uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
0ee52abb-b318-4119-8d44-c8b5ac56a740
xuyichen2010/TeamC_Navigation
src/Onboard-SDK-ROS/Onboard-SDK-3.8.1/osdk-core/protocol/src/dji_aes.cpp
/** @file AES256.cpp * @version 3.3 * @date April 12th, 2017 * * @Copyright (c) 2016-2017 DJI * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including witho...
ALGO
0.99896
6.503984
d0abb6d8-7428-4a1a-acba-9ff8c4f96748
koyc-code/C-Exercises
hw1/2.1-Computes the average and standard deviation/main.cpp
#include <iostream> #include <vector> using namespace std; int main() { int num;//numbers of scores float tot,ave,dev_temp,dev,temp; while (cin >> num) { vector <int> score; tot = 0; dev_temp = 0; for (int i = 0; i < num; i++) { cin >> temp; score.push_back(temp); tot += score[i]; } ave = tot / n...
ALGO
0.97942
3.486022
8bc59f28-6119-46f2-8a55-364df5829cee
TwilightZrui/LeetCode
algorithm_test/histogram/histogram.cpp
#include <iostream> #include <cmath> #include <cstring> #include <string> #include <vector> #include <stack> #include <ctype.h> using namespace std; class histogram { public: int largestRectangleArea(vector<int>& heights) { stack<int> sta; sta.push(-1); int maxArea = 0; for(int i=0;i<heights.si...
ALGO
0.999879
5.428822
39f72cd9-63d0-496b-b16c-200233853763
omi-sha/Leetcode_sols
2010-check-if-word-equals-summation-of-two-words/check-if-word-equals-summation-of-two-words.cpp
class Solution { public: bool isSumEqual(string firstWord, string secondWord, string targetWord) { int first = 0; int second = 0; int target = 0; for(int i = 0; i < firstWord.size(); i++) first = first*10 + (firstWord[i] - 'a'); for(int i = 0;i < second...
ALGO
0.999804
6.464886
b478896a-fad0-4b37-a866-dbd9165d3f85
ishandutta2007/codeforces
wzyyn/normal/631/E.cpp
#include<bits/stdc++.h> #define ll long long #define ull unsigned ll #define uint unsigned #define pii pair<int,int> #define pll pair<ll,ll> #define IT iterator #define PB push_back #define fi first #define se second #define For(i,j,k) for (int i=(int)(j);i<=(int)(k);i++) #define Rep(i,j,k) for (int i=(int)(j);i>=(int)...
ALGO
0.999913
3.19722
de8b8e2f-7dc2-430a-80ef-5a1bdb79b95f
Cornul11/IN4152-practicals
shadow_mapping/framework/third_party/glm/test/gtx/gtx_simd_mat4.cpp
/////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// /// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) /// Permission is hereby granted, free of charge, to any person obtaining a copy /// of this software and associated documentatio...
TEST
0.982743
6.515547
aca08190-0e5f-4400-b462-c244405ece3e
Isaac-Wiebe/OpenCV
OpenCV_HelloWorld/samples/cpp/tutorial_code/TrackingMotion/cornerHarris_Demo.cpp
/** * @function cornerHarris_Demo.cpp * @brief Demo code for detecting corners using Harris-Stephens method * @author OpenCV team */ #include "opencv2/highgui.hpp" #include "opencv2/imgproc.hpp" #include <iostream> using namespace cv; using namespace std; /// Global variables Mat src, src_gray; int thresh = 200;...
ALGO
0.998962
6.837141
a3212c6e-585e-48eb-a0e1-19127a90da36
TranKienCuong2003/Learn_CPP_with_HiepSiIT
34.checkSameSign.cpp
// Kiểm tra hai số thực có cùng dấu hay không bằng C++ #include <iostream> using namespace std; int main() { double a, b; cout << "Nhap so thuc a: "; cin >> a; cout << "Nhap so thuc b: "; cin >> b; if ((a > 0 && b > 0) || (a < 0 && b < 0)) { cout << "Hai so thuc a va b co cung dau." <...
ALGO
0.998149
4.342025
4c325d98-f9fc-4282-845e-41156efb4c6d
Phuong-Le-NN/Graphs-CS271-DataStructures
graph.cpp
//================================= // Aryah Rao, Lam Do, Phuong Le // graph.cpp // April 2024 // This file implements the templated Graph Class. //================================= #include "graph.h" #include <map> //======================================================== // Constructor // Initialize Graph // Param...
ALGO
0.99874
5.632578
8d082196-4a9f-4211-85a4-bb15dbbeca4d
dezhonger/muban
网络流/Dinic.cpp
#include <bits/stdc++.h> using namespace std; //Filename: Dinic.cpp // //Author: dezhonger - <EMAIL> //Create: 2020-11-14 18:48:11 //时间复杂度: O(N^2*M) const int N = 10010, M = 200001, INF = 1e8; int n, m, S, T; int h[N], e[M], f[M], ne[M], idx; //q是队列,d是分层路,cur是当前弧优化 int q[N], d[N], cur[N]; void add(int a, int b, in...
ALGO
0.999907
4.829448
20c6cb33-b25f-4656-abe6-baae1987de8a
anis009/competitve-programming
Chef_Restaurant.cpp
#include<bits/stdc++.h> using namespace std; int main() { // freopen("addin.txt","r",stdin); // freopen("addout.txt","w",stdout); ios_base::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL); int t; cin>>t; while(t--){ int n,m; cin>>n>>m; vector<pair<int,int>> v; for(int i=0;i<n;i++){ i...
ALGO
0.999941
4.1593
51d71fab-47d2-4052-9fb9-d1d105fb6c24
Mayank9mare/Codeforces
703div2/b2.cpp
// .-""""-. // / j \ // :.d; ; // $P : // .m._ $$ : // dSMMSSSss.__$b. __ : // :MMSMMSSSMMMSS$$b $P ; // SMMMSMMSMMMSSS$$$$ :b // dSMMMSMMMMMMSSMM$$b.dP ...
ALGO
0.999635
4.784793
ddf0a674-9422-4d45-a72c-67083aad3f30
pacmanzou/practice
cpp_test/min_number.cpp
#include <iostream> using namespace std; int main() { int a[10] = {1, 23, 45, 0, 4325, 66, 2, 45, 4, 65}; int min = a[0]; for (int i = 0; i < 10; ++i) { if (a[i] <= min) { min = a[i]; } } cout << "最小的数字:" << endl; cout << min << endl; }
ALGO
0.998894
3.308966
e6ca1632-a702-4aeb-8036-5b62025ba2ef
ishandutta2007/codeforces
heno239/normal/1176/A.cpp
#pragma GCC optimize("Ofast") //#pragma GCC target ("sse4") #include<iostream> #include<string> #include<cstdio> #include<vector> #include<cmath> #include<algorithm> #include<functional> #include<iomanip> #include<queue> #include<ciso646> #include<random> #include<map> #include<set> #include<bitset> #include<stack> #i...
ALGO
0.999734
4.409622
cd7ece76-f241-4ac8-9419-93ae38727a37
lmesacademy/x265
source/common/deblock.cpp
#include "common.h" #include "deblock.h" #include "framedata.h" #include "picyuv.h" #include "slice.h" #include "mv.h" using namespace X265_NS; #define DEBLOCK_SMALLEST_BLOCK 8 #define DEFAULT_INTRA_TC_OFFSET 2 void Deblock::deblockCTU(const CUData* ctu, const CUGeom& cuGeom, int32_t dir) { uint8_t blockStrengt...
ALGO
0.988815
3.785041
43a01861-6b35-4801-89e3-29b2d9321fad
ISOLDE-Project/riscv-llvm
libcxx/test/std/numerics/rand/rand.dist/rand.dist.norm/rand.dist.norm.chisq/eval_param.pass.cpp
// <random> // template<class RealType = double> // class chi_squared_distribution // template<class _URNG> result_type operator()(_URNG& g, const param_type& parm); #include <random> #include <cassert> #include <vector> #include <numeric> #include <cstddef> #include "test_macros.h" template <class T> inline T sqr...
TEST
0.911026
4.701449
fadf9a7c-e206-4a9a-942b-c606c84a620e
delta4d/AlgoSolution
codeforces/009/E.cpp
#include <cstdio> #include <vector> #include <cstring> #include <algorithm> using namespace std; const int MAXN = 64; const int INF = 0x3f3f3f3f; vector <int> f[MAXN]; vector <int> x[MAXN]; int d[MAXN], sz; bool v[MAXN], v2[MAXN][2]; int e[MAXN]; vector <pair<int, int> > p; vector <pair<int, int> > out; int r[MAXN]; ...
ALGO
0.999967
4.245228
acf187a2-f39b-4a26-9140-d9ff596e85fb
hrcarsan/problem-solving
uva/10300/main.cpp
#include <iostream> #include <cstdio> #include <vector> #include <queue> #include <bitset> #include <map> #include <set> #include <stack> #include <algorithm> #include <cmath> #include <sstream> #include <cstring> #include <utility> #include <climits> typedef long long ll; using namespace std; int main() { long n, ...
ALGO
0.969338
3.322602
77fe417d-738f-4253-baa8-ee1e55032271
GyuJin-Cho/Algorithm
프로그래머스/멀쩡한 사각형.cpp
#include <iostream> using namespace std; int gcd(int& w, int &h) { int c; while(h!=0) { c = w % h; w = h; h = c; } return w; } long long solution(int w, int h) { long long answer = 1; answer = (long long)w * (long long)h - (w+h); answer += gcd(w, h); retu...
ALGO
0.999923
4.782554
dcdb124c-d751-476b-9496-226f9ad3028f
karantiwari28/Leetcode-solutions
0528-swapping-nodes-in-a-linked-list/0528-swapping-nodes-in-a-linked-list.cpp
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode() : val(0), next(nullptr) {} * ListNode(int x) : val(x), next(nullptr) {} * ListNode(int x, ListNode *next) : val(x), next(next) {} * }; */ class Solution { public: ListNode* swapNodes(L...
ALGO
0.999999
5.771191
1bedd52d-0aab-47ac-981f-70dd175da8ee
DevJSter/dsa
Interview_DS_Algo/DP/Minimum Number of Refueling Stops.cpp
/* Company Tags : Google Leetcode Link : https://leetcode.com/problems/minimum-number-of-refueling-stops/ Similar Problem : Leetcode 1642. Furthest Building You Can Reach */ //Approach-1 ( O(n^2) DP) typedef unsigned long long ull; class Solution { public: int minRefuelStops(int target, int startF...
ALGO
0.999963
6.036895
b6c9d8b9-cf30-48d3-87c3-48d4453ac99d
ShazidMashrafi/Codeforces
Codes/1758 B - XOR = Average/1758B.cpp
#include<bits/stdc++.h> using namespace std; using ll = long long; void solve() { int n; cin>>n; if(n%2==0) { cout<<"1 3"; for(int i=1; i<=n-2; ++i) { cout<<" 2"; } cout<<endl; } else { for(int i=1; i<=n; ++i) { ...
ALGO
0.999426
4.195579
8fb63597-3d8c-44b9-ac1c-a1e4a67f919c
rickyggg/leetcode_and_swordoffer
src/leetcode/26_remove_duplicates.cpp
class Solution { public: int removeDuplicates(vector<int> &nums) { int slow = 0, fast = 0, n = nums.size(); while (fast < n) { if (nums[slow] == nums[fast]) ++fast; else nums[++slow] = nums[fast++]; } return nums.empty() ? 0 : (slow + 1); } };
ALGO
0.999536
6.45298
2c5baa16-8656-48e7-adb8-a002c978108b
YogeshKumarYadav/Pointers-CPP-TurboCPP
MERGESOR.CPP
#include"iostream.h" #include"conio.h" #include"limits.h" #include"stdio.h" void merge(int *a,int *b,int *c,int m,int n) { int i=0,j=0,k=0; while((i<m)&&(j<n)) { if(*(a+i)<=*(b+j)) { *(c+k)=*(a+i); k++; i++; } else { *(c+k)=*(b+j); j++; k++; } } if(i>m-1) { whi...
ALGO
0.999796
3.144281
be81eac3-8b4f-49ef-9686-e1b2ed2bfad4
bananaappletw/nctu
Algorithm/Homework/4-3 Tree Diameter/0116320_hw4-3_v1.cpp
#include<iostream> #include<cstdio> #include<list> using namespace std; bool visited[10001]; int N,i,n,m,j,a,b,answer,first; list<int>* vertax=new list<int>[10001]; void dfs(int point,int length) { visited[point]=true; if(length>answer) { answer=length; first=point; } for(list<int>::...
ALGO
0.999622
4.11543
36a93e9f-4ec5-4934-a4ba-485157a5f61e
fLeXnotOP/My-LeetCode-Solutions-Using-C-
1095-find-in-mountain-array/1095-find-in-mountain-array.cpp
/** * // This is the MountainArray's API interface. * // You should not implement it, or speculate about its implementation * class MountainArray { * public: * int get(int index); * int length(); * }; */ class Solution { public: int findInMountainArray(int target, MountainArray A) { int ...
ALGO
0.999994
6.364147
d20deaa4-ec95-4183-b5b4-4e11911cccf4
SergeyUsachev021/labaeba7
boost/libs/geometry/test/algorithms/distance/distance_se_geo_ar_ar.cpp
// Boost.Geometry (aka GGL, Generic Geometry Library) // Unit Test #ifndef BOOST_TEST_MODULE #define BOOST_TEST_MODULE test_distance_geographic_areal_areal #endif #include <boost/test/included/unit_test.hpp> #include "test_distance_geo_common.hpp" #include "test_empty_geometry.hpp" template <typename Point, typenam...
TEST
0.972596
7.720117
1868e886-0ab8-4c85-931b-528b41a405da
shishirkumar1996/cp
18/11.18/03.11.18/1066E.cpp
#include<bits/stdc++.h> #define lld long long int #define faster ios_base::sync_with_stdio(false);cin.tie(0); #define MOD (lld)(998244353) #define trace(x) cerr<<#x<<": "<<x<<'\n'; #define trace2(a,n) cerr<<#a<<": ";for(int i=0;i<n;i++)cerr<<a[i]<<" ";cerr<<'\n'; using namespace std; int main(){ int n,m; strin...
ALGO
0.999993
4.772018
3e657fbd-93af-40f2-8402-1f065dc46bc2
iSwanGit/BOJ_Study
BOJ_IO/11721.cpp
// 1 split per 10 words #include <iostream> #include <string> using namespace std; int main(int argc, char* argv[]) { string s; cin >> s; int full = s.length() / 10; int left = s.length() % 10; for (size_t i = 0; i < full; i++) { cout << s.substr(10 * i, 10) << endl; } cout << s.substr(10 * full, left) << ...
ALGO
0.998429
4.022027
de627d8d-3b73-4eb5-ac45-d3c7b6d2bcec
Sami-115667/Design-Analysis-and-Algorithm
DAA/Evaluation Lab 09/08/23/57_1.cpp
#include <bits/stdc++.h> using namespace std; const int MAXN = 10000; int n, m; std::vector<int> adj[MAXN]; bool visited[MAXN]; int disc[MAXN]; int low[MAXN]; int parent[MAXN]; std::vector<std::pair<int, int>> bridges; void dfs(int u, int time) { visited[u] = true; disc[u] = low[u] = time; time++; ...
ALGO
0.999886
5.474123
b4af4979-2c21-4d68-bcd3-5347a470530d
abdalrahmanshaban0/Problem-Solving
Codeforces/A_Problemsolving_Log.cpp
/* Problem Name : A. Problemsolving Log Author: Abdalrahman Shaban Date: 11/02/2024 22:35:05 */ #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> using namespace std; using namespace __gnu_pbds; typedef long long ll; typedef unsigned long long ull; typedef vector<long long> vi; typedef pair<ll, ll> p...
ALGO
0.999848
5.930256
4c61d716-295e-4c0d-9349-fc66e1c8d2ff
Deal1441/Work
DZ7/dz7/dz7.cpp
int is_dz7 ( int x ) { int i = 1; int bin = 0; while(x > 0) { bin += (x % 2) * i; x >>= 1;; i *= 10; } return bin; }
ALGO
0.965986
3.710125
89709ec9-d04b-4e33-b410-1ae4b48286fe
faux123/android_frameworks_base
media/libstagefright/codecs/amrnb/common/src/negate.cpp
/* Pathname: ./gsm-amr/c/src/negate.c ------------------------------------------------------------------------------ REVISION HISTORY Description: Created separate file for the negate function. Sync'ed up with the current template and fixed tabs. Description: Removed conditional code that updates WMOP...
TOOL
0.899591
6.029876
fa0f6585-f880-4564-8504-68299a301743
AceKokuren/LearnCoding
Learn Cpp/Bleep/functions.cpp
#include <iostream> #include <string> #include "functions.hpp" void bleep (std::string &text, std::string word) { for (int i = 0; i < text.size(); i++) { int match = 0; for (int j = 0; j < word.size(); j++) { if (text[i] == word[j]) { ++match; } } if (match == word.size()) { ...
TOOL
0.965978
3.507518
9b6a77d2-a27b-4401-9ff3-fb224bf5a01f
DNCHOW1/CompetitiveProgramming
cp_practice/abc/at_beginner197_e.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int,int> p32; typedef pair<ll,ll> p64; typedef vector<ll> v64; typedef vector<int> v32; typedef vector<vector<int> > vv32; typedef vector<vector<ll> > vv64; typedef vector<p64> vp64; typedef vector<p32> vp32; #define dbg(x) cout<<#x<...
ALGO
0.999938
4.297202
5fd23d50-e12a-4502-827a-f6dc044d258a
Janmansh/CompetitiveProgramming
Codeforces/20202021 ICPC NERC Southern and Volga Russian Regional Contest Online Mirror ICPC Rules/D_Firecrackers/D_Firecrackers.cpp
#include<bits/stdc++.h> using namespace std; #define ll long long #define int long long #define pb push_back #define mod 1000000007 #define mp make_pair #define double long double ll fact[200005]; ll powermod(ll x,ll y){ if(y==0) return 1; ll temp = powermod( x,y/2 )%mod; if( y%2 ){ return (((temp*temp)%mod...
ALGO
0.999945
3.716534
7651b4fe-796f-4a7a-872e-943e206dedb2
99hgz/Algorithms
Problems/bzoj/1260.cpp
#include <cstdio> #include <cstring> #include <cstdlib> #include <algorithm> using namespace std; typedef long long ll; char a[100]; int f[100][100]; int main() { scanf("%s", a + 1); memset(f, 0x3f3f3f3f, sizeof f); int len = strlen(a + 1); for (int i = 1; i <= len; i++) f[i][i] = 1; for (in...
ALGO
0.999922
3.405602
b8bfecbb-56d4-4141-bf95-a4bf1db47658
SLIIT-FacultyOfComputing/tutorial-03b-IT21292422
exercise03.cpp
#include <iostream> using namespace std; int volume(int height, int width, int length); struct box{ int height; int width; int length; }; // 1. Define a structure called Box // have the integer data types Height, Width, Length // Do not change the main function int main() { // 2. Create a variable called b...
TOOL
0.911123
3.972844
1f9682fa-b262-446c-93a3-e092f8489846
KwonCheolHyeon/Study_DS_Algorithm
DS_AL/Algorithm/greedy2.cpp
#include <vector> #include <queue> #include <iostream> #include <algorithm> #include <stack> #include <set> using namespace std; int solution(string name) { int n = name.length(); int total_moves = 0; int min_moves = n - 1; for (int i = 0; i < n; i++) { total_moves += m...
ALGO
0.999855
5.37231
0fc23385-0d08-43e8-922b-a61775974702
yanshui177/HandWritten-Analisys
测试/单独功能测试/0-DLL测试(实际没有部署)/dll-goal完整版/OpenCV/cv/src/cvcorner.cpp
#include "_cv.h" #include <stdio.h> static void icvCalcMinEigenVal( const float* cov, int cov_step, float* dst, int dst_step, CvSize size, CvMat* buffer ) { int j; float* buf = buffer->data.fl; cov_step /= sizeof(cov[0]); dst_step /= sizeof(dst[0]); buffer->rows = 1; for( ;...
ALGO
0.999972
4.599198
1d3dbaaf-1ddf-4c38-8ad8-837f0655884c
WeakKnight/pba
t1m1/include/eigen/doc/examples/tut_arithmetic_dot_cross.cpp
#include <iostream> #include <Eigen/Dense> using namespace Eigen; using namespace std; int main() { Vector3d v(1,2,3); Vector3d w(0,1,2); cout << "Dot product: " << v.dot(w) << endl; double dp = v.adjoint()*w; // automatic conversion of the inner product to a scalar cout << "Dot product via a matrix product...
ALGO
0.99944
4.02064
20f31362-25e3-4846-aa47-dc69e519106d
TrishaGhosh15/Leetcode
0238-product-of-array-except-self/0238-product-of-array-except-self.cpp
class Solution { public: vector<int> productExceptSelf(vector<int>& nums) { int n = nums.size(), i, j; vector<int> L_product(n), R_product(n), res(n); L_product[0] = 1; R_product[n-1] = 1; for(i=1; i<n; i++) { j = (n - 1) - i; L_product[i]...
ALGO
0.999977
6.281344
68622b30-7853-4c7d-aa38-887633db10aa
gh-develop/coding-test-kw
바킹독예제/0x03/find_100.cpp
//־ N int 迭 arr 100 ٸ ġ Ұ ϸ 1 0 ȯϴ Լ //func2(int arr[], int N) ۼ϶. ar 0 ̻ 100 ̰ N 1000̴. #include<bits/stdc++.h> using namespace std; int func(int arr[], int N){ int num_cnt[101] = {0}; for(int i = 0;i < N;i++){ if(num_cnt[100 - arr[i]]) return 1; num_cnt[arr[i]]++; } return 0; } int main(void){ i...
ALGO
0.9988
3.398646
b1ea4140-6a8b-472c-86a0-5bb68c8f7725
amitgupta85878/Important_programs_for_placements
c++/whether_number_is_odd_or_not_program.cpp
#include <iostream> using namespace std; int main() { int n; cout << "Enter an integer: "; cin >> n; if ( n % 2 == 0) cout << n << " is even."; else cout << n << " is odd."; return 0; }
ALGO
0.991102
3.807557
c456805e-d946-4009-961c-743c2764f289
raincross7/code-similarity
codes/train_code/problem435/problem435_10.cpp
/* ID: learnin7 TASK: test LANG: C++ */ /* LANG can be C++11 or C++14 for those more recent releases */ #include<bits/stdc++.h> /* Macros from Endagorion */ #define mp make_pair #define mt make_tuple #define fi first #define se second #define pb push_back #define all(x) (x).begin(), (x).end() #define...
ALGO
0.999907
3.598005
4c6e5ae2-6eb5-4f49-af62-cdda3014953f
youxiao/yxbase
third_party/icu/source/tools/toolutil/ppucd.cpp
#include "unicode/utypes.h" #include "unicode/uchar.h" #include "charstr.h" #include "cstring.h" #include "ppucd.h" #include "uassert.h" #include "uparse.h" #include <stdio.h> #include <string.h> U_NAMESPACE_BEGIN PropertyNames::~PropertyNames() {} int32_t PropertyNames::getPropertyEnum(const char *name) const { ...
TOOL
0.893858
7.072317
cf92cf71-23f5-4bb3-969f-43cd9be3c408
MissWhalen/DU-Projects
ExamPractice/main.cpp
#include <iostream> #include <iomanip> #include <cctype> int main() { int num,i, count; int n =2; for(num = 1;num<=n;num++){ count = 0; for(i=2;i<=num/2;i++){ if(num%i==0){ count++; break; } } if(count==0 && num!= 1) ...
ALGO
0.99817
4.903832
b3530acb-b5d8-4a06-9aa0-33df55ea0d41
sunlinjun2001/leetcodealgorithm
array/delNums.cpp
#include <iostream> using namespace std; #include <vector> #include <unordered_map> //26.ɾظԪ class Solution { public: int removeDuplicates(vector<int>& nums) { unordered_map<int, int> hashtable; vector<int>::iterator it = nums.begin(); for (it; it != nums.end(); it++) { a...
ALGO
0.99965
5.192794
7986387c-a6e5-4313-9329-06da100570b7
jetmuffin/algorithm
hdu/2020.cpp
/* ** feched by JetMuffin's crawler ** author: chen9434 (JetMuffin) ** http://acm.hdu.edu.cn/viewcode.php?rid=10856624 */ #include<iostream> #include<algorithm> #include<math.h> using namespace std; int a[101]; int cmp(int a,int b) { return(abs(a)>abs(b)); } int main() { int m,n; while(cin>>n&&n!=0) { ...
ALGO
0.998843
3.085925
99418592-e5c6-49a0-aa38-c5aa2e06ca3b
vbn930/baekjoon
Math/1934.cpp
#include <iostream> int gcd(int a, int b){ if(a % b == 0){ return b; } return gcd(b, a % b); } int main(){ int n, a, b, c; std::cin >> n; for(int i = 0; i < n; i++){ std::cin >> a >> b; std::cout << (a * b) / gcd(a, b) << "\n"; } }
ALGO
0.999979
5.326772
1b7159dd-c89c-4a37-b58c-c8cdf948f3e9
VanDien2006/DSA
ThucHanh/TH5_5_Lop.2/Bai01_2/Bai01_lan2.cpp
/*###Begin banned keyword - each of the following line if appear in code will raise error. regex supported ###End banned keyword*/ #include <iostream> using namespace std; struct TNODE { int key; TNODE* pLeft; TNODE* pRight; }; typedef TNODE* TREE; //###INSERT CODE HERE - TNODE *CreateTNode(int x) { TNODE *p=...
ALGO
0.999967
5.003376
14dc3c52-a042-44ff-b062-1bc92739566f
ishandutta2007/codeforces
krk/normal/1005/F.cpp
#include <bits/stdc++.h> using namespace std; typedef pair <int, int> ii; const int Maxn = 200005; int n, m, k; vector <ii> neigh[Maxn]; int dist[Maxn]; queue <int> Q; vector <int> my[Maxn]; vector <int> seq; vector <vector <int> > res; char str[Maxn]; void Gen(int v) { if (v > n) res.push_back(seq); else {...
ALGO
0.999991
4.042191
e0c56d97-e78a-44d1-84e2-06172ec72f79
pritthiprokashsarkar/problem-set
atcoder/A. Contest.cpp
#include<bits/stdc++.h> using namespace std; int main() { int a,b,c,d; cin>>a>>b>>c>>d; int score1=max(((3*a)/10),(a-(a/250)*c)); int score2=max(((3*b)/10),(b-(b/250)*d)); if(score1>score2) cout<<"Misha"<<endl; else if(score2>score1) cout<<"Vasya"<<endl; else cout<<"Tie"<<endl; }
ALGO
0.999897
3.893729
e46a8605-6ac1-436e-b686-d60bd166f1e5
pgm26/WorkBook
predict.cpp
#include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <time.h> #include <math.h> #include <iostream> #include <fstream> using namespace std; float data [20][5]; void read(); void error(double theta[5]); void normalize(); void gradient(double theta[5], double alpha); void runner(double theta[5], double al...
DATA
0.983418
3.135595
65c90c62-81c5-44ff-ae66-c4594c2e0756
AthulJoseph27/Codeforces
1200/1392C.cpp
#include <bits/stdc++.h> using namespace std; typedef unsigned long long ull; typedef long long ll; typedef vector<int> vi; typedef vector<vi> vvi; typedef vector<ll> vl; typedef vector<vl> vvl; typedef pair<int, int> pi; #define all(v) v.begin(), v.end() void __print(int x) { cerr << x; } void __print(long x) ...
ALGO
0.999889
4.357895
c9869249-6123-464f-839b-43ba205010c5
zrss/LeetCode
PlusOne.cpp
#include <iostream> #include <vector> using namespace std; class Solution { public: vector<int> plusOne(vector<int>& digits) { int in = 1; digits.insert(digits.begin(), 0); for (int l = digits.size() - 1; in != 0 && l >= 0; --l) { digits[l] += in; in = digits[l] / 10; ...
ALGO
0.999831
5.976309
4c76cfbf-c3ce-4358-8ba2-701989d4e497
rishanansari/Cpp_DataStructureAndAlgorithm
practiceProblem.cpp/assignment_Notion_missingNum.cpp
// Given an array a[ ] of size *‘n-1’* with integers in the range of *[1,n].* There are no duplicates in the list. // Write a program to find the missing number from the first **n** integers. // Consider example n=5; a[ ]= { 2, 5, 1, 3}; // n=5 means Range[1,5]. Output should be the missing number between 1 to 5. ...
ALGO
0.999866
4.622273
b9d712a8-b8be-4cf5-ba26-2e009a1eccfc
AtharvaGirishNaik/PCCOE_DSL_ASIGNMENTS
Assignment_5.cpp
// ASSIGNMENT 5 // Title : Implement a navigation system for a delivery service using a circular linked list to represent routes. The navigation system should support the following functionalities: a. Add route b. Remove route // c. Display route // PRN NO : 124B2B011 // NAME : Atharva Girirsh Naik // ...
ALGO
0.998202
4.680482
decf5382-fc27-4ebe-8896-d72ad84b8efa
rzkiyp29/Tekmob_Amajon
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.998733
6.76775
ee523430-62d2-48d0-ba9e-fee4663fe4c0
PrathamAsrani/GFG_POTD_CODES
Difficulty: Easy/Summed Matrix/summed-matrix.cpp
//{ Driver Code Starts #include <bits/stdc++.h> using namespace std; // } Driver Code Ends class Solution { public: long long sumMatrix(long long n, long long q) { long long low = 2, high = 2*n; if(q < low || q > high) return 0; return min(q-low, high-q) + 1; } }; //{ Driver Code S...
ALGO
0.999872
5.015948
50dfa99f-7a94-4f59-a737-82d1c729515c
yyhaos/Competitions
ACM-ICPC 2018 焦作赛区网络预赛/I. Save the Room .cpp
#include<bits/stdc++.h> int main () { int a,b,c; while(~scanf("%d%d%d",&a,&b,&c)) { if(a%2==1 && b%2==1 && c%2==1) printf("No\n"); else printf("Yes\n"); } return 0; }
ALGO
0.999968
3.725638
53c51d79-3d94-4500-a788-c9bdb844d331
arthurvtrr/AA-Problems-Solved
New/Training/GCJ 2015 - Round 2/C.cpp
#include <bits/stdc++.h> using namespace std; #define INF 2000000000 #define N 10010 int nodes = N, ini, fim; int dist[N], work[N]; struct Edge { int to, rev, used_flow, cap; }; vector < Edge > graph[N]; void addEdge(int from, int to, int cap) { Edge a = {to, graph[to].size(), 0, cap}; Edge b = {from,...
ALGO
0.999871
4.647215
d345e521-dcaf-411e-b2cf-fb2f6e5e2ae2
JJH123123123/codingtest_javafactory
SY/week04/Problem074.cpp
//https://school.programmers.co.kr/learn/courses/30/lessons/12919 #include <bits/stdc++.h> using namespace std; string solution(vector<string> seoul) { for(int i = 0; i < seoul.size(); i++) { if(seoul[i] == "Kim") return "김서방은 " + std::to_string(i) + "에 있다"; } }
ALGO
0.99557
5.111293
f98a0f03-d73b-46f0-8942-bc7e6822bd07
raincross7/code-similarity
codes/train_code/problem373/problem373_119.cpp
//#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; using ll = long long; #define pp pair<int,int> #define rep(i,n) for(int (i)=0;(i)<(n);(i)++) #define ld long double #define al(a) (a).begin(),(a).end() #define mk make_pair #define check cout<<"?"<<endl; ll MOD=1000000007; ll mod=998244353; int inf...
ALGO
0.999981
3.848858
29dd41d8-77be-4a29-a480-eb4319b3aa14
Seeseejava/Flame
Engine/Source/ThirdParty/bullet3/Extras/VHACD/src/vhacdICHull.cpp
#include "vhacdICHull.h" #include <limits> namespace VHACD { const double ICHull::sc_eps = 1.0e-15; const int ICHull::sc_dummyIndex = std::numeric_limits<int>::max(); ICHull::ICHull() { m_isFlat = false; } bool ICHull::AddPoints(const Vec3<double>* points, size_t nPoints) { if (!points) { return false; } Circula...
ALGO
0.994669
4.707275
66551bd1-c831-4a09-9b9a-e0bce261417b
AjaniStewart/bootcamp
cs/week_4/day_1/circular_queue.cpp
#include <vector> using namespace std; class MyCircularQueue { private: vector<int> data; int frontIndex; int backIndex; int current_size; int size; public: /** Initialize your data structure here. Set the size of the queue to be k. */ MyCircularQueue(int k) { data.reserve(k);...
ALGO
0.997762
5.784467
7c23727e-4042-4fc9-a9e0-35454a78d865
Poolfloaty/C-Plus-Plus-Projects
rightShiftElements.cpp
#include <iostream> using namespace std; /** * PURPOSE: Function simulates the effect of a circular array of size N, where N > 0, * by shifting all of its elements to the RIGHT by M elements, * where M is an integer >= 0. * PARAMETERS: * int arr[], int N, int M * RETURN VALUES: * No re...
ALGO
0.999633
6.009371
72e37542-bd3e-4c7b-840e-bc4d50ef5e07
EmirBashiri/Flutter-E-commerce-X
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
3c01c7f3-83cd-4c78-9f60-84285f24b50d
Wizapply/OvrvisionPro
3rdparty/opencv/sources/samples/cpp/select3dobj.cpp
/* * * select3obj.cpp With a calibration chessboard on a table, mark an object in a 3D box and * track that object in all subseqent frames as long as the camera can see * the chessboard. Also segments the object using the box projection. This * program is useful for col...
TOOL
0.992736
5.932558
d32257ed-785c-4ef2-9dc6-8a251f84c940
xiongliang120/cocos2dx-android
cocos2d/cocos/platform/winrt/CCWinRTUtils.cpp
#include "platform/winrt/CCWinRTUtils.h" #include <wrl/client.h> #include <wrl/wrappers/corewrappers.h> #include <ppl.h> #include <ppltasks.h> #include <sstream> #include "base/ccMacros.h" #include "platform/CCPlatformMacros.h" #include "platform/CCFileUtils.h" #include "base/CCUserDefault.h" using namespace Windows::...
TOOL
0.976221
6.400209
4be7f6e8-4972-4516-8ea0-08325c7f5b86
jonbrashears/Cpp-Projects
GraphNav/GraphNav.cpp
/********************************************************* * * Jonathan Brashears * April 26, 2018 * Algorithms * This program uses a matrix representation of a graph. * It uses separate array to track the points visited. * It visits each vertex of the graph by traveling * along edges. A algorithm for depth first sear...
ALGO
0.992826
4.998879
7dfe66b7-efef-4f90-b2a7-5beaad55862f
erictsaii/leetcode-practice
781_Rabbits_in_Forest.cpp
class Solution { public: int numRabbits(vector<int>& answers) { int ans = 0; unordered_map<int, int> cnt; for (int i = 0; i < answers.size(); i++) { cnt[answers[i]]++; } for (auto i : cnt) { ans += ceil((do...
ALGO
0.99994
6.274052
d14d8a12-993a-4c52-ac39-f46ec88caf4e
alamgir65/Competitive_Programming
February (1-10)/B_Mahmoud_and_a_Triangle.cpp
#include<bits/stdc++.h> #define ll long long #define yes cout<<"YES"<<endl; #define no cout<<"NO"<<endl; #define cyes cout<<"Yes"<<endl; #define cno cout<<"No"<<endl; #define all(x) x.begin(), x.end() #define nl cout<<endl; #define endl '\n' #define love int main() #define vtr vector #define pii pair<int,int> #define o...
ALGO
0.999915
4.130954
12e5c139-1dcc-4f17-908a-dee9ba0ed194
Lihoubrak/THUC_HANH_KTLT_BK_K65
Brak_Lihou_20200836_715026_3/bai1.cpp
#include<iostream> using namespace std; int lucas(int n) { if(n==0) return 2; if(n==1) return 1; else return lucas(n-1)+lucas(n-2); } int main(){ printf("-- Brak Lihou --\n"); printf("-- 20200836--\n\n"); int n; cout<<lucas(5); return 0; }
ALGO
0.99876
3.450537
bbf42444-f055-49b2-9508-025183a5d43b
nadimnesar/Online-Judges-Accepted-Solutions
Gym/100482H/40247697_AC_61ms_1724kB.cpp
#include "bits/stdc++.h" using namespace std; #define ll long long #define llu unsigned long long #define endl '\n' #define in insert #define pb push_back #define full(x) x.begin(),x.end() #define memset(x, y) memset...
ALGO
0.999958
5.362693
d56cba1f-adb9-4163-b2a7-7da791a399c3
shawnlian2008/USACO-solutions
bronze/block_game.cpp
#include <bits/stdc++.h> using namespace std; int main() { freopen("blocks.in", "r", stdin); freopen("blocks.out", "w", stdout); int n; cin >> n; vector<pair<string, string>> v(n); for (int i = 0; i < n; i++) cin >> v[i].first >> v[i].second; vector<int> ans(26, 0); for (int i = 0;...
ALGO
0.999912
4.17652
6c3829ed-4dc5-4375-bd4b-5914cb330cb8
jesuswr/cp-codes-and-problems
100513/E.cpp
#include <iostream> #include <vector> #include <queue> #include <stack> #include <algorithm> #include <math.h> #include <string> #include <cstring> #include <set> #include <map> #include <unordered_map> #include <assert.h> #include <array> #include <random> #include <chrono> using namespace std; typedef long long ll;...
ALGO
0.999977
3.719903
629f4d68-7500-4e21-98be-21516f1a5b82
saahu27/UR3Manipulator
src/pick_and_place/src/pick_place.cpp
#include "../include/pick_place.hpp" PickandPlace::PickandPlace(ros::NodeHandle *nodehandle): PP{*nodehandle} { this->pick_detected = false; this->place_detected = false; fiducial_sub = PP.subscribe("/logitech_webcam/fiducial_transforms", 1, &PickandPlace::Fiducial_Callback, this); pick_sub = PP.subscr...
TOOL
0.866343
5.711153
b910e42a-a21d-45c9-ad2a-42cacb9eb65d
almoidfahad/First_code_Cpp
pattern_type-10/pattern-5.cpp
#include <iostream> using namespace std; int main(){ int n, row , col; cout<< " Enter Any Number : "; cin>> n; for(row = n; row >= 1; row -- ){ for (col = 1 ; col <= n-row ; col++){ cout<< " "; } for (col = 1 ; col <= 2*row-1; col ++){ cout<< " " <<...
ALGO
0.999077
3.369706
f89f46c6-f2e8-4a3d-9d80-1378c553b2c1
kushagra-18/Data-Structures-and-Algo
Array/threePairs.cpp
#include <iostream> #include<algorithm> #include<unordered_set> #include<vector> using namespace std; vector <vector<int>> threePairs(vector <int> arr, int n,int target) { sort(arr.begin(),arr.end()); vector <vector<int>> res; int targetSum = 0; for(int i = 0;i<n-3;i++){ int j = i + 1; ...
ALGO
0.999797
4.630805
44cdec96-a81b-4305-b36f-6b780f727207
PaukIsUha/optimizing_formating_code
predictions/submissions-aizu-gpt4/Codenet/p02389/815156550/response_7.cpp
#include <iostream> int main() { int a, b; std::ios::sync_with_stdio(false); std::cin.tie(nullptr); std::cin >> a >> b; std::cout << a * b << ' ' << (a + b) << " 0\n"; }
ALGO
0.998352
5.21935
d54d97c4-6437-4cfc-963b-9b5cec7d45b7
as-is-as/Basic
Deious/수학/나머지(10430).cpp
#include <iostream> using namespace std; int main() { int A, B, C; cin >> A; cin >> B; cin >> C; cout << (A + B) % C << endl; cout << (A%C + B % C) % C << endl; cout << (A*B) % C << endl; cout << (A%C * B%C) % C << endl; return 0; }
ALGO
0.999847
3.519928
fc46abca-ac68-4dd4-8fbe-2769add15306
vinit0019/DSA-CPP
Day-34/day34-2.cpp
// #include<iostream> // using namespace std; // class vinit{ // public: // int data; // vinit *next; // }; // use the same Current Pointer for another new node // ======================================================= // int count,position; // int main(){ // vinit *head = new vi...
ALGO
0.99009
4.335899
194d0ec0-4c7c-413e-97f7-c8ae92db51fa
matheth/project_euler
001-100/31_coin_sums.cpp
#include <stdio.h> using namespace std; void ex31b(int m){ int ways=0; int a, b, c, d, e, f, g; for( a=m ; a>=0 ; a -= 200 ) for( b=a ; b>=0 ; b -= 100 ) for( c=b ; c>=0 ; c -= 50 ) for( d=c ; d>=0 ; d -= 20 ) for( e=d ; e>=0 ; e -= 10 ) for( f=e ; f>=0 ; f -= 5 ) for( g=f ; g>=0 ; ...
ALGO
0.998318
3.134288
daf5f99e-7a62-4212-928a-d7fc0170d12f
canhung/project2021
HangMan/HangMan 1.0.cpp
#include<iostream> #include<string> using namespace std; string chooseword(); string updateword(string&, string, char); bool contain(char, string); int main() { string secretWord = chooseword(); string guessedword = string(secretWord.length(), '-'); int count = 0; do { char guess; cout << "Enter a character:...
TOOL
0.99536
3.965805
f89a0814-b2a1-422b-af12-8a8711db5741
jeete121/Coding
Programs/Practice/Prac/GraphAlgorithms/roy_and_profile_picture.cpp
#include <bits/stdc++.h> using namespace std; void profilePicture(int l, int w, int h) { if (w < l || h < l) cout << "UPLOAD ANOTHER\n"; else if (w == h && w >= l && h >= l) cout << "ACCEPTED\n"; else cout << "CROP IT\n"; } int main() { int l = 180; int w = 640, h = 480; ...
ALGO
0.946722
4.204854
7d72481a-f08a-4bd9-bbb1-f00fbf8794c7
Jaygaur99/DS-Algo-Practice
Coding Minutes/Graph/Solutions/50-Minimum Cost to Make Valid Path in a Grid.cpp
#include<bits/stdc++.h> using namespace std; int dx[4]={0,0,1,-1},dy[4]={1,-1,0,0}; int minCost(vector<vector<int>> grid) { int n=grid.size(),m=grid[0].size(); deque<array<int,3>>qu; qu.push_front({0,0,0}); vector<vector<int>>dis(n+1,vector<int>(m+1,1e9)); dis[0][0]=0; int ans; while(qu.siz...
ALGO
0.999958
5.572066
d81b99a8-1b43-4d8e-81b6-11123f6821bf
igor-pavkov/honours-2024
Code Examples/DiverseVul Filtered/Secure/5ba0baaa269b3fd681828e0e3b3ac0f1472eaf40-55.cpp
stbi_inline static int stbi__jpeg_get_bits(stbi__jpeg *j, int n) { unsigned int k; if (j->code_bits < n) stbi__grow_buffer_unsafe(j); k = stbi_lrot(j->code_buffer, n); j->code_buffer = k & ~stbi__bmask[n]; k &= stbi__bmask[n]; j->code_bits -= n; return k; }
ALGO
0.871011
5.167271
077b4ae3-0799-4343-922c-9d6a78245673
nhatrongbp/DSA_codePTIT
biendoitientohauto.cpp
#include <bits/stdc++.h> using namespace std; int t,i; string s,s1,s2,s3; int main() { cin>>t; while(t--){ cin>>s; stack<string> st; for(i=s.length()-1;i>=0;--i){ if(s[i]=='+'||s[i]=='-'||s[i]=='*'||s[i]=='/'){ s1=st.top();st.pop(); s2=st.top();st.pop(); s3=s1+s2+s[i]; st.push(s3); } el...
ALGO
0.999916
4.448462
60bc3b92-1007-43f7-8d60-5aca7e7a27bf
waynezhangus/leetcode-solutions
C++/404-sum-of-left-leaves.cpp
#include "header.h" class Solution { public: int sumOfLeftLeaves(TreeNode* root) { if (!root) return 0; int middle = 0; if (root->left && !root->left->left && !root->left->right) { middle = root->left->val; } return middle + sumOfLeftLeaves(root->left) + sumOfLef...
ALGO
0.999914
6.422161
a223e2cf-4ebc-4958-9966-2210508f0553
ananthkumarmv/Coding-problems
codeforces/Sum-of-Round-Numbers.cpp
#include<iostream> #include<algorithm> using namespace std; int main(){ ios_base::sync_with_stdio(0); cin.tie(0); int t; cin>>t; while(t--){ string str; cin>>str; int n = str.length(); int nofz = count(str.begin(), str.end(), '0'); cout<<(n - nofz)<<"\n"; string z=""; for(int i = n-...
ALGO
0.999697
4.648047
6a130b10-1906-4679-a0a1-c77989680f1f
vibhash-singh/online-judges
codechef/j7.cpp
#include <iostream> #include <iomanip> #include <cmath> #include <cstdio> int main() { int t; double p, s; std::cin >> t; while (t--) { std::cin >> p >> s; double d = sqrt(p * p - 24 * s); double v1 = pow((p - d) / 12, 2) * ((p + 2 * d) / 12); double v2 = pow((p + d) / 12, 2) * ((p - 2 * d) / 12); ...
ALGO
0.999415
4.249039
f9ca1884-8c72-4cbf-ade5-a72c97d14aaa
codewith-AKY/C--
lab report 1/q19.cpp
#include <iostream> using namespace std; class Time { public: int hours, minutes; Time(int h = 0, int m = 0) { // Constructor with default values hours = h; minutes = m; } Time compare(Time t) { // Function to compare two times if (hours > t.hours || (hours == t.hours && minut...
TOOL
0.958616
5.100234
c3e0846f-8ed2-4159-9ef4-1c9bee0601c6
StolasIn/leetcode_Submissions
content/sort-integers-by-the-number-of-1-bits/Accepted/9-27-2021, 8_34_32 PM/Solution.cpp
// https://leetcode.com/problems/sort-integers-by-the-number-of-1-bits struct node{ int val,bit; bool operator<(const node a) const { if(a.bit==bit){ return a.val<val; } return a.bit<bit; } }; class Solution { public: int cnt(int x){ int ans=0; while(...
ALGO
0.999995
6.065812
3f5bbbb1-fb03-494a-bab8-ec0f0d53d1db
nanolith/minweb
src/util/graph_add_edge.cpp
#include <minweb/graph.h> using namespace minweb; using namespace std; /** * \brief Add an edge to the graph. * * \param node The "from" node that this edge is connecting. * \param toNode The "to" node that this edge is connecting. */ void minweb::graph::add_edge(int node, int toNode) { /* does node ...
ALGO
0.899963
6.333489
8e3dc759-21f0-4b73-8b65-fc211e662503
arnabdey24/uva-solution
uva_11742.cpp
#include <bits/stdc++.h> using namespace std; ////////////////////////////////////////////////////////////////////////////<editor-fold desc="macros"> #define endl "\n" #define long long long #define all(v) (v).begin(),(v).end() #define makeset(v) (v).resize(unique((v).begin(),(v).end())-(v).begin()) #define IOS ios::sy...
ALGO
0.999939
4.343457
0fe73669-989c-48de-9ca3-7d8dcd4112eb
legend507/CommonSense
SomethingAboutCoding/C/unordered_map.cpp
#include <iostream> #include <unordered_map> using namespace std; int main() { unordered_map<int, int> hash; // 也可以声明 unordered_map<string, int> hash, 然后用 hash["test"] = 10 来添加新元素,另一种添加方式是 hash.insert(make_pair("test",10)); hash[4] = 1; hash[6] = 9; hash[20] = 12; hash[10] = 11; // 注意,必须要用iterat...
TOOL
0.965783
5.11971
82ac1b11-6c7a-4120-af0e-43cdbcfd6e86
calgagi/leetcode
1234/answer.cpp
class Solution { public: int balancedString(string s) { int t = s.length()/4; unordered_map<char, int> seen; for (char &c : s) seen[c]++; int b = 0, e = 0, res = INT_MAX; while (e < s.length()) { seen[s[e]]--; while (b < s.length() && see...
ALGO
0.999878
5.246107
c4041cd8-ca7d-4fc4-b36f-26b7aafc0e55
Sharafabdullah/CompetitiveProgramming
topicBased/stacks/Increasing_Array_Queries.cpp
#include <bits/stdc++.h> using namespace std; #pragma GCC optimize("O3,unroll-loops,no-stack-protector,fast-math") #define all(v) ((v).begin()), ((v).end()) #define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end))) #define pb ...
ALGO
0.999971
4.141704
2f91f48d-9423-4feb-afa4-58d4867c6f6b
wuwushrek/sim_cf
crazyflie_gazebo/src/geo_mag_declination.cpp
/** * @file geo_mag_declination.c * * Calculation / lookup table for earth magnetic field declination. * * Lookup table from Scott Ferguson <<EMAIL>> * * XXX Lookup table currently too coarse in resolution (only full degrees) * and lat/lon res - needs extension medium term. * */ #include <cstdint> #include <cmath> #in...
ALGO
0.997768
6.243957