uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
cb2b047a-bd9e-4f6c-8650-023b95cab644
prasanna-sai/Leetcode
Top Interview Questions/Easy/Dynamic Programming/MaximumSubArray.cpp
class Solution { public: int maxSubArray(vector<int>& v) { int n = v.size(); int ans = INT_MIN; int cur = 0; //We will add the current index value to the curr and update curr to 0 if it is negative. Ans is max of curr and previous max for(int i=0;i<n;i++) { ...
ALGO
0.999905
6.265226
b9193c91-451c-4daa-a152-ccd8c484342c
InwooLeeme/Algorithm
Boj/1821.cpp
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,avx,avx2") #pragma GCC optimize("Ofast") #pragma GCC optimize("unroll-loops") #include <bits/stdc++.h> #include <ext/rope> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_cxx; using namespace __gnu_pbds...
ALGO
0.999989
3.571205
56196cc7-d53a-4c04-b38e-7cbd4220662e
Niksol15/smoothsort-benchmark
benchmark.cpp
#include "smooth_sort.hpp" #include "generate_random_vec.hpp" #include <benchmark/benchmark.h> namespace { template<size_t N> void BM_smoothsort_rand_N(benchmark::State &state) { auto vec = GenerateRandomVec(N); for (auto _: state) { Smoothsort(vec.begin(), vec.end()); } ...
TEST
0.965018
6.556691
07449627-65bf-473e-881a-f3617c52f62d
ishandutta2007/codeforces
kdvinit/normal/1526/C2.cpp
/* K.D. Vinit |,,| */ #include<bits/stdc++.h> using namespace std; #define int long long void solve() { int n; cin>>n; priority_queue<int> pq; int sum=0; for(int i=1; i<=n; i++) { int x; cin>>x; sum+=x; pq.push(-x); if(sum<0) { sum+=pq.top(); pq.pop(); } ...
ALGO
0.999768
4.402514
2f8e5285-b3f7-4ba2-a6d9-1d9978220975
raincross7/code-similarity
codes/train_code/problem229/problem229_59.cpp
#include <iostream> #include <vector> int sort(std::vector<int> &v) { int swapCount = 0; int size = v.size(); for (int i = 0; i < size; ++i) { int minj = i; for (int j = i; j < size; ++j) { if (v[j] < v[minj]) { minj = j; } } if (i != ...
ALGO
0.999962
4.675534
09f11e60-d743-4008-85ca-3bf1dea97c4d
raincross7/code-similarity
codes/train_code/problem261/problem261_45.cpp
#include<iostream> using namespace std; int main(){ int N; cin >> N; for(int i=N; i<=999; i++){ if(i%10 == i/100 && i%10 == (i/10)%10){ cout << i; return 0; } } }
ALGO
0.999408
4.262795
2fead306-74eb-40a3-bf42-7a3ea2a9d47b
dev14325/LeetCode-Questions
1569-max-dot-product-of-two-subsequences/1569-max-dot-product-of-two-subsequences.cpp
class Solution { public: int maxDotProduct(vector<int>& nums1, vector<int>& nums2) { const int m = nums1.size(); // Get the size of vector nums1 const int n = nums2.size(); // Get the size of vector nums2 vector<vector<int>> dp(m + 1, vector<int>(n + 1, INT_MIN)); // Nested loops to iterate th...
ALGO
0.999972
6.591238
f2ed2f58-f9dc-4674-a47a-181a853862c0
ishandutta2007/codeforces
maximumshot/normal/533/C.cpp
#include <iostream> #include <math.h> #include <cmath> #include <vector> #include <map> #include <set> #include <fstream> #include <string> #include <algorithm> #include <stack> #include <queue> #define ALL(x) (x).begin(), (x).end() #define mp make_pair #define vec vector #define deb(x) cerr << #x << " = " << x << '\n...
ALGO
0.999809
3.815085
86e4f162-4de3-4ccc-9f8b-027a03bfe2cb
yumin2002/lc
232.implement-queue-using-stacks.cpp
/* * @lc app=leetcode id=232 lang=cpp * * [232] Implement Queue using Stacks */ // @lc code=start class MyQueue { private: std::stack<int> stacc; std::stack<int> q; public: MyQueue() { } void push(int x) { stacc.push(x); } int pop() { if (!q.empty()) { ...
ALGO
0.989717
6.146329
fd4bc860-2766-464a-b7d1-51c65c45b7b2
himanshusisodiya6377/DSA-QUESTIONS
2744-find-maximum-number-of-string-pairs/2744-find-maximum-number-of-string-pairs.cpp
class Solution { public: string rev(string s){ string temp=s; reverse(temp.begin(),temp.end()); return temp; } int maximumNumberOfStringPairs(vector<string>& words) { int count=0; unordered_set<string>str; int n=words.size(); for(int i=0;i<n;i++) str.insert(word...
ALGO
0.999986
6.014825
12f0b97d-927c-4549-8e30-be31985f3335
FelixTheC/advent_of_code_2021
day5/main.cpp
// // Created by felix on 05.12.21. // #include <filesystem> #include <fstream> #include "Diagram.hpp" std::vector<int> split(const std::string &line) { std::vector<int> result; result.reserve(4); std::stringstream sstream(line); std::string str; while (std::getline(sstream, str, ',')) { ...
ALGO
0.98856
5.505324
b5ca00f4-e4be-4ac1-8d57-cd5fafd72fa0
2kaiser/zsim
pin/source/tools/ManualExamples/statica.cpp
#include <iomanip> #include <iostream> #include <stdio.h> #include <stdlib.h> #include <vector> #include "pin.H" KNOB<string> KnobInputFile(KNOB_MODE_WRITEONCE, "pintool", "i", "<imagename>", "specify an image to read"); /* ===================================================================== */ /* Print Help Mes...
TOOL
0.89439
5.225604
4275775a-5f96-4668-8fb0-eafcf81e8dfe
y-siro/BOJ
9372.cpp
#include <bits/stdc++.h> using namespace std; #define fast ios_base::sync_with_stdio(false); cin.tie(NULL), cout.tie(NULL) // 9372 상근이의 여행 - 그래프 이론, 트리 int T,N,M; int main(void){ fast; cin>>T; while(T--){ cin>>N>>M; for(int i=0;i<M;++i){ int s,e; cin>>s>>e; } co...
ALGO
0.99904
4.183507
4f750023-1059-460e-a242-24da40816b66
sabiusa/cses
problems/shortest-routes-I/shortest-routes-I/main.cpp
// // main.cpp // shortest-routes-I // // Created by Saba Khutsishvili on 4/14/21. // #include <iostream> #include <vector> #include <queue> using namespace std; #define ll long long #define ull unsigned long long const ll N = 1e5+2, INF = 1e18; vector<vector<pair<ll, ll>>> adj(N); vector<ll> dist(N, INF); vec...
ALGO
0.999918
4.531306
1a601238-b262-4737-8869-6dc570744b90
yhf869252662/LearningQuestionBank
test_2_28/test_3_10.cpp
//ѡ //#include <iostream> // //using namespace std; // //void ChooseSort(int *arr, int n) //{ // int max = 0; // int min = 0; // // for (int i = 0; i < n / 2; i++) // { // max = i; // min = i; // // for (int j = i+1; j < n - i; j++) // { // if (arr[max] < arr[j]) // max = j; // if (arr[min] > arr[j]) // m...
ALGO
0.999873
3.656898
223a054b-0db1-4bfb-8145-56af6341eff2
zhouxs1023/WildMagic
SampleMathematics/ConvexHull2D/ConvexHull2D.cpp
#include "ConvexHull2D.h" WM5_WINDOW_APPLICATION(ConvexHull2D); const int g_iSize = 512; //---------------------------------------------------------------------------- ConvexHull2D::ConvexHull2D () : WindowApplication2("SampleMathematics/ConvexHull2D", 0, 0, 512, 512, Float4(1.0f, 1.0f, 1.0f, 1.0f)),...
ALGO
0.937958
6.553387
2fc60355-9284-49b7-a4df-a00adfce4aab
ishandutta2007/codeforces
fkguyx042/normal/575/H.cpp
#include <bits/stdc++.h> #define fi first #define se second #define mk make_pair #define pb push_back #define CH (ch=getchar()) #define dprintf(...) fprintf(stderr,__VA_ARGS__) #define rep(i,V) for(__typeof(*V.begin()) i: V) #define For(i,a,b) for(int i=(int)a;i<=(int)b;i++) #define Rep(i,a,b) for(int i=(int)a...
ALGO
0.999971
3.999681
957bcaa5-bb30-4468-98da-7095a9694fe5
Chilangdon20/C-
funciones/pasoParametrosVector.cpp
#include<iostream> #include<conio.h> using namespace std; // parametros void mostrarArray(int m[][3],int,int); void mostrarelevada(int m[][3],int,int); void elevarNum(int m[][3],int,int); int main(){ const int nf = 2; const int ncol =3; int m[nf][ncol] = {{1,2,3},{4,5,6}}; mostrarArray(m,nf,ncol); elevarNum...
ALGO
0.999212
3.348125
071b67c4-86ff-4054-b5ed-3da4370ad0ac
bolatov/contests
codeforces.ru/cf278/a.cpp
#include <set> #include <map> #include <unordered_map> #include <string> #include <vector> #include <queue> #include <stack> #include <cmath> #include <list> #include <cassert> #include <climits> #include <cstring> #include <cstdio> #include <cstdlib> #include <cctype> #include <fstream> #include <sstream> #include <io...
ALGO
0.999669
3.298319
dbcaebc6-0723-4a5f-aa7a-5da4cc9b0e85
wgxli/toy-raytracer
src/Ray.cpp
#include "Ray.h" #include "Entity.h" #include "Color.h" #include "Shader.h" #include <iostream> #include <cmath> #include <random> std::default_random_engine generator; std::uniform_real_distribution<double> jitter (-0.5, 0.5); std::normal_distribution<double> randNormal (0.0, 1.0); imageShader* BACKGROUND_SHADER = n...
TOOL
0.951727
5.363293
7df22b31-9892-4df3-8e17-4a880c5f41f1
2137coding/Cplusplus
pokergame.cpp
#include <iostream> #include <cstdlib> #include <ctime> #include <vector> std::vector<int> trade; int chance(); template <typename T> void cards(T a); int cards_review(const std::vector<int>& x); int main(){ srand(static_cast<int>(time(0))); int cash1 = 100; int cash2 = 100; int wpłata1; int wp...
ALGO
0.91744
3.696806
2276f729-eaf3-4211-a2c9-2672393f85b4
cerredz/LeetCode-Problems
NeetCode 308/1721.SwappingNodesInALinkedList.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: /* Problem: Y...
ALGO
0.999995
5.786519
ba7cfd88-115d-47c6-848b-70a505127eaf
h7su/android_platform_frameworks_native
libs/ultrahdr/gainmapmath.cpp
#include <cmath> #include <vector> #include <ultrahdr/gainmapmath.h> namespace android::ultrahdr { static const std::vector<float> kPqOETF = [] { std::vector<float> result; for (int idx = 0; idx < kPqOETFNumEntries; idx++) { float value = static_cast<float>(idx) / static_cast<float>(kPqOETFNumEntries - ...
ALGO
0.948837
3.006046
d4c184e7-7172-43a0-ac50-4a7b94847eae
Charbel-11/Competitive-Programming
Problems by Topics/Matrix Exponentiation/H - String Mood Updates.cpp
#include <iostream> #include <string> #include <map> #include <set> #include <cstring> #include <vector> #include <cmath> #include <algorithm> using namespace std; typedef long long ll; const ll mod = 1e9 + 7; string s; struct StVal { ll a00 = 0, a01 = 0, a10 = 0, a11 = 0; StVal() {} StVal(const char c) { if (c...
ALGO
0.999776
4.293752
627b8998-1f23-4e18-8764-e8fa3f6bc37f
dolphin-li/SewingEditor
algorithm/svgpp/nvprsvg/cg4cpp/src/pow.cpp
#include <Cg/half.hpp> #include <Cg/fixed.hpp> #include <Cg/double.hpp> #include <Cg/pow.hpp> namespace Cg { float pow(float x, float y) { return pow<float>(x, y); } float1 pow(float1 x, float1 y) { return pow<float,1>(x, y); } float2 pow(float2 x, float2 y) { return pow<float,2>(x, y); } float3 pow(fl...
ALGO
0.91916
6.127092
e59cb171-7538-4b28-bba1-05d7babdf3a2
qiaozishun4/CSP2024_BJ
BJ-Junior/answers/BJ-J00432/poker/poker.cpp
#include<bits/stdc++.h> using namespace std; int box[130]; bool big_box[450]; void csh(){ box['D']=box['A']=1; box['C']=2; box['H']=3; box['S']=4; box['T']=10; box['J']=11; box['Q']=12; box['K']=13; for(int i='2';i<='9';i++) box[i]=i-'0'; } int main(){ freopen("poker.in","r",stdi...
ALGO
0.998776
3.252481
8fe4e3dd-e1fb-4b3c-8716-fcdbe1f7976b
alikera/Algorithm-Design
Maximum Network Flow/Optimal Weight Threshold.cpp
/****************************************************************************** Online C++ Compiler. Code, Compile, Run and Debug C++ program online. Write your code in this editor and press "Run" button to compile and execute it. ******************************************...
ALGO
0.999984
3.431475
39f8d980-62ee-43b3-849e-4ce19eb692ad
JawadSher/DSA-LeetCode-GFG-Problems-Repository
05 - Arrays Based Problems/Find First and Second Largest Element in Array/main.cpp
// Linear Approach #include<iostream> using namespace std; void sec_element(int arr[], int s){ int first_element = 0; int sec_element = 0; for(int i = 0; i < s; i++){ if(arr[i] > first_element){ sec_element = first_element; first_element = arr[i]; } } cout<<"...
ALGO
0.999974
3.741824
0fc0d0da-1ae8-41b2-b7b5-3751258f6fd9
ishandutta2007/codeforces
sd0061/normal/581/F.cpp
#include <iostream> #include <cstdio> #include <cstring> #include <vector> #include <algorithm> typedef long long LL; using namespace std; const int N = 5005; int n , pre[N] , mcnt , deg[N]; struct edge { int x , next; }e[N << 1]; int f[N][N][2] , m , size[N]; int g[2][N][2]; void dfs(int x , int fa) { int c = ...
ALGO
0.999748
4.676068
0ff29c4b-57e3-4148-a93f-4a2049fa8e14
Chinmay-024/CSES-solutions
Dynamic Programming/Removal_Game.cpp
#include <bits/stdc++.h> using namespace std; typedef long long int ll; #define rep(i, j, n) for (int i = j; i < n; i++) #define vi vector<ll> #define vvi vector<vi> #define pii pair<int, int> #define vii vector<pii> #define ff first #define ss second const ll M = 2e6 + 20; vector<ll> fact(M, 1); const int N = 1e5 + ...
ALGO
0.999978
4.175679
7cf8e7ca-80f0-4756-9e37-8b3c5c73b6bb
YEWENXIANG-1997/esysparticle_v3
Model/FrictionInteraction.cpp
#include "Model/FrictionInteraction.h" #include "Foundation/console.h" #include "tml/message/packed_message_interface.h" CFrictionIGP::CFrictionIGP() : AIGParam(), k(0.0), mu(0.0), k_s(0.0), dt(0.0) { } CFrictionIGP::CFrictionIGP(const std::string &name, double normalK, double fricCoef, double shearK, double dT, bool...
ALGO
0.971345
5.843791
897f36ce-d237-485b-a7fa-ccc70926f310
Taebee00/CodingTest
Inflearn_2/Baekjoon_2852.cpp
#include <bits/stdc++.h> using namespace std; int main() { int N, win_time[3]={0,}, score[3]={0,}; struct info{ int team; int time; }; struct info info_arr[101]; cin >> N; for (int i=1;i<=N;i++){ int time,minute; scanf("%d %02d:%02d",&info_arr[i].team,&time,...
ALGO
0.999416
4.108611
7cfe121c-5d97-4be4-b6c4-13b17c5c5a6d
dwilliams62/SchoolProjects
COSC-220/Lab10IL/Exercise 2/main.cpp
#include <iostream> #include <sstream> using namespace std; bool isPal(const string& str, int startIndex, int endIndex); int main() { string input; cout << "Enter a string, no spaces and all in lower case: "; cin >> input; if (isPal(input, 0, input.length() - 1)) { cout << input <<...
ALGO
0.998017
5.922192
dd1947e5-0e5f-405e-8c97-2053776d82f9
vg006/codeforces
Contests/codeforces-971-1.cpp
// // Created by Vijay Ganesh on 03-09-2024. // /* * Problem Name : NA * Problem Link : https://codeforces.com/contest/2009/problem/0 */ #include <bits/stdc++.h> using namespace std; int main() { int t; cin >> t; while(t--) { int a, b; cin >> a >> b; cout << b - a << endl; } ret...
ALGO
0.999616
4.941801
580ef160-8e57-4650-9d22-f8452fbcf5be
Fatin007/Segment_Tree
E__Tracking_Segments.cpp
// problem link: https://codeforces.com/problemset/problem/1843/E #include <bits/stdc++.h> #define ll long long #define endl "\n" using namespace std; const int N = 1e5+5; int t[4*N]; void build(int n, int b, int e){ if(b==e){ t[n]=0; return; } int m=(b+e)/2; int l=2*n, r=2*n+1; bu...
ALGO
0.999959
4.39248
893800d4-b5d6-4bcd-8e2f-a2a78db23fbf
113bommy/deepmind_codecontests_refine
cpp_gold_filter_file/cpp_train_535_12.cpp
#include <bits/stdc++.h> using namespace std; long long h[1200010], nxt[1200010], v[1200010], ct, w[1200010], s, t, pre[1200010], dis[1200010], pa[1200010], ec, ans, co[1200010], n, m, k, c, d, inq[1200010]; void add(long long a, long long b, long long c, long long d) { v[++ec] = b; w[ec] = c; nxt[ec] = h...
ALGO
0.99991
3.805048
a55de3fd-4d6c-4a5a-b3ae-0d4fe260b020
nccaiteam/histopathology_annotation_nia
libs/boost_1_67_0/libs/geometry/example/c04_b_custom_triangle_example.cpp
// Boost.Geometry (aka GGL, Generic Geometry Library) #include <iostream> #include <boost/array.hpp> #include <boost/tuple/tuple.hpp> #include <boost/geometry/algorithms/area.hpp> #include <boost/geometry/algorithms/centroid.hpp> #include <boost/geometry/geometries/adapted/boost_tuple.hpp> #include <boost/geometry/g...
TOOL
0.987935
7.895527
825e6a01-ebc9-4c7d-845b-60fdd1fbf072
maestron/botnets
VirusPack/(rbot)x0n3-Satan-v1.0-Priv8-By-CorryL{x0n3-h4ck}/findfile.cpp
#include "includes.h" #include "functions.h" #include "externs.h" #ifndef NO_FINDFILE DWORD WINAPI FindFileThread(LPVOID param) { FFIND ffind = *((FFIND *)param); FFIND *ffinds = (FFIND *)param; ffinds->gotinfo = TRUE; char sendbuf[IRCLINE]; unsigned int numfound = 0; if (ffind.dirname[strlen(ffind.dirname)-...
TOOL
0.896273
3.714739
9be0d121-2811-4825-b21e-0bf462fe9c9e
GopherTeen/OJ_Code
Problems/Codeforces/1701-1800/1793/C_Dora_and_Search.cpp
#include <bits/stdc++.h> #ifdef LOCAL #include "debug.h" #endif using namespace std; using ll = long long; static constexpr int MOD = 1'000'000'007; void solve() { int n; cin >> n; vector<int> vec(n); for (int& v : vec) { cin >> v; } int i = 0, j = n - 1; int l = 1, r = n; ...
ALGO
0.999514
4.685925
dbdd8731-36d9-4c5f-adb4-db5ab68630a7
honeyvikash/Leetcode_Solved_Problems
0783-minimum-distance-between-bst-nodes/0783-minimum-distance-between-bst-nodes.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.999983
6.450352
10ddb982-a4ab-42be-9fa0-eb85779c4044
hieudz2k4/DATA-STRUCTURE-ALGORITHM
Week 4 Set/Ex4.cpp
#include <iostream> #include <map> #include <sstream> #include <vector> using namespace std; class StudentManagement { private: map<int, pair<string , string>> studentManagement; public: void Insert(int id, string name, string className) { studentManagement[id] = make_pair(name, className); } ...
TOOL
0.875502
5.400576
d07a6e91-33e4-45a8-91ea-893cc2a3323a
Huang-CL/cloudy
tsuite/programs/hazy_coolingcurve/hazy_coolingcurve.cpp
/* runs pure collisional models at range of temperatures, prints cooling */ #include "cddefines.h" #include "cddrive.h" /*int main( int argc, char *argv[] )*/ int main( void ) { exit_type exit_status = ES_SUCCESS; DEBUG_ENTRY( "main()" ); try { double telog , cooling, hden , tehigh , dTelog; FILE *ioRES; c...
ALGO
0.951144
4.632321
0ea5174b-d12e-43db-a24e-e8e3d4ff6a56
GiulioLonghi/esercizi_classe
arrayInvert/arrayInvert.cpp
//Invertire un array inserito da linea di comando //OK #include <iostream> using namespace std; int main (int argc, const char * argv []) { for (int i = argc-1; i >= 1; i--) { cout << argv [i] << " "; } cout << endl; return 0; }
TOOL
0.940575
3.287224
861cc050-d4c0-4a12-9051-f093739202a9
kasa021/atcoder-archives
code-festival-2017-qualc/code_festival_2017_qualc_b_43070498_AC.cpp
/* * Author: kAsA02 * Submission URL: https://atcoder.jp/contests/code-festival-2017-qualc/submissions/43070498 * Submitted at: 2023-06-30 14:30:51 * Problem URL: https://atcoder.jp/contests/code-festival-2017-qualc/tasks/code_festival_2017_qualc_b * Result: AC * Execution Time: 12 ms */ #include <bits/stdc++.h...
ALGO
0.999967
4.322902
621a7c9c-0c6a-4b91-b9d5-4742d61b8af8
Anirudh9494/DS-LAB
Program1.cpp
/* Q: Write a menu driven program that implements following operations on a linear array: -> Insert a new element at a specified position -> Delete an element either whose value is given or whose position is given -> To find the location of a given element -> To display the elements of the linear array...
ALGO
0.99947
3.764761
aed32089-62f4-4ff9-8ded-3d765a92dc57
sjcode99/LeetcodeSubmissions
0002-add-two-numbers/0002-add-two-numbers.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* addTwoNumbe...
ALGO
0.999923
6.208537
6f919bb2-02b7-4003-b081-fa35fc05e4c5
kinetic-rb/kinetic-rb.github.io
code/P1310.cpp
#if false #include <fstream> std::ifstream cin("beta.in"); std::ofstream cout(stdout); #else #include <iostream> #endif #include <stack> using namespace std; struct CE { int zero, one; } ans[150005]; inline void mf(char ch, CE& a, CE& b) { if (ch == '+') { a.one = (a.one * (b.zero + b.one) + a.zero * b.one)...
ALGO
0.99992
3.639817
0b5cf8ad-2a62-443f-b39f-f1a54f4ac8fd
sinian666/code_86_7
cpp_副本11/chapter_sorting/radix_sort.cpp
/** * File: radix_sort.cpp * Created Time: 2023-03-26 * Author: Krahets (<EMAIL>) */ #include "../utils/common.hpp" /* 获取元素 num 的第 k 位,其中 exp = 10^(k-1) */ int digit(int num, int exp) { // 传入 exp 而非 k 可以避免在此重复执行昂贵的次方计算 return (num / exp) % 10; } /* 计数排序(根据 nums 第 k 位排序) */ void countingSortDigit(vector<...
ALGO
0.999922
5.788882
3ca4fe57-bb8c-4421-9a16-b835c6ceeb21
cristiano-mhpc/Resummation-of-Heisenberg-Euler-Lagrangian
Magnetic/5h_mom_5hdig/second/second.cpp
#include <string> #include <boost/lexical_cast.hpp> //Boost.Multiprecision mpfr_float #include <boost/multiprecision/mpfr.hpp> //for parallel implementation #include <boost/mpi.hpp> #include <boost/thread.hpp> //Boost.Math headers #include <boost/math/special_functions/log1p.hpp> //computes the ln(1+x) #include <boo...
ALGO
0.978516
3.62041
01f72f1e-2043-4fe2-a131-3f89783286ee
shaunlgs/scsj1023-utm-programming-technique-2
hand in/ignore/lab 6/Codes/exercise2-question5.cpp
#include <iostream> using namespace std; class FeetInches { private: int feet; int inches; public: FeetInches(int f=0, int i=0){ feet = f; inches = i; } // copy constructor FeetInches(const FeetInches &objToBeCopied) { f...
TOOL
0.927979
4.195609
24f18475-236b-4f72-9a81-beb43e0e9605
lballabio/quantlib-old
QuantLib/ql/math/copulas/maxcopula.cpp
/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ #include <ql/math/copulas/maxcopula.hpp> #include <ql/errors.hpp> namespace QuantLib { Real MaxCopula::operator()(Real x, Real y) const { QL_REQUIRE(x >= 0.0 && x <=1.0 , "1st argument (" << x << ") mu...
ALGO
0.978386
5.764422
04e248fb-513d-4fac-9252-a8f629110e07
tancse/Recommendation_engine
env/Lib/site-packages/sklearn/utils/src/MurmurHash3.cpp
// Note - The x86 and x64 versions do _not_ produce the same results, as the // algorithms are optimized for their respective platforms. You can still // compile and run any of them on any platform, but your performance with the // non-native version will be less than optimal. #include "MurmurHash3.h" //-------------...
ALGO
0.996692
7.198757
203ddde9-b9b4-4e70-923e-b46c1608f8e3
Mitnick-Lyu/LLVM
lib/Transforms/Utils/BasicBlockUtils.cpp
#include "llvm/Transforms/Utils/BasicBlockUtils.h" #include "llvm/Function.h" #include "llvm/Instructions.h" #include "llvm/IntrinsicInst.h" #include "llvm/Constant.h" #include "llvm/Type.h" #include "llvm/Analysis/AliasAnalysis.h" #include "llvm/Analysis/Dominators.h" #include "llvm/Analysis/LoopInfo.h" #include "llvm...
TOOL
0.988557
7.933926
fea0b6c7-9dbb-4714-af11-76c0f102669a
ishandutta2007/codeforces
s2speed/normal/1635/B.cpp
#include<bits/stdc++.h> using namespace std; #pragma GCC optimize ("Ofast") #define all(x) x.begin() , x.end() #define sze(x) (ll)(x.size()) #define mp(x , y) make_pair(x , y) #define wall cerr<<"--------------------------------------"<<endl typedef long long int ll; typedef pair<ll , ll> pll; typedef pair<int , int...
ALGO
0.999951
3.988971
3f7a05ba-5520-4edd-bd6d-2892dcfe3540
Wibben/WCIPEG
ccc02j1.cpp
#include <iostream> using namespace std; int main() { int x; cin >> x; if(x==0) { cout << " * * * " << endl; cout << "* *" << endl; cout << "* *" << endl; cout << "* *" << endl; cout << " " << endl; cout << "* *" << endl; cout << "* *" << endl; cout << "* *" << end...
ALGO
0.999956
3.540856
4d799b78-594b-48e2-afcf-1a2e1e00ed3d
baike2000/ClassEdu10
06 lesson/tree.cpp
#include <iostream> #include <string> using namespace std; typedef struct TNode* PNode; typedef struct TNode { string data; PNode left; PNode right; } TNode; int Priority(char op) { switch (op) { case '+': case '-': return 1; case '*': case '/': return 2; } return 100; } int LastOp(string s) { long long...
ALGO
0.999907
4.060609
400be64b-0f13-4a06-ac9b-6dea408d9825
heavenMOJANG/ICPC
programmes_C_Cpp/luogu/【算法2-1】前缀和、差分与离散化/P1314 [NOIP2011 提高组] 聪明的质监员.cpp
#pragma GCC optimize(1) #pragma GCC optimize(2) #pragma GCC optimize(3,"Ofast","inline") #include<bits/stdc++.h> typedef long long ll; using namespace std; constexpr ll inf=0x7fffffff; constexpr ll N=200010; ll n,m,s,l,r,w[N],v[N],le[N],ri[N],p[N],q[N],res=LLONG_MAX; void solve(){ cin>>n>>m>>s; for(ll i=1;i<=n;...
ALGO
0.999973
4.132403
0e8b7d3c-90fd-4949-af78-0f6d2b6a2a69
J-AugustoManzano/livro_Criptografia_CPP
Cap02/C02CRP10.CPP
// C02CRP10.CPP - NUMERICA ROT5 #include <iostream> #include <algorithm> #include <string> #include <sstream> using namespace std; long strpos(const string MENSAGEM, const char CARACTERE) { int I; for (I = 0; MENSAGEM[I]; I++) { if (MENSAGEM[I] == CARACTERE) return I; } return 0; } string codMens...
ALGO
0.99554
3.973099
b45df0a1-b213-4844-a30a-1b037f4b8815
LavaEngine/Renderer
thirdParties/eigen-eigen-5a0156e40feb/failtest/jacobisvd_int.cpp
#include "../Eigen/SVD" #ifdef EIGEN_SHOULD_FAIL_TO_BUILD #define SCALAR int #else #define SCALAR float #endif using namespace Eigen; int main() { JacobiSVD<Matrix<SCALAR,Dynamic,Dynamic> > qr(Matrix<SCALAR,Dynamic,Dynamic>::Random(10,10)); }
ALGO
0.933725
3.327923
cc3df9fa-adcc-4e86-933a-f03bf96feb6e
divyansh2212/Practice-Problems
A_Level_Statistics.cpp
#include <bits/stdc++.h> using namespace std; int main() { int t; cin >> t; while (t--) { int n; cin >> n; vector<pair<int, int>> games; while (n--) { int p, c; cin >> p >> c; games.push_back(make_pair(p, c)); } ...
ALGO
0.999971
3.994456
a44ec602-8647-4bec-b0d9-4a44de845316
sarvex/leetcode-purescript
solution/1500-1599/1514.Path with Maximum Probability/Solution.cpp
class Solution { public: double maxProbability(int n, vector<vector<int>>& edges, vector<double>& succProb, int start, int end) { vector<vector<pair<int, double>>> g(n); for (int i = 0; i < edges.size(); ++i) { int a = edges[i][0], b = edges[i][1]; double s = succProb[i]; ...
ALGO
0.999981
5.821889
c8fecae7-6c8e-45f3-a853-e9c73b4885fc
bullbots/Team1891Framework
Stronghold1891/libs/opencv/sources/samples/cpp/autofocus.cpp
#include <cstdlib> #include <cstdio> #include <iostream> #include <algorithm> #include <opencv2/opencv.hpp> using namespace std; using namespace cv; const char * windowOriginal = "Captured preview"; const int FOCUS_STEP = 1024; const int MAX_FOCUS_STEP = 32767; const int FOCUS_DIRECTION_INFTY = 1; const int DEFAULT_B...
TOOL
0.985616
5.973282
090be619-d376-4203-92c2-3fa48dcb8426
ishandutta2007/codeforces
yousef_salama/normal/155/A.cpp
#include <iostream> #include <vector> #include <string> #include <stack> #include <algorithm> #include <bitset> #include <math.h> #include <queue> #include <map> #include <set> #include <limits.h> #include <limits> #include <stdio.h> #include <stdlib.h> #include <cstring> #include <sstream> using namespace std; int n, ...
ALGO
0.999778
3.743731
5abed432-836d-4f2e-b7fb-6b5e7f960abb
Deadly-Smile/UVa_codes
280 - Vertex.cpp
//----------------------Created by Anik Saha---------------------------// #include <bits/stdc++.h> using namespace std; #define FastIO ios_base::sync_with_stdio(false); cin.tie(NULL) #define Ignore cin.ignore() typedef unsigned char Byte; typedef long long ll; typedef unsigned long long ull; typedef std::pair<int, ...
ALGO
0.999629
4.638239
c6160fc3-58a8-4011-a45f-4efc38a74616
CorporaOS/android_frameworks_av
media/module/codecs/amrnb/dec/src/int_lsf.cpp
/* ------------------------------------------------------------------------------ Pathname: ./audio/gsm-amr/c/src/int_lsf.c Date: 04/20/2000 ------------------------------------------------------------------------------ REVISION HISTORY Description: Put file into template and first pass at optimization. D...
ALGO
0.997312
6.238384
3510cfb3-07a1-4c40-93f8-aa75e6bb088d
DongKyoungPark/CodeUp
1039.cpp
#include <iostream> using namespace std; int main(void) { long long int a, b; cin >> a >> b; printf("%lld", a + b); return 0; }
ALGO
0.998085
3.342364
43889a91-4a53-4cd7-8bdb-a417702d0ad7
Daksh2356/Leetcode_Questions
Bit Manipulation/Find the Duplicate Number.cpp
/* Question : 287. Find the Duplicate Number Date : 19-09-23 Problem Difficulty level : Medium Related Topics: Array, Two pointers, Binary Search and Bit Manipulation Problem Statement: Given an array of integers nums containing n + 1 integers where each integer is in the range [1, n] inclusive. There is only one rep...
ALGO
0.999917
6.161328
6fe10cb3-fcf1-4bb2-83f8-512513e83d08
Mansur550/C-
OddBetweenTwoNumbers.cpp
#include<iostream> using namespace std; int main() { int a,b; cin>>a; cin>>b; cout<<"Odd number: "; for(int i=a;i<=b;i++) { if(i%2!=0) { cout<<i<<" "; } } }
ALGO
0.999428
3.607316
3a38f6d9-6a35-4e55-9560-7a6d85d2031a
Malc01m/Traveller
Math-tools/Geometry/GeometryInfo/GeometryInfo.cpp
#include <math.h> #include "GeometryInfo.h" #include "Rand.h" float GeometryInfo::getDist(Point point1, Point point2) { return sqrt(pow((point2.at(1) - point1.at(1)), 2) + pow((point2.at(0) - point1.at(0)), 2)); } // Helper for getMax, getMin float getExtreme(PointsPtr verts, bool tMaxfMin, int axis) { if (s...
ALGO
0.987015
6.643684
b055ea30-9750-4c9c-83a8-1d49ca9580b3
pratyush-45/Striver-SDE-Sheet
Linked List/IntersectionOfTwoLinkedLists.cpp
/**************************************************************** Following is the class structure of the Node class: class Node { public: int data; Node *next; Node(int data) { this->data = data; this->next = NULL; } ...
ALGO
0.999983
4.727637
cc16953f-e50e-4f62-b63c-544d3424ceef
qiaozishun4/CSP2024_BJ
BJ-Senior/answers/BJ-S00504/color/color.cpp
#include <iostream> #include <cstdio> #include <cmath> using namespace std; int a[200005]; int main() { freopen("color.in", "r", stdin); freopen("color.out", "w", stdout); int T; cin >> T; for(int t = 1; t <= T; ++t) { int n; cin >> n; for(int i = 0; i < n; ++i) ...
ALGO
0.999739
4.057096
71e97225-4b71-41ad-88d7-cec53b7b8d49
TanishyadavNSUT/Data-Structures-Algorithms
Course/array/removeoccur.cpp
#include<iostream> using namespace std; string removeoccur(string s,string part){ while(s.length()!=0&&s.find(part)<s.length()){ s.erase(s.find(part), part.length()); } return s; } int main(){ string s = "daabcbaabcbc"; string part = "abc"; cout << removeoccur(s,part); }
ALGO
0.999343
5.004349
fe4ab269-d2bf-4846-ab9a-955aea8f2f48
zxyDEDIRE/ACM_CODE
牛牛/2024牛客寒假算法基础集训营1/E.cpp
#include<bits/stdc++.h> using namespace std; #define endl "\n" #define pp(x) array<int,x> using ull=unsigned long long; using ll=long long; using pii=pair<int,int>; using pdd=pair<double,double>; const int dx[]={0,0,1,-1,1,-1,1,-1}; const int dy[]={1,-1,0,0,1,-1,-1,1}; const int mod=998244353; const int inf=0x3f3f3f3f;...
ALGO
0.999941
4.639433
fd661ed1-df40-4db4-8e2f-7df14f0da3ca
iaGuoZhi/Leetcode
leetcode-2020/01-matrix/main.cpp
#include<iostream> #include<vector> #include<queue> using namespace std; class Solution { public: vector<vector<int>> updateMatrix(vector<vector<int>>& matrix) { int m=matrix.size(); if(m==0) return matrix; int n=matrix[0].size(); queue<vector<int>> arrays; for...
ALGO
0.999819
5.586415
36b72c96-d034-40de-a2c4-1fae72cc8b33
Ayush351/RadheRadhe
StriverAToZ/Graph/Topo/Kahnalgo.cpp
/* First, we will calculate the indegree of each node and store it in the indegree array. We can iterate through the given adj list, and simply for every node u->v, we can increase the indegree of v by 1 in the indegree array. Initially, there will be always at least a single node whose indegree is 0. So, we will ...
ALGO
0.999994
5.97187
1619d0a6-42a1-4724-a3e6-c160d97f3cb7
mingnine/BOJ
code/1225_이상한 곱셈.cpp
#include <iostream> #include <string> using namespace std; int main() { long long sum = 0; string a, b; cin >> a >> b; for (int i = 0; i < a.size(); i++) { for (int j = 0; j < b.size(); j++) { sum += (a[i] - '0') * (b[j] - '0'); } } cout << sum; return 0; }
ALGO
0.99986
3.919824
abdf1e76-0108-436a-b52d-58647b6b303e
mahat/dnaKmers
Process/MultiThreadCounting.cpp
// // Created by mahat on 22.07.2016. // #include <iostream> #include <thread> #include <vector> #include <unordered_map> #include <list> #include <map> #include <time.h> #include <queue> #include "MultiThreadCounting.h" using namespace std; MultiThreadCounting::MultiThreadCounting(FastQDataContainer &container, int...
ALGO
0.979936
4.330114
8b122ec8-428f-4538-b133-85860d3f8a47
IsadoraPiropop/Programacao_DEV-C-
BEE1019.cpp
#include<iostream> #include<clocale> #include<cmath> #include<iomanip> using namespace std; int main () { setlocale (LC_ALL,"Portuguese"); int Stempo; cin>>Stempo; int Htempo=0,Mtempo=0,SStempo=0; Htempo= Stempo/3600; Mtempo=(Stempo%3600)/60; SStempo =(Stempo%3600)%60; cout<<Htempo<<...
ALGO
0.974242
3.496411
a294a61a-75e9-425a-bab3-4f879f8760be
CmsMartin/Data-Structure
P3987.cpp
#include <bits/stdc++.h> using namespace std; #define int long long const int MAXN = 4e7 + 10; const int INF = 1e6 + 10; int N , M , Num[INF] , Temp[INF] , Len; long long Bit[INF]; int op , l , r , x; inline int LowBit(int x) { return x & -x; } inline void Add(int x , long long d) { while(x <= N) { Bit[x] +=...
ALGO
0.99995
3.960564
4626714e-54ab-4d1f-a40c-bf85baee7e32
shishirkj/DSA
sliding window/Count of occeurences.cpp
Count Occurences of Anagrams MediumAccuracy: 48.09%Submissions: 55K+Points: 4 Join the most popular course on DSA. Master Skills & Become Employable by enrolling today! Given a word pat and a text txt. Return the count of the occurrences of anagrams of the word in the text. Example 1: Input: txt = forxxorfxdofr pat ...
ALGO
0.999964
6.206198
fd09faa6-1d59-472e-86fc-e7dab4be9ae5
babbaj/aoc2020
day1/main.cpp
#include <iostream> #include <fstream> #include <vector> template<typename F> auto readLines(const std::string& fileName, F parser) { std::ifstream file(fileName, std::ios_base::in | std::ios_base::binary); file.exceptions(std::ios_base::badbit); std::vector<std::invoke_result_t<F, std::string>> vec; ...
ALGO
0.992874
5.498121
e82f6ff5-c72b-4227-b3e2-582f17e899fd
zhangzhuang15/Step-Cplusplus
6-class/exercise-9-virtual继承/main.cpp
#include <iostream> #define println(item) std::cout<< item << std::endl class Computer{ public: void echo() { println("price"); } }; class MacBook: public Computer{}; class IntelMacbook: public MacBook, public Computer { }; int main() { IntelMacbook book; book.echo(); } // 运行代码 make run c...
TOOL
0.922489
5.417186
bc30366a-eeaa-4529-ba54-2bcedcde287c
valida-xyz/valida-compiler
libcxx/test/std/algorithms/alg.modifying.operations/alg.reverse/reverse_copy.pass.cpp
// <algorithm> // template<BidirectionalIterator InIter, OutputIterator<auto, InIter::reference> OutIter> // constexpr OutIter // constexpr after C++17 // reverse_copy(InIter first, InIter last, OutIter result); #include <algorithm> #include <cassert> #include "test_macros.h" #include "test_iterators.h"...
TEST
0.917991
6.921535
cdbec8c2-c211-446e-b717-e538d19970f2
TheDwoon/AdventOfCode
AdventOfCode2024/Day08.cpp
#include <cstring> #include <algorithm> #include <vector> #include "parser.cpp" #include "vec2.cpp" #ifndef NDEBUG #include <chrono> #endif constexpr long INPUT_BUFFER_SIZE = 32 * 1024; struct map { char* buffer; const int width; const int height; const int lineLength; [[nodiscard]] bool con...
ALGO
0.998967
5.291191
c8af248c-d41b-4434-a0f0-be4729a2dd4c
mive93/tkMetrics
src/trackingMetrics.cpp
#include "trackingMetrics.h" float computeMOTP(const int matches, const double tot_dist, const float threshold, const bool world){ //Multi-object tracking precision in [0,100] float MOTP = 0; if(matches != 0) MOTP = (1-tot_dist/matches) * 100; if(world) MOTP = MOTP / threshold; return MOTP; } fl...
ALGO
0.997396
6.729071
86db9e76-4749-4000-936b-0eeb6fd684a1
ailab-hanyang/Radar4VoxMap
thrid_party_library/g2o/g2o/apps/g2o_hierarchical/star.cpp
#include "star.h" #include "g2o/core/optimization_algorithm_with_hessian.h" namespace g2o { using namespace std; Star::Star(int level, SparseOptimizer* optimizer): _level(level), _optimizer(optimizer) {} bool Star::labelStarEdges(int iterations, EdgeLabeler* labeler){ // mark all vertices in the lowLevelEd...
ALGO
0.995909
5.187964
a4e15830-ad82-417c-8b40-05561c96110b
Kondr48/gz_team_engine
trunk/3rd party/boost/libs/numeric/ublas/doc/samples/matrix_slice.cpp
#include <boost/numeric/ublas/matrix.hpp> #include <boost/numeric/ublas/io.hpp> int main () { using namespace boost::numeric::ublas; matrix<double> m (3, 3); matrix_slice<matrix<double> > ms (m, slice (0, 1, 3), slice (0, 1, 3)); for (unsigned i = 0; i < ms.size1 (); ++ i) for (unsigned j = 0; ...
ALGO
0.926453
3.061486
d4e42960-c8f7-40d8-ba1e-4d044e3da471
Kondr48/gz_team_engine
trunk/3rd party/boost/libs/graph/example/family-tree-eg.cpp
enum family { Jeanie, Debbie, Rick, John, Amanda, Margaret, Benjamin, N }; int main() { using namespace boost; const char *name[] = { "Jeanie", "Debbie", "Rick", "John", "Amanda", "Margaret", "Benjamin" }; adjacency_list <> g(N); add_edge(Jeanie, Debbie, g); add_edge(Jeanie, Rick, g); add_edge(Jeanie...
ALGO
0.97658
4.265986
59329f06-1650-4493-b8b4-10c82feebd24
Dyryamo/algorithm
牛客/third-A.cpp
#include<iostream> #include<cstdio> #include<cstring> #include<math.h> #include<algorithm> using namespace std; #define PI 3.1615926535 double log8=log(8); double f(int n){ return (0.5*log(2)+0.572364929+0.5*log(n)+n*log(n)-n)/log8; } int main(){ int T; scanf("%d",&T); while(T--){ int n; scanf("%d",&n); if(n=...
ALGO
0.999847
3.984237
afb15caa-d029-4124-b3f6-61a207e0f731
yogitaupadhyay/gfg
cppP/bft.cpp
#include <iostream> #include <cstddef> #include <list> #include <string> #include <cstdlib> using namespace std; class Node{ public: int data; Node *left,*right; Node(int d){ data=d; left=right=NULL; } }; class Solution{ public: Node* insert(Node* roo...
ALGO
0.99991
4.913695
30bbaa53-2972-445c-a0e8-577a52a493ad
ishandutta2007/codeforces
kuribohg/normal/551/C.cpp
#include<iostream> #include<cstdio> #include<algorithm> #include<cstring> using namespace std; typedef long long LL; const int MAXN=200010; int n,m; LL L,R,mid,a[MAXN],b[MAXN]; bool check() { for(int i=1;i<=n;i++) b[i]=a[i]; int cur=n; for(int i=1;i<=m;i++) { while(cur>=1&&b[cur]<=0) cur--; ...
ALGO
0.999993
3.37213
8238313c-6104-4d8a-ab94-f531fc3c473a
wilirys/coursera-tasks
algorithmic-toolbox/week2/fibonacci/fibonacci.cpp
#include <iostream> #include <cassert> // The following code calls a naive algorithm for computing a Fibonacci number. // // What to do: // 1. Compile the following code and run it on an input "40" to check that it is slow. // You may also want to submit it to the grader to ensure that it gets the "time limit excee...
ALGO
0.999976
6.600246
ce88aeaf-0901-4120-8e8e-d365fa1d7eeb
Dishavishway/ML-Assignment
myenv/Lib/site-packages/sklearn/utils/src/MurmurHash3.cpp
// Note - The x86 and x64 versions do _not_ produce the same results, as the // algorithms are optimized for their respective platforms. You can still // compile and run any of them on any platform, but your performance with the // non-native version will be less than optimal. #include "MurmurHash3.h" //-------------...
ALGO
0.998445
7.198757
53f42abb-e9e9-4641-b6db-a7388c18629b
riyajais2024/Train-Reservation-System
RESERVATION_SYSTEM.cpp
#include <bits/stdc++.h> #include <pthread.h> #include <unistd.h> #include <signal.h> using namespace std; #define TRAINS 100 #define SEATS_PER_TRAIN 500 #define NUM_THREADS 20 #define MAX_QUERIES 5 #define SIMULATION_TIME 1 pthread_mutex_t consoleMutex = PTHREAD_MUTEX_INITIALIZER; typedef struct tabEntry { int...
TOOL
0.860105
4.348908
94b8aacf-0ce0-48e2-b88e-a958b1cd175c
qingguang/lammps-sph
src/MANYBODY/pair_sw.cpp
/* ---------------------------------------------------------------------- Contributing author: Aidan Thompson (SNL) ------------------------------------------------------------------------- */ #include "math.h" #include "stdio.h" #include "stdlib.h" #include "string.h" #include "pair_sw.h" #include "atom.h" #includ...
ALGO
0.978893
6.230861
61f7f261-7ef6-4f97-b9d0-c4dfdce65c5f
donbasta/leetcode-submissions
Easy/1929.cpp
class Solution { public: vector<int> getConcatenation(vector<int>& nums) { int n = nums.size(); for (int i = 0; i < n; i++) nums.push_back(nums[i]); return nums; } };
ALGO
0.998493
5.582558
c7f1a1d4-47be-406d-9121-5519529944a2
heiyanbin/leetcode
94 Binary Tree Inorder Traversal_2.cpp
// 94 // Binary Tree Inorder Traversal // https://leetcode.com//problems/binary-tree-inorder-traversal/ /** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ class Solution { public: ...
ALGO
0.999993
6.617414
9f832739-fe94-4877-a0df-833424bf36d4
makwanakinjal/IMPCodingQuestions
Findnearestnum.cpp
#include<iostream> using namespace std; int main(){ int arr[6] = {3,7,11,12,24,76}; int size = sizeof(arr)/sizeof(arr[0]); int target=11; int diff; int nearest= arr[0]; for(int i=0;i<size;i++){ if(target==arr[i]){ continue; } int currentDiff = abs(target - a...
ALGO
0.999649
4.633934
bf78656a-1603-4788-a28c-d8ccb51cf196
jenni0915/microprocesador
P3/S1/E2/to_7seg.cpp
#include "to_7seg.h" // converts to seven segment (active high, GFEDCBA) // input codes from 0 to 15 give simbols: // {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, -, r, n, E, F} // other inputs give a blank display int8_t to_7seg (uint8_t code) { // complete the code for this function ++++++++++++++++++++++++++++++ static...
ALGO
0.885594
4.116682
f8b44ecf-cfd6-4fb9-b0a4-b5eaaad6a1a4
Puneethnaik/TimusJudgeSolutions
1353.cpp
/*template created by */ #include <bits/stdc++.h> #define SI set<int> #define VI vector<int> #define ull unsigned long long #define inint(a) scanf("%d",&a) #define input(a) cin>>a #define ll long long #define f first #define s second #define len(s) s.length() #define FOR(i, a, b) for(i = a ; i < b ; i++) using namespac...
ALGO
0.997903
3.611965