uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
49cc4c51-9b89-4354-adc4-f3a5cb6c2d96
BlissOS/platform_frameworks_av
media/codecs/amrnb/dec/src/agc.cpp
/* ------------------------------------------------------------------------------ Pathname: ./audio/gsm-amr/c/src/agc.c Funtions: energy_old energy_new agc_init agc_reset agc_exit agc agc2 -------------------------------------------------------------...
ALGO
0.999244
5.192862
3f01644a-3437-412f-a7f0-ba6120e0fc70
Meet118/LeetCode
1每日一题/LeetCode1758.cpp
class Solution { public: int minOperations(string s) { int a = 0, n = s.size(); for (int i = 0; i < n; i ++ ) { if (s[i] != '0' + i % 2) a ++ ; } return min(a, n - a); } };
ALGO
0.999822
5.840492
8d6c5040-3934-4c7e-8121-450999f24fe8
adam-KUROPATWA-BUTTE/pacman
PacMan/Correc_Prof/game.cpp
#include <iostream> #include "game.h" #include "params.h" #include "gridmanagement.h" #include <map> using namespace std; template <class T, class U> void ShowMap (const map<T,U> & AMap){ for (const pair <T,U> & Val : AMap) cout << "Cle : " << Val.first << " " << "Valeur : " << Val.se...
ALGO
0.958071
3.230873
de993648-3959-4e44-8183-60da31633e11
qkrskdusdlqslek/basic-cpp-2024
day04/Project1/Project1/FruitSaleSim1.cpp
/*#include <iostream> using namespace std; class FruitSeller { private: int APPLE_PRICE; int numOfApples; int myMoney; public: void InitMembers(int price, int num, int money) //---> 생성자(기능: 객체를 생성하고 초기화, Init: 초기화 시켜주는 것) { APPLE_PRICE = price; numOfApples = num; myMoney = money; } int SaleApples(int...
ALGO
0.941988
5.596146
9c2a89f2-9013-4d51-903a-cd710bf489df
Kaileshwaran13/CodeChef
500 - 1000 difficulty rating/Cricket Ranking.cpp
#include <bits/stdc++.h> using namespace std; int main() { int t; cin >> t; while (t--) { int r1, r2, w1, w2, c1, c2; cin >> r1 >> w1 >> c1 >> r2 >> w2 >> c2; if ((r1 > r2) && (c1 > c2) || (w1 > w2) && (r1 > r2) || (c1 > c2) && (w1 > w2)) { cout << "A" << end...
ALGO
0.9993
3.869358
0bc422e2-1f84-415f-b8c8-b78ad5cc7218
Haleshot/Competitive-Programming
Codechef/Cheap_Food/Cheap_Food.cpp
#include <iostream> using namespace std; int main() { int T; cin >> T; while (T--) { int X, ten; cin >> X; ten = 0.1 * X; cout << max(ten, 100) << endl; } return 0; }
ALGO
0.998681
3.389735
a3fae3b5-fd2f-4cc6-8666-c2905efeb0d2
phhusson/platform_frameworks_av
media/libstagefright/codecs/amrnb/dec/src/bgnscd.cpp
/* ------------------------------------------------------------------------------ Pathname: ./audio/gsm-amr/c/src/bgnscd.c Functions: Bgn_scd_reset Bgn_scd ------------------------------------------------------------------------------ MODULE DESCRIPTION Background noise source characteristi...
ALGO
0.96763
6.9677
2c65fbcd-794c-4f39-bcf2-3ece7d7b1f45
tamanna026/SP-Lab-Task
Task-12:Sum of Digits.cpp
#include<stdio.h> int main() { int n; printf("Enter any digit:"); scanf("%d",&n); int sum=0; int temp=n; while(temp!=0) { int rem=temp%10; sum=sum+rem; temp=temp/10; } printf("The sum of the digit:%d",sum); return 0; }
ALGO
0.998844
3.156554
c87a4be1-5b5a-45dd-852a-823574ebd958
moondemon68/cp
Hackerearth/Divide-Number.cpp
#include <bits/stdc++.h> using namespace std; long long poww(long long a,int b) { long long ret=1; for (int i=1;i<=b;i++) ret*=a; return ret; } int main () { int tc; cin >> tc; while (tc--) { long long x; cin >> x; if (x%4==0) cout << poww(x/4,4) << endl; else ...
ALGO
0.999915
4.475665
4030b8c9-d97f-4e93-aeca-a10c19fa1502
raincross7/code-similarity
codes/train_code/problem278/problem278_227.cpp
#include <bits/stdc++.h> using namespace std; int main(){ string s1, s2; cin >>s1 >> s2; int N=s1.size(), M = s2.size(); int dp[1010][1010]; for(int i=0; i<=N; i++){ for(int j=0; j<=M; j++){ if(i==0) dp[i][j]=j; else if(j==0) dp[i][j]=i; else dp[i][j]=100100;...
ALGO
0.99999
4.508235
983e91b8-f008-4981-b90d-fde84f061263
seo-bo/ProblemSolving
백준/Gold/1525. 퍼즐/퍼즐.cpp
#include <bits/stdc++.h> #include <unordered_set> using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef tuple<int, int, int>ti; const char* yes = "Yes"; const char* no = "No"; int main(void) { cin.tie(0)->ios::sync_with_stdio(0); string t = "123456780", n; vector<v...
ALGO
0.999981
3.865417
b1f17bbf-982d-4d90-8d21-c639cdd3d84f
A2Amir/Highway-Driving
src/Eigen-3.3/bench/eig33.cpp
#include <iostream> #include <Eigen/Core> #include <Eigen/Eigenvalues> #include <Eigen/Geometry> #include <bench/BenchTimer.h> using namespace Eigen; using namespace std; template<typename Matrix, typename Roots> inline void computeRoots(const Matrix& m, Roots& roots) { typedef typename Matrix::Scalar Scalar; con...
ALGO
0.999545
5.613888
47c47ed4-27e3-4c5a-9de6-360a82906c08
Achiket123/weatherapp
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
d0249741-0f09-48c2-92ea-d3612de03bfc
aryan750/Coding_Blocks_DSA
book_allocation_repeat.cpp
#include<bits/stdc++.h> using namespace std; bool isPossible(int a[], int n, int m,int curr_sum) { int stud_used =1; int pages_reading = 0; for(int i=0;i<n;i++) { if(a[i] + pages_reading > curr_sum) { stud_used++; pages_reading = a[i]; if(stud_used > m) { return false; } } pages_reading...
ALGO
0.999964
5.104725
bc0299d9-29cb-4f61-9304-2e3c43915654
sdaffer/CS-142
3-13-prep-lab/3-13-prep-lab.cpp
#include <iostream> #include <iomanip> using namespace std; //Write your functions here double CalcRectanglePerimeter(double rectHeight, double rectWidth){ double rectPerimeter; rectPerimeter = (2 * rectHeight) + (2 * rectWidth); return rectPerimeter; } void PrintRectanglePerimeter(double rectHeight, do...
TOOL
0.970248
4.981423
7893c27e-b83d-4851-ae40-ca6665f3559a
adityaparmar9813/daily-leetcode
climbing_stairs.cpp
class Solution { public: int climbStairs(int n) { if(n <= 2) return n; int a = 1, b = 2; for(int i=n-3; i >= 0; i--) { int temp = a+b; a = b; b = temp; } return b; } }; // Time Complexity : O(n) // Space Complexity : O(1)
ALGO
0.99999
6.547594
32965ac8-f4c7-4a72-8a9f-410cb68243d8
raincross7/code-similarity
codes/train_code/problem261/problem261_74.cpp
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) using ll = long long; int main() { string s; cin >> s; while(true){ if(s.at(0) == s.at(1) && s.at(1) == s.at(2) && s.at(2) == s.at(0)){ cout << s << endl; break; } int x = stoi(s); x++; ...
ALGO
0.999836
3.742771
dd0745fd-d3d4-4d86-8fc9-1d7f5d4f935a
Shubhamm1211/GFG-
Difficulty: Medium/Row with max 1s/row-with-max-1s.cpp
//{ Driver Code Starts #include <bits/stdc++.h> using namespace std; // } Driver Code Ends // User function template for C++ class Solution { public: int rowWithMax1s(vector<vector<int> > &arr) { // code here int ans=-1; int maxi=0; for(int i=0;i<arr.size();i++){ int c...
ALGO
0.999904
6.186626
0c92582c-567a-4499-a969-4f917260721b
HamCat09/Tercer-Parcial-Cpp
colum.cpp
#include <iostream> #include <vector> using namespace std; int main() { const int fil = 4; const int col = 3; vector<vector<int>> tabla(filas, vector<int>(columnas, 0)); vector<int> columnSums(columnas, 0); for (int i = 0; i < fil; i++) { for (int j = 0; j < col; j++) { ...
ALGO
0.999408
4.829741
e8ebd421-8bc1-4193-910b-11d5cb9bdaee
junfanxia/REANN-MPI
src/density.cpp
#include "density.h" #include "comm.h" #include "neighbor.h" #include "neigh_list.h" #include "neigh_request.h" #include "atom.h" #include <mpi.h> using namespace torch::indexing; class cutoff_cosine : public torch::autograd::Function<cutoff_cosine> { public: static torch::Tensor forward( torch::autograd::Autog...
ALGO
0.999297
4.733875
f574b797-8aae-4da1-92e6-43f18b7832f3
MedinologyTeam/MedunologyTrainer
Trainer/jni/eigen/doc/examples/TutorialLinAlgSVDSolve.cpp
#include <iostream> #include <Eigen/Dense> using namespace std; using namespace Eigen; int main() { MatrixXf A = MatrixXf::Random(3, 2); cout << "Here is the matrix A:\n" << A << endl; VectorXf b = VectorXf::Random(3); cout << "Here is the right hand side b:\n" << b << endl; cout << "The least-squares ...
ALGO
0.999804
3.896713
7a94eefb-e650-4669-8f28-f0dc9da20aa9
alvaro-carlisbino/portfolio
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
08e9d7ae-9a8f-458e-aba6-09ad06bd69bf
byungmeo/WantedAlgorithm
이상민/백준-11053.cpp
#include <iostream> using namespace std; int A[1002] , DP[1002]; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int N; std::cin >> N; // 숫자 1개는 무조건 감소 수열이 1개다. int result = 0; for (int i = 0; i <= N; i++) { std::cin >> A[i]; // 모든 값을 1부터 시작하게 하기 위해 값 초기화 ...
ALGO
0.999948
4.693822
3b7d818f-afbc-47b8-ad42-3a8ad5da054e
kyohei8937/ProgramingContest
ARC/ARC129/ARC129_A_.cpp
#include <bits/stdc++.h> using namespace std; #define int long long const int INF = 1LL << 62; const int MOD = 1000000007; // マクロ #define rep(i,n) for(int i=0;i<n;++i) #define rep2(i,n,m) for(int i=n;i<m;++i) #define ALL(x) (x).begin(),(x).end() // 便利関数 // ...最小値・最大値交換 template<class T> inline bool chmin(T& a, T b) ...
ALGO
0.999768
3.648358
f3fec2f2-2c87-4c01-8be5-f8b2cfa4dc2d
jj123t/code
atcoder/136/b.cpp
/************************************************************************* > File Name: b.cpp > Author:123emm > Mail: <EMAIL> > Created Time: Tue 02 May 2023 02:15:34 PM CST ************************************************************************/ #include<bits/stdc++.h> using namespace std; typedef long long ll...
ALGO
0.999912
4.112021
559cca8d-7c43-4638-868e-0d407f95a808
pingchungchang/CP
deliveries/cpp/deliveries.cpp
#include "deliveries.h" #include <bits/stdc++.h> using namespace std; #define pii pair<int,int> #define fs first #define sc second #define ll long long #define pll pair<ll,ll> const int mxn = 1e5+10; vector<pii> tree[mxn]; ll W[mxn],sz[mxn],dep[mxn]; void init(int N, std::vector<int> U, std::vector<int> V, std::vect...
ALGO
0.999608
4.093686
4b33700c-d582-4450-91c3-445b18717492
ishandutta2007/codeforces
kokokostya/normal/772/A.cpp
#include <iostream> #include <vector> #include <algorithm> #include <string> #include <queue> #include <set> #include <iomanip> #include <map> #include <stack> #include <bitset> #include <deque> using namespace std; int main(){ ios_base::sync_with_stdio(false); int n, p; cin >> n >> p; vector<long double> a(n), b...
ALGO
0.999966
3.644521
68de6486-ef4f-4639-a065-e7db70d3ecde
chenshuyuhhh/STCA_weekly_coding
string/braceExpansionII2.cpp
#include <string> #include <vector> #include <set> #include <stack> using namespace std; vector<string> braceExpansionII2(string expression) { }
ALGO
0.99455
5.325818
ce80ebcb-44d0-4009-b92a-e255f4a712c5
AlexGeControl/Motion-Planning-for-Mobile-Robots
workspace/assignments/05-trajectory-generation--minimum-snap/ROS/src/waypoint_trajectory_generator/src/trajectory_generator_waypoint.cpp
#include "trajectory_generator_waypoint.h" #include <osqp++.h> #include <ros/ros.h> #include <chrono> #include <string> #include <vector> #include <map> TrajectoryGeneratorWaypoint::TrajectoryGeneratorWaypoint(){} TrajectoryGeneratorWaypoint::~TrajectoryGeneratorWaypoint(){} /** * @brief get partial factorial ge...
ALGO
0.999526
6.623255
fdaa993f-5a08-47f8-a5fc-6859b52258c3
shenghuanjie/poj
problems/3721_和数.cpp
/* 3721: 和数 http://bailian.openjudge.cn/practice/3721/ 描述 给定一个正整数序列,判断其中有多少个数,等于数列中其他两个数的和。 比如,对于数列1 2 3 4, 这个问题的答案就是2, 因为3 = 2 + 1, 4 = 1 + 3。 输入 共两行,第一行是数列中数的个数n ( 1 <= n <= 100),第二行是由n个不大于10000的正整数组成的数列,相邻两个整数之间用单个空格隔开。 输出 一个整数,即数列中等于其他两个数之和的数的个数。 样例输入 4 1 2 3 4 样例输出 2 */ #include<iostream> #include<stdlib.h> usi...
ALGO
0.999706
4.04373
949490ad-edd5-4620-ae31-b95424a51ec1
rsarthak/Leetcode-DSA
000n-ary-tree-level-order-traversal/000n-ary-tree-level-order-traversal.cpp
/* // Definition for a Node. class Node { public: int val; vector<Node*> children; Node() {} Node(int _val) { val = _val; } Node(int _val, vector<Node*> _children) { val = _val; children = _children; } }; */ class Solution { public: vector<vector<int>> levelOr...
ALGO
0.999972
5.860634
cc17c5e1-c09a-4e9c-b4c1-babb24839b3d
side-projects-all/works
Leetcodes/bit_manipulation_n_mask/q_411.cpp
/* A string can be abbreviated by replacing any number of non-adjacent substrings with their lengths. For example, a string such as "substitution" could be abbreviated as (but not limited to): "s10n" ("s ubstitutio n") "sub4u4" ("sub stit u tion") "12" ("substitution") "su3i1u2on" ("su bst i t u ti on"...
ALGO
0.999596
6.733113
19826d76-f540-4405-88b6-f48afad2be5a
apple-opensource-mirror/clang
src/lib/Analysis/CFG.cpp
#include "llvm/Analysis/CFG.h" #include "llvm/ADT/SmallSet.h" #include "llvm/Analysis/LoopInfo.h" #include "llvm/IR/Dominators.h" using namespace llvm; /// FindFunctionBackedges - Analyze the specified function to find all of the /// loop backedges in the function and return them. This is a relatively cheap /// (com...
ALGO
0.999663
7.515771
08dc94b6-0459-482c-9a85-149112c8cf36
jfpereira88/ndnSIM-VAL
NFD/tools/ndn-autoconfig/dns-srv.cpp
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ #include "dns-srv.hpp" #include <sys/types.h> #include <arpa/nameser.h> #include <netinet/in.h> #include <resolv.h> #ifdef __APPLE__ #include <arpa/nameser_compat.h> #endif #include <iostream> #include <boost/endian/conversion.hpp> namespace ndn { ...
TOOL
0.988338
6.448273
ea8e8142-6aba-425b-99cd-f688b9188de6
bretternst/tcpppl_answers
ch08/ex03.cpp
#include <iostream> #include <string> #include <map> #include <cctype> #include <sstream> #include <queue> #include <cmath> namespace Error { using std::string; double error(const string&); int no_of_errors = 0; } namespace Lexer { using std::string; using std::istream; using std::queue; ...
TOOL
0.924288
5.263338
641a580e-0717-407b-9d23-5dfcc444d06a
TimonKnigge/Competitive-Programming
SPOJ/KQUERYO.cpp
#include <iostream> #include <vector> #include <algorithm> #include <iterator> #include <functional> using namespace std; typedef long long ll; #define LC(n) (2 * (n)) #define RC(n) (2 * (n) + 1) #define PA(n) ((n) >> 1) class SegmentTree { struct Node { vector<int> st; int l, r; Node(int _l, int _r) : l(_l)...
ALGO
0.999896
4.778845
b485041b-8fb2-4666-afeb-d3e5b18aafe4
ishandutta2007/codeforces
pyqe/normal/1183/A.cpp
#include <bits/stdc++.h> using namespace std; long long sz=0; vector<long long> v; int main() { long long i,k,c; for(i=4;i<=1003;i++) { c=0; for(k=i;k>0;k/=10) { c+=k%10; } if(c%4==0) { v.push_back(i); sz++; } } scanf("%lld",&k); printf("%lld\n",v[lower_bound(v.begin(),v.end(),k)-v.beg...
ALGO
0.999897
4.035537
4984a26d-bcb7-4d6c-84d0-df9f7e682b57
TheHacha167/ejercicios_cpp_2
t5/3_T5_.cpp
/* Escribe un programa que defina un vector de n´umeros y calcule la suma de sus elementos. */ #include <iostream> #include <vector> using namespace std; int main() { int n; cout << "Ingrese la cantidad de números: "; cin >> n; vector<int> numeros(n); cout << "Ingrese los números:" << endl; ...
ALGO
0.996737
5.488854
904f25c3-3b64-4be9-ac74-0b0e041207db
NikitaUssyukin/PP1_2023_Fall
Lecture/G1/Week14/iomanip.cpp
#include <iostream> #include <iomanip> #include <cmath> using namespace std; int main() { long double d = M_PI; cout << "d: " << d << endl; // http://ejudge.kz/reference/en/cpp/header/iomanip.html // http://ejudge.kz/reference/en/cpp/io/manip/setprecision.html cout << "\nd, setprecision(4): " <...
ALGO
0.975558
3.454844
46a569a1-78ac-444c-bb10-8fb2c8c18764
130-SanaAsif/DSA-Practice
GFG POTD/6April.cpp
//Equal Left and Right Subarray Sum. /* Statement - Given an array A of n positive numbers. The task is to find the first index in the array such that the sum of elements before it is equal to the sum of elements after it. Note: Array is 1-based indexed. */ /* Input: n = 5 A[] = {1,3,5,2,2} Output: 3 Explanatio...
ALGO
0.999948
5.996883
870775dc-fcb5-47a0-89e0-adb881c97ed2
RodicaMihaelaVasilescu/AdventOfCode2021
Day 08/Day 8.cpp
#define _CRT_SECURE_NO_WARNINGS #include <iostream> #include <string> #include <vector> #include <algorithm> #include <map> using namespace std; vector<string> split(string line, string delimiters = ",./;") { vector<string> words; int index = line.find_first_of(delimiters); if (!line.substr(0, index).empty())...
ALGO
0.985823
5.371761
9e3e9476-5c42-4c35-acc4-60796cb211ca
Minoic-Intelligence/shrike
src/kdl_parser/kdl_parser/src/kdl_parser.cpp
/* Author: Wim Meeussen */ #include "kdl_parser/kdl_parser.hpp" #include <string> #include <vector> #include <urdf_model/model.h> #include <urdf_parser/urdf_parser.h> #include <kdl/frames_io.hpp> #ifdef HAS_ROS #include <ros/console.h> #else // forward ROS warnings and errors to stderr #define ROS_DEBUG(...) fprin...
TOOL
0.874861
6.833315
87537ede-5d1b-4a00-9377-b98d79015ccf
CyberPoint/Obfuscation
sge_obfuscator/code/src/new_zobfuscator.cpp
#include "circuit.h" #include "utils.h" #include "pyutils.h" #include "clt_mlm.h" #include "launcher.h" #include <omp.h> #include<drmaa.h> #include<iostream> #include<fstream> //#include "gperftools-2.4/src/gperftools/profiler.h" using namespace std; //#define NUMSLOTS 4 struct state { struct clt_mlm_state mlm...
ALGO
0.998026
3.875565
34f1c9ae-39a2-4594-a531-6f3b19be4ff8
clemkoh/csc417-fluid-simulator
extern/libigl/include/igl/combine.cpp
template < typename DerivedVV, typename DerivedFF, typename DerivedV, typename DerivedF, typename DerivedVsizes, typename DerivedFsizes> IGL_INLINE void igl::combine( const std::vector<DerivedVV> & VV, const std::vector<DerivedFF> & FF, Eigen::PlainObjectBase<DerivedV> & V, Eigen::PlainObjectBase<De...
TOOL
0.891718
5.802545
67415b09-8523-4dea-93d2-baac86a5e06c
Lucchetto/frameworks_native
cmds/servicemanager/ServiceManager.cpp
#include "ServiceManager.h" #include <android-base/logging.h> #include <android-base/properties.h> #include <binder/BpBinder.h> #include <binder/IPCThreadState.h> #include <binder/ProcessState.h> #include <binder/Stability.h> #include <cutils/android_filesystem_config.h> #include <cutils/multiuser.h> #include <thread>...
TOOL
0.92023
7.349759
07dc45a5-9c7f-4e78-af28-f0d3866a658e
hamzacyberpatcher/MazeBFS
MazeBFS/MazeBFS.cpp
#include <iostream> #include <vector> #include <unordered_map> #include <queue> #include <algorithm> #include <SFML/Graphics.hpp> const int WIDTH = 900; const int HEIGHT = 900; const int GRIDISZE = 50; void bfsMazeDraw(sf::RenderWindow& window, const std::vector<std::vector<int>>& maze, std::unordered_map<int, bool>&...
ALGO
0.999331
6.223886
b0dd941e-581f-4933-a6c7-6a4e8c223cdc
Time0o/mpsym
source/bsgs_reduce_gens.cpp
#include <algorithm> #include <unordered_set> #include <vector> #include "bsgs.hpp" #include "dbg.hpp" #include "orbit.hpp" #include "perm.hpp" #include "perm_set.hpp" namespace mpsym { namespace internal { void BSGS::reduce_gens() { DBG(DEBUG) << "Removing redundant strong generators"; std::unordered_set<Perm...
ALGO
0.999442
5.512462
142f9678-4a4b-4528-a462-f37fc7a6bba0
ishandutta2007/codeforces
ko_osaga/normal/482/B.cpp
#include <cstdio> #include <algorithm> using namespace std; typedef pair<int,int> pi; int dx[100005][30]; int n, q, s[100005], e[100005], x[100005]; int main(){ scanf("%d %d",&n,&q); for(int i=0; i<q; i++){ scanf("%d %d %d",&s[i],&e[i],&x[i]); for(int j=0; j<30; j++){ if((x[i] >> ...
ALGO
0.999902
3.624608
05115bcd-fe6c-447e-a10e-408f03c6b8f7
sarvex/leetcode-haxe
solution/1200-1299/1202.Smallest String With Swaps/Solution.cpp
class Solution { public: vector<int> p; string smallestStringWithSwaps(string s, vector<vector<int>>& pairs) { int n = s.length(); p.resize(n); for (int i = 0; i < n; ++i) p[i] = i; for (auto& pair : pairs) p[find(pair[0])] = find(pair[1]); unordered_map<int, vector<char...
ALGO
0.999999
6.103873
1b1a2657-42c7-4a28-9f5b-204c3bfc3f1b
Madhavan0210/ProblemSolving-GFG
Difficulty: Basic/Queue using Linked List/queue-using-linked-list.cpp
//{ Driver Code Starts #include<bits/stdc++.h> using namespace std; struct QueueNode { int data; QueueNode *next; QueueNode(int a) { data = a; next = NULL; } }; struct MyQueue { QueueNode *front; QueueNode *rear; void push(int); int pop(); MyQueue() {front = rea...
ALGO
0.998877
5.756299
abe811e7-4153-4907-9f5f-dfcc4ecdbdd8
Preetam078/Standered_Template_Library
iteratorsinpair.cpp
#include <iostream> #include <vector> using namespace std; int main() { vector<pair<int, int>> v = {{1, 2}, {2, 5}, {5, 7}, {6, 9}}; vector<pair<int, int>>::iterator itr = v.begin(); for (itr = v.begin(); itr != v.end(); itr++) { cout << (*itr).first << " " << (*itr).second << endl; } c...
ALGO
0.964914
3.755317
2c3b153a-449d-4078-a7c2-e833b5d05cc8
ddeka0/SPOJ-Solutions
Bytelandian_gold_coins.cpp
#include <vector> #include <list> #include <map> #include <set> #include <deque> #include <stack> #include <bitset> #include <algorithm> #include <functional> #include <numeric> #include <utility> #include <sstream> #include <memory.h> #include <iostream> #include <iomanip> #include <cstdio> #include <cmath> #include <...
ALGO
0.999306
4.220798
6094d77c-9daa-4a07-b1d9-edd6abff63de
kongyt/Civilization
gdx/jni/Box2D/Collision/Shapes/b2EdgeShape.cpp
#include <Box2D/Collision/Shapes/b2EdgeShape.h> #include <new> using namespace std; void b2EdgeShape::Set(const b2Vec2& v1, const b2Vec2& v2) { m_vertex1 = v1; m_vertex2 = v2; m_hasVertex0 = false; m_hasVertex3 = false; } b2Shape* b2EdgeShape::Clone(b2BlockAllocator* allocator) const { void* mem = allocator->All...
ALGO
0.969302
7.599598
f1db9645-7195-4bbb-8505-2421aa7c5abb
Pavan-B-N/DSA-with-C_plus_plus
DP/MinimumPathSum.cpp
// https://leetcode.com/problems/minimum-path-sum/ #include <iostream> #include <vector> #include <climits> using namespace std; int minPathSum(vector<vector<int>>& grid) { if (grid.size() < 1) { return 0; } int m = grid.size(); int n = grid[0].size(); vector<vector<int>> dp(m, vector<int>(...
ALGO
0.999991
6.216012
b315470b-f0c3-41b6-b102-5521612c3bbf
akash-gupta0/DSA
Recursion & Backtracking/01Recursion/17_SkipCharacter.cpp
#include <iostream> using namespace std; // First method (If we are allowed to use another string in arguments): we can use a another string in which we will be adding char according to condtions. // Second method : we will decleare return type as a string and add char while returning from the recursive call according...
ALGO
0.999661
4.23227
9ffca106-5615-41cf-8c1a-7b35dd4b2307
chiragHORSE12/SUPREME-BATCH
week11(linked list)/LECTURE_03/find_middle_node.cpp
#include<iostream> using namespace std; class node{ public: int data; node* next; node(){ this->data=0; this->next=NULL; } node(int data){ this->data=data; this->next=NULL; } }; void insertathead(node* &head,int data){ if(head == NULL){ //LL is...
ALGO
0.999563
3.766686
750713e2-6ad8-42c6-b713-e5da95adf44e
riyanbayusaputra/flutter_bloc_auth_example
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
48870540-9377-40aa-b157-0ee5b7f96c4e
ne0z/gecko-nokia-8110
js/src/frontend/ParseNode.cpp
#include "frontend/ParseNode-inl.h" #include "frontend/Parser.h" #include "jscntxtinlines.h" using namespace js; using namespace js::frontend; using mozilla::ArrayLength; using mozilla::IsFinite; #ifdef DEBUG void ParseNode::checkListConsistency() { MOZ_ASSERT(isArity(PN_LIST)); ParseNode** tail; uint3...
TOOL
0.925393
6.985521
64f4870a-54fd-49e3-b4d1-f581cb4fce4e
MarioJim/CompetitiveProgramming
Cpp/SemanaI_2019/Wednesday/G.cpp
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; string s; cin.clear(); cin.ignore(); getline(cin, s); int count = 0, maxCount = 0; for (int j = 0; j < n; ++j) { if (s[j] == ' ') { maxCount = max(count, maxCount); count = 0; ...
ALGO
0.998939
4.021039
3f86fc13-6a73-4ccb-9081-313f96b30d68
ishandutta2007/codeforces
hjqiusl/normal/1131/E.cpp
//The Hunting Party - Keys To The Kingdom #include<bits/stdc++.h> #define IOS ios::sync_with_stdio(false) #define ll long long #define mp make_pair #define pa pair < int,int > #define fi first #define se second #define inf 1e18 #define mod 998244353 #define int ll #define N 100005 using namespace std; inline char gc(){...
ALGO
0.999968
4.107779
46b95596-5dbd-455d-84a7-3e01375a7c2b
dev-amber/LeetcodeProblems
3321-type-of-triangle/type-of-triangle.cpp
class Solution { public: string triangleType(vector<int>& nums) { sort(nums.begin(), nums.end()); int a = nums[0], b = nums[1], c = nums[2]; // Check if it forms a valid triangle if (a + b <= c) { return "none"; } // Now check t...
ALGO
0.99996
6.102395
0c731d25-11cb-432d-9eff-5cbbec2e74e8
ishandutta2007/codeforces
realcomplex/normal/1458/C.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int,int> pii; #define fi first #define se second #define mp make_pair #define fastIO ios::sync_with_stdio(false);cin.tie(0);cout.tie(0); const int N = 1005; int A[N][N]; int B[N][N]; int nx[3]; int dif[3]; int n; void add(int &a, int...
ALGO
0.999934
4.0624
7fe44850-a48f-4766-ba62-9eb18a337864
aditimahajan04/Leetcode
2-add-two-numbers/add-two-numbers.cpp
class Solution { public: ListNode* solve(ListNode* l1, ListNode* l2, int carry) { if (l1 == nullptr && l2 == nullptr && carry == 0) { return nullptr; } int sum = 0; if (l1 != nullptr && l2 != nullptr) { sum = l1->val + l2->val + carry; l1 = l1->nex...
ALGO
0.999925
6.569892
c56c4dca-6686-4e91-b1d4-dd672a4de08d
TheGeekMax/exos_cpp
TD3/exo2/main.cpp
// // Created by Maxime Sanciaume on 18/10/2024. // #include <iostream> #include <vector> #include <unordered_map> using namespace std; vector<int> twoSumBruteForce(const vector<int>& nums, int target ) { for(int i = 0; i < nums.size(); i++) { for(int j = i + 1; j < nums.size(); j++) { if(i !...
ALGO
0.999738
6.383576
544625a6-4357-4c19-8fd7-ec74187c6ae4
IbrohimToxtasinov/instagram_ui
windows/runner/utils.cpp
#include "utils.h" #include <flutter_windows.h> #include <io.h> #include <stdio.h> #include <windows.h> #include <iostream> void CreateAndAttachConsole() { if (::AllocConsole()) { FILE *unused; if (freopen_s(&unused, "CONOUT$", "w", stdout)) { _dup2(_fileno(stdout), 1); } if (freopen_s(&unuse...
TOOL
0.998859
6.785645
bda5cfb3-7a60-47e0-9e8b-46363a4c93e6
its-cr7/LeetCode-V2
0055-jump-game/0055-jump-game.cpp
class Solution { public: bool canJump(vector<int>& nums) { int n = nums.size(); int maxp = 0; for(int i = 0; i < n; i++){ if(i > maxp) return false; maxp = max(i + nums[i], maxp); if(maxp > n - 1) return true; } return true; } };
ALGO
0.999989
6.236797
d707877e-0050-4cf6-9f79-d3d4211394b9
LGY3030/cpp_practice
Leetcode/215/Kth_Largest_Element_in_an_Array.cpp
//Solution 1 class Solution { public: int findKthLargest(vector<int>& nums, int k) { auto cmp=[](int a, int b){ return a<b; }; priority_queue<int, vector<int>, decltype(cmp)> pq(cmp); for(auto&i:nums) pq.push(i); for(int i=0;i<k-1;i++) pq.pop(); return pq....
ALGO
0.999952
5.20372
29f5d1d9-4360-4a1b-a666-a78c026c2d12
kashishgupta29/Learning_DSA-CP
1SummerCamp/1.cpp
#include <iostream> #include <vector> #include <algorithm> using namespace std; vector<int> myfunc(vector<int> &vec, vector<vector<int>> &queries) { vector<int> result; int j = 0; while (j < queries.size()) { int count = 0; for (int i = 0; i < vec.size(); i++) { if(queries[]) // int m ...
ALGO
0.99973
3.655564
3598bec1-db27-465d-a058-a9cdca20734e
sainanda59/CP-CF
01_Leetcode_FAANG/Putul Kumari/DeleteNodeBST.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.999999
6.434215
abe81f87-66c6-42f5-9bf1-bc751a074965
elixered/leetcode
281-zigzag-iterator/281-zigzag-iterator.cpp
class ZigzagIterator { public: ZigzagIterator(vector<int>& v1, vector<int>& v2) { if (v1.size() != 0) Q.push(make_pair(v1.begin(), v1.end())); if (v2.size() != 0) Q.push(make_pair(v2.begin(), v2.end())); } int next() { vector<int>::iterator it = Q.front().fir...
ALGO
0.999942
5.342824
76a1c65e-eac2-4886-8c6c-ca6cf41e2c3e
timothyshull/cpp_scratchpad_old
multiple_inheritance/virtual_base.cpp
// // Created by Tim Shull on 10/19/16. // #include <iostream> struct B { int n; }; class X : public virtual B { }; class Y : virtual public B { }; class Z : public B { }; // every object of type AA has one X, one Y, one Z, and two B's: // one that is the base of Z and one that is shared by X and Y struct AA ...
TEST
0.950097
5.885504
67ed25fe-fd41-4384-94bf-7a0ff6953076
HPC-Fortran2CPP/Fortran2Cpp
data/StarCoder2/readable_format_HPEC/cpp/file144.cpp
#include <iostream> #include <vector> #include <string> #include <omp.h> int main(int argc, char* argv[]) { int len = 100; int x = 10; int rdErr; if (argc == 0) { std::cout << "No command line arguments provided." << std::endl; } std::vector<std::string> args(argc); for (int ix = ...
ALGO
0.981706
3.851205
46b22a7c-c662-4134-a6de-7095c05b17b0
ishandutta2007/codeforces
catupper/normal/852/B.cpp
#include <bits/stdc++.h> using namespace std; typedef pair<int, int> pii; typedef long long ll; typedef vector<int> vi; #define pb push_back #define eb emplace_back #define mp make_pair #define fi first #define se second #define rep(i,n) rep2(i,0,n) #define rep2(i,m,n) for(int i=m;i<(n);i++) #define ALL(c) (c).begin(...
ALGO
0.999955
3.502797
b5a1eb3b-4530-4a7e-8455-89f60620af9e
dinhnguyencntt/LTCB_forlong
LTCB_forlong.cpp
#include <iostream> using namespace std; int main() { int so; cout << "nhapso:"; cin >> so; for (int i = 0; i < so; i++) { for (int j = so; j > i; j--) { cout << "*"; } cout << endl; } return 0; }
ALGO
0.999617
3.435543
e97bf75f-1ae8-42c5-b6fc-1c58dd3c0f46
SnehilPatel/Leetcode
1832-check-if-the-sentence-is-pangram/1832-check-if-the-sentence-is-pangram.cpp
class Solution { public: bool checkIfPangram(string sentence) { vector<char> f(26); for(int i=0; i<sentence.size(); i++){ f[sentence[i]-'a']++; } for(int i=0; i< f.size(); i++){ if(f[i]==0){ return false; } } return t...
ALGO
0.999404
6.028942
69772e1f-6ab7-46af-a31b-31aa1766516d
Anhlearning/DSA-PTIT
queue/biendoist.cpp
#include<bits/stdc++.h> using namespace std; int main(){ int tc; cin>>tc; while(tc--){ queue<pair<int,int>>q; set<int>se; int s,t;cin>>s>>t; se.insert(s); q.push({s,0}); while(1){ pair<int,int>top=q.front(); q.pop(); if(top...
ALGO
0.999913
3.625562
9f36f6cc-2169-468d-afe6-378b830c8a97
harvard-acc/gem5-aladdin
src/systemc/tests/systemc/misc/user_guide/chpt5.1/accumulator.cpp
/***************************************************************************** accumulator.cpp -- Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15 *****************************************************************************/ /************************************************************************...
ALGO
0.995922
5.740953
96871a71-077b-445f-b5e9-7fb8278b37a3
ishandutta2007/codeforces
bicsi/normal/1158/D.cpp
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<long long> x(n), y(n); for (int i = 0; i < n; ++i) { cin >> x[i] >> y[i]; } auto det = [&](int i, int j, int k) { // 1 1 1 // xi xj xk // yi yj yk long long ans = 0; ...
ALGO
0.999998
3.53686
a0a18e6d-89b3-4fab-b09f-4141c0ccdbc1
lzhou835/leetcode
366.Find_Leaves_of_Binary_Tree.cpp
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ class Solution { public: int solve(TreeNode * root, vector<vector<int>> & res){ if(!root) return -1; int...
ALGO
0.999937
6.175405
7f3d7edf-e35c-42b6-a9db-51c97b664f8c
KraitOPP/Codeforces
A_Closest_Point.cpp
#include <bits/stdc++.h> using namespace std; #define int long long #define endl "\n" #define loop(i, a, b) for(int i=a;i<b;i++) signed main(){ ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int t; cin>>t; while(t--){ auto begin = chrono::high_resolution_clock::now(); ...
ALGO
0.999617
4.167348
fe106149-6447-4060-a4b4-0983a3a85798
DeepDasg/gem5_cache_replacement
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
1da5858c-b121-4c06-b8dc-540b8eeadad9
jhasan2026/Road_To_Grandmaster
1_Learn_CPP/5_Array/4_merge_two_array.cpp
#include "iostream" #include "vector" using namespace std; void mergeTwoArray(vector<int> &arr1,vector<int> &arr2){ vector<int> mergeArray; mergeArray.reserve(arr1.size()+arr2.size()); //avoid reallocation mergeArray.insert(mergeArray.end(),arr1.begin(), arr1.end()); mergeArray.insert(mergeArray.en...
ALGO
0.998748
4.639634
ef3bb589-0c67-4a9c-851b-401cf49e94f0
wowcores/Cataclysm
Core/Diamond Core (For now)/src/scripts/scripts/eastern_kingdoms/stratholme/boss_order_of_silver_hand.cpp
/* ScriptData SDName: Boss_Silver_Hand_Bosses SD%Complete: 40 SDComment: Basic script to have support for Horde paladin epic mount (quest 9737). All 5 members of Order of the Silver Hand running this script (least for now) SDCategory: Stratholme EndScriptData */ #include "precompiled.h" #include "stratholme.h" /*####...
TOOL
0.887467
6.809698
7d29319d-f341-452a-8d51-ad35873c6d6d
GrandThed/calderum
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
81ae7526-d4aa-4c14-86b4-71363658bfa4
mamun4122/My-Online-Judge-Submission
UVA/11239.cpp
#include <cassert> #include <cctype> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <sstream> #include <iomanip> #include <string> #include <vector> #include <list> #include <set> #include <map> #include <stack> #include <queue> #include <algorit...
ALGO
0.997387
3.821452
6a8a4104-1005-42c4-bc30-e3d119a516c4
archana-9430/DSA-Practice
Level - 1/Arrays&2DArrays/ContainerWithMostWater.cpp
class Solution { public: int maxArea(vector<int>& height) { //OM GAN GANAPATHAYE NAMO NAMAH //JAI SHRI RAM //JAI BAJRANGBALI //AMME NARAYANA, DEVI NARAYANA, LAKSHMI NARAYANA, BHADRE NARAYANA int l = 0, r = height.size() - 1; int area, max = -1; while(l < r...
ALGO
0.999935
6.476164
1a9c9c39-7697-498a-93aa-799929440ee4
525jw/BOJ
2024_05/15650/15605.cpp
#include <iostream> #include <vector> using namespace std; int N,M; vector<vector<int>> answer; vector<int> included; void chknode(int i){ if(i<=N){ if(included.size()==M){ answer.push_back(included); }else{ included.push_back(i+1); chknode(i+1); inclu...
ALGO
0.999982
3.557042
3a1c4bc0-a93b-43c8-8c14-7b7e3bf8eb97
Du0ngkylan/C-Cpp
BaiTap_KTLT/Array 2D/Sửa BT ma trận/Source.cpp
#include <iostream> // input output stream. Dòng nhập xuất chuẩn C++ using namespace std; void NhapMaTran(int a[][10], int sodong, int socot) { for(int i = 0; i < sodong * socot; i++) { cout<<"Nhap a["<<i/socot<<"]["<<i % socot<<"]:\n"; cin>>a[i / socot][i % socot]; } } void XuatMaTran(int a[][10], int sod...
ALGO
0.986768
3.203528
2b876283-d978-49fd-bcdd-4f6c314df7ce
Seungchan0325/baekjoon
solutions/15661_0.cpp
#include <iostream> #include <algorithm> using namespace std; const int MAX_N = 20; int team[MAX_N], ans=987654321; int N, S[MAX_N][MAX_N]; int team_diff() { int start, link; start = link = 0; for(int i=0; i<N; i++) { int& cur = team[i] ? start : link; for(int j=i+1; j<N; j++) { ...
ALGO
0.999957
3.578896
01ed4170-85db-4beb-b1dd-9f2c39d08b1e
hfhongzy/CodeForOI
gym102900h.cpp
#include <bits/stdc++.h> #define rep(i, j, k) for(int i = j; i <= k; ++ i) #define per(i, j, k) for(int i = j; i >= k; -- i) using namespace std; typedef long long ll; const int N = 1e6 + 10; int n, k, a[N], b[N], u[N], v[N]; ll solve(int x) { rep(i, 0, k - 1) u[i] = (a[i] + n - x) % n; rep(i, 0, k - 1) v[i] = (b[i...
ALGO
0.999954
3.850623
50fbc03e-b645-430c-a9f5-13d0356bc7ac
chltkdgns1/Algoritmn_third
인접한 비트의 개수.cpp
#include <iostream> using namespace std; int dp[101][101][2]; int main() { ios::sync_with_stdio(0), cin.tie(0), cout.tie(0); dp[1][0][0] = dp[1][0][1] = 1; dp[2][1][1] = dp[2][0][1] = 1; dp[2][0][0] = 2; for (int i = 3; i <= 100; i++) { for (int k = 0; k < i; k++) { dp[i][k][0] = dp[i - 1][k][0] + dp[i - 1][k]...
ALGO
0.999816
4.522007
a8efbe14-b82b-431b-a44c-26ffa284c96a
rupakyeware/DSA-Problems
STLApplications/validParentheses.cpp
#include<bits/stdc++.h> #define int long long #define endl '\n' using namespace std; void solve() { string s; cin >> s; int cnt = 0; int parentheses_to_add = 0; int n = s.size(); for(int i = 0; i < n; i++) { if(s[i] == '(') cnt++; else if(s[i] == ')') cnt--; if(cnt < 0) { ...
ALGO
0.998523
4.955541
e31ae31e-d0bd-44b5-a289-7d5dc5cf5b8f
gauravksh/LeetCode-Problems
349-intersection-of-two-arrays/349-intersection-of-two-arrays.cpp
class Solution { public: vector<int> intersection(vector<int>& nums1, vector<int>& nums2) { unordered_set<int> s(nums1.begin(),nums1.end()); vector<int> ans; for(auto x : nums2) { if(s.find(x) != s.end()) { ans.push_back(x); s.erase(x); ...
ALGO
0.999874
5.670595
e77d0bea-0bd5-42f9-b3bb-de1eb531c2de
Ssebi1/-FMI-AlgoritmiFundamentali
FinalClass.cpp
#include <iostream> #include <vector> #include <list> #include <map> #include <queue> #include <fstream> #include <climits> #include <limits.h> using namespace std; class Graf { int nrNoduri; // numarul de noduri ale grafului vector<vector<int>> matriceAdiacenta; // matrice de adiacenta( un vector de vectori;...
ALGO
0.997724
4.887121
e1e52e45-9a4b-4eaf-a7be-f07ebf89a203
113bommy/deepmind_codecontests_refine
cpp_gold_filter_file/cpp_train_11695_2.cpp
#include <bits/stdc++.h> using namespace std; int main() { int a, b, i, j, sum = 0, m; vector<int> v; cin >> a; m = a / 2 + 1; for (i = 1; i <= a; i++) { for (j = 1; j <= a; j++) { cin >> b; if (i == j || i + j == a + 1 || i == m || j == m) v.push_back(b); } } sort(v.begin(), v.end());...
ALGO
0.999775
3.651954
1ab0245a-284b-45ca-a1ae-e9c9bf37fb57
paulx904/Project
1041439-hw2-2-while/1041439-hw2-2-while.cpp
// Compute all positive factors of a positive integer #include <iostream> using namespace std; int main() { int number; int factor; cout << "Enter a positive integer: "; cin >> number; cout << "\n\nThe positive factors of " << number << " :" << endl; int i=1; while (i <= number) { if (number % i == 0) ...
TOOL
0.989439
3.548066
b51a6692-6f7e-44c0-931e-a3915d617795
GaisaiYuno/OI-Record-exe-deleted
Grade 10-12/2018 autumn/NOIP/NOIP2018提高组Day2程序包/answers/GD-0264/defense/defense.cpp
#include <cstdio> #include <iostream> using namespace std; inline long long read() { long long x=0,w=0;char ch=getchar(); while(ch<'0'||ch>'9')w|=ch=='-',ch=getchar(); while(ch>='0'&&ch<='9')x=(x<<1)+(x<<3)+(ch^48),ch=getchar(); return w?-x:x; } char s[10]; long long p[100100],v[100100],f[100100]; long long last[10...
ALGO
0.999874
3.665516
f09730e7-0acb-461f-a0b0-7cbdcb760965
itkingnb/cf-atc-and-so-on
luogu/P2392.cpp
#include<bits/stdc++.h> using namespace std; #define ll long long ll jc(ll n){ if(n==1||n==0) return (ll)1; else return n*jc(n-1); } void yes(){ cout<<"Yes\n"; } void no(){ cout<<"No\n"; } int gcd(int a,int b){ return b?gcd(b,a%b):a; } int lcm(int a,int b){ return (a*b)/gcd(a,b); } ll qp...
ALGO
0.999959
3.085169
963c7134-0d12-4756-9985-691af9117b76
Alishabohara-07/DAA
lab1qno.4(sequential).cpp
#include <iostream> using namespace std; int sequentialSearch(int arr[], int n, int target, int &steps) { steps = 0; // Initialize step counter for (int i = 0; i < n; ++i) { ++steps; // Increment step counter for each comparison if (arr[i] == target) { return i; // Return the inde...
ALGO
0.999938
6.438721
957a9b2f-a1ee-44f5-a817-7ceb0d2cc920
RitikTiwary519/Data-Structure-Algorithms-and-Competitive-Programming
codeforces_practice/B_Three_Sevens.cpp
#include <bits/stdc++.h> #define ll long long #define rsrt sort(v.rbegin(), v.rend()); #define input \ for (ll i = 0; i < n; i++) \ { \ ll x; \ cin >> x; \ v.push_back(x); \ } #define mp make_pair #define ...
ALGO
0.999802
4.018003