uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
6526b85e-aecb-4cf2-afc2-f51cd9468dd6 | Mulab11/cntt2016-hw1 | TC-SRM-590-div1-500/oysq.cpp | #line 2 "XorCards.cpp"
#include <bits/stdc++.h>
using namespace std;
#define ui unsigned
#define ll long long
#define pii std::pair<int,int>
#define mp std::make_pair
#define fi first
#define se second
#define SZ(x) (int)(x).size()
#define pb push_back
template<class T>inline void chkmax(T &x, const T &y) {if... | ALGO | 0.99998 | 4.40698 |
1b79a48d-1699-4b6b-8636-453ec7755cdd | Harshkumar77/Data-Structure-Algorithm-cpp | 27-binary-tree/18_shortest_distance_bw_2_nodes.cpp | /**
Program to find distance between two nodes of a binary tree
Time Complexity -> O(N)
Space Complexity -> O(N)
**/
#include <iostream>
#include <vector>
using namespace std;
struct node
{
int data;
node *left = NULL;
node *right = NULL;
node(int val)
{
data = val;
}
};
int dist... | ALGO | 0.999991 | 6.435892 |
2ee61203-3d39-4ed9-8667-76f9d5e550ad | OranyPortilho/Sexta-feira | Programação/Estrategia.cpp | #include<robo_hardware2.h>
#include "Movimento.h"
#include"Estrategia.h"
#include "Logica.h"
#define DIVISOR_BRANCO_PRETO 51
Movimento movimento;
Logica logica;
float BBBB;
float PPPP;
float PPBB;
float BBPP;
float BPBB;
float BBPB;
float PBBB;
float BBBP;
float PPPB;
float BPPP;
float BPPB;
float PBBP;
float BPBP;
... | ALGO | 0.925659 | 3.915586 |
428bb37c-4e01-4c3e-852f-14353edc8cb6 | leeguandong/sd_webui_powerpaint | mmcv/ops/csrc/pytorch/npu/box_iou_rotated_npu.cpp | #include "pytorch_npu_helper.hpp"
using namespace NPU_NAME_SPACE;
using namespace std;
void box_iou_rotated_impl(const Tensor boxes1, const Tensor boxes2, Tensor ious,
const int mode_flag, const bool aligned);
void box_iou_rotated_npu(const Tensor boxes1, const Tensor boxes2, Tensor ious,
... | ALGO | 0.930204 | 6.13001 |
7812c7d7-c0c2-46ff-b3b7-772c96494fea | ldf1999/Onnxruntime-DML | src/config.cpp | #include <iostream>
#include <string>
#include <direct.h>
#include <windows.h>
#include <fstream>
#include"sf-info.h"
#include"config-info.h"
static bool Parameter_Error = FALSE; //参数错误标识
static bool Print_Parameter_Debug = FALSE; //Debug打印参数控制开关 FALSE / TRUE
// ---------------------------------- tool -----------... | CONFIG | 0.924234 | 3.034485 |
c76b1985-54d4-4989-ade0-2ed1ed5cbc0c | biswass101/code_chef_solutions | Contesst/Div-3/116/ORST.cpp | #include <bits/stdc++.h>
#define OJ
#define ROCKET \
ios ::sync_with_stdio(false); \
cin.tie(nullptr); \
cout.tie(nullptr);
#define ll long long int
#define fr(x, s, e, b) for (ll x = s; x < e; x = x + b)
#define rfr(x, s, e, b) for (ll x = s; x >= e; x = x - b)
#define efr(va... | ALGO | 0.999915 | 3.874619 |
2985d1d8-734f-4c0a-b2cb-7980d0be019e | sujeetamberkar/DSA_PW_Skills | Pratice/Advanced_dataStructure/2_Stacks/3_Lecture/3_MinStack_LeetCode155/1_TimeComplexity_O_N_/code.cpp | #include <iostream>
#include <stack>
#include <climits>
using namespace std;
class MinStack {
public:
stack<int> st;
MinStack() {}
void push(int val) {
st.push(val);
}
void pop() {
st.pop();
}
int top() {
return st.top();
}
int getMin() {
stack<in... | ALGO | 0.991707 | 6.974073 |
68caa912-9733-4221-92ed-ad2e816195fb | MdFaizan7397/Strivers-SDE-Sheet-challenge | Perfect Arrays - GFG/perfect-arrays.cpp | //{ Driver Code Starts
//Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function Template for C++
class Solution{
public:
bool IsPerfect(int a[],int n)
{
for(int i=0;i<=n/2;i++){
if(a[i]!=a[n-i-1]){
return false;
... | ALGO | 0.994734 | 5.266213 |
29ff212a-5532-4bdc-95c2-9a3af80ac32d | Aditya5-tech/Numerical-Statastical-Computing | secant method.cpp | #include <iostream>
#include <cmath>
using namespace std;
double f(double x) {
return x * x - 4;
}
double secantMethod(double x0, double x1, double prec, int maxIter) {
double x2;
int iter = 0;
while (iter < maxIter) {
double f0 = f(x0);
double f1 = f(x1);
x2 = x1 - (f1 * (x1 - x... | ALGO | 0.999998 | 5.179168 |
b9679933-4526-40cc-8734-2bc8d6ee51a8 | ibensw/AOC24 | day2/part1.cpp | #include <algorithm>
#include <filesystem>
#include <fmt/format.h>
#include <fmt/ranges.h>
#include <fstream>
#include <ranges>
#include <vector>
std::vector<std::vector<int>> parseInput(const std::filesystem::path &path)
{
auto parseLine = [](const std::string &line) {
std::istringstream iss(line);
... | ALGO | 0.986815 | 6.057096 |
be78aea8-59f8-4504-9d0a-335431b736da | ImtiazAhmedAkash/Problem-Solving | lightoj/1111.cpp | /* In the Name of ALLAH, the most gracious, the most merciful */
// 1111 - Best Picnic Ever
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define nl '\n'
#define deb(x) cerr << #x << " = " << x << nl
const int inf = 1e9;
const ll INF = 1e18;
const int mod = 998244353;
const int N = 2e5 + 5;
... | ALGO | 0.99995 | 4.759964 |
edaf6546-ddd7-482b-aa91-e1d95ec00672 | Jets1127/Pathfinder | visualizer.cpp | #include <iostream>
#include <SFML/Graphics.hpp>
#include "grid.h"
#include "graph.h"
void draw_grid(Grid &g, sf::RenderWindow &);
int main()
{
sf::RenderWindow window(sf::VideoMode(1000, 1000), "Pathfinder ");
Grid g;
Graph t;
g.make_graph(t);
while (window.isOpen())
{
sf::Event event;
while (window.pol... | ALGO | 0.944209 | 3.955592 |
4b0ddb9c-6e1a-4628-8ee2-a7c2336525ea | open-vela/nuttx_libs_libxx_libcxx | test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan_op_init.pass.cpp | // UNSUPPORTED: c++03, c++11, c++14
// <numeric>
// Became constexpr in C++20
// template<class InputIterator, class OutputIterator, class T, class BinaryOperation>
// OutputIterator
// inclusive_scan(InputIterator first, InputIterator last,
// OutputIterator result,
// B... | TEST | 0.975172 | 7.343214 |
a0f5a315-7668-48ee-a0c5-379a264811a4 | sarasazevedo/FEUP_DA | Exercises/TP1/da2324_p01_student/TP1/ex3.cpp | #include "../data_structures/Graph.h"
#include "stack"
using namespace std;
// Helper function to reverse the edges of a directed graph
template <typename T>
void aux_reverseGraphEdges(Graph<T>* g) {
stack<int> edge_stack;
for (auto v : g->getVertexSet()) {
for (auto & e : v->getAdj()) {
au... | ALGO | 0.999942 | 5.725277 |
35dc0529-0ef6-442f-b17d-0b4e12c1d82f | balajiofficial/CompetitiveProgramming | Codeforces/750A.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
int main() {
int n, k;
cin >> n >> k;
int a = 240 -k, ans =0;
for(int i = 1; i <= n; ++i) {
if (a - 5 *i >= 0) {
a -= 5 * i;
++ans;
} else {
break;
}
}
cout << ans << "\n";
}
| ALGO | 0.998927 | 3.192089 |
af7c507a-78b1-44bf-bb46-9ebe0e50d31f | saurov2752/Algorithm-Competitive-Programming | SourceCode/BiColor/uva10004.cpp | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <ctype.h>
#include <string>
#include <sstream>
#include <iostream>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <list>
#include <algorithm>
using namespace std;
#define sf scanf
#define pf printf
#defi... | ALGO | 0.999582 | 5.041809 |
1cd810ce-5529-412a-88d9-1d03229a00e3 | prakashsellathurai/a-grim-loth | cpp/Arrays/kth-smallest-sum-subarray.cpp | // CPP program to find k-th smallest sum
#include "algorithm"
#include "iostream"
#include "vector"
using namespace std;
int CalculateRank(vector<int> prefix, int n, int x)
{
int cnt;
// Initially rank is 0.
int rank = 0;
int sumBeforeIthindex = 0;
for (int i = 0; i < n; ++i) {
// Calculating the count the su... | ALGO | 0.999985 | 5.263513 |
4f2c3689-086c-4d2b-b4a2-e462a3ba494f | VarunArora14/CPP-practice | college/matrix_multiply.cpp | // for matrices of size m*n and p*q the condition is n==p and the resulting matrix is m*q
#include "iostream"
using namespace std;
int main()
{
int a[100][100], b[100][100];
int m, n, p, q;
// input of first matrix
cin >> m >> n >> p >> q;
if (n != p)
{
cout << "the matrix does not satify the primary ... | ALGO | 0.999824 | 3.085554 |
43f20604-742e-4f67-8854-23cc8ea40e45 | MehulJain-831/LeetCode | house-robber/house-robber.cpp |
class Solution {
private:
vector<int> dp;
public:
int find_max(vector<int>& nums,int node){
if(dp[node] != -1){
return dp[node];
}
if(node == 0){
return dp[node] = nums[0];
}
if(node == 1){
return dp[node] = max(nums[0],nums[1]);
... | ALGO | 0.999947 | 5.904723 |
5f33fc0e-75a4-472f-ba76-acfd0d6627e3 | Abhinav5050649/ProblemSolving | pm.cpp | #include "bits/stdc++.h"
using namespace std;
typedef long long ll;
#define pb push_back
typedef vector<ll> vll;
typedef vector<int> vii;
const ll mod = 1e9 + 7;
const ll NE = 1e6 + 5;
const ll max_v_sz = 1e6 + 6;
void swap(ll &a, ll &b)
{
a ^= b; b ^= a; a ^= b;
}
// for simple a ^ b
ll bin_exp(ll a, ll b)
{
... | ALGO | 0.999932 | 3.857324 |
38224ee6-7d01-4ecb-bb38-b8839f9866e9 | luceinaltis/Algorithms | BOJ6068.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <cstring>
#include <algorithm>
#define MAX_V 52
using namespace std;
const int INF = 987654321;
int capacity[MAX_V][MAX_V], flow[MAX_V][MAX_V];
int networkFlow(int source, int sink)
{
memset(flow, 0, sizeof(flow));
int totalFlow = 0;
while(... | ALGO | 0.997934 | 4.27713 |
ba288632-3df3-44bb-9772-f1acb7fdfcb1 | Vishal35198/Data-Structures-And-Algorithms | stacks/Stack_Linked_List.cpp | #include<bits/stdc++.h>
using namespace std;
struct node
{
int data;
node* next;
};
node* head=NULL;
//we will insert the value to the the head
//as it is O(1)
void push(int x)
{
node* temp=new node();
temp->data=x;
temp->next=head;
head=temp;
}
void pop()
{
if(head==NULL)
{
cout<<"... | ALGO | 0.998584 | 4.08783 |
46896fc4-426a-4aeb-bb0f-7cb56c15ab13 | damianivanov/CS-SDP | Seminar/Bank/Bank.cpp | // Bank.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
#include <queue>
using namespace std;
int bank(queue<int> q){
int balance = 0;
int max_counter = 0;
q.push(INT_MIN);
bool next_it = true;
bool served_clients = true;
while (ne... | ALGO | 0.998735 | 4.444062 |
1302366e-bf6d-4328-ad5d-10dc94e258fc | Chandrabhushan-mishra01/Operating_System | Operating_system/cpu_scheduling/SJF.cpp | #include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
int main() {
int arrival_upper = 10;
int arrival_lower = 0;
int burst_upper = 10;
int burst_lower = 1;
int n;
cout << "\nEnter the number of processes: ";
cin >> n;
int *processes = new int[n];
int *arriv... | ALGO | 0.999907 | 4.354233 |
ee347bce-c642-4460-8e02-73317d90fb38 | summer-5/Milk-Gen | Milk/deps/eigen-3.4.0/unsupported/doc/examples/MatrixSinh.cpp | #include <unsupported/Eigen/MatrixFunctions>
#include <iostream>
using namespace Eigen;
int main()
{
MatrixXf A = MatrixXf::Random(3,3);
std::cout << "A = \n" << A << "\n\n";
MatrixXf sinhA = A.sinh();
std::cout << "sinh(A) = \n" << sinhA << "\n\n";
MatrixXf coshA = A.cosh();
std::cout << "cosh(A) = \n"... | ALGO | 0.980379 | 5.914005 |
97ef2636-19b8-410c-91bc-31f13b363a9b | BALL-Contrib/contrib_eigen_3.3.4 | doc/examples/TemplateKeyword_flexible.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace Eigen;
template <typename Derived1, typename Derived2>
void copyUpperTriangularPart(MatrixBase<Derived1>& dst, const MatrixBase<Derived2>& src)
{
/* Note the 'template' keywords in the following line! */
dst.template triangularView<Upper>() = src.template... | TOOL | 0.995212 | 5.804369 |
156a0b59-1378-4452-a25f-98c6c2ac9f72 | donivanev/Data-Structures-and-Algorithms | Problems/dllistOperations.cpp | #include <iostream>
using namespace std;
template <class T>
class DLListOperations
{
struct Node
{
T data;
Node* prev;
Node* next;
Node();
Node(T newData):data(newData), prev(nullptr), next(nullptr){}
};
private:
Node* first;
void copy(const DLListOperation... | ALGO | 0.982704 | 4.779411 |
5f81dcce-447d-4741-835a-781b613b0339 | AKD-01/DSA-LeetCode | 3335-total-characters-in-string-after-transformations-i/3335-total-characters-in-string-after-transformations-i.cpp | class Solution {
public:
int lengthAfterTransformations(string s, int t) {
vector<int> cnt(26);
for (char ch : s) {
++cnt[ch - 'a'];
}
for (int round = 0; round < t; ++round) {
vector<int> nxt(26);
nxt[0] = cnt[25];
nxt[1] = (cnt[25] + ... | ALGO | 0.999986 | 6.641885 |
af3d2de4-3203-4f7b-9a50-acde2aee0591 | Saamaaanthaa/SamanthaFork | thirdparty/oidn/core/transfer_function.cpp | #include "transfer_function.h"
namespace oidn {
const float LogTransferFunction::xScale = 1.f / log(LogTransferFunction::yMax + 1.f);
const float PQXTransferFunction::xScale = 1.f / PQXTransferFunction::pqxForward(PQXTransferFunction::yMax * PQXTransferFunction::yScale);
float AutoexposureNode::autoexposure(co... | ALGO | 0.928587 | 5.244251 |
8f0c6761-0446-420c-82da-dff298e93759 | Sajal-kanwal/animated-onboarding-loading-screen | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998733 | 6.76775 |
2c957ab1-6877-46ac-bbb5-5ad26065b70b | spygearsteven/nbis | misc/nistmeshlab/meshlab/src/meshlabplugins/filter_measure/filter_measure.cpp | #include <QtGui>
#include <math.h>
#include <stdlib.h>
#include <time.h>
#include <vcg/complex/trimesh/clean.h>
#include <vcg/complex/trimesh/inertia.h>
#include <vcg/complex/trimesh/stat.h>
#include <vcg/complex/trimesh/update/selection.h>
#include<vcg/complex/trimesh/append.h>
#include<vcg/simplex/face/pos.h>
#incl... | TOOL | 0.918941 | 6.060472 |
dadf83a0-9b71-4dc0-98d5-06e632e3766c | PaukIsUha/optimizing_formating_code | predictions/submissions-aizu-coop-gpt35/Codenet/p00473/854015258/response_8.cpp | #include <iostream>
using namespace std;
int main() {
const int INF = 1000000000;
int n, c;
static int prev[5002][2];
static int curr[5002][2];
for (int j = 0; j < 5002; j++) {
prev[j][0] = INF;
prev[j][1] = INF;
}
prev[1][0] = 0;
prev[0][1] = 0;
scanf("%d", &n);
for (int i = 2; i <= n; i... | ALGO | 0.999912 | 3.698071 |
2eaf93bf-e297-461d-aa9e-33b627aa2232 | Rylynnn/Arithmetic | Templates/Chaos/数学/Miller-rabin&&rho.cpp | bool test(int n,int a,int d)
{
if (n==2) return true;
if (n==a) return true;
if ((n&1)==0) return false;
while (!(d&1)) d=d>>1;
int t=pow_mod(a,d,n);
while ((d!=n-1)&&(t!=1)&&(t!=n-1))
{
t=(long long) t*t%n;
d=d<<1;
}
return(t==n-1||(d&1)==1);
}
bool isPrime(int n)
{
if (n<2) return false;
int a[3... | ALGO | 0.999757 | 3.551763 |
1232a800-e94c-4a1f-a7f0-5abfcb8f795b | JunBinLiang/Road-To-1900 | Codeforce/1700/1826D.cpp | #include <string>
#include <iostream>
#include <vector>
#include <queue>
#include <deque>
#include <algorithm>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <string.h>
using namespace std;
using ll = long long;
#define FOR(i, a, b) for (int i = a; i < b; ++i)
#define ve vec... | ALGO | 0.999606 | 3.773185 |
b52c24c4-f516-4fdf-9009-b5db5dd6142d | Misaka2298/Misaka2298_OI_Project | 比赛/洛谷/Algo Beat Contest 001/C - Creating a Queue.cpp | #include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6+10 , mod = 1145141923;
| TOOL | 0.993151 | 3.156168 |
bd14c97b-ee63-4a77-9814-23e424d53b93 | Mohammad-Ashikul-Islam/Competitive_Programming | UVA/UVA_10222_Decode_the_Mad_man.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
char s[10000];
gets(s);
int i,j;
char s1[]= "ertyuiop[]dfghjkl;'cvbnm,. ";
char s2[] = "qwertyuiopasdfghjklzxcvbnm ";
for(i=0; i<strlen(s); i++){
for(j=0; j<strlen(s1); j++){
if(s[i] == s1[j])
cout... | ALGO | 0.999335 | 3.449625 |
b63a2ebf-54f4-4a20-8ef4-10ded09f26ac | kaybb12/Study | ssafy_imbedded/algo_worksapce/1018/minco_samsung_16.cpp | #include <iostream>
#include <vector>
#include <array>
#include <algorithm>
using namespace std;
using Point = pair<int, int>;
using MAP = vector<vector<int>>;
static array<Point, 2> dir_g{ {
{0, 1}, {1, 1}
} };
static array<Point, 2> dir_s{ {
{1, 0}, {1, 1}
} };
static array<Point, 3> dir_d{ {
{0, 1}, {1, 0}, ... | ALGO | 0.99971 | 5.269793 |
b7570cb6-daf3-41e9-8e58-781753c97165 | sharmakavya7/Codeforces_solutions | C_Ice_and_Fire.cpp |
#include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <ctime>
#include <sstream>
#include <string>
#include <map>
#include <climits>
#include <iterator>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <f... | ALGO | 0.999825 | 3.650366 |
117016d7-9d29-4135-94be-87dc6d59b780 | dylanchew2020/cpp_project | cpp02/ex03/bsp.cpp | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* bsp.cpp :+: :+: :+: ... | ALGO | 0.998689 | 5.583508 |
66df9b31-ed07-473c-bf71-6841f67fe12f | RicardoJavierH/ErrorEstimationForH1 | ErrorEstimation/Projects/MHM_Maze/main_Maze_Steklov.cpp | #ifdef HAVE_CONFIG_H
#include <pz_config.h>
#endif
#include <iostream>
#include "pzvec.h"
#include "pzstack.h"
#include "pzfmatrix.h"
#include "pzlog.h"
#include "pzreal.h"
#include "pzgmesh.h"
#include "pzcmesh.h"
#include "pzcompel.h"
#include "pzgeoelside.h"
#include "tpzgeoelrefpattern.h"
#include "tpzautopointer.... | ALGO | 0.992282 | 3.396244 |
28813e57-0030-4964-9fb7-144b8b3ecce6 | moonmehedi/Programming-Problems | dsa programmes/1-20/15_1.cpp | #include<bits/stdc++.h>
using namespace std;
/*this code prints all the prime factorisation of a number*/
void prime_factorisation(int arr[],int n){
/*initializing with index value*/
for(int i=2;i<=n;i++){
arr[i]=i;
}
/*store small prime factor*/
for(int i=2;i*i<=n;i++){
if(arr[i]==i... | ALGO | 0.999856 | 3.703506 |
5d9ef4e9-5121-4135-90c6-ec5277ce8542 | artilugio0/competitive-programming-problems | codeforces_2057B.cpp | // this solution does not work
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
int t;
cin >> t;
while (t--) {
vector<long long> aa;
map<long long, long long> counts;
int n, k;
cin >> n;
cin >> k;
long long a;
for (long long i = 0;... | ALGO | 0.999919 | 3.9048 |
34d63e61-2482-4ebc-ab55-ea9678c229d1 | Alexs06/Estructuraas | GrafoMatriz.cpp | #include "GrafoMatriz.h"
#include <string>
using namespace std;
GrafoMatriz::GrafoMatriz(int size){
ultimo = -1;
cantidadVertices = 0;
cantidadAristas = 0;
matriz = new Arista*[size];
for(int i = 0 ; i < size; ++i)
matriz[i] = new Arista[size];
vectorEtiquetas = new string[size];
vectorAdy = new int[size];
M... | ALGO | 0.967973 | 4.018473 |
4ee86ec6-935a-4d83-b954-d2f79d367b90 | ImperishableMe/codeforces-submissions | codeforces/288/C.cpp | /// HK 108 Times
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>
using namespace __gnu_pbds;
using namespace __gnu_cxx;
using namespace std ;
#define ll long long
#define pb push_back
typedef pair <int,int> PII ;
... | ALGO | 0.999994 | 3.412418 |
b3e76015-657c-4041-a7b8-4e73d1863445 | anshulgarg19/code-beans | cc/PouringWater.cpp | /*
** https://www.codechef.com/problems/POUR1
*/
#include<bits/stdc++.h>
using namespace std;
#define gi(x) scanf("%d",&x)
int min(int a ,int b){
if( a < b )
return a;
return b;
}
int main(void){
int t,a,b,c;
gi(t);
while(t--){
gi(a);
gi(b);
gi(c);
if( a < c && b < c )
cout<<"-1\n";
else if( a==... | ALGO | 0.999928 | 3.590511 |
3793d046-722c-49b1-be16-b96934ce3251 | qiaozishun4/CSP2024_BJ | BJ-Junior/answers/BJ-J01878/explore/explore.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
freopen("explpre.in","r",stdin);
freopen("explore.out","w",stdout);
int T;
int dan[6]={0,0,0,0,0,0};
cin>>T;
for(int sy=0;sy<T;sy++){
int x,y,d,n,m,k;
cin>>n>>m>>k;
cin>>x>>y>>d;
char a[2005][2005];
for(int i=0;i<n;i++){
for(int j=0;j... | ALGO | 0.999831 | 3.60872 |
348c9bfa-fb3f-4374-94ba-a49f297734aa | gittushR/DSA | 0437-path-sum-iii/0437-path-sum-iii.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999962 | 5.993861 |
ad8f81b5-a78d-4489-972c-9f47aef04bea | diyasoor/Striver-SDE-Sheet-Challenge | Day-18/K Most Frequent Elements.cpp | #include<unordered_map>
#include<algorithm>
bool cmp(pair<int,int> a, pair<int,int> b) {
return a.second > b.second;
}
vector<int> KMostFrequent(int n, int k, vector<int> &arr)
{
// Write your code here.
unordered_map<int,int> map;
for(auto x:arr) map[x]++;
vector<pair<int,int>> vec;
for(auto m:... | ALGO | 0.999997 | 5.105639 |
3440765c-3c6e-4d05-bef3-18a57a8402d4 | yoshi-self/codeforces | solutions/4A.cpp | #include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cctype>
#include <climits>
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <string>
#include <sstream>
#include <vector>
#include <map>
#include <set>
#include <complex>
#include <functional>
#include <utility>
#include <iterator>
#de... | ALGO | 0.999735 | 3.575904 |
48d16722-d3e5-40d5-9dae-db584b6959e8 | fenychn0206/OI-Codes | AtCoder/abc395/A_Strictly_Increasing.cpp | #include <bits/stdc++.h>
#define lo long long
#define INF INT_MAX
#define LLM LONG_LONG_MAX
#define endl "\n"
using namespace std;
/*
toothless. #17
@fredcss_dev
*/
int n, a[1000005], b[1000005];
bool f[100000005];
signed main()
{
cin >> n;
for (int i = 1; i <= n; i++) {
cin >> a[i];
... | ALGO | 0.999998 | 4.341076 |
91e7b41b-673d-4ec6-a05f-117e497e3f4e | whosxavierwu/LeetCodeSolution | leetcode_980/leetcode_980.cpp | // leetcode_980.cpp : This file contains the 'main' function. Program execution begins and ends there.
// https://leetcode.com/problems/unique-paths-iii/
/*
On a 2-dimensional grid, there are 4 types of squares:
1 represents the starting square. There is exactly one starting square.
2 represents the ending square. T... | ALGO | 0.999822 | 5.344793 |
c490597d-f770-4bee-98bc-c51180a46af8 | kew7/Cpp-Templates-The-Complete-Guide-2th_ed | debugging/tracertest.cpp | #include <iostream>
#include <algorithm>
#include "tracer.hpp"
int main()
{
// prepare sample input:
SortTracer input[] = { 7, 3, 5, 6, 4, 2, 0, 1, 9, 8 };
// print initial values:
for (int i=0; i<10; ++i) {
std::cerr << input[i].val() << ' ';
}
std::cerr << '\n';
// remember init... | ALGO | 0.998619 | 5.134456 |
5b9455ca-08f9-4e64-92f8-aca108b2cf05 | ANUJ0MUNJAL/LeetCode-POTD | 719-find-k-th-smallest-pair-distance/find-k-th-smallest-pair-distance.cpp | class Solution {
public:
int find(vector<int>&nums,int val,int k)
{
int count=0;
for(int i=1;i<nums.size();i++)
{
int value=nums[i]-val;
int index=lower_bound(nums.begin(),nums.end(),value)-nums.begin();
count+=(i-in... | ALGO | 0.999998 | 5.527686 |
63607c79-91f3-48cf-9737-99cd374058fd | raincross7/code-similarity | codes/train_code/problem313/problem313_306.cpp | #include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
using ll = long long;
struct UnionFind
{
vi p,r;
UnionFind(int n){
p.resize(n, -1);
r.resize(n,1);
}
int find(int x){
if(p[x] == -1)return x;
else return p[x] = find(p[x]);
}
void unite(int x, int y){
x = find(x);
... | ALGO | 0.999959 | 4.184558 |
c172b0d8-b0f7-43a6-957c-40838574f4c7 | Dawoodsarfraz/CS2001-Data-Structures | hash/quadraticProbing.cpp | /*
Author : Fakhra Najm<<EMAIL>>
Hash table implementataion : Quadratic Probing
*/
#include<iostream>
using namespace std;
class HashMap{
private:
int *Arr;
int size;
public :
HashMap(){}
void create(int size);
void update(int val);
int find(int val);
int probe(int val);
int hashvalue(int val);
void read(... | ALGO | 0.999682 | 4.492352 |
b859c868-e6c1-476b-83d8-d158cc1753bd | satyam15/Coding | CODECHEF/woc_5.cpp | #include <bits/stdc++.h>
using namespace std;
#define ld double
#define ll long long
#define pb push_back
#define mk make_pair
#define mod 1000000007
#define ff first
#define ss second
#define FIO ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define all(x) x.begin(),x.end()
int main(void)
{
FIO
in... | ALGO | 0.999956 | 3.616484 |
b2611d2f-bd62-4be1-8611-57e8e24ed57f | Kibria2002/XPSC_Weekly_Practice | Week 02 Day 01/Colourblindness.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
int t; cin >> t;
while(t--) {
int n; cin >> n;
string s, t; cin >> s >> t;
bool flag = true;
for (int i = 0; i < n; i++) {
if (s[i] == 'R... | ALGO | 0.999935 | 4.412357 |
b621a523-2fba-4ed2-ab0a-f9643a8817c6 | DavidChicharro/Fundamentos-de-Programacion | Sesión 12/12 - Elimina bloque caracteres - Ineficiente.cpp | /*
Alumno: David Carrasco Chicharro
Grado en Ingeniería Informática
Asignatura: Fundamentos de la Programación
Curso: 1º Grupo: C Subgrupo: C1
Profesor Teoría: Juan Carlos Cubero
Proferosa Prácticas: María del Carmen Pegalajar
Sesión 12
Ejercicio 12 - Elimina un bloque de caracteres. Versión ineficiente
Sobre la cl... | ALGO | 0.99492 | 3.785244 |
252a2b0c-9993-4682-b483-76e1ba99b60a | Unakepro/number_classificator | eigen-3.3.9/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_colwise.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace std;
int main()
{
Eigen::MatrixXf mat(2,4);
mat << 1, 2, 6, 9,
3, 1, 7, 2;
std::cout << "Column's maximum: " << std::endl
<< mat.colwise().maxCoeff() << std::endl;
}
| ALGO | 0.999542 | 3.779679 |
d44cf494-e6b1-437b-85c0-c1cd8431a300 | jahanzaib-ahsan/DSA | beginInsertLinkedList.cpp | #include <iostream>
using namespace std;
struct node
{
int data;
struct node *link;
};
struct node *head = nullptr;
void insertatbegining()
{
node *ptr;
int item;
ptr = new node;
if (ptr == nullptr)
{
cout << "Overflow";
}
else
{
cout << "Enter item : ";
c... | ALGO | 0.994118 | 3.61944 |
2c5aadf5-47c7-4b8e-9fdf-b1fff7157ca1 | SirjanSingh/CP-CF | cpp/B_AB_Flipping.cpp | #include <bits/stdc++.h>
using namespace std;
#define f(i, x, y) for (int i = x; i < y; i++)
#define fr(i, x, y) for (int i = x; i > y; i--)
#define int long long
#define yes cout << "YES\n"
#define no cout << "NO\n"
#define all(vector) vector.begin(), vector.end()
#define nl cout << "\n"
#define x first
#define y sec... | ALGO | 0.999633 | 4.840277 |
c6ee3565-88d4-45cf-a909-5fd12af29141 | ishandutta2007/codeforces | krk/normal/1671/E.cpp | #include <bits/stdc++.h>
using namespace std;
const int Maxn = 1 << 18;
const int mod = 998244353;
int n;
char str[Maxn + 5];
string my[Maxn + 5];
int res = 1;
void Solve(int v)
{
if (v * 2 >= 1 << n) {
my[v] = str[v];
return;
}
int lc = 2 * v, rc = 2 * v + 1;
Solve(lc);
Solve(rc)... | ALGO | 0.999995 | 4.808324 |
c2c8a048-3896-4503-af06-566271f20d99 | xwolalala/- | 第二周作业/Torry的困惑.cpp | #include <iostream>
using namespace std;
int main ()
{
int n,sum=1,flag,num=0;
cin>>n;
for(int i=2;num<n;i++)
{
flag=0;
for(int j=2;j<i;j++)
{
if(i%j==0)
{
flag=1;
continue;
}
}
if(flag==0)
{
num++;
sum=sum*i;
}
}
cout<<sum%50000;
return 0;
}
| ALGO | 0.999939 | 3.370807 |
999c1c82-e44f-4a41-879c-affbb244d148 | AnushkaPhogat16/DSA_trees | 735-asteroid-collision/asteroid-collision.cpp | class Solution {
public:
vector<int> asteroidCollision(vector<int>& ast) {
stack<int> st;
//push if +ve ie going right
//if going left compare with top and pop until lesser or opposite
//if left and stack empty add to result;
vector<int> ans;
for(int i = 0;... | ALGO | 0.999975 | 5.752354 |
a8851591-d64c-42ac-a8a0-c237445f5a46 | raincross7/code-similarity | codes/train_code/problem465/problem465_282.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef pair<int, int> pii;
int X, Y;
bool D[20202];
char str[10101];
vector<int> XM, YM, V;
int main(){
scanf("%s", str+1);
scanf("%d %d", &X, &Y);
int cnt=0, xy=1;
for (int i=1; str[i]; i++){
if (str[i] == 'F') cnt++;
... | ALGO | 0.999989 | 3.623163 |
f2c6f092-8425-4c8e-84b0-c369856e74fc | EyeEyeloving/Ergodicity-Metric | src/FOURIERBasis.cpp | #include "FOURIERBasis.h"
#include "cdef_value.h"
#include "cdef_function.h"
#include <cmath>
#include <algorithm>
#include <functional>
#include <numeric>
#include <boost/math/quadrature/trapezoidal.hpp>
FOURIERBasis::FOURIERBasis()
: domainUX(0), domainUZ(0), agents_sampling_numberlong(0), agents_sampling_timglong... | ALGO | 0.995867 | 3.941063 |
980b77d0-710c-4977-be83-c3c0fff13bb2 | mostafa-cse/Most-Used-Templates-from-Various-Sources | Math/Determinant of Sparse Matrix.cpp | #include<bits/stdc++.h>
using namespace std;
const int N = 3e5 + 9, mod = 998244353;
template <int32_t MOD>
struct modint {
int32_t value;
modint() = default;
modint(int32_t value_) : value(value_) {}
inline modint<MOD> operator + (modint<MOD> other) const { int32_t c = this->value + other.value; return modin... | ALGO | 0.999954 | 4.554368 |
d8ced6f0-ecca-4bc7-89ae-405f155d2176 | hxuhack/BiOpq | lib/Transforms/Scalar/SampleProfile.cpp | #include "llvm/Transforms/Scalar.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallSet.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/Analysis/PostDominators.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DebugInfo.h"
#include "llvm/I... | TOOL | 0.922704 | 7.581687 |
eccf9d7d-ea60-4600-a3b8-d26881df4da0 | aspect-ux/CppDaydaydream | Algorithms/02 Path Finding/main.cpp | #include <iostream>
#include <math.h>
#include <queue>
#include <vector>
#include <unordered_set>
std::vector<int> start = { 2, 8, 3,1, 6, 4,7, 0, 5 };
int final[9] = { 1, 2, 3,8, 0, 4, 7, 6, 5 };
int HType = -1;
int dir[4][2] = { {1,0},{0,1},{-1,0},{0,-1} };//下右上左
// 优先队列排序规则
//struct cmp1 {
// bool operator()(const... | ALGO | 0.999875 | 3.653867 |
4d5c319d-4d14-446e-99b2-9ecab812e200 | marcavenzaid/algorithms-practice | sphere_online_judge_PIHU1_love_story_1.cpp | /**
* author: marcavenzaid
* created: 2018-07-06-00.34
*/
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int t;
cin >> t;
for (int i = 0; i < t; ++i) {
int n;
cin >> n;
unsigned int a[n] = {0};
for (int j = 0;... | ALGO | 0.999435 | 4.213561 |
ffc00ced-24df-4ca2-a3e1-15c9513a0fc5 | yangyang861115/Introduction_to_Computing-C-_by_PekingUniversity- | week7-5.cpp | #include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
int i =0;
int j =0;
int a[n][n];
for(i=0; i<n; i++){
for(j=0;j<n;j++){
cin >> a[i][j];
}
}
int count = 0;
for(i=1; i<n-1; i++){
for(j=1; j<n-1; j++){
if((a[i-1][j]-a[i][j]>=50)&&(a[i+1][j]-a[i][j]>=50)&&(a[i][j-1]-a[i][j]>=... | ALGO | 0.999914 | 3.628889 |
c70eb980-5f5d-49e0-a5c1-8eeb09afa843 | Mrtriste/Learning-Algorithms | HDU/HDU/2717.cpp | #include <iostream>
#include <queue>
using namespace std;
bool a[100010];
int n, k;
struct Node{
int x, d;
bool operator<(const Node& node)const{
return d > node.d;
}
};
bool judge(int x){
if (x<0 || x>100000 || a[x])return true;
return false;
}
int BFS(){
Node cur, next;
cur.x = n, cur.d = 0;
queue<Node>... | ALGO | 0.999894 | 3.882777 |
bbe311e8-0776-49fd-91c6-d2febf98bb7e | FengBli/leetcode | 330.按要求补齐数组.cpp | /*
* @lc app=leetcode.cn id=330 lang=cpp
*
* [330] 按要求补齐数组
*/
#pragma GCC optimize("Ofast")
#define DBG_MACRO_NO_WARNING
#include <iostream>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <climits>
#include <algorithm>
#include <sstream>
#ifdef LOCAL
#include "dbg.h"
#endif
#define fr(... | ALGO | 0.999889 | 6.491122 |
2519b21c-51d7-4659-8250-4f3d49da8369 | phScholz/SAPPHIRE | src/GammaStrength/KopeckyUhlGSF.cpp | #include "GammaStrength/KopeckyUhlGSF.h"
#include <iostream>
KopeckyUhlGSF::KopeckyUhlGSF(int z2, int m2, double jInitial, int piInitial,
double jFinal, int piFinal, double maxL,
double totalWidthForCorrection,
double uncorrTotalWidthForCorrection,
double uncorrTotalWidthSqrdForCorrect... | ALGO | 0.987087 | 4.873473 |
0e0f1662-a7c0-43b9-b518-aecf495d4c86 | ankitgarg503/Revision-Programs-DSA | LL_circular_split.cpp | #include<iostream>
#include<stdlib.h>
using namespace std;
struct Node{
int data;
struct Node *next;
};
void splitList(Node *head, Node **head1_ref, Node **head2_ref)
{
Node* slow=head;
Node* fast=head->next;
Node* temp3=NULL;
Node* temp4=NULL;
Node* ptr=head;
while( fast!=he... | ALGO | 0.999668 | 3.786008 |
fda65f31-e9ce-415a-b338-3d3b0ca34804 | maryskar/spbspu-labs-2023-tp-904-a | gulkov.mikhail/T2/main.cpp | #include <algorithm>
#include <iostream>
#include <iterator>
#include <limits>
#include <list>
#include "dataStruct.hpp"
int main()
{
using namespace gulkov;
using input_iterator = std::istream_iterator< DataStruct >;
using output_iterator = std::ostream_iterator< DataStruct >;
std::list< DataStruct > res_lis... | ALGO | 0.992572 | 4.960341 |
44ca3977-a76c-4839-8c1d-56f2e897c2a2 | pspiyush52/cpp | practice/modulo.cpp | #include "print.h"
// Requires two modulo operations
bool isEquivalent_n(int a, int b, int n) {
return ((a % n) == (b % n));
}
// Requires one modulo operation
bool isEquivalent(int a, int b, int n) {
return (((a - b) % n) == 0);
}
int main(void)
{
int a = 7;
int b = 3;
int n = 2;
std::cout <... | ALGO | 0.986403 | 5.483451 |
ca5a52a9-f814-4e26-914a-8b2d4f13d68a | wolches/cpp-algos | 02_binary_ternary_two_pointers/h_place_for_meeting_v2.cpp | #include <bits/stdc++.h>
using namespace std;
double len(double start, double target) {
return abs(start - target);
}
double calcTimeSingle(double start, double target, double v) {
return len(start, target) / v;
}
double calcMaxTime(const vector<pair<double, double>>& xv, double target) {
double maxTime... | ALGO | 0.999982 | 5.076019 |
b6468605-660d-493d-b603-b0c859ce8311 | AvadheshChamola/LeetCode | 1178_Number_of_Valid_Words_for_Each_Puzzle.cpp | /*
1178. Number of Valid Words for Each Puzzle
Hard
With respect to a given puzzle string, a word is valid if both the following conditions are satisfied:
word contains the first letter of puzzle.
For each letter in word, that letter is in puzzle.
For example, if the puzzle is "abcdefg", then valid word... | ALGO | 0.999871 | 6.638506 |
d641e00a-f4f5-434a-9e2a-a73398fb70d9 | hyun98/Project_AlgoStudy | study/2021.03-2021.04/team2/Week02/BOJ_10971_류지환.cpp | #include <bits/stdc++.h>
using namespace std;
vector<int> picked;
vector<vector<int>> vvcost;
int N, data, cost, total, p_now, p_next, ans = numeric_limits<int>::max();
bool trip;
void input(){
cin >> N;
vvcost.resize(N);
for(auto& vc: vvcost) vc.resize(N);
for(int i=0; i<N; i++){
... | ALGO | 0.999905 | 3.744528 |
5883be01-c961-4d1a-8a6c-d819c3703a2c | CyberKun/cp | 1000/olya_and_game_with_arrays.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
int t;
cin >> t;
while (t--)
{
int n;
cin >> n;
vector<vector<int>> vec(n);
int m[n];
for (int i = 0; i < n; i++)
{
cin >> m[i];
vec[i... | ALGO | 0.999962 | 3.506521 |
bde1a276-26e2-4a9d-9194-98ed1906e31e | wvu-navLab/ICE | 3rdparty/RobustGNSS/gtsam/gtsam/3rdparty/Eigen/demos/mandelbrot/mandelbrot.cpp | #include "mandelbrot.h"
#include <iostream>
#include<QtGui/QPainter>
#include<QtGui/QImage>
#include<QtGui/QMouseEvent>
#include<QtCore/QTime>
void MandelbrotWidget::resizeEvent(QResizeEvent *)
{
if(size < width() * height())
{
std::cout << "reallocate buffer" << std::endl;
size = width() * height();
i... | ALGO | 0.942804 | 5.796075 |
8c7e29fb-a74e-48b1-8d34-41f634929431 | ishandutta2007/codeforces | pavelkunyavskiy/normal/264/D.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <set>
#include <map>
#include <cstring>
#include <string>
#include <cmath>
#include <cassert>
#include <ctime>
#include <algorithm>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <cstdlib>
#include <cstdio>
#include <iterator... | ALGO | 0.999863 | 3.611603 |
1805f0f9-3a72-44b8-81b6-ca739b6580cc | xowns0302/coding_test_practice | 1003f.cpp | //1003번이 시간이 너무 오래걸려서 빠른 버전
//dp썼음
#include <iostream>
#include <vector>
using namespace std;
vector<int> dpz(41, 0);
vector<int> dpo(41, 0);
int main(){
cin.tie(0)->sync_with_stdio(0);
int T;
cin>>T;
dpz[0] = 1, dpz[1] = 0;
dpo[0] = 0, dpo[1] = 1;
for(int i=2;i<41;i++){
dpz[i]=dp... | ALGO | 0.999935 | 4.018583 |
fd4574d2-219e-49fe-b96a-b794a2edf4ba | TusharChauhan09/DSA-cpp | Linked List/Circular Linked list/Circular_Linked_List_Triversal.cpp | #include<iostream>
using namespace std;
class Node{
public:
int data;
Node* next;
Node(int data1){
data = data1;
next = nullptr;
}
};
class CircularLinkedList{
public:
Node* head;
CircularLinkedList(){
head=nullptr;
}
void InsertionAtTail(int data){ ... | ALGO | 0.998893 | 5.238612 |
1f8b4ab8-ea2d-41b6-b986-3b89f5be7fac | kaloronahuang/KaloronaCodebase | Practices/Codeforces/CF1242B.cpp | // CF1242B.cpp
#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 1e5 + 200;
int n, m;
set<int> st;
set<int>::iterator it;
map<int, bool> mp[MAX_N];
void dfs(int u)
{
st.erase(st.find(u));
int last = 0;
while (!st.empty())
{
it = st.upper_bound(last);
if (it == st.end())... | ALGO | 0.999514 | 4.357566 |
46bce1e8-a186-4742-a5ff-37e70ff47699 | gzgreg/ACM | 2017adventofcode/21/21.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef vector<int> vi;
vector<string> startPattern = {".#.", "..#", "###"};
vector<string> rotate(vector<string> in) {
vector<string> out (in.size(), string(in.size(), 'a'));
for(int i = 0; i < ... | ALGO | 0.998959 | 3.98781 |
03b5cc42-d72c-46fa-b736-9a5bc0785040 | abdullahalkafi-dev/code-for-career | December_2024/D4M12Y2024/Problem1.cpp | // Problem Statement
// You will be given two strings S and X. You need to replace all X from string S with a '#' sign.
// Input Format
// First line will contain T, the number of test cases.
// Next T lines will contain a line with S and X.
// Constraints
// 1 <= T <= 1000
// 1 <= |S|, |X| <= 1000
// |X| <= |S|
//... | ALGO | 0.999918 | 4.959828 |
1899e403-080a-43b3-9eef-26d5a54ce046 | raincross7/code-similarity | codes/train_code/problem462/problem462_140.cpp | #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ALL(a) (a).begin(),(a).end()
int main(){
int N, A;
cin >> N;
cin >> A;
cout << (N * N - A) << endl;
} | ALGO | 0.998765 | 3.338404 |
12c46828-5da5-4ea3-a8f0-21f482ca8b65 | Hausdorffcode/leetcode_cpp | Implement strStr().cpp | //https://leetcode.com/problems/implement-strstr/#/description
//time O(n), space O(1)
class Solution {
public:
int strStr(string haystack, string needle) {
if (needle.size() == 0) return 0;
int len = haystack.size() - needle.size();
for (int i = 0; i <= len; i++) {
bool ok = tr... | ALGO | 0.99964 | 5.908989 |
781f6e9a-7922-4395-bc3a-14357dc64f18 | Taufique-07/Cpp | Infix to Prefix.cpp | #include<iostream>
#include<stack>
#include<algorithm>
using namespace std;
int precedence(char c) {
if (c == '^') {
return 3;
}
else if (c == '*' || c == '/') {
return 2;
}
else if (c == '+' || c == '-') {
return 1;
}
else {
return -1;
}
}
string Postf... | ALGO | 0.999862 | 4.770724 |
98004e9c-3f67-4d60-b2f7-b2f841e1807f | Official-Krish/CodersArena | apps/problems/Neon_Number/boilerplate-full/function.cpp |
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <numeric>
##USER_CODE_HERE##
int main(){
std::cin >> num1;
int result = (num1);
std::cout << result << std::endl;
return 0;
... | ALGO | 0.988975 | 4.089592 |
57ccb529-852d-4d33-8190-9b5ff5edb331 | Tatious/VisionFinalProject | src/filter_image.cpp | #include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <assert.h>
#include "image.h"
#define M_PI 3.14159265358979323846
void Image::l1_normalize(void) { ::l1_normalize(*this); }
void l1_normalize(Image& im)
{
float sum = 0;
for (int k = 0; k < im.c; k++) {
for (int j =... | TOOL | 0.976456 | 5.34176 |
be7f7297-b51f-4a12-b792-d519cddca125 | ParasWaghela07/DSA-SUPREME-2.0 | (WEEK 7) RECURSION/basic_qst/2^n.cpp | #include<bits/stdc++.h>
using namespace std;
int PowerOfTwo(int n){
if(n==1){
return 2;
}
return 2*PowerOfTwo(n-1);
}
int main(){
int num=3;
cout<<PowerOfTwo(num)<<endl;
} | ALGO | 0.999725 | 5.257987 |
59730fc0-9278-4368-8148-c961005329df | lthakur007/Camera_Based_Feature_Tracking | src/matching2D_Student.cpp | #include <numeric>
#include "matching2D.hpp"
using namespace std;
// Find best matches for keypoints in two camera images based on several matching methods
void matchDescriptors(std::vector<cv::KeyPoint> &kPtsSource, std::vector<cv::KeyPoint> &kPtsRef, cv::Mat &descSource, cv::Mat &descRef,
std:... | ALGO | 0.997944 | 6.365302 |
302a5b48-6b88-4391-96e0-e46d98e779b9 | vaibhav20031/C-DSA- | simpson.cpp | #include<bits/stdc++.h>
using namespace std ;
#define f(x) 1/(1+pow(x,2))
int main(){
cout<<"simpson 1/3 \n";
float a ,b,n,h;
cout<<"enter lower and upper limit ";
cin>>a>>b ;
cout<<"enter intervals and step size ";
cin>>n>>h;
float k=a;
float ans =f(a)+f(b);
for(int i=1;i<n;i++){
... | ALGO | 0.999957 | 3.94455 |
1055b734-459b-4599-90ac-51ee6912f9ca | sashedher/codec | Leetcode/Cpp_Leet/46.Permutations.cpp | // https://leetcode.com/problems/permutations/
#include<bits/stdc++.h>
using namespace std;
class Solution {
public:
vector<vector<int>> res;
void Backtrack(vector<int> &nums,int index){
if( nums.size()==index ){
res.push_back(nums);
}
else{
for... | ALGO | 0.999987 | 6.380394 |
f4bfe305-ef5b-447c-8d58-510a0142b4ce | thsdmfwns/backjoon | 18111번 - 마인크래프트/마인크래프트.cpp | /* ************************************************************************** */
/* */
/* ::: ::: ::: */
/* Problem Number: 18111 :+: :+: :+: ... | ALGO | 0.999793 | 3.739276 |
9d43df7d-0b50-4637-90d0-3c7a3b02977b | lsh0805/BOJ | solved/BOJ1111.cpp | #include <bits/stdc++.h>
using namespace std;
#define mp make_pair
#define pb push_back
#define fi first
#define se second
typedef long long ll;
typedef vector<int> vi;
int N, S, arr[51], ans, flag;
bool check(int a, int b){
for(int i = 1; i < N; i++)
if(arr[i] != arr[i - 1] * a + b)
return ... | ALGO | 0.999896 | 4.085582 |
12924878-eeb8-4ab8-b7b2-d5a11a57f302 | nobushi95/atcoder-archive-cpp | contest_cpp/abc274/C.cpp | #include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using ll = long long;
const ll infl = 1LL << 60;
const int inf = INT_MAX / 2;
#define REP(i, left, right) for (ll i = left; i < right; i++)
#define RREP(i, right, left) for (ll i = right; i >= left; i--)
#define REPEQ(i, left,... | ALGO | 0.999939 | 3.642709 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.