uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
38192b73-eae0-4bf2-97be-65c41f35e8e1 | joy-mohajon/UVa-Problem-solutions | uva 12646.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int arr[3];
int a, b, c;
while(cin >> a >> b >> c){
arr[0] = a, arr[1] = b, arr[2] = c;
// counting the number of 0, 1;
int cnt[2]={0};
for(int i=0; i<3; i++){
cnt[arr[i]]++;
}
// displ... | ALGO | 0.999968 | 3.471297 |
7250e7cc-6ba7-410b-9b2f-3951b52cd09f | khushisinha20/Data-Structures-and-Algorithms | Matrix/non_overlapping_intervals.cpp | //leetcode.com/problems/non-overlapping-intervals/submissions/
#include <bits/stdc++.h>
using namespace std;
class Solution {
public:
int eraseOverlapIntervals(vector<vector<int>>& intervals) {
int left = 0;
int right = 1;
int minimum_removals = 0;
sort(intervals.begin(), intervals... | ALGO | 0.999979 | 6.047612 |
31aa24a7-e5ba-4a29-9f0d-ff2a50aaa3cc | zqy1018/my_leetcode | code/365.cpp | #include <bits/stdc++.h>
#define INF 2000000000
using namespace std;
typedef long long ll;
int read(){
int f = 1, x = 0;
char c = getchar();
while(c < '0' || c > '9'){if(c == '-') f = -f; c = getchar();}
while(c >= '0' && c <= '9')x = x * 10 + c - '0', c = getchar();
return f * x;
}
struct TreeNod... | ALGO | 0.99964 | 3.872603 |
c3fda832-b543-4c52-b7b3-3cd85a5ac8d7 | EA03cs/MealApp | 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 |
355732f3-cefe-4ba2-aa3b-6d51ad7e6ae4 | tanbirrr/CS_fundamentals | Introduction to Algorithms/mid term exam(.......)/Area_of_Component.cpp | #include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> pii;
const int N = 1e3 + 5;
vector<vector<char>> g(N);
bool visited[N][N];
int n, m;
vector<pii> dest = {{-1, 0}, {1, 0}, {0, -1}, {0, 1}};
bool isValid(int i, int j)
{
return (i >= 0 && i < n && j >= 0 && j < m);
}
... | ALGO | 0.999871 | 4.851632 |
ae4a5ffa-cf67-4a5c-ac2b-206b83a7c84d | tkdgusqkr/Hanyang_University | Lecture/2022_ite1015_2022024348/7-1/7-1-1/main.cpp | #include <iostream>
#include <string>
#include <vector>
#include "sorted.h"
using namespace std;
int main()
{
SortedArray sortedarray;
while(1)
{
string command;
cin>>command;
if(command=="ascend")
{
vector<int> array=sortedarray.GetSortedAscending();
for(int i=0;i<array.size();i++)
{
cout<<arra... | ALGO | 0.998644 | 4.174117 |
36dde58e-2210-4d52-bd5f-8a26a173ecf2 | waniya23/c-_basic_ds_codes | combsort7.cpp | #include <iostream>
using namespace std;
void combSorting(int arr[], int n) {
float shrink=1.3;
int gap = n;
bool swapped = true;
while (gap != 1 || swapped == true) {
gap = (int)(gap/shrink);
swapped = false;
for (int i = 0; i + gap< n; i++) {
if (arr[i]... | ALGO | 0.999989 | 5.966103 |
5b264745-a917-4eeb-b89e-6c380e5ab5fd | thegamer1907/Code_Analysis | Graphs/1390.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int i,j,k=0,l,m,n,t;
cin>>n>>t;
int ara[n+1];
for(i=1; i<n; i++)
cin>>ara[i];
ara[n]=1;
for(i=1; ; )
{
i+=ara[i];
//cout<<i<<endl;
if(i>n)
break;
if(i==t || t==1)
... | ALGO | 0.999989 | 3.244641 |
50746997-49a1-4dcf-b3a9-457f6bcff3dc | lijwen2748/gic | mainsolver.cpp | /*
Author: Jianwen Li
Update Date: October 6, 2017
Main Solver in CAR
*/
#include "mainsolver.h"
#include "utility.h"
#include <algorithm>
using namespace std;
namespace car
{
int MainSolver::max_flag_ = -1;
vector<int> MainSolver::frame_flags_;
MainSolver::MainSolver (Model* m, Statistics* stats, const bool... | ALGO | 0.999208 | 5.721551 |
51fda01b-64d5-4934-97e3-67517cb6c39e | spacemonkey1101/cppDSA | 23_largest_string.cpp | // read N Strings and print the largest string
#include <iostream>
#include <cstring>
using namespace std;
int main()
{
char current[1000];
char largest[1000];
int N;
cout << "Enter the number of strings, we had to read" << endl;
cin >> N;
// to eat up the '\n'
cin.get();
for (int i =... | ALGO | 0.99024 | 4.615823 |
86881d46-23d3-42d5-89c7-c8d666116d17 | rohanxxx/leetcode | 0368-largest-divisible-subset/0368-largest-divisible-subset.cpp | class Solution {
public:
vector<int> largestDivisibleSubset(vector<int>& nums) {
int n = nums.size();
vector<int> dp(n, 1), hash(n);
sort(nums.begin(), nums.end());
int maxi = 1, lastIndex = 0;
for(int i = 1; i < n; i++){
hash[i] = i;
for(int prev = 0... | ALGO | 0.999996 | 5.6653 |
b212d2d2-cf92-4b6b-9371-60452f40a9b5 | julianchurchill/Melkor | src/Melkor/NeuralNetwork/BPNTrainer.cpp | #include "BPNTrainer.h"
#include <ctime>
double BPNTrainer::trainAndTime(vector<Matrix<float> >& input,
vector<Matrix<float> >& output, const vector<int>& freezeLayers, bool print /*=false*/,
int epochs /*=0*/, bool useSymmetry /*=false*/, bool doMomentum /*=true*/,
bool batchUpdate /*=false*/, bool convergenceCh... | ALGO | 0.959515 | 4.101922 |
f541e70e-90a6-4b45-8afa-78b3b4682429 | prashantmarshal/Code | binary trees/SubtreeMaximumAverage.cpp | // https://www.lintcode.com/problem/597/
class Result {
public:
int nodes;
int sum;
double max_avg;
TreeNode *node;
Result(int n=0, int s=0, double m=INT_MIN, TreeNode *N=nullptr) {
nodes = n; sum = s; max_avg = m; node = N;
}
};
class Solution {
public:
Result* util(TreeNode *roo... | ALGO | 0.99999 | 6.388436 |
68894e58-86fc-4d77-8b81-38dd125ad480 | ashuvo25/Codeforces_problem_Solve | Codeforces Round 886 (Div. 4)/C..cpp | /*বিসমিল্লাহির রাহমানির রাহিম */
/* MD ASADUZZAMAN SHUVO */
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
int t;cin>>t;
string s[t];
while(t--){
string cut ="";
for(int i = 0;i<8;i++){
string m;cin>>m;
for(int j=0;j<8;j++){
... | ALGO | 0.99636 | 3.05169 |
a84c5b75-2275-4b33-aa69-319e0d82c72d | ishandutta2007/codeforces | krijgertje/normal/1015/A.cpp | #include <algorithm>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <cmath>
#include <cstring>
#include <list>
#include <cassert>
#include <climits>
using ... | ALGO | 0.999982 | 3.227778 |
1a51e615-0666-4c92-9d10-6fa4a750ad7f | HanzalaKabir/Coding_Journey | RecursiveReverseALinkedList.cpp | #include <iostream>
#include <vector>
#include <string>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>
using namespace std;
struct node
{
int data;
node *next;
node(int x)
{
data = x;
next = NULL;
}
};
node *createLinkedList(int n)
{
node *head = NULL;
... | ALGO | 0.99987 | 5.313057 |
dad30dbb-20f1-4232-a1e5-adada18b34e9 | naomi-z/Machine-Learning-Portfolio | LogFromScratch.cpp | /*
Module Name : Logistic Regression from Scratch
Date : 2023 - 3 - 4
Author : Naomi Zilber
Module Purpose
Write a program to perform logistic regression from scratch in C++
Module Design Description
Read in a file and code the functions in C++ that will recreate a logistic regression model
Inputs:
titanic_project.c... | DATA | 0.996338 | 7.320615 |
d0104c0e-ab04-46bc-b81a-4390e218cea8 | raincross7/code-similarity | codes/train_code/problem176/problem176_338.cpp | #include <bits/stdc++.h>
using namespace std;
//mem(a, b) memset(a, (b), sizeof(a))
typedef long long ll;
#define f(i,a,b) for (ll i=a ; i<b ; i++)
#define fr(i,a,b) for (ll i=a ; i>=b ; i--)
#define faster ios::sync_with_stdio(0);cin.tie(0);
typedef pair<int, int> p;
typedef vector<int> vi;
typedef vector<string>... | ALGO | 0.9998 | 3.45215 |
f8783be3-90d7-4ec7-9cd3-84a104fd45e0 | sparxvidya/C--DSA | dsaobject+oriented.cpp | #include<iostream>
#include<stdio.h>
using namespace std;
//struct Rectangle
class Rectangle
{
public:
int length;
int breadth;
void initialise(int l,int b)
{
length=l;
breadth=b;
}
int area()
{
return length*breadth;
}
int perimeter()
{
// int p;
// p=2*(length+breadth);
//retur... | TOOL | 0.986788 | 3.981966 |
05f902c5-2d56-4676-a80f-a20806950228 | lys8325/boj_study | 17298/main.cpp | #include <iostream>
#include <stack>
#include <vector>
using namespace std;
int main() {
cin.tie(NULL);
ios::sync_with_stdio(false);
stack<int> s;
int n, num;
cin>>n;
vector<int> v1(n);
vector<int> v2(n);
for(int i=0;i<n;++i){
cin>>num;
v2[i] = num;
if(s.empty... | ALGO | 0.999987 | 4.428415 |
2cc7053e-fe14-4bcd-986d-d4e9680b16f5 | ajinkyavn1/Codes | codeforces_Old/B_Odd_Swap_Sort.cpp | #include<bits/stdc++.h>
typedef long long int ll;
#define do_it_fast ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define vll vector<long long int>
#define pll pair<long long int, long long int>
using namespace std;
void solve(){
int n;
cin>>n;
vector<int> v(n);
for(int i=0;i<n;i++){
... | ALGO | 0.999838 | 4.113181 |
c895c0ef-3ac1-4b8c-84a4-018dfb102068 | thanusree182/leetcode | Print 1 to n without using loops - GFG/print-1-to-n-without-using-loops.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function Template for C++
class Solution
{
public:
void printTillN(int N)
{
// Write Your Code here
if(N==0)
return;
else{
printTillN(N-1);
cout<<N<<" ";
... | ALGO | 0.999382 | 6.226272 |
bd41c3c4-f51f-42bc-b9fb-2c9342e8da6d | simonepri/competitive-programming | UVA/10004/10004.cpp | /**
* Competitive Programming - Collection of solved problems.
*
* @author Simone Primarosa,(http://simoneprimarosa.com)
* @link (https://github.com/simonepri/competitive-programming)
* @license MIT License (https://opensource.org/licenses/MIT)
*/
#include <iostream>
#include <vector>
#i... | ALGO | 0.995613 | 5.218186 |
7437528e-64ab-4a67-b2c1-9ce125fb063c | tsukasa38/AtCoderBeginnerContest | src/ABC179/C.cpp | #include <cmath>
#include <iostream>
using namespace std;
int main() {
int N;
cin >> N;
int count = 0;
int M = sqrt(N);
for(int a = 1; a < N; ++a) {
for(int b = 1; b <= M; ++b) {
if(a * b < N) {
int c = N - a * b;
if(a > M) { count += 2; }
... | ALGO | 0.999375 | 4.581502 |
e928b6a6-b131-4f91-80a0-22dfa04ae390 | Yuvaraj787/CSES-Problems-Set-Solutions- | apartments.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, m, k;
cin >> n >> m >> k;
vector<int> applicants(n);
vector<int> apartments(m);
for (int& i : applicants) {
cin >> i;
}
for (int& i : apartments) {
cin >> i;
}
sort(applicants.begin(), applicants.e... | ALGO | 0.999931 | 3.672099 |
de868582-4e68-4328-9b90-18af74d0aa1e | philippwindischhofer/POWHEG_ggHH_cH4 | refine_momenta.cpp | #include <iostream>
#include <cassert>
#include <vector>
#include <quadmath.h>
#define SQMASS_THRESHOLD 1e-13
#define MAX_ITERATIONS 16
template <typename T, typename U>
static T truncate(const T val, const T acc, int numscales, const U* scales)
{
T ans = val;
bool known = false;
for (int i=0; i<numscales; ... | ALGO | 0.999754 | 4.017894 |
3977cc22-fb20-4863-9de9-7a6450a7f7f8 | liuq901/code | SPOJ/sp_4302.cpp | #include <cstdio>
#include <algorithm>
using namespace std;
typedef long long ll;
ll Abs(ll x)
{
return(x<0?-x:x);
}
bool check(ll n,ll k,ll x1,ll x2,ll y1,ll y2)
{
if (n<k)
swap(n,k);
ll dx=Abs(x1-x2),dy=Abs(y1-y2);
if (dx%__gcd(n,k)!=0)
return(false);
if (dy%__gcd(n,k)!=0)
... | ALGO | 0.999346 | 4.435981 |
b7a074aa-0cf0-4390-bb7e-7e093abccbd4 | aces-coin/AcesCoin | src/scrypt.cpp | #include <stdlib.h>
#include <stdint.h>
#include "scrypt.h"
#include "pbkdf2.h"
#include "util.h"
#include "net.h"
#define SCRYPT_BUFFER_SIZE (131072 + 63)
#if defined (OPTIMIZED_SALSA) && ( defined (__x86_64__) || defined (__i386__) || defined(__arm__) )
extern "C" void scrypt_core(unsigned int *X, unsigned int *V... | ALGO | 0.989365 | 5.510696 |
593755cb-6c5a-49bd-a7e9-09bbdcb6ece1 | robson1872/Codeforces-Codes | Codeforces Round #642 (Div. 3)/D_Constructing_the_Array.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int INF = 0x3f3f3f3f;
const ll LINF = 0x3f3f3f3f3f3f3f3fll;
using vi = vector<int>;
using vll = vector<ll>;
const int MAXN = 2e5+7;
const int MOD = 1e9 + 7;
#define pb push_back
#define rsz resize
#define all(x) begin(x), end(x)
#define... | ALGO | 0.999823 | 3.938498 |
e6108865-680d-45ca-af0b-ddf085014d60 | nsacyber/simon-speck-supercop | crypto_dh/claus/gmp/keypair.cpp | #include <gmpxx.h>
#include "crypto_dh.h"
#include "randombytes.h"
#define PUBLICKEY_BYTES crypto_dh_PUBLICKEYBYTES
#define SECRETKEY_BYTES crypto_dh_SECRETKEYBYTES
int crypto_dh_keypair(
unsigned char *pk,
unsigned char *sk
)
{
long long i;
for (i = 0;i < SECRETKEY_BYTES;++i) sk[i] = 0;
for (i = 0;i < PUBL... | ALGO | 0.993253 | 4.04192 |
5316fcfe-96e7-4079-ac3a-9826060126cf | dlvguo/NoobOJCollection | LeetCode/Normal/1600-1699/1629.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution
{
public:
char slowestKey(vector<int> &releaseTimes, string keysPressed)
{
int _maxc = releaseTimes[0];
char ch = keysPressed[0];
for (int i = 1; i < releaseTimes.size(); i++)
{
int temp = releaseTimes[i] - ... | ALGO | 0.999769 | 5.832367 |
b57cf402-f5f1-4a04-aa2d-2d32a74ddfa4 | azurerazor/competitive-programming | Solutions/CSES/Graphs/flightroutescheck.cpp | #include <bits/stdc++.h>
using namespace std;
int bfs(vector<vector<int>>& g) {
vector<bool> vis(g.size(), false);
queue<int> q;
q.push(0);
vis[0] = true;
while (q.size()) {
int c = q.front();
q.pop();
for (auto v : g[c]) {
if (!vis[v]) {
vis... | ALGO | 0.999988 | 4.40775 |
f39e291a-62cf-47d3-978b-283dfad3fa87 | okailahmed/Data_structure_and_Algo_repo | Data_Structure_Linked_List/Exercies_LL/exercisice-ll-delete-first.cpp | #include <iostream>
using namespace std;
class Node
{
public:
int value;
Node *next;
Node(int value)
{
this->value = value;
next = nullptr;
}
};
class LinkedList
{
private:
Node *head;
Node *tail;
int length;
public:
LinkedList(int value)
{
Node *newN... | ALGO | 0.998812 | 5.326487 |
e5694af1-c33d-4191-a3bf-de8b726e21a8 | kuldeeprec/amazontestserieslivegfg | dynamicprogrammig/longestcommonsubsequece.cpp | #include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
public:
//Function to find length of longest increasing subsequence.
int longestSubsequence(int n, int input[])
{
// your code here
int output[n];
output[0]=1;
for(int i=1;i<n;i++){
... | ALGO | 0.999778 | 6.11841 |
769d6c1a-ab3f-475c-8d8a-b77befbcd9e7 | kartikeyaGUPTA45/C-Plus-Plus-Programming-Language | RECURSION/TAIL RECURSION.cpp | // TAIL RECURSION
#include <iostream>
using namespace std;
void function(int n)
{
if (n>0)
{
cout<<n;
function(n-1);
}
}
int main()
{
int n;
cout<<"IMPLEMENTATION OF TAIL RECURSION"<<endl;
cout<<"Enter a number:";
cin>>n;
function(n);
return 0;
}
| ALGO | 0.99975 | 4.969038 |
a760f841-63b3-4669-b112-175fb1a405ea | NickDeno/CS375 | nicholas_denobrega_c++3/submission.cpp | #include <iostream>
#include <vector>
#include <limits>
#include <chrono>
using namespace std;
using namespace std::chrono;
const int INF = numeric_limits<int>::max();
void floyd(int n, vector<vector<int>>& D, vector<vector<int>>& P) {
for (int k = 0; k < n; k++) {
for (int i = 0; i < n; i++) {
... | ALGO | 0.999724 | 4.667765 |
66273391-548f-423c-8dba-b4cf6ccbf809 | DavidWang19/NBodySimulatorPractice | include/EvolutionAlgorithmInterface.cpp | #include "EvolutionAlgorithmInterface.h"
#include <format>
using namespace nbs;
void EvolutionAlgorithmInterface::initialize(std::vector<PhysicalObject>& objects,
double time_step) {
m_logger.log("Initialization started.");
calculate_accelerations(objects);
fo... | ALGO | 0.99541 | 5.818561 |
1c50cc67-8108-41ab-82a0-b28444cdfa48 | chemlzh/Exercises-of-Introduction-to-Computing-A- | Week5 Homework in GitHub/Week5Task3.cpp | #include <cstdio>
long n;
int main() {
while (scanf("%ld", &n) != EOF) {
if (n % 3 == 0) printf("%s\n", "TRUE");
else {
while (n) {
if (n % 10 == 3) { printf("%s\n", "TRUE"); break; }
else n /= 10;
}
if (!n) printf("%s\n", "FALSE");
}
}
} | ALGO | 0.999131 | 3.788711 |
e5ccfcd0-3afd-4c93-a49c-2b6fcfb0b829 | MayankGupta-dev08/myCppWork | 96_p3_isNPowerOf2_BitM.cpp | // To write a program to check if a given number is power of 2 or not.
/* For a given number n, n-1 could be written just by flipping the right most bit (1) and its subsequent bit
n = 6 = 0110 --> n-1 = 5 = 0101 --> (n & (n-1)) = 0100
n = 8 = 1000 --> n-1 = 7 = 0111 --> (n & (n-1)) = 0000
So, (n & (n-1)... | ALGO | 0.996797 | 6.505116 |
4a08419e-7fe3-43a1-acff-5fca1ddccc5d | mchumpitazp/online-judge-solutions | 162_Beggar_My_Neighbour.cpp | #include <iostream>
#include <string>
#include <deque>
#include <fstream>
using namespace std;
deque<char> player, dealer, table;
bool isGameOver, playerLoss = false;
inline bool isFaceCard (char cardNum) {
return cardNum == 'A' || cardNum == 'J' || cardNum == 'Q' || cardNum == 'K';
}
inline int getChances (char... | ALGO | 0.997503 | 4.412216 |
207f0083-70c1-4754-8682-ccb51b9ca89a | lakshmanaram/Competitive-programming | apac/round 1b/A-small.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
ifstream infile;
ofstream outfile;
long long t;
infile.open("A-large.in");
outfile.open("A-output.out");
infile>>t;
for(long long tk=1;tk<=t;tk++){
long long l,r;
infile>>l>>r;
long long mv = min(l,r);
... | ALGO | 0.999076 | 4.472238 |
b437b754-3e91-4884-9fc6-c50eeda378aa | protik0939/XPSC_Codes | Week 14/Day 5/Absolute_Sorting.cpp | /*
________________________________________________________________
████████████████████████████████████████████████████████
█▄─▄▄─█▄─▄▄▀█─▄▄─█─▄─▄─█▄─▄█▄─█─▄███─▄▄─█░▄▄░█▄▄▄░█░▄▄░█
██─▄▄▄██─▄─▄█─██─███─████─███─▄▀████─██─█▄▄▄░██▄▄░█▄▄▄░█
▀▄▄▄▀▀▀▄▄▀▄▄▀▄▄▄▄▀▀▄▄▄▀▀▄▄▄▀▄▄▀▄▄▀▀▀▄▄▄▄▀▄▄▄▄▀▄▄▄▄▀▄▄▄▄▀
_______... | ALGO | 0.999873 | 4.758239 |
6cdec137-1b6d-49b5-918e-3a5e8abc33d1 | huynhtritaiml2/C-forBeginner | function2.cpp | #include <iostream>
using std::cin;
using std::cout;
double power( double base, int exponent) // function definition
{
double result = 1;
for(int i=0; i<exponent; i++)
{
result = result * base;
}
return result;
}
void print_pow(double base, int exponent)
{
double myPower = power(base,... | ALGO | 0.937456 | 5.559904 |
c28a83f3-b49c-4d3d-b25c-c7edc6cba2ed | mfs6174/mfs6174-ACM | POJ3663.cpp | /*
ID: mfs6174
email: <EMAIL>
PROG: ti
LANG: C++
*/
#include<iostream>
#include<fstream>
#include<string>
#include<sstream>
#include<cstring>
#include<algorithm>
#include<map>
#include<vector>
#include<queue>
#include<deque>
#include<iomanip>
#include<cmath>
#include<set>
#define sf scanf
#define pf printf
#define llg... | ALGO | 0.999703 | 3.144581 |
e0d8bc09-e52d-4983-91b7-951b51f27863 | ikefumy/ikefumy_library | test/LibraryChecker/graph/strongly_connected_components.test.cpp | #define PROBLEM "https://judge.yosupo.jp/problem/scc"
#include "../../../template/template.hpp"
#include "../../../graph/strongly_connected_components.hpp"
int N, M;
vector<int> cs[500010];
int main() {
cin.tie(nullptr);
ios_base::sync_with_stdio(false);
cout << fixed << setprecision(20);
cin >> N >> ... | ALGO | 0.999866 | 5.327948 |
e6a5af3c-c15f-4a17-90ec-3ac433caec94 | igor-pavkov/honours-2024 | Code Examples/DiverseVul Filtered/Secure/75e95e1fcd52d3ec8282edb75ac8cd0814095d54-48.cpp | static void windowAggFinal(WindowCodeArg *p, int bFin){
Parse *pParse = p->pParse;
Window *pMWin = p->pMWin;
Vdbe *v = sqlite3GetVdbe(pParse);
Window *pWin;
for(pWin=pMWin; pWin; pWin=pWin->pNextWin){
if( pMWin->regStartRowid==0
&& (pWin->pFunc->funcFlags & SQLITE_FUNC_MINMAX)
&& (pWin->eStart... | TOOL | 0.863078 | 3.619155 |
6bf67aca-8065-408d-90a0-dfa713f2a337 | ishandutta2007/codeforces | demoralizer/normal/1000/D.cpp | #include "bits/stdc++.h"
using namespace std;
#define int long long
#define pb push_back
#define ppb pop_back
#define pf push_front
#define ppf pop_front
#define all(x) (x).begin(),(x).end()
#define uniq(v) (v).erase(unique(all... | ALGO | 0.999955 | 4.267925 |
1dfca45e-212e-4539-a252-1a12ad847ce7 | redouane-nouri/leetcode | longest-palindromic-substring.cpp | #include <string>
class Solution {
public:
std::string longestPalindrome(std::string s) {
const std::size_t sz = s.size();
std::size_t start = 0, length = 0;
for (std::size_t i = 0; i < sz; ++i) {
findPalindrome(s, sz, i, i, start, length);
findPalindrome(s, sz, i, i + 1, start, length);
... | ALGO | 0.999851 | 6.391948 |
df8a8772-104d-4385-b7e1-014e59606e38 | jidushanbojue/DockStream-master | DockStreamCommunity/AutoDock-Vina-1.2.3/src/lib/parse_pdbqt.cpp | #include <string>
#include <fstream> // for getline ?
#include <sstream> // in parse_two_unsigneds
#include <cctype> // isspace
#include <exception>
#include <boost/utility.hpp> // for noncopyable
#include <boost/optional.hpp>
#include <boost/filesystem/fstream.hpp>
#include <boost/lexical_cast.hpp>
//#include <openba... | TOOL | 0.885316 | 5.896624 |
af80a3ca-31e6-49a5-a1f6-48e2a1b6ac63 | ishandutta2007/codeforces | saketh/normal/1025/A.cpp | #include <bits/stdc++.h>
using namespace std;
#define TRACE(x) x
#define WATCH(x) TRACE(cout << #x" = " << x << endl)
#define WATCHR(a, b) TRACE(for (auto it=a; it!=b;) cout << *(it++) << " "; cout << endl)
#define WATCHC(V) TRACE({cout << #V" = "; WATCHR(V.begin(), V.end());})
#define all(x) (x).begin(), (x).end()
... | ALGO | 0.999997 | 4.216049 |
67f6ad25-376b-493a-9010-e188b90aa4e4 | seoykwon/problem_solving | dp/11659.cpp | #include <iostream>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cout.tie(NULL);
cin.tie(NULL);
int num;
int que;
cin >> num >> que;
long long list[num + 1];
int calc = 0;
list[0] = 0;
for (int i = 1; i <= num; i++)
{
long long a;
cin... | ALGO | 0.999854 | 4.094061 |
9622b130-f57c-4370-8a01-5013113218f5 | milovate/Leetcode | 632-smallest-range-covering-elements-from-k-lists/smallest-range-covering-elements-from-k-lists.cpp | class Solution {
public:
vector<int> smallestRange(vector<vector<int>>& nums) {
// Min-Heap: stores (value, list index, element index)
priority_queue<vector<int>, vector<vector<int>>, greater<vector<int>>> minHeap;
int curMax = numeric_limits<int>::min();
// Initialize the heap with... | ALGO | 0.999997 | 6.732018 |
7645f362-b18d-439d-93c2-c857c9cadb5b | choudharymayank/Data-Structures-and-Algorithms-C- | Strings/LeftMostRepeatingCharacter_NaiveTwoTraversals_Strings.cpp | #include<bits/stdc++.h>
using namespace std;
const int CHAR=256;
int leftMostR(string str){
int count[CHAR]={0};
for(int i=0;i<str.size();i++){
count[str[i]]++;
}
for(int i=0;i<str.size();i++){
if(count[str[i]]>1){
return i;
}
}
return -1;
}
int main(){
string str;
cin>>str;
cout<<leftMostR(st... | ALGO | 0.9999 | 4.021519 |
e1bf8e84-eaba-4371-a265-7c746cf7e5af | hal-uw/gpu_variability_sc22_artifact | sec5c_lammps/lib/gpu/lal_lj_ext.cpp | /***************************************************************************
lj_ext.cpp
-------------------
W. Michael Brown (ORNL)
Functions for LAMMPS access to lj/cut acceleration routines.
________________________________... | ALGO | 0.93615 | 4.833457 |
4df51964-3554-4f0e-a721-f0270c99746a | GunhyukLee/codetree-TILs | 240206/열에 따라 감소하는 정사각형/a-square-that-decreases-with-heat.cpp | #include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
for (int i=1; i<=n; i++) {
for (int j=n;j>=1;j--) {
cout << j << " ";
}
cout << endl;
}
// 여기에 코드를 작성해주세요.
return 0;
} | ALGO | 0.999987 | 4.425583 |
f5fdbc05-b824-4413-9a21-9cde1aa89fab | TiagoMLucio/Competitive-Programming | codechef/Contests/123/A.cpp | #include "bits/stdc++.h"
#include <chrono>
using namespace std;
using ll = long long;
using ld = long double;
using str = string;
#define sz(x) static_cast<int>((x).size())
#define MAXX 1073741823
#define MAX (1 << 20)
#define INF 0x3f3f3f3f
#define MODN 1000000007
#define endl '\n'
#define int ll
using ii = pair<in... | ALGO | 0.999997 | 4.950448 |
76eb0bf4-b1ad-4cc5-8cd0-372f4469b8e5 | raincross7/code-similarity | codes/train_code/problem426/problem426_90.cpp | #include <iostream>
#include<queue>
#include<string.h>
using namespace std;
int main(){
queue <int> q;
int h,w,n,cnt;
long ans=0;
char map[1000][1000];
int d[1000][1000];
int x,fx,mx[]={0,1,0,-1};
int y,fy,my[]={1,0,-1,0};
cin>>h>>w>>n;
for(int i=0;i<h;i++){
for(int o=0;o<w;o... | ALGO | 0.999803 | 3.140074 |
f30f94b1-2ffc-456c-ad71-9eeda6e5c58c | dysoxor/Maple | src/modules/AutoMoDeBehaviour.cpp | /*
* @file <src/modules/AutoMoDeBehaviour.cpp>
*
* @author Antoine Ligot - <<EMAIL>>
*
* @package ARGoS3-AutoMoDe
*
* @license MIT License
*/
#include "AutoMoDeBehaviour.h"
namespace argos {
AutoMoDeBehaviour::~AutoMoDeBehaviour() {}
/****************************************/
/***************************... | TOOL | 0.862583 | 5.376646 |
06559e3d-7306-4cbd-aab6-5311157ce401 | advaitvarade/CG | Kochi.cpp | #include <GL/glut.h>
#include <cmath>
#include <iostream>
using namespace std;
int iterations = 3;
// Function to draw Koch curve segment
void koch(int it, float x1, float y1, float x5, float y5) {
if (it == 0) {
glVertex2f(x1, y1);
glVertex2f(x5, y5);
} else {
float dx = (x5 - x1) / 3... | ALGO | 0.961308 | 6.075328 |
d8a8c897-438e-4cd3-9f37-49ee3fd1df10 | rigelproject/rigel-sim | rigel-sim/src/caches_legacy/cluster_cache.cpp | ////////////////////////////////////////////////////////////////////////////////
// src/caches/cluster_cache.cpp
////////////////////////////////////////////////////////////////////////////////
//
// This file contains the implementation of the L2D cache (cluster cache).
//
////////////////////////////////////////////... | TOOL | 0.854232 | 5.024822 |
76c68a35-7a18-4f3a-a72c-cdecabae93bc | Leechihee/Data_Structure_study | Ans/12.Search_Algorithm/12-24_Solution(ReHesh).cpp | #include <iostream>
#include <vector>
#include <cmath>
using namespace std;
int hesh(int key,int table_size);
int NextPrime(int num);
vector<int>* Rehesh(vector<int>* Before_table,int& table_size);
int main()
{
int size = 13;
vector<int>* hesh_table = new vector<int>[size];
for(int i = 0;i<size;i++)
hesh_table[... | ALGO | 0.999827 | 3.896211 |
3de42078-3a70-4bce-88a4-f1de7641bd1d | MuratBolatoglu/LeetCode-Answers | 0011-container-with-most-water/0011-container-with-most-water.cpp | class Solution {
public:
int maxArea(vector<int>& h) {
int maxarea=0,l=0,r=h.size()-1;
while(l<r){
int area=(r-l)*min(h[l],h[r]);
if(h[r]>h[l]) l++;
else r--;
if(area>maxarea) maxarea=area;
}
return maxarea;
}
};
| ALGO | 0.999962 | 6.335522 |
4f01e8cb-eb5d-453f-b1a8-c2ba0f5d17c9 | efcwetgw/SaMT-master | MAT-master/examples/translation/mosesdecoder/contrib/relent-filter/src/TranslationAnalysis.cpp | // $Id$
#include <iostream>
#include <sstream>
#include <algorithm>
#include "StaticData.h"
#include "Hypothesis.h"
#include "TranslationAnalysis.h"
using namespace Moses;
namespace TranslationAnalysis
{
void PrintTranslationAnalysis(const TranslationSystem* system, std::ostream &os, const Hypothesis* hypo)
{
os ... | ALGO | 0.982575 | 4.640119 |
91ef180f-eb13-47ae-b947-07fd19a9ac89 | ishandutta2007/codeforces | shayan.p/normal/831/C.cpp | #include<bits/stdc++.h>
#define ll int
#define pll pair<ll,ll>
#define MP make_pair
#define PB push_back
#define F first
#define S second
using namespace std;
const ll maxn=2010;
ll a[maxn],b[maxn],sum,n,k;
set<ll>s,ans;
int main(){
cin>>n>>k;
for(ll i=0;i<n;i++)cin>>a[i];
for(ll i=0;i<k;i++)cin>>b[i];
ll sum=0;
f... | ALGO | 0.999791 | 3.379472 |
4c276aa2-b5de-457c-8a3c-d04408229afb | pranavsindura/CompetitiveProgramming | uva/10369.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.999803 | 3.750062 |
4422f48e-ca0d-4701-ba84-48b08d92e8b7 | Muntaha-Islam0019/CSE419 | Assignment-4/1/1.cpp | #include <bits/stdc++.h>
using namespace std;
int summation(int x, int y)
{
return x + y;
}
int subtraction(int x, int y)
{
return x - y;
}
int multiplication(int x, int y)
{
return x * y;
}
double division(int x, int y)
{
return x / y;
}
int exclusive_or(int x, int y)
{
return x ^ y;
}
int ma... | ALGO | 0.999893 | 5.166826 |
85fd1588-15d6-4ec9-9f2b-494e425d3c14 | Hijiongfeng/Likou | 738.cpp | #include<iostream>
#include<vector>
using namespace std;
/*
给定一个非负整数 N,找出小于或等于 N 的最大的整数,同时这个整数需要满足其各个位数上的数字是单调递增。
(当且仅当每个相邻位数上的数字 x 和 y 满足 x <= y 时,我们称这个整数是单调递增的。)
示例 1:
输入: N = 10
输出: 9
*/
class Solution {
public:
int monotoneIncreasingDigits(int n) {
string strNum = to_string(n);
int flag = s... | ALGO | 0.999954 | 5.848338 |
7d935d86-bc13-4a7c-985e-93dd6b55be92 | raincross7/code-similarity | codes/train_code/problem295/problem295_299.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;//データの数
int D;//次元の数
int count;//何通りあるかを計算
//データ入力部
cin >> N >> D;
//それぞれの位置を入れる配列を用意
vector<vector <int>> X(N,vector <int> (D));
//データ入力部2
for (int i=0; i<N;i++){
for(int j=0; j<D; j++){
cin >> X.at(i).at(j);
}
... | ALGO | 0.999799 | 3.343845 |
4b1246ba-b96d-49c7-b80e-78cbde279067 | TejasKumar555/leetcode | 1833-find-the-highest-altitude/find-the-highest-altitude.cpp | class Solution {
public:
int largestAltitude(vector<int>& gain) {
int height = 0;
int max = height;
for(int i=0; i<gain.size(); ++i)
{
height += gain[i];
if(height > max)
{
max = height;
}
}
return max;
... | ALGO | 0.999861 | 5.975398 |
2dadbb54-de5d-43f5-ac90-7fe709c599c8 | hackerpranavpandey/LeetCode | 0082-remove-duplicates-from-sorted-list-ii/0082-remove-duplicates-from-sorted-list-ii.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
ListNode* deleteDupli... | ALGO | 0.999975 | 5.925691 |
74906d7b-153b-41c9-a48b-3f8fa372ac5c | Cnd96/comp | google/codejamw/19/burgher.cpp | #include "bits/stdc++.h"
#include <iostream>
#include <vector>
#include <string>
using namespace std;
int main()
{
int t;
cin>>t;
for (int i = 1; i <=t; i++)
{
int k;
cin>>k;
int od[k];
vector<int> d;
if(k%2==0){
for(int q=0;q<=(k/2)-1;q++){
... | ALGO | 0.999404 | 3.75242 |
a0127139-8964-4dcd-9ecb-16ed33226c48 | BonexGoo/Boss2D | Boss2D/addon/opencv-4.1.1_for_boss/modules/imgproc/src/sumpixels.cpp | #include "precomp.hpp"
#include "opencl_kernels_imgproc.hpp"
#include "opencv2/core/hal/intrin.hpp"
#include "sumpixels.hpp"
namespace cv
{
template <typename T, typename ST, typename QT>
struct Integral_SIMD
{
bool operator()(const T *, size_t,
ST *, size_t,
QT *, size_t,
... | ALGO | 0.998172 | 4.29556 |
7f1698ae-6cfc-438a-bcd5-3052b354aa56 | thatscoding/DSA | String/reverse.cpp | #include<bits/stdc++.h>
using namespace std;
string reverseString(string str){
int start=0;
int end = str.length()-1;
while(start<end){
swap(str[start],str[end]);
start++;
end--;
}
return str;
}
int main(){
string str = "sachin";
cout<<reverseString(str);
} | ALGO | 0.997924 | 3.584763 |
8cc92b95-8c2e-4a79-a6fc-9596d4f66a82 | LIMDANBI/STUDY_CT | SW 역량 인증 기출/도로건설.cpp | #include<iostream>
#include<queue>
#define MAX 201
#define INF 10001
using namespace std;
int N;
char map[MAX][MAX];
int cost[MAX][MAX];
int dy[] = {-1,1,0,0};
int dx[] = {0,0,-1,1};
void input(){
cin >> N;
for(int i=0; i<N; i++){
for(int j=0; j<N; j++) cin >> map[i][j];
}
}
void init(){
for(... | ALGO | 0.999562 | 4.037111 |
66c12be2-764f-4f1e-bce4-7f9a466983b6 | doudou0o/LeetCode | solutions/Linked_List_Cycle_2.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
ListNode *detectCycle(ListNode *head) {
if(head==NULL)return NULL;
if(head->next==NULL)return NULL;
ListNode... | ALGO | 0.999958 | 5.456913 |
81526e87-28ef-4d17-9d82-8c0145abee94 | githubcpt/viewBasePolyScope | deps/libigl/include/igl/is_edge_manifold.cpp | #include <algorithm>
#include <vector>
template <
typename DerivedF,
typename DerivedBF,
typename DerivedE,
typename DerivedEMAP,
typename DerivedBE>
IGL_INLINE bool igl::is_edge_manifold(
const Eigen::MatrixBase<DerivedF>& F,
Eigen::PlainObjectBase<DerivedBF>& BF,
Eigen::PlainObjectBase<DerivedE>& E,
... | ALGO | 0.985705 | 6.948564 |
5433738f-6f43-477e-aa71-341a35f32bc2 | tomodakatunori/Dxlib_STG_20210422_Github | main.cpp | //wb_t@C̓ǂݍ
#include "game.h" //Q[̊{
#include "keyboard.h" //L[{[hĝɕKv
#include "FPS.h" //FPS̏
#include <math.h>
//}N`
#define TAMA_DIV_MAX 4 //ẻ摜̍ő吔
#define TAMA_MAX 1024 //ȇ
#define TEKI_KIND 8 //G̎
#define TEKI_MAX 10 //G̍ő̐
//\̂̒`
//摜̍\
struct IMAGE
{
int handle = -1; //摜̃nh
char path[255]; //摜̏... | TOOL | 0.878397 | 3.196981 |
07471cfe-7f3e-473e-b991-1c68427e06c1 | viiccwen/Competitve-programming | LeetCode/Daily/202311/1441. Build an Array With Stack Operations.cpp | class Solution {
public:
vector<string> buildArray(vector<int>& target, int n) {
vector<string> res;
int k = 1;
for (int i = 0; i < target.size(); i++) {
while (k < target[i]) {
res.push_back("Push");
res.push_back("Pop");
k++;
}
res.push_back("Push");
k++... | ALGO | 0.999898 | 6.640194 |
68380e70-b067-4a47-bd5a-1cb42c400f32 | eemoreira/biblioteca-de-problemas | cf/edu147/e.cpp | #include <bits/stdc++.h>
using namespace std;
typedef tuple<int,int,int> i3;
typedef long long ll;
typedef pair<int,int> ii;
#ifndef ONLINE_JUDGE
#include "debug.h"
#else
#define dbg(x...)
#endif
/* stop freaking out pls */
string change(string s, int to, int from) {
string ans = s.substr(0,to + 1) + s[from];
... | ALGO | 0.999453 | 4.027885 |
8f42c978-e089-4d79-81e9-df4e324bb458 | ishandutta2007/codeforces | 18michael/normal/15/C.cpp | #include<cstdio>
#define Mx 55
#define LL long long
int n;LL x,m,res=0;LL pw[56];
inline LL max(LL a,LL b)
{
return a>b? a:b;
}
inline LL solve(LL x)
{
LL res=((x&3)==1 || (x&3)==2),y;
for(int i=1;i<Mx;++i)res^=((max((x%pw[i+1])-pw[i]+1,0)&1)*pw[i]);
return res;
}
int main()
{
scanf("%d",&n),pw[0]=1;for(int i=1;i<... | ALGO | 0.999902 | 4.117287 |
e6c66b28-5c5e-4b26-bba7-6da4e991bfbd | yt-shen/Evaluation-of-Arithmetic-Expression | public.cpp | #include "public.h"
// Define the type of operations.
int get_type(string opera) {
if (opera == "(") return 1;
if (opera == "+") return 2;
if (opera == "-") return 3;
if (opera == "*") return 4;
if (opera == "/") return 5;
if (opera == ")") return 6;
return 0;
}
// Precedence is used to handle the order of op... | ALGO | 0.997578 | 4.026899 |
ecf74864-6382-452f-8af8-26ba1c93b532 | lucic71/llvm-ub-free | libcxx/test/std/algorithms/alg.modifying.operations/alg.partitions/ranges_partition_point.pass.cpp | // UNSUPPORTED: c++03, c++11, c++14, c++17
// UNSUPPORTED: libcpp-has-no-incomplete-ranges
// <algorithm>
// template<forward_iterator I, sentinel_for<I> S, class Proj = identity,
// indirect_unary_predicate<projected<I, Proj>> Pred>
// constexpr I partition_point(I first, S last, Pred pred, Proj proj = {}... | TEST | 0.963862 | 7.637679 |
691a5a02-18e3-4317-8f69-d96ba64f8de0 | Faizun-Faria/Competitive-Programming | Online-Judge-Solutions/CodeForces/822A/22334543_AC_31ms_8kB.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
int main(){
int a,b;
ll n=1;
cin>>a>>b;
if(a>b)swap(a,b);
for(int i=1; i<=a;i++){
n*=i;
}
cout<<n<<endl;
return 0;
}
| ALGO | 0.999938 | 4.093503 |
da9e5c75-2c03-4d9b-8a82-03e957e3623c | ishandutta2007/codeforces | eddy1021/normal/657/C.cpp | // eddy1021
#include <bits/stdc++.h>
using namespace std;
typedef double D;
typedef long double LD;
typedef long long ll;
typedef long long LL;
typedef pair<int,int> PII;
typedef pair<LL,LL> PLL;
typedef pair<LD,LD> Pt;
#define mod9 1000000009ll
#define mod7 1000000007ll
#define INF 1023456789ll
#define INF16 10000000... | ALGO | 0.999976 | 3.112539 |
f2caf066-3cc2-496c-8eeb-60e4a1588d22 | massout/ODEVs | Sınıf2/Algoritmalar/O2.cpp | /* labirent.txt dosyasının içeriği
0 1 0 0 0 0 0 0 0
1 0 1 0 0 0 0 0 0
0 1 0 0 0 1 0 0 0
0 0 0 0 0 0 1 0 0
0 0 0 0 0 1 0 1 0
0 0 1 0 1 0 0 0 0
0 0 0 1 0 0 0 1 0
0 0 0 0 1 0 1 0 1
0 0 0 0 0 0 0 1 0
*/
#include <cmath>
#include <fstream>
#include <iostream>
#include <list>
#include <vector>
using namespace std;
int ... | ALGO | 0.999901 | 3.894802 |
bbf3a04a-318d-47e1-aa69-c9d180912194 | aponom84/lpam-clustering | related_methods/OSLOM2/Sources_2_5/louvain/standard_package/histograms.cpp |
#if !defined(HISTOGRAMS_INCLUDED)
#define HISTOGRAMS_INCLUDED
int intlog_binning(deque<int> c, int number_of_bins, deque<double> & Xs, deque<double> & Ys, deque<double> & var) {
// this function is to make a log_histogram along the x axis and to compute y-errors
//prints(c);
Xs.clear();
Ys.clear();
var.cle... | ALGO | 0.884923 | 4.320524 |
cb0f300b-b94f-4b08-82cd-351aecbd6bc2 | JacobChstrfld/Operating-Systems-Labs | Lab 5/Lab5.cpp | #include <iostream>
#include <cstring>
#include <fstream>
#include <vector>
#include <math.h>
#include <algorithm>
#include <pthread.h>
#include <unistd.h>
struct PCB{
char name[16];
int32_t processID;
char status;
int32_t bt;
int32_t base;
int64_t limit;
char priority;
};
struct Queue{
... | ALGO | 0.999855 | 3.360576 |
42c431fb-656a-4c25-bc43-ae467f4c11ec | ishandutta2007/codeforces | baluteshih/normal/939/A.cpp | #pragma GCC optimize("Ofast")
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <string.h>
#include <bitset>
#include <queue>
#include <utility>
using namespace std;
#define jizz ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define ll long long
#define pb push_back
#define MEM(i,j... | ALGO | 0.999987 | 3.670305 |
4bc6814b-7051-49e2-9072-e19d6f2f6910 | bhavyagoel/LeetCode | 9. June & July'22/173-binary-search-tree-iterator/173-binary-search-tree-iterator.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.999883 | 6.341879 |
a29b47d0-7a30-45a5-b14b-ac93a7727c5b | iagozag/programmingSubjects | PC/lista1/p21.cpp | #include <bits/stdc++.h>
using namespace std;
#define _ ios_base::sync_with_stdio(0);cin.tie(0);
#define rep(i,x,n) for(auto i=x;i<n;i++)
#define repr(i,n,x) for(auto i=n;i>=x;i--)
#define forr(x, v) for(auto& x: v)
#define all(a) (a).begin(), (a).end()
#define endl '\n'
#define ff first
#define ss second
#define pb p... | ALGO | 0.999869 | 4.105858 |
42044daa-886f-40e9-b461-e92fe8a8b1cb | Melkonyan-Anahit/CHP | ex2.cpp | #include <iostream>
#include <cstdlib>
int gcd(int a, int b) {
return b == 0 ? std::abs(a) : gcd(b, a % b);
}
int lcm(int a, int b) {
return std::abs(a * b) / gcd(a, b);
}
int main() {
int num1, num2;
std::cout << "Enter two numbers: ";
std::cin >> num1 >> num2;
std::cout << "LCM of " << nu... | ALGO | 0.998855 | 5.778561 |
da34518d-586e-4262-9160-da3bc3f8b9ac | ishandutta2007/codeforces | snuke/normal/1616/H.cpp | #include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rep1(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < (t); ++i)
#define rng(a) a.begin(),a.end()
#define rrng(a) a.rbegin(),a.rend()
#define fi first
#define se seco... | ALGO | 0.99996 | 4.05365 |
d592c9b1-7a2b-425b-9263-78cdfa36b902 | DayBreakZhang/Tesseract_Ocr | source/Tesseract3.02/tesseract-ocr/ccmain/resultiterator.cpp | #include "resultiterator.h"
#include <allheaders.h>
#include "pageres.h"
#include "strngs.h"
#include "tesseractclass.h"
#include "unicharset.h"
#include "unicodes.h"
namespace tesseract {
ResultIterator::ResultIterator(const LTRResultIterator &resit)
: LTRResultIterator(resit) {
in_minor_direction_ = false;
... | ALGO | 0.854256 | 6.610278 |
ec5d0431-99f6-4795-858e-8cf234f3dce7 | vivekbiragoni/Leetcode | Strings/2032-largest-odd-number-in-string/largest-odd-number-in-string.cpp | class Solution {
public:
string largestOddNumber(string nums) {
for(int i = nums.size()-1; i>=0; i--){
if((nums[i] - '0')%2 == 1)
{
return nums.substr(0, i+1 );
}
}
return "";
}
}; | ALGO | 0.999918 | 6.140997 |
a1d2fcf5-c46e-4b2e-9804-dcf14b03e61d | Kawron/GameOfLife | CellMap.cpp | //
// Created by karol on 30.05.22.
//
#include "CellMap.h"
#include "Cell.h"
#include <iostream>
CellMap::CellMap(int width, int height) : width(width), height(height) {
for (int i = 0; i < width; i++) {
for (int j = 0; j < height; j++) {
Vector2d vec = Vector2d(i, j);
Cell *cell... | TOOL | 0.864897 | 4.257653 |
01e50aa2-6fad-444d-bcfd-9b11bc94df03 | pavelsevecek/OpenSPH | core/post/StatisticTests.cpp | #include "post/StatisticTests.h"
#include <algorithm>
#include <numeric>
NAMESPACE_SPH_BEGIN
Float Post::correlationCoefficient(ArrayView<const PlotPoint> points) {
SPH_ASSERT(points.size() >= 2);
// find the mean
PlotPoint mean(0._f, 0._f);
for (PlotPoint p : points) {
mean += p;
}
me... | TEST | 0.861818 | 6.237542 |
919d6659-b758-4ca1-a57b-fba2b849365c | HyperionSan/Last_One_Standing | Cactus/repos/fuka/src/Ope_1d/ope_1d.cpp | #include "headcpp.hpp"
#include "val_domain.hpp"
#include "scalar.hpp"
namespace Kadath {
Array<double> Base_spectral::ope_1d (int (*func) (int, Array<double>&),
int var, const Array<double>& in, Base_spectral& base_out) const {
Array<double> res (in.get_dimensions()) ;
int after = 1 ;
for (int i=0 ; i<var ;... | ALGO | 0.957219 | 4.281701 |
53078c9f-3951-4d43-a681-9217a26c135a | MKurthen/BayesianCausalInference | comparison_methods/Mooij16/fasthsic/fasthsic.cpp | #include "mex.h"
#include "hsic.h"
#include <cmath>
/* Input Arguments */
#define X_IN prhs[0]
#define Y_IN prhs[1]
#define SX_IN prhs[2]
#define SY_IN prhs[3]
#define NRPERM_IN prhs[4]
#define NR_IN 2
#define NR_IN_OPT 3
/* Output Arguments */
#define P_OUT plhs[0]
#define HSIC_... | ALGO | 0.993596 | 6.582724 |
3202bc18-80de-42e4-9447-d654da35c378 | atharvrendale/Ooplab | OOP5.cpp | #include <iostream>
class Stack {
private:
int *stack_array;
int top;
int size;
public:
Stack() : stack_array(nullptr), top(-1), size(0) {}
Stack(int s) : stack_array(new int[s]), top(-1), size(s) {}
~Stack() {
delete[] stack_array;
}
bool isEmpty() const {
return to... | ALGO | 0.998164 | 5.772639 |
6f89d5fb-8b6a-441f-a48e-1a149a5c9527 | raincross7/code-similarity | codes/train_code/problem321/problem321_442.cpp | #include<iostream>
#include<algorithm>
#include<functional>
#include<cmath>
#include<string>
#include<vector>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<deque>
using namespace std;
#define ll long long
const int mod = 1000000007;
const ll INF = 1000000000000000000;
ll A[2010];
int main()
{
l... | ALGO | 0.999971 | 4.035313 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.