uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
914962db-c97f-4f60-9459-e3e0911685d8 | Sumonta056/My-Codes | Competitive program solution/A+B.cpp | #include<iostream>
using namespace std;
int main()
{
unsigned long long int a,b;
for(int i =1 ; i<=12 ;i++)
{
cin>>a>>b;
cout<<a+b<<endl;
}
}
| ALGO | 0.995769 | 3.752443 |
70c2dd43-0078-4d41-887a-3e77e6f5b080 | karygauss03/Leetcode-Solutions | 0587-erect-the-fence/0587-erect-the-fence.cpp | class Solution {
private:
int cross(const vector<int>& a, const vector<int>& b, const vector<int>& c) {
return (b[0] - a[0]) * (c[1] - a[1]) - (b[1] - a[1]) * (c[0] - a[0]);
}
public:
vector<vector<int>> outerTrees(vector<vector<int>>& trees) {
int n = trees.size();
if (n <= 3) return tree... | ALGO | 0.999994 | 6.122661 |
79fc32d5-0e68-440e-971b-6f3acad798e2 | Seyamalam/C-Prac | 247 - Car and truck.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
int n,p,m,ans1,ans2;
cin>>n>>p>>m;
ans1=((n/p)-m)/2;
ans2=ans1+m;
cout<<ans1<<" "<<ans2;
return 0;
}
| ALGO | 0.99982 | 3.707738 |
02f6d92d-2736-416b-ad62-493bd0c5bca8 | yupi2/source-sdk-2007 | utils/vbsp/disp_ivp.cpp | struct disp_grid_t
{
int gridIndex;
CUtlVector<int> dispList;
};
static CUtlVector<disp_grid_t> gDispGridList;
disp_grid_t &FindOrInsertGrid( int gridIndex )
{
// linear search is slow, but only a few grids will be present
for ( int i = gDispGridList.Count()-1; i >= 0; i-- )
{
if ( gDispGridList[i].gridInde... | TOOL | 0.916298 | 5.124708 |
2c327a1d-88cf-4edb-8732-7b1f6d4529fe | faizan2307/meals_app | 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.998693 | 6.797273 |
87d137dc-3f0a-4ecf-b1fe-79988dd6d8f0 | Aryanlanghanoja/NBS_Training | 10-07-2024 Stack Using Linked List/Stack_Using_Linked_List.cpp | // #include <bits/stdc++.h>
// using namespace std;
// class ListNode {
// public:
// int data;
// ListNode* next;
// ListNode(int data) {
// this->data = data;
// this->next = nullptr;
// }
// };
// class Stack {
// private:
// ListNode* Top;
// public:
// Stack() {
// ... | ALGO | 0.9995 | 5.153786 |
1dbfc5f1-aeb0-4a11-9c92-6a0d3f33a6f9 | willzunker/lammps_mdr | src/fix_balance.cpp | #include "fix_balance.h"
#include "atom.h"
#include "balance.h"
#include "comm.h"
#include "domain.h"
#include "error.h"
#include "fix_store_atom.h"
#include "force.h"
#include "irregular.h"
#include "kspace.h"
#include "modify.h"
#include "neighbor.h"
#include "pair.h"
#include "rcb.h"
#include "update.h"
#include <... | ALGO | 0.987819 | 5.887251 |
7b28d8d2-b4d6-4940-a97a-69c18280c4ec | MINTU296/DSA | recursion/leetcode39.cpp | #include <iostream>
#include <vector>
using namespace std;
void combi(vector<int>& arr, int sum, int idx, vector<int>& ans) {
// Base case: If sum is less than 0 or index is out of bounds
if (sum < 0 || idx >= arr.size()) {
return;
}
// Base case: If the sum is 0, print the combination
if ... | ALGO | 0.999988 | 6.087845 |
672a8364-0792-4626-a655-ecb1fbfb4847 | XuepengShi/basic-algorithm | Others/hrbust1548(2).cpp | #include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <bitset>
#include <vector>
#include <list>
#include <deque>
#include <queue>
#include <stack>
#include <utility>
#include <map>
#include <set>
#include <stdexcept>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <ctime>
... | ALGO | 0.999945 | 3.110184 |
6620f09d-7d5b-4f2a-bbe1-3f803d0baf71 | sgtlaugh/algovault | code_library/fft.cpp | /***
* Fast Fourier Transformation
*
* Uses custom class for complex numbers and various optimizations for better performance
*
* Complexity:
* - O(MAX log MAX) pre-processing once
* - O(n log n) for all exposed methods
*
***/
#include <bits/stdc++.h>
#define MAX 2097152
using namespace std;
/// Use dou... | ALGO | 0.999967 | 3.579265 |
6a60a027-5159-422a-967e-65ca20a14741 | RoboticRobo/Mapping-robot | code/_merge_everything.cpp |
#include <stdio.h>
#include <assert.h>
#include <iostream>
#include <string.h>
#include <sys/types.h>
#include <winsock2.h>
#include <io.h>
#include <ws2tcpip.h>
#include <queue>
#include <stack>
#include "RobotConnector.h"
#include "cv.h"
#include "highgui.h"
#include <Windows.h>
#include <iostream>
#include <stdi... | TOOL | 0.894826 | 3.480197 |
5fc699b4-5ac4-4f3c-806e-bcc70e2db4c5 | xinlinqi/Sicily | 1200.cpp | #include <iostream>
#include <set>
using namespace std;
int main(void){
int n;
int temp;
multiset<int> arr;
while(cin >> n && n){
for(int i=0; i < n; i++){
cin >> temp;
if(arr.find(temp) != arr.end()){
arr.erase(arr.find(temp));
}else{
arr.insert(temp);
}
}
cout << *arr.begin() << endl;
... | ALGO | 0.998795 | 3.557982 |
9732ae9b-5828-4146-8832-8cec55ed3132 | Abir1373/XPSC-2 | W12/Extra/A_Kevin_and_Arithmetic.cpp | // Bismillahir Rahmanir Raheem
// author : VaLEnT_DouLoS ( Abir )
#include <bits/stdc++.h>
using namespace std ;
#define f first
#define s second
#define pb push_back
#define ppb pop_back
#define pf push_front
#define ppf pop_front
#define ll long long int
#define ld long double
#define nl '\n'
#define B begin
#d... | ALGO | 0.999966 | 4.139095 |
772ebac7-5de0-4b41-a3c6-c5a492e0021e | bitcoinfuzz/bitcoinfuzz | modules/bitcoin/crypto/hmac_sha512.cpp | #include <crypto/hmac_sha512.h>
#include <string.h>
CHMAC_SHA512::CHMAC_SHA512(const unsigned char* key, size_t keylen)
{
unsigned char rkey[128];
if (keylen <= 128) {
memcpy(rkey, key, keylen);
memset(rkey + keylen, 0, 128 - keylen);
} else {
CSHA512().Write(key, keylen).Finalize(... | ALGO | 0.910424 | 5.726457 |
b8507ee4-8166-4ac5-8387-5647b8b7e207 | Lydxn/Competitive-Programming | DMOJ/UCC/ucc21p5.cpp | #include <bits/stdc++.h>
using namespace std;
int dp[3][301][3][301];
int solve(int h1, int w1, int h2, int w2) {
if (h1 == 1 && w1 == 1 && h2 == 1 && w2 == 1) return 0;
if (dp[h1][w1][h2][w2] != -1) return dp[h1][w1][h2][w2];
bool res = false;
// option 1
for (int i = 1; i <= w1 - 1; i++)
res |= !solve(h1, i... | ALGO | 0.999479 | 3.527982 |
fcf28066-7e9b-4e78-9ac9-22cd736845d8 | 2001suraj/course | i_am_rich/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.997998 | 6.785645 |
d7a1863a-7653-4dc8-8cfe-26ff5584e5d5 | ishandutta2007/codeforces | wild_hamster/normal/776/D.cpp | #include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
#include <cstring>
#include <deque>
#include <stack>
#include <stdio.h>
#include <map>
#include <set>
#include <time.h>
#include <string>
#include <fstream>
#include <queue>
#include <bitset>
#include <cstdlib>
#include <assert.h>
#define X fir... | ALGO | 0.999996 | 4.082832 |
d8dc9620-da63-48bf-b194-6e52d6d93d37 | cjh8993/Algorithms | Chap6/6.BOGGLE/BOGGLE_CJH.cpp | #include <iostream>
#include <string>
using namespace std;
bool BoggleChecker(string* pannel, string input);
bool BoggleNearChecker(string* pannel, string c_input, int xidx, int yidx, int no_idx);
int main()
{
int cases;
cin >> cases;
while (cases--) {
//Boggle Pannel
string pannel[5];
for (int i = 0; i < ... | ALGO | 0.999798 | 5.252195 |
490bf936-7188-4b63-9dbf-8394ea583ebf | RomainLATRACE/Compute_enveloppeConvexe | calculEnveloppeConvexe.cpp | #include "calculEnveloppeConvexe.h"
vector<Point> CalculEnveloppeConvexe::algoGraham(vector<Point> points){
vector<Point> enveloppe;
if(points.size() < 3)
return points;
int yMinim = 0, i = 0;
Point pivot = points.front();
for(vector<Point>::iterator it = points.begin(); it != points.end(); ++it){
if(*i... | ALGO | 0.999846 | 4.72547 |
12c53cd7-7fd8-4055-9128-7039979af278 | raptor-library/raptor | raptor/util/linalg/par_matmult.cpp | using namespace raptor;
// Declare Private Methods
ParCSRMatrix* init_mat(ParCSCMatrix* A);
ParCSRMatrix* init_mat(ParCSRMatrix* A);
ParBSRMatrix* init_mat(ParBSRMatrix* A);
ParBSRMatrix* init_mat(ParBSCMatrix* A);
ParCSRMatrix* init_mat(ParCSCMatrix* A)
{
return new ParCSRMatrix(A->partition);
}
ParCSRMatrix* in... | ALGO | 0.997555 | 3.508126 |
0add19dd-0c8d-466c-a7df-9dbe56758be4 | AgentPengin/PhucCNH | CP-Code/Contest/41121/th.cpp | #include<iostream>
#include<iomanip>
#include<algorithm>
#include<math.h>
#include<cstring>
#include<vector>
#include<utility>
#include<set>
#include<queue>
using namespace std;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<long long> bigNum;
typedef vector<vector<int>> vii;
#define fastio ios_b... | ALGO | 0.999883 | 3.444032 |
fcdce481-b989-4067-bb7e-39a0f694154b | ciusji/sql_vectorization_compilation | src/benchmarks/simdJoin.cpp | #include <iostream>
#include <cassert>
#include <algorithm>
#include <ostream>
#include <vector>
#include <cstring>
#include <sys/mman.h>
#include <immintrin.h>
#include <cassert>
// #include "/opt/iaca-lin64/include/iacaMarks.h"
#include "profile.hpp"
using namespace std;
void* malloc_huge(size_t size) {
void* p... | ALGO | 0.976932 | 4.438744 |
175bcadb-8537-4360-9dac-534890487d24 | willydlw/leetcode | medium/2125/2125.cpp | /*
Anti-theft security devices are activated inside a bank. You are given a 0-indexed
binary string array bank representing the floor plan of the bank, which is
an m x n 2D matrix. bank[i] represents the ith row, consisting of '0's and '1's.
'0' means the cell is empty, while'1' means the cell has a ... | ALGO | 0.999842 | 6.979518 |
c837086e-3ff8-47c4-8153-81bbded1782f | swapnil312/CSE_4th_sem | TOC/02_Lab_02_01_2024/q1.cpp | // Take input of alphabet set, then take input a string and check if it is valid or not
# include <iostream>
# include <cstring>
using namespace std;
int check_string(string str, char* alpha)
{
int l = str.length();
if(l == 0)
{
return 1;
}
int l_alpha = strlen(alpha);
for(int i = 0... | ALGO | 0.998676 | 5.501313 |
c258b46b-30ac-43fb-a01e-64049e292b54 | Young22li/CT_Scan | DFT/main.cpp | // Discrete Fourier transform
// Edit By: Ziyang Li
// Date: 12/31/24
// Description: The dft of a set of numbers is computed and then the set is rederived by idft
#include <iostream>
#include <cmath>
#include <vector>
#include <numeric>
using namespace std;
vector<double> real, imag;
void dft(vector<int> &nums)
{
... | ALGO | 0.999134 | 3.572628 |
f7adb4a8-f7a8-4111-bc3b-1147a0051b61 | sarvex/leetcode-solidity | solution/0700-0799/0705.Design HashSet/Solution.cpp | class MyHashSet {
public:
bool data[1000001];
MyHashSet() {
memset(data, false, sizeof data);
}
void add(int key) {
data[key] = true;
}
void remove(int key) {
data[key] = false;
}
bool contains(int key) {
return data[key];
}
};
/**
* Your MyHashS... | ALGO | 0.998739 | 4.736753 |
5e5e1e6e-3d5a-45b8-bfde-5e4cff582bdd | parulvaghela18/practical-list-4 | p3.cpp | #include<iostream>
using namespace std;
class Student
{
public:
string name;
float spi;
};
int main()
{
Student student[10];
int highestspi=0;
for(int i=0;i<10;i++)
{
cout<<"Enter the name of student ::"<<i+1<<"::";
cin>>student[i].name;
cout<<"Enter SPI for "<<student[i].name<<"::";
cin>>student[i].... | ALGO | 0.978104 | 4.009392 |
d81168a6-ddbe-4c9a-8aaa-3f04b8a1127a | albertomain/termostato_arduino | numeroCicli.cpp | // numeroCicli.cpp
//*************************************************
// scrive ed IMPOSTA IL NUMERO DI CICLI DA ESEGUIRE
//*************************************************
#include "numeroCicli.h"
#include "MyLiquidCrystal.h"
#include "global.h"
numeroCicli::numeroCicli(){
Cicli = 50000;
}
numeroCicli::posPri... | TOOL | 0.888736 | 4.598799 |
f63b5a0e-c276-4196-9f16-fcfffe400761 | Mahmoudezzat00/problem-solving-with-c--main | Al-Azhar ICPC Community/Sheet #4 (Strings)/R. String Score.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int size;
cin>>size;
string value; // "VWY" ['Z','Y','0','Y','Z']
cin>>value;
int score = 0;
for(int i=0;i<value.size();i++){ // i = 0
char c = value[i]; // Z
switch(c){
case 'V':
score += 5;
break;
case 'W':
score ... | ALGO | 0.999874 | 3.484567 |
c5c7e9db-eaa0-4e16-952a-53cff29d871f | yzzupgo/MFTCG | Data/abc170_b/mohsinian/wa/14330658.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
long long int x,y;
cin>>x>>y;
if((y%2==0 || y%4==0)&&(y/4==x || y/2==x))
{
cout<<"Yes"<<"\n";
return 0;
}
int c_leg=y-4;
if((c_leg/2)+1==x && c_leg%2==0)
printf("Yes\n");
else
cout<<"No"<<"\n";
}
| ALGO | 0.999953 | 3.104028 |
f0a1b3cd-0972-4e84-8691-39d51696a892 | krishna-111/Cpp_Practice | AdvanceDS/4_Arrays/largestEvenOddSubarray.cpp | #include<iostream>
using namespace std;
int largestevenodd(int *arr,int n)
{
int sum=0,count=1;
for(int i=1;i<n;i++)
{
if((arr[i]%2==0 && arr[i-1]%2!=0) ||(arr[i]%2!=0 && arr[i-1]%2==0) )
{
count++;
if(i==n-1 && count>sum)
{
sum=count;
... | ALGO | 0.999355 | 4.509864 |
72bbbb12-5f2c-4aec-a7ca-e7582c780abb | vinayak501/DSA_CPP | children_sum_property_BT.cpp | //
// Created by vinayak on 19-07-2024.
//
using namespace std;
#include "TreeNode.h"
void changeTree(TreeNode* root) {
if (!root) return;
int child = 0;
if (root->left) {
child += root->left->val;
}
if (root->right) {
child += root->right->val;
}
if (child >= root->val) roo... | ALGO | 0.99998 | 5.496466 |
ec77f959-3d89-4df5-8ecb-c6b0fb7b4c48 | eggag32/Competitive-Programming | Codeforces/Love _A_.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pi;
#define debug(x) cout << #x << ": " << x << endl
#define repn(i, a, b) for(int i = (a); i < (b); i++)
#define rep(i, a) for(int i = 0; i < (a); i++)
#define all(v) v.begin(), v.end()
#define mp make_p... | ALGO | 0.998203 | 3.070918 |
11adc81e-deda-4872-b3e1-7d8996ee8daa | Randowlh/Project_ACM_2021 | code/competition/CodeRams Algorithm Contest/2.cpp | #include <bits/stdc++.h>
using namespace std;
#pragma optimize(2)
//#pragma GCC optimize("Ofast,no-stack-protector")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
const int inf = 0x7FFFFFFF;
typedef long long ll;
typedef double db;
typedef long double ld;
template<class T>inline v... | ALGO | 0.999949 | 4.039456 |
26526b70-84a8-43c1-8af4-c19c5900452d | rajneeshkumar09/C-language | area.cpp | #include<stdio.h>
#include<conio.h>
main()
{
int area();
area();
getch();
}
void area()
{
int b, h, ar;
printf("enter height: ");
scanf("%d",&h);
printf("enter base: ");
scanf("%d",&b);
ar=(b*h)/2;
printf("Area is %d",ar);
}
| TOOL | 0.971398 | 3.186642 |
5d412d1b-faeb-40e9-96f9-17110090b720 | Shakib29/DSA_Codes | 2Darray/print_likeawave.cpp | #include<iostream>
#include<vector>
using namespace std;
vector<int> printwave(int arr[][3],int r,int c){
vector<int> ans;
for(int j=0;j<c;j++){
if(j&1){
for(int i=r-1;i>=0;i--){
// cout<<arr[i][j]<<" ";
ans.push_back(arr[i][j]);
}
}
else{
for(int i=0;i<r;i++){
// cout<<arr[i][j]<<" "... | ALGO | 0.999876 | 3.935972 |
be0eb5c6-91de-4b2a-b2e7-0ddbc328c449 | SMHMS-01/VsCode | CPP_STORAGE/Algorithm/SEARCH/Hash.cpp | #include <iostream>
#include <windows.h>
#define SUCCESS 1
#define UNSUCCESS 0
#define MAXSIZE 999
#define OVERFLOW -1
#define ERROR -1
#define OK 1
using namespace std;
typedef bool status;
typedef int KeyType;
typedef struct
{
KeyType key;
} RcdType;
typedef struct
{
RcdType *rcd;//key value
int size;//c... | ALGO | 0.999706 | 4.532682 |
0cf8a910-ae77-4176-98a0-568907089f40 | Ritapravo/cpp | random/cpp/23.(path between 2 nodes).cpp | //finding a single path betwwen two nodes in a graph
#include<iostream>
#include<vector>
#include<bits/stdc++.h>
#define int long long int
#define v(x) vector<x>
using namespace std;
void print(v(v(int)) &arr);
void print(v(int)&arr);
void fpath(v(v(int))&graph, int u, int d, v(bool)vis, v(int)&path, v(int)curr = {})... | ALGO | 0.999876 | 4.48177 |
faf67457-c6ce-4d64-a629-a331154e583e | Airosspace/AIROS_DESIGN | blender-master/intern/cycles/integrator/path_trace_work_cpu.cpp | #include "integrator/path_trace_work_cpu.h"
#include "device/cpu/kernel.h"
#include "device/device.h"
#include "kernel/integrator/path_state.h"
#include "integrator/pass_accessor_cpu.h"
#include "integrator/path_trace_display.h"
#include "scene/scene.h"
#include "session/buffers.h"
#include "util/atomic.h"
#includ... | ALGO | 0.87401 | 3.820712 |
438ba9a3-6ec2-4989-a6e0-a1e35103b8ec | riku546/cpp-tutorial | atcoder_problems/ABC303/A.cpp | #include <bits/stdc++.h>
#define rep(i, m, n) for (int i = m; i < n; i++)
using ull = unsigned long long;
using namespace std;
int main()
{
int N;
cin >> N;
string S;
string T;
cin >> S;
cin >> T;
rep(i, 0, N)
{
bool flag = false;
if (S[i] == T[i])
flag = true;
else if ((S[i] == '0'... | ALGO | 0.999939 | 4.082125 |
d744f3da-eb8d-44b3-b8c5-57d196cc6cab | roytam1/gecko28a1-vc8 | netwerk/cache2/CacheHashUtils.cpp | #include "CacheHashUtils.h"
#include "plstr.h"
namespace mozilla {
namespace net {
/**
* CacheHashUtils::Hash(const char * key, uint32_t initval)
*
* See http://burtleburtle.net/bob/hash/evahash.html for more information
* about this hash function.
*
* This algorithm is used to check the data integrity.
*... | ALGO | 0.887445 | 6.572639 |
d74fef83-983c-4639-8ff5-5a469ca121c4 | PhamNhatTanCris/UDTT | OnTap/OnTap/PhuongPhapSInh/XepBanTronAkaHoanVi.cpp | #include <iostream>
using namespace std;
string s[7] = {" ","Cong", "Toan", "Trang", "Trung", "Tam", "Tu"};
void generate(int a[], int n, int i){
int k = n;
//tim x[k] nho nhat trong doan tu i den n
while(a[k] < a[i]){
k--;
}
//doi cho 2 gia tri cho nhau
swap(a[i], a[k]);
int j = n;
i++;
//dao nguoc da... | ALGO | 0.999526 | 3.517773 |
c3bf9ad0-1373-43a2-a11a-d8cd2af332d1 | Hemanth5603/Graphs-DSA | DSU_kruskal's_algo_using.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// Time Complexity - O(M * 4* alpha ) ~ O(M);
class DisjointSet{
vector<int> rank, parent;
public:
DisjointSet(int n){
rank.resize(n+1, 0);
parent.resize(n+1);
for(int i=0;i<=n;i++){
... | ALGO | 0.999983 | 5.890619 |
a031939a-0cc7-4983-af2c-47733cdca8eb | keastmin/Algorithm | 프로그래머스/2/131127. 할인 행사/할인 행사.cpp | #include <iostream>
#include <string>
#include <vector>
#include <unordered_map>
using namespace std;
int solution(vector<string> want, vector<int> number, vector<string> discount) {
int answer = 0;
int wSize = want.size();
int dSize = discount.size();
unordered_map<string, int> backup;
backup.ins... | ALGO | 0.998987 | 5.092517 |
a0130dd2-c251-491a-8212-1bb5b6d8d73d | gtoo8888/Cplusplustest | 1-Algorithm_test/leetcode/2-算法/小技巧/2-滑动窗口/2379-得到K个黑块的最少涂色次数.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
#include "E:\\Desktop\\languguetest\\Cplusplustest\\algorithm_util.h"
class Solution {
public:
int minimumRecolors(string blocks, int k) {
int n = blocks.size();
int black_num = 0,white_num = 0;
for(int i = 0;i < k;i++){
... | ALGO | 0.999915 | 5.084165 |
a3f2cbee-fc54-4264-ab5e-6a9f1ed71e2d | Johniel/contests | atcoder/arc074/C/main.cpp | #include <bits/stdc++.h>
#define each(i, c) for (auto& i : c)
#define unless(cond) if (!(cond))
using namespace std;
typedef long long int lli;
typedef unsigned long long ull;
typedef complex<double> point;
template<typename P, typename Q> ostream& operator << (ostream& os, pair<P, Q> p) { os << "(" << p.first << "... | ALGO | 0.999858 | 4.425731 |
e1bab4bd-4750-4c1a-8108-3c65013ba1b6 | Oana024/IntroP | Reprezentare Grafica Arbore/main.cpp | #include <bits/stdc++.h>
#include <graphics.h>
using namespace std;
ifstream f("arbore.in");
struct nod{
int informatieUtila, nivel, coloana;
nod *stanga, *dreapta;
};
typedef nod* arbore;
int NrLinii, NrColoane, DimLinie, DimColoana, DimNod;
void NumerotareColoane(arbore a, int c)
{
if(a!=NULL)
{
... | ALGO | 0.994706 | 3.810928 |
c30ca74e-7aa2-48c7-aadd-4048cb89ead3 | ishandutta2007/codeforces | hloya_ygrt/normal/786/C.cpp | // hloya template v24
//
//
//
//
//
//
//
//
//
//
//
#include <bits/stdc++.h>
#include <valarray>
using namespace std;
bool dbg = 0;
// clock_t start_time = clock();
#define current_time fixed<<setprecision(6)<<(ld)(clock()-start_time)/CLOCKS_PER_SEC
#define f first
#define s second
#define mp make_pa... | ALGO | 0.999972 | 4.09806 |
8c25fafb-64cc-4df6-8121-5bd6a0440186 | wang1qing1/C-learn | 最大公约数和最小公倍数.cpp | #include<stdio.h>
#include<math.h>
int wq(int P, int Q)
{
int t,r;
if (P > Q)
{
t = P;
P = Q;
Q = t;
}
r = Q % P;
while (r != 0)
{
Q = P;
P = r;
r = Q % P;
}
return P;
}
int main()
{
int P,sum=0;
int a, b, count = 0;
scanf_s... | ALGO | 0.999703 | 3.707334 |
f6fb81fa-2c20-4972-b29c-c5585e92c890 | ishandutta2007/codeforces | syloviaely/normal/653/D.cpp | #include<iostream>
#include<cmath>
#include<cstring>
#include<algorithm>
#include<cstdio>
using namespace std;
struct bian{
int next,point,f;
}b[2000];
int p[60],u[1000],v[1000],w[10000],n,m,K,len,totpoint,x[60],pd[60],dst[60];
const int inf=1e9;
void ade(int k1,int k2,int k3)
{
len++; b[len].point=k2; b[len].next... | ALGO | 0.999946 | 3.799294 |
1b6f5613-281e-4313-bd8c-bc944bc6ecb8 | mizzcereal/backjun2025_cpp | bronze4/10808.cpp | #include <iostream>
#include <string>
using namespace std;
int main(void) {
string s;
int apb[26] = {0};
cin >> s;
for(int i=0; i<s.length(); i++){
apb[s[i] - 'a']++;
}
for(int i=0; i<26; i++){
cout << apb[i] << " ";
}
} | ALGO | 0.999345 | 4.077165 |
cb38a74b-975c-43c3-a424-fdf9fe9e2eab | ishandutta2007/codeforces | shayan.p/normal/1375/F.cpp | // hello darkness my old friend, I've come to talk with you again
// Shayan.P 2020-07-04
#include<bits/stdc++.h>
#define F first
#define S second
#define PB push_back
#define sz(s) int((s).size())
#define bit(n,k) (((n)>>(k))&1)
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
const int maxn ... | ALGO | 0.999958 | 3.577345 |
3e581246-2acd-4aa6-b8e5-00995ea05bfe | dev-neha-raj/CppSolutionsArchive | Basic-program-2022/replace_element.cpp | #include <bits/stdc++.h>
using namespace std;
int replace(int arr[],int n){
for(int i=0;i<n;i++){
set<int> s;
for(int j=0;j<n;j++){
if(arr[j]<arr[i]){
s.insert(arr[j]);
}cout<<s.size<< ;
}
}
}
int main(){
int n;
cout<<"Enter the va... | ALGO | 0.99889 | 3.669394 |
fd6f2df7-6a7f-46e4-8081-5975cd697347 | retr0717/leetcode-ques | dynamic-prog/chocolatePickUpMemo.cpp | #include <bits/stdc++.h>
int MaxChoco(int i, int j1, int j2, vector<vector<int>> &grid, int n, int m, vector<vector<vector<int>>> &dp)
{
if(i < 0 || j1 < 0 || j2 < 0 || j1 >= m || j2 >= m) return -1e8;
if(i == n-1)
{
if(j1 == j2) return grid[i][j1];
else return grid[i][j1] + grid[i][j2];
... | ALGO | 0.999929 | 5.190549 |
2707b56f-1726-4431-a67c-eebff9f9f3c6 | AmbrishaVaibhav/C-c-progs | programs/oop-lab programs/lab 4/Q1.cpp | #include <iostream>
using namespace std;
class y;
class x
{
int a_07;
public :
friend void swap(x&, y&);
void setData(int c_07)
{
a_07 = c_07;
}
void display()
{
cout << "The value of data member is " << a_07 << endl;
}
};
class y
{
int b_07;
public :
fri... | ALGO | 0.982297 | 4.68663 |
2eb6c303-0803-423b-a1fc-6c1534fa6d41 | Sadat-09/Codeforces | Christmas_Candy.cpp |
#include <bits/stdc++.h>
#define IO \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(NULL)
typedef long long int ll;
typedef long double LD;
#define w(t) \
int t; \
cin >> t; \
while (t--) \
{ \
so... | ALGO | 0.999574 | 4.775085 |
5123d1a7-051a-473d-b194-2debf82be135 | arjunsinghpal26/Data-Structures | C++ DSA/ARRAY/sortedornot.cpp | #include <iostream>
#include<vector>
using namespace std;
int main(){
int arr[]={1,2,3,4,5,6,7};
bool sortedflag=true;
for(int i=1;i<6;i++){
if(arr[i]<=arr[i-1]){
bool sortedflag=false;
}
cout<<sortedflag<<endl;
}
return 0;
} | ALGO | 0.999379 | 3.300848 |
b570d1c1-6409-40cb-ad51-9405b4f3d464 | wuhao5/boost | libs/numeric/ublas/doc/samples/hermitian_matrix.cpp | #include <boost/numeric/ublas/hermitian.hpp>
#include <boost/numeric/ublas/io.hpp>
int main () {
using namespace boost::numeric::ublas;
hermitian_matrix<std::complex<double>, lower> ml (3, 3);
for (unsigned i = 0; i < ml.size1 (); ++ i) {
for (unsigned j = 0; j < i; ++ j)
ml (i, j) = st... | ALGO | 0.99178 | 3.609295 |
89c1d0c0-756a-467e-898d-6e3c601b48af | ishandutta2007/codeforces | calabash_boy/normal/533/F.cpp | #include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ULL;
const int maxn = 2e5+100;
/*
* char* 1-bas
* sum[i] = s[i]+s[i-1]*Seed+s[i-2]*Seed^2+...+s[1]*Seed^(i-1)
*/
ULL Seed_Pool[]={19260817,91815541};
ULL Mod_Pool[]={1000000009,4294967291ull};
ULL bas[maxn];
ULL Seed,Mod;
struct Hash_1D{
U... | ALGO | 0.99999 | 3.553961 |
54520465-28e2-4cd3-ae39-265b3e8b1e2b | achrafmerniz/Online_shop | 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 |
72f5cf57-027a-48e7-8472-f229f3ab47db | RuoAndo/NII-SOCs-admin-tools | template/traverse_2.cpp | #include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <dirent.h>
#include <pthread.h>
#include <alloca.h>
#include "timer.h"
#include <iostream>
#include <fstream>
#include<boost/spirit/include/qi.hpp>
#include "csv.h... | TOOL | 0.863551 | 3.973988 |
da550ce1-2547-44a5-87f3-71cc35d5e895 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_3946_1.cpp | #include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
int main(){
while(1){
int ans=0,p=0,n,k,x,a[100001]={},flag=0,sflag=0;
vector<int> V;
cin>>n>>k;
if(n==0 && k==0)
break;
for(int i=0;i<k;i++){
cin>>x;
if(x==0)
flag=1;
a[x]=1;
}
for(int i=1;i<=n;i++){
if(sflag=... | ALGO | 0.999856 | 3.70125 |
432c908a-b329-4b57-94a1-58acac0186a9 | mradulpaliwal/leetcode | 0387-first-unique-character-in-a-string/0387-first-unique-character-in-a-string.cpp | class Solution {
public:
int firstUniqChar(string s) {
int size=s.length();
int count[26] = {0}; // To store frequency of each character (a-z)
// Count frequency of each character
for (int i = 0; i < size; i++) {
count[s[i] - 'a']++;
}
// Find the first character with a fr... | ALGO | 0.999824 | 6.051383 |
5fef9490-e9a3-4cc1-9593-f604ca3ba158 | claudioDema99/robotics_projects | ExpLab-FinalAssignment/ros2_planning_system/plansys2_pddl_parser/src/plansys2_pddl_parser/Utils.cpp | #include <regex>
#include <limits>
#include <iostream>
#include <functional>
#include "plansys2_pddl_parser/Utils.h"
namespace parser
{
namespace pddl
{
std::string getReducedString(const std::string & expr)
{
std::regex nts_chars("[\n\t]*", std::regex_constants::ECMAScript);
std::string ret = std::regex_replace(... | TOOL | 0.924704 | 6.231024 |
30ba6b8a-fe33-4724-a48f-221d063d9266 | ArjunParajuli/DSA | Queue/reverse_first_k_elements.cpp | #include<iostream>
#include<queue>
#include<stack>
using namespace std;
/*
algo
- push first k elm from queue to stack
- now start popping each elm from queue and then push them again into the queue for n-k elms
*/
queue<int> modifyQueue(queue<int> q, int k) {
stack<int> st;
int temp = k;
wh... | ALGO | 0.999869 | 4.543683 |
627d36df-a3a6-441a-8dee-8b667a0b57b2 | Complex-data/rebalance-project | initial method/network.cpp | #include "network.hpp"
#include "io.hpp"
#include "random.hpp"
#include <algorithm>
#include <chrono>
#include <random>
#include <math.h>
using namespace std;
network::network(){
N=0;M=0;m=0;
max_time=0;min_time=-1;
a=1./(365.*3600.*24.); b=0;
delta = 0.85;
create_net();
run_algorithms();
}
net... | ALGO | 0.999164 | 4.007076 |
07de2d53-658c-4674-93eb-5560073453e2 | siukwan/algorithm | nowcoder/practice/重建二叉树.cpp | /*
题目描述
输入某二叉树的前序遍历和中序遍历的结果,请重建出该二叉树。假设输入的前序遍历和中序遍历的结果中都不含重复的数字。例如输入前序遍历序列{1,2,4,7,3,5,6,8}和中序遍历序列{4,7,2,1,5,3,8,6},则重建二叉树并返回。
*/
#include <stdio.h>
#include <iostream>
#include <vector>
using namespace std;
// Definition for binary tree
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
... | ALGO | 0.999982 | 5.716409 |
7e68dd50-6afb-461b-8dd1-c9263c2a5583 | sss70267/C-PLUSPLUS-exercise | 第7章 再談函數/7-38-1參照計算a+b.cpp | #include<iostream>
#include<cstdlib>
using namespace std;
void sum(int &,int &);
int main(void)
{
int a=11,b=10;
cout <<"a="<<a<<"b="<<b<<endl;
sum(a,b);
cout <<"a="<<a<<endl;
system("pause");
return 0;
}
void sum(int &a, int &b)
{
a+=b;
return;
}
// 第七章 牛刀小試 第一題 利用參考計算a+b值 並存入a值中 | ALGO | 0.989583 | 3.793416 |
66974bcb-143f-48e8-87c7-45c36ea8a8c6 | Manish3Air/LeetCode | 0037-sudoku-solver/0037-sudoku-solver.cpp | class Solution {
public:
bool solve(vector<vector<char>>& board){
for(int i=0;i<board.size();i++){
for(int j=0;j<board[i].size();j++){
if(board[i][j] == '.'){
for(char c = '1';c<='9';c++){
if(isValid(board,i,j,c) == true){
... | ALGO | 0.999665 | 6.842101 |
fe1c73e9-c59b-4ecd-b254-780f23fa46e4 | AlexGeControl/Motion-Planning-for-Mobile-Robots | workspace/assignments/capstone/ROS/src/read_only/quadrotor_simulator/so3_quadrotor_simulator/include/ode/libs/numeric/odeint/examples/fpu.cpp | #include <iostream>
#include <numeric>
#include <cmath>
#include <vector>
#include <boost/numeric/odeint.hpp>
#ifndef M_PI //not there on windows
#define M_PI 3.1415927 //...
#endif
using namespace std;
using namespace boost::numeric::odeint;
//[ fpu_system_function
typedef vector< double > container_type;
struct ... | ALGO | 0.99938 | 5.286558 |
775bd6d8-787d-4e29-a633-942d954e6e11 | SudhaVF/CPP | trianglepattern.cpp | #include<iostream>
using namespace std;
int main(){
int n = 6;
for(int i =0; i<n; i++){
for(int j=0; j<i+1; j++){
cout << " * ";
}
cout << endl;
}
return 0;
} | ALGO | 0.997041 | 3.470752 |
130feb78-248b-4bf3-827a-a88c7ca91fdd | mohamidsaiid/problem_solving_lvl2_cpp | Graph/Graph I/dfs/200. Number of Islands.cpp | // https://leetcode.com/problems/number-of-islands/
class Solution {
public:
bool valid(int i, int j, int n, int m)
{
return (i >= 0 && j >= 0 && i < n && j < m);
}
void dfs(int i, int j, vector<vector<char>> &grid)
{
int n = grid.size(), m = grid[0].size();
if(!valid(i, j, n... | ALGO | 0.999946 | 6.654975 |
d8f9cdff-4b1e-4bdd-9f18-bf0cd605b80b | Asatiji01/dsa1 | peak.cpp | #include<iostream>
using namespace std;
int peak(int arr[], int n)
{
int start=0, end=n-1,mid, ans=0;
while(start<=end)
{
mid =start+(end-start)/2;
if(arr[mid]>arr[mid-1] && arr[mid]>arr[mid+1])
{
ans= mid;
}
else if (arr[mid]>arr[mid-1])
{
... | ALGO | 0.999974 | 4.521948 |
492f7ff0-0953-4ed6-bc9e-e6e27593ed59 | ishandutta2007/codeforces | danya090699/normal/1299/D.cpp | #include <bits/stdc++.h>
#define uint unsigned int
using namespace std;
const int sz=1e3, sz2=1e5+10, mod=1e9+7;
int nex[sz][32], sm[sz][sz];
uint nmask[sz][32];
uint f(uint mask, int x)
{
uint re=mask|(1<<x);
for(int i=0; i<32; i++)
{
if(mask&(1<<i)) re|=(1<<(i^x));
}
return re;
}
vector <... | ALGO | 0.999973 | 4.264119 |
e705cd11-eba8-4fc7-874d-ae867b7e17f3 | mehulsr/AudioFingerPrinting | jni/boost_1_59_0/libs/numeric/ublas/doc/samples/assignment_examples.cpp | #include <boost/numeric/ublas/assignment.hpp>
#include <boost/numeric/ublas/vector.hpp>
#include <boost/numeric/ublas/vector_proxy.hpp>
#include <boost/numeric/ublas/matrix_proxy.hpp>
#include <boost/numeric/ublas/vector_sparse.hpp>
#include <boost/numeric/ublas/matrix_sparse.hpp>
#include <boost/numeric/ublas/io.hpp>
... | TOOL | 0.87275 | 3.670881 |
8dfcb5e4-e841-4e4d-88a8-b1d577403746 | qxp134/jzoffer | 二维数组中的查找.cpp | class Solution {
public:
bool Find(int target, vector<vector<int> > array) {
if (array.empty())
return false;
int hang = array.size();
int row = array[0].size();
int i = 0;
int j = row - 1;
while (i < hang && j > -1) {
if (target == array[i][j])
return true;
else if ... | ALGO | 0.999574 | 5.791933 |
4e10f901-0771-4347-8dfa-01b691c182a1 | tmobile/themes-platform-frameworks-base | media/libstagefright/codecs/aacdec/pv_sine.cpp | /*
Filename: pv_sine.c
------------------------------------------------------------------------------
REVISION HISTORY
Who: Date: MM/DD/YYYY
Description:
------------------------------------------------------------------------------
INPUT AND OUTPUT DEFINITIONS
Int32 x ... | ALGO | 0.99931 | 6.366296 |
3870a4ee-d29a-47d1-a13b-53d4c1aa9b3f | maplehua/c- | C_programme/bishi/amazon2.cpp | #include<iostream>
#include<string>
#include<math.h>
using namespace std;
bool isSymmerticNumber(int n) {
int tmp = n, m = 0;
while (tmp > 0) {
m = m*10+tmp%10;
tmp/=10;
}
return (m == n);
}
int getNextSymmetricNumber(int a) {
if (a < 9)
return a+1;
while (true) {
a++;... | ALGO | 0.999731 | 4.616711 |
d169cc78-96f6-4fb8-8e97-02c31fb50b53 | sahilpate-221s/Leetcode_solutions | 2149-remove-colored-pieces-if-both-neighbors-are-the-same-color/remove-colored-pieces-if-both-neighbors-are-the-same-color.cpp | class Solution {
public:
bool winnerOfGame(string colors) {
int n = colors.size();
int alice = 0;
int bob = 0;
for(int i=1;i<n-1;i++)
{
if(colors[i] == colors[i-1] && colors[i]==colors[i+1])
{
(colors[i]=='A')? alice++ : bob++;
... | ALGO | 0.999585 | 5.728625 |
41b303fe-c316-4b52-aa1b-6c1edd95344d | wonju-cho/Algorithm_Problems | SWEA/1244_SWEA_greatest_reward.cpp | #include <iostream>
#include <string>
#include <unordered_set>
using namespace std;
#define MAX 1000
int b[MAX];
void GetLargestNum(string& temp, int curr, int cnt, string& largest, unordered_set<string>& us) {
if (curr == cnt)
{
if (temp > largest)
largest = temp;
return;
}
... | ALGO | 0.999832 | 4.818536 |
8115d139-4678-4325-9e92-df9fc4cf9105 | nazibur175/C- | A_Zhan_s_Blender.cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long
#define mod 1000000007
#define test int t; cin>>t; while(t--)
void solve(){
test{
int n;
cin>>n;
int x,y;
cin>>x>>y;
double ans = ceil((n*1.0)/(min(x,y)*1.0));
int a=ans;
cout<<a... | ALGO | 0.998502 | 4.60801 |
313204c6-cfc6-4554-a29b-804f82e4dc55 | sonvule59/CUDA_and_OpenMP | weakLLM_openMP_examples/hpc_coder_OpenMP_Translated_v1/s667402340_omp.cpp | #include<iostream>
#include<omp.h>
using namespace std;
int main(void)
{
#pragma omp parallel for
for(int i=1;i<=9;i++){
for(int j=1;j<=9;j++){
cout<<i<<'x'<<j<<'='<<i*j<<'\n';
}
}
} | ALGO | 0.998853 | 3.489525 |
880600a6-7d1a-4ea6-ad41-7708867f2743 | FraRita/AlgoLab2023 | Week 4/Hiking Maps/code.cpp | #include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Point_2.h>
#include <iostream>
#include <vector>
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
int m,n;
K::Point_2 points[2000];
bool maps[2000][2000];
int count[1999];
K::Point_2 tri[6];
bool is_in(K::Point_2 point){
f... | ALGO | 0.999313 | 4.616833 |
47d44145-3508-4a48-84d8-14d1b79e9d1a | wasikahmed/Algorithms-CPP | Recursion/factorial.cpp | #include <iostream>
using namespace std;
int factorial(int x) {
int fact;
if(x<=1) {
return 1;
}
fact = x * factorial(x-1);
return fact;
}
int main() {
int n;
cout<< "Please enter a non-negative integer value: ";
cin>> n;
while(n<0) {
cout<< "The value is negativ... | ALGO | 0.999681 | 4.887354 |
ac0273be-a299-47f2-8858-2c8c8b6cd828 | yavuzkoca/Algoritma-Kutusu | Data_Structures/Homeworks/Homework3/_Gizem_Ece_Avsar/hospital.cpp | /* @Author
* Student Name: <Gizem Ece AVSAR>
* Student ID : <040140303>
* Date: <10.12.2017>
*/
#include <iostream>
#include <string>
#include <fstream>
#include <sstream>
using namespace std;
const int RED = 1; //minimum treatment times for particular codes. RED is not used due to the structure of the algorithm... | ALGO | 0.986899 | 4.450391 |
36d27fd5-581a-4583-b900-693ff6d015b2 | ashu0420/codeforces_problem | A_Trippi_Troppi.cpp | #include <bits/stdc++.h>
#define ll long long
#define li long
#define cn(n) cin >> n
#define py cout << "YES" << endl
#define pn cout << "NO" << endl
#define ct(c) cout << c << endl
#define fr(dt, a, b) for (dt i = a; i < b; i++)
#define in(a, n) \
fr(ll, 0, n) { cn(a[i]); }
#define out(a, n) \
fr(ll, 0, n) { c... | ALGO | 0.999742 | 4.423795 |
0398e31b-5205-4267-9366-f70938a897b9 | pkeyela/Cpp-and-C_sharp-projetcs | Libraries/polindrome_check.cpp | #include<iostream>
#include <string>
#include <cstring>
using namespace std;
bool polindrome_check(const string text){
// This function checks is a text is a polindrome
int len = text.length();
// This variable is changed to false as soon as
// the rule of polindrome is broken
bool is_polindrome = true;
char te... | ALGO | 0.996231 | 3.797116 |
c8e633b2-6e6f-43ec-8abb-a9e382d6deb3 | redwallbot/redwall_slam | lvi_sam_m/src/visual_odometry/visual_loop/ThirdParty/DVision/BRIEF.cpp | #include "BRIEF.h"
#include "../DUtils/DUtils.h"
#include <boost/dynamic_bitset.hpp>
#include <opencv2/imgproc/types_c.h>
#include <vector>
using namespace std;
using namespace DVision;
// ----------------------------------------------------------------------------
BRIEF::BRIEF(int nbits, int patch_size, Type type):... | ALGO | 0.979854 | 5.894513 |
46fa657f-4a53-4ea2-8d44-3b545e128e1e | gusuly0rum/Algorithms | Breadth First Search/BreadthFirstSearch.cpp | #include "BreadthFirstSearch.hpp"
inline std::vector<BSTNode*> bfs(BSTNode* root) {
BSTNode* node;
std::vector<BSTNode*> children;
std::vector<BSTNode*> queue { root };
std::vector<BSTNode*> order { root };
while (!queue.empty()) {
node = queue[0];
queue.erase(queue.begin());
children = node->... | ALGO | 0.999829 | 5.684781 |
cacd7bdb-761a-46c4-9e99-b9f4be28b433 | ShabbirHasan1/litepool | third_party/boost_1_83_0/libs/sort/example/int64.cpp | // See http://www.boost.org/libs/sort for library home page.
#include <boost/sort/spreadsort/spreadsort.hpp>
#include <time.h>
#include <stdio.h>
#include <stdlib.h>
#include <algorithm>
#include <vector>
#include <string>
#include <fstream>
#include <sstream>
#include <iostream>
using namespace boost::sort::spreadso... | ALGO | 0.97063 | 4.650084 |
5bf45da7-5138-4466-8bb1-c8a06623abf6 | aashish-thapa/DATA-STRUCTURE-AND-ALGORITHM | Blind75/Length _of_last_word.cpp | class Solution {
public:
int lengthOfLastWord(string s) {
int count = 0;
for(int i = s.size() - 1; i >= 0; i--){
if(s[i] != ' '){
count++;
if(i == 0 || s[i - 1] == ' '){
break;
}
}
}
return count... | ALGO | 0.999595 | 5.687054 |
26964f2d-a8a3-4607-b697-ed052f13739b | dfunny990/Battleship | Player_optimized.cpp | /**********************************
Patrick Saperstein
Battleship
for COBB Tuning
July 8, 2016
Player.cpp
**********************************/
#include "Player.h"
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
#include <iostream>
#include <time.h>
using namespace std;
Player::Player(){
isAI=false;
... | ALGO | 0.977609 | 3.55027 |
58dfb48b-0101-4636-9e81-bc1bf81a9223 | ybouret/hydrogels | src/approx/main.cpp | #include "yocto/math/fcn/zfind.hpp"
#include "yocto/math/fcn/functions.hpp"
#include "yocto/fs/vfs.hpp"
#include "yocto/exception.hpp"
#include "yocto/ios/ocstream.hpp"
#include "yocto/sequence/vector.hpp"
using namespace yocto;
static const double Kw = 1e-14;
static double pH0 = 2;
static double h0 = ... | ALGO | 0.994268 | 4.529936 |
53d6ccb9-9a3f-4428-b085-2082c3a707f1 | Artemis1096/Application-Club-MNNIT-POTD | POTD/Day 10/XorAverage.cpp | /*
You are given an integer 𝑛. Find a sequence of 𝑛 integers 𝑎1,𝑎2,…,𝑎𝑛 such that 1≤𝑎𝑖≤109 for all 𝑖 and
𝑎1⊕𝑎2⊕⋯⊕𝑎𝑛=𝑎1+𝑎2+⋯+𝑎𝑛/𝑛,
where ⊕
represents the bitwise XOR.
It can be proven that there exists a sequence of integers that satisfies all the conditions above.
Approach:-
if the n is odd then s... | ALGO | 0.999902 | 4.693032 |
b2a851d1-6a95-4bc4-8acf-aa53a7638f9c | BATspock/CP_problem_reference | graph_problems/cycle_check/check_cycle.cpp | #include<bits/stdc++.h>
using namespace std;
class Graph{
int V;
list<int> *adj;
public:
Graph(int V){
this->V = V;
adj = new list<int>[V];
}
void addEdge(int v, int w){
adj[v].push_back(w);
}
void BFS(int s){
ve... | ALGO | 0.999701 | 5.165764 |
26d79008-2c81-4068-8339-44cc23213301 | homer6/c_reading | boost-trunk/libs/graph/example/graph-property-iter-eg.cpp | #include <boost/config.hpp>
#include <string>
#include <iostream>
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/property_iter_range.hpp>
int
main()
{
using namespace boost;
typedef adjacency_list < listS, vecS, directedS,
property < vertex_name_t, std::string > >graph_t;
graph_t g(3);
co... | TOOL | 0.964788 | 4.995707 |
06b3cbd8-1764-4060-9d8d-6dff2883425e | AA-S/UVA-Problems-Solutuion | 484 - The Department of Redundancy Department.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
//freopen("in.txt","r",stdin);
int n,key[500000],i=0;
map<int,int> m;
while(scanf("%d",&n)!=EOF)
{
if(m.count(n) ==0)
{
m.insert(pair<int,int>(n,1));
key[i++] = n;
}
else
m... | ALGO | 0.999326 | 3.506325 |
5ef51f12-5946-4130-ab8c-33b1b990d418 | kevin-411/SIUE-Projects | CS 150 - Intro To Computing II/Project 150.3/Project 150.3/p03.cpp | //File: P03.cpp
//Date: 09/27/2011
//Name: Brian Olsen
//Course: CS 150-001 - Introduction to Computing II
//Desc:This program can take the input of a phone number and output to a text file all the possible words that could be used for that specific phone number.
#include <iostream>
#include <string>
#include <s... | TOOL | 0.856948 | 3.600393 |
c8e3277f-e3eb-4328-b562-67cfa43c9977 | salim002/Cpp-Codes | 52_Codeforces/17_Codeforces 5/57.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<ld> vd;
#define fi first
#define se second
#define pb push_back
#define all(x) x.begin(), x.end()
#define fast_io ios_base::sync_wit... | ALGO | 0.999995 | 4.125246 |
8a7140ba-1d92-48d2-9e7f-97c7e237b300 | jeong-hyeonHwang/Algorithm | Steps/ETC/prob_1026.cpp | //2022.02.01
#include <iostream>
using std::cin;
using std::cout;
void mS(int exist[], int left, int right, int temp[])
{
if(left >= right)
return;
int middle = (left+right)/2;
mS(exist, left, middle, temp);
mS(exist, middle+1, right, temp);
int i = left;
int j = mid... | ALGO | 0.999985 | 3.467772 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.