uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
cf76ab43-2d4f-423b-8303-6b21a06e756c
RinCloud/TrickCatcher
Datasets/TrickyBugs/GenProgs/dpp_generated_progs_cpp/p03625/p03625_num2_parsed.cpp
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main() { int N; cin >> N; vector<int> sticks(N); for (int i = 0; i < N; i++) { cin >> sticks[i]; } sort(sticks.rbegin(), sticks.rend()); long long maxArea = 0; for (int ...
ALGO
0.999724
4.392298
0997de52-a1d3-47b3-a0c7-f274b28091f0
hacch141/Coding-Practice
LeetCode/1061-Lexicographically-Smallest-Equivalent-String.cpp
// 1061. Lexicographically Smallest Equivalent String class Solution { public: void dfs(int u, int& mn, vector<vector<int>>& adj, vector<int>& cmp_nodes, vector<int>& vis) { cmp_nodes.push_back(u); vis[u] = true; mn = min(mn, u); for(auto v : adj[u]) { if(!vis[v]) dfs(v...
ALGO
0.999989
6.35406
f49d3cb7-4fb0-4c23-925a-30d6f0e91d7f
Glasspham/DSA-28Tech
Sort-Search/lesson_41.cpp
#include<bits/stdc++.h> using namespace std; using ll = long long; int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); int n, x; cin >> n >> x; int a[n]; for(int &x : a) cin >> x; ll tong = 0, ans = 0; map<ll, int> tmp; for(int i = 0; i < n; ++i){ tong += a[i]; if(tong =...
ALGO
0.999958
4.351453
c279ad1e-527b-49bc-8617-015f49e0b173
judy5050/algorithmStudy
4358.cpp
//// //// 4358.cpp //// algo //// //// Created by ๋ฐ•ํšจ์ • on 2021/08/02. //// // #include <iostream> #include <algorithm> #include <vector> #include <string> #include <map> using namespace std; int main(){ cin.tie(0); cout.tie(0); std::ios::sync_with_stdio(false); string str=""; map<string,int>m;...
ALGO
0.999019
4.516319
51031777-de48-45e3-a8b0-0ae3ca9073c9
AngadSingh04/DSA-Leetcode
234.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) {} * }; */ class Solution { public: ListNode* revR(ListNo...
ALGO
0.999863
5.88215
4d23fd18-e1a8-449d-867e-d11cb36c0954
AlexPuenteJara/PROBLEMAS_CODEFORCES
DIV_2/1478/B. Nezzar and Lucky Number.cpp
#include <bits/stdc++.h> using namespace std; #define debug(x) cout << #x << " = " << x << endl #define fastio ios_base::sync_with_stdio(false);cin.tie(NULL) typedef long long ll; typedef pair<int, int> ii; typedef vector<int> vi; typedef vector<ii> vii; const int MAXN=1e5; const int inf=1e9; vector<int> g[MAXN] ; bool...
ALGO
0.999587
4.834435
34276ae1-f3a2-41bf-b6d5-5f5349198469
sangita2907/CPP
19_pattern9_1.cpp
/* Create a pattern where limit will be taken from the user. If user enters 4 then - 1 2 3 3 4 5 4 5 6 7 */ #include<iostream> using namespace std; int main(){ int limit; cout << "Enter limit: "; cin >> limit; int i = 1; while(i <= limit){ i...
ALGO
0.999196
4.241072
695a8350-9799-44e0-ab82-347c787a4962
gurtaransingh/cpp
Before FEB 22/Factors_Finding.cpp
#include<iostream> using namespace std; int main(){ int n,count=0; cin>>n; for(int i=1;i<=n;i++) { if (n%i==0) { count++; } } cout<<count<<endl; for(int i=1;i<=n;i++) { if (n%i==0) { cout<<i<<" "; } } return...
ALGO
0.99964
4.323809
5f9cfc5d-8913-40f7-bdca-00715c58fd6f
Fly0307/dtee_ncnn_face_recognition
src/host/secure/secure_include/ncnn.x64/layer/x86/concat_x86_avx512.cpp
#include "concat_x86_avx512.h" namespace ncnn { Concat_x86_avx512::Concat_x86_avx512() { #if __SSE2__ support_packing = true; #endif // __SSE2__ } int Concat_x86_avx512::forward(const std::vector<Mat>& bottom_blobs, std::vector<Mat>& top_blobs, const Option& opt) const { int dims = bottom_blobs[0].dims; ...
ALGO
0.964884
5.877703
11a8ca54-46d7-4f35-84bd-8f18707222cf
rainfall3363/Algorithms
Programmers/Greedy/Level_3-Making_Big_Number.cpp
#include <string> #include <vector> using namespace std; string solution(string number, int k) { string answer = ""; int erased = 0; // ๋‚ด๊ฐ€ ๋‚ด ๋‹ค์Œ๋ณด๋‹ค ์ž‘์œผ๋ฉด ๋‚˜ ์‚ญ์ œ for (int i = 0; i < number.size() - 1; i++) { if (erased == k) { break; } if (number.at(i) < number.at(i +...
ALGO
0.999972
5.483045
e4e4d1db-7a45-4ea1-b819-46390ee2ffa5
ishandutta2007/codeforces
lawrenceli/normal/487/C.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int MAXN = 100100; int n; int pow(int b, int e) { if (!e) return 1; if (e&1) return ll(b)*pow(b, e-1)%n; int res = pow(b, e/2); return ll(res)*res%n; } int main() { cin >> n; if (n == 1) { cout << "YES\n1\n";...
ALGO
0.99991
3.804632
5e09c5e9-b1f0-4add-9ea7-ea83992c5879
shorden/public
src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_bjarngrim.cpp
/* ScriptData SDName: Boss General Bjarngrim SD%Complete: 70% SDComment: Waypoint needed, we expect boss to always have 2x Stormforged Lieutenant following SDCategory: Halls of Lightning EndScriptData */ #include "ScriptMgr.h" #include "ScriptedCreature.h" #include "halls_of_lightning.h" enum Yells { SAY_AGGRO ...
TOOL
0.923194
6.26736
1af67418-175b-4af7-9d6a-7e30a899f348
Jatin-Shihora/LeetCode-Solutions
1379-find-a-corresponding-node-of-a-binary-tree-in-a-clone-of-that-tree/1379-find-a-corresponding-node-of-a-binary-tree-in-a-clone-of-that-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: TreeNode* getTargetCopy(TreeNode* orig, TreeNode* clone, TreeNode* targ) { return orig == nullpt...
ALGO
0.999767
5.598211
14542aab-2b3b-40e9-b3be-ff9196968982
weisongwen/GTSAM
gtsam/3rdparty/Eigen/bench/sparse_transpose.cpp
//g++ -O3 -g0 -DNDEBUG sparse_transpose.cpp -I.. -I/home/gael/Coding/LinearAlgebra/mtl4/ -DDENSITY=0.005 -DSIZE=10000 && ./a.out // -DNOGMM -DNOMTL // -DCSPARSE -I /home/gael/Coding/LinearAlgebra/CSparse/Include/ /home/gael/Coding/LinearAlgebra/CSparse/Lib/libcsparse.a #ifndef SIZE #define SIZE 10000 #endif #ifndef...
ALGO
0.995876
5.110691
5d876f1c-aa91-4e6c-a782-4120d2545291
thegamer1907/Code_Analysis
Codes/AC/3344.cpp
#include <bits/stdc++.h> #define li long long int #define MOD 1000000007 using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); li n; cin>>n; li arr[n]; for(li i=0;i<n;i++) cin>>arr[i]; li low=0; li high=1e10; li ans=0; while(lo...
ALGO
0.999973
3.621686
613155eb-7261-44c7-b475-923d358b6f03
ProfAndersonVanin/OpenVinoSmatCity
src/Tracker.cpp
#include "Tracker.h" /* ========================================================================== Class : Util Many useful but not fundamental functions are implemented in this class. All functions are static functions so don't need to make class Util object to use these functions. ================================...
ALGO
0.97393
5.561705
7437533c-69c3-44c9-9f6f-c8c811c1805b
huudung0607/Thuat-toan-Ly-thuyet-so
seive PrimeNumber(classic).cpp
#include <iostream> #include <cmath> using namespace std; bool isPrime(int n) { if (n == 0 || n == 1) { return false; } for (int i = 2; i <= sqrt(n); i++) { if (n % i == 0) { return false; break; } } return true; } int main() { int n...
ALGO
0.999908
4.790537
8b7dd8c5-74ba-4958-b93a-f0368911a32c
marianavillar/FAL
01plantilla.cpp
// Nombre y apellidos del alumno // Usuario del juez de clase #include <iostream> #include <iomanip> #include <fstream> #include <vector> #include <algorithm> #include <string> #include <utility> // Explicaciรณn del algoritmo utilizado // La lรณgica que he utilizado es comparar el mayor elemento a la izquierda de p (i...
ALGO
0.999879
4.336819
027848a0-5697-4a81-9e15-ad45ba033aba
kocanory/baekjoon
silver 1/4889.cpp
#include <iostream> #include <vector> using namespace std; int t = 0, cnt = 0; string s; vector<char> st; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); while(true){ t++; cnt = 0; st.clear(); cin >> s; if(s[0] == '-'...
ALGO
0.998091
3.558569
1e9a4390-ee98-4d66-ab9c-b6d54de519d9
raincross7/code-similarity
codes/train_code/problem282/problem282_330.cpp
#include<bits/stdc++.h> using namespace std; int main(){ int n,k; cin>>n>>k; bool num[n]; for(int i=0;i<n;i++){ num[i]=true; } for(int i=0;i<k;i++){ int d; cin>>d; for(int j=0;j<d;j++){ int a; cin>>a; num[a-1]=false; } ...
ALGO
0.999504
3.246369
eb5bbe53-0de8-4f0f-9bbb-0f2218d112d3
Mephisto1024/MFST_Engine
Engine/Source/Runtime/Renderer/Private/Lumen/LumenScreenSpaceBentNormal.cpp
/*============================================================================= LumenScreenSpaceBentNormal.cpp =============================================================================*/ #include "LumenScreenProbeGather.h" #include "RendererPrivate.h" #include "ScenePrivate.h" #include "SceneUtils.h" #include "Pi...
ALGO
0.915103
6.87075
036e541e-5c41-434a-b1e7-7d1886982b34
TRAN-THUY-NGOC/UPCODER
UPCODER/Cแบฅu trรบc dแปฏ liแป‡u/1. Tรฌm kiแบฟm/TKTUANTU2.cpp
#include <bits/stdc++.h> using namespace std; int sequentialSearch(int arr[], int n, int x) { for (int i = 0; i < n; i++) if (arr[i] == x) return i; return -1; } int main() { int n, x; cin >> n >> x; int arr[n]; for (int &i : arr) cin >> i; if (sequentialSearc...
ALGO
0.999716
6.353434
1495e743-f2d8-453c-aba2-3a7a6e7f59e6
AnanyaSinha2717/CPP-Projects
INDIE/BinaryToDecimal.cpp
#include <iostream> #include <cmath> using namespace std; int main() { int n; cout << "Enter binary number: "; cin >> n; int i = 0; int ans = 0; while (n != 0) { int digit = n % 10; if (digit == 1) { ans = ans + pow(2, i); } n = n / 10; ...
ALGO
0.999663
5.15058
1bfaa6b8-36a9-48bb-b05b-da1f3afbe8ff
timeplus-io/proton
src/Processors/QueryPlan/PartsSplitter.cpp
#include <algorithm> #include <memory> #include <numeric> #include <queue> #include <unordered_map> #include <vector> #include <Core/Field.h> #include <Interpreters/ExpressionAnalyzer.h> #include <Interpreters/TreeRewriter.h> #include <Parsers/ASTFunction.h> #include <Parsers/ASTIdentifier.h> #include <Processors/Quer...
DATA
0.941018
5.221321
7cbe4cdd-b856-4c9c-ac58-2e85df65a490
lukgutierrez/Splash-screen-library
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
a8141eec-32c0-4876-a292-2eb481791d30
sky-hao-r/Mobile_robotic_arm_wall_spraying_path_planning
husky_livox_ur5_ws/src/ar_track_alvar/ar_track_alvar/src/Line.cpp
#include "ar_track_alvar/Line.h" #include <opencv2/opencv.hpp> using namespace std; namespace alvar { using namespace std; Line::Line(const cv::Vec4f& params) { c.x = params[2]; c.y = params[3]; s.x = params[0]; s.y = params[1]; } void FitLines(vector<Line>& lines) { } int FitLines(vector<Line>& lines, con...
ALGO
0.97656
4.497572
9879fa9b-59a4-465f-beb0-85ea54a99dd3
Swati213/c-programs
reverse_not.cpp
#include <iostream> using namespace std; int main() { int n; cin>>n; int reverse=0; while(n>0) { /* code */ int lastdigit=n%10; reverse=reverse*10+ lastdigit; n=n/10; } cout<<reverse<<endl; return 0; }
ALGO
0.99994
4.7139
af1e6d0d-c767-481b-9ae3-ffe00d718cd4
eliot-exdev/boost-morphos
libs/hana/benchmark/transform/compile.fusion.vector.erb.cpp
<% if input_size > 10 %> #define FUSION_MAX_VECTOR_SIZE <%= ((input_size + 9) / 10) * 10 %> <% end %> #include <boost/fusion/include/as_vector.hpp> #include <boost/fusion/include/make_vector.hpp> #include <boost/fusion/include/transform.hpp> namespace fusion = boost::fusion; struct f { template <typename X> ...
ALGO
0.943114
3.78815
47a89bbf-829f-4d26-b4e9-3668362aa3ee
MohamedIrfanAM/cp
codeforces/Round_847_Div.3/C_Premutation.cpp
// time-limit: 3000 // problem-url: https://codeforces.com/problemset/problem/1790/C #include<bits/stdc++.h> using namespace std; #define int long long int #define double long double #define pb push_back #define endl "\n" #define mod 1e9+7 #define all(p) p.b...
ALGO
0.999902
3.814632
560505ee-9a6f-469e-9184-1323870eb8d2
nk185545/c-DSA
c++ programs/palindrone using queue and atack.cpp
#include<iostream> #include<string.h> #include<queue> #include<stack> using namespace std; int main() { string str; bool pal=true; queue<char>q; stack<char>s; cout<<"enter a string to check whethere string is palindrome or not: "; getline(cin,str); int l; l=str.size(); for(int i=0;i<l/2;i++) { s.push(str[i...
ALGO
0.999778
3.881941
80039538-7563-4e83-8d0e-d78f082832f1
Aryaman028/Geeekss
Difficulty: Medium/Kadane's Algorithm/kadanes-algorithm.cpp
//{ Driver Code Starts // Initial Template for C++ #include <bits/stdc++.h> using namespace std; // } Driver Code Ends // User function Template for C++ class Solution { public: // Function to find the sum of contiguous subarray with maximum sum. int maxSubarraySum(vector<int> &arr) { // code here......
ALGO
0.999167
6.828114
1c751c81-65ab-48ec-93a1-cba5b7d951fb
ishandutta2007/codeforces
kobor/normal/492/A.cpp
//Krzysztof Boryczka #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef pair<int, int> ii; typedef vector<int> vi; typedef vector<ii> vii; const int inf=0x3f3f3f3f; const ll INF=0x3f3f3f3f3f3f3f3f; #define FOR(i, b, e) for(int i=b; i<=e; i++) #define FORD(i, b, e) for(...
ALGO
0.999902
3.564763
c08db673-b2f1-4f0b-a248-47756f429a98
Haysten-D-costa/Modern-Algorithm-Design-Foundation-C-plus-plus
PRACTICE/mergeSort.cpp
#include <iostream> #define MAX 20 void mergeSort(int* A, int low, int high) { if(low < high) { int mid = (low + high)/2; mergeSort(A, low, mid); mergeSort(A, mid+1, high); merge(A, low, mid, high); } } void merge(int* A, int low, int mid, int high) { int i = low; ...
ALGO
0.999979
5.155512
e2406379-414b-4edb-87b5-b7a4828f6fe7
113bommy/deepmind_codecontests_refine
cpp_gold_filter_file/cpp_train_9215_2.cpp
#include <bits/stdc++.h> using namespace std; const int mxn = 1e5 + 1; int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); int t = 1; while (t--) { int n, i, j, ans = 0; cin >> n; string s; cin >> s; for (i = 0; i < n; i++) { int cu = 0, cd = 0, cl = 0, cr = 0; ...
ALGO
0.999877
4.263044
81674a3c-89e5-40c9-b217-f8a0b5429609
tmastercoding/clang
USACO/Silver/SilverPractice/2021Feb/s03.cpp
#include <iostream> using namespace std; int main(){ int n, num; int imap[500][500], notimap[500][500]; cin >> n; for(int i = 0; i < n; i++){ for(int j = 0; j < n; j++){ cin >> num; if(num >= 100){ imap[i][j] = 1; } else{ imap[...
ALGO
0.998921
3.383116
f07665ed-1a63-4b9b-ada6-ad9b6815b6b9
wupeng78/weiliu89-caffe
tools/compute_image_mean.cpp
#include <stdint.h> #include <algorithm> #include <string> #include <utility> #include <vector> #include "boost/scoped_ptr.hpp" #include "gflags/gflags.h" #include "glog/logging.h" #include "caffe/proto/caffe.pb.h" #include "caffe/util/db.hpp" #include "caffe/util/io.hpp" using namespace caffe; // NOLINT(build/name...
DATA
0.915345
6.438655
8496d211-fe1c-46ae-a421-233139bf80b5
Shrestha04/NeetCode-150
Trees/Count_Good_Nodes_in_Binary_Tree.cpp
class Solution { public: int goodNodes(TreeNode* root) { return dfs(root, root->val); } int dfs(TreeNode* node, int maxVal){ if(!node) return 0; int res = (node->val>=maxVal) ? 1: 0; maxVal = max(maxVal, node->val); res+=dfs(node->left,maxVal); res+=dfs(nod...
ALGO
0.99987
6.710024
0adf95e2-ec25-4eb3-96fb-e7c9c09d53e6
113bommy/deepmind_codecontests_refine
cpp_source_filter_file/cpp_train_75_5.cpp
#include <bits/stdc++.h> using namespace std; long long int power(long long int x, long long int y, long long int p) { long long int r = 1; x = x % p; while (y) { if (y & 1) r = r * x % p; y = y >> 1; x = x * x % p; } return r; } mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());...
ALGO
0.999914
3.784019
ff10cdd3-2c62-4680-a352-2311b4b82136
ysyisyourbrother/Galaxy-MNN
tools/converter/source/tensorflow/TFGraphResolver.cpp
#include "TFGraphResolver.hpp" #include "TFGraphResolverHelpers.hpp" #include <vector> #include <queue> #include <unordered_map> #include <unordered_set> #include "graph.pb.h" #include "tfOpConverter.hpp" #include "MNN_generated.h" #include "../compression/quantization.hpp" #include <flatbuffers/util.h> void TFGraph...
TOOL
0.965094
7.113928
dafde7a2-ad58-4cf0-9421-4b6209d6b263
Justdwiwt/Cpp_basic
src/leetcode/338.cpp
#include <vector> using namespace std; class Solution { public: vector<int> countBits(int num) { vector<int> res(num + 1, 0); for (auto i = 1; i <= num; ++i) res[i] = res[i & (i - 1)] + 1; return res; } };
ALGO
0.999898
6.010163
9b54c296-d23f-4ac0-8e30-ecf5c4ea33a7
ssk4988/Coding
USACO/platinum/haybales_platinum_dec15/haybales.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using pi = pair<int, int>; using pl = pair<ll, ll>; using pd = pair<ld, ld>; using vi = vector<int>; using vl = vector<ll>; using vd = vector<ld>; using vpi = vector<pi>; using vpl = vector<pl>; using vpd = vector<pd>; using vv...
ALGO
0.999926
4.174882
0f331715-db58-4458-94a3-05ec7ee4388a
oxygen-hunter/Flashboom
data/big-vul-100/add_attention_code/MixtralExpert/top0-100/time-taken-to-cross-the-door-Solution.timeTaken/177842_+Info.cpp
_PUBLIC_ codepoint_t next_codepoint_handle_ext( struct smb_iconv_handle *ic, const char *str, charset_t src_charset, size_t *bytes_consumed) { /* it cannot occupy more than 4 bytes in UTF16 format */ smb_iconv_t descriptor; size_t ilen_o...
ALGO
0.934942
4.002487
5154759f-2f3d-4f56-bae0-518d9ec30bf0
parthh1112/cp
A_Laptops.cpp
#include <bits/stdc++.h> using namespace std; int main (){ int n;cin>>n; int ma=0,mi=n; vector<pair<int,int>> v; for(int i=0;i<n;i++){ int x,y;cin>>x>>y; v.push_back({x,y}); } sort(v.begin(),v.end()); for(int i=1;i<v.size();i++){ if((v[i-1].first < v[i].first) && (v[i...
ALGO
0.999951
3.387743
11c96d06-97a5-4fd8-908a-74328d3cc525
sjtu-imperishable-night/code-library
Template/Template of Other Teams/Spear-of-Longinus/acm/2016-07-28(Dhaka 2012)/D.cpp
#include<cstdio> #include<cstdlib> #include<cmath> #include<iostream> #include<algorithm> #include<cstring> using namespace std; const int N = 100005; const int eps = 1e-7; int n, Q; double a[N], b[N], c[N]; void work() { double speed = 0; scanf("%lf", &speed); for(int i = 1; i <= n; i++) { scanf("%lf%lf%lf", &a...
ALGO
0.999869
3.129245
ae9caf80-a0c7-42d4-87f8-23b8b74e972d
Honeybunch/BrickwareUtils
src/StringUtils.cpp
#define BRICKWARE_UTILITY_EXPORTS #include "BrickwareUtils/StringUtils.hpp" using namespace Brickware; using namespace Utility; /* Public Functions */ //return a vector of std::strings split by a delimeter std::vector<std::string> StringUtils::stringSplit(const char* toSplit, const char* delimiter) { //Modify the...
TOOL
0.975275
6.028406
3140458b-8841-4761-883a-9041e51d3da2
baixun2307/asd
solution/3100-3199/3111.Minimum Rectangles to Cover Points/Solution.cpp
class Solution { public: int minRectanglesToCoverPoints(vector<vector<int>>& points, int w) { sort(points.begin(), points.end()); int ans = 0, x1 = -(1 << 30); for (auto& p : points) { int x = p[0]; if (x1 + w < x) { x1 = x; ++ans; ...
ALGO
0.999991
5.701328
7ffc4c6b-5a05-4af8-8be6-9042909e4c7f
macavarapu/flutter_Example
ladies_onile_shiping_project/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.998335
6.76073
dde90b1c-bc1f-4222-81ef-707c7256dd53
ceoca-ovidiu/c-plus-plus
3/exercise3.cpp
//Write a C++ method called primeDiff which receives as the only parameter, n, a natural number with max 9 characters and return the minimum diff p2-p1 where p1 and p2 are prime numbers and p1 โ‰ค n โ‰ค p2. //Example : n = 28 p1 = 23 and p2 = 29 => result = 6; #include <iostream> using namespace std; // check if the numb...
ALGO
0.999737
5.666664
40e0e3b5-c1ed-4c25-854e-9cb3674550b3
Mamong/Algorithm
Algorithm/Graph/graph.cpp
#include "graph.h" #define MAX 100000 #define VNUM 10+1 //้‚ปๆŽฅ็Ÿฉ้˜ต int edge[VNUM][VNUM] = {}; //่ฎฐๅฝ•Vnewไธญๆฏไธช็‚นๅˆฐVไธญ้‚ปๆŽฅ็‚น็š„ๆœ€็Ÿญ่พนๅ€ผ int lowcost[VNUM]={0}; //ๆ ‡่ฎฐๆŸ็‚นๆ˜ฏๅฆๅทฒๅŠ ๅ…ฅVnew int addvnew[VNUM]; //่ฎฐๅฝ•Vไธญๆฏ็‚นๅ’ŒVnewไธญ้‚ปๆŽฅ็š„็‚น int adjacent[VNUM]={0}; void prim(int start) { //่พ…ๅŠฉ้‡ int sum = 0; int i,j,k=0; //ไฝฟ็”จstartๅˆๅง‹ๅŒ– for(i=1;i...
ALGO
0.999908
3.591794
ea9deeba-239b-4df8-b331-c9ad641ddff6
abhiramkg2000/HackOctober22
C++ programs/armstrong number.cpp
#include<stdio.h> int main() { int num,orig,newnum=0,r=0; printf("Enter a number"); scanf("%d",&num); orig=num; while(num!=0) { r= num%10; newnum=newnum+r*r*r; num=num/10; } printf("new number is%d",newnum); if(newnum==orig) { printf("number is armstrong"); } else { printf("...
ALGO
0.999854
3.37905
1800798b-e324-4188-a16e-d339a2b2757d
Shahriar-Seam/Programming
Codeforces/Contests/2035_A.cpp
#include <bits/stdc++.h> using namespace std; void solve() { long long n, m, r, c; cin >> n >> m >> r >> c; long long total = (n - r) * m + m - c; cout << total + (n - r) * (m - 1) << "\n"; } int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int t; cin >> t; whil...
ALGO
0.999709
4.363259
61bbb549-bac2-4fbe-9fa6-cc6ae8177645
ThiagoFBastos/programacao-competitiva
atcoder/F - Coincidence.cpp
#include "bits/stdc++.h" using namespace std; using i64 = long long; using u64 = unsigned long long; using i32 = int; using u32 = unsigned; using i16 = short; using u16 = unsigned short; using ld = long double; using ii = pair<int, int>; const int mod = 1e9 + 7; int cnt[61][2][2]; int count(i64 l, i64 r) { int ...
ALGO
0.999971
4.123475
a926b015-0551-4ba1-a8bd-4de67507a528
Yash-Soni/codes
DFSgraph.cpp
#include<iostream> using namespace std; typedef struct node { int dest; int weight; node *next; }; typedef struct list { node *head; }; typedef struct graph { int V,e,count,t_edges,c_edges,b_edges,f_edges; list *A; int *d,*pie,*dis,*fin; int **tree_mat, **front_mat,**back_mat,**cross_mat,**edge_mat; char *c...
ALGO
0.999594
4.076217
4f46a353-11e9-4646-b33c-7276907685ad
hummingbird-12/boj-solutions
Solutions/4358_์ƒํƒœํ•™.cpp
#include <cassert> #include <cctype> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <algorithm> #include <array> #include <bitset> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <iterator> #include <limits> #...
ALGO
0.999143
4.792917
6c294496-6fb2-4666-b3a6-2daf9bbbfc0b
Jayce-wsj/Jayce_note
structure/stack.cpp
#include <iostream> #include <vector> #include <deque> #include <stack> using namespace std; template <class T> class mStack { public: mStack() {} ~mStack(){} void pop() { if (!que.empty()) { que.pop_back(); } } void push(T e) { que.push_back(e); } T top(...
ALGO
0.990937
4.678675
4f0947bd-4d54-4fa8-9655-821679f7620e
Lincito-31/Preseleccion
Uva Online Judge/01709.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; int p,n,a,b,c,d; int main(){ ios_base::sync_with_stdio(0); cin.tie(0);cout.tie(0); while(cin >> p >> a >> b >> c >> d >> n){ vector<double> price(n); for(int i=0;i<n;i++){ price[i]=p*(sin(a*(i+1)+b)+cos(c*(i+...
ALGO
0.999733
3.598364
4f925b1c-12b6-4a50-8cad-66c7f4b881c2
gopi-chandu/DSA
16_TriesAndHuffmannCoding/1_ClassTriesNode.cpp
class TrieNode { public: char data; TrieNode**children; bool isTerminal; TrieNode(char data) { this->data=data; children=new TrieNode*[26]; for(int i=0;i<26;i++) { children[i]=nullptr; } isTerminal=false; } };
ALGO
0.999169
3.075069
ff7759b8-144e-4076-b3c0-77d3c1fe9bd1
galletas1712/CompetitiveProgramming
Atcoder/Atcoder027-AGC-C.cpp
// Repeatedly invalidate vertices (ones that don't have both options for A and B adjacent to it). // Magnificently, we can do this with a queue, which resembles BFS // We simply have to check if there is still a valid connected component. We don't even need DSU for this. #include <bits/stdc++.h> using namespace std; #d...
ALGO
0.99996
5.078224
19d94c25-694f-4ce9-b18e-86556d81012b
miguelAlessandro/CompetitiveProgramming
project_euler/even_fibonacci_number.cpp
#include <iostream> #include <cstdio> using namespace::std; int fib[11]; int main(){ fib[0] = 2; fib[1] = 8; int suma = 10; for(int i = 2; (fib[i] = 4*fib[i-1] + fib[i-2]) <= 4000000; ++i) suma += fib[i]; printf("%d\n", suma); return 0; }
ALGO
0.999978
4.440264
f61cbcc0-66e7-40cf-9d6d-c648a2d0abd6
shivamidow/deview
src/11vm/llvm/lib/Support/DynamicLibrary.cpp
#include "llvm/Support/DynamicLibrary.h" #include "llvm-c/Support.h" #include "llvm/ADT/DenseSet.h" #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/StringMap.h" #include "llvm/Config/config.h" #include "llvm/Support/ManagedStatic.h" #include "llvm/Support/Mutex.h" #include <cstdio> #include <cstring> #include <vecto...
TOOL
0.850303
7.661639
b7ad455c-30d1-4b95-8a9d-9b38bf2a2342
lansen31/learngit
C-Plus-Plus/range_queries/mo.cpp
#include <iostream> using namespace std; const int N = 1e6 + 5; int a[N], bucket[N], cnt[N]; int bucket_size; struct query { int l, r, i; } q[N]; int ans = 0; void add(int index) { cnt[a[index]]++; if (cnt[a[index]] == 1) ans++; } void remove(int index) { cnt[a[index]]--; if (cnt[a[index]] ...
ALGO
0.999946
4.294503
ae598e6f-2b6b-4655-b9a2-dbcce5ca44f7
sreakdgeek/Path-Planning
src/Eigen-3.3/unsupported/doc/examples/MatrixExponential.cpp
#include <unsupported/Eigen/MatrixFunctions> #include <iostream> using namespace Eigen; 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::cout << "The matrix A is:\n" << A << "\n\n"; std::cout << "The matrix exponential ...
ALGO
0.999642
3.730493
8e6d3fec-091a-4b95-958b-5d68d91b263e
MKimiSH/ETH-AlgoLab-17
cgal-kernels-lpqp.cpp
#include <CGAL/Exact_predicates_exact_constructions_kernel.h> //#include <CGAL/Exact_predicates_exact_constructions_kernel_with_sqrt.h> #include <CGAL/Exact_predicates_inexact_constructions_kernel.h> #include <CGAL/Projection_traits_xy_3.h> #include <CGAL/Delaunay_triangulation_2.h> #include <CGAL/Triangulation_vertex_...
ALGO
0.999843
3.2756
fbd9b1e1-72bb-47a1-b2de-ec38d1fd216a
ishandutta2007/codeforces
geothermal/normal/1264/B.cpp
#pragma GCC optimize ("O3") #pragma GCC target ("sse4") #include <bits/stdc++.h> #include <ext/pb_ds/tree_policy.hpp> #include <ext/pb_ds/assoc_container.hpp> using namespace std; using namespace __gnu_pbds; typedef long long ll; typedef long double ld; typedef complex<ld> cd; typedef pair<int, int> pi; typedef...
ALGO
0.999976
4.318576
54fac7fc-7e6a-479c-9441-9c6e4c129585
ZJU-FAST-Lab/Implicit-SVSDF-Planner
src/utils/include/igl/upsample.cpp
#include "triangle_triangle_adjacency.h" template < typename DerivedF, typename SType, typename DerivedNF> IGL_INLINE void igl::upsample( const int n_verts, const Eigen::MatrixBase<DerivedF>& F, Eigen::SparseMatrix<SType>& S, Eigen::PlainObjectBase<DerivedNF>& NF) { using namespace std; using namespa...
ALGO
0.965654
5.996515
30960d8a-39e6-4ca3-ac6f-a337bcf6c446
moinulshaon/Light-OJ
vol12/1279__completed/1279 - Copy.cpp
#include <cstdio> #include <cstring> #include <cmath> #include <algorithm> #include <vector> #include <utility> #include <set> #include <map> #include <iostream> #include <queue> #include <climits> using namespace std; typedef long long LL; #define PB push_back #define FRO freopen("in.txt","r",stdin); #define CLR(a...
ALGO
0.999942
4.133566
54464f98-5e14-444d-8465-b1bddcda0b31
compot51/acmp
1109.cpp
#include <iostream> using namespace std; int main() { int n; cin >> n; cout << "The next number for the number " << n << " is " << n+1 << ". " << endl; cout << "The previous number for the number " << n << " is " << n-1 << "."; }
ALGO
0.997727
4.306115
f406512c-f8ab-4e75-8b51-65b0f59adda7
17865138160/cocosluaGameFramework
cocos/scripting/lua-bindings/manual/cocos2d/lua_cocos2dx_physics_manual.cpp
#include "scripting/lua-bindings/manual/cocos2d/lua_cocos2dx_manual.hpp" #if CC_USE_PHYSICS #include "scripting/lua-bindings/manual/tolua_fix.h" #include "scripting/lua-bindings/manual/LuaBasicConversions.h" #include "scripting/lua-bindings/manual/CCLuaValue.h" #include "scripting/lua-bindings/manual/CCLuaEngine.h" #i...
TOOL
0.858323
7.122394
79c7bafc-4eca-437c-bed1-04f2cfc6cf89
511172176/codebook
code/BST ๅ‰ๅบๅŠ ไธญๅบๆ‰พๅ‡บๅพŒๅบ.cpp
//POJ2255 #include <stdio.h> #include <string.h> char preord[30], inord[30]; // ๅ„ฒๅญ˜ๅ‰ๅบๅ’Œไธญๅบ้ๆญท็š„ๅญ—ไธฒ // ่ฎ€ๅ–ๆฏๅ€‹ๆธฌ่ฉฆๆกˆไพ‹็š„ๅ‰ๅบๅ’Œไธญๅบ้ๆญท int read_case() { if (scanf("%s %s", preord, inord) != 2) return 0; // ่‹ฅ่ผธๅ…ฅไธ็‚บ 2 ๅ€‹ๅญ—ไธฒ๏ผŒ่ฟ”ๅ›ž 0 return 1; // ๆˆๅŠŸ่ฎ€ๅ–่ฟ”ๅ›ž 1 } // ๆ นๆ“šๅ‰ๅบๅ’Œไธญๅบ้ๆญทไพ†้ž่ฟดๆง‹ๅปบๆจนไธฆ่ผธๅ‡บๅพŒๅบ้ๆญท void recover(int preleft, int preright, int inleft, int in...
ALGO
0.999997
5.035646
77746edb-5849-4b35-8e67-9e9b95239120
sqybi/leetcode
LeetCode/binary-tree-postorder-traversal/main.cpp
#include <vector> #include <stack> #include <iostream> using namespace std; struct TreeNode { int val; TreeNode *left; TreeNode *right; TreeNode(int x) : val(x), left(NULL), right(NULL) {} }; class Solution { public: vector<int> postorderTraversal(TreeNode *root) { vector<int> result; ...
ALGO
0.999971
5.822863
2e1552a2-730a-4a9b-8d49-fcd46f9dc478
conradoboeira/CP
uva/uva_11727/Main.cpp
#include <iostream> using namespace std; int main(){ int k, s1, s2, s3, i, resp; cin >> k; for(i = 1; i <= k; i++){ cin >> s1 >> s2 >> s3; if(s1 > s2){ if(s1 < s3) resp = s1; else resp = (s2 > s3) ? s2 : s3; } else if(s2 > s3){ resp ...
ALGO
0.999827
4.144006
4b0c46c5-e9cf-4744-a69d-7e368874b4b1
ingyu1008/codetree-TILs
241203/์ ‘๋‘์‚ฌ์™€ ์ ์ˆ˜/prefix-and-score.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; struct Node { char c; int depth; int cnt; vector<int> nxt; Node(char c = '$', int depth = 0) : c(c), depth(depth), cnt(0) { nxt = vector<int>(26, -1); } }; int main() { cin.tie(0)->sync_with_stdio(); int N; ...
ALGO
0.99992
4.55097
1519b972-ffcc-4a07-9538-a189c94d35ce
raincross7/code-similarity
codes/train_code/problem260/problem260_285.cpp
#include <iostream> #include <queue> using namespace std; int main(){ priority_queue<int> Q; int value; string order; while (cin >> order ,order != "end") { if (order == "insert") { cin >> value; Q.push(value); } else { cout << Q.top() << endl; Q.pop(); } } return 0;...
ALGO
0.99545
4.368863
a5022d4e-1e06-4c48-8c9f-a79c10e5aa6e
Exalibur77/Data-Structure-and-Algorithm
2DArrays/SumTilli,j.cpp
#include<iostream> #include<vector> using namespace std; void printArr(vector <vector <int> > &arr, int n){ for(int i=0 ; i<n ; i++){ for(int j=0 ; j<n ; j++){ cout << arr[i][j] << " "; } cout << endl; } } void sumTill(vector <vector <int> > &arr, int n){ for(int ...
ALGO
0.999941
3.897095
aa64f887-25ef-40ba-9443-7b783920662b
EshaanVaswani/college
AOA/Djikstras.cpp
#include<bits/stdc++.h> using namespace std; const int V = 9; int minDistance(const vector<int>& dist, const vector<bool>& sptSet) { int min = INT_MAX, min_index = -1; for (int v = 0; v < V; v++) { if (!sptSet[v] && dist[v] <= min) { min = dist[v]; min_index = v; } ...
ALGO
0.999991
5.656889
2f7abb2a-7123-414a-bcc5-928f5b9fb16e
vemulapallimeghanachowdary/compitativecoding
competitivecoding/189_Rotatearray(stacks).cpp
#include <iostream> #include <stack> using namespace std; void rotateArrayWithStack(int arr[], int size, int k) { stack<int> stack; for (int i = size - k; i < size; i++) { stack.push(arr[i]); } for (int i = size - 1; i >= k; i--) { arr[i] = arr[i - k]; } for (int i = 0; i < k; i+...
ALGO
0.999994
4.585584
af07f236-c9c0-4ac5-9e75-37cf3bcfbef1
thermotools/lammps_mie_fh
src/OPENMP/pair_brownian_omp.cpp
// clang-format off /* ---------------------------------------------------------------------- Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ #include "pair_brownian_omp.h" #include "atom.h" #include "comm.h" #include "domain.h" #include ...
ALGO
0.999168
7.675918
43d16d92-d1f3-4905-8784-b0e3bd137e73
rishabh27goel/DSA-Extra-Questions
Leetcode/Find_the_Prefix_Common_Array_of_Two_Arrays.cpp
#include <iostream> #include <vector> using namespace std; class Solution { public: vector<int> findThePrefixCommonArray(vector<int>& A, vector<int>& B) { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int n = A.size(); int m = B.size(); long long...
ALGO
0.999933
5.149932
bda8da11-f900-4e51-8e31-de02c28c34d7
wynagito/algorithmzuo-recording
algorithmzuo_recording/38/t06_sort_stack_with_recursive.cpp
#include <iostream> #include <stack> #include <vector> #include <algorithm> #include <cstdlib> using namespace std; // ็”จ้€’ๅฝ’ๅ‡ฝๆ•ฐๆŽ’ๅบๆ ˆ // ๆ ˆๅชๆไพ›pushใ€popใ€emptyไธ‰ไธชๆ–นๆณ• // ่ฏทๅฎŒๆˆๆ— ๅบๆ ˆ็š„ๆŽ’ๅบ๏ผŒ่ฆๆฑ‚ๆŽ’ๅฎŒๅบไน‹ๅŽ๏ผŒไปŽๆ ˆ้กถๅˆฐๆ ˆๅบ•ไปŽๅฐๅˆฐๅคง // ๅช่ƒฝไฝฟ็”จๆ ˆๆไพ›็š„pushใ€popใ€emptyไธ‰ไธชๆ–นๆณ•ใ€ไปฅๅŠ้€’ๅฝ’ๅ‡ฝๆ•ฐ // ้™คๆญคไน‹ๅค–ไธ่ƒฝไฝฟ็”จไปปไฝ•็š„ๅฎนๅ™จ๏ผŒๆ•ฐ็ป„ไนŸไธ่กŒ // ๅฐฑๆ˜ฏๆŽ’ๅบ่ฟ‡็จ‹ไธญๅช่ƒฝ็”จ๏ผš // 1) ๆ ˆๆไพ›็š„pushใ€popใ€emptyไธ‰ไธชๆ–นๆณ• // 2) ้€’ๅฝ’ๅ‡ฝๆ•ฐ๏ผŒๅนถไธ”่ฟ”ๅ›žๅ€ผๆœ€ๅคšไธบๅ•ไธชๆ•ดๆ•ฐ // ...
ALGO
0.999857
4.941795
762c0089-e1f3-43d8-9d10-bb304eeeb366
yentl217/md-code
test.cpp
#include <iostream> #include <string> using namespace std; int main() { string test = "-45"; int num = stoi(test); cout << num << endl; return 0; }
ALGO
0.947465
3.082729
387a3be3-1fff-4f08-8f9c-f2ef3566723e
himanshu7465/Codeforces
#8_LuckyDivision.cpp
#include<bits/stdc++.h> using namespace std; int main(){ int n, digit=0; cin>>n; int luckyNum[11]={4,7,47,74,444,447,474,477,744,747,777}; for(int i=0;i<11;i++){ if(n%luckyNum[i]==0){ cout<<"YES"; return 0; } } cout<<"NO"; return 0; }
ALGO
0.999654
4.110179
0afb3827-5836-49e2-a4a9-a823f3d30a2e
GIRIPRASATH-B/C-DSA01
9.check string is palindrome or not.cpp
#include <iostream> #include <string> using namespace std; // Function to check if a string is a palindrome bool isPalindrome(const string& str) { int left = 0; int right = str.length() - 1; while (left < right) { if (str[left] != str[right]) { return false; } left++; ...
ALGO
0.962719
5.810966
2b735a17-1cdd-464f-bd03-7932e554580b
Aicry/Algotithms
PAT(AdvancedLevel)Practice/P1030.cpp
/** * @file P1030.cpp * @author your name (<EMAIL>) * @brief * @version 0.1 * @date 2020-11-12 * * @copyright Copyright (c) 2020 * 4 5 0 3 * 0 1 1 20 * 1 3 2 30 * 0 3 4 10 * 0 2 2 20 * 2 3 1 20 */ #include<iostream> #include<vector> #include<limits.h> using namespace std; struct node { int distance...
ALGO
0.999982
3.64756
dfc4f6a5-5bb2-40d1-a13d-dbcab4c659ec
ishandutta2007/codeforces
fanache99/normal/1553/G.cpp
#include <iostream> #include <fstream> #include <vector> #include <algorithm> #include <stack> #include <cassert> #include <map> #include <numeric> #include <cstring> #include <set> #include <ctime> #include <queue> #include <cmath> #include <iomanip> #include <iterator> #include <bitset> #include <unordered_map> #incl...
ALGO
0.999852
3.685516
267ecf1f-9c6f-4560-a70b-5ee16f79445a
elturner/cs184_as2
src/tree/aabb_node.cpp
#include "aabb_node.h" #include <shape/aabb.h> #include <algorithm> #include <iostream> #include <vector> #include <string> #include <Eigen/Dense> /** * @file aabb_node.cpp * @author Eric Turner <<EMAIL>> * @brief Implements the node class used for aabb trees * * @section DESCRIPTION * * This file impl...
ALGO
0.999179
7.632666
a0054c69-b033-44b1-8f8e-a60801b9eef5
Nasif-Imtiaj/Competitive-Programming
Number Theory/making a int roman.cpp
#include<bits/stdc++.h> using namespace std; ///Welcome to Nasif's Code #define co(q) cout<<q<<endl; typedef long long int ll; typedef unsigned long long int ull; const int MOD = (int)1e9+7; const int MAX = 1e6; #define pi acos(-1) #define bug cout<<"bug"<<endl; #define FastRead ios_base::sync_with_stdio(false);cin...
ALGO
0.99963
4.998117
ae9bdfb4-9eb6-4ac5-bdee-3055aa1c6731
Snigdha-Gayathri/C-Programs
Arrays/TwoSumProblem-BRUTE.cpp
#include <bits/stdc++.h> using namespace std; int main() { cout << "Enter the size of the array: " << endl; int n; cin >> n; int arr[n]; cout << "Enter the elements of the array: " << endl; for (int i = 0; i < n; i++) { cin >> arr[i]; } cout << "Enter target: " << endl...
ALGO
0.999749
6.103081
7372744b-d92b-414a-93f8-0e92466cfe0d
WTlumos/PAT-A
1012/1012.8.15.cpp
#include<cstdio> #include<vector> #include<map> #include<algorithm> using namespace std; struct node { int id; int score[4]; int rank[4]; int best; }; node stu[2010]; int flag=-1; bool cmp(node a,node b) { return a.score[flag]>b.score[flag]; } int main() { int n,m; scanf("%d%d",&n,&m); int id,a,b,c,d; int sum=...
ALGO
0.999967
4.641781
c99aa270-de22-4757-b6c1-ed8c3b86bbdb
robert2653/CSES
Introductory Problems/Two_Knights.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; void solve() { ll n; cin >> n; for (ll i = 1; i <= n; i++) { ll x = i * i;; ll ans = x * (x - 1) / 2; if (i >= 3) { ans -= 4 * (i - 1) * (i - 2); } cout << ans << "\n"; } } int main() {...
ALGO
0.999143
4.816687
ae1c2ba8-b687-44df-80c7-4ba6a3009391
27-aditya/LeetSols
0025-reverse-nodes-in-k-group/0025-reverse-nodes-in-k-group-Iterative.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) {} * }; */ class Solution { public: ListNode* reverseKGro...
ALGO
0.999987
5.681618
6b4557c6-e4bb-4e14-92a4-76f5e4b31145
ishandutta2007/codeforces
uuzlovetree/normal/607/A.cpp
#include<bits/stdc++.h> #define maxn 100005 using namespace std; int n; struct node { int x,y; }a[maxn]; bool operator < (node a,node b) { return a.x<b.x; } int dp[maxn]; int main() { scanf("%d",&n); for(int i=1;i<=n;++i) { scanf("%d%d",&a[i].x,&a[i].y); } sort(a+1,a+n+1); for(int i=1;i<=n;++i) { int l=0,r...
ALGO
0.999886
4.266343
6239c896-37ca-4638-9d00-c7ca2e729d62
raincross7/code-similarity
codes/train_code/problem314/problem314_337.cpp
#include <bits/stdc++.h> using namespace std; #define rep(i,n) for(int i=0; i<(n); ++i) using ll = long long; using P = pair<int, int>; template<class T> inline bool chmin(T& a, T b) {if (a > b) { a = b; return true; } return false;} template<class T> inline bool chmax(T& a, T b) {if (a < b) { a = b; return true; } re...
ALGO
0.999779
4.100278
3688d73f-b9c4-4f8c-9a97-0fe2e503d040
hinataros/V6
src/controller/rlsDynamics/constraintModel/update/computeCWC.cpp
/** @author Sho Miyahara 2018 */ #include "config.hpp" #include "model.hpp" #include "constraintModel.hpp" MatrixXd RLS::ConstraintModel::compute_FC_span(string _link_name) { double mu = 0.5; // double mu = 0.2; double qq = sqrt(1*1+mu*mu); MatrixXd S0 = MatrixXd::Zero(12, 16); for (int i=0; i<4; i++)...
ALGO
0.999062
4.110095
b8e8ff52-cc09-4be7-9213-dd9c0c8754ff
NaeemAdnan/Cpp
sorted unsorted array.cpp
#include <iostream> using namespace std; class set_elements { public: int arr[100], n, item, i; void input(); void search(); }; void set_elements::input() { cout << "Enter araray limit : "; cin >> n; cout << "Enter array elements : "; for (i = 0; i < n; i++) { cin >> arr[i]; } } void set_elements::search() { cout << "E...
ALGO
0.999188
4.301557
63e0cff4-7014-4e20-889f-4ccc8bc4eda9
ishandutta2007/codeforces
eliden/normal/NA/544.cpp
#include <bits/stdc++.h> using namespace std; #define rep(i,a,b) for(int i=a;i<b;++i) #define debug(x) cerr<<#x<<": "<<x<<endl #define sz(x) (int)(x).size() using ll = long long; using vi = vector<int>; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int MAXA=102; vi count(MAXA,-1); int...
ALGO
0.999999
3.549607
28054de1-4122-43cb-9709-00b5b5fc2910
Shrestha005/DSA_cpp
2.1.sorting/3.insertion.cpp
#include<bits/stdc++.h> using namespace std; void sort(int arr[], int n){ for (int i = 0; i <= n-1; i++) { int j= i; while (j> 0 && arr[j-1]> arr[j]) { int temp= arr[j-1]; arr[j-1]= arr[j]; arr[j]= temp; j--; } ...
ALGO
0.999941
4.780531
31fd3f31-d29e-42dd-b2fc-71bc686ac5e8
changsongzhu/leetcode
C++/seq_num/269_h.cpp
/** 269[H]. Alien Dictionary There is a new alien language which uses the latin alphabet. However, the order among letters are unknown to you. You receive a list of words from the dictionary, where words are sorted lexicographically by the rules of this new language. Derive the order of letters in this language. For ex...
ALGO
0.999989
6.043196
2b28027b-45a0-463f-b8c7-8a30e7dbf477
luong0104/thuchanh5
flutter_application_2/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.998579
6.76073
606ba454-af7b-4b9c-92b8-4fe5d179a681
Saul-Ceti/Proyecto_segundo
Proyecto/NodeAdd.cpp
#include <iostream> #include <vector> #include "Node.h" int main() { int option = 0; int value = 0; Node* p = nullptr; Node* source = nullptr; std::cout << "Ingrese el valor inicial para la estructura" << std::endl; std::cin >> value; source->createNode(value); p->add(source, value)...
ALGO
0.950782
3.758852
421dfbdf-248b-4120-bb78-e056d86d66a9
PhanDat2210/Vu-Nguyen-Coder-Basic-C-Language-Course-.
13Pointer2_LinkedList/Proctiscal/13_4.cpp
#include <iostream> #include <string> #include <stdlib.h> #include <list> using namespace std; struct Person { Person(string name) { fullName = name; next = NULL; } string fullName; Person *next; }; struct PersonList { Person *head = NULL; void print_all() { int i...
ALGO
0.983018
4.179981