uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
1f55ab5c-6a0e-44bc-8cb9-3f31e67880e3
leon0113/DSA-Advance-Cpp
Leetcode/1.258.Add-Dgit.cpp
#include <iostream> using namespace std; int main() { int num; cout << "Enter a number: "; cin >> num; while (num > 9) { int ans = 0, rem; while (num != 0) { rem = num % 10; num /= 10; ans += rem; } num = ans; } cou...
ALGO
0.999717
5.137919
16d829a4-6f60-475d-a541-7c2dd84d422e
ankeshmaurya/DSA-160-Days-GFG
Day2_Moving_Zeroes_At_End.cpp
#include<iostream> #include<algorithm> using namespace std; void MoveAtEnd(int arr[], int n){ int temp=0; for(int i=0;i<n;i++){ if(arr[i]!=0) arr[temp++]=arr[i]; } for(int i=temp;i<n;i++){ arr[i]=0; } } int main(){ int n; cin>>n; int arr[n]; for(int i=0;...
ALGO
0.999882
3.790996
2bdfceae-17af-4659-a361-2f9e4b075122
dev1d123/CompetitiveProg
codeforces/div3/CodeforcesRound479/B.cpp
#include <bits/stdc++.h> using namespace std; int main(){ int n; string s; cin>>n>>s; map<string, int> mp; int most = 0; for(int i = 0; i < n - 1; i++){ string tg = string(1, s[i]) + s[i+1]; mp[tg]++; most = max(most, mp[tg]); } for(auto it: mp){ if(it.second == most){ cout<<it.first<<endl; brea...
ALGO
0.999983
3.339942
9d868dfb-f819-4825-b3f7-3405ee50f003
xuedingedexingkong/fvm_solver
fvm/eigen-3.4.0/eigen-3.4.0/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_broadcast_simple.cpp
#include <iostream> #include <Eigen/Dense> using namespace std; int main() { Eigen::MatrixXf mat(2,4); Eigen::VectorXf v(2); mat << 1, 2, 6, 9, 3, 1, 7, 2; v << 0, 1; //add v to each column of m mat.colwise() += v; std::cout << "Broadcasting result: " << std::endl;...
ALGO
0.993656
4.136906
9e5e6869-125a-403b-abd4-51a46d77b809
tomagoyaky/ClassLoadShell
jni/libdex/ZipArchive.cpp
/* * Read-only access to Zip archives, with minimal heap allocation. */ #include "ZipArchive.h" #include <zlib.h> #include <stdlib.h> #include <unistd.h> #include <string.h> #include <fcntl.h> #include <errno.h> //#include "JNIHelp.h" // TEMP_FAILURE_RETRY may or may not be in unistd //#include <utils/Compa...
TOOL
0.947578
7.259663
d8a06221-71e6-4b91-a2e6-0b53cac6b75d
atlas25git/codeforces
Practice/1462A.cpp
/*************************************** *****Solution authored by Atlas25.****** *****************************************/ #include<bits/stdc++.h> using namespace std; #define int long long int #define ld long double #define F first #define S second #define P pair<int,int> #define pb push_back const int mod = 1e9 + 7...
ALGO
0.999767
4.189898
8e7dc239-a944-45ff-aaad-e9a1cba530a7
ishandutta2007/codeforces
3.141592653/normal/1066/D.cpp
#include<cstdio> #include<algorithm> typedef long long ll; int a[1111111];int n,m,k; ll s[1111111],nxt[1111111]; inline int half(int x) { int l=x,r=n+1; while(l+1<r) { int mid=(l+r)>>1; if(s[mid]-s[x-1]<=k)l=mid; else r=mid; }return r; } int fa[222222][22]; inline int getfa(int x,int k) { int i=0; while(k) ...
ALGO
0.999957
3.678401
ee3a8394-1ad2-4555-8eaf-a1c7d10d5c68
canplane/problem-solving
boj/old/202102-cpp/8-brute/_2580_1.cpp
#include <cstdio> int map[9][9], node[81], node_sz; bool dfs(int idx) { if (idx == node_sz) return true; int y = node[idx] / 9, x = node[idx] % 9; bool candi[10]; for (int i = 1; i < 10; i++) candi[i] = true; for (int i = 0; i < 9; i++) { candi[map[y][i]] = candi[map[i][x]] = false; candi[map[3 * (y / ...
ALGO
0.999891
4.274397
68fc7443-6cb0-4bfa-8918-433302a60a58
chenhch8/arithmetic
汉诺塔.cpp
#include<iostream> using namespace std; template<typename T> void HNT(int, T, T, T); int main() { int n; cin >> n; HNT(n, 'A', 'C', 'B'); return 0; } template<typename T> void HNT(int sum, T start, T temp, T goal) { if (sum == 0) return; HNT(sum - 1, start, goal, temp); cout << start << " => " << goal << endl...
ALGO
0.999982
3.759356
c730d4d4-215f-4c10-b0bf-310e0efc970c
K0nnyaku/Code
Data/CSP-JS2021二轮提高组数据/SD-00274/airport/airport.cpp
#include<bits/stdc++.h> using namespace std; int n,m1,m2; struct node{ long long x,y; }air1[100010],air2[100010]; int br1[100010],br2[100010]; int cnt1,cnt2; long long ans,ansn; bool cmp (node x,node y) { return x.x<y.x; } int main() { freopen("airport.in","r",stdin); freopen("airport.out","w",stdout); scanf("%d%d...
ALGO
0.999879
3.757693
7d6a1257-4114-4b69-a2d4-5f1ac90f4606
CakeForest/noip
2016上课/test/8.30考试/egypt(wrong).cpp
#include<cstring> #include<iostream> using namespace std; int dep,ans[100],temp[100],ok; int gcd(int a,int b){ return b?gcd(b,a%b):a; } void dfs(int a,int b,int k){ if(k==dep+1) return; if(b%a==0&&b/a>temp[k-1]){ temp[k]=b/a; if(!ok||ans[k]<temp[k]) memcpy(ans,temp,sizeof(temp)); ok=1; return; } int s=b/a...
ALGO
0.999736
3.557051
130cb424-2e1f-4af9-849e-2127c3ffca4c
andreacent/AI_Games
movements/BlendedSteering.cpp
/* Andrea Centeno carnet USB: 10-10138 sep-dic 2017 */ #ifndef BLENDED_CPP #define BLENDED_CPP #include "Behaviors.cpp" #include "BlendedSteering.h" #include <map> void followTarget( std::map<string,Behavior*> behaviors, BlendedSteering &blended ){ if(behaviors.count("obstacle"...
TOOL
0.909911
4.926932
9bdd17a8-22e9-4f2f-a1cd-872a0f73c6f3
mel-hamr/mobile-pool
mobileModule00/ex00/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.998006
6.76775
13a1efdd-9cc7-4858-9e42-03352c21ec0a
Meta3DCompany/MetaSlicer
src/libigl/igl/ceil.cpp
template < typename DerivedX, typename DerivedY> IGL_INLINE void igl::ceil( const Eigen::PlainObjectBase<DerivedX>& X, Eigen::PlainObjectBase<DerivedY>& Y) { using namespace std; //Y = DerivedY::Zero(m,n); //#pragma omp parallel for //for(int i = 0;i<m;i++) //{ // for(int j = 0;j<n;j++) // { // Y...
ALGO
0.964409
5.300989
f289227a-afd7-49f6-a2ed-ecae1b4c4883
ToThaiLinh/Algorithm
TTUD/TH/Gold_Mining.cpp
#include <bits/stdc++.h> using namespace std; const int N = 1e6 + 2; int n, l1, l2; int a[N], S[N]; int res = INT_MIN; void input() { cin >> n >> l1 >> l2; for(int i = 1; i <= n; i++) { cin >> a[i]; } } void process() { deque<int> d; for(int i = 1; i <= n; i++) { while(!d.empty() ...
ALGO
0.999842
3.997971
6a0b653b-f09a-40d3-a590-03cb5f3bf39d
remyvnkhiemtruong/ICPC
references/aoapc-book/TrainingGuide/bookcodes/ch5/la3211.cpp
// LA3211 Now or Later // Rujia Liu #include<cstdio> #include<vector> #include<cstring> using namespace std; const int maxn = 2000 + 10; struct TwoSAT { int n; vector<int> G[maxn*2]; bool mark[maxn*2]; int S[maxn*2], c; bool dfs(int x) { if (mark[x^1]) return false; if (mark[x]) return true; ma...
ALGO
0.99994
3.77884
46081fa7-b6b9-4a46-a575-1070c0792fe9
20191864147/jackywang
第四章作业/4.6/zuoye3.cpp
// zuoye3.cpp : Defines the entry point for the console application. // #include "stdafx.h" int main(int argc, char* argv[]) { int x,y; printf("x:"); scanf("%d",&x); if(x<1){ y=x;} else if(1<=x<10){ y=2*x-1;} else if(x>=10){ y=3*x-11;} printf("%d\n",y); return 0; }
ALGO
0.990735
3.445545
40781e89-3441-4d1d-a2c5-677c325ec344
TakefumiYamamura/CrackingTheCodingInterview
findMedianFromDataStream.cpp
class MedianFinder { private: vector<int> st; public: /** initialize your data structure here. */ MedianFinder() { } void addNum(int num) { auto itr = lower_bound(st.begin(), st.end(), num); st.insert(itr, num); } double findMedian() { if(st.size() % 2 ...
ALGO
0.99998
6.550442
485d4845-0a65-429f-8787-d99e5dca2f5d
JulUvarova/Advent_of_Code
day_11/day_11_task_02.cpp
#include <fstream> #include <iostream> #include <map> #include <sstream> #include <string> void read_file(std::map<int64_t, int64_t>& stones) { std::ifstream file("data.txt"); if (!file.is_open()) throw std::exception(); int x; while (file >> x) stones[x] += 1; file.close(); } void blinking(std::map<int64_t...
ALGO
0.964033
4.854146
057be4d5-90cd-41b2-b574-d5d3e1de9e9e
uniqucoder/DSA
Dyamic Programming/1fibonacci.cpp
#include<bits/stdc++.h> using namespace std; // RECURSION // TC exponential 2^n int getFibo(int n) { if(n==0) { return 0; } if(n==1) { return 1; } return getFibo(n-1)+getFibo(n-2); } // recursion + mem // step 1 : create Dp array and pass to the function // step2 : Store ...
ALGO
0.999988
5.76914
48dc7ece-dfea-4507-84ca-5779fa7f93d1
WFZ7789/contest.cpp
ALG-CPT03/r0.cpp
#include <iostream> #include <iomanip> #include <sstream> #include <vector> #include <cstdint> #include <cstring> #include <bits/stdc++.h> using namespace std; // SHA-256 常量 const uint32_t K[64] = { 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, 0xd807aa98, 0x128...
ALGO
0.999242
4.51067
12d63b55-08f2-4ea6-9dd3-ad349c26842d
RAGHIBRIZWAN/CPP-Practice
TopKFrequentElement.cpp
#include <iostream> #include <vector> #include<algorithm> using namespace std; int main() { vector<int> nums = {1,1,1,2,2,3}; vector<int> answer; int k = 2; int ans = nums[0],count = 1; for (int i = 1; i < nums.size(); i++) { if(nums[i] == ans){ count++; } e...
ALGO
0.999991
3.773766
ce6397e2-ae30-42c9-b365-06d66e117310
Abhinavpatel00/bgfx-sys
bimg/3rdparty/nvtt/bc7/avpcl_mode2.cpp
// Thanks to Jacob Munkberg (<EMAIL>) for the shortcut of using SVD to do the equivalent of principal components analysis // x100 555x6 64p 2bi #include "bits.h" #include "tile.h" #include "avpcl.h" #include "nvcore/debug.h" #include "nvmath/vector.inl" #include "nvmath/matrix.inl" #include "nvmath/fitting.h" #includ...
ALGO
0.997046
4.006711
62ce896d-6dd5-4bc6-9464-515e421372a7
Annie78724/Leetcode
1079-letter-tile-possibilities/1079-letter-tile-possibilities.cpp
class Solution { public: void permute(int i,string &temp,int &cnt,unordered_map<string,int>&m) { if(i==temp.size()) { if(!m[temp]) { m[temp]=1; // cout<<temp<<" "; cnt++; } } for(int j=i;j<temp...
ALGO
0.99996
6.873188
c4ca44b0-8419-49ce-bf69-847f229faf66
jma02/cpp-compprog
codeforces/9-05-2022/9-08-2022/A_n.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; void solve(){ ll n; cin >> n; vector<ll> ans(n); for(ll i : ans)cin>> i; ll x = 0; ll m = 0; for(ll i = 1; i <= n; i++){ if(ans[i-1]>m){ x=i; m=ans[i-1]; } } cout << x << '\n';...
ALGO
0.999864
5.005822
7c6b571a-225a-41e8-9280-267b27a55ce1
MINAKSHI101/basic-programming
x.cpp
#include<iostream> using namespace std; int main() { int num, rem, temp, product = 1, sum = 0, count = 0; cin >> num; temp = num; while (temp != 0) { count += 1; temp = temp / 10; } temp = num; // Reset temp to the original value of num while (temp != 0) { rem = t...
ALGO
0.999939
5.405572
c6c9d491-4fd0-48ce-917f-472284074b6c
manykits/PHOENIXEngine
PHOENIX/PX2Engine/Physics/Bullet/BulletCollision/CollisionShapes/btBvhTriangleMeshShape.cpp
//#define DISABLE_BVH #include "BulletCollision/CollisionShapes/btBvhTriangleMeshShape.h" #include "BulletCollision/CollisionShapes/btOptimizedBvh.h" #include "LinearMath/btSerializer.h" ///Bvh Concave triangle mesh is a static-triangle mesh shape with Bounding Volume Hierarchy optimization. ///Uses an interface to a...
ALGO
0.943532
7.193789
7754ac90-1024-4800-ae91-4b7c3c24ea88
Hiyabye/Baekjoon
14xxx/14245.cpp
#include <cmath> #include <iostream> #include <vector> using namespace std; class LazySegmentTree { private: int n, h, sz; vector<int> arr; vector<int> tree; vector<int> lazy; void init(int node, int start, int end) { if (start == end) { tree[node] = arr[start]; } else { init(node*2, sta...
ALGO
0.9998
5.859168
4ff315a2-2bdb-4fb4-b3a4-67a8ca2cd263
rlkcpo/Euler-Problems
Euler1.cpp
//**********************************************// //Richard Keener // //Project Euler (projecteuler.net) // //Problem 1 // //June 2015 // //**********************************************// #include "stda...
ALGO
0.999827
4.329601
b29d23dc-1dcc-4513-9014-06be53db7295
data61/MP-SPDZ
FHEOffline/Multiplier.cpp
/* * Multiplier.cpp * */ #include <FHEOffline/Multiplier.h> #include "FHEOffline/PairwiseGenerator.h" #include "FHEOffline/PairwiseMachine.h" #include "Math/modp.hpp" template <class FD> Multiplier<FD>::Multiplier(int offset, PairwiseGenerator<FD>& generator) : Multiplier(offset, generator.machine, genera...
ALGO
0.962906
6.138796
55a8f495-47e8-4460-9f24-94293ac2a6e3
raincross7/code-similarity
codes/train_code/problem277/problem277_123.cpp
#include<bits/stdc++.h> #define rep(i, n) for (int64_t i = 0; i < (int64_t)(n); i++) #define all(v) v.begin(), v.end() using ll = long long; using namespace std; int main(){ ll n;cin>>n; string s; vector<int>a(26,0); rep(i,n){ cin>>s; rep(j,26){ char x='a'+j; if(i==0)a[j]+=count(all(s),x...
ALGO
0.999982
3.890416
ba620cca-3ea6-424d-8473-79014da7467e
meruyme/Data-Structures
biblioteca.cpp
#include <stdio.h> #include <stdlib.h> #include <stdint.h> #include <string> #include <fstream> #include <iostream> #include <sstream> using namespace std; typedef struct livro{ string titulo; string autor; long long int isbn; } livro; int tamanho_vetor, quant_pesquisas; int cont_binaria = 0, aux_binar...
ALGO
0.948069
4.259503
fc6e822b-a2a9-486c-ad95-27adcb4e5aa4
JohnNiang/algorithm
A1033/main.cpp
#include <iostream> #include <algorithm> using namespace std; // A1033: To Fill or Not to Fill // <https://pintia.cn/problem-sets/994805342720868352/problems/994805458722734080> const double infinite = 999999999; struct Station { double unitPrice; double distance; } stations[501]; bool distanceCmp(Station& ...
ALGO
0.999757
4.079131
7c0fb4ed-6625-437c-af75-38e9fc1e711e
monish-1/Codeforces-Practice-Ladder
A_Cupboards.cpp
#include <bits/stdc++.h> using namespace std; #define mod 1000000007 #define ll long long #define endl '\n' #define xx ' ' #define f(i, n) for (int i = 0; i < n; i++) #define w(x) \ int x; \ cin >> x; \ while (x--) #define fast \ ios_base::sync_with_stdio(false); \ cin...
ALGO
0.999765
3.683627
02619fae-fa82-4d4f-84f3-8c265321f9d1
GDieser/Ejercicios-C-1C
C++ U6 VECTORES/EJE16.CPP
#include <iostream> #include <locale.h> using namespace std; /*16) Dada una lista de 10 números, cargarlos en un vector. Luego detectar si en el vector hay algún elemento repetido y, en caso de haberlo, indicarlo con un cartel “Hay Repetidos”.*/ int Repetidos(int vector[]) { int vectorClon, contador = 0; boo...
ALGO
0.968989
4.361536
f1845120-3469-4f12-b753-996e9c752101
lightkeeper/murmurhash
City.cpp
#include "City.h" #include <algorithm> using namespace std; #define UNALIGNED_LOAD64(p) (*(const uint64*)(p)) #define UNALIGNED_LOAD32(p) (*(const uint32*)(p)) #if !defined(LIKELY) #if defined(__GNUC__) #define LIKELY(x) (__builtin_expect(!!(x), 1)) #else #define LIKELY(x) (x) #endif #endif // Some primes between ...
ALGO
0.995321
6.463272
29148704-2193-40bd-bb6d-7e99cd1a8f06
roshanrk44/Leetcode_Solutions
0128-longest-consecutive-sequence/0128-longest-consecutive-sequence.cpp
class Solution { public: int longestConsecutive(vector<int>& nums) { if(nums.size()==1||nums.size()==0) return nums.size(); sort(nums.begin(),nums.end()); int ans=0,count=0; for(int i=1;i<nums.size();i++) { if(nums[i]-nums[i-1]==1) { ...
ALGO
0.999957
5.553209
f583f52f-2898-4de1-a314-f7e9520ce016
pandayed/LeetCode
144-binary-tree-preorder-traversal/144-binary-tree-preorder-traversal.cpp
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nullptr), right(nullptr) {} * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} * TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l...
ALGO
0.999986
6.136573
61cd273e-aafe-40fa-86c3-8e7f8f736c0d
souptikji/Competitive_Programming
codeforces/203b.cpp
#include<iostream> #include<vector> #include<string> #include<algorithm> using namespace std; main() { int tst=100; while(tst--) { vector<int>v; v.clear(); int tot,n,d,a,b,x,y,cnt=0,sum=0,i,j; cin>>n>>d>>a>>b; for(i=0;i<n;i++){ cin>>x>>y; tot=a*x+b*y; v.push_back(tot);} ...
ALGO
0.999479
3.335428
57f03f6e-e880-4522-92c0-59fbbabb9a16
jimmy980189/NTHU-CS6135-VLSI-Physical-Design-Automation
HW2-Two-way-Min-cut-Partitioning/HW2_grading/student/111062517/HW2/src/main.cpp
#include "fm.h" bool DEBUG = false; steady_clock::time_point tStart; int main(int argc, char* argv[]) { if (argc < 4) { cout << "Usage: ./hw2 [cell file] [net file] [output file]" << endl; exit(-1); } tStart = steady_clock::now(); FM Fm; steady_clock::time_point tIutputStart = s...
ALGO
0.990783
3.943491
61d64294-5e89-4a44-a6af-bf9e9b1af585
jagleeso/openmm
platforms/cpu/src/CpuGayBerneForce.cpp
#ifdef _MSC_VER // Prevent Windows from defining macros that interfere with other code. #define NOMINMAX #endif #include "CpuGayBerneForce.h" #include "ReferenceForce.h" #include "openmm/OpenMMException.h" #include "openmm/GayBerneForce.h" #include "openmm/internal/gmx_atomic.h" #include <algorithm> #include <c...
ALGO
0.999952
7.486471
54396bae-d4ac-45f9-8288-ee8f4fb09a55
rajatenzyme/LeetCode_Solutions
965-univalued-binary-tree/965-univalued-binary-tree.cpp
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nullptr), right(nullptr) {} * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} * TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l...
ALGO
0.999876
6.500185
2d7484e6-6bfc-4c2d-b19c-24a9a8bd7c08
netwarm007/llvm
tools/llvm-cov/CoverageSummaryInfo.cpp
#include "CoverageSummaryInfo.h" using namespace llvm; using namespace coverage; LineCoverageStats::LineCoverageStats( ArrayRef<const coverage::CoverageSegment *> LineSegments, const coverage::CoverageSegment *WrappedSegment) { // Find the minimum number of regions which start in this line. unsigned MinRe...
TOOL
0.88414
7.610509
83080d17-6750-42e1-8914-f18e7d6f502f
blackout-yash/LeetCode
2421-number-of-good-paths/2421-number-of-good-paths.cpp
class DSU { public: vector <int> parent, _size; DSU (int n) { parent.resize(n); _size.resize(n); for (int i = 0; i < n; i++) { parent[i] = i; _size[i] = 1; } } void makeSet(int v) { parent[v] = v; _size[v] = 1; } int find...
ALGO
0.999997
5.490771
e64b7da2-ebd2-4243-b0eb-034413c3c468
sji367/moos-ivp-reed
src/lib_anrp_util/DifferentialDriveIntegrator.cpp
#include "DifferentialDriveIntegrator.h" #include <math.h> void DifferentialDriveIntegrator::StepSystem(double readingtime, double lmovement, double rmovement) { double l_r, r_r; l_r = lmovement * c2m; r_r = rmovement * c2m; double a_d, l_d; a_d = (r_r - l_r) / al; l_d = (r_r + l_r) / 2.0; lhistory.push_fro...
ALGO
0.996761
5.541707
d390b1ed-9e3b-43f3-951b-996c05f7c437
maspypy/library
test/2_library_checker/data_structure/double_ended_q.test.cpp
#define PROBLEM "https://judge.yosupo.jp/problem/double_ended_priority_queue" #include "my_template.hpp" #include "other/io.hpp" #include "ds/double_end_queue.hpp" void solve() { LL(N, Q); VEC(int, A, N); Double_End_Queue<int> que(A); FOR(Q) { INT(t); if (t == 0) { INT(x); que.push(x); ...
ALGO
0.999691
5.491276
7da4704e-74ef-4673-9286-31e58e15004d
kelvindk/Video-Stabilization
boost_1_42_0/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.940311
7.219968
29deecd4-9ef9-4ebd-8b64-a2095f48a212
agaaga823/LabAlgo2-TI22PA2-222310031
Tugas 6(?) & 7/Tugas 6 no 1 (Graph).cpp
#include <iostream> #include <vector> #include <climits> #include <algorithm> using namespace std; // Fungsi untuk mencetak matriks cost void printCostMatrix(const vector<vector<int>>& costMatrix, int numCities) { cout << "Cost List :\n"; for (int i = 0; i < numCities; i++) { for (int j = 0; j < numCi...
ALGO
0.999994
5.357055
3ffb0ffd-5aec-4ebd-905f-ddbbfd07b15a
kua-as-exe/coding-notebook
cpp/problems/omegaup/Procesando-calificaciones-de-alumnos~10428/_main2.cpp
#include <bits/stdc++.h> using namespace std; long long int n, c, i, j, t, r=1, m, a, b; vector <int> x[105]; string s; int main(){ cin >> n; while (n--){ cin >> s; if(s == "REGISTRA"){ cin >> c; x[c-1].push_back(r); r++; }else if( s == "CUENTA" ){ printf("\n"); ...
ALGO
0.963897
3.274534
a96c8c08-216f-471b-ace9-0a3dfaf195df
NKNaN/myLeetcodeSolutions
c++/array/1.binary search/367. Valid Perfect Square.cpp
class Solution { public: bool isPerfectSquare(int num) { int lo = -1; int hi = 50000; while (hi - lo > 1) { int mid = (lo + hi) / 2; long s = (long)mid * mid; if (num > s) { lo = mid; } else if (num < s) { hi = m...
ALGO
0.999849
5.684007
4ef10ac9-8dc0-42bf-a415-ff725045d133
ishandutta2007/codeforces
n_z__/normal/573/E.cpp
#include<bits/stdc++.h> #define int long long using namespace std;int f[100001];main(){int n;cin>>n;int ans=0;memset(f,0x8f,sizeof(f));f[0]=0;for(int i=1,x;i<=n;i++){cin>>x;for(int j=i;j;j--)f[j]=max(f[j],f[j-1]+x*j),ans=max(ans,f[j]);}cout<<ans;}
ALGO
0.999929
3.685697
c48ec1f1-939e-44a0-a073-c14f3fe70f9e
itohdak/AtCoder
ABC/old/previous/04-/046/D.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long #define REP(i,m,n) for(int i=(int)(m); i<(int)(n); i++) #define rep(i,n) REP(i,0,n) #define REPL(i,m,n) for(ll i=(ll)(m); i<(ll)(n); i++) #define repl(i,n) REP(i,0,n) #define all(v) v.begin(), v.end() const int inf = 1e9+7; const ll longinf = 1LL<<60; c...
ALGO
0.999739
3.754647
cfbf6c50-1285-46b1-9a04-dd0f8669b5bb
ymin431/CppProgramming
Prac_01/012_Grade/main.cpp
#include <iostream> #include <vector> #include <utility> int main() { int num, score; int high_score = 0, sum = 0; std::string name, high_name; std::vector<std::string> st_name; std::vector<int> st_score; std::cout << "# of students:" << std::endl; std::cin >> num; for (int i = 1; i...
ALGO
0.993391
6.114518
406c9131-67eb-4668-b35b-9004f5f52bb2
113bommy/deepmind_codecontests_refine
cpp_source_filter_file/cpp_train_4546_112.cpp
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; cout << floor(n / 2.0) + 1 << endl; return 0; }
ALGO
0.999591
3.512099
cb4fd471-02b7-404f-bfdc-6202fa77041c
Misiulavlad/L42Solution
Project1/init random.cpp
#include "util.h" #include "logic.h" void init_random(int matrix[N][N],int a,int b) { for (int i = 0; i < N; i++) { for (int j = 0; j < N; j++) { matrix[i][j] = rand() % (b-a+1)+a; } } } string convert(int matrix[N][N]) { string s = " "; for (int i = 0; i < N; i++) { for (int j = 0; j < N; j++) { s ...
ALGO
0.992853
3.732022
3d4c0397-6b1e-44e3-8139-626f632f5e64
Sur818/Coding-Projects
CppCompiler/array19 (2).cpp
#include<iostream> using namespace std; int show(int arr[] ,int n) { int i; for(i=0;i<n;i++) { cout<<arr[i]<<" "; } cout<<endl; } void rotation (int arr[],int n,int direc,int s) { int i,temp; if(direc==1) { while (s--!=0) { temp=arr[n-1]; for(i=n-1;i>=1;i--) { arr[i]=arr[i-1]; } arr[0]=temp; } show(arr,n); } else { w...
ALGO
0.999948
3.59174
a4c4c3e1-542e-4a96-b497-ddfc4f66e42d
junest66/algorithm-practice
baekjoon-cpp/gold/gold2/20183.cpp
#include <iostream> #include <queue> #include <utility> #include <algorithm> #include <vector> #include <cstring> using namespace std; #define X first #define Y second #define ll long long ll n,m,st,en; ll won; ll l=1; ll hi; //{비용, 정점번호} vector<pair<ll,ll>> adj[500001]; const int INF = 0x7f7f7f7f; ll d[100001]; //...
ALGO
0.999974
4.109902
b332adee-ff5a-43a7-ab80-27688c0b0d5c
Manvityagi/Codechef-Codeforces-spoj
CODEFORCES/VIRTUAL CONTESTS/459 DIV2/B.cpp
#include <bits/stdc++.h> using namespace std; #define PB push_back #define F first #define S second #define MP make_pair #define LL long long #define ULL unsigned long long #define LB lower_bound #define MOD1 1000000007 #define MOD2 1000000009 #define loop(i, a, b) for (int i = a; i < b; i++) LL n, m; int movex[] = {0...
ALGO
0.999333
4.041406
c63f914e-32f5-48b2-871d-0941a64b5d7b
hajimeIppo-cmd/cp-codes
Codeforces/Educational Codeforces Round 140 (Rated for Div. 2)/C.cpp
#include <bits/stdc++.h> #include <cassert> using namespace std; #define ll long long #define ull unsigned long long #define ld long double #define pii pair<int, int> #define pll pair<ll, ll> #define fr first #define sc second #define vt vector #define all(c) (c).begin(), (c).end() #define sz(x) (int)(x).size() #defin...
ALGO
0.999954
4.339586
76e5c27c-0218-4a3a-b79b-eee8828ffddd
Saleh7127/CPP-solution-by-Fellow_junior
Codeforces/cf552A.cpp
#include<bits/stdc++.h> using namespace std; int main() { int a,b,c,d,e=0,f,i,j,k,l,t; cin>>t; while(t--) { cin>>a>>b>>c>>d; e+=abs(c-a+1)*abs(d-b+1); } cout<<e<<endl; return 0; }
ALGO
0.998814
4.211586
d5114677-105f-44ea-bcb5-6c921ef263fd
kwangswei/algorithm_study
Algospot/fotress.cpp
#include <iostream> #include <vector> #include <algorithm> using namespace std; class Node { public: int x; int y; int r; vector<Node> child; bool operator<(const Node& rhs) const { return r > rhs.r; } int get_max_distance() { int ...
ALGO
0.999269
4.633248
27b6eae1-1102-4cd5-ba9f-b70a949b8afd
eyepatchParrot/BigNumHistory
calcSqrt1/src/calcSqrt.cpp
// calcSqrt.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include "BigInt.h" void wait(int sec) { time_t sT = time(0); while (time(0) - sT < sec) { } } int _tmain(int argc, _TCHAR* argv[]) { using std::endl; using std::cout; //BigInt x = 0.7; //BigInt add = (chunk)3; //ad...
ALGO
0.994315
3.964264
c8045ed5-5f13-4fd0-83b8-c77e60755e09
huangjunhao2019/leetcode-tencent
algorithm/sort/insert_sort/insert_sort17.cpp
#include<iostream> #include<vector> using namespace std; void insert_sort(vector<int> &nums){ for(int i=1;i<nums.size();i++){ int j=i-1; int val=nums[i]; while(j>=0 && nums[j]>val){ nums[j+1]=nums[j]; j--; } nums[j+1]=val; } } int main(){ vecto...
ALGO
0.999943
4.510617
2267d437-1288-4d59-8dd5-348035a6732b
GQH123/Renatus-ACM-Codes
2021 百度之星·程序设计大赛 - 初赛一/06.cpp
#include <bits/stdc++.h> #define rep(i, l, r) for (int i = l; i <= r; i++) #define per(i, r, l) for (int i = r; i >= l; i--) #define srep(i, l, r) for (int i = l; i < r; i++) #define sper(i, r, l) for (int i = r; i > l; i--) #define erep(i, x) for (int i = h[x]; i; i = e[i].next) #define erep2(i, x) for (int& i = cur[x...
ALGO
0.999547
3.716441
988342cd-8f59-43cd-a337-e43cda68b657
raincross7/code-similarity
codes/train_code/problem477/problem477_154.cpp
#include<bits/stdc++.h> #define rep(i,j,n) for(int i=(j);i<(n);i++) #define per(i,n,j) for(int i=(n);i>=(j);i--) using ll=long long; using namespace std; template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; retu...
ALGO
0.999811
4.251528
fc8eec91-32f2-4749-aeda-97e2abf8ee05
jesstrice/M1_IMAGINA1415
Image/TP/TP2_IM3D/main_tp2_sub.cpp
#include <stdio.h> #include <stdlib.h> #include <math.h> #include <string.h> #include <vector> #include "Voxel.h" #include <iostream> #include <fstream> using namespace std; char *token; unsigned short ***data = NULL; int dimX,dimY,dimZ; unsigned short Pmin = 64000; unsigned short Pmax = 0; void readingImg(char* fil...
TOOL
0.953495
3.061893
b01aecf0-cee6-4937-9719-2d0f81c34098
MahmoudElmahalawy/iti-itp-tasks
OOP/Lab 4 Assignment/6_to_power_5.cpp
#include <iostream> using namespace std; int pow(int n, int p); int main(){ cout<<pow(6, 5); return 0; } int pow(int n, int p){ if (p != 0) return (n*pow(n, p-1)); else return 1; }
ALGO
0.999334
5.194252
e7585d27-1d1a-4b3a-8b0f-3b967bc41b6d
kpk-pl/phobos
src-cpp/Phobos/ImageProcessing/Calculator/Bluriness.cpp
#include "ImageProcessing/Calculator/Bluriness.h" #include "ImageProcessing/Utils/ROIProcessor.h" #include <opencv2/opencv.hpp> namespace phobos { namespace iprocess { namespace calc { template<> metric::Blur Bluriness<blur::Sobel>::calculate(cv::Mat const& cvImage) const { constexpr static double scalingValue = 65...
ALGO
0.998656
6.841463
9326ae40-5c5d-4060-a46b-0a53ebf62d1f
dhruvg24/Leetcode_Submissions
2916-check-if-it-is-possible-to-split-array/2916-check-if-it-is-possible-to-split-array.cpp
class Solution { public: bool isValid(vector<int>& nums, int m , int l, int r){ int sum=0; for(int i=l;i<=r;i++) sum+=nums[i]; return sum>=m; } bool solve(vector<int> &nums, vector<vector<int>> &dp, int m, int l, int r){ if(l==r) return true; i...
ALGO
0.999992
5.801562
511e0044-7fed-4a84-a4ee-1c26754f0c0a
matiego1/sio2
Mały preOI (23-24)/sej.cpp
#include <iostream> #include <vector> #include <map> #include "sejlib.h" using namespace std; const int MAX = 10 * 1000; int n; int odpowiedzi[MAX + 1]; map<int, int> zlicz; int czy_klamie(int prawdomowny, int do_sprawdzenia) { int trzeci = -1; for (int i = 1; i <= n; i++) { if (i == prawdomowny) continue; if...
ALGO
0.999882
3.596947
16bed678-1e66-49aa-b1f7-15ba8425ec96
jsulop/wecar
navigation/base_local_planner/src/voxel_grid_model.cpp
#include <base_local_planner/voxel_grid_model.h> #include <sensor_msgs/point_cloud2_iterator.h> using namespace std; using namespace costmap_2d; namespace base_local_planner { VoxelGridModel::VoxelGridModel(double size_x, double size_y, double size_z, double xy_resolution, double z_resolution, double orig...
ALGO
0.965522
7.219556
287bcd65-4f18-4c92-af3a-3f8a82f4e8a3
rainbow-auto/rainbow-codes
Luogu/P2766.cpp
#include <iostream> #include <algorithm> #include <string> #include <vector> #include <list> #include <stack> #include <map> #include <set> #include <cstdio> #include <cstring> #include <cmath> #include <queue> #define fastread ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); #define endl "\n" using namespace st...
ALGO
0.999914
3.712486
ce98a649-38b8-44df-a879-2076c21335ae
mehul02/Competitive-Programming
Codeforces Round #519 by Botan Investments by User mehul_02/B - Lost Array.cpp
1043 B - Lost Array.cpp GNU C++14 Accepted ///==================================================/// /// /// Ir0nic_ /// /// MEHUL BHUTALIA /// /// Indian Institute Of Information Technology and Management,Gwalior. /// /// ///==================================================/// #include<bits/s...
ALGO
0.999926
3.292086
563e2957-65ee-4d77-a64f-81cc419ec577
giuliopedicone02/Programmazione1
Simulazione Prove Scritte/07-09-2022/es2.cpp
#include <iostream> #include <cmath> using namespace std; int es2(string **A, int n, int &m) { int cont = 0, res = 0; string a = *A[0]; string b = *A[1]; double avg = 0.0; for (int c = 1; c < n - 1; c++) { avg += a.length(); avg += b.length(); if (a.length() == b.len...
ALGO
0.999128
4.886019
b76d26a0-a08d-4ccc-bcee-1ad066d8717b
woobba94/algorithm
Project_codingTest/0438_5525.cpp
//#include <bits/stdc++.h> //using namespace std; // //int main() //{ // int n, m; // string s; // cin >> n >> m >> s; // // string pattern = "I"; // for (int i = 0; i < n; i++) // { // pattern += "OI"; // } // // int pLen = pattern.length(); // int count = 0; // for (int i = 0; i < m; i++) // { // if (s[i] == 'I') /...
ALGO
0.999783
3.282005
434a25fd-ff3e-40ae-96c0-394e9c6a01aa
kimdongju1/basic-cpp-2024
day08/EmployeeManager2.cpp
#include <iostream> #include <cstring> using namespace std; class Employee // 고용인 의미하는 Employee 클래스 추가. 모든 고용인은 이름이 있으므로, 이와 관련된 멤버들을 기반으로 정의 { private: char name[100]; public: Employee(const char* name) { strcpy(this->name, name); } void ShowYourName() const { cout << "name: " << name << endl; } }; class...
TOOL
0.866375
4.258976
768c9dc9-f811-4648-939c-8e5ddb792faa
rohit8020/Competitive_Programming_Problems_Solutions_And_Concepts
XOR_split.cpp
#include<bits/stdc++.h> using namespace std; typedef long int l; typedef unsigned long int ul; typedef long long int ll; typedef unsigned long long int ull; #define memst(a, b) memset(a, (b), sizeof(a)) #define fr(i, j, k, in) for (ll i=j ; i<k ; i+=in) #define rfr(i, j, k, in) for (ll i=j ; i>=k ; i-=in) #define re...
ALGO
0.999655
4.214745
e83d1179-9596-4d5b-ae77-2574cdd7026d
viviansuzano/ocs2
ocs2_mpcnet/ocs2_legged_robot_mpcnet/src/LeggedRobotMpcnetDefinition.cpp
#include "ocs2_legged_robot_mpcnet/LeggedRobotMpcnetDefinition.h" #include <iostream> #include <ocs2_legged_robot/common/utils.h> #include <ocs2_legged_robot/gait/LegLogic.h> #include <ocs2_legged_robot/gait/MotionPhaseDefinition.h> #include <ocs2_robotic_tools/common/RotationTransforms.h> namespace ocs2 { namespace...
TOOL
0.928428
5.714463
91d98f62-782e-4402-b39b-6d015cab524e
xmirakulix/openttd-xmix
src/bridge_map.cpp
/* $Id$ */ /** @file bridge_map.cpp Map accessor functions for bridges. */ #include "stdafx.h" #include "landscape.h" #include "tunnelbridge_map.h" /** * Finds the end of a bridge in the specified direction starting at a middle tile * @param tile the bridge tile to find the bridge ramp for * @param dir the direc...
TOOL
0.984061
6.813138
8fa5e798-209b-4d43-aa68-4b6cca3e5246
indrajohn7/Problem-Solving
geeks_for_geeks/pattern_matching/wildcard.cpp
#include<bits/stdc++.h> using namespace std; #define SIZE 100 bool get_wild_card_pattern(string text, char* pattern) { const char* str = new char[SIZE]; //memset(str, '\0', SIZE); str = text.c_str(); int tlen, plen; tlen = strlen(str); plen = strlen(pattern); bool arr[plen][tlen]; for(int i = 0; i < plen; i++...
ALGO
0.999073
3.749705
bad77663-dc1c-4b68-a9f5-2af127b0296a
aanu2021/Leetcode-Solutions
0100-same-tree/0100-same-tree.cpp
class Solution { public: bool isSameTreeBFS(TreeNode* p, TreeNode* q) { if(p==NULL && q==NULL) return true; if(p==NULL || q==NULL) return false; queue<TreeNode*>q1,q2; q1.push(p); q2.push(q); while(!q1.empty() || !q2.empty()){ ...
ALGO
0.999991
6.308815
99d9182e-c62f-43d3-b696-b427a4e404d4
SPWW/LeetCode
Combination Sum.cpp
class Solution { public: vector<vector<int>> ret; void helper(const vector<int>& candidates,vector<int> v,int num,int b){ if(num == 0){ sort(v.begin(),v.end()); ret.push_back(v); return; } if(num < 0)return; for(int i = b ;i<candidates...
ALGO
0.999997
6.384152
11770bda-2606-4d40-84dd-59cf4fd589a5
Rohitrky2021/JavaSourceCode
=C--P/Coding-blocks-CP-master/Next_Greater_Element/Next_Greater_Element.cpp
/* Next Greater Element for any element present in the array is the first element occuring to the right of the element which is greater in value than the element. For example: arr = [5, 10, 14, 6, 12, 20] Next greater element for the elements are as following: 5 -> 10 10 -> 14 14 -> 20 ...
ALGO
0.999929
4.984983
ca0ada9b-f3f9-42e4-8160-9b1b8f32ebc4
divyang9575/CP
implementation/C_Tea_Tasting.cpp
#include<bits/stdc++.h> using namespace std; #ifndef ONLINE_JUDGE #define db(x) cerr << #x <<" "; _print(x); cerr << endl; #else #define db(x) #endif void _print(int t) {cerr << t;} void _print(long long int t) {cerr << t;} void _print(string t) {cerr << t;} void _print(char t) {cerr << t;} void _print(double t) {cerr...
ALGO
0.999906
3.223232
1067e763-a189-46a1-8d16-e53f8b89ea87
Mrsandman327/windows-book-code-c-
数据结构STL版/第5章/Algo5-3.cpp
//Algo5-3.cpp DFSTཫͼΪɭ֣Ժ-ֵܶ洢֮ #include "C5-1.h" #include "AdjListGraph.h" #include "CSTree.h" template<typename VerT, typename ArcT>class DFST: public AdjListGraph<VerT, ArcT> { private: vector<bool> Visited; void DFSTree(int v, CSNode<VerT>* &t) { bool first = true; int w; CSNode<Ve...
ALGO
0.999483
4.728303
987d50d3-6e36-4d66-b3dd-25b551a5f627
vishweshjatala/registersharing_hpdc16
RegisterSharing_GPGPU-Sim/v3.x/src/intersim2/allocators/wavefront.cpp
// $Id: wavefront.cpp 5262 2012-09-20 23:39:40Z dub $ /*wavefront.cpp * *The wave front allocator * */ #include "booksim.hpp" #include "wavefront.hpp" Wavefront::Wavefront( Module *parent, const string& name, int inputs, int outputs, bool skip_diags ) : DenseAllocator( parent, name, inputs, outputs ), ...
ALGO
0.999224
5.688231
93e098a5-8957-4b06-b32c-a800ac5bbc02
hksonngan/smart-kitchen-library
OpenCV/src/RegionLabelingEfficientGraph.cpp
/*! * @file RegionLabelingEfficientGraph.cpp * @author a_hasimoto * @date Date Created: 2012/Oct/07 * @date Last Change: 2013/Mar/21. */ #include "RegionLabelingEfficientGraph.h" #include "RegionLabelingEfficientGraph/segment-image.h" #include "sklcvutils.h" using namespace skl; /*! * @brief デフォルトコンストラクタ */ Re...
ALGO
0.999164
5.608762
551c1e17-59e5-487c-94a4-000b633bc34f
Rajeev0651/Codeforces
Set_4/x.cpp
//Jai Shree Ram #include <bits/stdc++.h> using namespace std; #define l long #define ll long long #define FOR(i, a, b) for (auto i = a; i <= b; i++) #define FOREV(i, a, b) for (auto i = a; i >= b; i--) void solve() { int N; cin >> N; int A[N]; for (int i = 0; i < N; i++) cin >> A[i]; int flag[N + 1]; ...
ALGO
0.999665
4.7241
c46006dc-5585-481d-bd49-43d49091abce
subarnasaikia/Problem-Solving
contests/codeforces/cf964/f.cpp
#include <bits/stdc++.h> using namespace std; // #include <ext/pb_ds/assoc_container.hpp> // using namespace __gnu_pbds; void fastio(){ ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); } #define ll long long typedef vector<int> vi; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typ...
ALGO
0.998968
4.241377
d36298b9-7b9a-40fe-9c9c-cc464a22dbdb
dEmON407/Semester1-Lab
MCA_136_B/week_06/W06_04.cpp
#include<iostream> using namespace std; int main() { int num1, num2, temp; int *ptr1, *ptr2; cout<<"Enter num1 :"; cin>>num1; cout<<"Enter num2 :"; cin>>num2; ptr1 = &num1; ptr2 = &num2; ++*ptr1; ++*ptr2; cout<<"\nNew value of num1 is :"<<num1<<endl; cout<<"New value of num2 is :"<<num2<<endl; r...
ALGO
0.999521
3.804332
b7e3a689-fabf-4831-bc0a-604908132b6a
avtomaton/blast-ncbi
c++/src/algo/winmask/seq_masker_util.cpp
#include <ncbi_pch.hpp> #include <algo/winmask/seq_masker_util.hpp> BEGIN_NCBI_SCOPE //------------------------------------------------------------------------- Uint1 CSeqMaskerUtil::BitCount( Uint4 mask, Uint1 bit_value ) { if( !bit_value ) return BitCount( ~mask, 1 ); else { Uint1 result = 0; ...
TOOL
0.918501
6.035769
c4696f44-d151-49fa-b31e-4c679f22a251
yyz845935161/sigin_cpp
Training/day39_1没做出来2复杂度超了.cpp
#include <iostream> using namespace std; #include <string> #include <vector> #include<math.h> int main() { int a, b; string s1, s2; while (cin >> s1 >> s2 >> a >> b) { s1.append(b - s1.size(), 'a'); s2.append(b - s2.size(), (char)('z' + 1)); int count = 0; vector<int> v(b + 1...
ALGO
0.999806
4.863214
0ae6c2e2-f064-4278-a81a-d868aa2f7579
mushanshanshan/LeetCode
1326. Minimum Number of Taps to Open to Water a Garden.cpp
class Solution { public: int minTaps(int n, vector<int>& ranges) { vector<int> farest(n+1, 0); int res = 0, N = ranges.size(), cur = 0, next = 0; for (int i=0; i<N; i++) { int l = max(0, i-ranges[i]); int r = min(n, i+ranges[i]); farest[l] = max(farest[l],...
ALGO
0.999978
5.916105
70a30b82-eace-4779-ac20-75157057931c
slimepiki/atcoder
abc141/d/main.cpp
using namespace std; using ll = long long; using ull = unsigned long long; #include <bits/stdc++.h> void debug_out() { cerr << endl; } template <typename Head, typename... Tail> void debug_out(Head H, Tail... T) { cerr << " " << to_string(H); debug_out(T...); } #ifdef __LOCAL #define debug(...) ...
ALGO
0.999748
4.082159
01ddf8c9-0a60-446b-b129-db8498d772a9
Isaac3105/Prog
teste_modelo2/Hanoi.cpp
#include <iostream> #include "Hanoi.h" Tower::Tower(int n_disks) : n_disks(n_disks), idx_top(0){ disks_ = new int[n_disks]; } Tower::~Tower() { delete[] disks_; } int Tower::top() const { if (idx_top == 0) return 0; return disks_[idx_top - 1]; } void Tower::add(int disk) { disks_[idx_top] = dis...
ALGO
0.995003
5.469775
ae928cfa-acc9-45e5-81e0-de19bd26b456
pixelpicosean/lp-oxygine-deprecated
examples/DemoBox2D/box2d/Box2D/Collision/b2CollideCircle.cpp
#include <Box2D/Collision/b2Collision.h> #include <Box2D/Collision/Shapes/b2CircleShape.h> #include <Box2D/Collision/Shapes/b2PolygonShape.h> void b2CollideCircles( b2Manifold* manifold, const b2CircleShape* circleA, const b2Transform& xfA, const b2CircleShape* circleB, const b2Transform& xfB) { manifold->pointCou...
ALGO
0.999186
7.760263
9907d838-718d-4850-af5b-e642afdcebf5
cubao/eigen-core-amalgamate
eigen-src/doc/examples/DenseBase_middleCols_int.cpp
#include <Eigen/Core> #include <iostream> using namespace Eigen; using namespace std; int main(void) { int const N = 5; MatrixXi A(N,N); A.setRandom(); cout << "A =\n" << A << '\n' << endl; cout << "A(1..3,:) =\n" << A.middleCols(1,3) << endl; return 0; }
ALGO
0.932241
3.133398
ca87dfed-4d4b-47f6-8b1f-f88999b70d2f
Yeluorag/ACM-ICPC-Code-Library
HDU/1513 Palindrome.cpp
#include <algorithm> #include <iostream> #include <sstream> #include <cstring> #include <cstdio> #include <vector> #include <string> #include <queue> #include <stack> #include <cmath> #include <set> #include <map> using namespace std; typedef long long LL; #define mem(a, n) memset(a, n, sizeof(a)) #define ALL(v) v.beg...
ALGO
0.999898
3.918193
50a6cf10-88f2-4a09-8a32-f900512f5474
dvalim/perlinfieldbot
circle.cpp
#define WINDOW #define OUTPUT #include "aural.hpp" #include <iostream> using namespace au; using namespace au::app; using namespace au::math; using namespace au::rnd; using namespace au::flame; const int color_number = 5; class baseApp : public App { using App::App; public: struct particle { ...
TOOL
0.958334
6.122792
66eb69e2-6c6e-452a-9732-fcd4693829d3
jorgenunezsiri/competitive-programming-solutions
COJ/1188.cpp
#include <iostream> #include <cstring> using namespace std; char a[11], b[11]; int sum; int main() { cin >> a >> b; for(int i = 0; i < strlen(a); i++) { for(int j = 0; j < strlen(b); j++) { sum += (a[i] - '0') * (b[j] - '0'); } } cout << sum << "\n"; return...
ALGO
0.999383
4.055799