uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
96d11b57-d780-4bfb-8943-a75d53cce631
sb-baifeng-sb/boost
libs/iterator/example/transform_iterator_example.cpp
#include <functional> #include <algorithm> #include <iostream> #include <boost/iterator/transform_iterator.hpp> // What a bummer. We can't use std::binder1st with transform iterator // because it does not have a default constructor. Here's a version // that does. namespace boost { template <class Operation> cla...
ALGO
0.995758
6.612723
621701c7-e4e6-408f-9172-6993bf56bec9
nakashima-takeo/AtCoder
algo-siki/union-find-q1.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; using ull = unsigned long long; using ld = long double; #define OVERLOAD_REP(_1, _2, _3, name, ...) name #define REP1(i, n) for (auto i = std::decay_t<decltype(n)>{}; (i) != (n); ++(i)) #define REP2(i, l, r) for (auto i = (l); (i) != (r); ++(i)) #defi...
ALGO
0.999992
4.523808
619b3451-b73b-42a7-939a-3572d8079af2
ishandutta2007/codeforces
huah/normal/1529/A.cpp
#include<bits/stdc++.h> typedef unsigned long long ull; typedef long long ll; #define inf 0x3f3f3f3f3f3f3f3fll #define rep(i,l,r) for(int i=l;i<=r;i++) #define nep(i,r,l) for(int i=r;i>=l;i--) void sc(int &x){scanf("%d",&x);} void sc(int &x,int &y){scanf("%d%d",&x,&y);} void sc(int &x,int &y,int &z){scanf("%d%d%d",&x,&...
ALGO
0.999661
4.563848
b66b526c-c35c-4db9-92f9-494d1820b163
lixiongfei2410/DSA
SourceCode/01SelectionSort/main.cpp
// // Created by er on 2020/4/21. // #include <iostream> #include <algorithm> #include "student.h" using namespace std; //选择排序 template <typename T> void SelectiongSort(T *ele,int n){ for(int i = 0; i < n; i++) { int eleIndex = i; // 寻找最小值的索引 for(int j = i+1; j < n ; j++) {...
ALGO
0.999619
4.463117
e7156df9-a51e-4a54-936c-d95bfaff48b8
mdunggggg/CPP_Code_PTIT
CPP0417.cpp
/* Hoang Manh Dung - D21 ProPTIT */ #include<bits/stdc++.h> using namespace std; #define Faster() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); const double PI = 2*acos(0); const int MOD = 1e9 + 7; const int MAX = 1e6 + 5; void Process(){ int n; cin >> n; int a[n], b[n]; for (int i = ...
ALGO
0.999871
3.990687
531b6cbd-6b87-4c64-a4d0-4bb41a5bf620
Romasa102/CompetitiveProgramming
ABC/ABCC/ABC376/B.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i,n) for(ll i = 0; i < (n); ++i) #define repp(i,o,n) for(ll i = o; i < (n); ++i) using P = pair<ll,ll>; int main(){ ll N,Q; cin >> N >> Q; ll H[Q],T[Q]; rep(i,Q){ cin >> H[i] >> T[i]; } }
ALGO
0.999366
3.281783
41e72a07-e11d-4dce-8734-334b38ac3e6b
ishandutta2007/codeforces
dreamoon_love_aa/normal/1198/D.cpp
/*{{{*/ #include <bits/stdc++.h> #define SZ(X) ((int)(X).size()) #define ALL(X) (X).begin(), (X).end() #define REP(I, N) for (int I = 0; I < (N); ++I) #define REPP(I, A, B) for (int I = (A); I < (B); ++I) #define FOR(I, A, B) for (int I = (A); I <= (B); ++I) #define FORS(I, S) for (int I = 0; S[I]; ++I) #define RS(X) s...
ALGO
0.999752
3.795943
25e55635-19a4-4167-a5a3-efaea25530e4
ChiliChunk/TP_cpp
TP3/tp2/correction-ex-2/list.cpp
#include "list.h" using namespace std; CNoeud::CNoeud() { this->pers = nullptr; this->pred = nullptr; this->suiv = nullptr; } CNoeud::CNoeud(CPersonne* pers, CNoeud* pred, CNoeud* suiv) { this->pers = pers; this->pred = pred; this->suiv = suiv; } CNoeud* CNoeud::get_pred(...
TOOL
0.910978
4.206402
7394c303-d280-46b4-b27b-1f02da6bae80
caps-tum/FastDDS-DPDK-XDP
src/cpp/security/accesscontrol/GovernanceParser.cpp
#include <security/accesscontrol/GovernanceParser.h> #include <fastdds/dds/log/Log.hpp> #include <cstring> #include <cassert> #if TIXML2_MAJOR_VERSION >= 6 #define PRINTLINE(node) node->GetLineNum() #define PRINTLINEPLUSONE(node) node->GetLineNum() + 1 #else #define PRINTLINE(node) "" #define PRINTLINEPLUSONE(node) "...
TOOL
0.878328
6.431359
b7f6f5a7-739d-43b8-bd23-af961cc123b6
azeemnitw/cpp
DFS.cpp
#include<bits/stdc++.h> using namespace std; class Graph { int V; list<int> *adj; void DFSUtil(int v,bool visited[]); public: Graph(int V); void addEdge(int v,int w); void DFS(int V); }; Graph::Graph(int V) { this->V=V; adj=new list<int>[V]; } void Graph::addEdge(int v,int w) { adj...
ALGO
0.999975
5.226727
f2f9bbea-2a09-4a54-aaba-4c5a10ea5427
LytvynPasha/6.2
6.2.cpp
// lab 6.2 // варіант 14 #include <iostream> #include <iomanip> using namespace std; void Print(int* a, const int size); void Sort(int* a, const int size); void Create(int* a, const int size, const int High); int main() { srand((unsigned)time(0)); const int n = 20; int a[n]; Create(a, n, 100); cout << "Start ...
ALGO
0.998945
4.129696
7803f504-2a1a-4574-8d87-d496b375562a
ayeshachryll/sh2024
smarthelmet2024/Thread/cv.cpp
#include <stdio.h> #include <opencv2/opencv.hpp> #include <iostream> #include <time.h> #include <stdlib.h> #include "cv.h" using namespace cv; using namespace std; CV::CV() { CV::PERCLOS = 0.0; CV::eyeData.radius = 0; CV::frameData.numOfPixels[CV::frameData.numOfFrames] = { 0 }; // num of black/white pi...
ALGO
0.998333
5.177546
995718a9-a0e4-4916-9d28-2036e9ba88bc
ghulamghousdev/CPP-Assignments
DFS.cpp
// DFS algorithm in C++ #include <iostream> #include <list> using namespace std; class Graph { int numVertices; list<int> *adjLists; bool *visited; public: Graph(int V); void addEdge(int src, int dest); void DFS(int vertex); }; // Initialize graph Graph::Graph(int vertices) { numVertices = vertices...
ALGO
0.999983
6.092109
9c91e434-100a-4bc1-b57b-a75fba2f7b76
zhaoruowei/leetcode
sort_algorithm/radixsort.cpp
#include <iostream> #include <vector> #include <climits> #include <cmath> using namespace std; class sortalgorithm { public: void radixsort(vector<int>& nums) { int n = nums.size(); if (n < 2) { return; } // 求数组中最大位数 int digital = maxbits(nums); ...
ALGO
0.999946
4.908514
2ef39a48-f57a-4414-8ccd-3599934de85a
KwanWaiPang/SF-Loc_comment
thirdparty/gtsam/gtsam/nonlinear/ISAM2.cpp
/** * @file ISAM2.cpp * @brief Incremental update functionality (ISAM2) for BayesTree, with fluid * relinearization. * @author Michael Kaess, Richard Roberts, Frank Dellaert */ #include <gtsam/nonlinear/ISAM2-impl.h> #include <gtsam/nonlinear/ISAM2.h> #include <gtsam/nonlinear/ISAM2Result.h> #include <gtsa...
ALGO
0.999553
3.680485
5803fd28-c6a9-4098-be38-e1b7efd17d1e
h1kka/Snake_game
SnakeGame.cpp
#include <iostream> #include <raylib.h> #include <deque> #include <raymath.h> Color Green = Color{173, 204, 96, 255}; Color darkGreen = Color{43, 51, 24, 255}; int cellSize = 30; int cellCount = 25; int offset = 75; double lastUpdateTime = 0; bool ElementInDeque(Vector2 element, std::deque <Vector2> deque) { for (...
ALGO
0.993422
6.22992
3d0aabb1-2ab8-4ed6-9d54-f10e12a6b260
Chaichas/Reconnaissance-de-Plantes-avec-NN
src/softmax_layer.cpp
#include "../include/softmax_layer.h" #include <algorithm> #include "../include/Convolution_layer.h" void Softmax_layer::Flatten(const std::vector<std::vector<double>>& img_input, int d) { for (int i = 0; i < d; i++) { mFlatten.insert(mFlatten.end(), img_input[i].begin(), img_input[i].end()); } } voi...
ALGO
0.999612
3.807818
5cfbf6e1-2613-49ef-b72e-54329e44f77d
gnebehay/SCM
spams-matlab/linalg/mex/mexCalcXY.cpp
/*! * \file * toolbox Linalg * * by Julien Mairal * <EMAIL> * * File mexCalcXY.h * \brief mex-file, function mexCalcXY.h * Usage: XY = mexCalcXY(X,Y); */ #include <mex.h> #include <mexutils.h> template <typename T> inline void callFunction(mxAr...
ALGO
0.992922
4.674198
ac67b72a-35f5-41e5-8735-2bbe2d2c1a88
shailjadav/ARL_25_noetic_packages
open_manipulator_friends/open_manipulator_6dof_moveit/src/smoothing_trajectory_filter.cpp
/* Author: Chris Lewis */ #include <industrial_trajectory_filters/smoothing_trajectory_filter.h> #include <console_bridge/console.h> #include <moveit/robot_state/conversions.h> #include <stdio.h> #include <ros/ros.h> #include <ros/console.h> namespace industrial_trajectory_filters { SmoothingTrajectoryFilter::Smo...
ALGO
0.998396
5.236042
914deff9-ec19-4e97-a153-b6d6ca38bb3f
Chao200/sort
heapSort/heap_sort.cpp
#include <iostream> #include <vector> #include "heap_sort.h" using namespace std; // 建立最大堆 void buildMaxHeap(std::vector<int>& nums) { int n = nums.size(); for (int i = n / 2; i >= 0; --i) { maxHeapify(nums, i, n); } } // 保持最大堆性质 void maxHeapify(std::vector<int>& nums, int i, int n) { wh...
ALGO
0.999938
4.786955
824206f2-5fd6-4457-8f1d-6377eb3926aa
yymin1022/Algorithm_Study
BOJ/5800.cpp
#include <bits/stdc++.h> using namespace std; int main(){ cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(false); int K; cin >> K; for(int i = 1; i <= K; i++){ cout << "Class " << i << "\n"; int N; cin >> N; vector<int> score; for(int j = 0; j < N;...
ALGO
0.999662
3.621017
31145a2d-dc0e-4fe8-aabf-3ae02edd1ef1
kshprenger/algorithms
intern/tinkoff/infinite/A.cpp
#include <algorithm> #include <cstddef> #include <iostream> int main() { int64_t A, B, C, D; std::cin >> A >> B >> C >> D; std::cout << A + std::max(D - B, (int64_t)0) * C; }
ALGO
0.975595
3.663164
ab83ab11-38d1-43d3-a32b-66cd34ef04f0
ishandutta2007/codeforces
kostia244/normal/516/A.cpp
#include<bits/stdc++.h> using ll = long long; using namespace std; const int maxn = 1<<18, mod = 1e9 + 7; int main() { ios::sync_with_stdio(0); cin.tie(0); int n; char c; cin >> n; string s; while(n--) { cin >> c; if(c == '2') s += "2"; if(c == '3') s += "3"; if(c == '4') s += "322"; if(c == '5') s +=...
ALGO
0.999847
5.071905
69d186c8-76ef-4f51-83b2-1871ae5be0d3
yinzishuo1995/yinzishuo_cpp_primer_5th
pezy/ch09/ex9_22.cpp
#include <iostream> #include <vector> using std::vector; void insertDoubleValue(vector<int>& iv, int some_val) { auto cursor = iv.size() / 2; auto iter = iv.begin(), mid = iv.begin() + cursor; while (iter != mid) { if (*iter == some_val) { iter = iv.insert(iter, 2 * some_val); ...
ALGO
0.999468
5.566405
e6db20dd-5044-4370-858c-545033a813f7
meen05akshi/C-Programming-23-24
Week 5/5.0 Program 34.cpp
#include <stdio.h> int main() { int n,s1=0,s2=0; printf("Enter an even size of array: "); scanf("%d",&n); int a[n]; printf("Enter elements of array: \n"); for(int i=0;i<n;i++) scanf("%d",&a[i]); for(int i=0;i<n/2;i++) s1+=a[i]; for(int i=n/2;i<n;i++) s2+=a[i]; if (s1-s2>0) printf("\nArray is unba...
ALGO
0.999788
3.171957
dffe14c0-5ff7-4922-8846-bb5fa387a5ad
HaoranTang/data-structure-potds
potd-q30/HuffmanUtils.cpp
#include "HuffmanNode.h" #include "HuffmanUtils.h" #include <string> #include <map> using namespace std; /** * binaryToString * * Write a function that takes in the root to a huffman tree * and a binary string. * * Remember 0s in the string mean left and 1s mean right. */ string binaryToString(string binaryStr...
ALGO
0.996083
5.407773
6c573506-84ff-47b1-bcd9-61466193c466
MdSadman39/Algorithm-lab-work-2.2-sem-220139
Lab_01_max_min.cpp
#include<bits/stdc++.h> using namespace std; int main() { int n; cin>>n; int arr[n]; for (int i=0; i<n; i++) { cin>>arr[i]; } for (int i=0; i<n; i++) { cout<<arr[i]<<endl; } int max=arr[0]; int min=arr[0]; for(int i=0; i<n; i++) { if (arr[i]>ma...
ALGO
0.999811
3.900811
e961f812-7b48-4edb-a997-047d6f72163a
MarkKirichev/SoftUni
C++ Fundamentals/01. Introduction to C++ and Basic Syntax/03-Quadratic-Equaation.cpp
#include <iostream> #include <cmath> using namespace std; int main() { double a, b, c; cin >> a >> b >> c; double discriminant = b*b - 4*a*c; if (discriminant < 0.0) { cout << "no roots" << endl; return 0; } else if (discriminant == 0.0) { b = -b; b /= ...
ALGO
0.999617
4.048345
9e7cc6d8-15e3-4c76-a343-839b69f80c4f
113bommy/LogicalErrorFixCodeT5
logicalErrorFix_CodeT5_no_LineNumber/model/cpp/cpp_source/source_155.cpp
#include <bits/stdc++.h> using namespace std; const int inf = 2000000000; const long double eps = 1e-07; int n; int a[200000]; int d[200000]; int main() { scanf("%d", &n); for (int i = 0; i < n; ++i) scanf("%d", &a[i]); d[0] = -inf; for (int i = 1; i <= n; ++i) d[i] = inf; for (int i = 0; i < n; i++) { int l = 0; int r...
ALGO
0.999774
3.884265
6686112c-fca3-4d90-b449-db1e9fd5dd9f
ahmedsaed/MUST-CS
CS102/week 6/Lab 5/Q1.cpp
#include <iostream> using namespace std; void swap(int& n1, int& n2) { n1 += n2; n2 = n1 - n2; n1 -= n2; } void order(int& n1, int& n2, int& n3) { if (n1 > n2 && n1 > n3) swap(n1, n3); if (n2 > n1 && n2 > n3) swap(n2, n3); if (n1 > n2) swap(n1, n2); } int main() { ...
ALGO
0.999532
4.162444
d87c6287-8e65-43d7-8808-0fb990edeb0c
fernandanavamoya/greedyAlgorithms
shapeContext.cpp
/* Matching with Shape Contexts Fernanda Nava Moya - A01023896 30/11/2021 */ #include <bits/stdc++.h> using namespace std; // class of Points of figure class Point { public: // x-axis and y-axis coordenates of point int x, y; // class inizializers Point(int x, int y){ this->x = x; thi...
ALGO
0.999865
4.752051
c0c86f7d-3dec-42e6-8ddc-4693bca79f1b
SanskariWolf/DataStructures
Linked List/[1]Singly Linked List/[2]Ascending Order Linked List.cpp
#include<iostream> using namespace std; class linklist{ private: struct node{ int data; node *link; }*p; public: linklist(); void add(int num); void display(); int count(); void del(int num); ~linklist(); }; linklist::link...
ALGO
0.997667
3.675468
29f5352b-0e2c-4c43-b06c-2192b6ca92ce
garvit-bhardwaj/Leetcode-Problems-Solutions
Merge Similar Items.cpp
vector<vector<int>> mergeSimilarItems(vector<vector<int>>& items1, vector<vector<int>>& items2) { map<int,int> m; for(int i=0;i<items1.size();i++) { m[items1[i][0]]=items1[i][1]; } for(int i=0;i<items2.size();i++) { if(m.find(items2[i][0])!=m....
ALGO
0.999856
4.881371
7d6fea58-dd96-41fa-9175-868f6bcf4492
sbturtle/Algorithm
재시도/(미완)1931_회의실 배정.cpp
#include <iostream> #include <vector> #include <algorithm> using namespace std; #define st second #define ed first #define LL long long int main() { ios_base::sync_with_stdio(0); cin.tie(0); int n; cin >> n; vector<pair<LL, LL>> vec; for (int i = 0; i < n; i++) { int st, ed; cin >> st >> ed; vec.push_back...
ALGO
0.999805
3.902881
39d529b1-b502-4a7b-8deb-5d711b62e370
pradumankumar9079/WebTech
CPP/test1.cpp
#include <iostream> using namespace std; int sumOfEachDigit(int num) { int sum = 0; while (num > 0) { int rem = num % 10; sum += rem; num /= 10; } return sum; } int main() { // cout << "Raja raj\n" // << endl; // Unlike java not need to specify d // dou...
ALGO
0.999565
4.947126
2978977e-8244-4dfa-9fe2-eb5613d5fcde
Banerjeehub/GFG
Medium/Detect cycle in an undirected graph/detect-cycle-in-an-undirected-graph.cpp
//{ Driver Code Starts #include <bits/stdc++.h> using namespace std; // } Driver Code Ends class Solution { public: // Function to detect cycle in an undirected graph. bool dfs(int node, int parent, int *visited, vector<int>adj[]) { visited[node] = 1; for(auto it : adj[node]) ...
ALGO
0.999934
6.244573
307c16c9-5041-48f0-b11a-6d40a1ab6c04
MarkRoy8888/CarND-Project-7-Highway-Driving
src/Eigen-3.3/doc/examples/QuickStart_example.cpp
#include <iostream> #include <Eigen/Dense> using Eigen::MatrixXd; int main() { MatrixXd m(2,2); m(0,0) = 3; m(1,0) = 2.5; m(0,1) = -1; m(1,1) = m(1,0) + m(0,1); std::cout << m << std::endl; }
ALGO
0.98603
3.474624
ee715fd0-a8b4-4526-80e4-17547241f13c
abdullahIt18040/cps_course_level_1
Bisection_problem/sieve_prime.cpp
#include<bits/stdc++.h> using namespace std; #define endl '\n' #define optimization() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0); const int mx=1e8+123; vector<int>prime; bool is_prime[mx]; void prime_gen(int n) { n+=100; for(int i=3;i<=n;i+=2) { is_prime[i]=1; } for(int i=3;i...
ALGO
0.999409
3.86247
36484431-352e-4d2a-b887-c7e06d238144
salllman84/AllCodes
DSA Data Structure and Algurithems/linklist/InsertTail.cpp
#include <iostream> using namespace std; class Node { public: int data; Node* next; Node(int value){ data = value; next = NULL; } //Node(int value) : data(value), next(nullptr) {} }; class LinkedList { private: Node* head; public: LinkedList(){ head = NULL; ...
ALGO
0.999361
6.179106
c080e54f-d135-4427-b659-a3761d2f721b
Sachin-Rawat07/LearningCplusplus
stacks/stackClass.cpp
#include <iostream> using namespace std; class Stack { public: int *arr; int size; int top; Stack(int size){ this->size=size; arr=new int [size]; top=-1; } void push(int element){ if(size-top>1){ top++; arr[top]=element; } ...
ALGO
0.993839
4.546023
f838fd5e-f833-4058-b9e3-32702fa874b5
furqi-code/Cpp__Programs
some DSA & basics/PrimeoRCo-prime.cpp
#include<iostream> using namespace std ; main() { int n , cnt=0 ; cout<<"Enter a number : " ; cin>>n ; for(int i=1 ; i<=n ; i++) { if(n%i==0) { cnt++ ; } } if(cnt==2) { cout<<n<< " is Prime"<<endl ; } else if(cnt>2) { cout<<n<< " is Co-Prime"<<endl ; } // Another more efficient approach /...
ALGO
0.9996
3.624194
5cec6604-deb1-4499-8690-ed764387266b
iamDip171/Codeforces
A_Whose_Sentence_is_it.cpp
#include <bits/stdc++.h> using namespace std ; int main () { string s, s2 = "lala.", s1= "miao." ; int n ; cin >> n ; getchar() ; while (n--){ int col1=0, col2=0 ; getline (cin,s) ; int m= s.length() ; if (s[0]=='m' && s[1]=='i' && s[2]=='a' && s[3]=='o' && s[4]=='...
ALGO
0.999505
3.977278
0039525a-fec2-441a-ab6d-4676bc1a1409
AbhijitDoesCoding/Coding
Important Alogrithms/maxfreqcounter.cpp
int highestFrequency(const vector<int>& arr) { unordered_map<int, int> freqMap; // Count frequencies of elements in the array for (int num : arr) { freqMap[num]++; } // Find the element with the highest frequency int maxFreq = 0; int maxFreqElement = arr[0]; // Default to the first...
ALGO
0.999847
6.540689
50348838-7e59-4f61-ace0-e59399831767
AlinurMammadzada5/CPP-Learning
lesson7/task67.cpp
#include <iostream> using namespace std; int main(){ int number1; int number2; int totalSum1=0; int totalSum2=0; cin>>number1>>number2; /* if(number2>number1){ for(int i=number1;i<number2;i++){ for(int j=2;j<=(i/2);j++){ if(i%j==0){ totalSum1+=j; } } cout<<totalSum1<<endl; ...
ALGO
0.999871
5.223499
5438fa2d-f109-4b0d-9c17-db36354cb0f9
SoshunNaito/kyopro-library
tree.cpp
///////////////// 各種設定 ///////////////// #define USE_SUBTREE_SIZE #define USE_LCA #define USE_TREE class TreeClass { // 木の入力を受け取る public: TreeClass(int n, int _root = 0) { // 頂点数nのグラフを初期化する。 N = n; root = _root; nodeWeight.resize(N, 1); next.resize(N); #ifdef USE_SUBTREE_SIZE subtree_size.resize(N); #endi...
ALGO
0.999683
3.46733
ad5138cf-e43a-473c-baf0-54f52df8bbbd
siddu138/c-programs
pascal.cpp
#include <stdio.h> int main() { int i, j, rows; printf("Enter number of rows: "); scanf("%d", &rows); for(i=1; i<=rows; i++) { for(j=1; j<i; j++) { printf(" "); } for(j=i; j<=rows; j++) { printf("*"); } printf("\n"); } retu...
ALGO
0.983186
3.88099
a0f78a9c-2716-4951-a444-ca94bd92030f
Riu-Rathor/Leetcode
985-bag-of-tokens/bag-of-tokens.cpp
class Solution { public: int bagOfTokensScore(vector<int>& tokens, int power) { int n = tokens.size(); sort(tokens.begin(), tokens.end()); int i = 0; int j = n-1; int score = 0; int maxScore = 0; while(i <= j) { if(power >= tokens[i]) { ...
ALGO
0.999977
6.393379
ef0ad3bb-ac69-4ccc-942c-a6037d6b9f1a
ishandutta2007/codeforces
rivalq/normal/151/A.cpp
#include<bits/stdc++.h> using namespace std; int main(){ int n,k,l,c,d,p,nl,np; cin>>n>>k>>l>>c>>d>>p>>nl>>np; int qeach=k*l/nl; int slices = d*c; int salteach=p/np; vector<int> v={qeach,slices,salteach}; cout<<*min_element(v.begin(),v.end())/n; }
ALGO
0.999612
3.297646
d7402dde-7cce-4286-95ea-24275ca512d6
aravind9154/CSA0261-C-PROGRAMMING
daily practice 1/13.cp(day 3).cpp
#include <stdio.h> int sumOfNaturalNumbers(int start, int end); int main() { int start, end, sum; printf("Enter lower limit: "); scanf("%d", &start); printf("Enter upper limit: "); scanf("%d", &end); sum = sumOfNaturalNumbers(start, end); printf("Sum of natural numbers from %d t...
ALGO
0.998103
4.373606
f736649a-0c93-4702-84d5-0d65b15c6f95
bhavymunjani/CPP
evenorodd.cpp
#include<iostream> using namespace std; int main() { int n; cout<<"enter the value of n"<<endl; cin>>n; if(n%2==0) { cout<<"even"<<endl; } else{ cout<<"odd"<<endl; } }
ALGO
0.999279
3.148357
74ef23c7-124a-4137-81cf-c09e3b5b2787
leeihcy/UI2023
ui/UISDK/Src/UIEffect/blur/webkit/shadowblur.cpp
#include "stdafx.h" #include "shadowblur.h" #include <math.h> // Ҫ㣺 // // 1. box blurGaussian blur // 2. 3box blurЧӽGaussian blur // 3. һbox blurʵΪһ Horz motion blur + Vert motion blur // 4. // // Box blurs are frequently used to approximate a Gaussian blur. // By the central limit theorem, if applied 3 times on the ...
ALGO
0.998802
4.884873
25a1e13c-5df6-4a98-ae54-5a0931d44b35
lshpku/gem5-runahead
src/systemc/tests/systemc/misc/v1.0/dash2/dist.cpp
/***************************************************************************** dist.cpp -- Implementation of the odometers. Original Author: Ali Dasdan, Synopsys, Inc. *****************************************************************************/ /************************************************************...
ALGO
0.986108
6.317926
b7b8f067-f214-48ab-9639-abcae43f53a4
OSVR/OSVR-Core
src/osvr/Server/ConfigFilePaths.cpp
/** @file @brief Platform specific search paths for osvr server config files. @date 2017 @author Sensics, Inc. <http://sensics.com/osvr> */ // Internal Includes #include <osvr/Server/ConfigFilePaths.h> #include <osvr/Server/ConfigureServerFromFile.h> #include <osvr/Util/BinaryLocation.h> #include...
CONFIG
0.964189
7.454523
79063959-5656-480c-8c81-bad5c4fd8d1c
sarvex/leetcode-rect
solution/0800-0899/0886.Possible Bipartition/Solution.cpp
class Solution { public: bool possibleBipartition(int n, vector<vector<int>>& dislikes) { vector<int> p(n); iota(p.begin(), p.end(), 0); unordered_map<int, vector<int>> g; for (auto& e : dislikes) { int a = e[0] - 1, b = e[1] - 1; g[a].push_back(b); ...
ALGO
0.999943
5.990525
7b21718b-a9b9-49e7-94db-d91415d33e74
CTKWOKcn/Programming-and-Algorithms-Solution
Programming and Algorithms Ⅱ/Help Jimmy(POJ1661).cpp
//#include<iostream> //#include<algorithm> //using namespace std; //const int INF = 999999; //int N, X, Y, MAX; //int X1[1000], X2[1000], H[1000]; //bool a[40001][20000]; //int V(int x, int y); //int deltaY[40001][20000]; //int deltaXL(int x, int y); //int deltaXR(int x, int y); //int main() { // int t; // cin >> t; //...
ALGO
0.999911
3.667628
d59785e9-c834-4018-adf1-d64b4b1c8e12
semkilljaeden/LeetCodePractice
LeetCodePractice/LeetCodePractice/Q116_PopulatingNextRightPointersinEachNode.cpp
#include<vector> #include "Node.cpp" //2:00 to 2:37 //read the solution, the solution is brilliant, sad i did not come up with my own. the code is quite ez /* Runtime: 12 ms, faster than 98.88 % of C++ online submissions for Populating Next Right Pointers in Each Node. Memory Usage : 17.3 MB, less than 57.13 % of C++ ...
ALGO
0.999965
5.13548
b5ed0c89-d9ca-404e-8673-582bff534fd0
ishandutta2007/codeforces
s2speed/normal/1341/B.cpp
#include<bits/stdc++.h> typedef long long ll; using namespace std; ll a[200000] , l[200000]; int main(){ ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); ll t; cin>>t; while(t--){ vector<ll> dp; ll n , k , o = 0; cin>>n>>k; for(int i = 0 ; i <= n - k ; i++){ dp.push_back(0); } cin>>a[...
ALGO
0.999874
3.515937
b7bac7d1-4524-468c-8878-0bdbae31ce6f
naxocist/POSN-IPST
cses/Tree_algorithms/tree_diameter.cpp
#include <bits/stdc++.h> using namespace std; const int N = 2e5 + 3; vector<int> adj[N]; int crr, f; void dfs(int u, int p, int d) { if(d > crr) crr = d, f = u; for(auto v : adj[u]) { if(v == p) continue ; dfs(v, u, d + 1); } } int main() { cin.tie(nullptr)->sync_with_stdio(false); int n, s=0; cin >> n; w...
ALGO
0.998053
4.633638
86bdb644-366f-4fa4-ab24-b527b701bad2
iliyian/vjudge.net
zjut2023week6/S.cpp
#include <bits/stdc++.h> #define N 105 using namespace std; bitset<N> a[N]; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); freopen("S.in", "r", stdin); int n; cin >> n; for (int i = 1; i <= n; i++) for (int j = 1; j <= n; j++) { int x; cin >> x; a[i][j] = x; } for (int k =...
ALGO
0.999398
3.673884
4e4b466b-3636-4123-addd-32c69731cff0
chickenchobab/BOJ-problem-solving
1_math/2_number/2745.cpp
#include <iostream> #include <algorithm> #include <vector> #define fastio ios::sync_with_stdio(false);cin.tie(0);cout.tie(0); using namespace std; string N; int B; void input(){ cin >> N >> B; } void solve(){ int answer = 0; int digit = 1; for (int i = N.length() - 1; i >= 0; --i){ if (isalpha(N[i])) an...
ALGO
0.999596
4.548408
7b907342-f594-4008-9738-c7619ad90027
Choaib-ELMADI/top-100-liked-leetcode-questions
101 -- 200/101. Symmetric Tree/main.cpp
/* !!!!!!!!!!!!!!!!!!!!!!!!!!!! !!! !!! !!! CODE NOT WORKING !!! !!! !!! !!!!!!!!!!!!!!!!!!!!!!!!!!!! */ #include <iostream> #include <queue> using namespace std; struct TreeNode { TreeNode(): val(0), left(nullptr), right(nullptr) {} ...
ALGO
0.999773
6.436644
add7454c-4c23-4921-9f92-912c321291c8
AbhishekMaira10/InterviewPrep-CP
Practice/LinkedLists/swap_two_nodes.cpp
#include <bits/stdc++.h> #include "Node.h" using namespace std; void swapNodes(Node *head, int x, int y) { if (x == y) return; //search for x Node *prevX = NULL, *currX = head; while (currX && currX->data == x) { prevX = currX; currX = currX->next; } //search for y Node *prevY = NULL, *cu...
ALGO
0.999905
4.694906
cb514a76-27ae-4dff-9c97-cef1e53ba2b4
pritamkashyap/Competitive-Programming
Graph/Kruskal'sAlgorithm.cpp
/****************************************** * AUTHOR : PRITAM KUMAR * * INSTITUTION : BIT SINDRI * ******************************************/ #include<bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> using namespace __gnu_pbds; using namespace std; #define ff first #define ss second...
ALGO
0.999986
4.629086
a5bd9cf0-c8a4-4c4b-bb57-a34d110335b7
JacobDDoS/Competitive_Programming
CodeForces/1100-1400/Double_Sort.cpp
// Author: JacobDDoS // Date: 3/10/23 // Problem: Double Sort #include <bits/stdc++.h> using namespace std; typedef unsigned long long ull; typedef long long ll; typedef double long ld; void solve() { int n; cin >> n; vector<int> a(n); vector<int> b(n); vector<pair<int, int>> moves; for (int i=0...
ALGO
0.999912
3.952534
c35f6bed-3a08-4bd7-9eb3-bd6c6a4d5a51
iSuneast/uva-codes-for-acm-icpc
UVa 10000/10147 - Highways_0326_graph theory_MST.cpp
/* 10147 - Highways MST... */ #include<iostream> #include<cmath> #include<queue> #define MAXN 760 using namespace std; typedef pair<int,int> pii; int n,fa[MAXN]; double x[MAXN],y[MAXN]; struct graph { int s,e; double w; }pnt; struct cmp { bool operator()(graph a,graph b) { return a.w>b.w; } }; int find(int...
ALGO
0.999944
4.125676
6ea2d2f6-cc7a-4154-bbb7-5a50c9889a8a
ishandutta2007/codeforces
andrew.volchek/normal/165/B.cpp
#include <iostream> using namespace std; int main() { long N,K; cin >> N >> K; unsigned long long l,r; unsigned long long sum; unsigned long long d; l = 1; r = N; while(l!=r) { unsigned long long m = (l+r)/2; d = 1; sum = 0; while(m/d) { sum += m/d; d *= K; } if(sum >= N) { r = (...
ALGO
0.999977
3.393168
2046e22a-eae0-40ec-9a1a-5cda65954360
Nitish-2000/namer_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.9988
6.76073
f400cbc6-0690-44ee-b55b-9ecc6196efac
yzzzh/ChangLuBei
TrieProj/DLeftCountingBloomFilter.cpp
#include "DLeftCountingBloomFilter.h" DLeftCountingBloomFilter::DLeftCountingBloomFilter() { // initialization for (int i = 0; i < DLEFT_SUBTALBE_SIZE; i++) hashtables[i] = (HashTable*)calloc(1, sizeof(HashTable)); } // add element void DLeftCountingBloomFilter::add(const string &str) { if (isContain(str)) ret...
ALGO
0.964666
4.585084
94be89b9-61a7-4179-b346-e48371cf0e4b
weee1211/itsa_C-
rmath28.cpp
#include <iostream> #include <vector> int main() { int a; std::vector<int> b; while (std::cin >> a) { for (int i = 1; i <= a; i++) { if (i % 5 == 0 && i % 7 == 0) { b.push_back(i); } } for (int i = 0; i < b.size(); i++) { ...
ALGO
0.999814
4.247373
024aaefa-91ac-4849-8bb0-3eaba1594d85
tzupengwang/PECaveros
contest/ASC/ASC29/b.cpp
#include <bits/stdc++.h> using namespace std; #define N 101010 struct Nd{ int mx , who; Nd *tl , *tr; Nd(){ mx = who = 0; tl = tr = NULL; } }; #define mid ((l+r)>>1) int MX( Nd* now ){ return now ? now->mx : 0; } int Who( Nd* now ){ return now ? now->who : 0; } void modify( Nd* now , int l , int r ,...
ALGO
0.99999
3.504891
956d6b05-5da4-48de-9424-6d5e96e5c68f
bossxu/acm
比赛/队内赛/补题/hdu3038.cpp
#include<iostream> #include<cstdio> #include<cstring> #include<algorithm> #include<queue> #include<stack> #include<cmath> #include<vector> #include<set> #include<cstdlib> #include<map> using namespace std; #define INF 0x3f3f3f3f const double eps = 1e-6; #define ll long long #define clr(a,x) memset(a,x,sizeof(a)) //带权并查...
ALGO
0.999946
4.115745
50cb2576-d86a-4fb8-9ff4-f1a45c25f728
Shishir1035/CP101
Codeforces/2020 April - 2021 Nov/Way too long words.cpp
///https://codeforces.com/problemset/problem/71/A #include<stdio.h> #include<string.h> int main() { int t; char str[110]; scanf("%d",&t); for(int i=1;i<=t;i++) { scanf("%s",&str); if(strlen(str)<=10) printf("%s\n",str); else printf("%c%d%c\n",str[0],s...
ALGO
0.999042
3.161924
a6ee4f0b-8a6a-4d96-a197-d53d06fd4441
shubhamsingh94/SPOJ
spoj/BENEFACT.cpp
/* Author : SHUBHAM SINGH */ #include<bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> vi; typedef vector<ll> vl; typedef vector<vi> vvi; typedef vector<vl> vvl; typedef pair<int,int> pii; typedef pair<ll,ll> pll; typedef vector<pii> vpii; typedef vector<pll> vpll; typedef vector<...
ALGO
0.999806
4.528296
80270b34-ff4b-482c-9e7e-b00c7aa4d9b6
everysoftware/c-huffman
utils.cpp
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> #include <stdbool.h> #include "utils.h" #include "nodes.h" size_t GetSizeOfFile(const char* filename) { FILE* f = NULL; if (fopen_s(&f, filename, "rb") != 0) { perror("fopen_s"); exit(EXIT_FAILURE); } fseek(f, 0L, SEEK_END); long fl...
TOOL
0.987298
4.757335
f2d16f6f-3e53-48aa-afd7-1aae594872a5
ZaxonChow/C_Code
2023_04_17_minesweeper/2023_04_17_minesweeper/work1.cpp
#define _CRT_SECURE_NO_WARNINGS 1 #include<stdio.h> #include<limits.h> int main() { int arr[] = { 1, 2, 3, 4, 5, 1, 2, 3, 4 }; //ҳֻһεԪ int i = 0; int ret = 0; int sz = sizeof(arr) / sizeof(arr[0]); for (i = 0; i < sz; i++) { ret = ret^arr[i]; } printf("%d\n", ret); //// //int i = 0; //int sz = sizeof(arr...
ALGO
0.999611
3.399979
be54cfb3-ac3b-4ac7-b6e3-50ca02730f2d
chenbei97/myLeetCode
STLTestCode/thread/c++11并发与多线程_bilibili/chapter4/main.cpp
/*** * @Author: chenbei * @Date: 2022-05-25 15:27:35 * @LastEditTime: 2022-05-26 10:07:17 * @Description: \chapter4\main.cpp * @FilePath: \myLeetCode\STLTestCode\thread\c++11并发与多线程_bilibili\chapter4\main.cpp * @Signature: A boy without dreams */ #include <iostream> #include <thread> #include <mutex> #include <v...
TOOL
0.96618
4.286297
d6d746b0-6b19-4749-a4a9-4565d9ee3cbe
bee0511/Computer-Security-Capstone
project1/csc2024-project1/source/sadb.cpp
#include "sadb.h" #include <arpa/inet.h> #include <linux/pfkeyv2.h> #include <sys/socket.h> #include <unistd.h> #include <cstdint> #include <iomanip> #include <iostream> #include <span> #include <string> #include <vector> std::optional<ESPConfig> getConfigFromSADB() { // Allocate buffer std::vector<uint8_t> mess...
TOOL
0.897022
6.451339
f1d75716-3f2a-4d19-9f03-4ea0f7000060
Maitrey27/DsaDaily
1352-product-of-the-last-k-numbers/1352-product-of-the-last-k-numbers.cpp
class ProductOfNumbers { public: vector<int>arr; ProductOfNumbers() { } void add(int num) { arr.push_back(num); } int getProduct(int k) { int cnt =0; int product =1; for(int i= arr.size()-k; i<arr.size();i++) { ...
ALGO
0.999961
5.664838
737b7668-782f-4f87-ab9f-9715fc11a345
HJWAJ/acm_codes
PKU/2600-2699/P2610.cpp
#include<iostream> #include<cstdio> #include<cstring> #include<cmath> using namespace std; double dis(double x1,double y1,double x2,double y2) { return sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2)); } int main() { double x1,y1,x2,y2,x,y,d1,d2; int val=0; scanf("%lf%lf%lf%lf",&x1,&y1,&x2,&y2); while...
ALGO
0.999823
3.333851
f12ea80d-922a-41c0-97ad-7e09542b6b17
raincross7/code-similarity
codes/train_code/problem500/problem500_214.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<int, int>; const int INF = 1001001001; const ll LINF = 1LL << 60; const int MOD = 1'000'000'007; template <typename T> void print(const T &v) { for (int i = 0; i < v.size(); i++) { if (i) cout << ' '; ...
ALGO
0.999783
4.082618
990ebe3d-ca74-497e-8f32-a6a369e9d979
snehamaryshaji/CPP_Training_U
assignment/day10/day10/qn6_sum_is_even.cpp
#include<iostream> using namespace std; bool check_even(int num1, int num2) { int sum = num1 + num2; if (sum % 2 == 0) { return true; } else { return false; } } int main() { int num1, num2; cout << "enter two numbers" << endl; cin >> num1 >> num2; if (check_even(num1, num2)) { cout << "the sum is even...
ALGO
0.999252
4.057756
f50931e8-8ff8-47ae-9a42-3c9e177740a8
anoobzg/qi
src/blender/src/intern/iksolver/intern/IK_QJacobianSolver.cpp
/** \file * \ingroup iksolver */ #include <stdio.h> #include "IK_QJacobianSolver.h" //#include "analyze.h" IK_QJacobianSolver::IK_QJacobianSolver() { m_poleconstraint = false; m_getpoleangle = false; m_rootmatrix.setIdentity(); } double IK_QJacobianSolver::ComputeScale() { std::vector<IK_QSegment *>::iter...
ALGO
0.996273
6.470786
56c11934-faed-4f84-9085-72d3d28f96c6
JiakunYan/arl
examples/microbenchmark/attentiveness/upcxx_at.cpp
// // Created by jackyan on 4/3/20. // #include <iostream> #include <string> #include <vector> #include <random> #include <chrono> #include <upcxx/upcxx.hpp> #include "gex_timer.hpp" using namespace upcxx; template<int N> struct ReqPayload { char data[N] = {0}; }; template<int N> struct AckPayload { char data[N...
TEST
0.962583
5.481606
f74af20f-a2fe-4f5b-8f88-eddc9c9cd076
EvinHafner/OceanBase
src/observer/sql/optimizer/comparison_simplification_rule.cpp
// // Created by Wangyunlai on 2022/12/13. // #include "sql/optimizer/comparison_simplification_rule.h" #include "sql/expr/expression.h" #include "common/log/log.h" RC ComparisonSimplificationRule::rewrite(std::unique_ptr<Expression> &expr, bool &change_made) { RC rc = RC::SUCCESS; change_made = false; if (expr...
TOOL
0.968796
5.691233
e6e14478-8e9a-45e9-9107-33d1feba8d7f
isha141/LeetCode
0001-two-sum/0001-two-sum.cpp
class Solution { public: vector<int> twoSum(vector<int>& nums, int target) { int n=nums.size(); map<int,int>mp; for(int i=0;i<nums.size();i++) { if(mp.count(target-nums[i])) { return {i,mp[target-nums[i]]}; } else ...
ALGO
0.999836
6.223547
dfa676b9-e023-43c0-b1ea-6e861326d16d
isangyoon-zz/BOJ
11720.cpp
#include <iostream> #include <cstdio> #include <numeric> int N; int numbers[101]; int main(int const argc, char const** argv) { scanf("%d", &N); for (auto i = 0; i < N; ++i) { scanf("%1d", &numbers[i]); } printf("%d\n", std::accumulate(std::begin(numbers), std::end(numbers), 0)); return 0; }
ALGO
0.99974
4.638193
936eba21-ab4d-42fe-bf78-db60870ddc97
chenliru/cweb.io
cplusplus/Model/Model.cpp
#include "Model.h" #include "../Camera/Common.h" Model::Model() { DataSet dataset(DATASET); imagePath = dataset.imagePath; videoPath = dataset.videoPath; modelPath = dataset.modelPath; } Mat Model::frameROI(Mat frame) { //""" // Region Of Interest(roi) of input image // : param frame : input image // : param ...
ALGO
0.938717
5.320364
b2df6f5d-cc98-4fa2-bec0-2c7ae5639485
CarbonROM/android_device_xiaomi_msm8956-common
data-ipa-cfg-mgr/hal/src/PrefixParser.cpp
/* External Includes */ #include <arpa/inet.h> #include <netinet/in.h> #include <netinet/ip.h> #include <string.h> #include <sys/socket.h> #include <sys/types.h> #include <vector> /* Internal Includes */ #include "IOffloadManager.h" #include "PrefixParser.h" /* Avoiding namespace pollution */ using IP_FAM = ::IOffloa...
TOOL
0.855578
6.35847
a6531e84-195d-4853-9c9c-b75a4d52053c
shelltdf/osgall
prebuild/opencv-2.4.13/modules/video/src/bgfg_gmg.cpp
/* * This class implements an algorithm described in "Visual Tracking of Human Visitors under * Variable-Lighting Conditions for a Responsive Audio Art Installation," A. Godbehere, * A. Matsukawa, K. Goldberg, American Control Conference, Montreal, June 2012. * * Prepared and integrated by Andrew B. Godbehere. */...
ALGO
0.976815
7.104128
464f617f-bd7f-408b-9c08-eb8ceaa2f276
cunbidun/competitive_programming
archive/Codeforces - Codeforces Global Round 15/C. Maximize the Intersections/solution.cpp
#include <bits/stdc++.h> using namespace std; template <class c> struct rge { c b, e; }; template <class c> rge<c> range(c i, c j) { return rge<c>{i, j}; } template <class c> auto dud(c *x) -> decltype(cerr << *x, 0); template <class c> char dud(...); struct debug { #ifdef LOCAL ~debug() { cout << endl; } templat...
ALGO
0.99986
4.573375
7b6182b5-2fd7-47dc-b12c-191a2705088a
ishandutta2007/codeforces
zemen/normal/638/B.cpp
#include <bits/stdc++.h> using namespace std; #define sz(x) ((int) (x).size()) #define forn(i,n) for (int i = 0; i < int(n); ++i) #define forab(i,a,b) for (int i = int(a); i < int(b); ++i) typedef long long ll; typedef long long i64; typedef long double ld; const int inf = int(1e9) + int(1e5); const ll infl = ll(2e...
ALGO
0.999996
4.157097
43f01cfb-5d6a-4768-a22c-8341e7786f11
cormoran/CompetitiveProgramming
src/contest/codeforces/188div1/B.cpp
//#include<bits/stdc++.h> #include<cstdio> #include<cstdlib> #include<iostream> #include<algorithm> #include<vector> #include<stack> #include<queue> #include<set> #include<string> #include<cmath> #include<cassert> #include<map> using namespace std; typedef pair<int,int> pii; typedef long long ll; typedef ll int__; #de...
ALGO
0.999954
3.042047
24037baf-0956-4475-865d-6c3aaa6e8b52
BeastBoy2209/ADSkbtu
Lab4/f.cpp
#include <iostream> #include <queue> using namespace std; struct Node { int key; Node *l, *r; Node(int key) { this->key = key; this->l = NULL; this->r = NULL; } }; struct BST { Node *root; Node* insert(Node *cur, int key) { if(!cur) { return new No...
ALGO
0.999947
5.107419
a7796405-381e-4ad3-b720-939d6361435e
noah-ftnx/rpl
sde/14/08_.cpp
#include <stack> using namespace std; class StockSpanner { public: struct Item { int value{-1}, span{}; }; stack<Item> st; StockSpanner() { } int next(int price) { int span=1; while(!st.empty() && st.top().value <= price) { span+=st.top().span; st.pop(); } st.push({price, span});...
ALGO
0.998844
6.046913
00b29190-e95e-4c8c-a821-66b78ac1a513
SrinivasuluCharupally/interviewQuestions
Trees/FlattenBinaryTreeToOtherLinkedList.cpp
#include<iostream> #include<vector> using namespace std; typedef struct treeNode { int data; treeNode *right, *left; treeNode(int i) : data(i), left(NULL), right(NULL) {} } treeNode; typedef struct mylist { int data; mylist *next; mylist(int i) : data(i), next(NULL) {} } mylist; mylist *headmylist = NULL; my...
ALGO
0.999985
4.306681
17d678e8-5789-4a16-a703-a1349c8f8a5a
Afraz-Khan1/Practice-Questions-OOP
Question 2_Template_fucntion_swap_value.cpp
#include<iostream> using namespace std; template <class T> void swapValues(T &a, T &b) { T temp; temp = a; a = b; b = temp; } int main() { int num1 = 5, num2 = 10; cout << "Before swapping:\n"; cout << "num1 = " << num1 << ", num2 = " << num2 << endl; swapValues(num1, num2); cout...
ALGO
0.999675
5.945029
fe3abb68-d4d5-4c37-b075-e47535743736
CSdlwr/OJ
POJ/3624/12894660_MLE.cpp
#include <iostream> using namespace std; #define MAX_NUM 5000 #define MAX_M 13000 int n, m; int w[MAX_NUM], d[MAX_NUM]; int v[MAX_NUM][MAX_M]; int maxValue(int i, int j); int main() { cin>>n>>m; int i; for (i = 0; i < n; ++i) cin>>w[i]>>d[i]; memset(v, -1, sizeof(v)); cout<<maxValue(n-1, m)<<endl; return 0; ...
ALGO
0.999969
3.987615
2fb02358-e850-4ce1-9a5c-5d6213021f1a
ishandutta2007/codeforces
heno239/normal/1283/C.cpp
#include<iostream> #include<string> #include<cstdio> #include<vector> #include<cmath> #include<algorithm> #include<functional> #include<iomanip> #include<queue> #include<ciso646> #include<random> #include<map> #include<set> #include<bitset> #include<stack> #include<unordered_map> #include<utility> #include<cassert> #in...
ALGO
0.999997
3.858835
3da154ac-ec8c-40f3-b189-8052101ddfd9
danyalmendigali/programming_scientific_codes
auto_scientific_codes/array---string/task_num2.cpp
#include <bits/stdc++.h> #include <windows.h> using namespace std; #define ll long long #define ar array #define FOR(i, a, b) for(int i = a; i < b; i++) class employee { private: string name; long int number; public: void getdate() { cout << "Введите имя: "; cin >> name; cout <...
TOOL
0.905594
3.959306
b9471140-05eb-4ef2-9e67-0076209e9b14
barisCanCoskun/DSA_using_C_and_Cpp
04Section7-Array-ADT/16Challenge_FindAPairOfElemsWithSumKInSorted/main.cpp
#include<iostream> typedef struct _Array { int A[10]; size_t size; size_t length; }Array; void Display(Array arr){ std::cout << "\nElements are:\n"; for (size_t i = 0; i < arr.length; i++) { std::cout << arr.A[i] << " "; } std::cout << std::endl; } void FindPairElementsSorte...
ALGO
0.997853
4.964248