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 |
|---|---|---|---|---|---|---|---|
d6bd1290-d04d-4ef2-b20e-c38503d107a3 | ishandutta2007/codeforces-k | kevinsogo/normal/827/A.cpp | #include <bits/stdc++.h>
using namespace std;
#define K 1111111
char *words[K];
int lens[K];
char wordt[K];
vector<pair<int, int>> writes[2*K];
vector<pair<int, int>> unwrites[2*K];
int main() {
int n;
scanf("%d", &n);
char *curr = wordt;
int tlen = 0;
for (int i = 0; i < n; i++) {
words[i... | ALGO | 0.999894 | 3.009941 | {
"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": "83270d8682a4... |
677a6e4c-5f17-4447-bd6b-350b04f4fa9f | juruoO-o/CPP_LC | LC225.cpp | #include <bits/stdc++.h>
using namespace std;
struct ListNode {
int val;
ListNode *next;
ListNode() : val(0), next(nullptr) {}
ListNode(int x) : val(x), next(nullptr) {}
ListNode(int x, ListNode *next) : val(x), next(next) {}
};
struct TreeNode {
int val;
TreeNode *left;
TreeNode ... | ALGO | 0.999973 | 4.87793 | {
"github_metadata": {
"branch": "master",
"commit_count": 255,
"repo_created_at": "2023-12-20T08:44:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8a58e7c0... |
e8aa36bb-cdd4-417f-a409-bd5ef4745d8e | MicBosi/VisualizationLibrary | src/vlCore/Plane.cpp | /**************************************************************************************/
/* */
/* Visualization Library */
/* http://visualizationlibrary.org ... | ALGO | 0.993013 | 6.752903 | {
"github_metadata": {
"branch": "master",
"commit_count": 1535,
"repo_created_at": "2015-03-23T10:57:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 355,
"forks": 98,
"issues": 73,
"pull_requests": 4
},
"file_meta": {
"content_id": "8d9... |
2c7fc460-1084-4bfd-9300-aff96f4aa279 | Simonhancrew/SCL | DynamicProgramming/树形dp/minimum-height-trees.cpp | #include <iostream>
#include <vector>
// Created by Simonhancrew on 2024/03/17
using namespace std;
// 给定一堆无向边,这些边能构成一颗树。要求层高最小的根节点合集
// 类似于树的直径,但是不累加起来,看两边的深度。求出每个节点作为根的最大深度
// 然后过滤出集合
using LL = long long;
using PII = pair<int, int>;
#define fast_cin() \... | ALGO | 0.999984 | 4.465272 | {
"github_metadata": {
"branch": "main",
"commit_count": 738,
"repo_created_at": "2021-08-08T02:13:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b47c2fc907... |
33643ccf-4cb8-4ffe-b327-103011fe2fcd | jiaqiangwjq/Algorithm-learning | 递归/n皇后问题.cpp | /*考虑到每行只能放置一个皇后,每列也只能放置一个皇后,那么如果把
n 列皇后所在的行数写出。将会是一个 1~n 的排列
*/
int count = 0;
const int maxn = 10;
int P[maxn], hashTable[maxn] = {false};
void generateP(int index)
{
if(index == n+1) //递归边界,生成一个排列
{
bool flag = true; //flag 为 true,表示当前排列为一个合法方案
for(int i = 1; i <= n; i++) //遍历任意两个皇后
... | ALGO | 0.999918 | 3.221911 | {
"github_metadata": {
"branch": "master",
"commit_count": 194,
"repo_created_at": "2018-09-02T04:27: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": "f9c9baa1... |
4da2565e-328a-44b5-9432-65237eee3700 | jerryhong21/comp4128 | pset2/d.cpp | #include <iostream>
#include <vector>
#include <cmath>
#include <stack>
#include <map>
#include <set>
#include <queue>
#include <tuple>
#include <algorithm>
#include <limits>
// #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<int> vi;
typedef vector<vi> vvi;
... | ALGO | 0.999881 | 5.445101 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2024-11-30T03:22: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": "993dfefc2ce... |
ff6d8290-da14-49eb-ae2c-dcd7957dc236 | bjorncs/vespa | eval/src/tests/gp/ponder_nov2017/ponder_nov2017.cpp | // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/vespalib/util/signalhandler.h>
#include <vespa/eval/gp/gp.h>
#include <limits.h>
#include <algorithm>
using namespace vespalib;
using namespace vespalib... | ALGO | 0.990642 | 4.631139 | {
"github_metadata": {
"branch": "master",
"commit_count": 74717,
"repo_created_at": "2023-07-05T14:21:29.000Z",
"is_fork": true,
"is_org_owned": false,
"forked_from": "vespa-engine/vespa",
"stars": 1,
"forks": 0,
"issues": 1,
"pull_requests": 183
},
"file_meta": {
"con... |
c38f65ba-52d1-4b69-b554-bb1881b6b1a2 | vinorom/contests | src/hackerrank/contests/projecteuler/Euler023.cpp | /**
* Problem:
* Non-abundant sums
*
* Links:
* https://projecteuler.net/problem=23
* https://www.hackerrank.com/contests/projecteuler/challenges/euler023
*/
#include <iostream>
#include <set>
using namespace std;
typedef set<int> IntSet;
const int MAX = 100001;
int sum_divisors[MAX] = {0};
I... | ALGO | 0.998951 | 5.365313 | {
"github_metadata": {
"branch": "master",
"commit_count": 91,
"repo_created_at": "2015-03-30T19:47:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "61ab27830... |
34413dc2-8062-4b26-b9e1-85cf815679b3 | gbhb/alg | hw/hw4/2.cpp | #include <algorithm>
#include <climits>
#include <cmath>
#include <iostream>
using namespace std;
int Max_Son(int *p, int len)
{
int Max_Sum = INT_MIN;
int i, j;
for (i = 0; i < len; ++i)
{
int sum = 0;
for (j = i; j < len; ++j)
{
sum = sum + p[j];
if (sum... | ALGO | 0.999736 | 3.842511 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2021-06-02T04:18:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d069dda1fc... |
fef204b7-9d38-40bb-b2a8-44222623d70c | themostfreeboy/CommonFiles | 7z的LZMA/所有h和cpp文件/My7z.cpp | #include "My7z.h"
const char *kCantReadMessage = "Can not read input file";//复制于7z官方LZMA算法SDK的LzmaUtil.c中
const char *kCantWriteMessage = "Can not write output file";//复制于7z官方LZMA算法SDK的LzmaUtil.c中
const char *kCantAllocateMessage = "Can not allocate memory";//复制于7z官方LZMA算法SDK的LzmaUtil.c中
const char *kDataErrorMessage ... | TOOL | 0.926133 | 4.641156 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2018-04-04T14:21: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": "cdf193a340... |
7d215232-c38f-4015-b6e0-7e0802a7fbd5 | deant-digital/NSSPC | cpp-2022-prelim/p06.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
double m, c;
cin >> m >> c;
const double delta = (m + 2) * (m + 2) + 4 * (c + 3);
if (delta < 0) {
cout << "No intersection";
return 0;
}
cout << fixed << setprecision(7);
const double center = m / 2 + 1;
if (de... | ALGO | 0.999916 | 3.996646 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2025-01-07T11:08: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": "c3d306bccb8f... |
2b9042b6-a18f-4b74-b675-037d6c90c71b | KratosMultiphysics/Kratos | kratos/spaces/ublas_space.h | // | / |
// ' / __| _` | __| _ \ __|
// . \ | ( | | ( |\__ `
// _|\_\_| \__,_|\__|\___/ ____/
// Multi-Physics
//
// License: BSD License
// Kratos default license: kratos/license.txt
//
// Main authors: <NAME>
// Collaborator: <N... | TOOL | 0.933929 | 7.09172 | {
"github_metadata": {
"branch": "master",
"commit_count": 106408,
"repo_created_at": "2017-02-13T10:58:24.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1141,
"forks": 265,
"issues": 381,
"pull_requests": 258
},
"file_meta": {
"content_id"... |
7fe5daaf-ea28-4aa9-9ec6-2cb61c125ca2 | amagalifv/CODE | VSCODE/Ejercicios_C++/2021_1erC_FRBA-UTN/1er Parcial/Eje1_Examen.cpp | #include <iostream>
using namespace std;
bool esNumeroPrimo (int num);
int main () {
int numeroEnt;
int numAnterior=0;
int cantIterac=0;
int contAscendente=0;
int contDescendente=0;
cout << "Ingrese un numero" <<endl;
cin >> numAnterior;
while (numeroEnt != 0){
cantIterac=cantIterac+1;
if (n... | ALGO | 0.999554 | 3.708966 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2022-08-03T13:46:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fae5efc21c... |
56f0fe54-f0a8-44da-8936-8c30c3021451 | gaokekun123/Note-Book | 并查集/QuickUnion.h | /*
这一版并查级 是将每一个节点都设置一个父节点,,每一个节点都指向她所连接的上一个节点知道找到它的根节点,根节点指向他自己
*/
#include<iostream>
#include<cassert>
using namespace std;
namespace UF2{
class QuickUnion{
private :
int * parent;
int count;
public :
QuickUnion( int count ){
parent = new int[count];
this -> count = count;
for( int i = 0 ... | ALGO | 0.997567 | 3.848217 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2018-03-21T07:33:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c79a1e4429... |
05221746-6152-449a-b527-137b16cfcfdc | ishandutta2007/codeforces-z | zhouzhendong/normal/1172/C2.cpp | #include <bits/stdc++.h>
#define clr(x) memset(x,0,sizeof x)
#define For(i,a,b) for (int i=(a);i<=(b);i++)
#define Fod(i,b,a) for (int i=(b);i>=(a);i--)
#define fi first
#define se second
#define pb(x) push_back(x)
#define mp(x,y) make_pair(x,y)
#define outval(x) cerr<<#x" = "<<x<<endl
#define outtag(x) cerr<<"--------... | ALGO | 0.999952 | 3.517871 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:43: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": "28085b798c42... |
7ba6f2c4-c77e-4475-adb3-5d79323da9ea | gustav0leal/MonkeysLIB | solutions/String/StringHash2D-Impl2.cpp | const int N = 2010;
const uint64_t p[4] = {33, 73, 37, 93}, mod[2] = {1000000007, 1000000009};
uint64_t ppow[4][N];
void build()
{
for (int j = 0; j < 4; j++){
ppow[j][0] = 1;
for (int i = 1; i < N; i++) {
ppow[j][i] = (ppow[j][i-1] * p[j]) % mod[j>>1];
}
}
}
//need... | ALGO | 0.999994 | 4.363501 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-11-30T21:57:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d5cf0b322fa3... |
d3409470-72ff-45d8-8cad-28341275569e | nikhilsinha822/CP | CP problems/D_Distinct_Split.cpp | #include<bits/stdc++.h>
#define ll long long
using namespace std;
bool compare_pair(const pair<int,int> &pair1, const pair<int,int> &pair2){
int result = 1;
if( (pair2.second > pair1.second) || ((pair2.second == pair1.second) && (pair2.first > pair1.first)) ){
result = 0;
}
return result;
}
//unordered_map <ll,ll> imap... | ALGO | 0.999942 | 3.568409 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2023-06-24T11:51: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": "ff1e984a4b89... |
58c012f3-2f68-4559-9f66-c023102fc529 | PolinaVoloshchik/Semester-1 | 18.10.2017/Task 5.cpp | #include <iostream>
using namespace std;
long long int deleting(long long int n, int n1);
long long int newNumber(long long int n, int n1);
int main()
{
long long int n, n1;
cout << "Enter n = ";
cin >> n;
while (true)
{
cout << "Enter digit to be deleted: ";
cin >> n1;
if ((n1 > 10) || (n1 < 0))
{
cou... | ALGO | 0.997287 | 3.74604 | {
"github_metadata": {
"branch": "master",
"commit_count": 58,
"repo_created_at": "2017-10-11T13:38: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": "d4867c870... |
32d1fe00-edd6-411d-a3fe-7925226d93a4 | denis-belov/xgk | src/data/mat4/mat4-32.cpp | #define SET32(\
matrix_addr_float,\
\
e0, e4, e8 , e12,\
e1, e5, e9 , e13,\
e2, e6, e10, e14,\
e3, e7, e11, e15\
)\
\
matrix_addr_float[0] = e0; matrix_addr_float[4] = e4; matrix_addr_float[8] = e8 ; matrix_addr_float[12] = e12;\
matrix_addr_float[1] = e1; matrix_addr_float[5] = e5; matrix_addr_float... | TOOL | 0.987063 | 4.504136 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2019-09-19T06:57:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "07547005e... |
12b6ad8c-1f8e-435c-81dd-cbdd8fbf48cb | injoon149/codetree-TILs | 240608/정수 명령 처리 3/process-numeric-commands-3.cpp | #include <iostream>
#include <deque>
#include <string>
using namespace std;
int main() {
// 여기에 코드를 작성해주세요.
deque<int> d;
int n;
cin >> n;
string s;
int num;
for(int i = 0; i<n; i++)
{
cin >> s;
if(s == "push_front")
{
cin >> num;
d.push_f... | ALGO | 0.998992 | 5.022515 | {
"github_metadata": {
"branch": "main",
"commit_count": 1143,
"repo_created_at": "2024-03-29T14:19:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "eaf715c8e... |
c6c468db-bc7f-40d2-96fb-8fecfa1755fa | andrew-canada/competitive-programming | ccc/problems/senior/2020/S_3.cpp | #include <bits/stdc++.h>
using namespace std;
const int M = 1e9 + 7, numC = 26;
int main()
{
string n, h;
cin >> n >> h;
int nl = n.size(), hl = h.size();
int mxH = 1;
for (int i = 0; i < nl - 1; i++)
{
mxH = (mxH * numC) % M;
}
int nh = 0, hh = 0;
for (int i = 0; i < nl; ... | ALGO | 0.999916 | 3.957965 | {
"github_metadata": {
"branch": "main",
"commit_count": 365,
"repo_created_at": "2024-07-28T17:18: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": "8cff9c39cb... |
1113b424-6716-4ee7-8595-f020c302e071 | siiyayu/Yandex-MIPT-Cpp-specialization | белый пояс/5 неделя/финалочка белый пояс/main.cpp | #include <iostream>
#include <map>
#include <set>
#include <vector>
#include <string>
#include <iomanip>
#include <sstream>
using namespace std;
class Date {
public:
Date(const int& NewYear, const int& NewMonth, const int& NewDay) {
year = NewYear;
month = NewMonth; // планирую тут сделать конверт... | TOOL | 0.989618 | 4.932428 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2020-02-10T15:52:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "21f22f2cd0... |
62d9409b-56c8-4979-8628-f2fdab4ffb9d | Kuro-orzz/Cses-solution | 06.Tree_Algorithms/1688.Company_Queries_II.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define MOD (ll)(1e9+7)
#define all(x) (x).begin(),(x).end()
#define vi vector<int>
#define pii pair<int, int>
#define fi first
#define se second
struct Lca{
vector<vector<int>> adj;
vector<int> h;
vector<vector<int>> up;
Lca(int n):... | ALGO | 0.999994 | 4.620084 | {
"github_metadata": {
"branch": "main",
"commit_count": 57,
"repo_created_at": "2024-03-12T11:43: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": "4d13f911889... |
55719234-2ca3-45bc-9804-94e8aafea154 | BHN-Nirab/practice- | bipartite.cpp |
#include<iostream>
#include<stdio.h>
#include<queue>
#define WHITE 1
#define GRAY 2
#define BLACK 3
#define RED 1
#define BLUE 2
using namespace std;
int numberOfNode, numberOfEdge;
int graph[100][100];
int color[100];
int parent[100];
int dis[100];
int colorOfNode[100];
void bfs(int startingNode)
{
for(int i=0;... | ALGO | 0.99993 | 5.02751 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2019-04-22T03:45:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5be6329c99... |
1e1eb28b-c950-422e-8547-3ea1d02e9696 | NgJaBach/MarisaOJ_Solutions | level4/203.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=100050;
ll a[N];
ll seg[4*N];
ll lazy[4*N];
void Build(int x,int L,int R){
lazy[x]=0;
if(L==R){
seg[x]=a[L];
return;
}
int mid=(L+R)/2;
Build(2*x,L,mid);
Build(2*x+1,mid+1,R);
seg[x]=seg[2*x]+... | ALGO | 0.999875 | 4.973008 | {
"github_metadata": {
"branch": "main",
"commit_count": 36,
"repo_created_at": "2023-07-08T07:28:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ba3b0fed9d5... |
15dab670-1ab5-474c-9385-ed6a90942b73 | jrubianom/Beyond-Research-HydroD | 3DSphere/code/Simulate.cpp | #include "mfem.hpp"
#include <fstream>
#include <iostream>
#include <algorithm>
#include <string>
#include "Simulate.h"
using namespace std;
using namespace mfem;
void PerformExp(flowParameters &FP,int myid,ParMesh *pmesh,int order,
int num_iterations,double tol){
FP.order = order;
FP.num_itera... | ALGO | 0.998159 | 4.847414 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-06-29T01:05: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": "e4e2a2ff5389... |
63b32c05-a057-4f33-80ba-e604594ead26 | kinetic-rb/kinetic-rb.github.io | code/P8814.cpp | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#define ra __Read_int()
using namespace std;
using tp = long long;
tp __Read_int() {
tp x;
scanf("%lld", &x);
return x;
}
tp get(tp w, tp a, tp b, tp c) {
return (-b + w * sqrt(b * b - 4 * a * c)) / (2 * a);
}
signed main() {
tp k... | ALGO | 0.999875 | 3.904193 | {
"github_metadata": {
"branch": "main",
"commit_count": 63,
"repo_created_at": "2022-11-19T06:37: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": "e570495ca76... |
4d67c597-31e5-4b2e-b318-ddc883b7e767 | Ranewen/CSE241-OOP | PS/PS2/q1.cpp | #include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
const int __DUELNUM__ = 10000; /* 10,000 duels.*/
void Aaron_shoots(bool aaron, bool& bob, bool& charlie); /* Randomly choose between 0,1, or 2. If ==1, missed shot. */
void Bob_shoots(bool& aaron, bool bob, bool& charlie); /* Randomly choo... | ALGO | 0.972316 | 3.976211 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-04-05T18:33: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": "2e587d43f020... |
bca69a56-8d08-428b-8b4c-852fba4913ff | Samsung/veles.sound_feature_extraction | src/allocators/sliding_blocks_impl.h | /*! @file sliding_blocks_impl.h
* @brief New file description.
* @author <NAME> <<EMAIL>>
* @version 1.0
*
* @section Notes
* This code partially conforms to <a href="http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml">Google C++ Style Guide</a>.
*
* @section Copyright
* Copyright © 2013 Sam... | ALGO | 0.976645 | 3.985325 | {
"github_metadata": {
"branch": "master",
"commit_count": 734,
"repo_created_at": "2015-08-07T02:50:31.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 27,
"forks": 15,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3a85aa3... |
345087f2-0f68-443f-99ac-cb760a18a5fb | shmohammadi86/SCINET | inst/include/stats/math/gcem_incl/sgn.hpp | /*################################################################################
##
## Copyright (C) 2016-2018 <NAME>
##
## This file is part of the GCE-Math C++ library.
##
## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with ... | TOOL | 0.942814 | 6.636543 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2019-07-15T22:40:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 18,
"forks": 5,
"issues": 2,
"pull_requests": 1
},
"file_meta": {
"content_id": "da475597... |
54be2e4e-5191-4ba7-a240-51a8e2ddebed | mvinci12/DoublyLinkedList-Implementation | LinkedList.h | //
// LinkedList.h
// Linked_List
//
//
// This is an implementation of an ordered Linked List class, which is made up of Nodes.
// All classes are templated, such that their types may be provided at creation.
// Nodes contain data (which doubles as key), and pointers to all directions.
#ifndef LinkedList_h
#def... | ALGO | 0.999696 | 4.819468 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2021-12-31T02: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": "4a4938ca0633... |
1e201a30-cac2-40a4-b0f2-bbb40952aa15 | mhmdriduan11/Databases-Application | BinarySearchTREE-Databases-Application.cpp | #include <iostream>
using namespace std;
//Program Databases: With "Binary Search Tree" : Author : @_mhmdriduan11
struct Node {
int data{};
Node* left{};
Node* right{};
};
void addDatabases(Node** superuser, int keyword){
if ((*superuser) == nullptr)
{
Node* temp = nullptr ;
temp = new Node();
temp->data ... | ALGO | 0.999117 | 4.497267 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2021-02-21T13:55: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": "9f5c83c68b... |
f7e008ac-2364-45f5-8bfc-a6d33327c33b | JunSince99/BaekJoon | C++/2025-05/23/15686.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int n,m;
int ans=2e9;
vector<pair<int, int>> houses;
vector<pair<int, int>> chickens;
void dfs(int idx, vector<int> &selected) {
if(selected.size() == m) {
int sum = 0;
for(int i=0;i<houses.size();i++) {
in... | ALGO | 0.999839 | 4.013206 | {
"github_metadata": {
"branch": "main",
"commit_count": 114,
"repo_created_at": "2024-12-18T08: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": "27af74c754... |
9604a507-b1f2-41c2-b394-0565314f72de | ashwath7/CPP_Codes-CP | CF-TPrimes.cpp | #include<bits/stdc++.h>
#define int int64_t
#define pb push_back
#define endl '\n'
#define pll pair<int,int>
#define vll vector<int>
#define all(a) (a).begin(),(a).end()
#define x first
#define y second
#define sz(x) (int)x.size()
#define hell ... | ALGO | 0.999819 | 4.027189 | {
"github_metadata": {
"branch": "main",
"commit_count": 37,
"repo_created_at": "2021-08-20T18:53:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "762b6a68f02... |
a02ae8df-2cbc-49cc-b03b-10930c923cd9 | kwebi/ojquestion | bjtu_oj/1864.cpp | #include <stdio.h>
#include <math.h>
#include <vector>
using namespace std;
int DigitSum(int n);
bool IsPrime(int n);
int main()
{
int n, k;
scanf("%d %d", &n, &k);
vector<int> arr;
for (int i = k; i <= n; i++)
{
if (DigitSum(i) == k)
{
arr.push_back(i);
}
}... | ALGO | 0.999984 | 4.596908 | {
"github_metadata": {
"branch": "master",
"commit_count": 272,
"repo_created_at": "2018-02-20T12:44: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": "6e5793c4... |
5c4ac01e-6c89-4a69-a6fc-051206164448 | atulag/Code | C++/LetterPhone.cpp | /*
Given a digit string, return all possible number combinations that the number can represent.
The mapping of digit to letters is just like the telephone number.
The digit 0 and 1 maps to itself.
Make sure the strings are lexicographically sorted.
======Input=====
Digit string "23"
================
======Output=====... | ALGO | 0.999706 | 5.706629 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2016-02-12T12:42: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": "718b90f893... |
2f8e89b0-d885-4db2-9c60-154d68464c18 | GianpaMX/coding-skills | levelup/21-rains.cc | #define CATCH_CONFIG_MAIN
#include <catch2/catch.hpp>
#include <vector>
using namespace std;
/**
* @brief Given n non-negative integers representing an elevation map where the
* width of each bar is 1, compute how much water it can trap after raining.
*
* @param arr
* @return int
*/
int rains(vector<int> arr) ... | TEST | 0.997089 | 7.369647 | {
"github_metadata": {
"branch": "master",
"commit_count": 34,
"repo_created_at": "2024-04-04T15:40: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": "099156a7b... |
48b23924-415f-4dc8-9490-c1ecd6a917ff | mengmingliang/leetcode | 18/solution.cpp | class Solution {
public:
vector<vector<int>> fourSum(vector<int>& nums, int target) {
vector<vector<int>> ans;
int n = nums.size();
int l = 0;
int r = 0;
sort(nums.begin(),nums.end());
for(int i = 0;i < n-3; ++i){
if(i > 0 && nums[i-1] == nums[i])... | ALGO | 0.999992 | 6.047539 | {
"github_metadata": {
"branch": "master",
"commit_count": 91,
"repo_created_at": "2016-07-01T08:18:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "647c268af... |
7db8083d-53ba-490b-bba3-a008b2e0040b | k2font/atcoder | arc050_B.cpp | #include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()
using ll = long long;
using P = pair<ll, ll>;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, -1, 0, 1};
string char_to_string(char val) {
return string(1, val);
}
int ... | ALGO | 0.999722 | 3.59228 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2020-07-08T09: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": "c6f9d1a73... |
366a9ad2-1def-4dea-82c6-656bec9e9d6a | JoyM1K1/Atcoder | DP/D.cpp | #include <bits/stdc++.h>
#define REP(i, N) for (int i = 0; i < (N); i++)
#define REPR(i, N) for (int i = (N)-1; i >= 0; i--)
#define ALL(x) (x).begin(), (x).end()
#define MOD 1000000007
#define PB push_back
#define MP make_pair
using namespace std;
typedef long long ll;
ll gcd(ll x, ll y) { return y ? gcd(y, x % y) : x... | ALGO | 0.999988 | 3.922884 | {
"github_metadata": {
"branch": "master",
"commit_count": 51,
"repo_created_at": "2019-08-28T02:58: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": "27defa388... |
b84c01b5-11c4-4091-8a2c-34c8ae55d80b | anubhavitis/Competitive-Programming | 1-Codeforces/Round 722 Div 2/B.cpp | //<NAME>
#include<bits/stdc++.h>
#define ll long long
#define mp make_pair
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()
#define big(x) greater<x>()
#define sp fixed<<s... | ALGO | 0.999879 | 4.095948 | {
"github_metadata": {
"branch": "master",
"commit_count": 324,
"repo_created_at": "2019-03-10T17:43:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 11,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "17e0141... |
2b59fef7-45f9-4101-9a6d-6b5bc1504a65 | frc971/971-Robot-Code | frc971/control_loops/drivetrain/ssdrivetrain.cc | #include "frc971/control_loops/drivetrain/ssdrivetrain.h"
#include "aos/commonmath.h"
#include "frc971/control_loops/coerce_goal.h"
#include "frc971/control_loops/drivetrain/drivetrain_config.h"
#include "frc971/control_loops/drivetrain/drivetrain_goal_generated.h"
#include "frc971/control_loops/drivetrain/drivetrain_... | TOOL | 0.952109 | 6.891631 | {
"github_metadata": {
"branch": "main",
"commit_count": 11732,
"repo_created_at": "2020-10-24T22:17:51.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 65,
"forks": 11,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "470ef39... |
a5060551-bbe3-49a3-a607-0dd0ad564529 | neppiness/TIL | problem-solving/boj/random-defense/25955-11-09-2024.cpp | #include <bits/stdc++.h>
using namespace std;
string input[1002];
string sorted[1002];
string ans[2];
int cnt;
int getGrade(char gr) {
if (gr == 'B') return 0;
if (gr == 'S') return 1;
if (gr == 'G') return 2;
if (gr == 'P') return 3;
return 4;
}
bool cmp(string &s1, string &s2) {
if (s1[0] == s2[0]) {
... | ALGO | 0.999876 | 3.972922 | {
"github_metadata": {
"branch": "main",
"commit_count": 623,
"repo_created_at": "2022-05-13T05:47: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": "0807e41750... |
4c675cb1-dd72-4a32-8c39-cdc6de7273af | cesar-borba/beecrowd-leetcode-questions | beecrowd/2000-2499/bee_2450.cpp | #include <bits/stdc++.h>
//https://judge.beecrowd.com/pt/problems/view/2450
using namespace std;
int main() {
int n, m;
cin >> n >> m;
vector<vector<int>> matriz(n, vector<int>(m));
bool linha_zero = false;
int zeros_consecutivos=-1;
for(int i=0; i<n; i++) {
int consecutivos_... | ALGO | 0.99997 | 4.985335 | {
"github_metadata": {
"branch": "main",
"commit_count": 118,
"repo_created_at": "2024-09-01T16:13:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "990f842426... |
63879e38-6418-4d90-88fc-92b9a07471ca | rabinwill/C- | quicksort.cpp |
#include<stdio.h>
#include <array>
#include <iostream>
using namespace std;
void swap(int* a, int* b)
{
int t = *a;
*a = *b;
*b = t;
}
int partition(int arr[], int low, int high)
{
int pivot = arr[high];
int i = (low - 1); //index of smaller elemenet
//if current elemet is less than or equal to the pivot
fo... | ALGO | 0.999929 | 4.815232 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2018-03-08T04:33: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": "3b6bb50216... |
8414277a-61e5-43d9-ad42-15f8e87d302f | jatinsm2023/AlgoZenith-Phase-Day | Phase 2/Day 25/N-Queens Revisited.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
int n;
vector<int> a;
bool check(int row, int col)
{
for (int i = 0; i < row; i++)
{
if (a[i] == col || abs(i - row) == abs(a[i] - col))
return false;
if ((abs(i - row) * abs(i - row) + abs(a[i] - col) * abs(a[i] - ... | ALGO | 0.99999 | 4.51237 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2024-08-09T16:27: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": "897bbfcaebf... |
f31931fa-6f57-4744-aa32-7881b8e4dee7 | morynicz/face-thief | src/Tester.cpp | ///\file
///\brief Main file of program crossvalidating the algorithms
#include <iostream>
#include <opencv2/core/core.hpp>
#include <opencv2/objdetect/objdetect.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <vector>
#include <list>
#include <cmath>
#include <string>
#incl... | ALGO | 0.965275 | 4.527121 | {
"github_metadata": {
"branch": "master",
"commit_count": 104,
"repo_created_at": "2013-02-13T14:45:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 3,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "ccbb55f4... |
9c578ab7-5db4-4e1b-8282-45c2d27a5e04 | hyunynim/algorithm_archive | 2021Kakao/c.cpp | #include<bits/stdc++.h>
using namespace std;
vector<int> solution(vector<string> info, vector<string> query) {
vector<int> answer;
vector<int> score[3][8];
for (int i = 0; i < info.size(); ++i) {
char msg[4][22];
int sc;
sscanf(info[i].c_str(), "%s %s %s %s %d", msg[0], msg[1], msg[2], msg[3], &sc);
int lang... | ALGO | 0.999231 | 4.131343 | {
"github_metadata": {
"branch": "master",
"commit_count": 50,
"repo_created_at": "2020-05-06T12:53:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "052bf38aa... |
5a71b1fc-3d56-47d7-a523-ad7d0924ab9d | leocabbage2008/codez | usaco/alphastar/CC24/6.2/2/main.cpp | #include <iostream>
#include <cmath>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
int N;
cin >> N;
char dir[N];
int p[N];
for (int i = 0; i < N; ++i) cin >> dir[i] >> p[i];
int ans = N - 1;
for (int i = 0; i < N; ++i) {
int liars = 0;
for (int j ... | ALGO | 0.99989 | 3.384539 | {
"github_metadata": {
"branch": "master",
"commit_count": 38,
"repo_created_at": "2022-06-18T18:34: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": "529848da3... |
d0f4149d-e289-4381-bc82-470fea170be3 | bu1th4nh/Internal-Offline-Judge | Training/2018_L12/Thay Tung - 2018_12_10-12/2018_12_12/VX09_FIREWORKS/FIREWORKS.cpp | /*==========================================================================================*\
** _ _ _ _ _ _ _ **
** | |__ _ _/ | |_| |__ | || | _ __ | |__ **
** | '_ \| | ... | ALGO | 0.999689 | 3.434134 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2019-01-08T13:48: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": "71b8890682... |
0babead6-516f-4c41-a4b8-8f4e7c5fa73d | Mityai/contests | cf/educational-13/D.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll MOD = 1e9 + 7;
ll bp(ll x, ll n) {
if (n == 0) return 1LL;
ll b = bp(x, n / 2);
b = (b * b) % MOD;
if (n & 1) b = (b * x) % MOD;
return b;
}
int main() {
ll A, B, n, x;
cin >> A >> B >> n >> x;
ll part1 = (bp(A, n) * x) % ... | ALGO | 0.999973 | 4.888834 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2017-02-04T09:44:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "80468226c5... |
b197c23c-5491-4676-8819-2729585fe3ac | kjbartel/magma | control/spanel_to_q.cpp | /*
-- MAGMA (version 1.6.1) --
Univ. of Tennessee, Knoxville
Univ. of California, Berkeley
Univ. of Colorado, Denver
@date January 2015
@author <NAME>
@generated from zpanel_to_q.cpp normal z -> s, Fri Jan 30 19:00:20 2015
*/
#include "common_magma.h"
// -----------------... | ALGO | 0.975208 | 5.250226 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2015-06-04T17:28:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 23,
"forks": 3,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "c0733a51... |
6d90a02c-ec3c-42ac-9d18-0e1e6d545110 | google/monster-mash | third_party/libigl/include/igl/signed_distance.h | // This file is part of libigl, a simple c++ geometry processing library.
//
// Copyright (C) 2014 <NAME> <<EMAIL>>
//
// This Source Code Form is subject to the terms of the Mozilla Public License
// v. 2.0. If a copy of the MPL was not distributed with this file, You can
// obtain one at http://mozilla.org/MPL/2.... | ALGO | 0.999692 | 6.788914 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2021-01-28T21:04:52.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1312,
"forks": 182,
"issues": 24,
"pull_requests": 0
},
"file_meta": {
"content_id": "d73eac... |
e58cd5b2-0e7e-4f8a-ba54-012c0cbb8cce | overIsAC/contest | cf/600/665/e.cpp | #include <bits/stdc++.h>
using namespace std;
using LL = long long;
using PII = pair<int, int>;
#define lson (k << 1)
#define rson (k << 1 | 1)
#if LEMON
#define db(x) cout << "function " << __FUNCTION__ << ", line " << __LINE__ << " : " << #x << " " << x << endl;
#else
#define db(x)
#endif
const int mod = 7 + 1e9;
/... | ALGO | 0.999994 | 4.574928 | {
"github_metadata": {
"branch": "main",
"commit_count": 131,
"repo_created_at": "2022-10-30T18:24: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": "0ba30165df... |
6cbd59d1-a154-451d-ac33-e395327325ce | yukikamome316/competition-archive | src/ABC/ABC223/D.cpp | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (int)s; i < (int)(n); i++)
using namespace std;
using ll = long long;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T ... | ALGO | 0.999985 | 4.399158 | {
"github_metadata": {
"branch": "main",
"commit_count": 184,
"repo_created_at": "2023-05-10T00:53: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": "acf4dc43aa... |
a4b9429e-1f39-454d-a08c-9bdf01a52f0d | immrhrr/DSA_leetcode | 445-add-two-numbers-ii/add-two-numbers-ii.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
void Reverse(ListNode... | ALGO | 0.999992 | 6.110659 | {
"github_metadata": {
"branch": "main",
"commit_count": 1199,
"repo_created_at": "2024-12-30T17:50:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "93e5d0a65... |
82260e00-bec6-488f-9f5f-36b709febc61 | spaceOfSoul/baekjunSolve_c- | cpp_solve/6549/6549.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int n;
int arr[100000];
int tree[400000];
long long result;
int init(int start, int end, int node){
if(start == end){
return tree[node] = end;
}
int mid = (start+end)/2;
int left = init(start, mid, node*2);
int right = init(mid+1, end, node*2... | ALGO | 0.999897 | 4.200708 | {
"github_metadata": {
"branch": "main",
"commit_count": 75,
"repo_created_at": "2021-10-19T07:44: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": "207e2076574... |
70375d15-0e0d-488e-be8e-7c260a7ddcc4 | seedChen/leetcode | convertSortedListToBinarySearchTree/ans.cpp | /**
* @file ans.cpp
* @brief
* Given a singly linked list where elements are sorted in ascending order,
* convert it to a height balanced BST.
*
* @version
* @date 2015-06-29 15:08
* @author chen_juntao
* @email <EMAIL>
*/
#include <cstddef>
struct ListNode
{
int val;
ListNode *next;
ListNode(in... | ALGO | 0.99999 | 5.810204 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2015-08-14T08:22: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": "e41efec31d... |
48f07410-173f-476d-9d8e-a42abaab6102 | Feng-Jay/DataStruct | Chapter2_linearlist/linear_list_sequential.cpp | /*线性表的顺序实现*/
#include <iostream>
#include <new>
using namespace std;
const int List_size=100;
const int List_Size_Increment=10;
typedef int eletype;
typedef struct{
eletype *elem;
int len;
int listsize;
}SqList;
bool Init_List(SqList &L){
//为什么要传引用?
//因为Init函数只返回bool量,而非结构体,所以在把L传进去后L就会被销毁,导致内存... | ALGO | 0.998487 | 4.179996 | {
"github_metadata": {
"branch": "master",
"commit_count": 74,
"repo_created_at": "2021-05-16T15:17: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": "d20a10ec6... |
bac44cd3-ef6d-45a4-9733-0c9352d97b9c | HungNguyenBa1811/CTDLGT-PTIT-2024 | 189.PhepToanCoBan.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define ed "\n"
#define use(x) freopen(x".inp", "r", stdin); freopen(x".out", "w", stdout);
#define BidenJr 0
int x_4axis[] = {-1, 0, 0, 1};
int y_4axis[] = {0, -1, 1, 0};
int x_8axis[] = {-1, -1, -1, 0, 0, 1, 1, 1};
int y_8axis[] = {-1, 0, 1, -1, 1, -... | ALGO | 0.999906 | 3.654523 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2024-10-07T11:13:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "735358a970de... |
6451cba2-b641-4bd9-b322-c58be653c037 | pavan-k-teja/DSA-Journey | Graphs/shortestPaths/shortest_path_in_DAG.cpp |
#include <bits/stdc++.h>
using namespace std;
// DAG can be represented as a linear graph with no back edges
// https://media.geeksforgeeks.org/wp-content/uploads/shortestpathsteps.png
/*
Time Complexity -> O ( V + E )
*/
void findTopoSort(int node, int vis[], stack<int> &st, vector<pair<int, int>> adj[])
{
vi... | ALGO | 0.999982 | 4.447596 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2022-08-17T02:10: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": "b7e76eae00... |
ce96e7b6-77d1-4d92-83f4-aec655e1262f | Harshit9670/CPP | 15_a_twopointer.cpp | // Sort an array consist of only 0s and 1s
// #include<iostream>
// #include<vector>
// using namespace std;
// void sort_zero(vector<int> &v){
// int ele,zero=0;
// for(int ele:v){
// if(ele==0){
// zero++;
// }}
// for(int i=0;i<v.size();i++){
// if(i<zero)
// {
// v[i]... | ALGO | 0.999991 | 4.721144 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2025-05-05T17:34:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cbbe4086f041... |
3d928100-284c-4e2d-b780-a41a6817aac9 | memento3525/BaekJoon | 백준/Gold/2342. Dance Dance Revolution/Dance Dance Revolution.cc | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
const int INF = 1e9;
int energy[5][5] =
{
{ 0, 2, 2, 2, 2 },
{ 0, 1, 3, 4, 3 },
{ 0, 3, 1, 3, 4 },
{ 0, 4, 3, 1, 3 },
{ 0, 3, 4, 3, 1 }
};
int n;
int p[100001];
int dp[100001][5][5];
int Go(int here, int a, int b)
{
... | ALGO | 0.999954 | 3.867231 | {
"github_metadata": {
"branch": "main",
"commit_count": 999,
"repo_created_at": "2023-01-20T02:57: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": "b9f81ed2fc... |
ca1ffe4c-04bd-4f9a-babd-a439eebd509e | SoulDeplane/DAA | Week 4/Q2.cpp | /*Given an unsorted array of positive integers, design an algorithm and implement it using a program to find whether there are any duplicate elements in the array or not. (use sorting) (Time Complexity = O(n log n)) */
#include <iostream>
using namespace std;
int part(int *a, int l, int r, int *c, int *s)
{
int p=a... | ALGO | 0.999713 | 4.457278 | {
"github_metadata": {
"branch": "main",
"commit_count": 25,
"repo_created_at": "2025-02-16T13:21:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e534ceda28d... |
3eb131d3-e13a-450a-a1e4-98c5067faf79 | ishandutta2007/codeforces-d | dmitrygrigorev/normal/1375/F.cpp | #include <bits/stdc++.h>
#define int long long
#define db long double
#define x first
#define y second
#define mp make_pair
#define pb push_back
#define all(a) a.begin(), a.end()
using namespace std;
int read() {
int x;
cin >> x;
if (x==0) exit(0);
return x - 1;
}
bool good(vector<int> &v, int last) {
if (v[... | ALGO | 0.999942 | 3.309468 | {
"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": "8a5ac0ca734d... |
795f22f7-86c0-40d8-be5a-cca6e85377b8 | PaulReisenberg/Algorithms-Lab-2024 | 2024/week07/germs/src/main.cpp | #include <iostream>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Delaunay_triangulation_2.h>
#include <queue>
#include <CGAL/Triangulation_vertex_base_with_info_2.h>
#include <algorithm>
using namespace std;
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef CGAL:... | ALGO | 0.999784 | 3.5332 | {
"github_metadata": {
"branch": "main",
"commit_count": 89,
"repo_created_at": "2024-10-06T15:48: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": "7130986e5f9... |
c9da4911-f4a9-4325-b83e-7f70a9500d60 | Abdullah-Asif/Codeforces | CodeForces/CF-1272C.cpp | #include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
typedef long long ll;
int main() {
//freopen("input.txt","r",stdin);
//freopen("output.txt","w",stdout);
int n, k;
cin >> n >> k;
string s;
cin >> s;
bool valid[26];
for (int i... | ALGO | 0.99999 | 3.497405 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2021-04-06T09:09:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2d9c7116975... |
6fbfa69c-3bbe-457f-904c-e483d4738e89 | Aarongr73/TareaP1 | Denisse_Prueb/arreglopuntp.cpp | #include "arreglopuntp.h"
int NodoNulo=-1;
Arbol::Arbol(){
PonerRaiz(' ');
Arreglo[0].nodoPadre = 0;
numNodos = 1;
}
void Arbol::Crear(){
Arbol arbol=Arbol();
}
void Arbol::Vaciar(){
Arreglo[NumElem()].nodoPadre = 0;
numNodos = 0;
}
bool Arbol::Vacio(){
if (Arreglo[NumElem()].nodoPadre... | ALGO | 0.999067 | 3.29053 | {
"github_metadata": {
"branch": "master",
"commit_count": 45,
"repo_created_at": "2017-10-03T00:02: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": "3347989f0... |
c67a9788-5120-4030-8e4d-e3467f7d6733 | TalhaF101/OOP-_-1 | practice.cpp | #include <iostream>
using namespace std;
#include <string>
class Employee {
private:
string name;
int id;
char gender;
public:
void setName(string n) {
name = n;
}
void setId(int i) {
id = i;
}
void setGender(char g) {
gender = g;
}
string getName()... | TOOL | 0.958168 | 5.511702 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2024-02-22T06:10: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": "61fef66d81... |
3231212d-3b04-4073-9850-69ff9c43a917 | tinhngovnptho/Code | CP/Code THPT/DTQG 25/ThinhGiang 25/Thay Thuan/OCT/landslide.cpp | /*
Author: Tinhnopro (<NAME>)
From: CHV Phu Tho
*/
#include<bits/stdc++.h>
namespace std {
// optimize min max
template<typename T1, typename T2> bool maximize(T1 &a, T2 b) { return a < b ? a = b, 1 : 0; }
template<typename T1, typename T2> bool minimize(T1 &a, T2 b) { return a > b ? a = b, 1 : 0; }
// vector
... | ALGO | 0.999584 | 3.996208 | {
"github_metadata": {
"branch": "main",
"commit_count": 25,
"repo_created_at": "2024-10-13T07:51: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": "d3850337900... |
4cb27b87-aa65-445e-b37d-ff9ec1c09670 | jeevan-2007/OOps-lab- | lab8/5.cpp | /*Matrix operations are fundamental in many computational problems, including computer graphics, simulations, and data transformations. In this task, you will develop a Matrix2x2 class that represents a 2x2 matrix with integer elements. The class should support standard matrix operations such as addition, subtraction, ... | TOOL | 0.994602 | 7.28955 | {
"github_metadata": {
"branch": "main",
"commit_count": 28,
"repo_created_at": "2025-01-25T10:13: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": "65b9386a734... |
ef5fd0b3-ccae-4b5a-8a03-f4e4ba9d8d06 | Upsurge-11/DSA | Leetcode/CPP/minimumInsertionStepsToMakeAStringPalindrome.cpp | #include <bits/stdc++.h>
using namespace std;
int minInsertions(string s)
{
int n = s.size();
int dp[n][n];
memset(dp, 0, sizeof(dp));
for (int i = 0; i < n; i++)
dp[i][i] = 1;
for (int i = 0; i < n - 1; i++)
{
if (s[i] == s[i + 1])
dp[i][i + 1] = 2;
else
dp[i][i + 1] = 1;
}
fo... | ALGO | 0.999941 | 4.045039 | {
"github_metadata": {
"branch": "main",
"commit_count": 311,
"repo_created_at": "2022-08-20T14:09: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": "262af57288... |
db15d0bc-51ac-44f6-a3bb-04f4b40f11a6 | agalin1/OpenMP | A01793927_algorparalelos/A01793927_algorparalelos/A01793927_algorparalelos.cpp | // A01793927_algorparalelos.cpp : Este archivo contiene la función "main". La ejecución del programa comienza y termina ahí.
//
#include <stdio.h>
#include <stdlib.h>
#include <omp.h>
#define ARRAY_SIZE 1000
void realizaSumaArray(int *A, int *B, int *C, int size) {
#pragma omp parallel for
for (int i = 0; i < size;... | ALGO | 0.999596 | 4.978438 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-01-27T14:46: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": "972b195e5971... |
7edd820a-54e8-4848-bdff-b775aef80e83 | Xabibax/DUT-Info | S1/M1102-Introduction_à_l_Algorithmique_et_à_la_Programmation/TP5/RepresentationEtManipulationDeDate/main.cpp | /*
Programme : RepresentationEtManipulationDeDate
But : Déterminer la date la plus ancienne parmi deux dates prédéfinies.
Date de création : 15/10/15
Date de dernière modification : 11/11/15
Auteur : <NAME>
Dernière compilation : Linux
*/
#include <iostream>
using namespace std;
int main()
{
// VARIABLES
... | ALGO | 0.934293 | 4.002441 | {
"github_metadata": {
"branch": "master",
"commit_count": 138,
"repo_created_at": "2016-11-05T16:59:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4711c3d4... |
870f104e-3a54-4873-9039-0670a7741204 | marcoskwkm/code | Contests/Yandex Algorithm/2016/Round 1/E/e.cpp | #include <bits/stdc++.h>
using namespace std;
#define debug(args...) fprintf(stderr,args)
typedef long long lint;
typedef pair<int, int> pii;
typedef pair<lint, lint> pll;
const int INF = 0x3f3f3f3f;
const lint LINF = 0x3f3f3f3f3f3f3f3fll;
const int MAXN = (int)1e6 + 10;
int v[MAXN];
int main() {
int n, m;
... | ALGO | 0.999958 | 3.262562 | {
"github_metadata": {
"branch": "master",
"commit_count": 399,
"repo_created_at": "2016-04-27T23:39:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "3dd5e639... |
a0d251d4-5535-4de5-a2b4-5255f4c723c1 | AlexSias18/Asignacion16 | Ejercicio 9.cpp | #include <iostream>
#include <conio.h>
#include <stdio.h>
using namespace std;
bool FechaEsValida(int dia, int mes, int annio) {
bool verificador;
if (annio % 400 == 0)
{
cout << "Es un aņo Bisiesto";
}
else
{
if (annio % 4 == 0 && annio % 100 != 0)
{
cout << "Es un aņo Bisiesto"<<endl;
}
else
... | ALGO | 0.971399 | 3.343747 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-05-23T01:40: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": "2953c96732... |
8084c80d-f5a4-4962-a27b-4f909312e71a | CAEL0/algorithm | ternary_search.cpp | // BOJ 8986 전봇대
#include <bits/stdc++.h>
#define sz size()
#define bk back()
#define fi first
#define se second
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
ll f(ll k, vector<int> &v) {
ll ret = 0;
ll x = k;
for (int i = 1; i < v.sz; i++) {
ret += abs(v[i] - x);
... | ALGO | 0.99997 | 4.384696 | {
"github_metadata": {
"branch": "main",
"commit_count": 928,
"repo_created_at": "2021-07-01T05:45: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": "2e94174bda... |
6f2eb0f3-efbc-4776-97c1-7be2bf616bde | ToruTakefusa/AtCoder | AGC011/A/main.cpp | #include <iostream>
#include <algorithm>
using namespace std;
size_t GetCountWithinK(int t[], int k, int start_index, int size);
int main() {
size_t n;
int c, k;
cin >> n >> c >> k;
int t[n];
for (size_t i = 0; i < n; ++i) {
cin >> t[i];
}
sort(t, t+n);
int count = 0;
fo... | ALGO | 0.999959 | 4.34273 | {
"github_metadata": {
"branch": "master",
"commit_count": 60,
"repo_created_at": "2019-11-16T12:09: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": "c87513067... |
cede5869-1346-44ec-ab90-bc6b133be6db | michaeljecmen/bonus-lab | shared.cpp | #include <iostream>
#include <memory>
#include <vector>
using namespace std;
struct Item {
Item(int x_) : x(x_) { cout << "item " << x << " created" << endl; }
~Item() { cout << "item " << x << " destroyed" << endl; }
int x;
};
vector<shared_ptr<Item>> items;
shared_ptr<Item> process_item() {
auto t... | TOOL | 0.977435 | 5.646345 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2021-12-15T16:40: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": "3fc1f46525... |
ccfa3c69-bbfa-414c-8ce6-829f50421db5 | Kawser-nerd/CLCDSA | Source Codes/CodeJamData/16/51/18.cpp | #include <bits/stdc++.h>
using namespace std;
const int M = 20200;
const int inf = 100 * M;
string s;
int n;
int D[2][M], H[2][M];
void read() {
cin >> s;
n = s.length();
}
void uax(int &a, int b) {
a = max(a, b);
}
void kill() {
auto d = D;
auto h = H;
for (int t = 0; t < 2; ++t)
for (int i = 0;... | ALGO | 0.99993 | 3.800335 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2019-09-30T05:38:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 22,
"forks": 8,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "0e91a900... |
4453042a-bb7f-42fc-8cbe-791f7a57915f | SadieSv/demorpheus | racewalk/racewalkDetect.cpp | #include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <iostream>
#include <time.h>
#include "i386-dismod.h"
#include "bfd.h"
#include "racewalk.h"
#include <setjmp.h>
#define MAX_LEN 256
void printHelp()
{
std::cerr<< "usage: ./racewalkDetect <path_to file> MODE <nop_length> \n"
<... | TOOL | 0.934354 | 3.927483 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2012-07-06T16:40:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 7,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5e3c5473d8... |
0d8f5873-607b-48bd-a1de-563c0137f4dc | shreshiv123/Leetcode | Print Anagrams Together - GFG/print-anagrams-together.cpp | //{ Driver Code Starts
//Initial Template for C++
#include <bits/stdc++.h>
#include <unordered_map>
using namespace std;
// } Driver Code Ends
//User function Template for C++
class Solution{
public:
vector<vector<string> > Anagrams(vector<string>& sl) {
//code here
vector<string> temp... | ALGO | 0.999959 | 5.655483 | {
"github_metadata": {
"branch": "main",
"commit_count": 155,
"repo_created_at": "2023-04-24T15:34: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": "e2ac329a27... |
48e20512-e636-4d35-bce3-c9f2ec175b91 | migue99angel/ED | Teoria/Relacion de ejercicios de pilas y colas/ejercicio10.cpp | /*
10. Un tipo ventana es un tipo de dato que permite insertar un elemento, mover derecha, mover
izquierda, borrar elemento y que se implementa usando dos pilas. Implementa ese tipo de
dato con las operaciones comentadas.
*/
/*
@author <NAME>
*/
//g++ -o ejercicio10 ejercicio10.cpp
#include <iostream>
#include <stack... | ALGO | 0.991165 | 4.262372 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2018-10-26T09:45:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "43fb6256c... |
f1597b34-db16-49ae-a923-f3664e8e1506 | juanlee01/baekjoon_prac | baekjoon2738.cpp | #include <iostream>
#include <string>
#include <vector>
#include <sstream>
using namespace std;
vector<string> split(string input, char dlim)
{
vector<string> result; // 분리한 문자열들을 저장하는 vector
stringstream ss; // stringstream 객체인 ss 선언
string stringBuffer; // stringstream에서 문자열 자를 때마다 임시로 저장하는 변수
ss.str(input); ... | ALGO | 0.999769 | 4.223237 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2025-01-18T09:28: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": "1f17433e36a... |
9e702318-ff52-40b6-93ed-006c7b26c53f | endeavors/Binary-Tree-Generic | BST.hpp | /*******************************************************************/
/* Name: <NAME>
* Description: This program is an implementation of the binary search
* tree. It includes the find, clear, and insert methods
* that follow the binary search tree principles. An
* it... | ALGO | 0.998393 | 5.291075 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2015-12-24T23:28:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "738b8c7285... |
d0ff2639-f413-4106-b639-8efb35f7e12e | Dflybird/MDP | MDP/matrix.cpp | #include <stdio.h>
#include <stdlib.h>
#include "matrix.h"
int InitialMatrix(Matrix *matrix, int row, int column) {
int i;
int status = 1;
matrix->column = column;
matrix->row = row;
matrix->mat = (double **)malloc(row * sizeof(double *));
if (matrix->mat == NULL)
status = -1;
else
{
for (i = 0; i < row; ... | ALGO | 0.999011 | 3.93768 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2018-07-27T04:50:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bbbeaddf3c... |
9c925f2f-822a-4a35-b736-73d282ef7ce4 | Atharva961/LeetCode-submissions | Subarray with given sum - GFG/subarray-with-given-sum.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
public:
//Function to find a continuous sub-array which adds up to a given number.
vector<int> subarraySum(vector<int>arr, int n, long long s)
{
long long beg = 0, end = 0, sum = 0;
... | ALGO | 0.999759 | 5.686774 | {
"github_metadata": {
"branch": "main",
"commit_count": 845,
"repo_created_at": "2022-12-30T16:27:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6c10f2607e... |
66b79e44-427e-46ef-9f2f-658f225be933 | lccatala/OpenGL3DRendering | PGUPV/utils.cpp |
#include <cctype>
#include <algorithm>
#include <iterator>
#include <fstream>
#include <sstream>
#include <iomanip>
#include <string.h>
#ifdef _WIN32
#pragma warning( push)
#pragma warning( disable : 4505)
#endif
#include <dirent.h>
#ifdef _WIN32
#pragma warning(pop)
#endif
#include <regex>
#include <string>
#include... | TOOL | 0.959573 | 3.308667 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2022-08-22T12:05:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "306704324c69... |
8be67c93-dd15-4f44-8ffd-ccc5d1bef9f0 | alexandraback/datacollection | solutions_5670465267826688_0/C++/zizhong/test.cpp | #include <vector>
#include<cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <string>
#include <map>
#include <deque>
#include <set>
#ifdef __GXX_EXPERIMENTAL_CXX0X__
#include <unordered_map>
#include <unordered_set>
#include <cassert>
#endif
#include <ctime>
#include <queue>
#include <stack>... | ALGO | 0.999915 | 3.780118 | {
"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": "a667fb05e... |
9178f15a-c8dc-4486-a95b-a4634244f2f8 | ZTZEROS/ProjectEuler | Problem9.cpp | /*
#include <iostream>
#include <map>
using namespace std;
int a = 0, b = 0, c = 0;
void main()
{
for (int a = 0; a < 500; ++a)
{
for (int b = 0; b < 500; ++b)
{
for (int c = 0; c < 500; ++c)
{
if ((a * a + b * b) == c * c)
{
//cout << a << ", " << b << ", " << c << endl;
if ((a + b + ... | ALGO | 0.999211 | 3.150186 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2019-02-25T10:05:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "67b5ed1592... |
4f861d34-5bf7-403e-88cb-ded880ae3058 | SarthakRawat-1/dsa | String/orderlyQueue.cpp | // Problem Statement :- https://leetcode.com/problems/orderly-queue/description/
// Take any string, for eg :- "baaca" If we are given freedom to choose any two characters and swap them. With this, we can sort any string.
// Consider eg :- "ceabd" and k = 2, now try to use the logic given above. Say, we want to swap ... | ALGO | 0.999996 | 6.874153 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2025-03-16T07:11: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": "aa2176f712c9... |
01042c9f-59a1-453c-bb84-069d12c3ba6d | yjdong9697/Baekjoon-practice_cpp | baekjoon_12837.cpp | #include <bits/stdc++.h>
#define fastio ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
using namespace std;
typedef long long ll;
ll seg[4000000];
void update(int node_index, int node_left, int node_right, int index, ll value){
if(index < node_left || node_right < index) return; // Out of Bound
seg[no... | ALGO | 0.999774 | 4.901721 | {
"github_metadata": {
"branch": "master",
"commit_count": 565,
"repo_created_at": "2020-07-23T15:44: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": "0f3eef42... |
3594b203-740a-4bd4-bf65-ab4e0442ea84 | aaiss0927/Tutoring_DataStructure | 24실습/Week_2/Week_2_3.cpp | #include <iostream>
using namespace std;
class Node {
private:
int value;
Node* next;
public:
Node(int value) {
this->value = value;
next = nullptr;
}
friend class SinglyLinkedList;
};
class SinglyLinkedList {
private:
Node* head;
Node* tail;
int list_size;
public:
SinglyLinkedList() {
head = tail =... | ALGO | 0.99899 | 4.58488 | {
"github_metadata": {
"branch": "main",
"commit_count": 171,
"repo_created_at": "2024-03-20T13:28: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": "34b78a63da... |
40dc15ea-57f9-4459-9ba1-da659bb9781a | mdahtotul/phitron_course | LeetCode problem set/01_Two_Sum.cpp | // https://leetcode.com/problems/two-sum/
#include <bits/stdc++.h>
using namespace std;
class Solution {
public:
vector<int> twoSum(vector<int>& nums, int target) {
vector<int> ans(2);
unordered_map<int, int> hash_table;
for (int i = 0; i < nums.size(); i++) {
auto it = hash_table.find(target - nu... | ALGO | 0.999886 | 6.277389 | {
"github_metadata": {
"branch": "main",
"commit_count": 106,
"repo_created_at": "2022-10-29T18:59:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "658056eba5... |
acbd2295-b0e3-4859-b185-221ba741eb00 | rjenez/W266-final-project | data/programming-homework-dataset-plagiarism-detection/src/B2017/Z5/Z6/student8412.cpp | /B2017/2018: Zadaća 5, Zadatak 6
#include <iostream>
#include<string>
#include<vector>
#include<stdexcept>
#include<map>
#include<algorithm>
#include<functional>
#include<iomanip>
class Berza
{
int min,max;
std::vector<int> v;
public:
Berza(int min1,int max1) {
if(min1<0 or max1<0) throw std::range_... | TOOL | 0.929568 | 4.287683 | {
"github_metadata": {
"branch": "main",
"commit_count": 125,
"repo_created_at": "2022-02-09T00:45:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "35c7d2e84e... |
a8b11e13-6c45-41e4-bb61-29af6b423005 | nafi103/Solved-Problems | Practice/2025/May/J_Simple.cpp | #include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace chrono;
using namespace __gnu_pbds;
/****************************************************************/
#define int long long
#define pi acos(-1.0)
const int mod = 998244353;
#defin... | ALGO | 0.999976 | 4.683574 | {
"github_metadata": {
"branch": "main",
"commit_count": 224,
"repo_created_at": "2024-09-04T14:52: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": "43f42a4a1c... |
57ba7113-2c28-4a22-ac01-e115578caf96 | 8emi95/elte-ik-prog | bead/prog_bead1_minta/gt/hf1/naplo.cpp | //Készítette: <NAME>
//Dátum: 2009.01.23.
//eha kód: EHACODE.ELTE
//mail: <EMAIL>
//csoport: 0.csoport
//Feladat: Van-e minden tanulónak legalább két tantárgyból ötöse
#include <iostream>
#include <cstdlib>
#include <fstream>
#include <string>
#include <vector>
#include "read.h"
... | TOOL | 0.908851 | 3.938816 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-03-16T16:50: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": "9965301f0d... |
cc6b71b3-7d80-459a-964c-f5423a812c81 | sonkey/leetcode_solve | 190.reverse_bits.cc | /*
Reverse bits of a given 32 bits unsigned integer.
Example 1:
Input: 00000010100101000001111010011100
Output: 00111001011110000010100101000000
Explanation: The input binary string 00000010100101000001111010011100 represents the unsigned integer 43261596, so return 964176192 which its binary representation is 001... | ALGO | 0.999788 | 5.878472 | {
"github_metadata": {
"branch": "v0.1",
"commit_count": 15,
"repo_created_at": "2018-08-12T15:34: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": "d06b237e34f... |
e13fd785-a77b-4997-ba74-6b2a8430238e | liuyubobobo/Play-Leetcode | 2501-3000/2502-Design-Memory-Allocator/cpp-2502/main2.cpp | /// Source : https://leetcode.com/problems/design-memory-allocator/description/
/// Author : liuyubobobo
/// Time : 2022-12-15
#include <iostream>
#include <list>
#include <vector>
using namespace std;
/// Using LinkedList
/// Time Complexity: init: O(1)
/// allocate: O(n)
/// fr... | ALGO | 0.998108 | 5.7235 | {
"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": "f4... |
fbf0704e-ad93-4e79-8a36-a047a7b2e4d5 | rayyy100/dailycodes1 | OWwlhosue.cpp | #include<iostream>
using namespace std;
int main() {
//variables to hold onto each princess' score:
int Luz = 0;
int Amity = 0;
int Eda = 0;
int King = 0;
cout << "Welcome to the Owl House quiz!" << endl;
//question 1
char choice;
cout << "What's your favorite color?" << endl;
cout << "(p)urple" << endl... | TOOL | 0.963167 | 3.019216 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2021-09-30T18:42: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": "5858058e67c... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.