uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
eaf56b49-815b-485a-b456-c0738cb79328
allahrakha-7/Code_Daily
350-intersection-of-two-arrays-ii/intersection-of-two-arrays-ii.cpp
class Solution { public: vector<int> intersect(vector<int>& nums1, vector<int>& nums2) { unordered_map<int, int> counts; vector<int> intersection; for (int num : nums1) { counts[num]++; } for (int num : nums2) { if (counts[num] > 0) ...
ALGO
0.999938
5.968398
e48158de-dc20-43da-9b13-45dd64a0029a
bruce6005/PPHW3
Complete-Striped-Smith-Waterman-Library/src/example.cpp
// ========================== // example.cpp // This is a simple example to show you how to use the SSW C++ library. // To run this example: // 1) g++ -Wall ssw_cpp.cpp ssw.c example.cpp // 2) ./a.out // Created by Wan-Ping Lee on 09/04/12. // Last revision by Mengyao Zhao on 2023-Apr-21 // ========================== ...
ALGO
0.864645
4.648317
55ea4455-bebe-458f-bf2c-b8ded0b9171d
naylahuyne/dsa22
assign1/radix_sort.cpp
#include <iostream> #include <vector> #include <algorithm> #include <cmath> using namespace std; void printArr(const vector<int> &arr) { int n = arr.size(); for (int i = 0; i < n; i++) { cout << arr[i] << " "; } cout << endl; } int countDigits(int n) { int res(1); while (n / 10 > 0) {...
ALGO
0.999953
6.080494
1807cb30-6da2-4eae-a258-48254b80a45a
krishnakumbhaj/DSA
Recursion2/8IncreasingSubsequence.cpp
#include<iostream> #include<vector> using namespace std; void subvector(int arr[],int n,int idx,vector<int> ans){ if(idx == n){ if(ans.size() == 3) { for(int i = 0; i<ans.size(); i++){ cout<<ans[i]<<" "; } cout<<endl; ...
ALGO
0.999654
4.251639
53177c42-47c9-4b6e-ba46-5fe4194adc66
claudiapanza/Homework3
ros2_kdl_package/src/ros2_kdl_node_example.cpp
#include <kdl/chain.hpp> #include <kdl/chainfksolver.hpp> #include <kdl/chainfksolverpos_recursive.hpp> #include <kdl/frames_io.hpp> #include <stdio.h> #include <iostream> using namespace KDL; int main( int argc, char** argv ) { //Definition of a kinematic chain & add segments to the chain KDL::Chain chain; ...
ALGO
0.998073
5.588583
5d0fa7b8-2e47-490b-8399-aa8e3c4a7961
Thien-anh-De/DSA_soure_code
CODE_PTIT/DSA07001.cpp
#include <bits/stdc++.h> using namespace std; int main() { stack<int> st; string command; //chuoi lenh while (cin >> command) { if (command == "push") { int x; cin >> x; st.push(x); } else if (command == "pop") { if (!st.empty())...
ALGO
0.999612
5.041069
cb128593-c59a-4c6e-bad2-f1a298e47ad9
craigsapp/humextra
cli/minrhy.cpp
// // Programmer: Craig Stuart Sapp <<EMAIL>> // Creation Date: Sat Jun 9 14:48:41 PDT 2001 // Last Modified: Sun Jun 20 13:35:41 PDT 2010 added rational rhythms // Last Modified: Wed Jan 26 18:14:20 PST 2011 added --debug // Last Modified: Tue Apr 12 12:04:23 PDT 2011 fixed findlcm for rational rhys. // Last Modif...
ALGO
0.924093
4.503926
cf27f4a2-2fb3-4fc8-9733-4c6478f6d7be
MikaelVallenet/R-Type
libs/boost/libs/log/example/settings_file_custom_factories/main.cpp
/*! * \file main.cpp * \author Andrey Semashev * \date 12.05.2010 * * \brief An example of initializing the library from a settings file, * with custom filter and formatter factories for attributes. */ // #define BOOST_ALL_DYN_LINK 1 #include <string> #include <iostream> #include <fstream> #includ...
TOOL
0.89331
7.210421
5d503981-24d1-4383-b583-28a396489572
CyberGrandChallenge/clang-cgc
lib/CodeGen/LiveRangeCalc.cpp
#define DEBUG_TYPE "regalloc" #include "LiveRangeCalc.h" #include "llvm/CodeGen/MachineDominators.h" #include "llvm/CodeGen/MachineRegisterInfo.h" using namespace llvm; void LiveRangeCalc::reset(const MachineFunction *mf, SlotIndexes *SI, MachineDominatorTree *MDT, ...
TOOL
0.995659
7.963732
f73bc794-5d6e-417d-90fb-3d905ac30acd
sibiraja/svd-parallelized
parallel_src/parallel.cpp
#include "helper.h" #include <chrono> #include <cmath> #include <iostream> #include <vector> #include <random> using namespace std; using namespace std::chrono; // WORK: 2M^2 + (K * ((3M + 1) + 2M^2 + 2M + 1)) = 2M^2 + (K * (2M^2 + 5M + 2)) = 2KM^2 + 5MK + 2K + 2M^2 // DATA TRANSFERS: 3M^2 + (K * ((32M + 8) + (3M^2) ...
ALGO
0.999935
5.55481
14313632-bd14-4f36-abd7-e38c108b6433
Guvvala-Prasanth-Reddy/O-n-
onam-work/math.cpp
#include<bits/stdc++.h> #define ll long long #define str string #define pb push_back #define mp make_pair #define ff first #define ss second using namespace std ; int main() { unsigned ll n ,a ; cin >> n >> a; if( a != 10) { while(n--) { cout << a; } } else { if( n != 1) { cout << 1; n--; ...
ALGO
0.999847
3.102206
7bc551ab-f69f-45b1-8208-be54de16adfe
bheem2510/Data_Structure_using_Cpp
problems on numbers/check_armstrong.cpp
//3. Check if a number is prime or not //Armstrong Numbers are the numbers having the sum of digits raised to power no. of digits is equal to a given number. //Examples- 0, 1, 153, 370, 371, 407, and 1634 are some of the Armstrong Numbers. #include<bits/stdc++.h> using namespace std; int get_armstrong(int n){ int orig...
ALGO
0.999924
5.542777
7cf6f90e-eb88-489b-8884-3168394803af
horsetif/light_field_see_through
src/kmeans.cpp
#include "kmeans.h" #include<glm.hpp> /*void separatePoints(int width, int height, bool * pointGroup1, bool * pointGroup2, bool * sparseMap, glm::ivec2 * points) { //glm::vec2 t1 = glm::vec2(0.0f, 0.0f); //glm::vec2 t2 = glm::vec2(0.0f, 0.0f); float t1 = 0.0f; float t2 = 0.0f; float ct1 = 0.0f; float ct2 = ...
ALGO
0.998385
4.380989
f0adcc9a-03bd-474b-a91b-dca0702b3064
octopopo/MyLeetCode_2022
1663. Smallest String With A Given Numeric Value/Smallest_String_With_A_Given_Numeric_Value.cpp
class Solution { public: string getSmallestString(int n, int k) { string res = ""; string zpart = ""; string apart = ""; //This will be the number of Z int divZ = k/26; //This will be the remaining number int remZ = k%26; int remN = n-divZ; ...
ALGO
0.99995
5.753844
4892ff14-86eb-4118-a4f8-a354e9639dc2
basavarajakj/DataStructure_Algo_CPP
00-Basics/5-Conditionals_Loops/Loops/Patterns/19-Pattern.cpp
#include<iostream> using namespace std; /* A A B A B C A B C D A B C D E print row + 1 */ int main() { int numRows = 0; cin >> numRows; for (int row = 0; row < numRows; row++){ for (int col = 0; col < row + 1; col++){ char ch = col + 'A'; cout << ch << " "; } cout << endl; } ...
ALGO
0.999189
4.137198
1e7cbfaa-cbcb-4d3a-b092-3bd38a3724e5
Saifix/CPP-3rd-Sem-Data-Structures
Next Prime Number.cpp
#include<iostream> #include <ctime> using namespace std; bool prime(int n) { for (int z = 2; z <= sqrt(double(n)); z++) if (n % z == 0) return false; return true; } int main() { int num, stop; clock_t time_req; do { cout << "Please enter a number : "; cin >> num; time_req = clock(); for (int x = num;...
ALGO
0.999775
3.637103
eef65a73-bf7c-4111-83b9-1b048ba96887
codenuri/ecourse_cpp_basic
CPPBASIC_010050_FUNCTION/deleted_function2.cpp
#include <print> /* double gcd(double a, double b) { return b == 0 ? a : gcd(b, a % b); } */ double gcd(double a, double b); int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); } int main() { auto ret1 = gcd(9, 3); // int // auto ret2 = gcd(9.9, 3.3); // error // call xxxx }
ALGO
0.968888
3.488642
775ba9c6-1603-4409-bd07-71733dc24118
u-wyh/Mycode
二分图/匈牙利算法.cpp
#include<bits/stdc++.h> using namespace std; int n,m; //M, NֱʾҲ༯ϵԪ int graph[20][20]; //ڽӾͼ int p[20]; //¼ǰҲԪӦԪ bool vis[20]; //¼ҲԪǷѱʹ bool match(int i){ for (int j = 1; j <= m; j++){ if (graph[i][j] && !vis[j]) { //бδ vis[j] = true; //¼״̬Ϊʹ ...
ALGO
0.999993
3.721204
5a8b0055-8dfa-4dec-9bd0-6614a0e419c0
rishavgn/DSA_sheet
binaryTrees/checkBalancedBT.cpp
// { Driver Code Starts //Initial Template for C++ #include <bits/stdc++.h> using namespace std; // Tree Node struct Node { int data; Node* left; Node* right; }; // Utility function to create a new Tree Node Node* newNode(int val) { Node* temp = new Node; temp->data = val; temp->left = NULL; ...
ALGO
0.999925
6.712835
cc545bfb-a0f7-4759-80fb-a7699389ca83
HStudyCode/CPlusPlus_DSA
Patterns/2_Patterns.cpp
// a b c // d e f // g h i // print squire pattern #include <iostream> using namespace std; int main(){ int n=3; char ch='a'; int i,j; for(i=0; i<n; i++){ for(j=0; j<n; j++){ cout<<ch<<" "; ch++; } cout<<endl; } return 0; }
ALGO
0.999208
3.049614
439fd56a-e03e-4a9c-b26a-b94c5fab1209
facebookarchive/clangir
compiler-rt/lib/fuzzer/FuzzerIOWindows.cpp
#include "FuzzerExtFunctions.h" #include "FuzzerIO.h" #include <cstdarg> #include <cstdio> #include <fstream> #include <io.h> #include <iterator> #include <sys/stat.h> #include <sys/types.h> #include <windows.h> namespace fuzzer { static bool IsFile(const std::string &Path, const DWORD &FileAttributes) { if (FileA...
TOOL
0.863902
5.725334
afd2c872-c7ed-4262-9d0d-968f23bd4bac
Sanghyunn/2021-Summer
Day24/Princess_2457.cpp
#include <iostream> #include <deque> #include <algorithm> using namespace std; class Date { public : int month; int day; Date() { month = 0; day = 0; } Date(int m, int d) {month = m; day = d;} bool operator == (Date& t) { return (month == t.month) && (day == t.day); } bool operator > (Date& t) { if(month =...
ALGO
0.999835
4.392299
1bd914a3-8dbe-4a3c-8fe4-543b9207be25
elgamalsalman/cp-solutions
UVa/UVa_Solutions/00796_Critical_Links/00796.cpp
#include<bits/stdc++.h> using namespace std; typedef pair<int, int> ii; typedef vector<int> vi; typedef vector<vi> vvi; typedef vector<ii> vii; int dfsParent[505], dfsCounter, dfsNum[505], dfsLow[505], k, n; vvi adj; vii articulationEdges; void findArticulations (int u) { dfsNum[u] = dfsLow[u] = ++dfsCounter; fo...
ALGO
0.999804
4.128615
66df7af2-e6ea-4636-822d-bd574a298d6a
IBM/parallel-cycle-enumeration
src/CycleMain.cpp
#include <iostream> #include <fstream> #include <cstdint> #include <sys/stat.h> #include <limits.h> #include <unistd.h> #include <vector> #include <ctime> #include <chrono> #include <map> #include "utils.h" #include "Graph.h" #include "CycleEnumeration.h" #ifdef MPI_IMPL #include <mpi.h> #endif using namespace std;...
ALGO
0.995097
3.199094
8b980716-60b8-4cfd-9439-01b2fe107fff
johntanas/kattis
stampcombinations.cpp
#include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef pair<int,int> pii; typedef pair<ll,ll> pll; typedef long double ld; #define mp make_pair #define pb push_back #define nl "\n" #define all(v) v.begin(),v.end() #define fi first #define se second #define debug(x) cout << #x << ": " << x << ...
ALGO
0.999994
4.086941
334702f4-3d9d-453e-aedd-f354b5522ada
Anousheybaig/5thassignment
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
f351d6f6-c419-452c-b64e-9e1ebb79107b
ashutosh017/cp_journey
439_binary_cut.cpp
#include <bits/stdc++.h> using namespace std; // Values #define ll long long #define nline '\n' #define mod 1000000007 // Loops #define forn(i, a, b) for(ll i=a;i<=b;i++) #define ford(i,a,b) for(ll i=a;i>=b;i--) #define forc(i,a,b) for(char i=a;i<=b;i++) #define rep(i, n) forn(i, 0, n-1) // Containers #define vi vec...
ALGO
0.99954
4.049833
fd069962-3de2-48a5-ac2c-8cd96cb95c8b
kkw-11/Problem_Solving
Study/녹색 옷 입은 애가 젤다지.cpp
//https://www.acmicpc.net/problem/4485 //시간초과 풀이 #include <iostream> #include <cstring> #define endl "\n" #define MAX 126 #define INF 987654321 using namespace std; int N; int arr[MAX][MAX]; int dy[4] = { 0,1,0,-1 }; int dx[4] = { 1,0,-1,0 }; int sum[MAX][MAX]; void jelda(int a, int b) { int cost = sum[a][b]; i...
ALGO
0.999762
5.636187
fc4e08b5-2124-479d-bf0a-10d7a670e4af
phoboslab/JavaScriptCore-iOS
JavaScriptCore/dfg/DFGInPlaceAbstractState.cpp
#include "config.h" #include "DFGInPlaceAbstractState.h" #if ENABLE(DFG_JIT) #include "CodeBlock.h" #include "DFGBasicBlock.h" #include "GetByIdStatus.h" #include "Operations.h" #include "PutByIdStatus.h" #include "StringObject.h" namespace JSC { namespace DFG { InPlaceAbstractState::InPlaceAbstractState(Graph& gra...
ALGO
0.909372
6.9004
b373a339-80d4-494d-99d4-3429e5c19c28
difx/difx-archive
master_tags/DiFX-RA-1.0.1/mpifxcorr/utils/mpispeed.cpp
#include <mpi.h> #include <cstdlib> #include <cstdio> #include <time.h> void senddata(int rank, int n, int s, char *buffer, MPI_Comm comm) { int i, v; for(i = 0; i < n; i++) { v = MPI_Send(buffer, s, MPI_CHAR, rank+1, i, comm); printf("[%d] Sent %d -> %d\n", rank, i, v); } } void recvdata(int rank, int n, in...
ALGO
0.903321
4.489204
1a18bb4d-9875-4d6d-8ea6-4d81358f0ca0
Shitaibin/leetcode-2016
292.NimGame.cpp
// 判断你能否赢,不是判断一定赢 // https://github.com/haoel/leetcode/blob/master/algorithms/cpp/nimGame/nimGame.cpp class Solution { public: bool canWinNim(int n) { return n % 4; } };
ALGO
0.999966
5.823974
0e52872f-057c-4604-8fc2-4e0a73460e0a
ishandutta2007/codeforces
atreus/normal/301/D.cpp
#include <cstring> #include <algorithm> #include <map> #include <stack> #include <cassert> #include <cmath> #include <vector> #include <unordered_set> #include <unordered_map> #include <queue> #include <vector> #include <iostream> #include <set> #define MP make_pair #define F first #define PB push_back #define S second...
ALGO
0.999938
3.60405
874a202c-ed1c-4745-b25b-7d1d81619a5a
uaskh/Competitive_Programming
Random_Codes/findminmix.cpp
#include<iostream> using namespace std; struct node{ int data; node* left; node* right; }; node* root=NULL; node* getnewnode(){ node* currentnode=new node; currentnode->left=NULL; currentnode->right=NULL; return currentnode; } void insert(int data){ if(root==NULL){ root=getnewnode(); root->data=data; } el...
ALGO
0.999782
4.257589
13e31b1e-bc42-48dc-85a1-7332b2a249c4
malhardv/DSA
Trees/Binary Search Tree/bstToSortedDLL.cpp
#include<iostream> #include<queue> #include<vector> using namespace std; class Node { public: int val; Node* left = NULL; Node* right = NULL; Node(int val) { this -> val = val; this -> left = NULL; this -> right = NULL; } }; Node* insertInBST(Node* root, int data) { ...
ALGO
0.999947
5.054104
d6d0590e-d9c4-4230-ba4b-9e6a2a7c3c21
musbel/Snippets
cpp/MapRemovingElements.cpp
#include <iostream> #include <map> using namespace std; void printMap( const map<int, string>& m ) { for_each( m.begin(), m.end(), [] ( pair<int, string> p ) { cout << "[" << p.first << "] " << p.second << endl; } ); } int main( int argc, char *argv[] ) { map<int, string> people; people.insert( pair<i...
ALGO
0.984564
4.840931
ae18625a-2ebb-40a9-ad45-cecf55cbd4d5
salkhon/CSE318
offline2/CSPSolver/CSPSolver.cpp
#include "CSPSolver.hpp" #include <algorithm> #include "../VariableOrderHeuristic/VariableOrderHeuristic.hpp" #include "../VariableOrderHeuristic/SmallestDomain/SmallestDomainHeuristic.hpp" #include "../VariableOrderHeuristic/SmallestDomainMaxDegree/SmallestDomainMaxDegreeHeuristic.hpp" #include "../VariableOrderHeuris...
ALGO
0.999898
7.061225
b3d775cd-7dd2-408b-b55d-66a5b8892b95
shengren/Practice
leetcode/Find_Minimum_in_Rotated_Sorted_Array.cpp
class Solution { public: int findMin(vector<int> &num) { return FindMin(num, 0, num.size()); } private: int FindMin(const vector<int> &num, int a, int b) { if (num[a] <= num[b - 1]) return num[a]; int m = (a + b) / 2; return min(FindMin(num, a, m), FindMin(num, m, b)); } };
ALGO
0.999894
5.945478
3fc18354-f668-49db-9463-aea104489014
shubham-githb/LeetCode-Accepted-Solutions
378-kth-smallest-element-in-a-sorted-matrix/378-kth-smallest-element-in-a-sorted-matrix.cpp
class Solution { public: int kthSmallest(vector<vector<int>>& matrix, int k) { priority_queue<int> pq; int n = matrix.size(); int m = matrix[0].size(); for(int i=0;i<n;i++){ for(int j=0;j<m;j++){ if(pq.size()<k){ pq.push(matrix[i][j]); ...
ALGO
0.999991
5.783606
d15e1968-6aa6-4ca7-aa73-b0bbdfb5b4df
asad-shuvo/ACM
Online Judge/UVA/11960.cpp
#include <stdio.h> #include<math.h> int main() { // freopen("input.txt","rt",stdin); long long int i,j,k,l,m,mx,cnt,pos,n,test,sq; scanf("%lld",&test); while(test--) { mx=0; scanf("%lld",&n); for(i=1;i<=n;i++) { k=i; sq=sqrt(k); cnt=0; if(sq*sq==k) ...
ALGO
0.999956
4.020815
25973532-532e-4298-a3ec-91c8a2927fc5
RajuuTedd/Codeforces-solutions
71A.cpp
#include<iostream> using namespace std; int main (){ string s; int n; cin>> n; while (n--) { cin >> s; if (s.length() > 10){ cout << s[0] << s.length() - 2 << s[s.length() - 1] << endl; } else { cout << s << endl; } } return 0; }
ALGO
0.999286
3.725737
4d1326f6-56be-4cee-859c-d76fa36d9baa
BbillahrariBBr/cpp_practise_phitron
Module26/MYQUEUE.cpp
#include<bits/stdc++.h> using namespace std; class Node{ public: int value; Node* next; Node(int val) { value = val; next = NULL; } }; class Queue{ Node* front; Node* rear; public: Queue() { front = NULL; rear = NULL; } //enqueue --> ...
ALGO
0.995196
3.548785
82ae84f2-3675-4717-82c4-8ab71779dd9b
Farhana-Najnin/Datastructure
module23/How_STL_priority_queue_works_(max_heap)_module23.cpp
#include<bits/stdc++.h> using namespace std; int main(){ priority_queue<int>pq; while(true){ int c; cin>>c; if(c==0){ int x; cin>>x; pq.push(x);//o(logn) } else if(c==1){ pq.pop(); } else if(c==2) cout<<pq.top()<<endl;//o(1) else break; } r...
ALGO
0.999292
3.707662
6ef262c9-a9cb-47ce-b4c0-f711aa659fa8
ik04/daily-dsa
random/countDigits.cpp
#include <iostream> using namespace std; int countDigits(int n) { int original = n; // Keep the original number for modulo operations int count = 0; while (n > 0) { int digit = n % 10; // Extract the last digit if (digit != 0 && original % digit == 0) { // Check if the digit di...
ALGO
0.999649
6.348641
6831e1ae-c98e-46e7-bcfb-ac7d93297dab
tachyon83/code-rhino
DAY450~499/DAY479-BOJ14284_간선 이어가기2/yunkyu.cpp
#include <iostream> #include <algorithm> #include <queue> #include <vector> using namespace std; typedef pair<int, int> pii; int n, m, s, t; vector<pii> graph[5001]; int cost[5001]; void dijkstra() { priority_queue<pii,vector<pii>,greater<pii>> pq; cost[s] = 0; pq.push({ cost[s],s }); // s 지점부터 시작 while (!pq.empt...
ALGO
0.99991
4.715423
8583b3c8-3e2b-42f9-a9dc-dce2250f3d2e
AndyNichol3/URECA-finite-generator
.ccls-cache/@home@runner@URECA-2/type.cpp
#include <fstream> #include <iostream> #include <string> using namespace std; #include "type.h" // recursive funtion to generate all possible combinations void FindCombinations(int inputArray[], int combinationArray[], int start, int end, int index, int r, fstream &inFile) { if (index == r) ...
ALGO
0.988461
3.920758
d7f40f4f-9251-43ea-98b0-7de80afef7a4
zhibekkazbek/pp1-22B030546
codeinside/string/f.cpp
//F-n-ое слово //В первой строке дана целая строка. Во второй строке дано число n - номер слова, которое надо вывести. #include <iostream> using namespace std; int main(){ int pos=0; string s; getline(cin, s); int ans; cin >> ans; string t; s += " "; for(int i=0; i<s.size(); i++){ ...
ALGO
0.999305
3.197048
fd3152a9-c65b-4f95-a19c-a144432b6e01
Saibha69/CCE-2310-Competitive-Programming-Sessional
Cpp. sheet 1/V. Comparison.cpp
1.// Problem name: (V) Comparision. 2.// Course title: Competitive Programming Sessional 3.// Course code: CCE-2310 4.// Course teacher name: Mirza Raquib 5.// Date: 5/5/25 #include<bits/stdc++.h> using namespace std; int main() { long long A,B; char S; cin>>A>>S>>B; if(S=='<') { if(A<B) ...
ALGO
0.999933
3.170402
0d8c3380-e626-4dd7-8972-e90bd7784f77
Tasneem205/ICPC-Assuit-Sheets-Solution
juniors1/contests/contest#1/G. Digits and Multiplication.cpp
#include <iostream> #include <vector> #include <set> #include <bits/stdc++.h> #include <string> #include <algorithm> #include <map> #include <iomanip> typedef unsigned long long ull; typedef long long ll; typedef long double ld; using namespace std; ll f(ll a, ll b) { return max(floor(log10(a)) + 1, floor(log10(b...
ALGO
0.999896
5.249904
73ebc37e-f6d3-47d9-b94f-676097c8b63e
ameerkhan123ak/VisualStudioCode
Cplusplus/Problems/pattern_M.cpp
#include<bits/stdc++.h> using namespace std; int main() { int n; cin>>n; int start=1,end=n-2; for(int i=0;i<n;i++) { for(int j=0;j<n;j++) { if(j==0 || j==n-1) cout<<"*"; //first and last line of M | | else if(i==j && i<=n/2) cout<<"*"; /* line- \ */ ...
ALGO
0.999963
3.111782
fcc1ffd9-a647-4b9d-a4c0-95c49d06e7b1
sarvex/leetcode-elixir
solution/1300-1399/1358.Number of Substrings Containing All Three Characters/Solution.cpp
class Solution { public: int numberOfSubstrings(string s) { int d[3] = {-1, -1, -1}; int ans = 0; for (int i = 0; i < s.size(); ++i) { d[s[i] - 'a'] = i; ans += min(d[0], min(d[1], d[2])) + 1; } return ans; } };
ALGO
0.999955
5.553498
20d62780-8e07-4d15-a847-d1eddc9cbde9
jwezorek/advent_of_code
src/2022/day_03.cpp
#include "../util/util.h" #include "y2022.h" #include <filesystem> #include <functional> #include <print> #include <ranges> #include <unordered_map> #include <unordered_set> namespace r = std::ranges; namespace rv = std::ranges::views; /*--------------------------------------------------------------------------------...
ALGO
0.985574
5.601563
c158a01d-cf3c-4bd8-9aa6-2f0269915f0a
YayL/AOC
2021/Day15/Part1/main.cpp
#include <bits/stdc++.h> #define PRINT(x) std::cout << x << std::endl #define PRINTS(x) std::cout << x std::vector<std::vector<int>> map; int width, height, x, y, val; bool *visited; struct MouNode{ int cost; std::pair<int, int> coord; std::bitset<10000> path; MouNode(const int& cost, const int& x, const int& y...
ALGO
0.998978
3.963658
0abf4e61-3597-41db-a7d3-283802c1f981
oneapi-src/SYCLomatic
libcxx/test/std/containers/sequences/forwardlist/forwardlist.ops/sort.pass.cpp
// <forward_list> // void sort(); #include <forward_list> #include <iterator> #include <algorithm> #include <vector> #include <random> #include <cassert> #include "test_macros.h" #include "min_allocator.h" std::mt19937 randomness; template <class C> void test(int N) { typedef typename C::value_type T; typedef ...
TEST
0.964688
6.690365
4b3a23cb-67f4-4a54-868e-18eb2788466d
util6/cpp-algorithm-code
AcWing3300FoodTransportation.cpp
// // Created by 刘宇韬 on 2022/3/6. // #include "bits/stdc++.h" using namespace std; typedef long long LL; const int N = 105,M = 10,S = 1<<M; typedef pair<int,int> PII; #define x first #define y second int n,m,k; //存第n个点需要那些食材 int need[N][M]; //每个酒店需要食材的状态压缩 int state[N]; int h[N], e[N*2], ne[N*2],w[N*2], idx; //预处理从每辆车从...
ALGO
0.99989
4.36261
bfa3b7ec-255b-47c4-8e9d-fcbac5841bc7
HuyWibu/C_plus_plus
Lkeuocsotrongkhoang/main.cpp
#include <iostream> #include <math.h> using namespace std; /* run this program using the console pauser or add your own getch, system("pause") or input loop */ int ktraNT(int n) { if(n<2) return 0; else { for(int i=2 ; i<=sqrt(n) ; i++) { if(n%i==0) return 0; } return 1; } } int main(int argc, char** ...
ALGO
0.99946
4.074446
772ddaba-c433-4f4d-a3fc-5f792f300c83
ishandutta2007/codeforces
nishant403/normal/1301/E.cpp
#include <bits/stdc++.h> using namespace std; #define pb push_back #define S second #define F first #define f(i,n) for(int i=0;i<n;i++) #define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0) #define vi vector<int> #define pii pair<int,int> const int N = 506; int n,m,q; int a[4][N][N]; string s; int b[N][...
ALGO
0.997607
4.308937
252927b9-762e-4b80-90e5-8438c2cbd0c5
ShivamKureel1122/365-days-coding-challenge
day52-Reorder List.cpp
// Problem - https://www.interviewbit.com/problems/reorder-list/ ----------------------------------------------------------- ListNode* reverse(ListNode* head) { if(!head->next) return head; ListNode* newHead = reverse(head->next); head->next->next = head; head->next = NULL; return newHead;...
ALGO
0.999983
5.707883
1d2f1395-6350-49a8-9fc0-9c9b541bee5f
raiyan6c/XPSC
week8/Day7/C_TPrimes.cpp
#include<bits/stdc++.h> #define ll long long #define pb push_back #define vi vector<long long> #define si set<long long> #define pi priority_queue<long long> #define stc stack<ll> using namespace std; bool alu(ll n) { if(n==1) return false; for(ll i=2;i*i<=n;i++) { if(n%i==0) return false; } ...
ALGO
0.999508
5.209134
9e110215-91e0-414d-9a26-6db12f29fb32
keshav-goswami/DSA
GRAPHS/Kosarajus.cpp
#include<bits/stdc++.h> using namespace std; // Strongly Connected Components // Steps // 1) Find The topological sort // 2) Transpose the graph // 3) Perform DFS with topo order in transposed graph void toposort(int node,vector<int> &vis,stack<int> &st,vector<int> adj[]){ vis[node] = 1; for(auto i:adj[nod...
ALGO
0.999971
5.514296
70f0795c-b5f9-4d43-a273-abe439860d7d
huntermBerkeley/denro_taskflow
Fluid/src/root.cpp
#include <stdio.h> #include <string.h> #include <math.h> #include <stdlib.h> #include "mpi.h" #include "fluid.h" #include "root.h" #define SIGN(a,b) ((b) >= 0.0 ? fabs(a) : -fabs(a)) #define LTRACE 0 // rbrac {{{ /*------------------------------------------------------------------------- * * Routine from numeric...
ALGO
0.999939
5.640815
bca00ab8-5f40-4d5f-9224-fbe4f4139087
raincross7/code-similarity
codes/train_code/problem003/problem003_31.cpp
#include<bits/stdc++.h> using namespace std; typedef long long ll; template<typename T> ostream& operator<<(ostream &os, vector<T> &v){ string sep = " "; if(v.size()) os << v[0]; for(int i=1; i<v.size(); i++) os << sep << v[i]; return os; } template<typename T> istream& operator>>(istream &is, vector<T> &v){ for...
ALGO
0.999646
3.086895
0f54abef-9743-49ff-ad25-2c0d205f01ec
ishandutta2007/codeforces
tdpencil/normal/717/C.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> vi; typedef vector<long long> vl; typedef pair<int, int> pii; typedef pair<ll, ll> pll; #define sz(b) (int(b.size())) #define all(x) x.begin(), x.end() #define pb push_back #define popb pop_back #define tp top #define sumvt(x) accu...
ALGO
0.99994
4.442432
6cac2202-af17-4578-95df-dc2edf387c32
mutablealligator/scalable-ndn-forwarding
boost_1_60_0/libs/graph/example/topo_sort.cpp
typedef std::pair<std::size_t,std::size_t> Pair; /* Topological sort example The topological sort algorithm creates a linear ordering of the vertices such that if edge (u,v) appears in the graph, then u comes before v in the ordering. Sample output: A topological ordering: 2 5 0 1 4 3 */ int main(int ...
ALGO
0.999123
6.224144
4080d1e7-a488-48b1-a6f0-bfd6d638ca25
pranavsindura/CompetitiveProgramming
codeforces/contest/1327/a.cpp
#include<bits/stdc++.h> #define ll long long int #define pii pair<int,int> #define mod 1000000007 #define eps 0.000000001 #define all(x) x.begin(), x.end() #define allr(x) x.rbegin(), x.rend() #define sz(x) ((int)x.size()) #define ln(x) ((int)x.length()) #define mp make_pair #define pb push_back #define ff first #defin...
ALGO
0.99963
4.450666
c2a55067-ee30-4624-9fe6-0e2e0056b204
ErfanHossain/-CSE-122-spring-2023-50-06
1.Assignment/4.50-06-062-Assignment4.cpp
/* 4. Write a function which receives a float and an int from main(), finds the product of these two and returns the product which is printed through main() in C++. */ #include<iostream> #include<conio.h> #include<iomanip> using namespace std; double f(float i,int j) { float n; n=i*j; return(n); } int mai...
ALGO
0.850876
3.705924
580eb7b8-afe1-4665-a3cd-b742c03d68ab
Anmol-Mahajan/Coding-Questions
Merge_Sort.cpp
#include<stdio.h> #include<stdlib.h> // Function to Merge Arrays L and R into A. // lefCount = number of elements in L // rightCount = number of elements in R. void Merge(int *A,int *L,int leftCount,int *R,int rightCount) { int i,j,k; // i - to mark the index of left aubarray (L) // j - to mark the index of right ...
ALGO
0.999996
5.630349
061c5acb-3fd8-43ff-a08f-a937b29305b7
abhishek0948/CodeChef-Starters
Mighty_Friend.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long int #define vll vector<long long> #define pb(x) push_back(x) int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); ll t; cin>>t; while(t--){ ll n,k; cin>>n>>k; vll v(n); ll m_sum = 0; ...
ALGO
0.999932
4.315747
825ca0a4-8f95-46a9-be6b-9c08afdc3c84
MichaelAzmy/RDF-Deduplication
Graph_Embeddings/GEM/gem/c_src/graphFac_ret_ndarray.cpp
#include <boost/python/numpy.hpp> #include <boost/python/module.hpp> #include <boost/python/def.hpp> #include <fstream> #include <iomanip> #include <string> #include <numeric> #include <algorithm> #include <unistd.h> #include <cmath> #include <chrono> #include <random> #include <iostream> #include <assert.h> #include ...
DATA
0.918863
4.295203
e2bafcbd-2ca9-458a-b8a1-4bff558d39b7
ayushhharyann007/Ayush17_23-27_Sem1_Cpp_programs
avgmarks.cpp
//Including the library #include <iostream> //Standard namespace to be used using namespace std; //Class for getting data and maintaining the objects class Student{ private: //Initializing some value float sem1 , sem2 , sem3 , sem4 , sem5 ; float average; public: string nam...
TOOL
0.920697
3.675217
4de21897-fb9e-4159-bc4d-6d8ec06f9e3e
kimhj02/Algorithm_Backjoon
2150.cpp
#include <iostream> #include <vector> #include <stack> #include <algorithm> using namespace std; int vertex_num, edge_num; vector<vector<int>> graph, rev_graph; vector<bool> visited; stack<int> stack1; vector<vector<int>> scc; void dfs1(int node) { visited[node] = true; for (int next : graph[node]) { ...
ALGO
0.999958
5.042727
9470d97b-b464-4f2a-8b13-e1bada88e187
ermine27/competitive-programming
src/atcoder/abc/227/227-c-wa.cpp
// WA:cbrtとsqrtの誤差バグが生じる #include <bits/stdc++.h> using namespace std; using ll = long long; int main(){ ll n; cin >> n; ll ans = 0; ll r1 = cbrt(n); for(int i = 1; i <= r1; ++i){ ll r2 = sqrt(n/i); for(int j = i; j <= r2; ++j){ ll r3 = n / i / j; ans += r...
ALGO
0.999892
3.962973
55c93e42-c2a9-4de6-b272-e1961591b616
juangallardo0/UCA
AnalisisAlgorimos/DP/p437.cpp
#include<iostream> #include<vector> #include<algorithm> using namespace std; typedef struct dims { int x, y, z; dims(int a, int b, int c) { x = a; y = b; z = c; } bool operator < (const dims& area) const { return (x * y > area.x * area.y); } }dims; int boxStack(std::vector<dims> bricks) { s...
ALGO
0.999898
4.473053
4bf674bc-8282-4351-8656-0791a7bc09a4
psa1K/snake
Project2/源.cpp
#include<iostream> #include<windows.h> #include<vector> #include<conio.h> #include<time.h> using namespace std; #define random(a,b) (rand()%(b-a+1)+a) //ָλʾ struct Snake { int x, y; }; vector<Snake>snake; void gotoxy(int x,int y,char c) { CONSOLE_SCREEN_BUFFER_INFO csbiInfo; //variablendklaration HANDLE hConsoleOu...
TOOL
0.86851
3.296458
0b769afb-c049-4460-87cb-743cae025b37
starrykss/ProblemSolving
Baekjoon Online Judge (BOJ)/Codes/BOJ10811.cpp
#include <iostream> using namespace std; int N, M, i, j; int baskets[101]; int tmp[101]; void Initialize() { for (int i = 1; i <= 100; i++) { baskets[i] = i; // 1번째부터 N번째 바구니에 1부터 N까지의 숫자 넣기 } } void Input() { cin >> N >> M; for (int a = 1; a <= M; a++) { cin >> i >> j; ...
ALGO
0.999989
4.132436
3b63b68e-6d49-46b6-8157-61f7fa8b7d6a
11HimanshuSharma/REDOOOO_end
LIL_DP/1D_DP/Frog_jump_with_k_dist.cpp
#include<iostream> using namespace std; #include<vector> int Solve(int index,int maxSteps,vector<int> &cost,vector<int> &dp){ if (index == 0){ return 0; } if (dp[index] != -1){ return dp[index]; } int minLocalCost = INT_MAX; for (int i = 1 ; i <= ...
ALGO
0.999976
5.019658
c94df649-f5d2-42ee-a6af-00c7116c9b20
mcash8849/mcash
src/kernelrecord.cpp
#include "kernelrecord.h" #include "wallet.h" #include "base58.h" #ifdef _MSC_VER #pragma warning( disable : 4345) #endif using namespace std; bool KernelRecord::showTransaction(const CWalletTx &wtx) { if (wtx.IsCoinBase()) { if (wtx.GetDepthInMainChain() < 2) { return false; ...
TOOL
0.9335
5.061444
b7b30e0e-edf8-43de-aba1-57e9703b9cfd
atul-kumar-shahi/oops
string/practice10.cpp
#include<iostream> #include<cstring> using namespace std; int main() { static int c; string s1; string s2("aeiouAEIOU"); cout<<"Enter the string "<<endl; getline(cin,s1); int l=s1.length(); for(int j=0;j<l;j++) { for(int i=0;i<10;i++) { if(s1.at(j)==s2.at(i)) c++; }}...
ALGO
0.997934
3.922397
787a424f-b4eb-4f07-9a3a-8c7940fa501d
NadavMantsur/LeetCode
cpp/#70_climbing_stairs.cpp
#include <iostream> using namespace std; // dynamic programming - fibonacci // each number in fib serie represent the number of ways class Solution { public: int climbStairs(int n) { if (n <= 2) { return n; } int prev1 = 1; int prev2 = 2; in...
ALGO
0.999852
4.607216
60f338d8-9155-4116-bdb9-6bb15dceb375
YuzhenYe/WET
AIZU/xcube.cpp
#include <iostream> using namespace std; int main() { int t; cin>>t; cout<<t * t * t<<endl; }
ALGO
0.976704
3.07316
b1f4c625-c96a-4b56-a454-eb93a5fd9b89
SuvratZZZ/solved
ccef/s144b.cpp
#include <bits/stdc++.h> using namespace std; # define ll long long #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; #define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> # define pb push_back # define fl(i,n) for(ll...
ALGO
0.999907
4.332225
b17fec6d-6edb-48f6-b84e-d197dde15e36
RockCityDev/Alphagram-Android
TMessagesProj/jni/third_party/openh264/src/codec/decoder/core/src/decoder_core.cpp
#include "decoder_core.h" #include "error_code.h" #include "memmgr_nal_unit.h" #include "au_parser.h" #include "decode_slice.h" #include "manage_dec_ref.h" #include "expand_pic.h" #include "decoder.h" #include "decode_mb_aux.h" #include "memory_align.h" #include "error_concealment.h" namespace WelsDec { static inline ...
TOOL
0.878488
3.492143
cc15a910-c29a-41c0-b7f2-c9b2318b9dda
snandasena/cpp-advanced-topics
ds/leetcode/disjoint_set/src/disjoint_set_demo.cpp
// // Created by sajith on 4/28/22. // #include <bits/stdc++.h> using namespace std; class UnionFind { vector<int> root; public: explicit UnionFind(int size) : root(size) { iota(root.begin(), root.end(), 0); } int find(int x) { return root[x]; } void unionSet(int x...
ALGO
0.991807
4.497755
dcedcf96-496a-4ef6-ad67-240f0adb4c30
BGMer7/LeetCode
576. Out of Boundary Paths/outOfBoundaryPaths.cpp
#include <vector> #include <cstring> #include <iostream> using namespace std; class Solution { public: const int MOD = 1000000007; long dp[51][51][51]; int _m, _n, _maxMove; inline long dfs(int x, int y, int s) { if (s > _maxMove) return 0; if (x < 0 || x >= _m || y < ...
ALGO
0.999772
4.617509
5b8b2a17-7188-48c9-afb3-e23fdc0b258f
ishandutta2007/codeforces
savinov/normal/645/C.cpp
#include <bits/stdc++.h> #define clr(x) memset((x), 0, sizeof(x)) #define all(x) (x).begin(), (x).end() #define pb push_back #define mp make_pair #define in(x) int (x); input((x)); #define x first #define y second typedef int itn; //#define next next12345 //#define prev prev12345 #define left lefdsf232 #define right ...
ALGO
0.999951
4.358211
289fb6b0-693a-44e5-b370-b1694f653d55
deepti-iiitr/LeetCode_Practice
39-combination-sum/39-combination-sum.cpp
class Solution { public: vector<vector<int>>result; vector<int>current; int sum; void function(vector<int>& candidates,int target,int index) { if(sum>target)return ; if(sum==target){ result.push_back(current); } for(int i=index;i<candidates.size();i++){ sum+=candidat...
ALGO
0.999982
6.497089
aaa4f3b2-a65c-4818-a1a1-41064c6ba5d6
Proyecto-Athenas/athenas-reforged
dep/recastnavigation/Recast/Source/RecastFilter.cpp
#define _USE_MATH_DEFINES #include <math.h> #include <stdio.h> #include "Recast.h" #include "RecastAssert.h" /// @par /// /// Allows the formation of walkable regions that will flow over low lying /// objects such as curbs, and up structures such as stairways. /// /// Two neighboring spans are walkable if: <tt>rcAb...
ALGO
0.983283
6.925026
7ea0019f-193a-496c-b313-5dafb0568f79
smmahadee/xpsc_club
week_1/day_1/non_topicwise/A_Biscuit_Generator.cpp
#include <iostream> using namespace std; int main() { int a, b, t; cin >> a >> b >> t; int divideTimes = (t + 0.5) / a; cout << divideTimes * b; return 0; }
ALGO
0.999519
3.720848
98541b81-10c7-46f4-a55b-54671612c592
keyapatel1707/SE_Assigment_M2
C PROGRAMING/basic logic/32numbers and find out its sum.cpp
#include<stdio.h> int main() { int num1,num2; int sum; printf("enter first number:"); scanf("%d,&num1"); printf("enter secound number:"); scanf("%d,&num2"); sum=num1+num2; printf("the sum of %d and %d is:%d\n",num1,num2,sum); printf ("the size of the sum is:%zu\n",size of(sum)); }
ALGO
0.915418
3.021947
5c02db9b-4b81-4cb1-a9af-0639061d1602
yzcmf/Lintcode
22_flatten-list/flatten-list.cpp
/* @Copyright:LintCode @Author: zhouyx @Problem: http://www.lintcode.com/problem/flatten-list @Language: C++ @Datetime: 16-09-13 08:09 */ /** * // This is the interface that allows for creating nested lists. * // You should not implement it, or speculate about its implementation * class NestedInteger { * publ...
ALGO
0.99971
5.851742
fab8746a-be7b-4c12-96f8-291edf748c13
sakib-mustafa-ak/Tasks
DS_Lab_Solve_A.cpp
#include <bits/stdc++.h> using namespace std; int main() { int n; // Accept an integer n as the initial size of the array. cout << "Enter the initial size of the array: "; cin >> n; int a[100]; // Acceppt n integers as elements of the array. cout << "Enter " << n << " elements: "; for ...
ALGO
0.999639
4.475837
9cda0b2e-b599-448a-8764-d6a878159243
wanyuxing/CPP_learning
Assignment1-Receipt/src/Assignment1-Receipt.cpp
#include <iostream> #include <iomanip> using namespace std; int main() { float amtPer[3] = {0.0}, amtCat[3] = {0.0}; int person[3] = {1, 2, 3}; char category[3] = {'A', 'B', 'C'}; for (int i = 0; i < 3; i++) { int p; cin >> p; for (int j = 0; j < 3; j++) { if (person[j] == p) { int n; cin >...
ALGO
0.970354
3.57571
7eb60b20-1e08-4d92-a809-095ef623b4d6
syzygy-12/oi-wiki-page
ds/code/binary-heap/binary-heap_1.cpp
#include <cstdio> #include <iostream> #include <queue> using namespace std; int main() { int t, x; scanf("%d", &t); while (t--) { // 大根堆,维护前一半元素(存小值) priority_queue<int, vector<int>, less<int> > a; // 小根堆,维护后一半元素(存大值) priority_queue<int, vector<int>, greater<int> > b; while (scanf("%d", &x) &...
ALGO
0.999955
3.966514
2e6fe940-422b-41bf-9451-0ba770c4d7fa
Ambareen09/leetcode-pods
2215-find-the-difference-of-two-arrays/2215-find-the-difference-of-two-arrays.cpp
class Solution { public: vector<vector<int>> findDifference(vector<int>& nums1, vector<int>& nums2) { unordered_map<int, int> m; for(int i:nums1) m[i] = 1; for(int i:nums2) m[i] = 2; vector<int> v; for(auto i:m){ if(i.second == 1...
ALGO
0.999945
5.967598
42bd2a5d-9aad-4317-a858-d6f245c40d24
alexandraback/datacollection
solutions_5751500831719424_0/C++/BudgieInWA/a.cpp
#include<iostream> #include<vector> #include<algorithm> using namespace std; int main() { int kases; cin >> kases; for (int kase = 1; kase <= kases; kase++) { cout << "Case #" << kase << ": "; int n; cin >> n; vector<string> ss; vector<int> is(n, 0); int ml = 0; for (int i = 0; i < n; i++) { stri...
ALGO
0.999804
4.522766
fbd04041-e41c-429d-b2e2-b9c8d366fc62
JmsPae/Engine-Alpha
EngineAlpha/EngineAlpha/Box2D/Collision/b2CollideCircle.cpp
#include "Box2D/Collision/b2Collision.h" #include "Box2D/Collision/Shapes/b2CircleShape.h" #include "Box2D/Collision/Shapes/b2PolygonShape.h" void b2CollideCircles( b2Manifold* manifold, const b2CircleShape* circleA, const b2Transform& xfA, const b2CircleShape* circleB, const b2Transform& xfB) { manifold->pointCou...
ALGO
0.998495
7.761623
86431c96-0e42-45a0-aada-826c914a8921
libinghope/my-code-diaries
005-数据结构与算法/009sort/heapSort.cpp
//堆排序 void heapSort( int A[], int N ) { int i; int temp; //* 建立最大堆 for( i = (N-1)/2; i >= 0; i-- ) /*从有儿子的最后一个结点开始*/ Adjust(A, i, N); for( i = N-1; i > 0; i-- ){ /* 将堆顶元素A[0]与当前堆的最后一个元素A[i]换位 */ temp = A[0]; A[0] = A[i]; A[i] = temp; /* 将有i个元素的新堆从根结点向下过滤调整 */ ...
ALGO
0.999985
3.461427
bce30453-c87e-4fb7-8838-de41a18d54f8
gopoma/competitive-programming
tasks/2100.cpp
//* sometimes pragmas don't work, if so, just comment it! //? #pragma GCC optimize ("Ofast") //? #pragma GCC target ("avx,avx2") //! #pragma GCC optimize ("trapv") //! #undef _GLIBCXX_DEBUG //? for Stress Testing #include <bits/stdc++.h> //? if you don't want IntelliSense using namespace std; // building blocks usi...
ALGO
0.999365
4.501226
0f382b21-4b51-48ae-8403-9d5f96cb8576
TanishAggarwal5/coding_prep
cpp/StringStream/code.cpp
#include <sstream> #include <vector> #include <iostream> using namespace std; vector<int> parseInts(string str) { vector<int>v; stringstream ss(str); char ch; int i; while(ss>>i) { v.push_back(i); ss>>ch; } return v; // Complete this functio } int ma...
TOOL
0.974525
4.824783
9f0973aa-6117-4c61-88ce-744f720d55eb
FergalOK/aoc-2024
day_25/main.cpp
#include <iostream> #include <fstream> #include <cassert> #include <unordered_set> #include <set> #include <unordered_map> #include <regex> const int KEY_SIZE = 7; int main(int argc, char** argv) { assert(argc == 2); std::ifstream file(argv[1]); std::vector<std::vector<int>> keys; std::vector<std::ve...
ALGO
0.997839
4.194217
7bc6c88f-47a4-46de-8d74-23607587fa26
avinashsai/Spoj
Binary search/abcdef.cpp
#include<iostream> #include<algorithm> #include<vector> #include<stdio.h> #define ll long long int using namespace std; vector<ll>s1,s2; int main() { ll a[100],n,i,j,k,res=0,lo,hi; cin>>n; for(i=0;i<n;i++) cin>>a[i]; for(i=0;i<n;i++) { for(j=0;j<n;j++) { for(k=0;k<n;k++){ if(a[k]==0) ...
ALGO
0.999944
3.307863