uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
acb39b5e-b419-427f-a97b-e5483ca6b02b | eaallen/learn_cpp | linked_list/main.cpp | #include <cstdio>
struct IntNode {
const int TAG{321};
int value{};
IntNode* next_ptr{nullptr};
IntNode* prev_ptr{nullptr};
IntNode(int val, IntNode* node_ptr) {
value = val;
next_ptr = node_ptr;
}
void insert(IntNode* node_ptr) {
if (this->next_ptr != nullptr) {
... | ALGO | 0.992171 | 4.884652 |
3c32a0ab-f747-44f3-addf-e30bd89cf210 | Tanyapurwar2004/Codeforces | level1/doors.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
vector<pair<int,int>>arr;
for(int i=0;i<n;i++){
int first,second;
cin>>first>>second;
arr.push_back({first,second});
}
int c1=0,c0=0,c2=0,c3=0;
for(int i=0;i<n;i++){
if(arr[i].first==1){... | ALGO | 0.999984 | 3.9392 |
b7147c02-6aa7-4251-8c0a-5f83ec9cd504 | tangodown1934/Algorithm-judge | source/bhd/1866051_TLE.cpp | #include <iostream>
using namespace std;
class Stack {
public:
int data[80001];
int top;
Stack()
{
top = -1;
}
void push(int val)
{
data[++top] = val;
}
int pop()
{
if (isEmpty())
{
return -1;
}
return data[top--];
}
bool isEmpty()
{
return top == -1;
}
int getSize()
{
return ... | ALGO | 0.999769 | 3.974969 |
4283555e-eea7-4017-9bff-b2e09390a385 | manhhung2111/LeetcodeGrind | Day 027/Problem 2965. Find Missing and Repeated Values.cpp | class Solution {
public:
vector<int> findMissingAndRepeatedValues(vector<vector<int>>& grid) {
int n = grid.size() * grid.size();
vector<int> freq(n + 1 , 0); // 1 index
int a = -1, b = -1;
for (vector<int> row : grid) {
for (int num : row) {
freq[num]++;... | ALGO | 0.999609 | 6.188675 |
d73035eb-bf2d-4274-a4e5-a68b71b91a7c | ishandutta2007/codeforces | blackbori/normal/550/C.cpp | #include <bits/stdc++.h>
using namespace std;
string s;
bool TRUE(int a,int b,int c)
{
if(((s[a]-'0')*100+(s[b]-'0')*10+(s[c]-'0'))%8!=0) return false;
printf("YES\n");
printf("%c%c%c\n",s[a],s[b],s[c]);
return true;
}
bool TRUE2(int a,int b)
{
if(((s[a]-'0')*10+(s[b]-'0'))%8!=0) return false;
... | ALGO | 0.99884 | 3.432245 |
ee03f635-5f9e-40a3-86f1-af3616174132 | yhmunna1/data-structure | Assignment-4/1_sum_of_tree.cpp | #include <bits/stdc++.h>
using namespace std;
class Node
{
public:
int val;
Node *left;
Node *right;
Node(int val)
{
this->val = val;
this->left = NULL;
this->right = NULL;
}
};
Node *input_tree()
{
int val;
cin >> val;
Node *root;
if (val == -1)
r... | ALGO | 0.999705 | 4.223689 |
fbddff15-9b5c-41fa-96a2-6251f5bd6860 | ritikgarg655/CodeForce | fb_hacker_cup/round2/perimetric_ch1.cpp | #include<bits/stdc++.h>
using namespace std;
// template
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<pii> vii;
#define pb push_back
#define mp make_pair
#define f first
#define ... | ALGO | 0.999718 | 3.248053 |
27d1a954-4763-4e23-b81a-32db6cd5241a | Vishakha93/LeetCode | AlienDictionary-269.cpp | class Solution {
public:
bool isCycle(int idx, vector<vector<int>> &graph, vector<int> &visited, vector<int> ¤t, stack<int> &s)
{
visited[idx] = 1;
bool res;
current[idx] = 1;
for(int i=0; i<graph[idx].size(); i++)
{
if(visited[graph[idx][i... | ALGO | 0.999995 | 6.30296 |
64afe0ef-0c18-49fa-a13b-682702dadd19 | nicolexxuu/competitive-programming | USACO/2015-2016/Jan 2016/Gold/angry.cpp | //Angry Cows
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
#define INF 2000000000
int main () {
int N;
cin >> N;
vector<int> pos(N);
for(int i = 0; i < N; i++) {
cin >> pos[i];
pos[i] *= 2;
}
sort(pos.begin(), pos.end());
vector<int> DP[2];
for(int i = 0; i < 2; i++) ... | ALGO | 0.999926 | 4.045632 |
9ab38de1-0f07-46eb-b1eb-b635304883de | shahriar021/Competitive-programming | cp/leetcode/number_of_dice.cpp | class Solution
{
public:
int numRollsToTarget(int d, int f, int target)
{ int a=d*f;
int l[a];
for (int i = 0; i < a; i++)
{
for (int j = 0; i < target; j++)
{
l[]
}
}
}
}; | ALGO | 0.999949 | 5.174013 |
3ac7b8dc-f530-47b2-b387-cf74ab002109 | Rayapureddyhemasundhar/cpp | Pattern Printing/6.pattern printing.cpp | #include <iostream>
using namespace std;
int main()
{
int n;
cout << "Enter the number: ";
cin >> n;
int k;
for (int i = 1; i <= n; i++)
{
if (i % 2 != 0)
k = 1;
else
k = 0;
for (int j = 1; j <= i; j++)
{
cout << k;
... | ALGO | 0.999865 | 4.827286 |
ddb1a46d-3983-40db-a85d-6319468b11fb | senier-archive/android_platform_frameworks_native | opengl/libagl/matrix.cpp | #include <stdlib.h>
#include <stdio.h>
#include "context.h"
#include "fp.h"
#include "state.h"
#include "matrix.h"
#include "vertex.h"
#include "light.h"
#if defined(__arm__) && defined(__thumb__)
#warning "matrix.cpp should not be compiled in thumb on ARM."
#endif
#define I(_i, _j) ((_j)+ 4*(_i))
namespace android... | TOOL | 0.895574 | 6.368666 |
908d52cc-8d8a-4258-8a3b-956af1b96e50 | wynagito/algorithmzuo-recording | algorithmzuo_recording/129/t03_count_repetitions.cpp | // 统计重复个数
// 如果字符串x删除一些字符,可以得到字符串y,那么就说y可以从x中获得
// 给定s1和a,代表s1拼接a次,记为字符串x
// 给定s2和b,代表s2拼接b次,记为字符串y
// 现在把y拼接m次之后,得到的字符串依然可能从x中获得,返回尽可能大的m
// s1、s2只由小写字母组成
// 1 <= s1长度、s2长度 <= 100
// 1 <= a、b <= 10^6
// 测试链接 : https://leetcode.cn/problems/count-the-repetitions/
#include <iostream>
#include <vector>
#include <cstring>... | ALGO | 0.999615 | 5.089517 |
99dcf5ce-52c7-4107-9411-426d4d3869b0 | deepuyadav004/DataStructure | practice/recursion/jump_games/jump_games_3.cpp | Given an array of non-negative integers arr, you are initially positioned at start index of the array. When you are at index i, you can jump to i + arr[i] or i - arr[i],
check if you can reach to any index with value 0.
Notice that you can not jump outside of the array at any time.
Example 1:
Input: arr = [4,2,3,0,... | ALGO | 0.999997 | 6.362767 |
cfb9eeda-89c2-413f-b319-69d070d7b1de | Arthurllt/Estudos-em-C | Exercicios iniciais/exercicio 6.cpp | // Refaa o programa acima, utilizando uma funo.
#include <stdio.h>
#include <math.h>
double calcularPotencia(int base, int exp) {
return pow(base, exp);
}
int main() {
int numero, potencia;
printf("Digite um nmero inteiro: ");
scanf("%d", &numero);
if (numero > 10) {
printf("A raiz quad... | ALGO | 0.999003 | 5.229705 |
2b4085bb-b520-4a98-b77b-caf0ba953bfa | edger330/huawei-works | runtest/native/BaseRecalibrationCmethodFastHaplotypeCaller/ContextSignal.cpp | //
// Created by shawn on 18-3-20.
//
#include <iostream>
#include "ContextSignal.h"
using namespace std;
int ContextSignal::getMisMatchContextSignal(char *bases, int bases_length, const int offset, const bool NegativeStrandFlag) {
if (NegativeStrandFlag) {
if (offset > bases_length - mismatchesContextSiz... | ALGO | 0.856124 | 4.301334 |
ebf1d218-6111-4fde-a04a-395da724eb3a | 42somoim/42somoim1 | soohchoi/week4/bj11004.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int N, K;
vector<long long> v;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cin >> N >> K;
for (int i = 0; i < N; i++)
{
long long num;
cin >> num;
v.push_back(num);
}
sort(v.begin(), v.end())... | ALGO | 0.999973 | 4.248522 |
cb6f16bf-f5a4-4cb4-b045-4e1a88e069a4 | adityarajput22/HACKERBLOCKS- | Recursion-Ascii Subsequences.cpp | #include <iostream>
using namespace std;
int count_ascii_subsequences(string str) {
if (str.empty())
return 1;
int count = count_ascii_subsequences(str.substr(1));
count += count_ascii_subsequences(str.substr(1)) + count_ascii_subsequences(str.substr(1));
return count;
}
void print_ascii_sub... | ALGO | 0.999921 | 5.739451 |
3f151e05-600a-45ed-aaa8-e75b98ce734b | snewptl/stationaryTraveller | gym/tsinghua2025/K.cpp | #include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <set>
#include <queue>
#include <vector>
#include <assert.h>
#include <cmath>
#define all(x) x.begin(), x.end()
typedef long long ll;
typedef std::pair<int, int> pii;
typedef std::pair<ll, int> pli;
typedef std::pair<ll, ll> pll;
typedef... | ALGO | 0.999972 | 3.769016 |
591f9373-2dc1-4144-a093-b8d5fbf94c26 | DHTHEFOOL/ZHAOLUSI | chuyensoi1.cpp | #include<bits/stdc++.h>
using namespace std;
long long ans, n, a[100004], vt1, vt2, x1, x2, dem;
int main()
{
ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
// freopen("ChuyenSoi1.Inp","r",stdin); freopen("ChuyenSoi1.Out","w",stdout);
cin>>n;
for(int i=1; i<=n; i++)
{
cin>>a[i];
if... | ALGO | 0.999971 | 3.366242 |
efe6a6bc-f2d4-4db2-903e-060178a7007e | JudithRomerCori/Practica_6 | Ejericicio_03_06.cpp | // Materia: Programacin I, Paralelo 1
// Autor: Judith Marisol Romero Cori
// Fecha creacin: 23/10/2023
// Fecha modificacin: 23/10/2023
// Nmero de ejericio: 3
// Problema planteado:Realizar un algoritmo recursivo, dado un vector de nmeros enteros, retorne la suma de sus elementos.
#include <iostream>
#include <... | ALGO | 0.999951 | 6.268818 |
7019399b-6935-4793-a3c4-e2a5d2936311 | wabisabi3yade/Syusyoku_Sample | ThirdParty/bullet/include/BulletCollision/CollisionShapes/btOptimizedBvh.cpp | #include "btOptimizedBvh.h"
#include "btStridingMeshInterface.h"
#include "LinearMath/btAabbUtil2.h"
#include "LinearMath/btIDebugDraw.h"
btOptimizedBvh::btOptimizedBvh()
{
}
btOptimizedBvh::~btOptimizedBvh()
{
}
void btOptimizedBvh::build(btStridingMeshInterface* triangles, bool useQuantizedAabbCompression, const b... | ALGO | 0.982458 | 6.781789 |
95d87e78-865f-4bd9-9a77-e795753f2715 | K14KHaNaSa/bojPractice | 2535.cpp | #include <iostream>
#include <queue>
using namespace std;
int main(void) {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int nation[101];
priority_queue<pair<int, pair<int, int>>> stud;
int n, a, b, c;
cin >> n;
while (n--) {
cin >> a >> b >> c;
stud.push(make_pair(c, make_pair(a, b)));
nat... | ALGO | 0.999921 | 3.758629 |
6fa8d5e5-54ca-4327-8a9c-47eb1d1f0371 | ArmandoReyesRepo/Cplusplus | Chapter 04/18 pointindex/pointindex.cpp | // Reverse case using pointer arithmetic.
#include <iostream>
#include <cctype>
using namespace std;
int main()
{
char *p;
char str[80] = "This Is A Test";
cout << "Original string: " << str << "\n";
p = str; // assign p the address of the start of the array
while(*p) {
if(isupper(*p))
... | ALGO | 0.968585 | 5.150676 |
acbf7a1d-3444-405e-aac8-08b992bac2d3 | Arjunkhera/Competitive_Programming | LeetCode/9palindromenumber.cpp | // leetcode question 9
#include<iostream>
using namespace std;
// solution function
bool isPalindrome(int x){
// case 1
if( x < 0 || (x%10 == 0 && x != 0)) return false;
// case 2
int reverse = 0;
while(x > reverse){ reverse = reverse*10 + x%10; x /= 10; }
if(reverse == x || (reverse/10 == x)) return tr... | ALGO | 0.999989 | 4.693419 |
b41aee11-9b65-474a-8130-cc2ab8228474 | vfolunin/archives-solutions | UVa Online Judge/346.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <string>
using namespace std;
const vector<string> notes = { "A", "A#", "B", "C", "C#", "D", "D#", "E", "F", "F#", "G", "G#" };
int pos(string note) {
note[0] = toupper(note[0]);
if (note.size() == 2 && note[1] =... | ALGO | 0.998914 | 5.030286 |
10410411-209f-4b11-89c3-9e073712c7d7 | ricardo-quesada/Webkit-Projects | WebCore/platform/audio/SincResampler.cpp | #include "config.h"
#if ENABLE(WEB_AUDIO)
#include "SincResampler.h"
#include <wtf/MathExtras.h>
using namespace std;
// Input buffer layout, dividing the total buffer into regions (r0 - r5):
//
// |----------------|----------------------------------------------------------------|----------------|
//
// ... | ALGO | 0.910709 | 7.076619 |
8d83d02f-4c67-4ea0-a763-f91dadc48e0f | hasnat0006/CP_SOLUTION | Codeforces/Normal Round/Round 800 - 899/Round 896 (Div. 2)/B_2_D_Traveling.cpp | #ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#in... | ALGO | 0.99972 | 5.250575 |
a5694e36-4c94-44eb-b874-99e574a951c2 | devartstar/Algorithms | CodeForcesDP/12.cpp | /*
Link - https://codeforces.com/gym/302977/problem/D
*/
#include <bits/stdc++.h>
using namespace std;
#define ar array
#define ll long long
#define vi vector<int>
#define vll vector<long long>
#define vpii vector<pair<int,int>>
#define f0(i, n) for (int i = 0; i < n; i++) // 0 based indexing
#define f1(i, n) for (i... | ALGO | 0.999947 | 3.897355 |
140c620c-8b34-4766-826f-08dd5c48240c | khuzii/Cpp-DSA | Trees/postorder.cpp | #include <bits/stdc++.h>
using namespace std;
struct Node {
int data;
Node *left;
Node *right;
Node(int data) {
this->data= data;
this->left= NULL;
this->right= NULL;
}
};
int idx;
Node* buildTree(int nodes[]) {
idx++;
if(nodes[idx]==-1) {
return NULL;
... | ALGO | 0.999972 | 4.260936 |
68ecdb0a-2b1a-4ce6-b876-74fd60a0b2e9 | Min-tunnn/PTIT-HCM-KS2024B | Dev_C_basic/Session_16/Bai_9.cpp | #include <stdio.h>
void insertElement(int *array, int *size, int value, int position)
{
if (position<0||position>*size)
{
printf("V? tr khng h?p l?!\n");
return;
}
for (int i=*size; i>position; i--)
{
*(array+i)=*(array+i-1);
}
*(array+position)=value;
(*size)++;
}... | ALGO | 0.999742 | 4.017571 |
87ec217e-41b0-45d3-bcf5-5c77d93fd051 | BartSteen/AdventOfCode | 2023/day10/d10.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <queue>
using namespace std;
#define filename "input.txt"
vector<int> findStart(vector<string> input) {
for (int i = 0; i < input.size(); i++) {
for (int j = 0; j < input[i].size(); j++) {
if (input[i][j] == 'S') {
... | ALGO | 0.999777 | 4.687341 |
2f8a011d-69a5-4ac2-8aea-da27040497c8 | harsh-srivastv/December-Leetcode-Challenge-2024 | 2825-make-string-a-subsequence-using-cyclic-increments/2825-make-string-a-subsequence-using-cyclic-increments.cpp | class Solution {
public:
bool canMakeSubsequence(string str1, string str2) {
int i = 0; // str2's index
for (const char c : str1)
if (c == str2[i] || ('a' + ((c - 'a' + 1) % 26)) == str2[i])
if (++i == str2.length())
return true;
return false;
}
}; | ALGO | 0.999779 | 6.396739 |
a245f03c-5d63-41f7-82f6-029e48e8c7ac | AthomsG/FC | A07/Trab01/Problema3/Matrix_solver.cpp | #include <iostream>
#include <vector>
using namespace std;
#include "Vec.hpp"
#include "FCmatrix.hpp"
#include "FCmatrixFull.hpp"
#include "FCmatrixBanded.hpp"
#include "EqSolver.hpp"
int main()
{
//Nao e possivel resolver sem recorrer a pivotagem, porque logo apos
// o primeiro passo da eliminacao de gauss (linha... | ALGO | 0.999817 | 3.361427 |
97102a19-9bfd-49db-8719-5ce18b827964 | ritiksharma-code/C-Programming | DSA/Recursion/sumArray.cpp | #include <iostream>
using namespace std;
int sumArray(int *arr, int size)
{
int sum=0;
// Base Case
if(size == 0)
return 0;
if(sum==1)
return arr[0];
// Process and Recursive Call
else
{
int remainingPart = sumArray(arr+1, size-1);
sum=sum+arr[0]+remai... | ALGO | 0.999942 | 5.750312 |
cec74f4b-00c8-4969-aa34-9863c5edf5e6 | chenhan1218/UVa-Online-Judge | 11503.cpp | #include <iostream>
#include <map>
using namespace std;
map<string, string> parent;
map<string, int> rank;
string getParent(const string &name) {
if ("" == parent[name]) {
parent[name] = name;
rank[name] = 1;
}
if (parent[name] != name) {
parent[name] = getParent(parent[name]);
}
return parent[name];
}
... | ALGO | 0.999855 | 4.6145 |
5c3ab614-a850-4123-ad20-40f5ae6913e6 | rkaunismaa/CUDA | NVIDIA/cuda-samples/Samples/5_Domain_Specific/smokeParticles/ParticleSystem.cpp | #include <assert.h>
#include <math.h>
#include <memory.h>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#define HELPERGL_EXTERN_GL_FUNC_IMPLEMENTATION
#include <helper_gl.h>
#include <cuda_runtime.h>
#include <cuda_gl_interop.h>
#include <helper_functions.h>
#include <helper_cuda.h>
#include "ParticleSys... | ALGO | 0.969638 | 3.281423 |
1466e384-1ec9-48d3-9fa3-3bcde3637922 | Soumithra-DNS/Problem_Solving | Codeforces/1831B.cpp | #include<bits/stdc++.h>
using namespace std;
void solve()
{
int n; cin >> n;
vector <int> a(2*n);
for(int i=0;i<2*n;i++) cin >> a[i];
sort(a.begin(),a.end());
int ct=1,mx=0;
for(int i=1;i<2*n;i++){
if(a[i]==a[i-1]) ct++;
else{
if(ct>mx) mx=ct;
ct=1;
}... | ALGO | 0.999539 | 4.462602 |
ba27f808-40bb-49da-b33f-c0e3514b6a9f | bechirzarrouki/java_ML | src/opencv/sources/modules/features2d/src/blobdetector.cpp | #include "precomp.hpp"
#include <iterator>
#include <limits>
#include <opencv2/core/utils/logger.hpp>
// Requires CMake flag: DEBUG_opencv_features2d=ON
//#define DEBUG_BLOB_DETECTOR
#ifdef DEBUG_BLOB_DETECTOR
#include "opencv2/highgui.hpp"
#endif
namespace cv
{
// TODO: To be removed in 5.x branch
const std::vect... | TOOL | 0.961307 | 3.704457 |
f5da4be4-c0cb-4f85-9df4-34b059282fa2 | raincross7/code-similarity | codes/train_code/problem206/problem206_93.cpp | //#include "bits/stdc++.h"
#define _USE_MATH_DEFINES
#include<cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <deque>
#include <algorithm>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <sta... | ALGO | 0.982635 | 3.910156 |
cb509168-0083-4276-89cc-d982c35950d6 | Ausaf1/DSA_AND_CP | 0231-power-of-two/0231-power-of-two.cpp | class Solution {
public:
bool isPowerOfTwo(int n) {
if(n <= 0) return false;
return (n & (n-1)) == 0;
}
}; | ALGO | 0.993677 | 6.323567 |
9800f9e6-263e-4a8e-a0db-2b438c7babdc | dzhi1993/Practice-DataStructures | LeetCode/014LongestCommonPrefix.cpp | #include <iostream>
#include <vector>
#include <string>
using namespace std;
class Solution {
public:
string longestCommonPrefix(vector<string>& strs) {
if (strs.empty()) return "";
string common = strs[0];
int len = common.size();
for (int i = 1; i < strs.size(); ++i) {
... | ALGO | 0.998799 | 4.826512 |
a55cb5a6-cfdb-44a4-acab-b4f528b4a27a | Philip-sung/DIR__Algorithm | hash/cuckooHash/CuckooHashing.cpp | //implementation of basic linked-list hash
#ifndef _CUCKOO_INT_HASH_
#define _CUCKOO_INT_HASH_
#include <vector>
#include <climits>
#include <iostream>
#define INT_MIN 0
class CuckooIntegerHash {
private:
int size = 0;
std::vector<int> bucketA;
std::vector<int> bucketB;
int hashA(int key) {
int result = key ... | ALGO | 0.995326 | 4.612377 |
7204fbf1-0545-484e-905e-415d51fcdb7c | alexandraback/datacollection | solutions_1480487_0/C++/Cifko/main.cpp | #include "stdio.h"
#include "stdlib.h"
#include "memory.h"
#include "string.h"
#include "math.h"
FILE *fin, *fout;
#define INPUT_FILE_NAME "A-small-attempt3"
#define INPUT_FILE INPUT_FILE_NAME##".in"
#define OUTPUT_FILE INPUT_FILE_NAME##".out"
#define print(format,...) {fprintf(fout, format, __VA_ARGS__); printf(for... | ALGO | 0.997142 | 3.660667 |
3a4edb69-11d3-4d5c-93eb-a04fd31c364e | shelestvitru/competitive-programming | HoT 2023/round1/simple_ensemble.cpp | #include <bits/stdc++.h>
using namespace std;
struct MSG {
int type;
int user;
int time;
int deadline;
};
int score(vector<vector<MSG> > &distribution, int global_deadline)
{
int affinity_score = 0;
int capability_score = 0;
for (int i = 0; i < distribution.size(); i++)
{
if (distributi... | ALGO | 0.999986 | 4.83197 |
fb4917db-3b42-45f8-9dab-f91b6b191a7b | Monal-Patel/amrsolver | lib/boost/libs/graph/example/sloan_ordering.cpp | #include <boost/config.hpp>
#include <vector>
#include <iostream>
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/sloan_ordering.hpp>
#include <boost/graph/properties.hpp>
#include <boost/graph/bandwidth.hpp>
#include <boost/graph/profile.hpp>
#include <boost/graph/wavefront.hpp>
using std::cout;
using... | ALGO | 0.999944 | 6.518653 |
8bd8f75e-a4e6-406b-8a90-e0d4c7dc72a9 | GonzaloPerezChamarro/bullet-example | practice/libraries/bullet-2.87/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorldMt.cpp | #include "btDiscreteDynamicsWorldMt.h"
//collision detection
#include "BulletCollision/CollisionDispatch/btCollisionDispatcher.h"
#include "BulletCollision/BroadphaseCollision/btSimpleBroadphase.h"
#include "BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h"
#include "BulletCollision/CollisionShapes/btCollisi... | ALGO | 0.990099 | 4.75574 |
c30796d7-7a1a-4f32-b778-0eedcebbb01e | honeyvikash/Leetcode_Solved_Problems | 0424-longest-repeating-character-replacement/0424-longest-repeating-character-replacement.cpp | class Solution {
public:
int characterReplacement(string s, int k) {
int l = 0,r=0,len=0,mf=0;
unordered_map<char, int> m;
int n = s.size();
for(int r=0;r<n;r++)
{
m[s[r]]=m[s[r]]+1;
mf = max(mf, m[s[r]]);
if ((r - l + 1) - mf > k)
... | ALGO | 0.999988 | 6.499683 |
0992fd64-fe90-4e64-ac7a-55a5f5f9b464 | senlinzhan/experiments | leetcode_solutions/AddTwoNumbers.cpp | class Solution {
public:
ListNode* addTwoNumbers( ListNode *l1, ListNode *l2 )
{
ListNode *head = nullptr;
ListNode *tail = nullptr;
int plusOne = 0;
ListNode *p1, *p2;
for( p1 = l1, p2 = l2; p1 && p2; p1 = p1->next, p2 = p2->next )
{
... | ALGO | 0.99991 | 6.556043 |
ec90e937-23c9-4093-bbbc-55eede5d8ec9 | pogery-foggy/BOJ_study | code/2023/code/14427_seg.cpp | #include <iostream>
#include <vector>
#define MAX_N 100000
using namespace std;
int N, M, mode, a, v;
pair<int, int> tree[MAX_N * 4];
int arr_index[MAX_N + 1];
pair<int, int> init_tree(int s, int e, int node) {
if (s == e) {
cin >> tree[node].first;
tree[node].second = s + 1;
arr_index[s +... | ALGO | 0.999946 | 4.795733 |
69119c41-c555-4279-81bf-fdeef79ff03a | kacper-ziemecki/Competitive-Programming | Codechef Problems/COOMILK.cpp | #include <bits/stdc++.h>
using namespace std;
#define endl "\n"
#define ll long long
#define ld long double
void solve()
{
ll n;
cin >> n;
vector<string> list(n, " ");
for(auto &el : list) cin >> el;
for(ll i = 1; i < n; i++){
if(list[i-1] == "cookie" && list[i] == "cookie"){
cout << "NO\n";
... | ALGO | 0.999654 | 4.347722 |
51f62046-4735-46a9-abf4-fe2a854eaaba | sunputawan/2110211-data-structures | grader/numberTriangles.cpp | #include <iostream>
using namespace std;
int arr[105][105], dp[105][105];
int main() {
int n; cin>>n;
for(int i=1;i<=n;i++) {
for(int j=1;j<=i;j++) {
cin>>arr[i][j];
}
}
dp[1][1] = arr[1][1];
for(int i=2;i<=n;i++) {
for(int j=1;j<=i;j++) {
dp[i][j] =... | ALGO | 0.999949 | 3.917266 |
c2703911-ed6d-4d55-8cf9-e7e313064475 | Bhanupal22600/CANDIDATE-MASTER | Cp31Sheet1100/B_Pleasant_Pairs.cpp | #include <bits/stdc++.h>
using namespace std;
void calc() {
int n;
cin >> n;
vector<pair<int, int>> v(n);
for (int i = 0; i < n; i++) {
int a;
cin >> a;
v[i] = {a, i + 1};
}
sort(v.begin(), v.end());
int cn = 0;
for (int i = 0; i < n; i++) {
for (int j... | ALGO | 0.999731 | 4.921866 |
d6c81465-ccd3-458a-9c6c-6c3ade4ada56 | raincross7/code-similarity | codes/train_code/problem150/problem150_333.cpp | #include<iostream>
#include<map>
#include<string>
#include<vector>
#include<algorithm>
#include<numeric>
#include<cmath>
#include<queue>
using namespace std;
long long int inf = 10000000000;
int dx[4] = {0,0,1,-1};
int dy[4] = {1,-1,0,0};
int main(){
long long int n, m;
cin >> n >> m;
vector< vector<long long ... | ALGO | 0.999974 | 4.484466 |
8cc28321-3b05-4147-84f0-ef8025ed6139 | JabedWeb/cpp-contest-solutions | D_Binary_Cut.cpp | //https://atcoder.jp/contests/abc326/tasks/abc326_c
////https://codeforces.com/contest/266/problem/A
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int mod = 1e9 + 7;
const int N = 1e5 + 5;
int solve(int a,vector <int> &v){
}
void solve(){
string s;
cin>>s;
ll cnt=1, res=0;
... | ALGO | 0.999734 | 4.658143 |
500fbca9-6ca6-45b9-895e-beae98a467df | Mj7user/FOC-PRACTICALS- | FOC(Experiment 10).cpp | #include <stdio.h>
int main() {
int n, sum = 0;
printf("Enter the value of n: ");
scanf("%d", &n);
for (int i = 1; i <= n; i++) {
sum += i * i;
}
printf("The sum of squares of first %d natural numbers is: %d", n, sum);
return 0;
} | ALGO | 0.974935 | 4.567572 |
3e37f6f0-fa58-4f79-8ea4-11e1620a3ee3 | AsilbekBoboqulov/cuddly-umbrella | main_12.cpp | #include <iostream>
#include<bits/stdc++.h>
using namespace std;
int main(){
string a;
cin >> a;
string greeting = a;
reverse(greeting.begin(),greeting.end());
cout<<greeting<<endl;
}
| ALGO | 0.999846 | 4.684305 |
f957c33a-c65d-490e-94ed-824d3cc9687f | Shadab420/Online-Judge-Solutions | UVA-OJ/10050 - Hartals.cpp | #include <bits/stdc++.h>
using namespace std;
#define read(num) scanf("%d", &num)
int main()
{
freopen("input/in.txt", "r", stdin);
freopen("input/out.txt", "w", stdout);
int t, n, parties, hartalParam, workingDays[3655];
read(t);
for(int cs=1; cs<=t; cs++)
{
read(n); read(parties);
... | ALGO | 0.999897 | 3.393651 |
e6cfcc7b-3445-468e-81d3-22ed63db6c22 | tobing7799/Study | 공부/LV_0/한 번만 등장한 문자.cpp | #include <string>
#include <vector>
#include <iostream>
#include<algorithm>
using namespace std;
string solution(string s) {
string answer = "";
for (char c : s) {
if (count(s.begin(), s.end(), c) < 2)
answer += c;
}
sort(answer.begin(), answer.end());
return answer;
}
int mai... | ALGO | 0.999936 | 5.474102 |
66acba6f-2fe2-44d9-9dba-11c2eb670496 | parthbakare/CS204_parthbakare | lab12.cpp | #include<bits/stdc++.h>
using namespace std;
struct edge {
int x;
int y;
long long int w;
};
bool com(edge A, edge B)
{
return (A.w > B.w);
}
int main(){
int n, m;
cin >> n >> m;
long long int cost = 1;
vector<edge> E;
for(int i=0; i<m; i++)
{
edge temp;
cin >> temp.x >> temp.y >> temp.w;
E.push_bac... | ALGO | 0.999972 | 4.323328 |
e614ece7-d810-43b7-bd96-a19c07ab384c | RheinX/LeetCode | 0-100/90_SubsetsII.cpp | //description
//Given a collection of integers that might contain duplicates, nums, return all possible subsets.
//Note: The solution set must not contain duplicate subsets.
// For example,
// If nums = [1, 2, 2], a solution is :
//[
// [2],
// [1],
// [1, 2, 2],
// [2, 2],
// [1, 2],
// []
//]
//Solution
//Solutio 1:... | ALGO | 0.999538 | 6.595894 |
87c2d225-15ba-4942-a80f-3bab2d88ab96 | CoderGenJ/camera_tool | sfm/sfm.cpp | #include "sfm.h"
namespace SFM {
bool structureFromMotion::detectMarker(cv::Mat img,
MarkerDetector::MarkerData &output) {
if (!marker_detector_ptr_->detectMarker(img, output)) {
return false;
}
return true;
}
void structureFromMotion::insertMarkerData(
const Marke... | ALGO | 0.99369 | 3.760109 |
bbded3f5-5989-4e02-b3bc-be4a300532ee | wangc0812/MICS6000L | src/systemc/tests/systemc/misc/unit/data/general/promote_add/datawidth.cpp | /*****************************************************************************
datawidth.cpp --
Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
*****************************************************************************/
/**************************************************************************... | ALGO | 0.851896 | 5.241626 |
9af1cf7e-15c1-40e4-a924-d4c54e601527 | DenMoz/spisci_ocheredi_stack | лаба 12 структуры данных/main.cpp | #include<stdio.h>
#include"header.h"
#include<locale.h>
int main()
{
setlocale(LC_ALL, "rus");
NodePtr root=NULL;
int number;
int(*FuncPtr)() = getNumber;
printf(" \n \n");
while (true)
{
switch (menu())
{
case 1: input(&root, FuncPtr);
break;
case 2: printf(" %d", countList(&root));
break;
c... | ALGO | 0.993593 | 3.438475 |
03149d94-28f2-480d-8b2c-6cb3dba6c11d | Vapoursynth-Plugins-Gitify/vcm | F1QClean.cpp | //---------------------------------------------------------------------------
/*
#include <stdlib.h>
#include "VapourSynth.h"
#include "VSHelper.h"
#include <math.h>
#define _USE_MATH_DEFINES
#include <vector>
#include "windows.h"
#include "fftwlite.h"
#include "FQDomainHelper.h"
*/
//--------------------------------... | ALGO | 0.993517 | 3.941736 |
e646a61c-a308-4af4-97fe-12df0d071faf | IlGyu/algorithm | koi_pass.cpp | #include <stdio.h>
#define Max_n 1000
#define MOD 1000000009
int N, K;
long long D[4][4][4][4], E[4][4][4][4], Sol;
void init()
{
scanf("%d%d", &N, &K);
}
void process()
{
long long k;
int i, a, b, c, d, e;
for (a = 0; a < 4; a++) {
for (b = 0; b < 4; b++) {
for (c = 0; c < 4; c++) {
for (d = 0; d < 4... | ALGO | 0.999927 | 3.837965 |
58aee1dd-c652-47d2-9139-ba0195341ba9 | sinian666/codes_102_3 | cpp_副本7/chapter_searching/hashing_search.cpp | /**
* File: hashing_search.cpp
* Created Time: 2022-11-25
* Author: Krahets (<EMAIL>)
*/
#include "../utils/common.hpp"
/* 哈希查找(数组) */
int hashingSearchArray(unordered_map<int, int> map, int target) {
// 哈希表的 key: 目标元素,value: 索引
// 若哈希表中无此 key ,返回 -1
if (map.find(target) == map.end())
return -... | ALGO | 0.999778 | 5.437144 |
c740401b-51ee-4005-8f6c-37a178edd1d0 | perchess/raisim_ws | src/MIT_mpc_ros/third-party/JCQP/CholeskyDenseSolver.cpp | /*!
* @file: CholeskyDenseSolver.cpp
*
* Dense Cholesky Solver.
*/
#include "CholeskyDenseSolver.h"
#include "Timer.h"
#include <cassert>
#include <iostream>
#include <immintrin.h>
static constexpr s64 UNROLL_MATVEC = 8; //! Loop unroll for all inner loops, AVX2 only
/*!
* Perform initial factorization
*/
temp... | ALGO | 0.992979 | 6.585369 |
e281722e-986b-4358-92ed-664fe3626a88 | Himanshu-Rishi/StriverSheet-60-Days | Day_05/sort012.cpp | void sort012(int arr[], int n)
{
int low = 0;
int mid = 0;
int high = n - 1;
while (mid <= high)
{
if (arr[mid] == 0)
{
swap(arr[mid], arr[low]);
low++;
mid++;
}
else if (arr[mid] == 2)
{
swap(arr[mid], arr[high]... | ALGO | 0.999478 | 3.121663 |
4b93a0e8-2172-4647-8323-f74b050e4f4b | ayushsharman/DSA-Practice | kth_largest_sumArray.cpp | #include <bits/stdc++.h>
using namespace std;
int getKthLargest(vector<int> &arr, int k)
{
int n = arr.size();
vector<int> subArraySum;
// Calculate subarray sums
for (int i = 0; i < n; i++)
{
int sum = 0;
for (int j = i; j < n; j++)
{
sum += arr[j];
... | ALGO | 0.999977 | 5.72096 |
f73dc007-a7ea-467d-bc07-8dee7c68a78e | syedtaha22/Object-Oriented-Programming-CPP | 08_Functional_Programming/examples/example4.cpp | #include <iostream>
int add(int a, int b) { return a + b; }
int subtract(int a, int b) { return a - b; }
int multiply(int a, int b) { return a * b; }
int main() {
int (*operations[])(int, int) = { add, subtract, multiply };
int x = 6, y = 3;
for (auto func : operations) {
std::cout << func(x, y) ... | ALGO | 0.96489 | 6.288857 |
314db157-05d3-48d7-a837-48225edbe3ee | SahooBishwajeet/LeetCode | Solutions_CPP/1190_Reverse_Substrings_Between_Each_Pair_of_Parentheses.cpp | // 1190 : Reverse Substrings Between Each Pair of Parentheses
/*
You are given a string s that consists of lower case English letters and brackets.
Reverse the strings in each pair of matching parentheses, starting from the innermost one.
Your result should not contain any brackets.
*/
/*
Example 1:
Input: s = "(ab... | ALGO | 0.999915 | 6.340997 |
91be3683-8cbc-47f3-bee3-cc3e068f2abd | MekhyW/Vehicle-routing-optimization | solvers/brute_force_solver.cpp | #include "brute_force_solver.h"
#include <set>
#include <stack>
#include <unordered_map>
using namespace std;
vector<vector<int>> BruteForceSolver::solve(const vector<int>& places, const map<int, int>& demand, int capacity, int max_stops, Graph& graph, int& bestCost) {
vector<vector<int>> routes = GenerateAllComb... | ALGO | 0.999974 | 6.425621 |
ce877460-b762-4004-a317-85bce8c3307b | Shubhambarange/LeetCode-Top-Interview-150 | 27_Remove_Element.cpp | Example 1:
Input: nums = [3,2,2,3], val = 3
Output: 2, nums = [2,2,_,_]
Explanation: Your function should return k = 2, with the first two elements of nums being 2.
It does not matter what you leave beyond the returned k (hence they are underscores).
Example 2:
Input: nums = [0,1,2,2,3,0,4,2], val = 2
Output: 5, nums... | ALGO | 0.999987 | 6.314946 |
ac425b9e-f4cb-4f14-a49a-39139c03fe4f | sophiegsmith/fallsem2022 | cs1b/hw_1b/source.cpp | #include<iostream>
using namespace std;
//function prototype
void gettemps(int&, int&, int&);
int calcavg(int, int, int);
void displayavg(int);
//main function
int main()
{
//variables
int temp1, temp2, temp3 = 0;
int count = 1;
int avg = 0;
cout << "Please enter 3 different temperatures: ";
... | ALGO | 0.980637 | 4.766525 |
ac617bdb-d4e1-435a-ab15-f3c132092691 | omagdy7/competitive-programming | codeforces/Matching/main.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using vpi = vector<pii>;
using vi = vector<int>;
using vll = vector<long long>;
using mpii = map<int, int>;
using mpll = map<ll, ll>;
using db = long double;
#define pb push_back
#define all(x) (x).begin(), (x).end()
#defi... | ALGO | 0.99977 | 4.156014 |
0e6d8633-93c7-4255-9990-9ff8777f2a53 | Ddelval/Competitive-programming | AceptaElReto/163__Súmale uno.cpp | #include <iostream>
#include <string>
using namespace std;
int main(int argc, const char * argv[]) {
ios::sync_with_stdio(false);
cin.tie(NULL);
string num;
int i;
while(cin>>num&&num!="FIN"){
for(i=(int)num.length()-1;i>=0;i--){
if(num[i]=='F'){
num[i]='0';
... | ALGO | 0.98905 | 3.623515 |
d142777c-65e6-4843-bb33-542d452807c6 | adiX002/Leetcode | 0033-search-in-rotated-sorted-array/0033-search-in-rotated-sorted-array.cpp | class Solution {
public:
int search(vector<int>& nums, int target) {
int leftIdx = 0;
int rightIdx = nums.size() - 1;
while (leftIdx <= rightIdx) {
int midIdx = (leftIdx + rightIdx) / 2;
if (nums[midIdx] == target) {
return midIdx;
... | ALGO | 0.999973 | 6.36847 |
a6700c4c-c15a-485a-b6e7-29739175125a | Ankush1722/DSA | Linked List/link_1.cpp | // #include <iostream>
// using namespace std;
// class node
// {
// public:
// int data;
// node *next;
// node(int data)
// {
// this->data = data;
// next = NULL;
// }
// };
// int main()
// {
// // STATICALLY
// node n1(2);
// node *head = &n1;
// node n2(3);
// ... | ALGO | 0.979219 | 4.557081 |
29848384-c302-4856-87b6-7e52925b0526 | yisusrgg/competitive-programming | argus.cpp | #include <bits/stdc++.h>
#include <utility>
using namespace std;
int main()
{
ios::sync_with_stdio(false);
priority_queue<pair<int,int>>pq;
bool zy=1;
while(zy)
{
string x;
cin >> x;
if(x=="#")
{
break;
zy=0;
}
int a,b;
... | ALGO | 0.999862 | 3.408709 |
2e49abec-cef8-45e4-a00d-579aa3e1e338 | ishandutta2007/codeforces | krk/normal/1063/B.cpp | #include <bits/stdc++.h>
using namespace std;
typedef pair <int, int> ii;
const int Maxn = 2005;
const int Inf = 1000000000;
const int Maxd = 4;
const int dy[Maxd] = {-1, 1, 0, 0};
const int dx[Maxd] = {0, 0, -1, 1};
const int cost[Maxd] = {0, 0, 1, 1};
int n, m;
int r, c;
int x, y;
char B[Maxn][Maxn];
int dist[Maxn... | ALGO | 0.999696 | 3.66831 |
0a141363-fec4-47bd-853c-17736c2f5716 | Meghul/leetcode | 2106-find-greatest-common-divisor-of-array/2106-find-greatest-common-divisor-of-array.cpp | class Solution {
public:
int ans(int a,int b){
while(b!=0){
int temp=b;
b=a%b;
a=temp;
}
return a;
}
int findGCD(vector<int>& nums) {
sort(nums.begin(),nums.end());
return ans(nums[0],nums[nums.size()-1]);
}
}; | ALGO | 0.999982 | 5.760907 |
68bf2339-1408-48d7-93e4-69d31fbcd59a | risal-shefin/Competitive-Programming | CodeForces/Solutions/479B.cpp | // #pragma GCC optimize("Ofast,unroll-loops")
// #pragma GCC target("avx,avx2,fma")
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define dd double
#define ld long double
#define sl(n) scanf("%lld", &n)
#define si(n) scanf("%d", &n)
#define sd(n) scanf("%lf", &n)
#d... | ALGO | 0.999967 | 3.725156 |
fe548d98-f8c8-4312-bb36-4a2b97fe8828 | PedroMoT4/csc_415 | prog4_Pedro.cpp | /*
Program 4: Steffensen's Method
2/13/23
Pedro Mota - Pledged
*/
#include <iostream>
#include <math.h>
#define TOL 0.00001
using namespace std;
double fx(double x);
void steffensens(double p0, int n);
int main(){
int n;
double p0;
cout << "What is the initial value: ";
cin >> p0;
cout << "Max... | ALGO | 0.999998 | 4.821566 |
de631721-1c7c-4173-8eff-37f05be2716e | X-oss-byte/Walletcore | src/Waves/Signer.cpp | #include "Signer.h"
#include "../Hash.h"
using namespace TW;
namespace TW::Waves {
Proto::SigningOutput Signer::sign(const Proto::SigningInput& input) noexcept {
auto privateKey = PrivateKey(Data(input.private_key().begin(), input.private_key().end()));
auto publicKey = privateKey.getPublicKey(TWPublicKeyTy... | ALGO | 0.965321 | 6.715244 |
f8585ed7-55f2-4608-bf21-be8c2b35a3ad | JimmyyyChen/CampusConnect | 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.9988 | 6.76073 |
a1f28ec3-ef6d-4800-b35b-4bd44d1b7edd | raincross7/code-similarity | codes/train_code/problem267/problem267_346.cpp | #include <iostream>
using namespace std;
int main(void) {
for(int i = 1; i <= 9; ++i) {
for(int j = 1; j <= 9; ++j) {
cout << i << "x" << j << "=" << i*j << endl;
}
}
}
| ALGO | 0.990563 | 3.807265 |
92405eaa-84eb-4460-a76d-992f58755a59 | Mosina916/CB-Noida-Offline-Cpp-Feb21 | qps3-13april/Q4.cpp | /*
Given a list of N strings <S1, S2, ... , SN> each consisting of digits and spaces, the
number of spaces is the same for each entry. The goal is to implement a variation of the
sort command.
No string consists of consecutive spaces. Also no string starts or ends with a space.
Spaces are used to divide a string into... | ALGO | 0.999962 | 5.093221 |
f17d1692-9879-42f7-badf-1531809a1909 | PythonSmall-Q/OI-Codes | 1013.cpp | #include <bits/stdc++.h>
using namespace std;
int height[50010],n,vis[50010],dis[50010];
//bool judge(){
// for(int i=0;i<n;i++){
// if(vis[i]!=1) return false;
// }
// return true;
//}
int main()
{
cin>>n;
for (int i=1;i<=n;i++){
cin>>height[i];
}
memset(vis,0,sizeof(vis));
fo... | ALGO | 0.999951 | 3.402299 |
696cb07a-0cba-4bf5-9c0a-aebefcf86f3f | HunterJohnson/Interviews | ctci5/c++/Chapter 3/Question3_6.cpp | #include<iostream>
#include<stack>
using namespace std;
void sortStack(stack<int> *st){
stack<int> sorted; //top contains smallest element
while(!(*st).empty()){
int tmp = (*st).top();
(*st).pop();
while(!sorted.empty() && tmp>sorted.top()){
(*st).push(sorted.top());
... | ALGO | 0.999877 | 4.416969 |
b2a302d0-b6c5-4c84-b909-bf13e868b869 | Karthick-r01/DSA-Problem-Solving | 0002-Add Two Numbers/Add Two Numbers.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
ListNode* addTwoNumbe... | ALGO | 0.999931 | 6.273014 |
a667125e-c2eb-499a-a824-1a0b7b36654f | adrianrocamora/kng | cpp/pair_equality.cpp | #include <utility>
#include <iostream>
#include <algorithm>
#include <cassert>
using namespace std;
int main() {
auto orig = make_pair(12,34);
auto a = make_pair(12,34);
auto b = make_pair(12,56);
auto c = make_pair(512,34);
auto d = make_pair(3124,13242);
assert(orig == a);
assert(orig !=... | TEST | 0.863787 | 3.122607 |
07fa6b1e-e4a0-410f-b7b0-efd4ff226312 | samiunblack/phitron | semester 1/introduction to c/week 2/module 6/U.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n, a, b;
cin >> n >> a >> b;
if(a > b)
{
swap(a, b);
}
int total = 0;
for(int i = 1; i <= n; i++)
{
int sum = 0;
int j = i;
while(j != 0)
{
sum += j % 10;
j... | ALGO | 0.999584 | 3.78838 |
ae26d281-299d-4bac-832f-6eb3351e715f | shrutijpg/DSA | 37-sudoku-solver/sudoku-solver.cpp | class Solution {
public:
void solveSudoku(vector<vector<char>>& board) {
solve(board);
}
bool solve(vector<vector<char>>& board){
for(int i=0;i<board.size();i++){
for(int j=0;j<board[0].size();j++){
if(board[i][j] == '.'){
for(char c='1';c<='9... | ALGO | 0.999691 | 6.965267 |
0e3eb408-dda8-4d24-b35c-f23a2c3870cb | alexandraback/datacollection | solutions_5690574640250880_1/C++/ilackthatsuperpower/c.cpp | //
// c.cpp
//
//
#include <cstdlib>
#include <stdint.h>
#include <iostream>
#include <iomanip>
#include <utility>
#include <functional>
#include <fstream>
#include <algorithm>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <math.h>
//#include <boost/multi_array.hpp>
// function prototyp... | ALGO | 0.998908 | 4.027558 |
e4f2c7b7-e577-48fb-a567-3c48bdc1ae7a | yucdong/bookreading | c++_primer_5e/ch12/ex12.6.cpp | #include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
vector<int>* create_vector() {
return new vector<int>();
}
void read_input(vector<int>* vec) {
int val;
while (cin >> val) {
vec->push_back(val);
}
}
void print_vec(vector<int>* vec) {
for_each(vec->begin(), ... | ALGO | 0.958612 | 4.695657 |
df32b11a-4a8e-46d8-805d-797ab1ce8cfe | dmehrab06/Time_wasters | codeforces/436/A.cpp | /*-------property of the half blood prince-----*/
#include <bits/stdc++.h>
#include <dirent.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>
#define MIN(X,Y) X<Y?X:Y
#define MAX(X,Y) X>Y?X:Y
#define ISNUM(a) ('0'<=(a) && (a)<='9')
#defin... | ALGO | 0.99961 | 3.147507 |
e8333859-1b5d-4d23-b4bb-444939e2cb6d | Arshjeet-Singh/Strivers-SDE-Sheet-Challenge | Power Set.cpp | #include <bits/stdc++.h>
void help(int ind,vector<int>v,vector<int>temp,vector<vector<int>> &ans)
{
if(ind==v.size())
{
sort(temp.begin(),temp.end());
ans.push_back(temp);
return;
}
temp.push_back(v[ind]);
help(ind+1,v,temp,ans);
temp.pop_back();
help(ind+1,v,temp,an... | ALGO | 0.999871 | 4.896289 |
1f28fad4-e4aa-4efe-bdcb-ae4ef2164f1c | Shanto57575/DSA-problems | Graph/Graph_representation_in_matrix.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n, m;
cin >> n >> m;
int adj[n + 1][m + 1];
// graph representation using matrix
for (int i = 0; i < m; i++)
{
int u, v;
cin >> u >> v;
adj[u][v] = 1;
adj[v][u] = 1;
}
return 0;
}
| ALGO | 0.999972 | 3.861847 |
f989d6d2-5395-4038-a01c-4b9dd908a2fa | amchp/CompetitivePrograming | Practice/C_Sum_on_Subarrays.cpp | #include <bits/stdc++.h>
#define fi first
#define se second
#define forn(i, n) for (int i = 0; i < (int)n; ++i)
#define for1(i, n) for (int i = 1; i <= (int)n; ++i)
#define fore(i, l, r) for (int i = (int)l; i <= (int)r; ++i)
#define ford(i, n) for (int i = (int)(n)-1; i >= 0; --i)
#define fored(i, l, r) for (int i = ... | ALGO | 0.99985 | 3.750263 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.