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 |
|---|---|---|---|---|---|---|---|
35d80433-0b98-4097-9f6e-7b1a42173cce | TimeDA/TimeDA | dataset/cpp_12_18/gcj2014/bardek/3014486_5649687893770240_bardek_d.cpp | #include <cstdio>
#include <algorithm>
#include <string>
#include <iostream>
#include <vector>
#define fru(j,n) for(int j=0;j<n;++j)
#define tr(it,x) for(typeof(x.begin()) it=x.begin();it!=x.end();++it)
#define x first
#define y second
using namespace std;
typedef pair<int,int> pii;
typedef long long L... | ALGO | 0.999525 | 3.391607 | {
"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": "d2f2abc455f... |
f5b0faae-0b33-4490-a6b5-d290fe6b441b | phpduke/Algorithms-Notebook | HLD.cpp | #include <cstdio>
#include <vector>
using namespace std;
#define root 0
#define N 10100
#define LN 14
vector <int> adj[N], costs[N], indexx[N];
int baseArray[N], ptr;
int chainNo, chainInd[N], chainHead[N], posInBase[N];
int depth[N], pa[LN][N], otherEnd[N], subsize[N];
int st[N*6], qt[N*6];
/*
* make_tree:
* Used... | ALGO | 0.999721 | 4.322967 | {
"github_metadata": {
"branch": "master",
"commit_count": 73,
"repo_created_at": "2018-12-15T00:06:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 212,
"forks": 58,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
"content_id": "ac2546... |
ec38e3f4-7d70-45df-9f8d-5d82086abed5 | jianningzhuang/CS2040C-Data_Structures_and_Algorithms | Week 4/gear_changing.cpp | #include <bits/stdc++.h>
using namespace std;
void print_arr(int arr[], int len){
for (int i = 0; i < len; i++){
cout << arr[i] << " ";
}
}
int main(){
int n, m, p;
cin >> n >> m >> p;
int crank[n];
for (int i = 0; i < n; i++){
int c;
cin >> c;
crank[i] = c;
}
//print_arr(crank, n);
... | ALGO | 0.999714 | 3.364845 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-07-03T13:56: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": "714e465f2fb7... |
8378edcb-0e9a-4f8c-a5d3-e42ef6a833f7 | hrithiksagar/Competetive-Programming | Programming Questions/7. Functions/Adding2BinaryNumbers.cpp | #include<iostream>
using namespace std;
int reverse(int n){
int ans = 0;
while(n>0){
int lastDigit = n%10;
ans = ans*10 +lastDigit;
n /= 10;
}
return ans;
}
int addBinary(int a, int b){
int ans = 0;
int previousCarry = 0;
while(a>0 && b>0){
if(a%2 == 0 && b%2 ... | ALGO | 0.999967 | 4.670586 | {
"github_metadata": {
"branch": "main",
"commit_count": 125,
"repo_created_at": "2021-06-22T17:22:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8dc8b73825... |
470b6518-b332-43ca-b403-185af6ba06f1 | sanjeevWeb/leetcode_practice | Reverse words in a given string - GFG/reverse-words-in-a-given-string.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
string reverseWord(string str){
int i=0;
int n=str.size()-1;
while(i<=n){
swap(str[i],str[n]);
i++;
n--;
}
return str;
}
p... | ALGO | 0.999396 | 5.675496 | {
"github_metadata": {
"branch": "main",
"commit_count": 542,
"repo_created_at": "2023-06-22T06:41: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": "1ec66023a4... |
c26f3064-9b16-4dcf-bf9e-5a692df1297d | electro-smith/DaisySP | Source/Filters/fir.h | /*
Copyright (c) 2020 Electrosmith, Corp, <NAME>
Use of this source code is governed by an MIT-style
license that can be found in the LICENSE file or at
https://opensource.org/licenses/MIT.
*/
#pragma once
#ifndef DSY_FIRFILTER_H
#define DSY_FIRFILTER_H
#include <cstdint>
#include <cstring> // for memset
#include <c... | TOOL | 0.94166 | 7.413884 | {
"github_metadata": {
"branch": "master",
"commit_count": 584,
"repo_created_at": "2020-03-05T17:30:27.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1003,
"forks": 162,
"issues": 19,
"pull_requests": 8
},
"file_meta": {
"content_id": "cfb... |
a98802c2-f482-4ee6-a2ab-5c51031cd7f1 | panluDreamer/LeetCode | Solution.h | #ifndef SOLUTION_H
#define SOLUTION_H
#include<iostream>
#include<vector>
#include<algorithm>
#include<map>
#include<sstream>
using namespace std;
class Solution {
public:
/**
Problem 1:Two Sum
*/
vector<int> twoSum(vector<int>& nums, int target) {
vector<int> ans;
int len = nums.size();
for (int i = 0; i... | ALGO | 0.999756 | 3.375653 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2017-10-28T05:57: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": "9faf5171f4... |
b42b09cb-d07c-40b6-a65a-35dc3d3538c5 | lyellread/cs161 | labs/lab5/lab5-question1.cpp | #include <iostream>
#include <string>
#include <stdlib.h>
using namespace std;
/*
Written by <NAME>
October 26th, 2018
This program accepts a string from the user and searches for the substring "dog" or "cat".
If "dog" is discovered, the program prints the index of the 'd' character.
If "cat" is discovered, the ... | ALGO | 0.99176 | 4.907866 | {
"github_metadata": {
"branch": "master",
"commit_count": 82,
"repo_created_at": "2018-09-21T19:07: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": "8a4634d4b... |
f80b651d-296e-4df6-bdc6-674c7894cdcd | wilesduan/quick-start-app | util/src/sched_cpu_affinity.cc | #include <sched_cpu_affinity.h>
#ifndef __USE_GNU
#define __USE_GNU
#endif
#include <sched.h>
#include <pthread.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <util_log.h>
#define K_PRE_CPU_STAT "/tmp/.pre_stat"
#define K_CUR_CPU_STAT "/proc/stat"
static int* g_cpu_idx = NULL;
static int... | TOOL | 0.939373 | 4.722773 | {
"github_metadata": {
"branch": "master",
"commit_count": 73,
"repo_created_at": "2018-08-02T07:51:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 18,
"forks": 11,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "1760581... |
bf30bb79-459d-4aee-ae1a-a37aec330330 | SummerDay231/leetcode_cpp | 12.cpp | #include <iostream>
#include <string>
using namespace::std;
class Solution {
public:
string intToRoman(int num) {
int quotient, divisor = 1000;
char c5, c1, c10;
string romanNum;
while (num != 0) {
quotient = num / divisor;
if (quotient == 0) {
... | ALGO | 0.999897 | 5.270411 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2020-01-07T09:47: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": "6f614e47b... |
93751c75-fe33-4d78-8066-20dac11a2bc2 | LDaniels18/LeetCodeProblems | Find_numbers_with_even_number_of_digits.cpp | class Solution {
public:
int divideNumbers(int result){
int countOfDigits = 0; //to count the digits we get of a particular number
//we need to divide that element by 10 until we cant anymore:
while(result > 0){
result = result / 10;
coun... | ALGO | 0.999785 | 5.154384 | {
"github_metadata": {
"branch": "main",
"commit_count": 16,
"repo_created_at": "2022-04-02T22:13: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": "aa0722a9e5d... |
2070c00b-864f-4013-b81f-23386f136ff7 | gavinloverqq/Algorithm | data Structure/p1090合并果子/main.cpp | #include <iostream>
#include <queue>
#include <algorithm>
#include <vector>
#define INF 1<<30
using namespace std;
/*
* STL实现
int n;
struct Node{
int a;
Node(){}
Node(int aa):a(aa){}
};
bool operator < (Node a,Node b){
return a.a > b.a;
}
int main() {
cin >> n;
priority_queue < Node > pq;
... | ALGO | 0.999992 | 3.82686 | {
"github_metadata": {
"branch": "master",
"commit_count": 63,
"repo_created_at": "2016-09-21T09:26: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": "7768b26d3... |
46532e15-2303-4c1b-9de7-ea8815dcf003 | halfguru/dsa-practice | src/graph/clone-graph.hpp | // Given a reference of a node in a connected undirected graph.
//
// Return a deep copy (clone) of the graph.
//
// Each node in the graph contains a value (int) and a list (List[Node]) of its neighbors.
//
// class Node {
// public int val;
// public List<Node> neighbors;
// }
#include <queue>
#include <unor... | ALGO | 0.999828 | 6.56768 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2024-07-29T15:05:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8ebb2817e4f... |
920a1239-a3bc-462b-bd4d-75afcde174f9 | TypicalHog/THCrypt | main.cpp | // THCrypt v1.3
// Copyright (c) 2017 TypicalHog
// https://github.com/TypicalHog/THCrypt
// I will comment the code and explain how everything works when I catch some time.
#include <chrono>
#include <cstring>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <random>
#include <string>
#include <thr... | TOOL | 0.960079 | 3.081855 | {
"github_metadata": {
"branch": "master",
"commit_count": 69,
"repo_created_at": "2017-06-15T20:58:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 53,
"forks": 20,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "aeef27e... |
2b64a01c-4749-4bed-8b12-15486b23370e | xiivthx/programming.in.th | Task/Volume 10/1017 - Magic Square.cpp | //============================================================================
// Name : 1017 - Magic Square.cpp
// Author : ztrixack
// Copyright : MIT License
// Description : 1017 Magic Square in C++, Ansi-style
// Run time : 0.004 s
//================================================================... | ALGO | 0.99998 | 5.428143 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2017-07-03T20:15: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": "5f53779007... |
6f22bfb1-6869-4817-b903-7d8d10600233 | Oyinda8/Hive-AI | hiveai.cpp | #include "hiveai.h"
#include "game.h"
#include <stdlib.h>
#include <time.h>
#include <tuple>
extern Game *game;
HiveAI::HiveAI()
{
}
void HiveAI::GetMoveList()
{
moveList.clear();//clear current move list
//get list of moves that involve placing a tile near the opponent queen
std::deque<Tile*>::iterato... | ALGO | 0.989744 | 3.988239 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2015-07-27T00:54:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2526efd99f... |
2ce9fd28-cf29-4404-a3cf-139dd83cf5c4 | wiwitrifai/competitive-programming | codeforces/samara_X/i.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 1024, mod = 1e9 + 7, MAGIC = 25;
int tmp[N][N];
struct matrix {
int n, m;
int x[N][N];
matrix(int n = 1000, int m = 1) : n(n), m(m) {};
void rmul(matrix & other) {
for (int i = 0; i < other.n; i++) {
for (int j = 0; j < m; j++) {
i... | ALGO | 0.999902 | 4.15127 | {
"github_metadata": {
"branch": "master",
"commit_count": 628,
"repo_created_at": "2016-05-21T12:11:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 37,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1f8ca26... |
0e9a782b-8665-4b85-8c91-b5fb1656bce9 | pawan09032004/Strivers-SDE-Sheet-Challenge | CeilfromBST.CPP | #include <bits/stdc++.h>
/************************************************************
Following is the TreeNode class structure:
class BinaryTreeNode {
public:
T data;
BinaryTreeNode<T> *left;
BinaryTreeNode<T> *right;
BinaryTreeNode(T data) {
this->d... | ALGO | 0.999991 | 4.342813 | {
"github_metadata": {
"branch": "main",
"commit_count": 187,
"repo_created_at": "2023-06-04T16:57: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": "1d7acdc0c3... |
37ff780a-3b43-4e53-bafb-402f48c56cb9 | Hardikmaind/DSA-CPP | Codechef/_cc_S150_EqualPairs_Easy-M2.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int testCases;
cin >> testCases;
while (testCases--) {
int arraySize;
cin >> arraySize;
vector<int> array(arraySize);
unordered_map<int, int> frequencyMap;
int zeroCount = 0;
for (int ... | ALGO | 0.999891 | 5.617424 | {
"github_metadata": {
"branch": "main",
"commit_count": 296,
"repo_created_at": "2024-04-01T16:59: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": "af088f475a... |
4a098ee0-9e44-4cfa-9935-cb7ce0978dbf | phs7646/codingtest | CPP/div1/21315/sol.cpp | #include <iostream>
#include <vector>
using namespace std;
int N;
vector<int> shuffle(vector<int>& prev, int k) {
vector<int> ret(N,0);
int num = 1<<k;
int pos = 0;
for(;pos < N-num;pos++) {
ret[num+pos] = prev[pos];
}
num>>=1;
while(num > 0) {
for(int i = 0;i < ... | ALGO | 0.999983 | 3.500433 | {
"github_metadata": {
"branch": "main",
"commit_count": 146,
"repo_created_at": "2024-03-13T09:22:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "49e0845027... |
6227e245-9e90-420d-bee4-4263c4c0ae36 | 5tarlight/BOJ | boj/bronze/2985.cpp | #include <iostream>
using namespace std;
int main() {
cin.tie(nullptr);
cout.tie(nullptr);
ios_base::sync_with_stdio(false);
int a, b, c;
cin >> a >> b >> c;
char op1, op2;
if (a + b == c) {
op1 = '+'; op2 = '=';
} else if (a -b == c) {
op1 = '-'; op2 = '=';
} els... | ALGO | 0.999935 | 4.584897 | {
"github_metadata": {
"branch": "master",
"commit_count": 1192,
"repo_created_at": "2023-02-01T06:45:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2ccb14d... |
b94d053b-9fce-4565-a435-0692a3a5302c | suraj1611/Competitive_Programming | CP-Codes/cuba_trainee12.cpp | /* Code by : Suraj (@suraj1611) */
#include<bits/stdc++.h>
#include <string>
using namespace std;
#define ll long long int
#define rep(i,n) for(int i=0; i<n; i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define mx INT_MAX
#define mn INT_MIN
#define md 15000000000031
#define pb push_back
#define mp make_pair
#define ... | ALGO | 0.999997 | 4.117803 | {
"github_metadata": {
"branch": "master",
"commit_count": 24,
"repo_created_at": "2019-02-13T16:34:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0962f2e35... |
c72265bc-fb06-4c5d-9444-24c38f231a75 | Jain101/OA_Preparation | Graph/BipartiteCheck.cpp | #include <bits/stdc++.h>
using namespace std;
/**bipartite check - "graph is bicolored in such a way that no 2 exact neighbors
* share the same color"
* # Assumptions:
* 1. graph is connected
* 2. graph is numbered from 1 to N(no. of nodes)
*
* #conclusions:
* 1. A tree is always bipartite
* 2. A graph with ... | ALGO | 0.999946 | 4.574912 | {
"github_metadata": {
"branch": "main",
"commit_count": 34,
"repo_created_at": "2023-07-16T07:31:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "adb32e6fdd7... |
d29f462f-2aaf-4ae3-97bd-e099f48c5dbd | xu-xiaoya/c | 11.15/38.两日期相差天数.cpp | #include<stdio.h>
int LeapYear(int y) {
return (y % 4 == 0 && y % 100 != 0) || (y % 400 == 0);
}
int Day(int year, int month, int day) {
int a[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int s = 0, k = year - 1;
for (int i = 0; i < month; i++) s += a[i];
s += day;
if (LeapYear(year) && month ... | ALGO | 0.999933 | 3.457511 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2021-01-18T13:48: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": "4f83ef36f692... |
312ca667-19e6-425c-903e-39670b661248 | LeatherWang/svo | rpg_svo/svo/src/matcher.cpp | // This file is part of SVO - Semi-direct Visual Odometry.
// 重投影匹配与极线搜索
#include <cstdlib>
#include <vikit/abstract_camera.h>
#include <vikit/vision.h>
#include <vikit/math_utils.h>
#include <vikit/patch_score.h>
#include <matcher.h>
#include <frame.h>
#include <feature.h>
#include <point.h>
#include <config.h>
#incl... | ALGO | 0.999567 | 5.402995 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-08-11T02:56:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ee6de5df68... |
f8df7dd7-7328-42ee-9418-ade33c358314 | nojhan/paradiseo | smp/src/islandModel.cpp | /*
<islandModel.cpp>
Copyright (C) DOLPHIN Project-Team, INRIA Lille - Nord Europe, 2006-2012
<NAME>, <NAME> - INSA Rouen
This software is governed by the CeCILL license under French law and
abiding by the rules of distribution of free software. You can ue,
modify and/ or redistribute the software under the terms o... | ALGO | 0.989793 | 6.012506 | {
"github_metadata": {
"branch": "master",
"commit_count": 5554,
"repo_created_at": "2013-01-11T08:47:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 108,
"forks": 36,
"issues": 45,
"pull_requests": 4
},
"file_meta": {
"content_id": "02f... |
23a5c837-4783-4636-b526-8a068769ede6 | evia100/oriyaHW1 | OriyaHW1/OriyaHW1/bp.cpp | /* 046267 Computer Architecture - Winter 20/21 - HW #1 */
/* This file should hold your implementation of the predictor simulator */
#include "bp_api.h"
#include "math.h"
#include <stdio.h>
using namespace std;
class BTB;
BTB* BP_Table;
int calls = 0;
int flushes = 0;
int bitExtracted(int number, i... | ALGO | 0.998135 | 5.626016 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2020-11-23T12:54: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": "1e11b50afc... |
9212a0f5-e3bc-4f04-9a88-1f511cc8a57d | xinyang3/C | c1/examples/examples/hw_day1_array.cpp | #include <stdio.h>
#include <stdlib.h>
#include <math.h>
void exchange(int * p1, int *p2) {
int tmp;
tmp = *p1;
*p1 = *p2;
*p2 = tmp;
}
// 数组的最大值和次大值
void print_array_max(int *p, int size) {
for (size_t i = 1; i < size; i++)
{
if (*(p + i) > p[0]) {
exchange(p, p + i);
} else if (*(p + i) > p[1]) {
ex... | ALGO | 0.999096 | 3.558409 | {
"github_metadata": {
"branch": "main",
"commit_count": 41,
"repo_created_at": "2020-11-04T15:41: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": "f8cec529898... |
3f072574-07d2-4cbf-a574-1c8ec6487b10 | itz-arnav/-6Companies30Days-Challenge | DAY 26-30/number_of_unique_paths.cpp | class Solution
{
public:
//Function to find total number of unique paths.
void path( int a , int b , int x , int y , int &ans )
{
if( x == a and y == b )
ans++;
if( x > a or y > b )
return ;
path( a , b , x + 1 , y , ans );
path( a , b ,... | ALGO | 0.999951 | 4.995331 | {
"github_metadata": {
"branch": "main",
"commit_count": 96,
"repo_created_at": "2021-12-31T08:12: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": "642f2585f05... |
504d3e43-e25b-4502-abd8-13b58c337629 | DONXUX/algorithm-study | Algorithm/1162 도로포장/main.cpp | #include <iostream>
#include <queue>
#include <vector>
using namespace std;
constexpr int INF = 99999999;
constexpr int MAX = 10000;
typedef long long ll;
typedef pair<ll, pair<int, int>> p;
int n, m, k;
vector<pair<int, int>> edge[MAX];
priority_queue<p, vector<p>, greater<p>> pq;
int dist[MAX], check[MAX];
bool visi... | ALGO | 0.999946 | 4.032777 | {
"github_metadata": {
"branch": "master",
"commit_count": 102,
"repo_created_at": "2019-10-02T07:53:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9b1b0c20... |
65543894-11b9-439e-9dfd-0f15a1d55f88 | ayuriK152/Baekjoon | 백준/Silver/1080. 행렬/행렬.cc | #include <iostream>
using namespace std;
int main() {
bool matA[50][50] = { false };
bool matB[50][50] = { false };
int n, m;
cin >> n >> m;
int result = 0;
for (int i = 0; i < n; i++) {
string input;
cin >> input;
for (int j = 0; j < m; j++)
matA[i][j] = input[j] == '1' ? true : false;
}
for (int i... | ALGO | 0.999987 | 3.483523 | {
"github_metadata": {
"branch": "main",
"commit_count": 341,
"repo_created_at": "2023-03-22T04:52: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": "f64242cbf9... |
bbb7b125-25dd-4092-b1b9-5d2748238e43 | ydb-platform/ydb | ydb/core/driver_lib/run/config_helpers.cpp | #include "config_helpers.h"
#include <ydb/core/base/localdb.h>
#include <ydb/core/protos/bootstrap.pb.h>
#include <ydb/core/protos/resource_broker.pb.h>
#include <ydb/library/actors/util/affinity.h>
namespace NKikimr {
namespace NActorSystemConfigHelpers {
namespace {
template <class TConfig>
static TCpuMask Par... | CONFIG | 0.942775 | 7.274448 | {
"github_metadata": {
"branch": "main",
"commit_count": 35208,
"repo_created_at": "2022-02-07T14:52:36.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 4512,
"forks": 701,
"issues": 2263,
"pull_requests": 682
},
"file_meta": {
"content_id": ... |
ed04fbb0-45e8-4e2f-9ba8-8d4677d9919d | Keyur1284/Competitive-Programming | Dynamic Programming/DP on Grids/Ninja’s_Training.cpp | //Problem Link :- https://www.codingninjas.com/codestudio/problems/ninja-s-training_3621003
//Solved by Memoization Method
int func (int day, int last, vector <vector<int>> &dp, vector<vector<int>> &points)
{
if (dp[day][last] != -1)
return dp[day][last];
if (day == 0)
{
int maxi = 0;... | ALGO | 0.999775 | 5.364765 | {
"github_metadata": {
"branch": "master",
"commit_count": 1296,
"repo_created_at": "2022-11-03T10:45:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "08e9a2e... |
4c97cf51-847a-4933-bd3c-b3c9fb127698 | jaiminocha/LeetCode-Solutions | 990-satisfiability-of-equality-equations/990-satisfiability-of-equality-equations.cpp | class Graph{
int V;
list<pair<int, int> > l;
public:
Graph(int v){
V = v;
}
void addEdge(int node1, int node2){
l.push_back({node1, node2});
}
void displayEdges(){
for (auto x : l){
cout << x.first << " " << x.second << endl;
}
}
int findSe... | ALGO | 0.999921 | 5.225883 | {
"github_metadata": {
"branch": "main",
"commit_count": 611,
"repo_created_at": "2022-09-01T09:44: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": "3c01297b00... |
75cb10d2-ae7a-4431-9115-2d5f5450ccaf | un01s/code-exercises | ex01/ex22-103zigzag.cpp | /*
* leetcode 103 binary tree zigzag level order traversal
*
* level: from root to leaf and from left to right
*
*
* 2023-07-13
*
* TODO 2290. hard
* minimum obstacle removal to reach center
*
*/
#include <iostream>
#include <vector>
#include <queue>
using namespace std;
struct TreeNode {
int val;
... | ALGO | 0.999991 | 6.083436 | {
"github_metadata": {
"branch": "main",
"commit_count": 937,
"repo_created_at": "2023-06-21T16:36: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": "50014f10ce... |
6b5cd224-c6b7-4e77-8534-f0f931949503 | yliu-cs/ACM | PTA/团体程序设计天梯赛-练习集-L3-011.cpp | #include<bits/stdc++.h>
using namespace std;
#define mem(a,b) memset(a,b,sizeof(a))
typedef long long ll;
typedef pair<int, int> P;
const int INF = 0x3f3f3f3f;
const int maxn = 3e2;
const double eps = 1e-5;
const double e = 2.718281828459;
struct connect {
int v;
int dis;
};
int n, m;
int cnt = 0;
// 每个城镇驻守的敌... | ALGO | 0.999964 | 3.975515 | {
"github_metadata": {
"branch": "master",
"commit_count": 442,
"repo_created_at": "2018-10-03T10:47:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e51aeff5... |
86c558b7-7d3b-4d40-bc0d-d889f87979c6 | mohit2308jain/CCC-Coding-Camp | Lightbulb.cpp | /*******************************************
<NAME>, a proud canadian wants to turn on all the light bulbs as she is scared to go into the dark.
N light bulbs are connected by a wire. Each bulb has a switch associated with it, however due to faulty wiring, a switch also changes the state of all the bulbs to the right ... | ALGO | 0.999993 | 4.301305 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2019-01-16T13:04: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": "4d040a452... |
546cf382-4466-4eab-b37f-1fbfd92d8706 | kishan2k2/DSAandCP | LeetCode/Problems/200.cpp | class Solution {
private:
// Even though the solution is quite different but I dont consider it to be so much different.
// I did recursion which increase the complexity way too much.
// They just do bfs for the counting of the neighbours.
// Algorithm
// 1- Iterate the 2d array.
// 2- If one th... | ALGO | 0.999901 | 6.282797 | {
"github_metadata": {
"branch": "master",
"commit_count": 132,
"repo_created_at": "2023-10-01T14:37: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": "fe30444d... |
d6ea9de2-e9b9-4143-8204-26a1db417b30 | YessineJallouli/Competitive-Programming | Codeforces Submissions/rounds/1850/H.cpp | #include <bits/stdc++.h>
#define ll long long
using namespace std;
const int N = 2e5+7;
vector<vector<pair<int,int>>> adj(N);
bool visite[N];
ll d[N];
bool ans = true;
void dfs(int node, ll dist = 0) {
if (d[node] == -1)
d[node] = dist;
else {
visite[node] = true;
if (d[node] != di... | ALGO | 0.999922 | 5.063202 | {
"github_metadata": {
"branch": "main",
"commit_count": 107,
"repo_created_at": "2021-05-13T16:32:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c47dbbcd42... |
a89aec96-af6e-43df-8bc7-0da6f0c9e066 | liardanc3/algorithm | cpp/1450.cpp | #include <bits/stdc++.h>
#define int long long
using namespace std;
vector<int> vect, vect1, vect2;
int N, C, tmp, sum, ans;
void f1(int left, int right, int sum) {
for (int i = left + 1; i <= right; i++) {
vect1.push_back(sum + vect[i]);
f1(i, right, sum + vect[i]);
}
}
void f2(int left, int ... | ALGO | 0.999987 | 3.999547 | {
"github_metadata": {
"branch": "master",
"commit_count": 673,
"repo_created_at": "2021-06-30T06:52: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": "06c118a7... |
30acd3fb-f877-45d0-9524-5b32b24e727c | Next-Gen-UI/Code-Dynamics | Leetcode/1000-2000/1136. Parallel Courses/1136-2.cpp | class Solution {
public:
int minimumSemesters(int n, vector<vector<int>>& relations) {
int ans = 0;
vector<vector<int>> graph(n);
vector<int> inDegree(n);
queue<int> q;
// build graph
for (const auto& r : relations) {
const int u = r[0] - 1;
const int v = r[1] - 1;
graph[u]... | ALGO | 0.99974 | 5.768263 | {
"github_metadata": {
"branch": "main",
"commit_count": 99,
"repo_created_at": "2022-01-06T07:57:09.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 44,
"forks": 35,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "411a28a655... |
2c5b5099-90fb-4ca5-b07b-d9d1e4795bc8 | 1ali2ansari3/Ansari_Ali_Projet_RO | Ansari_Ali_Projet_RO/dijkstra/dijkstra.h | #ifndef DIJKSTRA_H
#define DIJKSTRA_H
#include <iostream>
using namespace std;
#include<vector>
#define MAX 50
class graphe
{
int G[MAX][MAX];
int I[MAX],A[MAX];
bool DejaMarquer[MAX];
public:
void inistialisation()
{
for(int i=1; i<MAX; i++)
{
I[i]=0;
A[i... | ALGO | 0.99981 | 3.090348 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-01-27T20:22: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": "2b5c8569a7ea... |
5a432022-824a-4eb0-8786-4ab1d56e03d1 | jeongChoi/Basic_CProgramming | BackJoon/문자열/1316(string).cpp | #include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main(void) {
int n;
char s[101];
int sum = 0;
scanf("%d", &n);
for (int i = 0; i < n; i++) {
int cnt[26] = { 0 };
scanf("%s", &s);
int j = 0;
while (s[j] != '\0') {
if (j == 0) {
cnt[(int)s[j] - 'a'] += 1;
}
else if (s[j] != ... | ALGO | 0.999977 | 3.491301 | {
"github_metadata": {
"branch": "main",
"commit_count": 102,
"repo_created_at": "2021-11-22T12:04: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": "e254a3e492... |
59f5325e-01ce-4f75-8ff2-a7b69a744ff6 | LuciferHe/C-HistoryCode | hiho 73周 Arithmetic Puzzles 改进版1.cpp | //这组测试数据会超时
//ABCDEFJHIJJJJJJJJJJJJJJJJJAAAA=ABCDEFJHIJJJJJJJJJJJJJJJJJAAAA
#include<cstdio>
#include<iostream>
#include<cstring>
#include<string>
#include<vector>
#include<cctype>
#include<algorithm>
using namespace std;
#define DEBUG 0
#define DEBUG1 0
#define DEBUG2 0
#define mem(a) memset(a, 0, sizeof(a))
//for i ... | ALGO | 0.999979 | 3.449608 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2020-05-28T14:05: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": "c70ac2d3c9... |
07994faf-676b-4221-a6f5-f2b0f13906e7 | RebelToolbox/RebelEngine | servers/physics/step_sw.cpp | // SPDX-FileCopyrightText: 2023 Rebel Engine contributors
// SPDX-FileCopyrightText: 2014-2022 Godot Engine contributors
// SPDX-FileCopyrightText: 2007-2014 <NAME>, <NAME>
//
// SPDX-License-Identifier: MIT
#include "step_sw.h"
#include "core/os/os.h"
#include "joints_sw.h"
void StepSW::_populate_island(
BodySW... | ALGO | 0.997384 | 5.238777 | {
"github_metadata": {
"branch": "main",
"commit_count": 579,
"repo_created_at": "2022-09-03T12:04:51.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 9,
"forks": 2,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
"content_id": "4fd2c936aa3... |
1b86eff6-f56a-43cf-a751-b5dcbadb03c2 | LYJ0126/data-structures_and_algorithms | 树/树状数组和线段树/树状数组/树状数组2 区间更新,区间查找/树状数组2 区间更新,区间查找/源.cpp | #include<iostream>
#include<algorithm>
#include<cmath>
#include<cstring>
using namespace std;
/*
之前我们说的差值建树状数组,得到的是某个点的值,那如果我既要区间更新,又要区间查询怎么办。
这里我们还是利用差分,由上面可知
∑ni = 1A[i] = ∑ni = 1 ∑ij = 1D[j];
则A[1]+A[2]+...+A[n]
= (D[1]) + (D[1]+D[2]) + ... + (D[1]+D[2]+...+D[n])
= n*D[1] + (n-1)*D[2] +... +D[n]
= n * (D[1]+D[2]+..... | ALGO | 0.999986 | 4.166396 | {
"github_metadata": {
"branch": "master",
"commit_count": 27,
"repo_created_at": "2024-02-22T10:14: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": "8d220ad3c... |
7a9a6e33-fb18-49d0-a6d1-17db3ea67b9f | Saregadon/COSC3320 | Assignment7.cpp | #include <iostream>
#include <queue>
#include <unordered_map>
using namespace std;
// Huffman tree node
struct Node {
char letter;
unsigned count;
Node* left, * right;
Node(char letter, unsigned count) : letter(letter), count(count), left(nullptr), right(nullptr) {}
};
// Comparison operator for prio... | ALGO | 0.999998 | 6.175336 | {
"github_metadata": {
"branch": "main",
"commit_count": 34,
"repo_created_at": "2023-06-07T15:44: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": "95d300cc1b3... |
2ca516d2-fbd5-4954-9c5f-2f20dd4efd65 | ishandutta2007/codeforces-h | heart_blue/normal/523/C.cpp | #include <cstdlib>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <iostream>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <fstream>
#include <numeric>
#include <iomanip>
#include <bi... | ALGO | 0.999692 | 3.527385 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T02:01: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": "9d1c4e6551cd... |
41142152-7df6-4413-8e5d-b76ccaeb324f | abhishekmeena33/Codes | CodeForces/A_Is_It_a_Cat.cpp | #include <bits/stdc++.h>
#include <string>
#include <set>
using namespace std;
#define FAST ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define ll long long
#define vec vector<ll>
#define pb push_back
#define vecpair vector <pair<ll ,ll>>
#define mp make_pair
#define map map<ll,ll>
#define dd double
... | ALGO | 0.999906 | 3.862545 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2024-03-04T10:45:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ed133d61316... |
98bedad4-b01f-4e78-9940-7b0e9409748b | cmgcds/ParMooN_CMG | Main_Users/Ankit/2D/2D_withblock/MHD2D.h | // Navier-Stokes problem, Poiseuille-Problem
//
// u(x,y) = (4*y*(1-y), 0)
// p(x,y) = x-1/2
void ExampleFile()
{
OutPut("Example: MHD2D.h" << endl) ;
TDatabase::ParamDB->INTERNAL_STEADY_STATE_MATRICES_OR_RHS = 0;
TDatabase::ParamDB->INTERNAL_CONVECTION_EQ_VELOFIELD = 1;
}
#include <Joint.h>
#include <Bound... | ALGO | 0.997771 | 3.289926 | {
"github_metadata": {
"branch": "master",
"commit_count": 77,
"repo_created_at": "2020-09-29T03:41:37.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2,
"forks": 3,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "65076cc3e2... |
970dc864-ae72-4a3d-ad31-06e9f5f3ce41 | ksaveljev/UVa-online-judge | 405.cpp | #include <iostream>
#include <string>
#include <vector>
#include <map>
using namespace std;
typedef struct _routing_table {
string mta;
string country;
string admd;
string prmd;
string organization;
} routing_table;
map<string,bool> visited;
pair<int,string> send_message(routing_table &msg, map< ... | ALGO | 0.997593 | 4.070737 | {
"github_metadata": {
"branch": "master",
"commit_count": 788,
"repo_created_at": "2011-04-04T11:43:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 106,
"forks": 69,
"issues": 0,
"pull_requests": 4
},
"file_meta": {
"content_id": "a78f3... |
52f8c681-14f7-495f-b9a9-4323662022ad | MXNXV-ERR/cnlab | Question2_checksum.cpp | #include <bits/stdc++.h>
using namespace std;
string addBinaryUtil(string a, string b)
{
string result = "";
int s = 0;
int i = a.size() - 1, j = b.size() - 1;
while (i >= 0 || j >= 0 || s == 1)
{
s += ((i >= 0) ? a[i] - '0' : 0);
s += ((j >= 0) ? b[j] - '0' : 0);
result = char(s % 2 + '0') + result;... | ALGO | 0.999909 | 4.354677 | {
"github_metadata": {
"branch": "main",
"commit_count": 39,
"repo_created_at": "2022-09-19T14:26:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "eb1f1677c61... |
22961abc-4712-459c-aa00-b09eab118ef3 | chromecast56/cprepo | Notes/data_structures/HeavyLight-Decomposition/XORsum(cowland).cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pi;
typedef vector<int> vi;
const int MAXN = 100100;
const int LN = 17;
int n,q, costs[MAXN]; vi adj[MAXN];
int baseArray[MAXN], ptr=0;
int chainNo=0, chainInd[MAXN], chainHead[MAXN], posInBase[MAXN];
int depth[MAXN], f[LN][MAXN]... | ALGO | 0.999879 | 4.544266 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2022-03-10T06:30: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": "5c414d6807dd... |
48536881-3a76-4fde-a521-d71b3381bcf2 | Mindjolt2406/Competitive-Programming | Codeforces/GYM/2020 UP ACM Algolympics Elimination Round/I.cpp | #include<bits/stdc++.h>
#define mt make_tuple
#define mp make_pair
#define pu push_back
#define INF 1000000001
#define MOD 1000000007
#define EPS 1e-6
#define ll long long int
#define ld long double
#define fi first
#define se second
#define all(v) v.begin(),v.end()
#define pr(v) { for(int i=0;i<v.size();i++) { v[i]==I... | ALGO | 0.999947 | 3.650623 | {
"github_metadata": {
"branch": "master",
"commit_count": 36,
"repo_created_at": "2018-11-15T05:50:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c2e3eb7b7... |
40bf299f-f315-41d9-9f49-6ea7a235a5ab | tarnowskijan/Projekt_IM__QT | mouthStateDet.cpp | #include "mouthStateDet.h"
#include <QDebug>
using namespace std;
using namespace cv;
int getBiggestRect(const vector<Rect> rects){
int biggestIdx = 0;
if (rects.size()<=1){return 0;}
for(unsigned int i = 0; i < rects.size(); i++){
Rect current = rects.at(i);
Rect biggest = rects.at(bigg... | ALGO | 0.998689 | 4.872793 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2013-06-01T23:07: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": "fbc8b34b1... |
6a3f2bf0-f022-4639-99df-b05bcdbf9b56 | ibadeeCodes/All-About-C-plus | My C++ Programs/toll bith extended with not paying.cpp | //toll bothh//
#include<iostream>
using namespace std;
class tb{
public:
double totalmoney;
int totalvehicles,n;
int van,car,bike;
public:
tb ()
{
totalmoney=0;
totalvehicles=0;
bike=0;
car=0;
van=0;
}
void payingcar()
{
totalmoney=totalmoney+10;
totalvehicle... | TOOL | 0.949294 | 3.549357 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-01-02T17:25: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": "39c47f1547... |
6823a60d-3d1a-4b90-a62b-b3e1165fd858 | SergiyYermak/Gaussian_Elimination | Gaussian_Elimination/main.cpp | /* This algorithm transforms an n*n(+1) augmented matrix M representing a linear system into its reduced form.
At each step, M refers to the current state of the matrix, not the original state.
A. Set the row i equal to 0.
B. Set the column j equal to 0. We will loop though columns 0 to n-1.
C. Find the row k with... | ALGO | 0.999761 | 4.810018 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2022-02-09T17:15: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": "baab85fd7dee... |
9f639a8f-18f9-4ecd-b94e-35816d0e1605 | tatparya/HackerRank | Algorithms - Graph Theory/Even Tree/solution.cpp | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
// Author: <NAME>
#define MAX 100
class Node
{
public:
int id;
int parent;
int numChildren;
vector<int> children;
int numVertices;
Node();
void init( int, int );
void addChild( int );
... | ALGO | 0.99986 | 4.341445 | {
"github_metadata": {
"branch": "master",
"commit_count": 116,
"repo_created_at": "2015-04-14T17:32:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 6,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e2494316... |
29695e37-eca7-41e4-83ba-9c3eeb0abf95 | Atanusaha143/Competitive-Programming | UVA/11085 - Back to the 8-Queens.cpp | #include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> pii;
#define endl '\n'
const int N = 10;
int queen[N]; /// queen[row] = column number of queen at that row
int column[N], diagonalL[N], diagonalR[N]; /// arrays to mark if there is a queen or not
int n, cnt, arr[N];
vector <pii> adj[100];
bool cmp(pi... | ALGO | 0.999959 | 4.034228 | {
"github_metadata": {
"branch": "master",
"commit_count": 526,
"repo_created_at": "2019-10-06T15:46:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "afbe9bbd... |
51ae5c20-e810-4e7f-a0dc-586d8566e02d | zfantasier/workspace | codeforces/codeforces round#404/e/ans.cpp | #include <cmath>
#include <cstdio>
#include <cstdlib>
#include <climits>
#include <cstring>
#include <algorithm>
using namespace std;
#define MAXN 200010
#define MAXT (100 * MAXN)
#define lm ((l + r) >> 1)
#define rm (lm + 1)
static int N, Q, tr_tot, A[MAXN];
static int root[MAXN], lson[MAXT], rson[MAXT], size[MAXT]... | ALGO | 0.999985 | 4.187128 | {
"github_metadata": {
"branch": "master",
"commit_count": 40,
"repo_created_at": "2015-08-27T14:49:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "024ff046a... |
bcf418b0-d249-4a66-b4ec-3fbd45041a99 | stanfordhpccenter/HTR-solver | src/Utils/math_utils.hpp | // Copyright (c) "2019, by Stanford University
// Developer: <NAME>
// Affiliation: Center for Turbulence Research, Stanford University
// URL: https://ctr.stanford.edu
// Citation: <NAME>., <NAME>., and <NAME>. (2020).
// HTR solver: An op... | ALGO | 0.999603 | 4.289209 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2020-03-24T10:35:29.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 77,
"forks": 24,
"issues": 5,
"pull_requests": 0
},
"file_meta": {
"content_id": "a68f10497... |
62e25de0-5ed8-4bde-819d-5b71114ea7e1 | tayu0110/atcoder | abc/abc103d.cpp | #include<iostream>
#include<iomanip>
#include<string>
#include<vector>
#include<algorithm>
#include<utility>
#include<tuple>
#include<map>
#include<queue>
#include<deque>
#include<set>
#include<stack>
#include<numeric>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
using namespace std;
struct Ed... | ALGO | 0.999679 | 3.316237 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2021-05-02T14:14: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": "8f547fd45... |
ec088f4d-e515-4280-bae5-eec4c0a1916e | kodumurivarun/csa0166-C-192210536- | lp 32.cpp | #include <iostream>
using namespace std;
const int MAX_SIZE = 5;
class Stack {
private:
int arr[MAX_SIZE];
int top;
public:
Stack() : top(-1) {}
bool isEmpty() {
return top == -1;
}
void push(int value) {
if (top == MAX_SIZE - 1) {
co... | ALGO | 0.998654 | 5.033384 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-07-29T05:02: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": "e98f159f248d... |
fbcceb52-c1c5-4145-8086-b1a54d1621f0 | lballabio/quantlib-old | QuantLib/ql/pricingengines/vanilla/fdamericanengine.hpp | /* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
Copyright (C) 2005 <NAME>
Copyright (C) 2009 StatPro Italia srl
This file is part of QuantLib, a free-software/open-source library
for financial quantitative analysts and developers - http://quantlib.org/
QuantLib is free softwar... | ALGO | 0.995797 | 7.106093 | {
"github_metadata": {
"branch": "master",
"commit_count": 18714,
"repo_created_at": "2013-06-06T07:47:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 473,
"forks": 399,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "52... |
f9a7ae82-4aa0-4d46-92c0-b3f64c78441f | sekzerd/design-pattern-cpp | source/behavioral/visitor.cpp | #include <iostream>
#include <vector>
class visitor;
class element {
public:
virtual void accept(visitor *visitor) = 0;
virtual ~element() {}
};
class visitor {
public:
virtual void visit_elementA(element *element) = 0;
virtual void visit_elementB(element *element) = 0;
virtual ~visitor() {}
}... | TOOL | 0.932543 | 6.393579 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2020-11-02T15:52:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0a3b2b591... |
72c921b5-3082-4319-847b-36884532d300 | k1101jh/CodingTest | baekjoon/2636.cpp | #include <iostream>
#include <queue>
#include <vector>
using namespace std;
int H, W;
int map[100][100];
bool visited[100][100] = {0};
int dy[] = {-1, 0, 1, 0};
int dx[] = {0, 1, 0, -1};
void print_map() {
cout << '\n';
for(int i=0; i < H; i++) {
for(int j=0; j < W; j++) {
cout << map[i][... | ALGO | 0.999966 | 3.653507 | {
"github_metadata": {
"branch": "main",
"commit_count": 115,
"repo_created_at": "2021-10-05T08:27: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": "b2553aaaa9... |
e8736967-39e8-4be4-b2de-18337c4dbd40 | Mtsaleem/SaleemMuhammad_CIS5__Spring2017 | Homework/Assignment_2/Gaddis_8thEd_Chap3_Prob6_Recipe/main.cpp | /*
* File: main.cpp
* Author: <NAME>
* Created on March 09, 2017, 11:25 AM
* Purpose: Calculate ratio of ingredients for cookies
*/
//System Libraries Here
#include <iostream>
using namespace std;
//User Libraries Here
//Global Constants Only, No Global Variables
//Like PI, e, Gravity, or conversions
//Fu... | ALGO | 0.958626 | 4.228079 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2017-03-07T19:13: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": "3a73c3044a... |
93cb26e9-87c6-4f31-8cea-2cc15746acc1 | Shre-sg/COMP | DSA/BINARY TREE/22_check_if_leaf_@_lvl.cpp | #include <iostream>
#include <map>
#include <bits/stdc++.h>
using namespace std;
struct Node {
int data;
Node* left;
Node* right;
// Add any other necessary members
};
// Leaf at same level
// Given a Binary Tree, check if all leaves are at same level or not.
// Example 1:
// Input:
// ... | ALGO | 0.99924 | 6.236024 | {
"github_metadata": {
"branch": "main",
"commit_count": 173,
"repo_created_at": "2023-11-04T14:36:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c3275074e4... |
b42be049-2aaf-476a-b938-5a4d085c2dbf | openvinotoolkit/openvino | src/core/reference/src/op/reverse.cpp | // Copyright (C) 2018-2025 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#include "openvino/reference/reverse.hpp"
#include <cmath>
#include <cstring>
#include <iterator>
#include "openvino/core/except.hpp"
#include "openvino/reference/utils/coordinate_range.hpp"
namespace ov {
namespace reference {
v... | ALGO | 0.921497 | 6.721938 | {
"github_metadata": {
"branch": "master",
"commit_count": 19551,
"repo_created_at": "2018-10-15T10:54:40.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 8597,
"forks": 2656,
"issues": 303,
"pull_requests": 258
},
"file_meta": {
"content_id"... |
6f7d7b53-5007-47f2-953c-7bca8c5c9a92 | Froked/LeetCode_30_days_challenge_2020 | week_3/day_18.cpp | /**
Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path.
Note: You can only move either down or right at any point in time.
Example:
Input:
[
[1,3,1],
[1,5,1],
[4,2,1]
]
Output: 7
Explanation: Because the path 1→3... | ALGO | 0.999966 | 5.642981 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2020-12-13T05:30:44.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "89e7ab0d6b... |
fb6ddb54-34b8-484c-838b-d1ce83d54d0f | palvaibhav/competitive-programming-codes | DS & Algos/Graph Theory/toposort.cpp | #include <bits/stdc++.h>
using namespace std;
#define sz(o) ((int)o.size())
#define all(o) o.begin(), o.end()
#define rep(i, a, b) for(int i = (a); i <= (b); i++)
#define repr(i, a, b) for(int i = (a); i >= (b); i--)
typedef long long int ll;
typedef vector<ll> vll;
typedef vector<int> vi;
const int maxn = 1e5+5;
in... | ALGO | 0.999989 | 4.362507 | {
"github_metadata": {
"branch": "master",
"commit_count": 62,
"repo_created_at": "2017-10-01T17:45: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": "fdcf3dc1a... |
74b281fc-0cfe-413c-ab90-7af7ade3d0cf | ggh-png/PS | 백준/2178.cpp | #include <iostream>
#include <queue>
using namespace std;
// joy
int dy[] = {-1, 0, 1, 0};
int dx[] = {0, 1, 0, -1};
// map
bool map[101][101];
int visited [101][101];
// map 크기
int n, m;
// 현 위치
int x, y;
int main()
{
cin >> n >> m;
for(int i=0; i < n; i++)
{
string str;
cin >> str... | ALGO | 0.999976 | 3.982887 | {
"github_metadata": {
"branch": "master",
"commit_count": 522,
"repo_created_at": "2022-02-20T06:07: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": "64f29fce... |
98728969-347f-4510-8516-f20e5adf2447 | Prikshit-anthal/45_DAY_DSA_QUESTIONS | heaps_pq/3.cpp | #include<bits/stdc++.h>
using namespace std;
class Solution
{
unsigned long long arr[1690] = {};
int idx = 0;
public:
int nthUglyNumber(int n)
{
return arr[n - 1];
}
Solution()
{
int count = 0;
int cur = 1;
while (idx < 1690)
{
unsigned l... | ALGO | 0.999906 | 4.65739 | {
"github_metadata": {
"branch": "main",
"commit_count": 30,
"repo_created_at": "2022-05-04T10:04: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": "04df72cb967... |
dd8ea253-547e-41d2-909b-25e2d655da9e | KTS-o7/Leetcode_Journey | LeetcodeSolutions/Prob0452_MinimumNumberOfArrowsToBurstBalloons.cpp | class Solution {
public:
int findMinArrowShots(vector<vector<int>>& points) {
sort(points.begin(),points.end());
int cmp = points[0][1];
int arrow = 1;
for(int i = 1;i<points.size();i++)
{
if(cmp<points[i][0])
... | ALGO | 0.999926 | 6.188587 | {
"github_metadata": {
"branch": "main",
"commit_count": 250,
"repo_created_at": "2023-08-07T17:53:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "95d6d53ce7... |
4c1d3927-3752-4b76-9a60-7f780a7a3e2b | tanmoy13/AlgorithmsInCPP | Segment Tree/main.cpp | /* ******************************************************
* Md. Abdulla-Al-Sun
* Codeforces: sun. , Topcoder : sun.
* Uva: sun. , SPOJ : sun_kuet , LOJ : 5002 CodeChef: sun_kuet
* KUET, Bangladesh
****************************************************** */
#include <bits/stdc++.h>
#define scan(a)... | ALGO | 0.999949 | 3.389339 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2016-07-15T11:45: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": "6ce1d838ee... |
eb51534e-94f1-45a1-92f8-76f78fc488f1 | Nitun499/SDESheet-TakeUForward- | Array/4Sum.cpp | #include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define vi vector<int>arr
#define vvi vector<vector<int>>arr
vector<vector<int>> fourSum(vector<int>& nums, int target_main) {
vector<vector<int>>ans;
int n=nums.size();
sort(begin(nums),end(nums));
for(int i=0;i<n;i++){
... | ALGO | 0.999832 | 5.245838 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2022-04-14T14:11: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": "50651266a5... |
c00b3281-d896-46e8-8adb-1c0544de470e | Qurclinc/LABs | SACOD/STUFF/Sort algs/Sorts.h | #include <vector>
#include <iostream>
#include <cmath>
#include <algorithm>
// Шейкерная сортировка
/////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////
void ShakerSort(std::vector<int> &arr... | ALGO | 0.999865 | 4.321192 | {
"github_metadata": {
"branch": "master",
"commit_count": 29,
"repo_created_at": "2024-10-07T10:05:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5883b871f... |
b9950543-6fde-468a-b3d6-4853ec101463 | adityarev/cpp-implementation | array.cpp | #include <functional>
#include <iostream>
#include <vector>
template<typename T>
class Array {
private:
std::vector<T> arr;
public:
Array();
Array(std::vector<T> arr);
std::vector<T>& value();
std::vector<T> filter(std::function<bool(T)> valid);
template<typename _T> std::vector<_T> map(std::function<_T(T)> mod... | TOOL | 0.990035 | 5.722629 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-04-29T00:28: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": "f9a641b2cb... |
c2e0b30c-ce36-4da3-ad4c-0b7c48189c77 | jescas981-courses/design-patterns | 8.Composite/src/array_backed.cpp | #include <array>
#include <iostream>
#include <numeric>
#include <algorithm>
// Bad approach , doesn't scale
//
// class Creature {
// int strength, agility, intelligence;
// public:
// int get_strength() const { return strength; }
// int get_agility() const { return agility; }
// int get_intelligen... | ALGO | 0.941313 | 5.01382 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2022-10-12T21:45:16.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fda5fcdcd71... |
4055e360-d824-42bc-aada-4e51f169096c | AntonyMei/RayTracingRender | src/core/PhotonMap.h | //
// Created by meiyixuan on 2021-12-29.
//
#ifndef PROJECT_PHOTONMAP_H
#define PROJECT_PHOTONMAP_H
int calculate_median(int start, int end);
class PhotonMap {
public:
PhotonMap() {
max_photon_num = 10000;
photon_num = 0;
photon_list = new Photon[10000];
box_min = Vector3d(10000,... | ALGO | 0.999667 | 5.470767 | {
"github_metadata": {
"branch": "RayTracer7.0",
"commit_count": 328,
"repo_created_at": "2021-12-09T03:45: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": "19... |
4ff5f496-a424-4d4b-9e56-b69c65ce324a | ForgotDream/Problemset | Luogu/P4553 80人环游世界.cpp | /**
* @file P4553 80人环游世界.cpp
* @author ForgotDream
* @brief MCMF
* @date 2023-08-20
*/
#include <algorithm>
#include <cstring>
#include <iostream>
#include <queue>
#include <vector>
using i64 = long long;
using pll = std::pair<i64, i64>;
#pragma region
template<int N = 100050>
struct MCMF {
static co... | ALGO | 0.999833 | 3.883688 | {
"github_metadata": {
"branch": "main",
"commit_count": 286,
"repo_created_at": "2023-04-20T07:00: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": "0ba3e7e3d5... |
145ae0f3-4fc8-4308-910c-89ddccb33c2a | matheus3301/neps-academy-exercises | COMUNIDADE/classificacaotriangulos.cpp | #include <bits/stdc++.h>
#define REP(x,ini,fim) for(int x = ini; x < fim; x++)
#define endl "\n"
#define debug(x) cout << "DEBUG: " << x << endl;
using namespace std;
typedef long long ll;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int a, b , c;
cin >> a >> b >> c;
if(a > ... | ALGO | 0.999955 | 3.765783 | {
"github_metadata": {
"branch": "master",
"commit_count": 27,
"repo_created_at": "2019-11-06T19:40:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "9bfc323e8... |
1cdb7ce9-d61d-499d-b4d8-f8ec05bc4762 | KIET-Github/2024-B-Training | 2000290120095/Week_5/snakeAndLadder.cpp | class Solution {
public:
int snakesAndLadders(vector<vector<int>>& board) {
int n = board.size();
int count = 0;
bool reverse = false;
map<int,int> adj;
for(int i=n-1;i>=0;i--){
if(reverse){
for(int j=n-1;j>=0;j--)
{
... | ALGO | 0.999803 | 4.932988 | {
"github_metadata": {
"branch": "main",
"commit_count": 429,
"repo_created_at": "2023-07-06T07:09:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 38,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "912077fe2... |
20a014cc-7b39-41a5-9999-b92d778a3f77 | ishandutta2007/codeforces-s | shun_pi/normal/1338/B.cpp | #include <bits/stdc++.h>
using namespace std;
using lint = long long int;
#define FOR(i, begin, end) for(int i=(begin),i##_end_=(end);i<i##_end_;i++)
#define IFOR(i, begin, end) for(int i=(end)-1,i##_begin_=(begin);i>=i##_begin_;i--)
#define REP(i, n) FOR(i,0,n)
#define IREP(i, n) IFOR(i,0,n)
constexpr int MOD = 100000... | ALGO | 0.999501 | 3.81958 | {
"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": "884243dd553f... |
5d29268a-be88-43d6-99ab-e20ea05909cc | hasib095/XPSC-B-5 | Binary Search - 1/Fast_search.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define endl "\n"
#define all(x) begin(x), end(x)
void solve()
{
int n;
cin >> n;
vector<ll> v(n);
for (int i = 0; i < n; i++)
{
cin >> v[i];
}
sort(all(v));
int k;
cin >> k;
for (int i = 0; i < k; i++)
... | ALGO | 0.999971 | 5.075356 | {
"github_metadata": {
"branch": "main",
"commit_count": 55,
"repo_created_at": "2024-10-26T18:20: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": "603f2546990... |
880d5185-3b22-41c5-9869-a81d379d620d | Zoey-Fan/Q-view | mergeindex/tinyCG/triangle.hpp | #ifndef TRIANGLE_HPP
#define TRIANGLE_HPP
#include <Vec3.hpp>
#include <algorithm>
#include <iostream>
namespace tinyCG {
//空间三角形
//按照逆时针顺序插入值并计算法向量
template <class T>
class Triangle
{
public:
Vec3<T> v0;
Vec3<T> v1;
Vec3<T> v2;
Vec3<T> vn;
Vec3<T> min;
Vec3<T> max;
Triangle()
{
}
... | ALGO | 0.979899 | 6.328874 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-09-23T00:51:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6e75672ebbf1... |
3d910a81-7868-4ca3-a7c0-52c4b8f61529 | pdrabik223/CoA | path_search/random_step/random_step.cpp | //
// Created by piotr on 29/10/2021.
//
#include "random_step.h"
std::vector<Coord> RandomStep::FindPath(Window &window_handle, const ColorScheme &color_scheme) {
ClearGraph();
if (not UpdateGs(window_handle, color_scheme)) return {};
GeneratePath(window_handle, color_scheme);
return shortest_path_;
}
st... | ALGO | 0.999681 | 3.888324 | {
"github_metadata": {
"branch": "main",
"commit_count": 168,
"repo_created_at": "2021-10-04T21:09: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": "485192ac0d... |
5139b247-654e-44fd-a9e6-0e70c7f37540 | QuachTinh68/LessonCode | C++/Trash/C++ CopyCode/coc.cpp |
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
// Ham nhap chuoi
void nhapChuoi(string& s)
{
cout << "Nhap chuoi: ";
getline(cin, s);
}
// Ham thong ke so lan ky tu 'a' xuat hien trong chuoi
int demKyTuA(string s)
{
int count = 0;
for (int i = 0; i < s.length(); i++)... | ALGO | 0.988518 | 3.292076 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-10-23T05:05: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": "c838d760e83c... |
7f05141d-6bc2-411f-ad3f-4b365b5bd51a | shubham-deshmukh/CP-Contests | Codeforce/CF_R_1037/E_G_C_D_Unlucky.cpp | #include <bits/stdc++.h>
using namespace std;
// #ifndef ONLINE_JUDGE
// #include "./debug.h"
// #else
// #define debug(x...)
// #endif
#define endl "\n"
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> //... | ALGO | 0.99977 | 5.494392 | {
"github_metadata": {
"branch": "main",
"commit_count": 365,
"repo_created_at": "2023-05-21T17:27:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "74aa0a431f... |
69664721-0723-4d2e-aa3e-1a2b7082b0b4 | royalpranjal/Interview-Bit | Linked-Lists/RemoveDuplicatesFromSortedLists-II.cpp | // https://www.interviewbit.com/problems/remove-duplicates-from-sorted-list-ii/
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
ListNode* Solution::deleteDuplicates(ListNode* A) {
// Do not write main() f... | ALGO | 0.999979 | 5.125205 | {
"github_metadata": {
"branch": "master",
"commit_count": 356,
"repo_created_at": "2016-04-11T09:21:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 545,
"forks": 451,
"issues": 2,
"pull_requests": 24
},
"file_meta": {
"content_id": "3fa... |
d2f1a377-e385-4809-a509-ba195d7c5ac8 | bootchk/libsaliency | include/libsaliency.hpp | /*
* Software License Agreement (BSD License)
*
* Saliency Detection
* Copyright (c) 2011, <NAME>
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of s... | ALGO | 0.993439 | 7.065236 | {
"github_metadata": {
"branch": "master",
"commit_count": 39,
"repo_created_at": "2016-04-07T18:28:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cc96e8b37... |
32cccaeb-a44f-491d-b16e-efe9433a9b46 | metehkaya/Algo-Archive | Problems/LeetCode/Solutions/0968.Binary_Tree_Cameras.cpp | typedef vector<int> vi;
typedef vector<vi> vii;
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), left(left), rig... | ALGO | 0.999973 | 5.484902 | {
"github_metadata": {
"branch": "main",
"commit_count": 78,
"repo_created_at": "2023-04-04T19:44: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": "492cc4f3cfb... |
93ae03dc-8fe8-4f44-a4a9-0a4d89df367b | Khanhnvtb/Data-structures-and-algorithms-PTIT-2021 | CPP/DSA10006.cpp | //
// Created by khanh on 5/23/2021.
//
#include <bits/stdc++.h>
using namespace std;
int v, e, cnt, vs[1005];
vector <int> a[1005];
vector <int> res;
void dfs(int u) {
vs[u] = 1;
queue <int> q;
q.push(u);
while (! q.empty()) {
u = q.front();
q.pop();
for (int i = 0; i < a[u].siz... | ALGO | 0.99996 | 4.530506 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2022-05-16T10:07: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": "15be2c6f487e... |
ca25d105-e611-4bf0-a0bd-f924093f7d56 | JackeyLove1/Leetcode | others/poj1014.cpp | // Author: Jacky
#include <iostream>
#include <sstream>
#include <vector>
#include <algorithm>
#include <functional>
#include <cmath>
#include <unordered_map>
#include <unordered_set>
#include <map>
#include <set>
#include <bitset>
#include <cstring>
#include <queue>
#include <tuple>
#include <deque>
#include <numeric>... | ALGO | 0.999738 | 3.822999 | {
"github_metadata": {
"branch": "master",
"commit_count": 547,
"repo_created_at": "2020-08-14T01:48:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9fa0b70a... |
ae3857f2-da1b-48cd-9fc8-a131611d2128 | AnneMayor/algorithmstudy | Atcoder_Beginner_Contest_191_F.cpp | #include <bits/stdc++.h>
using namespace std;
int getGcd(int a, int b) {
if(b == 0) return a;
return getGcd(b, a%b);
}
int main(void) {
int n;
scanf("%d", &n);
vector<int> numList;
int minNum = INT_MAX;
for(int i = 0; i < n; i++) {
int num;
scanf("%d", &num);
min... | ALGO | 0.999961 | 4.488717 | {
"github_metadata": {
"branch": "master",
"commit_count": 654,
"repo_created_at": "2019-04-19T07:42:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "fa1be64e... |
b5396baa-d16a-4e8e-85d3-17a968a3b8be | kushal15-neub/CP | fart.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define fast_cin() \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(NULL)
int main()
{
ll tt;
cin >> tt;
while (tt--)
{
int n, k;
... | ALGO | 0.99999 | 4.225288 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2025-01-31T18:59: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": "bc863a20920f... |
30d9d382-db3c-49e4-b9d9-c9de39a099d2 | nihal-kv/Strivers-SDE-Sheet-Challenge | PredecessorAndSuccessorInBST.cpp | #include <bits/stdc++.h>
/*************************************************************
Following is the Binary Tree node structure
template <typename T>
class BinaryTreeNode
{
public :
T data;
BinaryTreeNode<T> *left;
BinaryTreeNode<T> *right;
BinaryTreeNode(T d... | ALGO | 0.999999 | 4.345972 | {
"github_metadata": {
"branch": "master",
"commit_count": 24,
"repo_created_at": "2023-06-06T04:14:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "56460b1b8... |
1ca075ec-5c1e-497e-8c01-aa9673b3469b | lubby/sort | src/sort.cpp | //============================================================================
// Name : sort.cpp
// Author :
// Version :
// Copyright : Your copyright notice
// Description : Sort in C++, Ansi-style
//============================================================================
#include "sort.h"
us... | ALGO | 0.99956 | 4.264719 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2012-07-26T01:24:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8fd0314861... |
d1a4b7f9-4d92-4abb-8aea-ccea26e648ad | AmanSharma121202/DSA-Code | bucketSortAlgo.cpp | #include<bits\stdc++.h>
using namespace std;
void bucketSort(float arr[], int size){
vector<vector<float>>bucket(size,vector<float>());
for(int i=0; i<size; i++){
int index=arr[i]*size;
bucket[index].push_back(arr[i]);
}
for(int i=0; i<size; i++){
if(!bucket[i].empty()){
... | ALGO | 0.999958 | 4.362529 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-06-19T05:40:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ed18dd722585... |
d1210c9f-fb70-4b89-933c-2c5c0b482b85 | Ziaeemehr/cpp_workshop | FFT/1/tutorial/cross_correlation/test/use_alglib/integration.cpp | /*************************************************************************
ALGLIB 3.11.0 (source code generated 2017-05-11)
Copyright (c) <NAME> (ALGLIB project).
>>> SOURCE LICENSE >>>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as publishe... | ALGO | 0.999713 | 6.039912 | {
"github_metadata": {
"branch": "master",
"commit_count": 70,
"repo_created_at": "2019-02-13T18:27:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fbb62e00e... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.