uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
5d83d11d-6be0-4fa1-841c-2da191665aaf
himanshu-balasamanta/Journey
Platforms/Codeforces/679a.cpp
#include<bits/stdc++.h> using namespace std; #define ll long long #define all(v) v.begin(),v.end() #define vi vector<int> #define vll vector<ll> #define vvi vector<vi> #define deb(x) cout<<#x<<' '<<x<<' '; #define debarr(v) cout<<#v<<" : ";for(int i = 0;i != (int)v.size(); i++)cout<<i<<":"<<v[i]<<", ";cout<<'\n'; int...
ALGO
0.999925
3.549788
a6398ce5-e030-42f6-a885-4ba6c476ce1f
Maniac198/Competitve-Programming
C_Board_Moves.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; ll lcm(ll a,ll b) { return a/__gcd(a,b)*b; } #define endl '\n'; const int MOD = 1e9 + 7; void solve() { ll n; cin>>n; ll p = n/2; ll ans = 8*((p*(p+1))/2); ll ans2 = (((p-1)*p*(p+1))/3)*8; cout<<ans+ans2<<endl; } int main() {...
ALGO
0.99958
4.533444
fed297c1-a00e-4a8b-8db9-4c78e75dfabb
Dajtbaeva/PP1_2021
labz/lab5/j.cpp
#include <bits/stdc++.h> using namespace std; int main(){ string s; cin >> s; string t = s + s[0]; string k = t; reverse(k.begin(), k.end()); if(t == k) cout << "YES"; else cout << "NO"; }
ALGO
0.999981
3.601221
4ad35c28-7f98-49f2-adb5-a0937b8419df
windcry1/My-ACM-ICPC
CodeForces/1296 C.cpp
/************************************************************************* >>> Author: WindCry1 >>> Mail: <EMAIL> >>> Website: https://windcry1.com >>> Date: 12/30/2019 11:03:37 PM *************************************************************************/ //#pragma GCC optimize(3) //#pragma GCC diagnostic error "-std=c...
ALGO
0.999744
3.854417
61601f42-72fb-46d0-8dec-c8beff3541be
kamrulashraf/Vjudge-mixed-
CodeForces/282E/10475376_AC_686ms_81056kB.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long #define N 1000005 ll a[N], dp[N] , bdp[N]; struct node{ int mark; node *child[2]; node(){ mark = 0; for(int i = 0 ; i< 2 ; i++){ child[i] = NULL; } } } *root; void addTrie(ll n){ string s; for(int i = 0 ;...
ALGO
0.999975
4.254963
7a1e46cc-734f-47d3-bb49-f8a260d509eb
Ehiremen/literate-pancake
hackerrank/Algorithms/DataStructures/Arrays/SparseArrays/solution.cpp
//https://www.hackerrank.com/challenges/sparse-arrays #include <bits/stdc++.h> using namespace std; // function completed by me vector<int> matchingStrings(vector<string> strings, vector<string> queries) { vector<int> countMatches;//(queries.size()); int pos = 0; for(auto s: strings){ s.erase(re...
ALGO
0.999409
4.912253
a6746f1a-c563-499e-a286-980894f66033
Anshul407/LeetCode
1876-map-of-highest-peak/1876-map-of-highest-peak.cpp
class Solution { public: vector<vector<int>> highestPeak(vector<vector<int>>& isWater) { queue<pair<int,int>>q; for(int i=0;i<isWater.size();i++){ for(int j=0;j<isWater[0].size();j++){ if(isWater[i][j]==1){ isWater[i][j]=-1; q.push(...
ALGO
0.999986
5.935906
ff223182-15b7-48f7-9ed9-647f872e83eb
ryo97321/cpp-workspace
atcoder/past_questions/abc147B.cpp
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; int count = 0; for(int i=0; i<s.size()/2; i++) { if (s[i] != s[s.size()-i-1]) count++; } cout << count << endl; return 0; }
ALGO
0.999932
4.371833
64cb2992-23dc-455e-8e8b-97cf9719aa61
mrityunjay33/DSA
0237-delete-node-in-a-linked-list/0237-delete-node-in-a-linked-list.cpp
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ class Solution { public: void deleteNode(ListNode* node) { node->val = node->next->val; node->next = node->next->next; } };
ALGO
0.999741
5.647937
f2e4a54b-e4b9-431a-a337-ae07a77c690b
3nya/cs491-cap
2-24 MST/b.cpp
#pragma GCC optimize("O3,unroll-loops") #include <vector> #include <iostream> #include <queue> #include <algorithm> using namespace std; typedef long long ll; vector<int> parent; vector<int> level; ll const INF = 1e9; vector<vector<ll>> floyd_warshall(vector<vector<ll>> &arr, int n) { for (int k = 0; k < n; k++) {...
ALGO
0.999994
4.776145
5e3ff6bc-7fcd-4d6a-b74d-94734d85a50f
alexvelea/competitive
contests/hackerearthAugustEasy16/b.cpp
#include <algorithm> #include <iostream> #include <vector> using namespace std; typedef long long int64; const int inf = 0x3f3f3f3f, kMaxN = 1e5+5; vector<int> under[kMaxN], colors[kMaxN]; int color[kMaxN], result[kMaxN]; void df(int nod) { if (colors[color[nod]].size() == 0) { result[nod] = -1; } ...
ALGO
0.999996
4.284845
7f0fcfff-4efa-4f2b-ba83-394e14367633
zee-bit/FINAL450
Bit Manipulation/Square of number.cpp
#include <bits/stdc++.h> using namespace std; using namespace std::chrono; typedef long long ll; typedef long double ld; struct custom_hash; #define ff first #define I insert #define ss second #define maxN 300002 #define inf INT_MAX #define ninf INT_MIN #define pb push_back #define popb pop_back #define pf push_front #...
ALGO
0.999838
4.556966
ec479442-503c-4354-a394-339cce18aaac
SvenPegels/rp-mass-and-com
rp-mass-and-com-standalone/source/volume_estimation_ply.cpp
/** * Volume estimation from .obj files * * For code consistency: * - Visualizers as ::Ptr * - PointClouds/Meshes/etc as ::Ptr * - Single points not as ::Ptr. Passed as &reference to functions where necessary */ #include <pcl/features/moment_of_inertia_estimation.h> #include <pcl/point_types.h> #include <iostr...
TOOL
0.854845
6.401604
f581ba1b-3e06-4cec-ad9a-44da9a2e58bc
qinhx/C
17/dp3.cpp
#include <iostream> #include <vector> using namespace std; class Solution{ public: int FindTheBestSumOfSubArray(vector<int> array){ if(array.size()==0){ return 0; } int maxSum = INT_MIN; int sum = 0; for(int i=0;i<array.size();i++){ if(sum<0){ sum = array[i]; }else { sum += arra...
ALGO
0.999543
5.457219
7ee097ef-1fb6-49cf-ad81-82797ee0d912
Chirag-04/DSA-Practice-
2182-find-the-minimum-and-maximum-number-of-nodes-between-critical-points/find-the-minimum-and-maximum-number-of-nodes-between-critical-points.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: vector<int> nodesBetw...
ALGO
0.99999
4.936631
675cbd18-2a86-43ff-bc8d-7d74103dd0b3
leverimmy/Codes
比赛/学校/2019-11-6测试/data/matrix/make/matrix.cpp
#include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <algorithm> using namespace std; #define LY(p) freopen (p".in", "r", stdin); freopen (p".out", "w", stdout) #define LL long long #define dbl double #define lf long double #ifdef WIN32 #define L_L "%I64d" #else #define L_L "%lld" #endif ...
ALGO
0.999995
3.857672
08d5ce83-6022-4d39-aa58-d45fa41f780e
MadMike0204/MyCode
C++/szu oj/id35.cpp
#include<iostream> using namespace std; int main(){ int m,n,t,min,max; cin >> t; while(t>0) { min = 999; max = -999; cin >> m >> n; int** p = new int*[n]; for(int i=0;i<m;i++) { p[i] = new int[m]; } for(int i=0;i<m;i++) ...
ALGO
0.999498
3.453789
be58822d-2463-403a-bcd5-8826a9b3fa5c
ishandutta2007/codeforces
crying/normal/1606/B.cpp
#include<bits/stdc++.h> #define rep(i,a,b) for(int i=(a);i<=(b);i++) #define per(i,a,b) for(int i=(a);i>=(b);i--) #define op(x) ((x&1)?x+1:x-1) #define odd(x) (x&1) #define even(x) (!odd(x)) #define lc(x) (x<<1) #define rc(x) (lc(x)|1) #define lowbit(x) (x&-x) #define Max(a,b) (a>b?a:b) #define Min(a,b) (a<b?a:b) #defi...
ALGO
0.999626
3.963389
399e9a70-43e7-4041-9112-d07cb27bc262
AshaSatpathy08/SUPREME_2.0
Assingment2/patterns/classWork/invertedFullPyramid.cpp
#include <iostream> using namespace std; int main() { int n; cin >> n; for(int row = 0; row < n; row++){ //space for(int col = 0; col < row; col++){ cout << " "; } //star for(int col = 0; col < n-row; col++){ cout << "* "; } c...
ALGO
0.999969
4.139564
02923fb4-88a2-485e-b52c-ed7539e1570e
arafat-yasin-2413/PHITRON-B5
CP_Problems/abc382_a.cpp
#include <bits/stdc++.h> using namespace std; #define nl "\n" #define ll long long int // https://atcoder.jp/contests/abc382/tasks/abc382_a int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int n, d; cin >> n >> d; string s; cin >> s; int found_empty = 0; int cookie_found ...
ALGO
0.999213
4.211125
ef263c5a-e827-4560-83b5-1af39b890bfc
lintopher0315/CSES
problems/math/exponentiation.cpp
#include <bits/stdc++.h> using namespace std; const int m=1e9+7; int main() { int n, b; cin >> n; for (int i=0; i<n; ++i) { long long a; cin >> a >> b; long long ans=1; while (b) { if (b%2) ans=(ans*a)%m; a=(a*a)%m; b/=2; } ...
ALGO
0.999741
4.198466
ddf04eb0-1514-41ac-b805-c6c95e6f360a
justhusnan/CppDroid
tutorials/cplusplus.com#1.0#1/programstructure/overloadsandtemplates/templates/source5.cpp
// function template #include <iostream> using namespace std; template <class T> T sum (T a, T b) { T result; result = a + b; return result; } int main () { int i=5, j=6, k; double f=2.0, g=0.5, h; k=sum<int>(i,j); h=sum<double>(f,g); cout << k << '\n'; cout << h << '\n'; return 0; }
ALGO
0.99775
5.324547
5d589cbe-9f26-4515-bc3f-53bbd1d23a0a
pradeep891/LeetCode-and-Gfg-Practice
Break a number - GFG/break-a-number.cpp
//{ Driver Code Starts //Initial Template for C++ #include<bits/stdc++.h> using namespace std; // } Driver Code Ends //User function Template for C++ class Solution{ public: int waysToBreakNumber(int N){ // code here N // N += 1; long long n = 1 + N; long long mod = 1e9+7; ...
ALGO
0.999964
6.25372
197e7ab2-1867-4d30-afdf-56e4ae221cbf
Amorrrrrrrrr/algorithm
algorithm/二刷/栈和队列/480. 滑动窗口中位数.cpp
/* ʱƣȼУ */ class Solution { public: vector<double> medianSlidingWindow(vector<int>& nums, int k) { vector<double> result; for (int i = 0; i <= nums.size() - k; i++) { priority_queue<int, vector<int>, greater<int>> pri_que; for (int j = i; j < i + k; j++) { pr...
ALGO
0.999992
5.698144
f408a1cc-1666-4f87-bd1b-1eba24a1ac98
miiitomi/atcoder
mayocon/20240208/7.cpp
// https://atcoder.jp/contests/abc318/tasks/abc318_f #include <bits/stdc++.h> using namespace std; using ll = long long; void solve() { ll N; cin >> N; vector<ll> X(N), L(N), S; for (int i = 0; i < N; i++) cin >> X[i]; for (int i = 0; i < N; i++) cin >> L[i]; for (ll x : X) { for (ll l ...
ALGO
0.999932
4.608845
b980c1b1-21bf-4dd1-b014-938a16ac1723
gabriel-candeia/Competitive-Programming-Solutions
Codeforces/[GYM] - 2021 Shandong Provincial Collegiate Programming Contest/G.cpp
#include <bits/stdc++.h> #define ll long long using namespace std; int main(){ ll n, k; ll sum = 0; cin >> n >> k; for(int i=0;i<n;i++){ ll x; cin >> x; sum += x; } cout << sum/n << "."; sum = sum%n; int decimal = 0; sum = sum*10; while(de...
ALGO
0.999879
3.603366
7d6a011e-c9b4-4578-9cf6-d0ced0278865
mizanonik/DataStructure
Set3&4/problem_24.cpp
#include <iostream> using namespace std; int adjacencyMatrix[50][50]; void addEdge(int u, int v){ adjacencyMatrix[u][v] = 1; adjacencyMatrix[v][u] = 1; } int main(){ int vertices; cout << "Enter number of vertices: "; cin >> vertices; for(int i = 0; i<vertices; i++){ for(int j = 0;...
ALGO
0.999593
5.248109
ce60f8f8-96a4-4731-9c73-99a0321bec97
Prashantkumar210/Leetcode
2346-largest-3-same-digit-number-in-string/2346-largest-3-same-digit-number-in-string.cpp
class Solution { public: string largestGoodInteger(string num) { string ans = ""; for(int i=0; i<=num.size()-3; i++){ string temp = ""; int j = 0; while(num[i]==num[i+j] && j<3){ temp += num[i]; ++j; } ...
ALGO
0.999918
5.914562
2d356aae-9987-4416-a50b-fa7afcc3ac4b
jingtaozhang18/algorithm-exercises
code-interview/第1章 栈和队列/1-单调栈结构(进阶).cpp
#include<iostream> #include<stack> using namespace std; int mem[1000000]; int ans[1000000][2]; int N; void process(bool flag){ stack<int> sta; int i,index; index=flag?0:1; for(flag?i=0:i=N-1;flag?i<N:i>-1;flag?++i:--i){ while(!sta.empty()&&mem[sta.top()]>=mem[i]) sta.pop(); if(sta.empty(...
ALGO
0.99998
3.530577
ef2d551e-b559-469a-8dae-79fbea1fc1c2
gogiung/algorithm
14888 연산자 끼워넣기/소스.cpp
#include <iostream> #include <algorithm> using namespace std; const int MAX = 1000000000 + 1; int N; int number[12], Operator[4]; int maxResult = -MAX, minResult = MAX; void DFS(int plus, int minus, int multiply, int divide, int cnt, int sum) { if (cnt == N) { maxResult = max(maxResult, sum); ...
ALGO
0.999985
4.126602
101646cf-1fda-44d2-9500-972495aeea24
shrey265/leetcode-solutions
Isomorphic Strings.cpp
class Solution { public: bool isIsomorphic(string s, string t) { unordered_map<char,char> char_map; unordered_set<char> char_set; for(int i=0;i<s.length();i++){ if(char_map.count(s[i])==0){ if(char_set.count(t[i])==1) return false; ...
ALGO
0.999964
6.290394
3f1934be-d6a9-4ba7-bfe6-1712ab62e2ce
rwightman/boost
libs/fusion/example/performance/functional.cpp
#include <boost/fusion/container/list.hpp> #include <boost/fusion/container/vector.hpp> #include <boost/fusion/algorithm/iteration/fold.hpp> #include <boost/fusion/functional/adapter/unfused.hpp> #include <boost/fusion/functional/adapter/fused_function_object.hpp> #include <boost/functional/forward_adapter.hpp> #inclu...
TOOL
0.948765
7.219968
a4122fbd-f4d3-48eb-be62-87f5f2d2b14a
Bhavik-Ardeshna/COCO
DP/Longest common subsequence/Variation Problems/LIS.cpp
// Longest Repeating Subsequence // LRS = LCS(s,s) and i!=j // LPS = LCS ( string , reverse ( string ) ) // LIS = LCS(arr,sort(arr)) #include <bits/stdc++.h> using namespace std; #define forr(i, n) for (int i = 0; i < n; i++) #define forrr(i, n) for (int i = 1; i <= n; i++) #define rforr(i, n) for (int i = n; i >...
ALGO
0.999969
4.587443
6050b51e-9497-4c77-bf67-5f6ea217fb6c
liy010/c_coursera
primer/5/5.11.cpp
#include <iostream> #include <string> using namespace std; int main() { int aCnt = 0, eCnt = 0, iCnt = 0, oCnt = 0, uCnt = 0, nextLine = 0, t = 0, space = 0; string a; cin >> noskipws >> a; auto beg = a.begin(), end = a.end(); for (beg; beg != end && !isspace(*beg); ++beg) { if (tolower(*be...
ALGO
0.934974
3.452168
b461a87d-8913-4fba-8d9d-9e8b1af23217
oxygen-hunter/Flashboom
data/big-vul-100/add_attention_code/CodeLlama/top0-100/palindrome-partitioning-iii-Solution.palindromePartition/177741_DoS_Overflow.cpp
gnutls_session_get_data (gnutls_session_t session, void *session_data, size_t * session_data_size) { gnutls_datum_t psession; int ret; if (session->internals.resumable == RESUME_FALSE) return GNUTLS_E_INVALID_SESSION; psession.data = session_data; ret = _gnutls_session_pack (s...
ALGO
0.99884
3.444229
052afe29-c0a4-4b3e-9851-a5c94f219445
Calebisco/L.T.C.S
C++/subarray-with-elements-greater-than-varying-threshold.cpp
// Time: O(n) // Space: O(n) // mono stack class Solution { public: int validSubarraySize(vector<int>& nums, int threshold) { vector<int> stk = {-1}; for (int i = 0; i <= size(nums); ++i) { while (stk.back() != -1 && (i == size(nums) || nums[stk.back()] >= nums[i])) { i...
ALGO
0.999956
6.541214
f28f41b2-ddff-400c-8fe6-f750fc623740
INYerty/Cpp-learn-skills
test10-4.3/t2/t.cpp
#include <iostream> #include <cstring> using namespace std; class Tyear { private: int* year; public: Tyear(int y = 2000) { year = new int(y); } Tyear(const Tyear& other) { year = new int(*(other.year)); } Tyear& operator=(const Tyear& other) { if (this != &other) { ...
TOOL
0.915019
3.68785
dd5d51de-9477-48c4-a002-192d7fb4c298
DuyTran1234/1000ExerciseC-
Chuong 6 - Ma tran/Ky thuat dat linh canh/bai367.cpp
#include <iostream> using namespace std; void nhapMang(int a[][100], int &m, int &n); void xuatMang(int a[][100], int m, int n); int maxTrongMang(int a[][100], int m, int n); int main() { int mSize; int nSize; int nArray[100][100]; nhapMang(nArray,mSize,nSize); cout<<endl; xuatMang(nArray,mSize,nSize); cout<<max...
ALGO
0.996403
3.472836
5349ea99-c0fd-41c7-acd2-26db366c6197
dwip-nandi/CodeForces
A_I_Wanna_Be_the_Guy.cpp
#include<bits/stdc++.h> using namespace std; int main(){ int n; cin>>n; set<int>s; int p; cin>>p; vector<int>vp(p); for(int i=0;i<p;i++){ cin>>vp[i]; s.insert(vp[i]); } int q; cin>>q; vector<int>vq(q); for(int j=0;j<q;j++){ cin>>vq[j]; s.in...
ALGO
0.999711
3.434308
df735c31-325f-47c8-a067-afa50664753d
ebiederstadt/satellite-approximation
lib/cloud_shadow_detection/source/ProbabilityRefinement.cpp
#include "cloud_shadow_detection/ProbabilityRefinement.h" #define _USE_MATH_DEFINES #include <list> #include <map> #include <math.h> #include "cloud_shadow_detection/Functions.h" #include "cloud_shadow_detection/ImageOperations.h" namespace ImOp = ImageOperations; using namespace Functions; float __f__(float x, floa...
ALGO
0.998734
4.421126
b91fe5ec-e876-4dfc-8428-7ce9bca8378a
MansiMittal7/LeetCode_Questions
0217-contains-duplicate/0217-contains-duplicate.cpp
class Solution { public: bool containsDuplicate(vector<int>& nums) { // int c=0; map<int,int> mp; for(auto i:nums) mp[i]++; bool flag=false; for(auto i:mp){ if(i.second >= 2) return true; } return flag; } };
ALGO
0.999705
5.566232
a8106542-4b19-47b0-9ea2-f74bfeac046b
Ankit8607/TOP-CP-Contest-Problems
Happy Students.cpp
// https://leetcode.com/problems/happy-students/ class Solution { public: int countWays(vector<int>& nums){ sort(nums.begin(),nums.end()); int ans=0,n=nums.size(); if(nums[0]!=0) ans=1; for(int i=0;i<n;i++){ if(nums[i]<i+1 and (i+1==n || nums[i+1]>i+1)){ ...
ALGO
0.999974
5.578053
7385b472-30e7-43c9-8eb3-c84e349f6d9d
lacram/study
Programmers/brutuforce/2.cpp
#include <iostream> #include <vector> #include <cstring> #include <fstream> #include <algorithm> #include <cmath> #include <queue> #include <stack> #include <map> #define endl '\n' #define INF 2000000000 using namespace std; /* 1. 12345 2. 21232425 3. 3311224455 */ int first[5] = {1,2,3,4,5}; int second[8] = {2,1,...
ALGO
0.999933
3.931973
eac11aba-22dc-47cf-94e1-32cb1b9c763e
ishandutta2007/codeforces
zero4338/normal/1622/F.cpp
#include<bits/stdc++.h> typedef unsigned long long ull; using namespace std; mt19937_64 rnd((ull)(new int)); int read() { int ret=0;bool f=0;char c=getchar(); while(c>'9'||c<'0')f|=(c=='-'),c=getchar(); while(c>='0'&&c<='9')ret=(ret<<3)+(ret<<1)+(c^48),c=getchar(); return f?-ret:ret; } const int maxn=1e6+5; int n; ...
ALGO
0.999985
3.836277
4eaaf52e-9a7d-4dff-93b3-87b1630ab93e
Krmsh1n5/trashHunt
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.998756
6.772262
0321e3ed-f5ca-42ca-9522-1334159b41ea
surya3214/coding
SPOJ/ADATAXES.cpp
// AC Phew! Square Root Decomposition, sqrt(n) gives TLE; Manual merge sort also gives TLE. Weird! #include <bits/stdc++.h> #define BUFFER 5 #define BUFF(x) x + BUFFER #define N_MAX (int) (3 * 1e5) #define Q_MAX (int) (3 * 1e5) #define MOD 1000000007 #define BLOCKS_MAX 500 #define BLOCKS_SIZE 1000 using namespace std; ...
ALGO
0.999949
4.200953
40f0b718-bdeb-43be-98cc-5eb98d5efb37
vicebaraban/test-llvm-plugins
src/bb_modification_plugin.cpp
#include "llvm/Pass.h" #include "llvm/IR/Function.h" #include "llvm/IR/BasicBlock.h" #include "llvm/IR/Instruction.h" #include "llvm/IR/IRBuilder.h" #include <llvm-18/llvm/ADT/StringRef.h> #include <llvm-18/llvm/ADT/Twine.h> #include <llvm-18/llvm/IR/PassManager.h> #include "llvm/IR/LegacyPassManager.h" #include "llvm/...
TOOL
0.934769
7.713818
6e876251-4b26-4bd0-b281-08852910e593
VIPINRANGU/LeetCode
1108-defanging-an-ip-address/1108-defanging-an-ip-address.cpp
class Solution { public: string defangIPaddr(string address) { string s; for(auto i:address){ if(i=='.'){ s=s+"[.]"; } else{ s=s+i; } } return s; } };
ALGO
0.989213
6.026711
e7eb8c88-ac0c-46c0-b4ee-3af8bf07b433
Epikem/sport
solutions/jm/clocksync - refd.cpp
#include <sstream> #include<iostream> #include<algorithm> #include<vector> #include<set> #include<ctime> #include<cmath> #include<map> #include<stack> #include<random> #include<queue> #include<list> #include<math.h> #include<cstring> using namespace std; const long long int INF = 2000000000000000000; #define ll long lo...
ALGO
0.999676
4.75351
fc3c1e8b-6abc-441c-b915-931e583abbb1
sameer-19/Leetcode
76-minimum-window-substring/76-minimum-window-substring.cpp
class Solution { public: string minWindow(string s, string t) { int n=s.length(),m=t.length(); int i,j,ans=INT_MAX,lid=-1,rid=-1; map<char,int> a,b; for(i=0;i<m;i++) { a[t[i]]++; } int left=0,right=0; ...
ALGO
0.99999
6.512533
f082dc13-ef72-4b8d-a8eb-19b23fd1e44a
aniruddh-joshi/GeeksforGeeks
Difficulty: Medium/Smallest number/smallest-number.cpp
//{ Driver Code Starts #include <bits/stdc++.h> using namespace std; // } Driver Code Ends // User function Template for C++ class Solution { public: string smallestNumber(int s, int d) { // code here // Check if it's possible to create such a number if (s > 9 * d) return "-1"; ...
ALGO
0.999538
6.485193
fe93e75c-8d34-41f2-8eaa-a44d4ed78eda
JsKim4/BOJ-BaekJoon-Online-judge-
cpp/1000/1900/P1977.cpp
#include<iostream> #pragma warning (disable:4996) using namespace std; // 1977 완전제곱수 int arr[102]; int main(){ for (int i = 0; i < 102;i++) { arr[i] = i * i; } int a, b; cin >> a >> b; int i; for (i = 0; arr[i] <a; i++); int m = arr[i]; int sum = 0; for (; b >= arr[i];i++) { sum += arr[i]; } if (sum == 0...
ALGO
0.999891
3.854759
3d50fb70-ec6d-45c5-b2f9-24fa245f75e2
113bommy/deepmind_codecontests_refine
cpp_gold_filter_file/cpp_train_1173_1.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long int; const int MOD = 1e9 + 7; int mpow(int a, int n) { int r = 1; while (n) { if (n & 1) r = (1LL * r * a) % MOD; a = (1LL * a * a) % MOD; n >>= 1; } return r; } int main() { ios::sync_with_stdio(0); cin.tie(0); mt19937 rng(chr...
ALGO
0.99996
4.034964
3a129488-9c5d-4492-b530-b1beecaf8e03
Eagle233Fake/Eagle233-Algorithms
ProgrammerCarl/20250224-/Backtracking/131.cpp
class Solution { public: vector<vector<string>> v; vector<string> cur; bool isPalindrome(string &s, int i, int j) { for (; i <= j; i++, j--) { if (s[i] != s[j]) { return false; } } return true; ...
ALGO
0.999749
6.654028
229f08b9-c33b-4b33-965d-fbf2762090e5
ishandutta2007/codeforces
natsugiri/normal/1408/C.cpp
#pragma GCC optimize ("O3") #pragma GCC target ("sse4") #include<stdio.h> #include<iostream> #include<vector> #include<algorithm> #include<string> #include<string.h> #ifdef LOCAL #define eprintf(...) fprintf(stderr, __VA_ARGS__) #else #define NDEBUG #define eprintf(...) do {} while (0) #endif #include<cassert> using ...
ALGO
0.999756
3.339497
2386b9ae-fa23-4d04-bf0e-ee14d7397441
osirisQdt2810/algorithms
src/leetcode/cheatsheet/solution/1200-1299/1209.Remove All Adjacent Duplicates in String II/Solution.cpp
class Solution { public: string removeDuplicates(string s, int k) { vector<pair<char, int>> stk; for (char& c : s) { if (stk.size() && stk.back().first == c) { stk.back().second = (stk.back().second + 1) % k; if (stk.back().second == 0) { ...
ALGO
0.999995
6.522066
4e615240-f02f-403c-bc02-7f66e8150690
yashikota/contests
abc/336/a.cpp
#include <bits/stdc++.h> #define ll long long int main() { int n; std::cin >> n; std::cout << "L"; for (int i = 0; i < n; i++) { std::cout << "o"; } std::cout << "ng" << std::endl; return 0; }
ALGO
0.996314
3.291409
9269a7d0-bb43-4466-93ed-44f2eff1f062
anjali766/cpp
practice/makeeual.cpp
#include<bits/stdc++.h> using namespace std; int makeequal(int arr1[] ,int n1){ unordered_map<int,int> mp; int maxfreq =0; for(int i=0;i<n1;i++){ mp[arr1[i]]++; } for(auto x:mp){ if(x.second > maxfreq) maxfreq = x.second; } return n1 - maxfreq; } int main(){ int...
ALGO
0.999785
4.318387
fd905b7c-ff90-4ea9-b651-7aaf66749392
drankye/openjdk
hotspot/src/share/vm/gc_implementation/shared/gcUtil.cpp
#include "precompiled.hpp" #include "gc_implementation/shared/gcUtil.hpp" // Catch-all file for utility classes float AdaptiveWeightedAverage::compute_adaptive_average(float new_sample, float average) { // We smooth the samples by not using weight() directly u...
ALGO
0.950589
6.600198
3b60c3e8-d356-445e-ae37-1e5372ab1e09
ishandutta2007/codeforces
artyom123/normal/1358/D.cpp
#include<bits/stdc++.h> using namespace std; #define fi first #define se second #define all(x) (x).begin(), (x).end() #define pb emplace_back long long lol(long long x) {return (x + 1) * x / 2;} long long kek(long long a, long long b) {return (a + b) * (b - a + 1) / 2;} int main() { ios_base::sync_with_stdio(0)...
ALGO
0.999971
3.67018
baf1053d-d107-4882-96b2-4e939eb18c4d
Ritesh-Bommaraju/Practice
338-counting-bits/338-counting-bits.cpp
class Solution { public: vector<int> countBits(int num) { vector<int> ret(num+1, 0); for (int i = 1; i <= num; ++i) ret[i] = ret[i>>1] + (i&1); return ret; } };
ALGO
0.999986
5.955723
7f8530a3-49e0-4831-a4b2-52f4f6437f62
virusnaruto/sample
prims.cpp
#include <bits/stdc++.h> using namespace std; class Graph{ public: int v; vector<vector<vector<int>>>adj; Graph(){ cout<<"Enter the number of vertices :"; cin>>v; adj = vector<vector<vector<int>>>(v); while(true){ int u,v,w; cout<<"Enter vertex 1 ...
ALGO
0.998982
4.148601
b0c983b9-2c66-41f0-a74f-5749f4fda141
kkpan11/apple-llvm-project
libcxx/test/std/algorithms/alg.sorting/alg.sort/is.sorted/ranges.is_sorted_until.pass.cpp
// UNSUPPORTED: c++03, c++11, c++14, c++17 // <algorithm> // template<forward_iterator I, sentinel_for<I> S, class Proj = identity, // indirect_strict_weak_order<projected<I, Proj>> Comp = ranges::less> // constexpr I ranges::is_sorted_until(I first, S last, Comp comp = {}, Proj proj = {}); // template<for...
TEST
0.974397
7.846852
1b90f005-9941-4506-8572-3e80dd355cb1
ishandutta2007/codeforces
rama_pang/normal/1621/E.cpp
#include <bits/stdc++.h> using namespace std; using lint = long long; // #define int lint class SegTree { public: int sz; vector<int> tree; vector<int> lazy; SegTree(int sz) : sz(sz), tree(2 * sz), lazy(2 * sz) {} void Apply(int n, int x) { tree[n] += x; lazy[n] += x; } void Push(int n, int lc,...
ALGO
0.999972
4.060764
46b4870c-79fc-4f4c-be65-5b7d3cb48c1e
liongis/DaQin
BOSS/source/CombatSearch_BestResponse.cpp
#include "CombatSearch_BestResponse.h" using namespace BOSS; CombatSearch_BestResponse::CombatSearch_BestResponse(const CombatSearchParameters p) : _bestResponseData(p.getEnemyInitialState(), p.getEnemyBuildOrder()) { _params = p; BOSS_ASSERT(_params.getInitialState().getRace() != Races::None, "Combat se...
ALGO
0.991555
6.856167
5b2961e4-aa62-42d3-890b-a321d79bd7ac
ishandutta2007/codeforces
asdsasd/normal/1560/B.cpp
#include<bits/stdc++.h> using namespace std; void solve(){ int a, b, c; scanf("%d %d %d", &a, &b, &c); int d = abs(a - b); int max_ = max(a, max(b, c)); if(max_ > d * 2){ cout << "-1\n"; return; } if(c > d) cout << c - d << "\n"; else cout << c + d << "\n"; } int m...
ALGO
0.999942
4.326406
2a324c22-6c8c-4175-aab6-5b0e9131035b
alexandraback/datacollection
solutions_5765824346324992_1/C++/aknow/b.cpp
#include <algorithm> #include <cassert> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <string> #include <vector> using namespace std; #define clr(x) memset((x), 0, sizeof(x)) #d...
ALGO
0.99991
3.66794
e27e5a8f-37a3-4a7c-9957-98d79e6764e2
aritra741/Competitive-Programming
Codeforces/755C.cpp
#include <bits/stdc++.h> #define mx 10007 using namespace std; int par[mx], Size[mx]; int Find( int u ) { if( par[u]==u ) return u; return par[u]= Find(par[u]); } void unite( int u, int v ) { int paru= Find( u ); int parv= Find( v ); if( paru!=parv ) { if( Size[paru]>Size[par...
ALGO
0.999285
4.094072
6eb0ae26-b41e-41a3-9b25-4992e50395dd
kunyavskiy/competitive-programming-archive
GoogleCodeJam/2020/r2/D.cpp
#include <cassert> #include <fstream> #include <iostream> #include <vector> #ifdef LOCAL #define eprintf(...) fprintf(stderr,__VA_ARGS__) clock_t __my_start_clock = clock(); #else #define eprintf(...) #endif #define TIMESTAMP(x) eprintf("["#x"] Time : %.3lf s.\n", (clock() - __my_start_clock)*1.0/CLOCKS_PER_SEC) #def...
ALGO
0.999718
3.831046
10a4fbeb-fe1e-4f7c-8b7a-46e19c4d8a2b
raincross7/code-similarity
codes/train_code/problem291/problem291_382.cpp
#include<iostream> using namespace std; int main(){ int d, hd; int sum; while(cin >> d){ sum = 0; hd = d; while(hd < 600){ sum += hd*hd*d; hd += d; } cout << sum << endl; } return 0; }
ALGO
0.999632
3.233076
03585aaf-bfee-40b7-a201-5876c80f3e9d
Sankhya0/logicDetector
backend/CDataset/numTrees/numTrees_4.cpp
class Solution { public: int numTrees(int n) { int catalan[n+1]; catalan[0] = 1; catalan[1] = 1; for(int i=2;i<=n;i++){ catalan[i] = 0; for(int j=0;j<i;j++){ catalan[i]+= catalan[j]*catalan[i-j-1]; } ...
ALGO
0.999957
6.415768
5663d03f-ff60-40cc-9c7c-ce5ab1987200
farhan13000/dsa2025
stacks/infix_to_postfix.cpp
#include<bits/stdc++.h> using namespace std; int precedence(char c) { if (c == '^') { return 3; } else if (c == '*' || c == '/') { return 2; } else if (c == '+' || c == '-') { return 1; } else { return -1; } } int main() { string s; cin >> s; stack<char>s...
ALGO
0.999972
4.521032
22e89ffa-0af8-4dff-86f6-1a654810f844
ArchitKumar1/LeetCode-Submissions
closest-dessert-cost/Wrong Answer/2-28-2021, 10:28:59 PM/Solution.cpp
// https://leetcode.com/problems/closest-dessert-cost class Solution { public: int closestCost(vector<int>& baseCosts, vector<int>& toppingCosts, int target) { int ans = 0; int bestdiff = INT_MAX; int m = toppingCosts.size(); int MX = 1e5; auto upd...
ALGO
0.999941
5.929005
954deea7-2793-487c-924c-752c89eb9ec5
Strider-7/code
sorting/hoare-partition.cpp
#include <bits/stdc++.h> using namespace std; int hoare(int arr[], int low, int high) { int pivot = arr[low]; int i = low - 1, j = high + 1; while (true) { do { i++; } while (arr[i] < pivot); do { j--; } while (arr[j] > pivot); ...
ALGO
0.999894
5.50008
38eb37cb-c64d-420f-b3f5-0ac9132a0eaa
Valgt/CompetitiveProgramming
AtCoder/AtCoder129-ABC-D.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; const int TAM = 2000 + 5; string s[TAM]; int h[TA...
ALGO
0.9998
3.851488
049f0b51-8c24-43d6-add8-40691b3c5d31
mazewu1102/oj
pat/1050/1050.cpp
#include <cstdio> #include <cstdlib> #include <iostream> using namespace std; int main() { char s1[10000]; short s2[200] = {0}; char c; int i = 0; scanf("%c", &c); while (c != '\n') { s1[i++] = c; scanf("%c", &c); } s1[i] = 0; scanf("%c", &c); while (c != '...
ALGO
0.999718
3.088326
ca0ccd18-b651-4715-b420-de544cf1c961
songhn233/Algorithm-Packages
codeforces/cf565 div3/B.cpp
#include<cstdio> #include<algorithm> #include<cstring> #include<iostream> #include<vector> #include<queue> #include<cmath> #include<map> #include<set> #define ll long long #define F(i,a,b) for(int i=(a);i<=(b);i++) #define mst(a,b) memset((a),(b),sizeof(a)) #define PII pair<int,int> #define rep(i,x,y) for(auto i=(x);i<...
ALGO
0.999769
3.529078
582597b7-069f-4f10-a5de-08bf1f8822a7
ishandutta2007/codeforces
yosupo/normal/484/B.cpp
#include <vector> #include <iostream> #include <set> #include <cstdio> #include <queue> #include <cstdio> #include <cstdlib> #include <cassert> #include <ctime> #include <cmath> #include <complex> #include <algorithm> #include <tuple> #include <algorithm> #include <limits> #include <map> #include <valarray> #include <l...
ALGO
0.999875
3.263317
fe359249-9b54-4496-aad5-104e8a02e76b
EslamKhder/problem-solving-with-c-
sheets/sheet #5 (functions)/J. Average.cpp
#include<bits/stdc++.h> using namespace std; double sum(int size){ double sum; for(int i=0;i<size;i++){ // 0 1 2 double value; cin>>value; sum+= value; } return sum; } int main() { int size; cin>>size; cout<<setprecision(8)<<sum(size)/size<<endl; }
ALGO
0.995437
3.166274
8bb4c58d-72ef-41ce-b8cb-48b98e786fd1
R-YimY/MVS-POLYFIT
code/3rd_party/3rd_eigen-3.3.7/unsupported/test/NumericalDiff.cpp
#include <stdio.h> #include "main.h" #include <unsupported/Eigen/NumericalDiff> // Generic functor template<typename _Scalar, int NX=Dynamic, int NY=Dynamic> struct Functor { typedef _Scalar Scalar; enum { InputsAtCompileTime = NX, ValuesAtCompileTime = NY }; typedef Matrix<Scalar,InputsAtCompileT...
TEST
0.985528
6.185318
4e84a2f8-ba87-4590-90fb-d59593e26299
a-farooq/ProblemsAndSolutions
DataStructuresAndAlgorithms/tree/max-levelsum-in-binary-tree.cpp
/**** Given a Binary Tree having positive and negative nodes. Find the maximum sum of a level in the given Binary Tree. Example 1: Input : 4 / \ 2 -5 / \ / \ -1 3 -2 6 Output: 6 Explanation : Sum of all nodes of 0'th level is 4 Sum of all no...
ALGO
0.999983
5.500018
78440648-f6ed-4b93-aa0c-f8642371da7e
huhkyun1275/boost_realize
libs/compute/perf/perf_stl_partition.cpp
#include <algorithm> #include <iostream> #include <numeric> #include <vector> #include "perf.hpp" int rand_int() { return static_cast<int>((rand() / double(RAND_MAX)) * 25.0); } bool less_than_10(int value) { return value < 10; } int main(int argc, char *argv[]) { perf_parse_args(argc, argv); std::c...
ALGO
0.994105
6.02186
f985d857-087c-4907-a665-43ba56fb2fc5
smh997/Problem-Solving
Online Judges/Kattis/islandhopping.cpp
/* * https://open.kattis.com/problems/islandhopping * Author: https://github.com/smh997/ */ #include <bits/stdc++.h> using namespace std; #define MAX_N 753 int parent[MAX_N]; int raank[MAX_N]; int t, n; double x, y; pair<double, double> points[MAX_N]; vector<pair<double, pair<int, int>>> edgeList; void initSets(i...
ALGO
0.999839
4.730501
aacb632d-f1ee-45ec-8de1-97f359693c1f
yeonjae11/PDP
pytorch/third_party/flash-attention/csrc/composable_kernel/example/ck_tile/10_rmsnorm2d/instances/rmsnorm2d_fwd_bf16_n2048_instance.cpp
#include "rmsnorm2d_fwd_instance_common.hpp" // clang-format off // rm rn tm tn vn pd rms 2p template float rmsnorm2d_fwd_<trait_<ck_tile::bf16_t, 1, 1, 1, 256, 8, true, false, false>>(const S&, A); template float rmsnorm2d_fwd_<trait_<ck_tile::bf16...
DATA
0.910484
6.435408
7293bf80-acb2-495e-b35d-5644cd218a07
MorningXu/dnn_yolo_tracker
src/third_part/eigen3/doc/examples/TutorialLinAlgExSolveLDLT.cpp
#include <iostream> #include <Eigen/Dense> using namespace std; using namespace Eigen; int main() { Matrix2f A, b; A << 2, -1, -1, 3; b << 1, 2, 3, 1; cout << "Here is the matrix A:\n" << A << endl; cout << "Here is the right hand side b:\n" << b << endl; Matrix2f x = A.ldlt().solve(b); cout << "...
ALGO
0.999889
3.807622
8b4d71cd-e812-4c96-8c98-6f82125d8d03
denis-gubar/Leetcode
Hash Table/1122. Relative Sort Array.cpp
class Solution { public: vector<int> relativeSortArray(vector<int>& arr1, vector<int>& arr2) { vector<int> M(1001); vector<int> result; for (int a : arr1) ++M[a]; for (int a : arr2) { for (int x = 0; x < M[a]; ++x) result.push_back(a); M[a] = 0; } for(int i = 0; i < M.size(); ++i) for (in...
ALGO
0.999995
5.608225
4f334f94-5f56-471d-9050-da2a19da4426
gtkn/atcoder
ABC_269_D_2.cpp
//title #include <bits/stdc++.h> using namespace std; #include <atcoder/all> using namespace atcoder; #define rep(i,n) for (ll i = 0; i < (n); ++i) #define rep1(i,n) for (ll i = 1; i <= (n); ++i) #define repr(i,n) for (ll i = (n)-1; i >= 0; --i) #define rep1r(i,n) for (ll i = (n); i > 0; --i) #define bit(n,k) ((n>>k)&1...
ALGO
0.999816
5.030793
6f7f1c9a-b1d9-4a19-802c-d0c955a68669
vazirr/DSA
cloneLLWithRandomPtr.cpp
//approach 1 ------------------------------------------------------------------------------------------------------- //page 2-3 newBook Solution { private: void insertAtTail(Node* &head, Node* &tail, int d){ Node* temp = new Node(d); if(head == NULL){ head = temp; tail ...
ALGO
0.999686
4.546324
b90516f5-92b3-45ac-a719-765db4ce68e2
Masud2017/todo-flutter-app
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.998799
6.776823
e1a2d7de-47bd-46e0-8f3f-35b038782952
dytos666/myCS106B
a9/Huffman.cpp
#include "Huffman.h" #include "priorityqueue.h" #include "map.h" using namespace std; bool isLeaf(EncodingTreeNode* node){ return !node->one && !node->zero; } /** * Deallocates all nodes in a Huffman tree. We've provided this helper function * to you since we also use it in our test driver and figured you might ...
ALGO
0.975925
6.965443
19a0f9f1-3b8b-48d5-a6a2-ab0ca9d9b5ea
Pierre-Terdiman/PEEL_PhysX_Edition
PEEL_Externals/5_6_0_GitHub/source/geomutils/src/intersection/GuIntersectionBoxBox.cpp
#include "GuIntersectionBoxBox.h" using namespace physx; bool Gu::intersectOBBOBB(const PxVec3& e0, const PxVec3& c0, const PxMat33& r0, const PxVec3& e1, const PxVec3& c1, const PxMat33& r1, bool full_test) { // Translation, in parent frame const PxVec3 v = c1 - c0; // Translation, in A's frame const PxVec3 T(v....
TEST
0.955983
5.147453
4127e07c-bcff-41c3-a9d9-1e224b5479ef
AniketShivhare/TasteJunction_App
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.998809
6.763549
f9db0da4-6e06-44a0-bfc5-47b1cd6071c4
oucler/CarND-PathPlanning
src/Eigen-3.3/bench/bench_gemm.cpp
// g++-4.4 bench_gemm.cpp -I .. -O2 -DNDEBUG -lrt -fopenmp && OMP_NUM_THREADS=2 ./a.out // icpc bench_gemm.cpp -I .. -O3 -DNDEBUG -lrt -openmp && OMP_NUM_THREADS=2 ./a.out // Compilation options: // // -DSCALAR=std::complex<double> // -DSCALARA=double or -DSCALARB=double // -DHAVE_BLAS // -DDECOUPLED // #include...
TOOL
0.941634
5.840695
29384250-86cf-415e-a12f-afffa6f103f3
h2ssh/Vulcan
src/planner/exploration/local_topo/local_topo_explorer.cpp
/** * \file local_topo_explorer.cpp * \author Collin Johnson * * Definition of LocalTopoExplorer. */ #include <planner/exploration/local_topo/local_topo_explorer.h> #include <planner/exploration/local_topo/exploration_status.h> #include <hssh/local_topological/events/area_transition.h> #include <hssh/local_topo...
ALGO
0.910022
7.035127
da89a3bf-72a4-4805-ac5d-3b4754bb6ba6
JustHoang/IINT1306_CAU_TRUC_DU_LIEU_VA_GIAI_THUAT_HK20222
CHỦ ĐÊ 5. QUY HOẠCH ĐỘNG/SO SANH XAU CON.cpp
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; set<char> tmp; int ans = 0; for (char x : s) { tmp.insert(x); ans = max(ans, int(x)); } int d[ans + 5][s.size() + 5] = {}; for (int i = 1; i <= s.length(); ++i) { for (char x : tmp) { ...
ALGO
0.999837
4.0882
ac08d144-8516-47f3-9bc3-8a32134759d8
doug65535/madDougAlgorithm
Acm/AcmClass/prim算法1162.cpp
#include <iostream> #include <stdio.h> #include <string.h> #include <math.h> using namespace std; /** 杭电ACM 1162 最小生成树解决的问题:AB之间带权路径的最小值 1.最小生成树prim算法 2.最小生成树的kruskal算法 */ #define INF 1<<30 //用来存储带权路径,点与点之间要求计算之间的距离 double a[101], b[101], map[101][101]; double dist[101];//当前路径和 int used[101]; void prim(int n) {...
ALGO
0.999637
3.077971
9a905d69-13a8-456d-bbd3-8c028ffe28e8
ilksh/Algorithm-template
C++/Graph/Dijkstra/Dijkstra.cpp
#include<bits/stdc++.h> using namespace std; typedef pair<int, int> pii; const int INF = 1e9; const int MAX_V = 2 * 1e4 + 1; priority_queue<pii> pq; // distance, node vector<pii> adj[MAX_V]; // adjacency list // The minimum cost to the ith node is dp[i] int dp[MAX_V+1]; void fill_adj() { // adj[from].push...
ALGO
0.999734
4.087341
a5794a62-199f-4395-9844-2b5d34957a81
sp9820e-kaios/android_frameworks_rs
cpu_ref/rsCpuIntrinsicConvolve3x3.cpp
#include "rsCpuIntrinsic.h" #include "rsCpuIntrinsicInlines.h" using namespace android; using namespace android::renderscript; namespace android { namespace renderscript { class RsdCpuScriptIntrinsicConvolve3x3 : public RsdCpuScriptIntrinsic { public: void populateScript(Script *) override; void invokeFreeCh...
ALGO
0.877704
5.056992
5bee5213-2ffa-463a-87d4-332b75d4153c
jumyoung/kuuve
lane_detector/src/InToOutLaneDetector.cpp
#include "lane_detector/InToOutLaneDetector.h" using namespace std; using namespace cv; InToOutLaneDetector::InToOutLaneDetector(const int width, const int height, const int steer_max_angle, const int detect_line_count) : LaneDetector(width, height, steer_max_angle, detect_line_count) {} void InToOutLaneDetector::...
ALGO
0.945446
5.848826
e6481da4-0fdb-47f9-b435-a7fb6b5eb7b6
alexandraback/datacollection
solutions_5765824346324992_0/C++/chongkong/haircut.cpp
#define _CRT_SECURE_NO_WARNINGS #include <iostream> #include <cstring> using namespace std; int time_taken[1000]; int available[1000000]; int main() { freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); int t; cin >> t; for (int tc = 1; tc <= t; tc++) { memset(available,...
ALGO
0.999832
4.034779