uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
fce9abde-23c3-414a-8b45-0d88267f77c1
kasunJKD/pixel_me_puzzle
src/game.cpp
#include "game.h" #include "assets.h" bool just_pressed(GameInputType type) { KeyMapping mapping = gameState->keyMappings[type]; for(int idx = 0; idx < mapping.keys.count; idx++) { if(input->keys[mapping.keys[idx]].justPressed) { return true; } } return false; } bool is_down(GameInputType...
ALGO
0.983945
5.112266
e31535ac-3023-42a2-a4ce-7b83c5d240ee
zagardous/Self-driving-car
project_10_MPC_control/src/Eigen-3.3/doc/special_examples/Tutorial_sparse_example.cpp
#include <Eigen/Sparse> #include <vector> typedef Eigen::SparseMatrix<double> SpMat; // declares a column-major sparse matrix type of double typedef Eigen::Triplet<double> T; void buildProblem(std::vector<T>& coefficients, Eigen::VectorXd& b, int n); void saveAsBitmap(const Eigen::VectorXd& x, int n, const char* file...
ALGO
0.991152
5.429372
11adf51c-d058-4ca5-bb3a-9376a6ade011
iridescent2836/LeetCode
cpp/103.cpp
#include "header.h" class Solution { public: vector<vector<int>> zigzagLevelOrder(TreeNode* root) { if(root == nullptr) return vector<vector<int>>(); queue<TreeNode*> qu; qu.push(root); bool FromLeft = true; vector<vector<int>> ret; while(!qu.empty()){ in...
ALGO
0.999993
5.889616
2994eb36-d7c4-4917-bf1c-e2f4a98105a1
mejillon65/Prueba
thirdparty/msdfgen/core/render-sdf.cpp
#include "render-sdf.h" #include "arithmetics.hpp" #include "pixel-conversion.hpp" #include "bitmap-interpolation.hpp" namespace msdfgen { static float distVal(float dist, double pxRange, float midValue) { if (!pxRange) return (float) (dist > midValue); return (float) clamp((dist-midValue)*pxRange+....
ALGO
0.996913
6.088582
fa81da7b-397e-4dec-b9cd-6b46d5453e9d
Archana-Kumarkhaniya/KUNJ-DSA_WEB-06-00-PM
Stack/1.cpp
#include <iostream> using namespace std; class stack{ private: int arr[7]; int top; public: stack(){ top = -1; for (int i = 0; i < 7; i++) { arr[i] = 0; } } bool isfull(){ if (top == 4) { return true; ...
ALGO
0.959282
3.586198
b862fea8-d07e-40bc-8091-80341ca4677a
busiqiao/VSCODE
GPLT/L1-006.cpp
//L1-006 连续因子 (20 分) #include<bits/stdc++.h> using namespace std; typedef long long LL; int main() { LL N; cin>>N; LL prd; int sq_n=sqrt(N);//连续因子的乘积中最大因子不可能比他的根号大 int flag=0,start,len;//flag标志是否为符合条件的连续因子;start为连续因子的开始因子;len为因子长度 for(len=12;len>=1;len--)//len=12由于13的阶乘已经大于2^31 { for...
ALGO
0.999974
3.720133
adbdfb4a-8b46-4928-ad20-a9a7e5556c1d
hammasattila/Sapientia-2021-Crypto
Lab_01/lab01-ex04.cpp
#include <algorithm> #include <fstream> #include <iostream> #include <string> #include <vector> class Cesar { protected: int key; const size_t begin = 'A'; const size_t end = 'Z'; const size_t set_size = end - begin + 1; public: Cesar(int key) : key(key) {} char encrypt(char &c) { return ...
TOOL
0.981624
5.324049
512b5f55-2a23-4e1f-a7a9-85edec52ea46
alexandraback/datacollection
solutions_5765824346324992_1/C++/crazyboycjr/b.cpp
#include <cstdio> #include <cstring> using namespace std; #define rep(i,l,r) for (int i=(l);i<=(r);i++) typedef long long LL; const int maxn=1020; int B,n,a[maxn]; int b[maxn]; int chk(LL tim) { LL tmp=0,t2=0; rep(i,1,B) { tmp+=tim/a[i]; b[i]=tim%a[i]; if (b[i]==0) t2++; else tmp++; } if (tmp<n&&tmp+t2>...
ALGO
0.99987
3.053302
31ffc1cc-c63b-4421-a518-339d042f53b5
lfbettcher/Parallel-Programming
2 OpenMP Numeric Integration/Project2.cpp
#include <stdio.h> #define _USE_MATH_DEFINES #include <math.h> #include <omp.h> #include <stdlib.h> #include <time.h> #include <iostream> // print debugging messages? #ifndef DEBUG #define DEBUG false #endif // setting the number of threads: 1, 2, 4, 8 #ifndef NUMT #define NUMT 2 #endif // setting the number of nod...
ALGO
0.999884
6.842857
0cc10fec-fe16-4c37-b700-7189595dd49a
findsantodev/brik_test
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
3c655c61-745c-476c-9c04-fc726a766319
hope-lord/P342
Assignment3-cpp/q3.cpp
#include<iostream> using namespace std; #define LIMIT 3 void swap(float &a,float &b){ float t=a;a=b;b=t; } bool partial_pivot(float ar[][LIMIT],float br[][LIMIT]){ float zero[]={0,0,0}; for(int i=0;i<LIMIT;i++){ if (ar[i][i]==0){ bool isit=true; for(int t=0;t<LIMIT;t++){ if(zero[t]!=ar[i][t])isit=false;...
ALGO
0.999952
3.160937
81e50b5b-ee34-4154-9233-d613d6d9defe
mkp0/CP
CodeForce/1311B - WeirdSort.cpp
#include <bits/stdc++.h> #define ll long long #define pi (3.141592653589) #define all(x) (x).begin(), (x).end() #define vi vector<int> #define vll vector<long long> #define pii pair<int, int> #define pll pair<long long, long long> #define pb push_back #define mp make_pair #define S second #define loop(i, a, b, c) for ...
ALGO
0.999977
4.185182
950af952-bae5-4a15-ac64-4607e4b42dea
PriyanshK09/Leetcode-Discord-Bot
solutions/subsets-ii.cpp
// Time: O(n * 2^n) // Space: O(1) class Solution { public: vector<vector<int>> subsetsWithDup(vector<int> &nums) { vector<vector<int>> result(1); sort(nums.begin(), nums.end()); size_t previous_size = 0; for (size_t i = 0; i < nums.size(); ++i) { const size_t size = re...
ALGO
0.999886
6.692758
24654c78-99a8-4436-ad3f-ee7db8ac0af5
TrustyJAID/TrustyCoin
src/rpcnet.cpp
#include "net.h" #include "trustycoinrpc.h" using namespace json_spirit; using namespace std; Value getconnectioncount(const Array& params, bool fHelp) { if (fHelp || params.size() != 0) throw runtime_error( "getconnectioncount\n" "Returns the number of connections to other nodes."...
WEB
0.888883
6.376241
dba3b028-fc01-437d-b544-e5b3b72742b9
sahiljuneja/Udacity-SDCND-Term-2
P5-MPC/src/Eigen-3.3/bench/sparse_product.cpp
//g++ -O3 -g0 -DNDEBUG sparse_product.cpp -I.. -I/home/gael/Coding/LinearAlgebra/mtl4/ -DDENSITY=0.005 -DSIZE=10000 && ./a.out //g++ -O3 -g0 -DNDEBUG sparse_product.cpp -I.. -I/home/gael/Coding/LinearAlgebra/mtl4/ -DDENSITY=0.05 -DSIZE=2000 && ./a.out // -DNOGMM -DNOMTL -DCSPARSE // -I /home/gael/Coding/LinearAlgebr...
ALGO
0.976126
4.164869
1b06ecca-5764-47d0-b08f-95e6e8c7ef46
asobase0504/Avoidance
task_group.cpp
//============================================================================= // // }l[W[ // Author : Yuda Kaito // //============================================================================= //----------------------------------------------------------------------------- // include //-----------------------------...
TOOL
0.928826
4.520296
726ead51-5522-453f-8c40-7a401810440f
Wanger-SJTU/leetcode-solutions
cpp/26.remove-duplicates-from-sorted-array.cpp
/* * @lc app=leetcode id=26 lang=cpp * * [26] Remove Duplicates from Sorted Array */ #include <vector> using namespace std; class Solution { public: int removeDuplicates(vector<int>& nums) { int i = 0; for (int n : nums) if (!i || n > nums[i - 1]) nums[i++] = n; return i; } };
ALGO
0.999769
6.786018
f3d03e44-bd3a-4da6-b44a-8b87ded34def
MBS-Muthiah/Metro-Track-Bengaluru
.history/test2_20250210121343.cpp
// Bengaluru Metro Rail Route Finder in C++ #include <iostream> #include <vector> #include <unordered_map> #include <unordered_set> #include <queue> #include <limits> #include <ctime> #include <algorithm> #include <utility> #include <iomanip> using namespace std; // Structure for a Metro Station struct Station { ...
ALGO
0.968199
6.352601
ef51ba7d-8b1e-4248-ad87-9526d6a8b63a
sraihan73/Lucene-
analysis/common/src/java/org/apache/lucene/analysis/synonym/SynonymMap.cpp
using namespace std; #include "SynonymMap.h" #include "../../../../../../../../../core/src/java/org/apache/lucene/analysis/Analyzer.h" #include "../../../../../../../../../core/src/java/org/apache/lucene/analysis/tokenattributes/CharTermAttribute.h" #include "../../../../../../../../../core/src/java/org/apache/lucene/...
ALGO
0.939446
4.999796
f1002c70-8a1c-486b-abb0-21c0317ca70e
Rohit-8/Leetcode
485-max-consecutive-ones/485-max-consecutive-ones.cpp
class Solution { public: int findMaxConsecutiveOnes(vector<int>& a) { int c = 0, ans = 0; for(int i = 0; i < a.size(); i++){ if(a[i] == 1) c++; else c = 0; ans = max(ans, c); } return ans; } };
ALGO
0.999957
5.851966
e7cfaa65-73f4-4fe0-ac20-c83ec81b9c16
NestZ/competitive-programming
CodeForces/1175C.cpp
#include<bits/stdc++.h> using namespace std; #define endl '\n' typedef long long int ll; #define sim template < class c #define ris return * this #define dor > debug & operator << #define eni(x) sim > typename \ enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) { sim > struct rge { c b, e; }; sim > rge<c...
ALGO
0.999995
4.42744
89fe8f39-d696-4ed3-95ce-e81ba2f5e3e0
sarvex/leetcode-ada
solution/1100-1199/1156.Swap For Longest Repeated Character Substring/Solution.cpp
class Solution { public: int maxRepOpt1(string text) { int cnt[26] = {0}; for (char& c : text) { ++cnt[c - 'a']; } int n = text.size(); int ans = 0, i = 0; while (i < n) { int j = i; while (j < n && text[j] == text[i]) { ...
ALGO
0.99998
5.989851
4f129723-89e7-46cb-9969-4b5c515f2b9b
vin070/c_plus_plus
DS_and_ALGO/searching_and_sorting/leaders_in_array/leaders_in_array.cpp
#include<iostream> #include<vector> void take_input(std::vector<unsigned long>& vect, unsigned long const& size) { vect.reserve(size); for (int i = 0; i < size; ++i) { int ele = 0; std::cin >> ele; vect.push_back(ele); } } /** * https://www.pepcoding.com/resources/data-structures-...
ALGO
0.999971
4.692825
d4a1ee72-c9c8-472f-921a-ded35bc046a2
nowsang/gaggumV2
ros2/src/navigation2/nav2_costmap_2d/src/footprint_collision_checker.cpp
#include <memory> #include <string> #include <vector> #include <algorithm> #include "nav2_costmap_2d/footprint_collision_checker.hpp" #include "nav2_costmap_2d/cost_values.hpp" #include "nav2_costmap_2d/exceptions.hpp" #include "nav2_costmap_2d/footprint.hpp" #include "nav2_util/line_iterator.hpp" using namespace st...
TOOL
0.994418
4.369632
1f03ee6d-4b9b-40d2-ab6a-2c70d2db462c
bawejagb/LeetCode_Solutions
0104-maximum-depth-of-binary-tree/0104-maximum-depth-of-binary-tree.cpp
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nullptr), right(nullptr) {} * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} * TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l...
ALGO
0.999632
6.524738
b5e813e2-1df3-4e8c-80e5-684e17675119
muhammadalisaleem/C-Code-Chronicles
GCD Detective.cpp
//This C++ program efficiently computes the greatest common divisor (GCD) of two non-zero integers using Euclid's algorithm. By continuously applying Euclid's algorithm within a loop structure, it navigates through the integers, unraveling their common divisors. Offering a dynamic and user-friendly approach, it empower...
ALGO
0.999925
6.709587
5ad3d621-2ac9-4ae0-b9f1-992131821f2c
NeuraiProject/Neurai
src/crypto/chacha20.cpp
// Based on the public domain implementation 'merged' by D. J. Bernstein // See https://cr.yp.to/chacha.html. #include "crypto/common.h" #include "crypto/chacha20.h" #include <string.h> constexpr static inline uint32_t rotl32(uint32_t v, int c) { return (v << c) | (v >> (32 - c)); } #define QUARTERROUND(a,b,c,d) \ ...
ALGO
0.999389
6.878013
7640edf4-8526-4b16-8fe6-479fac232a23
avritichauhan/z3
src/math/hilbert/hilbert_basis.cpp
#include "math/hilbert/hilbert_basis.h" #include "util/heap.h" #include "util/map.h" #include "math/hilbert/heap_trie.h" #include "util/stopwatch.h" typedef int_hashtable<int_hash, default_eq<int> > int_table; class hilbert_basis::value_index1 { struct stats { unsigned m_num_comparisons; unsigned ...
ALGO
0.998301
4.874758
14241310-155d-44bb-9fbf-304467f17bc1
cullenwren/CSEP527
HW_2/main.cpp
/** * @file: main.cpp * * @author: Cullen Billhartz * Student ID: 1877747 * * @brief: Assignment #2 * CSEP 527 - Computational Biology * Computes Smith Waterman local alignments * * * */ #include <iostream> #include <vector> #include <string> #include <fstream> #inclu...
ALGO
0.998819
4.629009
edc61965-d16d-495a-9973-663d98080018
dara0312/HackerRank
security-tutorial-functions.cpp
int function(int x) { return (x%11); }
TOOL
0.955327
3.107007
4d1ed6e2-b526-4d24-92dc-b000393fb250
hmson3/codingtest
baekjoon/TUTORIAL/13_SORT/2587.cpp
#include <iostream> using namespace std; int main() { int N,temp; int a[5] = {}; for(int i = 0; i < 5; i++) { cin >> a[i]; } for(int i = 0; i < 5-1; i++) { for(int j = 0; j < 5-i-1; j++) { if(a[j+1] < a[j]) { temp = a[j]; a[j] = a[j+1...
ALGO
0.999977
3.269111
5be8f019-f056-4ac1-86c4-4c04fbacdee5
SlimRoms14/bionic
tools/versioner/src/Driver.cpp
#include "Driver.h" #include <err.h> #include <string.h> #include <chrono> #include <mutex> #include <string> #include <thread> #include <unordered_map> #include <vector> #include <clang/AST/ASTConsumer.h> #include <clang/Basic/Diagnostic.h> #include <clang/Basic/TargetInfo.h> #include <clang/Driver/Compilation.h> #...
TOOL
0.932236
7.789224
e80f0901-6c4f-457c-857f-53265466d870
Vinh1222001/DSA_practice
Sorting/main.cpp
#include "Sort_methods/Sort_methods.h" #include "Sort_methods/Sort_methods.cpp" #include <chrono> using namespace std::chrono; int main(void){ int arr[1000]; int count; cin >> count; srand(time(0)); for (int i = 0; i < count; i++) { arr[i] = rand() % 100; } auto start = hi...
ALGO
0.998696
5.082997
58c07cb0-86f5-4db0-bb78-9e7191b6fa1a
rasinhas/Maratona
uri/algar-xiii/j.cpp
#include <iostream> #include <cstdio> #include <algorithm> #include <vector> #include <cstring> #include <string> #include <cmath> #define ff first #define ss second using namespace std; typedef long long ll; typedef pair<int,int> pii; int main() { double a, b, c; while(scanf("%lf", &a) && a) { cin >...
ALGO
0.999688
3.204064
31032132-4259-41ce-b950-eed40cfed563
h3136514/Algorithm
baekjoon/랜덤 마라톤/23080.cpp
#include <iostream> #include <string> using namespace std; int k; string str1, str2; // 스키테일 암호 int main() { cin >> k; cin >> str1; str2 += str1[0]; for(int i = 1; i < str1.size(); i++){ if(i % k == 0) str2 += str1[i]; } cout << str2 << "\n"; return 0; }
ALGO
0.999993
3.575616
2bc73390-e499-4424-adfb-a7d97ad4a0ef
Exalibur77/Data-Structure-and-Algorithm
Vectors/vector02.cpp
#include<iostream> #include<vector> using namespace std; int main(){ // Unlike 2D array we can have different columns for each row vector < vector <int> > arr = { {1,23,4,5}, {2,3,4}, {11,22,33,44,45,55}, {0,1,10,0,-1} }; // Using iterative for loops for (int ...
ALGO
0.998208
4.649835
0be58319-5e98-4cc6-a900-42433ea81533
luke-tangh/leetcode-solutions
src/0209.cpp
#include <vector> using namespace std; class Solution { public: int minSubArrayLen(int target, vector<int>& nums) { int i = 0, n = nums.size(), res = n + 1; for(int j = 0; j < n; ++j) { target -= nums[j]; while(target <= 0) { res = min(res, j - i + 1); ...
ALGO
0.999969
6.168726
2e23efc6-b3b3-48d0-9faf-ec7d812a149a
DawnteaStudio/TIL
coding-test/Baekjoon/2000/2563.cpp
#include <iostream> #define fast ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL); using namespace std; int main() { fast; int n, x, y, res = 0; cin >> n; int arr[100][100] = {0}; for (int i = 0; i < n; i++) { cin >> x >> y; for (int i = y - 1; i < y + 9; i++) ...
ALGO
0.998944
3.758648
00bd11d7-a803-49f9-ac19-4b79690bb8d3
abhijeetdheer/DSA
string/1796.cpp
//1769. Minimum Number of Operations to Move All Balls to Each Box //medium vector<int> minOperations(string boxes) { int n = boxes.size(); vector<int> ans(n,0); int last = 0 , sum = (boxes[0] -'0'); for(int i = 1; i < n; i++){ ans[i] += last+sum; last = ans[i...
ALGO
0.999964
5.612258
d1e9f9b6-7d2e-4c62-aeb6-44427e4abb4e
karasuma-2401/IT001
HW(final)_array/hw14.cpp
#include <iostream> using namespace std; int main(){ int n; cin >> n; int a[n]; bool ok = false; int max_negative =-2e9; for ( int i =0; i < n; i++){ cin >> a[i]; if ( a[i] <0) ok = true; if ( a[i] < 0 && a[i] > max_negative) max_negative =a[i]; } if (o...
ALGO
0.999875
4.855401
63d8194e-e28b-4baf-ad75-e029511098f4
Ayush-Balodi/CrackYourInternship
0155-min-stack/0155-min-stack.cpp
class MinStack { typedef long long int LL; public: stack<LL> st; LL minval; MinStack() { } void push(int val) { if(st.empty()){ st.push(val); minval=val; } else if( val>=minval ){ st.push(val); } ...
ALGO
0.99993
6.072961
55793b45-fc1d-4340-951f-498ea16f6cd7
ishandutta2007/codeforces
kostia244/normal/186/D.cpp
#include<bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define mp make_pair #define pb push_back #define eb emplace_back #define xx first.first #define yy first.second #define __V vector #define all(x) x.begin(), x.end() #define rall(x) x.rbegin(), x.rend() #define oit ost...
ALGO
0.999953
3.634566
ebc0360c-82d7-48d9-b1da-ddf653c66323
theyashshahs/Algorithms
C++/bubblesort.cpp
#include<bits/stdc++.h> using namespace std; int main() { cin.tie(NULL); cout.tie(NULL); ios::sync_with_stdio(0); ifstream fin; ofstream fout; int ch, flag = 0; vector<int> v,v1; //Unsorted file execution file fin.open("File 1.txt", ios::in); //change the filename while (!...
ALGO
0.999424
3.828359
e86fd4b6-1f1b-4cb5-82e1-d41e376a79e9
rumisle/llvm-project
libcxx/test/std/algorithms/alg.sorting/alg.nth.element/nth_element.pass.cpp
// <algorithm> // template<RandomAccessIterator Iter> // requires ShuffleIterator<Iter> && LessThanComparable<Iter::value_type> // constexpr void // constexpr in C++20 // nth_element(Iter first, Iter nth, Iter last); #include <algorithm> #include <cassert> #include "test_macros.h" #include "test_iterators.h" ...
TEST
0.873248
7.399998
b7159b6c-d75f-4998-8760-b732d26bd2b0
photosartd/vnav
cpp/thirdparty/eigen/unsupported/doc/examples/BVH_Example.cpp
#include <Eigen/StdVector> #include <unsupported/Eigen/BVH> #include <iostream> using namespace Eigen; typedef AlignedBox<double, 2> Box2d; namespace Eigen { Box2d bounding_box(const Vector2d &v) { return Box2d(v, v); } //compute the bounding box of a single point } struct PointPointMinimizer //how to compute squa...
ALGO
0.99988
6.502348
68d5fbcd-2c25-475e-aea6-5d6fca02a6fe
anup-ghosh/Leetcode
0041-first-missing-positive/0041-first-missing-positive.cpp
class Solution { public: static int firstMissingPositive(vector<int>& nums) { int n=nums.size(); bool with1=0; for(int& x: nums){ if(x==1) with1=1; else if (x<=0 || x>n) x=1; } if (!with1) return 1; unsigned bitMask=(1<<17)-1;//>10^5>=n all bi...
ALGO
0.999967
4.635587
1026e5e4-d6c7-4da1-b57c-9075216ddbc7
chiennguyencoder/PBL1_MAXFLOW_MINCUT
ioHandler.cpp
#pragma once #include <iostream> #include <fstream> #include <vector> #include <string> #include "format.cpp" #include <iomanip> #include <cstring> #include <climits> #define line "--------------------------------------------------------------------" #define MAX_VERTICES 107 using namespace std; // Function declarati...
ALGO
0.994716
4.301229
f9d17910-c202-4e33-85b4-0f56e333e2ef
alexandraback/datacollection
solutions_2749486_0/C++/aszxdfc/B.cpp
#include<iostream> #include<math.h> using namespace std; int x, y; int main() { freopen("B-small-attempt0.in", "r", stdin); freopen("outB.txt", "w", stdout); int T; scanf("%d", &T); for(int i = 0; i < T; i++) { scanf("%d%d",&x,&y); printf("Case #%d: ", i + 1); if(y > 0) { for(int j = 0; j < y;...
ALGO
0.999426
3.246326
2cee89e6-b17c-498a-af53-21a36197672b
phantomate/Untare
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.99887
6.783439
5d56fe89-64f0-43b2-8664-c47bb94f8cb5
Raindrips/CodeNote
cpp/dataStruct/Griph/Graph/sparse_graph.cpp
#include <vector> #include <cassert> //实现一个稠密图 class SparseGraph{ public: int n,m; bool directed; std::vector<std::vector<int>> g; SparseGraph(int n,bool directed=false):n(n),directed(directed){ this->m=0; for (size_t i = 0; i < n; i++) { g.push_back(std::vector...
ALGO
0.997762
5.111961
afa49be3-f4ab-4784-9096-26466003e206
CharlesSherwood/Chapter2Exercise20
Chapter2Exercise20.cpp
/*FileName:Chapter2Exercise20.cpp Programmer Name:Charles Sherwood Date:2/2025 Requirements:A particular brand of paint covers 340 square feet per gallon. Write a program to determine and report approximately how many gallons of paint will be needed to paint two coats on a wooden fence that is 6 feet high and 100 feet ...
ALGO
0.976723
5.938008
bb2cd218-7561-4732-a53e-9cea5fbe2725
wkohlenberg/FFNN
software/ffnn_project/neuron.cpp
#include "neuron.h" int initNeuron1(double* inputs, double* weights, int nInputs){ // Set start bit low IOWR_ALTERA_AVALON_PIO_DATA(START_NEURON_1_BASE, LOW); // Convert decimals to binary double convInput[5]; double convWeight[5]; for (int i = 0; i < 5; i++){ convInput[i] = (int)(inputs[i] * 255.0); convW...
TOOL
0.904813
3.512805
bc4075ac-b14c-4133-8eb2-6b576558398e
BerntA/MasterSwordClassic
game/shared/MS/encrypt.cpp
#include <iostream> #include <cmath> #include "encrypt.h" #include "msdebug.h" using namespace std; #define MS_SIZE_LONG 4 void CEncryptBase::SetData(const byte *pData, const size_t Size) { m_pData = msnew(byte[Size]); m_DataSize = Size; memcpy(m_pData, pData, m_DataSize); } void CEncryptBase::GetData(byte *pData...
ALGO
0.995911
5.218817
07a1f0c8-cced-4b0b-abea-d65a59c58d34
meilleur777/Competitive_Programming
프로그래머스/3/49189. 가장 먼 노드/가장 먼 노드.cpp
#include <bits/stdc++.h> using namespace std; int solution(int n, vector<vector<int>> edges) { vector<vector<int>> arcs(n+1); for (auto edge:edges) { arcs[edge[0]].push_back(edge[1]); arcs[edge[1]].push_back(edge[0]); } vector<int> vis(n+1, -1); queue<int> q; q.push(1); vis...
ALGO
0.998521
5.105072
51a56c48-3e36-4d98-a836-c4e7d8e3172c
payen/tesseractdotnet
dotnetwrapper/Source/cube/altlist.cpp
#include "altlist.h" #include <stdlib.h> namespace tesseract { AltList::AltList(int max_alt) { max_alt_ = max_alt; alt_cnt_ = 0; alt_cost_ = NULL; alt_tag_ = NULL; } AltList::~AltList() { if (alt_cost_ != NULL) { delete []alt_cost_; alt_cost_ = NULL; } if (alt_tag_ != NULL) { delete []alt_...
TOOL
0.852433
5.879907
0c961935-1778-4c0e-9a97-ce0f70c9d5dc
Jackarain/tinyrpc
third_party/boost/libs/sort/example/stringsample.cpp
// See http://www.boost.org/libs/sort for library home page. #include <boost/sort/spreadsort/string_sort.hpp> #include <time.h> #include <stdio.h> #include <stdlib.h> #include <algorithm> #include <vector> #include <iostream> #include <fstream> #include <string> using std::string; using namespace boost::sort::spreads...
ALGO
0.994345
4.77458
0959f84d-d3cb-4eea-bfc6-f323771972db
nybzmr/CP
cp31/A_How_Much_Does_Daytona_Cost.cpp
// Author: Nayaab Zameer #include <bits/stdc++.h> using namespace std; #define pi (3.141592653589) #define mod 1000000007 #define pb push_back #define is insert #define mp make_pair #define ff first #define ss second #define all(x) x.begin(), x.end() #define min3(a, b, c) min(c, min(a, b)) #define min4(a, b, c, d) min...
ALGO
0.999859
3.762549
9e939dbc-49ae-4735-a9b8-d8d8c81afcb9
petermoomaw/Xenharmonic-Keyboard
cpp/eigen/unsupported/doc/examples/MatrixPower.cpp
#include <unsupported/Eigen/MatrixFunctions> #include <iostream> using namespace Eigen; int main() { const double pi = std::acos(-1.0); Matrix3d A; A << cos(1), -sin(1), 0, sin(1), cos(1), 0, 0 , 0 , 1; std::cout << "The matrix A is:\n" << A << "\n\n" "The matrix power A^(pi/4) is:\n"...
ALGO
0.999764
3.790203
7315baf1-6373-48cf-9b0d-0e011aeb4a81
arifulnoman/Competitive-Programming
A_Recovering_a_Small_String.cpp
#include<bits/stdc++.h> #define ll long long const int INF = 1e9 + 7; using namespace std; void solve() { int i,n; cin >> n; string s = "aaa"; n-=3; i = 2; while(n > 0) { if(s[i] == 'z') { i--; } s[i]++; n--; } cout << s << '\n'; } ...
ALGO
0.999495
4.278645
9e22f023-f216-4df8-b611-3725a393d51f
msorvig/qt4-hidpi
src/3rdparty/clucene/src/CLucene/search/MultiSearcher.cpp
#include "CLucene/StdHeader.h" #include "MultiSearcher.h" #include "SearchHeader.h" #include "HitQueue.h" #include "CLucene/document/Document.h" #include "CLucene/index/Term.h" #include "FieldDocSortedHitQueue.h" CL_NS_USE(index) CL_NS_USE(util) CL_NS_USE(document) CL_NS_DEF(search) /** Creates a searcher which s...
ALGO
0.988021
6.74995
292430dc-7d59-4eb8-b44a-6b7b1ca6a448
C5Hwang/Online-Judge-Solutions
BZOJ/BZOJ1150_Greedy.cpp
#include <queue> #include <stdio.h> #include <stdlib.h> #define DEBUG printf("Passing [%s] in Line %d\n" , __FUNCTION__ , __LINE__) ; const int MAX_N = 1e5 + 10 , INF = 0x3f3f3f3f ; struct data { int num , pl ; friend bool operator <(data a , data b) {return a.num > b.num ;} } ; std::priority_queue<data> que ; ...
ALGO
0.999946
3.42027
72f181cf-e369-4788-b1c3-7c3136e57fbe
jetillett/ni-iot-example-rioeval
sbRIO Eval ORIGINAL Example Code/LabVIEW RIO Evaluation Kit/Tutorials/3- Create Real-Time Application/LVRIOEval_C_Exercise3/src/LVRIOEval_C_Exercise3.cpp
#include <LVRIOEval_C_Exercise3.h> #define MY_PRIORITY (49) #define MAX_SAFE_STACK (8*1024) #define NSEC_PER_SEC (1000000000) enum MachineState {Stage1, Stage2, Stage3, Alarm, Shutdown}; MachineState state = Stage1; double amplitude = 0; bool uiStop = false; //Prefault the stack so that future stack faults wont impa...
ALGO
0.930355
5.324134
b50682bb-1131-4bc4-a94a-85f844b093dc
edge555/Online-Judge-Solves
UVA/11518 - Dominos 2.cpp
#include <bits/stdc++.h> #define FAST ios_base::sync_with_stdio(false); cin.tie(NULL) #define pf printf #define sf(num) scanf("%d",&num) #define sff(num1,num2) scanf("%d %d",&num1,&num2) #define sfff(num1,num2,num3) scanf("%d %d %d",&num1,&num2,&num3); #define rep(i,n) for(i=1;i<=n;i++) #define rep0(i,n) for(i=0;i<n;i...
ALGO
0.999788
3.636531
09020ffd-ae4a-472d-abdd-e28245fa2551
The1one1/code
Minimum-Amount-of-Time-to-Collect-Garbage.cpp
class Solution { public: int garbageCollection(vector<string>& garbage, vector<int>& travel) { int pTruck = 0, gTruck = 0, mTruck = 0; int j = travel.size() - 1; bool pFlag = false, gFlag = false, mFlag = false; for(int i = garbage.size() - 1; i >= 0; i--) { // COUNT ...
ALGO
0.999658
5.491373
f0529b43-1128-4a27-a4e3-bdfdf9beae4e
TD2106/Competitive-Programming
ATCoder/B - Checkpoints.cpp
#include <bits/stdc++.h> #define bug(x) cout << #x << " = " << x << endl #define F first #define S second using namespace std; typedef long long int ll; typedef pair<int,int> pii; int main(){ int n,m,Ti[51]={0},t; pii st[51],ck[51]; cin>>n>>m; for(int i=1;i<=n;i++) cin>>st[i].F>>st[i].S; for(int i=1...
ALGO
0.999989
3.649546
e0d3a66a-a6b7-46b4-90eb-f4dd1dbb4db8
allwinner-ics/platform_frameworks_base
media/libstagefright/codecs/aacdec/pns_corr.cpp
/* Pathname: pns_corr.c ------------------------------------------------------------------------------ REVISION HISTORY Description: Made changes per review comments, the most major of which being the change of the scaling into a 16 x 16 multiply. Description: When the multiplication of two 16-bits variables i...
ALGO
0.999464
5.392339
74b02a02-9002-46b1-a2cf-9b369470172c
vassbar/Codeforces
407A.cpp
#include <cstdio> #include <iostream> #include <cmath> int main(){ long a, b; std::cin >> a >> b; long f, g, x, y; bool possible = 0; for(f = 1; f < a; f++){ g = sqrt(a * a - f * f); if(f * f + g * g != a * a){continue;} x = (b * g) / a; y = (b * f) / a; if(x * x + y ...
ALGO
0.999747
3.652206
739f83b1-754a-4e21-ba80-cbe663c5a7b5
wuuuiYan/Cpp-Primer-Plus-Code
chapter16/valvect.cpp
#include <iostream> #include <valarray> #include <vector> using namespace std; int main() { double temp; vector<double> data; cout << "Enter numbers (<= 0 to quit): " << endl; while(cin >> temp && temp > 0) data.push_back(temp); sort(data.begin(), data.end()); int size = data.size(); ...
ALGO
0.997961
3.056557
dbf9092e-81e2-47c9-82f6-058fc94083e1
MacThanhD21/CodePTIT
DSA/DSA10001-TIMDUONG.cpp
/* Cho một bảng S[][] kích thước N x M, bao gồm các ô trống, các vật cản. Ban đầu bạn ở vị trí S. Nhiệm vụ của bạn là hãy di chuyển tới vị trí T, sao cho số lần đổi hướng không quá hai lần. Input: Dòng đầu tiên là số lượng bộ test T (T ≤ 20). Mỗi test bắt đầu bởi hai số nguyên N và...
ALGO
0.999912
4.504031
465fe6c2-955b-4c8f-af1f-12a01628547a
Princy-Malhotra/leetcode-solutions
0547-number-of-provinces/0547-number-of-provinces.cpp
class Solution { public: void dfs(vector<vector<int>>& isCon, int src, unordered_map<int,int>& vis){ vis[src]=1; int n=isCon.size(); for(int i=0;i<n;i++){ if(isCon[src][i] && !vis[i]){ dfs(isCon,i,vis); } } return; } int findCi...
ALGO
0.999981
6.086444
ebf3d1f0-d824-43fb-b3f4-0e2308518d59
Madhu-Biradakota/Mutation-Testing-using-DeepState
Final_SM_2/StringManipulator.mutant.720.cpp
#include "StringManipulator.h" #include <algorithm> #include <cctype> #include <sstream> #include <iterator> #include <map> #include <stdexcept> #include <locale> #include <regex> #include <numeric> std::string StringManipulator::reverse(const std::string& str) { std::string reversed = str; std::reverse(revers...
TOOL
0.893623
6.410615
b1783462-a4cc-49b3-8ebb-01e08e1fb982
Lihit/LeetCode
Medium/508. Most Frequent Subtree Sum.cpp
// // Created by wenshao on 2017/12/3. // /* Given the root of a tree, you are asked to find the most frequent subtree sum. The subtree sum of a node is defined as the sum of all the node values formed by the subtree rooted at that node (including the node itself). So what is the most frequent subtree sum value? If th...
ALGO
0.999969
6.093148
2170d544-6b20-4e16-b68a-bab9ae238442
than0112/learning_hub
codewar/8kyu/problem 59/59-1.cpp
#include <iostream> #include <string> #include <vector> #include <limits> // 用於暫停功能 using namespace std; string double_char(const string& str) { // 1. 準備一個空字串,用來存放結果。 string result = ""; // 2. 使用 for-each 迴圈,逐一處理原始字串中的每一個字元。 for (char c : str) { // 3. 將每一個字元 c 連續兩次加到 result 向量中。 resu...
TOOL
0.98137
6.440752
08888a5a-9ac6-4983-8aea-c8b294d268f7
wusunmoon/DataStructure_Learning
Sort/sort.cpp
/* 程序:排序算法时间性能比较 作者:Moyu */ #include<iostream> #include<random> #include<ctime> using namespace std; const int Size = 24; //比较数据数量 int movec; //交换次数 int compc; //比较次数 void InitRandomArr(vector<int> &v, int n); void InitPosArr(vector<int> &v, int n); void InitNegArr(vector<int> &v, int n); void OutPut(const v...
ALGO
0.999608
4.365082
42276ef8-6a8f-4573-bc6c-967268eb4d1e
zhangOSK/pinocchio
bindings/python/algorithm/expose-kinematics-derivatives.cpp
#include "pinocchio/bindings/python/algorithm/algorithms.hpp" #include "pinocchio/algorithm/kinematics-derivatives.hpp" #include "pinocchio/algorithm/center-of-mass-derivatives.hpp" #include <boost/python/tuple.hpp> namespace pinocchio { namespace python { namespace bp = boost::python; bp::tuple getJ...
TOOL
0.853819
6.835526
3d88bd71-5e78-46c3-bda1-8b5924b12a98
peresonacifer/Compitive_Programming
dp/p-median.cpp
#include<bits/stdc++.h> using namespace std; void sol(int n, int k) { int P, N; int dp[P + 1][N + 1], dis[N + 1][N + 1], r[P + 1][N + 1]; for(int i = 0; i <= N; i++) dp[0][i] = (i == 0 ? 0 : INT32_MAX); for(int p = 1; p <= P; p++) { for(int n = p; n <= N; n++) { dp[p][n] = INT32_M...
ALGO
0.999947
3.730486
d40c2be4-9b42-4a06-8bdc-b52fc77460ad
MainFrameKuznetSov/LeetCode
1305-number-of-visible-people-in-a-queue/number-of-visible-people-in-a-queue.cpp
class Solution { public: vector<int> canSeePersonsCount(vector<int>& heights) { int n=heights.size(); vector<int>ans(n,0); stack<int>stk; for(int i=0;i<n;++i) { while(!stk.empty() && heights[stk.top()]<=heights[i]) { ++ans[stk.top()]; ...
ALGO
0.999992
6.490993
e1b2cadd-609e-43ed-886a-5d6612c37fee
almas-ashruff/DSASolutions
July/28 July/findMedianInAStream.cpp
// Given an input stream of N integers. The task is to insert these numbers into a new stream and // find the median of the stream formed by each insertion of X to the new stream. // https://practice.geeksforgeeks.org/problems/find-median-in-a-stream-1587115620/1# // https://www.youtube.com/watch?v=dshWERdcAdg prio...
ALGO
0.999956
5.511804
7e4f632e-c414-42c6-9caa-24aa1b833bf3
Harshdeep-Yadav/Heap
sort_character_by_frequency.cpp
class Solution { public: string frequencySort(string s) { int n=s.size(); string ans=""; int ct=0; map<char,int> map; for(int ind=0;ind<n;ind++){ map[s[ind]]++; } priority_queue<pair<int,char>>pq; for(auto i:map){ pq.push({i.sec...
ALGO
0.999981
6.108614
7f5efe1e-40fb-48a4-8f09-4e44b0754cac
sosnicklab/upside2-md
src/coord_operator.cpp
#include <math.h> #include <string> #include <algorithm> #include <iostream> #include "deriv_engine.h" #include "timing.h" #include "state_logger.h" #include "vector_math.h" #include <Eigen/Dense> using namespace std; using namespace h5; using namespace Eigen; struct Add : public CoordNode { CoordNode &pos1; ...
ALGO
0.971328
4.667039
5815cbfd-7367-4ada-80bb-cb84883dce85
sajuuk/VTM_bezcurve_merge
source/Lib/CommonLib/MCTS.cpp
/** \file MCTS.cpp \brief Motion Constrained Tile Sets class */ #include "MCTS.h" #include "Buffer.h" #include "UnitTools.h" #include <memory.h> #include <algorithm> //! \ingroup CommonLib //! \{ // =========================================================================================================...
ALGO
0.97086
6.50235
b539d529-7468-48af-9673-125ffcaada52
jayshri-developer/DataStructures_and_Algorithms
Daily Problem/Array/single number.cpp
// Approch 1 // PL:- https://leetcode.com/problems/single-number/ // tc:- o(n) // sc:- 0(1) class Solution { public: int singleNumber(vector<int>& nums) { // 0 ^ n = n // n ^ n = 0s int ans = 0; for(int i = 0; i< nums.size(); i++) { ans = ans ^ nums[i]; ...
ALGO
0.999747
5.43973
3b42f20f-cde7-47b2-b0cb-a855b967084d
Eleuterio258/Show-Hide-Password
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.998689
6.787361
6ffb0fb8-bf3a-4eb4-b6c1-202142982604
archrave/DSA-Topics-and-Problems
Linked List/recusive_list.cpp
#include <iostream> using namespace std; // Node Structure: class Node { public: int data; Node *next; Node(int data) { this->data = data; next = NULL; } }; void printList(Node *h) { while (h != NULL) { cout << h->data << " "; h = h->next; } cout << e...
ALGO
0.999358
4.68404
8f528fd5-f081-405d-8d50-4fecee2ed47f
CloverTinTin/CppPrimerStudy
chapter_05/Exercise_5_20/stopBySuccession.cpp
#include <iostream> #include <string> #include <cctype> using namespace std; int main() { string str; string previous; while(cin >> str) { if(str == previous) { if(!isupper(str[0])) continue; cout << str << " occurs twice in succession\n"; break; } previous = str; } if(!ci...
ALGO
0.999833
4.190114
de203709-dc9d-4e61-bfea-6694c7eb67ec
Lihui-Gu/algorithm
AcWing/链表/共享.cpp
#include <iostream> #include <algorithm> #include <cstring> using namespace std; const int N = 100010; int e[N], ne[N]; int st[N]; int h1, h2, n; int main() { scanf("%d%d%d", &h1, &h2, &n); while(n --) { int address, next; char data; scanf("%d %c %d", &address, &data, &next); ...
ALGO
0.999896
3.403415
7a04a119-cf16-45d0-a5b9-4d33d81d2b79
FaizahMalik/eng300_collaborative_robots
navigation/base_local_planner/src/voxel_grid_model.cpp
#include <base_local_planner/voxel_grid_model.h> #include <sensor_msgs/point_cloud2_iterator.h> using namespace std; using namespace costmap_2d; namespace base_local_planner { VoxelGridModel::VoxelGridModel(double size_x, double size_y, double size_z, double xy_resolution, double z_resolution, double orig...
ALGO
0.965522
7.219556
db9cc989-5fce-45d7-a6e2-b472902c70d5
123amigo/algorithm
实验六(贪心法)/活动安排.cpp
#include <iostream> using namespace std; void sort(int s[], int f[], int n) { int i, j; for (i = 0; i < n; i++) { for (j = 0; j < n - i - 1; j++) { if (f[j] > f[j + 1]) { int temp1 = f[j]; f[j] = f[j + 1]; f[j + 1] = temp1; int temp2 = s[j]; s[j] = s[j + 1]; s[j + 1] = temp2; } } } ...
ALGO
0.999982
3.00716
190bb657-dd62-4906-8b00-952583d748c9
klotte/boost
src/boost_1_44_0/libs/spirit/classic/example/fundamental/more_calculators/phoenix_subrule_calc.cpp
/////////////////////////////////////////////////////////////////////////////// // // Full calculator example // [ demonstrating phoenix and subrules ] // // [ Hartmut Kaiser 10/8/2002 ] // /////////////////////////////////////////////////////////////////////////////// //#define BOOST_SPIRIT_DEBUG // define ...
TOOL
0.969272
6.534732
d4500437-260c-4964-9b62-999fbe082d3f
aravindsomaraj/LeetCodes
Codes/0717-1-bit-and-2-bit-characters/solution.cpp
class Solution { public: bool isOneBitCharacter(vector<int>& bits) { int i=1; for(i=1;i<bits.size();) { if(bits[i-1]==1) i=i+2; else i=i+1; } return i==bits.size(); } };
ALGO
0.999739
5.955497
76a8853c-b323-46f1-bfca-1eae982c41e5
Sillyringo/opticks_original
npy/NRngDiffuse.cpp
#include <sstream> #include "BRng.hh" #include "NRngDiffuse.hpp" #include "NPY.hpp" NRngDiffuse::NRngDiffuse(unsigned seed, float ctmin, float ctmax ) : m_pi( glm::pi<float>() ), m_seed(seed), m_uazi(new BRng(0.f, 2.f*m_pi, seed, "uazi")), // azimuthal m_upol(new BRng(-1.f, 1.f, seed+1, "u...
ALGO
0.987796
5.670962
a57728a5-f79e-4ce1-a622-c0fa46b1abde
SeeleVolle/cann-ops-clean
src/pooling/max_pool3_d_with_argmax_v2/op_host/aclnn_max_pool3d_with_argmax.cpp
#include "aclnn_max_pool3d_with_argmax.h" #include "max_pool3d_with_argmax_v2_l0.h" #include "unsqueeze.h" #include "squeeze.h" #include "aclnn_kernels/transdata.h" #include "aclnn_kernels/contiguous.h" #include "aclnn_kernels/common/op_error_check.h" #include "opdev/op_log.h" #include "opdev/op_dfx.h" #include "opdev/...
TOOL
0.898287
6.628607
d9cc7d59-885e-4223-87c9-b8445484bed8
pnoga190401/projekt
cpp/min_max/min_max.cpp
#include <iostream> #include <cstdlib> using namespace std; void minmax1() { char dalej = 't'; int liczba = 0; int min, max; cout << "podaj liczbe :"; cin >> liczba; min = max = liczba; while (dalej == 't') { cout << "podaj liczbe :"; cin >> liczba; if (liczba < min)...
ALGO
0.992988
3.705475
67c83d54-62dc-460e-abb1-298c4e4370d6
ChengChien1114/E14101082_numerical_hw3
question2.cpp
// E14101082_陳政謙 #include <iostream> #include <vector> #include <cmath> #include <iomanip> using namespace std; double lagrangeInterpolation(const vector<double>& X, const vector<double>& E_X, double Guess) { double ANS = 0; int n = X.size(); for (int i = 0; i < n; ++i) { double L = 1; ...
ALGO
0.99995
3.81875
e66a8767-b611-4f84-a848-403b21911850
GuacheSuede/MSSubmission1234567890
submission/sma/boost_1_69_0/libs/intrusive/example/doc_splay_algorithms.cpp
struct my_node { my_node(int i = 0) : int_(i) {} my_node *parent_, *left_, *right_; int color_; //other members int int_; }; //Define our own splaytree_node_traits struct my_splaytree_node_traits { typedef my_node node; typedef my_node * ...
ALGO
0.99983
5.465754
0bbc58e0-280e-4fa1-ba3d-badb39a8dd2a
Beknight/ProofOfConcept
FastTracking.cpp
#include "FastTracking.h" #include "Util.h" #include "Camera.h" #define MAX_VALUE 255 #define BLUR_VAL 30 namespace Thesis{ FastTracking::FastTracking(int sensitivity) { thresholdValue_ = sensitivity; } CoordinateReal FastTracking::findObject(Mat first, Mat second, CoordinateReal currentBelief, bool debug){ Co...
ALGO
0.998328
5.402123
91e6f0b7-af2b-42d0-a2f3-8ee911dd9072
RajibTheKing/ACMProgramming
Light OJ/Accepted/1354 - IP Checking.cpp
#include<iostream> #include<string> #include<string.h> using namespace std; typedef long long LL; LL value(string a) { LL t, r=0, f=1; for(int i=a.length()-1;i>=0;i--) { t=a[i]-'0'; r+=t*f; f=f*2; } //cout<<r<<endl; return r; } int main() { LL T, kase = 0; LL a...
ALGO
0.999858
3.38622
83e0ca97-3cac-4709-8ea9-64d4dd7fb08f
johnnessantos/programacao-competitiva
uri/Iniciante/2061 -As Abas de Péricles.cpp
#include<bits/stdc++.h> using namespace std; int main(){ int n,m; string s; cin>>n>>m; while(m){ cin>>s; if(s[0]=='f') n++; else n--; m--; } cout<<n<<endl; return 0; }
ALGO
0.999683
3.818054
3a2f6e5b-81cd-4818-83d5-dccf5b40ab0e
YJK0805/onlinejudge_ac_code
Kattis/Pet.cpp
// Problem: Pet // Contest: Kattis // URL: https://open.kattis.com/problems/pet // Memory Limit: 1024 MB // Time Limit: 1000 ms // // Powered by CP Editor (https://cpeditor.org) #include <bits/stdc++.h> using namespace std; int main(){ ios::sync_with_stdio(0); cin.tie(0); long long win = -1,score = 0; ...
ALGO
0.999917
4.000404
01f18053-e55f-4c97-9ac4-25f38a18ab93
Mosharrof8413/Data-structure-And-Algorithm
Binary Search/35. Search Insert Position.cpp
/* Problem link: https://leetcode.com/problems/search-insert-position/ */ class Solution { public: int searchInsert(vector<int>& nums, int target) { int lo=lower_bound(nums.begin(),nums.end(),target)-nums.begin(); if(nums[lo]==target)return lo; else return lo; } }; //Alhamdulillah.....
ALGO
0.999969
6.549423