uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
24789efd-5f4d-4d6a-8ce3-bdc34f5ea549 | hyperfield/ai-file-sorter | app/lib/Utils.cpp | #include "Utils.hpp"
#include <cstring> // for memset
#include <filesystem>
#include <stdlib.h>
#include <string>
#include <glibmm/fileutils.h>
#ifdef _WIN32
#include <windows.h>
#include <wininet.h>
#elif __linux__
#include <dlfcn.h>
#include <limits.h>
#include <unistd.h>
#elif __APPLE__
#inc... | TOOL | 0.994919 | 6.494209 |
24eab94f-f31e-4dfb-91d6-2630070cba40 | ElMaestruli28/Introduccion-c- | Expresiones y Operadores/Ejercicio raiz cuadrada y potenciacion.cpp | #include<iostream>
#include<math.h>
using namespace std;
int main (){
float x,y,resultado=0;
cout<<"digite el valor de x: "; cin>>x;
cout<<"Digite el valor de y: "; cin>>y;
resultado= (sqrt(x))/(pow(y,2)-1);
cout<<"\nEl resultado es: "<<resultado<<endl;
return 0;
} | ALGO | 0.997004 | 3.458321 |
0826cedf-4762-4e6c-9905-32d6f64daf2d | imnooy/algorithm | BOJ/Backtracking/Backtracking/[9663번] N-Queen.cpp | #include <bits/stdc++.h>
using namespace std;
bool isused1[40];
bool isused2[40];
bool isused3[40];
int cnt = 0;
int n;
void func(int cur) { //cur° ġ
if (cur == n) { //n µ
cnt++;
return;
}
for (int i = 0; i < n; i++) {
if (isused1[i] || isused2[i + cur] || isused3[cur - i + n - 1]) continue;
isused1[... | ALGO | 0.999944 | 4.069035 |
5df4871f-1b57-4ef2-8fec-d894d89bff94 | kweonminsung/BOJ | 16953/main.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll a, b;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cin >> a >> b;
queue<pair<ll, ll>> Q;
Q.push({a, 1});
while (!Q.empty()) {
auto cur = Q.front();
Q.pop();
if (cur.first == b) {
cout << cur.second;
re... | ALGO | 0.999908 | 4.069909 |
a6be6ba9-75b9-41ee-b63e-5950775c4b6a | 7ANJ0I2407/Competitive-Coding-Codeforces | D_Static_Range_Queries.cpp | #include <bits/stdc++.h>
#include<iostream>
#include<vector>
#include<algorithm>
#include<set>
#include<map>
using namespace std;
typedef long long ll;
ll difference_array[400005], prefix_sums[400005];
int widths[400005];
vector<int> indices;
pair<int, int> queries[100005];
pair<pair<int, int>, int> updates[100005];
... | ALGO | 0.999859 | 4.695493 |
b4cc542a-aa56-465d-90dc-268a6b44c162 | qian3567510/LearnCpp | cpp_code/cmake_test/src/tutorial.cpp | // mkdir build
// cd build
// cmake -G "Ninja Multi-Config" -DUSE_MYMATH=ON ..
//OR cmake -G "Ninja Multi-Config" -DUSE_MYMATH=OFF ..
// cmake --build .
#include <cmath>
// #include <cstdlib>
#include <iostream>
#include <string>
#include "TutorialConfig.h"
//#include "MathFunctions.h"
#ifdef USE_MYMATH
#include ... | TOOL | 0.907778 | 3.239432 |
0e7771cc-1ccb-42c5-8b80-4073330562ae | Niloy-Pramanik/DSA_2 | Recursion/binary_search.cpp | // #include<bits/stdc++.h>
// using namespace std;
// int Binary_Search(int arr[],int low,int high,int mid,int key){
// while(low<=high){
// int mid = (low+high)/2;
// if(arr[mid] == key){
// return mid;
// }
// if(arr[mid]<key){
// low = mid+1;
// }
// if(arr[mid]>key){
//... | ALGO | 0.999827 | 5.75688 |
9b9143b2-f088-4c54-a01a-b7607cb33f56 | novassdsu/VideoCallVoIP | VideoCallVoIP/submodules/externals/opencore-amr/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/src/int_lsf.cpp | /*
------------------------------------------------------------------------------
Filename: int_lsf.cpp
------------------------------------------------------------------------------
*/
/*----------------------------------------------------------------------------
; INCLUDES
----------------------------------------... | ALGO | 0.980133 | 5.459167 |
86385586-d548-4ce7-9aa7-91203c11c16e | DevAryanSin/Sandbox | strings/breakandcontinue.cpp | #include <iostream>
using namespace std;
// Break = break out f a loop
// continue = skip current iteration
// only break = tab 13 tak jaake ruk jayega
// only continue = 13 ko skip karega
int main(){
for (int i = 1; i <= 20 ; i ++){
if(i == 13){
continue;
}
cout << i << '\n';
}
return 0;
}
| TOOL | 0.961317 | 3.11154 |
7f1e1d24-f974-4bc3-bbc3-5b6818867c66 | Jiheyy/study | 14501re.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <cstring>
using namespace std;
int n, answer;
int t[30];
int p[30];
int cache[30];
int DP(int i) {
if(i > n) {
return 0;
}
if(cache[i] != -1)
return cache[i];
if(i+t[i] <= n+1)
cache[i] = DP(i+t[i])+p[i];
cache[i] = max(cache[i], DP(... | ALGO | 0.999921 | 3.115208 |
36d3a2bc-dc92-466c-8429-0ce50ded33fb | tynnp/CP-Practice | UPCODER/MINIGAME37.1-EXPONENT2.cpp | #include <bits/stdc++.h>
using namespace std;
#define int int64_t
void binary(int n) {
cout << "NO ";
stack<int> s;
while (n) {
s.push(n % 2);
n /= 2;
}
while (!s.empty()) {
cout << s.top();
s.pop();
}
cout << endl;
}
void power(int n) {
... | ALGO | 0.999317 | 5.132503 |
b42001fd-9343-41db-a9b8-dd82b3aec6c6 | highruned/node-flash | lib/base/image_filters.cpp | // image_filters.cpp -- Original code by Dale Schumacher, public domain 1991
// See _Graphics Gems III_ "General Filtered Image Rescaling", Dale A. Schumacher
// Modifications by Thatcher Ulrich <<EMAIL>> 2002
// This source code has been donated to the Public Domain. Do
// whatever you want with it.
// A series o... | TOOL | 0.895718 | 5.809802 |
86415323-766e-4cf8-abd5-f0325504e611 | DreamingCats/Solutions_of_Algorithm_Notes | 第10章 图算法专题/10.6 拓扑排序/拓扑排序.cpp | #include <bits/stdc++.h>
using namespace std;
const int maxn=100;
vector<int> G[maxn];
vector<int> topoOrder;
int inDegree[maxn]; //
int n,m;
void topoSort(){
int num=0;
priority_queue<int, vector<int>, greater<int> > q;
for(int i=0;i<n;i++){
if(inDegree[i]==0){
q.push(i); //Ϊ0Ķ
}
}
while(!q.empty()){
... | ALGO | 0.999989 | 4.934842 |
9b14dbbd-af03-4d8f-b0a0-c61552b4c188 | rares-gh-pisoi/pbinfo | Clasa 10/meditatie/teme/13.10.2024/genmat20/genmat20/main.cpp | #include <iostream>
using namespace std;
int a[16][16];
int main()
{
int n;
cin>>n;
for(int i=1;i<=n;i++){
a[i][n-i+1]=n;
}
for(int i=1;i<n;i++){
for(int j=1;j<n-i+1;j++){
a[i][j]=i+j-1;
}
}
for(int i=2;i<=n;i++){
int nr=1;
for(int j=n+2-i... | ALGO | 0.99986 | 3.119214 |
a1ea97ab-f879-4988-a24b-7822384c7387 | ShimuGuyue/AlgorithmPractice-Codes | AtCoder/题库/ABC405A.cpp | /*-----------------------------------head-----------------------------------*/
#pragma region template
/*
/$$$$$$\ $$\ $$\ $$\ $$$$$$\ $$$$$$\ $$$$$$\
$$ __$$\ $$ | \$$\ $$ |$$ __$$\ \_$$ _|$$ __$$\
$$ / $$ |$$ | \$$\ $$ / $$ / \__| $$ | $$ / $$ |
$$$$$$$$ |$$ | \$$$$ / \$$$$$$\ $$ | ... | ALGO | 0.99961 | 3.559849 |
10df60bd-a1d4-40de-97f2-103710f64c54 | aniketyd/leetcode_solution | 1046-max-consecutive-ones-iii/max-consecutive-ones-iii.cpp | class Solution {
public:
int longestOnes(vector<int>& nums, int k) {
int n=nums.size();
int j=0;
int ans=0,cnt=0;
for(int i=0;i<n;i++){
while((nums[i]==1&&cnt>k)||(nums[i]==0&&cnt>=k)){
if(nums[j]==0) cnt--;j++;
}
if(nums[i]==0)
... | ALGO | 0.999985 | 5.988911 |
e5c44e8b-58c9-4193-816a-7a9e42c01150 | Ankitkumar2205/DSA-sheet-Fraz | Arrays/majorityElement.cpp | #include<iostream>
#include<vector>
#include<unordered_map>
using namespace std;
int findMajorityElement(vector<int> nums){
unordered_map<int,int> mp;
int n=nums.size();
int numb;
for(int i:nums){
mp[i]+=1;
if(mp[i]>n/2){
numb = i;
return i;
}
}
... | ALGO | 0.999707 | 4.981863 |
1f2876e6-7a6a-47ad-aee4-e63324c06003 | Githubiswhat/LeetCode | C++/src/Solution101_200/Solution121.cpp | //
// Created by windows on 2023/3/1.
//
#include "Solution121.h"
#include <functional>
#include <iostream>
#include <vector>
#include <unordered_set>
#include <unordered_map>
#include <string>
using namespace std;
int Solution121::maxProfit(vector<int> &prices) {
int maxProfit = 0;
int maxValue = 0;
for ... | ALGO | 0.997484 | 6.105613 |
b19b721d-9d7a-46b0-87f0-d9212d73cfd4 | ashish4122/CodeX_Online-Judge-System | backend/compiler/codes/e1e68fa2-7d8d-499d-8800-b5b7ce54fb2c.cpp | #include <iostream>
using namespace std;
int main() {
int num1, num2, sum;
cin >> num1 >> num2;
sum = num1 + num2;
cout << "The sum of the two numbers is: " << sum;
return 0;
} | TOOL | 0.990469 | 5.347076 |
447438a6-20fc-4d87-8c93-7d30a438fb28 | gauri-singh/LeetCodeQuestions | 0252-meeting-rooms/0252-meeting-rooms.cpp | class Solution {
public:
bool canAttendMeetings(vector<vector<int>>& intervals) {
if(intervals.empty()){
return true;
}
sort(intervals.begin(),intervals.end()); // sorting by the start value
int lastEnd=intervals[0][1];// end time for the last meeting
for(int i=1;... | ALGO | 0.999998 | 6.26534 |
c33917a9-1c6f-4c6b-a496-cf420fd5b8c0 | johnjohnlin/leetcode | binary-search-tree-iterator.cpp | #include "template_tree.h"
#include <stack>
#include <string>
#include <algorithm>
#include <utility>
#include <vector>
#include <cassert>
#include <cstdio>
using namespace std;
class BSTIterator {
stack<TreeNode*> st;
void LeftMost(TreeNode *cur) {
while (cur != nullptr) {
st.push(cur);
cur = cur->left;
}... | ALGO | 0.999911 | 4.893073 |
803c6a64-4ff6-4114-954c-c677195c3590 | Kawser-nerd/CLCDSA | Source Codes/CodeJamData/17/42/15.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
#include <assert.h>
#ifdef LOCAL
#define eprintf(...) fprintf(stderr,__VA_ARGS__)
#else
#define eprintf(...)
#endif
#define TIMESTAMP(x) eprintf("["#x"] Time : %.3lf s.\n", clock()*1.0/CLOCKS_PER_SEC)
#define TIMESTAMPf(x, ...) eprintf("[" ... | ALGO | 0.999911 | 3.658875 |
f5ea7213-efcf-4ce7-9f67-bae4c92ad2ad | ishandutta2007/codeforces | heno239/normal/1515/A.cpp | #pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<bitset>
#include<stack>... | ALGO | 0.999989 | 3.554954 |
b62d7dd3-7582-46fe-bf3a-4c59ad3fcbad | pgh08/DSA | String/PermutaionOfString.cpp | // Given the string find its all the permutation.
// Recursive Solution : Time Complexity : O(n*n!), Space Complexity : O(R-L).
#include<iostream>
#include<vector>
using namespace std;
void getPermutations(string s, int index, int n, vector<string> &ans){
// Base Case.
if(index >= n){
ans.push_back(s);... | ALGO | 0.999931 | 5.283079 |
98fbec8a-7864-4d5d-9b2d-5f7aecca8a82 | ImNuam/study-in-army | 이코테/다이나믹 프로그래밍/외발 뛰기(종만북)/외발 뛰기.cpp | #include <iostream>
#include <vector>
using namespace std;
/*
bool jump(int y, int x){ //재귀 알고리즘(메모이제이션을 안 쓴 버전)
//기저 사례 1. 게임판을 벗어난 경우
if(y>=n|| x>=n) return false;
//기저 사례 2. 마지막 칸에 도착한 경우
if(y==n-1 && x==n-1) return true;
int jumpSize=board[x][y];
return jump(y+jumpSize, x) || jump(y, x+jumpS... | ALGO | 0.999957 | 4.172873 |
cd834057-96ab-41aa-9e7a-fcdf0680071b | renbaoshuo/OI-codes | Luogu/P5082/P5082.cpp | #include <bits/stdc++.h>
using namespace std;
long long n, a[10000005], b[10000005], c[10000005], a1, b1, c1;
int main() {
cin >> n;
for (int i = 0; i < n; i++) {
cin >> a[i];
a1 += a[i];
}
for (int i = 0; i < n; i++) {
cin >> b[i];
c[i] = a[i] - b[i];
b1 += b[... | ALGO | 0.999736 | 3.67664 |
77084468-efff-415e-8009-e29a73eeb056 | ShubhamAnkush2000/Lb | program188.cpp | #include<iostream>
using namespace std;
class Arithematic
{
public :
int Addition(int iValue1,int iValue2)
{
int iAdd = 0;
iAdd = iValue1 + iValue2;
return iAdd;
}
};
int main()
{
int iNo1 = 0, iNo2 = 0 , iAns = 0;
cout<<"Enter first number : \n";
cin>>iNo1;
cout<<"Enter second numb... | ALGO | 0.961661 | 4.284673 |
f00ee4e9-0fa3-4033-a3e1-b33fff986c73 | renu-singhh/SummerPep-DSA-Question- | 00_Day4/WordSearch.cpp | #include <bits/stdc++.h>
using namespace std;
bool ispresent(vector<vector<char>> &board, string &word, int i, int j, int index)
{
if (index == word.length())
return true;
// checking the boundaries of the grid
if (i < 0 || i >= board.size() || j < 0 || j >= board[0].size() || board[i][j] != word[i... | ALGO | 0.999739 | 5.87126 |
11bd9657-b442-41d3-b3d6-5f85a9b6e292 | raincross7/code-similarity | codes/train_code/problem368/problem368_143.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
ll a,b,k;
cin>>a>>b>>k;
if(k<=a)
cout<<a-k<<" "<<b;
else if(k<=a+b)
cout<<"0 "<<b-(k-a);
else
cout<<"0 0";
return 0;
} | ALGO | 0.999977 | 3.657519 |
bba7a8e2-b2f2-4bcc-a70a-375671d58463 | yash2411-cmd/placement_prep | stacks/questions/simplify_path.cpp | #include <bits/stdc++.h>
using namespace std;
// Initialize an empty stack to keep track of directories.
// Split the input path by '/' to get individual components.
// Iterate over the components:
// If the component is an empty string or '.', skip it.
// If the component is '..', pop the top directory from the stack ... | ALGO | 0.999808 | 6.573847 |
15282442-0f93-4585-9f56-29f68be7a92d | alexOarga/PSConcurrentesDistribuidos16 | practica1/ejercicio_4.cpp | //*****************************************************************
// File: practica_1_V2.cpp
// Author: PSCD-Unizar
// Date: septiembre 2016
// Coms: Parte del práctica 1 de PSCD
// Compilar mediante
// g++ -std=c++11 -pthread practica_1_V2.cpp -o practica_1_V2
//******************************... | TOOL | 0.949115 | 3.561347 |
2702fdfb-e967-426c-a893-89963c0475f0 | bantasica/Competitive-programming | template/bitloop.cpp | #include <iostream>
#include <vector>
using namespace std;
int main() {
int n = 3;
// {0, 1, ..., n-1} の部分集合の全探索
for (int bit = 0; bit < (1<<n); ++bit) {
vector<int> S;
for (int i = 0; i < n; ++i) {
if (bit & (1<<i)) { // 列挙に i が含まれるか
S.push_back(i);
... | ALGO | 0.99443 | 4.643491 |
ca30e327-e2ad-4211-88b7-9ebcb8cb229a | jacob-debruyn/Cpp_Mazer_Generator_Solver | aldousbrodergenerator.cpp | #include "aldousbrodergenerator.h"
std::unique_ptr<Grid> AldousBroderGenerator::generateMaze()
{
int counter=1;
std::unique_ptr<Grid> grid(new Grid(height, width));
//Grid *grid = new Grid(height, width);
Cell *cur, *next;
// Generate seed for algorithm pathtaking.
//std::mt19937 seed = seedGenerator(... | ALGO | 0.99186 | 4.119571 |
e1fb08a5-3138-44b2-9875-1ebe62f28ca0 | rctzeng/AlgorithmDataStructuresPractice | CodeJam/2015_R1B/A.cpp | #include <stdio.h>
#define min(x,y) (x)<(y)?(x):(y)
#define MAX 1000001
int dp[MAX];
long long int rev(long long int n);
int dig(long long int n);
int main() {
// store answer in array
for(int i=1;i<MAX;i++) dp[i]=i;
for(int i=1;i<MAX;i++) {
if(dig(rev(i)) == dig(i) && rev(i)<MAX) dp[i] = min(d... | ALGO | 0.999671 | 4.45702 |
05a68738-3e31-48aa-bf7d-efa6fb4ee8b1 | TurboROM-Legacy/frameworks_av | media/libstagefright/codecs/m4v_h263/dec/src/datapart_decode.cpp | #include "mp4dec_lib.h"
#include "vlc_decode.h"
#include "bitstream.h"
#include "scaling.h"
#include "mbtype_mode.h"
#include "idct.h"
#define OSCL_DISABLE_WARNING_CONDITIONAL_IS_CONSTANT
/* ======================================================================== */
/* Function : DecodeFrameDataPartMode() ... | ALGO | 0.939184 | 5.393804 |
53ea8977-72eb-4035-86fd-ba9a2a5378f6 | SnehaGouda697/leetcode-DSA- | 20-valid-parentheses/valid-parentheses.cpp | class Solution {
public:
bool isValid(string s) {
stack<char> st;
for (int i = 0; i < s.length(); i++) {
char ch = s[i];
// If opening bracket, push to stack
if (ch == '(' || ch == '{' || ch == '[') {
st.push(ch);
} else {
... | ALGO | 0.999324 | 6.658418 |
38a41ee7-6b20-41e8-8a97-a1820d35a763 | teamsalta/sm64nx | src/engine/surface_collision.cpp | #include <ultra64.h>
#include "sm64.h"
#include "game/level_update.h"
#include "game/debug.h"
#include "game/camera.h"
#include "game/mario.h"
#include "behavior_script.h"
#include "surface_collision.h"
#include "surface_load.h"
#include "game/object_list_processor.h"
#include "game/room.h"
/*************************... | ALGO | 0.993216 | 3.960323 |
0fc2ea0d-273a-4925-a1c2-5ae801ea4650 | Somang-Kang/Prob_solving | week4_hardline.cpp | #include <iostream>
using namespace std;
class Line{
public:
int x1,x2,y1,y2;
};
int main(){
int testcase;
cin>>testcase;
while(testcase--){
Line L1;
Line L2;
for(int i = 0;i<2;i++) {
int x1,y1,x2,y2;
cin>>x1>>y1>>x2>>y2;
if(i==0){
... | ALGO | 0.999763 | 3.794225 |
da87234b-2a83-40e7-a852-923d6ad89a38 | cristiellesreis/cpp-estruturas-de-dados | estrutura de dados/testes/operadores-mat.cpp | #include <iostream>
#include <math.h>
using namespace std;
int main(){
int a=5, b=2;
int soma = a+b;
cout << "Soma: " << soma << endl;
//cout << "Soma: " << a+b << endl;
int sub = a-b;
cout << "Subtracao: " << sub << endl;
int mult= a*b;
cout << "Multiplicacao: " << mult << endl... | ALGO | 0.891837 | 3.057963 |
6fc4e4b2-4b3e-4ee6-8a7d-afea9268b1fe | JulyBelost/algo | hackerrank/Interview_Preparation_Kit/warm-up/Sock_Merchant.cpp | // https://www.hackerrank.com/challenges/sock-merchant/problem
#include <vector>
#include <iostream>
#include <unordered_set>
using namespace std;
vector<string> split_string(string);
// Complete the sockMerchant function below.
int sockMerchant(int n, vector<int> ar) {
unordered_set<int> left;
int cnt = 0;
... | ALGO | 0.999975 | 5.361185 |
183a20be-9930-4165-af5b-f7aeb209c277 | ishandutta2007/codeforces | yuma_/normal/1204/D2.cpp | #include "bits/stdc++.h"
#include<vector>
#include<iostream>
#include<queue>
#include<algorithm>
#include<map>
#include<set>
#include<iomanip>
#include<assert.h>
#include<unordered_map>
#include<unordered_set>
#include<string>
#include<stack>
#include<complex>
#pragma warning(disable:4996)
using namespace std;
using ld... | ALGO | 0.999986 | 3.809235 |
caf38b94-7a3b-4e29-9932-361e22b350f0 | phess110/RNG | period.cpp | #include <iostream>
#include <vector>
#include <cmath>
using namespace std;
/*
Given a function f: {0,...,m-1} -> {0,...,m-1}, and a seed X_0,
Let X_i = f(X_(i-1)) for i >= 1.
This function computes the smallest µ,p such that X_0,...,X_(µ+p-1) are distinct, but X_(n+p) = X_n for n >= µ.
That is, f is p-periodic sta... | ALGO | 0.999884 | 4.944557 |
105d4431-40b8-4dd4-97af-c3b1599162b2 | alexandraback/datacollection | solutions_1595491_0/C++/sunilrao/2.cpp | #include<iostream>
#include<stdio.h>
using namespace std;
int find_g(int n,int s,int p,int t[100])
{
int i,count=0,val,num;
for(i=0;i<n;i++)
{
if(t[i]<p)
{
continue;
}
val=t[i]/3;
if(t[i]%3==0)
{
if(val>=p)
count++;
else
{
if((val-p)>=-1&&(val-p)<=1&&(--s)>=0)
{
count... | ALGO | 0.999638 | 3.176348 |
ccde396d-c0ff-430c-971c-d7a3d7393eee | mhetrerajat/courses | fastai_course_v3/nbs/swift/SwiftCV/Sources/COpenCV/core.cpp | #include "include/core.h"
#include <string.h>
Mat Mat_New() { return new cv::Mat(); }
void Mat_Close(Mat m) { delete m; }
Mat Mat_NewWithSize(int rows, int cols, int type) { return new cv::Mat(rows, cols, type, 0.0); }
Mat Mat_NewFromScalar(Scalar ar, int type) {
cv::Scalar c = cv::Scalar(ar.val1, ar.val2, ar.val... | TOOL | 0.896161 | 5.862789 |
c599bf38-2a42-4011-9f03-678d2c09b331 | arajshow/Contribution_Repo | Binary Tree Questions/Diameter_of_a_Binary_Tree.cpp | class Solution {
public:
// Function to return the diameter of a Binary Tree.
pair<int, int> diameterPair(Node* root)
{
if(root==NULL)
{
pair<int, int> p=make_pair(0,0);
return p;
}
pair<int, int> left=diameterPair(root->left);
pair... | ALGO | 0.999827 | 6.479625 |
3cc9ef15-2206-4233-b4c4-ea3cee09d0c6 | 0xSiddhant/CodeSnippet_Cplus | HashTable.cpp | #include <iostream>
using namespace std;
template<typename T>
class Node {
public:
string key;
T value;
Node<T> *next;
Node(string key, T value) {
this->key = key;
this->value = value;
next = NULL;
}
~Node() {
cout<<"Destory "<<key<<" ====="<<endl;
if (... | ALGO | 0.997427 | 5.043212 |
8dc6f5e5-22e5-4748-a067-0eb9f999e48c | frenkield/numerical_linear_algebra | projet/src/visualisation/visualisation_main.cpp | #include <iostream>
#include <json.hpp>
#include <vector>
#include <map>
#include <matrice_laplacien_csr.hpp>
#include <chargeur_matrice.hpp>
#include <sys/types.h>
#include <dirent.h>
#include <algorithm>
using namespace std;
const double TOLERANCE = 0.00000000001;
typedef vector<HistoristiqueResidu>::iterator Resid... | TOOL | 0.954602 | 3.767971 |
189c0391-61e2-47c4-a5c1-53f60d3014a7 | truongdcba/Algorithms-Samsung-and-PTIT | Lập trình cơ bản/Sắp xếp đổi chỗ trực tiếp.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >>n;
int arr[n];
for(int &x : arr) cin >>x;
for(int i=0;i<n-1;i++) {
cout <<"Buoc " <<i+1 <<": ";
for(int j=i+1;j<n;j++) {
if(arr[j]<arr[i]) swap(arr[i],arr[j]);
}
for(int k=0;k<n;k++... | ALGO | 0.999957 | 3.760134 |
989dbf00-4cdd-4415-a73c-c044139fb8f2 | ItsUtkarshhh/Arsh-Goyal-45-Days-DSA-Challenge | Day35/LRUCache.cpp | // Leetcode question number 146 :
#include <iostream>
#include <unordered_map>
#include <list>
using namespace std;
class LRUCache {
private:
int capacity;
list<int> lruList; // stores keys in order of usage
unordered_map<int, pair<int, list<int>::iterator>> cache; // key -> {value, iterator to key in l... | ALGO | 0.999627 | 7.058555 |
19f0d674-0086-435c-8284-8b64c18656d8 | Amit-S-Terdal/Leetcode_Practice | day_106.cpp | // 1550. Three Consecutive Odds
// Given an integer array arr, return true if there are three consecutive odd numbers in the array. Otherwise, return false.
// Example 1:
// Input: arr = [2,6,4,1]
// Output: false
// Explanation: There are no three consecutive odds.
// Example 2:
// Input: arr = [1,2,34,3,4,5,7,23,... | ALGO | 0.999886 | 6.004527 |
9043e590-2f6f-401c-89d0-a7d17f35a1bd | MasterIceZ/IMSO | Retired/Atcoder/332_F_RandomUpdateQuery.cpp | /*
* AUTHOR : Hydrolyzed~
* SCHOOL : RYW
* TASK : Random Update Query
* ALGO : Segment Tree, Lazy Propagation
* DATE : 11 Dec 2023
* */
#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.999864 | 5.251327 |
4f992163-5e72-4d97-9d81-f0f0f9626bdb | Kisna2512/Problem-Solving | Reducing_dishes.cpp | class Solution
{
public:
int maxSatisfaction(vector<int> &sat)
{
int n = sat.size();
sort(sat.begin(), sat.end(), greater<int>());
vector<int> sum = sat;
for (int i = 1; i < n; i++)
{
sum[i] = sum[i] + sum[i - 1];
}
int mx = 0, cur = 0;
... | ALGO | 0.99984 | 5.210046 |
21d231c2-1b38-41e7-947a-ce7c86c5704f | JeffTimoman/binusOnlineJudge | 00_onlineJudge/OLQ/3/ANSWERS/f.cpp | #include <stdio.h>
int main(){
for (int i = 0; i < 3; i++){
int a, b;
scanf("%d + %d =", &a, &b);
printf("%d\n", a + b);
}
return 0;
} | ALGO | 0.97901 | 3.671101 |
fbd06f93-739e-4151-8a4d-ab9109334027 | alexandraback/datacollection | solutions_2751486_0/C++/pat3ik/A.cpp | #include <iostream>
#include <fstream>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <ctime>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <set>
#include <stack>
#include <map>
#include <climits>
#include <cassert>
#define FOR(i,n) for(int i=0,_n=n... | ALGO | 0.99893 | 3.643644 |
21c2e9ab-5483-4315-b8a6-c612378afa86 | SAMOSAXX/DAA | Magnet.cpp | // Write Python3 code here
#include<bits/stdc++.h>
using namespace std;
bool checkConstraints(vector<vector<char>> &rules){
int M = 5;
int N = 6;
vector<int> top = { 1, -1, -1, 2, 1, -1 };
vector<int> bottom = {2, -1, -1, 2, -1, 3 };
vector<int> left = {2, 3, -1, -1, -1};
vector<int> right = {-1, -1, -1, 1, -1};
vect... | ALGO | 0.999888 | 5.358947 |
a891baf3-e6ca-40fa-8ea9-0a368274420a | semurr/ProjectsBook | BintoHex/BintoHex/Main.cpp | //hex/dec/bin converter
#include <iostream>
#include <string>
#include <stdio.h>
#include <math.h>
using namespace std;
//declaring functions
int binToDecConverter(int value);
string binToHexConverter(int value);
int main()
{
//variable
int binValue = 1000101010;
int decValue = 0; //hold the binary ... | ALGO | 0.988147 | 5.55037 |
63f1e613-3517-43f8-886a-e8ba004f3869 | deverfan44/Problem-Solving | Week_3/Day_4/D_line.cpp | #include <bits/stdc++.h>
#define ll long long int
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(NULL);
int t;
cin >> t;
while(t--)
{
int n;
cin >> n;
string s;
cin >> s;
vector<ll> dec;
ll total=0,minChan=0;
for(in... | ALGO | 0.999935 | 3.897289 |
c910baea-a6bb-484a-b3b4-0fe138d6189f | mollah2022/code | sum.cpp | //Bismillahir Rahmanir Rahim
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define FAST ios_base::sync_with_stdio(0); cin.tie(0);
#define tst int t; cin >> t; while(t--)
#define yes cout << "YES\n";
#define no cout << "NO\n";
int32_t main(){
FAST
tst{
... | ALGO | 0.99997 | 3.642804 |
eed0560e-d2e7-4246-b8fc-7cfa4e948dd4 | Deep-023/LeetCode-questions | Check for Balanced Tree - GFG/check-for-balanced-tree.cpp | //{ Driver Code Starts
//Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
// Tree Node
struct Node {
int data;
Node* left;
Node* right;
};
// Utility function to create a new Tree Node
Node* newNode(int val) {
Node* temp = new Node;
temp->data = val;
temp->left = NULL;
... | ALGO | 0.999894 | 6.88616 |
95d40a8a-cc12-4521-9128-1086a12249d4 | PriyanshuRj/Compititive | codechef/staters9/uchiha.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int t;
scanf("%d",&t);
for(int it =0;it<t;it++){
int a,b;
cin>>a>>b;
vector<pair<string,int>> vect;
int finalsum =0;
for(int i =0;i<a;i++){
string s;
int sumer = 0;
cin>>s;
... | ALGO | 0.999674 | 3.087001 |
ee75a0e5-1412-427f-8fba-1a4183136111 | Shintaro0105/Competitive-programming | atcoder/abc/240/ans_d.cpp | #include <iostream>
#include <vector>
#include <array>
#include <cmath>
#include <string>
#include <algorithm>
#include <functional>
#include <map>
#include <tuple>
#include <queue>
#include <bitset>
#include <deque>
#include <iomanip>
#define rep(i,n) for(int i = 0;i < (n);i++)
using namespace std;
using ll = long lon... | ALGO | 0.999866 | 3.722392 |
333f0ad0-23b1-4691-ab3d-ca54cf856d00 | VISHALBHARDWAJ123/companies_houses | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.9988 | 6.76073 |
3cdc1adf-c583-468f-8b1b-96b757f93feb | yidingjiang/cs184sp18_final | ext/nanogui/ext/eigen/doc/special_examples/Tutorial_sparse_example_details.cpp | #include <Eigen/Sparse>
#include <vector>
#include <QImage>
typedef Eigen::SparseMatrix<double> SpMat; // declares a column-major sparse matrix type of double
typedef Eigen::Triplet<double> T;
void insertCoefficient(int id, int i, int j, double w, std::vector<T>& coeffs,
Eigen::VectorXd& b, con... | ALGO | 0.998592 | 5.392571 |
e6e1319e-e3d8-4304-a7bc-15e5a10bc7d6 | Kashyap-Nirmal/Hackerrank-Solutions | Problem Solving/Algorithms/Implementation/MigratoryBirds.cpp | /*
https://www.hackerrank.com/challenges/migratory-birds/problem
020721
Done+ Solution
*/
#include <bits/stdc++.h>
using namespace std;
string ltrim(const string &);
string rtrim(const string &);
vector<string> split(const string &);
/*
* Complete the 'migratoryBirds' function below.
*
* The function is expect... | ALGO | 0.999909 | 5.451553 |
b14d27e2-0548-4350-8106-060256203649 | md-asif-shahriar/cpp-interview | Linked-List/linkedlist1.cpp | #include <bits/stdc++.h>
using namespace std;
class Node
{
public:
int data;
Node *next;
};
Node *push_end(Node *head, int new_data)
{
if (head == NULL)
{
Node *node = new Node();
node->data = new_data;
node->next = NULL;
head = node;
return head;
}
Node... | ALGO | 0.999633 | 4.907214 |
d02c1415-5cb9-4718-a641-6148844723d6 | ngthanhtrung23/ProjectEuler | P1XX/122.cpp | #include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a),_b=(b); i<=_b; i++)
#define FORD(i,a,b) for(int i=(a),_b=(b); i>=_b; i--)
#define REP(i,a) for(int i=0,_a=(a); i<_a; i++)
#define EACH(it,a) for(__typeof(a.begin()) it = a.begin(); it != a.end(); ++it)
#define DEBUG(x) { cout << #x << " = "; cout << (x) << end... | ALGO | 0.999783 | 3.473706 |
f16be3dd-48c3-4c1a-a58b-c0a422f249f9 | Ged0oo/AssiutUniversityTrainingNewcomers | Sheet #2 (Loops)/A - 1 to N.cpp | #include <iostream>
#include <math.h>
#include <cmath>
using namespace std;
int main()
{
int n;
cin >> n;
for (int i = 1; i <= n; i++) cout << i << endl;
return 0;
} | ALGO | 0.998358 | 3.489172 |
0c72975d-75e1-4cbb-aaa8-d6f1779b170c | thakordrvl/CF | 221A.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
if(n==1){
cout<<n;
return 0;
}
cout<<n<<" ";
for(int i=1;i<n;i++)
cout<<i<<" ";
return 0;
}
| ALGO | 0.998955 | 3.86808 |
21bcc52a-f1b8-4a1e-854e-aa1d1deb1c33 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_5989_18.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
char a[n][n];
int tot = 0;
for (int i = 0; i < n; i++) {
int ct = 0;
for (int j = 0; j < n; j++) {
cin >> a[i][j];
if (a[i][j] == 'C') ct++;
}
tot += ((ct * (ct - 1)) / 2);
}
for (int i = 0; i < n; i++)... | ALGO | 0.999749 | 3.790498 |
a338c429-8984-4f46-ad9a-ab83195fc0c3 | SachinUnityDev/outscalbasicunity | Chap1MA3GDev9/main.cpp | #include <iostream>
using namespace std;
int getCurrentBoxScore(char box){
int currentScore;
//if(box is red ) {
if(box == 'r') {
currentScore = 10;
}
//else if(box is blue){
else if(box == 'b') {
currentScore = 20;
}
else {
currentScore = 0;
}
cout<<currentScore<<... | ALGO | 0.966429 | 3.889459 |
a543efbe-b5e3-445b-868c-21efb6e4a727 | tungisdab/Algorithm | codeforces/wrong_subtraction.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double db;
//by KMA dil and man
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int n;
cin>>n;
int k;
cin>>k;
for(int i=0;i<k;i++){
if(n%10 == 0){
n = n/10;
... | ALGO | 0.999777 | 3.631031 |
6125675c-44ad-458b-8fb6-25be9faa148e | bdqnghi/bi-tbcnn | code/mergesort/cpp/3202.cpp | #include <boost/threadpool.hpp>
#include <boost/thread/mutex.hpp>
#include <boost/smart_ptr.hpp>
#include <iostream>
#include <sstream>
#include <algorithm>
using namespace std;
using namespace boost::threadpool;
//
// Helpers
boost::mutex m_io_monitor;
void print(string text)
{
boost::mutex::scoped_lock lock(m_io... | TOOL | 0.951714 | 5.227809 |
47ecf53e-d869-48dd-b15f-a49f214c73d4 | Stenardt-9002/CODECHEF-Datastructure-and-algo | List-question/Graph/26-bridge_graph-383.cpp |
#include <bits/stdc++.h>
using namespace std;
//disc : discovery time
// parent : parent bruh
// low : lowest time
void bridge_Util(int src , int &time , vector<bool> &viisted ,vector<int> &disc , vector<int> &low,vector<int> &parent , vector<int> adj1[],vector<pair<int,int>> &asn1 )
{
viisted[src] = true ;
... | ALGO | 0.999985 | 5.133905 |
844a0034-78bb-4c87-9642-27fc341cce04 | louis-bompart/8IAR125-01 | lib/boost_1_61_0/libs/geometry/doc/src/examples/algorithms/distance.cpp | // Boost.Geometry (aka GGL, Generic Geometry Library)
// QuickBook Example
//[distance
//` Shows calculation of distance of point to some other geometries
#include <iostream>
#include <list>
#include <boost/geometry.hpp>
#include <boost/geometry/geometries/linestring.hpp>
#include <boost/geometry/geometries/point_xy... | ALGO | 0.993963 | 5.687009 |
014148ab-ddfd-4713-be63-a4e0ebb0d431 | walkccc/LeetCode | solutions/918. Maximum Sum Circular Subarray/918.cpp | class Solution {
public:
int maxSubarraySumCircular(vector<int>& nums) {
int totalSum = 0;
int currMaxSum = 0;
int currMinSum = 0;
int maxSum = INT_MIN;
int minSum = INT_MAX;
for (const int num : nums) {
totalSum += num;
currMaxSum = max(currMaxSum + num, num);
currMinSum =... | ALGO | 0.999795 | 6.867491 |
dc2eac52-1911-4e2e-b1e1-3e521961ac7d | Bhavya333-web/Cpp | Questions/Q_LargestandSecondLargestArray.cpp | #include<iostream>
#include<climits>
using namespace std;
int main(){
int t;
cin>>t;
while(t--){
int n;
cin>>n;
int a[n];
for(int i=0;i<n;i++){
cin>>a[i];
}
int maxno = INT_MIN;
int secno = INT_MIN;
for(int i=0;i<n;i++){
... | ALGO | 0.999969 | 3.590378 |
1b7c5eb3-cc30-4a98-9e39-292c325b1242 | surajdarade/competitive-programming | MATHS/25_1266_B_dice_tower.cpp | #include<bits/stdc++.h>
#include<string.h>
#define cint int t; cin >> t;
#define ll long long int
#define br << endl;
#define no "NO"
#define yes "YES"
#define vecint vector<int>
#define vecll vector<long long int>
#define vecstring vector<string>
#define push push_back
#define decimal(n) cout<<fixed<<setprecision(n);
... | ALGO | 0.999929 | 4.28125 |
26855abb-bee7-40dc-9a6c-a8c82eaecfa8 | parkkrrr/cpp | DSA/binarySearch/kokoEatingBanana.cpp | #include <bits/stdc++.h>
using namespace std;
int calculateHour(vector<int>arr, int mid){
int result=0;
for(int i=0;i<arr.size();i++){
result+=(arr[i]+mid-1)/mid;
}
return result;
}
int koko(vector<int>arr, int hourly){
int low=1;
int high=*max_element(arr.begin(),arr.end());
int a... | ALGO | 0.999882 | 5.102182 |
80da7803-a03e-4e61-8a8e-33215159a9fe | HutakiHare/csie_itsa_work2 | itsa-5-arr-116.cpp | //到底有幾隻兔子? arr-116
#include<iostream>
using namespace std;
long long int Fib(int month){
if(month<2){
return 1;
}else{
long long int tmp1=0,tmp2=1,result;
for(int i=2;i<=month;i++){
result=tmp1+tmp2;
tmp1=tmp2;
tmp2=result;
}
return re... | ALGO | 0.999826 | 3.746469 |
8679e9cb-271e-4b41-bc9d-b519fa35dfaa | LIHPC-Computational-Geometry/qualif | src/qualif/Analyse.cpp | #include "IQualif.h"
#include "Qualif.h"
#include "Maille.h"
#include "Triangle.h"
#include "Quadrangle.h"
#include "Tetraedre.h"
#include "Pyramide.h"
#include "Prisme.h"
#include "Hexaedre.h"
//***************************************************************************
//
// FONCTIONS UTILISATE... | TOOL | 0.930312 | 3.899431 |
42e93075-c32a-4364-8cbd-54502eed9ba1 | akuendig/algolab | week_8_cgal/2_first_hit/first_hit/main.cpp | #include <CGAL/Exact_predicates_exact_constructions_kernel.h>
#include <iostream>
#include <vector>
#include <algorithm>
typedef CGAL::Exact_predicates_exact_constructions_kernel K;
using namespace std;
double floor_to_double(const K::FT& x)
{
double a = std::floor(CGAL::to_double(x));
while (a > x) a -= 1;
wh... | ALGO | 0.9997 | 4.546968 |
fe7c7a17-7225-42af-b404-79b560916ed4 | DerGoogler/liquid-wars | app/src/main/cpp/ode/demo/demo_hinge.cpp | #include <ode/ode.h>
#include <drawstuff/drawstuff.h>
#include "texturepath.h"
#ifdef _MSC_VER
#pragma warning(disable:4244 4305) // for VC++, no precision loss complaints
#endif
// select correct drawing functions
#ifdef dDOUBLE
#define dsDrawBox dsDrawBoxD
#endif
// some constants
#define SIDE (0.5f) // side leng... | ALGO | 0.956031 | 4.903493 |
c633e356-4405-43ba-b41e-f4328601afe4 | aayush4jha/Leetcode | 1890-sum-of-beauty-of-all-substrings/1890-sum-of-beauty-of-all-substrings.cpp | class Solution {
public:
int beautySum(string s) {
int ans=0;
int n=s.length();
for(int i=0;i<n;i++)
{
vector<int> freq(26,0);
for(int j=i;j<n;j++)
{
freq[s[j]-'a']++;
int mx=0, mn=INT_MAX;
for(int f:... | ALGO | 0.999979 | 5.788953 |
ff070599-60ef-45fc-a894-281ab8c790cb | masiljangajji/Algorithm | 프로그래머스/2/70129. 이진 변환 반복하기/이진 변환 반복하기.cpp | #include <string>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
string convert(int cnt){
string str="";
while(cnt){ // 4
str+=to_string(cnt%2);
cnt/=2;
}
reverse(str.begin(),str.end());
return str;
}
vector<int> solution(string s) {
vecto... | ALGO | 0.999929 | 3.970341 |
2d0dc82a-52e0-43e0-95ef-c60f4fa66bc8 | GalDagan90/github-upload | modern_cpp/src/threadpool.cpp | #include <algorithm>
#include "threadpool.hpp"
/***********************************************************************/
struct ThreadPool::PauseTask
{
PauseTask(ThreadPool& _threadpool) : m_pool{_threadpool} {}
void operator()()
{
std::unique_lock<std::mutex> lk(m_pool.m_mutex);
m_pool.m_... | TOOL | 0.881524 | 6.151355 |
e7e9c837-7712-4fd9-95ba-717f493c9ec8 | Ivkalipt/prog | cf/R1006D3/C.cpp | #pragma GCC optimize ("Ofast")
#include <bits/stdc++.h>
#define fastio cin.tie(0)->sync_with_stdio(0);
using namespace std;
using ll = long long;
using vll = vector<long long>;
using pll = pair<ll, ll>;
#define F first
#define S second
#define all(a) a.begin(), a.end()
ll inf = 1e9 + 7;
void solve() {
ll n, x... | ALGO | 0.999905 | 3.933598 |
5f98efe3-bc98-4291-84ef-4429fe55f3d4 | metashell/metashell | 3rd/templight/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp | #include "ValueEnumerator.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/Config/llvm-config.h"
#include "llvm/IR/Argument.h"
#include "llvm/IR/BasicBlock.h"
#include "llvm/IR/Constant.h"
#include "llvm/IR/DebugInfoMetadata.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/GlobalA... | TOOL | 0.95567 | 5.314767 |
f156e405-86a7-4901-bd04-9a0dc38c5421 | yogeshvishnole/cliondsalgo | cliondsalogo-2021/problem-solving/goldTransfer.cpp | #include<iostream>
#include<vector>
#include<utility>
using namespace std;
typedef pair<pair<int, int>, bool> pa;
class Node {
public:
int q;
int nodeGold;
int nodeGoldCost;
vector<Node *> children;
Node(int q, int nodeGold, int nodeGoldCost) :q{q}, nodeGold{nodeGold}, nodeGoldCost{nodeGoldCost} ... | ALGO | 0.997979 | 4.042828 |
187fb8ec-747c-4861-b1ac-784ec9f62969 | liu-mengyang/SEU-CPP-2021fall | lab8/ex4.cpp | #include <iostream>
using namespace std;
#define arraySize 100
bool paren_check(char* expr){
int left_count = 0;
int right_count = 0;
while(*expr != '\0'){
if (*expr == '(')
left_count++;
else if (*expr == ')')
right_count++;
expr++;
}
if (left_count ... | ALGO | 0.988334 | 4.210782 |
4e9728d8-e815-42d6-be95-501034bfd8a1 | hfukuoka/atcoder | abc/257/f.cpp | #include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
#define ll long long
#define rep(i, n) for (ll i = 0; i < n; ++i)
#define rep_up(i, a, n) for (ll i = a; i < n; ++i)
#define rep_down(i, a, n) for (ll i = a; i >= n; --i)
#define P pair<ll, ll>
#define all(v) v.begin(), v.en... | ALGO | 0.995172 | 3.454615 |
5375a81e-9bf8-4b2f-bcb2-731b99367613 | sanyamjain036/HacktoberFest2022 | LeetCode/C++/N_aryTreePreorderTraversal.cpp | /*
// Definition for a Node.
class Node {
public:
int val;
vector<Node*> children;
Node() {}
Node(int _val) {
val = _val;
}
Node(int _val, vector<Node*> _children) {
val = _val;
children = _children;
}
};
*/
class Solution {
public:
vector<int>ans;
vo... | ALGO | 0.999964 | 5.892351 |
02acefeb-3767-4092-bde7-29019903d037 | mlevim/lammps-nequip-test | src/BROWNIAN/fix_brownian.cpp | /* ----------------------------------------------------------------------
Originally modified from CG-DNA/fix_nve_dotc_langevin.cpp.
Contributing author: Sam Cameron (University of Bristol)
------------------------------------------------------------------------- */
#include "fix_brownian.h"
#include "atom.h"
... | ALGO | 0.998224 | 7.072191 |
b585b912-fcc1-4101-9ced-f746653dab94 | kennyfs/competitive-programming | ojdl/12pD.cpp | #include <iostream>
#define Hirasawa_Yui_My_Wife ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
using namespace std;
const int N=1000,INF=80000000;
int n,t,data[N+10],seg[4*N+10];
void build(int cur,int l,int r){
if(l>=r)return;
if(l+1==r){seg[cur]=data[l];return;}
int m=(l+r)>>1;
build(cur<<1 ,l,m);
build(cur<<... | ALGO | 0.999887 | 4.415858 |
a223ddc6-069c-43dc-8357-4e24d6742c84 | Xiro28/DesmumePSPExperimental | source/arm_jit.cpp | #include "types.h"
#include <unistd.h>
#include <stddef.h>
#include <stdint.h>
#include <vector>
#include "MMU.h"
#include "MMU_timing.h"
#include "bios.h"
#include "PSP/FrontEnd.h"
#include "blockdecoder.h"
#include "PSP/emit/psp_emit.h"
#include "mips_code_emiter.h"
#include "Disassembler.h"
#include <pspsuspe... | ALGO | 0.898308 | 4.231987 |
6a0c9726-86e3-4d77-920c-76314336afcd | mengziheng/Gpu-SubgraphIsomorphism | preprocess/Trust/sort.cpp |
int sum = 0;
for (int i = 0; i < vertex_count; i++)
{
beginFile.write((char *)&sum, sizeof(int));
sum += vertex[i].edge.size();
sort(vertex[i].edge.begin(), vertex[i].edge.end(), cmp3);
vector<int>::iterator upp = upper_bound(vertex[i].edge.begin(), vertex[i].edge.end(), k);... | ALGO | 0.994786 | 3.812598 |
a5a0d5a7-b850-48bb-8843-91c8b88de9fe | pent0/ka3d | source/lua/lua-5.0.2/src/lvm.cpp | #include <stdarg.h>
#include <stdlib.h>
#include <string.h>
/* needed only when `lua_number2str' uses `sprintf' */
#include <stdio.h>
#define lvm_c
#include "lua.h"
#include "ldebug.h"
#include "ldo.h"
#include "lfunc.h"
#include "lgc.h"
#include "lobject.h"
#include "lopcodes.h"
#include "lstate.h"
#include "lstri... | TOOL | 0.940399 | 6.695131 |
43e4e79a-eed0-4fd7-ab1a-8626f3db9806 | mdyasinahmed/daily-problem-solving | practice_problems/data_type_conditions/P_first_digit.cpp | #include<bits/stdc++.h>
using namespace std;
int main() {
long long n;
cin >> n;
while(n>=10){
n/=10;
}
if(n%2 == 0){
cout << "EVEN" << endl;
} else {
cout << "ODD" << endl;
}
return 0;
} | ALGO | 0.999874 | 4.493202 |
d53e5332-51e0-43b3-b19e-c4a168c3fe35 | wassimalharaki/Codeforces | 1700/LongLegs.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define nl '\n'
#define v vector
#ifdef WASSIM
#include "debug.h"
#else
#define dbg(...)
#endif
void solve() {
int a, b; cin >> a >> b;
if (a < b) swap(a, b);
auto get = [&](int i) {
return i - 1 + (a + i - 1) / i + (b + i - ... | ALGO | 0.999852 | 5.21439 |
ca9d45b0-0b64-471f-a8f4-13ca39cfaf69 | Yidadaa/Coding-Every-Day | 2019/acwing/102-best-cow-fences[POJ2018].cpp | #include <iostream>
using namespace std;
const int MAX = 1e5 + 1;
double a[MAX], b[MAX], s[MAX];
int main() {
int N, F;
cin >> N >> F;
double max_a = MAX, min_a = 0;
for (int i = 1; i <= N; i++) {
cin >> a[i];
max_a = max(max_a, a[i]);
min_a = min(min_a, a[i]);
}
double eps = 1e-5, l = ... | ALGO | 0.999983 | 3.972524 |
ecb61465-4bdb-489f-b2ae-dc9bd1d98998 | kangjianwei/Data-Structure | Dev-C++/CourseBook/0707_MinimumSpanningTree/MinimumSpanningTree.cpp | /*==================
* С
*
* 㷨: 7.9
==================*/
#include "MinimumSpanningTree.h"
/*
* ķ㷨õĸ飬
* ¼ӶӼUӼV-UĴСı
*/
static struct {
VertexType adjvex; // ӼUеĶ
VRType lowcost; // ӼV-UǰıߵȨֵ
} closedge[MAX_VERTEX_NUM]; //
/*
* 㷨7.9
*
* ķ㷨
*
* ӵuGСTTĸߡ
* 㷨ĺʱǶԶıеıأΪڱ߱Ƚϳܵ
*
* עԤͼȨֵ... | ALGO | 0.999964 | 3.762239 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.