uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
1b4cbff7-24cd-4f9d-aa61-f667f8a36618
oxygen-hunter/Flashboom
data/big-vul-100/add_attention_code/Mixtral/top0-100/minDistance-Solution.minDistance/177909_DoS_Exec_Code_Overflow.cpp
void Splash::scaleMaskYdXu(SplashImageMaskSource src, void *srcData, int srcWidth, int srcHeight, int scaledWidth, int scaledHeight, SplashBitmap *dest) { Guchar *lineBuf; Guint *pixBuf; Guint pix; Guchar *destPtr; int yp, yq, xp, xq, yt, y, yStep, xt, x, xStep, d; int i, j; yp = s...
TOOL
0.985245
3.363543
24ffaac8-60ea-4538-aa3b-289b04c18879
ishabhray/Competitive-Programming
atcoder/abc255d.cpp
#include <bits/stdc++.h> using namespace std; #define PI 3.141592653589 #define ll long long int #define ld long double #define vi vector<int> #define vl vector<ll> #define ii pair<int,int> #define pb push_back #define mp make_pair #define ff first #define ss second #define pll pair<ll,ll> #define vv vector #define al...
ALGO
0.99992
4.271592
0fc3e057-ab85-4c1f-bf21-d92946e85306
JoseJuanSE/Algorithm_Analysis
HUffman/Descomprime.cpp
#include<bits/stdc++.h> #include "Arbol.hpp" using namespace std; //En esta funcion se pasa el nombre de un archivo y regresa la extension string getExtention(string a) { return a.substr(a.find_last_of(".")); } //Le pasamos el el archivo de frecuencias y el comprimido int main(int argc, char* argv[]) { //val...
ALGO
0.993577
4.109674
141e72e6-cf52-483a-af93-22df9aeb7e78
yeeking/ai-enhanced-audio-book
src/Part4_NeuralFX/034a_iir_basic/src/main.cpp
#include "../../tinywav/myk_tiny.h" #include <string> #include <vector> #include <iostream> int main(){ float a = -0.9; float b = 0.5; // feedback float x[] = {0.1, -0.1, 0.2, 0.5, 0.25, 0}; // signal float y[100]; // output - we'll run it for 100 samples y[0] = 0; for (int n=1;n<100;++n)...
ALGO
0.998236
3.703115
f3d76d6b-01f5-4be6-9a80-3d8b8c96f641
MichalEngineer/P1_33434_MB
PWIR_4/5_pi_bad.cpp
#include <cstdio> #include <thread> #include <chrono> double sum; void calculatePI(int id, double step, unsigned long long steps_per_thread) { double x = 0; double temp_sum = 0; for (unsigned long long i = id * steps_per_thread;i < (id + 1) * steps_per_thread;i++) { x = (i + 0.5) * step; ...
ALGO
0.999798
4.418913
fa46d87a-fc33-43bc-9cb7-df858c4b785c
lazypal/problems
mergeIntervals.cpp
/** * @rohit */ class Solution { public: vector<vector<int>> merge(vector<vector<int>>& intervals) { vector<vector<int>> mergedIntervals; std::sort(intervals.begin(), intervals.end()); mergedIntervals.push_back(intervals[0]); for(int i = 1; i < intervals.size(); i++) { ...
ALGO
0.999998
6.102416
70df26cb-f81f-4ebf-9d26-b51b672f0ca4
GuacheSuede/MSSubmission1234567890
submission/macd/boost_1_69_0/libs/geometry/doc/src/examples/quick_start.cpp
// Boost.Geometry (aka GGL, Generic Geometry Library) // Quickbook Examples, for main page #if defined(_MSC_VER) // We deliberately mix float/double's here so turn off warning //#pragma warning( disable : 4244 ) #endif // defined(_MSC_VER) #include <iostream> //[quickstart_include #include <boost/geometry.hpp> #inc...
TOOL
0.88151
5.868282
6663f83b-2c0f-4ca0-b265-3cf50db25b34
ctzsm/Tsunemori-Akane
LightOJ/1100-1199/1150.cpp
#include <queue> #include <vector> #include <cstdio> #include <cstdlib> #include <cstring> #include <algorithm> using namespace std; const int dx[] = {0, 0, 1, -1}; const int dy[] = {1, -1, 0, 0}; const int maxn = 110; const int maxm = 10000; const int oo = 0x3f3f3f3f; struct edge { int u, v, cap; edge() {} edge(i...
ALGO
0.999443
4.126078
4f64028f-7824-46e7-9220-e78e9819ddcb
geekygirl8/Hacktoberfest_2022_DSA
C++/C++/two-city-scheduling.cpp
// Time: O(n) ~ O(n^2), O(n) on average. // Space: O(1) // quick select solution class Solution { public: int twoCitySchedCost(vector<vector<int>>& costs) { static auto cmp = [](auto &a, auto &b) { return a[0] - a[1] < b[0] - b[1]; }; nth_element(costs.begin(), ...
ALGO
0.999985
6.393755
ae643068-cb74-4381-9b00-547022f56f47
tcew/nodal-dg
nudg++/trunk/Src/Codes2D/CurvedDGGrad2D.cpp
// CurvedDGGrad2D.m // function [dUdx, dUdy] = CurvedDGGrad2D(cU, gU, gmapD, bcU) // 2007/06/25 //--------------------------------------------------------- #include "NDGLib_headers.h" #include "NDG2D.h" //--------------------------------------------------------- void NDG2D::CurvedDGGrad2D ( const DMat& cU, // ...
ALGO
0.993872
6.951636
c80c007c-6359-445b-942b-86bb02a5bad2
KhaledHegazy222/Problem-Solving
CodeForces/248B/main.cpp
#include <bits/stdc++.h> using namespace std; int main(void){ int n; cin >> n; if(n < 3){ cout << -1 << endl; } else if(n == 3){ cout << 210 << endl; } else if(n == 4){ cout << 1050 << endl; } else{ int mod = 50; cout << 1; for(int ...
ALGO
0.999806
4.115134
94ee2d36-66a3-4cd1-897e-6ab5de913134
wavelet-and-multiscale-library/Marburg_Software_Library
WaveletTL/general_domain/domain_frame_index.cpp
#include "domain_frame_index.h" #include "domain_frame.h" // implementation for domain_index.h namespace WaveletTL { template <class IFRAME, int NPATCHES> DomainFrameIndex<IFRAME, NPATCHES>::DomainFrameIndex(const DomainFrame<IFRAME, NPATCHES>* frame) : frame_(frame), patch_(0) { if (frame_ == 0) { ...
TOOL
0.948682
5.237115
503c60ad-024f-44a4-a07b-aaf4ba1bc8b1
Hasanul-Bari/contests
Codeforces Round #699 (Div. 2)/A.cpp
#include<bits/stdc++.h> #define faster ios :: sync_with_stdio(0); cin.tie(0); cout.tie(0); #define ll long long #define ull unsigned long long #define pb push_back const double PI = acos(-1.0); using namespace std; int main() { faster int t; cin>>t; int px,py; string s; while(t--) { ...
ALGO
0.999757
3.686196
76fa67c1-9843-4b1f-b237-189ec751f3b3
KYENS/gem5_InCache
src/systemc/tests/systemc/misc/unit/data/datawidth_unsigned/promote/datawidth.cpp
/***************************************************************************** datawidth.cpp -- Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15 *****************************************************************************/ /**************************************************************************...
ALGO
0.960585
5.331775
eb9b829d-6c20-4376-bfe9-67ab6654ef17
TengFeiyang01/Algorithm
ACODE/cf/cf_853/b.cpp
#include <iostream> #include <algorithm> #include <string> #include <queue> #include <set> #include <functional> #include <vector> #include <cstring> #include <map> #include <unordered_map> #include <stack> #include <numeric> #include <cmath> #define sz(x) int((x).size()) #define bg(x) begin(x) #define all(x) bg(x), e...
ALGO
0.99997
4.757905
c6ee23a4-7469-44f4-84c9-208ad848dad3
AhanaDatta59/Codeforces
TrafficLights.cpp
#include <bits/stdc++.h> using namespace std; int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); int T; cin >> T; while (T--) { int n, m; cin >> n >> m; vector<vector<int>> adj(n+1); for (int i = 0; i < m; i++) { int u, v; cin >> u >>...
ALGO
0.999956
4.758967
cbbd2edb-5564-4187-915e-9dc32be8933e
yexis/OI
nowcoder/牛客周赛64/g.cpp
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/hash_policy.hpp> using namespace __gnu_pbds; using namespace std; #define ios ios::sync_with_stdio(0),cin.tie(0),cout.tie(0) template<class KT, class VT = null_type> using RBTree = tree<KT, VT, std::less<KT>, rb_tree_tag, tree_order...
ALGO
0.999776
4.413255
3d670608-a520-4ef0-9d84-013ff5f0e33f
mohitkhedkar/competitive-programming
Codechef/Practice and Learn/Beginner/The One Who Knocks!.cpp
#include <iostream> using namespace std; int main() { // your code goes here int t; cin>>t; while(t--){ int x,y; cin>>x>>y; if(x>y){ if((x-y)%2 == 0) { cout<<1; } else { cout<<2; } } else if (x<y) { if((x-y)%2 ==0) { ...
ALGO
0.999979
3.974688
3404b795-9dc8-4a5c-9edc-965a39f6c774
Erich8200/Impact_Blue-algorithm_practicing
蓝桥杯算法题/ADV-225_文本加密(模拟).cpp
#include <iostream> #include <stdio.h> #include <vector> #include <math.h> #include <algorithm> using namespace std; string keyArr; int main(void) { string str; getline(cin, str); for (char ch = 'A'; ch <= 'Z'; ch++) keyArr.push_back(ch); for (char ch = 'a'; ch <= 'z'; ch++) keyArr.push_back(ch); for...
ALGO
0.999467
4.366299
eeda769d-82bc-4d65-b6ce-67315e1f4689
girlcoder18/Model-Based-IDS
robot_formation/01252016/robot_1/robot/robot.cpp
real_T rt_atan2d_snf(real_T u0, real_T u1) { real_T y; int32_T u0_0; int32_T u1_0; if (rtIsNaN(u0) || rtIsNaN(u1)) { y = (rtNaN); } else if (rtIsInf(u0) && rtIsInf(u1)) { if (u0 > 0.0) { u0_0 = 1; } else { u0_0 = -1; } if (u1 > 0.0) { u1_0 = 1; } else { u1_0 = ...
ALGO
0.999184
4.999753
9bf2a71a-0a2f-4926-a1f2-15e36121316b
Jayasharma27/ADA-Lab-Program
Write a program for Recursive Binary Search.cpp
#include <iostream> using namespace std; int binarySearch(int arr[], int low, int high, int number) { if (low > high){ return -1; } int mid = (low + high)/2; if (number == arr[mid]){ return mid; } else if (number < arr[mid]){ return binarySearch(arr, low, mid - 1, numbe...
ALGO
0.999394
5.468799
1e792bff-91b8-431d-9b95-1aa016651cad
adityak54/cp
before-aug-24/C_Odd_Even_Increments.cpp
#include<bits/stdc++.h> using namespace std; int main(){ int t; cin>>t; while(t--){ int n; cin>>n; int arr[n]; for(int i=0;i<n;i++){ cin>>arr[i]; } vector<int> even; vector<int> odd; for(int i=0;i<n;i++){ if(arr[i]%2==0)...
ALGO
0.999397
3.999318
26286358-bed4-4b13-941e-1ef07b81e203
UdaySharmaGitHub/GFG-160-Challenge
Arrays/Day5_Next_Permutation.cpp
// User function Template for C++ class Solution { public: void nextPermutation(vector<int>& arr) { // code here next_permutation(arr.begin(), arr.end()); } };
ALGO
0.999866
5.343468
03c28ca7-8e1c-4f93-8423-f65b0f75507e
Yawn-Sean/Daily_CF_Problems
daily_problems/2024/06/0603/personal_submission/cf802b_ToC.cpp
// https://codeforces.com/contest/802/submission/264081409 const int MAXN = 4e5 + 10; using PII = pair<int, int>; int n, m, k; int a[MAXN]; vector<int> seq[MAXN]; int idx[MAXN]; void sol() { cin >> n >> k; for (int i = 1; i <= n; i++) { cin >> a[i]; if (seq[a[i]].empty()) { m++; ...
ALGO
0.999963
3.997202
6b54c38e-6a1a-42fa-86da-1560cf89ba0f
bewuethr/stroustrup-ppp
chapter21/chapter21_ex04.cpp
// Chapter 21, Exercise 4: implement count_if() yourself and test it #include "../lib_files/std_lib_facilities.h" //------------------------------------------------------------------------------ template<class In, class Pred> int my_count_if(In first, In last, const Pred& p) { int ctr = 0; while (first != la...
ALGO
0.975723
6.459715
c3469310-5d35-42f6-895b-3d13108174d6
srbcheema1/Algo_Ds
Mathematical Challenges/C:C++/power/two_pow.cpp
#include<bits/stdc++.h> #define F0(i,t) for(int i=0; i<t; i++) #define F1(i,t) for(int i=1; i<=t; i++) #define Si(x) scanf("%d",&x) #define Si2(x,y) scanf("%d %d",&x,&y) #define Sl(x) scanf("%lld",&x) #define Sl2(x,y) scanf("%lld %lld",&x,&y) #define dout if(debugg)cout<<" " /* * * * * * * * * * * * * * * * * * * ...
ALGO
0.99956
4.629675
184e6cd0-ed30-451d-b2b4-645be9f6b6d7
SanjishMaharjan/defacelab1
windows/runner/utils.cpp
#include "utils.h" #include <flutter_windows.h> #include <io.h> #include <stdio.h> #include <windows.h> #include <iostream> void CreateAndAttachConsole() { if (::AllocConsole()) { FILE *unused; if (freopen_s(&unused, "CONOUT$", "w", stdout)) { _dup2(_fileno(stdout), 1); } if (freopen_s(&unuse...
TOOL
0.9988
6.76073
90c4a6a4-5eed-4686-aa48-66c768927397
YoungseokCh/problem-solving
baekjoon/2143.cpp
#include <bits/stdc++.h> #define faster ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0); using namespace std; int T, n, m; // A[i] is prefix sum for A_0 + ... + A_{i-1} int A[1024]; int B[1024]; map<int, int> sum_count_A; map<int, int> sum_count_B; int main(){ faster cin >> T; cin >> n; for (...
ALGO
0.999958
4.107456
9e8a4c93-991f-4f95-8be1-e5c1c76efe9c
AKBaman/Leet_Solutions
2551-apply-operations-to-an-array/2551-apply-operations-to-an-array.cpp
class Solution { public: vector<int> applyOperations(vector<int>& nums) { int n = nums.size(); vector<int> newNums(n, 0); int count = 0; for (int i = 0; i < n - 1; i++) { if (nums[i] != 0) { if (nums[i] == nums[i + 1]) { newNums[count...
ALGO
0.999964
6.156136
0c0ee5e5-d9ca-4146-ada8-950b0b854f67
mickybart/android_frameworks_av
media/libstagefright/codecs/amrnb/enc/src/hp_max.cpp
/* ------------------------------------------------------------------------------ Filename: /audio/gsm_amr/c/src/hp_max.c Date: 02/01/2002 ------------------------------------------------------------------------------ REVISION HISTORY Description: Replaced "int" and/or "char" with OSCL defined types. Des...
ALGO
0.999618
7.219464
48ff5f2e-176e-438b-ad1b-3441f2b5290b
steph1111/F23_CS11_SI
week_8/monday/exercise0/GCD.cpp
#include <iostream> using namespace std; int main() { int m, n; cout << "Enter a number m: "; cin >> m; cout << "Enter a number n: "; cin >> n; // ------------------------------------------------------------ // ---------------------- YOUR CODE HERE ---------------------- // ------------------------...
ALGO
0.991269
5.051321
c3fb2931-332e-4c69-a844-fce68356bdbe
ravi956/pepcoding-level1-in-cpp
Recursion and Backtracking/08_recursion_on_the_way_up/01_print_subsequence.cpp
#include <bits/stdc++.h> using namespace std; void printSS(string input, string output) { if (input.length() == 0) { cout << output << endl; return; } char ch = input[0]; string newInput = input.substr(1); printSS(newInput, output + ch); printSS(newInput, output + ""); } i...
ALGO
0.999845
4.353639
f54e9d9a-15bf-4d81-a5ae-76b33b6a557b
DcmTruman/my_acm_training
HDU/5676/13079830_AC_546ms_2464kB.cpp
#include<iostream> #include<algorithm> #include<string> #include<cstring> #include<string.h> using namespace std; int cnt = 0; typedef long long ll; ll num[600000]; void dfs(int n1, int n2, int l, ll number) { if (n1 == l && n2 == l) { num[cnt++] = number; return; } if (n1<l) { dfs(n1 + 1, n2, l, number *...
ALGO
0.999208
4.150681
3f74c906-37f0-4e6f-9ba4-8f07e352297a
Meh494/Coding-solutions
ECOO '16 R1 P3 - Railway Sort.cpp
//Thoughts: Vector useage, nothing too complex //Meh494 #include <bits/stdc++.h> using namespace std; int main(){ cin.sync_with_stdio(0); cin.tie(0); for(int i = 0; i<10; i++){ int n; cin>>n; vector<int> arr; for(int j = 0; j<n; j++){ int input; cin...
ALGO
0.999872
4.317677
6d22aa09-aae6-44f0-a4f5-c86efc569a25
RashedCSEJnU/ProblemSolving
CSES/DynamicProgramming/Coin_Combinations_I.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long vector<int> coins; int dp[3000010]; const int mod = 1e9 + 7; int func(int amount) { if (amount == 0) return 1; if (dp[amount] != -1) return dp[amount]; int ans = 0; for (int coin : coins) { if (amount - c...
ALGO
0.999954
4.387432
9230f5c5-cb25-490e-9de0-a7381970e4c0
telecran-telecrit/xulrunner-icefox-widget
layout/base/nsCSSRenderingBorders.cpp
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ // vim:cindent:ts=2:et:sw=2: #include "nsStyleConsts.h" #include "nsPresContext.h" #include "nsIFrame.h" #include "nsPoint.h" #include "nsRect.h" #include "nsIViewManager.h" #include "nsIPresShell.h" #include "nsFrameManager.h" #include "n...
TOOL
0.909371
7.614293
8c6be94e-df4a-4bc0-b670-e57bd2071e63
zixfy/cpp-leetcode
[2391]收集垃圾的最少总时间.cpp
//给你一个下标从 0 开始的字符串数组 garbage ,其中 garbage[i] 表示第 i 个房子的垃圾集合。garbage[i] 只包含字符 'M' //,'P' 和 'G' ,但可能包含多个相同字符,每个字符分别表示一单位的金属、纸和玻璃。垃圾车收拾 一 单位的任何一种垃圾都需要花费 1 分钟。 // // 同时给你一个下标从 0 开始的整数数组 travel ,其中 travel[i] 是垃圾车从房子 i 行驶到房子 i + 1 需要的分钟数。 // // 城市里总共有三辆垃圾车,分别收拾三种垃圾。每辆垃圾车都从房子 0 出发,按顺序 到达每一栋房子。但它们 不是必须 到达所有的房子。 // // 任何时刻只有...
ALGO
0.999599
6.36105
8a95f9fd-6eb1-4641-864a-389fa58d7df9
mkmojo/aoapc-book
TrainingGuide/exercises/ch2/Number Theory/UVa11440.cpp
// UVa11440 Help Mr. Tomisu // Rujia Liu #include<cstdio> #include<cmath> #include<cstring> const int maxn = 10000000 + 10; const int MOD = 100000007; int vis[maxn], phifac[maxn]; void gen_primes(int n) { int m = (int)sqrt(n+0.5); int c = 0; memset(vis, 0, sizeof(vis)); for(int i = 2; i <= m; i++) if(!vis[i])...
ALGO
0.999933
3.964463
f0d0eeb3-3a71-4daa-b46a-a8ac38038147
abcivashritt/codechef
Bear and Candies 123.cpp
#include <iostream> #include <cmath> using namespace std; int main() { int t; cin>>t; while(t--) { int a,b,limak, bob; cin>>a>>b; limak = sqrt(a); bob = max(0, (int)sqrt(b) - 1); while(((bob + 1) * (bob + 1) + (bob+1)) <= b) bob++; cout<<(limak <= bob ? "Bob" : "Limak")<<"\n"; } return 0; }
ALGO
0.999818
4.110439
741403c9-d0e7-4261-aacc-adfc46a64db8
ishandutta2007/codeforces
fastmath/normal/1348/F.cpp
#include<bits/stdc++.h> using namespace std; #define int long long #define ii pair <int, int> #define app push_back #define all(a) a.begin(), a.end() #define bp __builtin_popcount #define ll long long #define mp make_pair #define f first #define s second #define Time (double)clock()/CLOCKS_PER_SEC const int N = 2e5 + ...
ALGO
0.999999
3.448966
25a6d0f5-62a5-4115-851c-087c9625c6d2
omnibor/llvm-omnibor
llvm-project/mlir/lib/Dialect/Linalg/Utils/Utils.cpp
#include "mlir/Dialect/Linalg/Utils/Utils.h" #include "mlir/Analysis/SliceAnalysis.h" #include "mlir/Dialect/Affine/Analysis/AffineStructures.h" #include "mlir/Dialect/Affine/IR/AffineOps.h" #include "mlir/Dialect/Affine/IR/AffineValueMap.h" #include "mlir/Dialect/Affine/LoopUtils.h" #include "mlir/Dialect/Arithmetic/...
TOOL
0.906512
5.473994
3943a3f8-6f61-4b7b-849a-981628c5c00a
lazybones1/Algorithms
백준알고리즘/단계별로 풀어보기/6. 1차원 배열/P_Number_2562.cpp
#include <iostream> #include <algorithm> using namespace std; int main() { int index; int maxN; for(int i = 0; i<9; i++){ int tmp; cin>>tmp; if(i==0) { maxN = tmp; index = i; } else { if(maxN<tmp){ maxN=tmp; index = i; } } } cout<<maxN<<"\n"<<in...
ALGO
0.99997
3.463649
63752e70-c3b2-40df-832a-875cdc445512
NestZ/competitive-programming
AtCoder/SimpleStringQueries.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.999798
4.491754
3138a5f9-7b0f-402b-a317-cfdef7f16553
saidwho12/c-raytracer
main.cpp
#include <stdio.h> #include <stdlib.h> #include <math.h> #include <stdint.h> #include <cmath> #include <cfloat> #include <unordered_map> #include <ctime> //#define WIDTH 3840 //#define HEIGHT 2160 #define WIDTH 500 #define HEIGHT 500 #define ARRAYSIZE(x) (sizeof(x)/sizeof((x)[0])) #define STB_IMAGE_WRITE_IMPLEMENTAT...
ALGO
0.925776
4.278387
9c6dc1da-c48e-42e0-a180-6003daae2cfb
son-of-mountain/problem-solving
codeforces/.history/Verify Password_20240829133842.cpp
#include <iostream> #include <bits/stdc++.h> using namespace std; #define sonic ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); #define y cout<< "YES\n" #define no cout<< "NO\n" int main() { sonic ; int t ; cin >> t ; while (t--) { int n ; cin >> n ; string s ; cin >> s ; fo...
ALGO
0.999885
3.503714
0410fd91-8de4-46fa-bf19-c01e25a34df2
Nishantniro/delivery_app
windows/runner/utils.cpp
#include "utils.h" #include <flutter_windows.h> #include <io.h> #include <stdio.h> #include <windows.h> #include <iostream> void CreateAndAttachConsole() { if (::AllocConsole()) { FILE *unused; if (freopen_s(&unused, "CONOUT$", "w", stdout)) { _dup2(_fileno(stdout), 1); } if (freopen_s(&unuse...
TOOL
0.998799
6.776823
3c846194-4a24-4fdc-9569-eed82dabc344
JyotiOjha/PLacement-Preparation-Module
DAY2(ARRAYS 2)/countinversions.cpp
#include<bits/stdc++.h> using namespace std; int inverse(vector<int>&v) { int cnt=0; for(int i=0;i<v.size();i++) { for(int j=i+1;j<v.size();j++) { if(v[i]>v[j]) cnt++; } } return cnt; } int main() { int n; cin>>n; vector<int>v(n); f...
ALGO
0.999733
3.846222
1508e47e-e171-47df-ba62-694c22bb9a7f
ashrwin/Spoj-Solutions
solutions/Amusingnumbers.cpp
#include<iostream> #include<set> #include<vector> #include<algorithm> #include<string> #include<map> #include<math.h> #include<stdlib.h> #define mp make_pair #define pb push_back #define MAX (1<<30) using namespace std; typedef pair<int , int> ii; typedef vector<int> vi; typedef vector<ii> vii; typedef vector<vii> vvii...
ALGO
0.999657
4.570947
0bd521ca-1774-4d0c-a231-97280efba167
KeLuoJun/Algorithm
cpp/DP/背包/01背包问题(模板).cpp
// 01(ģ) // һtʾ // mÿѡһ // ÿԼcosts[i]ͼֵvalues[i] // ڲ£ôѡܴﵽֵ // ļֵ // : https://www.luogu.com.cn/problem/P1048 #include <iostream> using namespace std; #include <algorithm> const int MAXN = 1001; int *value = new int[MAXN]; int *cost = new int[MAXN]; //iƷţjǰı int compute1(int t, int m) { int (*dp)[MAXN] = new int[...
ALGO
0.999987
3.931148
635d6f39-5839-4155-9554-a3f18df206ed
FAU-LMS/vvc-extension-mm
source/Lib/DecoderLib/DecLib.cpp
/** \file DecLib.cpp \brief decoder class */ #include "NALread.h" #include "DecLib.h" #include "CommonLib/dtrace_next.h" #include "CommonLib/dtrace_buffer.h" #include "CommonLib/Buffer.h" #include "CommonLib/UnitTools.h" #include "CommonLib/ProfileLevelTier.h" #include <fstream> #include <set> #include <s...
TOOL
0.854677
4.844975
c6abecdc-235b-4689-b79f-95a15d760f3c
Ryan-Ala/Leetcode-
2611.老鼠和奶酪/源.cpp
#include<iostream> static int cmp(const void* a, const void* b) { return *(int*)a < *(int*)b; } int miceAndCheese(int* reward1, int reward1Size, int* reward2, int reward2Size, int k) { int sum = 0, * ret = (int*)malloc(sizeof(int) * reward2Size); for (int i = 0; i < reward2Size; i++) { sum += r...
ALGO
0.999929
3.743572
5ec19197-e2ab-4b36-837c-c9d74da76126
Rapidsnopp/Hustack
Simulation Stack.cpp
#include <bits/stdc++.h> using namespace std; int main(){ stack <int> st; while(1){ string s; cin >> s; if(s=="PUSH") { int t; cin >> t; st.push(t); } else if(s=="POP") { if(!st.empty()) { cout << st.top() <...
ALGO
0.998689
4.178802
314ac649-1e15-4ab9-baa8-2ea763f3423e
YMDragon/OJ-code
codeforces/457/F.cpp
#include <algorithm> #include <iostream> #include <cstdlib> #include <cstring> #include <cstdio> #include <cmath> using namespace std; int n,mid,ch[255][2],a[255],siz[255],f[255][2][3],vis[255][2][3]; int dfs(int x) { if (a[x]!=-1) return siz[x]=0; siz[x]=dfs(ch[x][0])+dfs(ch[x][1])+1; if (siz[ch[x][1]]&1) swap(...
ALGO
0.99992
4.025866
cfa0c662-ee8c-4e46-acf0-9eff40f15ac4
vikashmishra464/competitiveCoding
geeksForGeeks/tripletFamily.cpp
class Solution { public: bool findTriplet(vector<int>& arr) { sort(arr.begin(),arr.end()); int n=arr.size(); for(int i=0;i<n-1;i++){ for(int j=i+1;j<n;j++){ int sum=arr[i]+arr[j]; for(int k=j+1;k<n;k++){ if(arr[k]==sum){ ...
ALGO
0.999911
5.386755
89ae90fd-a554-48f8-9932-1a5a10864994
wol101/GaitSym5
PhysX/PhysX-107.0/physx/source/geomutils/src/pcm/GuPCMContactPlaneConvex.cpp
#include "geomutils/PxContactBuffer.h" #include "GuVecConvexHull.h" #include "GuContactMethodImpl.h" #include "GuPersistentContactManifold.h" using namespace physx; bool Gu::pcmContactPlaneConvex(GU_CONTACT_METHOD_ARGS) { PX_UNUSED(shape0); PX_UNUSED(renderOutput); using namespace aos; PersistentContactManifold...
ALGO
0.984088
7.199165
c7bec06f-e348-4d5f-a8e5-e7cb34cf4b9d
sinian666/code_86_7
cpp_副本23/chapter_stack_and_queue/array_deque.cpp
/** * File: array_deque.cpp * Created Time: 2023-03-02 * Author: Krahets (<EMAIL>) */ #include "../utils/common.hpp" /* 基于环形数组实现的双向队列 */ class ArrayDeque { private: vector<int> nums; // 用于存储双向队列元素的数组 int front; // 队首指针,指向队首元素 int queSize; // 双向队列长度 public: /* 构造方法 */ ArrayDequ...
ALGO
0.998795
6.046702
f5fcdc89-e6d2-43a1-a248-142bc02f54ae
diohabara/competitive_programming
ac/prev/arc103_a.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long #define rep(i, n) for (ll i = 0; i < n; ++i) const ll INF = LLONG_MAX; const ll MOD = 1e9 + 7; int main() { ios_base::sync_with_stdio(false); cin.tie(0); ll n; cin >> n; // cnt[num][oe] : numがいくつあるか,oeは偶数奇数番目の要素かどうか ll cnt[10000...
ALGO
0.999957
3.735932
175480b6-ba04-4f31-8422-12b3a9384b0f
Lcooldong/C_Study
C_Visual_Studio/Queue_test/Queue_test/operation.cpp
#include <stdio.h> #define N 10 int queue[N]; //int len = sizeof(queue) / sizeof(queue[0]); int rear = -1; int front = 0; int put_flag; int put(int n) { printf("front : %d, rear : %d\n", front, rear); //if (rear >= N - 1) if(rear == -1) put_flag = 0; if(rear == front && put_flag == 1) // circular { return -1;...
ALGO
0.999485
4.010541
d26a87b6-0655-442f-bfc7-a3e82c39f0ed
physicalist/ncbs-moose
moose/branches/zbigniew_py3k/biophysics/HHGate.cpp
#include "header.h" #include "ElementValueFinfo.h" #include "HHGate.h" static const double SINGULARITY = 1.0e-6; const Cinfo* HHGate::initCinfo() { /////////////////////////////////////////////////////// // Field definitions. /////////////////////////////////////////////////////// static ReadOnlyLookupValueFinfo...
ALGO
0.917987
5.098986
6383aafb-9629-4996-89a7-5e66c53e570c
lc-3-2/llvm
llvm/lib/CodeGen/MachineDominanceFrontier.cpp
#include "llvm/CodeGen/MachineDominanceFrontier.h" #include "llvm/CodeGen/MachineDominators.h" #include "llvm/CodeGen/Passes.h" #include "llvm/InitializePasses.h" #include "llvm/Pass.h" #include "llvm/PassRegistry.h" using namespace llvm; namespace llvm { template class DominanceFrontierBase<MachineBasicBlock, false>...
ALGO
0.993995
7.473969
9be2d7bd-90c0-4a8d-b1d5-e105acd29e94
wol101/GaitSym2019
ode-0.15/ode/src/box.cpp
/* standard ODE geometry primitives: public API and pairwise collision functions. the rule is that only the low level primitive collision functions should set dContactGeom::g1 and dContactGeom::g2. */ #include <ode/common.h> #include <ode/collision.h> #include <ode/rotation.h> #include "config.h" #include "ma...
ALGO
0.997302
6.802304
1b556509-61e6-48f2-823c-f84f381751e1
acnokego/LeetCode
021_merge_two_sort_lists/recursion.cpp
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ /* * Complwxity: O(n) * Space: O(n) number of stack frames * * This solution is not a tail-recursive (do the calculation first, then * recursion, passing th...
ALGO
0.999997
6.058073
f6f7831b-74f8-4690-a158-7fad02669a6c
hemanth1999k/Competitive-Programming
Codeforces/pleasantpairs.cpp
#include<bits/stdc++.h> #define FOR(n) for(int i=0;i<n;++i) #define FOR1(n) for(int i=1;i<n;++i) #define FR(i,a,b) for(int i=a;i<b;++i) #define rng(a,b) for(int i=a;i<b;++i) #define ll long long #define vint vector<int> #define vlong vector<long long> #define vstr vector<string> #define vvin vector<vector<int>> #defin...
ALGO
0.999598
3.696789
21902402-273a-4300-8956-8d98ba3b387c
Hasanul-Bari/codeforces
codeforces/467/B.cpp
#include<bits/stdc++.h> #define faster ios :: sync_with_stdio(0); cin.tie(0); cout.tie(0); #define ll long long #define ull unsigned long long #define pb push_back const double PI = acos(-1.0); using namespace std; int main() { faster int n,m,k,f; cin>>n>>m>>k; int a[m]; for(int i=0; i<m; i++) ...
ALGO
0.999975
3.957202
870084e0-44b9-4a17-b335-572e2de9e47a
sarvex/leetcode-nim
solution/0200-0299/0242.Valid Anagram/Solution.cpp
class Solution { public: bool isAnagram(string s, string t) { if (s.size() != t.size()) { return false; } vector<int> cnt(26); for (int i = 0; i < s.size(); ++i) { ++cnt[s[i] - 'a']; --cnt[t[i] - 'a']; } return all_of(cnt.begin(), c...
ALGO
0.999974
6.625284
1a8a4599-8ca7-4923-8872-27ed431c0fc2
sav/hackerrank
cpp/c-tutorial-for-loop/main.cpp
#include <iostream> #include <bits/stdc++.h> using namespace std; const char *word[] = { "one", "two", "three", "four", "five", "six", "seven", "eight", "nine" }; int main(void) { int a, b; cin >> a; cin >> b; for (int i = a; i <= b; ++i) { if (i >= 1 && i <= 9) { cout << word[i - 1] << endl; }...
ALGO
0.999755
3.991715
9afdc384-6d47-4af1-ad86-5105397ed745
jzhng/algorithm-training-camp
sort.cpp
#include "stdio.h" #include <vector> using namespace std; void qsort(int l, int r, vector<int> &a) { if (l >= r) return; int i = l, j = r + 1; int key = a[l]; while (true) { while (a[++i] < key && i < r) ; while (a[--j] > key && j > l) ; if (i >= j) break; swap(a[i], a[j...
ALGO
0.999981
4.148101
76607736-576a-485b-a07d-8541bca7401c
phuhuynhh/pkam
VINS-Mono/vins_estimator/src/estimator.cpp
#include "estimator.h" Estimator::Estimator(): f_manager{Rs} { ROS_INFO("init begins"); clearState(); } void Estimator::setParameter() { for (int i = 0; i < NUM_OF_CAM; i++) { tic[i] = TIC[i]; ric[i] = RIC[i]; } f_manager.setRic(ric); ProjectionFactor::sqrt_info = FOCAL_LEN...
ALGO
0.964688
5.319429
e1defbbf-6d69-4287-9560-da53508be958
BGMer7/LeetCode
202. Happy Number/happyNumber.cpp
#include <iostream> #include <set> using namespace std; class Solution { public: bool isHappy(int n) { bool res = true; set<int> s; int trans = resolve(n); if (trans == 1) return true; while (s.count(trans) == 0) { s.insert(trans); ...
ALGO
0.999891
5.862583
368d827d-e6a1-4bb4-97a5-df060f2c7297
ZwFink/hpacml
llvm/tools/llvm-strings/llvm-strings.cpp
#include "Opts.inc" #include "llvm/Object/Binary.h" #include "llvm/Option/Arg.h" #include "llvm/Option/ArgList.h" #include "llvm/Option/Option.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/Error.h" #include "llvm/Support/Format.h" #include "llvm/Support/InitLLVM.h" #include "llvm/Support/MemoryBuffer....
TOOL
0.871803
4.744654
886eb21d-083f-4b58-bfaf-9f3e65dcbae2
R-Priyadarshi/DSA_cpp
104.doublePtr_MCQ7.cpp
#include<iostream> using namespace std; int main(){ int arr[5]; int *ptr; cout<<sizeof(arr)<<" "<<sizeof(ptr)<<endl; return 0; }
ALGO
0.928616
3.336222
e9f75c56-e341-4e1b-8e34-52b29e5b07b7
altafraza/Cipher-School-Assignment1
star_print.cpp
/* Q.3 1. You are given a number n. 2. You've to create a pattern of * and separated by tab as shown in output format. */ #include <iostream> using namespace std; void pypart2(int n) { int i = 0, j = 0, k = 0; while (i < n) { while (k < (n - i - 1)) { cout << " "; ...
ALGO
0.99977
4.420109
2fb31610-0951-49e3-9e65-e7656953795e
Utkarsh-123github/DSA-striver-A2Z
Linked List/26_merge-two-sorted-LL.cpp
#include<bits/stdc++.h> using namespace std; class Node { public: int data; Node* next; Node(int data1, Node* next1) { data = data1; next = next1; } Node(int data1) { data = data1; next = NULL; } }; Node* convertArr2LL(vector<int>&arr) { Node* head ...
ALGO
0.999994
5.280652
5e0dc346-6ba0-4a0d-86f0-4b3e6d218977
AnhLM027/CPP_PTIT
CPP0443 - SỐ NHỎ NHẤT CÒN THIẾU.cpp
#include<bits/stdc++.h> #define MOD 1000000007 #define maxn 1003 #pragma GCC optimize("O3,unroll-loops") #pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt") using namespace std; typedef long long ll; #define AnhLM027 "Le Minh Anh" int main() { int te; cin >> te; while (te--) { int n; cin >> n; set<int> se; for...
ALGO
0.999442
4.007968
f24ef2de-e860-4fa3-b4fa-7fb0a9afc67f
Nakib-Arman/CSE318---ArtificialIntelligence
3.ChainReaction/.history/main_20250614180436.cpp
#include <bits/stdc++.h> using namespace std; #define DEPTH 3 class Cell { int orb_num; int critical_mass; char color; public: Cell() { this->orb_num = 0; this->color = 'W'; this->critical_mass = 4; } // Cell(int orb_num, char color) { // this->orb_num = orb_...
ALGO
0.999481
4.834919
031460d0-e284-427f-91d5-853ac6d8ae42
Tamimkhan7/CF
1000/B. Notepad#.cpp
#include <bits/stdc++.h> using namespace std; #define MTK \ ios_base::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0); #define mem(a, b) memset(a, b, sizeof(a)) #define show(x) cout << #x << ' ' << x << endl #define all(x) (x).begin(), (x).end() #define ll int long lo...
ALGO
0.999959
4.708802
14fb751b-cab0-48a5-b02d-4effe9113244
Xetd71/Algorithms-and-Data-structures
Algorithms/Contest13-dancing-links-algorithm/task2-dancing-links-algo/task2-dancing-links-algo.cpp
#include "ReadWriter.h" struct Node { Node *left; Node *right; Node *up; Node *down; Node *head; int size; int id; }; const int MAX_N = 150; Node* headHead = nullptr; Node* solution[MAX_N]; int size = 0; void cover(Node* col) { col->left->right = col->right; col->right->left = co...
ALGO
0.999994
4.154295
1c0c689a-fb1b-48a9-a4af-1061d4f054ce
abhay-k47/Placements-2023
CP/Problems/AlgoZenith/Week-13/student_happiness.cpp
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; #define fi first #define se second #define mp make_pair #define mt make_tuple #define pb push_back #define eb emplace_back #define all(a) (a).begin(), (a).end() #defin...
ALGO
0.999702
4.652626
4517b97e-f985-4507-bf62-e41f82ae263f
jonstewart/boost-svn
libs/math/tools/generate_test_values.cpp
#ifndef NTL_STD_CXX # define NTL_STD_CXX #endif #include <ntl/RR.h> #include <iostream> #include <iomanip> int main() { NTL::RR r, root_two; r.SetPrecision(256); root_two.SetPrecision(256); r = 1.0; root_two = 2.0; root_two = NTL::sqrt(root_two); r /= root_two; NTL::RR lim = NTL::pow(NTL::RR(...
ALGO
0.991864
3.291113
fdd42a4e-93b9-494c-b89d-ae8c60197f41
minnce/codechef
1400-1600/equalMEX.cpp
#pragma GCC optimize("O2,no-stack-protector,unroll-loops,fast-math") #include <iostream> #include <bits/stdc++.h> #define ll long long #define db double #define MOD 1000000007 #define PB push_back #define F first #define S second #define uset unordered_set #define umap unordered_map #define pq priority_queue #define MP...
ALGO
0.999807
4.392075
420343f5-6081-4904-84c7-a2db11fb79db
EinPy/Competition_lib
CodeForces/Practice/BinarySearch/MeetingPlace.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define mp make_pair bool ok (vector<ll> f, vector<ll> s, long double t){ long double sho = 3e9, lon = 0; vector<ll> pref(f.size(),0); long double L = 0, R = 3e9; vector<pair<long double,long double>> segs; for ...
ALGO
0.999948
4.430827
93691cd2-c796-4730-9263-07ec2b80ee71
headshote/ProjectEulerSolutions
Problem1/eulerProblem6.cpp
#include "eulerProblem6.h" /** * The sum of the squares of the first ten natural numbers is, * 1^2 + 2^2 + ... + 10^2 = 385 * * The square of the sum of the first ten natural numbers is, * (1 + 2 + ... + 10)^2 = 552 = 3025 * * Hence the difference between the sum of the squares of the first ten natural numbers and the...
ALGO
0.985896
5.29283
f84e9ce4-a533-4750-9738-a34bd106ded5
jatinnarang22/leetcode
2894-divisible-and-non-divisible-sums-difference/2894-divisible-and-non-divisible-sums-difference.cpp
class Solution { public: int differenceOfSums(int n, int m) { int num1=0; int num2=0; for(int i=1;i<=n;i++){ if(i%m!=0)num1+=i; else num2+=i; } return num1-num2; } };
ALGO
0.999984
5.646874
6b278728-630c-45c7-a654-40e61ae00738
mariahito/studious
lab1/xToN.cpp
//Maria Hito mh4wt 22 01 2017 xToN.cpp #include<iostream> using namespace std; int xton(int,int); int main(){ int x,n,result; cout<<"Enter base number: "; cin>>x; cout<<"Enter power number: "; cin>>n; result = xton(x,n); cout<<x<<"^"<<n<<"="<<result<<endl; return 0; } int xton(int x,int n){ if(n...
ALGO
0.999738
4.921599
be6564c3-65e9-447d-8e6e-91a933ef816e
ta7uw/competitive-programming
AtCoder/Iroha2019day2/D.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<ll, ll>; using Graph = vector<vector<ll>>; #define rep(i, n) for(ll i=0;i<(ll)(n);i++) #define rep2(i, m, n) for(ll i=m;i<(ll)(n);i++) #define rrep(i, n, m) for(ll i=n;i>=(ll)(m);i--) const int dx[4] = {1, 0, -1, 0}; const int dy[4] = ...
ALGO
0.999997
4.719483
bf4f82a8-1619-439c-b594-4cc89886d367
tazkhan24/Coding-Questions
1192-critical-connections-in-a-network/1192-critical-connections-in-a-network.cpp
class Solution { public: vector<vector<int>> criticalConnections(int n, vector<vector<int>>& connections) { vector<bool> vi(n, false); vector<int> disc(n, 0), low(n, 0), parent(n, -1); vector<vector<int>> g(n, vector<int>()), res; for (auto& p : connections) { g[p.front(...
ALGO
0.99988
5.624514
2cff18d1-f007-4723-be74-663d7c7dd571
richard-shepherd/coding-world-cup
AIs/AI_Rimpo/FootballCpp/FootballCpp/Game.cpp
#include "stdafx.h" #include "Game.h" CGame::CGame() { CPlayerState::InitGlobalPlayerStateVector(); //creating strategy strategyPtr_ = make_shared<CCounterAttackerAI>(); /*#ifdef _DEBUG strategyPtr_ = make_shared<CPasserAI>(); #else strategyPtr_ = make_shared<CCounterAttackerAI>(); #endif */ strategyPtr_->Create...
TOOL
0.872191
3.767973
d38fe0d6-f687-41c6-9e8c-466119ee0fa3
diptu/Teaching
CSE 225L Data Structures and Algorithms/Resources/Codes Previous/Spring-2019-CSE225 1/Lab2/main(32).cpp
#include "dynarr.h" #include "dynarr.cpp" #include <iostream> using namespace std; int main() { dynArr<int>a; dynArr<double>b(5); int i; double x; cout << "Input : " << endl; for(i=0;i<5;i++){ cin >> x; b.setValue(i, x); } cout << "Output : " ; for(i=0;i<5;i++){ ...
ALGO
0.923148
3.619308
c7ab12d7-4ce1-414d-baf9-cf32c2d35d43
MdTowfikomer/CodeVault
mislenious/maxAreahistogram.cpp
#include <iostream> #include <vector> #include <climits> #include <stack> using namespace std; void printArrayI(vector<int> arr){ for(int i = 0; i < arr.size(); i++){ cout << arr[i] << " "; } cout << endl; return; } int maxHistogram(vector<int>& heights){ int n = heights.size(); stack<i...
ALGO
0.999955
6.323247
2115ff31-0909-4bb6-8d62-6b6511992dc4
Lemon-XQ/PAT-Advanced
PAT-Advanced-1096.cpp
#include <iostream> #include <algorithm> #include <vector> #include <map> using namespace std; int main(){ long long N,max=0,ans=0; cin>>N; for(long long i=2;i*i<=N;i++){ long long num=N,cnt=-1,j=i,tmp=1; while(num%tmp==0){ cnt++; tmp*=j; j++; } if(cnt>max){ max=cnt; ans=i; } } if(max==0...
ALGO
0.999975
3.692726
2c30affd-9c56-4dc9-aeec-b7bda882b8f9
josuerom/Competitive-Programming
Training/UVa/CP3/Mathematics/Number Theory/10892 - LCM Cardinality.cpp
#include <bits/stdc++.h> #define endl '\n' #define debug(X) cout << #X << " = " << X << endl #define fori(i,b,e) for (int i = (b); i < (e); ++i) #define mod(x,m) ((((x) % (m)) + (m)) % (m)) #define sq(x) (x) * (x) using namespace std; typedef long long ll; typedef vector<int> vi; typedef vector<vi> vvi; typedef pair<...
ALGO
0.999601
4.923796
031e7944-591c-4ec3-b40e-c3204ddcb5cf
YashNihalani/codes
flappy.cpp
#include<stdio.h> #include<stdlib.h> #include<GL/glut.h> #include<unistd.h> //Pipe int pipeSpawn[3] = { 300,500,700 }; int translatePipePos[3] = { 0,100,0 }; int pipeCollisionBox[3][4][2] = { { { 0,0 },{ 0,0 },{ 0,0 },{ 0,0 } },{ { 0,0 },{ 0,0 },{ 0,0 },{ 0,0 } },{ { 0,0 },{ 0,0 },{ 0,0 },{ 0,0 } } }; //Bird int wingR...
TOOL
0.976535
3.823552
f3ef63f1-1b42-4631-a80b-ac88adf26560
DorianPio/B-OOP-400-BDX-4-1-tekspice
src/components/C4030_xor.cpp
/* ** EPITECH PROJECT, 2021 ** B-OOP-400-BDX-4-1-tekspice-dorian.pio ** File description: ** C4030_xor */ #include "C4030_xor.hpp" nts::Tristate xor_gate(size_t state1, size_t state2) { if (state1 == 42 || state2 == 42) { return (nts::Tristate::UNDEFINED); } else if (state1 == state2) { return...
ALGO
0.890504
4.61357
fb56699b-3af6-4147-a8f0-e7b07aac09e9
Sagar73594/C-Tutuorials
22STL/26isSorted.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; void solve() { vector<int> arr = {1, 2, 3, 4, 5, 6}; if (is_sorted(arr.begin(), arr.end())) { cout << "true" << endl; } else { cout << "NO" << endl; } } int main() { ios:...
ALGO
0.998955
4.374661
f0f82846-bf52-4636-a274-d89a204376bd
ganeshalamuru/prg
atcoder/abc393/E_GCD_of_Subset.cpp
#include <bits/stdc++.h> using namespace std; #define fast ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); typedef long long ll;typedef long double ld;typedef pair<int,int> pii; #define F first #define S second #define PB push_back #define MP make_pair const ll mod = 1e9+7, N = 1e6+1, M = 2e6+7, INF = INT_MAX/10; ll po...
ALGO
0.999987
3.460939
0a64ec82-5f72-43e6-8843-b29889129aa9
Mulab11/cntt2016-hw1
TC-SRM-584-div1-900/syf.cpp
//============================================================================ // Author : Sun YaoFeng //============================================================================ //#pragma comment(linker, "/STACK:100240000,100240000") //#include <cstdio> //#include <cstdlib> //#include <cstring> //#include <...
ALGO
0.999569
3.505742
68d2823d-55d9-4f5e-ba1e-9164979ae3e9
ghugesachin0806/Data_Structure_n_Algorithm
12_Graph/27_Distance_nearest_cell_having_one_TLE.cpp
// https://practice.geeksforgeeks.org/problems/distance-of-nearest-cell-having-1-1587115620/1 // Here BSF will be used for step by step distance count. #include <bits/stdc++.h> using namespace std; class Solution { public: // Function to find distance of nearest 1 in the grid for each cell. int BSF(vector<ve...
ALGO
0.999975
5.935428
ad35010a-2cc0-4fc1-9101-3c8ad4e15055
Baryshev194/x-ray1.0007
xray/trunk/3rd party/boost/libs/utility/tie_example.cpp
#include <set> #include <algorithm> #include <iostream> #include <iterator> // std::distance // Note: tie() use to live in boost/utility.hpp, but // not it is part of the more general Boost Tuple Library. #include <boost/tuple/tuple.hpp> int main(int, char*[]) { { typedef std::set<int> SetT; SetT::iterator...
ALGO
0.977652
6.214447
befd43d3-4ea6-4c5f-a71c-ffe6f26f81ca
jayant-baid/DSA
First non-repeating character in a stream - GFG/first-nonrepeating-character-in-a-stream.cpp
//{ Driver Code Starts #include<bits/stdc++.h> using namespace std; // } Driver Code Ends class Solution { public: string FirstNonRepeating(string s){ int count[26]={0}; string ans=""; int nonrepeatingIndex=0; count[s[0]-'a']++; ans+=s[0]; ...
ALGO
0.999942
5.438123
95d28a53-43e3-47df-b6fe-2582c85c08b5
Hackeries/CP
Questions/B/borze.cpp
#include<bits/stdc++.h> using namespace std; int main(){ string s; cin >> s; for(int i=0;i<s.size();i++){ if(s[i] == '.'){ cout << "0"; } else if(s[i] == '-' && s[i+1] == '.'){ cout << "1"; i++; } else if(s[i]=='-' && s[i] == '-')...
ALGO
0.999918
3.41893