uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
0a7469b7-5b95-4e91-8600-ce99bb67b3f6
Octobug/notes
algorithms_and_data_structures/leetcode/hash_table/e_00804_unique_morse_code_words/main.cpp
#include <iostream> #include <unordered_set> #include <vector> using namespace std; class Solution { public: int uniqueMorseRepresentations(vector<string> &words) { if (words.size() == 1) return 1; string morse[26] = { ".-", "-...", "-.-.", "-..", ".", "..-.", "--.", "...
ALGO
0.999455
5.894231
6cc60493-9dc6-4f45-a70a-1f3e5bfcce70
jswxhd/Learning-C-plus-plus
chapter8/assignments/ex5.cpp
#include <iostream> #include <climits> using namespace std; const int ArSize = 5; template <typename T> T max5(T arr[]); int main(void) { int nums1[ArSize] = {1, 2, 3, 4, 5}; double nums2[ArSize] = {1.1, 2.3, 3.4, 4.5, 5.6}; cout << max5(nums1) << endl; cout << max5(nums2) << endl; return 0; } template <typ...
ALGO
0.998307
4.45937
9453a827-4d43-41c7-984a-3a879ed830f8
liangyutang/C-Study-Project-1
C++ Study Project 1/结构体案例-英雄.cpp
#include<iostream> using namespace std; struct hero { string name; int age; string sex; }; void bubbleSort(hero heros[], int len) { for (int i = 0; i < len-1; i++) { for (int j = 0; j < len-i-1; j++) { if (heros[j].age>heros[j+1].age) { hero hero = heros[j]; heros[j] = heros[j + 1]; heros[j...
ALGO
0.958109
3.838267
704301ff-b294-44ec-a9dd-47fb7165ba44
alokmaurya013/leetcode_alok
0297-serialize-and-deserialize-binary-tree/0297-serialize-and-deserialize-binary-tree.cpp
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ class Codec { public: // Encodes a tree to a single string. string serialize(TreeNode* root) { string s=""...
ALGO
0.999868
5.387203
96c05a07-8c75-4c9a-810d-d2bd24bd22a1
abimjoshi7/Parking-Management
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
1d5a4081-0449-430c-b10f-9f3ae1edb9ac
atlas25git/LeetCode
83RemoveDuplicates.cpp
class Solution { public: ListNode* deleteDuplicates(ListNode* head) { ListNode* curr = head,*prev = NULL; while(curr) { if(!prev) prev = curr; else if(prev->val == curr->val) { prev->next = curr->next; ...
ALGO
0.999867
5.776246
f7422d86-ef78-4432-a860-52e12f46b136
ivan-ruizrosello/LibroCpp
7/Ejercicios/7.30/7.30/main.cpp
#include <iostream> #include <array> using namespace std; const size_t tamanioArreglo = 10; void imprimirArreglo(size_t begin, size_t end, array<short , tamanioArreglo > &arr) { cout << arr.at(begin) << " "; if (begin < end) imprimirArreglo(begin + 1, end, arr); else cout << endl; } int main() { array < short...
ALGO
0.990165
4.59267
a38bcee3-d5a0-453d-a2f4-bccfa298f2a1
Priyadarshan2000/Hacktoberfest_2k22
DSA/Singly_Linked_List.cpp
#include <iostream> using namespace std; void getch(); void clrscr(); template <class T> class Node { public: T info; Node *ptr; }; template <class T> class SinglyLinkedList { protected: Node<T> *head, *tail; public: // Constructor SinglyLinkedList() { head = tail = NULL; ...
ALGO
0.996745
4.513989
226c73f4-3452-43c2-9f8d-9a9d878fde7e
arianneg/cs3505_stuff
3505_NetworkSpreadsheet/zip shit/Spreadsheet Server/Formula.cpp
#include "Formula.h" #include <string> #include <exception> #include <iostream> // std::cout #include <stack> // std::stack #include <vector> // std::vector #include <deque> #include <boost/regex.hpp> using namespace std; Formula::Formula(string formula) { this->cellname = formula; this->to...
TOOL
0.911364
4.107546
b31cd50c-3b89-4370-9f4b-8715948b2729
Nanored4498/CodeJam
2020/2020_round_1c/oversized_pancake_choppers.cpp
#include <iostream> #include <algorithm> #include <map> #include <vector> using namespace std; typedef long long LL; typedef pair<LL, LL> PLL; typedef pair<int, int> PII; int main() { ios::sync_with_stdio(false); cout.tie(nullptr); int T, N, D; cin >> T; for(int t = 1; t <= T; ++t) { cin >> N >> D; vector<...
ALGO
0.999833
4.536609
c7f4860f-9a56-4475-8626-00e825ec17ec
tiyamti/university
basics of programming/functions & pointers/main6.cpp
/*Your program first receives one of the following four strings: "double", "float", "char", or "int". Then, it receives two numbers, which are memory addresses corresponding to two hypothetical elements of an array with the data type specified by the string received at the start. Using a function, you need to calculate...
ALGO
0.995667
3.679242
7ece164d-6676-4ce0-bd34-26d83f682a37
EngineerXL/op-report-template
autumn21/src/gp_dolgop_g.cpp
#include <bits/stdc++.h> using namespace std; #define flush cout.flush using ll = long long; using ull = unsigned long long; using ld = long double; using pl = pair<ll, ll>; const ll INF = 1e9 + 7; const ll mod = 1e9 + 7; const ll mod2 = 998244353; const ld eps = 1e-9; const ld PI = acos(-1); struct line { ld k...
ALGO
0.999707
4.377969
435e9529-ae7e-4ad1-80a6-9d80354f11b6
muskankumari11/Placement-Dairy
DSA/Linkedlist/4). creating linkedlist.cpp
#include<iostream> using namespace std; class Node{ public: int val; Node*next; //using constructor Node(int val){ this->val=val; this->next=NULL; } }; int main(){ Node* a=new Node(10); Node* b=new Node(20); Node* c=new Node(30); Node* d=new Node(40); a->next=b; b...
ALGO
0.998413
3.095376
df23ffc9-a730-4664-ad16-99b739e8fcbb
if1live/essential-game-programming-GameLib
src/12_2DTransform/TranslationWithMatrix23/Matrix23.cpp
#include "Matrix23.h" #include "Vector2.h" Matrix23::Matrix23( double e00, double e01, double e02, double e10, double e11, double e12 ) : m00( e00 ), m01( e01 ), m02( e02 ), m10( e10 ), m11( e11 ), m12( e12 ){ } void Matrix23::multiply( Vector2* out, const Vector2& in ) const { double tx = in.x; //outとinが同じかもしれないので...
ALGO
0.933332
4.246542
3eee8e9d-42b9-4702-b4b5-0b6d38168299
raincross7/code-similarity
codes/train_code/problem334/problem334_178.cpp
#include "iostream" using namespace std; int main() { int n; cin>>n; string s,t; cin>>s>>t; string result; for(int i=0;i<n;i++) { result=result + s[i] +t[i]; } cout<<result<<endl; }
ALGO
0.999851
3.551912
e2814c06-64fa-4b72-b799-4f0c5203b586
ftiasch/acm-icpc
multi-university-trainings/2011/contest-16/G.cpp
#include <cassert> #include <cstdio> #include <cstring> #include <climits> #include <algorithm> using namespace std; const int N = 1000; int n, a[N], longest[N]; const int V = 2 * N + 2; int nodeCount, capacity[V][V], level[V], queue[V]; bool bfs(int source, int target) { memset(level, -1, sizeof(level)); ...
ALGO
0.999598
3.342615
41224e1a-909f-41c4-8f8e-3120000cb4fb
Guddukuma/C-.
repet_element.cpp
#include <iostream> #include "bits\stdc++.h" using namespace std; int main() { int n; cin>>n; int arr[n]; for (int i=0; i<n; i++){ cin>>arr[i]; } cout<<"Hii"; const int N = 1e6+2; int idx[N]; for (int i=0;i<N;i++){ idx[i]=-1; } int minidx=INT_MAX; for(int i=0;i<n;i++){ if(idx[arr[i]] !=-1){ ...
ALGO
0.999902
4.070127
b453a99e-c931-4c98-8aa4-e398d7bee867
lclpsoz/competitive-programming
CF/1153/B.cpp
#include "bits/stdc++.h" using namespace std; ////////////// Prewritten code follows. Look down for solution. //////////////// #define x first #define y second #define len(x) ((int)(x).size()) using pii = pair<int, int>; using ll = long long; using llu = long long unsigned; using ld = long double; const ld EPS = 1e-9...
ALGO
0.999968
3.157198
0b08407a-4f37-4bd6-8cfd-77b6c16e5e0e
miyajiro/competitive_programming
atcoder/abc168/e/e.cpp
#define TO_BE_SUBMITTED #include <bits/stdc++.h> // #include <atcoder/fenwicktree> // #include <atcoder/segtree> // #include <atcoder/lazysegtree> // #include <atcoder/string> // #include <atcoder/math> // #include <atcoder/convolution> #include <atcoder/modint> // #include <atcoder/dsu> // #include <atcoder/maxflow> /...
ALGO
0.999918
5.153981
f97e8fbd-aa75-4098-9182-f5ef814ed5b3
joshualass/CP
Solutions/Default/builddependencies.cpp
#include <bits/stdc++.h> typedef long long ll; typedef long double ld; using namespace std; void printV(const vector<int> &x, map<int,string> rev) { cout << " --- vector --- \n"; // for(int y : x) { // cout << y << " "; // } for(int i = 0; i < x.size(); i++) { cout << rev[i] << "- " << ...
ALGO
0.999915
4.231719
a5a1421a-2087-44b9-a358-43ee935484af
WanDejun/vscode_cpp
vjudge/ICPC_ShanDong/M.cpp
#include<bits/stdc++.h> using namespace std; #define MAX_N 100000 struct Node { double x, y; }; Node operator - (const Node a, const Node b) { return {a.x - b.x, a.y - b.y}; } double cal(Node a, Node b, Node c) { b = b - a; c = c - a; return b.x * c.y - b.y * c.x; } int n, k; Node s[MAX_N + 5]; void...
ALGO
0.999552
4.498571
cc415d65-3e95-4a67-8031-efc9c2ee9dc2
AlexPara2003/GAT350
ThirdParty/glm/test/gtx/gtx_simd_mat4.cpp
/////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// /// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) /// Permission is hereby granted, free of charge, to any person obtaining a copy /// of this software and associated documentatio...
TEST
0.986865
6.515547
0bd0efad-b041-487d-9f4d-11451ebca10f
yifeihe007/FDTD
compiler-rt/lib/sanitizer_common/sanitizer_suppressions.cpp
#include "sanitizer_suppressions.h" #include "sanitizer_allocator_internal.h" #include "sanitizer_common.h" #include "sanitizer_flags.h" #include "sanitizer_file.h" #include "sanitizer_libc.h" #include "sanitizer_placement_new.h" namespace __sanitizer { SuppressionContext::SuppressionContext(const char *suppression_...
TOOL
0.863677
5.698095
707d10d3-d719-4299-a994-29109c830ab8
zainzahir/Programming-Fundamentals
Week 3/T9-cp.cpp
#include<iostream> using namespace std; void tpChecker(int people, int tp); int main(){ int people,tp; cout<<"Number of people in household: "; cin>>people; cout<<"Number of Rolls of TP: "; cin>>tp; tpChecker(people,tp); return 0; } void tpChecker(int people, int tp){ int totalTp, totalU...
ALGO
0.992378
4.354409
77f406fe-49e5-4459-92c7-c2b626e11e7a
ebahtiyar/NecatiErginCppKursuNotlari
2024_01_10/2024_01_10.cpp
// std::shared_mutex #include <shared_mutex> using namespace std::literals; int cnt = 0; std::shared_mutex mtx; void writer() { for (int i = 0; i < 10; ++i) { { std::scoped_lock lock(mtx); ++cnt; } std::this_thread::sleep_for(100ms); } } void reader() { for (int i = 0; i < 100; ++i) { int c; { // yazm...
TOOL
0.946548
5.214231
ef571d9d-01a8-4d7b-a954-b8cb420e85f7
Bubunker/PR_04_3
PR_04_2.cpp
#include "math.h" #include <cmath> #include "iostream" #include <string> #include <iomanip> #include <algorithm> #include <fstream> #include <stdio.h> using namespace std; /*Задание. Массив боссов и среди них с максимальной зарплатой */ int q = 1000000; int* p = new int[q]; class Sotrudnik { public: int zarplata;...
ALGO
0.980709
3.462422
53a8d381-fa80-4cc6-a224-a203422fe2d2
eth-sri/R4
Source/WebCore/xml/XPathNodeSet.cpp
#include "config.h" #include "XPathNodeSet.h" #include "Attr.h" #include "Element.h" #include "Node.h" namespace WebCore { namespace XPath { // When a node set is large, sorting it by traversing the whole document is better (we can // assume that we aren't dealing with documents that we cannot even traverse in reaso...
ALGO
0.938173
7.054713
75430c17-d325-4728-b8c3-0dbeab92fc7a
lanarayanne/EstudoCpp
Lista 1/P1 - Problema 1.cpp
#include <iostream> #include <vector> using namespace std; void rotate1(vector<int> &arr, int n) { int size = arr.size(); int last= size-1; int temp; for (int i = 0; i < n; i++) { temp = arr[last]; for (int j = last; j > 0; j--) { arr[j] = arr[j - 1]; } arr[...
ALGO
0.999978
4.84889
d912369d-f7fa-424b-824b-ce8aafbeb242
dhiman-64/DataStructures
10_SeachingSorting/secLargest.cpp
#include<iostream> #include<bits/stdc++.h> using namespace std; int secLargest(int arr[], int n) { int max = INT_MIN; int secmax = INT_MIN; for(int i=0 ; i<n ; i++){ if(arr[i]>max){ max = arr[i]; } } for(int i=0 ; i<n ; i++){ if(arr[i]<max && arr[i]>secmax){ ...
ALGO
0.999943
4.200661
b9aa92d4-f12b-49f5-81c0-9f9d1793f690
Halum/UVA-Codes
Big Mod.cpp
#include<stdio.h> #include<iostream> #include<cmath> #include<cstring> #include<cctype> #include<cstdlib> #include<utility> #include<functional> #include<bitset> #include<deque> #include<set> #include<algorithm> #include<ctime> #include<string> #include<list> #include<vector> #include<stack> #include<queue> #include<ma...
ALGO
0.999873
3.666479
03704b8e-609b-4dc3-bfe5-db15dcc3921f
MarkGhann/array-sorting
bubble-sort/bubble.cpp
#include "../MyArray.h" void MyArray::BubbleSort() { for(size_t i = 0; i < this->curr; i++) { for(size_t j = 0; j < this->curr - 1; j++) { if (this->arr[j] > this->arr[j+1]) { this->Replace(j, j+1); } } } }
ALGO
0.992463
3.673256
5c184d1a-f0a2-4f47-908c-523cbc06b550
yeye921/Algorithm-cpp
Study/Logic/upper_bound.cpp
// lower_bound(): 어떠한 값 이상인 것의 위치 = 그 값 이상인 것의 위치 // upper_bound(): 그 값이 나오기 전의 위치 = "그 값보다 첫번째로 큰 수의 위치" (뒤에서부터 탐색) // 둘은 이터레이터를 반환하기 때문에 꼭 시작주소를 빼줘서 int형으로 몇번째인지 파악하자 #include <bits/stdc++.h> using namespace std; vector<int> v; int main(){ for(int i = 2; i <= 5; i++) v.push_back(i); // v = {2, 3, 4, 5} v.pus...
ALGO
0.999556
4.336728
55026c50-51cb-4fce-baf3-2d1bd48e293d
hschoi1104/Algorithm
BOJ/시뮬레이션/8982_수족관 1.cpp
#include <iostream> #include <vector> #include <algorithm> using namespace std; vector<int>wall, water, hole; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n; cin >> n; int a, b; cin >> a >> b; for (int i = 0; i < n / 2-1; i++) { int a, b, c, d; cin >> a >> b >> c >> d; for (int s = a;...
ALGO
0.999222
4.002212
cac2d66a-28dd-40f3-9d36-40af65f9c3eb
raincross7/code-similarity
codes/train_code/problem285/problem285_381.cpp
#include <vector> #include <list> #include <map> #include <set> #include <queue> #include <deque> #include <tuple> #include <stack> #include <bitset> #include <algorithm> #include <functional> #include <numeric> #include <utility> #include <sstream> #include <iostream> #include <iomanip> #include <cstdio> #include <cma...
ALGO
0.999815
3.103511
ef45d615-626b-4459-b7d3-f67ecec22961
LRMPUT/PlaneLoc
src/UnionFind.cpp
#include "UnionFind.h" UnionFind::UnionFind(int icount){ set.resize(icount); } UnionFind::~UnionFind(){ } int UnionFind::findSet(int node){ if(set[node].parent == -1){ return node; } set[node].parent = findSet(set[node].parent); return set[node].parent; } int UnionFind::unionSets(int node1, int node2){ in...
ALGO
0.993356
4.166953
3c1dee29-3ba5-4216-81cf-e20bc9c65519
AshvinBa/CPP_Programs-2
String's/Apend_Operator.cpp
#include<iostream> #include<bits/stdc++.h> using namespace std; int main(){ string s1; string s2; cout<<"Enter the s1: "; cin>>s1; cout<<"Enter the s2: "; cin>>s2; cout<<s1+s2<<endl; return 0; }
TOOL
0.928876
3.361872
ec05e340-021a-47ef-a1a6-95231fa5b850
vladmaryna/laborat
lab6_3.cpp
#include <iostream> using namespace std; int main() { double a, b, c; cin >>a>>b>>c; if (a+b>c && a+c>b && b+c>a) { if(a==b && b==c) { cout<<"rivnostor"<<endl; } if(a==b || b==c || c==a) { cout<<"rivnobedr"<<endl; } if(a!=b && b!=c && c!=a) { ...
ALGO
0.998097
3.665023
43674db8-8ace-4cc9-9cf3-ac5f2a6bee04
luowanqian/LeetCode
101-200/200_NumberOfIslands/solution1.cpp
#include <iostream> #include <vector> #include <queue> #include <string> using namespace std; class Solution { private: queue<pair<int, int>> trace; public: int numIslands(vector<vector<char>>& grid) { int res = 0; int numRows = grid.size(); int numCols = numRows > 0 ? grid[0].size() : ...
ALGO
0.999931
6.603408
98a6fdc5-7264-41d9-b2b7-23815f1dbb6d
raincross7/code-similarity
codes/train_code/problem484/problem484_362.cpp
#include <iostream> #include <string> using namespace std; int main(){ string s; string t; cin >> s; cin >> t; bool bad = false; int size = s.size(); // cout << size; for(int i = 0; i < size; i++){ if(s[i] != t[i]){ bad = true; // cout << i; break; } } if(bad) cout << "No"; else cout << "...
ALGO
0.999993
3.717068
bd8cc716-5fca-4ad4-ae3d-c87b39747236
ishandutta2007/codeforces
tzxydby/normal/1556/H.cpp
#include<bits/stdc++.h> using namespace std; const int N=55,inf=1e9; int n,k,u[N*N],v[N*N],w[N*N],s,t,d,in[N*N],c[N*N],q[N*N*N*N],dis[N*N],pr[N*N],a[N*N],lj[N][N],ans=inf,bg,ed; vector<int>e[N*N]; struct d1 { int f[N]; void init(int n){for(int i=1;i<=n;i++)f[i]=i;} int fa(int x){return x==f[x]?x:f[x]=fa(f[x]);} voi...
ALGO
0.999966
3.487846
57e006bf-f4b9-4c7f-8ceb-d187eeee5aff
Shivam08IITKGP/OtherCP
Atcoder/abc395_D_PigeonSwap.cpp
void solve() { int n, q; cin >> n >> q; DisjointSet ds(n); int a, b; map<int, int> color_index; for (int i = 1; i <= n; i++) { color_index[i] = i; } map<int, int> index_color; for (int i = 1; i <= n; i++) { index_color[i] = i; } while (q--) { ...
ALGO
0.99988
4.936965
b41b199a-b2d2-4559-91da-bbb13769da7b
minnce/codechef
1200-1400/arrangingCupcakes.cpp
#include <iostream> #include <bits/stdc++.h> #define ll long long #define pb push_back #define F first #define S second #define vt vector using namespace std; void solve() { ll n; cin >> n; ll maxi = 1e10; if (sqrt((double)n)==(int)sqrt(n)) { cout << 0 << endl; } else { for (int...
ALGO
0.999813
4.889177
4a2a80a5-cb97-416a-bb03-ba011ec0f8e9
Lerezz/Algorithmic-toolbox
week2/test1.cpp
#include<iostream> using namespace std; int fab(int n) { int a=0; int b=1; int c; if(n==1) return 1; if(n==0) return 0; for(int i=2;i<=n;i++) { c=a+b; a=b; b=c; } return c; } int main() { int n; cin>>n; int res=fab(n); cout<<res; }
ALGO
0.99999
4.380008
cfaf9fd2-1f5f-4066-9091-54193a0f9f9d
vms2805/DSA2-SEM4
intopost_withbracees.cpp
#include <iostream> //#include<bits/stdc++.h> #include <stdlib.h> using namespace std; class Node { public: char data; Node *next; }; class stack { private: /* data */ Node *top; public: stack() { top = NULL; } void push(/* args */ char x); char pop(); // int check_expre...
ALGO
0.999985
4.317727
b65dfbc0-11bd-4374-befb-04c0935e253d
mkp0/CP
CodeForce/A - Boboniu Likes to Color Balls.cpp
#include <bits/stdc++.h> using namespace std; int main() { int t; cin >> t; while (t--) { long long a, b, c, d; cin >> a >> b >> c >> d; int mod1 = a % 2 + b % 2 + c % 2 + d % 2; if (mod1 <= 1) { cout << "YES" << endl; continue; }...
ALGO
0.999094
3.84367
6c45257d-fd3a-497b-b100-8ac9a8e3e8ab
LucaMizrahi/SuperComp
aula15/ex6.cpp
#include <mpi.h> #include <iostream> int main(int argc, char** argv) { MPI_Init(&argc, &argv); // Inicializa o ambiente MPI int rank, size; MPI_Comm_rank(MPI_COMM_WORLD, &rank); // Obter o rank do processo atual MPI_Comm_size(MPI_COMM_WORLD, &size); // Obter o número total de processos int men...
ALGO
0.993225
5.869966
a2263468-be0b-40f6-bb54-fb6e95edb6be
ishandutta2007/codeforces
dhxh/normal/1250/A.cpp
#include <iostream> #include <cstdio> #include <cstdlib> #include <cmath> #include <cstring> #include <string> #include <algorithm> using namespace std; const int maxn = 1e5 + 5; int n, m, t; int a[maxn]; int cnt[50]; int read(){ int x; scanf("%d", &x); return x; } int solve(){ int i, j; if(n == 1){ if(a[1...
ALGO
0.999925
3.837019
a11d4867-ccc8-42bf-b8a7-30b28b3ff83e
ishandutta2007/codeforces
linkct/normal/348/A.cpp
#include <cstdio> typedef long long int ll; inline ll max(ll a, ll b){return a > b ? a : b;} int main(){ int i, maxv = -1, t, n; ll sum = 0LL; scanf("%d", &n); for(i = 1; i <= n; ++ i){ scanf("%d", &t); if(t > maxv) maxv = t; sum += t; } printf("%I64d\n", max(maxv, (sum - 1) / (n - 1) + 1)); return 0; }
ALGO
0.999782
3.621112
7dae2e24-d547-4b6b-90c9-97789fdd7b46
marysaka/mina32-llvm
llvm/lib/CodeGen/ReachingDefAnalysis.cpp
#include "llvm/ADT/SmallSet.h" #include "llvm/CodeGen/LivePhysRegs.h" #include "llvm/CodeGen/ReachingDefAnalysis.h" #include "llvm/CodeGen/TargetRegisterInfo.h" #include "llvm/CodeGen/TargetSubtargetInfo.h" #include "llvm/Support/Debug.h" using namespace llvm; #define DEBUG_TYPE "reaching-deps-analysis" char Reachin...
ALGO
0.999182
7.759061
9a5737c7-0907-453d-9f5d-ffe2fbfdda37
enochii/leetcode-solution
494_target_sum.cpp
#include <vector> #include <iostream> using namespace std; // typedef long long ll; class _Solution { public: int findTargetSumWays(vector<int>& nums, int S) { // return(0, nums, S);//tmd,这都能返回一个值S int sum = 0; for(auto x:nums){ sum+=x; if(x<0)return -1; } ...
ALGO
0.999958
4.895026
50b83939-2f54-4c1c-abbc-5fb6a4a92ed6
Lewuathe/mlir-hello
thirdparty/llvm-project/clang-tools-extra/clang-tidy/utils/RenamerClangTidyCheck.cpp
#include "RenamerClangTidyCheck.h" #include "ASTUtils.h" #include "clang/AST/CXXInheritance.h" #include "clang/AST/RecursiveASTVisitor.h" #include "clang/ASTMatchers/ASTMatchFinder.h" #include "clang/Basic/CharInfo.h" #include "clang/Frontend/CompilerInstance.h" #include "clang/Lex/PPCallbacks.h" #include "clang/Lex/Pr...
TOOL
0.946678
6.126825
40eff999-6d9c-4ec1-b58c-ef3550f7d027
YooJeeSeok/Sol_Algo
BJ/BJ191231_10430.cpp
#include <iostream> using namespace std; int main(){ int a,b,c; cin >> a >> b >> c; cout << (a + b)% c << endl; cout << ((a % c) + (b%c))%c<< endl; cout << (a * b)% c << endl; cout << ((a % c) * (b%c))%c<< endl; return 0; }
ALGO
0.999926
3.700137
aa37fc77-45cf-45f7-9e1c-b1c08809c134
mutharibayub/Competitive_Programming
codeForces/round690div3/6.cpp
#include <iostream> #include <vector> #include <array> #include <algorithm> using namespace std; class FenwickTree { vector<int> arr; public: FenwickTree(int n) { arr.resize(n+1, 0); } void init(int n, int val) { arr.clear(); arr.resize(n+1, val); } void update(...
ALGO
0.999921
4.701993
9b1894f7-d264-4f03-afe4-9503c79b51cf
imkhateeb/Problem-Solving
Contests/codeforces/LIVE/Round_986_Div2/A.cpp
#include <bits/stdc++.h> #define let long long #define MOD 1000000007 #define pb push_back #define ppb pop_back #define mp make_pair #define ff first #define ss second #define all(x) x.begin(), x.end() #define endl "\n" #define vi vector<let> #define vvi vector<vector<let>> #define vs vector<string> #define vpii vector...
ALGO
0.999962
4.157702
3f933824-fd1c-4643-8961-c4accfcc7c3f
pawangupta5167/6Companies30Days
Goldman Sachs/5.cpp
//https://practice.geeksforgeeks.org/problems/ugly-numbers2254/1/# class Solution{ public: // #define ull unsigned long long /* Function to get the nth ugly number*/ ull getNthUglyNo(int n) { // code here set <long long int> s; s.insert(1); n--; while(n--){ auto it = s.begin(); ...
ALGO
0.99994
4.818008
ff2a4bbe-cf9c-4cab-963a-26c06fac5078
sischei/global_solution_methods_Rochester
Lecture_1/SparseGridCode/pyipopt/Ipopt-3.12.5/Ipopt/src/Algorithm/LinearSolvers/IpTripletToCSRConverter.cpp
#include "IpTripletToCSRConverter.hpp" #include <vector> #include <algorithm> #ifdef HAVE_CSTDDEF # include <cstddef> #else # ifdef HAVE_STDDEF_H # include <stddef.h> # else # error "don't have header file for stddef" # endif #endif namespace Ipopt { #if COIN_IPOPT_VERBOSITY > 0 static const Index dbg_verbosity =...
TOOL
0.861303
5.431803
aa4bad79-9b94-4868-853f-b24fd01e1d0a
PrathameshAundhakar/Data_Structures_And_Algorithms
HashMap/iterators.cpp
#include<bits/stdc++.h> using namespace std; int main(){ unordered_map<string,int> m; m["abc"]=1; m["def"]=2; m["ghi"]=3; m["jkl"]=4; m["mno"]=5; m["pqr"]=6; unordered_map<string,int>::iterator it=m.begin(); while(it!=m.end()){ cout<<"key : "<<it->first<<" value : "<<it->se...
ALGO
0.988838
3.879707
ef33534d-4543-4938-9b1b-584597c3e9e4
davil2020/Competitive-Programming
cses/Dynamic_Programming/dice_combinations.cpp
#include <bits/stdc++.h> using namespace std; #define _ ios_base::sync_with_stdio();cin.tie(0); #define rep(i,a,b) for(int i = a; i <= b; i++) #define endl '\n' #define f first #define s second #define pb push_back typedef long long ll; const int mod = 1e9 + 7; int main(){ int n; cin >> n; vector<ll> c...
ALGO
0.999988
4.917882
8e12211d-edfe-44c6-8dfd-6f20604583f4
KhoaTranNguyen/Github_Learning_Lab
PROGRAMMING-2/EXERCISES/MAX_SUM/factorial.cpp
#include <iostream> int factorial(int num){ if (num == 0) return 1; return num*factorial(num-1); } int main(){ int num; std::cin>>num; int fact = factorial(num); std::cout<<fact<<"\n"; }
ALGO
0.999966
5.617864
b876ec7c-56db-453e-bfe5-c7e2a217e196
anis016/DataStructures-Algorithm
UVA/739.cpp
#pragma warning (disable : 4789) #include<cstdio> #include<cstring> #include<cstdlib> #include<cctype> #include<cmath> #include<iostream> #include<fstream> #include<string> #include<vector> #include<queue> #include<map> #include<algorithm> #include<set> #include<sstream> #include<ctime> #include<stack> using namespace ...
ALGO
0.99963
3.324476
be0a9579-323a-4a5d-a065-e052588571be
cezime/mina
reference-07-groth16-prover/depends/xbyak/gen/sortline.cpp
#include <iostream> #include <fstream> #include <string> #include <set> typedef std::set<std::string> StrSet; int main() { StrSet ss; std::string line; while (std::getline(std::cin, line)) { if (!line.empty() && line[line.size() - 1] == '\n') { line.resize(line.size() - 1); } if (!line.empty()) { ss.in...
TOOL
0.872476
5.274673
a1728ecf-f100-4213-ae40-e3dc80328d41
wallaceketler/cplusplus
Aula9/copyswap.cpp
#include <iostream> using namespace std; template <class T> class CopySwap{ public: void swap(T&a, T&b){ T tmp(a); a = b; b = tmp; } };
ALGO
0.946909
3.103384
b37e2c59-bc33-4eda-a36b-b900c0b92e55
trilinos/Trilinos
packages/epetra/test/CrsRectMatrix/cxx_main.cpp
#include "Epetra_LocalMap.h" #include "Epetra_Map.h" #include "Epetra_Time.h" #include "Epetra_Vector.h" #include "Epetra_CrsMatrix.h" #include "Epetra_Flops.h" #include "Epetra_Export.h" #include "Epetra_Import.h" #include "Epetra_SerialDenseVector.h" #include "Epetra_IntSerialDenseVector.h" #ifdef EPETRA_MPI #include...
ALGO
0.954491
4.247835
6aa43b7e-30d5-4974-a3d2-8652759bf6a4
Dup4/competitive-programming
nowcoder/879/g.cpp
#include <bits/stdc++.h> using namespace std; #define N 2000010 int n, a[N], b[N], m; int main() { while (scanf("%d%d%d", &n, &a[1], &m) != EOF) { for (int i = 2; i <= n; ++i) { a[i] = (a[i - 1] + 7 * i % m) % m; } for (int i = 1; i <= n; ++i) { for (int j = i; j <=...
ALGO
0.99997
3.63785
299a92fb-5620-4a56-b5ff-a558fc5f6057
Akuma925/test_task
invert_bit/main.cpp
#include "iostream" using namespace std; template < typename T > inline T highbit(T& t) { return t = (((T)(-1)) >> 1) + 1; } template < typename T > std::ostream& bin(T& value, std::ostream &o) { for ( T bit = highbit(bit); bit; bit >>= 1 ) { o << ( ( value & bit ) ? '1' : '0' ); } ret...
ALGO
0.998504
4.441233
2588250e-bfd2-4a4f-917f-a0f373368b8b
Vikasshende/Competive-programming
Vector_Sort.cpp
#include<algorithm> #include<iostream> #include<vector> using namespace std; void display(vector<int> &v) { for(int j=0;j<v.size();j++) { cout<<v[j]<<" "; } } int main() { vector<int> v; int n; cin>>n; int x; for(int i=0;i<n;i++) { cin>>x; v.push_back(x); ...
ALGO
0.999948
4.576124
40f77e61-1e46-4dac-84dd-30ccfdda43e4
pranta-deba/problem-solved
DSA/01_Linear_Search.cpp
#include <bits/stdc++.h> using namespace std; int linearSearch(int arr[], int size, int target) { for (int i = 0; i < size; i++) { if (arr[i] == target) { return i; } } return -1; } int main() { int arr[5] = {2, 4, 6, 8, 10}; int size = sizeof(arr) / sizeof(...
ALGO
0.994753
5.818201
9441d26e-80dc-48ad-9f84-f46cbcac1dcc
hrithik86/algorithm
LIS-optimizedApproach.cpp
// Longest increasing subsequence in O(N*logN) time complexity #include <bits/stdc++.h> using namespace std; int longestSubsequence(int n, int a[]) { vector<int>v; v.push_back(a[0]); for(int i=1;i<n;i++){ if(a[i]>v.back()){ v.push_back(a[i]); } else{ int low=...
ALGO
0.999963
5.187322
d132ddd9-a7ed-44bf-8a45-fc30a60ccf3d
sachinites/Algo
DP/test.cpp
#include<iostream> #include<string> using namespace std; int minFlips(string arr) { int i,inversion1=0,inversion2=0; int n = arr.length(); for(i=0;i<n;i++) { if((i%2)==0) { if(arr[i]!='0') inversion1++; } else ...
ALGO
0.999894
4.905056
6d0521c6-2c73-420f-ac06-b4479aae211d
MillanPad/AlgoritmosINSO
Concurso/BateriasCoches/BateriasCoches.cpp
#include <iostream> #include <cstring> using namespace std; void ordenar(int *x,int len){ int permutacion; for(int i=1;i<len;i++){ for(int j=1;j<(len);j++){ if(x[j-1]>x[j]){ permutacion=x[j-1]; x[j-1]=x[j]; x[j]=permutacion; } } } } int main(){ int cantidad; double resist...
ALGO
0.999324
3.861203
c77ed26d-b833-4cd5-a79e-378443afbf26
juhik24/DSA-Sheet
112-path-sum/112-path-sum.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.999975
6.264527
da36cc6b-ed72-4928-bead-6a803933f5a9
opendemjapan/LIGGGHTS_Flexible_Fibers-202501-Unofficial-
src/compute_erotate_asphere.cpp
#include <mpi.h> #include "compute_erotate_asphere.h" #include "math_extra.h" #include "atom.h" #include "atom_vec_ellipsoid.h" #include "atom_vec_line.h" #include "atom_vec_tri.h" #include "update.h" #include "force.h" #include "memory.h" #include "error.h" using namespace LAMMPS_NS; /* -----------------------------...
ALGO
0.99453
6.583151
6ed42ff4-ef11-408d-8166-a45a821646ae
qcollins/fencing_referee_bot
fencing_referee/src/tournament.cpp
#include <algorithm> #include <cmath> #include <iostream> #include <ros/ros.h> #include <std_msgs/Bool.h> #include <std_msgs/Int8.h> #include <sound_play/sound_play.h> #include <sound_play/SoundRequest.h> using namespace std; string to_str(int i) { stringstream ss; ss << i; return ss.str(); } /* ============= VA...
TOOL
0.938801
5.414252
a11b1a2f-0b2e-4470-bbfa-b0fe0126e805
shivanshugupta7/codestepbystep-C-solution
parameterMystery2.cpp
/* Code Step By Step Practice Problems */ /* Dec 19th 2017 */ #include <iostream> using namespace std; string parameterMystery2( string& s1, string s2 ) { s1 += "1"; s2 += "2"; cout << s2 << " -- " << s1 << endl; return "!" + s2; } int main() { ...
TOOL
0.931873
3.870233
eecdedbc-7a06-4089-a223-5b99ebdb753c
azhongisme/StudyCode
并发编程/条件变量.cpp
#include <mutex> #include <thread> #include <iostream> #include <condition_variable> std::mutex mtx; std::condition_variable cv; bool ready = false; void do_print_id(int id) { std::unique_lock <std::mutex> lck(mtx); cv.wait(lck, [] {return ready == true; }); //第二个是参数为false那么将阻塞,参数需要函数be used as a function ...
TOOL
0.890068
4.561931
9249c45f-6803-476d-8f3a-6556bef6a69d
curvedns/curvedns
nacl/crypto_scalarmult/wrapper-base.cpp
#include <string> using std::string; #include "crypto_scalarmult.h" string crypto_scalarmult_base(const string &n) { unsigned char q[crypto_scalarmult_BYTES]; if (n.size() != crypto_scalarmult_SCALARBYTES) throw "incorrect scalar length"; crypto_scalarmult_base(q,(const unsigned char *) n.c_str()); return stri...
ALGO
0.975058
5.372132
9c32235c-8260-4fd6-9cc3-47e9f54dd77c
jerrychenh/vscode
src/HeapSort.cpp
#include <iostream> #include <vector> using namespace std; class Solution { public: void heapSort(vector<int>& nums){ if(nums.size() < 2) return; makeHeap(nums); for(int i = nums.size() - 1; i > 0; --i){ rearrange(nums, i); } } void rearrange(vector<int>& nums...
ALGO
0.999948
5.199653
b6a8b6bf-36a4-4d22-a1a8-ffaf6a5fa5bd
Bryans91/TeamCars
TeamCars/externals/box2d/Box2D/Dynamics/b2WorldCallbacks.cpp
#include <Box2D/Dynamics/b2WorldCallbacks.h> #include <Box2D/Dynamics/b2Fixture.h> // Return true if contact calculations should be performed between these two shapes. // If you implement your own collision filter you may want to build from this implementation. bool b2ContactFilter::ShouldCollide(b2Fixture* fixtureA, ...
TOOL
0.941817
7.142647
5f4dbce1-09f0-46e5-bfee-5489c8ad9293
rk3288-dev/android_frameworks_av
media/libstagefright/codecs/avc/enc/src/sad_halfpel.cpp
/* contains int AVCHalfPel1_SAD_MB(uint8 *ref,uint8 *blk,int dmin,int width,int ih,int jh) int AVCHalfPel2_SAD_MB(uint8 *ref,uint8 *blk,int dmin,int width) int AVCHalfPel1_SAD_Blk(uint8 *ref,uint8 *blk,int dmin,int width,int ih,int jh) int AVCHalfPel2_SAD_Blk(uint8 *ref,uint8 *blk,int dmin,int width) int AVCSAD_MB_Hal...
ALGO
0.999654
3.913443
4c32fbcc-fa5d-49af-8cbd-929f878ac64c
SegmentationFaultUtadeo/DS-A-Problemas
C++/Problemas/CodeForces/HelpFarmer/CFHelpFarmer.cpp
#include <bits/stdc++.h> #define endl "\n" using namespace std; typedef long long ll; int main(){ ll n; cin >> n; ll mini = LLONG_MAX, maxo = LLONG_MIN; for (ll a = 1; a *a * a <= n; ++a){ if (n % a == 0){ for (ll b = 1; b * b <= n/a; ++b){ if ((n/a) % b == 0){ ...
ALGO
0.999871
3.970698
905591f0-040b-435b-a9b0-58f56257e790
akashiitj/dsaprogram
hackerearth/mayhem/2q.cpp
#include<bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; int mod= 1000000007; #define fast ios_base::sync_with_stdio(false); #define frmlty int test_case;cin>>test_case;while(test_case--) #define vi vector<int> #define vs vector<string> #define vll ...
ALGO
0.99999
3.026673
4313e26d-6ae4-4e18-a91c-fde2ce330a6c
xManan/study
cpp/FileSysModule/splitStr.cpp
#ifndef SS_CPP #define SS_CPP #include <string> #include <vector> std::vector<std::string> splitStr(const std::string &s, const char c){ std::string tmp = ""; std::vector<std::string> res; for(int i=0; i<s.length(); ++i){ if(s[i] != c){ tmp += s[i]; } else if(tmp.l...
TOOL
0.976851
4.110423
691125b0-ad08-4575-97c7-48aee3555f85
SSonlam/bankingprogram
nguyen/bstree.cpp
#include "bstree.h" //constructors BSTree::BSTree() { } BSTree::~BSTree() { makeEmpty(); } //---------------------------------------------------------------------------- //function to insert a Client* into the binary tree, sets first value //as the root then sorts future data going to the left subtree is value /...
ALGO
0.969366
4.165548
dd1459bb-e1c7-481a-98d6-f19e4948bbee
sahuaman83/Competetive
Leetcode/Contains Duplicate III(leetcode).cpp
class Solution { public: bool containsNearbyAlmostDuplicate(vector<int>& nums, int k, int t) { int n=nums.size(); set<int> ss(nums.begin(), nums.end()); if( t == 0 && n == ss.size()) return false; for(int i = 0; i < n; ++i){ for(int j = i+1; j < i+1+k; ...
ALGO
0.999892
6.163316
f71544e7-f3e6-4f7c-a104-7ed7214a5fd5
KrolKamil/politechnika
semestr1/programowanie_cpp/lista_2/zad10/main.cpp
#include <iostream> using namespace std; int main() { string wynik = ""; unsigned int liczba; int pomoc = 1; int zera = 0; int jedynki = 0; cout<<"Wprowadz liczbe: "; cin>>liczba; while(pomoc<=liczba) { if(liczba&pomoc) { wynik = "1" + wynik; ...
ALGO
0.99966
4.417988
52754420-8414-47fc-a665-d9b622a2ba40
redwanpp/oj
beecrowd/prob1759.cpp
//ho ho ho #include <iostream> #define endl "\n" using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); int inpt, cnt; cnt = 0; cin >> inpt; while(cnt < inpt) { cout << "Ho"; cnt++; if(cnt == inpt) { cout << "!"; ...
ALGO
0.998127
3.418438
14dc5933-5c1f-4ebc-9b05-da1448fefbe6
artiam99/GeeksforGeeks
10 Dynamic Programming/3 Hard Problems/27 Count Arrays st 1 of every 2 adjacent element divides the other.cpp
#include<bits/stdc++.h> using namespace std; int Rec(int n,int m,int p,vector<vector<int>> &dp) { if(n == 0) return 1; if(dp[n][p] != -1) return dp[n][p]; dp[n][p] = 0; for(int i = 1 ; i <= m ; i++) { if(i > p && i%p == 0) dp[n][p] += Rec(n-1 , m , i , dp); if(i <= p && p%i == 0) dp[n][p] += Rec(n...
ALGO
0.999992
5.386332
fe90f14a-f93a-43d7-bb9e-cae8b7bfa453
113bommy/PathRepair
variable_trace/cpp/cpp_code/cpp_incorrect/cpp_incorrect_test_70_8.cpp
#include <bits/stdc++.h> using namespace std; const int N = 2e5 + 5, K = 1, mod = 1e9 + 7, inv2 = 5e8 + 4; int n, q; int a[N], s[N]; int c[N][K + 5], has[N][K + 5]; int ksm(int a, int x) { int tot = 1; while (x) { if (x & 1ll) tot = 1ll * tot * a % mod; a = 1ll * a * a % mod; x >>= 1ll; } return tot...
ALGO
0.999988
5.073679
a485d8fa-463f-46fb-a397-6c7d35a14925
zhaoyizheng0930/UnrealEngine
Engine/Source/ThirdParty/IntelTBB/IntelTBB-4.4u3/examples/parallel_for/tachyon/src/parse.cpp
/* * parse.cpp - an UltraLame (tm) parser for simple data files... */ // Try preventing lots of GCC warnings about ignored results of fscanf etc. #if !__INTEL_COMPILER #if __GNUC__<4 || __GNUC__==4 && __GNUC_MINOR__<5 // For older versions of GCC, disable use of __wur in GLIBC #undef _FORTIFY_SOURCE #define _FORTI...
TOOL
0.878637
5.020642
9dceb50f-be73-4839-9404-fb73800787aa
pan9pan9/Algorithm
1436.cpp
#include <iostream> #include <string> using namespace std; int main(){ int N; cin >> N; int cnt = 0; int num = 665; int temp; while(cnt != N){ num++; temp = num; while(temp != 0){ if(temp%1000 == 666){ cnt++; break; } else temp /= 10; } } cout << num; return 0; }
ALGO
0.999525
3.863889
4149a65c-1f8b-4431-a778-17d22e54fb6b
Kawser-nerd/CLCDSA
Source Codes/CodeJamData/12/51/7.cpp
#include <vector> #include <list> #include <map> #include <set> #include <queue> #include <deque> #include <stack> #include <bitset> #include <algorithm> #include <functional> #include <numeric> #include <utility> #include <sstream> #include <iostream> #include <iomanip> #include <cstdio> #include <cmath> #include <cst...
ALGO
0.99964
3.401105
031b56a8-a5ae-4529-8896-2faa459435d7
jookbooin/Algorithm
10week_Algorithm/ch2/B_2636/m2636.cpp
/** * ϸ 1ð ڿ ´. * * 1. ġ µ ɸ ð * 2. ѽð ִ ĭ * * row, col = 100 */ /** * (ݺ) * 1. ǥ -> ǥ * 2. ǥ 0 ȯ * 3. ġ * * * : ǥ̶ ´ ־ ϳ..? * */ #include <bits/stdc++.h> using namespace std; const int MAX_LEN = 101; const int dr[4] = {-1, 0, 1, 0}; const int dc[4] = {0, 1, 0, -1}; int R, C; int graph...
ALGO
0.999694
3.406218
83303f70-b043-4a58-bd95-71dd74cbd90a
NguyennGiang/CP_tutorial
BunDau/Lab05/bai9.cpp
#include <bits/stdc++.h> using namespace std; typedef struct { int x, y, z; } block; int n; block a[100]; int maxh[100]; void input(){ cin >> n; if (n == 0) exit(0); int x, y, z; for (int i = 1; i <= n; i++){ cin >> x >> y >> z; a[3 * i - 2].x = x; a[3 * i - 2].y = y; ...
ALGO
0.999111
4.159759
9387446c-64dd-4e9f-ad3b-19d75f88252a
SizzlingStats/hl2sdk-ob-valve
utils/vrad/vraddisps.cpp
#include "vrad.h" #include "UtlVector.h" #include "cmodel.h" #include "BSPTreeData.h" #include "VRAD_DispColl.h" #include "CollisionUtils.h" #include "lightmap.h" #include "Radial.h" #include "CollisionUtils.h" #include "mathlib/bumpvects.h" #include "UtlRBTree.h" #include "tier0/fasttimer.h" #include "disp_vrad.h" cl...
ALGO
0.97791
4.096786
4176ee32-bd46-418c-8de3-6aa9a12fd627
eyeboyplus/lc
test/test05.cpp
#include "./../lc.h" bool recursive(char* matrix, int rows, int cols, int i, int j, bool *board, char *str, int k) { if(*(str + k) == '\0') return true; if(i < 0 || i >= rows) return false; if(j < 0 || j >= cols) return false; if(board[i * cols + j]) return false; if(matrix[i * ...
ALGO
0.999503
5.864158
2baf1fed-f7b5-429d-a504-2c32d3ce1658
habib302/LeetCode-Solution
stack/next smallest element to left.cpp
#include <bits/stdc++.h> #include <vector> #include <algorithm> using namespace std; vector<int> NSEL(vector<int> nums); int main() { // added the two lines below for faster input ios_base::sync_with_stdio(false); cin.tie(NULL); //taking total testcases int t; cin>>t; while(t--) ...
ALGO
0.999951
4.921595
1da7a353-7308-453a-ab0e-2eaea2c853a3
Nickel-Nie/Leetcode-C-
DynamicProgramProblem/Solution64.cpp
// // Created by 聂伟豪 on 2023/2/15. // #include <vector> using namespace std; class Solution { public: int minPathSum(vector<vector<int>>& grid) { int m = grid.size(); int n = grid[0].size(); vector<vector<int>> dp(m, vector<int>(n, INT32_MAX)); dp[0][0]=grid[0][0]; for(int...
ALGO
0.999916
6.096172
a8cfe669-e59c-4183-86e1-66d88544c528
Stareat0707/Baekjoon-Online-Judge
15552. 빠른 A+B/Main.cpp
#include <iostream> int main() { std::ios_base::sync_with_stdio(false); std::cin.tie(NULL); int t; std::cin >> t; for (int i = 0; i < t; ++i) { int a, b; std::cin >> a >> b; std::cout << a + b << '\n'; } return 0; }
ALGO
0.998694
5.495321
c30826c5-97d4-4962-b895-2f0205030d3e
Rimaansh/MyUltimateDSAPackage
74-search-a-2d-matrix/search-a-2d-matrix.cpp
class Solution { public: bool searchMatrix(vector<vector<int>>& matrix, int target) { int m = matrix.size(); int n = matrix[0].size(); int lo = 0; int hi = m * n - 1; while (lo <= hi) { int mid = lo + (hi - lo) / 2; int r = mid / n; // Calculate row i...
ALGO
0.999967
6.771331
bcf2c90e-478f-44d8-94c1-4dbb2ca89cdc
rafaelleru/p2scd
SCD/Practica/Practica_1_fumadores/Fumadores.cpp
#include <iostream> #include <time.h> //incluye "time(....)" #include <unistd.h> //incluye "sleep(....)" y "usleep(....)" #include <stdlib.h> //incluye "rand(...)" y "srand" #include <semaphore.h> //incluye los semáforos #include <pthread.h> pthread_t fumadores[3] ; int quiero_seguir=0; sem_t continuar; //és...
ALGO
0.964983
3.44638