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 |
|---|---|---|---|---|---|---|---|
94d5e1b0-e1d0-42ec-af59-d9b327aa7538 | ZeroOnePro/PS-Gym | review/2일차/13913.cpp | #include <bits/stdc++.h>
using namespace std;
const int range = 100'001;
int n, k;
int dist[range];
int path[range];
void bfs() {
queue<int> q;
fill(dist, dist + range, -1);
q.push(n);
dist[n] = 0;
path[n] = -1;
while (!q.empty()) {
int cur = q.front();
q.pop();
for (int nxt : {cur - 1, cur ... | ALGO | 0.99999 | 4.317541 | {
"github_metadata": {
"branch": "main",
"commit_count": 817,
"repo_created_at": "2021-11-10T16:20:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 9,
"pull_requests": 0
},
"file_meta": {
"content_id": "308d149c53... |
550b2978-b0ec-4328-95c4-3ccffae59072 | TimeDA/TimeDA | dataset/cpp_12_18/gcj2016/thocevar/10224486_5718447400943616_thocevar_main.cpp | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <iostream>
#include <sstream>
#include <vector>
#include <string>
#include <math.h>
#include <queue>
#include <list>
#include <algorithm>
#include <map>
#include <set>
#include <stack>
#include <ctime>
using namespac... | ALGO | 0.999882 | 4.099951 | {
"github_metadata": {
"branch": "main",
"commit_count": 70,
"repo_created_at": "2022-10-24T06:47: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": "592c79341f0... |
46797f39-337f-42ce-80a8-0cec48eeb3ab | PulkitMathur/Applied-Algorithms | Programming Assignments/AppliedAlgo_PA_3_Q2/src/AppliedAlgo_PA_3_Q2.cpp | //============================================================================
// Name : AppliedAlgo-PA3-Q2.cpp
// Author : <NAME>
// Version :
// Copyright : Your copyright notice
// Description : Hello World in C++, Ansi-style
//=======================================================================... | ALGO | 0.996955 | 4.086308 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2017-09-08T16:57: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": "77d9c97d01... |
e50b88b1-205c-407a-9c4a-89adbf206a96 | mkmpib/decode | DecodeWork/vector/negtivePstiveBegningEnding.cpp | // WAP to negative in begning and postive at the end
#include <bits/stdc++.h>
using namespace std;
void display(vector<int> &v)
{
for (int i = 0; i < v.size(); i++)
{
cout << v[i] << " ";
}
cout << endl;
}
// input by function
void input(vector<int> &v)
{
int n;
cout << "Enter the size... | ALGO | 0.999983 | 4.780684 | {
"github_metadata": {
"branch": "main",
"commit_count": 25,
"repo_created_at": "2023-08-30T15:30: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": "bb3876de55d... |
b046c6f5-25ed-49b1-a444-dc5aaa6afdf8 | taatzz/LeetCode | 1993.树上的操作.cpp | /*
* @lc app=leetcode.cn id=1993 lang=cpp
*
* [1993] 树上的操作
*/
// @lc code=start
#include <vector>
#include <queue>
using namespace std;
class LockingTree {
public:
vector<int> p;
vector<vector<int>> son;//邻接表
vector<int> tag;//tag[i]: 若tag[i]!=0则表示当前对节点i上锁的用户为tag[i]
LockingTree(vector<int> &pare... | ALGO | 0.999888 | 5.905109 | {
"github_metadata": {
"branch": "main",
"commit_count": 301,
"repo_created_at": "2023-11-15T00:24: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": "513fa0f85d... |
76a692dd-9106-4b6a-8a23-75cc6cc3be21 | D940465942/SIT315 | Module2/openmp/openmp.cpp | #include <stdio.h>
#include <iostream>
#include <sys/time.h>
#include <time.h>
#include <pthread.h>
#include <omp.h>
using namespace std;
#define N 1000
int NUM_THREADS;
pthread_mutex_t mutx;
int inputArray1[N][N];
int inputArray2[N][N];
int outputArray[N][N];
void intialiseArray(int array[N][N]) {
cout << "intiali... | ALGO | 0.999105 | 4.470251 | {
"github_metadata": {
"branch": "main",
"commit_count": 22,
"repo_created_at": "2021-07-29T13:10: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": "bc692c250fa... |
27158a38-d3e7-4eeb-909e-092442f044e7 | AlejandroMunozManterola/LossyLine | src/lossylin.h | #pragma once
#include <stdlib.h>
#include <vector>
#include <iostream>
#include <fstream>
#include <filesystem>
#include <nlohmann/json.hpp>
#include <Eigen/Dense>
namespace FEM {
typedef std::vector<double> Coordinates;
struct InputData {
InputData() = default;
InputData(nlohmann::json j);
double vol... | ALGO | 0.926998 | 3.684784 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2022-01-11T15:40:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "15e03c3d4ab... |
1ff5b046-397a-4180-8b2b-c7a65038917c | YuDe0418/Cpp_practice | ZeroJudge/B/304.cpp | <<<<<<< HEAD
#include <bits/stdc++.h>
using namespace std;
#define IO ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long
#define vt(v) vector<int>v;
#define pr(pr) pair<int,int>pr;
#define vtpr(vp) vector<pair<int,int>>vp;
#define qu(q) queue<int>q;;
#define F first
#define S second
#define FOR(i,a,... | ALGO | 0.999757 | 4.991502 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2024-04-28T01:23: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": "6ea68923cf0... |
c27c1bd7-88be-4a3b-985f-9d484dce2330 | vaopen/blogs | Codes/Data_Structures/Week_7/Tourism_Planning.cpp | /*
# 旅游规划
有了一张自驾旅游路线图,你会知道城市间的高速公路长度、以及该公路要收取的过路费。现在需要你写一个程序,
帮助前来咨询的游客找一条出发地和目的地之间的最短路径。如果有若干条路径都是最短的,那么需要输出最便宜的
一条路径。
# 输入格式:
输入说明:输入数据的第1行给出4个正整数N、M、S、D,其中N(2≤N≤500)是城市的个数,顺便假设城市的编号为
0~(N?1);M是高速公路的条数;S是出发地的城市编号;D是目的地的城市编号。随后的M行中,每行给出一条高速公
路的信息,分别是:城市1、城市2、高速公路长度、收费额,中间用空格分开,数字均为整数且不超过500。输入保
证解的存在。
# 输出格式:
在一行里输出... | ALGO | 0.99926 | 3.81893 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2020-03-06T11:49:31.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 25
},
"file_meta": {
"content_id": "3346908f50... |
29252f26-73be-46b2-b084-8c6db074b5a6 | soumajyoti02/Stack-Queue | Iterative_TOHanoi.cpp | /*
1. Calculate the total number of moves required i.e. "pow(2, n) - 1"; here n is number of disks.
2. If number of disks (i.e. n) is even then interchange destination pole and auxiliary pole.
--> char s = 'S', d = 'D', a = 'A';
3. FOR i = 1 to total number of moves --> (pow(2, No_Of_Disks) - 1):
if i%3 == 1:
--> L... | ALGO | 0.999901 | 5.749516 | {
"github_metadata": {
"branch": "main",
"commit_count": 30,
"repo_created_at": "2022-09-12T08:43: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": "01fe0ba1588... |
c2ddd502-3ce9-4793-9ec8-2bef95ff830b | Tyferse/C_Cpp_public | OAiP/CATS1/B_tasks/AiSD1-B1.cpp | // #include <fstream>
#include <iostream>
using namespace std;
int main() {
char n[5], settings[5];
FILE *f1 = fopen("input.txt", "r");
for (int i = 0; i < 5; i++) {
fscanf(f1, "%c", &n[i]);
}
fclose(f1);
int j = 0;
for (int i = 0; i < 5; i++) {
if (n[i] == '=') {
... | ALGO | 0.999871 | 3.401099 | {
"github_metadata": {
"branch": "main",
"commit_count": 49,
"repo_created_at": "2023-03-18T05:19: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": "c470596ceeb... |
a950eca0-5ba3-4c04-97cf-76eb2c07ace6 | CLDP/ACM-ICPC | World-Finals/2007 - Tokyo/I.cpp | #include <iostream>
#include <cstdio>
#include <vector>
#include <cmath>
#include <cstring>
#include <algorithm>
using namespace std;
double calH(double air, double space, double l, double r, double h) {
double mid = (r + l) / 2;
while (r - l > 1e-6) {
if (mid * 0.097 + air / (space - mid) > 0.097 * h ... | ALGO | 0.999938 | 3.627859 | {
"github_metadata": {
"branch": "master",
"commit_count": 486,
"repo_created_at": "2013-09-24T19:04:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "48f5fddd... |
f9aa59d7-e361-41a6-a2c6-ffbdd75bcb52 | pyeongseop96/Algo | 백준/Silver/1380. 귀걸이/귀걸이.cc | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define precision(x) cout << fixed; cout.precision(x);
#define all(a) begin(a), end(a)
/* 보석함
* cout << (s.find("fgg") == string::npos) << endl;
* ceil, round, floor, sqrt
* multiset<string> ss;
cout << *s.rbegin() << endl;
* vector<int> c(n... | ALGO | 0.991423 | 3.000356 | {
"github_metadata": {
"branch": "main",
"commit_count": 486,
"repo_created_at": "2024-04-30T00:18: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": "dab8c90ba2... |
5a76a1c9-a416-4372-b9f5-dd4f94e821ee | badouralix/adventofcode-2018 | day-11/part-1/evqna.cpp | #include <array>
#include <iostream>
#include <string>
#include <ctime>
using namespace std;
const int GRID_SIZE = 300;
const int WINDOW_SIZE = 3;
int powerLevel(int serialID, int x, int y) {
int rackID = x + 10;
int power = (rackID * y + serialID) * rackID;
power = power / 100 - 10 * (power / 1000);
... | ALGO | 0.999305 | 5.022991 | {
"github_metadata": {
"branch": "master",
"commit_count": 629,
"repo_created_at": "2018-11-30T23:33:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 29,
"forks": 6,
"issues": 3,
"pull_requests": 2
},
"file_meta": {
"content_id": "170be1d... |
8a8abd29-e00e-4a63-abdd-3beb64399f78 | thalyson004/solutions | codeforces/C_makeItEqual.cpp | #include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define ii pair<int,int>
#define iii pair<ii, int>
#define iiii pair<ii, ii>
#define viiii vector< iiii >
#define viii vector< iii >
#define vii vector< ii >
#define vi vector< int >
#define int long long
#define sz(x) ((int)x.size())
#def... | ALGO | 0.99997 | 3.767658 | {
"github_metadata": {
"branch": "master",
"commit_count": 535,
"repo_created_at": "2018-04-21T02:21:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "110cfec7... |
07a4956f-c62e-45d7-b1b6-fdd289469b1a | otischung/CCU_workspace | Database/HW5/Leaf_Node.hpp | #pragma once
#include "Declaration.hpp"
/***********************************************************************************
Template functions, including member functions, must be written entirely in the
header files. This means that if you have a template class, its implementation
must be entirely in a header file. ... | TOOL | 0.939083 | 4.429164 | {
"github_metadata": {
"branch": "master",
"commit_count": 237,
"repo_created_at": "2021-03-27T15:33: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": "089a5767... |
540f04e2-b4dd-490e-9f65-2296ed0c71f4 | mihail-m/CP-implementations | 4-Graphs/01-Fundamentals/c++/11-prim.cpp | #include <bits/stdc++.h>
using namespace std;
static const int MAX_SIZE = 1 << 18;
struct Edge {
int to = -1;
int cost = INT_MAX;
bool operator <(const Edge& rhs) const {
return make_pair(cost, to) < make_pair(rhs.cost, rhs.to);
}
};
int n, m; // nodes and edges
vector<Edge> graph[MAX_SIZE];... | ALGO | 0.999665 | 4.749456 | {
"github_metadata": {
"branch": "master",
"commit_count": 275,
"repo_created_at": "2019-11-21T08:56:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "538c4409... |
c099cc89-9666-4579-b74b-add904ef4b1b | Ilsa-Ilyas/OOP-Lab-Semester-2-24K-0563- | Lab 5/5CW3.cpp | #include <iostream>
#include <vector>
#include <string>
using namespace std;
class Catalog {
vector<string> ISBN;
vector<string> locations;
public:
void addISBN(string s, string l) {
ISBN.push_back(s);
locations.push_back(l);
cout << "\nISBN Added: " << s <... | TOOL | 0.992607 | 5.92122 | {
"github_metadata": {
"branch": "main",
"commit_count": 109,
"repo_created_at": "2025-02-05T07:08:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "518de094b3... |
41595076-b988-4a2b-a33d-a140bff92771 | tlc-pack/relax | src/relay/transforms/merge_compiler_regions.cc | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... | TOOL | 0.997721 | 7.295083 | {
"github_metadata": {
"branch": "relax",
"commit_count": 10428,
"repo_created_at": "2021-06-22T22:05:26.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 196,
"forks": 56,
"issues": 43,
"pull_requests": 2
},
"file_meta": {
"content_id": "8486... |
c15e247d-7e26-4804-a19c-b9e33bfaa9ff | ithink20/Algorithms | codes/Tree/heap_sort.cpp | /*
author: @vikasc
*/
#include <iostream>
#include <algorithm>
#include <vector>
#include <cstdlib>
#include <vector>
#include <set>
#include <climits>
#include <map>
#include <string>
using namespace std;
typedef long long int lint;
void max_heapify(int *A, int i, int N) {
int left = 2 * i + 1;
int right = 2 ... | ALGO | 0.999919 | 4.471882 | {
"github_metadata": {
"branch": "master",
"commit_count": 255,
"repo_created_at": "2018-02-19T13:55:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 7,
"issues": 0,
"pull_requests": 6
},
"file_meta": {
"content_id": "1a88d0f3... |
d52ffa47-be10-4ae8-be69-295938940e7d | PrashansaSoni/Analysis_and_Design_of_algo | N_Queens.cpp | // #include<bits/stdc++.h>
// using namespace std;
// class NQueens{
// int N;
// vector<vector<int>>board;
// public:
// NQueens(int n){
// this->N = n;
// for(int i=0;i<N;i++){
// for(int j=0;j<N;j++)
// board[i][j]=0;
// }
// }
... | ALGO | 0.999931 | 5.936633 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2024-11-06T13:27: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": "4eaad54dba... |
1ef790a7-4347-4f09-96bf-02fa42fcd856 | ishandutta2007/codeforces-m | mnaeraxr/normal/1428/E.cpp | #include <algorithm>
#include <array>
#include <assert.h>
#include <bitset>
#include <chrono>
#include <cmath>
#include <complex>
#include <cstring>
#include <functional>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <istream>
#include <map>
#include <math.h>
#include <numeric>
#include <ostream>
... | ALGO | 0.999855 | 4.627653 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-06-06T01:03: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": "dd8bb6d8ff6f... |
c998cc56-7907-4970-bbb9-b86621b2c503 | Capobmb/CP-library | Trie.hpp | #include<bits/stdc++.h>
template<unsigned char_count = 26, int char_base = 'a'>
struct Trie {
struct Node {
Node* child[char_count];
int char_n; // char_base_indexed
int word_end_count;
// 以下に任意の情報を追加
// cというcharをもつ頂点を作成
Node(int c) : char_n(c), word_end_count(0) {
... | ALGO | 0.994117 | 4.595108 | {
"github_metadata": {
"branch": "main",
"commit_count": 63,
"repo_created_at": "2023-06-05T15:40:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "187b139fe92... |
ca265063-56f1-43e5-affa-569026fd3380 | LucasWilkinson/ASpT-mirror | nlibs/CSR.h | /*
* CSR.h
*
* Created on: Oct 3, 2013
* Author: niuq
*/
#ifndef CSR_H_
#define CSR_H_
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include "math.h"
#include "cpu_csr_kernel.h"
#include "tools/key_value_qsort.h"
#ifdef enable_gpu
#include <cuda.h>
#include <cuda_runtime_api.h>
#endif
#include... | TOOL | 0.911897 | 3.1129 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2021-10-20T21:32:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 16,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ec77af3f1... |
59b3a0ee-232d-4531-b100-64e51f73ed0d | Kostebelova-Elizaveta/CodeRunnerTasks_practice | alg-teachers-support-sorting/course/merging/3_task.cpp | #include <iostream>
#include <math.h>
using namespace std;
// Функция для слияния двух подмассивов
void merge(int arr[], int left[], int leftSize, int right[], int rightSize) {
int i = 0, j = 0, k = 0;
// Слияние двух подмассивов в основной массив
while (i < leftSize && j < rightSize) {
if (left[i... | ALGO | 0.999994 | 5.605719 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-09-01T14:13: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": "7ab77a81844a... |
1ab1e8a3-3aab-4c21-aaf5-dc797c5c3851 | Marlin-Phone/code | cpp/luogu/Luogu_P_10426.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
int H[N], n;
unordered_map<int, vector<int>> factor_map;
void get_factors(int x) {
set<int> factors;
for (int i = 1; i * i <= x; ++i) {
if (x % i == 0) {
factors.insert(i);
factors.insert(x / i);
}
... | ALGO | 0.999982 | 3.832127 | {
"github_metadata": {
"branch": "main",
"commit_count": 179,
"repo_created_at": "2025-01-09T06:37:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "107f89423e... |
15d47b27-a21a-4c47-a6e8-26bf92b01479 | SamuellH12/Competitive-Programming-Algorithms | Solutions/CodeForces/1932f - Feed Cats.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 vii vector<pii>
#define INF 0x3f3f3f3f
const int MAXN = 1e6 + 5;
using namespace std;
// ... | ALGO | 0.999944 | 3.912586 | {
"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": "92b2104d... |
434ae459-fdcc-4f77-b59b-dc4554cdddd4 | reza-hm89/C-Plus-Plus | WEP/WEP/main1.cpp | #include <stdio.h>
#include <iostream>
using namespace std;
unsigned char* KSA(char* key, int keylen){
unsigned char* s=new unsigned char[256];
for(int i=0; i<256; i++)
s[i]=i;
int j=0;
for(int i=0; i<256; i++){
j=(j+s[i]+(unsigned char)key[i % keylen]) % 255;
swap(s[i], s[j]);
}
return s;
}
char PRGA(u... | ALGO | 0.999902 | 3.851643 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2022-10-09T10:14: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": "b87edbf4f6... |
f1bcc671-ade0-459d-a2d1-8f93d166a5c5 | JokubasZaveckis/Uzdaviniai | 2021/Pakartotine/Savanoryste/main.cpp | #include <iostream>
#include <iomanip>
#include <fstream>
#include <cmath>
using namespace std;
struct Diena
{
int numeris;
int praleistasLaikasMinutemis;
int suvenyrai[5];
int skirtinguSuvenyruSuma = 0;
int h0, m0, h, m; //Isejimo ir atejimo laikas
int kiekSkirtinguSuvenyru = 0;
};
void Nusk... | ALGO | 0.998947 | 3.510303 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2022-01-02T16:20: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": "09a4fbbe563... |
193df9e0-cf55-40d5-ad8b-96c8a59587e6 | Hyper-Infinity/DsaCodes | trie/trieWithXor.cpp | /* <<<<< <NAME> >>>>> */
#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
typedef long long int ll;
typedef unsigned long long int ull;
#define all(x) (x).begin(), (x).end()
#define F first
#define S second
#define PB push_back
#define MP make_pair
typedef vector<long long int> vli;
typedef vector... | ALGO | 0.998822 | 3.862532 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2023-07-28T14:00: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": "6d31bf9d5b50... |
2df09e49-3245-453e-bcef-deebe4fadd2c | luciocf/CP-Problems | Codeforces/1238F.cpp | // Codeforces 1238F - The Maximum Subtree
// <NAME>
// Solution is the same as in editorial
#include <bits/stdc++.h>
#define ff first
#define ss second
using namespace std;
typedef pair<int, int> pii;
const int maxn = 3e5+10;
int dp[maxn][2];
vector<int> grafo[maxn];
void dfs(int u, int p)
{
pii mx = {0, 0};
... | ALGO | 0.999877 | 4.702911 | {
"github_metadata": {
"branch": "master",
"commit_count": 1082,
"repo_created_at": "2019-02-04T01:05: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": "f5364f9... |
cb782ad0-60c8-4a8f-8639-5203abd8a455 | Harsh0721/data-structures-and-algorithms | Linked List implementation.cpp | #include<bits/stdc++.h> // "Hello there"
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define pb push_back
#define ll long long int
#define SORTA(v) sort(v.begin(),v.end())
#define SORTD(v) sort(v.begin(),v.end()... | ALGO | 0.999553 | 3.670436 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2021-06-25T17:27: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": "21c0cb25603e... |
61332133-be60-4125-9e8e-deb4f5eee36a | yyzs/OnlineJudgeCode | HDOJ/hdu/hdu/4027.cpp | #include "stdio.h"
#include "string.h"
#include "math.h"
#include "algorithm"
#define lson l,m,rt<<1
#define rson m+1,r,rt<<1|1
#define MAX 100010
using namespace std;
long long sum[MAX<<2];
void push_up(int rt)
{
sum[rt]=sum[rt<<1]+sum[rt<<1|1];
}
void build(int l,int r,int rt)
{
if(l==r)
{
scanf("... | ALGO | 0.999799 | 3.488427 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2016-12-02T09:07: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": "1ff1fa8d9a... |
93fc0459-8e84-4f56-b918-76fd544b52ed | Zipa008/Proyecto_Gamestrore | Proyecto_grupo16_beta_estructuras.cpp | #include <iostream>
#include <string>
using namespace std;
struct Juego {
string nombre;
string categoria;
string peso;
string precio;
int licencias_disponibles;
int licencias_vendidas;
string codigo;
};
struct Descuento {
int licencias_sports;
int licencias_shooter;
int licen... | TOOL | 0.906956 | 4.121384 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2023-11-14T15:34:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "aad1d02a0bf... |
6c591026-c2bb-4044-8a79-44540d3d56dd | Yash-op7/programming-contests-streak-challenge | day_11/div2_contest/a.cpp | #include <bits/stdc++.h>
using namespace std;
#define vi vector<int>
#define vvi vector<vi>
#define vvvi vector<vvi>
#define vb vector<bool>
#define vvb vector<vb>
#define vvvb vector<vvb>
#define pq priority_queue
#define ll long long
#define all(x) (x).begin(), (x).end()
#define vl vector<ll>
#define vvl vector<vl>
... | ALGO | 0.999917 | 4.084245 | {
"github_metadata": {
"branch": "main",
"commit_count": 60,
"repo_created_at": "2024-08-01T20: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": "dd1ef875286... |
a22ba542-a900-4c65-870d-dbebf37468f5 | jiakum/leetcode | seventh/twosumiv.cpp |
/**
* 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 subSearch(unordered_set<int> &data,TreeNode* root, int k) {
if(root =... | ALGO | 0.999998 | 5.950492 | {
"github_metadata": {
"branch": "master",
"commit_count": 66,
"repo_created_at": "2018-09-01T01:20: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": "19a30f87a... |
eb9d72e5-9f8a-4941-8522-218669364b8f | lmark1/aoc2020 | day09.cpp | #include "util.hpp"
template <typename T, typename It>
bool preamble_contains(It begin, It end, T val) {
end--;
while (begin != end) {
auto res = *begin + *end;
if (res == val) {
return true;
}
if (res < val) {
begin++;
continue;
}
if (res > val) {
end--;
... | ALGO | 0.999059 | 6.720624 | {
"github_metadata": {
"branch": "main",
"commit_count": 38,
"repo_created_at": "2020-12-02T00:26: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": "62cac9ae830... |
9181f15b-e0ab-4f9e-aee5-bf521a5f5d86 | hjiang13/LLM4IR | results/Task2_IR_Decompilation/Decompiled_Humaneval_x_cpp_164_Result_O3/Meta-Llama-3.1-405B_Humaneval_x_cpp_164/test/CPP_49.cpp | int modp(int a, int b) {
if (a > 0) {
if ((a & 3) == 0) {
a = 1;
} else {
int c = a - 1;
int d = a & 3;
int e = 1;
do {
e = (e << 1) % b;
d--;
} while (d != 0);
a = e;
}
} ... | ALGO | 0.999724 | 4.810398 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2025-05-21T20:32:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "22436937ce5... |
164805e4-fe1c-4d87-b9b7-915e99eaf47d | kateBea/FIB-PRO1-Programacion-I | Problemas de Jutge/P09 - Data Structures [ Tuples ]/P82952.cc | // P82952 RECTANGLES (2)
#include <iostream>
using namespace std;
struct Rectangle {
int x_left, x_right, y_down, y_up;
};
void llegeix(Rectangle& r) {
cin >> r.x_left >> r.x_right >> r.y_down >> r.y_up;
}
int relationship(const Rectangle& r1, const Rectangle& r2) {
if (r1.x_left == r2.x_left && r1.x_right == r2... | ALGO | 0.99769 | 3.866918 | {
"github_metadata": {
"branch": "main",
"commit_count": 56,
"repo_created_at": "2022-08-13T05:28:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "337a5a06bd3... |
edc62d9a-021e-4870-b8df-054f69883e1c | dslwz2008/opencourse | dsa-thu/dsa-assignments/DataStructure/Vector.h | #ifndef VECTOR_H
#define VECTOR_H
typedef int Rank; //秩
#define DEFAULT_CAPACITY 3 //默认的初始容量(实际应用中可设置为更大)
//向量模板类
template <typename T> class Vector {
protected:
Rank _size; int _capacity; T* _elem; //规模、容量、数据区
//复制数组区间A[lo, hi)
void copyFrom ( T const* A, Rank lo, Rank hi )
{
_elem = new T[_capacity = 2 * ... | TOOL | 0.956111 | 4.714372 | {
"github_metadata": {
"branch": "master",
"commit_count": 100,
"repo_created_at": "2014-07-09T08:37:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3fec2ba0... |
781479e9-9dc6-4975-8983-f7549f5adc7c | haiphamcoder/CodeSignal | Intro/P02.EdgeOfTheOcean/problem05_shapeArea.cpp | #include <iostream>
using namespace std;
int solution(int n)
{
// n: 1 2 3 4 5 6 ... n
// append: 1 4 8 12 16 20 ... 4*(n-1)
// s: 1 5 13 25 41 61 ... 1 + 2*n*(n-1)
return 1 + 2 * n * (n - 1);
}
int recursive(int n)
{
if (n == 1)
{
... | ALGO | 0.999146 | 5.556839 | {
"github_metadata": {
"branch": "main",
"commit_count": 110,
"repo_created_at": "2023-04-15T15:58:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "396e9cce46... |
859d8c02-c97b-466a-b104-7581630fd5e7 | ac-voyage/library | data_structure/segment_tree.cc | /* Segment tree (Interval tree, range tree), by Abreto <<EMAIL>>. */
template <int STMAX = 1000000>
struct segment_tree
{
struct node_t
{
static inline node_t merge(node_t n1, node_t n2)
{
node_t ans;
ans.l = n1.l; ans.r = n2.r;
/* merge n1 and n2 to ans. */
... | ALGO | 0.999447 | 6.245898 | {
"github_metadata": {
"branch": "master",
"commit_count": 58,
"repo_created_at": "2017-08-07T14:36:53.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bb05b5f12c... |
97084647-ab0e-424a-ae8e-79eb08920021 | 1InfinityDoesExist/HackerRank | Equal Stacks.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution{
private:
public:
Solution();
int equalStacks();
};
Solution::Solution(){}
int Solution::equalStacks(){
int k, l, m;
cin >> k >> l >> m;
vector<int> first(k);
vector<int> second(l);
vector<int> third(m);
int h1... | ALGO | 0.999763 | 3.861531 | {
"github_metadata": {
"branch": "master",
"commit_count": 63,
"repo_created_at": "2018-03-03T21:44: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": "63e4f2f8e... |
9219d3d1-1e9d-458f-82d9-01fd684e329c | uni-algo/uni-algo | example/cpp_ranges.h | /* Example for Unicode Algorithms Implementation.
* License: Public Domain or MIT - choose whatever you want.
* See LICENSE.md */
#include "uni_algo/norm.h"
#include "uni_algo/ranges.h"
#include "uni_algo/ranges_norm.h"
#include "uni_algo/ranges_conv.h"
#include "uni_algo/ranges_word.h"
// -------------------------... | TOOL | 0.949302 | 7.31882 | {
"github_metadata": {
"branch": "main",
"commit_count": 863,
"repo_created_at": "2022-07-07T09:25:07.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 298,
"forks": 26,
"issues": 6,
"pull_requests": 1
},
"file_meta": {
"content_id": "3bfce761... |
e6493b3a-e7ce-448a-a7b5-40f5227ca40f | isaaclo97/programacion-competitiva | Problemas/Codeforces/101620_CERC2017A_CODEFORCES.cpp | #include <bits/stdc++.h>
#define INF 0x3f3f3f3f
using namespace std;
int main()
{
//freopen("C:/Users/Isaac/Documents/QT/Entregar/in.txt","r",stdin);
int r,p; scanf("%d%d",&r,&p);
int peopleleft=0, peopleright=0;
char matrix[r+3][11];
int numasientos[r+3][11]; memset(numasientos,0,sizeof(numasiento... | ALGO | 0.999811 | 3.101516 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2022-06-26T17:15:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d976c6dbd8b0... |
991fea88-9038-4b53-a358-12ca0698eb30 | Tudi/TempStorage | Calculator/main.cpp | #include <stdio.h>
#include <string.h>
#include <windows.h>
#include <list>
#include "Logger.h"
#include "PosixToInfix.h"
#include "KeyWords.h"
#include "Expression.h"
/*
* Contains hardcoded strings to print out string.
* Same string contained in the readme file
*/
void PrintHelp(int Type=0)
{
#define HelpString R"(T... | ALGO | 0.977183 | 4.583862 | {
"github_metadata": {
"branch": "master",
"commit_count": 385,
"repo_created_at": "2016-04-07T09:42:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 5,
"issues": 3,
"pull_requests": 6
},
"file_meta": {
"content_id": "85a4b9a5... |
d8228de2-9be5-403f-bc9f-372711eebd14 | Hcappers/School-Work | CSCE 1030/Labs/Lab6/LAb6B.cpp | #include <iostream>
using namespace std;
int main ()
{
const int ROW_SIZE = 2; //number of rows
const int COLUMN_SIZE = 5; //number of columns
int row_sum[ROW_SIZE];
int column_sum[COLUMN_SIZE];
int matrix[ROW_SIZE][COLUMN_SIZE]; //2D array
int sum_1, sum_2;
for (int i = 0; i < ROW_SIZE; ++i){
for (int h = 0... | ALGO | 0.998588 | 4.142993 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2023-12-05T16:45:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bef3bedbede... |
949f4e67-af69-4365-955a-2a9f85e19bf7 | dgardner4695/mastermind | code.cpp | #include <iostream>
#include <algorithm>
#include <time.h>
#include <sstream>
#include <locale>
#include "code.h"
using namespace std;
vector<int> split(string &s, char delim, int max){
//function to split a string seperated by commas into integers and stores them in a vector
vector<int> nums;
string digi... | ALGO | 0.998171 | 3.827111 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2017-01-19T13:07: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": "cc2a97f74... |
8ad45fca-522f-4b25-9a5e-31c6bd225d8e | ckdlscjs/AlgorithmRepo | 백준/Silver/14940. 쉬운 최단거리/쉬운 최단거리.cc | #include <bits/stdc++.h>
using namespace std;
const int dy[] = {0, 0, 1, -1};
const int dx[] = {1, -1, 0, 0};
int n, m, sy, sx, arr[1005][1005], dist[1005][1005];
int main()
{
std::ios::sync_with_stdio(false);
std::cin.tie(0);
std::cout.tie(0);
std::cin >> n >> m;
for(int i = 0; i < n; i++)
{
for(int j... | ALGO | 0.999775 | 3.746846 | {
"github_metadata": {
"branch": "main",
"commit_count": 1272,
"repo_created_at": "2024-01-10T13:32: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": "c9f83f96d... |
d7c697c7-da74-4f17-bc4c-a29c90b0520a | NekoMio/ACMcode | Codes/BZOJ/BZOJ_4521.cpp | #include <cstdio>
#include <algorithm>
#include <cstring>
using namespace std;
long long f[15][2][10][10][4][2];
int g(int a, int b)
{
return (((a == 8) << 1)|(b == 4))|(((b == 8) << 1) | (a == 4));
}
long long DP(long long x)
{
int a[15];
int len = 0;
memset(f, 0, sizeof (f));
while (x) a[11 - (len... | ALGO | 0.999654 | 4.350117 | {
"github_metadata": {
"branch": "master",
"commit_count": 122,
"repo_created_at": "2017-07-14T23:35: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": "542636e1... |
497c41c2-d60f-4a5f-87e6-7c2bd0b55b26 | luyocarp/Algorithmic-Contests | Codeforces/cf_750B.cpp | #include <bits/stdc++.h>
using namespace std;
#define all(v) (v).begin(),(v).end()
#define pb push_back
#define sqr(x) ((x)*(x))
#define mp make_pair
#define EPS 1e-9
#define ones(x) __builtin_popcount(x)
#define fast_io() ios_base::sync_with_stdio(0);cin.tie(0);
#define REP(i,x,y) for(int (i)=(x);(i)<(y);(i)++)
#defin... | ALGO | 0.999864 | 3.643883 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2020-09-10T15:25: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": "2cf21cae89... |
629cb771-d1b0-44cb-95db-6d8fc2d80d93 | yjl9903/XCPC | HDu/attempt/3567-TLE.cpp | #include <iostream>
#include <cstring>
#include <algorithm>
#include <queue>
#include <vector>
#define ms(a,b) memset(a,b,sizeof(a))
using namespace std;
typedef long long ll;
const int maxn = 362880 + 5;
int f[10], st[maxn][9], pre[maxn], vis[maxn], shash[maxn];
int dir[4][2] = {1, 0, 0, -1, 0, 1, -1, 0};
void init()... | ALGO | 0.999979 | 4.064433 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-03-25T19:33:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "71fa162b625c... |
3d04b423-995a-4cd4-b301-3819f5d39a14 | JonyeLH/DSA | 图/ConsoleApplication1/ConsoleApplication1/源.cpp | #include <iostream>
#include <string>
#include <stdio.h>
#include <stdlib.h>
using namespace std;
#define MAX_VERTEX_NUM 4
#define MAX_NAME 2
typedef int Infortype;
typedef int VertexType;
typedef enum { DG, DN, AG, AN } GraphKind; //图形种类{有向图,有向网,无向图,无向网}
typedef struct _ArcNode
{
int adjvex; //该弧指向的顶点的位置
... | ALGO | 0.998865 | 3.622441 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2020-06-22T03:05:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f9ef45d579... |
3c085328-d745-43b7-bf9c-f21c888959c1 | lihuaibei7951/C-2graph | utils/convert2binary.cpp | #include <iostream>
#include <fstream>
#include <sstream>
#include <vector>
#include <algorithm>
#include <ctime>
using namespace std;
void buildGraph(const string& filePath, vector<vector<int>>& G) {
int VerNum = 0;
cout<<"Reading graph from " << filePath << endl;
// 第一遍扫描,确定最大顶点标号
ifstream file(fil... | DATA | 0.974624 | 3.94968 | {
"github_metadata": {
"branch": "main",
"commit_count": 16,
"repo_created_at": "2024-11-25T10:28:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b04928aa699... |
986f1ba3-28b4-46bb-b396-e81a7186e4dd | NipenPaul/Program-Catagory-Document | Online Judge/LightOJ/light_1212.cpp | #include <bits/stdc++.h>
#define int long long
using namespace std;
void start()
{
//ios::sync_with_stdio(0);cin.tie(0);
#ifndef ONLINE_JUDGE
freopen("in.txt", "r", stdin);
// freopen("out.txt", "w", stdout);
#endif // ONLINE_JUDGE
}
int32_t main()
{
start();
int t; cin >> t;
for(in... | ALGO | 0.998566 | 4.015714 | {
"github_metadata": {
"branch": "main",
"commit_count": 754,
"repo_created_at": "2022-08-22T08:20: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": "d640252032... |
5b114f86-1141-466b-b81a-babde847d119 | luciocf/CP-Problems | infoarena/curent.cpp | // Infoarena - Curent
// <NAME>
// Solution:
// Notice a vertex is only on if none of its ancestors are off. Let's linearize the tree.
// The problem now becomes handling these 2 queries:
// 1. Add +1 or -1 in a range (vertex becomes off or on, respectively)
// 2. Count the amount of zeroes in a range (if a vertex h... | ALGO | 0.999874 | 4.404202 | {
"github_metadata": {
"branch": "master",
"commit_count": 1082,
"repo_created_at": "2019-02-04T01:05: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": "d6e17e7... |
f8caeff6-1377-43e3-b716-a1854bba3b5b | leviroseb/BinarySearchTree | BinarySearchTree.h | #ifndef BINARY_SEARCH_TREE_H
#define BINARY_SEARCH_TREE_H
#include "dsexceptions.h"
#include <iostream>
using namespace std;
template <typename Comparable>
class BinarySearchTree
{
public:
BinarySearchTree( ) :root( NULL )
{
}
BinarySearchTree( const BinarySearchTree & rhs ) : root( NULL )
{
... | ALGO | 0.997316 | 4.977524 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-10-14T10:33:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4d428edfc8... |
af04a7a0-1f5f-4c5a-9ed0-d8e1b187ccb6 | vectorstorm/vectorstorm | VS/Math/VS_Matrix.cpp | /*
* VS_Matrix.cpp
* VectorStorm
*
* Created by <NAME> on 11/12/08.
* Copyright 2009 <NAME>. All rights reserved.
*
*/
#include "VS_Matrix.h"
#include "VS_Quaternion.h"
vsMatrix4x4 vsMatrix4x4::Identity;
vsMatrix3x3 vsMatrix3x3::Identity;
vsMatrix3x3::vsMatrix3x3():
x(1.f,0.f,0.f),
y(0.f,1.f,0.f),
z(0... | TOOL | 0.996617 | 5.810331 | {
"github_metadata": {
"branch": "master",
"commit_count": 1696,
"repo_created_at": "2012-04-12T11:10:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 37,
"forks": 7,
"issues": 2,
"pull_requests": 2
},
"file_meta": {
"content_id": "dbe9e2... |
2f7d6a33-d697-44ff-b0e3-1f717f9863e0 | chisanahn/TIL | Algorithm/PS_history/BOJ/old/BOJ_45656.cpp | #include <iostream>
using namespace std;
using ll = long long;
// dp[i][j] = 길이가 i이고 j로 끝나는 계단수 개수
ll dp[101][10];
const ll MOD = 1000000000;
int main() {
int n;
cin >> n;
// 길이가 1인 계단수 초기화
dp[1][0] = 0;
for(int i=1; i<=9; i++) dp[1][i] = 1;
for (int i = 1; i < n; i++) {
dp[i+1][0]... | ALGO | 0.99982 | 4.174527 | {
"github_metadata": {
"branch": "main",
"commit_count": 476,
"repo_created_at": "2021-08-05T11:33:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "09264780db... |
30a5ced9-a1de-425e-a0a2-4aae7cfe208b | zimpha/competitive-programming | project-euler/volume05/230.cc | #include <bits/stdc++.h>
using LL = long long;
int F(int A, int B, LL n) {
if (n <= A + B) return n;
std::vector<LL> f = {A, B};
for (int i = 2; ; ++i) {
LL x = f[i - 2] + f[i - 1];
f.push_back(x);
if (x >= n) break;
}
int s = f.size() - 1;
while (s >= 2) {
if (n <= f[s - 2]) s -= 2;
e... | ALGO | 0.999848 | 4.349963 | {
"github_metadata": {
"branch": "master",
"commit_count": 352,
"repo_created_at": "2016-08-17T16:37:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 36,
"forks": 16,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c979cf... |
b4a9a8f5-98d6-4372-b139-d0defc6635c7 | Akshat090803/DSA-leetcode-and-Gfg-ques | 1558-course-schedule-iv/course-schedule-iv.cpp | class Solution {
public:
vector<bool> checkIfPrerequisite(int numCourses, vector<vector<int>>& prerequisites, vector<vector<int>>& queries) {
vector<vector<int>> adj(numCourses);
vector<int> indegree(numCourses, 0);
for(auto p : prerequisites) {
adj[p[0]].push_back(p[1]);
... | ALGO | 0.999613 | 6.012978 | {
"github_metadata": {
"branch": "main",
"commit_count": 333,
"repo_created_at": "2025-01-08T07:34: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": "eb6ebe6e84... |
fa24fe63-ee02-46ae-9697-73c698918bd9 | lucastr98/algorithms-lab-examples | src/h1n1.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Delaunay_triangulation_2.h>
#include <CGAL/Triangulation_face_base_with_info_2.h>
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef CGAL::Triangulation_vertex_base... | ALGO | 0.999851 | 4.577734 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2023-02-27T15:44: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": "42c31d544a01... |
0f10b7ec-afb5-46cc-af58-1396e6dc3449 | hhuangwx/sidecar | Algorithms/PRISegmentation/PRISegmentation.cc | #include "Messages/Segments.h"
#include "PRISegmentation.h"
using namespace SideCar::Algorithms;
using namespace SideCar::Messages;
PRISegmentation::PRISegmentation(Controller& controller, Logger::Log &log)
: Algorithm(controller, log),
threshold_(Parameter::IntValue::Make("threshold", "Threshold", 5000))
{... | ALGO | 0.958418 | 5.884056 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2017-10-10T04:37:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 9,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f80c27089... |
ac95bef4-5831-4317-a051-0884fe1aa384 | Xvedk/GFG-ALL | POTD/2024/JULY/23-07-2024.cpp | class Solution {
public:
// code to perforn in-order traversal of BSTs and form two sorted arrays
void inOrderTraversal(Node* root, vector<int>& ans) {
stack<Node*> s;
Node* temp = root;
while (!s.empty() || temp!=NULL) {
while (temp!=NULL) {
s.... | ALGO | 0.999995 | 6.181093 | {
"github_metadata": {
"branch": "main",
"commit_count": 650,
"repo_created_at": "2023-10-29T18:34: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": "3c6e7cd761... |
e82dbfd0-d453-4d71-9d1d-5b96b5a938bb | imsure/tech-interview-prep | leetcode/contest/57/722.cpp | #include "../common.hpp"
class Solution {
public:
vector<string> removeComments(vector<string>& source) {
vector<string> ans;
bool code = false, line_comment = false, block_comment = false;
for (auto& line : source) {
code = false; line_comment = false;
int space_count = 0;
string valid... | ALGO | 0.993946 | 5.081191 | {
"github_metadata": {
"branch": "master",
"commit_count": 439,
"repo_created_at": "2017-06-12T22:14:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7fc4e6f6... |
5517eb5b-4574-40f9-ab9c-bc997defc38b | leonardotong/psoSolver | Swarm/Swarm.cpp | #include "Swarm.h"
SWARM::CSwarm::CSwarm()
: Dimension(NULL)
, nObj(NULL)
, Population(NULL)
, Iteration(NULL)
, MaxEval(NULL)
{
gBest.resize(Population);
vartype.resize(Dimension);
LB.resize(Dimension);
UB.resize(Dimension);
}
SWARM::CSwarm::CSwarm(int dim, int obj, int pop, int iter)
: Dimension(dim)
, n... | ALGO | 0.990922 | 4.282166 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2016-03-03T16:34:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "60bdba0d0b... |
c6756623-16e5-4dd7-9588-a078b411d7ae | zbh123456hui/ThreadTest | thread1/thread3.cpp | #include <iostream>
#include <thread>
#include <mutex>
#include <condition_variable>
#include <deque>
#include <unistd.h>
using namespace std;
typedef void(*handler_pt)(void *);//函数指针
typedef struct task_t{ //任务函数
handler_pt func;
void *arg;
}task_t;
int done=0;
void do_task(void* arg){
if(done<100){
... | TOOL | 0.943929 | 4.655501 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2023-08-20T14:37: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": "b718cfe0579c... |
dbd604c9-da7a-4ccc-9d03-46313a88a96a | girish751/LeetCode | 0019-remove-nth-node-from-end-of-list/0019-remove-nth-node-from-end-of-list.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* removeNthFr... | ALGO | 0.999981 | 5.64782 | {
"github_metadata": {
"branch": "main",
"commit_count": 243,
"repo_created_at": "2025-01-06T18:02: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": "7958ba8673... |
13ac860a-11d5-4fd5-86d7-bfd69c615940 | mooner92/COTE | BOJ-230211/B2_1.cpp | #include <iostream>
#include <queue>
using namespace std;
int main()
{
int n, m;
queue<char> st;
string s;
cin >> n >> m;
cin >> s;
for (int i = 0; i < s.length(); i++)
{
if (s[i] == 'A')
{
if (st.size() < 2)
{
st.push(s[i]);
... | ALGO | 0.999986 | 3.271832 | {
"github_metadata": {
"branch": "master",
"commit_count": 113,
"repo_created_at": "2022-03-08T16:53:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c37d9642... |
4a3c7d6c-7551-4716-850a-88ea77984223 | sarthakkapoor44/CP | A_Fancy_Fence.cpp | ///////////////////////////////////////////////////// DYNATOS ////////////////////////////////////////////////////
#include<bits/stdc++.h>
using namespace std;
//#include <ext/pb_ds/assoc_container.hpp>
// using namespace __gnu_pbds;
typedef long long ll;
#define fi first
#define se second
#define INF 10000000000000000... | ALGO | 0.999902 | 4.143294 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2024-01-12T13:33: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": "6b55b4ee23a1... |
d913eef4-eea3-4d81-bc2b-acd725fe7d68 | yuliy/sport_programming | timus/1118/main.cpp | #include <stdio.h>
#include <iostream>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <list>
#include <algorithm>
using namespace std;
using i64 = long long;
class TApplication {
public:
void Run() {
int I, J;
cin >> I >... | ALGO | 0.99999 | 4.098988 | {
"github_metadata": {
"branch": "master",
"commit_count": 982,
"repo_created_at": "2016-07-23T21:21:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5e267773... |
eb84e177-304e-4d36-8512-f296f573da2d | JianBoLiao/wheel_legged | controllers/wheel_legged_controller/wheel_legged_controller.cpp | // File: wheel_legged_controller.cpp
// Date: 2023.11.03
// Description:
// Author: HustRobocon
// Modifications:
//#include "wheel_legged_controller.h"
#include <iostream>
#include <webots/Robot.hpp>
#include <webots/Motor.hpp>
#include <webots/PositionSensor.hpp>
#include <webots/Gyro.hpp>
#incl... | ALGO | 0.981388 | 4.432758 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-07-27T03:54:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 11,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "32f41f4a50f... |
66899c51-3246-4aae-9587-299fec185b05 | Kim-DongGeun/Probelm-Solving | 백준/180907/4963.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int map[52][52];
int check[52][52];
int index;
int N, M;
int dx[8] = { 1,0,-1,0, 1, -1, -1, 1 };
int dy[8] = { 0,1,0,-1, 1,1,-1,-1 };
void dfs(int curR, int curC)
{
check[curR][curC] = index;
for (int i = 0; i < 8; i++)
{
int nextR = curR + dy[i];
... | ALGO | 0.999849 | 3.690369 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2020-12-23T09:46: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": "3c89d2490... |
9af0912f-a3ab-489f-a726-7f4b139820d0 | nNbSzxx/ACM | 分治/平面上的分治/uva10245 平面最近点对.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
using namespace std;
const int MAX = 10010;
const double INF = 80000;
struct point {
double x, y;
} p[MAX];
int n;
double d;
bool ok[MAX];
bool cmp(const point& p1, const point& p2)
{
return p1.x < p2.x;
}
void mer... | ALGO | 0.999937 | 4.361559 | {
"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": "b87f9cc78... |
9739dcdb-d173-4ed4-b92a-dd3d2e5f3c81 | yash0530/Competitive-Programming | 02 CONTESTS/Codechef/LONG JAN20/04.cpp | #include <bits/stdc++.h>
using namespace std;
#define endl "\n"
#define INF 9e18
#define HELL (int) (1e9 + 7)
#define int long long
#define double long double
#define uint unsigned long long
#define deb(x) cout << #x << " => " << x << "\n"
#define deba(x) cout << #x << "\n"; for (auto a : x) cout << a << " "; cout << ... | ALGO | 0.999997 | 4.429231 | {
"github_metadata": {
"branch": "master",
"commit_count": 89,
"repo_created_at": "2019-12-15T06:50:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 20,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f479945a... |
55052eb6-6acc-4649-b55f-d19885c3d744 | GarJor/EDA | examProblems/P22295.cc | #include <iostream>
#include <vector>
using namespace std;
typedef vector<char> CVec;
typedef vector<CVec> CMat;
typedef vector<bool> BVec;
typedef vector<BVec> BMat;
const int NDIRS = 4;
const int DR[NDIRS] = { 0,-1, 0, 1};
const int DC[NDIRS] = { 1, 0,-1, 0};
struct Point {
int r, c ;
Point(int rr, int cc) : r... | ALGO | 0.999534 | 3.099593 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2018-12-04T16:54: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": "9eb4b93530... |
b51d806d-9c38-4121-a367-a0422e0c96fb | balagithubaccount/cpp-program-my-workout | array-programs/87-maxele1stincreasthendecrease.cpp | // Write a Cpp program to find the maximum element in an array which is first increasing and then decreasing.
#include <iostream>
using namespace std;
int main()
{
int size, i, big, pos;
cout << "Enter the size of the array: ";
cin >> size;
int arr[size];
cout << "Enter the " << size << " elements: ";
for... | ALGO | 0.999984 | 5.086693 | {
"github_metadata": {
"branch": "master",
"commit_count": 378,
"repo_created_at": "2023-01-31T00:55:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "cfd68ae6... |
cece3e85-1ddb-4438-b383-33937ecb2565 | HarryNguyen2662/codeKingToan | other/BOARD.cpp | #include<bits/stdc++.h>
using namespace std;
#define NMOD 3
#define fi first
#define se second
#define pb push_back
#define log 17
#define mask(i) (1ll << (i))
#define setp(x) setprecision(x)
#define ALL(v) v.begin(), v.end()
#define ck(n, i) (((n) >> (i)) & 1)
#define getbit(x) __builtin_popcount(x)
const double P... | ALGO | 0.999935 | 4.620606 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2022-12-20T15:17: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": "ddd133745b08... |
ba80f905-5173-43bc-9c65-5ef1f590d060 | stdcall0/code | LG/P4999.cpp | #include <bits/stdc++.h>
using namespace std;
#define Rn(a, n) a + 1, a + n + 1
typedef long long ll;
typedef unsigned long long ull;
const int N = 19;
namespace U {
inline ll retR() {
ll ret(0), c(0); bool neg(0); while (!isdigit(c = getchar())) neg = c == '-';
ret = c - '0'; while (isdigit(c = getchar()))... | ALGO | 0.999859 | 4.454045 | {
"github_metadata": {
"branch": "main",
"commit_count": 100,
"repo_created_at": "2021-02-03T01:15: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": "5d9abb90e9... |
d6b28075-5674-434d-9b33-ab46cdcafe60 | nameless621/code | atcoder/ABC365/E.cpp | #include <bits/stdc++.h>
using namespace std;
#include <atcoder/all>
using namespace atcoder;
using mint = modint998244353;
// E - Xor Sigma Problem
// https://atcoder.jp/contests/abc365/tasks/abc365_e
int main() {
int N;
cin >> N;
vector<int> A(N);
for(int& a : A) cin >> a;
vector<int>... | ALGO | 0.999989 | 4.759749 | {
"github_metadata": {
"branch": "main",
"commit_count": 247,
"repo_created_at": "2024-12-06T12:01:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2e5b6ae7ae... |
ad706046-edfe-423c-a3f3-c508ab8f37e6 | Piamsuk-Kongmaha/CodeGrinding | CodeForceComp/Div1003/E.cpp | #include <bits/stdc++.h>
using namespace std;
bool feasibleUp(int cur, int ru, int rd, int U, int F) {
if(ru <= 0) return false;
int ncur = cur + 1;
if(ncur > U) return false;
int maxFinal = ncur + (ru - 1);
int minFinal = ncur - rd;
return (minFinal <= F && F <= maxFinal);
}
bool feasibleDown... | ALGO | 0.999932 | 4.779603 | {
"github_metadata": {
"branch": "main",
"commit_count": 34,
"repo_created_at": "2025-02-27T13:08:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4baa2c0ce98... |
dae01b42-11d5-4575-8f5f-c0ca1b118b4e | LifeHashed/OOPS-Repository | assign_6/queue.cpp | #include <iostream>
using namespace std;
class Queue {
private:
int front, rear, size;
int *array;
public:
Queue(int maxSize) : front(-1), rear(-1), size(maxSize) {
array = new int[size];
}
~Queue() {
delete[] array;
}
void enqueue(int value) {
if ((rear + 1) % si... | ALGO | 0.987583 | 5.663873 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2024-01-21T06:30: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": "61815603b88... |
dadd55eb-a46c-416c-a436-7a3ebc6753d6 | subhamagrawal7/College-Material-And-Assignments | Sem 4/DAA/Sorting/selectionsort.cpp | #include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <time.h>
clock_t start, end;
double cpu_time_used;
//COUNTING NUMBER OF ELEMENTS IN A FILE
long long count(char file[])
{
FILE *fp = fopen(file, "r");
long long count = 0;
char b[100];
while (fscanf(fp, "%s\n", &b) == 1)
{
count++;
}
fclose(... | ALGO | 0.997616 | 3.857964 | {
"github_metadata": {
"branch": "main",
"commit_count": 55,
"repo_created_at": "2021-05-09T04:53:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 32,
"forks": 14,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "c39995d18... |
06cbbcb0-0c1c-44f8-9626-e40ee8af024d | Accelerator950113/Solutions_For_HDU | 1880.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <string>
#include <cmath>
#include <vector>
#include <string>
#include <sstream>
#include <queue>
#include <map>
#include <algorithm>
using namespace std;
struct word {
string s1, s2;
friend bool operator <(const word &a1, co... | ALGO | 0.994208 | 3.433966 | {
"github_metadata": {
"branch": "master",
"commit_count": 62,
"repo_created_at": "2017-12-29T01:23:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c5b5ebcdf... |
bdaea8c4-c77e-47fd-81f9-8d1ff4e098ec | for-geeks/geek-car | modules/control/control_reference_gen.cc | /******************************************************************************
* MIT License
* Copyright (c) 2019 Geekstyle
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without res... | ALGO | 0.995447 | 4.022385 | {
"github_metadata": {
"branch": "master",
"commit_count": 590,
"repo_created_at": "2019-08-15T11:49:35.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 13,
"forks": 11,
"issues": 1,
"pull_requests": 1
},
"file_meta": {
"content_id": "3f3af4b... |
1bc6a447-2725-47aa-b200-3b6bad8bc912 | hpatel424/Computer-Programing-1 | Lab6e-ArrayTally.cpp |
//<NAME>
//lab6e
#include <iostream>
#include <ctime>
#include <cstdlib>
#include <iomanip>
using namespace std;
int dice1();
int dice2();
void diceTotal(int dice[], int diceCount[], int rand, int size);
void display(int dice[], int diceCount[], int size);
int main() {
srand(time(0));
cout << "Array Tally" << end... | ALGO | 0.992404 | 4.199401 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2022-08-11T17:31:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c086be23f8f1... |
78e689a9-c9c2-4753-98c1-5a1fe4f8853b | muhammadakfz/Algorithm-Adventures | EDU codeforces/Two Pointers Method/merging_arrays.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define FORI(i, a, b) for (int i = (a); i <= (b); i++)
#define io_i ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NU... | ALGO | 0.999997 | 3.337984 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2024-05-27T13:24: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": "5dbc0161546... |
f280f60a-4c5a-40d7-9f9b-51a2510e7590 | mhtang2/CS491CAP | Inclusion-exclusion/A.cpp | #include <bits/stdc++.h>
using namespace std;
#define newl '\n'
#define forn(i, n) for (int i = 0; i < (int)(n); ++i)
#define pb push_back
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vector<int>> vvi;
typedef vector<pii> vp... | ALGO | 0.999607 | 4.370571 | {
"github_metadata": {
"branch": "main",
"commit_count": 37,
"repo_created_at": "2024-01-29T20:22:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8cf2e19caf7... |
33b0c900-0b1b-4ba5-9cb7-a19a683194cd | DIPJOY10/Codeforces_Problemset | G_Maximize_the_Remaining_String.cpp | //author: <NAME>
//dip_10
#include <bits/stdc++.h>
using namespace std;
#define endl "\n"
#define ll long long
#define ld long double
#define pb push_back
#define mp make_pair
#define vi vector<int>
#define pi pair<int, int>
#define vpi vector<pair<int, int>>
#define rep(i, l, r) for (int i = l; i <= r; i++)
#define ... | ALGO | 0.999941 | 4.457165 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2021-03-19T15:27: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": "95565013943e... |
31d29f79-335e-40bf-bed1-e4c1a35d308c | YinJianxiang/first-test | prime.cpp | /*************************************************************************
> File Name: prime.cpp
> Author: YinJianxiang
> Mail: <EMAIL>
> Created Time: 2017年10月23日 星期一 21时52分58秒
************************************************************************/
#include<iostream>
#include<algorithm>
#include<cstdio>
#incl... | ALGO | 0.999988 | 3.884054 | {
"github_metadata": {
"branch": "master",
"commit_count": 31,
"repo_created_at": "2017-05-21T15:40: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": "03822a77e... |
dd57da42-0843-4150-a7e3-4a750bf1ab41 | tdzl2003/algorithm_workspace | cpp/tdzl/math/crt.hpp | #pragma once
#include "./common.hpp"
#include "./inv_gcd.hpp"
// 求解中国剩余定理类似问题
// 求解最小的x,满足 x == r[i] (mod m[i])
// (rem, mod)
long long crt(const std::vector<long long>& r,
const std::vector<long long>& m) {
assert(r.size() == m.size());
int n = int(r.size());
// Contr... | ALGO | 0.99994 | 5.778652 | {
"github_metadata": {
"branch": "main",
"commit_count": 41,
"repo_created_at": "2023-07-06T13:37:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9b81e33686f... |
3b81029f-0d9f-435d-960c-b90b40b504c0 | bunjj/Algorithms-Lab | w13/evolution/algorithm.cpp | #include <limits>
#include <iostream>
#include <iomanip>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <unordered_map>
#include <set>
#include <stack>
struct specie{
std::string name;
int age;
std::vector<std::string> children;
};
struct query{
std::string name;
int age;
int... | ALGO | 0.999051 | 3.988099 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2021-10-03T15:24:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ba71925de4ad... |
0f734cf2-f37c-48f8-8140-e38e42a6e1e1 | ChuanSWT/Codeforces_codes | D_Apple_Tree_Traversing.cpp | #include <iostream>
#include <vector>
#include <string>
#include <map>
#include <cmath>
#include <algorithm>
#include <set>
#include <tuple>
#include <queue>
#include <iomanip>
#include <numeric>
#include <assert.h>
using namespace std;
void compete_solution();
signed main()
{
ios_base::sync_with_stdio(false);
... | ALGO | 0.999973 | 4.491835 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-02-18T06:09: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": "92aa9f895017... |
ba7a9713-2e88-4965-aa90-89c6a028fabe | eliogovea/solutions_cp | Codeforces-Gym/100523 - 2014-2015 CT S02E07: Codeforces Trainings Season 2 Episode 7/C.cpp | // 2014-2015 CT S02E07: Codeforces Trainings Season 2 Episode 7
// 100523C
#include <bits/stdc++.h>
using namespace std;
#define forr(i, n) for(int i = 0; i < (int)(n); ++i)
#define ffor(i, n) for(int i = 1; i <= (int)(n); ++i)
#define revforr(n , i) for(int i = (int)(n)-1; i >= 0; i--)
#define kasign(a,b) a = b
#... | ALGO | 0.999614 | 4.06394 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2019-11-16T04:08:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2f19027979... |
5000b807-44ec-444e-8233-9a1991d29f94 | igorternyuk/TeSFMLDrawPoker | hand.h | #pragma once
#include "card.h"
#include <vector>
#include <map>
#include <string>
#include <iostream>
namespace poker
{
class Hand
{
public:
enum CombinationType
{
NO_HAND,
HIGH_CARD,
PAIR,
TWO_PAIR,
THREE_OF_A_KIND,
S... | ALGO | 0.912517 | 6.047562 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2017-09-13T15:25: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": "52797edd3c... |
4e8d6cbb-dfe7-4b27-9f86-e9650e340d23 | daikidaiku/procon-archive | atcoder.jp/abc335/abc335_c/Main.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using VI = vector<int>;
#define rep(i,n) for(int i=0; i<(n); i++)
#define rep2(i,x,n) for(int i=x; i<(n); i++)
#define all(obj) (obj).begin(), (obj).end()
constexpr int dx[] = {1, 0, -1, 0};
constexpr int dy[] = {0, 1, 0, -1};
// const long long INF = ... | ALGO | 0.999821 | 3.864842 | {
"github_metadata": {
"branch": "main",
"commit_count": 296,
"repo_created_at": "2023-07-15T11:41: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": "f972da6953... |
99a9f76a-7a8d-4b5d-83d5-c4aeb9d8965b | jh9amn/Master-DSA | GFG POTD/Rohan's_Love_for_matrix.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:
int firstElement(int n) {
int mod = 1e9 + 7;
int a = 1;
int b = 1;
int ans = 0;
if(n ... | ALGO | 0.999924 | 5.765219 | {
"github_metadata": {
"branch": "main",
"commit_count": 450,
"repo_created_at": "2024-01-06T15:19:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1133d76de8... |
0b343314-7eb9-4c3f-8496-5f9de74f4247 | RomainPierre7/snake | src/snake.cpp | #include "snake.hpp"
#include "geometry.hpp"
struct Snake{
enum Direction direction;
node *head;
};
struct Snake *createSnake(int x, int y, enum Direction direction){
struct Snake *snake = new Snake;
snake->direction = direction;
snake->head = new node;
snake->head->x = x;
snake->head->y =... | TOOL | 0.975957 | 4.791865 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2023-03-08T22:16: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": "86beff36fd4... |
55439ebe-d4ed-4ae2-8c5c-7804482dffc8 | thatianajribeiro/EstruturaDeDadosLab | Lista6/Questao7Lista6CaminhoCidades/main.cpp | #include <iostream>
using namespace std;
typedef struct No{
int chave;
struct No *prox;
}No;
typedef struct Fila{
struct No *inicio;
struct No *fim;
int n;
}Fila;
No* criarNo(int chave){
No *novo_no = new No;
novo_no->prox = NULL;
novo_no->chave = chave;
return novo_no;
}
void d... | ALGO | 0.99994 | 3.580589 | {
"github_metadata": {
"branch": "master",
"commit_count": 33,
"repo_created_at": "2019-08-02T01:27: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": "023b0c4f1... |
156c750f-346c-4ec0-be40-aaa672b2b645 | KattoRan/applied_algorithms | TINHOC/1aaaaa/buoi2/jump.cpp | // Cat \\
||*---*||
#include<bits/stdc++.h>
#define fu(i,a,b) for(int i=a;i<=b;i++)
#define fd(i,a,b) for(int i=a;i>=b;i--)
#define fi first
#define se second
#define catlan main
#define bit(X,i) ((X>>i)&1)
#define on(X,i) (X|(1<<i))
#define off(X,i) (X^(1<<i))
#define dembit(X) __builtin_popcount(X)
using namespace st... | ALGO | 0.999989 | 3.961163 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-11-04T10: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": "4f5ffdc2c9b2... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.