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 |
|---|---|---|---|---|---|---|---|
a047c00d-81a1-4f82-b6fa-203002429577 | yulinglingling/Minichess | src/policy/mcts.cpp | #include <iostream>
#include <cstdlib>
#include <fstream>
#include <cstdlib>
#include <climits>
#include <algorithm>
#include "../state/state.hpp"
#include "./mcts.hpp"
/**
* @brief Randomly get a legal action
*
* @param state Now state
* @param depth You may need this for other policy
* @return Move
*/
floa... | ALGO | 0.998693 | 4.180804 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2023-06-18T02:57: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": "8372a987f610... |
0f83c818-3e6f-4327-8a2c-fceac84a808c | rodrigobsm/octopus_one | octopus_two.ino | /*********************************************************
* PROJETO ESTATOSFERA UNIFEOB - www.unifeob.edu.br
* Este codigo fonte faz parte do computador de bordo
* Octopus One e seu codigo fonte pode ser usado livremente
* Prof. Resp.: <NAME>
* <EMAIL> e demais alunos/desenvolvedores
* Ultima atualizacao: 17/06/2015
*... | TOOL | 0.91658 | 6.410423 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2015-10-08T06:26: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": "9a125b9e16... |
ce2782fa-803d-4a7a-a7af-e3420f308544 | yuede/small_graph | bfs/bfs_multi_invoke.cpp | /**
File name: bfs_small_graph.cu
Author: <NAME>
Last update: 14:10 10-14-2015
Description: BFS on small graph
(1) read begin position, csr from binary file
(2) using shared memory
**/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "wtime.h"
#include "graph.h"
using namespace std;
//... | ALGO | 0.999495 | 3.709809 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2015-10-16T15:48: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": "a543b5793d... |
e0a09f03-bb6b-44fd-b822-95fd5c5b7706 | maxsnew/CHamsa | sig_gen.cpp | /*
**************************************************************************
*
* N o r t h w e s t e r n U n i v e r s i t y
*
* Hamsa - Polymorphic Worm Signature Generation Project -- <NAME>
* ... | ALGO | 0.955382 | 3.69559 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2013-05-22T17:28: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": "d0a25a4063... |
5c4159b1-e882-42e0-8416-2ba47f885fb9 | aalekhm/Templates | TechTalk_MichiganHackers_AndyModell_C++AdvancedTopicsInTemplates/7. Writing a Tuple/tuple.h |
// - Any number of combo types.
// - No type information needed at runtime.
// - 'get<n>' function lets us access the nth element of the tuple.
namespace VariadicTemplates
{
// Incomplete declaration of Tuple template
template <typename... Ttypes>
class Tuple;// ^
// |___________________________ Variadic para... | TOOL | 0.934744 | 5.769006 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2018-11-19T19: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": "0e0af1bd49... |
71eb5789-8968-49d7-86b0-a85867cee459 | Sarumathi-Devi/Placement-Interview-Questions | Alternate prime numbers with the range in descending order.cpp | //INPUT : 20
//OUTPUT : 19 13 7 3
#include <bits/stdc++.h>
using namespace std;
int main()
{
int num;
cin >> num;
bool arr[num+1];
memset( arr, true, sizeof(arr) );
int start = 2;
int multiple = 0;
while ( start < sqrt(num) )
{
if ( arr[start] == true )
{
... | ALGO | 0.999901 | 3.947465 | {
"github_metadata": {
"branch": "main",
"commit_count": 74,
"repo_created_at": "2022-02-26T09:42: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": "a73d962612b... |
e9206344-80e1-437f-8f4a-be235ef7fe36 | cjk2889/SWExpertAcademy | 1263/main.cpp | #include <cstring>
#include <iostream>
#include <queue>
#include <algorithm>
using namespace std;
#define INF 999999
int N;
int map[1000][1000];
int dist[1000];
int dij(int s, int e) {
memset(dist, INF, sizeof(dist));
priority_queue<int> q;
q.push(s);
dist[s] = 0;
while(!q.empty()){
in... | ALGO | 0.999936 | 4.621686 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2021-01-18T09:04: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": "2bf5b5ab6cc... |
e62d3f05-4ec0-41b4-a23c-d9b98238fbf9 | nnk03/robot-implementation-and-methods | arduino/servo-motor/servo-first/servo-first.ino | #include <Servo.h>
#include <math.h>
Servo shoulder;
Servo elbow;
int shoulderPin = 5;
int elbowPin = 6;
double centreX = 0;
double centreY = 10;
double l1 = 9;
double l2 = 8;
double currentTheta = 0;
double stepTheta = 5;
double A = 4;
double K = 0.5;
double xRose, yRose;
double sg; // shoulder to ground
doubl... | ALGO | 0.987111 | 4.571277 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2024-09-10T10:20:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f752b74f76d... |
780e7fd6-37e6-46f4-a842-1262eab4df09 | oxygen-hunter/Flashboom | data/big-vul-100/add_attention_code/Phi/top0-100/maximal-square-Solution3.maximalSquare/177747_DoS.cpp | bgp_attr_unknown (struct bgp_attr_parser_args *args)
{
bgp_size_t total;
struct transit *transit;
struct attr_extra *attre;
struct peer *const peer = args->peer;
struct attr *const attr = args->attr;
u_char *const startp = args->startp;
const u_char type = args->type;
const u_char flag = args->fla... | ALGO | 0.925388 | 6.227615 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2025-03-22T14:39:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "66fa5037502c... |
05330187-d41f-46c5-94a5-5a18913605d4 | Madssb/FYS3150_H22_4_pers | Project_1/task_9/problem9.cpp | #include <iostream>
#include <vector>
#include <cmath>
#include <string>
#include <fstream>
#include <chrono>
/*
Problem 9 on FYS3150 project 1. Implementing the Thomas-algorithm as special as possible for the
tridiaginal matrix A with signature (-1, 2, -1).
Then
bt_i = 2 - 1 / bt_(i-1) since a, c = -1, a*c = 1, b_i =... | ALGO | 0.999957 | 4.47934 | {
"github_metadata": {
"branch": "main",
"commit_count": 221,
"repo_created_at": "2022-08-25T10:28:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "85207dcf6c... |
279075df-df9a-4c02-9bc4-03c0847de167 | Annoyshah/Cp-Dsa-Solutions | D_Mathematical_Problem.cpp | /*ॐ श्री गणेशाय नमः || */
/* ॐ नमः पार्वती पतये हर हर महादेव */
/* कर्पूरगौरं करुणावतारं संसारसारं भुजगेन्द्रहारम्। सदा बसन्तं हृदयारविन्दे भवं भवानीसहितं नमामि।। */
/* ॐ नमो भगवते वासुदेवाय */
#include "bits/stdc++.h"
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
u... | ALGO | 0.999491 | 4.612605 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2024-06-20T10:44: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": "96af714b8c... |
18da3387-29e2-483f-8bbe-cf29473dcefd | kinantanbagaspati/competitive-programming | CodeForces/1216E2.cpp | #include<bits/stdc++.h>
using namespace std;
#define pll pair<long long, long long>
long long getLen(long long x){
long long pw10 = 10, pw = 1, ans = 0;
while(pw10 <= x){
ans += (x + 1 - pw10/10 + x + 2 - pw10) * pw10 / 20 * 9 * pw;
pw10 *= 10; pw++;
} // pw10/10 <= x < pw10
x -= pw10/1... | ALGO | 0.999811 | 3.990667 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2023-03-07T09:45: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": "5405d1b3fa... |
6cdee6b2-9822-40fd-b13c-4b2315deb308 | raincross7/code-similarity | codes/train_code/problem320/problem320_376.cpp | #include <iostream>
#include <vector>
#include <set>
#include <algorithm>
int main() {
int n, m;
std::cin >> n >> m;
std::vector< std::pair<long long, long long> > drinks;
for (int i = 0; i < n; i++) {
long long a, b;
std::cin >> a >> b;
drinks.push_back(std::make_pair(a, b));
}
std::sort(drink... | ALGO | 0.99993 | 3.971178 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-03-06T05:07:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ee92f121dc34... |
b0372d97-fdee-4db9-8daa-f3e8131c6961 | Nitish-JS/Leetcode | Stock buy and sell II - GFG/stock-buy-and-sell-ii.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
class Array
{
public:
template <class T>
static void input(vector<T> &A,int n)
{
for (int i = 0; i < n; i++)
{
scanf("%d ",&A[i]);
}
}
template <class T>
static void print(vector<T> &A)
... | ALGO | 0.999904 | 5.563766 | {
"github_metadata": {
"branch": "main",
"commit_count": 2273,
"repo_created_at": "2022-07-12T12:17:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "9906a34f4... |
deec4a31-0fb7-45d2-bf47-349c3250fc7a | SCUTMSC/SCUT-Course | 软件学院/数据结构/源码/ListTest.h | // From the software distribution accompanying the textbook
// "A Practical Introduction to Data Structures and Algorithm Analysis,
// Third Edition (C++)" by <NAME>.
// Source code Copyright (C) 2007-2011 by <NAME>.
// Full template version of find function
template <typename Key, typename E, typename Compare, typena... | TOOL | 0.961058 | 5.706152 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2019-09-02T14:58:58.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 12,
"forks": 6,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0b00410fb... |
848774f8-7520-4c07-80a4-653a245d95c2 | tonoysheikh/comparative-programming-cpp- | codeforce/vessel.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define nl '\n'
#define pb push_back
#define ppb pop_back
#define mp make_pair
#define mod 1000000007
#define pi 3.1415926535897932384626433832795
#define lpz(i, a, b) for (int i=a; i<b; i++)
#define lp(i, a, b) for (int i=a; i<=b; i++)
#define t... | ALGO | 0.99992 | 4.08224 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-06-05T17:49: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": "d256a0e5ff08... |
048090e6-0f0c-4028-a6b6-7801f149a19f | syedtaha22/Intro-to-Programming-CPP | Lab_Solutions/Lab10/Task3.cpp | /*
Task 3:
Write a function concatenateArrays that takes two 1D arrays of integers.
The function should return a new array that concatenates the two arrays.
For example, if the arrays are {1, 2, 3} and {4, 5, 6}, the result should
be {1, 2, 3, 4, 5, 6}. In the main function, print th... | ALGO | 0.994753 | 5.965565 | {
"github_metadata": {
"branch": "main",
"commit_count": 44,
"repo_created_at": "2024-08-20T17:20:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "52b22a5daed... |
8b8bb125-f444-4a63-8f9a-070fb2a3c0cb | zarif98sjs/Competitive-Programming | Mostofa Saad's Training/CF D1/UVA 12532.cpp |
/** Which of the favors of your Lord will you deny ? **/
#include<bits/stdc++.h>
using namespace std;
#define LL long long
#define PII pair<int,int>
#define PLL pair<LL,LL>
#define F first
#define S second
#define ALL(x) (x).begin(), (x).end()
#define READ freopen("alu.txt", "r", stdin)
#define WRITE ... | ALGO | 0.999971 | 4.316391 | {
"github_metadata": {
"branch": "master",
"commit_count": 83,
"repo_created_at": "2018-10-14T16:47:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bd6aeb18e... |
d83d22d6-81ef-4499-86f4-de461361dfa3 | Chunming/CS267-hw2 | particles/pthreadChngFile/pthreads.cpp | #include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#include <math.h>
#include <pthread.h>
#include "common.h"
//
// global variables
//
int n, n_threads;
particle_t *particles;
FILE *fsave;
pthread_barrier_t barrier;
//
// check that pthreads routine call was successful
//
#define P( condition ) {if( (condi... | ALGO | 0.996245 | 5.055517 | {
"github_metadata": {
"branch": "master",
"commit_count": 291,
"repo_created_at": "2012-02-22T06:41: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": "732e9373... |
a5d05bf0-3529-4911-9dab-26502976f8b1 | yuzhishuo/pat | 1022/1.cpp | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
//由于均是查询Id,故可将Id看做value,其余属性每一项看做key 构建map
map<string, set<int>> title, author, key, pub, year;
//比如title
//key value
//The Testing Book 1111111
//Another Testing Book 3333333
//The Testing Book 2222222
void query(map<stri... | ALGO | 0.996515 | 3.498448 | {
"github_metadata": {
"branch": "master",
"commit_count": 37,
"repo_created_at": "2019-12-31T03:43:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "64bd52e6a... |
db24577d-aa2a-49cf-8cc7-2d85a54b68f5 | Stroescu-Andrei/Cazino | main.cpp | #include <iostream>
#include<string> //Pentru utilizarea sirurilor de caractere
#include<cstdlib> //Prentru utilizarea numerelor random
#include<ctime>
using namespace std;
void trageLinie(int n,char simbol);
void reguli();
int main()
{
string JucatorNume;
int suma; //tine soldul jucatorului
int sumaPa... | TOOL | 0.979987 | 3.532513 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2018-11-08T21:05:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
"content_id": "53dda5cfde... |
cbe66146-db40-4078-ac35-20de2ec8130f | mosuab-bit/Problem-Solving-C- | Problem 3/Problem 3.cpp |
#include <iostream>
#include <iomanip>
#include <string>
using namespace std;
int RandomNumber(int From, int To)
{
//Function to generate a random number
int randNum = rand() % (To - From + 1) + From;
return randNum;
}
void FillMatrixWithRandomNumbers(int arr[3][3], short rows, short cols)
{
for (int ... | ALGO | 0.97698 | 4.117777 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-11-24T20:11: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": "cd4ca2c25c99... |
3be4ee23-0f6f-4e31-b93e-44fecd78b949 | LinkCatList/asd | floyd.cpp | /*The complete oriented weighted graph is given by the adjacency matrix. Construct a matrix of shortest paths between its vertices.
It is guaranteed that there are no negative weight cycles in the graph.*/
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
ll n;
void floyd(vector<vector<ll>>& graph) ... | ALGO | 0.999993 | 5.193544 | {
"github_metadata": {
"branch": "main",
"commit_count": 45,
"repo_created_at": "2021-10-12T15:08:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "73a7683d2e8... |
d8cee4dc-2288-40d9-9e79-c0f7db416520 | nikolayvsk/lab3_main | lab3_main/Source.cpp | #include <iostream>
#include <vector>
using namespace std;
const int N = 1;
double f(double x) {
return N * pow(x, max(20 - N, N)) + (N + 2) * pow(x, max(20 - N, N) - 1) + (N - 3) * pow(x, max(20 - N, N) - 2);
}
void solve() {
int numberOfDots = max(20 - N, N) - ((int)N % 3) - 1;
for (int i = 0; i < numbe... | ALGO | 0.993718 | 3.496127 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2022-05-29T19:46: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": "03bec3ac32... |
fbadc659-d46f-4530-8a5e-5716a9c223da | baojinchang/PAT | Talent_and_Virtue.cpp | #include <algorithm>
#include <iostream>
using namespace std;
int l, h;
struct People
{
int id;
int Virtue;
int Talent;
};
bool cmp(People a, People b)
{
if (a.Talent >= h && a.Virtue >= h && b.Virtue >= h && b.Talent >= h)
{
if (a.Talent + a.Virtue == b.Virtue + b.Talent)
{
... | ALGO | 0.999947 | 3.606709 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2020-04-20T05:32: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": "a50cc07cd0... |
368c1738-1068-4cf4-96e8-3b3b8f1b094e | mpfeifer1/Kattis | bingoties.cpp | #include <bits/stdc++.h>
using namespace std;
typedef vector<vector<int>> card;
typedef set<int> win;
card getcard() {
vector<vector<int>> v(5, vector<int>(5));
for(int i = 0; i < 5; i++) {
for(int j = 0; j < 5; j++) {
cin >> v[i][j];
}
}
return v;
}
void getwins(vector<wi... | ALGO | 0.999978 | 4.009508 | {
"github_metadata": {
"branch": "master",
"commit_count": 881,
"repo_created_at": "2017-11-27T05:28:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 175,
"forks": 79,
"issues": 3,
"pull_requests": 1
},
"file_meta": {
"content_id": "a77fe... |
e24b6e09-36ca-496d-bed9-74b7309ec871 | Anupam0401/Data-Structures-and-Algorithms | CS102-DSA/Improvement/Assignment_1/Group_5_Return0/Group_5_Return0/q6.cpp | #include<bits/stdc++.h>
#include<stdlib.h>
using namespace std;
typedef struct node
{
int data;
struct node *next;
}NODE;
NODE * newNode();
void insertNode(NODE **head, int number);
//dyanamically creates a new node
NODE * newNode()
{
NODE *p;//p is temporary pointer variable
p=(NODE*) malloc (sizeof... | ALGO | 0.999989 | 4.048009 | {
"github_metadata": {
"branch": "master",
"commit_count": 516,
"repo_created_at": "2022-05-26T17:01:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "727d8182... |
4f3df240-f9a1-406d-954e-79c3c1b388ee | bo-yang/dtf_fisher | vgg_fisher/lib/gmm-fisher/gmm.h |
#ifndef __GMM_H
#define __GMM_H
#include <vector>
#include <assert.h>
#include <iostream>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <fstream>
#include <ctime>
#include <limits>
#include "stat.h"
#include "simd_math.h"
struct em_param
{
em_param():
max_iter(100),
alpha(100.0),
... | ALGO | 0.984287 | 4.39716 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2014-01-19T02:30:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 25,
"forks": 23,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "da7fc07... |
2e78363d-d046-4bd9-8355-8da2a15cf7ab | marjanhasan/CP-PREP | Algorithm/problem solving/sundarban.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define nl '\n'
#define pi pair<ll, ll>
const int N = 35;
bool vis[N][N];
int dis[N][N];
char a[N][N];
vector<pi> dir;
int n;
bool valid(int i, int j)
{
return (i >= 0 && i < n && j >= 0 && j < n && (a[i][j] == 'P' || a[i][j] == 'E'));
}
void bfs(in... | ALGO | 0.999911 | 4.724449 | {
"github_metadata": {
"branch": "main",
"commit_count": 597,
"repo_created_at": "2023-09-28T09:17: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": "1550ceb48a... |
e7509f86-4c3a-47b4-a078-7db63173a614 | 0xpye/cp | code/220.colors.cpp | //Pye
#include <bits/stdc++.h>
#define FOR(i, a, b) for(int i = (a); i <= (b); i++)
#define FORR(i, a, b) for(int i = (a); i >= (b); i--)
#define pair pair <int, int>
#define maxn 400005
using namespace std;
int n, m, a[maxn], d[4*maxn], p[maxn], res[maxn];
struct data{
int l, c, d, val;
};
vector <data> q[maxn];
b... | ALGO | 0.999969 | 4.156641 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2021-12-15T04:18: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": "0de3156ec509... |
c32f42ff-1076-40ba-b16f-f75abe850c46 | HYS-Alakui/EA-MRL | upper_mutate.cpp | #include "headfile.h"
#include "Individual.h"
#include "Qpacking.h"
#include "rankSequ.h"
#include "Chromosome.h"
void QPacking::upper_mutate(CIndividual& t, double rate)//对个体进行变异,rate是变异率;t是传进来的child1对象,在evovle中
{
if (rand() / (RAND_MAX * 1.0) <= rate) //产生一个随机数与rate比较判断是否进行变异,由于设置的是百分百变异,故肯定对该个体进行变异
{
////step... | ALGO | 0.999902 | 3.748682 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-12-20T01:11: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": "389a38cf70c2... |
d2abce9e-77d3-444a-9162-20ec873c1a95 | ShapeLayer/training | tasks/online_judge/baekjoon/cpp/24391.cpp | #include <bits/stdc++.h>
#define MAX 100'000
using namespace std;
int parents[MAX];
int find(int n) {
if (parents[n] == n) return n;
return parents[n] = find(parents[n]);
}
void merge(int a, int b) {
int pa = find(a), pb = find(b);
if (pa > pb) {
parents[pa] = pb;
parents[a] = pb;
} else {
pare... | ALGO | 0.999831 | 3.63568 | {
"github_metadata": {
"branch": "main",
"commit_count": 1533,
"repo_created_at": "2021-01-29T05:13:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "17477733a... |
d710e46d-2c31-4da3-9a97-d5271f9b044c | AkashSingh3031/The-Complete-FAANG-Preparation | 1]. DSA + CP/1]. DSA/4]. Striver Series/30 Days of SDE Sheet/C++/20]. Day-20 (Binary Search Tree)/Leetcode/3]. Construct BST from given keys.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999998 | 6.835561 | {
"github_metadata": {
"branch": "master",
"commit_count": 1827,
"repo_created_at": "2021-05-29T04:41:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 11343,
"forks": 2526,
"issues": 3,
"pull_requests": 2
},
"file_meta": {
"content_id": "... |
7572c718-4df6-4e9e-8834-649166f2b9a5 | Runarok/GeeksForGeeks-solutions | Difficulty: Basic/C++ Inheritance introduction/c-inheritance-introduction.cpp | //{ Driver Code Starts
//Initial Template for C++
#include <iostream>
using namespace std;
// } Driver Code Ends
// User function Template for C++
class Cuboid
{
// Class to represent a cuboid with length, width, and height
public:
int length, width, height; // Dimensions of the cuboid
// Function to... | ALGO | 0.984595 | 5.523346 | {
"github_metadata": {
"branch": "main",
"commit_count": 6962,
"repo_created_at": "2025-01-14T04:19:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ac5da012e... |
1b9c8bfa-cc81-488a-8d0b-c3ca9b226e0c | KeepFightingUntilDone/Programming | C++/LinkedList/LinkedList/LinkedList/GetMiddleItem.cpp | #include <iostream>
#include <map>
using namespace std;
struct SinglyLinkedListNode
{
int value;
SinglyLinkedListNode* next;
};
class SinglyLinkedList
{
private:
SinglyLinkedListNode* current;
public:
SinglyLinkedList(SinglyLinkedListNode* head) { current = head; }
public:
bool hasNext() const { return curren... | ALGO | 0.999596 | 5.927746 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2014-07-22T03:02:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ad6a6556b... |
13555586-49cf-4531-ad13-c78c1e8e39ac | abhishek9125/Data-Structures-and-Algorithms-Code-Set | Reset/Dynamic Programming/2. Minimum Coin Change.cpp | #include <bits/stdc++.h>
int solveRec(vector<int> &num, int x) {
if(x == 0) return 0;
if(x < 0) return INT_MAX;
int mini = INT_MAX;
for(int i = 0; i < num.size(); i++) {
int ans = solveRec(num, x - num[i]);
if(ans != INT_MAX) {
mini = min(mini, ans + 1);
}
}
... | ALGO | 0.999977 | 4.748446 | {
"github_metadata": {
"branch": "master",
"commit_count": 38,
"repo_created_at": "2022-09-15T01:35: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": "c9854ee91... |
3eaa17e5-c84f-41a9-8581-8ab6e570946b | Parul2004/DSA | Array/LeetcodeTwoSum.cpp | #include <iostream>
#include <vector>
#include <unordered_map>
using namespace std;
vector<int> twoSum(vector<int> &arr, int target)
{
unordered_map<int, int> mp;
for (int i = 0; i < arr.size(); i++)
{
if (mp.find(target - arr[i]) == mp.end())
mp[arr[i]] = i;
else
... | ALGO | 0.999572 | 5.434876 | {
"github_metadata": {
"branch": "main",
"commit_count": 87,
"repo_created_at": "2023-04-13T13:37:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "187dc3b8762... |
733976a9-8ddb-480a-93bb-760a4f048deb | surendra172001/hackerearthDS | snackdown.cpp | #include<bits/stdc++.h>
using namespace std;
#define gc getchar_unlocked
#define fo(i,n) for(i=0;i<n;i++)
#define Fo(i,k,n) for(i=k;k<n?i<n:i>n;k<n?i+=1:i-=1)
#define ll long long
#define si(x) scanf("%d",&x)
#define sl(x) scanf("%lld",&x)
#define ss(s) scanf("%s",s)
#define pi(x) printf("%d\n",x)
#define pi_(x) printf... | ALGO | 0.998344 | 3.555755 | {
"github_metadata": {
"branch": "master",
"commit_count": 47,
"repo_created_at": "2020-05-24T07:29: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": "1b6a8a370... |
e17274f6-de1f-4c2b-a9c3-c0a69086e7da | infinite234/ee6470_hw5-hw6-hw7-hw1 | hw7/hw_7_1/gauss-multicore/main.cpp | #include <string.h>
#include "stdio.h"
#include "math.h"
#include "lena_std_short.h"
// Gaussian Filter ACC
static char* const GaussFILTER_START_ADDR = reinterpret_cast<char* const>(0x73000000);
static char* const GaussFILTER_READ_ADDR = reinterpret_cast<char* const>(0x73000004);
// Gaussian Filter ACC 1
static char... | ALGO | 0.959058 | 4.029982 | {
"github_metadata": {
"branch": "main",
"commit_count": 65,
"repo_created_at": "2021-03-15T20:45: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": "296ce5a13a0... |
e1bc7999-011f-48bc-88fb-2858282e262b | danyalmendigali/programming_scientific_codes | auto_scientific_codes/array---string/array_partial_sort()_function.cpp | #include <bits/stdc++.h>
#include <windows.h>
#include <iterator>
using namespace std;
#define ar array
#define ll long long
#define FOR(i, a, b) for(int i = a; i < b; i++)
// partial_sort(): Эта функция частично сортирует элементы массива, так что первые k элементов будут находиться в
// отсортированном порядке, а о... | ALGO | 0.999638 | 4.759218 | {
"github_metadata": {
"branch": "main",
"commit_count": 882,
"repo_created_at": "2023-05-03T17:14:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "48ca31ea83... |
1b7ce9fb-1b26-49e7-a479-089e6dd39eec | Koozzi/Algorithms | BJ/4991.cpp | #include <iostream>
#include <memory.h>
#include <vector>
#include <algorithm>
#include <cmath>
#include <queue>
using namespace std;
int N, M, ans = 99999;
char map[21][21];
bool visited[21][21];
bool check[11];
int Distance[11][11];
vector<pair<pair<int, int>, int>> nodeInfo;
vector<pair<pair<int, int>, int>> dist... | ALGO | 0.999915 | 3.640217 | {
"github_metadata": {
"branch": "master",
"commit_count": 320,
"repo_created_at": "2020-02-05T07:16:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "d2f981e1... |
b0d48b49-9d91-4749-b8cc-cf6471906236 | mindspore-ai/mindspore | mindspore/lite/tools/converter/micro/coder/opcoders/nnacl/fp32/matmul_fp32_coder.h | /**
* Copyright 2021 Huawei Technologies 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.org/licenses/LICENSE-2.0
*
* Unless required by applicable law... | TOOL | 0.910884 | 7.759533 | {
"github_metadata": {
"branch": "master",
"commit_count": 83896,
"repo_created_at": "2020-02-11T08:43:48.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 4559,
"forks": 740,
"issues": 181,
"pull_requests": 20
},
"file_meta": {
"content_id": ... |
e41015d4-6e9c-4ddf-8095-90fe1cf9286e | huaxiatony/CS | College/CS14/assignments/assn4/pq_zero.H | /**
* Course: CS014 Summer 2018
*
* First Name: Benjamin
* Last Name: Lee
* Username: blee073
* email address: this must be your cs or UCR student email address
*
*
* Assignment: assn4
* Filename : pq_zero.H
*
* I hereby certify that the contents of this file represent
* my own original individual work. No... | ALGO | 0.99865 | 4.169466 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2018-11-05T03:01: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": "4d8e0043d... |
b050c7cc-e126-4c12-9e87-72f8d9cf4c81 | YangIeuan/MatrixCalc | src/matrix_multiply/mmm/src/mmm_opt.cpp | #include "mmm_opt.h"
#include "xdoty.h"
#include "matrixutils.h"
MATRIX MmultMOpt(MATRIX A, MATRIX B, MATRIX C)
{
int row_A = A.size();
int row_B = B.size();
int col_B = B[0].size();
Trans(B);
for (int i = 0; i < row_A; ++i) {
for (int j = 0; j < row_B; ++j) {
for (int k = 0; k... | ALGO | 0.999521 | 4.782763 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2024-06-01T09:50: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": "04900ebea61... |
955c4b93-c8d7-4dad-bd7f-3e54941dca52 | skyblue71/DS4 | DS2ex4_16_11127246_11127256.cpp | //11127246 陳柏劭 11127256 蕭天語
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <iomanip>
#include <queue>
using namespace std;
// 邊結構
struct Edge {
string getID; // 接收者學號
float weight; // 邊的權重
};
// 頂點結構
struct Vertex {
string putID; // 發送者學號
vector<Edge> edges; // ... | ALGO | 0.99387 | 3.847165 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2024-05-15T14:50: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": "aadf6562c268... |
27234ae6-433d-4320-9c74-069e6bb45689 | Denoble/C- | ExamTest/ExamTest/Source.cpp | #include<string>
#include<iostream>
#include<fstream>
#include<algorithm>
#include<vector>
#include<time.h>
using namespace std;
class Person{
public:
Person(char* s,int i);
void operator()(int i);
void display();
private:
string name;
int age;
};
vector<int> cont2;
int addToContainer(int b){
srand(time(NULL)... | TOOL | 0.969445 | 3.534845 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2016-09-23T01:40: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": "e0a8cb87b4... |
ea17af53-f03d-420a-8c73-cda607db43f6 | huyentranq/CPP_cpp | vector_bt.cpp | //[Mảng 2 Chiều]. Bài 24. Phần tử xuất hiện ở mọi hàng.
//Cho ma trận vuông A[N][N]. Hãy in ra các số xuất hiện ở mọi hàng theo thứ tự từ bé đến lớn, mỗi giá trị xuất hiện chỉ liệt kê 1 lần.
// Đầy đủ trong BT mảng hai chiều
vector<int> vec; // vector lưu mảng một chiều ( hàng đầu tiên)
for(int i=0;i<n;i++){
... | ALGO | 0.999863 | 3.948091 | {
"github_metadata": {
"branch": "main",
"commit_count": 141,
"repo_created_at": "2024-03-31T07:40:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c43b33c0e7... |
fa70d669-19a6-40e0-87c5-d8db746d57b7 | raincross7/code-similarity | codes/train_code/problem415/problem415_426.cpp | // #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()
#define Graph vector<vector<int>>
typedef long long ll;
const int INF = 1000000007;
// #include <boost/multiprecision/cpp_dec_float.hpp>
// #include <boost/mult... | ALGO | 0.999877 | 4.410564 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-03-06T05:07:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b564f73804ed... |
ca2f25d4-5d4d-4bc1-b784-6b6633599d7a | CoderAbhinav/language-processing-and-compiler-construction | 3AddressCodeAssignements/StringManipulator.h | #pragma onces
#include <iostream>
#include <vector>
#include <string>
std::vector<std::string> splittedExpression(std::string exp) {
exp += " ";
int i = 0, n = exp.length();
std::vector<std::string> res;
std::string curr = "";
while (i < n) {
if (exp[i] == ' ' || exp[i] == '+' || exp[i] ... | ALGO | 0.998963 | 4.127401 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2022-12-09T06:00: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": "74133b332a... |
73003a36-a4c1-435a-8716-363ce454037f | aghnashranjith/CP | GFG/Nth Fibonacci Number.cpp | //{ Driver Code Starts
// Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// User function Template for C++
class Solution {
public:
long long int nthFibonacci(long long int n){
//Recursive solution
// if(n==1)
// return 1;
// else ... | ALGO | 0.999677 | 5.572567 | {
"github_metadata": {
"branch": "main",
"commit_count": 68,
"repo_created_at": "2022-03-22T16:57:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "becab8b31a0... |
9fd13516-fbf9-48cc-8b50-5f5269406527 | monkeyKing001/Algorithm_exercise | dokwak/0D_simulation/16392/16392.cpp | #include <bits/stdc++.h>
static const double PI = acos(-1.0);
static const double DIAMETER = 60.0; // 원의 지름 (피트)
static const double CIRCUMFERENCE = DIAMETER * PI; // 원의 둘레 (피트)
static const int NUM_POINTS = 28; // 둘레 위의 점 개수
static const double DIST_PER_SEGMENT = CIRCUMFERENCE / NUM_POINTS;... | ALGO | 0.997319 | 3.917258 | {
"github_metadata": {
"branch": "main",
"commit_count": 302,
"repo_created_at": "2022-07-13T10:28:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "7f4477585b... |
8e981b70-8b0f-44eb-a74f-83113d5d574c | k8440009/Algorithm | BOJ/1753_2_2.cpp | // 최단경로
// https://www.acmicpc.net/problem/1753
#include <iostream>
#include <vector>
#include <queue>
using namespace std;
const int INF = 987654321;
const int MAX_V = 20000;
int V, E, K;
int main(){
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
// freopen("input.txt", "r", stdin);
vector <pair<int,int>... | ALGO | 0.999971 | 4.609137 | {
"github_metadata": {
"branch": "master",
"commit_count": 762,
"repo_created_at": "2019-08-04T15:03:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 12,
"pull_requests": 0
},
"file_meta": {
"content_id": "92fb4c7... |
cd0ea08a-36f2-4175-8f8f-cc6bb3ef23ac | okoks9011/problem_solving | codeforces/round_589/primes.cc | #include <iostream>
#include <unordered_set>
#include <cmath>
using namespace std;
const long long kMod = 1000000007;
long long FastPower(long long p, long long k) {
long long result = 1;
p %= kMod;
while (k > 0) {
if (k % 2 == 0) {
p *= p;
p %= kMod;
k /= 2;... | ALGO | 0.999987 | 4.962432 | {
"github_metadata": {
"branch": "master",
"commit_count": 519,
"repo_created_at": "2018-07-18T11:48:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "83febaae... |
2c152daa-2314-4b79-b9f4-d6aa8546e10e | jorgesalhani/advancedAlgorithms | prog4/src/main.cpp | /**
* Projeto 4: Tarefas
*
*
* @author <NAME>, 8927418
*/
#include <iostream>
#include <queue>
#include <map>
using namespace std;
typedef vector<int> vecInt;
typedef vector<vecInt> vecVecInt;
typedef struct {
bool operator()(vecInt itemA, vecInt itemB) {
return itemA[0] != itemB[0]
? itemA[0] >... | ALGO | 0.999793 | 3.607384 | {
"github_metadata": {
"branch": "main",
"commit_count": 32,
"repo_created_at": "2024-08-11T12:10:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b848e749943... |
988a3239-346d-4a2d-ba43-10adc047a1a0 | LiAnNO2/NUKU_PD2 | hw6/hw6.cpp | #include <iostream>
#include<string>
#include<vector>
#include<fstream>
#include<algorithm>
#include<iterator>
#include<cmath>
using namespace std;
class keywords { // 紀錄
public:
vector<string> keyword;
double idf_sum[3] = {};
};
class ids { // 儲存
public:
int id2;
double total;
bool operator < (... | ALGO | 0.999253 | 3.864072 | {
"github_metadata": {
"branch": "main",
"commit_count": 36,
"repo_created_at": "2023-03-30T07:56:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "de5ccaf1bfc... |
4e7601eb-7f2c-41fb-8a54-fd957be36dff | 1231234448/xuexi | c++/源码/CPP-基础篇源码/18_数组元素搬运/a2.cpp | #include <iostream>
using namespace std;
void put_tag(int* p, int* end)
{
for(int*q = p + *p; q<end; q += *p) *q = -1;
}
int* next_pos(int* p, int* end)
{
while(++p<end && *p <0);
return p<end ? p : NULL;
}
int main()
{
const int M = 10; //第M个素数
const int N = M * 20; //需要筛选 N 个数字
int a[N];... | ALGO | 0.999901 | 3.090663 | {
"github_metadata": {
"branch": "main",
"commit_count": 69,
"repo_created_at": "2023-02-09T05:23: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": "7ef39d75e20... |
bb7220b7-b2b6-4d22-a85f-e684fa789ee0 | mostafa-cse/CSES-Solutions | 4. Graph Algorithm/Y - Planets and Kingdoms /Using_Kosaraju's_SCC.cpp | #include <bits/stdc++.h>
#define int long long
using namespace std;
signed main() {
int n, m;
cin >> n >> m;
vector<vector<int>> g(n + 1), r(n + 1);
for (int i = 1; i <= m; i++) {
int u, v;
cin >> u >> v;
g[u].push_back(v);
r[v].push_back(u);
}
stack<int> ... | ALGO | 0.99999 | 4.553672 | {
"github_metadata": {
"branch": "main",
"commit_count": 105,
"repo_created_at": "2025-05-25T08:12: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": "b996fbd576... |
8b95d784-bec3-42dc-992c-836f75fc1a13 | Miroier/daily-programming | PAT (Advanced Level) Practice/1149.cpp | #include "iostream"
#include "unordered_map"
#include "vector"
using namespace std;
typedef long long LL;
int n, m;
unordered_map<int, vector<int>> mp;
bool a[100005];
int main()
{
#ifdef ONLINE_JUDGE
#else
freopen("input.txt", "r", stdin);
#endif
cin >> n >> m;
for (int i = 0; i < n; i++)
{
LL ... | ALGO | 0.999992 | 4.080116 | {
"github_metadata": {
"branch": "master",
"commit_count": 236,
"repo_created_at": "2021-02-09T13:52:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ca4293bf... |
b494ad4d-b88a-453f-8c4f-240687239e9c | LTLA/assorthead | inst/include/tatami_mult/sparse_row.hpp | #ifndef TATAMI_MULT_SPARSE_ROW_HPP
#define TATAMI_MULT_SPARSE_ROW_HPP
#include "utils.hpp"
#include <vector>
#include <cstddef>
#include <type_traits>
#include <algorithm>
#include "tatami/tatami.hpp"
#include "sanisizer/sanisizer.hpp"
namespace tatami_mult {
namespace internal {
template<typename Value_, typenam... | ALGO | 0.95955 | 7.24127 | {
"github_metadata": {
"branch": "master",
"commit_count": 87,
"repo_created_at": "2024-06-15T08:50: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": "e3f11a0e4... |
039176ef-eea2-4528-8cd2-49dc66768178 | yuujin-Q/praktikum-oop | UTS [cpp]/UTS/Pecahan/Pecahan.cpp | // <NAME> 13521074
#include "Pecahan.hpp"
#include <iostream>
using namespace std;
// ctor: set n = 0 dan d = 1
pecahan::pecahan() : n(0), d(1) {}
// ctor: set n = _n dan d = _d
pecahan::pecahan(int _n, int _d) : n(_n), d(_d) {}
pecahan::pecahan(const pecahan &P) {
this->n = P.n;
this->d = P.d;
} // cctor:
... | TOOL | 0.957672 | 5.410457 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2023-06-05T16:53: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": "a21eb46c7a0... |
9bb03f29-99d0-4cb8-aaa6-d6c4289018ca | Moran79/folda | src/RcppExports.cpp | // Generated by using Rcpp::compileAttributes() -> do not edit by hand
// Generator token: 1<PASSWORD>
#include <RcppEigen.h>
#include <Rcpp.h>
using namespace Rcpp;
#ifdef RCPP_USE_GLOBAL_ROSTREAM
Rcpp::Rostream<true>& Rcpp::Rcout = Rcpp::Rcpp_cout_get();
Rcpp::Rostream<false>& Rcpp::Rcerr = Rcpp::Rcpp_cerr_get();... | ALGO | 0.975369 | 6.849595 | {
"github_metadata": {
"branch": "master",
"commit_count": 34,
"repo_created_at": "2024-09-05T15:01:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a146b35be... |
922b332c-7be0-4d1e-967a-0921008fa335 | arkabarua69/XPSC | Week-17/Day-7/D_Districts_Connection.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define nl endl
#define it(_) (_).begin(), (_).end()
#define cy cout << "YES" << endl
#define cn cout << "NO" << endl
#define Speed_code \
ios::sync_with_stdio(false); \
cin.tie(0);
void GunJon()
{
map<int, int> mp;
int n;... | ALGO | 0.999837 | 3.40255 | {
"github_metadata": {
"branch": "main",
"commit_count": 151,
"repo_created_at": "2024-10-27T13:28:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d20e557ffc... |
5fd1ba1f-cc2e-4436-a79a-0c7af336fea5 | theodore-norvell/the-teaching-machine-and-webwriter | trunk/tm web site/courses/introductory/content/control_flow/better_complex_print.cpp | /*#H*//******************************************************************
* Memorial University of Newfoundland
* Engineering 2420 Structured Programming
* complex_print.cpp -- Demonstrate functions
*
* Author: <NAME>
* Date: 2004.01.02
*
*******************************************************************/
/*#D... | ALGO | 0.975948 | 5.986753 | {
"github_metadata": {
"branch": "master",
"commit_count": 263,
"repo_created_at": "2015-10-01T19:13:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 7,
"issues": 21,
"pull_requests": 1
},
"file_meta": {
"content_id": "3bb27c2... |
8960b3f1-034f-4167-b656-2368ac49a1d9 | nNbSzxx/ACM | 数学/组合数学/poj 3406组合数非零最低位.cpp | #include <cstdio>
#include <iostream>
#include <algorithm>
using namespace std;
int n,m;
int table[4][4] = {
6,2,4,8,
1,3,9,7,
1,7,9,3,
1,9,1,9,
};
int getprime( int n, int x)
{
int ret = 0;
while (n) {
ret += n / x;
n /= x;
}
return ret;
}
int getodd (int n, int x)
{
if (n == 0) {
return 0;
} else ... | ALGO | 0.99995 | 3.858368 | {
"github_metadata": {
"branch": "master",
"commit_count": 75,
"repo_created_at": "2018-07-24T12:29: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": "6570d24f1... |
8faada90-c806-46ce-a0b2-7347d9574200 | subodhnarayan/100DayofCoding | day511.cpp | -- -- -- -- -- -- -- -- -GFG - POTD - 22 / 05 / 2025 ----------------------------------------
Minimum Deletions
Difficulty: MediumAccuracy: 58.8%Submissions: 67K+Points: 4
Given a string s, write a program to delete the minimum number of characters from the string so that the resultant string is a palindrome, while ma... | ALGO | 0.999943 | 5.757545 | {
"github_metadata": {
"branch": "main",
"commit_count": 1744,
"repo_created_at": "2024-05-01T06:51: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": "87cd8e490... |
fab0cb00-6f55-426f-a413-4ad5db463407 | ishandutta2007/codeforces-t | thienu/normal/1515/D.cpp | #include <bits/stdc++.h>
using namespace std;
#define u_map unordered_map
#define u_set unordered_set
#define u_multiset unordered_multiset
using ll = long long;
using vvi = vector<vector<int>>;
using vi = vector<int>;
using vvll = vector<vector<long long>>;
using vll = vector<long long>;
using vd = vector<double>;
... | ALGO | 0.999868 | 4.354883 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:27: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": "54a61c7d7472... |
07f52029-f3ba-41ef-85b9-57340b40f8b9 | gilbertoef/graph-colorings | Generalizations/Code/README.cc | well have to take care of the weight thing
weight neighbor -> all cliques of subset (i) to all cliques of subjset (j) have the weights of weight(i,j)
weight self -> all cliques of subset(i) have the weight of weight(i,i) among themselves ... have to check this
is there weight(i,i) ???
const double nAntsPercent ... | ALGO | 0.999985 | 3.350762 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2015-10-14T22:57: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": "7a43ee02ba... |
43bb4c83-596d-4389-a37f-be44cb69be12 | MingKeungZhang/Convex-Hull-Cpp- | KDTree.cpp | #include "stdafx.h"
#include "KDTree.h"
#define _USE_MATH_DEFINES
#include <math.h>
#include <fstream>
#include <iostream>
KDNode::KDNode(double la, double lo, int d, const std::string &desc) {
left = NULL;
right = NULL;
depth = d;
name = desc;
lat = la;
lon = lo;
}
KDNode::~KDNode() {
}
double KDNode::distan... | ALGO | 0.995836 | 3.369691 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2016-06-06T21:48: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": "e1fa4df089... |
80a9800f-41b6-4e43-a4c5-f52cfd8c53ec | Ashukr321/complete_data_structure_and_algorithms_for_placement | 30_days_chllanges/day1/_4_find_middle_node_of_singly_linked_list.cpp | // preprocessor
#include <iostream>
using namespace std;
class Node
{
public:
int data;
Node *next;
Node(int data)
{
this->data = data;
this->next = nullptr;
}
};
void displayNode(Node *head)
{
Node *temp = head;
while (temp != nullptr)
{
cout << temp->data << "-> ";
temp = temp->next;... | ALGO | 0.999521 | 5.410324 | {
"github_metadata": {
"branch": "master",
"commit_count": 1737,
"repo_created_at": "2024-04-28T12:42:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4fae4e0... |
03071427-c38c-41a3-b984-b09573cc371c | ZasGeo/Math | MathTest/operations.h | #ifndef _LIN_ALG_OPERATIONS_ZASGEO_
#define _LIN_ALG_OPERATIONS_ZASGEO_
#include "vector.h"
#include "matrix.h"
namespace esm {
/*
Lineary interpolates beetween A and B. If alpha is close to zero, then result is close to A, if alpha is close to one, then result is close to B.
No restriction is aplied to alpha.
... | ALGO | 0.962502 | 6.383411 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2018-02-07T11:37: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": "11535a984d... |
35e01353-38d3-4553-9b63-c4c95b388036 | samosapiens/algoritmos | parciales/parcial1/HakerrankContest/p5_2.cpp | /*
REFERENCIAS:
https://gist.github.com/saichandrasekhar/d5c75963849661aedeb2
*/
#include <cmath>
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
using Long = long long;
const Long infty = 10000; // Umbral de distancia infinita
const int N = 100001; // Máxima capacidad de datos... | ALGO | 0.999826 | 4.586548 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2018-09-09T05:54:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8834adb36... |
7578e924-b2f8-44f8-b52c-71726be970cc | luqmanarifin/cp | 0-unclassified/bigrace.cpp | #include <bits/stdc++.h>
using namespace std;
long long kpk(long long a, long long b) {
return a / __gcd(a, b) * b;
}
int main() {
long long t, w, b;
cin >> t >> w >> b;
long long a;
if(kpk(b, w) < 0) {
a = 0;
} else {
a = t / kpk(b, w);
}
cout << a << endl;
long long x = kpk(b, w) * a;
l... | ALGO | 0.999871 | 4.08705 | {
"github_metadata": {
"branch": "master",
"commit_count": 772,
"repo_created_at": "2016-02-09T04:26:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "2448577c... |
221a3324-6f17-47f9-ba9a-9e08e8496c8d | KieranGrist/Stormvile | Stormvile/VectorMaths.h | #pragma once
#include "DDSTextureLoader.h"
#include "resource.h"
#include <windows.h>
#include <d3d11_1.h>
#include <d3dcompiler.h>
#include <directxmath.h>
#include <string.h>
#include<string>
#include <directxcolors.h>
#include <algorithm>
#include <SimpleMath.h>
#include <math.h>
#include <cstdint>
#include <algori... | TOOL | 0.954887 | 3.658183 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2019-03-18T14:49: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": "415d74eba... |
75f86a3c-b3ce-45af-ad0d-ea7db363a4cf | AngelDRR/RetroBikeRacer | track.h | #include <iostream>
#include <vector>
#include <random>
using namespace std;
void makeTrack(vector<pair<float, pair<float, bool>>> &vecTrack, int nTrackSize) {
float fCurvature, fDistance;
float fTotaldistance = 0.0f;
bool bCheckPoint;
// The structure is: Curvature, Distance, CheckPoint
vecTrac... | TOOL | 0.990415 | 4.240108 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2023-09-12T14:57:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "972335c9eaab... |
a3d65a3d-4743-4ccc-986f-436397aac166 | Tej-git-212/DSA-SHEET-BY-ARSH | Stack & Queue/19. LRU-Cache.cpp | class LRUCache {
public:
class Node {
public:
int key, val;
Node* prev;
Node* next;
Node(int _key, int _val) {
key = _key;
val = _val;
}
};
Node* head = new Node(-1, -1);
Node* tail = new Node(-1, -1);
unordere... | ALGO | 0.99976 | 5.962484 | {
"github_metadata": {
"branch": "main",
"commit_count": 37,
"repo_created_at": "2022-05-31T19:13:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3d4ddd9d950... |
b272c360-6e66-4430-a8b3-d9bb29f1bcd8 | FatnomWin5/Matrix-Multiplication | OpenMP/OpenMP/OpenMP.cpp | #include <iostream>
#include <cstdlib>
#include <omp.h>
using namespace std;
void randomiseMatrix(int** matrix, int N) {
for (int i = 0; i < N; i++) {
for (int j = 0; j < N; j++) {
matrix[i][j] = rand() % 11;
}
}
return;
}
int main(int argc, char** argv) {
int N;
int threads;
printf("Enter matrix siz... | ALGO | 0.998525 | 4.365673 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-12-10T12:55: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": "6ecd5d5abab0... |
9c9e3338-c7f9-4e4b-99b4-a4aad7a3fbb2 | Yawn-Sean/Daily_CF_Problems | daily_problems/2024/12/1203/personal_submission/cf229c_Bonelight.cpp | /*
Bonelight =^x^=
20241117: 单枪匹马,无畏粉身碎骨
我尝试过无数次了,但我知道,机会只会出现在其中的一两次
*/
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define endl '\n'
#define pii pair<int,int>
#define tiii tuple<int,int,int>
#define INF 2e18
#define VC vector<int>
#define VCii vector<pii>
#define MAT vector<VC>... | ALGO | 0.99996 | 4.46681 | {
"github_metadata": {
"branch": "main",
"commit_count": 20410,
"repo_created_at": "2024-02-26T01:04:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 478,
"forks": 302,
"issues": 0,
"pull_requests": 7
},
"file_meta": {
"content_id": "09d3... |
ce595570-9a86-426b-a4a1-2231f40bedbe | aayush2761/Leetcode_prob | 1248-count-number-of-nice-subarrays/1248-count-number-of-nice-subarrays.cpp | // class Solution {
// public:
// int numberOfSubarrays(vector<int>& nums, int k) {
// int n = nums.size();
// vector<bool> isOdd(n, false);
// for(int i = 0; i < n; i++) {
// if(nums[i] % 2 != 0) isOdd[i] = true;
// }
// int i = 0, j = 0, count = 0, res ... | ALGO | 0.999991 | 5.804217 | {
"github_metadata": {
"branch": "main",
"commit_count": 1988,
"repo_created_at": "2023-10-03T12:58:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2656bcc60... |
3ddf5d1d-c229-4dec-bbb1-146cdfb294d2 | Tapesh-Vashisth/Leetcode_Solutions | 1751_Maximum_Number_of_Events_That_Can_Be_Attended_II.cpp | #include <iostream>
#include <vector>
#include <map>
#include <algorithm>
using namespace std;
class Solution {
public:
static bool comparator (vector <int> first, vector <int> second) {
if (first[1] < second[1]) {
return true;
} else {
return false;
}
}
int... | ALGO | 0.999961 | 5.623758 | {
"github_metadata": {
"branch": "main",
"commit_count": 67,
"repo_created_at": "2023-06-08T19:01: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": "359eb46baba... |
a66d176d-efcd-45db-af45-76c69bacc75d | ketpadilla/cpe104l | codechum/lesson6/27-linkedList-6.cpp | #include <iostream>
#include "includes/27-6-node.h"
int main() {
Node* linkedList = new Node;
Node* node1 = addNode(linkedList, 5);
Node* node2 = addNode(node1, 3);
Node* node3 = addNode(node2, 22);
Node* node4 = addNode(node3, 100);
Node* node5 = addNode(node4, -10);
Node* node6 = addNode... | ALGO | 0.995184 | 5.595998 | {
"github_metadata": {
"branch": "main",
"commit_count": 37,
"repo_created_at": "2024-08-16T02: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": "6b1f20b9b6d... |
6a04f626-e6d0-4066-b8d6-02d2c2bb5dde | Shikhar-S/Analysis-of-Competitive-Codebase | Data/Contest1244/all/28913627_62491020.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 3e5 + 7;
int n, c1[N], c2[N], c3[N], st[N];
vector<int> g[N], v;
void dfs(int cur, int p) {
v.push_back(cur);
for(int i=0;i<g[cur].size();i++) {
int to = g[cur][i];
if(to != p)
dfs(to, cur);
}
}
... | ALGO | 0.999943 | 4.291443 | {
"github_metadata": {
"branch": "master",
"commit_count": 74,
"repo_created_at": "2019-11-22T14:40:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "485774bf6... |
88148251-fbc1-4402-8243-226cc3a6d844 | hasnatulalam/interview_preparation_dsa | Priority Queue/leastIntervals.cpp | #include <iostream>
#include <unordered_map>
#include <vector>
#include <queue>
using namespace std;
int leastInterval(vector<char>& tasks, int n) {
unordered_map<char, int> taskCount;
// Count the frequency of each task
for (char task : tasks) {
taskCount[task]++;
}
// Create a priority ... | ALGO | 0.999988 | 7.373764 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2023-08-27T03:09: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": "0240dfd5010e... |
3df8740a-e9d3-4ced-9e6c-83adf34877cf | pmnyc/Source_Codes_Collected | osrm-backend/include/extractor/guidance/intersection_normalizer.hpp | #ifndef OSRM_EXTRACTOR_GUIDANCE_INTERSECTION_NORMALIZER_HPP_
#define OSRM_EXTRACTOR_GUIDANCE_INTERSECTION_NORMALIZER_HPP_
#include "util/attributes.hpp"
#include "util/name_table.hpp"
#include "util/typedefs.hpp"
#include "extractor/guidance/coordinate_extractor.hpp"
#include "extractor/guidance/intersection.hpp"
#in... | ALGO | 0.935812 | 7.012579 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2018-10-15T04:37:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 4,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "f147b2a017... |
385411d1-02e7-47cf-ac10-9543d7cabc6d | Code-Dilip/CPlusPlus-Programming | Back_tracking/N_Queen.cpp | #include<iostream>
using namespace std;
bool isSafe(int **arr,int x,int y,int n){
if((x<n && y<n) && arr[x][y] == 1){
return true;
}
return false;
}
bool ratInMaze(int **arr,int **sol_arr,int x,int y,int n){
if(x==n-1 && y==n-1){
sol_arr[x][y] = 1;
return true;
}
if(is... | ALGO | 0.999977 | 4.560183 | {
"github_metadata": {
"branch": "main",
"commit_count": 196,
"repo_created_at": "2024-09-03T16:41: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": "da29cfafd9... |
46fdaecc-3852-4581-87da-85c35a8dbdbb | ishandutta2007/codeforces-s | szb/normal/750/F.cpp | #include<queue>
#include<ctime>
#include<vector>
#include<cstdio>
#include<cstring>
#include<memory.h>
#include<algorithm>
#define ll int
#define For(i,j,k) for(ll i=j;i<=k;++i)
#define FOr(i,j,k) for(ll i=j;i>=k;--i)
#define F first
#define S second
using namespace std;
inline ll read(){ ll x=0,f=1;char ch=getchar... | ALGO | 0.999747 | 3.26901 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:07: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": "80920626920e... |
c6d19eb1-95f2-4a9b-a224-412923add3b0 | algorithmSSU/yejiHong | Weekly problem solving(2023~)/June/programmers/level3/가장먼노드.cpp | #include <iostream>
#include <string>
#include <vector>
#include <queue>
using namespace std;
int maxlen = 20001;
vector<int> tree[20001];
int *dist;
bool visited[20001] = {
0,
};
int d = 1;
void bfs(int start)
{
queue<int> q;
q.push(start);
visited[start] = true;
while (!q.empty())
{
... | ALGO | 0.999019 | 4.322196 | {
"github_metadata": {
"branch": "main",
"commit_count": 289,
"repo_created_at": "2022-06-29T06:51:50.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "82d5f5b3e11... |
dbf83797-24b1-4f95-9f41-0aa686551a98 | khs3737/Algorithm | Baekjoon/Baekjoon_9934_완전 이진 트리.cpp | #include<bits/stdc++.h>
using namespace std;
int n;
pair<int, int> node[1050];
int isVisited[1050];
int idx = 1;
void inorder(int k)
{
if (k * 2 < pow(2, n))
inorder(2 * k);
if (isVisited[k] == 0)
{
isVisited[k] = 1;
node[idx].first = k;
idx++;
}
if (k * 2 + 1 < pow(2, n))
inorder(2 * k + 1);
}
int ma... | ALGO | 0.999986 | 4.327786 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2021-02-01T07:36:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "79c96e8093e8... |
071f9ff3-39b8-47bb-b74a-eb45f68054c9 | kozyarskaya/functions_koz_sof_easy | squares_of_figures.cpp | #include"easy.h"
//Площадь квадрата в целых числах
int itc_skv(int side){
if (side <= 0){
return -1;
}
else{
return side * side;
}
}
//Площадь прямоугольника в целых числах
int itc_spr(int side_a, int side_b){
if (side_a <= 0 || side_b <= 0){
return -1;
}
else{
retu... | ALGO | 0.987105 | 4.393164 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2021-11-06T19:38: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": "202b228efb76... |
e2b71403-7e8b-4aed-be82-3c593ab95dc5 | weiqixu05/Codeforces | candies.cpp | /*
ID: weiqixu1
PROG: test
LANG: C++
*/
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define FOR(i,a,b) for(int i = a; i<b; i++)
#define pob pop_back()
#define vi vector<int>
#define vs vector<string>
#define vll vector<long long int>
#define vc vector<char>
#define vb vec... | ALGO | 0.998966 | 3.055676 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2021-11-07T15:45:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "006ab964312... |
ac049210-c40c-4c81-9a74-cc3026d1869e | malinfeng/Blog_mlf | 刷题/leetcode/04_寻找两个有序数组的中位数.cpp |
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
class Solution {
public:
double findMedianSortedArrays(vector<int>& nums1, vector<int>& nums2)
{
int len1 = nums1.size();
int len2 = nums2.size();
if ((len1 + len2) & 1)
{
return helpfindKth(nums1, 0, nums2, 0, (len1 + len2)... | ALGO | 0.99996 | 5.458773 | {
"github_metadata": {
"branch": "master",
"commit_count": 54,
"repo_created_at": "2019-08-07T12:39:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dd11e9646... |
9b8d1f1c-a75c-4b94-b19b-c7807cfd6e4a | Kiritow/OJ-Problems-Source | HDOJ/4478_autoAC.cpp | #include <cstdlib>
#include <cstring>
#include <cstdio>
#include <algorithm>
#include <iostream>
#include <queue>
using namespace std;
int N, T, sx, sy;
char mp[105][105];
char vis[105][105][2];
struct Sta {
int x, y, t;
};
queue<Sta>q;
int dir[8][2]={{-1,0},{-1,1},{0,1},{1,1},{1,0},{1,-1},{0,-1},{-1,-1}};
inli... | ALGO | 0.999466 | 4.352036 | {
"github_metadata": {
"branch": "master",
"commit_count": 939,
"repo_created_at": "2016-04-10T01:06:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 24,
"forks": 8,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2fcaec2... |
0a0b9f3d-63c1-4980-bfc3-28af6c9919ad | AlexVRC3/FAL | FAL EJ5 - 02/source.cpp | // <NAME>
#include <fstream>
#include <iostream>
#include <vector>
using namespace std;
using matriz = vector<vector<bool>>;
using marcador = vector<bool>;
// Calcula la diagonal ascendente de la casilla [f,c]
int d_asc(const int f, const int c, const int n) {
return c + f + 2 * n - 1;
}
// Calcula la diagonal... | ALGO | 0.999912 | 5.079586 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2024-02-01T16:09:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6008f0f64f90... |
6716ad81-a54e-47a8-83f6-fb00459df36a | aureliencarpentier/grammaire-langage-tp-4IF | e8.cpp | #include "automate.h"
#include "e8.h"
#include <iostream>
E8::E8():Etat("E8"){}
bool E8::transition(Automate & automate, Symbole*s) {
//ici on récupère la pile de symboles contenue dans l'automate (fonction à tester évidement)
stack<Symbole*> symboleStack = automate.getSymbolstack();
//ici,... | ALGO | 0.977441 | 3.683853 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2021-02-24T09:12: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": "285793d60... |
4834fbd4-4e29-480c-9bb9-9f25b855400d | ishandutta2007/codeforces-k | khuepr123/normal/1693/B.cpp | /*
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimize("unroll-loops")
*/
// lethal option
#include<bits/stdc++.h>
using namespace std;
#define all(flg) flg.begin(), flg.end()
#define int long long
#define pb push_back
#define fi first
#define se second
#define endl "\n"
#define eb e... | ALGO | 0.999614 | 3.598614 | {
"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": "39b3bedb1834... |
52cb7a0e-b61e-4e1e-9e75-29924951add3 | mdronyislamheemel/A2Z-DSA-with-Strivers | patterns.cpp | #include<iostream>
#include<vector>
using namespace std;
void pattern1(int n){
for(int i = 1; i<=n; i++){
for(int j=1; j<=i; j++){
cout<< j<< " ";
}
cout<< endl;
}
}
void pattern2(int n){
for(int i = 0; i<n; i++){
for(int j=0; j< n-i-1; j++){
cout<< "... | ALGO | 0.999979 | 3.491044 | {
"github_metadata": {
"branch": "master",
"commit_count": 44,
"repo_created_at": "2025-05-26T16:23: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": "c494a46f1... |
bd06fe7c-90ff-4c27-a7b0-677d1724f2ae | alexandraback/datacollection | solutions_5690574640250880_0/C++/yefllowers/cc.cpp | #include <iostream>
#include <string>
#include <algorithm>
#include <queue>
using namespace std;
const int dx[8] = {0, 1, 0, -1, 1, 1, -1, -1};
const int dy[8] = {1, 0, -1, 0, -1, 1, -1, 1};
char a[55][55];
int r, c, m, n;
string toString() {
string s;
a[0][0] = 'c';
for (int i = 0; i < r; i++) {
for (int j = ... | ALGO | 0.999673 | 3.34399 | {
"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": "0bb95b665... |
41a45496-d2c5-467c-b4f9-e530e606ea3b | bluesquinn777/Linear_Solvers_app | linear_solvers/CSRMatrix.h | #pragma once
#include "Matrix.h"
/**
Implementation of CSRMatrix (class)
This is the Matrix class for CSR Format stored matrix. This class
includes basic operations like addition, multiplication, etc.
and advanced operations like convert to Original Format.
@tparam T The type of data stored in the table
*/
temp... | TOOL | 0.976956 | 5.078152 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-03-27T06:47: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": "c1b04ddb9e... |
68b02b4d-10df-4cd4-a696-610189a2f603 | dotuangv/MyLeetCode | 1229-shortest-path-with-alternating-colors/shortest-path-with-alternating-colors.cpp | class Solution {
public:
vector<int> shortestAlternatingPaths(int n, vector<vector<int>>& redEdges, vector<vector<int>>& blueEdges) {
vector<int> ans(n, 1e9);
ans[0] = 0;
vector<vector<int>> Rpath(n), Bpath(n);
for(auto x: redEdges)
{
Rpath[x[0]].push_back(x[1]);
... | ALGO | 0.999913 | 5.263494 | {
"github_metadata": {
"branch": "main",
"commit_count": 3564,
"repo_created_at": "2024-03-26T17:17: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": "1aa048c68... |
4980a119-b3f0-4800-bfea-b97d36b29d4e | cmuparlay/parlaylib | include/parlay/internal/counting_sort.h |
#ifndef PARLAY_COUNTING_SORT_H_
#define PARLAY_COUNTING_SORT_H_
#include <cassert>
#include <cstddef>
#include <cstdint>
#include <algorithm>
#include <iterator>
#include <limits>
#include <type_traits>
#include <utility>
#include "sequence_ops.h"
#include "uninitialized_sequence.h"
#include "../monoid.h"
#include... | ALGO | 0.999737 | 7.81583 | {
"github_metadata": {
"branch": "master",
"commit_count": 221,
"repo_created_at": "2019-12-10T19:52:11.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 369,
"forks": 71,
"issues": 17,
"pull_requests": 3
},
"file_meta": {
"content_id": "ec879... |
a60be64a-902b-4c7d-839e-82177f126cbb | klzgrad/naiveproxy | src/net/third_party/quiche/src/quiche/quic/core/crypto/client_proof_source.cc | // Copyright (c) 2021 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "quiche/quic/core/crypto/client_proof_source.h"
#include <memory>
#include <string>
#include <utility>
#include <vector>
#include "absl/str... | TOOL | 0.966183 | 7.87389 | {
"github_metadata": {
"branch": "master",
"commit_count": 66,
"repo_created_at": "2018-01-27T16:02:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7097,
"forks": 903,
"issues": 6,
"pull_requests": 0
},
"file_meta": {
"content_id": "8e69... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.