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 |
|---|---|---|---|---|---|---|---|
ab6119f9-e203-4f46-9f34-e4b66256d221 | DILET1/usacoarchive | Alphastar/CC41A/Mixed Problem Set 1/cruise.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
ifstream in("cruise.in");
ofstream out("cruise.out");
vector<bool> seq; //false is l, true is r
int n, m, k;
// in >> n >> m >> k;
cin >> n >> m >> k;
vector<pair<int,int>> adj(n);
for(int i= 0; i< n; i++){
int a, b;
cin >> a >> b;
// in >> a >> b;
... | ALGO | 0.999996 | 3.211793 | {
"github_metadata": {
"branch": "main",
"commit_count": 250,
"repo_created_at": "2022-01-28T18:13: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": "a4759921d1... |
709126e6-daf7-45d3-bdd7-c1cb7008154e | itkingnb/cf-atc-and-so-on | luogu/P1042.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pii pair<int,int>
ll jc(ll n){
if(n==1||n==0)
return (ll)1;
else
return n*jc(n-1);
}
void yes(){
cout<<"Yes\n";
}
void no(){
cout<<"No\n";
}
int gcd(int a,int b){
return b?gcd(b,a%b):a;
}
int lcm(int a,int b){
retu... | ALGO | 0.999957 | 3.549898 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2025-03-26T07:30:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f30e6edb8496... |
7b75e558-17ee-4cbf-9270-ceb64e1ffcee | RobotLocomotion/drake | systems/optimization/system_constraint_adapter.h | #pragma once
#include <memory>
#include <optional>
#include <vector>
#include "drake/solvers/binding.h"
#include "drake/systems/optimization/system_constraint_wrapper.h"
namespace drake {
namespace systems {
/**
* This class is a factory class to generate SystemConstraintWrapper. Namely
* this class helps to conve... | TOOL | 0.985776 | 7.688686 | {
"github_metadata": {
"branch": "master",
"commit_count": 33726,
"repo_created_at": "2014-01-26T16:11:05.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 3630,
"forks": 1305,
"issues": 690,
"pull_requests": 46
},
"file_meta": {
"content_id":... |
7466cbfe-cd87-438f-b099-03fae9cab991 | GoldFeniks/DORK | include/dork.hpp | #pragma once
#include "solver.hpp"
#include "coefficients.hpp"
namespace dork {
template<typename T>
static runge_kutta_method<T, 2, 2> rkf1 = runge_kutta_method(coefficients::rkf1<T>);
template<typename T>
static runge_kutta_method<T, 2, 2> rkf1b = runge_kutta_method(coefficients::rkf1b<T>);
t... | ALGO | 0.997102 | 5.776754 | {
"github_metadata": {
"branch": "master",
"commit_count": 35,
"repo_created_at": "2018-10-04T04:50:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "aef58b288... |
de47982f-59e8-43bc-8872-2301b76f8641 | NateSeymour/urban | src/main.cpp | #include <city/JIT.h>
#include <cstring>
#include <filesystem>
#include <fstream>
#include <iostream>
#include <sstream>
#include <tree_sitter/api.h>
#include <unordered_map>
extern "C" TSLanguage const *tree_sitter_c();
class Scope
{
std::vector<std::unordered_map<std::string, city::Value *>> variables_;
public... | TOOL | 0.928295 | 7.05772 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2025-02-03T23:53:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "38696afcd... |
bbfa981e-db2e-42b9-86d9-8b20993ce4c0 | Bighandsome-handsome/USTB-Information-security | 计算器大作业(屈微,能环)/algorithm.cpp | #include <iostream>
#include <stack>
#include <sstream>
#include <cctype>
using namespace std;
// 函数用于检查是否是运算符
bool isOperator(char c) {
return c == '+' || c == '-' || c == '*' || c == '/';
}
// 函数用于比较运算符的优先级
int precedence(char op) {
if (op == '*' || op == '/') return 2;
if... | ALGO | 0.99996 | 4.616428 | {
"github_metadata": {
"branch": "main",
"commit_count": 25,
"repo_created_at": "2024-11-29T17:06: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": "5653ebcd241... |
01b2c9d8-f8c9-4d12-b4db-2a2fe03ac26d | risenfromashes/cse314 | ipc/main.cc | #include "binding_stations.h"
#include "config.h"
#include "entry_book.h"
#include "group.h"
#include "printing_station.h"
#include "random.h"
#include "staff.h"
#include "student.h"
#include "timer.h"
#include <cassert>
#include <cstdio>
#include <iostream>
int main(int argc, char **argv) {
for (int i = 1; i < arg... | ALGO | 0.996132 | 3.524384 | {
"github_metadata": {
"branch": "master",
"commit_count": 70,
"repo_created_at": "2023-06-18T06:11:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0b59eab83... |
a65bfeb2-d5d9-46da-ac9e-fe9432ad9a9b | Bhupesh-aher/Recursion-Hashing- | Recursion/L12/PrintAllPermutationsOfArrString.cpp | #include<bits/stdc++.h>
using namespace std;
void printAllPermutations(vector<int> &arr, vector<int> &ds, vector<int> &hashArr, vector<vector<int>> &ans, int n){
if(ds.size() == n){
ans.push_back(ds);
return;
}
for(int i = 0; i<n; i++){
if(hashArr[i] != 1){
ds.push_bac... | ALGO | 0.999964 | 5.635139 | {
"github_metadata": {
"branch": "main",
"commit_count": 27,
"repo_created_at": "2025-04-01T17:44: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": "afd7cb3392e... |
a6e4b293-f264-4e2b-b666-f1ad2a477608 | zyf-123/Struct_date | Struct_date/后缀表达式的计算.cpp | #if 0;
/*基于后缀表达式的计算问题
对于数字全部进栈
对于符号,从栈中弹出右操作数,然后从栈中弹出左操作数,根据符号进行相应的计算,然后运算结果在次压入栈中
直到剩下一个值*/
#include <iostream>
#pragma warning(disable:4996)
using namespace std;
typedef struct LINKNODE
{
struct LINKNODE* next;
}LinkNode;
typedef struct LINKSTACK
{
LinkNode head;
int size;
}LinkStack;
//初始化函数
LinkStack* Init_... | ALGO | 0.999968 | 3.533968 | {
"github_metadata": {
"branch": "master",
"commit_count": 31,
"repo_created_at": "2020-02-26T16:25:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "96262e61e... |
57191eae-cc61-4cdd-b9ce-c60568b54238 | shashank20-02/Striver-DSA | Stacks/nextGreaterElement.cpp | #include <bits\stdc++.h>
using namespace std;
vector<int> nextGreaterElement(vector<int> &arr)
{
int n = arr.size();
vector<int> nge(n, 0);
stack<int> st;
for (int i = n - 1; i >= 0; i--)
{
int element = arr[i];
if (st.empty())
{
nge[i] = -1;
st.push(... | ALGO | 0.999992 | 4.720906 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2023-02-22T07:26: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": "4acffc911b5... |
138c1e6b-b439-4eac-bde1-f608a39a7b30 | atharv1707/CodeCraft-100DaysOfCode-Completed- | Palindrome Linked 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* reverseList... | ALGO | 0.99954 | 6.163101 | {
"github_metadata": {
"branch": "main",
"commit_count": 333,
"repo_created_at": "2023-09-12T05:36: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": "87d523ccfb... |
9a0c087f-1ab2-4180-b7c0-74400821f844 | harshjaiswalprgm/CodeHelpDSA | Week3/SearchingTechniques/LinerSearch.cpp | #include <iostream>
using namespace std;
bool targetFound(int arr[], int size, int target)
{
for (int i = 0; i < size; i++)
{
int currentElement = arr[i];
if (currentElement == target)
{
return true;
}
}
return false;
}
int main()
{
// int arr[] = {10, 20... | ALGO | 0.999498 | 5.105352 | {
"github_metadata": {
"branch": "main",
"commit_count": 131,
"repo_created_at": "2023-10-19T09:20: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": "6cacd541a2... |
71bf3f3e-8dcd-4e78-a84a-4c48b67abb2b | MasterIceZ/IMSO | Retired/BetaProg/toi18_garden.cc | /*
* AUTHOR : Hydrolyzed~
* SCHOOL : RYW
* TASK : toi18_garden
* ALGO : Fenwick Tree, Dynamic Programming
* DATE : 28 Oct 2022
* */
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/rope>
#ifndef _DEBUG
// @==== Libary ====@ //
// @=========... | ALGO | 0.999937 | 4.828023 | {
"github_metadata": {
"branch": "main",
"commit_count": 127,
"repo_created_at": "2022-01-04T04:37:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5c3bcce35b... |
4b92e289-0ba4-49ac-82db-f2a5404ba746 | Shivamkumar26/Leetcode-Solutions | Container With Most Water - GFG/container-with-most-water.cpp | //{ Driver Code Starts
//Initial template for C++
#include<bits/stdc++.h>
using namespace std;
// int maxArea(int A[], int len);
// } Driver Code Ends
//User function template for C++
long long maxArea(long long nums[], int n) {
long long water = 0;
long long leftmax = 0, rightmax = 0;
int li = 0, r... | ALGO | 0.999801 | 5.967341 | {
"github_metadata": {
"branch": "main",
"commit_count": 1157,
"repo_created_at": "2022-09-25T06:03: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": "7caa2645c... |
00af3ca0-d494-4ada-830c-4d401691fc04 | sebaxtian/IA | BuscandoNemo/nodo2.h | /*
#ifndef NODO2_H
#define NODO2_H
#include <iostream>
//#include <queue>
using namespace std;
// Posibles estados del problema
enum estados {onLibre, onTiburon, onTortuga, onDori, onMarlin, onNemo};
// Posibles operadores aplicados
enum operadores {arriba, abajo, izquierda, derecha};
class Nodo2
{
// Identific... | ALGO | 0.994105 | 3.948386 | {
"github_metadata": {
"branch": "master",
"commit_count": 60,
"repo_created_at": "2016-05-09T14:10:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "be3d20fb9... |
125c8200-ee80-45f2-b79a-10d95ce299fb | nadim45448/Data-Structure | Data Structure/8.Tree/3.levelOrderTraversal.cpp | #include <bits/stdc++.h>
using namespace std;
class treeNode
{
public:
int data;
treeNode *leftChild;
treeNode *rightChild;
treeNode(int val)
{
data = val;
leftChild = NULL;
rightChild = NULL;
}
};
void printTree(treeNode *root, int val);
void spaceprint(int level);
void ... | ALGO | 0.999795 | 4.148964 | {
"github_metadata": {
"branch": "main",
"commit_count": 56,
"repo_created_at": "2023-10-17T04:15: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": "8d1c0899ace... |
9f64eed6-44da-44d4-ae0e-a7a273d8142d | amanpatel59/Problem_Solving | DP_2/decode_ways.cpp | // MEMO
// int getWays(string &s, int index, int &n, vector<int> &dp)
// {
// // base case
// if (index >= n)
// {
// return 1;
// }
// if (dp[index] != -1)
// return dp[index];
// int ways = 0;
// if (s[index] != '0')
// ways = getWays(s, index + 1, n, dp);
// ... | ALGO | 0.999649 | 5.398823 | {
"github_metadata": {
"branch": "main",
"commit_count": 61,
"repo_created_at": "2024-03-08T19:51: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": "7fc07806f4a... |
2fd2840d-9ac8-48f2-9437-e28a4ee719c1 | rahulvarma5297/NeetCode | Priority_Queue/621. Task Scheduler.cpp | #include<bits/stdc++.h>
using namespace std;
class Solution {
public:
int leastInterval(vector<char>& tasks, int n) {
unordered_map<char, int> m;
for(auto x: tasks){
m[x]++;
}
// count
priority_queue<int> pq;
for(auto x: m){
pq.push(x.second)... | ALGO | 0.999995 | 5.513661 | {
"github_metadata": {
"branch": "main",
"commit_count": 33,
"repo_created_at": "2023-05-18T16:34:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f2ec93e0b77... |
117a0d04-ea40-4009-b498-54071a09edb8 | rprs/prog-problems | coj/sol/1003.cpp | // General Election
#include <iostream>
#include <cmath>
#include <string>
#include <vector>
using namespace std;
int main() {
// get number of cases.
int cases = 0;
cin >> cases;
while( cases > 0) {
// get number of rows and cols
int rows, cols;
cin >> cols >> rows;
int candidates[co... | ALGO | 0.999971 | 4.410088 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2014-03-26T05:06:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "9dc17d7c6... |
c08fcea0-de1d-4c05-b1a6-a57fa62c2743 | LucasAust/CSCE240H-Spring2023-Lucas | Home-Work/HW1/src/calc.cpp | //To run program, press run in the top left corner, and click run without debugging.
//If it goes to the debug console screen, switch back to the terminal
//Enter data/input.txt when asked for the file name.
//Output will be printed to data/output.txt
//FOCUS ON REUSABILITY
#include <iostream>
#include <fstream>
#in... | ALGO | 0.935902 | 4.010427 | {
"github_metadata": {
"branch": "main",
"commit_count": 26,
"repo_created_at": "2023-01-12T05:09: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": "a78014bee1a... |
a849f20d-c607-434b-969d-a5f1719f2acf | max-galetskiy/traj-sim | TrajModels/EuclideanPoint3D.cpp | #include "EuclideanPoint3D.hpp"
#include <cmath>
/*
Converts GPS Coordinates to Cartesian coordinates (with 1 unit being 1km or 1m depending on the meters boolean)
*/
EuclideanPoint3D::EuclideanPoint3D(std::pair<float, float> longLat, bool meters) {
// Convert to radians
float longitude = (longLat.first ... | ALGO | 0.997921 | 6.80757 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2025-02-05T18:12: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": "da10e55e6d1b... |
ef17d744-ce89-42ae-8441-82b2462be256 | NgTienHungg/PTIT-Source | CodePTIT - DSA/DSA05023 - TỔNG CÁC XÂU CON.cpp | // https://code.ptit.edu.vn/student/question/DSA05023
// TỔNG CÁC XÂU CON
#include <bits/stdc++.h>
using namespace std;
// void TestCase() {
// string s; cin >> s;
// long long ans = 0;
// for (int i = 0; i < s.length(); ++i) {
// for (int j = i; j < s.length(); ++j) {
// string temp ... | ALGO | 0.999637 | 5.016152 | {
"github_metadata": {
"branch": "main",
"commit_count": 106,
"repo_created_at": "2021-07-04T02:14:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 130,
"forks": 36,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5696e4d... |
4aae73ad-cab7-476f-9834-d07a59df9623 | amartyads/uva-solutions | 00661 Blowing Fuses.cpp | #include <cstdio>
#include <cmath>
#include <cstring>
#include <cctype>
#include <iostream>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
#include <map>
#define iter(a,b,c,d) for(a = b; a < c; a+=d)
#define ited(a,b,c,d) for(a = b; a > c; a-=d)
#define seto(a,n,x) for(int bartho = 0; bartho <... | ALGO | 0.9997 | 3.390675 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2016-12-02T08:36:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8526e3606... |
da34d854-efad-4a46-877b-543d14b5d6ff | Lizhen0909/graph_clustering_toolkit | submodules/GANXiS/GANXiS-S_v1.0/LabelRank.cpp | /*
* LabelRank.cpp
*
* Created on: Nov 15, 2011
* Author: <NAME> (<EMAIL>)
*/
#include "LabelRank.h"
#include "CommonFuns.h"
#include "CommonFuns_TMP.h"
#include "rndNumbers.h"
#include "fileOpts.h"
#include <pthread.h>
#include <cmath>
typedef std::tr1::unordered_map<int, int> UOrderedH_INT_INT;
typedef... | ALGO | 0.998207 | 4.013408 | {
"github_metadata": {
"branch": "master",
"commit_count": 194,
"repo_created_at": "2020-05-10T23:27:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "bb4c7ae6... |
01660ba1-339c-4b12-842f-1f0ef95781b3 | NikiStoyanov/PolynomialCalculator | UserInterface.cpp | /**
*
* Solution to course project # 4
* Introduction to programming course
* Faculty of Mathematics and Informatics of Sofia University
* Winter Semester 2024/2025
*
* @author <NAME>
* @idnumber 2MI0600435
* @compiler VC
*
* Source: Methods that load the user interface.
*
*/
#include <iostream>
#include "PolynomialF... | TOOL | 0.941097 | 5.107194 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2025-01-08T06:53: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": "87760edab... |
deb7ed15-76fd-4132-a1fc-6310a042b689 | atig05/sorting | class all sort.cpp | #include<iostream>
#include<stdlib.h>
#define size 15
using namespace std;
void push(int a[],int n){
for(int i=0;i<n;i++)
cin>>a[i];
}
void swap(int *a,int *b){
int t=*a;
*a=*b;
*b=t;
}
class sorting{
public:
int arr[size];
int a[size];
int n;
void in(int ar[],int c){
for(int i=0;i<c;i++)
arr[i]=ar[i];
... | ALGO | 0.999781 | 3.866575 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2020-11-30T16:35: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": "96e81f477dcc... |
ac1ad971-d326-47ce-a0dd-1c85311bb123 | ergou10086/MyAlogrithmLearn | src/搜索/BFS/template/双向BFS/HDU3085_NightMare/Main.cpp | #include<cstdio>
#include<cstring>
#include<algorithm>
#include<queue>
#define x first
#define y second
using namespace std;
const int N=810;
int n,m;
char g[N][N]; //地图
int vis[N][N]; //2表示女孩走过,1表示男孩走过,0都没走过
pair<int,int> boy,girl,ghost[2]; //存储人、鬼的初始位置
int dx[4]={-1,0,1,0},dy[4]={0,1,0,-1}; //搜索的方向数组
bool check(in... | ALGO | 0.999796 | 3.531952 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2025-05-07T09:45: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": "196b53ef8977... |
539f6a92-1dae-410a-8ba6-53c3082f054f | shivgang/CSES-Solutions | Dynamic Programming/ElevatorRides.cpp | /*
ॐ त्र्यम्बकं यजामहे सुगन्धिं पुष्टिवर्धनम् |
उर्वारुकमिव बन्धनान्मृत्योर्मुक्षीय माऽमृतात् ||
*/
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define int long long int
#define lu long unsigned int32_t
#define F first
#define S ... | ALGO | 0.999995 | 3.661819 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2023-09-10T12:25: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": "4e30979857b4... |
e7305ea4-a8ae-49cf-b7be-c6fd08bc0c8b | diaojibo/PAT-Code | advanced level/1022/1022.cpp | #include<string>
#include<stdio.h>
#include<vector>
#include<iostream>
#include<algorithm>
using namespace std;
#define N 10001
struct book{
long long id;
string total_id;
string author;
string title;
vector<string> keywords;
string publisher;
string year;
};
int n,m;
vector<book> books;
vector<string> getv(cha... | ALGO | 0.998001 | 3.517377 | {
"github_metadata": {
"branch": "master",
"commit_count": 59,
"repo_created_at": "2016-08-06T13:29:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "01d51ae07... |
7e523a7b-f9e3-4bec-8956-4e26ca8e26e6 | LILIStrade/Radio-OneFM | gr-blocks/lib/vector_map_impl.cc | /* -*- c++ -*- */
/*
* Copyright 2012,2013 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
* SPDX-License-Identifier: GPL-3.0-or-later
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "vector_map_impl.h"
#include <gnuradio/io_signature.h>
#include <cstring>
namespace gr {
name... | TOOL | 0.921154 | 6.482486 | {
"github_metadata": {
"branch": "main",
"commit_count": 226,
"repo_created_at": "2024-02-19T19:24:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 13,
"pull_requests": 0
},
"file_meta": {
"content_id": "b999afb8e... |
89559178-c1d1-4433-b149-c974875fb2c0 | IEIAuto/AutoDRRT | src/autodrrt.core/ros2_opt/src/eProsima/Fast-DDS/tools/fds/server.cpp | // Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima).
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless re... | WEB | 0.965032 | 6.609859 | {
"github_metadata": {
"branch": "main",
"commit_count": 26,
"repo_created_at": "2023-08-11T02:20:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 23,
"forks": 14,
"issues": 1,
"pull_requests": 1
},
"file_meta": {
"content_id": "f3071daf5... |
2ca46b5f-f122-4953-bd8b-6583d5faf511 | wenet-e2e/wenet | runtime/core/decoder/context_graph.cc | // Copyright (c) 2021 Mobvoi Inc (<NAME>)
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or a... | ALGO | 0.996717 | 4.494155 | {
"github_metadata": {
"branch": "main",
"commit_count": 1594,
"repo_created_at": "2020-11-17T03:57:23.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 4688,
"forks": 1147,
"issues": 14,
"pull_requests": 18
},
"file_meta": {
"content_id": "46... |
b5c2382e-1355-463b-b8f0-a40505cc1441 | XBOOS/leetcode-solutions | binary_tree_maximum_path_sum.cpp | /*
* Given a binary tree, find the maximum path sum.
*
* For this problem, a path is defined as any sequence of nodes from some starting node to any node in the tree along the parent-child connections. The path does not need to go through the root.
*
* For example:
* Given the below binary tree,
*
* 1
*... | ALGO | 0.999998 | 6.242034 | {
"github_metadata": {
"branch": "master",
"commit_count": 298,
"repo_created_at": "2015-10-19T13:35: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": "ecdacfe5... |
26853606-e3a0-4668-8f2e-bfe698b71fa1 | matthewvierling/First-Programing-Class | Vierling_Section2_Lab10.cpp | // 3D Tic Tac Toe
// <NAME>
// 11/5/2015
// Lab #10
// Section 2
#include <iostream>
#include <string>
#include <cstdlib>
#include <ctime>
using namespace std;
class TTTBoard{//************************************************************************************ class
p... | ALGO | 0.990984 | 3.297625 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2017-02-18T18:46: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": "769d77787f... |
bfad5e59-003d-4108-a78e-98b5baf769d0 | JohnnyLee1809/DataStructure-Algorithm | DSA_DoublyLinkedList.cpp | /***
* Function name: DSA_DoublyLinkedList.cpp
* Purpose: Build a Doubly Linked List and test the funciton.
* Author: <NAME>
* Date: 2020.05.27
***/
#include <iostream>
#include <string>
using namespace std;
class DoubleLinkedList;
class ListNode{
private:
int data;
ListNode *prev;
Li... | ALGO | 0.977914 | 4.998637 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2021-04-11T07:23: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": "db5b008d1b26... |
c691a084-05ee-4283-86bc-36d410d36678 | UmairPhoenix/Parallel-Program-in-C- | brick_omp.cpp | #include <algorithm>
#include <iostream>
#include <omp.h>
using namespace std;
// Function to sort an array using brick sort
int brickSort(int arr[], int N)
{
// Calculate the number of threads to use
int num_threads = omp_get_max_threads();
// Determine the size of each "brick"
int brick_size = (N + num_threads -... | ALGO | 0.999997 | 5.820909 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-01-27T17:24: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": "9f5ae22453b2... |
198ac9ce-be97-49a0-9533-88c0ebe5e882 | alexandraback/datacollection | solutions_5670465267826688_0/C++/Sanya1/1.cpp | #include <bits/stdc++.h>
#include <unordered_map>
#include <initializer_list>
#include <memory>
#include <vector>
#define mp make_pair
#define pb push_back
#define lo int
#define li long long int
#define db double
#define sz(a) (lo)(a).size()
#define FOR(i, n) for(int i = 0; i < (n); i++)
#define all(a) (a).begin(), (... | ALGO | 0.999903 | 3.760471 | {
"github_metadata": {
"branch": "master",
"commit_count": 58,
"repo_created_at": "2017-03-08T11:33:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "75d491fc9... |
fbccaed1-06ec-4e75-a102-6c35c586ce55 | rennone/FDTD-Cpp | FDTDSimulator/StFDTD_TE.h | #ifndef _ST_FDTD_TE_
#define _ST_FDTD_TE_
#include "FDTD_TE.h"
class StFDTD_TE: public FDTD_TE{
typedef FDTD_TE super;
public:
StFDTD_TE();
~StFDTD_TE();
bool calc();
void field();
private:
void absorbing();
void cycle();
void CalcE(){
#ifdef _OPENMP
#pragma omp parallel
#endif
{
#ifdef _OPENMP
#pragm... | ALGO | 0.998141 | 3.653859 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2014-04-01T13:45:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f7b9763195... |
5d4c3a24-3770-492e-8f48-cdb29fde4a3a | ishandutta2007/codeforces-a | acrush/normal/226/D.cpp | #include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cst... | ALGO | 0.99992 | 3.052075 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-04-11T00:51:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8968c36e2e44... |
6f488d15-6370-48c5-b3ae-c122aa2b9a30 | lyt123/algorithm_learning | 算法题目/20树非递归遍历.cpp | #include<iostream>
#include<vector>
#include <stack>
using namespace std;
struct TreeNode {
int val;
struct TreeNode *left;
struct TreeNode *right;
TreeNode(int x = 0) :
val(x), left(NULL), right(NULL) {
}
};
TreeNode* CreateBinaryTreeNode(int value);
//{
// TreeNode* pNode = new TreeNode();
// pNode->val = v... | ALGO | 0.999984 | 4.786503 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2018-02-04T02:11: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": "13ca998a5... |
66bd5a5f-5d96-4611-bde4-822cb60dba17 | hdeplaen/masterthesis-src | frameworks/scale-mamba/SCALE-MAMBA-master/src/Math/Matrix.h | /*
Copyright (c) 2017, The University of Bristol, Senate House, Tyndall Avenue, Bristol, BS8 1TH, United Kingdom.
Copyright (c) 2018, COSIC-<NAME>, <NAME> 10, bus 2452, B-3001 Leuven-Heverlee, Belgium.
All rights reserved
*/
#ifndef _myHNF
#define _myHNF
#include <vector>
using namespace std;
#include "Math/bigint.... | ALGO | 0.996707 | 3.186164 | {
"github_metadata": {
"branch": "master",
"commit_count": 29,
"repo_created_at": "2018-11-26T14:02: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": "b547e0e9d... |
c4296920-f6a6-409b-bc38-3f789f5205ff | sophiepavia/stackSimulate | in2post.cpp | #include <iostream>
#include <sstream>
//#include <cctype>
#include <string>
#include "stack.h"
using namespace std;
using namespace cop4530;
string infix2Postfix(string s);
int precendance(char c);
bool isNumber(string num);
bool isOperand(string op);
char toChar(string s);
int evaluate(string s);
int main()
{
wh... | ALGO | 0.999137 | 4.362577 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-02-28T13:28: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": "e7f8be0cab70... |
fe64f409-7060-4b79-b249-814c3552e80e | char-1ee/coding-interview-chinese-2 | cpp/59_1_MaxInSlidingWindow.cc | // Q59_1: Maximum sliding window.
// Description: Given a array and the size of sliding window, find the maximum elements in
// every sliding window.
// Example: {2, 3, 4, 2, 6, 2, 5, 1} and k = 3, then there are 6 windows. For 6 windows, each
// window max element is {4, 4, 6, 6, 6, 5}.
#include <bits/stdc++.h>
using... | ALGO | 0.999915 | 6.467012 | {
"github_metadata": {
"branch": "main",
"commit_count": 98,
"repo_created_at": "2022-03-18T08:39: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": "22e541175f8... |
838cac76-c8d0-4f39-a43e-893cf0c5fa28 | IshaAgawal/GoogleCodeJam | 1.cpp | # include <iostream>
# include <vector>
# include <map>
# include <stack>
# include <queue>
# include <algorithm>
# define ll long long
# define pll pair < ll, ll >
# define fs first
# define se second
# define mp make_pair
# define pb push_back
# define rep(i, n) for( ll (i) = 0; (i) < (n); (i)++)
# define REP(i, n) ... | ALGO | 0.999909 | 3.475125 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2017-04-25T14:56: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": "5052f17816... |
ad32943f-4f8f-4e1e-9073-93d495a10e4a | aldolo69/ats_alternative_controller | alternative_controller.ino |
#include <avr/io.h>
#include <util/delay.h>
/*
al reset parte con tutto spento e posizione iniziale=0
ats si posiziona in automatico
pausa 10 secondi
nel loop
se c'e' forzatura non controlla posizioni
altrimenti controlla le 3 posizioni. 1=fv fisso 2=enel fisso 3=automatico
i posizione 3 control... | ALGO | 0.971394 | 4.548056 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2022-09-25T20:33: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": "3986376bb24... |
21d95e40-2088-4740-a7f8-54cf74ba29d2 | AkshatRauthan/Decode-DSA-2.0-With-Cpp | 02. Input And Operators/prdictTheBooleanOutputLvlMedium.cpp | #include<iostream>
using namespace std;
int main(){
// PART A
bool p = false, q = false, r = true;
cout<<"\nValue Of p==q==r is :-\n"<<(p==q==r);
// Solution Of p==q==r :-
// p is false and q is also false. {Left ==> Right}
// Therefore, p == q is true.
// Now both (p == q) and q == r a... | ALGO | 0.998566 | 3.519707 | {
"github_metadata": {
"branch": "main",
"commit_count": 45,
"repo_created_at": "2024-01-04T16:33:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e518dc435ef... |
a3dcb008-81da-4e35-9365-cd83b0d0364f | mrunaltarwatkar018/Coding_Ninjas_Introduction_To-C-and_Data_Structures_and_Algorithm | Milestone 1/H - Lecture 7 - Functions/1. Functions/1_What_are_functions.cpp | #include<iostream>
using namespace std;
/* Factorial */
// int main() {
// int n,r;
// cout << "Enter the value of n & r : ";
// cin >> n >> r;
// int fact_n = 1;
// int i = 1;
// while ( i <= n ) {
// fact_n = fact_n * i;
// i++;
// }
// int fact_r = 1;
// i = 1;
/... | ALGO | 0.998896 | 4.782001 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2024-06-18T14:56:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cb684e7bf8... |
5f71a063-c015-4b45-925d-7af0213469e2 | akshitkumar450/-cpp-codes | trees/binary tree to DLL.cpp | class Solution {
public:
void solve(Node*root,Node*&head,Node*&prev,int &first){
if(root==NULL){
return;
}
// do a inorder traversal
// left call
solve(root->left,head,prev,first);
// for first node in inorder traversal make it head
// make ... | ALGO | 0.99999 | 6.022086 | {
"github_metadata": {
"branch": "master",
"commit_count": 53,
"repo_created_at": "2021-05-30T15:50: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": "2b40428fa... |
e7798a8a-6a98-46fd-8ff1-21f6d715665b | hadleyhzy34/data_structure_and_algorithm | tree/src/270_closest_binary_search_tree_value.cpp | #include <iostream>
#include <vector>
#include <unordered_map>
#include <unordered_set>
#include <cstdlib>
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : v... | ALGO | 0.999992 | 5.82784 | {
"github_metadata": {
"branch": "master",
"commit_count": 117,
"repo_created_at": "2020-09-06T13:38:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bb2cf338... |
bacc8299-28c0-494b-9ad8-dc136394bcca | thcy/CSES-Solutions | Additional Problems/Book Shop II (1159)/catkl.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define trav(a, x) for(auto& a : x)
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
int main() {
cin.sync_with_stdio(0); cin.tie(0... | ALGO | 0.999883 | 4.297276 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2019-08-15T05:56:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 115,
"forks": 50,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
"content_id": "221ac9... |
e674f2b8-1140-47f3-9428-b93d1f038525 | chambs1/Christopher_Ambs_Portfolio | C++/Core Concepts/Passing_and_Returning_Pointers.cpp | /***************************************************************
* Pointer Manipulation and Safety Demo
*
* Purpose: Demonstrates proper pointer usage, parameter passing,
* and memory safety through a clock synchronization
* simulation.
*
* Technical Features:
* - Raw pointer manipulation
*... | ALGO | 0.968329 | 7.69151 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-05-27T00:07:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fc53ade68e24... |
bec0e42e-52dc-4912-ae1b-56dc9361eef9 | tlahoda/sorts | cpp/counting_sort.h | /**
* \file counting_sort.h, Contains a counting sort implementation.
*
* Copyright (C) 2011 <NAME>
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including wit... | ALGO | 0.99983 | 7.32591 | {
"github_metadata": {
"branch": "master",
"commit_count": 46,
"repo_created_at": "2011-09-14T21:29:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a4f3f3de8... |
ff488120-b8a6-49c6-9507-253dfe96c3f8 | theaveragewhite/2120-and-2121-Assignments | lab2/infixToPostfix.cpp | /*
* Name: <NAME> (coltono)
* Date Submitted: Submitted 9/18/2023
* Lab Section: 007
* Assignment Name: Lab 2
*/
#include <string>
#include <stack>
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
using namespace std;
//Converts an infix arithmetic expression into postfix
//The function takes 3 parame... | ALGO | 0.998869 | 4.596974 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2025-02-27T07:02: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": "ed7ac44824a4... |
af163890-7ccf-4343-bd98-6d0832da374a | gabriel88766/C-CPP-AlgorithmsAndContests | Codeforces/1607/E.cpp | #include <bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
const ll INF_LL = 0x3f3f3f3f3f3f3f3f, MOD = 998244353; //1e9+7
const int INF_INT = 0x3f3f3f3f;
const long double PI = acosl(-1.), EPS = 1e-9;
using namespace std;
//cout << fixed << setprecision(6)
int main(){
ios_base::sync_wi... | ALGO | 0.999985 | 3.65486 | {
"github_metadata": {
"branch": "master",
"commit_count": 436,
"repo_created_at": "2020-08-21T00:21: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": "82a83622... |
94f9e4db-3828-43ea-9139-0ab67a7145eb | skojaku/multiresolcp | include/km_multiresol.h | /*
This code defines and implements a class object, KM_multiresol class, which carries out the detection of core-periphery structure in unipartite networks.
*/
#include <omp.h>
#include <algorithm>
#include <cmath>
#include <fstream>
#include <iostream>
#include <numeric>
#include <random>
#include <vector>
#inclu... | ALGO | 0.998852 | 4.836155 | {
"github_metadata": {
"branch": "master",
"commit_count": 54,
"repo_created_at": "2018-08-07T06:45:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "1935b67ae... |
97ef6eaf-5e50-4cf8-b1aa-59f93bf7d623 | isdiscodead/2022_KUS | Spring/ComputationalThinking/ch1_fibo.cpp | #include <iostream>
using namespace std;
// fibonacco sequence
// input : n
// output : n번째 피보나치 수열
// 재귀호출 이용
int recursive_fibo(int n) {
if ( n < 2 ) {
return n;
} else {
return recursive_fibo(n-1) + recursive_fibo(n-2); // 전항 + 전전항 return
}
}
// fibonacco sequence
// input : n
// o... | ALGO | 0.999133 | 5.230885 | {
"github_metadata": {
"branch": "master",
"commit_count": 53,
"repo_created_at": "2022-03-11T05:53: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": "dca50dbe4... |
4fba3dce-d55b-47ff-aab3-2c18137b7009 | raincross7/code-similarity | codes/train_code/problem213/problem213_290.cpp | #include <bits/stdc++.h>
#define ll long long
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define rrep(i, n) for (int i = 1; i <= n; i++)
ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
ll lcm(ll a, ll b) { return (a * b) / gcd(a,b); }
using P = pair <int, int>;
template<class T>bool chmax(T &... | ALGO | 0.999781 | 3.499284 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-03-06T05:07:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a02ee25dce94... |
584f7331-b40e-43eb-b05c-40d7b7deddd8 | TanzimRusho/OLD-MATERIALS | Online_Judge/UVA_Solutions/11636 - Hello World cheat.cpp | #include<stdio.h>
unsigned int arr[10010];
void precalculate(){
register unsigned int n = 10001;
for(; n; --n){
if(n > 8192)
arr[n] = 14;
else if(n >= 4097)
arr[n] = 13;
else if(n >= 2049)
arr[n] = 12;
else if(n >= 1025)
arr[n] = 1... | ALGO | 0.999838 | 3.419207 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2021-08-11T20:01: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": "414ac195d3... |
3c3f66ab-410a-477b-a71f-f3b656b435b7 | Junwon/JyakuhaiEngine | Code/Engine/Core/Configuration.cpp | #include "Engine/Core/Configuration.hpp"
#include <map>
#include <string>
#include <algorithm>
#include <iostream>
#include <sstream>
#include "Engine/Core/FileUtils.hpp"
#include "Engine/Core/ErrorWarningAssert.hpp"
#include "Engine/Core/StringUtils.hpp"
#define UNUSED(x) (void)(x);
std::map< std::string, std::stri... | CONFIG | 0.939414 | 5.555563 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2018-01-26T03:59: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": "f24eeb013d... |
b09ef17a-2e9a-4074-8cce-b3f54cb33c7e | jkkjjj/ACM-Algorithm-Practices-Summer-2023 | code/P1024.cpp | #include<iostream>
using namespace std;
double a, b, c, d;
double cclt(double x) {
return a * x * x * x + b * x * x + c * x + d;
}
int main() {
int cnt = 0;
double x[4];
cin >> a >> b >> c >> d;
for (int i = -100; i <= 100; i++) {
double lf = i;
double rt = i + 1;
if (cclt(lf) == 0) {
if (x[cnt] != lf) ... | ALGO | 0.999853 | 3.065518 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-09-28T08:16:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3326bc910dfe... |
562eb5de-aa80-424a-ad40-ec71d34ed73f | cunbidun/competitive_programming | archive/Codeforces - Codeforces Round #190 (Div. 1)/C. Ciel the Commander/solution.cpp | #include <iostream>
#include <vector>
using namespace std;
const int MAXN = 1e5+1;
typedef vector<int> vi;
int n, root, nodeCount;
vector<vi> adj_list, centroidTree;
int numChild[MAXN], level[MAXN];
bool checked[MAXN];
void dfs(int u, int last){
nodeCount ++ ;
numChild[u] = 1;
for(int i = 0; i < adj_li... | ALGO | 0.999995 | 3.763936 | {
"github_metadata": {
"branch": "master",
"commit_count": 189,
"repo_created_at": "2020-07-14T13:10: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": "4cc0cf26... |
57261e4c-e8d0-4862-9724-05bc99a10953 | Yago030/QuarkAcacemi-DevVideoGames | item15problema3/item15problema3/Source.cpp | /*
Se tienen las notas del primer parcial de los alumnos de dos cursos, el curso A y el curso B, cada curso cuenta con 5 alumnos.
Realizar un programa que muestre el curso que obtuvo el mayor promedio general.
*/
#include<iostream>
using namespace std;
class NotasParciales {
private:
double cursoa [5];
double cur... | ALGO | 0.977795 | 4.361297 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2023-02-16T01:29:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6939ac155985... |
2a03e64f-4966-4141-8612-db91705e6cd1 | Negationist/Negationst-Codeforces | Codeforces Practice/D. Digital string maximization cf/main.cpp | #include <bits/stdc++.h>
#define int long long
#define pb push_back
#define ff first
#define ss second
#define pii pair<int,int>
#define vi vector<int>
#define vii vector<pair<int,int>>
using namespace std;
void solve(){
string s;
cin >> s;
int n = s.size();
string ans;
stack<pii> stck;
int cu... | ALGO | 0.999969 | 4.583689 | {
"github_metadata": {
"branch": "main",
"commit_count": 45,
"repo_created_at": "2025-02-18T19:54: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": "7d6c76ef215... |
5fc956d0-a40e-4a7f-9428-6791cd2f9c5b | nathanluiz33/MAC0323-EDII-EP2 | Tabelas_de_Simbolos/ARN.cpp | #include <bits/stdc++.h>
using namespace std;
mt19937 rng((int) chrono::steady_clock::now().time_since_epoch().count());
const int mod = 1e9 + 7;
#define dbg(x) cout << #x << " = " << x << "\n"
template<class Key, class Item>
class ARN{
private:
class Node{
public:
Node *esq, *dir, *pai;
... | ALGO | 0.999986 | 4.567636 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2022-05-19T13:44: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": "72b9fa9fbec0... |
41639c08-3947-4739-856b-ec36f5a07e8f | Aziz-Ru/Probelm-Solving | CF/852A.cpp | #include <bits/stdc++.h>
using namespace std;
#define TC int t; cin>>t;while(t--)
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define ll long long int
#define nl '\n'
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define ff first
#define ss second
#define sz(x) int(x.size())... | ALGO | 0.99964 | 3.942124 | {
"github_metadata": {
"branch": "main",
"commit_count": 139,
"repo_created_at": "2023-06-14T07:15: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": "23c35ebb33... |
bfe1db9c-eaa4-41f7-88ef-d2af16c56415 | timmyjose-experiments/competitive-programming | lc/coreprep/implementation/practice_iterations/patterns_iterations_3/pair_with_target_sum_hashtable.cpp | #include <algorithm>
#include <cmath>
#include <iostream>
#include <limits>
#include <list>
#include <queue>
#include <random>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
using namespace std;
int next_random(int low, int high) {
random_device rd;
mt19937 engine(rd());
u... | ALGO | 0.999738 | 4.497131 | {
"github_metadata": {
"branch": "master",
"commit_count": 181,
"repo_created_at": "2022-06-14T11:32:15.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "daa60b0a1... |
3b7df527-543e-42b4-a2a0-ff549445427a | RobertDeBiro/Cpp_Programs | Books_and_Courses/HackerRank/15.Lower_Bound-STL-With_find.cpp | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <iterator>
using namespace std;
int main() {
cout << "*****************************************************\n";
int n;
cin >> n;
vector<int> v;
int elem;
for(int i = 0; i < n; i++)
{
... | ALGO | 0.99994 | 3.992138 | {
"github_metadata": {
"branch": "master",
"commit_count": 137,
"repo_created_at": "2022-08-26T13:51: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": "80797957... |
1ead3862-da39-4742-ab51-4b427cf2b940 | mlk5436/Rosalind-Algorithms-and-DataStructures | TwoWayPartitions/TwoWayPartitions/TwoWayPartitions.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
void partition(int arr[], int low, int high);
void swap(int arr[], int num1, int num2);
int main() {
FILE *fp = fopen("input.txt", "r");
int num = 0;
int arr[100000];
if (fp == NULL) {
return -1;
}
fscanf(fp, "%d", &num);
for (int i = 1; i <= num; i++) {
f... | ALGO | 0.99999 | 4.571254 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2016-12-23T23:03:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e33131cbaa... |
b4a5f198-3997-49d2-9a37-d2eeed50d0a1 | jatinarora2702/Competitive-Coding | topic_practice/algo/dijkstra1.cpp | #include <bits/stdc++.h>
#define FF first
#define SS second
#define PB push_back
#define MP make_pair
#define N 1005
using namespace std;
typedef pair<int, int> pii;
const int INF = 1e9 + 7;
vector<pii> g[N];
priority_queue<pii, vector<pii>, greater<pii>> pq;
vector<int> d(N, INF);
int main() {
int n, m, x, y, z... | ALGO | 0.999985 | 3.941492 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2017-01-15T21:30:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "78b67eb21... |
5aa43fb3-4957-4c1c-b4bd-9a748050ca14 | pedrogarciafreitas/TUT-HDCA | source/predictdepth.cpp | #include "predictdepth.hh"
#include "warping.hh"
#include "medianfilter.hh"
#include "ppm.hh"
#include "inpainting.hh"
#include <ctime>
#include <vector>
void predictDepth(view* SAI, view *LF)
{
/* forward warp depth */
if (SAI->n_depth_references > 0) {
/* currently we forward warp the depth from the N (for HDCA... | ALGO | 0.995947 | 4.934803 | {
"github_metadata": {
"branch": "master",
"commit_count": 92,
"repo_created_at": "2018-08-02T13:00:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1f92d05e0... |
04ac8505-0f9e-4955-b8ec-81088baf2b3f | ishandutta2007/codeforces-i | i_love_tigersugar/normal/163/E.cpp | #include<cstdio>
#include<cstdlib>
#include<iostream>
#include<queue>
#include<string>
#include<vector>
#define FOR(i,a,b) for (int i=(a),_b=(b);i<=_b;i=i+1)
#define REP(i,n) for (int i=0,_n=(n);i<_n;i=i+1)
#define FORE(i,v) for (__typeof((v).begin()) i=(v).begin();i!=(v).end();i++)
using namespace std;
typedef long lo... | ALGO | 0.999323 | 3.788643 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T05:39: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": "19b92906e0e6... |
d737e54e-0232-4b8c-bef3-96237be77f57 | kn33hit/Coursework | GL_backup/202/LABS/lab9/List.cpp |
#include "List.h"
#include <iostream>
using namespace std;
Node::Node(int data)
: m_data(data)
{
next = NULL;
}
List::List()
: m_head(new Node(0))
{ /* No code */ }
List::List(const List &rhs)
: m_head(new Node(0))
{
// Assign RHS into this List
(*this) = rhs;
}
List::~List()
{
clear();
d... | ALGO | 0.974157 | 4.716654 | {
"github_metadata": {
"branch": "master",
"commit_count": 54,
"repo_created_at": "2016-12-18T23:45: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": "efa943dc3... |
ddd89267-d31f-4b70-88d6-9fd77367ecdf | YilingQiao/diffsim | arcsim/src/collisionutil.cpp | /*
Copyright ©2013 The Regents of the University of California
(Regents). All Rights Reserved. Permission to use, copy, modify, and
distribute this software and its documentation for educational,
research, and not-for-profit purposes, without fee and without a
signed licensing agreement, is hereby granted, pr... | ALGO | 0.996062 | 4.83112 | {
"github_metadata": {
"branch": "master",
"commit_count": 28,
"repo_created_at": "2020-06-03T00:47:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 178,
"forks": 13,
"issues": 2,
"pull_requests": 1
},
"file_meta": {
"content_id": "3844da... |
80672cc9-135f-4b1f-89e6-2101499ca49d | Rakshitpant22/Code_Kosh | TREES/BST/largest_Bst.cpp | //BRUTE FORCE -> O(n^2);
int height(Node *root){
if(!root)return 0;
int l= height(root->left);
int r= height(root->right);
return 1+l+r;
}
bool valid (Node *root,Node *mini,Node *maxi){
if(!root)return 1;
if(mini && mini->data>= root->data)return 0;
if(maxi && maxi-... | ALGO | 0.999985 | 5.38973 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2024-09-14T17:34:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "415fe2c0c45... |
38d0b7c1-c95a-46e8-b571-8efd160ce8a6 | TekuConcept/math4610 | modules/test/matrix_test.cpp | /**
* Created by TekuConcept on November 5, 2019
*/
#include <iostream>
#include <chrono>
#define V(x) std::cout << x << std::endl
#include "matrix.h"
#include "vector_ops.h"
std::ostream&
operator<<(
std::ostream& __os,
std::vector<double> __n)
{
__os << "[ ";
for (auto x : __n)
__os << ... | ALGO | 0.97641 | 5.615102 | {
"github_metadata": {
"branch": "master",
"commit_count": 41,
"repo_created_at": "2019-09-01T21:03: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": "d8c26d6be... |
547cc38e-7beb-4cdc-921a-f10852152c00 | T2hhbmEK/cp | P_1215_USACO_1_4_母亲的牛奶_Mother_s_Milk.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 25;
int a[3], x[3];
bool t[N][N][N], ans[N];
void p() {
for (int i = 0; i < 3; ++i) cout << x[i] << " ";
cout << "\n";
}
void dfs() {
if (t[x[0]][x[1]][x[2]]) {
return;
}
t[x[0]][x[1]][x[2]] = true;
if (x[0] == 0) {
ans[... | ALGO | 0.999906 | 3.250648 | {
"github_metadata": {
"branch": "main",
"commit_count": 100,
"repo_created_at": "2024-11-15T14:58: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": "82a0204863... |
5172bd84-6e73-4829-935e-e7720cac5b08 | Hephaestus14089/c- | Graphs/Prim.cpp | #include<iostream>
#include<list>
using namespace std;
int get_id(char c) { return ((int)c - 65); }
char get_char(int id) { return (char)(id + 65); }
class Connection {
public:
int dst;
int wgt;
Connection() {
dst = 0;
wgt = 0;
} // end of default cons... | ALGO | 0.999898 | 4.210021 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2021-05-30T17:18: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": "443661370... |
528bc800-6181-47dc-b8c4-1ccf53f552d5 | Sokolov-Vladisl/theory-probability | Labwork_for_K/Labwork_for_K/main.cpp | #include<iostream>
using namespace std;
int f1(int M,double p)
{
int res=0;
for (int i = 0; i < M; i++)
{
if (p >= (double)rand() / (RAND_MAX))
{
res++;
}
}
return res;
}
int main()
{
setlocale(LC_ALL, "Russian");
int M = -1;//Кол-во приборов которые испытывают на надёжность
double p = -1; /... | ALGO | 0.994373 | 3.688275 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-03-01T06:19: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": "e32f4e2685d2... |
379f24f4-16ff-4750-b474-9efc36047db8 | RomanPorshnev/parallel-algorithms | lab4/first_task/main.cpp | #include <iostream>
#include <thread>
#include <fstream>
#include <string>
#include <vector>
#include <sstream>
#include <cstdlib>
#include <algorithm>
#include <chrono>
using Matrix = std::vector<std::vector<int>>;
using Sizes = std::pair<std::pair<int, int>, std::pair<int, int>>;
Matrix GetMatrix(std::string filena... | ALGO | 0.991103 | 5.003583 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-03-04T16:04: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": "0b77127c894d... |
56a362d7-5dcc-4cbb-ab76-1fcdd7f54887 | milandetiankong/OJ | jobdu/1051-2.cxx | #include <stdio.h>
#include <stdint.h>
#include <algorithm>
using namespace std;
int n, m;
struct Edge{
int a, b, c;
bool operator<(const Edge & rhs) const {
return c < rhs.c;
}
}buf[1000006];
int p[10004];
int f(int x) {
if (p[x] == x) return x;
p[x] = f(p[x]);
return p[x];
}
int ... | ALGO | 0.999922 | 3.75237 | {
"github_metadata": {
"branch": "master",
"commit_count": 90,
"repo_created_at": "2013-12-26T09: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": "0f2eebebf... |
cc143d36-180d-4268-b6bb-4e692def6fe0 | ujunhwan/algorithms_cpp | ALGOSPOT/chapter-21/TRAVERSAL.cpp | #include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>
using namespace std;
void postOrder(const vector<int>&preorder, const vector<int>&inorder) {
if(preorder.empty()) return;
int n = preorder.size();
int root = preorder[0];
int left, right;
for(int i =... | ALGO | 0.999997 | 5.116161 | {
"github_metadata": {
"branch": "master",
"commit_count": 374,
"repo_created_at": "2020-02-26T12:18: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": "fb20b76a... |
0d617849-41a9-4f87-bb57-9c553672b0c7 | Shre-sg/COMP | DSA/DAILY/RAND/6_remove_kth_ele.cpp | #include <iostream>
#include <stack>
#include <string>
#include <algorithm>
using namespace std;
// 402. Remove K Digits
// Given string num representing a non-negative integer num, and an integer k, return the smallest
/// possible integer after removing k digits from num.
// Example 1:
// Input: num = "1432219",... | ALGO | 0.999974 | 6.694786 | {
"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": "38eab22843... |
73549836-f8a0-4980-9cc4-40b4b6f99c3d | cmuparlay/parlaylib | examples/helper/ligra_light.h | #include <parlay/delayed.h>
#include <parlay/primitives.h>
#include <parlay/parallel.h>
#include <parlay/range.h>
#include <parlay/internal/get_time.h>
namespace delayed = parlay::delayed;
// **************************************************************
// A lightweight implementation of the Ligra interface
// Suppo... | ALGO | 0.996778 | 7.10202 | {
"github_metadata": {
"branch": "master",
"commit_count": 221,
"repo_created_at": "2019-12-10T19:52:11.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 369,
"forks": 71,
"issues": 17,
"pull_requests": 3
},
"file_meta": {
"content_id": "95f4a... |
3e210ad4-6a32-4886-9965-395e21debf4a | ASSERT-KTH/Supersonic | predictions/submissions-aizu-cot-gpt35/Codenet/p01137/326699847/response_6.cpp | #include <iostream>
#include <cmath>
#include <algorithm>
using namespace std;
int main() {
int e;
while (cin >> e, e) {
int m = 1000000;
for (int z = 0; z <= 100; ++z) {
int val = z * z * z;
if (val > e)
continue;
int sqrt_e_val = sqrt(e - val);
for (int y = 0; y <=... | ALGO | 0.99995 | 3.844961 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2022-02-03T10:33:34.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fb1eaa607d21f... |
0d73128c-1a91-4d6d-a297-0da6e49c6cd4 | alapan-sau/CP-Library | mergesort.cpp | #include<bits/stdc++.h>
using namespace std;
void merge(int arr[], int l, int m, int r){
int l1 = m-l+1;
int l2 = r-m;
int L[l1];
int R[l2];
for(int i=l;i<=r;i++){
if(i<=m){
L[i-l] = arr[i];
}
else{
R[i-m-1] = arr[i];
}
}
int i=... | ALGO | 0.999994 | 5.03894 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2020-12-14T07:39: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": "997647048c53... |
7313b350-edb0-48b6-96e3-363ec62c3ebf | swapzism/my-coding-library | placement/heap/implementHeap.cpp | #include <bits/stdc++.h>
using namespace std;
class MinHeap
{
vector<int> a;
int capacity;
int sz;
public:
MinHeap(int cap)
{
a=vector<int> (cap);
capacity=cap;
sz=0;
}
int parent(int i)
{
return (i-1)/2;
}
int left(int i)
{
re... | ALGO | 0.999796 | 3.867713 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2020-09-21T11: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": "653373c2bf... |
ab2f2bcb-1db7-4135-9711-4a7028319b99 | raincross7/code-similarity | codes/train_code/problem192/problem192_33.cpp | #include <iostream>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <vector>
#include <set>
#include <queue>
#include <map>
#include <string>
#define rep(i, a, b) for ( int i = (a); i < (b); i++ )
#define per(i, a, b) for ( int i = (b)-1; i >= (a); i--)
#define pb push_back
#define mp make_pair
#defi... | ALGO | 0.99975 | 4.118007 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-03-06T05:07:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "58c9b883f98f... |
0291793f-c154-45b0-8595-56584cea4326 | 100495769/COMP_ARCH_P1 | libraries/common/b_tree.cpp | //
// Created by sergio on 12/11/24.
//
#include "b_tree.hpp"
#include <cstdint>
#include <vector>
#include <memory>
#include <iostream>
//IMPORTANTE, CUANTO MAS A LA IZQUIERDA MAYOR ES EL NUMERO
auto b_tree::compare(std::uint8_t r_new, std::uint8_t g_new, std::uint8_t b_new, std::uint8_t r_old, std::uint8_t g_o... | ALGO | 0.994373 | 4.714205 | {
"github_metadata": {
"branch": "main",
"commit_count": 74,
"repo_created_at": "2024-10-06T19:58:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "73209041a32... |
45a2aa8d-03e2-47e5-957e-379289d11200 | EvanWen036/Competitive-Programming-Evn | C++ Workspace/USACO Problems/game1.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
int sum[5005][5005];
int memo[5005][5005];
int dp(int A[], int l, int r){
if(memo[l][r] == -1){
if(l == r){
memo[l][r] = A[l];
}
else{
memo[l][r] = max(A[l] + sum[l+1][r] -... | ALGO | 0.999985 | 3.86106 | {
"github_metadata": {
"branch": "main",
"commit_count": 29,
"repo_created_at": "2021-02-09T03:46: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": "55a9cde119a... |
2a17c327-f7fb-401a-8e28-5fdb84fb0bfe | pviafore/AdventOfCode2015 | challenges/challenge15.cpp | #include <iostream>
#include <tuple>
#include "input.h"
struct Ingredient{
int capacity;
int durability;
int flavor;
int texture;
int calories;
};
Ingredient toIngredient(const std::string& s){
auto split = input::split(s, ' ');
return Ingredient{std::stoi(split[2]), std::stoi(split[4]), ... | ALGO | 0.989411 | 5.13265 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2019-01-02T22:41:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1a588c094... |
b3930fb9-b175-41e8-bb48-e957021fb9e0 | cdit-ma/SEM | re/src/workers/opencl/utilities.cpp | #include "utilities.h"
#include <algorithm>
#include "logger.h"
#include "worker.h"
#include <fstream>
#include <functional>
#include <sstream>
namespace Re::OpenCL {
std::string OpenCLErrorName(int opencl_error_code)
{
static const std::vector<std::string> clErrorNames({"CL_SUCCESS",
... | TOOL | 0.938669 | 6.725359 | {
"github_metadata": {
"branch": "master",
"commit_count": 7732,
"repo_created_at": "2020-06-12T06:47:00.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 4,
"forks": 3,
"issues": 0,
"pull_requests": 8
},
"file_meta": {
"content_id": "67d12589... |
7cbc71ca-d5b0-43bc-815b-5917f89ec32a | zhsun/neu-cs5800 | graph/scc.cpp | #include <vector>
#include "graph/graph.h"
#include "graph/topological_sort.h"
#include "graph/scc.h"
using std::vector;
AdjacencyList Reverse(const AdjacencyList& graph) {
size_t n = graph.NumVertices();
AdjacencyList rg(n);
for (Vertex u = 0; u < n; ++u) {
for (const Neighbor& neighbor : graph.GetNeighbor... | ALGO | 0.999497 | 5.733231 | {
"github_metadata": {
"branch": "master",
"commit_count": 115,
"repo_created_at": "2014-10-13T04:28:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 10,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "781b05d... |
7bd88dc1-65bc-41ed-81ef-da2df1750d62 | orijoon98/Algorithm_Study | C++/baekjoon/줄어들지않아_2688.cpp | #include <bits/stdc++.h>
#define endl '\n'
#define MAX 65
#define ll long long
using namespace std;
int T;
ll DP[MAX][MAX]; // 오른쪽부터 i자리수가 j인 개수
void Input() {
cin >> T;
}
void Solution() {
for (int i = 0; i <= 9; i++) DP[1][i] = 1;
for (int i = 2; i <= 64; i++) {
for (int j = 0; j <= 9; j++) {
for (int k =... | ALGO | 0.999016 | 4.670354 | {
"github_metadata": {
"branch": "main",
"commit_count": 160,
"repo_created_at": "2021-03-16T14:25:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8389ee3a3f... |
fe8b8df1-9fd1-4d25-81ac-2196107573da | sadr0b0t/rraptor | test/circle-ark/circle.cc | #include<stdio.h>
#include<math.h>
int main() {
// радиус окружности, мм
double r = 10;
// скорость перемещения, мм/с
double f = 3;
// начнем движение из крайней правой точки против часовой стрелки
double x_0=r, y_0=0;
// шаг по x
double dx = 0.1;
// шаг по y
double dy = 0.... | ALGO | 0.99774 | 4.08896 | {
"github_metadata": {
"branch": "master",
"commit_count": 179,
"repo_created_at": "2013-03-30T18:08: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": "403db4ad... |
91f1e50c-ba3f-4b31-a320-271664dc1dbf | ArorAnam/LeetCode-Solutions | Word_Search_II_Better.cpp | class Solution {
public:
struct Node{
Node* child[26];
int count;
Node(): count(0){memset(child, 0, sizeof(child));}
};
typedef pair<int, int> Grid;
Grid directions[4] = {
{1, 0}, {0, 1}, {-1, 0}, {0, -1}
};
void buildTree(Node* root, vector<string>& words){
... | ALGO | 0.999967 | 6.356607 | {
"github_metadata": {
"branch": "master",
"commit_count": 30,
"repo_created_at": "2020-06-21T12:52: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": "84bb39fe8... |
24dc9b56-d552-4177-86b1-0bed26ec53ec | Sartazz7/CSES-Problem-Set | Graph/PlanetsAndKingdoms.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
void dfs(vector<int> v[], int k, int vis[], int m){
vis[k]=m;
for(int i=0; i<v[k].size(); i++){
if(vis[v[k][i]]==0){
dfs(v,v[k][i],vis,m);
}
}
}
void dfs2(vector<int> v[], int k, int vis[], stack<int> &s){
... | ALGO | 0.999996 | 3.975028 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2022-06-25T13:52: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": "354b80f5eb... |
3392e0dc-364d-4aa6-921c-155f3f537ad6 | tcbrindle/NanoRange | include/nanorange/algorithm/binary_search.hpp | // nanorange/algorithm/binary_search.hpp
//
// Copyright (c) 2018 <NAME> (<EMAIL>)
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef NANORANGE_ALGORITHM_BINARY_SEARCH_HPP_INCLUDED
#define NANORANGE_ALGORITHM_... | ALGO | 0.999946 | 7.280863 | {
"github_metadata": {
"branch": "master",
"commit_count": 772,
"repo_created_at": "2017-10-09T17:40:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 364,
"forks": 28,
"issues": 10,
"pull_requests": 8
},
"file_meta": {
"content_id": "7cd6... |
144d8569-f1d7-4211-9920-6035577e4d27 | RicoJia/Leetcode | actual_test/hacker_rank_practice_1/solution.h | #include <iostream>
#include <vector>
#include <map>
#include <string>
#include <algorithm>
#include <set>
#include <cassert>
#include <iostream>
using namespace std;
struct Node{
Node* next;
Node* prev;
int value;
int key;
Node(Node* p, Node* n, int k, int val):prev(p),next(n),key(k),value(val){};
... | ALGO | 0.999401 | 5.056203 | {
"github_metadata": {
"branch": "master",
"commit_count": 62,
"repo_created_at": "2020-06-23T19:32:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "75d4e7f14... |
d5091052-66d7-4186-9300-632f6ae51d8e | abhi061201/GFG-LEETCODE-CODINGNINJA-SOLUTION | Day 50/Minimum Path Sum GFG.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 maximumPath(int n, vector<vector<int>> mt)
{
// code here
vector<vector<int>>dp(n+1, vector<int>(n+1, -1));
... | ALGO | 0.999867 | 5.610234 | {
"github_metadata": {
"branch": "main",
"commit_count": 1328,
"repo_created_at": "2022-01-11T12:52:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b0f77d646... |
dd24c211-5498-49ee-8cd9-a2f19c21640a | VanishRan/leetcode | RanLeetCode/RanLeetCode/排序/215数组中的第k个最大元素.cpp | //
// 215数组中的第k个最大元素.cpp
// RanLeetCode
//
// Created by mahuanran on 2021/2/23.
// Copyright © 2021 mahuanran. All rights reserved.
//
#include "common.h"
class Solution {
public:
int findKthLargest(vector<int>& nums, int k) {
int len = nums.size();
quickSort(nums, 0, len-1, len-k);
r... | ALGO | 0.999873 | 5.622269 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2019-12-13T14:10:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5b4eacefa... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.