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 |
|---|---|---|---|---|---|---|---|
49b6932a-fb23-4e36-a592-f2f15e44bd4b | ishandutta2007/codeforces-k | khuepr123/normal/1528/B.cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back
#define fi first
#define se second
#define endl "\n"
#define ii pair<int, int>
#define PI 3.141592653589793238462643383279502884
#define ll long long
#define for1(i, ff, gg) for(int i = ff; i <= gg; ++i)
#define for2(i, ff, gg) for... | ALGO | 0.999987 | 4.331668 | {
"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": "10887dfadcb1... |
2cd8492f-95c4-45c1-aac0-4a4a6619e5f3 | kririae/Learning | Algorithms/最终集训/51nod1588 幸运树 - 树形dp.cpp | #include <bits/stdc++.h>
#define ll long long
using namespace std;
struct IO {
char ibuf[1 << 18], *s, *t, obuf[1 << 18], *o, vbuf[65];
IO() : s(ibuf), t(ibuf), o(obuf) {}
~IO() { fwrite(obuf, 1, o - obuf, stdout); }
inline char gc() {
(s == t) && (t = (s = ibuf) + fread(ibuf, 1, 1 << 18, stdin));
retu... | ALGO | 0.999773 | 3.985755 | {
"github_metadata": {
"branch": "master",
"commit_count": 829,
"repo_created_at": "2017-06-21T14:30:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 1,
"issues": 18,
"pull_requests": 1
},
"file_meta": {
"content_id": "5e25d30... |
5c200370-e6c2-4375-a947-8c4bbb5fe12b | yoonjaehee/STL-algorithm | src/implementation/bak12100.cpp | #include <iostream>
#include <string.h>
#include <vector>
#include <queue>
using namespace std;
int n,mx,temp;
vector<int> res;
priority_queue<int> pq;
void dfs(vector<vector<int>> tem,int count){
vector<vector<int>> temp;
temp = tem;
//위로 이동
if(count>4){
pq.push(mx);
return;
}
... | ALGO | 0.999956 | 3.327238 | {
"github_metadata": {
"branch": "master",
"commit_count": 253,
"repo_created_at": "2021-11-07T15:11:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fa702843... |
403292bc-cd63-488b-8604-c40ffc479186 | ishandutta2007/codeforces-a | amnesiac_dusk/normal/348/D.cpp | /*
* Roses are red
* Violets are blue
* I cried
* And so did you
*/
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
#ifndef rd
#define endl '\n'
#endif
#define pb push_back
#define fi first
#define se second
//#define int long long
//typedef... | ALGO | 0.999849 | 4.053961 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-04-11T00:51: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": "5671af7fe327... |
7d049638-afea-4fd6-a315-d213c3619e68 | GrzegorzPodwika/Laboratorium04_02 | lab04_02/libONP.cpp | #include "pch.h"
#include "libONP.h"
#include <iostream>
#include <string>
#include <cstring>
#include <stack>
#include <Windows.h>
using namespace std;
void loadCorrectFileName(char *fileName)
{
cin >> fileName;
int nameLength = strlen(fileName);
bool flag = false;
for (int i = 1; i <= 3; i++)
{
if (i == 3) {... | TOOL | 0.974553 | 3.703002 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-04-24T19:12: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": "bc8866b1c2... |
ab355835-826e-473d-b077-1c3915eaf03e | emilyju0314/gpt_code_plagiarism | dataset/code_content_classifier/ai_code/train/0_0_7803.cpp | #include <iostream>
#include <vector>
using namespace std;
int main() {
int n;
cin >> n;
vector<int> castleX, castleY;
for (int i = 0; i < n; i++) {
int a, b, c, d;
cin >> a >> b >> c >> d;
castleX.push_back(a);
castleX.push_back(c);
castleY.push_back(b);
... | ALGO | 0.999855 | 3.870904 | {
"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": "6bca7b684af... |
2f8706e9-a681-4c23-b1dc-81575ec78aa0 | ishandutta2007/codeforces-a | artyom123/normal/1353/E.cpp | #include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define pb emplace_back
#define all(x) (x).begin(), (x).end()
const int INF = 1e9 + 1;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int t;
cin >> t;
while (t--) {
int n, k;
... | ALGO | 0.999938 | 4.180889 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-04-11T00:51: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": "1d46c3e07e53... |
fb2aafff-4b6d-4626-9c33-d12659dd3a45 | Aditya3042off/DSA-daily-practice | greedy/policeAndThieves.cpp | // // https://www.geeksforgeeks.org/policemen-catch-thieves/
// Given an array of size n such that each element contains either a 'P' for policeman or a 'T' for thief. Find the maximum number of thieves that can be caught by the police.
// Keep in mind the following conditions :
// Each policeman can catch only one t... | ALGO | 0.999965 | 5.083179 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2022-02-03T04:20:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "21becb4ac... |
0e1a0a6c-0315-47dd-9425-48552b9dbdbb | PrincetonUniversity/athena | src/pgen/poisson.cpp | //========================================================================================
// Athena++ astrophysical MHD code
// Copyright(C) 2014 <NAME> <<EMAIL>> and other code contributors
// Licensed under the 3-clause BSD License, see LICENSE file for details
//=====================================================... | ALGO | 0.971258 | 5.214171 | {
"github_metadata": {
"branch": "main",
"commit_count": 5233,
"repo_created_at": "2014-05-02T16:11:56.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 270,
"forks": 152,
"issues": 24,
"pull_requests": 4
},
"file_meta": {
"content_id": "22a5e... |
7a720c9f-6262-4767-8e24-01c80c3c871d | Hayabusa1601/Atcoder-codes | abc186/b/main.cpp | #include <bits/stdc++.h>
#define MOD 1e9 + 7
#define PI 3.141592653589793238
#define pb push_back
#define ALL(V) (V).begin(), (V).end()
#define FOR(i, a, b) for(int i = (a); i < (b); ++i)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long long int lint;
typedef vector<ll> VL;
typede... | ALGO | 0.999972 | 3.867247 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2020-06-13T13:05: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": "5f1c894e8... |
128cacf1-b01d-4661-8c8e-d097b39256e2 | DigvijayMane21/cpp_programming | Cpp. max & min number.cpp | #include<iostream>
/* max number finding
using namespace std;
int main()
{
int n;
cout<<"Enter size:";
cin>>n;
int arr[n];
cout<<"Enter "<<n<<" inputs:"<<endl;
for(int i=0;i<n;i++)
{
cin>>arr[i];
}
int max=arr[0];
for(int i=0;i<n;i++)
{
if(arr[i]>max)
... | ALGO | 0.993662 | 3.025308 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-08-13T14:12: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": "3017107733d2... |
5e7419b2-556c-48b4-aa9f-0782e3ae5da4 | ytia001/leetcode-practice | LeetCode/1161. Maximum Level Sum of a Binary Tree/MaxLevelSum.cpp | #include <queue>
#include <iostream>
using namespace std;
//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, T... | ALGO | 0.999957 | 5.309577 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-01-12T04:06:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "97e93303b0f0... |
8831d4d8-b4e2-4c13-9f67-60a9e2f1302a | alexandraback/datacollection | solutions_5631572862566400_0/C++/Hezhu/C.cpp | #include <cstdio>
#include <algorithm>
using namespace std;
int F[1000];
bool incir[1000];
int loopsize[1000];
int mxlen[1000];
int main()
{
int T;
scanf("%d", &T);
for (int kase = 1; kase <= T; ++kase)
{
int N;
scanf("%d", &N);
for (int i = 0; i < N; ++i)
{
scanf("%d", &F[i]);
--F[i];
}
int an... | ALGO | 0.99985 | 3.714655 | {
"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": "c10acb7fa... |
8b352aba-62ac-4e81-aeb1-fe71fe244d32 | minhoteam-msl/minho_team_ros | ai_node/src/rdefender.cpp | #include "rdefender.h"
#define distFromBall 1.0
#define parkingDist 0.2
/* What rSTRIKER Does:
Parking - Goes to parking spot 2
Own Kickoff - Receives the ball passed by rSUPSTRIKER
Their Kickoff - Stays midfield
Own Freekick - Received the ball passed by rSUPSTRIKER and shoots if possible
Their Freekick - Stays betwe... | TOOL | 0.988025 | 5.43164 | {
"github_metadata": {
"branch": "master",
"commit_count": 287,
"repo_created_at": "2016-09-18T01:53:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "97f3fdfb... |
f60cbcf7-8f6f-4b01-add4-e4c5c82cd139 | AnKra/advent-of-code-2022 | 03/include/solution.h | #ifndef ADVENT_OF_CODE_2022_03_SOLUTION_H_
#define ADVENT_OF_CODE_2022_03_SOLUTION_H_
#include <cassert>
#include <fstream>
#include <map>
#include <numeric>
#include <string>
#include <vector>
#include <common/load_input.h>
namespace day03 {
static char commonChar(const std::string &s1, const std::string &s2) {
... | ALGO | 0.999329 | 6.186859 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2022-12-01T21:25: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": "bc0b5bbb98... |
6e764226-251c-40a6-94f8-0b0c58c18750 | ThuyTTT96/Bi-Intra-prediction-for-compressive-sensing-images | libraries/Single-Core L-1 Minimization Lib in C/util/matlab_blas_wrappers.cpp | // Wrappers around some of the BLAS routines that ship with MATLAB.
//#include "/usr/local/bin/MATLAB_R2009a/extern/include/blas.h"
//#include "/usr/local/bin/MATLAB_R2009a/extern/include/lapack.h"
//#include "/Applications/MATLAB_R2009b.app/extern/include/blas.h"
//#include "/Applications/MATLAB_R2009b.app/extern/inc... | TOOL | 0.90326 | 6.06795 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2021-08-02T06:38:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "743198262c05... |
e96aa9e0-7ed7-42fa-9ff9-d2f547b6064c | sipah00/Educational_DP_Contest_Atcoder | candies_m.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int mod = 1e9 + 7;
int n, k;
vector<ll> a;
vector<ll> dp;
int main(){
cin>>n>>k;
a.resize(n+1); dp.resize(k+1);
for(int i = 1; i <= n; i++){
cin>>a[i];
}
dp[0] = 1;
for(int i = 1; i <= n; i++){
vector<l... | ALGO | 0.999995 | 4.776696 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2020-01-21T12:28:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "79cd3487d7... |
e573ad7c-4bba-49c6-898d-950fef01c5ec | marioyc/Online-Judge-Solutions | ZOJ/3229 - Shoot the Bullet.cpp | #include <cstdio>
#include <climits>
#include <algorithm>
using namespace std;
struct flow_graph{
int V,E,s,t;
int *flow,*low,*cap,*to,*next,*last,*delta;
int *dist,*q,*now,head,tail;
flow_graph(){}
flow_graph(int V, int E){
(*this).V = V; (*this).E = 0;
int TE = 2*(E+V+1... | ALGO | 0.999752 | 3.426387 | {
"github_metadata": {
"branch": "master",
"commit_count": 364,
"repo_created_at": "2010-09-24T16:07:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 603,
"forks": 359,
"issues": 1,
"pull_requests": 9
},
"file_meta": {
"content_id": "a151... |
c22bc226-1fa7-4fbf-8d79-67a8eee3bda7 | AhmadOsama4/Competitive-Programming | Codeforces/CF - 879B - Table Tennis.cpp | #include <bits/stdc++.h>
using namespace std;
#define sz(v) ((int)v.size())
#define ll long long
#define all(v) (v.begin()) , (v.end())
#define rall(v) (v.rbegin()) , (v.rend())
int arr[5005];
int main ()
{
//freopen("input.txt", "r", stdin);
int n, k;
... | ALGO | 0.99999 | 3.790735 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2017-12-23T20:59:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fe41b41a8d... |
1da2fa5d-f22a-48f7-a2b8-9bc8a8771e78 | KhoiBui16/28Tech_Code_Online | C++/Source Code C++ Contest/KieuDuLieu,BienVaToanTu/Bai6_LuyenTapVietCauDieuKien.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n ; cin >> n;
// dieu kien 1
if(n % 2 == 0) cout << "YES" << endl;
else cout << "NO" << endl;
// dieu kien 2
if(n % 3 == 0 && n % 5 == 0) cout << "YES" << endl;
else cout << "NO" << endl;
// dieu kien 3
if(n % 3 == 0 && ... | ALGO | 0.999814 | 3.268058 | {
"github_metadata": {
"branch": "main",
"commit_count": 104,
"repo_created_at": "2024-01-13T13:33:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d0fc1b162e... |
d1a93eb8-5884-4e0c-a19e-2bcd5f89b50e | jqxallen/LeetCode | Algorithms/Palindrome Partitioning/Source.cpp | /*
* Author: <NAME>
* Date: Nov 1, 2013
* Link: https://leetcode.com/problems/palindrome-partitioning/
* Description:
* Given a string s, partition s such that every substring of the partition is a palindrome.
* Return all possible palindrome partitioning of s.
* For example, given s = "aab",
* Return
* ... | ALGO | 0.999949 | 6.723767 | {
"github_metadata": {
"branch": "master",
"commit_count": 257,
"repo_created_at": "2013-11-01T07:45:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1cd9eb3e... |
34994190-3f43-4039-97e9-9db0ba053216 | Gomi-coder/baekjoon_recursion | recursion/divide_Conquer.cpp | #include <iostream>
#include <vector>
using namespace std;
//#define N 10000 //원하는 원소의 갯수
void divide(int, int);
void merges(int, int);
//int result[N];
vector<int> result;
vector<int> arr;
int main() {
result.clear();
arr.clear();
int N;
cin >> N;
for (int i = 0; i < N; i++) {
int tmp;
cin >> tmp;
arr.p... | ALGO | 0.999995 | 4.806338 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2022-12-09T09:02: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": "388c0da426... |
388adfcb-01c5-4282-b586-5e6272c939bc | NilayBadjatya/Leetcode-January-Challenge-2025 | Maximum Number of Fish in a Grid.cpp | typedef pair<int, int> P;
class Solution {
public:
int m, n;
bool isValid(int x, int y){
return x >= 0 && x < m && y >= 0 && y < n;
}
int bfs(vector<vector<int>>& grid, int i, int j){
int s = 0;
queue<P> q;
vector<vector<int>> dir = {{0,1}, {1,0}, {-1,0}, {0,-1}};
... | ALGO | 0.999952 | 5.440133 | {
"github_metadata": {
"branch": "main",
"commit_count": 34,
"repo_created_at": "2025-01-24T14:54: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": "9c564655dd9... |
769a1d9d-9ad9-4bc2-a013-0728be4f60cb | ishandutta2007/codeforces-w | wygzgyw/normal/755/G.cpp | // wygzgyw
#include <bits/stdc++.h>
using namespace std;
template <typename T> void read(T &t) {
t=0; char ch=getchar(); int f=1;
while (ch<'0'||ch>'9') { if (ch=='-') f=-1; ch=getchar(); }
do { (t*=10)+=ch-'0'; ch=getchar(); } while ('0'<=ch&&ch<='9'); t*=f;
}
template <typename T> void write(T t) {
if (t<0) { put... | ALGO | 0.99986 | 4.2864 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:34: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": "d6eee823f1c8... |
db329d6c-10a0-44c8-9221-d09eab9132c7 | artificial-intelligence-department/ai_programming_playground_2024 | ai_13/maksym_tofan/epic_3/vns_lab_7_task_1_maxym_tofan_variant_15.cpp | #include <iostream>
#include <cmath>
#include <numeric> // для std::gcd
// Структура для представлення звичайного дробу
struct Fraction {
int numerator;
int denominator;
// Скорочення дробу
void reduce() {
int gcd_value = std::gcd(numerator, denominator);
numerator /= gcd_value;
... | TOOL | 0.960555 | 5.632983 | {
"github_metadata": {
"branch": "main",
"commit_count": 2638,
"repo_created_at": "2024-09-22T19:14:24.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 7,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5585600e8d... |
89878d50-2361-4b80-a911-38cf389f49f6 | skalskidaniel/Algorithms | bitmap.cpp | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <string>
#define MAX 128*128
using namespace std;
struct Pixel
{
int x;
int y;
};
int distance(Pixel p1, Pixel p2)
{
return abs(p1.x - p2.x) + abs(p1.y - p2.y);
}
int lowest_distance(Pixel p1, vector<... | ALGO | 0.999963 | 3.926941 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2024-04-26T08:56: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": "3f1e35d0bc8... |
e223047c-9c26-4767-9c07-335b39b2dc02 | heroming/algorithm | hihocoder/weekly/034_1122_二分图二•二分图最大匹配之匈牙利算法.cpp | /*
* Author:heroming
* File:heroming.cpp
* Time:2017/01/12 06:57:15
*/
#include <vector>
#include <list>
#include <set>
#include <map>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <io... | ALGO | 0.99987 | 4.117366 | {
"github_metadata": {
"branch": "master",
"commit_count": 77,
"repo_created_at": "2016-07-09T14:21:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "65f0f9fe1... |
53ab48f6-6232-499c-ada7-f7ec92e3da4c | troyhe/Leetcode_2021 | 0059_Spiral Matrix II.cpp | class Solution {
public:
vector<vector<int>> generateMatrix(int n) {
int r1 = 0;
int r2 = n - 1;
int c1 = 0;
int c2 = n - 1;
vector<vector<int>> ans(n, vector<int>(n));
int num = 1;
while (r1 <= r2 && c1 <= c2){
for (int i = c1; i <= c2; i++) ans[r... | ALGO | 0.999985 | 6.029532 | {
"github_metadata": {
"branch": "main",
"commit_count": 302,
"repo_created_at": "2020-12-26T01:08: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": "018fdddf4a... |
07836090-849b-4668-95ad-82f87a955931 | bit24/Competitive-Programming | Camps/Alpha Star/TuringFall19/therd2.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef tuple<char, int, int> ti;
typedef vector<int> vi;
typedef vector<ld> vd;
typedef vector<ll> vl;
#define pb push_back
#define f first
#define s second
namespace deb... | ALGO | 0.999527 | 4.277172 | {
"github_metadata": {
"branch": "master",
"commit_count": 913,
"repo_created_at": "2016-02-04T06:16:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "43d568ea... |
9697fdbc-c8e6-4ace-a76c-cf787b4cf83e | ConsensusFuzz/LOKI | src/fisco_fuzz/bcos-pbft/bcos-pbft/pbft/libloki/Strategy.cpp | #include "Strategy.h"
namespace loki
{
namespace protocolFuzzer
{
bcos::crypto::NodeIDs random_send_nodes(loki::statemachine::State _state, bcos::crypto::NodeIDs all_consensus_nodes){
(void)_state;
bcos::crypto::NodeIDs res;
int length = all_consensus_nodes.size();
srand((unsigned)time(NULL));
for... | ALGO | 0.988144 | 4.987862 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2023-05-11T02:22:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 15,
"forks": 6,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "654d48d4dc... |
2e9799f0-975b-4c07-a343-99c9919c3e73 | victoriadjw/pms | PMS1/pms - 副本.cpp | #if 1
#include<iostream>
#include<fstream>
#include<string>
#include<time.h>
#include<iomanip>
#include<algorithm>
using namespace std;
typedef double proc_type; // type of processing time
typedef double dete_type; // type of deterioration effect
typedef double obj_type; // type of objective value
typedef double perf_t... | ALGO | 0.999919 | 3.498176 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2016-03-25T17:08: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": "a68828a77... |
fd473ff1-83d0-47f8-a148-e1f9cb1f3afa | s-chance/CPP-Practice | cpp-basics/4/4-3 myVector/myVector.cpp | #include "myVector.hpp"
#include <istream>
#include <ostream>
myVector::myVector(unsigned n, int value) {
size = n;
for (int i = 0; i < size; i++) {
data[i] = value;
}
}
myVector::myVector(const myVector& obj) {
for (int i = 0; i < obj.size; i++) {
data[i] = obj.data[i];
}
size = obj.size;
}
myV... | TOOL | 0.989367 | 3.990906 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2022-05-20T15:54: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": "59d3b2709... |
fad4cb82-a056-4469-bbd6-850241d72c5b | w3mona/Feature_selection_forward_backward_search | search.cpp | #include <iostream>
#include <vector>
#include <cmath>
#include <limits>
#include <numeric>
#include <algorithm>
#include <iomanip>
#include <fstream>
#include <sstream>
#include <string>
#include <thread>
#include <mutex>
#include <queue>
#include <condition_variable>
using namespace std;
// Constant for the class l... | DATA | 0.983186 | 6.603512 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2025-06-03T01:06: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": "ebf38bf9269b... |
1590c9f7-2339-4c26-b7b5-c02706d87a5f | ftithe/kattis_sol | platforme.cpp | #include<iostream>
#include<vector>
#include<sstream>
#include<cstdlib>
#include<algorithm>
using namespace std;
bool comp (vector<int> first, vector<int> second) {
return (first[0] < second[0]);
}
int main () {
int N;
cin >> N;
int i;
vector<int> coord;
vector<vector<int> > coords;
string line;
i = 0;
... | ALGO | 0.998807 | 3.632947 | {
"github_metadata": {
"branch": "master",
"commit_count": 35,
"repo_created_at": "2019-08-13T12:36: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": "02d42d652... |
bfadc7bb-ac14-4022-8fed-51c51d5652bb | CodeTiger927/CodeForcesRepo | edu104/stringcount.cpp | using namespace std;
#include <iostream>
#include <set>
#define MAXN 405
#define MOD 998244353
int N,arr[26];
int dp[2][MAXN][MAXN][3][3],sum1[MAXN][MAXN],sum2[MAXN][MAXN],sum3[MAXN][MAXN];
int add(int x,int y) {
if((x + y) >= MOD) return (x + y - MOD);
return (x + y);
}
int sub(int x,int y) {
if(x < y) return ... | ALGO | 0.999994 | 4.056687 | {
"github_metadata": {
"branch": "main",
"commit_count": 32,
"repo_created_at": "2021-05-09T19:25:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bcbeffa783a... |
1d30cf35-b240-4b55-ba2f-de5535812eb0 | klahaag/cf_tracking | src/cf_libs/common/math_helper.hpp | /*
// License Agreement (3-clause BSD License)
// Copyright (c) 2015, <NAME>, all rights reserved.
// Third party copyrights and patents are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions... | ALGO | 0.992139 | 6.054172 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2015-04-24T05:51:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 127,
"forks": 70,
"issues": 5,
"pull_requests": 0
},
"file_meta": {
"content_id": "741a86b... |
cd45db1e-8ed1-4282-844a-aa88ec15d009 | ivek1312/gimli | apps/misc/invlinearmat.cpp | /***************************************************************************
* Copyright (C) 2006-2007 by the resistivity.net development team *
* <NAME> <EMAIL> *
* <NAME> <EMAIL> *
* ... | ALGO | 0.966738 | 5.275565 | {
"github_metadata": {
"branch": "master",
"commit_count": 2419,
"repo_created_at": "2019-05-27T18:25: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": "6bd095c... |
f490114e-f355-4c4c-821c-cf06d7ff8dca | jiamingluuu/RayTracer2D | src/shapes/circle.cc | #include "circle.h"
#include <cmath>
#include "core/material.h"
namespace RayTracer2D {
Circle::Circle(const Point2d &c, const double r, MaterialPtr material) : c_(c), r_(r) {
material_ = std::move(material);
}
std::optional<double> Circle::Intersect(const Ray &ray) const {
auto oc = ray.p_ - c_;
auto a = Dot(... | ALGO | 0.956849 | 7.353245 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-05-14T14:58:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "24072fe763ec... |
86eb5c2d-6d6c-4a35-bb39-2d361828bbce | jthies/PELS | RACE/include/RACE/traverse_serial.h | /*
* =======================================================================================
*
* RACE: Recursicve Algebraic Coloring Engine
* Copyright (C) 2019, RRZE, Friedrich-Alexander-Universität Erlangen-Nürnberg
* Author: <NAME>
*
* This program is free software: you can redistribute it and/or modi... | ALGO | 0.995862 | 3.965917 | {
"github_metadata": {
"branch": "main",
"commit_count": 95,
"repo_created_at": "2024-04-19T08:51:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f96e1d12d88... |
a3a1c5b4-0af8-4cf8-916f-4af5893e314f | bioidiap/bob.ip.gabor | bob/ip/gabor/cpp/Wavelet.cpp | /**
* @author <NAME> <<EMAIL>>
* @date Wed Jun 4 17:44:24 CEST 2014
*
* @brief C++ implementations of the Gabor wavelet transform
*
* Copyright (C) 2011-2014 Idiap Research Institute, Martigny, Switzerland
*/
#include <bob.ip.gabor/Wavelet.h>
static inline double sqr(double x){return x*x;}
/**
* Generates a... | ALGO | 0.980512 | 6.702242 | {
"github_metadata": {
"branch": "master",
"commit_count": 170,
"repo_created_at": "2017-01-17T23:19:49.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "26902d73d... |
0c5041fb-cb2f-4716-8aca-e496858a4433 | SiyangShao/codes | luogu/P2683.cpp | #include <bits/stdc++.h>
#define int long long
using namespace std;
int n, m;
int c, u, v, w;
int dis[110][110];
signed main() {
ios::sync_with_stdio(false);
cin.tie(0), cout.tie(0);
cin >> n >> m;
memset(dis, 0x3f, sizeof(dis));
for (int i = 1; i <= n; ++i) {
dis[i][i] = 0;
}
while (m--) {
cin >> c;
if (c... | ALGO | 0.999929 | 3.929836 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2021-04-08T14:41:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "04aef167a40a... |
4fae00d5-0d2b-4c12-acfa-4ff8cbb886d4 | zheng-yk/comp2113-gp-proposal | Judge.cpp | #include <iostream>
#include <iomanip>
#include "Judge.h"
using namespace std;
//judge if there is a winning situation (5 in a row), output: result or continue
int Judge::judgeResult(const int chessboard_state[15][15])
{
int lastrow, lastcolumn;
int i, j;
int count, result;
int rowmin, rowmax, columnmin, columnm... | ALGO | 0.999732 | 3.583133 | {
"github_metadata": {
"branch": "main",
"commit_count": 47,
"repo_created_at": "2020-10-21T00:51: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": "70ace1a1f42... |
2e8f0d90-1868-4409-a4fe-1f104780a341 | ASSERT-KTH/Supersonic | predictions/submissions-aizu-cot-gpt35/Codenet/p00739/482779983/response_2.cpp | #include <iostream>
#include <unordered_set>
#include <vector>
typedef long long ll;
const int dx[] = {0, 1, 0, -1};
const int dy[] = {-1, 0, 1, 0};
int w, h, csize;
int field[12][12], tatu[20][2], kazu[20][2];
std::unordered_set<ll> visited[20][4][2];
bool inside(int x, int y) {
return !(x < 0 || x >= w || y >= ... | ALGO | 0.999933 | 4.867105 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2022-02-03T10:33:34.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bbc8fa018d033... |
28b5cab8-468d-41d5-8b19-9b6c1eda2a32 | bkaradzic/bgfx | 3rdparty/glsl-optimizer/src/glsl/opt_rebalance_tree.cpp | /*
* Copyright © 2014 Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, pub... | ALGO | 0.964416 | 6.683464 | {
"github_metadata": {
"branch": "master",
"commit_count": 8928,
"repo_created_at": "2012-04-04T03:39:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 15914,
"forks": 2000,
"issues": 289,
"pull_requests": 22
},
"file_meta": {
"content_id"... |
3dca180c-c192-4414-a108-9a38bcb088a1 | INGg/ACM | acwing/AC1070.cpp | // Problem: 环形石子合并
// Contest: AcWing
// URL: https://www.acwing.com/problem/content/1070/
// Memory Limit: 64 MB
// Time Limit: 1000 ms
// Code by: ING__
//
// Edited on 2021-08-10 16:50:06
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <map>
#include <vector>... | ALGO | 0.99996 | 3.837316 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2021-10-19T02:50: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": "be24d41eec... |
9644ccf7-82ee-4536-93c6-1f0deba97ce2 | coldMater/bigstone_algorithm | sandbox_graph/adjacency_matrix.cpp | #include <bits/stdc++.h>
using namespace std;
const int S = 10;
int a[S][S];
int visited[S];
void print (int adj[S][S]) {
for (int i = 0 ; i < S; ++i) {
for (int j = 0; j < S; ++j) {
cout << adj[i][j] << " ";
}
cout << "\n";
}
}
void go (int from) {
visited[from] = 1;
... | ALGO | 0.999946 | 3.981995 | {
"github_metadata": {
"branch": "main",
"commit_count": 324,
"repo_created_at": "2023-05-13T16:32:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bf5f98f5b2... |
275fa62a-8a2a-4451-ac0e-7a5f2d12f515 | georgerapeanu/c-sources | B. Intersecting Subtrees.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <cstring>
using namespace std;
int n;
int t;
vector<int> graph[1005];
bool isx[1005];
bool isy[1005];
int dfs(int nod,int tata){
if(isx[nod]){
return nod;
}
int ans = 0;
for(auto it:graph[nod]){
if(it == tata){
continue;
}
int tmp... | ALGO | 0.999802 | 3.543327 | {
"github_metadata": {
"branch": "master",
"commit_count": 177,
"repo_created_at": "2018-08-15T14:37:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1df013e2... |
8bef90d5-358f-42f3-b26d-64bce8f59b59 | BekzhanKassenov/olymp | codeforces.com/Gym/Отборочный контест СГАУ 2013/B/Main.cpp | #include <iostream>
#include <cstdio>
#include <map>
#include <string>
using namespace std;
string remake(const string& s) {
int cnt[26];
for (int i = 0; i < 26; i++)
cnt[i] = -1;
int cn = 0;
string ans(s.begin(), s.end());
for (size_t i = 0; i < s.size(); i++) {
if (cnt[s[i] - 'a'] == -1)
cnt[s[i] - 'a... | ALGO | 0.999993 | 3.474783 | {
"github_metadata": {
"branch": "master",
"commit_count": 426,
"repo_created_at": "2015-07-29T15:25:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3a719022... |
a07c48ae-67f0-47e1-a912-f09d838cd28e | LuisVillanuevaFlores/Estructura-de-datos-avanzada | arbol b/B+.h | #include<bits/stdc++.h>
using namespace std;
struct indice{
string key;
int pos;
indice(string c="&",int p=0):key(c),pos(p){};
indice& operator = (const indice &p){
this->key=p.key;
this->pos=p.pos;
return *this;
}
bool operator <(const string a)const{return this->key<a... | ALGO | 0.99832 | 3.167233 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2020-11-28T03:45: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": "8d5df3b70995... |
72164315-d492-43a9-86fb-a0d9beb370a1 | L3b1n/course_1 | ExamFirstSample/Stud.h | #include <iostream>
#include <fstream>
using namespace std;
class Stud
{
public :
Stud(): head(0), tail(SIZE) {queue = new int[SIZE]; str = new string[SIZE];} //конструктор класса по умолчанию
Stud(int n): head(0), tail(n) {queue = new int[n];} //конструктор класса
void push (int num);
int size(... | ALGO | 0.994334 | 3.601146 | {
"github_metadata": {
"branch": "main",
"commit_count": 168,
"repo_created_at": "2022-11-07T18:40:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a2d6ceac98... |
09dfbfe7-ca60-46ef-86a5-aade667c3a36 | roytam1/palemoon27 | dom/media/webaudio/blink/HRTFKernel.cpp | /*
* Copyright (C) 2010 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of condit... | ALGO | 0.993858 | 6.587454 | {
"github_metadata": {
"branch": "master",
"commit_count": 4110,
"repo_created_at": "2018-07-25T02:10:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 68,
"forks": 12,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2847d... |
079bd973-6f7a-49ee-bbf5-34a8146b42f0 | Ahmed-Khaled-dev/problem_solving | acm/acm_level2/acm_week5_practice/vacation.cpp | /**
* author: Akayiz
* created: 2023-07-15 23:46:05
**/
#include <iostream>
#include <algorithm>
using namespace std;
void fast(void) {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
}
int day_activities_happiness[100005][5];
int memo[100005][5];
int days_count;
int get_day_max_happiness(... | ALGO | 0.999963 | 4.693522 | {
"github_metadata": {
"branch": "main",
"commit_count": 99,
"repo_created_at": "2023-02-06T22:13:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d296c0069dc... |
ae078f19-72b1-482b-84d2-d052fbbe04fb | cstack/asteroids | engine/geometry.cc | #include "geometry.h"
#include "util.h"
#include <math.h>
std::ostream &operator<<(std::ostream &os, point_t const &location) {
return os << "(" << location.x << ", " << location.y << ")";
}
std::ostream &operator<<(std::ostream &os, polygon_t const &polygon) {
os << "polygon(" << polygon.num_points << ")";
for... | ALGO | 0.986932 | 6.42462 | {
"github_metadata": {
"branch": "master",
"commit_count": 41,
"repo_created_at": "2016-02-14T01:16:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2e7b8a40d... |
9fc03f6f-bcbf-4828-8502-1f6516e226c2 | SolomennikovKolya/nsu-course-2 | evmpu/pract4_vectorization/trash/blass0.cpp | #include <cblas.h>
#include <ctime>
#include <iostream>
#include <cmath>
#include <cfloat>
#define N 2
#define M 100000
struct TimeRange
{
timespec start, end;
};
double get_elapsed_time(const TimeRange &time_range)
{
return (time_range.end.tv_sec - time_range.start.tv_sec) + 1e-9 * (time_range.end.tv_nsec -... | ALGO | 0.999907 | 4.527518 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-11-24T19:15: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": "ed725853cc4e... |
566e4196-30f0-4c2b-ae96-5e0ee0ef8062 | ZoloZiak/WinNT4 | private/ntos/w32/ntgdi/gre/srcblt1.cxx | /******************************Module*Header*******************************\
* Module Name: srcblt1.cxx
*
* This contains the bitmap simulation functions that blt to a 1 bit/pel
* DIB surface.
*
* Created: 07-Feb-1991 19:27:49
* Author: <NAME> patrickh
*
* Copyright (c) 1990 Microsoft Corporation
*
\*******************... | ALGO | 0.940468 | 4.909638 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2014-12-05T09:38:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 328,
"forks": 201,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "69c855... |
c93bee86-2a32-4192-9738-29222de317c3 | SunBillows/algorithm-learning | zuo/Code03_BitAddMiunsMultiDiv.cpp | //使用位运算实现加减乘除
#include <iostream>
using namespace std;
int BitAdd(int a,int b)
{
int sum = 0;
//当进位为 0 (没有产生进位时)
while (b != 0)
{
sum = a ^ b; //sum 变量存储无进位相加的值
b = (a & b) << 1; // b 变量存储进位值
a = sum; // a 存储无进位相加的值
}
//返回无进位相加
return a;
}
int BitMinus(int a, int b)
{
return BitAdd(a, BitAdd(~b, 1));... | ALGO | 0.999708 | 4.103864 | {
"github_metadata": {
"branch": "master",
"commit_count": 31,
"repo_created_at": "2022-06-14T13:29: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": "21f877cb8... |
aa38e0cd-4d2b-4ba3-82cf-e88e14e42af4 | sola2233/leetcode | 224.基本计算器.cpp | /*
* @lc app=leetcode.cn id=224 lang=cpp
*
* [224] 基本计算器
*/
// @lc code=start
/**
* 相比 227 题,需要考虑括号
* 栈 + 递归
*/
#include <string>
#include <stack>
using namespace std;
class Solution {
public:
// 遍历到的下标位置
int pos;
// 字符串长度
int n;
int calculate(string s) {
pos = 0;
n = s.size... | ALGO | 0.999976 | 5.416686 | {
"github_metadata": {
"branch": "master",
"commit_count": 70,
"repo_created_at": "2021-08-17T07:02: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": "5b40765e1... |
77ffe141-6a6b-4d2e-9a92-8d2338da6f22 | Pritanjan/Leetcode | 2601 - 2800/2616. Minimize the Maximum Difference of Pairs.cpp | // APPROACH 1 [ SORTING & BINARY SEARCH ]
class Solution {
public:
// min max -> think of binary search
int minimizeMax(vector<int>& nums, int p) {
// sort array
sort(nums.begin(), nums.end());
int n = nums.size();
int L = 0;
// the possible difference ranges from 0 to t... | ALGO | 0.999986 | 6.302328 | {
"github_metadata": {
"branch": "main",
"commit_count": 2409,
"repo_created_at": "2022-04-09T13:04: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": "f47537991... |
38dcde2b-5560-448e-8f31-f6a6f42191b6 | jixiangwangzi/sps | src/navi2/navigation2/nav2_regulated_pure_pursuit_controller/src/util/path_process.cpp | #include "nav2_regulated_pure_pursuit_controller/util/path_process.h"
#include "nav2_regulated_pure_pursuit_controller/util/frame_converter.h"
#include "nav2_regulated_pure_pursuit_controller/util/path_matcher.h"
#include "tf2/utils.h"
namespace util
{
PathProcess::PathProcess(const double interval) : p2p_interval_(i... | ALGO | 0.998164 | 5.438567 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2024-06-15T10:39: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": "415084ca1e... |
8111ebbc-53fb-456c-9d2b-9367e52c31b7 | ASSERT-KTH/Supersonic | predictions/submissions-aizu-coop-gpt4/Codenet/p02527/885785209/response_6.cpp | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
template <typename T>
void quicksort(T *l, T *r) {
struct range {
T *l, *r;
};
static range s[300];
auto partition = [&](T *l, T *r) {
if (r - l < 2)
return (T *)nullptr;
T *piv = l + rand() % (r - l);
swap(*l... | ALGO | 0.999937 | 4.580815 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2022-02-03T10:33:34.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6e37144cb7876... |
a3016e1a-54a9-4364-b504-154455aad904 | 5tarlight/BOJ | boj/gold/11444.cpp | #include <iostream>
#include <map>
#define DIV 1000000007LL
typedef long long ll;
using namespace std;
map<ll, ll> cache;
ll fibo(ll n) {
if (n == 0)
return 0;
else if (n == 1 || n == 2)
return 1;
if (cache.count(n) > 0)
return cache[n];
if (n % 2 == 0) {
ll m = n /... | ALGO | 0.999988 | 4.659849 | {
"github_metadata": {
"branch": "master",
"commit_count": 1192,
"repo_created_at": "2023-02-01T06:45:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "125c105... |
e26ff2c2-c4ce-4d71-83dd-b8af0a6a3d7b | roy7077/POTD-Leetcode | 935. Knight Dialer.cpp | #define ll long long
int mod=1e9+7;
class Solution {
public:
int help(ll i,ll j,ll n,vector<vector<vector<int>>>& memo)
{
//base case
if(i < 0 or j < 0 or i >= 4 or j >= 3 or (i == 3 && j != 1))
return 0;
if(n==1)
return 1;
//memo check... | ALGO | 0.999995 | 4.638463 | {
"github_metadata": {
"branch": "main",
"commit_count": 338,
"repo_created_at": "2023-09-25T16:12:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7fcd981994... |
3578b153-4aa0-4ad9-8d2e-77d96d6a7f6e | sulthan-95/Practice_codes | _cpp_/Merge_Sortll.cpp | #include<iostream>
#include<stdlib.h>
using namespace std;
struct node{
int data;
struct node *next;
};
void push(struct node** head_ref, int new_data)
{
/* allocate node */
struct node* new_node =
(struct node*) malloc(sizeof(struct node));
/* put in the data */
new_node->data = new_data;
/* link the old ... | ALGO | 0.999978 | 4.665918 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2017-05-13T08:42: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": "3ad6b5ac0e... |
29750f2b-73ad-44c4-8bbf-d2634d824b6b | xfile6912/Baekjoon | samsung/boj20057(마법사상어와토네이도).cpp | #include <stdio.h>
#include <vector>
using namespace std;
enum direction
{
left,
down,
right,
up
};
vector<vector<int>> congestion_window(5, vector<int>(5, 0));
void init_congestion_window()
{
congestion_window[0][2] = 2;
congestion_window[1][1] = 10;
congestion_window[1][2] = 7;
con... | ALGO | 0.999869 | 4.216954 | {
"github_metadata": {
"branch": "master",
"commit_count": 216,
"repo_created_at": "2020-02-19T06:50: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": "0b42a671... |
cfd3acdc-3f38-4607-8ff0-5309a509a3e8 | lpierezan/jssp-solver | src/mh_engine.cpp | #include "global.hpp"
#include "mh_engine.hpp"
#include "time_control.hpp"
#include <iostream>
#include <sstream>
using namespace std;
mh_engine::mh_params::mh_params()
{
// ============
//Intensive TS - Random Solution Generated
ls_params_indv_gen = ls_engine::ls_parameters();
ls_params_indv_gen.max_... | ALGO | 0.998532 | 3.909864 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2016-09-05T01:38:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 14,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "90d4d9f8... |
9683d9de-43eb-45cb-9876-0af5d7ed1732 | pingu00/DataType | DataType/Linearlist.cpp | ////
//// Linearlist.cpp
//// DataType
////
//// Created by Phil on 2022/03/30.
////
//
//#include <stdio.h>
//#include <stdlib.h>
//#include <string.h>
//
//typedef int element;
//typedef struct ListNode{
// element data;
// struct ListNode* link;
//}ListNode;
//ListNode* insert_first(ListNode *head, element ... | ALGO | 0.991249 | 4.004856 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-05-31T03:59: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": "c745422e9c11... |
889b0c3a-5e26-493d-9a73-92fcd2805163 | ycdzj/OJSolutions | codeforces/1975/a.cpp | #include <algorithm>
#include <cassert>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <vector>
using namespace std;
class Solver {
int n;
vector<int> a;
bool get_ans() {
int cn... | ALGO | 0.99997 | 4.369777 | {
"github_metadata": {
"branch": "master",
"commit_count": 195,
"repo_created_at": "2018-11-22T04:24: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": "fa29b6c8... |
47fa55c0-cd63-4de4-880e-43c09c943b6e | ianmacapple/idk | ofxLaser/src/utils/PennerEasing.h |
// Modified from <NAME>'s easing equations
#pragma once
class Quint {
public:
// t = time (between 0 and d)
// v = start value
// c = end value
// d = duration
static float easeIn (float t,float b , float c, float d) {
t/=d;
return c*t*t*t*t*t + b;
}
static float easeOut(float t,float b , float c, fl... | ALGO | 0.997786 | 4.859936 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-03-07T04:44: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": "506b1a8431... |
c3b14fb1-e567-4f26-a0a2-2bf3d0f2ba93 | Mariovr/CIFlow | src/CIMethod.cpp | // CIFlow is a very flexible configuration interaction program
// Copyright (C) Ghent University 2014-2015
//
// This file is part of CIFlow.
//
// CIFlow is developed by <NAME> <<EMAIL>>
// a member of the Ghent Quantum Chemistry Group (Ghent University).
// See also : http://www.quantum.ugent.be
//
// At this moment ... | ALGO | 0.983206 | 4.631374 | {
"github_metadata": {
"branch": "master",
"commit_count": 96,
"repo_created_at": "2015-09-14T14:45:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "032747bc0... |
2d9733e2-b371-4cbe-bef1-1ffd2e9d3e78 | Etsuya233/CodeSyncEtsuya | Luogu/2058.cpp | #include <iostream>
#include <queue>
#include <map>
#include <vector>
using namespace std;
int main(){
int n, nowCountry = 0, ans = 0, delCnt = 0;
cin >> n;
map<int, int> mapa; //First is the real loc, second is the fake loc.
vector<queue<int> > my;
for(int i = 0; i < n; i++){
int t, m;
cin >> t >> m;
for... | ALGO | 0.999723 | 3.134904 | {
"github_metadata": {
"branch": "main",
"commit_count": 23,
"repo_created_at": "2022-11-29T15:12: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": "2a5575830f9... |
c52fc7c1-1599-45f5-a2ad-c41b0ae8db0c | mathidot/leetcode_solution | nthUglyNumber.cpp | #include <unordered_map>
#include <vector>
#include <algorithm>
#include <unordered_set>
#include <iostream>
#include "ListNode.h"
using namespace std;
class Solution {
public:
int nthUglyNumber(int n) {
int a = 0, b = 0, c = 0;
std::vector<int> dp(n, 1);
dp[0] = 1;
for (int i = 1;... | ALGO | 0.999814 | 5.809965 | {
"github_metadata": {
"branch": "main",
"commit_count": 53,
"repo_created_at": "2025-03-19T13:56:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9e0c0281c34... |
d7bdf98c-a87d-4f0e-a86a-bc9e8b3a44dc | ishandutta2007/codeforces-y | yuma_/normal/734/D.cpp | #include "bits/stdc++.h"
#include<unordered_map>
#include<unordered_set>
#pragma warning(disable:4996)
using namespace std;
using ld = long double;
const ld eps = 1e-9;
//// < "d:\d_download\visual studio 2015\projects\programing_contest_c++\debug\a.txt" > "d:\d_download\visual studio 2015\projects\programing_contest_... | ALGO | 0.999657 | 3.657467 | {
"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": "7ddbb381f162... |
7b3eb732-5798-4ac6-b239-40b5deca6ce1 | bmwong84/Homework7EC | BankSimulation.cpp | //<NAME>
//CSCI 2421 Homework 7
#include "BankSimulation.h"
#include "Customer.h" //to hold the duders' arrival and processing time
BankSimulation::BankSimulation() //default constructor
{
}
void BankSimulation::runSimulation()
{
//std::priority_queue<Customer, std::vector<Customer>, CompareCustomer> eventQueu... | ALGO | 0.997858 | 4.21841 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2018-02-14T19: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": "988ecb8cae... |
d97ef667-a97b-4267-9529-90af9f2b4636 | dolanor/TheDarkMod | game/randomizer/rancombi.h | /*****************************************************************************
The Dark Mod GPL Source Code
This file is part of the The Dark Mod Source Code, originally based
on the Doom 3 GPL Source Code as published in 2011.
The Dark Mod Source Code is free software: you can redistribute ... | TOOL | 0.932948 | 5.787484 | {
"github_metadata": {
"branch": "master",
"commit_count": 5158,
"repo_created_at": "2013-07-30T21:33:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "343fb46... |
98f0d286-ae82-4a41-9542-3142a4b94441 | MITE666/Derivative-Calc | main.cpp | #include "Tree.h"
#include "Node/Headers/Node.h"
#include "Operations/Headers/Addition.h"
#include "Operations/Headers/Arccosinus.h"
#include "Operations/Headers/Arccotangent.h"
#include "Operations/Headers/Arcsinus.h"
#include "Operations/Headers/Arctangent.h"
#include "Operations/Headers/Constant.h"
#include "Operati... | ALGO | 0.998001 | 3.742183 | {
"github_metadata": {
"branch": "main",
"commit_count": 40,
"repo_created_at": "2023-05-01T06:06:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "73555ae2f3d... |
dbbaa8c7-75af-4dce-a0d1-ca00475f5e04 | enesflow/tubitak | 2022-yaz-kampı/AJ.cpp | #include <bits/stdc++.h>
#pragma GCC optimize("Ofast,unroll-loops")
#pragma GCC target("avx,avx2,fma")
using namespace std;
map<int, int> m;
int main()
{
// fastio
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n;
cin >> n;
int x;
int l = INT_MAX;
int r = INT_MIN;
for (int i... | ALGO | 0.999998 | 4.405764 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2023-02-06T07:04:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ea87c2398... |
c43eaf0e-76c7-4c2b-a92b-5dcd96856fea | Khadiza13/Compiler_Lab | Lab2-Tokenize.cpp | #include <bits/stdc++.h>
using namespace std;
bool isKeyword(const string &s) {
string keywords[] = {"int", "double", "for", "return", "bool"};
for (const auto &keyword : keywords) {
if (s == keyword) return true;
}
return false;
}
bool isOperator(const string &s) {
string operators[] = {"... | ALGO | 0.985369 | 4.184736 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-03-10T06:38: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": "178c103658da... |
fd1df651-e895-4cc3-9c00-fbcb200ad087 | Kennyarlexy/Competitive-Programming | CONTEST/CODEFORCES/Round_929/D.cpp | #include <bits/stdc++.h>
#define ll long long
#define fi first
#define se second
using namespace std;
ll A[100005];
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
int T; cin >> T;
for (int t = 1; t <= T; t++) {
int n; cin >> n;
ll cnt = 0;
ll x = LLONG_MAX;
ll ... | ALGO | 0.999619 | 4.437951 | {
"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": "44ba378ef21... |
29c89f06-0579-4f7d-bc78-f5142c441295 | JunJun355/usacoContests | usacoGuide/Chapter2/Section2/runround.cpp | /*
ID: 06jajun
TASK: runround
LANG: C++17
*/
#include <iostream>
#include <algorithm>
#include <vector>
#include <fstream>
#include <unordered_set>
#include <string>
using namespace std;
#define INF 1000000000
int m;
int best = INF;
bool digs[9];
string nums;
ifstream fin ("runround.in");
ofstream fout ("runround.o... | ALGO | 0.9997 | 3.741069 | {
"github_metadata": {
"branch": "main",
"commit_count": 84,
"repo_created_at": "2021-12-05T03:53: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": "05a539520a4... |
3b641ee3-b8d9-4a1a-86a1-054d9e85a318 | Judimax/Cpp_projects | alphabet_triangle.cpp | #include <iostream>
#include <cstring>
using namespace std;
int main() {
char letter;
cout << "Up to which letter of the alphabet would you like to see?"<< endl;
cin >> letter;
char ch = 65; //represents A from ascii, used so we wont use extra space making an array
char helper = 65; // help the pyramid
int... | TOOL | 0.998265 | 3.596749 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2017-06-09T15:58: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": "614a25c04... |
d881ac8d-9a4b-4f05-b5a7-9a0cd1c21b23 | AeroCTF/aero-ctf-2022 | tasks/reverse/syringa/dev/inc/vm.hpp | #ifndef _VM_HPP
#define _VM_HPP
#include <cstddef>
#include <cstdint>
#include <stack>
#include <vector>
#include <stdexcept>
namespace Syringa {
using CodeElement = uint8_t;
using MemoryElement = uint8_t;
class VM {
public:
VM(size_t stack_size) {
this->stack_size = stack_size;
... | ALGO | 0.9659 | 6.734755 | {
"github_metadata": {
"branch": "main",
"commit_count": 34,
"repo_created_at": "2021-11-02T14:42:28.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 17,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3621b1b43bd... |
b3a038f8-1c24-412f-8d8c-6920d77dd697 | meSerge8/coursework4 | circuit/subprojects/bdd/subprojects/bdd_manager/source/bdd_manager/operators.cpp | #include "bdd_manager.h"
bool and_bool(bool x, bool y) { return x & y; };
bool or_bool(bool x, bool y) { return x | y; };
bool nand_bool(bool x, bool y) { return not(x & y); };
bool nor_bool(bool x, bool y) { return not(x | y); };
bool xor_bool(bool x, bool y) { return x xor y; };
bool nxor_bool(bool x, bool y) { retu... | ALGO | 0.997853 | 5.672851 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2022-05-24T12:39: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": "362c403ef81... |
73666f79-1b0c-4c73-8684-0447b62cdb18 | sekargestiau/semester-2-projects | task 5 [graph-pt 1].cpp | #include <iostream>
using namespace std;
enum klub_t {
REAL_MADRID,
CHELSEA,
AC_MILAN,
VALENCIA,
JUMLAH_KLUB
};
enum hasil_t {
MENANG = 3,
SERI = 1,
KALAH = 0,
};
int main(){
// adjacency matrix
hasil_t HasilPertandingan[JUMLAH_KLUB][JUMLAH_KLUB];
int SelisihGol[JUMLAH_... | ALGO | 0.999483 | 4.470928 | {
"github_metadata": {
"branch": "main",
"commit_count": 46,
"repo_created_at": "2022-04-26T14:08: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": "799f9347a12... |
bd502f9e-2ca0-4b48-a378-e819aad9a957 | xr1s/brush-title | HDOJ/2999/main.cc | #include <algorithm>
#include <cstring>
#include <iostream>
using namespace std;
int N, a[100], M, K;
int mem[1001];
int sg(int k) {
if (mem[k] != -1) return mem[k];
bool mex[1024]{false};
for (int i = 0; i != N; ++i)
for (int j = 0; j <= k - a[i] >> 1; ++j)
mex[sg(j) ^ sg(k - j - a[i])] = true;
for... | ALGO | 0.999757 | 3.943968 | {
"github_metadata": {
"branch": "master",
"commit_count": 40,
"repo_created_at": "2017-06-21T18:44:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f40bab9ab... |
7d42d97c-0e9a-4102-80cc-e04ecfcd28f3 | mhaoli/ACM-Source-Code | Problems/POJ/Tree-POJ-1741.cpp | /*
* Author: Plumrain
* Created Time: 2014/5/13 12:05:13
* File Name: Tree-POJ-1741.cpp
*/
#include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <cstdlib>
#include <sstream>
#include <fstream>
#include <list>
#include <deque>
#i... | ALGO | 0.999904 | 4.207357 | {
"github_metadata": {
"branch": "master",
"commit_count": 109,
"repo_created_at": "2015-04-15T04:55: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": "40a8ba7c... |
5f12e74a-9fe7-470e-b89c-fdd9c0bd9f42 | villerbond/Practice2021 | 2021.10.25/5. hole_in_array.cpp | #include <iostream>
#include <time.h>
void fillArray(int n, int arr[]) {
srand(time(NULL));
int flag, temp;
for (int i = 0; i < n; ) {
flag = 0;
temp = rand() % (n+1); //текущее число
for (int j = 0; j < i; ++j) {
if (arr[j] == temp) {
... | ALGO | 0.998605 | 3.79039 | {
"github_metadata": {
"branch": "main",
"commit_count": 115,
"repo_created_at": "2021-10-10T08:55:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3bcb9e18e3... |
3dff3e36-37be-46a1-af32-59faeb40fc50 | luotuoqingshan/acm | neerc14/f.cpp | #include <cstdio>
#include <algorithm>
#include <cstring>
#include <iostream>
#include <bitset>
#include <vector>
using namespace std;
const int maxn = 1005;
int m,f,n;
int a[maxn];
char s[maxn][maxn];
bitset<1000> b[maxn];
int id(char c){
if(c >= '0' && c <= '9') return c - 0;
return c - 'a' + 10;
}
int num[maxn];... | ALGO | 0.99993 | 3.178239 | {
"github_metadata": {
"branch": "master",
"commit_count": 28,
"repo_created_at": "2016-12-07T15:08:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1b698ce9b... |
9b0150c2-5332-4613-9352-c3a4be6a1f1a | williewillus/advent_of_code_2018 | src/day8.cpp | #include "util.h"
#include <sstream>
#include <memory>
#include <numeric>
#include <optional>
struct Node {
vec<Node> children;
vec<uint32_t> metadata;
std::optional<uint32_t> value;
void parse(std::stringstream& s) {
uint32_t num_children;
uint32_t num_meta;
s >> num_children;
s >> num_meta;
for (uint3... | ALGO | 0.971406 | 5.341958 | {
"github_metadata": {
"branch": "master",
"commit_count": 41,
"repo_created_at": "2018-12-01T04:50: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": "233dc3834... |
8d4b40e9-d6c6-4a57-8fc8-dcaa05cfbc58 | DFHG10/031702429 | src/Sudoku/Sudoku.cpp | #include<iostream>
#include<cstdlib>
#include<cstring>
#include<fstream>
#include<stdio.h>
#pragma warning(disable:4996)
#include"stdafx.h"
using namespace std;
int board[10][10] = { 0 };//数独二维数组//
int num, x;//定义阶数和盘面数//
int canshu(int argc)//判断命令行参数是否有误
{
if (argc != 9)
{
cout << "参数个数出错!";
return 1;
}
if (x ... | ALGO | 0.997907 | 3.989098 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2019-09-25T08:12: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": "8528caa6ca... |
bd400652-f731-41e3-9d60-279b1bee242d | SafwanIbrahim/All-Code | Bit,Rec,Prfix,Math(Phase 1)/class 4/Prefix sum/prefix_sum.cpp | #include<bits/stdc++.h>
using namespace std;
const int N = 1e5 + 9;
int a[N];
long long prefix_sum[N];
int main()
{
int n; cin >> n;
for (int i = 1; i <= n; i++) {
cin >> a[i];
}
for (int i = 1; i <= n; i++) {
prefix_sum[i] = prefix_sum[i - 1] + a[i];
}
int q; cin >> q;
... | ALGO | 0.999903 | 5.813913 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2024-05-10T13:27: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": "a1db70afbcc... |
f154cfcd-0812-4912-ac31-403e9214a3c3 | Kewth/OJStudy | lg5665.cpp | /*
* Since g++10 is released, some characters is not valid inside #if 0 :(
* So, why not using clang++? :D
* Date:
2020.06.12
* Solution:
* 贪心,单调栈,双指针
考场上一直想的 DP ,到 O(n^2) 就死路了。抛弃 DP 上贪心,可以发现(反正我是没发现,没
救了没救了)末尾的段只要尽可能短就是最优的(因为同时满足了贡献的最优性和转移的最优性)。
那么就是要求出 g[i] 表示以 i 为结尾的段的最小的长度,设 j = i - g[i] ,那么 g[i] 是满足
s[... | ALGO | 0.9999 | 3.137263 | {
"github_metadata": {
"branch": "master",
"commit_count": 779,
"repo_created_at": "2019-02-26T09:28:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c7825369... |
cea37cf1-4ebc-4cf8-ae46-d6254e71dbac | sbfrusho/Numerical | 10Lagrange.cpp | #include<bits/stdc++.h>
using namespace std;
struct Point{
double x, y;
};
class Lagrange{
public :
double lagrange(vector<Point>points, double value){
int n = points.size();
double res = 0;
for (int i = 0; i < n; i++) {
double up = 1, down = 1;
for (int j ... | ALGO | 0.999687 | 4.592722 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-12-03T07:59:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fe515ffbea03... |
ea0ad1ab-3c09-4941-9cda-ccbb78fedc3b | TheMusicBoy/Raspred | src/lab6.cpp | #include <mpi/mpi.h>
#include <vector>
#include <iostream>
#include <string>
#include <algorithm>
#include <numeric>
#include <sstream>
#include <numeric>
#include <random>
#include <ctime>
#include <iomanip>
template <typename Type>
std::ostream& operator<<(std::ostream& os, const std::vector<Type>& value) {
for ... | ALGO | 0.998823 | 5.952341 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2025-01-23T05:19: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": "e99c58cac8... |
d663f052-6ed6-4dbd-b30a-02268127ef9f | HansKramer/OpenXIL | src/IHV/codec/cell/memory/encodeDither.cc | /***********************************************************************
EXHIBIT A - XIL 1.4.1 (OPEN SOURCE VERSION) License
The contents of this file are subject to the XIL 1.4.1 (Open Source
Version) License Agreement Version 1.0 (the "License"). You may not
use this file except in compliance with th... | ALGO | 0.998913 | 6.706755 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2015-01-27T10:16: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": "571013708b... |
54637934-8691-410b-87ac-7ae11a7955ec | DarkImpact1/Data-Structure-Algorithm | Tree/balancedTree.cpp | /*
check if tree is balanced binary tree
/*
/**
* 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,... | ALGO | 0.999862 | 5.807774 | {
"github_metadata": {
"branch": "main",
"commit_count": 253,
"repo_created_at": "2023-09-16T22:29: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": "4c97916e8c... |
fa1b4759-69f1-4eff-b1b9-8786bd1ccb7e | mouli7625/Single-Linked-List | insertion_and_searching.cpp | #include<iostream>
using namespace std;
class Node
{
public:
int data;
Node* next;
Node(int val)
{
data=val;
next=NULL;
}
};
void insertAtTheTail(Node* &head,int val)
{
Node* new_node=new Node(val);
if(head==NULL)
{
head=new_node;
return;
}
No... | ALGO | 0.999951 | 4.512876 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2022-06-04T05:19:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7cb2f9c44533... |
3ba807ab-2122-4912-a413-7c4f64938370 | claudioDema99/robotics_projects | ExpLab-FinalAssignment/ros2_planning_system/plansys2_pddl_parser/src/plansys2_pddl_parser/Or.cpp |
#include "plansys2_pddl_parser/Domain.h"
namespace parser { namespace pddl {
void Or::PDDLPrint( std::ostream & s, unsigned indent, const TokenStruct< std::string > & ts, const Domain & d ) const {
tabindent( s, indent );
s << "( or\n";
if ( first ) first->PDDLPrint( s, indent + 1, ts, d );
else {
tabindent( s... | TOOL | 0.901347 | 6.215341 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2025-01-18T14:24:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0af8da7b8e1... |
d69d1498-a057-4c5c-8a7d-f403df0351be | aws/lumberyard | dev/Code/CryEngine/CryCommon/ParseEngineConfig.h | /*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or t... | CONFIG | 0.937185 | 6.763586 | {
"github_metadata": {
"branch": "master",
"commit_count": 62,
"repo_created_at": "2017-06-30T05:18:43.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2079,
"forks": 544,
"issues": 49,
"pull_requests": 196
},
"file_meta": {
"content_id": "e9... |
f9930e90-e124-432e-aa0d-00e4233d8005 | mr-programming/HW9 | TowerOfHanoi.cpp | // Participant(s): <NAME>
// Date: 04-29-21
// Description: Algorithm using recursion to solve the tower of Hanoi game (Implementation)
#include "towerOfHanoi.h"
void printTowers(int numberOfRings, stack <int>& towerA, stack <int>& towerB, stack <int>& towerC)
{
stack<int> tempTowerA = towerA;
stack<int> tempTowerB ... | ALGO | 0.999834 | 5.499053 | {
"github_metadata": {
"branch": "master",
"commit_count": 22,
"repo_created_at": "2021-04-23T06:56: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": "4c6e5e0e8... |
3d9482b1-beba-4c67-b699-7043095b84f2 | dangwei-90/HDDecFile | HDDecFile/HDDecFile/Md5.cpp | #include "stdafx.h"
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <Winbase.h>
#include <time.h>
#include "md5.h"
#define S11 7
#define S12 12
#define S13 17
#define S14 22
#define S21 5
#define S22 9
#define S23 14
#define S24 20
#define S31 4
#define S32 11
#define S33 16... | TOOL | 0.924379 | 3.97667 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2018-08-01T07:54:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "71920a2b6f... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.