uuid stringlengths 36 36 | repo_name stringlengths 5 133 | relative_path stringlengths 3 3.76k | content stringlengths 282 4.03M | category stringclasses 6
values | algo_rel_score float32 0.9 1 | quality_score float32 3 8.13 | source_meta dict |
|---|---|---|---|---|---|---|---|
e83ae358-7820-4fb7-9189-7e9f56e441f7 | DionysiosB/CodeForces | 0900-0999/978G-PetyasExams.cpp | #include <cstdio>
#include <iostream>
#include <vector>
#include <algorithm>
struct xm{long s, d, c, r;};
bool xmCompare(xm a, xm b){return a.d < b.d;}
int main(){
long n, m; scanf("%ld %ld", &n, &m);
std::vector<xm> v(m);
for(long p = 0; p < m; p++){scanf("%ld %ld %ld", &v[p].s, &v[p].d, &v[p].c); v[p].... | ALGO | 0.999993 | 3.479358 | {
"github_metadata": {
"branch": "master",
"commit_count": 4487,
"repo_created_at": "2013-06-27T18:15:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 690,
"forks": 163,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dde... |
4d236f45-a697-4576-9365-9358e08309be | prajwolsubedi/100daysCoding-Part1-DSA | binarySearch/peakMountain.cpp | #include<iostream>
using namespace std;
int peakMountain(int arr[], int size){
int start = 0;
int end = size - 1;
int middle = start + (end - start) / 2;
while(start <= end){
if(arr[middle] > arr[middle+1]){
if(arr[middle] > arr[middle-1])
return middle;
e... | ALGO | 0.999975 | 4.288932 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2023-01-23T14:29:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b53aa144822... |
c187e159-1318-45fd-a8c2-88bf5b17fb19 | MightyBhargava/CNS-Sem-6 | DAY-5/Q36/Q36.cpp | #include <stdio.h>
#include <string.h>
int mod_inverse(int a, int m) {
a = a % m;
for (int x = 1; x < m; x++) {
if ((a * x) % m == 1) {
return x;
}
}
return 1;
}
void encrypt_affine_caesar(const char *plaintext, int a, int b, char *ciphertext) {
int len = strlen(plainte... | ALGO | 0.999859 | 4.256781 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2024-03-14T06:34:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0348caae4a8b... |
fad49a6c-41b5-4b2e-b35f-b259c7346e3e | YarnSpinnerTool/YarnSpinner-Unreal | Source/YarnSpinner/Private/YarnSpinnerCore/VirtualMachine.cpp | #include "YarnSpinnerCore/VirtualMachine.h"
#include "CoreMinimal.h"
#include "YarnSubsystem.h"
#include <stack>
#include <regex>
#include <string>
#include <sstream>
namespace Yarn
{
VirtualMachine::VirtualMachine(Yarn::Program program, /*Library& library,*/ IVariableStorage& variableStorage, ILogger& logger)
... | TOOL | 0.974701 | 7.113701 | {
"github_metadata": {
"branch": "main",
"commit_count": 130,
"repo_created_at": "2020-08-12T02:46:19.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 62,
"forks": 7,
"issues": 1,
"pull_requests": 3
},
"file_meta": {
"content_id": "4148597b8a... |
288762b4-0151-4c9e-8e71-863f4f91a167 | marmot0814/OmegaExercise | 雜題/各種瑣碎/U_00162.cpp | #include <bits/stdc++.h>
using namespace std;
int trans(char c) {
if (c == 'A') return 1;
if (c == 'T') return 10;
if (c == 'J') return 11;
if (c == 'Q') return 12;
if (c == 'K') return 13;
return c - '0';
}
int value(int x) {
if (x == 1) return 4;
if (x == 11) return 1;
if (x == 12)... | ALGO | 0.999213 | 3.400748 | {
"github_metadata": {
"branch": "master",
"commit_count": 39,
"repo_created_at": "2018-12-28T09:01:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c4d69b066... |
d4c4307c-f2ba-4dd9-ab26-0ea91566a66b | ImtiazAhmedAkash/Problem-Solving | codeforces/1999/C.cpp | /* In the Name of ALLAH, the most gracious, the most merciful */
// C - Showering
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define nl '\n'
#define deb(x) cerr << #x << " = " << x << nl
const int inf = 1e9;
const ll INF = 1e18;
const int mod = 998244353;
const int N = 2e5 + 5;
void solve... | ALGO | 0.99991 | 4.565773 | {
"github_metadata": {
"branch": "main",
"commit_count": 475,
"repo_created_at": "2022-11-19T14:05:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "823d7b52c0... |
2de240f1-ca22-4fb4-af98-b079aa18b095 | abhiramdapke/Independent-projects | Matrices and Graphs/Print a matrix in a spiral order.cpp | #include <iostream>
#include <vector>
using namespace std;
vector<int> spiralOrder(vector<vector<int>>& matrix) {
if (matrix.size() == 0)
return {};
int n = matrix.size();
vector<int> v;
int m = matrix[0].size();
int top = 0;
int down = n-1;
... | ALGO | 0.999997 | 5.603623 | {
"github_metadata": {
"branch": "master",
"commit_count": 384,
"repo_created_at": "2020-01-22T23:01:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6ca4a218... |
edf62b4f-cf08-4836-80ea-4247d0543b4f | todouu/cs444-11-04 | homework4/concurrency4/con1.cpp | /*
* Programmers: <NAME>, <NAME>, <NAME>
* Class: CS 444 - Operating Systems II
* Date: 5/29/17
* Description: Barbershop Problem - Problem 1
*/
#include "concurrency.hpp"
#define MaxThreadNum 5
static volatile int run = 1;
worker workers[] = {{0, 0}, {0, 0}, {0, 0}, {0, 0}};
pthread_mutex_t mutexnum;
pthre... | ALGO | 0.996332 | 4.587143 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2017-04-11T19:33:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dfe9cb709... |
1c7eacfb-4578-4c62-88a4-6f9ec841161d | okrcma/pseudoprimes | power_two/case1.cpp | #include <iostream>
#include <NTL/ZZ.h>
#include <chrono>
#include <vector>
#include <fstream>
/**
* Compute fibonacci number for 2**i mod m. Using double and add method.
*/
NTL::ZZ fibonacci_mod(int i, const NTL::ZZ& m) {
NTL::ZZ x;
x = 0;
NTL::ZZ y;
y = 1;
NTL::ZZ tmp;
// add for the fir... | ALGO | 0.998685 | 5.31126 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2021-02-23T18:43:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "963cd3d711ea... |
cce5042d-8c4f-448b-8e3c-e0682619cc73 | raincross7/code-similarity | codes/train_code/problem460/problem460_499.cpp | #include <iostream>
#include <algorithm>
using namespace std;
void solve() {
long long h, w, t;
cin >> h >> w;
long long ans, minans = 1e5, maxsq, minsq;
for (int j=0; j<2; ++j) {
for (long long i=1; i < h; ++i) {
maxsq = max(w*i, max((h-i)*(w/2), (h-i)*(w/2) + (h-i)*(w&1)));
... | ALGO | 0.999882 | 3.554112 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-03-06T05:07:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "24da9179ced7... |
adb47370-7acf-4ea2-8f1f-93fa0fcfd151 | Paresh-Wadhwani/Competitive_Programming | SPOJ (Sphere Online Judge)/SEQ/Solutions/C++/SPOJ_SEQ.cpp | #include <iostream>
#include <cstdio>
#include <cctype>
#include <string>
#include <sstream>
#include <iomanip>
#include <cmath>
#include <algorithm>
#include <array>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#define ll long long
#define mod 1000... | ALGO | 0.999996 | 4.315627 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2020-11-11T18:30:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "32e77788234... |
32bd9f59-f31c-4c19-a3bf-172519cd09a5 | ishandutta2007/codeforces-d | demoralizer/normal/1209/E1.cpp | #include "bits/stdc++.h"
using namespace std;
#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(v)),(v).end())
#define sz(x) ... | ALGO | 0.999971 | 3.94737 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:31:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "67602d2fe9b3... |
03421aa8-53ce-48e6-96bc-1d57deb7a829 | FranckyAndriam/HestonEfficientSimulation_Andersen | BroadieKayaScheme.cpp | #include "BroadieKayaScheme.h"
#include <cmath>
BroadieKayaScheme::BroadieKayaScheme(double kappa, double theta, double epsilon, double rho, double r,
double gamma1, double gamma2, const Variance* variance_scheme)
: kappa(kappa), theta(theta), epsilon(epsilon), rho(r), r(r),
gamma1(gamma1), gamma2(gamma2),... | ALGO | 0.988083 | 5.39198 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2025-04-21T08:47:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1db74c7d7a4... |
a37a8ae8-157b-4269-8dda-1abb13b02140 | enitink/prj | generic/codes/leetcode/productsubarrayofk.cpp | /**************************************************************************************************
713. Subarray Product Less Than K
Given an array of integers nums and an integer k, return the number of contiguous subarrays where
the product of all the elements in the subarray is strictly less than k.
Example 1:
... | ALGO | 0.999698 | 5.884741 | {
"github_metadata": {
"branch": "master",
"commit_count": 136,
"repo_created_at": "2014-02-02T13:22:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0dec2ab8... |
17cd3b9e-9453-4500-b5f7-805459948c54 | lxiao217/study428 | 深度学习/源码/OpenCV/opencv_contrib/modules/tracking/src/trackerMIL.cpp | /*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, i... | ALGO | 0.996117 | 6.154345 | {
"github_metadata": {
"branch": "main",
"commit_count": 46,
"repo_created_at": "2023-05-29T01:51:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 141,
"forks": 28,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1754f0db... |
2987f2ed-a29a-4ac7-a2b4-7f05353beedb | chroniclesofcode/competitive-programming | atcoder/abc390E-Vitamin_Balance.cpp | #include <bits/stdc++.h>
using namespace std;
#define MAINRET(x) in##x
#define what_is(x) cout << #x << " is " << x << endl;
#define prLL_vec(x, n) for (LL i = 0; i < n; i++) cout << x[i] << ' '; cout << endl;
#define LL long long
#define arr2 array<LL,2>
#define arr3 array<LL,3>
void solve();
MAINRET(t) main(void)... | ALGO | 0.999824 | 4.498103 | {
"github_metadata": {
"branch": "main",
"commit_count": 822,
"repo_created_at": "2022-09-09T05:32:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8781bd939b... |
f4aaf649-f41c-4d92-a382-8d14e9888fcf | Wilson9098/C-Code | 22nd practice.cpp | #define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <assert.h>
#include <string.h>
#include <time.h>
#include <windows.h>
int* partition(int* arr, int L, int R);
void Swap(int* arr, const int n, const int R)
{
assert(arr);
int tmp = arr[R];
arr[R] = arr[n];
arr[n] = tmp;
}
void quicksort(int* arr, cons... | ALGO | 0.999953 | 4.450892 | {
"github_metadata": {
"branch": "main",
"commit_count": 106,
"repo_created_at": "2021-11-03T23:04:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b1a323de9d... |
3cd9d4c5-0505-42cb-ad87-676ca4523ec7 | prasadsilva/advent-of-code-2018 | src/day13.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <fstream>
#include <set>
#include <list>
#include <regex>
#include <limits>
#include <array>
namespace day13 {
const bool trace_read = false;
const bool trace_carts_collisions = true;
const bool trace1 = true;
const bool trace2 = false;
con... | ALGO | 0.999579 | 5.769566 | {
"github_metadata": {
"branch": "master",
"commit_count": 58,
"repo_created_at": "2018-12-14T23:35:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5a9697e44... |
af80f75d-5951-497c-86e1-14a133bc536a | ishandutta2007/codeforces-f | fruwajacybyk/normal/1098/B.cpp | #include <bits/stdc++.h>
#include <unistd.h>
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define FORD(i, a, b) for(int i = (a); i >= (b); --i)
#define VAR(v, i) __typeof(i) v=(i)
#define FORE(i, c) for(VAR(i, (c).begin()); i != (c).end(); ++i)
#define all(v) (v).begin(),(v).end()
#define PII pair<int,int>
#define mp ... | ALGO | 0.999975 | 3.27932 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:43:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "95d4c997a5e9... |
4c8eb498-272d-40d7-b726-c76b5e1af47d | ishandutta2007/codeforces-i | ivan100sic/normal/1437/E.cpp | // Retired?
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long unsigned long ull;
typedef double long ld;
int n, k;
int a[500005];
bool c[500005];
int d[500005];
int main() {
ios::sync_with_stdio(!cin.tie(0));
cin >> n >> k;
for (int i=0; i<n; i++) {
int x;
cin >> x;
a[i] = x ... | ALGO | 0.999979 | 3.647382 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T05:39:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "37600902a9c2... |
53bf4b56-14aa-4865-b59c-52ad651c608e | JianFC/AlgorithmLearning | AcWing/Level_1/Chapter2/ac154.cpp | #include <iostream>
using namespace std; //AcWing 154. 滑动窗口
const int N = 1000010;
int n, k;
int a[N];
int q[N], hh, tt = -1; //q单调队列,队列中存储的是数据的下标
int main(void) {
scanf("%d%d", &n, &k);
for (int i = 0; i < n; i ++) scanf("%d", &a[i]);
for (int i = 0; i < n; i ++) { //从前往后遍历每一个位置
... | ALGO | 0.999993 | 3.492571 | {
"github_metadata": {
"branch": "master",
"commit_count": 108,
"repo_created_at": "2021-03-18T12:12:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c81f6833... |
a9c0d1e9-1bdb-4397-8ef0-eb587a95be36 | eisber/vowpal_wabbit | vowpalwabbit/search_meta.cc | /*
Copyright (c) by respective owners including Yahoo!, Microsoft, and
individual contributors. All rights reserved. Released under a BSD (revised)
license as described in the file LICENSE.
*/
#include <float.h>
#include <errno.h>
#include "reductions.h"
#include "vw.h"
#include "search.h"
using namespace std;
name... | ALGO | 0.997549 | 6.070463 | {
"github_metadata": {
"branch": "master",
"commit_count": 7639,
"repo_created_at": "2015-05-08T15:04:38.000Z",
"is_fork": true,
"is_org_owned": false,
"forked_from": "VowpalWabbit/vowpal_wabbit",
"stars": 23,
"forks": 10,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
... |
3ae6a322-c54b-4f76-85bf-2795cab3c9e6 | adarshnarayan04/Codeforces | 1486B.cpp | #include <bits/stdc++.h>
using namespace std;
#ifndef ONLINE_JUDGE
#include "debugging.h"
#else
# define debug(x...)
#endif
#define int long long
#define ll long long
#define w(t) int testcase; cin>>testcase; for (int tc = 1; tc <= testcase; ++tc)
#define vin(v,n) for(int i = 0; i < n; ++i){int x;cin>>x;v.push_bac... | ALGO | 0.999533 | 4.172966 | {
"github_metadata": {
"branch": "main",
"commit_count": 30,
"repo_created_at": "2023-06-25T06:22:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bfd3a782ef0... |
ec209e5a-bdd9-4aa9-9725-227d3b12c4fc | danieelgohh/Automated-Trash-Bot-Prototype | Complete/Complete/Complete.ino | //defines variables for IR sensor
int val_container; // store analog value read from IR sensor inside the bin
int distance_container; // returns distance inside bin calculated in cm
int sum_container = 0; // variable used for calculations
// defines pin numbers for ultrasound
int trigPin = 9... | TOOL | 0.905744 | 4.029474 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2021-07-15T20:53:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "63663a1014f4... |
0d15650c-5602-48ee-8b62-4d5c14ba04b7 | RRIZVE/Graph-Theory-1 | 1 Graph Theory/4 grid/1192 CSES Counting Rooms.cpp | //***********************Bismillah-ir-Rahman-ir-Rahim******************************\
//In the Name of Allah
//<NAME>
//<NAME>
#include<bits/stdc++.h>
using namespace std;
#define Alhamdulillah ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define endl '\n'
typedef long long ll;
typedef unsigned long long ull;... | ALGO | 0.999368 | 3.808328 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-08-15T18:17:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a607523ba430... |
ab1d23ba-4df2-4331-881d-8ce9dbc3c9c2 | yasirfaizahmed/Arduino_repository | binary_counter_4bit.ino | const int a0 = 12;
const int a1 = 11;
const int a2 = 10;
const int a3 = 9;
void setup(){
pinMode(a3, OUTPUT);
pinMode(a2, OUTPUT);
pinMode(a1, OUTPUT);
pinMode(a0, OUTPUT);
}
void loop(){
for(int i=0;i<=15;i++){
switch(i){
case 0:
digitalWrite(a3,LOW);
digitalWrite(a2,LOW... | ALGO | 0.979409 | 4.225641 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2019-04-20T19:30:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "627bd18da... |
ca30a40d-29cb-406d-8181-6181d736d7eb | matthewshang/competitive-programming | cf/1369/C.cpp | #include "bits/stdc++.h"
using namespace std;
using ll = long long;
using vi = vector<int>;
using vb = vector<bool>;
using vvi = vector<vector<int>>;
using vll = vector<long long>;
using vpi = vector<pair<int, int>>;
using pii = pair<int, int>;
using pll = pair<long long, long long>;
#define F first
#define S second
#... | ALGO | 0.999989 | 3.73885 | {
"github_metadata": {
"branch": "master",
"commit_count": 163,
"repo_created_at": "2019-02-08T04:37:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9ac455f4... |
73d2073b-81b8-4895-8ec2-c8607978f3db | izenecloud/izenelib | include/util/sortCompare.h | /**
* @file sortCompare.h
* @brief Provides the template compare functions for qsort.
*/
#ifndef _sortCompare_h
#define _sortCompare_h 1
NS_IZENELIB_UTIL_BEGIN
template <class Element> int sort_compare(const Element* a, const Element* b);
template <class Element> int sort_ptr_compare(const Element** a, const ... | ALGO | 0.995226 | 6.004306 | {
"github_metadata": {
"branch": "master",
"commit_count": 4711,
"repo_created_at": "2014-09-11T15:18:18.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 42,
"forks": 12,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "b769ab... |
b2255154-e3ae-4960-8cbd-4e684a4a57b5 | SSAFY-ALGORITHM-12th-2Team/GyuHyeon | Leetcode/Medium/0874-walking-robot-simulation/0874-walking-robot-simulation.cpp | class Solution {
public:
int robotSim(vector<int>& commands, vector<vector<int>>& obstacles) {
map<pair<int, int>, int> m;
for (auto o: obstacles) m[{o[0], o[1]}]++;
vector<vector<int>> dir = {{0,1}, {1,0}, {0,-1}, {-1,0}};
int d = 0, x = 0, y = 0, ans = 0;
for (auto c: comma... | ALGO | 0.999985 | 5.166031 | {
"github_metadata": {
"branch": "main",
"commit_count": 344,
"repo_created_at": "2024-08-21T23:42:37.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d5e80d7e9d4... |
cae182b8-e91e-4338-9d9e-1e8427bbded1 | PrveenYadav/DSA-Journey | 25_Graph/Lecture-93 & 94 Graph/code1.cpp | #include <iostream>
#include <climits>
#include <vector>
#include <queue>
using namespace std;
//Shortest path in Undirected Graph : we'll use queue and distance array
vector<int> shortestPath(int src, int N, int M, vector<vector<int>> &edges) {
vector<vector<int>> adj(N);
for(auto i : edges) {
adj[i[0... | ALGO | 0.999992 | 5.329307 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2025-02-28T08:40:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f71dc48e1b94... |
419dd23a-048a-4fbc-b7f8-dbaa5b6a537b | liuyubobobo/Play-Leetcode | 2501-3000/2761-Prime-Pairs-With-Target-Sum/cpp-2761/main.cpp | /// Source : https://leetcode.com/problems/prime-pairs-with-target-sum/description/
/// Author : liuyubobobo
/// Time : 2023-07-10
#include <iostream>
#include <vector>
using namespace std;
/// Sieve
/// Time Complexity: O(nlogn)
/// Space Complexity: O(n)
class Solution {
public:
vector<vector<int>> findPrim... | ALGO | 0.999811 | 5.338816 | {
"github_metadata": {
"branch": "master",
"commit_count": 2592,
"repo_created_at": "2016-12-01T17:08:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2732,
"forks": 718,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "d0... |
a5a90b1a-6ddc-4db0-bb34-3edfe6092ac6 | o3de/o3de | Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorVisibleEntityDataCache.cpp | /*
* Copyright (c) Contributors to the Open 3D Engine Project.
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
#include "EditorVisibleEntityDataCache.h"
#include <AzCore/std/sort.h>
#include <AzToolsFramework... | TOOL | 0.940656 | 7.907576 | {
"github_metadata": {
"branch": "development",
"commit_count": 26515,
"repo_created_at": "2021-04-05T06:38:18.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 8421,
"forks": 2320,
"issues": 3293,
"pull_requests": 98
},
"file_meta": {
"conten... |
0f6fe827-f55e-46e9-93da-224ecf48b2f0 | glanzkaiser/SymIntegration | Examples/Test SymIntegration Trigonometry Integration Level 4 Sec^m Tan^n for n Odd m Even with Functions/main.cpp | /*
SymIntegration is branching from SymbolicC++ 3.35
SymbolicC++ : An object oriented computer algebra system written in C++
Copyright (C) 2008 <NAME> and <NAME>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published b... | ALGO | 0.999499 | 5.836399 | {
"github_metadata": {
"branch": "main",
"commit_count": 53,
"repo_created_at": "2025-04-09T06:27:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0c6cc49a398... |
9c0dcfa6-a8c0-4334-aa93-9e0bc40e8ba3 | hdh06/CP-code | Sờ Trinh nhẹ nhàng giải trí/D.cpp | #include <bits/stdc++.h>
using namespace std;
struct node{
node* tree[128] = {};
// map<char, node*> tree;
node* link = nullptr;
bool end = false;
bool calc = false;
bool match = false;
int cnt = 0;
};
node* nn(){
node* n = new node;
return n;
}
void insert(node* root, string s){
node* v = root;
for (i... | ALGO | 0.999935 | 3.913507 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2023-12-23T02:31:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d42ae8653f10... |
cb143ed0-d983-4b95-99b0-e66db3e203aa | laam-egg/HPFS | include/Rack.hpp | #ifndef Rack_DEFINED
#define Rack_DEFINED
#include <vector>
#include "Crop.hpp"
#include "Cultivation.hpp"
class Rack {
public:
int rackId;
int numberOfTimeSlot;
int numAvailableTimeSlot;
bool haveSunlight;
std::vector<Cultivation> cultivations;
std::vector<Crop*> cropAtTimeSlot;
std::vect... | ALGO | 0.982802 | 5.456678 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2023-12-03T18:22:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "704f5ab5ddb... |
75464eca-30e8-4288-952e-ae9244975f31 | amandanish882/Polygot | C_Cpp/Introduction to C++ for Financial Engineers source code/Chapter11/HelloWorldAlmost.cpp | // ch3vector.cpp
//
// Examples to show how sequence containers (vector) work.
//
// Last modificaton dates:
//
// 2006-3-22 DD new code for algorithms
//
// (C) Datasim Education BV 2003-2006
//
//
#include <vector>
#include <list>
#include <string>
#include <algorithm>
#include <iostream>
using namespace std;
stri... | ALGO | 0.995817 | 4.470716 | {
"github_metadata": {
"branch": "master",
"commit_count": 102,
"repo_created_at": "2020-07-18T19:05:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "504696eb... |
ca2a2da7-bd63-4062-b65d-016822117268 | AnkurIbySarkar/Strivers-SDE-Sheet-Challenge | implementstackusingarr.cpp | #include <iostream>
using namespace std;
class Stack
{
int *arr;
int Top;
int max_size;
public:
Stack(int capacity)
{
// Write your code here.
arr = new int[capacity];
Top = 0;
max_size = capacity;
}
void push(int num)
{
// Write your code here.
... | ALGO | 0.998906 | 5.308846 | {
"github_metadata": {
"branch": "master",
"commit_count": 197,
"repo_created_at": "2023-06-04T06:55:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "14ba6abd... |
23bc0ff4-a58f-4ff2-a5c1-d00203b67aff | guyutongxue/ica2022 | docs/public/ica/da7f4a3eadf4448d98cca4006c43b640.cpp | #include <cstring>
#include <iostream>
using namespace std;
struct Word {
char word[30];
int occurrence;
};
int main() {
Word words[1000]{};
int wordsCnt = 0;
char c;
char currentWord[30]{};
int currentWordLen = -1;
while (cin.get(c)) {
if (c >= 'a' && c <= 'z' || c >= 'A' && c... | ALGO | 0.999427 | 3.91294 | {
"github_metadata": {
"branch": "main",
"commit_count": 71,
"repo_created_at": "2022-09-07T16:34:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fde394f336b... |
4243d4a6-16e5-4e7e-9580-1e44f3264435 | Nikhil-Attar/Data-Structures | Queue/practical7_LL.cpp | #include<iostream>
#include<stdlib.h>
using namespace std;
struct node
{
int data;
node *next;
};
class CQueue
{
node *front,*rear;
public:
CQueue()
{
front = NULL;
rear = NULL;
}
void enqueue(int val)
{
node* newnode = new node();
newnode->data = val;
if(front == NULL && rear == NULL)
{
... | ALGO | 0.996993 | 3.712915 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2018-10-15T13:34:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "86e7a9999... |
1896ce31-700d-4196-a2d9-99ec4d0884a9 | keyliin0/Competitive-Programming | codeforces/CF201-D1-B.cpp | /*
find min answer for the row and col since both answers are independent
*/
#include <bits/stdc++.h>
using namespace std;
#define loop(i,b,e) for(int i=b;i<=e;i++)
#define loop2(i,e,b) for(int i=e;i>=b;i--)
#define io ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define fi first
#define se second
#define X... | ALGO | 0.999993 | 3.107414 | {
"github_metadata": {
"branch": "master",
"commit_count": 443,
"repo_created_at": "2018-07-08T09:21:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cc58be42... |
ccf8bf6a-14f1-45c4-92cd-372535f1b5f0 | shotauedaGit/cp_practice | ABC/ABC113/ABC113C.cpp | #include <bits/stdc++.h>
using namespace std;
#define INF ((1<<30)-1) //int32_t
#define MOD 1000000007
#define MOD2
#define all(a) (a).begin(),(a).end()
#define mkp make_pair
#define pb push_back
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
int main(){
bool flag=false;
ll... | ALGO | 0.999953 | 3.91341 | {
"github_metadata": {
"branch": "master",
"commit_count": 108,
"repo_created_at": "2020-03-20T04:28:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e4dc7da3... |
147c13ea-193c-43bd-ae55-471df9c6bc02 | celuro/algs-cpp | findMax.cpp | /*
@brief Finds the max element in an array and returns it's index
@param arr is the array being searched
@param size is the size of the array
@return returns index of max element
*/
int findMax(int arr[], int size);
#include <iostream>
int main()
{
const int size = 11;
int arr[size] = {11, 3, 543, 18, 300, ... | ALGO | 0.998943 | 5.633168 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2024-02-08T20:38:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a3326fc9bfc5... |
8b1bf4b6-ba85-4ee6-b8ac-0a502a845b23 | skJack/Leetcode | DFS/[113]路径总和.cpp | 路径总和 II
Category Difficulty Likes Dislikes
algorithms Medium (57.95%) 145 -
Tags
Companies
给定一个二叉树和一个目标和,找到所有从根节点到叶子节点路径总和等于给定目标和的路径。
说明: 叶子节点是指没有子节点的节点。
示例:
给定如下二叉树,以及目标和 sum = 22,
5
/ \
4 8
/ / \
11 13 4
/ \ / \
7 2 5 1
返回... | ALGO | 0.99991 | 4.624887 | {
"github_metadata": {
"branch": "master",
"commit_count": 198,
"repo_created_at": "2019-12-27T11:23:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e6824804... |
d753808f-90e8-4d9d-95ff-1226ccdd5c44 | spinlockirqsave/examples | exception_safety/vector/main.cpp | /*
* File: main.cpp
* Author: peter
*
* Created on April 7, 2014, 1:03 PM
*/
#include <iostream>
#include <algorithm>
template<typename T, typename A = std::allocator<T> >
class vector {
private:
T* v; // start of allocation
T* space; // end of element sequence, start of space a... | TOOL | 0.976372 | 4.834026 | {
"github_metadata": {
"branch": "master",
"commit_count": 357,
"repo_created_at": "2013-08-08T23:46:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 6,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b683de99... |
69eaf1cc-42ef-4efb-85f7-1eef091676b5 | nbutacm/NBUTACM | 2019级/2020年暑期集训 - 课件&标程&题解/2020-暑假出题总附录/std/I/I-O(n).cpp | #include <iostream>
#include <cstdio>
using namespace std;
const int maxn = 1e7 + 10;
long long f[maxn], flag[maxn], prime[maxn];
int is_prime[maxn];
void init() {
f[1] = 1;
for(int i = 2; i < maxn; i++)
is_prime[i] = true;
is_prime[0] = is_prime[1] = false;
int num = 0;
for(int i = 2; i < ... | ALGO | 0.999958 | 4.165898 | {
"github_metadata": {
"branch": "master",
"commit_count": 72,
"repo_created_at": "2019-03-09T16:05:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 14,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dd22a9e9... |
3f8b9107-0667-47ad-aa4b-07f020bc4e53 | SCIInstitute/SCIRun | src/Core/Algorithms/Legacy/FiniteElements/Mapping/BuildNodeLink.cc | /*
For more information, please see: http://software.sci.utah.edu
The MIT License
Copyright (c) 2020 Scientific Computing and Imaging Institute,
University of Utah.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the ... | ALGO | 0.992497 | 6.139244 | {
"github_metadata": {
"branch": "master",
"commit_count": 12589,
"repo_created_at": "2012-02-16T18:51:26.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 132,
"forks": 73,
"issues": 372,
"pull_requests": 2
},
"file_meta": {
"content_id": "f3... |
4a49cecd-8057-413b-8b13-ac2aecb8f83a | stegmuel/sp4e-homeworks | homework3/src/fft.hh | #ifndef FFT_HH
#define FFT_HH
/* ------------------------------------------------------ */
#include "matrix.hh"
#include "my_types.hh"
#include <fftw3.h>
/* ------------------------------------------------------ */
struct FFT {
static Matrix<complex> transform(Matrix<complex>& m);
static Matrix<complex> itransfor... | ALGO | 0.998693 | 6.097881 | {
"github_metadata": {
"branch": "main",
"commit_count": 147,
"repo_created_at": "2024-10-03T09:15:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5e6e83e78b... |
47bf5ace-c331-48df-8ac4-dbfa066bc440 | Anujjha19/cpp | B_Morris_Traversal.cpp | #include <iostream>
#include <queue>
#include <map>
using namespace std;
class Node
{
public:
int data;
Node *left;
Node *right;
Node(int d)
{
this->data = d;
this->left = NULL;
this->right = NULL;
}
};
Node *buildTree(Node *root)
{
cout << "Enter the data: " << e... | ALGO | 0.999996 | 5.169856 | {
"github_metadata": {
"branch": "master",
"commit_count": 61,
"repo_created_at": "2023-01-10T13:26:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "02244636f... |
77f0f3bf-5c0e-47bc-92bb-3d35e296892b | JCheng0709/data-structures-implementation | BinaryTree/AVL_tree.cpp | #include<iostream>
#include <utility>
#include <vector>
#include <queue>
#include <memory>
#include <algorithm>
struct TreeNode
{
int val;
int height;
std::unique_ptr<TreeNode> left, right;
TreeNode() : val(0), height(0), left(nullptr), right(nullptr) {}
TreeNode(int val) : val(val), height(1), lef... | ALGO | 0.999218 | 5.780385 | {
"github_metadata": {
"branch": "master",
"commit_count": 24,
"repo_created_at": "2025-07-01T14:32:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a0d95fcf2... |
5e0cef55-5430-4b65-ac76-4b454915bc2d | ShivamAwasthi07/Data-Structures-Algorithms | leet/2d-binary.cpp | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
class Solution {
public:
bool searchMatrix(vector<vector<int>>& matrix, int target) {
if(matrix[0][0]> target || matrix[matrix[0].size()-1][matrix[0].size()-1] < target){
return false;
}
int vi=0;
int vj=m... | ALGO | 0.999884 | 5.566156 | {
"github_metadata": {
"branch": "master",
"commit_count": 33,
"repo_created_at": "2023-05-24T18:58:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6a65064a7... |
272aad6d-8af6-4467-afd7-32fa610989ca | VarmaMSP/UVA-Solutions | 03 - Problem Solving Paradigms/01 - Complete Search/03 - Iterative (Three or More Nested Loops, Easier)/00154 - Recycling.cpp | #include <bits/stdc++.h>
int ind(char bin) {
switch (bin) {
case 'r': return 0;
case 'o': return 1;
case 'y': return 2;
case 'g': return 3;
case 'b': return 4;
}
}
int main() {
char str[20], city[110][5];
while (scanf("%s", str) && str[0] != '#') {
int n... | ALGO | 0.99876 | 3.657469 | {
"github_metadata": {
"branch": "master",
"commit_count": 126,
"repo_created_at": "2016-11-30T05:36:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 29,
"forks": 11,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d75a11... |
d0e80473-a2a5-4d98-a0fa-858967644e4f | didw/coding | algospot/algosrc/src/local_search/local_search.cpp | #include<iostream>
#include<cstring>
#include<algorithm>
#include<sstream>
#include<string>
#include<vector>
#include<cmath>
#include<cstdio>
#include<cstdlib>
#include<fstream>
#include<cassert>
#include<numeric>
#include<set>
#include<map>
#include<queue>
#include<list>
#include<deque>
using namespace std;
#define F... | ALGO | 0.999656 | 3.937672 | {
"github_metadata": {
"branch": "master",
"commit_count": 96,
"repo_created_at": "2015-12-01T04:53:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e94b3acbe... |
f4fc7a56-af43-4442-9375-01601401c708 | sugo14/Competitive-Programming | leetcode/completed/2415.cpp | #include <bits/stdc++.h>
using namespace std;
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), left(left), right... | ALGO | 0.999995 | 5.876162 | {
"github_metadata": {
"branch": "main",
"commit_count": 36,
"repo_created_at": "2024-11-06T00:38:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "99cf6f06d14... |
e3abde31-15e0-4293-8fd8-9a3dae701c03 | ansh-j/DSA | binary_tree.cpp | #include <stdio.h>
#include <stdlib.h>
struct node
{
int data;
struct node *left;
struct node *right;
};
struct node *create_node(int data)
{
struct node *n = NULL;
n = (struct node *)malloc(sizeof(struct node));
n->data = data;
n->left = NULL;
n->right = NULL;
return n;
}
void pr... | ALGO | 0.999928 | 5.081108 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-05-28T04:30:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2e9eb928f6db... |
1cb08baa-1ee5-4354-bbb3-43360ae3ac6b | Yusheng-cai/CMCEvolver | src/fsolve.cpp | # include <cmath>
# include <cstdlib>
# include <iomanip>
# include <iostream>
# include <limits>
using namespace std;
# include "fsolve.hpp"
//****************************************************************************80
void backward_euler_residual ( void dydt ( double t, double y[], double dy[] ),
int n, dou... | ALGO | 0.999913 | 5.588355 | {
"github_metadata": {
"branch": "main",
"commit_count": 26,
"repo_created_at": "2024-07-01T18:00:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "257fdcbb160... |
81c08e50-1399-414c-84d2-7ff8041665ff | robosoft-ai/turtlebot_gazebo_sm_library | sm_dance_bot_warehouse_2/include/sm_dance_bot_warehouse_2/states/s_pattern_states/sti_spattern_forward_4.hpp | // Copyright 2021 RobosoftAI Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to... | TOOL | 0.967048 | 5.427535 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2025-05-14T18:34:50.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "05926317fe7e0... |
620fd0bc-60db-4249-b2eb-ad202e25b67a | sarahishamsaied/Problem-Solving | Leetcode/mergeSort.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution {
public:
vector<int> sortArray(vector<int>& nums) {
mergeSort(nums,0,nums.size()-1);
return nums;
}
void mergeSort(vector<int>& nums,int l,int r){
if(l<r){
int m=l+(r-l)/2;
mergeSort(nums,l,m);
... | ALGO | 0.999998 | 5.723844 | {
"github_metadata": {
"branch": "main",
"commit_count": 26,
"repo_created_at": "2023-02-24T21:35:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f7f5c3da193... |
2da13c9c-0ed3-4634-a654-0eccf3920552 | RitikJainRJ/Leetcode-Practice | 227. Basic Calculator II.cpp | class Solution {
private:
int solve(int &a, int &b, char &ch){
switch(ch){
case '+' : return a + b;
case '-' : return a - b;
case '*' : return a * b;
case '/' : return a / b;
}
return -1;
}
public:
int calculate(string s) {
stac... | ALGO | 0.999968 | 4.523644 | {
"github_metadata": {
"branch": "master",
"commit_count": 83,
"repo_created_at": "2020-05-08T06:54:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a540cf85f... |
88ae7d16-cee3-43a9-a999-efdd0db2cb2d | hatlonely/leetcode | cpp/leetcode/leetcode/160_intersection_of_two_linked_lists.cpp | //
// 160_intersection_of_two_linked_lists.cpp
// leetcode
//
// Created by hatlonely on 16/1/30.
// Copyright © 2016年 hatlonely. All rights reserved.
//
// Write a program to find the node at which the intersection of two singly linked lists begins.
//
// For example, the following two linked lists:
//
// A: ... | ALGO | 0.99603 | 5.244697 | {
"github_metadata": {
"branch": "master",
"commit_count": 306,
"repo_created_at": "2015-06-20T10:58:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "21e9891c... |
48b45ac0-1f47-4f06-92fc-9136e19f9147 | Liu-Steve/leetcode-sign-in | 20240802-3128.cpp | #include "bits/stdc++.h"
#define io \
ios::sync_with_stdio(false); \
cin.tie(0); \
cout.tie(0)
using namespace std;
struct TreeNode
{
int val;
TreeNode *left;
TreeNode *right;
TreeNode() : val(0), left(nullptr), right(nullptr) {}
TreeNode(int x) : ... | ALGO | 0.999938 | 4.824935 | {
"github_metadata": {
"branch": "main",
"commit_count": 1020,
"repo_created_at": "2022-09-30T16:44:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "968155121... |
526cafc1-269e-4f2a-9d86-a3d76f3ee672 | savi-1311/code-solutions | 1788A.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define vll vector<ll>
#define vvll vector<vector<ll>>
#define umap unordered_map<ll, ll>
#define pa pair<ll, ll>
#define pb push_back
#define loop(i, m, n) for (ll i = m; i < n; i++)
#define loope(i, m, n) for (ll i = m; i <= n; i++)
#define repr(i, m,... | ALGO | 0.99948 | 3.638709 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2022-10-23T04:20:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4514ecf9b... |
119a3469-4f43-48f8-b92a-45e6d3ff1137 | Hasanul-Bari/contests | Codeforces Round #712 (Div. 2)/B. Flip the Bits.cpp | #include<bits/stdc++.h>
#define faster ios :: sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long
#define ull unsigned long long
#define pb push_back
const double PI = acos(-1.0);
using namespace std;
int main()
{
faster
int t,n;
cin>>t;
string a,b;
while(t--)
{
cin>>n... | ALGO | 0.999955 | 3.410307 | {
"github_metadata": {
"branch": "master",
"commit_count": 340,
"repo_created_at": "2020-03-27T16:34:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6c7e1c79... |
bd7461e3-d80c-4f92-b01c-eba17518c4b7 | Sujeet3099/Comp-Code | PS_HackerRank/Greedy/Mark_and_Toys.cpp | #include"bits/stdc++.h"
using namespace std;
/**
* Copyright (c)
* author : <NAME>
* question name : Mark and Toys
* link : https://www.hackerrank.com/challenges/mark-and-toys/problem
*/
#define ll long long
#define ull unsigned long long
#define pb push_back
#define mp make_pair
#define f... | ALGO | 0.999968 | 4.1847 | {
"github_metadata": {
"branch": "master",
"commit_count": 31,
"repo_created_at": "2020-08-05T20:04:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ce9d7fbda... |
0495b6bb-f989-49ff-be1b-95dc782b336e | gosujuna/cf | rating 1156/B_Dorms_War.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using str = string; // ben qi python
#define endl '\n'
#define sz(v) ((int)(v).size())
#define all(v) (v).begin(), (v).end()
template <typename T> T pow(T a, long long b) {
assert(b >= 0);
T r = 1;
while (b) {
if (b & 1)
r *= a;
b >>= 1;
a... | ALGO | 0.999707 | 3.808068 | {
"github_metadata": {
"branch": "master",
"commit_count": 36,
"repo_created_at": "2023-02-22T22:21:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1384f702e... |
add3bb5a-64bd-457e-94c7-863d659fd14c | SlimShadys/RobotProgramming | Exercises/10 - ROS and Rviz/CPP/rp_10_scan_matcher/src/scan_matcher/include/icp/eigen_icp_2d.h | #pragma once
#include "Eigen/Geometry"
#include "eigen_kdtree.h"
using Vector2f = Eigen::Vector2f;
class ICP {
protected:
struct PointPair {
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
PointPair(const Vector2f& fixed_, const Vector2f& moving_)
: _fixed(fixed_), _moving(moving_){};
PointPair() {}
Vecto... | ALGO | 0.962377 | 6.676951 | {
"github_metadata": {
"branch": "master",
"commit_count": 51,
"repo_created_at": "2022-10-05T18:11:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "43660da54... |
ce46e290-6072-4698-bb70-eb6c3c59e182 | Robertolme/Analisis_Numerico | Metodo_euler.cpp | /* Metdo de euler.cpp
* Este programa resulve una ecuacion
* dieferncial usando el metodo de euler
*/
#include <iostream>
#include <cmath>
using namespace std;
double funcion(double t, double y) {
// Aquí defines la ecuación diferencial que quieres resolver
// Por ejemplo, vamos a resolver la ecuación ... | ALGO | 0.999888 | 5.161201 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2023-05-04T15:26:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "eb7844f8cbfc... |
103593e8-955c-47e8-bb89-39d893b2e422 | CS-Organize/Data-Structures-and-Algorithms | 19_priority_queue/7662/7662.cpp | #include <algorithm>
#include <iostream>
#include <map>
using namespace std;
typedef pair<int, int> P;
#define ll long long
#define f(i, n) for (int i = 0; i < n; i++)
static void testCase(void);
int main(void)
{
ios::sync_with_stdio(false), cin.tie(nullptr);
int t; cin >> t;
f(i, t) testCase();
... | ALGO | 0.999693 | 3.830721 | {
"github_metadata": {
"branch": "main",
"commit_count": 133,
"repo_created_at": "2023-03-12T17:22:23.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "345fa2cc3c6... |
552b8717-0ebe-4b29-9add-194b2fc7ff3f | 113bommy/PathRepair | variable_trace/cpp/cpp_code/cpp_incorrect/cpp_incorrect_test_116_3.cpp | #include <bits/stdc++.h>
using namespace std;
const int Mod = 998244353;
const int MaxN = 5e5 + 5;
int T, N, Ans;
int A[MaxN], F[MaxN], G[MaxN], H[MaxN];
int tF[MaxN], tG[MaxN], tH[MaxN];
int main() {
int i, j;
scanf("%d", &T);
while (T--) {
scanf("%d", &N);
for (i = 0; i <= N; i++) F[i] = G[i] = H[i] = 0... | ALGO | 0.999796 | 3.956959 | {
"github_metadata": {
"branch": "main",
"commit_count": 17,
"repo_created_at": "2024-11-11T15:46:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3e153d67122... |
8cd8045f-81b3-463d-8bf6-8d91ad107e5d | lcarrio/Project-3 | TweetReader.cpp | #include <iostream>
#include <fstream>
#include <sstream>
#include <map>
#include <algorithm>
using namespace std;
int main() {
string line, word;
int totalWords = 0;
map<string, int> wordsCount;
map<string, int>::iterator mapIt;
ifstream input("republicans.csv");
ofstream output("republicansO... | DATA | 0.989684 | 4.860085 | {
"github_metadata": {
"branch": "main",
"commit_count": 22,
"repo_created_at": "2020-12-01T19:02:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c03990de45a... |
9e493ea4-6669-49db-93e7-4349c8a60149 | pbettancourt2022/Proyecto_EdD | Codificacion_Huffman.h | #include <iostream>
#include <queue>
#include <unordered_map>
#include <vector>
#include <bitset>
// Estructura para representar un nodo en un árbol de Huffman.
struct HuffmanNode {
char data;
unsigned freq;
HuffmanNode* left;
HuffmanNode* right;
/**
* @brief Constructor de un nodo de Huffman.... | ALGO | 0.999957 | 5.739864 | {
"github_metadata": {
"branch": "main",
"commit_count": 22,
"repo_created_at": "2024-06-10T20:19:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "acc0e3f4bab... |
7607876f-dd21-4a8c-b3b7-c563e69c6701 | Daiver/jff | cpp/adept_test/cppoptlib/solver/cmaessolver.h | // CppNumericalSolver
#ifndef CMAES_H_
#define CMAES_H_
#include <random>
#include <Eigen/Dense>
#include "isolver.h"
namespace cppoptlib {
/**
* @brief Covariance Matrix Adaptation
*/
template<typename T>
class CMAesSolver : public ISolver<T, 1> {
// random number generator
// http://stackoverflow.com/questio... | ALGO | 0.999987 | 6.384749 | {
"github_metadata": {
"branch": "master",
"commit_count": 398,
"repo_created_at": "2013-08-17T15:03:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "9325450f... |
3be2d011-4ffd-469b-8e8c-4aa6a2d6e60d | zasdfgbnm-dumpster/DNP | DNP.cpp | #include "spin.hpp"
#include <iostream>
#include <fstream>
double fi = -14.5_MHz;
double fe = -28.3775_MHz;
double f1 = 14.5_MHz;
double t_half_pi = (pi/2)/(2*pi*f1);
double t_cycle = 200_ns;
constexpr int N = 8;
int N_cycle = 100;
double Azx[N] = { -5.8293_MHz,1.0625_MHz,-2.5745_MHz,0.1657_MHz,1.2042_MHz,0.0968_MHz,0... | ALGO | 0.998685 | 4.699964 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2013-07-09T08:43:22.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "10e23f346b... |
ae1bcadc-7553-4921-b331-ef6cc8850789 | ishaanshah/Competitive-Programming | INOI/INOI1302.cpp | /* Created by <NAME> on 14-12-2017.
* Problem Name: INOI1302
* Problem Link: https://www.codechef.com/INOIPRAC/problems/INOI1302
*/
#include <bits/stdc++.h>
using namespace std;
class Graph {
int v;
list<int> *adj;
public:
explicit Graph(int v);
void add_edge(int u, int v);
int DFS(int start);... | ALGO | 0.999824 | 4.239205 | {
"github_metadata": {
"branch": "master",
"commit_count": 202,
"repo_created_at": "2018-01-17T07:59:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c5e8505f... |
da42367f-e5e8-4efd-bb32-22e0c89137b3 | hipforth/coding | desktop/cpp/美团/meituan2020/meituan_002_1.cpp | #include <bits/stdc++.h>
using namespace std;
void meituan002(vector<int>& W, vector<int>& List) {
int pre_l = List[0] - 1;
long left_sum = 0;
long right_sum = 0;
for(int i = 0; i < W.size(); i++){
if(i < pre_l) left_sum += W[i];
if(i > pre_l) right_sum += W[i];
}
cout << max... | ALGO | 0.999943 | 3.92528 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2022-02-21T14:12:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0a30358743... |
8c8f05b0-41c0-4517-aae7-b107c0c2638e | tanishajasu/practise | linked_list_menu.cpp | #include<iostream>
#include<climits>
using namespace std;
class Node {
public:
int data;
Node* next;
Node() {
data = 0;
next = NULL;
}
Node(int n) {
data = n;
next = NULL;
}
};
class LinkedList {
Node* head;
int index;
public:
LinkedList() {
... | ALGO | 0.999417 | 6.415179 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2024-06-20T07:05:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "652baa2a53f... |
7c80e8fd-c0ec-412c-91e4-24caeb270f0f | loloof64/StockfishExample | stockfishlib/src/main/cpp/stockfish/src/nnue/features/half_ka_v2_hm.cpp | /*
Stockfish, a UCI chess playing engine derived from Glaurung 2.1
Copyright (C) 2004-2022 The Stockfish developers (see AUTHORS file)
Stockfish is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either ve... | ALGO | 0.971448 | 7.008758 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2022-07-23T14:34:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "eb1d7e6334... |
77db1f21-e513-4c68-a5bd-74fb6e5df01e | chriswengqi/kattis | distance/distance.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define int ll
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<char> vc;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<double, double> pdd;
typedef... | ALGO | 0.999913 | 3.490937 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-08-13T15:12:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "773b39fa55d3... |
dcdbd3d5-309d-4bab-a243-66a4d15ebe1b | raincross7/code-similarity | codes/train_code/problem452/problem452_61.cpp | #include <bits/stdc++.h>
#include <vector>
#include <iostream>
#include <map>
#include <cmath>
#include <string>
#include <algorithm>
#include <math.h>
using namespace std;
#define rep(i, o) for (int i = 0; i < (o); ++i)
#define REP(i,a,b)for(int i=(int)(a);(i)<(int)(b);i++)
#define NUM 1e5
typedef long long ll;
type... | ALGO | 0.999976 | 3.600356 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-03-06T05:07:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1aaeffa19ad5... |
b2ab4a90-9f2d-489a-bd4f-c5300fe68cd1 | shaunathon6/Sumo-Robot | RobotSumo.ino | #include <Servo.h>
Servo leftWheel;
Servo rightWheel;
int leftWheelPin = 3; // These are digital PWM pins
int rightWheelPin = 11;
int mspeed = 200; // Variable that will be added to lspeed & rspeed to set a precise speed
int lspeed = 1530; // Signal sent that stops left motor
int rspeed = 1535; // Signal sent that st... | ALGO | 0.999076 | 6.404408 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2014-09-24T15:50:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f83aa31700... |
35e00bd0-a0c9-435a-bba5-6867d61f5726 | siliviu/uni | sem5/ppd/lab1/lab1cpp/dynamic.cpp | #include <bits/stdc++.h>
using namespace std;
int N, M, n, m, P = 1;
int getElement(vector<vector<int>>& in, int i, int j) {
i = max(i, 0);
j = max(j, 0);
i = min(i, N - 1);
j = min(j, M - 1);
return in[i][j];
}
void task(vector<vector<int>>& in, vector<vector<int>>& conv, int startY, int endY,... | ALGO | 0.999713 | 4.705907 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2022-11-02T14:29:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9cc4a7c695... |
1a08b91b-1c6b-47a4-9a3b-b2df252b7ede | RaphaelLeivas/pds-ii-2020-2 | CPP_model.cpp | #include<bits/stdc++.h>
using namespace std;
#define dbg(x) cout << (#x) << " = " << x << endl;
#define f first
#define sec second
#define pb push_back
#define __ ios_base::sync_with_stdio(false); cin.tie(NULL);
const int MAX = 1e5 + 1;
vector< vector<int> > g(MAX);
vector<bool> vis(MAX, false);
vector<int> dist(MA... | ALGO | 0.999992 | 4.110754 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2022-12-05T22:12:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bee748be2396... |
fa8f8750-d2c1-4fbe-8310-ce75d8109aef | HandsOnOpenCL/Exercises-Solutions | Solutions/Exercise05/Cpp/vadd_abc.cpp | //------------------------------------------------------------------------------
//
// Name: vadd_three.cpp
//
// Purpose: Elementwise addition of three vectors (d = a + b + c)
//
// d = a + b + c
//
// HISTORY: Written by <NAME>, June 2011
// Ported to C++ Wrapper API by <NAME... | ALGO | 0.935604 | 6.124297 | {
"github_metadata": {
"branch": "master",
"commit_count": 262,
"repo_created_at": "2013-07-23T11:20:29.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 521,
"forks": 187,
"issues": 6,
"pull_requests": 5
},
"file_meta": {
"content_id": "4bdd5... |
0d401278-dd43-41cd-863e-0d48c99dc69b | franke333/AoC | 23AoC/Puzzles/Puzzle14.cpp | #include "../Utility.h"
#include "../Puzzle.h"
class Puzzle14 : IPuzzle
{
void Solve() override
{
std::vector<uint32_t> rocks;
std::vector<int> holes(_inputLines[0].size(), 0);
for (size_t i = 0; i < _inputLines.size(); ++i)
for (size_t j = 0; j < _inputLines[i].size(); ++j)
if (_inputLines[i][j] == '#'... | ALGO | 0.993454 | 4.75982 | {
"github_metadata": {
"branch": "main",
"commit_count": 72,
"repo_created_at": "2021-12-02T17:30:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "25ab6fba15f... |
7fdc081f-6fe6-4f32-87d7-75cd242db6d2 | sophiagodoy/balanced_parentheses_check | code.cpp | // VERIFICAÇÃO DE PARÊNTESES BALANCEADOS
// DEFININDO BIBLIOTECAS
#include <iostream>
#include <string>
// ESTRUTURA DE NÓ
// representa um elemento na pilha
struct No {
char var; // armazena o valor do nó da pilha
No* next; // aponta para o próximo
};
// ESTRUTURA DA PILHA
// representa a pilha em si
... | ALGO | 0.965173 | 6.599523 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-11-06T00:38:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dd85ab0ac413... |
3ba3652f-4d32-4622-86e3-23b89e1de670 | hariosannn/procon | AtCoder/others/selected100/58.cpp | #include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using mint = modint998244353;
using ll = long long;
using ld = long double;
using V_I = vector<int>;
using V_L = vector<ll>;
using P_I = pair<int, int>;
#define ALL(a) (a).begin(),(a).end()
#define rep(i, n) for (ll i = 0; i <... | ALGO | 0.999973 | 4.609148 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2022-07-05T14:09:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b6296cb6376f... |
e4654d84-4359-48fb-8c41-57e6c37889ff | wyrover/book-code | 从算法到程序(第2版)/Chapter02/zju1004-Stack.cpp | #include <iostream>
#include <stack>
#include <vector>
using namespace std;
string a, b;
stack<char> build;
vector<char> operate;
int length;
void dfs(int iPush, int iPop)
{
if (iPush == length && iPop == length) {
for (int i = 0; i < operate.size(); i ++)
cout << operate[i] << " ";
... | ALGO | 0.999743 | 4.623394 | {
"github_metadata": {
"branch": "master",
"commit_count": 192,
"repo_created_at": "2016-07-24T07:29:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 388,
"forks": 248,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b799... |
dc1984c4-dc25-48df-bee4-52e1f6d2880c | AlleyNawaz/366DaysofLeetcode | 0007_P446_Arithmetic_Slices_II_Subsequence.cpp | /*
Day: 7
Problem Number: 446 (https://leetcode.com/problems/arithmetic-slices-ii-subsequence)
Date: 07-01-2024
Description:
Given an integer array nums, return the number of all the arithmetic subsequences of nums.
A sequence of numbers is called arithmetic if it consists of at least three elements and if the differ... | ALGO | 0.999866 | 6.095851 | {
"github_metadata": {
"branch": "main",
"commit_count": 417,
"repo_created_at": "2024-01-01T12:01:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2eb3629165... |
0404439d-7f33-4025-9012-b8c57ba7ae60 | dilkhush05/C- | short0or1.cpp | #include<iostream>
using namespace std;
void printroy(int arr[],int size){
for(int i=0; i<size; i++){
cout << arr[i] << " ";
}
cout << endl ;
}
void shortone(int arr[], int size){
int left = 0 , right = size - 1;
while(left < right){
while(arr[left]== 0 && left < right){... | ALGO | 0.999988 | 4.236083 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-08-25T18:37:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7d3775de3021... |
5376f249-31ed-4c19-b4aa-aaf9eae594cf | SuvratZZZ/solved | solved/1288c.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) fo... | ALGO | 0.999985 | 4.013725 | {
"github_metadata": {
"branch": "main",
"commit_count": 46,
"repo_created_at": "2024-01-11T19:38:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "87f1de56bae... |
870c1f43-a2c4-4870-a983-643b5fcdb2aa | LihbGame/Graduation_Design_Game | AI_Path/CGameMapElement.cpp |
#include "CGameMapelement.h"
#include "GamePathFinder.h"
CGameMapelement::CGameMapelement()
{
}
CGameMapelement::~CGameMapelement()
{
}
CGameMapelement::CGameMapelement(float x, float y
, bool bLeft, bool bTop, bool bRight, bool bBottom)
: m_bLeft(bLeft), m_bTop(bTop), m_bRight(bRight), m_bBottom(bBottom)
{
}
... | ALGO | 0.971274 | 3.423225 | {
"github_metadata": {
"branch": "master",
"commit_count": 64,
"repo_created_at": "2020-02-23T05:28:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0f44d5682... |
8e19b0d7-0386-40dc-8fd4-59cf38885f0d | Kynn274/BaitapUPCODER | MINIGAME45.2_LAS.cpp | #include <iostream>
#include <cmath>
#include <vector>
#include <string.h>
#include <stdio.h>
#include <iomanip>
#include <sstream>
using namespace std;
long long N,Q;
long long a[100001],b[100001];
long long people[100001];
long long gr[100001];
long long sl=0;
long long _min=1;
long long _max=1;
int main(){
cin>>N>... | ALGO | 0.999464 | 3.278373 | {
"github_metadata": {
"branch": "main",
"commit_count": 173,
"repo_created_at": "2024-02-18T10:03:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "03482e51cf... |
c620b408-e21d-441f-8717-20d43bdfa3e5 | ArsanyGhaly/Numerical-Methods-CSC3020_pro4 | FalsePosition.cpp | #include "FalsePosition.h"
#include <math.h>
double* FalsePosition::falsePosition(Function* f, double l, double u, double tol, int max)
{
if (max < 0)
{
max = 10;
}
double fl = f->evaluate(l);
double fu = f->evaluate(u);
if (fl * fu > 0) //a zero has not been properly bracketed
{
... | ALGO | 0.99962 | 4.859734 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-07-28T00:46:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "81ddc57cb5... |
4ea6a090-665e-43aa-baa8-e845730ffb1e | DysonHoang/Tin-Hoc | time-skip/season 1/HDA_LQD_12-20/PHANTU.cpp | // Good wine must be aged for a long time...
// <NAME>
#include <bits/stdc++.h>
#define Mx 10000000
#define ll long long
using namespace std;
int max1 = INT_MIN;
int min1 = INT_MAX;
int main()
{
ios_base::sync_with_stdio(NULL);
cin.tie(0);
cout.tie(0);
string s;
cin >> s;
ll res = 0;
ll e_O... | ALGO | 0.999308 | 3.4537 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2025-01-14T09:21:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "746446b85f27... |
f3b00ea4-93ca-4db1-8244-b66dab6a1500 | alexandraback/datacollection | solutions_5644738749267968_0/C++/SeeSharp/cj4.cpp | #include <iostream>
#include <fstream>
#include <algorithm>
#include <vector>
using namespace std;
int main(){
ifstream _if("in.txt");
ofstream _of("out.txt");
_of.precision(7);
_of.setf( ios::fixed, ios::floatfield );
int n;
_if >> n;
for(int i=0;i < n; i++){
int m;
_if >>... | ALGO | 0.99994 | 3.177666 | {
"github_metadata": {
"branch": "master",
"commit_count": 58,
"repo_created_at": "2017-03-08T11:33:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "87e62504d... |
fbc78c6d-e394-464d-be39-c3892a92cdbd | WilstonOreo/Tomo | src/toolset/fdm/tool/perimeter.hpp | #pragma once
#include <gex/prim.hpp>
#include <gex/algorithm/boost.hpp>
#include <gex/algorithm/offset.hpp>
#include <gex/algorithm/perimeter.hpp>
#include <tomo/routing/generate.hpp>
#include <tomo/slice/for_each_parallel.hpp>
#include "../routing/MoveMaker.hpp"
#include "../item/SliceGraph.hpp"
namespace tomo
{
... | ALGO | 0.986246 | 6.139447 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2016-06-21T11:45:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c4bc61005b... |
cfc0cdf2-8cb6-4703-a3b4-8ce24498531a | yamanalab/FHE_Scheduling_Problems | src/RelinearizeCutSolver.cpp | #include "RelinearizeCutSolver.hpp"
#include "MaximumFlow.hpp"
#include "misc.hpp"
ProblemResult RelinearizeCutSolver::solve(const int kr, const int km,
const CircuitGraph &graph,
const int max_threads)
{
timer.set();
Maximum... | ALGO | 0.999637 | 4.608028 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2021-04-22T07:29:41.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "02e36128cea... |
d96584e9-3e35-41d6-a609-f9ad06525e32 | dtcxzyw/OI-Source | Unclassified/Done/2486.cpp | #include <cstdio>
#include <algorithm>
int read(){
int res=0,c;
do c=getchar();
while(c<'0'||c>'9');
while('0'<=c&&c<='9'){
res=res*10+c-'0';
c=getchar();
}
return res;
}
int getOp(){
int c;
do c=getchar();
while(c!='Q' && c!='C');
return c;
}
void printImpl(int x){
if(x>=10)printImpl(x/10);
putchar('0'... | ALGO | 0.999969 | 4.219582 | {
"github_metadata": {
"branch": "master",
"commit_count": 288,
"repo_created_at": "2018-07-11T09:33:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 57,
"forks": 14,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6189f1... |
ad292d23-02e9-431b-9377-ca3f93165e41 | eliz-bzh/SAOD-All | 8_nikita/main.cpp | #include <iostream>
#include <queue>
#include <stack>
using namespace std;
int main()
{
std::cout<<"Obhod v shiriny"<<std::endl;
queue<int> Queue;
int mas[7][7] =
{
{ 0, 0, 1, 0, 0, 0, 0},
{ 0, 0, 0, 0, 0, 1, 0},
{ 0, 0, 0, 0, 1, 0, 0},
{ 1, 1, 0, 0, 1, 0, 0},
{ ... | ALGO | 0.999966 | 3.621973 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-10-28T22:03:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9bd7be358b... |
99d16e96-846a-4b26-be7e-958d8366c6d1 | DaAlG/code_studying | jeehyun/개별문제/Baekjoon/1929_소수 구하기.cpp | /* etc
* 1929 소수 구하기
* M 이상 N 이하의 소수를 모두 출력
*/
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
ios::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int min, max;
cin >> min >> max;
bool *prime = new bool[max + 1];
fill_n(prime, max + 1, 1);
prime[0] = prime[1] = false;
/... | ALGO | 0.999911 | 4.467028 | {
"github_metadata": {
"branch": "master",
"commit_count": 1042,
"repo_created_at": "2020-09-13T08:06:41.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 5,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "824bea60... |
6bcb5071-a9bd-4783-b3d7-29b93387f4c3 | elizaveta310/uni | 5.2.3.cpp | #include <iostream>
using namespace std;
const int WIDTH = 3;
const int LENGTH = 4;
void transposeMatrix(int input[][LENGTH], int output[][WIDTH]) {
for (int i = 0; i < WIDTH; i++) {
for (int j = 0; j < LENGTH; j++) {
output[j][i] = input[i][j];
}
}
}
int main() {
int input[WID... | ALGO | 0.999825 | 5.270472 | {
"github_metadata": {
"branch": "main",
"commit_count": 56,
"repo_created_at": "2024-10-04T09:47:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0a7d61a8640... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.