uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
ed445dd0-6e80-4678-9caa-411d29233d34
bhavyagoel/LeetCode
5. January'22/1835-find-xor-sum-of-all-pairs-bitwise-and/1835-find-xor-sum-of-all-pairs-bitwise-and.cpp
class Solution { public: int getXORSum(vector<int>& arr1, vector<int>& arr2) { int a1 = 0; int n = arr1.size(); int m = arr2.size(); for(int i = 0 ; i < n; i++) { a1 ^= arr1[i]; } int b1 = 0; for(int i = 0 ; i < m; i++) { b...
ALGO
0.999949
5.506109
ed6bae63-0202-4b27-bb53-98f21f3d0b89
Subbuleo23/finding-nemo
UnacademyCourse/DPInterviewPrepMay2021/Lecture7/DungeonGame.cpp
// Problem Link - /* By Sanket Singh */ #include<bits/stdc++.h> //#include<ext/pb_ds/assoc_container.hpp> //#include<ext/pb_ds/tree_policy.hpp> //#include <ext/pb_ds/trie_policy.hpp> //using namespace __gnu_pbds; using namespace std; #define ll long long int #define ld long double #define mod 100000...
ALGO
0.999982
4.774969
c70d4187-0b76-4621-80f3-cdb70095bfd1
Viraj1975/DSA_C-
PW_Decode/Queue/firstNegativeinWindow.cpp
#include<bits/stdc++.h> using namespace std; int main(){ int arr[] = {3,-4,-7,30,7,-9,2,1,6,-1}; int k = 3; int n = sizeof(arr)/sizeof(arr[0]); queue<int>q; vector<int>ans; for(int i=0;i<n;i++){ if(arr[i]<0) q.push(i); } int i=0; while(i+k<=n){ while(q.size()>0 && ...
ALGO
0.999963
3.513976
929426f5-e63d-4dc3-9d7e-73d4f1009e23
JunheeLee7/Programers.CP
[프로그래머스 C++] rny_string.cpp
◈ 문제 설명 링크 ◈ 작성 코드 #include <string> #include <vector> using namespace std; string solution(string rny_string) { string answer = ""; for(int i = 0; i < rny_string.size(); i++) { if(rny_string[i] == 'm') { answer.push_back('r'); answer.push_back('n'); } ...
ALGO
0.99949
4.144288
873b9537-8d2a-4f2c-9a21-27e38e264988
ishandutta2007/codeforces
latte0119/normal/859/B.cpp
#include<bits/stdc++.h> using namespace std; #define int long long #define rep(i,n) for(int i=0;i<(n);i++) #define pb push_back #define all(v) (v).begin(),(v).end() #define fi first #define se second typedef vector<int>vint; typedef pair<int,int>pint; typedef vector<pint>vpint; template<typename A,typename B>inline ...
ALGO
0.999823
4.148805
f31ac69d-327c-4838-b74c-163ecf0525ae
suanhaitech/cppstudy2023
zhangjinghong_cppfiles/sort.cpp
#include<iostream> using namespace std; class Sort{ public: void bubble_sort(int a[],int n); void select_sort(int a[],int n); void quick_sort(int a[],int low,int high); }; //冒泡排序 void Sort::bubble_sort(int a[],int n){ int temp; for(int i= 0;i<n-1;i++){ for(int j = 0; j< n-i-1;j++){ ...
ALGO
0.999952
4.356019
cfed5caa-ef67-43cc-87bc-c130fa7e3fa3
pankaj443/CODEFORCES
free cash.cpp
#include<bits/stdc++.h> using namespace std; int main() { int n ; cin>>n; int a[n][2]; int count=1,max=1; for(int i=0 ;i<n;i++) { for(int j=0 ;j<2;j++) cin>>a[i][j]; } for(int i=1 ;i<n;i++) {if(a[i][1]==a[i-1][1]&&a[i][0]==a[i-1][0]) { ...
ALGO
0.999913
3.341028
081fdd57-dbd0-4299-9a35-a7a8b0456c6f
dhkim0821/DynaCoRE
DynaController/Mercury_Walking/WBWC.cpp
#include "WBWC.hpp" #include <Mercury_Controller/Mercury_StateProvider.hpp> WBWC::WBWC(const RobotSystem* robot): robot_sys_(robot), torque_cmd_(mercury::num_act_joint), mu_(0.3), dim_rforce_(6), qddot_(mercury::num_qdot), left_z_min_(0.), left_z_max_(250.), right_z_min_(0.), right_...
ALGO
0.999503
4.932433
358c7bf8-f811-4914-99a1-bc1743da0e9d
felix-rojas/verano-algos
act3.1/main.cpp
/** * Alexia Castillo Diaz y Félix Javier Rojas Gallardo * Ejemplo que implementa un Binary Search Tree (BST) * y los recorridos inorder, postorder, y preorder * * Compilacion para debug: * g++ -std=c++17 -g -o main *.cpp * Ejecucion con valgrind: * nix-env -iA nixpkgs.valgrind * valgrind --leak-check=fu...
ALGO
0.988144
3.927317
f5d41696-cf96-4fa7-98a5-1895d49d0304
rushikeshg25/Solutions
162-find-peak-element/162-find-peak-element.cpp
class Solution { public: int findPeakElement(vector<int>& nums) { int low=0,high=nums.size()-1,mid; int n=nums.size(); while(low<=high){ mid=low+(high-low)/2; if((mid==n-1 || nums[mid]>nums[mid+1]) && (mid==0 || nums[mid]>nums[mid-1])) return mid; else if(...
ALGO
0.999964
5.678018
955f46c8-7259-4020-8649-afbba9508fc0
ChunjiangChe/leetcode
leetcode207.cpp
#include<queue> #include<iostream> #include<vector> using namespace std; class Solution { public: bool canFinish(int numCourses, vector< vector<int> >& prerequisites) { vector<int> inDegree(numCourses, 0), outDegree(numCourses, 0); for(vector<int> path : prerequisites){ outDegree[path[0...
ALGO
0.9996
5.841258
9224ee1d-d5eb-4b68-970a-47343da344cf
Mindjolt2406/Competitive-Programming
Codeforces/496/D.cpp
#include<bits/stdc++.h> #define mt make_tuple #define mp make_pair #define pu push_back #define INF 1000000001 #define MOD 1000000007 #define ll long long int #define ld long double #define vi vector<int> #define vll vector<long long int> #define sc(n) scanf("%d",&n); #define scll(n) scanf("%lld",&n); #define scld(n) s...
ALGO
0.999891
3.658335
445eb143-823c-431d-8685-4b96b4d5563d
TanushreeSB/Code-1000
Patterns/trianglenum.cpp
#include<iostream> using namespace std; int main() { int n; cin>>n; int row = 1; while(row <= n) { //Print karo space (1st triangle) int space = n - row ; while(space) { cout<<" "; space = space -1; } //print 2nd triangle int...
ALGO
0.999995
4.028085
4838612a-9d3b-4f2c-82e1-7a6f88782747
shindesuyog/DSA
gfg/basic/fibonacci.cpp
//wrong ans #include <bits/stdc++.h> using namespace std; int main(){ int n, fib=0, a=1,b=1; cout<<"enter number "; cin>>n; cout<<"1 1 "; for(int i=2; i<=n; i++) { fib=a+b; cout<<fib<<" "; a=b; b=fib; } }
ALGO
0.999811
4.222955
4fb084f4-a3bd-461e-a8f0-f49956d85a60
janderkkotlarski/Boussigon
Boussigon_V0-10.cpp
#include <iostream> #include <string> #include <vector> #include <cassert> #include <chrono> #include <thread> #include <utility> #include <SFML/Graphics.hpp> struct player_circle { const float m_radius{10.0f}; const float m_thickness{3.0f}; sf::Color m_color{127, 127, 127}; sf::Vec...
TOOL
0.936781
4.942788
07163194-47b6-43cc-8a27-590a861e83cb
Pandosity/Competitive-Programming-and-Contests-
Lesson_2/next_greater_long.cpp
/*The algorithm here, which implements the solution showed in the slide, is explained via comments in the code. Time and space consumption are both O(n)*/ #include <iostream> #include <vector> #include <stack> using namespace std; vector<long> linear_solver(vector<long> A){ stack<int> S;//it will store positions ve...
ALGO
0.999904
4.125133
09476304-f90a-495b-a255-0cf4a8cb7e65
adhishm/blackout_gui
blackout.cpp
/** *@file blackout.cpp *@author Adhish Majumdar *@version 0.0.0 *@date 14/03/2013 *@brief File with definition of member functions of the class Blackout. *@details The Blackout class handles data and events required for the game. */ #include "blackout.h" /** * Constructor that initializes the game. */ Black...
TOOL
0.968497
5.403278
ad2dda05-4f7b-4613-8e2a-ba31e0ee6174
TW-a-coin/a-coin
src/protocol.cpp
#include <protocol.h> #include <util/system.h> static std::atomic<bool> g_initial_block_download_completed(false); namespace NetMsgType { const char *VERSION="version"; const char *VERACK="verack"; const char *ADDR="addr"; const char *ADDRV2="addrv2"; const char *SENDADDRV2="sendaddrv2"; const char *INV="inv"; const...
WEB
0.86084
6.575674
4a0cecd2-afb8-4f8a-b86c-d56c99f98750
jiy12345/Beakjoon-Online-Judge
Data Structure/10828 - 스택.cpp
#include<iostream> #include<map> using namespace std; #define STACK_CAPACITY 10000 enum STACK_COMMAND { PUSH, POP, SIZE, EMPTY, TOP }; map<string, int> stackCommandMap = { {"push", PUSH}, {"pop", POP}, {"size", SIZE}, {"empty", EMPTY}, {"top", TOP}, }; class stack { private: int stackArray[STACK_CAPACITY] =...
ALGO
0.997809
4.703897
f063da67-1f18-4f28-884b-342cc786e5e9
Min-03/Algorithm
02/2024_02_04/11559.cpp
#include <bits/stdc++.h> #define FastIO ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); using namespace std; char graph[12][6]; bool visited[12][6]; int n = 12, m = 6; int dx[] = {1, -1, 0, 0}; int dy[] = {0, 0, 1, -1}; bool bfs(int sx, int sy) { queue<pair<int, int>> q, nxt; q.push({sx, sy}); ...
ALGO
0.999825
4.603646
d8336f67-7fca-4fcb-b3d9-943183c77346
WaldonChen/eigen
test/clz.cpp
#include "main.h" template <typename T> int ref_clz(T val) { constexpr int kNumBits = sizeof(T) * CHAR_BIT; T kMsbMask = T(1) << (kNumBits - 1); int z = 0; for (; z < kNumBits && ((val & kMsbMask) == 0); ++z) { val <<= 1; } return z; } template <typename T> int ref_ctz(T val) { constexpr int kNumBit...
TEST
0.862971
6.884459
aa2bfa62-3100-4800-bff0-6b4e7ef2093f
AndreeaPurcaras/Kattis-Problems-Cpp-Python
Cpp/oddities.cpp
#include <iostream> using namespace std; int main() { int even; int formula; cin >> even; for (int i = 0; i < even; i++) { cin >> formula; if (formula%2 == 0){ cout<<formula <<" " << "is even\n";} else {cout<<formula <<" " << "is odd\n";} } }
ALGO
0.998211
3.772359
90cc1aed-cc64-4a1b-961c-b48255c4a38b
lixworth/cpp-playground
codeforces/space/cf/contest/1921/B/B.cpp
/* * Created by LixWorth on 2024/01/15 23:43 * Github: https://github.com/lixworth/ * Website: https://blog.lix.moe/ * Contact: <EMAIL> **/ //#include <bits/stdc++.h> #include <iostream> #include <algorithm> using namespace std; typedef long long ll; void solve() { int n; cin >> n; string s, f; c...
ALGO
0.999962
5.857875
1e2e1ce8-c180-432d-add9-6461d2a446fb
mark-petersen/c-plus-plus-practice
10_templates/templates.cpp
// g++ templates.cpp // ./a.out #include <iostream> constexpr size_t MPAS_VH = 1; constexpr size_t MPAS_HV = 2; constexpr size_t QUAD_VH = 3; constexpr size_t QUAD_HV = 4; // headers template <size_t MT> void RHS(); template <size_t MT> void term1(); template <> void term1<MPAS_VH>(); template <> void term1<QUAD_V...
ALGO
0.990377
4.771319
ecd90282-62fe-4244-95e1-f42f4aea2c60
ayushawasthi24/takeuforward-sheets
CP Sheets/Maths/A_Buy_a_Shovel.cpp
#include <bits/stdc++.h> using namespace std; //author: von_Braun #define ll long long #define lli long long int #define pb push_back #define rep(var, start, num) for(ulli var = start; var <start + num; var++) #define all(x) x.begin(), x.end() #define ulli unsigned long long int #define ull unsigned long long bool sort...
ALGO
0.999329
3.934138
6c307768-fcfb-43c8-b7ef-fa7142c7a2ba
jbm2593/Algorithm
Programmers/가장 먼 노드/dong/가장 먼 노드.cpp
#include <iostream> #include <string> #include <vector> #include <algorithm> #include <queue> using namespace std; queue<int> q; int arr[20001][20001]; int tmp[20001]; bool desc(int a, int b) { return a > b; } int solution(int n, vector<vector<int>> edge) { int answer = 0; int eg_size = (int)edge.size(); ...
ALGO
0.999515
4.569747
52512ef8-0a12-4cf7-8d2a-f5edcbe691c7
krlmlr/duckdb-r
src/duckdb/src/common/types/column/column_data_collection_segment.cpp
#include "duckdb/common/types/column/column_data_collection_segment.hpp" #include "duckdb/common/vector_operations/vector_operations.hpp" namespace duckdb { ColumnDataCollectionSegment::ColumnDataCollectionSegment(shared_ptr<ColumnDataAllocator> allocator_p, v...
TOOL
0.887222
6.159676
90c00fd5-3596-4856-a63c-036b16ada5e7
sjy0727/pvf_parser
src/pvf_encryption.cpp
#include "pvf/pvf_encryption.h" #include <cstring> namespace pvf { // CRC32 table (originally in crc32.cpp) static uint32_t crc32_tab[] = { 0x00000000L, 0x77073096L, 0xee0e612cL, 0x990951baL, 0x076dc419L, 0x706af48fL, 0xe963a535L, 0x9e6495a3L, 0x0edb8832L, 0x79dcb8a4L, 0xe0d5e91eL, 0x97d2d988L, 0x09b64c2bL, 0...
ALGO
0.998505
6.258953
fb9452f4-45d3-4414-a6f1-08fdb79490f7
Alexjuniorislareyes/PROGRAMACION-BASICA
ejercicio2 .cpp
#include<iostream> using namespace std; int main (){ float base1, base2,altura,area; cout<<"ingrese la base mayor: "; cin>>base1; cout<<"ingrese la base menor: "; cin>>base2; cout<<"ingrese la altura: "; cin>> altura; area =(base1+base2)*altura/2; cout<<"el area del trapecio es : "<<area; return 0; }
ALGO
0.911088
3.287406
9ca479d8-5fb4-4e64-85a4-bdbda5e9a922
raincross7/code-similarity
codes/train_code/problem303/problem303_244.cpp
#include<iostream> #include<math.h> #include<vector> using namespace std; char str1[1000000],str2[1000000]; int main(){ cin >> str1 >> str2; int count = 0; for(int i=0;str1[i];i++){ if(str1[i]!=str2[i])count++; } printf("%d\n",count); return 0; }
ALGO
0.999935
3.185479
6f4bf494-c3ec-45ef-863c-3a2c8064adc6
hajimeIppo-cmd/cp-codes
Baekjoon OJ/16000-16999/16563.cpp
#define _USE_MATH_DEFINES #include <bits/stdc++.h> using namespace std; #define ll long long const int MAXN = 5000000; vector<int> sp(MAXN + 1); vector<ll> prime; // Determine prime numbers between 1 and MAXN in O(MAXN) void linearSieve() { for (int i = 2;i <= MAXN; i++) { if (!sp[i]) { prime.push_back(i); ...
ALGO
0.999899
4.326374
5ff1506b-e3e8-4b05-ad87-a639ff272b70
WYK15/swift-Ollvm10
libcxx/test/std/algorithms/alg.sorting/alg.permutation.generators/prev_permutation_comp.pass.cpp
// <algorithm> // template<BidirectionalIterator Iter, StrictWeakOrder<auto, Iter::value_type> Compare> // requires ShuffleIterator<Iter> // && CopyConstructible<Compare> // bool // prev_permutation(Iter first, Iter last, Compare comp); #include <algorithm> #include <functional> #include <cassert> #inc...
TEST
0.907876
6.799718
34158fd2-7aa9-49f4-aaf9-891260af8816
mridulgupsss/Problem-Solving-Practice
236-lowest-common-ancestor-of-a-binary-tree/236-lowest-common-ancestor-of-a-binary-tree.cpp
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ class Solution { public: TreeNode* lowestCommonAncestor(TreeNode* root, TreeNode* p, TreeNode* q) { if(!root)ret...
ALGO
0.999987
6.089545
6dd25c22-5b7f-4097-8619-0a1d75f632bd
anipatil72/My_Competitive_Programming
A_Tavas_and_Nafas.cpp
// ॥ श्री गणेशाय नमः ॥ #include <bits/stdc++.h> #include <random> #include <complex> #include <tuple> #include <functional> // #include <ext/pb_ds/assoc_container.hpp> // #include <ext/pb_ds/tree_policy.hpp> #include <cstdint> #include <ctime> #include <cassert> #include <complex> #include <string> #include <cstring> ...
ALGO
0.999421
6.261679
2ac2e246-e2cf-40be-b6b1-25324fc6d934
113bommy/deepmind_codecontests_refine
cpp_gold_filter_file/cpp_train_9010_2.cpp
#include <bits/stdc++.h> using namespace std; const int N = 250; int n, m, B, ans; int co[N], sx[N], sy[N]; int mp[N][N], id[N], fl[N]; bool cmp(int x, int y) { return sy[x] < sy[y]; } const int ND = 500; struct edge { int to, next, f, v; } e[N * N]; int head[ND], cur[ND], tot; int S, T, dis[ND]; int q[ND * ND], tp[N...
ALGO
0.999927
3.443175
dbef96d1-b971-4e18-b826-af084e632d30
MedinologyTeam/MedunologyTrainer
Trainer/jni/eigen/doc/examples/class_CwiseUnaryOp.cpp
#include <Eigen/Core> #include <iostream> using namespace Eigen; using namespace std; // define a custom template unary functor template<typename Scalar> struct CwiseClampOp { CwiseClampOp(const Scalar& inf, const Scalar& sup) : m_inf(inf), m_sup(sup) {} const Scalar operator()(const Scalar& x) const { return x<m_...
ALGO
0.936786
6.417363
3dfb1627-d7de-49e2-b7d2-c722173c4fc6
hhhxiao/Leetcode
stash/ms08.04.cpp
#include <vector> #include "dbg.h" using namespace std; vector<vector<int>> subsets(vector<int>& nums) { std::vector<std::vector<int>> vect; size_t total_num = 1 << nums.size(); for (int i = 0; i < total_num; i++) { std::vector<int> v; int n = i; for (int j = 0; j < nums.size(); j...
ALGO
0.999909
5.495042
79b2726a-e191-4801-82cf-c35a000350fb
sarvex/leetcode-racket
solution/1000-1099/1079.Letter Tile Possibilities/Solution.cpp
class Solution { public: int numTilePossibilities(string tiles) { vector<int> cnt(26); for (char& c : tiles) ++cnt[c - 'A']; return dfs(cnt); } int dfs(vector<int>& cnt) { int res = 0; for (int i = 0; i < 26; ++i) { if (cnt[i]) { --cnt[i];...
ALGO
0.999981
6.903073
048baf75-a1b6-4106-9d47-1543e035780d
marre1002/99LIDARS
dbscan-v1.0.0/parallel_multicore/omp_main.cpp
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Files: omp_main.cpp clusters.cpp clusters.h utils.h utils.cpp */ /* dbscan.cpp dbscan.h kdtree2.cpp kdtree2.hpp */ /* */ /* Description: an openmp implementation of dbscan clustering al...
ALGO
0.980468
6.972789
76e76331-a8eb-407c-aa9a-d97ad09f8709
nafi103/Solved-Problems
Practice/2025/August/School_Dance.cpp
#include<bits/stdc++.h> #include<ext/pb_ds/assoc_container.hpp> #include<ext/pb_ds/tree_policy.hpp> using namespace std; using namespace chrono; using namespace __gnu_pbds; /****************************************************************/ #define int long long #define pi acos(-1.0) const int mod = 998244353; #defin...
ALGO
0.999975
4.178765
827f6680-69dc-4435-bffd-bd16e44f664f
GFG-CLUB-KIIT/100-Days-of-Code
AyushRaj/day24/Arithmetic_Square.cpp
/****************************** codificador10 *******************************/ #include <bits/stdc++.h> using namespace std; #define fastio() ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL) #define INF 1e18 #define ll long long int #define ld long double #define ull unsigned long long #define mod 1...
ALGO
0.999317
4.988841
5a80ae67-05eb-4447-843b-a831e3c162c2
Shivam010/daily-coding-problem
001-050/015/c++/code.cpp
// This file contains Solution to Challenge #015, run using // g++ 001-050/015/c++/code.cpp -o bin/out // ./bin/out < 001-050/015/c++/in.txt > 001-050/015/c++/out.txt #include <bits/stdc++.h> using namespace std; #define ll long long int main() { srand(time(NULL)); string n, res; ll cnt = 0; while (cin...
ALGO
0.998393
4.183286
b0b2c625-6133-4b01-aedc-bd5bb069dedb
ZhukDI/cpp_repository
Laba4_ListTemplate/laba4_ListTemplate.cpp
/* ** Cоздать шаблон класса для работы с односвязным списком. Применить его для решения задачи № 5 (лаб. работа № 3). */ #include <iostream> #include <clocale> #include <Windows.h>//для русского вывода char-ов using namespace std; template <class Type> struct listElement{ Type element; listElement *Next; }; templ...
ALGO
0.987034
3.737818
ebd8f82c-5aef-449c-99ce-5e5af1cb3847
shikhorroy/UVa-OJ-Problem-Solutions
11936 - The Lazy Lumberjacks/11936 - The Lazy Lumberjacks.cpp
#include<algorithm> #include<cstdio> #include<iostream> using namespace std; int main() { int num[3]; int i,j; int _case; scanf("%dd",&_case); for(i=0;i<_case;i++) { for(j=0;j<3;j++) scanf("%d",&num[j]); sort(num,num+3); if((num[0]+num[1])>num[2]) ...
ALGO
0.995659
3.466685
cb7f74db-6777-4bfd-affc-3a553b8ce81d
ProtonAOSP-lavender/android_frameworks_av
media/libeffects/testlibs/AudioCoefInterpolator.cpp
#include <string.h> #include <cutils/compiler.h> #include "AudioCoefInterpolator.h" namespace android { AudioCoefInterpolator::AudioCoefInterpolator(size_t nInDims, const size_t inDims[], size_t nOutDims, ...
ALGO
0.947341
6.436342
b5bb9e18-759e-420b-a26e-7c02019aa116
Sahil-Mahawer/Leetcode_problem
0144-binary-tree-preorder-traversal/0144-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.999993
6.077087
6c4b163b-70cf-4f57-a131-46b4b49fec88
Fork512Hz/Fork512Hz_Codeforces
misc/714AS.cpp
#include<cstdio> #include<algorithm> #include<iostream> #include<cstring> #include<utility> #include<vector> #include<cmath> using namespace std; typedef pair<long long, long long> pii; typedef vector<long long> vint; typedef long long ll; //#define DEBUG #define MULTI #ifdef DEBUG const long long N = 1000; #endif #i...
ALGO
0.99984
3.495551
d2397b34-21ef-4036-a8e2-18dd5ad32511
sandeepkumar75/DSA_HacktoberFest2K22
seive.cpp
#include <bits/stdc++.h> typedef long long ll; #define max 1000000 using namespace std; vector<ll>isp(max,1); void seive(){ isp[0]=isp[1]=0; for(ll i=2;i<=max;i++){ if(isp[i]==1) { isp[i]=i; //primes.push_back(i); for(ll j=i *i ;j<=max;j+=i) { ...
ALGO
0.997851
3.378103
7ccaf28e-edea-4449-b5d9-fcbe42b6801d
a5tronomy/ue5-ffcotw
Engine/Source/ThirdParty/Intel/TBB/IntelTBB-2019u8/examples/graph/som/som.cpp
// // Self-organizing map in TBB flow::graph // // we will do a color map (the simple example.) // // serial algorithm // // initialize map with vectors (could be random, gradient, or something else) // for some number of iterations // update radius r, weight of change L // for each ex...
ALGO
0.999936
5.545004
5800b754-dfdf-4dfc-9777-1cb5957cc57c
suhyunNam000/acmicpc_practice
1932.cpp
#include <iostream> using namespace std; // ﰢ //https://www.acmicpc.net/problem/1932 int N; int tri[501][501] = { 0 }; int MAX(int a, int b) { if (a > b) return a; else return b; } int main() { cin >> N; for (int i = 0; i < N; i++) { for (int j = 0; j <= i; j++) cin >> tri[i][j]; } for (int lv = 1; lv ...
ALGO
0.999966
3.871784
18a38378-abe1-412e-aad6-b2ef97aed282
Deepanshurathore01/CoderArmy180Days_DSA
Week13_DSA/Searching/BinarySearch/Binarysearc.cpp
#include<iostream> using namespace std; // for non decreasing array bool BinarySearch(int arr[] , int start ,int end ,int X) { if(start > end) return 0; int mid = start + (end-start)/2; if(arr[mid] == X) return 1; else if(arr[mid] < X) return BinarySearch(arr,mid+1,end,X); else return BinarySear...
ALGO
0.99998
3.62358
36e69b41-bb51-459c-89a0-810e859ab10f
darkwuta/-CSC417-Assignment
Assignment1/extern/libigl/include/igl/invert_diag.cpp
template <typename T> IGL_INLINE void igl::invert_diag( const Eigen::SparseMatrix<T>& X, Eigen::SparseMatrix<T>& Y) { #ifndef NDEBUG typename Eigen::SparseVector<T> dX = X.diagonal().sparseView(); // Check that there are no zeros along the diagonal assert(dX.nonZeros() == dX.size()); #endif // http://www.a...
ALGO
0.999026
5.066147
b8d45d02-3103-4f9c-bd14-0906706c35f9
Z841973620/llama.cpp-tegra
llama.cpp/ggml/src/ggml-cpu/kleidiai/kernels.cpp
// KleidiAI micro-kernels #include "kai_matmul_clamp_f32_qsi8d32p_qsi4c32p_interface.h" #include "kai_matmul_clamp_f32_qsi8d32p1x8_qsi4c32p4x8_1x4x32_neon_dotprod.h" #include "kai_matmul_clamp_f32_qsi8d32p1x4_qsi4c32p4x4_1x4_neon_dotprod.h" #include "kai_matmul_clamp_f32_qsi8d32p4x4_qsi4c32p4x4_16x4_neon_dotprod.h" #in...
CONFIG
0.981513
5.713571
3f60fe8c-be72-4a8e-89a1-0210e7f5db5b
longathelstan/learncplusplus
LOPTHAYNAM/BUOI1/LONG/PPOINT.cpp
#include <bits/stdc++.h> #define ll long long using namespace std; const int limit = 1e6+8; int main() { ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); freopen("PPOINT.INP", "r", stdin); freopen("PPOINT.OUT", "w", stdout); int n, d[4] = {0}; ll ans = LLONG_MAX; pair<ll, ll> a[limi...
ALGO
0.999986
4.120509
ead715e0-3c9a-4fa0-b2e7-45b3d7843bb5
geo-wurth/URI
C++/1038 - Lanche.cpp
#include <iostream> #include <iomanip> using namespace std; int main(){ int item, qtd; double valor; cin >> item >> qtd; switch (item){ case 1: valor = qtd * 4; break; case 2: valor = qtd * 4.5; break; case 3: valor = qtd * 5; break; case 4: valor = qtd * 2; break; case 5: val...
ALGO
0.997504
4.412247
0595b81b-0dab-4388-9aa7-692c854bc224
adarshdbg/LeetCode
Leetcode_binary_search/Koko Eating Bananas.cpp
static const auto _____ = []() { // fast IO code : this I understand ios::sync_with_stdio(false); cin.tie(0); return 0; }(); class Solution { public: int binary(vector<int>&v,int l,int r,int h) { if(l<=r) { int ans=0; int mid=l + (r-l)/2; for(in...
ALGO
0.999924
5.241367
7b37a998-867e-4b9f-9cb8-7cbf83f29efb
ishandutta2007/codeforces
ezoilearner/normal/341/D.cpp
#include<iostream> #include<cstring> #include<cstdio> #include<algorithm> using namespace std; typedef long long ll; int n,m; #define maxn 1010 ll sumv[2][2][maxn][maxn]; int lowbit(int &x){return x&(-x);} void Add(int x,int y,ll v){ for(int i=x;i<=n;i+=lowbit(i)) for(int j=y;j<=n;j+=lowbit(j)) sumv[x&1][y&1][i][j]^...
ALGO
0.99975
3.560042
4e685af4-2a97-4a2a-aa95-6ccc82fa5377
Rajada/College-Classwork
C++/Mersenne Numbers/Project1.cpp
/***************************************************** Jared Petersen CISP 400 - MW 3:00 pm Programming Project 1 February 19, 2014 *****************************************************/ #include <iostream> #include <time.h> #include <sys/timeb.h> using namespace std; bool IsPrime( unsigned long lon...
ALGO
0.999424
4.818833
4138f4d7-f531-4c11-aa78-7c83050e3853
Mr-Phoebe/ACM-ICPC
比赛源码/2014 Multi-University Training Contest 10/1001.cpp
#include <cstdio> #include <cstring> #include <vector> #include <algorithm> #define sz 1000 #define inf 0x3fffffff using namespace std; int n,m; int a[sz],b[sz]; vector <int> p[sz]; vector <int> g[sz],ng[sz]; int low[sz],dfn[sz],stack[sz],instack[sz],belong[sz],cost[sz]; int deep,top,kinds; void tarjan(int s) { low...
ALGO
0.999864
3.514104
04e281a9-56e8-41b4-b02f-d379890010bd
ramumsrk/codeforces.com
group/MWSDmqGsZm/contest/219158/problem/V/src/v_comparison_implementation.cpp
#include "v_comparison_constraints.hpp" #include <iostream> #include <format> // Function definition int read_first_number() { std::cout<<std::format( "Enter first number: " )<<std::endl; int first_number {}; std::cin>>first_number; return first_number; } // Function definition int read_second_number()...
TOOL
0.983334
4.705349
4980e727-7657-4a44-ac63-87eedb44d9f6
Rikon07/XPSC
Week 11/Day 1/C_Little_Girl_and_Maximum_Sum.cpp
#include<bits/stdc++.h> using namespace std; typedef long long int ll; int main() { ll n,q; cin >> n >> q; vector<ll> ar(n), d(n+2), pre(n+1); for(auto &ele : ar) cin >> ele; while(q--) { ll l, r; cin >> l >> r; d[l] += 1; d[r+1] -= 1; } for(in...
ALGO
0.99999
4.370001
c679205f-b041-44d1-90ad-641a8fa43def
arpansahu/LinkedListInCandCpp
singly linked list/delete_a_node__at_position.cpp
// A simple C program to introduce // a linked list #include <stdio.h> #include <stdlib.h> struct node{ int data; struct node * next; }; struct node* start = NULL; void insertStart(struct node ** s,int data); void insertLast(struct node **s,int data); void insertAtPos(struct node **s,int data,int loopVar); void...
ALGO
0.998829
3.005699
3f9afc78-c49f-4ef1-b2df-674416290012
yosukesan/traning
at_coder/2020_panasonic/c/main.cpp
#include <iostream> #include <string> #include <algorithm> #include <set> #include <cmath> #include <vector> #include <numeric> #include <map> #include <unordered_map> #include <unordered_set> #include <queue> #include <tuple> using ll = long long int; using ul = unsigned long long int; const ll LL_MAX (1LL<<60); con...
ALGO
0.999961
3.940714
6735b29a-f485-4782-b21f-26bd03cc7903
jeong011010/baekjoon
solved.ac/7576/7576.cpp
#include<iostream> #include<queue> #include<tuple> using namespace std; int m, n; int arr[1001][1001]; queue<tuple<int, int, int>> q; int bfs() { int cnt; for(int i = 1; i <= n; i++) for (int j = 1; j <= m; j++) { if (arr[i][j] == 1) q.push(make_tuple(i, j, 0)); } if (q.empty()) return -1; while (!q.empty(...
ALGO
0.999589
4.134118
c6ade0d0-218b-477d-9960-a622ce512843
raincross7/code-similarity
codes/train_code/problem221/problem221_243.cpp
#include <iostream> using namespace std; using ll = long long; using ld = long double; #define ALL(x) begin(x), end(x) #define REP(i, n) for (size_t i = 0, i##_len = (n); i < i##_len; ++i) void solve(ll N, ll K) { cout << (N%K != 0) << endl; } int main() { ll N; cin >> N; ll K; cin >> K; solve(N, K); ...
ALGO
0.999775
3.988732
b60b29e0-78c6-4cf2-a331-e86adba760fa
diyagoyal98/Leetcode-Questions
0230-kth-smallest-element-in-a-bst/0230-kth-smallest-element-in-a-bst.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.999993
5.57695
8d3aea38-ee41-4e7f-bb39-fc40dea3e668
SanketSarmalkar/Compass_App_using_Flutter
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.998859
6.785645
29f9b5be-1cbe-4edf-aa51-6616030e0682
Suryansh23-IT/LEETHUBSOLUTION
0168-excel-sheet-column-title/0168-excel-sheet-column-title.cpp
class Solution { public: string convertToTitle(int columnNumber) { string str; vector<char> rev; while(columnNumber>0){ columnNumber--; char ch=65+(columnNumber)%26; columnNumber/=26; rev.push_back(ch); } for(int j=rev.size()-1;...
ALGO
0.999922
5.935207
c2fe7cfd-fa08-44be-93f7-8ec1b6cf6b31
raincross7/code-similarity
codes/train_code/problem156/problem156_190.cpp
#include <iostream> #include <iomanip> #include <cmath> using namespace std; int main() { double a, b, C; cin >> a >> b >> C; C *= M_PI / 180; double h = b * sin(C); double S = a * h / 2; double c = sqrt(pow(a,2) + pow(b,2) - 2 * a * b * cos(C)); double L = a + b + c; cout << fixe...
ALGO
0.99974
3.851234
8e1ff699-2274-4ca1-8143-7723a5c70acd
VenusCh001/bloodSweatTears
2Darray/maxNumberOf1.cpp
#include<iostream> #include<vector> using namespace std; int main(){ int m,n,index; cout<<"enter row";cin>>m; cout<<"enter column";cin>>n; int max=INT_MIN; vector<vector<int>> A(m,vector<int>(n)); cout<<"enter the elements : "<<endl; for(int i=0;i<m;i++){ for(int j=0;j<...
ALGO
0.999644
4.342077
4977c707-0942-4445-ac15-acf9e6a9f228
shamilkvv/sha1
sha1/sha1.cpp
#include <iostream> #include <string> #include <vector> #include <cstdio> template <typename T> T leftСyclicShift(T value, int positions) { const int bitSize = sizeof(T) * 8; return (value << positions) | (value >> (bitSize - positions)); } unsigned int nonLinFunc(int i, unsigned int B, unsigned int C, unsign...
ALGO
0.999652
6.114349
bcacccc6-3532-4959-b4e0-8440969dcd12
rajdeepf1/quiz_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.9988
6.76073
1da07dda-8c98-48e7-93b3-58b7b8442eb9
prognant/nomad
tools/SENSITIVITY/problems/styrene/black-box/truth/RungeKutta.cpp
#include "RungeKutta.hpp" #include <iomanip> using namespace std; template <class E> RungeKutta<E>::RungeKutta(int dim) { m = dim; k1 = new double[m]; k2 = new double[m]; k3 = new double[m]; k4 = new double[m]; y = new double[m]; y_tmp = new double[m]; } template <class E> RungeKutta<E>::~Runge...
ALGO
0.999665
4.923023
5cce104a-d481-403e-941e-da4923412745
ArefinAlter/ProblemSolving
codeforces/757/G.cpp
#include<bits/stdc++.h> using namespace std; const int N = 2e5 + 9, M = N * 2 + N * 20 * 2; vector<pair<int, int>> g[N * 2], G[N]; inline void add_edge(int u, int v, int w) { g[u].push_back({v, w}); } int T; void binarize(int u, int p = 0) { int last = 0, tmp = 0; for (auto e : G[u]) { int v = e.first, w ...
ALGO
0.99996
4.395066
d82a6f58-4ddb-43c6-9aa4-b0624b1d49eb
hyungyu-02/CppStudy_BJ_Army
7662.cpp
//multiset 으로 풂 #include <iostream> #include <set> //자동 오름차순 정렬, 중복 값 허용, 중위 순회 사용 using namespace std; int t, k; char order; int info; multiset<int> ms; int main(){ ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); cin>>t; while(t--){ cin>>k; ms.clear(); while(k--){ cin>>order; cin>>info; ...
ALGO
0.997264
3.939835
52cb653d-4bde-424c-95a2-8cea3d5b8dd0
rasikamekhe/DSA
deque.cpp
/* A double-ended queue (deque) is a linear list in which additions and deletions may be made at either end. Obtain a data representation mapping a deque into a one-dimensional array. Write C++ program to simulate deque with functions to add and delete elements from either end of the deque. */ #include <iostream> usi...
ALGO
0.997703
6.221932
8d235ba5-e1d3-49da-af6d-936d3df2c460
heavenMOJANG/ICPC
.history/programmes_C_Cpp/2025金马高校/H_20250517141025.cpp
#pragma GCC optimize(1) #pragma GCC optimize(2) #pragma GCC optimize(3, "Ofast", "inline") #include <bits/stdc++.h> #define int long long using namespace std; constexpr int INF = 0x7fffffff; constexpr int N = 1e6 + 10; vector<int> g[N]; int n, fa[N]; int v0[N], v1[N], vis[N]; pair<int, int> a[N]; void solve() { cin...
ALGO
0.999765
4.271148
bd07fa9e-bec6-4149-b8da-c743d9245149
chakitg/cp_solutions
gfg-potd/Check for Children Sum Property in a Binary Tree.cpp
Given a binary tree having n nodes. Check whether all of its nodes have the value equal to the sum of their child nodes. Return 1 if all the nodes in the tree satisfy the given properties, else it return 0. For every node, data value must be equal to the sum of data values in left and right children. Consider data val...
ALGO
0.999958
6.103507
6ab6165f-f27d-4b2b-8d00-099e018116e8
Utkarsh-Arora-007/GFG-Self-Paced-Course
Gfg DSA Self Paced Course/LinkedList/29. Detect Loop.cpp
//Method : Changing References / Pointers. #include<bits/stdc++.h> using namespace std; struct Node{ int data; Node *next; Node(int x){ data = x; next = NULL; } }; bool isLoop(Node *head) { Node *temp = new Node(0); Node *curr = head; while(curr!= NULL) { if(cu...
ALGO
0.999775
4.562508
6fdb6a74-b14f-4c25-b6cd-5d49b84527ce
AndreiGwn/PTY-Quest-1-AG
Library/PackageCache/com.unity.ide.visualstudio@2.0.22/Editor/COMIntegration/COMIntegration~/COMIntegration.cpp
#include <iostream> #include <sstream> #include <string> #include <filesystem> #include <windows.h> #include <shlwapi.h> #include <fcntl.h> #include <io.h> #include "BStrHolder.h" #include "ComPtr.h" #include "dte80a.tlh" constexpr int RETRY_INTERVAL_MS = 150; constexpr int TIMEOUT_MS = 10000; // Often a DTE call m...
TOOL
0.94874
6.933585
61828ab6-a7e5-447d-b646-d1c05719de07
kevintelloarevalo/Reconocedor-Facial-OpenCV
entrenamientos opencv ruidos/opencv-master/samples/cpp/train_svmsgd.cpp
#include "opencv2/core.hpp" #include "opencv2/video/tracking.hpp" #include "opencv2/imgproc.hpp" #include "opencv2/highgui.hpp" #include "opencv2/ml.hpp" using namespace cv; using namespace cv::ml; struct Data { Mat img; Mat samples; //Set of train samples. Contains points on image Mat responses;...
ALGO
0.981334
5.006021
cb198846-a085-4a02-8de0-afefbd679d33
azamalijafri/CSES
Sorting And Searching/FerrisWheel.cpp
#include<bits/stdc++.h> #define ll long long using namespace std; int main() { ll x, n; cin >> n >> x; int weights[n]; ll res = 0; for(int i=0; i<n; i++) cin >> weights[i]; sort(weights, weights+n); int i=0, j=n-1; while(i <= j) { if(weights[i] + weights[j] <= x) { i++; j--; } ...
ALGO
0.999971
4.256351
cad21f19-d274-4c2b-bde7-45b98b506898
sahapranta/practice-c
ph-dsa/binary-tree/practice-d1-18.5/level-order.cpp
// https://www.naukri.com/code360/problems/level-order-traversal_796002?leftPanelTabValue=SUBMISSION #include <bits/stdc++.h> using namespace std; template <typename T> class BinaryTreeNode { public: T val; BinaryTreeNode<T> *left; BinaryTreeNode<T> *right; BinaryTreeNode(T val) { this->va...
ALGO
0.99986
5.117446
0574e300-acd8-482d-bb9f-c21e5fb9d6bb
whatlulumomo/Computer-Photography
实验8-全景拼接与SIFT算法/工程/OpencV/sift.cpp
#include <opencv2\opencv.hpp> #include <opencv2\highgui\highgui.hpp> #include <opencv2\nonfree\features2d.hpp> #include <opencv2\legacy\legacy.hpp> #include <math.h> #include <vector> #include <string> using namespace cv; using namespace std; class CylindricalPanorama { public: virtual bool makePanorama(vector<Mat>& ...
ALGO
0.989497
4.086291
4cbd8a16-4bb2-47e5-acda-734aebf55159
rahuldohare007/LeetCode2022-CPP
45. Jump Game II.cpp
/* Given an array of non-negative integers nums, you are initially positioned at the first index of the array. Each element in the array represents your maximum jump length at that position. Your goal is to reach the last index in the minimum number of jumps. You can assume that you can always reach the last index. Ex...
ALGO
0.999998
6.00357
0e609079-90f1-4b64-9d66-c04b97c11d40
Chase07/Cpp-Primer-Exercise
Chapter11/11-8.cpp
#include<iostream> #include<set> #include<map> #include<vector> #include<string> #include<fstream> #include<algorithm> #include<numeric> using namespace::std; inline void change(string& word, set<char> punctuation) { for_each(word.begin(), word.end(), [](char& c) { if (isupper(c)) { c = tolower(c); } }); for (auto ...
ALGO
0.999099
4.665146
073c974b-d57b-484b-b3d0-9a8553fef6de
bola-nabil/atcoder
abc172_b.cpp
// bola nabil #include <bits/stdc++.h> using namespace std; void solve() { string s, t; cin >> s >> t; int count = 0; for (int i = 0; i < s.length(); i++) { if (s[i] != t[i]) count++; } cout << count; } int main() { solve(); return 0; }
ALGO
0.999942
3.934612
2ac67db5-9d1d-4a6b-9003-0d556d24cbba
Ahtisham2486/DataStructuresAndAlgorithms
vectors.cpp
#include <iostream> //using namespace std; int main(){ int n, m; std::cout<< " enter the values of n and m"; std::cin>>n; std::cin>>m; int sum = n+m; std::cout<< "the sum of two numbers is :"<< sum ; return 0; }
ALGO
0.975177
3.155819
64842b35-0b8f-427d-a337-affbac4d4b66
MarkusWynandVenter/GraphCalculator
src/equationSimplify.cpp
#include "equationSimplify.h" EquationSimplify::EquationSimplify(string parEquation) { setEquation(parEquation); } EquationSimplify::~EquationSimplify() { } void EquationSimplify::solveEquation() { //Simplifies the equation and calls for the solution to be printed setSolvedEquation("Simplify"); printS...
TOOL
0.992786
3.259919
9055ede1-48af-4a5e-81e9-e8aa84f81447
jgjung9/algorithm-test-practice
BOJ/C++/done/15666.cpp
/** * https://www.acmicpc.net/problem/15666 * */ #include <iostream> #include <algorithm> using namespace std; int number[8] = {0}; int answer[8] = {0}; void Permutation(int n, int m, int idx) { if (m == idx) { for (int i = 0; i < m; i++) cout << answer[i] << ' '; cout << '\n'; ...
ALGO
0.999988
3.739411
9bb79ada-4300-4b93-a7e8-f6caa5a0a2f5
phil-de-choc/bot_arctor_mm
waypoint.cpp
// HPB bot - botman's High Ping Bastard bot // // (http://planethalflife.com/botman/) // // waypoint.cpp // #ifndef __linux__ #include <io.h> #endif #include <fcntl.h> #ifndef __linux__ #include <sys\stat.h> #else #include <string.h> #include <sys/stat.h> #endif #include <extdll.h> #include <dllapi.h> #include <h_e...
TOOL
0.97481
3.804639
79d09df0-9307-48fc-a54d-8108e23e7d6b
maple3142/Practice
sprout_pretest/2018/D.cpp
#include<iostream> using namespace std; int ar[2005]; bool vis[2005]; int dfs(int x){ if(vis[x])return 0; vis[x]=true; int r=dfs(ar[x])+1; vis[x]=false; return r; } int main(void){ ios::sync_with_stdio(false); int n; cin>>n; for(int i=1;i<=n;i++){ cin>>ar[i]; } int mx=0; for(int i=1;i<=n;i++){ mx=max(m...
ALGO
0.999936
3.801627
2c2d687c-d763-4fe6-b77b-9d1bf3c68b89
sugrob9000/comp-math
src/integral/calc.cpp
#include <integral/calc.hpp> #include <util/util.hpp> namespace math { double integrate_rect (double (*f) (double), double low, double high, unsigned n, Rect_offset offset) { const double step = (high - low) / n; switch (offset) { case Rect_offset::left: break; case Rect_offset::middle: low += step * 0.5; break; ...
ALGO
0.999386
6.54907
0b10d8cb-1d03-4f5d-beb4-67ccfaee1545
113bommy/deepmind_codecontests_refine
cpp_source_filter_file/cpp_train_5428_13.cpp
#include <bits/stdc++.h> using namespace std; int m, n; int dp[41][64][64]; int main() { cin >> m >> n; if (n < m) swap(m, n); memset(dp, 63, sizeof(dp)); int g = (1 << m); for (int k = 0; k < g; k++) dp[1][0][k] = 0; for (int i = 1; i <= n; i++) { for (int j = 0; j < g; j++) { for (int k = 0; k <...
ALGO
0.999976
3.958248
ea939922-a63d-40fb-bf5f-8a16bff86883
riscv-spectre-mitigations/llvm_retpoline
libc/src/math/generic/llrintl.cpp
#include "src/math/llrintl.h" #include "src/__support/FPUtil/NearestIntegerOperations.h" #include "src/__support/common.h" namespace __llvm_libc { LLVM_LIBC_FUNCTION(long long, llrintl, (long double x)) { return fputil::roundToSignedIntegerUsingCurrentRoundingMode<long double, ...
TOOL
0.976829
5.760077
13592769-f11f-4584-85c6-8cf9229ff32b
ZhangshenHuang/Algorithm
07二叉树/12二叉树的最大深度_104.cpp
/** * 高度:节点到叶子节点的距离 后序遍历 * 深度:节点到根节点的距离 先序遍历 * 求出高度就可得到深度?因为根节点的高度就是二叉树的最大深度 * 很多题解都是使用后序遍历求高度 进而得到深度信息 */ #include <iostream> #include <vector> #include <queue> using namespace std; struct TreeNode { int val; TreeNode* left; TreeNode* right; TreeNode() : val(0), left(nullptr), right(nullptr) {} ...
ALGO
0.999941
5.98928
dd6438ba-e446-4568-b135-ba257f8f4545
s3rgiux/ArduCopter-3.2-rc1-Px4Flow
libraries/AP_AHRS/AP_AHRS_DCM.cpp
/// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- #include <AP_AHRS.h> #include <AP_HAL.h> extern const AP_HAL::HAL& hal; // this is the speed in m/s above which we first get a yaw lock with // the GPS #define GPS_SPEED_MIN 3 // the limit (in degrees/second) beyond which we stop integrat...
TOOL
0.920797
5.897321
daa572bf-275f-49f0-81f4-bcbef769e104
qyunhuang/PTA
basic/1055.cpp
/* 拍集体照时队形很重要,这里对给定的 N 个人 K 排的队形设计排队规则如下: 每排人数为 N/K(向下取整),多出来的人全部站在最后一排; 后排所有人的个子都不比前排任何人矮; 每排中最高者站中间(中间位置为 m/2+1,其中 m 为该排人数,除法向下取整); 每排其他人以中间人为轴,按身高非增序,先右后左交替入队站在中间人的两侧(例如5人身高为190、188、186、175、170,则队形为175、188、190、186、170。这里假设你面对拍照者,所以你的左边是中间人的右边); 若多人身高相同,则按名字的字典序升序排列。这里保证无重名。 现给定一组拍照人,请编写程序输出他们的队形。 输入格式: 每个输入包含 1 个测试...
ALGO
0.999501
5.058086
4814e214-14ee-4b3f-93cd-f35cd90ed0db
Jaan19867/AlgoZenith
B-Practise/BCatFoxandtheLonelyArray.cpp
#include<bits/stdc++.h> using namespace std; #define int long long int check(int k,int arr[],int n ){ vector<int> bits(21,0); // freq of set bits for( int i=0;i<k;i++){ for( int bit=0;bit<21;bit++){ if((arr[i]&(1<<bit))==1){ bits[bit]++; } } ...
ALGO
0.998904
5.461779
af503503-85d8-4eb1-bc96-b8ebc4a5e87d
yeseongmoon/hanhwa_veda
Basic_Cpp_language/ch04/min.cpp
#include <iostream> using namespace std; int GetMin(int a, int b) { return a > b ? b : a; } double GetMin(double a, double b) { return a > b ? b : a; } string GetMin(string a, string b) { return a > b ? b : a; } int GetMin(int arr[], int size) { int min = arr[0]; for (int i = 0; i < size; i++) { if (min > ...
ALGO
0.986481
3.75271