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 |
|---|---|---|---|---|---|---|---|
41cbc81f-413f-43dc-a216-24be339e9b89 | arin2002/leetcode | 0211-design-add-and-search-words-data-structure/0211-design-add-and-search-words-data-structure.cpp | class Node{
public:
Node* links[26];
bool flag = false;
bool contains(char ch){
return links[ch-'a'] != NULL;
}
void insert(char ch, Node *node){
links[ch-'a'] = node;
}
Node* next(char ch){
return links[ch-'a'];
}
bool isEnd(... | ALGO | 0.999815 | 5.40098 | {
"github_metadata": {
"branch": "main",
"commit_count": 4845,
"repo_created_at": "2022-05-19T14:50: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": "dc78aa1cd... |
00473f9d-c9c8-4f1c-a8de-7fc2589d22e4 | ishandutta2007/codeforces-k | kan/normal/1427/A.cpp | #include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
#define eprintf(...) 42
#endif
using ll = long long;
using ld = long double;
using D = double;
using uint = unsigned int;
template<typename T>
using pair2 = pair<T, T>;
using pii = pair<int, int... | ALGO | 0.99907 | 3.721341 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T06:06: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": "9ad574c2ee61... |
ac27bbd5-4395-4867-a40c-d2aafbe2640b | OwaisK4/Competitive-Programming | ACM/Devday/DEVDAY 2024/C.cpp | #include <bits/stdc++.h>
#define int long long
#define all(a) a.begin(), a.end()
#define seed chrono::high_resolution_clock::now().time_since_epoch().count()
#define file_read(filepath) freopen(filepath, "r", stdin);
#define file_write(filepath) freopen(filepath, "w", stdout);
#define fastio \
ios... | ALGO | 0.999878 | 4.613472 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2025-01-04T18:41:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "914d37e12abf... |
8d288b0a-cc0b-4159-9383-5a086de83210 | tonningp/cis201-class-examples | chapter03-control-flow/3.11-simulations/roll_dice/main.cpp | #include<iostream>
#include<cstdlib>
#include<ctime>
using namespace std;
const int SCALE = 6;
const int SHIFT = 1;
const int UPPER_LIMIT = 1000000;
int main()
{
srand(time(0));
// declare the counters
int one=0,two=0,three=0,four=0,five=0,six=0;
for(int i=0;i<UPPER_LIMIT;i++)
{
int ... | ALGO | 0.900162 | 3.372734 | {
"github_metadata": {
"branch": "master",
"commit_count": 140,
"repo_created_at": "2018-09-17T01:33:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 11,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9099eb2... |
883b82ce-1b2e-4a3e-b706-d74bc3b03b72 | PanBartlomiej/Anaglyph | src/MatrixParallelMultiplier.cpp | #include "MatrixParallelMultiplier.h"
void SingleMultiplier::operator()()
{
while (! _manager.Terminating())
{
if (doneID != _manager.getCalcID())
{
_manager.DoneStatus(_id) = false;
for (unsigned int i=_id;i<_manager.getPointCount();i+=_manager.getThreadCount())
... | ALGO | 0.938008 | 4.990098 | {
"github_metadata": {
"branch": "master",
"commit_count": 87,
"repo_created_at": "2021-05-15T14:27:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "37e02d875... |
77b2d659-55de-4015-b1a0-bf65b5f665e3 | CanoeByGuitar/myzeno | zeno/src/nodes/neo/ReadObjPrim.cpp | #include <zeno/zeno.h>
#include <zeno/types/PrimitiveObject.h>
#include <zeno/funcs/PrimitiveUtils.h>
#include <zeno/types/StringObject.h>
#include <zeno/utils/string.h>
#include <zeno/utils/fileio.h>
#include <zeno/utils/logger.h>
#include <zeno/utils/vec.h>
#include <string_view>
#include <algorithm>
#include <cstrin... | TOOL | 0.925986 | 5.916907 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-02-25T20:20: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": "1a8c6dcc48ec... |
65318bc5-17cb-4604-901f-5dfbbebc334e | Landvibe-DataStructure-2022/ENFP-Hyeokjun | week13/graph_simplified.cpp | #include <iostream>
#include <string>
using namespace std;
int main() {
int tc, n;
int vId;
int size = 0;
cin >> tc >> n;
for (int i = 0; i < n; i++) {
cin >> vId;
}
bool graph[2000][2000];
while (tc--) {
string q;
cin >> q;
int u, v;
cin >> u... | ALGO | 0.999448 | 5.414591 | {
"github_metadata": {
"branch": "main",
"commit_count": 57,
"repo_created_at": "2022-03-10T15:26:43.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7a05bdf85c16... |
61cf2706-7d00-4b4f-a0cd-10bb9838b1c2 | tuanvuPresent/application-algorithm | exercise/graph/final.cpp | /*
inputCopy
5 6
1 4 6
2 5 5
3 4 2
2 1 2
2 3 3
4 5 4
outputCopy
4
*/
#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
struct Graph {
int x;
int y;
int v;
};
vector<Graph> g;
int fron[100001], cnt[100001];
bool cmp(Graph g1, Graph g2) { return g1.v < g2.v; }
int find(int u) {
if... | ALGO | 0.99997 | 4.509104 | {
"github_metadata": {
"branch": "master",
"commit_count": 41,
"repo_created_at": "2019-09-25T13:39:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c219eb89c... |
5b07788c-f8bf-45a7-803d-b42630a4df0e | ask2003/cppconcepts | oops_array_of_objects_2.cpp | /*
Write a program to print the roll number and average marks of 8 students
in three subjects (each out of 100). The marks are entered by the user and
the roll numbers are automatically assigned.
*/
#include <iostream>
using namespace std;
class student{
private:
int roll;
int marks[3];
float avg;
... | TOOL | 0.979944 | 3.932137 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2023-12-05T11:58: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": "cc3c7ea31df0... |
669e6b38-ab79-4c21-8462-f3e90e026b05 | gzshawnliang/competitive-programming | myCpps/other/test/powTest.cpp | #include <bits/stdc++.h>
using namespace std;
//ifstream fin("powTest.in");
//ofstream fout("powTest.out");
using ull = unsigned long long;
using ull128 = unsigned __int128;
const ull p = 137;
ull hashcode(const string & x)
{
int len = x.length();
ull hashValue1 = 0;
for (int i = 0; i <= len - 1; ++i)
... | ALGO | 0.999706 | 3.960266 | {
"github_metadata": {
"branch": "master",
"commit_count": 1963,
"repo_created_at": "2019-01-17T06:33:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6a91249... |
efe8cfb6-3669-4ae5-a609-2ff094489983 | yasith/Problems | codeforces/round37/b.cpp | #include <iostream>
#include <algorithm>
using namespace std;
struct scroll{
int dmg, num, turn;
double pow;
} scrolls[1000];
bool comp(scroll a, scroll b){
return a.dmg > b.dmg;
}
bool comp2(scroll a, scroll b){
return a.turn < b.turn;
}
int N, hp, reg;
int getScroll(int health){
int selected = -1;
i... | ALGO | 0.999852 | 3.570029 | {
"github_metadata": {
"branch": "master",
"commit_count": 29,
"repo_created_at": "2011-02-03T15:08:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4a76d78a7... |
2afe9bcc-c299-45e4-a964-4b64fc76f17b | Eric-Tzeng/Eric | HW1082-1.cpp | #include <iostream>
#include <cstdlib>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <vector>
using namespace std;
struct College {
int number ;
int gNum ;
};
class BuildTree {
string fileName ;
string fileNumber ;
vector<College> aList ;
vector<College> min ;
vector<... | ALGO | 0.99564 | 3.304519 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2019-09-10T03:11: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": "0b1916fd9... |
f1f6d4e4-4e5a-406a-8393-b1b9a7895908 | wiwitrifai/competitive-programming | atcoder/agc010/b.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int n;
long long a[N], b[N];
int main() {
scanf("%d", &n);
long long sum = 0;
for (int i = 0; i < n; i++) {
scanf("%lld", a+i);
sum += a[i];
}
long long con = 1LL * n * (n + 1)/2;
if (sum % con) {
puts("NO");
return 0;
... | ALGO | 0.999988 | 3.682745 | {
"github_metadata": {
"branch": "master",
"commit_count": 628,
"repo_created_at": "2016-05-21T12:11:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 37,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c1cff18... |
2edbced8-916d-4c46-ad6f-ae260c4502aa | sjhalayka/opengl4_stlview | mesh.cpp | #include "mesh.h"
void get_vertices_and_normals_from_triangles(vector<triangle> &t, vector<vec3> &fn, vector<vec3> &v, vector<vec3> &vn)
{
fn.clear();
v.clear();
vn.clear();
if(0 == t.size())
return;
cout << "Triangles: " << t.size() << endl;
cout << "Welding vertices" << endl;
// Insert unique v... | TOOL | 0.944171 | 4.447063 | {
"github_metadata": {
"branch": "main",
"commit_count": 16,
"repo_created_at": "2020-11-07T02:05:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "42cb077df46... |
6405bb59-892a-4c88-9905-e56d58ef1373 | Dilder601/phitron_class | DATA STRUCTURE/Week 1/Module 2/ProblemSet/problem5.cpp | #include<bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
vector<int> v(n);
for (int i = 0; i < n; ++i) {
cin >> v[i];
}
int old_val, new_val, find_val;
cin >> old_val >> new_val >> find_val;
// Replace old_val with new_val
for (int i = 0; i < n; i++) {
... | ALGO | 0.999845 | 5.167918 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2024-06-29T15:26: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": "d291ecedc3... |
0ba1c9db-2a5c-4be3-af5c-2649eb87df3b | kedidoima/Contest1-2 | test.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
int t; cin>>t;
while(t--){
int n,m;
cin>>n>>m;
long long a[n+5],b[m+5];
for (int i=0;i<n;i++) cin>>a[i];
for (int i=0;i<m;i++) cin>>b[i];
sort(a,a+n); sort(b,b+m);
int i=0,j=0;
a[n]=100000000; b[m]=... | ALGO | 0.999934 | 3.791306 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2020-04-28T12:27: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": "3836fd1353... |
65565b66-9c3e-4ea1-a48b-8761d03c4e28 | TheGeekiestOne/Coursera-Data-Structures-and-Algorithms-Specialization | Course 1 - Algorithmic Toolbox/week5_dynamic_programming1/1_money_change_again/change_dp.cpp | // Recursive C program for
// coin change problem.
#include <iostream>
#include <vector>
#include <climits>
////////////////////////////////////////////////////////////////////////////////
// Created By <NAME>
//
//
// Reversi
////////////////////////////////////////////////////////////////////////////////
using std:... | ALGO | 0.999865 | 5.004025 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2019-06-10T08:56:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 165,
"forks": 70,
"issues": 1,
"pull_requests": 2
},
"file_meta": {
"content_id": "364775... |
9761d99d-40b3-43cc-96b5-a1079e4d1a40 | EnzoWarner/CPlusPlusAula3EX4 | C++ Aula3 EX4.c++ | #include <cstdlib>
#include <iostream>
using namespace std;
/* 4-) Criar uma matriz de ordem 5 e imprima: toda a matriz e
depois os números que se encontram em posições cuja a linha
mais a coluna formam um número ímpar. */
int main(int argc, char *argv[])
{
setlocale(LC_CTYPE, "portuguese_brazil");
int i,j;
... | ALGO | 0.986732 | 4.008401 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-05-13T04:47: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": "a8a7d628748e... |
27c47abb-757d-4174-910d-1feb6677aa95 | csijun/leetcode | leet022_generateParenthesis.cpp | #include<iostream>
#include<string>
#include<stdlib.h>
#include<set>
#include<vector>
using namespace std;
class Solution {
public:
vector<string> generateParenthesis(int n) {
set<string> strSet = generateParenthesisSet(n);
return vector<string>(strSet.begin(),strSet.end());
}
set<string> ... | ALGO | 0.999915 | 4.913218 | {
"github_metadata": {
"branch": "master",
"commit_count": 47,
"repo_created_at": "2017-10-11T00:30: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": "5af88db72... |
696cbace-91c1-4249-8470-63994ab56efa | MarianoCH117/TorresDeHanoi | Torres.cpp | #include "Torres.h"
#include <iostream>
#include <windows.h>
Torres::Torres() {
filas = 3;
columnas = 0;
tablero = nullptr;
}
void Torres::empezar() {
std::cout << "Con cuantos discos va a jugar?: ";
std::cin >> columnas;
tablero = (int*)malloc(sizeof(int) * filas * columnas);
iniciarJuego... | ALGO | 0.96101 | 4.527619 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-03-14T02:29: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": "c23be4682c... |
ba3e6799-dd99-459d-b71d-ddad032ef75d | l0nl1f3/1-l0nl1f3-s-code-repo | BZOJ/bzoj3144.cpp | #include<bits/stdc++.h>
#define fir first
#define sec second
using namespace std;
typedef long long LL;
template <typename T> inline bool cmin(T & a, const T & b) { return a > b ? a = b, 1 : 0;}
template <typename T> inline bool cmax(T & a, const T & b) { return a < b ? a = b, 1 : 0;}
int inp() {
int x = 0, f = 1;ch... | ALGO | 0.999382 | 3.47238 | {
"github_metadata": {
"branch": "master",
"commit_count": 328,
"repo_created_at": "2017-02-11T04:20: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": "de5e0aef... |
159621df-37ef-4c15-995f-4dc62b328305 | Harmit485/Competitive-programming | binaryLifting.cpp | /*
Binary Lifting — Only for k-th Ancestor Queries (from parent array + root)
Purpose:
- Efficiently find the k-th ancestor of any node in a rooted tree.
Assumptions:
- Tree is rooted.
- No cycles (standard tree structure).
Core Idea:
- Precompute 2^j-th ancestors for each node using ... | ALGO | 0.999948 | 6.480869 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2025-07-05T09:39:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "77c5d13be162... |
98440c34-92f9-4a73-8343-12c1a25e2ed3 | punkfulw/LeetCode | leetcode/419. Battleships in a Board/s1.cpp | ## Solution 1. DFS
```cpp
// OJ: https://leetcode.com/problems/two-sum/
// Author: github.com/punkfulw
// Time: O(NM)
// Space: O(1)
class Solution {
public:
int n, m, ans = 0, dirs[5] = {1, 0, -1, 0, 1};
void dfs(int i, int j, vector<vector<char>> &board){
board[i][j] = '.';
for (int d = ... | ALGO | 0.999978 | 5.396845 | {
"github_metadata": {
"branch": "main",
"commit_count": 3159,
"repo_created_at": "2021-04-17T03:38:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "03cba487c... |
65d528f4-a65d-4d04-a9f6-652b46a470f4 | usman-tahir/rooks-guide-c-plus-plus | google-cpp-tutorial/exercises-and-projects/time_conversion.cpp | /**
* Takes an amount of time (in seconds) and converts it into hours, minutes
* and seconds
*/
#include <iostream>
using namespace std;
#define SECONDS_PER_HOUR 3600
#define SECONDS_PER_MINUTE 60
int getInitialTime() {
int initialTime = -1;
do {
cout << "Please enter the number of seconds to convert: ";
... | ALGO | 0.960252 | 4.972881 | {
"github_metadata": {
"branch": "master",
"commit_count": 49,
"repo_created_at": "2016-10-05T23:53:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d0fa0d73f... |
463ccb1b-af7c-4a7c-8f34-4346b2fc3fe9 | btabram/AdventOfCode2020 | 24/main.cpp | #include <algorithm>
#include <fstream>
#include <iostream>
#include <set>
#include <vector>
// Using axial hex coordinates here, see https://www.redblobgames.com/grids/hexagons/#coordinates-axial
using Coord = std::pair<int, int>;
enum class Direction { E, SE, SW, W, NW, NE };
std::vector<std::vector<Direction>> re... | ALGO | 0.999888 | 6.405565 | {
"github_metadata": {
"branch": "main",
"commit_count": 28,
"repo_created_at": "2020-12-03T21:05: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": "212635e5474... |
60533fec-bd8e-4d51-a62c-338008c71ae4 | Anik114911/UU-IUPC-2025 | J Sublime Replacement.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using ll = long long;
using ld = long double;
#define yes cout << "YES\n";
#define no cout << "NO\n";
#define endl '\n'
#define gcd(a, b) __gcd(a, b)
#define lcm(a, b) ((a / gcd(a, b)) * b)
#define e4 signed main()
#d... | ALGO | 0.999921 | 4.225132 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2025-06-25T13:14: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": "7eec670723e0... |
65eeed4f-b370-4f36-a980-43ef71fae26e | Psycho7/LeetCode | CPP Solutions/10.cpp | class Solution {
public:
bool isMatch(string s, string p) {
auto f = vector(s.size() + 1, vector<bool>(p.size() + 1, false));
f[0][0] = true;
for (int k = 2; k <= p.size() && p[k - 1] == '*'; k += 2) f[0][k] = true;
for (int i = 1; i <= s.size(); i++) {
... | ALGO | 0.999806 | 5.346787 | {
"github_metadata": {
"branch": "master",
"commit_count": 75,
"repo_created_at": "2015-12-07T12:52:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e75178d1e... |
6e055705-71b1-4562-99ca-bdc6506aedaa | T-R0D/Past-Courses | CS202/asmt07/myIntListClass.cpp | ////////////////////////////////////////////////////////////////////////////////
//
// Title: myIntListClass.cpp
// Created By: <NAME>
// Course: CS202
//
// Summary: The implementation of the class defined in myIntListClass.h
//
// Last Modified: 4/12/2013 14:45
//
//////////////////////////////////... | ALGO | 0.975325 | 5.457359 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2016-07-17T02:17:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 16,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "185a79c51... |
192a4790-05b3-42c4-8eed-deb4f921309d | sneumann/xcms | src/massifquant/Tracker.h | #ifndef TR_h
#define TR_h
#include<iostream>
#include <vector>
#include <list>
//Tracker.h
//Global Constants
const int DIMV = 2;
const int DIMM = 4;
const int INFOSIZE = 8;
const double P_INIT_I = 10000;
const double P_INIT_MZ = 0.000001; //10^(-6);
const double MILLION = 1000000;
class Tracker {
private:
... | TOOL | 0.907713 | 3.487463 | {
"github_metadata": {
"branch": "devel",
"commit_count": 3978,
"repo_created_at": "2014-03-28T07:03:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 201,
"forks": 81,
"issues": 204,
"pull_requests": 3
},
"file_meta": {
"content_id": "605... |
f6000084-825e-42b6-9a80-33c0dfc6acb0 | GAS-Gist-Algorithm-Study/ProblemSolving | PS_1916_MIN_COST/LYJ/1916.cpp | #include<iostream>
#include<vector>
#include<queue>
#include<climits>
using namespace std;
typedef pair<int, int> pii;
struct Edge{
int start;
int end;
int cost;
Edge() {}
Edge(int start, int end, int cost) : start(start), end(end), cost(cost) {}
bool operator >(const Edge &A) const{
r... | ALGO | 0.999915 | 3.739373 | {
"github_metadata": {
"branch": "master",
"commit_count": 260,
"repo_created_at": "2019-09-26T12:58:58.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
"content_id": "7a3be38a0... |
d425b3c7-f515-4351-9288-8e6f91ebae4c | ethz-asl/maplab | algorithms/map-sparsification/src/sampler-factory.cc | #include "map-sparsification/sampler-factory.h"
#include <gflags/gflags.h>
#include "map-sparsification/graph-partition-sampler.h"
#include "map-sparsification/heuristic/cost-functions/min-keypoints-per-keyframe-cost.h"
#include "map-sparsification/heuristic/heuristic-sampling.h"
#include "map-sparsification/heuristi... | TOOL | 0.909003 | 7.201818 | {
"github_metadata": {
"branch": "master",
"commit_count": 895,
"repo_created_at": "2017-11-27T21:58:23.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2745,
"forks": 730,
"issues": 113,
"pull_requests": 8
},
"file_meta": {
"content_id": "62... |
546de405-989c-436a-8a82-b73f68246649 | yuqilin/CodesAndNotes | FillColor/FillColor/ColorIt.cpp | #include "ColorIt.h"
#include <stack>
struct Point {
int x;
int y;
Point(int a, int b) {
x = a;
y = b;
}
};
typedef std::stack<Point> PointStack;
static int s_ImageWidth = 16;
static int s_ImageHeight = 16;
static int s_ImageArray[s_ImageWidth][s_ImageHeight] = {
0, 0, 0, 0, 0,... | ALGO | 0.996585 | 4.882027 | {
"github_metadata": {
"branch": "master",
"commit_count": 71,
"repo_created_at": "2012-10-12T09:41:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 7,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "71abf2872... |
b193aa60-7090-44c7-a10a-3ba242e8f015 | Spirit599/algorithm | leetcode/cpp/520_1.cpp | class Solution {
public:
bool detectCapitalUse(string word) {
int n = word.size();
if(n == 1)
return true;
bool first_is_lower = (word[0] >= 'a' && word[0] <= 'z') ? true : false;
bool second_is_lower = (word[1] >= 'a' && word[1] <= 'z') ? true : false;
if(firs... | ALGO | 0.9979 | 5.418771 | {
"github_metadata": {
"branch": "master",
"commit_count": 98,
"repo_created_at": "2022-04-25T08:50:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "84f5a77e2... |
c2025737-cc45-4cbb-87b1-863930d233da | salsadsid/Problem_Solution_By_Salman | week4/day6/A_Jellyfish_and_Undertale.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int t;
cin >> t;
while (t--) {
long long int m, s, f;
cin >> m >> s >> f;
vector<int> tools(f);
for (int i = 0; i < f; i++) {
... | ALGO | 0.999759 | 4.732783 | {
"github_metadata": {
"branch": "main",
"commit_count": 84,
"repo_created_at": "2024-10-27T10:04:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f77448947cd... |
029c8f37-7152-4a10-a5d5-f33ca3dbdc75 | phanxuanquang/Introduction-To-Programming-UIT | BTH5/03.cpp | #include <iostream>
using namespace std;
int a[100], b[100], c[200], m, n;
void import(int arr[], int x)
{
for (int i = 0; i < x; i++)
cin >> arr[i];
}
int main()
{
cout << "So phan tu cua mang a la: ";
cin >> n;
cout << "Nhap mang a: " << endl;
import(a, n);
cout << "So phan tu cua mang... | ALGO | 0.999976 | 3.142346 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2021-12-12T07:36:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dfc402a554f7... |
da489cc7-8a26-4780-ac09-db372e50d4fc | Kennyarlexy/Competitive-Programming | PROBLEMS/UVA/UVA_12192/main.cpp | #include <bits/stdc++.h>
#define ll long long
using namespace std;
bool valid(ll i, ll j, ll N, ll M) {
if (i >= N) return false;
if (j >= M) return false;
return true;
}
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
ll N, M;
while (cin >> N >> M && N && M) {
vector<vecto... | ALGO | 0.999893 | 4.379074 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2024-08-12T09:13:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ecb55af3e76... |
f32add42-4a81-4baf-b5ef-7b4f7f5c5905 | tongzx/nt5src | Source/XPSP1/NT/inetsrv/query/fdriver/entrybuf.cxx | //+---------------------------------------------------------------------------
//
// Microsoft Windows
// Copyright (C) Microsoft Corporation, 1991 - 2000.
//
// File: EntryBuf.Cxx
//
// Contents: Implementation of the CEntryBuffer and associated classes.
//
// Classes: CEntry, CKeyVector, CEntryBuffer,... | ALGO | 0.9933 | 5.935157 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2020-10-12T04:28:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1012,
"forks": 555,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "99255... |
800ef219-1496-4802-90a5-da0bc499be95 | imvskalhans/DSA-Codes | LeetCode605CanPlaceFlower.cpp | /*
605. Can Place Flowers
You have a long flowerbed in which some of the plots are planted, and some are not.
However, flowers cannot be planted in adjacent plots.
Given an integer array flowerbed containing 0's and 1's, where 0 means empty and 1
means not empty, and an integer n, return if n new flowers can be plant... | ALGO | 0.999969 | 5.682018 | {
"github_metadata": {
"branch": "DSA-Practice",
"commit_count": 990,
"repo_created_at": "2022-11-17T19:00:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c0... |
169942c6-08b4-4197-b4ea-3d6339d68c3f | ucyang/AlgoEx | codingdojang/morse_code_translator.cpp | // Problem: http://codingdojang.com/scode/469?answer_mode=hide
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <map>
using namespace std;
map<string, char> m{
{ ".-", 'A' },
{ "-...", 'B' },
{ "-.-.", 'C' },
{ "-..", 'D' },
{ ".", 'E' },
{ "..-.", 'F' },
{ "--.", 'G' },
{ ... | ALGO | 0.999051 | 4.075015 | {
"github_metadata": {
"branch": "main",
"commit_count": 153,
"repo_created_at": "2019-10-19T08:35: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": "7799fbd385... |
0a4dcdc3-b94d-4e5b-9412-4df58b307bfc | arangodb/arangodb | 3rdParty/boost/1.78.0/boost/heap/detail/ordered_adaptor_iterator.hpp | // boost heap: ordered iterator helper classes for container adaptors
//
// Copyright (C) 2011 <NAME>
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_HEAP_DETAIL_ORDERED_ADAPTOR_ITERATOR_HPP
#de... | TOOL | 0.917718 | 7.103311 | {
"github_metadata": {
"branch": "devel",
"commit_count": 51986,
"repo_created_at": "2011-10-26T06:42:00.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 13878,
"forks": 857,
"issues": 743,
"pull_requests": 38
},
"file_meta": {
"content_id": ... |
d44f601f-5d80-4735-8379-73cefa54d616 | ghdeo/solved.ac | 2003.cpp | #include <iostream>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int n, m;
int arr[10001];
cin >> n >> m;
for (int i = 0; i < n; i++) {
cin >> arr[i];
}
int ans = 0;
int sum = arr[0];
int left = 0;
int right = 0;
while ... | ALGO | 0.999989 | 4.414905 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2023-06-23T14:54: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": "acb414b44... |
131fb0ab-cd4c-45b8-9ef7-32528c806c8a | miaojiang1987/LeetCode | CPlus/EncodeAndDecodeStrings.cpp | class Codec {
public:
// Encodes a list of strings to a single string.
string encode(const vector<string> &strs) {
string ret;
auto escape = [](const string &s) {
string escaped;
for(size_t i=0; i<s.size(); i++) {
escaped.push_back(s[i]);
... | TOOL | 0.935785 | 5.793172 | {
"github_metadata": {
"branch": "master",
"commit_count": 610,
"repo_created_at": "2018-11-01T17:59:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f34e9779... |
f8f952a6-81d9-467f-976d-e14b05f266f9 | AhmedMostafa79/problem-solving | Problem-Solving/Hacker Rank/data-structures/Array & Linked Lists/2D-Array DS.cpp | #include <bits/stdc++.h>
using namespace std;
int nx[] = { -1,-1,-1,0,0,1,1,1 };
int ny[] = { -1,0,1,-1,1,-1,0,1 };
int ar[6][6]{};
int getsum(int i,int l) {
int sum = 0;
for (int j = 0; j < sizeof(nx)/4; j++) {
if (!(!nx[j] and ny[j]))
sum += ar[i + nx[j]][l + ny[j]];
}
return sum;
... | ALGO | 0.999862 | 5.039457 | {
"github_metadata": {
"branch": "main",
"commit_count": 53,
"repo_created_at": "2023-10-26T13:40: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": "3e5e6ab6f8c... |
db52e16a-3f50-4256-bb9e-29d1a5662ab2 | CompilerLuke/NextEngine | NextCore/include/core/container/sort.h | #pragma once
#include "core/memory/allocator.h"
#include "core/memory/linear_allocator.h"
//ripped from https://www.geeksforgeeks.org/radix-sort/
template<typename T, typename F>
long long getMax(T arr[], int n, F func)
{
long long mx = func(arr[0]);
for (int i = 1; i < n; i++)
if (func(arr[i]) > mx)
mx = fun... | ALGO | 0.998785 | 5.627473 | {
"github_metadata": {
"branch": "master",
"commit_count": 127,
"repo_created_at": "2019-07-02T14:31:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 21,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d60b9a6... |
6108613a-5237-4409-9c3b-df882209307f | hanshulll/CodeCollection | C++/Data Structure - ADTs/returnMinimumFromStack.cpp | #pragma once
/*
Stack ADT:
Individual items can be added and stored using a push operation
Individual items can be removed and extracted using a push operation
*/
template<class T>
class MyStack {
private:
int size;
int top;
T* stack;
public:
MyStack();
MyStack(int);
void Push(T x);
T Pop();
T Peek();
bool is... | ALGO | 0.998563 | 4.24329 | {
"github_metadata": {
"branch": "main",
"commit_count": 1438,
"repo_created_at": "2021-10-01T17:59:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 219,
"forks": 585,
"issues": 0,
"pull_requests": 130
},
"file_meta": {
"content_id": "6b2... |
0c223e5a-828a-436a-88ab-0ccafc60a54f | Mohit-cmd-jpg/DSA_labSheets_2301010310 | labsheet6.cpp | #include <iostream>
#include <map>
#include <vector>
#include <queue>
#include <set>
#include <algorithm>
using namespace std;
// Binary Tree Implementation
class BinaryTree {
public:
struct Node {
int key;
Node* left;
Node* right;
Node(int value) : key(value), left(nullptr), right... | ALGO | 0.999853 | 6.61974 | {
"github_metadata": {
"branch": "main",
"commit_count": 17,
"repo_created_at": "2024-11-18T18:17:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "851f8dc61bf... |
03305b9f-7a43-4e5f-bf3c-9c79ef48a622 | H-Multani/Leetcode-questions-stuff | 0787-sliding-puzzle/0787-sliding-puzzle.cpp | class Solution {
public:
int slidingPuzzle(vector<vector<int>>& board) {
// string me daal do
string start = "";
for (auto it : board) {
for (auto it2 : it) {
start += to_string(it2);
}
}
string target = "123450";
// bfs ke li... | ALGO | 0.999969 | 6.021052 | {
"github_metadata": {
"branch": "main",
"commit_count": 1652,
"repo_created_at": "2024-08-08T13:00:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "afc3f147b... |
dee17ac9-0bc1-4bf9-95c4-a66f914bc48f | vaish-8468/leetcode | 0105-construct-binary-tree-from-preorder-and-inorder-traversal/0105-construct-binary-tree-from-preorder-and-inorder-traversal.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.999994 | 6.633012 | {
"github_metadata": {
"branch": "main",
"commit_count": 1332,
"repo_created_at": "2022-12-20T11:46: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": "d2223833f... |
63f749df-077d-4850-8d8a-f412d943b3f3 | JasenARHansen/portfolio | src/CPP/code/hackerrank/prepare/dataStructures/tree/PreOrderTraversal.cpp | #pragma clang diagnostic push
#pragma ide diagnostic ignored "misc-no-recursion"
#pragma ide diagnostic ignored "OCInconsistentNamingInspection"
#include <iostream>
#include <map>
#include <set>
#include <queue>
using namespace std;
class PreOrderTraversal {
private:
class Node {
public:
int data;
... | ALGO | 0.999915 | 6.642496 | {
"github_metadata": {
"branch": "master",
"commit_count": 174,
"repo_created_at": "2020-12-26T01:33:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ff95c9d8... |
f3582c38-801f-4d88-9986-d5f8ed139bf1 | hau65/oop-week3 | 5.cpp | #include <bits/stdc++.h>
using namespace std;
void Input(int& n, const int& lowerbound = numeric_limits<int>::min())
{
while (!(cin >> n) || n < lowerbound)
{
cout << "Thu lai: ";
cin.clear();
cin.ignore(1000, '\n');
}
}
class cDonThuc
{
private:
int a, n;
public:
cDonThuc... | ALGO | 0.99925 | 4.621511 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2025-04-02T16:55: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": "544b668c46d4... |
36885368-e895-4f15-897a-65fde596a32a | avniamitkumar/CODING-PLATFORM-PRACTICE | print_binary_levels_in_sorted_order.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
public:
vector <vector <int>> binTreeSortedLevels (int arr[], int n)
{
// Your code here
vector<vector<int>>ans;
queue<int>q;
int j=0;
q.push(arr[j]);
... | ALGO | 0.99994 | 5.410137 | {
"github_metadata": {
"branch": "master",
"commit_count": 72,
"repo_created_at": "2022-08-18T14:50:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "10bbfd1e9... |
76e9c216-139c-4f1a-9364-4c2355d101ea | hahaslav/pseudorandom_generators | ratio.cpp | #include "ratio.h"
#include "linear.h"
#include "fibonacci.h"
#include <cmath>
const float root = std::sqrt(8 / std::exp(1));
bool upper_check(float x, float u) {
return x * x <= 5 - 4 * std::exp(0.25) * u;
}
bool lower_check(float x, float u) {
return x * x >= 4 * std::exp(-1.35) / u + 1.4;
}
bool final_ch... | ALGO | 0.999339 | 4.075273 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2022-09-20T07:18:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "984f633640... |
0c5bfc54-f67e-4139-8539-e4f4599b2d74 | chengyiwei/algorithm | hdu/HDU2023/E/E.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long LL;
inline int read(){
int x=0,f=1;char ch=getchar();
while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
return f*x;
}
struct Edge{
int from,to,w;
Edge(int u,int v,int w):from(u... | ALGO | 0.999926 | 4.47968 | {
"github_metadata": {
"branch": "main",
"commit_count": 68,
"repo_created_at": "2024-08-13T07:27:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "73f9c9912bd... |
de49b5b2-06b3-41cd-b956-b29485a0cc70 | danieldrysn/circle_maker | circle_maker.cpp | // circle_maker.cpp : Main entry point for the application.
// Created by: <NAME>
//
#include <opencv2/opencv.hpp>
#include "circle_algorithms.h"
static void onMouse( int event, int x, int y, int, void* );
bool tracking = false;
bool complete = false;
std::vector<cv::Point> points;
int main(void)
{
std::string win... | ALGO | 0.991904 | 5.264144 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2021-10-26T13:30: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": "35ca13306cde... |
27fc922f-245c-42fb-aced-ddb4baa0e375 | MazenAtlam/CODSOFT | C++ programming internship/Task_3/tic-tac-toe.cpp | #include "X_O.hpp"
/**
* main - Entry point
*
* Description: A Tic-Tac-Toe game that allows two players to play together
*
* Return Always 0 (success)
*/
int main(void)
{
char board[3][3];
unsigned int i, j, round, player, play_again = 0;
char ch[2] = {'X', 'O'};
cout << "Welcome to TIC-TAC-TOE GAME" << end... | ALGO | 0.928192 | 4.554995 | {
"github_metadata": {
"branch": "main",
"commit_count": 17,
"repo_created_at": "2023-11-24T14:17: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": "50aa752186b... |
e2a5f271-ce5d-484d-aa4d-73ac3de3c2ae | ValdemarTD/Random | primes.cpp | #include <iostream>
#include <cmath>
using std::cout;
using std::cin;
using std::endl;
int main()
{
unsigned long long int num;
int mult = 3, oldMult = 3;
bool isPrime;
isPrime = true;
// cout << "Which prime would you like to start at?" << endl;
// cin >> num;
num = 3;
while(num < 922337203685477580... | ALGO | 0.999815 | 3.613846 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2018-04-29T05:27: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": "35e9c5db64... |
51d87978-492b-4299-a533-5f04e0d812e4 | davidedellagiustina/linear-centroid-decomposition | benchmark.cpp | #include "src/main.hpp"
#include <cstring>
#include <stdlib.h>
using namespace std;
// Return the formatted string for the elapsed time
// @param duration time in microseconds
// @return formatted string
inline string printDuration(const uint64_t duration) {
int us = duration; // Microseconds
int ms ... | ALGO | 0.945958 | 6.077975 | {
"github_metadata": {
"branch": "master",
"commit_count": 138,
"repo_created_at": "2019-04-05T09:35:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "596b16f8... |
42c5232f-de36-471a-bc00-ac9d344f85be | veqcc/atcoder | atcoder/2020_2_9_JOI/b.cpp | #include <functional>
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <string>
#include <vector>
#include <random>
#include <bitset>
#include <queue>
#include <cmath>
#include <stack>
#include <set>
#include <map>
typedef long long ll;
using namespace std;
const int MAX = 1 << 30... | ALGO | 0.999973 | 3.544139 | {
"github_metadata": {
"branch": "master",
"commit_count": 832,
"repo_created_at": "2018-06-09T04:36:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e9a817e4... |
da0e614b-4cea-4f25-9ea5-07b9ca7e568d | Jessie-JY2728/probsolving | diamOfTree.cpp | // Question: given a tree, represented as a list of edges,
// find the length of its diameter
// the diameter is the longest path from one node to another
vector<int> *adj;
void dfs(int node, int par, vector<int> &d){
for(auto nei: adj[node]){
if(nei==par){
continue;
}
if(d[nei... | ALGO | 0.99985 | 4.474347 | {
"github_metadata": {
"branch": "main",
"commit_count": 34,
"repo_created_at": "2023-09-21T20:16: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": "be1f28975ef... |
50408103-4452-4374-9d34-097b9ccd81e4 | Visible1/Problems-Solutions | European Girls' Olympiad in Informatics 2023/Padel_Prize_Pursuit.cpp | #include <bits/stdc++.h>
using namespace std;
#define mp(a,b) make_pair(a,b)
#define ff first
#define setp(a) setprecision(a)<<fixed
#define ss second
#define fori(v) for(int i=0; i<v; i++)
#define forj(v) for(int j=0; j<v; j++)
#define fork(v) for(int k=0; k<v; k++)
#define forl(v) for(int l=0; l<v; l++)
#define fort... | ALGO | 0.999962 | 3.582267 | {
"github_metadata": {
"branch": "main",
"commit_count": 57,
"repo_created_at": "2023-03-12T18:35:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "899b1ce5e7f... |
d1b62828-9a34-4ceb-84ae-cb2258d97958 | ishandutta2007/codeforces-f | forza_ferrari/normal/603/E.cpp | #include<iostream>
#include<cstdio>
#include<vector>
#include<algorithm>
using namespace std;
struct edge
{
int x,y,w,id;
}e[300001];
vector<pair<int,int> > v[300001<<2];
int n,m,pos,ans[300001],bin[300001],s[300001],cnt;
inline int read()
{
int x=0;
char c=getchar();
while(c<'0'||c>'9')
c=getch... | ALGO | 0.99997 | 4.158788 | {
"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": "a08ad941871f... |
3cfaafc6-39b3-4849-8f14-ca341e815fe5 | hgrgr/bjzip | bj1033.cpp | #include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> pll;
int n;
bool arr[10][10];
bool visit[10];
int parent[10];
pll rate[10][10];
ll gcd(ll a, ll b);
bool dfs(int start, int target);
int main(){
ios_base::sync_with_stdio(fals... | ALGO | 0.999966 | 3.286961 | {
"github_metadata": {
"branch": "main",
"commit_count": 151,
"repo_created_at": "2022-04-17T09:27: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": "f1c8f3fc78... |
4f98231b-9eae-4575-98f7-d9677c6bc9e0 | subham-spec/comptetiveProgramming | Stack/LRU_cache.cpp | #include <bits/stdc++.h>
using namespace std;
class Node{
public:
int key, value;
Node *prev, *next;
Node(int key, int value){
this->key = key;
this->value = value;
}
};
Node* head = new Node(0, 0);
Node* tail = new Node(0, 0);
int cap;
unordered_map<int, Nod... | ALGO | 0.998464 | 4.672708 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2023-02-19T17:37: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": "dd2d0686279... |
dbfefbd5-316a-457b-b978-89a7edfc45f9 | ShehrozIrfan/learn-dsa | C++/Binary Tree/Inorder.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define f(i, x, y) for (ll i = x; i < y; i++)
class Node
{
public:
int data;
Node *left = NULL;
Node *right = NULL;
Node(int x)
{
data = x;
}
};
void InOrder(Node *head, vector<int> &a)
{
if (head == NULL)
... | ALGO | 0.999996 | 5.509387 | {
"github_metadata": {
"branch": "master",
"commit_count": 176,
"repo_created_at": "2022-12-07T17:59:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 23,
"forks": 20,
"issues": 4,
"pull_requests": 2
},
"file_meta": {
"content_id": "b26c2a... |
3e8fb2d2-fd6c-460f-8957-7f6cdbd5f403 | JoaoVitorMartelleto/Projeto_Forca_em_C | Projeto_Final (2) (2).cpp |
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
char palavra[20];
char palavra_secreta[30];
void forca(int erro){
//Desenho inicial da forca
if(erro == 0){
printf("____________\n");
printf("| |\n");
printf("|\n");
printf("|\n");
printf("|\n");
printf("|\n")... | TOOL | 0.934978 | 3.246847 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2022-11-24T21:04: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": "215ce0dc2e9b... |
1d1fcd93-3bbb-4fdd-bb8b-1422026b3a96 | yashraj-code/Practice_C | linkedlist/2_Circular_linked_list/delete_CL.cpp | // Includes - deletion, deleteAtHead
#include<iostream>
using namespace std;
class Node
{
public:
int data;
Node* next;
Node(int val)
{
data=val;
next=NULL;
}
};
void deletion(Node* &head,int pos)
{
//pos= position of Node to be deleted
//h... | ALGO | 0.999111 | 4.326615 | {
"github_metadata": {
"branch": "main",
"commit_count": 179,
"repo_created_at": "2023-01-31T12:40:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3c5bbe7d92... |
0fe57c8c-3567-4e0a-aece-9e1cc4174aae | LarionovaAnastasiaAlexandrovna/Tasks-for-algorithms-and-data-structures | uni tasks/Задача 42. Лента/main.cpp | #include <iostream>
#include <fstream>
#include <algorithm>
#include <vector>
class Solution
{
public:
static std::vector<std::vector<int>> make_matrix(int length, std::vector<int>& mass)
{
std::vector<std::vector<int>> S(length, std::vector<int>(length));
for (int i = 0; i < length; ++i)
... | ALGO | 0.999974 | 3.975944 | {
"github_metadata": {
"branch": "main",
"commit_count": 23,
"repo_created_at": "2023-10-23T16:22: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": "3f123fd594e... |
3d550004-1fff-47ed-a276-02f247ab41ce | dhanraj-12/Dsa | Binary_tree/traversal/itretive_inorder.cpp | #include<bits/stdc++.h>
using namespace std;
struct Node {
int data;
struct Node *left, *right;
Node(int d) {
this->data = d;
left = NULL;
right = NULL;
}
};
vector<int> fun(struct Node *root) {
vector<int> ans;
stack<struct Node*> st;
while(true) {
if(roo... | ALGO | 0.999997 | 4.874544 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2024-08-02T09:45:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "326b51a3276... |
5fdb530d-722c-4e00-8750-b34f0d8a2a64 | arvidn/libtorrent | src/ed25519/fe.cpp | // ignore warnings in this file
#include "libtorrent/aux_/disable_warnings_push.hpp"
#include "fixedint.h"
#include "fe.h"
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4146 ) /* warning C4146: unary minus operator applied to unsigned type, result still unsigned */
#pragma warning(disable : 4244 ) /... | ALGO | 0.983117 | 4.238478 | {
"github_metadata": {
"branch": "RC_2_0",
"commit_count": 13881,
"repo_created_at": "2015-06-03T05:22:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5609,
"forks": 1040,
"issues": 197,
"pull_requests": 33
},
"file_meta": {
"content_id"... |
f93f003a-652f-432a-a2a4-c0ecc362fb6a | root-project/cling | lib/Utils/PlatformPosix.cpp | //--------------------------------------------------------------------*- C++ -*-
// CLING - the C++ LLVM-based InterpreterG :)
// author: <NAME>
//
// This file is dual-licensed: you can choose to license it under the University
// of Illinois Open Source License or the GNU Lesser General Public License. See
// LICENSE... | TOOL | 0.976448 | 7.353628 | {
"github_metadata": {
"branch": "master",
"commit_count": 5347,
"repo_created_at": "2016-01-07T14:45:35.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 3925,
"forks": 292,
"issues": 119,
"pull_requests": 14
},
"file_meta": {
"content_id": "... |
1a776da5-2617-42bc-aab7-60367a205d17 | Larissa-Nahan/Wallace---PRATICA-FIXACAO-PARA-1a-AVALIACAO | Questão 1 - COMPLETO.cpp | #include <stdio.h>
#include <locale.h>
int main()
{
/*1. Criar uma aplicação, para ler 5 números e ir armazenando-os em um vetor.
Em seguida, exiba esse vetor em ordem crescente dos índices e
em ordem decrescente dos índices.*/
setlocale(LC_ALL,"");
int numeros[4];
int i, j, armazena;
printf("Digite 5 númer... | ALGO | 0.999832 | 4.609555 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-10-01T19:05:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "903f34d833... |
1a9254bd-b5ec-474e-8e44-c3109bdca89f | AEGON34/Phitron-daily | Week 20/Day 2/C_Alternating_Subsequence.cpp | #include <bits/stdc++.h>
using namespace std;
bool sign(int num)
{
return num > 0;
}
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
int t;
cin >> t;
while (t--)
{
int n;
cin >> n;
vector<int> ar(n);
for (int i = 0; i < n; i++)
{
... | ALGO | 0.999987 | 5.644012 | {
"github_metadata": {
"branch": "main",
"commit_count": 110,
"repo_created_at": "2024-10-27T17:06: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": "2561719ff0... |
62a7f88e-a3d2-484d-9ba8-164f34d69eec | ishandutta2007/codeforces-k | klimoza/normal/1353/D.cpp | /*#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,popcnt,abm,mmx,tune=native")
#pragma GCC target("avx2")
#pragma GCC optimize("no-stack-protector")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("fast-math")*/
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <math.h>
#inclu... | ALGO | 0.999746 | 3.99966 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T06:06: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": "9aaea0b4b334... |
147466df-534d-4811-aa6a-d4f3075ff498 | arangodb/arangodb | 3rdParty/boost/1.78.0/libs/numeric/odeint/examples/integrate_times.cpp | /* Boost libs/numeric/odeint/examples/integrate_times.cpp
Copyright 2009-2014 <NAME>
Copyright 2009-2014 <NAME>
example for the use of integrate_times
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or
copy at http://www.boost.org/LICENSE_1_0.txt)
*/
#include... | ALGO | 0.994723 | 6.552703 | {
"github_metadata": {
"branch": "devel",
"commit_count": 51986,
"repo_created_at": "2011-10-26T06:42:00.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 13878,
"forks": 857,
"issues": 743,
"pull_requests": 38
},
"file_meta": {
"content_id": ... |
c79e5e20-1189-4010-bf7e-6d63bfc64864 | VincenzoVillanova/Programmazione-2 | Coding Contest/Alberi Binari Di Ricerca/natural-fill/codice.cpp | #include <iostream>
#include <fstream>
#include <string>
#include "bst.h"
using namespace std;
int main()
{
BST<int> BstInt;
BST<double> BstDouble;
string output = "";
fstream fileInput("input.txt", fstream::in);
fstream fileOutput("output.txt", fstream::out);
string type = "";
int n = 0;
... | ALGO | 0.990386 | 4.22131 | {
"github_metadata": {
"branch": "main",
"commit_count": 32,
"repo_created_at": "2022-03-23T08:15: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": "1ab596e36e7... |
e9393766-8644-4252-8a98-4b5fd3dbeeea | darimachine/Data-Structures-and-Algorithms-2024-2025 | Final_Exam_Prep/Exam 03/2019-2020/Penultimate Descendants.cpp | #include <bits/stdc++.h>
using namespace std;
struct Node {
Node *left;
Node *right;
int value;
Node(int value) {
this->value = value;
this->left = NULL;
this->right = NULL;
}
};
class BST {
public:
BST() {
root = NULL;
}
void insert(int value) {
... | ALGO | 0.999947 | 4.902779 | {
"github_metadata": {
"branch": "main",
"commit_count": 66,
"repo_created_at": "2024-10-25T21:32:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8bf483e6bd9... |
cd3eb760-5b45-42de-bf86-9789bec7a9d5 | yashsarda/Scaler-Academy | Array/Maximum_Unsorted_Subarray.cpp | vector<int> Solution::subUnsort(vector<int> &A) {
int n = A.size();
int left = -1;
int right = n-1;
vector<int> ans;
//logic for left side
for(int i=1;i<n;i++){
if(A[i] < A[i-1]){
left = i;
break;
}
}
if(left == -1){
ans.push_back(-1);
... | ALGO | 0.999882 | 4.841075 | {
"github_metadata": {
"branch": "master",
"commit_count": 90,
"repo_created_at": "2019-08-29T02:35:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 29,
"forks": 24,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7635045... |
2df9d11e-6185-439a-b89e-0dc3f0135f75 | ishandutta2007/codeforces-e | errorgorn/normal/1569/B.cpp | //
//
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/rope>
using namespace std;
using namespace __gnu_pbds;
using namespace __gnu_cxx;
#define ll long long
#define ii pair<ll,ll>
#define iii pair<ii,ll>
#define fi first
#define se second
#define end... | ALGO | 0.999281 | 4.832621 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:34:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e16c8f017b36... |
8e67ac36-772e-4121-b358-9fe11470a64b | ishandutta2007/codeforces-y | yfhuang/normal/804/B.cpp | //
// main.cpp
// A
//
// Created by on 2017/5/4.
// Copyright 2017 . All rights reserved.
//
#include <iostream>
#include <cstring>
#include <cstdio>
#include <algorithm>
using namespace std;
int n;
const int maxn = 1e6 + 6;
const int mod = 1e9 + 7;
int ans[maxn];
char s[maxn];
int main(int argc, const c... | ALGO | 0.999924 | 3.652356 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:40:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "eb2bb6f8bc71... |
ae08403b-c60d-4176-b83e-44132d0d1d42 | AdminAbhi/MyCodeLib | CodeChef/2020/20.04 april/Code War/5.cpp | // @abhi_admin FB UserId: abhiavisekkr Email Id: <EMAIL>
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef vector<int> VI;
typedef vector<LL> VLL;
typedef vector<VI> VVI;
typedef pair<int, int> PI;
typedef vector<PI> VPI;
#define endl "\n"
#define PB push_back
#define MP make_pair
#d... | ALGO | 0.999649 | 5.085172 | {
"github_metadata": {
"branch": "master",
"commit_count": 80,
"repo_created_at": "2019-05-19T10:11:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fb3de9d7b... |
3b40cfd6-cb8b-4a49-806f-780d573d2d05 | dbowker/othello | worker.cpp | /*
* Author: <NAME>
* Name: worker.cpp
* Date: 2/27/12
* purpose: This is the worker routine to process computer moves
*/
#include "othello.h"
#include <time.h>
void worker(Communicator comm) {
int i;
int validCMoves[BS];
int scoreCMoves[BS];
clock_t startTime, endTime;
int elapsedTime = 0;
int iterat... | ALGO | 0.994138 | 4.352934 | {
"github_metadata": {
"branch": "master",
"commit_count": 22,
"repo_created_at": "2012-02-07T19:08:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "98d399121... |
c83e2e35-8b20-4084-bd6b-5b6a18815cd1 | mihirp1/Leetcode_Algorithms | valid-parenthesis/solution.cpp | //https://leetcode.com/problems/valid-parentheses/submissions/
class Solution {
public:
bool isReverse(char c1, char c2) {
if (c1 != NULL && c2 != NULL) {
if (c1 == '{' and c2 == '}') return true;
if (c1 == '[' and c2 == ']') return true;
if (c1 == '(' and c2 == ')') return t... | ALGO | 0.999862 | 6.084115 | {
"github_metadata": {
"branch": "master",
"commit_count": 157,
"repo_created_at": "2019-05-11T00:40: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": "fc0bdb3e... |
44ab8c35-2f97-4bd3-b6dc-ba503fd7005a | 0KABE/CCF_CSP | 201604-3.cpp | #include <bits/stdc++.h>
using namespace std;
string CurPath;
int p;
stack<string> path, source;
int main() {
scanf("%d\n", &p);
// get current path
string s;
getline(cin, s);
std::size_t start, end = 0;
while ((start = s.find_first_not_of('/', end)) != string::npos) {
end = s.find_f... | ALGO | 0.987537 | 4.333813 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2019-03-10T17:19: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": "0722fae85... |
22c1aead-d599-49c6-969d-f144de8d2882 | VishalSingh-07/Data-Structures-and-Algorithms | Section 11 - Linked List/1. Linear Singly Linked List/Counting and Sum of Nodes in a Linked List/Sum_of_node.cpp | #include <bits/stdc++.h>
using namespace std;
struct Node
{
int data;
struct Node *next;
} *first=NULL;
void create(int A[], int n)
{
int i;
struct Node *t, *last;
first = (struct Node *)malloc(sizeof(struct Node));
first->data = A[0];
first->next = NULL;
last = first;
... | ALGO | 0.999967 | 4.337579 | {
"github_metadata": {
"branch": "master",
"commit_count": 50,
"repo_created_at": "2022-08-29T10:11:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 14,
"forks": 6,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8f412dcf... |
4d4e85d0-478e-46fe-b8e6-6b22cf47e802 | abhinavprkash/geeksforgeeks | Recusrion/chefmath.cpp |
#include <bits/stdc++.h>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstring>
#include <chrono>
#include <complex>
#define endl "\n"
#define ll long long int
#define vi vector<int>
#define vll vector<ll>
#define vvi vector < vi >
#define pii pair<int,int>
#define pll pair<long long, long long>
#def... | ALGO | 0.999908 | 3.954319 | {
"github_metadata": {
"branch": "master",
"commit_count": 81,
"repo_created_at": "2020-04-18T04:45:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8ce3dfd03... |
7a705804-cd5e-4763-973b-26a5b3623492 | emilyju0314/gpt_code_plagiarism | dataset/code_content_classifier/allpro_train/0_0_6399.cpp | #include <iostream>
#include <vector>
#include <string>
#include <map>
using namespace std;
int main() {
int caseNum = 1;
while (true) {
int N;
cin >> N;
if (N == 0) {
break;
}
map<string, int> dict;
for (int i = 0; i < N; i++)... | ALGO | 0.99974 | 4.148177 | {
"github_metadata": {
"branch": "main",
"commit_count": 50,
"repo_created_at": "2024-04-28T03:59:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "054addd8e0f... |
8c0c0207-f084-4cfb-9357-ad89ab6c12b9 | Sandern/lambdawars | src/game/client/deferred/deferred_client_common.cpp |
#include "cbase.h"
#include "deferred/deferred_shared_common.h"
ConVar deferred_rt_shadowspot_res( "deferred_rt_shadowspot_res", "1024", FCVAR_HIDDEN | FCVAR_RELOAD_TEXTURES | FCVAR_RELOAD_MATERIALS );
#if DEFCFG_ADAPTIVE_SHADOWMAP_LOD
ConVar deferred_rt_shadowspot_lod1_res( "deferred_rt_shadowspot_lod1_res", "512", ... | TOOL | 0.966602 | 4.686947 | {
"github_metadata": {
"branch": "develop",
"commit_count": 1660,
"repo_created_at": "2012-09-15T16:03:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 57,
"forks": 13,
"issues": 1,
"pull_requests": 1
},
"file_meta": {
"content_id": "ea6d... |
325a9e27-4ed1-4d8d-8fba-e39412220f1a | AI-Planning/autoscale | planners/ipc2018-opt-delfi1/src/search/structural_symmetries/group.cc | #include "group.h"
#include "graph_creator.h"
#include "permutation.h"
#include "../global_state.h"
#include "../option_parser.h"
#include "../per_state_information.h"
#include "../plugin.h"
#include "../state_registry.h"
#include "../task_proxy.h"
#include "../utils/memory.h"
#include <algorithm>
#include <iostream... | ALGO | 0.992981 | 6.507893 | {
"github_metadata": {
"branch": "main",
"commit_count": 1270,
"repo_created_at": "2021-07-13T08:45:03.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 5,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ad4d55d1bf... |
2043cda9-7186-4090-8f3d-4453401f212f | walkccc/LeetCode | solutions/1674. Minimum Moves to Make Array Complementary/1674.cpp | class Solution {
public:
int minMoves(vector<int>& nums, int limit) {
const int n = nums.size();
int ans = n;
// delta[i] := the number of moves needed when target goes from i - 1 to i
vector<int> delta(limit * 2 + 2);
for (int i = 0; i < n / 2; ++i) {
const int a = nums[i];
const in... | ALGO | 0.999977 | 5.759641 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2019-02-23T15:46:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1254,
"forks": 437,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d2b0520... |
7013b11a-bbc2-4e0e-928e-88930e67f35e | mgokulkrish/myfirstcompiler | main.cpp | #include <algorithm>
#include <cassert>
#include <cctype>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <map>
#include <memory>
#include <string>
#include <vector>
#include "KaleidoscopeJIT.h"
#include "llvm/ADT/APFloat.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/IR/BasicBlock.h"
#include "llv... | TOOL | 0.984387 | 5.797887 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2023-07-03T13:51:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "49ef40a6bc80... |
271a888f-d8f0-4618-8f50-607e213fad3a | vitaliishh/jarvis_algorithm | ConsoleApplication1/Jarvis.cpp | #include "Jarvis.h"
vector<Point> Jarvis::getResultP()
{
return resultP;
}
Jarvis::Jarvis(vector<Point> points)
{
this->points = points;
alg(points);
}
void Jarvis::searchExPoint(vector<Point> points)
{
for (int i = 0; i < points.size(); i++)
{
if (points[i].x < xML)
{
xML = points[i].x;
yML =... | ALGO | 0.999836 | 3.86812 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2021-12-13T00:30:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "11e06a178a... |
d2943064-d382-4fca-b4e8-9948ac4e49a0 | Jain-Ayush-11/Competitive-Programming | B_Maximum_Substring.cpp | /*******************
CodeForces:- Ayush_J
CodeChef:- stein_1103
********************/
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,fma")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
#define int long long int
int ... | ALGO | 0.999827 | 4.572422 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2023-02-10T17:02:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "246465d07a... |
0a9ec0ff-5209-4f6d-aec2-709e4cc55109 | jalotra/Codeforces_Submissions | codeforces/1419/A.cpp | #include <bits/stdc++.h>
using namespace std;
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
s... | ALGO | 0.999959 | 3.698613 | {
"github_metadata": {
"branch": "master",
"commit_count": 165,
"repo_created_at": "2021-01-21T12:44: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": "bffea0e0... |
adb49695-a7cd-42db-ac34-387b09db180e | astrasourav/Leetcode | 623-Add-One-Row-to-Tree/623-Add-One-Row-to-Tree.cpp | class Solution {
public:
TreeNode* add(TreeNode* root, int val, int depth, int curr) {
if (root == nullptr) {
return nullptr;
}
if (curr == depth - 1) {
TreeNode* tempLeft = root->left;
TreeNode* tempRight = root->right;
root->left = new Tree... | ALGO | 0.999932 | 6.481293 | {
"github_metadata": {
"branch": "main",
"commit_count": 234,
"repo_created_at": "2024-01-07T19:51:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cafbafe0b7... |
2670e623-9edc-4303-8429-69a6540587c3 | HariAakash646/CompetitiveProgramming | Contests/COCI24_round2/zatopljenje.cpp | #include <bits/stdc++.h>
using namespace std;
#define scd(t) scanf("%d", &t)
#define sclld(t) scanf("%lld", &t)
#define forr(i, j, k) for (int i = j; i < k; i++)
#define frange(i, j) forr(i, 0, j)
#define all(cont) cont.begin(), cont.end()
#define mp make_pair
#define pb push_back
#define f first
#define s second
typ... | ALGO | 0.999929 | 3.862992 | {
"github_metadata": {
"branch": "main",
"commit_count": 123,
"repo_created_at": "2022-09-08T07:58:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "326fb28ac3... |
4362f820-a28b-4acf-99d3-c3e32d787dd7 | Oozwding/helloworld | HDOJ/HDOJ1709/HDOJ1709.cpp | /**
* Filename:HDOJ1085
* Date :2016/4/21
* @Author :zwding
* Describe:母函数应用
*/
/**16930890 2016-04-21 15:56:56 Accepted 1709 93MS 1724K 1434B G++ zwding*/
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#define MAXN 10005
using namespace std;
int num[102];
in... | ALGO | 0.999991 | 3.216927 | {
"github_metadata": {
"branch": "master",
"commit_count": 27,
"repo_created_at": "2016-05-20T08:35:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6570344b8... |
4498f127-97bb-42eb-a642-d8ef75e9467b | morris821028/UVa | contest/FacebookHackerCup/FBHacker2016Round1/B/main.cpp | #include <stdio.h>
#include <stdlib.h>
#include <set>
#include <vector>
#include <algorithm>
using namespace std;
const int MAXN = 131072;
const int LMAX = 0x3f3f3f3f;
int main() {
int testcase;
int cases = 0;
scanf("%d", &testcase);
while (testcase--) {
int L, N, M, D, W, target;
mult... | ALGO | 0.99991 | 3.400974 | {
"github_metadata": {
"branch": "master",
"commit_count": 1197,
"repo_created_at": "2013-06-14T12:34:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 571,
"forks": 269,
"issues": 1,
"pull_requests": 1
},
"file_meta": {
"content_id": "c5a... |
30061686-5602-4a3b-b993-e23aa8ef327a | WarToks/compProgramming | Fourier.cpp | // フーリエ変換を愚直に行う関数 複素数列{Ai} から Âm を計算する関数
template <class precision = double>
std::complex<precision> fourier_transform(const std::vector<std::complex<precision>>& A, unsigned int m){
using number_type = std::complex<precision>; // 複素数の型
constexpr number_type pi = std::acos<precision>(-1); // 円周率
const unsig... | ALGO | 0.999755 | 5.696524 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2020-02-26T15:44: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": "7843659cfa... |
9d75abc6-dc7d-4a83-bafa-6bb0ee6b1767 | ishandutta2007/codeforces-h | he_ren/normal/1451/E1.cpp | #include<cstdio>
#include<algorithm>
#include<vector>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
const int MAXN = (1<<16) + 5;
inline int ask_pos(int i,int j)
{
printf("%d %d\n",i,j);
fflush(stdout);
int res;
scanf("%d",&res);
return res;
}
inline int ask_and(int i,int j){ printf("AND "... | ALGO | 0.999878 | 3.314701 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T02:01:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c5545b8043b9... |
39226178-a334-431a-a832-3daacdd8ff23 | vancha/HexMinimax | board.cpp |
#include "board.h"
#include <stdlib.h> /* exit, EXIT_FAILURE */
Board::Board()
{
for (int q = 0; q < SIZE; q++)
{
for (int t = 0; t < SIZE; t++)
{
board[q * SIZE + t] = 0;
}
}
}
void Board::clear()
{
for(int i = 0; i < SIZE*SIZE;i++)
{
board[i] = 0;
... | ALGO | 0.987674 | 4.484547 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2017-01-17T16:12:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ad5484cd3... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.