uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
456c9156-5f0f-47bd-80a5-2d4ca3f2b528
Winston0323/LOD_Generator
Final_Project/Spring.cpp
#include "Spring.h" //////////////////////////////////////////////////////////////////////////////// Spring::Spring(glm::vec3 center,glm::vec3 direction, GLfloat SConst, GLfloat RLength) { GLfloat offset = RLength / 2; this->pos1 = center + direction * offset; this->pos2 = center - direction * offset; this->spri...
ALGO
0.988217
4.306552
7a4c7305-2d68-4fa6-afc6-be721804ab9f
pavanpvl/cp_problems
codeforces/edu96/A.cpp
#include<bits/stdc++.h> #define DEBUG using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); #ifndef ONLINE_JUDGE freopen("/home/pavan/cp_problems/a.in","r",stdin); freopen("/home/pavan/cp_problems/a.out","w",stdout); #endif int t{}; cin>>t; int p[100...
ALGO
0.999382
3.435384
384019c2-82b9-40df-8b34-7aa00f59396c
Vlad104/Technopark_Algorithms
Modul_3/task5.cpp
#include <iostream> #include <vector> #include <set> #include <limits> const int inf = std::numeric_limits<int>::max()/2; //////////////////////////////////////////////////////////////////////////////////////////////////// class ListGraph { public: ListGraph(int vertices_count); void AddEdge(int from, int to, int...
ALGO
0.999826
4.671723
afef7108-7be1-4468-bfad-7847bb1cca1e
Narendra-Sivangula/DSA_CPP
Recursion/Print1ToNRecursion.cpp
#include<bits/stdc++.h> using namespace std; void printOneToN(int n){ if(n == 0) return; else{ printOneToN(n-1); cout<<n<<" "; } } int main(){ int n; cin>>n; printOneToN(n); return 0; }
ALGO
0.999184
4.826665
5dc24eb5-d317-436f-82d6-fef009f9ab63
ishandutta2007/codeforces
nyaan/normal/1148/A.cpp
#include <algorithm> #include <cassert> #include <cmath> #include <cstdarg> #include <cstdio> #include <cstring> #include <deque> #include <iomanip> #include <iostream> #include <iterator> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #include <v...
ALGO
0.999629
3.310901
8c7c2c49-e9b1-4cd8-8812-1aa3223c3499
rohitpatil825/cpp_programs
factorial.cpp
#include<iostream> using namespace std; int main() { long x,fact=1,i; cout<<"\n enter a no : "; cin>>x; for(i=1;i<=x;i++) { fact=fact*i; } cout<<"factorial of "<<x<<" is= "<<fact; return 0; }
ALGO
0.999869
3.395279
f00850fe-4cb2-412b-8c69-2a4677cc2d18
kamal-singh819/LeetCode
1791. Find Center of Star Graph/code.cpp
class Solution { public: int findCenter(vector<vector<int>>& edges) { unordered_map<int, vector<int>> adj; for(int i=0; i<edges.size(); i++){ int u = edges[i][0]; int v = edges[i][1]; adj[u].push_back(v); adj[v].push_back(u); } int adj...
ALGO
0.999753
5.557092
318fb967-5d74-4708-9422-1754969056f0
amanjain272002/c-
OperationsBinaryString.cpp
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; int n = s.length(); int a = s[0] - '0'; for (int i = 1; i < n; i++) { if (s[i] == 'A') { i++; a = a & (s[i] - '0'); } else if (s[i] == 'B') { ...
ALGO
0.999869
3.804568
e48bc1f8-b4be-4c49-88fd-560b134fb169
maxsofar/234218---wet2
UnionFind.cpp
// // Created by Max on 10/06/2023. // #include "UnionFind.h" UnionFind::UnionFind() : m_stack(nullptr), m_parent(nullptr) {} UnionFind::~UnionFind() { delete[] m_stack; delete[] m_parent; } void UnionFind::init(const int* m_recordStocks, int number_of_m_record) { delete[] m_st...
ALGO
0.999264
4.209081
c3ea460e-1d68-4cc9-8919-d9e6a03a2b67
1exx/xray-1
3rd party/boost/libs/graph/example/strong_components.cpp
#include <boost/config.hpp> #include <iostream> #include <vector> #include <boost/graph/strong_components.hpp> #include <boost/graph/adjacency_list.hpp> #include <boost/graph/graphviz.hpp> #include <boost/graph/graph_utility.hpp> /* Sample output: A directed graph: a --> b f h b --> c a c --> d b d --> e...
ALGO
0.996213
6.706331
076ae505-aec8-48f7-9af6-36f9c5a59cc3
anujajaya/cpp
HCFVoidfunction.cpp
#include<iostream> using namespace std; void hcffunction(){ int hcf,n1,n2; cout<<"enter the value of the n1"<<endl; cin>>n1; cout<<"enter the value of the n2"<<endl; cin>>n2; for(int i=1;i<=n2;i++){ if(n1%i==0 && n2%i==0){ hcf=i; } } cout<<"hfc = "<<hcf<<endl; } in...
ALGO
0.998334
3.363838
c164fdfa-aebf-4217-8062-7614ba064ce8
ishandutta2007/codeforces
gmusya/normal/1230/C.cpp
#include <iostream> #include <vector> #include <algorithm> using namespace std; int n, m; vector <int> a; vector <vector <bool>> g; vector <vector <int>> ans; int main() { cin >> n >> m; g.resize(7); ans.resize(7); for (int i = 0; i < 7; i++) g[i].resize(7); for (int i = 0; i < 7; i++) ans[i].resize(7); a.resiz...
ALGO
0.9998
3.745434
920150d8-6111-459e-8e88-27bd39f299d8
shahayushd/MyCPtemplate
Trie.cpp
#include <bits/stdc++.h> #define int long long using namespace std; class Trie { public: char data; Trie *ptr[26]; int word_end = 0; Trie() { for(int i=0;i<26;i++) ptr[i] = NULL; } Trie init() { Trie root; root.data = '_'; root.word_end = -1...
ALGO
0.999233
3.572446
389457be-aa84-4f56-8799-7abb3185d25d
Carlos-Segura/Ejercicios-C-
6. Matrices o Tablas/Ejercicio 7 de C++.cpp
/*7.Desarrollar un programa que determine si una matriz es simetrica o no. Una matriz es simetrica si es cuadrada y si es igual a su matriz transpuesta. |8 1 3| |8 1 3| |1 7 4| --> |1 7 4| |3 4 9| |3 4 9| */ #include<iostream> #include<conio.h> using namespace std; int main(){ int num[100][100],f...
ALGO
0.998893
3.833596
fa8b92be-3a62-49f4-83f7-9a4c12c0a52c
emonislive/learning-skills
CPS Academy - Basic to Intermediate Level Competitive Programming/Module 1 - Basic Programming & Problem Solving Techniques/Contest-2: Conditional Statement/N - All New CodeChef.cpp
#include <bits/stdc++.h> using namespace std; #define endl '\n' void solve(int old, int new_) { if (old < new_) cout << "Old" << endl; else if (old > new_) cout << "New" << endl; else cout << "Same" << endl; } int main() { ios::sync_with_stdio(false); cin.tie(NULL); in...
ALGO
0.999794
3.262529
d4f1ea60-48be-4022-87d1-4a49a47beed9
113bommy/deepmind_codecontests_refine
cpp_source_filter_file/cpp_train_9642_9.cpp
#include <bits/stdc++.h> using namespace std; int main(int argc, const char* argv[]) { int N; cin >> N; char s[101]; scanf("%s", s); int ct1 = 0, ct2 = 0; for (int i = 1; i < N; i++) { if (s[i] == 'F' && s[i - 1] == 'S') ct1++; if (s[i] == 'S' && s[i - 1] == 'F') ct2++; } if (ct2 > (ct1)) { ...
ALGO
0.999888
3.957735
65ec7866-d361-4ae0-85d3-c82b00481e3a
sency90/boj
11504.cpp
#include <stdio.h> #include <stdlib.h> int main() { int testN = 0; int n = 0; int m = 0; int x[9]; int y[9]; int cnt; int i=0, k=0; long long accx; long long accy; long long accch[110]={0}; int div; scanf("%d", &testN); for(k = 0; k<testN; k++) { cnt = 0; ...
ALGO
0.999738
3.405508
418fa9c1-0c6d-4c6c-b39c-c45d014ab90a
opengurukul/cpp-examples
chap08_console_io/set_func.cpp
#include <iostream> using namespace std; int main() { cout << "Right Justified - Default with width" << endl; cout.fill('#'); cout.width(5); cout << 12 << endl; cout << "Left Justified" << endl; cout.setf(ios::left, ios::adjustfield); cout.width(5); cout << 12 << endl; cout << ...
TOOL
0.865367
3.581458
f382d0e3-7e8f-4506-91e1-38b54757003b
VARUN-009/Dynamic-Programming
Delete-operations-to-make-two-string-equal.cpp
class Solution { public: int dp[1001][1001]; int memoisation(string &str1, string &str2, int len1, int len2) { // base case // agr aisa hua ki ek string ya dono hi string khatam ho gayi toh phir toh m check ni kar sakta na toh then phir return 0 if (len1 < 0 || len2 < 0) { ...
ALGO
0.999971
6.063577
80e1c09f-e1c0-4f1b-8dfa-ddebf61f6b9f
nong1029/study
SeqList.cpp
#include<iostream> using namespace std; struct SeqList { int *data; int maxsize; int length; }; void InitList(SeqList &L, int maxsize){ L.length=0; L.data = new int[maxsize]; L.maxsize = maxsize; } void IncreaseSize(SeqList &L, int len){ int *p = L.data; L.data = new int[L.maxsize + len]...
ALGO
0.999154
3.462319
8f179795-cd9f-4998-8a34-3a86a03c5081
xczhang07/leetcode
cpp/middle/01_matrix.cpp
class Solution { public: vector<vector<int>> updateMatrix(vector<vector<int>>& matrix) { int m = matrix.size(); int n = matrix[0].size(); if(m == 0 || n == 0) return matrix; queue<pair<int,int>> q; vector<pair<int,int>> dirs = {{-1,0},{1,0},{0,-1},{0,1}}; for(int i = ...
ALGO
0.999964
6.324335
0d1a3f46-8c47-4f77-9d8b-100d79223abf
mdzahidh/euglenatracer
opencv/samples/cpp/select3dobj.cpp
/* * * select3obj.cpp With a calibration chessboard on a table, mark an object in a 3D box and * track that object in all subseqent frames as long as the camera can see * the chessboard. Also segments the object using the box projection. This * program is useful for col...
TOOL
0.990481
5.843719
fa317925-fe70-439c-b53b-a2bc276866aa
113bommy/deepmind_codecontests_refine
cpp_gold_filter_file/cpp_train_12813_15.cpp
#include "cstdio" int main(){ int x,i; while(1){ scanf("%d",&x); i++; if (x==0) break; printf("Case %d: %d\n",i,x); } }
ALGO
0.980704
3.404926
4c629fb5-35d0-4506-925e-ea5920b09d25
Cheloveck322/Cave
C++ проекты/14chapterquizes/14-4.cpp
#include <iostream> #include <numeric> #include <limits> class Fraction { private: int m_numerator{ }; int m_denominator{ }; public: Fraction(int numerator=0, int denominator=1) : m_numerator{numerator}, m_denominator{denominator} {reduce(); } void print() const { std::cout ...
TOOL
0.978254
5.958265
6449c249-88d2-4fd0-adba-891bbd145d82
WhoIsGorynych/last
main.cpp
#include <stdio.h> #include "matrix_help.h" #include <iostream> #include <stdlib.h> #include "function_v1.h" int main(int argc, char** argv){ int N = -1; double **matrix_old; double **matrix_new; if(argc == 1){ printf("Hello!\n"); printf("1 - matrix from file ('in.txt')\n"); printf("2 - matri...
ALGO
0.994553
3.68123
157210ae-3538-4ed5-baaf-61a6bf466f39
artsking/frameworks_av_10.0.0_r33
media/libstagefright/httplive/M3UParser.cpp
//#define LOG_NDEBUG 0 #define LOG_TAG "M3UParser" #include <utils/Log.h> #include "M3UParser.h" #include <binder/Parcel.h> #include <cutils/properties.h> #include <media/stagefright/foundation/ADebug.h> #include <media/stagefright/foundation/AMessage.h> #include <media/stagefright/foundation/ByteUtils.h> #include <me...
TOOL
0.897226
6.459057
fd6e55bf-4b4c-4aec-93b8-780498d91c75
androidHarlan/ncnn
src/layer/groupnorm.cpp
#include "groupnorm.h" namespace ncnn { GroupNorm::GroupNorm() { one_blob_only = true; support_inplace = true; } int GroupNorm::load_param(const ParamDict& pd) { group = pd.get(0, 1); channels = pd.get(1, 0); eps = pd.get(2, 0.001f); affine = pd.get(3, 1); return 0; } int GroupNorm::loa...
DATA
0.926557
6.373437
b17debb2-f657-4b3a-90c0-933a18552cda
zshangGEO/gmsh
src/mesh/meshTriangulation.cpp
#include <utility> #include <list> #include <map> #include <unordered_map> #include "Context.h" #include "gmsh.h" #include "GModel.h" #include "GFace.h" #include "GEdge.h" #include "MLine.h" #include "MVertex.h" #include "MTriangle.h" #include "MQuadrangle.h" #include "meshTriangulation.h" #include "SBoundingBox3d.h" #...
ALGO
0.963653
5.412938
a59cb00d-d02a-4c2c-b2bf-b81c9a79d6e2
Meet118/LeetCode
1每日一题/LeetCode29.cpp
class Solution { public: int divide(int x, int y) { if (x == INT_MIN && y == -1) return INT_MAX; bool f = false; if (x > 0 && y < 0 || x < 0 && y > 0) f = true; if (x > 0) x = -x; if (y > 0) y = -y; vector<int> a; a.push_back(y); ...
ALGO
0.999977
5.298819
41b80cad-4cae-4cc3-9082-6ac737ad6d9c
Vanslashington/algorithm-problem-solutions
UVa/theDecoder.cpp
#include <iostream> #include <map> #include <cstring> using namespace std; int main() { string s; while(getline(cin, s)) { for(int i = 0; i < s.length(); ++i) { cout << char(s[i] - 7); } cout << endl; } return 0; }
ALGO
0.994253
3.690631
c926eef3-5b89-4fb4-95dc-982e30a262ae
DungNguyenCoder/THCS2_PTIT
C04038.cpp
#include <stdio.h> #include <stdlib.h> int cmp(const void *a, const void *b) { return *(int*)a - *(int*)b; } int main() { int n; scanf("%d",&n); int a[n],b[n]; for (int i = 0; i < n; i++) { scanf("%d",&a[i]); b[i] = a[i]; } qsort(b,n,sizeof(int),cmp); int index = 0; ...
ALGO
0.999998
3.130564
eb77e7f2-8801-48f3-bc06-e5f3cd2a5c67
noobie7/CodeBank
AtCoder/abc199/A.cpp
/* "An anomaly, I'm Muhammad Ali Cause I know one day I'm gonna be the" - Greatest, Eminem */ #pragma GCC optimize ("O3") #pragma GCC target ("sse4") #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; typ...
ALGO
0.999962
3.930156
0802bfad-b4ee-4046-b4ec-f217e7b6333c
edsomjr/TEP
Upsolving/OBI/2013_F1_JR_Tomadas/codes/solution.cpp
#include <iostream> using namespace std; int main() { int T1, T2, T3, T4; cin >> T1 >> T2 >> T3 >> T4; auto ans = T1 + T2 + T3 + T4 - 3; cout << ans << "\n"; return 0; }
ALGO
0.999267
3.93934
f8857372-8ea1-41c7-93e2-297d14b490db
nodejs/perfetto-nodejs-wip
deps/icu-small/source/i18n/collation.cpp
#include "unicode/utypes.h" #if !UCONFIG_NO_COLLATION #include "collation.h" #include "uassert.h" U_NAMESPACE_BEGIN // Some compilers don't care if constants are defined in the .cpp file. // MS Visual C++ does not like it, but gcc requires it. clang does not care. #ifndef _MSC_VER const uint8_t Collation::LEVEL_SEP...
TOOL
0.946767
7.071237
5bd15ef1-0c58-4e72-9095-6f40a1943404
3013216006/ACM
17-8-22/10.cpp
#include <iostream> using namespace std; int main(){ int T; scanf("%d",&T); while(T--){ scanf("%s%s",&s,&s1); int l=strlen(s); while(!Q.empty()) Q.pop_front(); while(!Q1.empty()) Q1.pop_front(); Q.push_back(Node(s[0],1,0)); Q1.push_back(Node(s1[0],1,0)); for(int i=1;i<l;i++){ if(s[i]==Q.back().x) Q...
ALGO
0.997535
3.08709
c145299f-0caa-4454-8a4c-25a283ceef13
raincross7/code-similarity
codes/train_code/problem009/problem009_97.cpp
#include<bits/stdc++.h> using namespace std; int main(void){ int n,m; cin>>n>>m; vector<int> c(n); vector<vector<int>> a(n,vector<int>(0)); for(int i=0; i<m; ++i){int p,q; cin>>p>>q; a[p-1].push_back(q-1); a[q-1].push_back(p-1);} vector<bool> d(n,false); queue<int> que; que.push(0); while(true){ int p...
ALGO
1
3.760019
41cc1ee8-8622-4a12-8856-26fff7d6403c
Ahmedmeid99/programming-fundamentals-by-c-
07-Algorithmes-problemSolving_v4/09-solving_59-64/solving_59-64.cpp
#include <iostream> #include <string> #include <vector> #include "../../00-MyLibrary/numbers.cpp" using namespace std; struct stDate { short Day; short Month; short Year; }; string DayName(stDate Date) { string DaysName[7] = {"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"}; short a = abs((14 - D...
ALGO
0.992835
3.901808
6a835809-88ab-4e03-96e7-7c97cc0a957c
jpd002/Play-Dependencies
unrarsrc-5.2.5/unrar/rs16.cpp
#include "rar.hpp" // We used "Screaming Fast Galois Field Arithmetic Using Intel SIMD // Instructions" paper by James S. Plank, Kevin M. Greenan // and Ethan L. Miller for fast SSE based multiplication. // Also we are grateful to Artem Drobanov and Bulat Ziganshin // for samples and ideas allowed to make Reed-Solomon...
ALGO
0.998243
4.700583
7573670f-61bb-4c4a-9c6e-fc042b4fe34f
Nilanjana02/DSA_C_C-_programe
Decimal to binary.cpp
//Decimal to binary #include<stdio.h> #include<conio.h> #include<math.h> int main () { int n,r,s=0,i=0; printf("Enter a decimal number"); scanf("%d",&n); while(n!=0) { r=n%2; s=s+r*pow(10,i); i++; n=n/2; } printf("The binary equivalent is %d",s); return 0; }
ALGO
0.999733
3.618606
a6109e07-4ed3-427c-a6cc-d1e1da10ad34
sarvex/leetcode-s
solution/2100-2199/2171.Removing Minimum Number of Magic Beans/Solution.cpp
class Solution { public: long long minimumRemoval(vector<int>& beans) { sort(beans.begin(), beans.end()); long long s = accumulate(beans.begin(), beans.end(), 0ll); long long ans = s; int n = beans.size(); for (int i = 0; i < n; ++i) ans = min(ans, s - 1ll * beans[i] * (n - i...
ALGO
0.999984
5.686555
63dd057a-2537-4c24-96eb-e8d39785c0dc
javagovindsharma/leetscode
solution/1600-1699/1653.Minimum Deletions to Make String Balanced/Solution2.cpp
class Solution { public: int minimumDeletions(string s) { int ans = 0, b = 0; for (char& c : s) { if (c == 'b') { ++b; } else { ans = min(ans + 1, b); } } return ans; } };
ALGO
0.999577
5.867014
69b8353e-705e-4f4c-af86-6802a1357c27
BhishamGahlaut805/C_CPP_DSA_Algorithms
DSA_QUESTIONS/28_LongestCommon_Subsequence.cpp
#include<iostream> #include<vector> #include<algorithm> // For min() #include<climits> // For INT_MAX using namespace std; int LCS_Recursive(string s1, string s2, int i, int j){ if(i == s1.length() || j == s2.length()){ return 0; } if(s1[i] == s2[j]){ return 1 + LCS_Recursive(s1, s2, i+1, j...
ALGO
0.999893
6.054957
96ef5099-b310-45c3-a294-6b38b40e2c69
UChicagoInterviewPrep/winter2015
jan21/beginner/pow_optimized.cpp
/* * optimizing pow for tail recursion, time complexity, * and possible overflows */ #include <iostream> using namespace std; /* * pow is now O(log2(n)) */ long pow_work(long base, long power, long current) { if (power <= 0) { return current; } if (power % 2 == 0) { return pow_work(base * base,...
ALGO
0.999703
6.635474
e9ea1985-b25c-4899-b2a0-e2aa63eeb69b
Rainboylvx/bookData
算法篇/数据结构/并查集/code/template.cpp
template<int size> struct DisjointSet { int fa[size+5]; DisjointSet() { for(int i=0;i<=size+4;++i) fa[i] = i; } int find(int u){ if( u == fa[u]) return u; return fa[u] = find(fa[u]); } inline void un(int u,int v){ fa[find(u)] = find(v); } };
ALGO
0.999166
4.319868
132788f6-65c0-4cd3-8009-82a57ff2b890
Prince9g/Leetcode-Submissions
0437-path-sum-iii/0437-path-sum-iii.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.999972
6.296735
9c783261-25e5-46b9-9209-fcb78c492f1e
yaroslavsadin/leetcode-solutions
1143_longest_common_subsequence/main.cpp
#include <vector> #include <string> #include <iostream> #include <algorithm> #include <unordered_map> #include <map> #include <optional> class Solution { public: int longestCommonSubsequence(std::string text1, std::string text2) { std::vector<std::vector<int>> dp_matrix(text1.size() + 1,std::vector<int>(te...
ALGO
0.999629
6.077887
c4e1a35c-c463-4d1a-8f32-388c1ce42a4c
Ma-Eltohamy/DS-playGround
SLLHomeWork/Easy/03_delete_front.cpp
#include <algorithm> #include <assert.h> #include <iostream> #include <sstream> #include <vector> using namespace std; struct Node { int data; Node *next; Node(int data) : data(data) {} ~Node() { std::cout << "Destroy value: " << data << " at address " << this << '\n'; } }; class LinkedList { private: ...
TEST
0.968256
5.332263
04c5571f-d5b8-45f9-bd07-4519cf9822f6
Swapnil1163github/cpp
Hybrid_Inheritance.cpp
//HYBRID INHERITANCE #include<iostream> using namespace std; class A { private: int a,b; public: int add(int x, int y) { return x+y; } }; class B: public A { private: int a,b; public: int sub(int x, int y) { return x-y; } }; class C: public A { priv...
TOOL
0.857015
4.613781
78ad0302-ce13-410d-8123-e61a39526cfb
j00v/solidus-coin
src/rpc/masternode.cpp
#include "activemasternode.h" #include "db.h" #include "init.h" #include "main.h" #include "masternode-payments.h" #include "masternode-sync.h" #include "masternodeconfig.h" #include "masternodeman.h" #include "netbase.h" #include "rpc/server.h" #include "utilmoneystr.h" #include <univalue.h> #include <boost/tokenize...
WEB
0.97451
5.910233
b543e888-c4b4-4a48-8755-c511f37c6510
qiiingc/2020.3-PAT
TestPAT/TestPAT/1150.cpp
#include "0.h" int n,m,k,u,w,c; int G[maxn][maxn]; int main(){ freopen("/Users/ching_shing/Documents/SJTU/ky/PAT顶级/PAT-GitHub/2020.3-PAT/TestPAT/TestPAT/1150.in","r", stdin); cin>>n>>m; for(int i=0;i<m;i++){ scanf("%d %d %d",&u,&w,&c); G[u][w]=G[w][u]=c; } cin>>k; int sp=1,sd=999...
ALGO
0.999954
3.923244
4e06feff-2f0e-4389-973a-8cfddb8c977d
Azeved00/CPProblems
Atcoder/235/D.cpp
/* COMPLEXITY(big O): time: space: DESCRIPTION: */ #include <iostream> #include <string.h> #define ll long long #define u unsigned #define nl std::endl #define MAX(x, y) (x > y ? x : y) #define MIN(x, y) (x > y ? y : x) #define MAXN 1000000000 int a, n; bool done[MAXN]; int swich(int t) { ...
ALGO
0.999093
3.848111
8e46c163-176c-40b2-b6ff-961d9fbf420b
jash139/leetcode_solutions
C++/convert-sorted-list-to-binary-search-tree.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) {} * }; */ /** * Definition for a binary tree node. * struc...
ALGO
0.999996
6.249225
016757c3-732c-4cbb-a2e1-abe584073aed
ishandutta2007/codeforces
sonechko/normal/455/C.cpp
#include<bits/stdc++.h> using namespace std; const int N = 3e5 + 11; #define pb push_back int glava[N],maxdist[N],sum[N]; int gg,use[N],dd,KOR; vector<int> v[N]; void dfs(int l, int r) { sum[gg]++; use[l]=1; glava[l]=gg; if (r>dd) {dd=r; KOR=l;} for (int j=0; j<v[l].size(); j++) if (use[v[l...
ALGO
0.999938
3.999277
9b07676a-c768-4a8a-9045-d55f479b11ba
rabelhmd/LeetCode
2903-find-indices-with-index-and-value-difference-i/2903-find-indices-with-index-and-value-difference-i.cpp
class Solution { public: vector<int> findIndices(vector<int>& nums, int indexDifference, int valueDifference) { int len = nums.size(); for(int i = 0; i < len; i++) { for(int j = 0; j < len; j++) { if(abs(i - j) >= indexDifference and abs(nums[i] - nums[j] >= valueDifferen...
ALGO
0.999989
5.563053
ad5b06ab-23b2-448d-8039-f1771991feb4
andrew-canada/competitive-programming
aops/lect2/p2/2-2-sol.cpp
#include <bits/stdc++.h> using namespace std; #define MAX_N 100000 typedef struct {vector<int> out; vector<int> in; int component; bool visited;} vdata; typedef int node; // graph[0] is unused vdata graph[MAX_N+1] = {}; vector<node> l; int totalComponents = 0; void visit(node u) { if (!graph[u].visited) { gra...
ALGO
0.999943
5.800642
9630fdf6-6643-4b53-95b0-b903d2239bda
manikanta2901/ubuntu
.history/practice/cpp/Codechef/DeltaAndShops_20200902134227.cpp
#include<bits/stdc++.h> #include<vector> #include<iostream> #include<cmath> #include<algorithm> #include<iterator> #include<string> #include<map> #define vv vector #define F first #define S second #define MP make_pair #define EXECUTE_FASTER ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); #define printM...
ALGO
0.992393
3.465659
352391b8-e87e-4f00-a81f-c255bf0b4e3f
wangtongxue-369/xcpc_Code_file
file/hduoj/dingpa_spring_race/2/1004.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long #define ull unsigned long long #define INF 0x3f3f3f3f #define PII pair<ll, ll> const ll mod = 1e9 + 7; const ll MAXN = 500005; const ll base1 = 131; const ll base2 = 127; ll _ = 1, n, m, ans = 0, a[MAXN], f[MAXN]; void solve() { string s, k; ci...
ALGO
0.999835
4.816853
8d4e92ec-d427-4c30-8379-ea27ea84e55a
FrankenRomP/android_frameworks_av
media/libstagefright/Utils.cpp
//#define LOG_NDEBUG 0 #define LOG_TAG "Utils" #include <utils/Log.h> #include <ctype.h> #include <stdio.h> #include <sys/stat.h> #include <utility> #include <vector> #include "include/ESDS.h" #include "include/HevcUtils.h" #include <cutils/properties.h> #include <media/openmax/OMX_Audio.h> #include <media/openmax/O...
TOOL
0.862798
3.316542
e5d988a2-5b90-4a04-9977-9fe023348934
VulpesCorsac/Leetcode
0221. Maximal Square - Medium/solution.cpp
static auto _ = [] () { ios_base::sync_with_stdio(false); cin.tie(nullptr); return 0; } (); class Solution { public: int maximalSquare(vector < vector < char > >& matrix) { if (matrix.empty()) { return 0; } const int n = matrix.size(); const int m = matrix[0].size(); ...
ALGO
0.999639
6.168602
f74e96a2-074f-4e10-a069-802de365deac
hzqsec/PRACTICE2022
summer/guibin.cpp
#include <iostream> using namespace std; const int maxn = 100; void merge(int num[], int L1, int R1, int L2, int R2) { int left = L1, right = L2; int temp[maxn], index = 0; while (left <= R1 && right <= R2) { if (num[left] <= num[right]) temp[index++] = num[left++]; else temp[index++] = num[ri...
ALGO
0.999985
4.332159
a332a9bd-ef4b-4bba-bd98-05f63319cb77
syohex/aizu_online_judge
Volume00/0009/main.cpp
#include <iostream> #include <vector> #include <cstdint> int main() { int64_t n; while (std::cin >> n) { std::vector<bool> primes(n + 1, true); int ret = 0; for (int64_t i = 2; i <= n; ++i) { if (!primes[i]) { continue; } ++ret; ...
ALGO
0.999923
5.3598
d2bfb6ca-ff40-4096-aeba-246e1ff5811d
FGHIRZ/Hydradrone
libraries/AP_AHRS/AP_AHRS_DCM.cpp
/// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- #include "AP_AHRS.h" #include <AP_HAL/AP_HAL.h> extern const AP_HAL::HAL& hal; // this is the speed in m/s above which we first get a yaw lock with // the GPS #define GPS_SPEED_MIN 3 // the limit (in degrees/second) beyond which we stop i...
TOOL
0.863497
4.518695
440661d6-67e5-4010-981f-adc1baf16718
mateusur/Advent_of_code_2020
Day02/Day02/main.cpp
#include <algorithm> #include <iostream> #include <fstream> #include <numeric> #include <sstream> #include <vector> using namespace std; void read_from_file(const string& filename, stringstream& buffer) { ifstream file(filename); if (file) { buffer << file.rdbuf(); file.close(); } } int part...
ALGO
0.992754
5.105467
fd7ddbc2-58b8-42f5-8c83-3a86a056e8f9
florianabel/healthcare-code-challenge
healthcare-code-challenge/healthcare-code-challenge/eigen_3.3.7/unsupported/doc/examples/MatrixFunction.cpp
#include <unsupported/Eigen/MatrixFunctions> #include <iostream> using namespace Eigen; std::complex<double> expfn(std::complex<double> x, int) { return std::exp(x); } int main() { const double pi = std::acos(-1.0); MatrixXd A(3,3); A << 0, -pi/4, 0, pi/4, 0, 0, 0, 0, 0; std::...
ALGO
0.999255
4.353816
822b19bc-fb6d-4da0-ac0e-61f7c10dbf80
RamaraRaghu/Program_Data_Representation_class
lab11work/testfolder/traveling.cpp
#include <iostream> #include <stdio.h> #include <stdlib.h> #include <algorithm> using namespace std; #include "middleearth.h" float computeDistance (MiddleEarth &me, string start, vector<string> dests); void printRoute (string start, vector<string> dests); int main (int argc, char **argv) { // check the number ...
ALGO
0.999922
5.081331
6a8c2e81-7535-4caf-9bcb-39ea4ccb3207
aokblast/LeetCode_Problem_Solving
Eazy/942_DI_String_Match.cpp
class Solution { public: vector<int> diStringMatch(string s) { int min = 0, max = s.length(); vector <int> result; for (auto &c : s){ if (c == 'D'){ result.push_back(max--); } else result.push_back(min++); } result.push_back...
ALGO
0.999663
6.43622
c35c37dd-b3ac-4bf7-b9a6-032645bd5fc4
SanthoshBala/protein-modules
lib/cgal/examples/Circular_kernel_3/functor_has_on_3.cpp
#include <CGAL/Exact_spherical_kernel_3.h> #include <CGAL/Random.h> typedef CGAL::Exact_spherical_kernel_3 Spherical_k; typedef CGAL::Point_3<Spherical_k> Point_3; typedef CGAL::Circular_arc_3<Spherical_k> Circular_arc_3; int main() { int n = 0; Circular_arc_3 c = Circular_arc_3(Point_3(...
ALGO
0.944574
4.346195
88ead164-57d9-4db0-a949-97457b514569
Qbase-Foundation/QBase-Core
src/rpcclient.cpp
#include "rpcclient.h" #include "rpcprotocol.h" #include "util.h" #include <set> #include <stdint.h> #include <boost/algorithm/string/case_conv.hpp> // for to_lower() #include <univalue.h> using namespace std; class CRPCConvertParam { public: std::string methodName; //! method whose params want conv...
CONFIG
0.983475
6.954901
1f154a2c-4bbf-424b-a394-66151351df19
Chesterwongz/CppProject
Team12/Code12/src/spa/src/pkb/readers/relation_reader/proc_to_proc/ProcToProcReader.cpp
#include "ProcToProcReader.h" std::vector<std::string> ProcToProcReader::getDirectP1ByP2( const std::string& proc2) { return ReaderUtils::readStrStore( proc2 != common::WILDCARD_PROC && !store.hasDirectAncestors(proc2), [proc2, this]() { return proc2 == common::WILDCARD_PROC ? store.getDirect...
TOOL
0.853205
6.235562
8b4b22b4-d294-4a5d-94c2-b1f719d1c9f6
A01367213/Mis-Programas
TC1031/vectores2.cpp
#include <iostream> #include <vector> using namespace std; void imprime(vector<int> v){ for (int i=0 ; i<v.size(); i++){ cout<<v[i]<<" "; } cout<<endl; } int main (){ vector<int> arreglo; arreglo.push_back(-1); imprime(arreglo); arreglo.push_back(1); imprime(arreglo); arreglo.push_back(4); imprime(...
ALGO
0.992663
4.043257
3f2566ec-c2cd-4875-9ea2-34af30247d6c
thanhdat317/code-c-ptit
c04026.cpp
#include<stdio.h> int main(){ int A[105]; int n; scanf("%d", &n); for(int i = 0 ; i < n; i++){ scanf("%d", &A[i]); } for(int i = 0 ; i< n-1; i++){ for(int j = i+1; j< n; j++){ if(A[i]> A[j]){ int temp = A[ i]; A[i]= A[j]; A[j]= temp; } } printf("Buoc %d: ",i+1); for(int i = 0 ; i< n; i...
ALGO
0.999808
3.336674
f49076e9-dfc0-47b2-9850-31e42fe21997
ishandutta2007/codeforces
brobat/normal/1195/B.cpp
// https://codeforces.com/problemset/problem/1195/B #include <bits/stdc++.h> #define forn(i, n) for (int i = 0; i < int(n); i++) using namespace std; #define MAXN 1000000000 long long n, k; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); cout.precision(numeric_limits<dou...
ALGO
0.999875
3.403691
1a6c0fc6-5418-4125-b007-0daa6f2c2e53
vishalhandoo/Prac_Cpp
7pm/prac_03.cpp
#include<bits/stdc++.h> using namespace std; int main(){ int userInput=422; int sum=0; int rem; while(userInput!=0){ rem=userInput%10; sum=sum+rem; userInput=userInput/10; } cout<<sum; return 0; }
ALGO
0.999198
3.954719
315cf072-e2e1-4a7f-b7c1-233bcdbd9734
vivekkushwaha373/collection-of-all-Cpp-codes-part-3
bubblesort.cpp
#include<iostream> using namespace std; swap(int *a,int *b) { int temp; temp=*a; *a=*b; *b=temp; } bubblesort(int arr[],int size) { int flag=0; for(int j=0;j<size-1;j++) { flag=0; for(int i=0;i<size-1-j;i++) { if(arr[i]>arr[i+1]) { swap(&arr[i],&arr[i+1]); flag=1; } } if(flag==0) break; } }...
ALGO
0.999918
4.815578
9286d733-c339-493a-852a-df55aacda286
qlcal/qlcal-r
src/ql/time/calendars/italy.cpp
/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ #include <ql/time/calendars/italy.hpp> #include <ql/errors.hpp> namespace QuantLib { Italy::Italy(Italy::Market market) { // all calendar instances on the same market share the same // implementation instance ...
TOOL
0.915813
6.102225
1643c026-f80d-40bb-a769-599c73cd9f75
jaryapp/-PS-algorithm-study
Baekjoon/1931_회의실배정.cpp
#include <iostream> #include <algorithm> #include <vector> #include <stack> using namespace std; vector<pair<int,int>> schedule; stack<pair<int,int>> room; bool compare(pair<int,int> A, pair<int,int> B){ if(A.first == B.first){ return A.second < B.second; } return A.first < B.first; } int main() { int N; ...
ALGO
0.999947
4.057532
432e8537-7400-42f3-96b7-653cffb0ee3a
magicmoo/codeforces
#720div2/D.cpp
#include<cstdio> #include<cstring> #include<algorithm> #include<iostream> #include<string> #include<vector> #include<stack> #include<bitset> #include<cstdlib> #include<cmath> #include<set> #include<list> #include<deque> #include<map> #include<queue> using namespace std; #define CAS int CASE; \ cin>>CASE; \...
ALGO
0.999673
3.946499
0bfb8db0-6bf3-40bd-950f-76182cd23644
Airono/ifmo_programming
work2/work2_task2_3.1/main.cpp
#include <iostream> #include <cmath> using namespace std; int main() { double x, x1, x2,y; cout << "x1 = "; cin >> x1; cout << "x2 = "; cin >> x2; cout << "\tx\tsin(x)\n"; x = x1; while (x <= x2) { y = sin(x); cout << "\t" << x << "\t" << y << endl; x = x + 0.0...
ALGO
0.970919
3.757062
773b8638-64e9-4a57-90f1-8feea06ca5ea
Laxmikant-Dwivedi/Codeing2023
oddindices.cpp
int oddcells(int m, int n, vector<int>& indices) { vector<vector<int,int>> matrix(m,vector<int> (n,0)); int cnt = 0; for(int i=0; i<indices.size(); i++) { for(int j=0; j<matrix.size(); j++) ++matrix[indices[i][0]] [j]; for(int j=0; j<matrix.size(); j++) ++mat...
ALGO
0.999721
5.153968
f09f7eac-a9fd-44b0-8b00-576adecec071
jakub-kaminski/coding-challenges
DP/DPX-SubsequenceSumEqualsK.cpp
// QUESTION NAME: DPX-Subsequence Sum Equals K // DESCRIPTION: check if there exist a subsequence in a vector of ints that adds up to a target. // vector has only positive numbers // APPROACH: // Recursion, DP // FUNCTION NAME: solve #include <catch2/catch_all.hpp> #include<bits/stdc++.h> using namespace std; //ht...
ALGO
0.999899
6.252678
627d466f-bb66-485b-9ea7-df6f7476e508
VentureROM-L/android_external_skia
src/gpu/GrOvalRenderer.cpp
#include "GrOvalRenderer.h" #include "GrEffect.h" #include "gl/GrGLEffect.h" #include "gl/GrGLSL.h" #include "gl/GrGLVertexEffect.h" #include "GrTBackendEffectFactory.h" #include "GrDrawState.h" #include "GrDrawTarget.h" #include "GrGpu.h" #include "SkRRect.h" #include "SkStrokeRec.h" #include "SkTLazy.h" #include ...
TOOL
0.932154
6.691446
b96ae568-63c0-409d-8c39-76d778c377c2
gopal-panigrahi/Leetcode
Easy/Search In A Binary Search Tree/SearchInABinarySearchTree.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.999992
6.369361
ea19540e-9219-49c5-a108-c2f9285fea9d
HourunLi/Leetcode
SourceCode/UnionFind/0765_Couples_Holding_Hands.cpp
#include<bits/stdc++.h> using namespace std; class UnionFind { private: int size; int *arr; public: UnionFind(int size) : size(size) { arr = new int[size]; for(int i = 0; i < size; i++) { arr[i] = i; } } int find(int x) { if(x != arr[x]) { arr[x] = find(arr[x]); } return...
ALGO
0.999995
5.344342
515453ba-e77c-4c1f-bed9-a1669c82b088
wangzy0327/Leetcode-Practice
leetcode_0677/cpp/leetcode_0677.cpp
// // Created by wzy on 2022/4/24. // #include<iostream> #include<queue> #include<vector> #include <algorithm> #include <unordered_map> #include <unordered_set> #include <list> #include <deque> #include <stack> #include <sstream> #include <typeinfo> #include <climits> #include <random> #include <ctime> using namespac...
ALGO
0.99995
5.884967
46a966fb-aa4f-47ba-9785-1f2af8a86eeb
Abubakarwarraich21/pfassign
Arrays/index of maximum value in array.cpp
//5. Write a program to ask user to enter 5 numbers in a array, and find the index of maximum value in array #include <stdio.h> int main() { int numbers[5]; printf("Enter 5 numbers: "); for (int i = 0; i < 5; i++) { printf("Number %d: ", i + 1); scanf("%d", &numbers[i]); ...
ALGO
0.999597
4.374814
9b88411a-467e-4141-8eee-3e45f487a729
heinrich0hartmann/Info_1_Semester
Programmierübungen/B.4.6_Felder.cpp
#include<iostream> #include<cmath> using namespace std; int main() { //Integrieren Messwerte const int GROESSE{ 10 }; //Anzahl Messwerte int i1; double WERTE[GROESSE] = { 99.975, 100.002, 99.999, 99.982, 100.100, 100.009, 99.826, 100.547, 100.023, 100.008 }; //Messwerte cout << "Messwerte [m]" << endl; cout <<...
ALGO
0.99585
3.5209
78f1bbf0-5a26-4285-a4b4-6b1147950167
ArturoGomezGz/AlgoritmosCpp
S3/Actividades/Arturo/4.2/MyGraph.cpp
#include "MyGraph.h" // Constructor que inicializa el grafo con una matriz de adyacencia // Complejidad: O(n^2) MyGraph::MyGraph(vector<vector<int>>& matriz) { this->size = matriz.size(); this->nodes.resize(size); this->matriz = matriz; loadGraph(); } // Destructor del grafo // Complejidad: O(1) MyGra...
ALGO
0.996479
4.852867
37c71553-a550-47b7-87b2-0a811ae527f8
LeeYJ2147/BOJ
C++/10250_ACM_호텔.cpp
#include <stdio.h> int main() { int TestCase, h, w, n; scanf("%d", &TestCase); for(int i=0; i<TestCase; i++) { scanf("%d %d %d", &h, &w, &n); if(n%h) printf("%d\n", (n%h)*100+(n/h+1)); else printf("%d\n", h*100+(n/h)); } return 0; }
ALGO
0.999338
3.502832
eba4cd2c-a316-463a-ad3c-9d9410eda2d6
YuDe0418/Cpp_practice
ZeroJudge/D/071.cpp
#include <bits/stdc++.h> using namespace std; signed main(void) { int y; while(cin >> y) { cout << (((y % 4 == 0) && (y % 100 != 0)) || (y % 400 == 0) ? "a leap year" : "a normal year") << "\n"; } }
ALGO
0.999516
3.603641
498c322b-1909-4f71-ba52-8af895f30f1b
euav/focss
src/focss/processing/modulation.cpp
#include "modulation.h" #include <algorithm> #include <cassert> #include <random> #include "focss/field.h" #include "focss/functions.h" namespace focss { const complex_t gray_symbols_16qam[16] = { complex_t(-3.0, -3.0) / sqrt(10.0), complex_t(-1.0, -3.0) / sqrt(10.0), complex_t(3.0, -3.0) / sqrt(10.0), comple...
ALGO
0.99908
5.618565
deb477c8-c760-49d5-b46e-119e7292eeea
apl-mhd/problemSolving
Data Structure and Algo Lab/dijkstra.cpp
#include <iostream> #include <cstdio> #include <stack> #include <queue> #include <algorithm> #include <vector> #define MAX_SZ 100 #include <climits> using namespace std; //graph /* 5 10 0 1 10 0 3 5 1 2 1 1 3 2 2 4 4 3 1 3 3 2 9 3 4 2 4 0 7 4 2 6 */ int n,m; vector< vector< pair<int, int> > >adj; void print_graph()...
ALGO
0.999987
4.055666
61f38498-a2e6-44ee-8612-8fc7c8dcaf32
misima49/LeetCode-Solutions
174-dungeon-game/174-dungeon-game.cpp
class Solution { int findPath(int r, int c, vector<vector<int>>& dungeon, vector<vector<int>>& dp) { int m = dungeon.size(); int n = dungeon[0].size(); if(r == m-1 && c == n-1) return dungeon[r][c]; if(r == m) return -1e8; if(c == n) return -1e8; if(dp[r][c] ...
ALGO
0.999839
6.264236
fd53ac7b-aba9-4418-a765-599d607ff166
mharrish7/LEETCODE_SHEET_PROGRESS
C++/Greedy/medium/1647.MinDelToMake.cpp
class Solution { public: int minDeletions(string s) { unordered_map<char,int> hast; for(auto x : s){ if(hast.find(x) != hast.end()){ hast[x] +=1; } else{ hast[x] = 1; } } set<int> v; in...
ALGO
0.999956
5.919128
47e350cf-63c0-4900-acdd-bd69e7ff38a4
hardeepsingh34/CPlusPluscodes
programd56.cpp
// this code is not valid (failure) skip this #include<iostream> #include<vector> using namespace std; void printArr(vector<int>arr, int n){ for(int j=0; j<n; j++){ cout<<arr[j]<<" "; }cout<<endl; } vector<int> spiralprint(vector<vector<int>>v , int rows, int columns){ cout<<v.size()<<endl;; co...
ALGO
0.999922
3.985584
e208d372-f80d-44c7-b77e-c5028a31c6bb
mark-by/techno_algo_2
task2/main.cpp
#include <iostream> #include <vector> #include <stack> template<class T> struct DefaultComparator { bool operator()(T &l, T &r) { return l < r; } }; template<class Key, class Comparator = DefaultComparator<Key>> class Tree { struct Node { Key key; Node *left; Node *right; ...
ALGO
0.999941
5.388804
1f95efb3-0f89-49f4-ac30-fdd00bed6f24
Raajzz/leetcode-dsa
0516-longest-palindromic-subsequence/0516-longest-palindromic-subsequence.cpp
class Solution { public: // I think the longest palindromic subsequence would be the longest common subsequence between that string and the reverse string int recursion(int index1, int index2, string s1, string s2, vector<vector<int>> &dp){ if(index1 <= 0 || index2 <= 0){ retur...
ALGO
0.999944
6.397867
6a9ee986-53aa-4773-8816-bcf2b9f1c4fc
Pradip-Kathiriya/Program-Flow-And-Control-Box-Filling-Algorithm-Cpp
Assignment_1.cpp
/** * @file Assignment_1.cpp * @author Pradip (<EMAIL>) * @brief RWA1 : Program Flow Control and Function * @version 0.1 * @date 2021-09-29 * * @copyright Copyright (c) 2021 * */ #include<iostream> #include<string> /** * @brief to check wether the input is positive integer or not * * @param s * @retur...
TOOL
0.970629
3.785575
8bfe0cce-2289-4b55-91f0-aeba9ba95fc6
timofeykt/StudentCppRevisionTask04Project
StudentCppRevisionTask04Project/task01.cpp
#include "tasks.h" /* Task 01. Desks [рабочие столы] * * В Академии решили набрать три новых группы и * оборудовать аудитории для них новыми рабочими столами. * За каждым столом может сидеть только два учащихся. * Известно количество учащихся в каждой из трёх групп. * Высчитайте наименьшее число рабочих столов, которо...
ALGO
0.9992
5.112269
f092fda4-db64-4b59-9687-2beab88dd327
aadarshahebsingh/DSA-Problems-starting-21st-March
A. Make it Beautiful.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<ll> vi; void solve() { int n; cin >> n; vector<int> arr; for (int i = 0; i < n; i++) { int x; cin >> x; arr.push_back(x); } if(arr[0]==arr[n-1]){ cout<<"no\n"; return; ...
ALGO
0.999931
4.330412
3dad5718-39d8-4201-836a-bd9af7d52de2
Nikitiwe/Leetcode
1002-maximum-width-ramp/1002-maximum-width-ramp.cpp
class Solution { public: int maxWidthRamp(vector<int>& nums) { vector<int> l, lid; int m=60000; for (int i=0; i!=nums.size(); i++) { if (m>nums[i]) { m=nums[i]; l.push_back(m); lid.push_back(i); } ...
ALGO
0.999959
6.161184