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 |
|---|---|---|---|---|---|---|---|
85c2b59d-c8e9-4948-9ab3-2e7770f5a755 | Dc0dez/CSS-343 | program-3/graphm.cpp | // ------------------------------------------------ graphm.cpp ----------------------------------------------------------
// <NAME> CSS 343 A
// Creation Date
// 11/3/24
// Date of Last Modification
// 11/9/24
// -------------------------------------------------------------------------------------------------------... | ALGO | 0.997066 | 3.843797 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2025-07-01T03:07: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": "d672532539e6... |
9b9f5d05-0fc5-4264-81fd-61065fec28a8 | tab21/100DaysOfCode | codes/Day18.cpp | #include <bits/stdc++.h>
#include <iostream>
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) {}
};
ListNode *reverseList(ListNode *head)
{
if (he... | ALGO | 0.999984 | 4.354921 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2022-10-05T13:33: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": "53f251fdd6... |
99c635ab-5d98-4a62-be02-d59463360eb9 | greatbridf/greatbridf-lg | Hi-accuracy/division.cpp | // Hi-accurancy division
// Not recommanded
#include<bits/stdc++.h>
#define MAIN 110
int compare(int a[],int b[],int lena,int lenb)
{
int flag;
if(lena<lenb) flag=0;
else if(lena>lenb) flag=1;
else
{
int i=lena,judge=0;
while(!judge&&i>0)
{
if(a[i]>b[i])
... | ALGO | 0.999986 | 3.086517 | {
"github_metadata": {
"branch": "master",
"commit_count": 88,
"repo_created_at": "2019-01-18T02:21: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": "a691309fb... |
c3a8165b-b5fd-4a14-805f-ae9b6756c867 | MostafaGalal1/CP-Submissions | Codeforces/1690/162444207.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int main() {
int t = 0;
cin >> t;
for (int i = 0; i < t; i++) {
int n = 0;
cin >> n;
long a[n];
long b[n];
for (int j = 0; j < n; j++){
cin >> a[j];
}
for (int j = 0; j < n;... | ALGO | 0.999979 | 3.288907 | {
"github_metadata": {
"branch": "main",
"commit_count": 1484,
"repo_created_at": "2023-10-10T14:00: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": "903c2c464... |
c65b7592-a145-43ec-826e-b3f9a55d3866 | sraihan73/Lucene- | sandbox/src/java/org/apache/lucene/document/LatLonPointDistanceComparator.h | #pragma once
#include "stringhelper.h"
#include <cmath>
#include <limits>
#include <memory>
#include <optional>
#include <string>
#include <deque>
// C++ NOTE: Forward class declarations:
#include "core/src/java/org/apache/lucene/index/SortedNumericDocValues.h"
#include "core/src/java/org/apache/lucene/search/Score... | ALGO | 0.998045 | 7.802131 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2018-10-08T04:50:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e51f935d9b... |
97d662ff-9e82-4ed0-899a-e92649c0b2c0 | bvquoc/CP-Trainning-2021 | 0 - Contest 2020/Ninh Binh PreVNOI 2017/PREVNOIA/Contestants/Ti077/ARRANGE.cpp | #include <bits/stdc++.h>
using namespace std;
ifstream fi("ARRANGE.INP");
ofstream fo("ARRANGE.OUT");
int64_t n,k,sum=0,a[100005],S[100005],C[10000005],F[10000005],c[2005][2005],f[2005][2005];
void Sub1()
{
int64_t res=0,s=0,tmp=sum/n;
for(int64_t i=1; i<=n; i++)
{
s+=a[i]-tmp;
res+=abs(s... | ALGO | 0.999841 | 3.673374 | {
"github_metadata": {
"branch": "master",
"commit_count": 611,
"repo_created_at": "2020-06-03T07:47:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9cfe1b1f... |
248db579-9b98-42fe-92a4-d5bcee6f5997 | poevoid/arduboyTrivia | arduboytrivia.ino |
///Arduboy 2 player trivia
//poevoid
/*
* Alright, so here's the run-down: Player 1 holds their finger over the LEFT button,
* Player 2 over the B button. A timer will count down from 3 and show a question, a
* 10 second timer is represented by a ever-shortening bar at the top and bottom of the screen.
*... | TOOL | 0.985585 | 5.898547 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2021-04-15T02: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": "639a2e2ee1f... |
04103e93-5112-47c2-bc7d-688c7e5e3ba3 | old-yan/CP-template | TEST/local/LCT_test.cpp | #include "IO/FastIO.h"
#include "TREE/LCT.h"
// 只维护树结构的 lct
void test_no_makeroot() {
cout << "lct no make root:\n";
// 不支持换根的树,必须通过 connect_above 加边
OY::LCTTree<false, false, 1000> S(10);
// 十个点,八条边,这个森林有两棵树
S.connect_above(3, 5);
S.connect_above(8, 5);
S.connect_above(6, 7);
S.connect... | ALGO | 0.983339 | 4.266519 | {
"github_metadata": {
"branch": "main",
"commit_count": 390,
"repo_created_at": "2021-06-29T16:22:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 268,
"forks": 43,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "82ac456... |
9361b6f0-ef55-4862-92b0-36f0150de955 | SamuellH12/Competitive-Programming-Algorithms | Solutions/CodeForces/732F - Tourist Reform.cpp | #include <bits/stdc++.h>
#define optimize ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define ALL(x) x.begin(), x.end()
#define endl "\n"
#define ll long long
#define vi vector<int>
#define pii pair<int,int>
#define INF 0x3f3f3f3f
const int MAXN = 1e6 + 5;
using namespace std;
// https://codeforces.com/... | ALGO | 0.999987 | 4.023522 | {
"github_metadata": {
"branch": "master",
"commit_count": 131,
"repo_created_at": "2022-04-12T18:19:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "50c6ad96... |
0d367279-a5dc-405a-9d2c-406f09d80ae2 | tu-rbo/omip | shape_reconstruction/include/vcglib/apps/sample/trimesh_curvature/trimesh_curvature.cpp | /****************************************************************************
* VCGLib o o *
* Visual and Computer Graphics Library o o *
* _ O _ *
* Copyri... | ALGO | 0.923788 | 6.255906 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2016-11-03T13:24:12.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 29,
"forks": 10,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "4083809e... |
c5a8d01a-d941-49ea-b869-5280e6f1d50a | GeoscienceAustralia/ginan | src/cpp/common/acsQC.cpp |
// #pragma GCC optimize ("O0")
#include <iostream>
#include <vector>
#include "observations.hpp"
#include "navigation.hpp"
#include "acsConfig.hpp"
#include "testUtils.hpp"
#include "constants.hpp"
#include "satStat.hpp"
#include "algebra.hpp"
#include "common.hpp"
#include "acsQC.hpp"
#include "trace.hpp"
#include ... | ALGO | 0.986431 | 4.20477 | {
"github_metadata": {
"branch": "main",
"commit_count": 84,
"repo_created_at": "2021-03-25T02:33:40.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 268,
"forks": 116,
"issues": 20,
"pull_requests": 4
},
"file_meta": {
"content_id": "c7bc4d9... |
3c8ced86-3cad-49e3-9f3a-5bd9c4d0a521 | HN026/CAlgo | Tree/EvenOddTree.cpp | #include <iostream>
#include <queue>
#include <limits.h>
using namespace std;
// Definition for a binary tree node.
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode(int x) : val(x), left(NULL), right(NULL) {}
};
class Solution {
public:
bool isEvenOddTree(TreeNode* root) {
... | ALGO | 0.99979 | 6.233954 | {
"github_metadata": {
"branch": "master",
"commit_count": 223,
"repo_created_at": "2023-05-20T07:21: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": "aa4a4cbf... |
7b1c0a70-c6b8-4fc0-8f1a-b18a96c8d4d6 | ikunforever1234/NKU_Parallel-Programming_2025 | lab3/线程池/gue_pool.cpp | #include "PCFG.h"
#include <pthread.h>
#include <iostream>
#include <vector>
#include <atomic>
#include <queue>
#include <functional>
#include <time.h>
#include <thread>
#include <mutex>
#include <condition_variable>
using namespace std;
void PriorityQueue::CalProb(PT &pt)
{
// 计算PriorityQueue里面一个PT的流程如下:
// 1... | ALGO | 0.99993 | 3.567771 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2025-03-27T05:05: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": "3020c2e0b86... |
6a7c5239-4957-424a-97d5-f91c014d16e1 | DariaMruh/lz10 | MyForm.h | #pragma once
namespace lz10 {
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
using namespace System::IO; //клас простору для роботи з файлами
/// <summa... | TOOL | 0.986564 | 3.866615 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2025-05-12T18:21: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": "65b6159a48... |
78737994-ca58-42e3-bd5a-d992d20530ac | Mew463/Project-l0ckcr4ck3r | combobreaker/cracklock.ino |
void crackLock() {
estop = false;
cracked = false;
firstCheckStall = false;
firstComboCheck = true;
Serial.println(" ----- Start -----");
printCombo(-1, -1, -1,1);
lockTime = millis();
findFirstNum();
if (estop)
return;
printCombo(firstNum, -1, -1, 3);
dial(39, CC); // Make sure all the disc... | ALGO | 0.98224 | 5.029725 | {
"github_metadata": {
"branch": "main",
"commit_count": 33,
"repo_created_at": "2022-08-28T04:52:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 64,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a9df9ba622... |
bd8d2538-51d5-4249-8be7-057a573b2562 | MeetThakkar-01/DSALGO | Number Theory/Multiplicative Inverse.cpp |
// Given a number n. Print the multiplicative inverse of “n modulo 1000000007” .
// Input Format
// Single line containing an integer value.
// Constraints
// 1<=n<=1000000
// Output Format
// Integral value representing the multiplicative inverse.
// Sample Input
// 3
// Sample Output
// 333333336
#include<... | ALGO | 0.999947 | 4.455421 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2020-08-03T16:32: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": "bd4d0f7c1d... |
d7b54a1e-3cfe-47fc-a9c7-14d758f75404 | alphaRaWaY/2025ACM | oldlist/graph/0x08/version1.cpp | //开的集合过多,代码冗长
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
const ll INF(0x3f3f3f3f);
const int MaxN(2e5+5);
map<pair<int,int> , int>usd;
struct Edge
{
int p;
ll w;
bool operator < (const Edge & a) const {return w<a.w;}
};
vector<Edge> Adj[MaxN];
ll dis[MaxN];
bool vis[MaxN];
stack<int> ... | ALGO | 0.99988 | 3.832204 | {
"github_metadata": {
"branch": "main",
"commit_count": 34,
"repo_created_at": "2025-01-18T08:47: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": "65057ecfce7... |
ef7b76e5-b5cc-493f-95d5-bc56bd4e2982 | jeayoungho97/CodeStudy | week3/N9934/9934.cpp | #include<bits/stdc++.h>
using namespace std;
int Node[1024], visited[1024];
vector<int> level[11];
void go(int fr, int en, int lev){
if(fr > en) return;
if(fr == en) {
level[lev].push_back(Node[fr]);
return;
}
int mid = (fr + en) / 2;
level[lev].push_back(Node[mid]);
go(fr, mid... | ALGO | 0.999939 | 4.398798 | {
"github_metadata": {
"branch": "main",
"commit_count": 266,
"repo_created_at": "2025-02-12T03:27:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8245262c87... |
fedbf088-cd79-43b8-ac1c-b3cc85fac3d4 | YashChavanWeb/DSA_Complete_Notes | Programs/09_Strings/08_check_if_strings_are_anagram.cpp | #include <bits/stdc++.h>
using namespace std;
/*
// Check if the two given strings are anagram
- in the two given strings the second string is formed by re-arranging the first string then it is called as anagram
- so we have to tell whether the given two strings follow the above rule
Eg: silent -> listen
1. Brut... | ALGO | 0.999981 | 6.386741 | {
"github_metadata": {
"branch": "main",
"commit_count": 38,
"repo_created_at": "2024-12-15T14:59:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cf28a751c34... |
a15f4e78-055d-4c8d-b6e8-ce38c3a17800 | ishandutta2007/codeforces-c | cyand1317/normal/803/A.cpp | #include <cstdio>
#include <algorithm>
static const int MAXN = 104;
int n, k;
int a[MAXN][MAXN];
int main()
{
scanf("%d%d", &n, &k);
if (k > n * n) { puts("-1"); return 0; }
for (int r = 0; r < n && k > 0; ++r) {
int c = std::min(k, (n - r) * 2 - 1);
for (int i = 0; i < (c - 1) / 2 + 1; +... | ALGO | 0.999733 | 3.789796 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:17: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": "b2d1635d9cd7... |
ea5f5d19-2393-4b43-bcb4-54fa00f3d77a | Chiki1601/Hackerearth-Solutions | Algorithms/Graphs/Breadth first search/Question paper.cpp | #include<bits/stdc++.h>
using namespace std;
long long power(long long a, long long b)
{
long long res = 1;
while(b != 0)
{
if(b % 2 != 0)
res = (res * a); //%1000000007;
b /= 2;
a = (a * a); //%1000000007;
}
return res;
}
int main()
{
ios_base::syn... | ALGO | 0.999884 | 4.225968 | {
"github_metadata": {
"branch": "main",
"commit_count": 1808,
"repo_created_at": "2022-09-09T09:13:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 14,
"forks": 2,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
"content_id": "c6ecfb05... |
95ca415d-e066-4b1c-a7fd-64c5f93c0493 | jpricarte/trab-aco | graph-gen.cpp | /**************************************\
* GRAPH GENERATOR. *
* created by Jpricarte, 2023 *
* feel free to use anyway you want *
* params: n m seed, where: *
* n = number of vertices *
* m = number of edges *
* seed = you know, the random seed *
\**************************************... | ALGO | 0.998836 | 3.830791 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2023-09-06T19:14: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": "d7a8daf9b4a6... |
cb0fb55d-3be0-4071-9381-09c1744d6840 | tzw-wen/StringHelper | StringHelper.cpp | /*
* Copyright 2015 <NAME> (<EMAIL>)
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in w... | TOOL | 0.971791 | 4.798289 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2015-03-26T20:08: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": "f53688b8ae... |
d1cadfe2-a52f-48be-8283-e8e4eb9bdbb8 | renesultan/parallel_search_library | src/tests/main_find_all_if_early_termination.cpp | #include <iostream>
#include <vector>
#include <chrono>
#include "../core/find_all_if_early_termination.h"
void test_find_all_if_early_termination()
{
std::cout << "\n=== Find All If Early Termination Analysis ===" << std::endl;
std::vector<size_t> vector_sizes = {10000, 100000, 1000000, 10000000};
std::ve... | ALGO | 0.993641 | 6.691089 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-22T07:08: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": "0798091cdb98... |
d45585e0-f6f1-4e78-bff9-4436faf6f1a4 | Lazar-Ilic/Lazar | Notes/Computer Science/Algorithms/CodeForces/CodeForces 154 D.cpp | // ctzsm
// Interesting case study on fast robust C++
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <iostream>
using namespace std;
int n,m,k;
char t[405][405];
int sum[405][405];
int sam[405];
int cnt[26];
int main(int argc, char** argv) {
freopen("input.txt","r",stdin);
... | ALGO | 0.999921 | 3.520462 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-03-09T15:18:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 17,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b6d1bb7248e... |
23af0958-157a-4b1b-b73d-329e40478a51 | Raiden49/auto_drive | src/reference_line.cpp | /*
* @Author: Raiden49
* @Date: 2024-09-20 10:27:45
* @Last Modified by: Raiden49
* @Last Modified time: 2024-09-25 14:59:21
*/
#include "reference_line.hpp"
namespace auto_drive {
int ReferenceLine::SearchTargetIndex(const double& cur_x, const double& cur_y,
const double& a... | ALGO | 0.999596 | 4.769356 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2024-09-26T06:59:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 37,
"forks": 7,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fe83cfc5... |
edc15a45-cbd6-401b-b082-fcd0a3b7191a | Rainboylvx/pcs | uva/1025/1.cpp | /*-----------------
* author: Rainboy
* email: <EMAIL>
* time: 2019年 05月 19日 星期日 21:09:37 CST
* problem: uva-1025
*----------------*/
#include <bits/stdc++.h>
using namespace std;
const int INF = 0x7fffffff/3;
#define maxn 55 //最大的车站数目
#define maxt 205 //最大的时间
#define maxm 55 //最大的车的数量
int n,t;
int _time[maxn]; //间隔时... | ALGO | 0.99986 | 3.291306 | {
"github_metadata": {
"branch": "master",
"commit_count": 89,
"repo_created_at": "2019-11-03T09:56:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
"content_id": "a7d86e84e... |
7e42908d-4e35-4084-8aa0-3515f8ea22cb | JoshChubi/Academic | Spring2019/Discrete Math/Probability/main.cpp | // <NAME> HW 14 CS 542
#include <iostream>
#include <cstdlib>
#include <algorithm>
#include <string>
#include <vector>
using namespace std;
const char NORTHCHAR = '0';
const char EASTCHAR = '1';
string createSequence(const unsigned & a, const unsigned & b);
bool seqOrdered(const string & sequence, const bool & stric... | ALGO | 0.998979 | 3.788043 | {
"github_metadata": {
"branch": "master",
"commit_count": 156,
"repo_created_at": "2019-04-14T06:28: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": "7be899d2... |
254acbc1-3945-4c49-ba3a-c999adec0099 | RadialFunc/USACO_Problems | 2014/Gold/2014MG2.cpp | #include <bits/stdc++.h>
using namespace std;
float dcplaces(float x){
return round( x * 1000.0 ) / 1000.0;
}
float a[100000];
bool possible(float change, int s){
float b[s];
for(int i=0; i<s; i++) b[i] = a[i]-change;
float total =0; for(int i=0; i<s; i++) total+= a[i];
float best = b[1]; float cu... | ALGO | 0.999888 | 3.327872 | {
"github_metadata": {
"branch": "master",
"commit_count": 83,
"repo_created_at": "2022-04-14T13:54:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "ff1e5a170... |
117ac793-1343-4812-9d5b-19b4045d634a | elliottslaughter/amd-gpu-test | device_kernel_module/saxpy.cc | #include <hip/hip_runtime.h>
#include <stdio.h>
__global__ extern "C" void saxpy(
const size_t num_elements, const float alpha,
const float *x, const float *y, float *z);
#ifdef TERRA_HACK
extern "C" void hip_module_ctor();
#endif
int main() {
#ifdef TERRA_HACK
printf("r... | ALGO | 0.952807 | 5.119171 | {
"github_metadata": {
"branch": "master",
"commit_count": 55,
"repo_created_at": "2021-07-20T20:31: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": "12bbb2718... |
cede77f7-22ea-4528-a15d-a5f916397987 | H1Do/UGATU-Latipov-Niyaz | sem 1/task 1 - 4_3.cpp | // 55523761
// https://contest.yandex.ru/contest/29212/problems/4_3
#include <cassert>
#include <iostream>
class Stack {
public:
Stack();
~Stack();
void push(int a);
int pop();
bool empty() const { return top == -1; }
int Size();
private:
int *buffer;
int buffer_size;
int top;
void BufferBoost()... | ALGO | 0.99992 | 4.62052 | {
"github_metadata": {
"branch": "main",
"commit_count": 159,
"repo_created_at": "2021-09-13T15:02:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0dfdddc207... |
3d586977-ceeb-48a7-a7b9-fe69e219f252 | PakinDioxide/temp | skr_contest/mock_kmutnb_65/tiny-brain.cpp | /*
author : PakinDioxide
created : 22/03/2025 20:43
task : tiny-brain
*/
#include <bits/stdc++.h>
#define ll long long
using namespace std;
int main() {
ios::sync_with_stdio(0), cin.tie(0);
int n;
cin >> n;
int dp[2][150005], a[n+1], sum = 0;
for (int i = 1; i <= n; i++) cin >> a[i... | ALGO | 0.999942 | 4.159616 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2024-12-10T10:36: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": "0ee7fb168fb... |
523ac39b-9249-4768-add9-f9544bcbad01 | google/gapid | gapis/shadertools/cc/common.cpp | /*
* Copyright (C) 2017 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agree... | TOOL | 0.98368 | 6.065334 | {
"github_metadata": {
"branch": "master",
"commit_count": 4208,
"repo_created_at": "2017-02-14T11:18:43.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2226,
"forks": 327,
"issues": 332,
"pull_requests": 3
},
"file_meta": {
"content_id": "b... |
ee49cf9c-2481-41df-9e96-081d5776efa9 | Pozo94/PSI_GCP01_zima_2017-2018_Jacek_Pozowski | Scenariusze/Kody/S1/Źródło.cpp | #include <stdio.h>
#include "perceptron.h"
const int iteration =40, numberOfImputs = 2;
const double learnRate = 0.5;
void wait()
{
while (true)
{
}
}
int main() {
double case1[] = { 0, 0 };
double case2[] = { 0, 1 };
double case3[] = { 1, 0 };
double case4[] = { 1, 1 };
Perceptron *AndGate = Perceptro... | ALGO | 0.999371 | 4.126224 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2018-01-05T05:52: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": "7d273da8d3... |
29099974-dd02-476d-8344-840a1db0ed73 | darkshadoww/Heuristics-CodeForces-GYM | 100540/J.cpp | #include<bits/stdc++.h>
#define assn(n,a,b) assert(n<=b and n>=a)
#define pb push_back
#define mp make_pair
#define PB push_back
#define MP make_pair
#define F first
#define S second
#define SZ(a) (int)(a.size())
#define SET(a,b) memset(a,b,sizeof(a))
#define LET(x,a) __typeof(a) x(a)
#define TR(v,it) for( LET(it,v.beg... | ALGO | 0.999762 | 3.788078 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2016-01-25T07:49:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 29,
"forks": 14,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cb355c80... |
a7ce2879-9fe3-4341-bcc4-b449c70c55b6 | rgsk/cpp-dsa-endgame | src/CSES/8. String Algorithms/3. Finding Borders/main.cpp | #include <bits/stdc++.h>
using namespace std;
// Function to compute the LPS array
vector<int> computeLPSArray(const string& s) {
int n = s.length();
vector<int> lps(n, 0);
int length = 0;
int i = 1;
while (i < n) {
if (s[i] == s[length]) {
length++;
lps[i] = length... | ALGO | 0.999853 | 5.298378 | {
"github_metadata": {
"branch": "main",
"commit_count": 245,
"repo_created_at": "2023-03-14T07:49: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": "6d5e1fc012... |
1b9ab9dd-cda5-4b3d-9a19-2114922a7ef6 | GentleDell/StereoSLAM | src/Usrmath.cpp | #include "usrmath.h"
cv::Matx44d Usrmath::standard_ICP(cv::Mat srcPC, cv::Mat dstPC, cv::Matx44d pose)
{
int flag;
cv::ppf_match_3d::ICP ICP_operator;
cv::ppf_match_3d::Pose3D pose3D;
cv::ppf_match_3d::Pose3DPtr p_pose3D;
std::vector<cv::ppf_match_3d::Pose3DPtr> v_p_pose3D;
pose3D.updatePose(p... | ALGO | 0.998527 | 5.648912 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2018-07-17T12:31:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4436cc8b5... |
2f82fc7f-734f-4dcb-91e6-0582d58cf7e4 | Lombren/NullTerminatedLines34 | main.cpp | #include<iostream>
#include<Windows.h>
#include<conio.h>
//#define CASE_FUNCTIONS
using namespace std;
void InputLine(char szStr[], const int n);
int StrLen(char szStr[]); //Определить длину строки символов.DONE
void UpperCase(char szStr[]); //Переводит строку в верхний регистр.DONE
void LowerCase(char szStr[]); //П... | TOOL | 0.983472 | 3.30297 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2019-05-23T15:26: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": "76abb0d226... |
31b1fafb-8225-40be-8c45-18eb7c98a14c | PlanarG/Code | Practise/6.13/source/丁晓漫/sequence.cpp | #include<bits/stdc++.h>
using namespace std;
const int maxn=50005;
const long long Inf=1e18;
int n,q;
int a[maxn],l[maxn],r[maxn],k[maxn],ord[maxn];
vector<int>ver[maxn];
long long x;
long long ans[maxn],low[maxn],high[maxn];
bool cmp(int u,int v){
return low[u]+high[u]>low[v]+high[v];
}
class Convex{
public:
int... | ALGO | 0.999957 | 4.492153 | {
"github_metadata": {
"branch": "master",
"commit_count": 56,
"repo_created_at": "2020-04-07T07:52:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "893d78355... |
ce40c64b-ad83-438a-8b8b-59f3a589d765 | ROBOTIS-GIT/ROBOTIS-THORMANG-MPC | thormang3_walking_module/src/thormang3_online_walking.cpp | /*******************************************************************************
* Copyright 2018 ROBOTIS CO., LTD.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.o... | TOOL | 0.966225 | 3.911368 | {
"github_metadata": {
"branch": "master",
"commit_count": 321,
"repo_created_at": "2016-03-04T12:03:33.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 17,
"forks": 15,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "26311fe... |
da2c4d78-8ae7-4d45-a247-12ebefb6c16e | emiliot/spoj | lisa.cpp | #include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <vector>
#include <algorithm>
#include <string>
#include <iostream>
#include <sstream>
using namespace std;
typedef unsigned long long i64;
char buffer[1000];
bool mark[200][200];
i64 memo[200][200];
i64 f(string &s, bool flag, i... | ALGO | 0.999943 | 3.684833 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2016-04-29T19:44: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": "24aad9fe8e... |
c1965e87-f352-4cf3-ae1c-44b6dc036c4a | tugrulyatagan/itu_comp_eng_lectures | BIL 105E - Intr to Sci&Eng Comp (C)/Other Examples/degree2.cpp | #include <iostream> // cout,cin,endl
#include <stdlib.h> // EXIT_SUCCESS
#include <math.h> // sqrt
using namespace std;
int main(void)
{
float a, b, c;
float disc;
float x1, x2;
cout << "a, b ve c katsayilarini yaziniz: ";
cin >> a >> b >> c;
disc = b * b... | ALGO | 0.999368 | 3.814598 | {
"github_metadata": {
"branch": "master",
"commit_count": 62,
"repo_created_at": "2020-09-20T11:47:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 18,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "36d831fc... |
526b5282-384e-4555-99d8-7a1702d6a552 | molly5617/macbook | uva/12415.cpp | #include <iostream>
using namespace std;
#include <string>
#include <vector>
#include <algorithm>
int main()
{
int n, target, p;
cin >> n;
while (n--)
{
cin >> target;
cin >> p;
vector<int> v;
for (int i = 0; i < p; i++)
{
int temp;
cin >> ... | ALGO | 0.999971 | 3.967457 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2024-09-19T01: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": "dd6b27e2806... |
1dceb402-01ee-4d89-9c66-3be700305fde | dalanlan/algo | firstMissingPositive.cpp |
/*
LintCode : find first missing positive integer
Given an unordered array of integers, find out the
first missing positive index.
http://www.lintcode.com/zh-cn/problem/first-missing-positive/
*/
class Solution {
public:
/**
* @param A: a vector of integers
* @return: an integer
*/
int fi... | ALGO | 0.999741 | 4.184922 | {
"github_metadata": {
"branch": "master",
"commit_count": 149,
"repo_created_at": "2015-07-12T23:53:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5c52c05b... |
761c0a61-e8eb-41ae-85c8-b94793a206ef | AcubeSAT/adcs-on-board-software | src/SatelliteModel.cpp | #include "SatelliteModel.hpp"
#include "MathFunctions.hpp"
#include "CSSCompensation.hpp"
#include "Parameters.hpp"
using namespace Eigen;
using namespace Parameters::SatelliteModel;
MeasurementVector
SatelliteModel::measurementFunction(const Vector3f magneticField, const Vector3f sunPosition, const bool eclipse,
... | ALGO | 0.947922 | 7.178712 | {
"github_metadata": {
"branch": "master",
"commit_count": 46,
"repo_created_at": "2022-01-19T17:39:54.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 6,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "942679f51b... |
49fe9228-4b1e-41a6-9d3a-98f05b1e3319 | npdoan1996/Data-Structures-and-Algorithms- | assignment1/main.cpp | #include <iostream>
#include <random>
#include <chrono>
#include <algorithm>
void Menu();
void InitArray();
int FreddyAlgo(int*,int);
int SophieAlgo(int*,int);
int JohnyAlgo(int*,int,int);
int SallyAlgo(int*,int);
void testCase1();
void testCase2();
void testCase3();
void testCase4();
void testCase5();
void testC... | ALGO | 0.998968 | 4.426164 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2020-07-18T20:32: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": "f078cd797d... |
81a10bcc-c7b6-4f31-bbb0-e30073a4225a | a063mg/Multiplication-algorithms | LargeInteger.h | #include <iostream>
#include <string>
#include <vector>
#include <random>
using namespace std;
class LargeInteger {
private:
string num;
public:
LargeInteger();
LargeInteger(const int& i);
LargeInteger(const string& s);
static vector<vector<LargeInteger> > table; // Multiplication table
frie... | ALGO | 0.997048 | 3.766827 | {
"github_metadata": {
"branch": "master",
"commit_count": 25,
"repo_created_at": "2020-04-22T10:32:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "f7b1c24c2... |
2e61357f-b5ca-414b-ad1b-48ee38bb6c57 | comeonboi/algorithm-practise | loong's code/leetcode/editor/cn/[530]Minimum Absolute Difference in BST.cpp | /**
<p>Given the <code>root</code> of a Binary Search Tree (BST), return <em>the minimum absolute difference between the values of any two different nodes in the tree</em>.</p>
<p> </p>
<p><strong class="example">Example 1:</strong></p>
<img alt="" src="https://assets.leetcode.com/uploads/2021/02/05/bst1.jpg" style=... | ALGO | 0.999987 | 6.53696 | {
"github_metadata": {
"branch": "main",
"commit_count": 156,
"repo_created_at": "2023-04-04T14:22:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 4,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "16be246e43... |
6a78c252-fc39-4c3c-b9d2-9df9bc7cfc19 | Robotics-UniBG/MarkerBasedNavigation_Orocos | BRICS_RN/TrajectoryFollower/src/RampGenerator.cpp | /********************************************************************************
*
* RampGenerator
*
* Copyright (c) 2012
* All rights reserved.
*
* <NAME>
* ...
* ...
*
* -------------------------------------------------------------------------------
*
* File: RampGenereator.cpp
* Created: May 25, 2012
... | ALGO | 0.997074 | 5.61904 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2012-09-28T12:57:14.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "62d978110b3... |
e96179ba-96fb-4be6-9e38-6ee307d61027 | GValiente/butano | butano/hw/src/bn_hw_palettes.bn_iwram.cpp | /*
* Copyright (c) 2020-2025 <NAME> <EMAIL>
* zlib License, see LICENSE file.
*/
#include "../include/bn_hw_palettes.h"
#include "bn_algorithm.h"
namespace bn::hw::palettes
{
void brightness(const color* source_colors_ptr, int value, int count, color* destination_colors_ptr)
{
auto tonc_dst_ptr = reinterpret... | TOOL | 0.965037 | 6.0718 | {
"github_metadata": {
"branch": "master",
"commit_count": 2349,
"repo_created_at": "2020-01-03T09:35:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1379,
"forks": 80,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5d4... |
c9f005cf-7a34-496a-860b-3cba2dbdeec3 | eyaCherni965/Projet-simulation-de-Tris | Tableau_alea.cpp | /*===========================================================*/
/*
* Module : tableau_alea.cpp
* Par : <NAME>
* Date : 2024-12-10
*
* Description :
*
* Ce module contient les fonctions nécessaires pour générer
* des tableaux aléatoires et effectuer des permutations entre
* les éléments de tableaux. Il pe... | ALGO | 0.916975 | 4.518359 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2025-01-12T00:06: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": "bf87388490d6... |
03094c51-b939-4f4e-ac18-3561c9fffd49 | Jokezor/code_puzzles | spoj_LOCKER.cpp | #include <bits/stdc++.h>
#define ll long long
using namespace std;
ll binpow(ll a, ll b, ll m) {
a %= m;
ll res = 1;
while (b > 0) {
if (b & 1) {
res = res * a % m;
}
a = a * a % m;
b >>= 1;
}
return res;
}
void solution() {
ll n;
cin >> n;
ll res = 0;
ll m = 1000000007;
... | ALGO | 0.999952 | 4.820613 | {
"github_metadata": {
"branch": "master",
"commit_count": 324,
"repo_created_at": "2022-07-13T19:53:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "22bf11ea... |
e0840766-11de-4330-b617-acb99465e0c9 | ermias-vm/EDA | 3_graphAlgorithms/DFS/p90766.cc | //Tresors en un mapa(3)
#include <iostream>
#include <vector>
using namespace std;
vector<pair<int,int>> dirs = {{0,1},{0,-1},{1,0},{-1,0}};
typedef vector<vector<char>> Map;
bool vei_ok(Map& M, int i, int j) {
return i >= 0 and i < int(M.size()) and j >= 0 and j < int(M[0].size()) and M[i][j] != 'X';
}
int nTre... | ALGO | 0.999566 | 4.501205 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-07-03T21:36: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": "ccb84c80183c... |
b9f6cd54-cdb5-4cd3-91f1-e77b4316f9a6 | projeto-de-algoritmos-2024/DividirConquistar_LeetCode_UnB | 23_merge_k_sorted_lists.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:
// funcao principal
... | ALGO | 0.999666 | 6.164568 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2024-12-20T18:31:08.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "38b26f4bb6... |
5dc8ecba-04af-4a32-867c-06b5ee758f48 | lgsvl/apollo-5.0 | modules/planning/math/smoothing_spline/active_set_spline_2d_solver.h | /******************************************************************************
* Copyright 2018 The Apollo Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
... | ALGO | 0.989501 | 6.418647 | {
"github_metadata": {
"branch": "simulator",
"commit_count": 13395,
"repo_created_at": "2019-08-19T21:00:15.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 88,
"forks": 91,
"issues": 0,
"pull_requests": 18
},
"file_meta": {
"content_id": "d... |
7b9503c6-839e-46d9-947f-f897e17b137b | MIC-DKFZ/RTTB | code/models/rttbDoseBasedModels.h | // -----------------------------------------------------------------------
// RTToolbox - DKFZ radiotherapy quantitative evaluation library
//
// Copyright (c) German Cancer Research Center (DKFZ),
// Software development for Integrated Diagnostics and Therapy (SIDT).
// ALL RIGHTS RESERVED.
// See rttbCopyright.txt or... | ALGO | 0.934958 | 6.068542 | {
"github_metadata": {
"branch": "master",
"commit_count": 776,
"repo_created_at": "2018-04-16T13:20:05.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 30,
"forks": 9,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "ec74320a... |
de617d31-9f8f-4a19-b707-e0833dece2a0 | chanwowow/Algorithm-Study | Certi/Pro/집만들기/user.cpp | const int maxN = 122;
const int maxPut = 8005;
#include <iostream>
#include <memory.h>
#include <queue>
#include <unordered_set>
using namespace std;
int map[maxN][maxN]; // ID 할당해준다
int newID;
// UnionFind용
int parent[maxPut];
int findParent(int ID) {
int id = ID;
while (parent[id] != id) id = parent[id];
paren... | ALGO | 0.998793 | 4.052768 | {
"github_metadata": {
"branch": "main",
"commit_count": 43,
"repo_created_at": "2023-05-30T12:27: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": "0afa485dd21... |
6263575f-defa-47a3-a1e5-dadcd25c2501 | rafaelsa99/algorithmic-information-theory | Lab Work 3/GetMaxFreqs/src/GetMaxFreqs.cpp | //
// <NAME>, <EMAIL>, 2016-2020
//
// See:
// http://www.mega-nerd.com/libsndfile
// http://www.fftw.org
//
// In linux, compile with:
// g++ -W -Wall -std=c++11 -o GetMaxFreqs GetMaxFreqs.cpp -lsndfile -lfftw3 -lm
//
// It should accept .wav and .flac audio files, stereo, sampled at 44100 Hz, 16 bits
//
// Example:
/... | ALGO | 0.964553 | 5.301325 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2021-01-23T15:56:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e2b29c3f5e... |
00aafc86-9d3d-4426-bb1d-9b71baba662f | LSUDOKO/CodeForces | Contests/Contest_1/A. Square of Rectangles.cpp | #include <iostream>
#include <cmath>
#include <vector>
using namespace std;
struct Rect {
int l, b;
};
bool can_form_square(Rect a, Rect b, Rect c) {
int total_area = a.l * a.b + b.l * b.b + c.l * c.b;
int side = sqrt(total_area);
if (side * side != total_area) return false;
if (a.b == b.b &&... | ALGO | 0.999061 | 4.577146 | {
"github_metadata": {
"branch": "main",
"commit_count": 49,
"repo_created_at": "2025-06-13T19:16: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": "6cadc0a05ee... |
56ed4175-8ee5-46bd-a499-dcf02d2de907 | jmejias0/SaddlebackRep | Homework2/SecondHomeworkP2.cpp | //====================================================================
// Attached: HW_2a, HW_2b, HW_2c, HW_2d
//
//====================================================================
// File: HW_2b
// ===================================================================
// Programmer: <NAME>
// Class: CS1B
// ========... | ALGO | 0.978713 | 4.0906 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-08-24T23:13: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": "58f1e832b6ce... |
6dee110c-1c3d-4462-8b6c-497e92ecb96f | manya16102003/DSA-practiceQuestions | Difficulty: Medium/Check whether BST contains Dead End/check-whether-bst-contains-dead-end.cpp | //{ Driver Code Starts
//Initial template for C++
#include<bits/stdc++.h>
using namespace std;
struct Node
{
int data;
struct Node *left;
struct Node *right;
Node(int x){
data = x;
left = NULL;
right = NULL;
}
};
void insert(Node ** tree, int val)
{
Node *temp = NULL;
if(!(*tree))
... | ALGO | 0.999831 | 4.360959 | {
"github_metadata": {
"branch": "main",
"commit_count": 155,
"repo_created_at": "2023-09-27T05:45:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4ff5875101... |
573e26a6-072e-4167-98a6-ec238898cca0 | rohit9798/LeetCode | 117_PopulatingNextRightPointersInEachNode2.cpp | Given a binary tree
struct Node {
int val;
Node *left;
Node *right;
Node *next;
}
Populate each next pointer to point to its next right node. If there is no next right node, the next pointer should be set to NULL.
Initially, all next pointers are set to NULL.
Follow up:
You may only use constant extra sp... | ALGO | 0.999992 | 5.947413 | {
"github_metadata": {
"branch": "master",
"commit_count": 335,
"repo_created_at": "2020-02-28T16:40:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d411f7c6... |
e64d9cfd-3087-4570-aed8-ca28e02bcd65 | scottgood333/leetcodePractice | 21_merge_two_sorted_lists.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution
{
public:
ListNode *mergeTwoLis... | ALGO | 0.999907 | 5.825234 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-03-18T22:54: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": "a025fdc9502e... |
9fccd97f-3020-4291-92c3-36559bb567ab | AndreyVLD/Ray-Tracing-Engine | src/shading.cpp | #include "render.h"
#include "texture.h"
#include <cmath>
#include <fmt/core.h>
#include <glm/geometric.hpp>
#include <glm/gtx/string_cast.hpp>
#include <shading.h>
// This function is provided as-is. You do not have to implement it (unless
// you need to for some extra feature).
// Given render state and an intersect... | ALGO | 0.945197 | 6.921929 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2023-11-29T23:35: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": "10aedca36294... |
7709962d-f309-488c-b701-def3613de085 | sabaunach/cp | euler/0-99/0-9/7/7.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define fi first
#define se second
typedef pair<int, int> pii;
#define UMAX(a,b) a = max(a,b)
#define UMIN(a,b) a = min(a,b)
int main() {
// x/log x as prime-counting function
// has <15% error, <10% for n>=10^5, <5% for n>=10^10
// x/l... | ALGO | 0.999118 | 3.324665 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2022-12-15T22:22: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": "37b0e2194... |
334b0199-bcf4-4f29-bf22-674a84d84db4 | hackerlank/Learn | Parctice/2013/June/Server/include/day_limit_item.h | #ifndef _DAY_LIMIT_ITEM_H_
#define _DAY_LIMIT_ITEM_H_
#include<map>
#include<string>
using namespace std;
#define MAX_DAY_LMT_ITEM_SIZE 400
//每日都会更新但每日有次数限制的项目,如签到,日更新活动,日常任务,帮派任务等
typedef struct DayLimitItem_S
{
char id[32]; //项目Id
int limit; //项目每天的限制次数, limit要求是大于0
int value; //当日项目已经做过的次数
DayLimitI... | TOOL | 0.972932 | 3.436141 | {
"github_metadata": {
"branch": "master",
"commit_count": 128,
"repo_created_at": "2016-12-02T15:37:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "004e899b... |
56f2cf35-1871-4a7b-9a76-c14e0f727ab5 | e5pe0n/algorithm-training | cracking_the_coding_interview_6th/chapter10/cpp/10_05_v01.cpp | #include <fstream>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
using ll = long long;
ll bs(const vector<string> &v, const string &x) {
ll left = 0;
ll right = v.size() - 1;
bool to_left = true;
while (left <= right) {
ll mid = (left + right) / 2;
ll _mid = mid;
whil... | ALGO | 0.999866 | 4.256176 | {
"github_metadata": {
"branch": "master",
"commit_count": 571,
"repo_created_at": "2019-12-09T13:22:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 8
},
"file_meta": {
"content_id": "61b4a90c... |
5a82b337-bda2-4473-af45-46ac9d658c2e | r-d-s-l-w/competitive-programming | USACO/Wormholes.cpp | /*
ID: radek.m1
TASK: wormhole
LANG: C++11
*/
#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define ALL(x) (x).begin(),(x).end()
#define endl '\n'
#define DEBUG(x) cout << '>' << #x << ": " << x << endl;
#define REP(... | ALGO | 0.999837 | 3.639714 | {
"github_metadata": {
"branch": "master",
"commit_count": 589,
"repo_created_at": "2020-02-05T09:36: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": "26167789... |
2f2a7d53-8570-49c2-8b5f-038fc30fe47d | VasiliBaranov/packing-generation | Externals/Boost/boost/numeric/odeint/iterator/impl/adaptive_iterator_dense_output_impl.hpp | /*
[auto_generated]
boost/numeric/odeint/iterator/detail/adaptive_iterator_dense_output_impl.hpp
[begin_description]
tba.
[end_description]
Copyright 2009-2012 <NAME>
Copyright 2009-2012 <NAME>
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or
co... | ALGO | 0.931046 | 7.473536 | {
"github_metadata": {
"branch": "master",
"commit_count": 32,
"repo_created_at": "2015-07-06T10:33:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 117,
"forks": 46,
"issues": 30,
"pull_requests": 0
},
"file_meta": {
"content_id": "d12f7... |
54482e0c-847f-47a9-b8cb-5e68d4fd2cba | if1t/fpp-rostislav | merge_sort.cpp | #include <iostream>
#include <vector>
#include <random>
#include <omp.h>
using namespace std;
vector<int> merge(vector<int> a, vector<int> b) {
vector<int> ans;
for (int i = 0, j = 0; i < a.size() || j < b.size();) {
if (i >= a.size()) {
while (j < b.size()) {
ans.push_bac... | ALGO | 0.999889 | 4.616487 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2022-02-13T12:39: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": "be43610169b... |
0dab847a-d44e-49d1-bf07-4d514b472830 | LuizaMannes/Competitive_Programming | CSES_problems/tree_algorithms/distance_queries.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define endl '\n'
const int mx=2e5+5;
const int L=20;
vector<int> adj[mx];
int up[mx][L];
int dep[mx];
void dfs(int u,int p){
for(int i=1;i<L;i++) up[u][i]=up[up[u][i-1]][i-1];
for(auto v:adj[u]){
if(p!=v){
dep[v]=dep[... | ALGO | 0.99992 | 4.885865 | {
"github_metadata": {
"branch": "main",
"commit_count": 69,
"repo_created_at": "2025-04-28T02:10: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": "4bc96ce589b... |
55db9834-c8fd-4e01-8e80-79f4bade3581 | Xayoteh/advent-of-code | 2015/puzzles/03/day03.cpp | #include <fstream>
#include <iostream>
#include "day03.hpp"
#include "../../tools/directions.hpp"
using namespace AoC2015::Puzzles;
using namespace AoC2015::Tools;
using std::cout, std::endl;
using std::string;
using std::unordered_set;
const string Day03::FILENAME = "puzzles/03/input.txt";
void Day03::run()
{
... | ALGO | 0.999667 | 5.741742 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2025-01-12T21:17:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1f6321488541... |
d2825499-41b4-4762-bac8-def69f16ce07 | Pkataki/Problem_Solving | uva/13008.cpp | #include<bits/stdc++.h>
using namespace std;
int d,p,r,b;
vector<int>rivals[2004];
int dsp[105];
int ppp[105];
int dp[101][1005];
int solve_dsp(int pos, int w)
{
if(pos > p)
{
return 0;
}
if(dp[pos][w] != -1)
{
return dp[pos][w];
}
int ans = INT_MIN;
int sum = 0;
for(int i = 0; i < rivals[d+pos].size(); i... | ALGO | 0.999847 | 3.327898 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2017-11-27T18:35:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a749b1b1bd... |
6ced5e7e-c633-4478-b883-523c22b41cc3 | marinaKollmitz/lattice_planner | src/heuristics.cpp | /*******************************************************************************
*
* Software License Agreement (BSD License)
*
* Copyright (c) 2015 <NAME>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following co... | ALGO | 0.989457 | 7.251343 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2015-06-30T15:11:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 232,
"forks": 86,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8dcb4c... |
2ad3ca50-2a51-4a63-85aa-6a4dca360429 | TechMelon/Oops-Problem | question3.cpp | // Modify the Rectangle class to include a method compareArea() that takes another Rectangle object as an argument and uses the this pointer to compare the area of the current object with the passed object.
#include<iostream>
using namespace std;
class Rectangle{
private:
int length,breadth;
public:
Rec... | TOOL | 0.998385 | 5.533713 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2024-12-26T05:07: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": "cd7677f2bb64... |
c388539d-79b2-4ff5-839e-25c599708aa3 | ar1936/leetcode | 525-contiguous-array/525-contiguous-array.cpp | class Solution {
public:
// int findMaxLength(vector<int>& nums) {
// int n=nums.size(),ans=0;
// for(int i=1;i<n;i++){
// nums[i]=nums[i]+nums[i-1];
// if(2*nums[i]<=i+1){
// ans=max(2*nums[i],ans);
// }
// }
// for(auto x:nums){
... | ALGO | 0.999959 | 4.715314 | {
"github_metadata": {
"branch": "main",
"commit_count": 2108,
"repo_created_at": "2021-01-07T05:00: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": "398b9a210... |
a84b4ab3-cdb3-418e-ba77-e408add12064 | Scipo/C | dataStructures/linklist/linklist.cpp | #include<iostream>
using namespace std;
struct node
{
int data;
node* linkNext;
};
//node* head;//global variable
//insert the node
void insert(node** head,int x)
{
node* tmp = new node();
tmp->data = x;
tmp->linkNext = NULL;
if(*head!=NULL) tmp->linkNext = *head;
*head = tmp;
}
//Insert th... | ALGO | 0.999515 | 4.121992 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2022-12-17T20:02: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": "503164a3decc... |
9d9382e0-fd90-47c4-9984-ab20958e2316 | jovid18/problem_solving | atcoder_training/097.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define pii pair<int, int>
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
int lcm(int a, int b) { return a / gcd(a, b) * b; }
int cnt(int a, int b, int x, int y) {
if (a == 0) {
if (b >= x && b <= y) return -1;
return 0;... | ALGO | 0.99998 | 3.897265 | {
"github_metadata": {
"branch": "main",
"commit_count": 841,
"repo_created_at": "2024-01-14T07:53: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": "94a69e1398... |
c0680046-f9a3-4660-9bc9-aae4ce8a3153 | JanaSabuj/Leetcode-solutions | Session 2019/690.cpp | /*
// Employee info
class Employee {
public:
// It's the unique ID of each node.
// unique id of this employee
int id;
// the importance value of this employee
int importance;
// the id of direct subordinates
vector<int> subordinates;
};
*/
class Solution {
public:
int getImportance(vect... | ALGO | 0.999947 | 5.758722 | {
"github_metadata": {
"branch": "master",
"commit_count": 780,
"repo_created_at": "2019-01-13T14:59:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 13,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "48ec225... |
4e0c069f-90f9-43c1-b740-6c6dadbcc2c0 | kimtaehyun98/Jandi | 2021.11/boj_2729.cpp | #include <bits/stdc++.h>
using namespace std;
int calc(int temp,deque<int>& dq) {
int ret = 0;
if (temp < 2) dq.push_front(temp);
else {
dq.push_front(temp % 2);
ret = 1;
}
return ret;
}
int main() {
string a, b;
int t;
cin >> t;
while (t--) {
deque<int>dq;
cin >> a >> b;
int size = max(a.size(), b... | ALGO | 0.999987 | 4.683702 | {
"github_metadata": {
"branch": "main",
"commit_count": 337,
"repo_created_at": "2021-07-26T12:19:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8019ad1bd3... |
97456172-57ba-4e88-86c3-3671f95a0fda | allagolub/Programming_3_sem | solutions/C_2.cpp | #include <iostream>
#include <vector>
#include <queue>
struct Coord {
int64_t x_;
int64_t y_;
Coord(int64_t coord_x, int64_t coord_y) : x_(coord_x), y_(coord_y) {
}
Coord() = default;
friend bool operator==(const Coord& first, const Coord& second) {
return ((first.x_ == second.x_) && (fi... | ALGO | 0.999933 | 4.549263 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-12-14T18:36:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8e4d82b9710a... |
be5c567d-7836-483f-bc21-1343ce1d824b | kbcgang/kbc | KBB TIME/C++/DO-for-fun/Bacthang.cpp | ///Hãy làm Sư tử, đừng làm Nai.😅😅😅
///Hãy làm thợ săn, đừng làm con mồi.
/// --- <EMAIL> ---
///☆*: .。. o(≧▽≦)o .。.:*☆
#include <bits/stdc++.h>
using namespace std;
#define kien long long
#define JAV main
#define Million 1000000
#define NT 10000000
#define MOD 1000000007
kien n,k,m,dem,f[NT + 5], a[1000000];
kien ma... | ALGO | 0.999866 | 3.396651 | {
"github_metadata": {
"branch": "main",
"commit_count": 57,
"repo_created_at": "2024-11-22T08:35:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "163e8d31b51... |
8404c290-5eb1-444a-9a24-c08a642ac13d | Baplisca/AtCoder-Submission | atcoder.jp/tokiomarine2020/tokiomarine2020_c/Main.cpp | #include <bits/stdc++.h>
using namespace std;
//#define int long long
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<n;++i)
#define exrep(i, a, b) for(ll i = a; i < b; i++)
#define out(x) cout << x << endl
#define EPS... | ALGO | 0.999979 | 3.584093 | {
"github_metadata": {
"branch": "master",
"commit_count": 1610,
"repo_created_at": "2020-08-25T04:37: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": "b9fc11c... |
c48dd3ac-073d-4e37-9ad3-b011a1182083 | mzry1992/workspace | contest/2012summer/UESTC Summer Training #5 Division I/B.cpp | #include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstring>
using namespace std;
int lc,fail[70];
int nxt[70][2][2][70][4];
bool dp[70][2][2][70],flag[70][2][2][70];
bool sa[70],sb[70],sc[70],tsc[70];
long long a,b,p;
bool DP(int pos,int u,int d,int ppos)
{
if (pos == 60)
return ppos == ... | ALGO | 0.999828 | 4.259251 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2012-11-03T05:40:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7256ea915... |
3aea3afd-2104-4433-b3dc-cb621f84bbe7 | lialittis/Show-Me-The-Code | Leetcode/sort/kth_largest_element_in_an_array_215.cpp | #include <vector>
using namespace std;
class Solution{
public:
// quick sort
int findKthLargest(vector<int>& nums, int k){
int l = 0, r = nums.size()-1;
while (l<r)
{
int mid = quickselection(nums, l, r);
if(mid = nums.size() - k) return nums[mid];
i... | ALGO | 0.999948 | 5.456079 | {
"github_metadata": {
"branch": "main",
"commit_count": 64,
"repo_created_at": "2021-10-04T17:43: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": "68c3f294af2... |
cfc081ac-3d95-46f1-99bc-dbbef0d6c15f | rmfarber/ParallelProgrammingWithOpenACC | Chapter04/cpp/task4/main_solution.cpp | #include <cstdio>
#include <cstdlib>
#include <fstream>
#include <cstring>
#include <omp.h>
#include <openacc.h>
#include "mandelbrot.h"
#include "constants.h"
using namespace std;
int main( int argc, char **argv ) {
size_t bytes=WIDTH*HEIGHT*sizeof(unsigned int);
unsigned char *image=(unsigned char*)malloc(by... | ALGO | 0.99458 | 4.941207 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2016-05-31T14:58:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 86,
"forks": 35,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "05ed014... |
9cdaf1c7-a0f1-4c74-9986-af07cd831f35 | Hunterdii/GeeksforGeeks-POTD | January 2025 GFG SOLUTION/January-25.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
struct Node {
int data;
Node *next;
Node(int x) {
data = x;
next = NULL;
}
};
void printList(Node *node) {
while (node != NULL) {
cout << node->data << " ";
node = node->next;
}
cout << "\... | ALGO | 0.999718 | 5.197651 | {
"github_metadata": {
"branch": "main",
"commit_count": 3732,
"repo_created_at": "2024-03-09T09:48:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 202,
"forks": 54,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1ca190... |
6bac9e1d-eff1-487c-becb-9d4c99fc0b7b | FIUP/Programmazione-1 | Esercizi assegnati/2015-2016/Esercizio (27) Esercizio_1_27_4_2016.cpp | #include <iostream>
using namespace std;
bool fin(int *x, int i, int *P, int dimP){ //controlliamo effettivamente il match
if(dimP){ //se c'è ancora pattern
if(x[i] != P[0]) //se l'elemento considerato non coincide con il primo elemento del pattern
return false; ... | ALGO | 0.998901 | 3.722854 | {
"github_metadata": {
"branch": "master",
"commit_count": 163,
"repo_created_at": "2017-01-26T16:01:07.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 14,
"forks": 14,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "392acc1... |
b433bd05-2617-4e3b-b119-2609a540b877 | vinic011/sudoku | sudoku.cpp | #include "sudoku.hpp"
bool sudoku::check_xy()
{
vector d = {1,2,3,4,5,6,7,8,9};
//check vertical lines
for(int i = 0; i < 9; i++)
{
vector aux;
for(int j = 0; j < 9; j++)
{
aux.push_back(values_[i][j]);
}
std::sort(aux.begin(), aux.end());
if... | ALGO | 0.989183 | 4.841911 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2021-09-27T15:47:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "436f5cda3be2... |
2dedef92-4f5a-4ce9-9c74-f33589cbda6d | whztt07/FishEye | fishEyeDemo/fishEyeDemo/PanoramaCorrect.cpp | #include "stdafx.h"
#include "PanoramaCorrect.h"
CPanoramaCorrect::CPanoramaCorrect()
{
}
CPanoramaCorrect::~CPanoramaCorrect()
{
if (position!= NULL)
{
free(position);
position = NULL;
}
if (positionShift != NULL)
{
free(positionShift);
positionShift = NULL;
}
}
void CPanoramaCorrect::ParamInit()
{
... | TOOL | 0.960227 | 4.590136 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2016-03-05T05:39:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8519bab5db... |
1ad01987-2765-49f6-88da-b545df227332 | RITCHIEsingh/cp-journey | 1794B.cpp | #include <bits/stdc++.h>
//Author : ritchie_s
#define for0(i, n) for (int i = 0; i < (int)(n); ++i) // 0 based indexing
#define for1(i, n) for (int i = 1; i <= (int)(n); ++i) // 1 based indexing
#define forr0(i, n) for (int i = (int)(n) - 1; i >= 0; --i) // reverse 0 based
#define forr1(i, n) for (int i = (int)(n); i >... | ALGO | 0.99978 | 3.194855 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2024-12-29T14:55:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "63202ab20... |
d820af7c-0ad7-4594-bde8-48a6c9a4449c | SaiVamshiK/revised-ds | DP/Arithmetic Slices.cpp |
An integer array is called arithmetic if it consists of at least three elements and if the difference between
any two consecutive elements is the same.
For example, [1,3,5,7,9], [7,7,7,7], and [3,-1,-5,-9] are arithmetic sequences.
Given an integer array nums, return the number of arithmetic subarrays of nums.
A su... | ALGO | 0.999563 | 5.783065 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2022-03-20T15:43: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": "4748c41cb6... |
6b46329e-dcf2-4291-bb31-0f9ce246abe1 | NYCU-PCCA/NYCU_MyGO | codes/data-structure/lazy_segtree.cpp | template<class S, class T> // [l,r)
struct Seg { // init S(), T() / upd T(S&) T(&T) / S+S
Seg<S, T> *ls{}, *rs{};
int l, r; S d{}; T f{};
Seg(int _l, int _r, auto&& v) : l{_l}, r{_r} {
if (r - l == 1) { d = v[l]; return; }
int mid = (l + r) / 2;
ls = new Seg(l, mid, v);
rs = new Seg(mid, r, v);
... | ALGO | 0.999854 | 5.680973 | {
"github_metadata": {
"branch": "main",
"commit_count": 129,
"repo_created_at": "2024-08-27T17:10:21.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4582cd5d775... |
20d4c6d3-4847-429c-b6de-8beeaef6c1df | CesarinGood/OMICH | OMICH-2022/Enero2022/Día 3 (sort, priority_queue)/Ocupados/100A.cpp | #include <bits/stdc++.h>
using namespace std;
int countSwaps(vector<int>& arr, int desc) {
int n = arr.size();
vector<pair<int, int>> arrPos(n);
for (int i = 0; i < n; i++) {
arrPos[i].first = arr[i];
arrPos[i].second = i;
}
sort(arrPos.begin(), arrPos.end());
if (desc == 1) {
reverse(arrPos.... | ALGO | 0.99999 | 4.343443 | {
"github_metadata": {
"branch": "master",
"commit_count": 45,
"repo_created_at": "2022-05-06T04:32: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": "4236ee819... |
11d6b8db-a7cf-439a-bcc1-51aa98b3fc4e | iCodeIN/Competitive-Programming-11 | CodeForces/Codeforces Round #751 (Div. 2)/C_Array_Elimination.cpp |
// // // // // // // // // // // // // // // // // // // // // // // //
/* author : pasricha_dhruv */
// // // // // // // // // // // // // // // // // // // // // // // //
#include <algorithm>
// #include <bits/stdc++.h>
// #include <cmath>
#include <iostream>
// #include <map>
// #include <set>
// #in... | ALGO | 0.999962 | 5.2114 | {
"github_metadata": {
"branch": "master",
"commit_count": 211,
"repo_created_at": "2022-03-22T12:10:57.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "880bc46e1... |
a6cd1ba1-fac4-47b9-b518-3fa7d5d46440 | Evantopian/DS-ALG | Trees/AVLTrees/avl_tree.h | #ifndef AVL_TREE_H
#define AVL_TREE_H
#include "dsexceptions.h"
#include <algorithm>
#include <iostream>
using namespace std;
// AvlTree class
//
// CONSTRUCTION: zero parameter
//
// ******************PUBLIC OPERATIONS*********************
// void insert( x ) --> Insert x
// void remove( x ) --> Remove x... | ALGO | 0.996099 | 4.517344 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2022-12-01T19:04: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": "20fd0f08c7... |
64ba9466-c264-45a3-a670-82fa3c69933d | harrybp/advent_of_code_2020 | day_14/part2.cpp | #include <cstdio>
#include <iostream>
#include <fstream>
#include <vector>
#include <map>
// Recursive function to expand a string with X's in to all possible
// combinations of replacing the X's with either 0's or 1's
std::vector<std::string> getAllCombos(std::string bitMask){
std::vector<std::string> combos;
... | ALGO | 0.993758 | 4.536435 | {
"github_metadata": {
"branch": "main",
"commit_count": 25,
"repo_created_at": "2020-12-01T19:57: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": "4c1a15b8050... |
3da819dc-e443-4d13-a080-29d386996d68 | Rythe-Interactive/Rythe-Standard-Library | src/rsl/impl/math/trigonometric/tan_vector.inl | #pragma once
namespace rsl::math::internal
{
template <typename T>
struct compute_tan;
template <typename Scalar, size_type Size, storage_mode Mode>
struct compute_tan<vector<Scalar, Size, Mode>>
{
using vec_type = vector<Scalar, Size, Mode>;
[[nodiscard]] [[rythe_always_inline]] constexpr static vec_type c... | ALGO | 0.917508 | 7.595756 | {
"github_metadata": {
"branch": "main",
"commit_count": 239,
"repo_created_at": "2022-12-27T18:50:18.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b7025d180f1... |
692d6157-af0e-4000-a4d8-1aeb2c2f619e | JocelynHub/leetCode | 200.岛屿数量.cpp | /*
* @lc app=leetcode.cn id=200 lang=cpp
*
* [200] 岛屿数量
* 思路DFS深度优先搜索
* BFS宽度优先搜索
*/
// @lc code=start
#include <vector>
#include <queue>
using namespace std;
class Solution {
public:
int numIslands(vector<vector<char>>& grid) {
int islandNum = 0;
vector<vector<int>>mark;
for (int i ... | ALGO | 0.999901 | 6.257066 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2021-03-06T10:57:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e46f0182d47e... |
87573ff3-a62c-4e8a-814a-8da4e9aec28f | Chameison/Quest-esC | questoes/questao07 - lista09.cpp | #include <stdio.h>
#include <string.h>
#include <iostream>
#include <locale.h>
#include <stdlib.h>
#include <ctype.h>
#define R 3
#define C 10
#define P1 1
#define P2 1
#define P3 1
int main(){
setlocale (LC_ALL,"Portuguese");
int notas[R][C];
int i, j, menor, prova1, prova2, prova3, notaMenor, notaMenor2, not... | ALGO | 0.990543 | 3.720362 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2022-08-01T19:38:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "02af754e151c... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.