uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
26f36900-bc4e-4727-8b8c-cc52462ee974
HakashiKatake/DSA-1
Sorting/BubbleSort.cpp
#include <iostream> using namespace std; void bubbleSort(int arr[], int n) { for (int i = 0; i < n-1; i++) { for (int j = 0; j < n-i-1; j++) { if (arr[j] > arr[j+1]) { int temp = arr[j]; arr[j] = arr[j+1]; arr[j+1] = temp; } } ...
ALGO
0.99987
5.535342
be1f196a-fd73-4905-97b5-0f2f5a0d6de6
LunaLuan/KeyboardTest
KeyboardTest/telextalgorithm.cpp
#include "telextalgorithm.h" TelextAlgorithm::TelextAlgorithm() { QString temp[] = { "aas", "aaf", "aar", "aax", "aaj", "aa", "as", "af", "ar", "ax", "aj", "aws", "awf", "awr", "awx", "awj", "aw", "us", "uf", "ur", "ux", "uj", "uws", "uwf", "uwr", "uwx", "uwj", "uw", "ees", "eef", "eer", "e...
ALGO
0.910661
3.531115
585ce512-edde-4ee2-9bb1-9ab1ae49641f
BhuvanChaithanya/Competitive-Coding
lecture1/factorial.cpp
#include <iostream> using namespace std; int main(){ int n; cin>>n; int res = 1; for (int i=1; i<=n;i++){ res *= i; } cout<<"the factorial of "<<n<<" is "<<res<<endl; }
ALGO
0.99997
4.632784
31351c02-c9ec-4b91-98fe-09181550d9b1
ishandutta2007/codeforces
komendart/normal/859/C.cpp
#include <bits/stdc++.h> using namespace std; signed main() { ios_base::sync_with_stdio(false); cin.tie(0); int n; cin >> n; vector<int> a(n); for (int i = 0; i < n; ++i) { cin >> a[i]; } reverse(a.begin(), a.end()); vector<int> pref(n + 1); vector<int> dp(n + 1); for ...
ALGO
0.999971
3.989716
9a68a446-d736-4b83-a9d2-cdbdb3f30d2c
AdityaSolanki189/Cpp-Projects
CodeChef/2021/ipc_certi.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long int main(){ ios_base::sync_with_stdio(false); cin.tie(NULL); ll N,M,K; //n->students, k->lectures, m->min. munites cin>>N>>M>>K; ll questions; ll lectures; ll total_time=0; ll eligible=0; for(ll i=0;i<N;i++){ ...
ALGO
0.999825
3.419535
173072d9-2344-462d-a673-32504c475749
rohit11012003/cp_problems
hcf of two numbers.cpp
#include<bits/stdc++.h> using namespace std; long long int gcd(long long int a, long long int b) { if(b==0) { return a; } else{ return gcd(b,a%b); } } int main(){ long long int a,b; cin>>a>>b; cout<<gcd(a,b); }
ALGO
0.999936
4.878013
ed116ba5-1245-414e-bf23-310fcc648b7f
username82839/i5
GameTemplate1/k2EngineLow/ExEngine/bulletPhysics/src/BulletCollision/CollisionShapes/btPolyhedralConvexShape.cpp
#if defined (_WIN32) || defined (__i386__) #define BT_USE_SSE_IN_API #endif #include "BulletCollision/CollisionShapes/btPolyhedralConvexShape.h" #include "btConvexPolyhedron.h" #include "LinearMath/btConvexHullComputer.h" #include <new> #include "LinearMath/btGeometryUtil.h" #include "LinearMath/btGrahamScan2dConvexHu...
ALGO
0.981247
7.034167
050e4778-629d-4f50-a0b5-0720419b7c7f
libingmoma/suiji
assignment/A5_10195101504_王玥莹/observer_pattern.cpp
/* ۲ģʽ */ /* Demoģ΢ij */ #include <iostream> #include <stdio.h> #include <stdlib.h> #include <string> using namespace std; #define M 100 #define N 100 // class DispatchingCenter { private: int userCount; // û public: DispatchingCenter() { userCount = 0; } void setUserCount(int num)...
TOOL
0.876259
4.479794
7cd772d6-c58e-442d-b89f-dc3fce580d07
dinhtai1104/ctdl_gt_D18
Contest6/Solv/27.cpp
#include<bits/stdc++.h> using namespace std; typedef long long ll; #define get(n) ll n; cin>>n #define getStr(s) string s;cin>>s; #define getStrs(s) string s;getline(cin,s); #define set_arr(a,n); ll a[n]; for(int i=0;i<n;i++)cin>>a[i]; #define set_vect(a,n); vector<ll>a(n); for(int i=0;i<n;i++)cin>>a[i]; #define sort_a...
ALGO
0.999926
3.941426
bfe10509-4223-4b3e-a7cf-464baaeefc19
BangJinM/LeetCode
main.cpp
#include <string> #include <vector> #include "code/leetcode_24.cpp" using namespace std; ListNode *createNodeByVector(vector<int> nums) { ListNode *head = new ListNode(nums[0]); ListNode *pre = head; for (int i = 1; i < nums.size(); i++) { ListNode *node = new ListNode(nums[i]); pre->...
ALGO
0.999975
5.773369
55867ea9-ce42-46d5-871a-47e47cb530ad
M-E-U-E/Current
A. Segment with Small Sum.cpp
#include<bits/stdc++.h> #define ll long long #define endl "\n" using namespace std; bool cmp(pair<int,int>a,pair<int,int> b) { if(a.first > b.first) return true; else if(a.first == b.first and a.second<b.second) return true; return false; } //vector<ll>v; //void primeFactors(ll n) //{ // ...
ALGO
0.999879
4.356386
c9eb0e3c-8828-4689-b93a-6cf9e4f4eb54
alinaamanzhol/bonus
module1/b.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 << "." << endl; int arr[][] return ...
ALGO
0.993337
3.326577
d9e129d1-a650-48fa-abd5-03f8defd0f13
TNTksals/pose_solver
src/pose_solver.cpp
// // Created by ksals on 2022/6/6. // #include "pose_solver/pose_solver.h" #include <pluginlib/class_list_macros.h> PLUGINLIB_EXPORT_CLASS(rm_pose_solver::PoseSolver, nodelet::Nodelet) namespace rm_pose_solver { void PoseSolver::onInit() { ros::NodeHandle& nh = getPrivateNodeHandle(); initialize(nh); } vo...
TOOL
0.92834
6.369269
7198129f-75c5-4908-a6d4-3d5a2855948c
luerer/ccOOder
leetcode_547.cpp
/************ Friend Circles 大意: 找朋友,有直接关系的为1,如果M(i,j)=1 && M(j,k)=1,那么ijk属于一个朋友圈。 思路: 新知识-并查集,解决是否属于同一个集合的问题,最后计数集合数,具体见笔记。 ************/ class Solution { public: int findCircleNum(vector<vector<int>>& M) { friends.resize(M.size(),0); for(int i=0; i<M.size(); ++i) friends[i] = i; ...
ALGO
0.99999
5.674756
f12d5283-4bc3-4e8f-bdbf-c33038c82f80
msiley/GeneticAlgorithmTSP
modga.cpp
#include "modga.h" ModGA::ModGA(int pop_size, double cutoff_percent, double mutate_prob, ChromosomeFactory *factory) { this->factory = factory; this->pop_size = pop_size; this->mutate_prob = mutate_prob; trace = true; random = Random::Instance(); population = factory->create_population(this->pop_size); ...
ALGO
0.999449
5.593422
d45f83c6-6237-459e-9c5e-e3af324dc420
fwdzh/cp_code
Codeforces/2133/C.cpp
#include<bits/stdc++.h> using namespace std; using LL = long long; void solve() { int n; cin >> n; vector<int> len(n + 1); set<int> st; for(int i = 1; i <= n; i++) st.insert(i); for(int i = 1; i <= n; i++){ cout << "? " << i << " " << n << " "; for(auto s : st) cout << s...
ALGO
0.999866
3.490411
79bd36a7-3e3c-43ec-80a8-033464d7e6e8
dytsou/lc
cpp/2095.cpp
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* deleteMiddle(ListNode* head) { if(!head || !head->next) ...
ALGO
0.999914
5.871569
26f6947b-263e-4917-be4e-44569bea95e6
ishandutta2007/codeforces
fqw/normal/748/F.cpp
#include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <limits> #include <map> #include <memory> #include <numeric> #include <queue> #include <set> #include <sstream> #include <string> #include <u...
ALGO
0.99999
4.158472
24317e62-691a-4a42-9140-1968ae4fea29
codyliciouscat/MAC-PAN
Backup/graphing/spanning-tree.cpp
#include "graphify.h" /* ================================================== --------------------PATH TABLE-------------------- ================================================== */ class PathTable { public: map<Vertex, map<Vertex, vector<Edge> > > table; }; /* ============================================ ---------...
ALGO
0.999759
3.243175
8a122345-901f-4a91-b05b-95881f6098c6
Enelar/eigen
blas/single.cpp
#define SCALAR float #define SCALAR_SUFFIX s #define SCALAR_SUFFIX_UP "S" #define ISCOMPLEX 0 #include "level1_impl.h" #include "level1_real_impl.h" #include "level2_impl.h" #include "level2_real_impl.h" #include "level3_impl.h" float BLASFUNC(sdsdot)(int* n, float* alpha, float* x, int* incx, float* y, in...
TOOL
0.979438
3.396469
b67fc001-fb73-408c-8768-cc5b11e8cff9
082-Rishikant/CP-NITT
CP Essentials, Master Algorithms/A_Coding-Minutes-Competitive-Programming-main/Coding-Minutes-Competitive-Programming-main/Coding Exercise Solutions/subtreeProblem.cpp
#include<bits/stdc++.h> using namespace std; void dfs(int x,int p, vector<int>&sub, vector<vector<int>>&v) { sub[x]=1; for(auto itr:v[x]) { if(itr!=p) { dfs(itr,x,sub,v); sub[x]+=sub[itr]; } } } vector<int> subtreeProblem (int n, vector<vector<int>> edges...
ALGO
0.999809
5.170377
3d678ca8-d9c6-4da6-bea5-68373068a513
juanmaaf/Practica-1-Inteligencia-Artificial
Comportamientos_Jugador/jugador.cpp
#include "../Comportamientos_Jugador/jugador.hpp" #include <iostream> using namespace std; Action ComportamientoJugador::think(Sensores sensores){ Action accion = actIDLE; cout << "Posicion: fila " << sensores.posF << " columna " << sensores.posC << " "; switch(sensores.sentido){ case 0: cout << "Norte" << endl...
ALGO
0.981453
4.149029
3f19e894-a77d-4c38-b0c7-02ec289c697a
sat-yad/codeforcesSolutions
codeforcesladder/amsing_joke.cpp
#include <iostream> #include <algorithm> using namespace std; int main(){ string str1; string str2; string str3; cin>>str1; cin>>str2; cin>>str3; string s; s=str1+str2; sort(s.begin(),s.end()); sort(str3.begin(),str3.end()); if(str3==s){ cout<<"YES"<<endl; }...
ALGO
0.999923
3.726275
6c6db5b6-a4bf-4a08-834f-f8a7003a349e
ishandutta2007/codeforces
ditoly/normal/762/E.cpp
#include<cstdio> #include<algorithm> using namespace std; inline int read() { int x,f=1;char c; while((c=getchar())<'0'||c>'9')if(c=='-')f=0; for(x=c-'0';(c=getchar())>='0'&&c<='9';)x=x*10+c-'0'; return f?x:-x; } #define MN 100000 #define MX 1000000000 struct P{int x,r,f;}p[MN+5]; struct node{int l,r,s;}t[MN*50+5];...
ALGO
0.999277
3.264707
6a92594f-a877-4d55-b623-223758de0d5c
LangArthur/Smort
src/movement/SteeringAlgorithm.cpp
/** * @file SteeringAlgorithm.cpp * @author Arthur Lang (<EMAIL>) * @brief steering algorithm declaration * @date 2022-12-08 */ #include "movement/SteeringAlgorithm.hpp" namespace smort::movement { SteeringAlgorithm::SteeringAlgorithm(const Kinetic &state, Kinetic &target) : m_state(state), m_target(target) ...
ALGO
0.975458
4.501763
8ab3dd0c-97aa-4196-836e-1e5948c3dd34
Beast-Alok/gfg-potd
04 April (2024)/April_22th.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: int minRow(int n, int m, vector<vector<int>> a) { // code here int sum = INT_MAX; int ans = 0; for (i...
ALGO
0.999811
6.286905
67b346e9-efe6-406e-ad50-68311e0de628
suxutao/LeetcodeList
cn/1530-number-of-good-leaf-nodes-pairs .cpp
#include "../../../stdc.h" using namespace std; //leetcode submit region begin(Prohibit modification and deletion) /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nullptr), right(nullptr) {} * TreeNode(i...
ALGO
0.999965
6.061847
00d1eeb7-5981-4c6f-8ab4-5f752af7e30c
dongli/TTS-I
Sources/Mesh/PolarRing.cpp
#include "Sphere.hpp" #include "Constants.hpp" #include "ReportMacros.hpp" #include "TimeManager.hpp" #include "PolarRing.hpp" PolarRingVelocity::PolarRingVelocity() { isInitialized = false; } PolarRingVelocity::~PolarRingVelocity() { } void PolarRingVelocity::linkVelocityField(const Field &u, const Field &v) { ...
ALGO
0.944386
6.398551
48952d20-8c60-4387-89df-3bb5d63907cc
niket3342/leetcode_solutions
414-third-maximum-number/414-third-maximum-number.cpp
class Solution { public: int thirdMax(vector<int>& nums) { int point=1; sort(nums.begin(), nums.end(), greater<int>()); int pre = nums[0]; if(nums.size()==1 or nums.size()==2) { return (nums[0]); } for(int i=1;i<nums.size();i++) { ...
ALGO
0.999982
5.304307
a994d20d-cba1-4e8a-9ae4-f7cfdef1f09d
raincross7/code-similarity
codes/train_code/problem224/problem224_306.cpp
#include<iostream> #include<cstdlib> #include<string> #include<vector> #include<map> #include<unordered_map> #include<queue> #include<algorithm> #include<iomanip> #include<typeinfo> #include<complex> using namespace std; using ll = long long int; const int mod = 1e9 + 7; #define rep(i, a, b) for(ll i = a;i < b; i++) co...
ALGO
0.999948
4.08194
e9a93e61-bd46-4670-bd30-67186e419a7c
subhodynamics/my_template
compete/codeforces/D_Same_Differences.cpp
//! We can go up or down, either ways I am prepared //! Hello there! Subhadeep this side. #include<bits/stdc++.h> using namespace std; #define fastio() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL) #define MOD 1000000007 #define MOD1 998244353 #define INF 1e18 #define nline "\n" #define pb push_back ...
ALGO
0.999599
4.241387
548f3a63-dc81-471c-a625-519451d51681
tongzhou80/MiniSpot
hotspot8_src/share/vm/c1/c1_Canonicalizer.cpp
#include "precompiled.hpp" #include "c1/c1_Canonicalizer.hpp" #include "c1/c1_InstructionPrinter.hpp" #include "c1/c1_ValueStack.hpp" #include "ci/ciArray.hpp" #include "runtime/sharedRuntime.hpp" class PrintValueVisitor: public ValueVisitor { void visit(Value* vp) { (*vp)->print_line(); } }; void Canonicaliz...
ALGO
0.856606
3.728514
d84cc783-068a-443a-9629-324c7cd9e94d
Gaurav31U/LEETCODE
0729-my-calendar-i/0729-my-calendar-i.cpp
static const int _ = [](){ ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); return 0; }(); class MyCalendar { public: vector<pair<int,int>> vi; MyCalendar() { } bool book(int start, int end) { for(int i=0;i<vi.size();i++){ if(start>vi[i...
ALGO
0.999939
5.824025
2c28f886-2902-420a-99f3-6996f5bf0214
ProvaPaul/Advanced-Programming
queen.cpp
#include <iostream> #include <vector> using namespace std; int count = 0; bool isSafe(vector<vector<int>>& board, int row, int col, int n) { for (int i = 0; i < row; i++) { if (board[i][col] == 1) { return false; } } for (int i = row, j = col; i >= 0 && j >= 0; i--, j--) { ...
ALGO
0.999872
6.260448
78149a42-472a-4425-9be2-2e766578b159
sahilcodes2002/LeetCode..-etc.
Graphs/Graph1/lec-7/dfsLexicographicallySmallestPath.cpp
#include <bits/stdc++.h> using namespace std; #define int long long #define mod 1000000007 #define vi vector<int> vector<vi> adj; vi vis; vector<stack<int>> paths; stack<int> ans; // void dfs(int i, stack<int> &st){ // vis[i]=1; // st.push(i); // paths[i]=st; // for(auto it: adj[i]){ // if(vis[it]==1){ // c...
ALGO
0.999975
5.308864
11622a8f-9e78-4207-8df8-36ee981fef10
sinian666/codes_102_3
cpp_副本40/chapter_computational_complexity/time_complexity.cpp
/** * File: time_complexity.cpp * Created Time: 2022-11-25 * Author: Krahets (<EMAIL>) */ #include "../utils/common.hpp" /* 常数阶 */ int constant(int n) { int count = 0; int size = 100000; for (int i = 0; i < size; i++) count++; return count; } /* 线性阶 */ int linear(int n) { int count = ...
ALGO
0.997863
4.117926
2f662038-c620-415d-a378-9aff21dd60f8
ecnerwala/icpc-book
xyz/codes/random_code2/后缀平衡树.cpp
#include <cstdio> #include <cstring> #include <algorithm> #include <cstdlib> using namespace std; typedef long long int64; struct T { int x, height, min, to; int64 l, r, mid; T *son[2]; } f2[110000], *f1 = f2, *f[110000], *null, *root, *next, *prep; int i, TT, n; char S[110000]; int64 ans; bool g(T *x, T *y) { i...
ALGO
0.999746
4.534257
33999650-7025-4818-9829-0ad00941c475
kashif-603/user-details
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
38bf0b27-cc93-44b2-b4ca-091e6d730415
mrnetbear/Alg-progs
lab5/src/graph.cpp
#include "graph.hpp" #include <iostream> #include <fstream> #include <vector> #include <queue> #include <stack> #include <map> #include <unordered_map> #include <limits> #include <algorithm> #include <random> #include <chrono> #include <string> #include <sstream> #include <cctype> #include <cstdlib> /*double Vertex::d...
ALGO
0.996478
6.023758
5dd3e3b1-0b60-43af-b8f0-20c98c5c3088
Jikky1618/AtCoder
kyopro90/046.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; int main(){ cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(20); int N; cin >> N; vector<int> A(N), B(N), C(N); for(int i = 0; i < N; i++) cin >> A[i]; for(int i = 0; i < N; i++) cin >> B[i]...
ALGO
0.999739
4.283806
442b8241-5557-4bc6-8d72-d42d82054df6
sri-soumya/leetcode-questions
238-product-of-array-except-self/238-product-of-array-except-self.cpp
class Solution { public: vector<int> productExceptSelf(vector<int>& nums) { int n=nums.size(); vector<int> a; a.push_back(1); for(int i=1;i<n;i++) a.push_back(a[i-1]*nums[i-1]); int t=1; for(int i=n-2;i>=0;i--) { ...
ALGO
0.999955
6.043185
60933ac3-722d-41ba-b103-4ba59bd2edab
beelisais2793/FX
Synthesizer/Waves/PhysicalModel/Physically-based-modelling/RigidBodySimulation/RigidBodySimulation/include/eigen-eigen-323c052e1731/doc/examples/Tutorial_BlockOperations_print_block.cpp
#include <Eigen/Dense> #include <iostream> using namespace std; int main() { Eigen::MatrixXf m(4,4); m << 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12, 13,14,15,16; cout << "Block in the middle" << endl; cout << m.block<2,2>(1,1) << endl << endl; for (int i = 1; i <= 3; ++i) { cout << "B...
ALGO
0.985285
3.6853
b46733cd-113a-40a1-8f0f-968d4aa0fdaf
zenosambu/Computer_Graphics
assignment6/src/framework/base/Sort.cpp
#include "base/Sort.hpp" #include "base/MulticoreLauncher.hpp" using namespace FW; //------------------------------------------------------------------------ #define QSORT_STACK_SIZE 32 #define QSORT_MIN_SIZE 16 #define MULTICORE_MIN_SIZE (1 << 13) //--------------------------------------------------------...
ALGO
0.99969
5.890717
c18fe850-6c57-4b19-97dd-2410d0078032
ShivamBhuskute/DSA
POTD/ninjas/22march/queries.cpp
#include <iostream> #include <vector> #include <climits> #include <cmath> using namespace std; vector<long long int> solve(int N, vector<int> &arr, int q, vector<vector<int>> &queries) { vector<long long> ans; long long x, r, l; long long Q; for (int i = 0; i < q; i++) { Q = queries[i...
ALGO
0.999029
4.587051
424c2dc3-38ca-492b-b12f-1c98c2fc8fec
sara-mohamd/Leetcode
0374-guess-number-higher-or-lower/0374-guess-number-higher-or-lower.cpp
// #typedef long long ll; /** * Forward declaration of guess API. * @param num your guess * @return -1 if num is higher than the picked number * 1 if num is lower than the picked number * otherwise return 0 * int guess(int num); */ class Solution { public: int guessNumber(int...
ALGO
0.999991
5.805194
128cf7e9-babe-4d5a-96bf-ca3a2a1b23f9
agul/contest-tasks
caide_archive/2016-07-13/cf691A/submission.cpp
#pragma comment(linker, "/STACK:66777216") #pragma warning(disable : 4996) #include <algorithm> #include <array> #include <bitset> #include <cassert> #include <chrono> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <functional> #include <iomanip> #include <iostream> ...
ALGO
0.999846
4.028312
0f170e91-5f0c-4d2a-9c13-d4ed9e56e2e7
ErenKaracan47/MGUProgramlama
SesProgramlama/Final/JUCE/modules/juce_dsp/processors/juce_FIRFilter.cpp
namespace juce { namespace dsp { template <typename NumericType> double FIR::Coefficients<NumericType>::Coefficients::getMagnitudeForFrequency (double frequency, double theSampleRate) const noexcept { jassert (theSampleRate > 0.0); jassert (frequency >= 0.0 && frequency <= theSampleRate * 0.5); constexpr ...
ALGO
0.97462
5.865329
408a4bdd-7d7a-4c70-92d2-ba3971a014e8
abhiXsliet/Solved-DSA-Problems
GFG POTD/007-July-2024/009-three-sum-closest.cpp
// https://www.geeksforgeeks.org/problems/three-sum-closest/1 //{ Driver Code Starts #include <bits/stdc++.h> using namespace std; // } Driver Code Ends // User function template for C++ // arr : given vector of elements // target : given sum value class Solution { public: int threeSumClosest(vector<int> arr, i...
ALGO
0.999984
6.259258
9de27dd0-825d-46c3-a652-b5a3209fae25
AlonsoPaulino/competitive-programming
Codeforces/322B - Ciel and Flowers.cpp
#include <bits/stdc++.h> #define pi acos(-1) #define sz(x) (int) x.size() #define pii pair<int, int> #define mii map<int, int> #define vi vector<int> #define mp make_pair #define pb push_back #define popb pop_back #define mset(v, x) memset(v, x, sizeof(v)) #define mset2d(v, x, n) memset(v, x, sizeof(v[0][0]) * n * n) #...
ALGO
0.997665
4.264011
cd621d3a-0e89-4142-8590-fa44b44b061f
learner-Pankaj/cpp_practice
funcTemplateEx.cpp
#include<iostream> #include<string> using namespace std; template <class T> T sum(T x, T y){ return x+y; } int main(){ cout << sum<int>(1,3) << endl; cout << sum<double>(1.5,3.8) << endl; cout << sum<string>("pankaj ", "yadav") << endl; return 0; }
ALGO
0.955552
4.770729
b7b3a67e-cef5-413d-9d4c-b35736178cdf
raincross7/code-similarity
codes/train_code/problem302/problem302_122.cpp
#include<bits/stdc++.h> using namespace std; using ll = long long; using pii = pair<int,int>; #define rep(i,n) for(int i=0; i<n; i++) #define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end()) //sortしてから使う #define INF 2147483647 #define LLINF 9223372036854775807LL int main() { ll l,r; cin>>l>>r; ll ans = 3000;...
ALGO
0.999839
3.616917
1c7a2868-590e-4703-a379-297fea4dee93
Jaisuraj/competitive-coding
B_Two_Buttons.cpp
#include <iostream> using namespace std; int main() { int n, m, w(0); cin >> n >> m; while (n != m) { if (m > n) if (m % 2 == 0) m /= 2, w++; else m++, w++; else if (n > m) m++, w++; } cout << w << endl; return 0; }
ALGO
0.999944
3.976968
d42f48ef-200f-440b-aab8-9f2439da663f
floatouble/leetcode-golang-cpp
problems/binary_tree_preorder_traversal/solution.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: vector<int> preorderTraversal(TreeNode* root) { if (root == nullptr) { retu...
ALGO
0.999978
6.591386
96185a16-b581-45ad-810f-26ebcf185128
shunliuniliu/SVO_edge
Thirdparty/opencv-2.4.13/modules/imgproc/src/smooth.cpp
#include "precomp.hpp" namespace cv { /****************************************************************************************\ Box Filter \****************************************************************************************/ template<typename T, typename ST> struct RowS...
ALGO
0.976644
5.28863
9bbcb778-f844-4183-9ecd-20b9b4863fd0
TensorCodeGen/tensor-codegen
libcxx/test/std/algorithms/alg.sorting/alg.min.max/min_init_list.pass.cpp
// UNSUPPORTED: c++03 // <algorithm> // template<class T> // T // min(initializer_list<T> t); #include <algorithm> #include <cassert> #include "test_macros.h" int main(int, char**) { int i = std::min({2, 3, 1}); assert(i == 1); i = std::min({2, 1, 3}); assert(i == 1); i = std::min({3, 1, 2}...
TEST
0.992941
4.9407
6ac0959d-8641-4b68-a1e2-c33d8e42d979
batuyanga/RoCore
src/server/scripts/EasternKingdoms/MoltenCore/boss_majordomo_executus.cpp
/* ScriptData SDName: Boss_Majordomo_Executus SD%Complete: 30 SDComment: Correct spawning and Event NYI SDCategory: Molten Core EndScriptData */ #include "ScriptPCH.h" #define SAY_AGGRO -1409003 #define SAY_SPAWN -1409004 #define SAY_SLAY -1409005 #define SAY_SPECIAL -1409006 #d...
TOOL
0.866852
5.904242
590aad81-97e2-458c-9a83-e0a42d385de7
oki-miyuki/boost_spirit_guide
samples/raw.cpp
#include <boost/spirit/include/qi.hpp> #include <vector> #include <iostream> #include <string> namespace qi = boost::spirit::qi; int main() { std::string input = "04142019"; int year, month, day; qi::parse( input.begin(), input.end(), qi::raw[qi::repeat(2)[qi::standard::digit]] >> qi::raw[qi::repeat(...
ALGO
0.937152
5.259726
f59233fa-c416-4a20-8cd3-279c3b02cc6a
tsnest/xray-2-2011
sources/bullet/BulletCollision/Gimpact/gim_tri_collision.cpp
/*! \file gim_tri_collision.h \author Francisco Leon Najera */ #include "gim_tri_collision.h" #define TRI_LOCAL_EPSILON 0.000001f #define MIN_EDGE_EDGE_DIS 0.00001f class GIM_TRIANGLE_CALCULATION_CACHE { public: GREAL margin; btVector3 tu_vertices[3]; btVector3 tv_vertices[3]; btVector4 tu_plane; btVector4 tv_...
ALGO
0.999605
5.728266
a3a06d1c-dc8e-45a3-95aa-5dbd8d56f78e
ninad-moree/DataStructuresAlgorithms
Hashtable/0961-NRepeatedElementSize2NArray.cpp
/* You are given an integer array nums with the following properties: nums.length == 2 * n. nums contains n + 1 unique elements. Exactly one element of nums is repeated n times. Return the element that is repeated n times. Example 1: Input: nums = [1,2,3,3] Output: 3 */ #include<bits/s...
ALGO
0.999857
5.465085
ddb5b4d8-114b-4231-9dcb-ad632679a1fa
zhjiay/cmain
Essentialcpp/chapter2/limitstest1.Cpp
#include <iostream> #include<cstdlib> #include<limits> #include<vector> using namespace std; void test(){ int maxI=numeric_limits<int>::max(); long double d=numeric_limits<long double>::max(); cout<<"max:"<<d; } void swap(int &a,int& b){ int temp=a; a=b; b=temp; } void dispaly(vector<int> v ...
ALGO
0.992196
3.234792
150e836e-6f8f-450e-acc7-6b23da446206
adrianmfi/ProjectEuler
cpp/problem96.cpp
#include <iostream> #include "problem96.h" #include <string> #include <fstream> #include <bitset> using namespace std; int NumberOfSetBits(int i) { i = i - ((i >> 1) & 0x55555555); i = (i & 0x33333333) + ((i >> 2) & 0x33333333); return (((i + (i >> 4)) & 0x0F0F0F0F) * 0x01010101) >> 24; } short flagToValue(short fl...
ALGO
0.99944
5.541728
5c47bcae-c7cd-4270-ae4a-70a942d4dd6a
EGyeom/egyeom.github.io
code/save_before/0802/1_1.cpp
#include <string> #include <vector> #include <algorithm> #include <string.h> #include <cstdio> using namespace std; int compare(pair<int,int> a, pair<int,int> b) { return a.first > b.first; } int solution(vector<int> priorities, int location) { int answer = 1; vector<pair<int,int> > v; int size = prio...
ALGO
0.999923
4.321068
b18e3afb-f0f7-4484-a8e9-7ac1233b4237
HanYouyang/Computer
数据结构与算法/PKU-CS/Leetcode/LeetCode-master/C++/350. Intersection of Two Arrays II.cpp
350. Intersection of Two Arrays II Given two arrays, write a function to compute their intersection. Example: Given nums1 = [1, 2, 2, 1], nums2 = [2, 2], return [2, 2]. Note: Each element in the result should appear as many times as it shows in both arrays. The result can be in any order. 分析:将nums1的每一个数字以及对应数字的个数存储在...
ALGO
0.999938
5.956771
7905272b-a278-404a-9ff6-f7e93e466916
jshky/CODE
p1168.cpp
#include<bits/stdc++.h> using namespace std; int hd[100005],hx[100005],ld,lx,n,a[100005],i; void pushx(int x){ lx++; hx[lx]=x; int now=lx,nxt; while (now>1){ nxt=now/2; if (hx[nxt]<hx[now]) return; int t=hx[nxt]; hx[nxt]=hx[now]; hx[now]=t; now=nxt; } } void pushd(int x...
ALGO
0.99999
3.435493
9d3f257b-882c-4c17-a8e9-21e7d1a76922
somu-bs/Leetcode
2131-longest-palindrome-by-concatenating-two-letter-words/2131-longest-palindrome-by-concatenating-two-letter-words.cpp
class Solution { public: int longestPalindrome(vector<string>& words) { vector<vector<int>> counter(26, vector<int>(26, 0)); int longestPalindrome = 0; for(string ele : words) { int first = ele[0] - 'a', second = ele[1] - 'a'; if(counter[second][first]) { ...
ALGO
0.999984
5.943313
2ad8beb9-0f0f-427a-a4d1-b004fa741366
TrueStar02/Practice
Homework/(141) Matrix 作业 - 程序设计Ⅱ(20计算机类3班)/254140 [Template] Search a value/Standard Answer/framework.cpp
#include<iostream> #include<string> #include<vector> #include<algorithm> using namespace std; #include "source.h" struct Point{ int x,y; bool operator<(const Point& p) { return (x<p.x || (x==p.x&&y<p.y)); } }; int main() { //freopen("test01.in", "r", stdin); //freopen("test01.out", "w", stdout); { int A[5]...
ALGO
0.999764
4.068623
24b9df1f-86c3-42ea-894e-bce84860b0ee
MinhTuNguyen02/Code-Cpp
baitapC++_2/BT_5/baitap13.cpp
#include <iostream> #include <cmath> using namespace std; int PhanTu(int, int, int); int Tong(int, int, int); int main(){ int a0, q, n; do{ cout << "Nhap gia tri a0: "; cin >> a0; cout << "Nhap cong boi: "; cin >> q; cout << "Nhap so phan tu: "; cin >> n; }while(n<=0); cout << "\nPhan tu thu " << n <...
ALGO
0.983002
3.084185
012645ad-51f6-4c64-b48b-38ee4dfc6c9e
soolabettu/cp
gks/2021/f/c_binary_search.cpp
#include<bits/stdc++.h> using namespace std; using ll = long long; using vs = vector<string>; using vi = vector<int>; using vl = vector<ll>; using vb = vector<bool>; using pi = pair<int, int>; using pl = pair<ll, ll>; using vpi = vector<pair<int, int>>; using vpl = vector<pair<ll, ll>>; using ld = double; #define sz(...
ALGO
0.999452
4.183563
942241da-d5af-4196-87e6-da6184627a7c
suhaas02/Data-structures-and-algorithms
Medium/0 - 1 Knapsack Problem/0-1-knapsack-problem.cpp
//{ Driver Code Starts #include<bits/stdc++.h> using namespace std; // } Driver Code Ends class Solution { public: int helper(int w, int wt[], int val[], int ind, vector<vector<int>> &dp) { if(ind == 0) { if(wt[0] <= w) return val[0]; else ...
ALGO
0.999997
5.95964
1a8fc2e8-4b65-47e4-9cab-512158795322
SnehilVukkusila/graph-resources
DSA Crack Sheet/solutions/Find Pair Given Difference.cpp
/* Find Pair Given Difference ========================== Given an unsorted array Arr[] and a number N. You need to write a program to find if there exists a pair of elements in the array whose difference is N. Input: First line of input contains an integer T which denotes the number of test cases. Then T test cases f...
ALGO
0.999803
5.729087
1f6feafe-d97b-4f2d-93cc-8094458fa0ce
jingtaozhang18/algorithm-exercises
leetcode/100-199/143. 重排链表-特例判断.cpp
// https://leetcode-cn.com/problems/reorder-list/ #include<bits/stdc++.h> using namespace std; // 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), ...
ALGO
0.999994
5.95605
e8a71a7f-6c54-4118-a372-875448dc0994
Zlin0509/Zlin_ACM
_Luogu/P4042.cpp
// // Created by 27682 on 2025/5/21. // #include "bits/stdc++.h" #define endl '\n' using namespace std; mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count()); typedef __int128 i128; typedef double db; typedef long double ldb; typedef long long ll; typedef unsigned long long ull; typedef vector<int> vi...
ALGO
0.999907
3.658366
9c8a08c9-99d2-4348-90d5-a25181693f7a
RishabhKumar25/DSA-Practice-Series
Pattern Questions/pattern15.cpp
#include<iostream> using namespace std; int main(){ /* D C D B C D A B C D */ int n; cin>>n; for(int i =1;i<=n;i++){ char start = ('A'+n-i); for(int j=1;j<=i;j++){ cout<<start<<" "; start+=1; } cout<<endl; } }
ALGO
0.999629
3.921669
916d9bed-29f1-4c92-a44f-67659c97b40a
piyushthange/CPP
Basics/stockm_simu.cpp
#include <iostream> #include <cmath> using namespace std; int main() { float a; float p = 10000; float r = .01; for (int day = 1; day <= 20; day++) { a = p * pow(1+r, day); cout << day << " ---- " << a << endl; } return 0; }
ALGO
0.998668
3.720547
2012d8b0-0315-4b2d-9f0a-78fa7d8c4305
maruf-git/basic-data-structures-with-cpp
binary-tree/input_binary_tree.cpp
// In The Name of Allah #include <bits/stdc++.h> #define ll long long int using namespace std; class Node { public: int val; Node *left; Node *right; Node(int val) { this->val = val; this->left = NULL; this->right = NULL; } }; Node *input_binary_tree() { int val; ...
ALGO
0.999872
4.171804
f29f9197-0192-47e0-98ec-da64806b8991
RYQ-22/Stable-Fluid
Stable-Fluid/Stable-Fluid/include/eigen-3.4.0/bench/perf_monitoring/trmv_upt.cpp
#include "gemv_common.h" EIGEN_DONT_INLINE void trmv(const Mat &A, Vec &B, const Vec &C) { B.noalias() += A.transpose().triangularView<Upper>() * C; } int main(int argc, char **argv) { return main_gemv(argc, argv, trmv); }
ALGO
0.989629
4.898617
554086fc-a484-4215-83df-377a70a4096c
actium/codeforces
1000/20/1028b.cpp
#include <iostream> #include <string> void answer(const std::string& x, const std::string& y) { std::cout << x << ' ' << y << '\n'; } void solve(unsigned n, unsigned m) { const size_t k = n / 9 + 1; const std::string a(k, '9'); answer(a, a + std::string(k-1, '0') + "1"); } int main() { unsigned ...
ALGO
0.999213
4.895918
0d092cf8-9d80-4d06-bf59-8f92b3911fee
Shokkenn/Data-Structures-And-Algorithms
Stack/1 Reverse Linked List using stack.cpp
#include <bits/stdc++.h> using namespace std; // Definition of the node structure struct node { int data; // Data stored in the node node* next; // Pointer to the next node in the list }; // Function to insert a node at the end of the list node* insert(node** head, int x) { node* temp = new node...
ALGO
0.999994
5.916811
847d23e1-3037-4475-ab96-31cf6d80e9b7
kvm2116/vmtorrent
p2pfs/boost/libs/numeric/ublas/benchmarks/bench1/bench13.cpp
#include "bench1.hpp" template<class T, int N> struct bench_c_matrix_prod { typedef T value_type; void operator () (int runs) const { try { static typename c_matrix_traits<T, N, N>::type m1, m2, m3; initialize_c_matrix<T, N, N> () (m1); initialize_c_matrix<T, N, N> ...
TOOL
0.989342
5.331476
fed813e5-e722-4f1c-b199-14b2c86c98ed
MasanoriSuda/atcoder
book_tessoku/A02/cppfile.cpp
#include <bits/stdc++.h> using namespace std; int main(void) { int N, X; vector<int> A; cin >> N >> X; for (int i = 0; i < N; ++i) { int tmp; cin >> tmp; A.push_back(tmp); } for (int i = 0; i < N; ++i) { if (A[i] == X) { cout << "Yes"...
ALGO
0.999992
3.993027
099066e0-67d1-4faa-b768-359b52819058
RajiaRani/DSA-with-CPP
K queueinanArray.cpp
#include<iostream> #include<bits/stdc++.h> using namespace std; class KQueue{ public: int k,n,freespot; int *arr; int *front; int *rear; int *next; KQueue(int n, int k) { this->n=n; this->k=k; freespot=0; arr=new int[n]; front=new int[k]; rear=new int[k]; for(int i=0;i<k;i++) { front[i]=...
ALGO
0.999838
3.71219
2a971c5c-365d-4573-8429-9c55bdf7e823
ShantanuKasana17/Leetcode_Solution
0328-odd-even-linked-list/0328-odd-even-linked-list.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* oddEvenList...
ALGO
0.999917
5.764458
520c5d67-8d44-4036-888d-f96bcea9ef6b
ishandutta2007/codeforces
fkguyx042/normal/372/D.cpp
#include<cstdio> #include<algorithm> #include<cstring> #include<vector> #include<set> #define se second #define fi first #define mk make_pair #define N 100005 #define M 20 using namespace std; set<pair<int,int> >str; int st[N],fa[N][M],i,j,m,n,p,k,ans,x,y,sum,tot,deep[N]; vector<int>v[N]; void get(int x) { int...
ALGO
0.999951
3.993656
7d7bcd4e-03aa-4d80-ac04-24096c6ff178
south37/atcoder
agc024/b/b_2.cpp
#include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <unordered_map> #include <vector> #include <string.h> #include <set> using namespace std; #define COUT(x) cout << #x << " = " << (x) << " (L"...
ALGO
0.999887
4.011668
af9aa808-ec58-400d-bc4a-8ff60cbeb877
miaodi/leetcode_practice
Feb_25/136.single-number.cpp
/* * @lc app=leetcode id=136 lang=cpp * * [136] Single Number * * https://leetcode.com/problems/single-number/description/ * * algorithms * Easy (58.91%) * Total Accepted: 415.2K * Total Submissions: 704.7K * Testcase Example: '[2,2,1]' * * Given a non-empty array of integers, every element appears twi...
ALGO
0.999911
5.721165
3b5f4916-f038-456d-8686-ff5863f9ddca
nguyenthihaik61/thuat_toan_ung_dung
de quy quay lui/de quy quay lui/Source.cpp
//sai //sua tai bai indaynhiphan #include <iostream> using namespace std; int n; int x[100]; int check(int v, int k) { if(k==1) return 1; return x[k - 1] + v <= 1; } void solution() { for (int i = 1; i <= n; i++) { cout << x[i]; } cout << endl; } void TRY(int k) { for (int v = 0; v <= 1; v++) { if (check(...
ALGO
0.999522
3.219871
452dca57-c2a8-4b2d-a027-9fa9e1a04f33
ishandutta2007/codeforces
derekfeng/normal/1650/G.cpp
#include<bits/stdc++.h> using namespace std; const int M=1e9+7; int n,m,s,t; int f[200004][2],lv[200004][2]; vector<int>g[200004]; void sol(){ scanf("%d%d%d%d",&n,&m,&s,&t); for(int i=1;i<=n;i++)g[i].clear(),lv[i][0]=lv[i][1]=-1,f[i][0]=f[i][1]=0; for(int i=1;i<=m;i++){ int u,v;scanf("%d%d",&u,&v); g[u].push_bac...
ALGO
0.999874
4.52549
d39a3503-dfd6-4d52-a8c7-43504257217f
rakibul263/Algorithm
Disjoint Set Union/union.cpp
#include <bits/stdc++.h> using namespace std; const int N = 1e5; int parent[N]; void dsu_initilize(int n) { for (int i = 0; i < n; i++) { parent[i] = -1; } parent[1] = 2; parent[2] = 3; parent[5] = 6; parent[6] = 7; } int dsu_find(int node) { if (parent[node] == -1) { ...
ALGO
0.999881
4.114115
b3834abf-a048-475d-893d-757928cb6fe2
phamhau1412004/PhamVanHau_monC
chapter 10/chapter 10/challenges/Word Counter.cpp
#include <iostream> #include <cstring> using namespace std; int demSoTu(const char *chuoi) { int dem = 0; bool dangLaTu = false; for (int i = 0; chuoi[i] != '\0'; i++) { if (isalpha(chuoi[i])) { if (!dangLaTu) { dem++; dangLaTu = true; } ...
ALGO
0.999428
4.316657
aec81498-b55e-429d-a3ea-10d6a8ca454a
Giatroo/Competitive-Programming
vjudge/4A.cpp
#include <bits/stdc++.h> typedef long long int ll; typedef unsigned long long int ull; typedef long double lld; #define fora(i, n) for (ll i = 0; i < n; i++) #define forai(i, n) for (ll i = 1; i <= n; i++) #define ford(i, n) for (ll i = n-1; i >= 0; i--) #define fordi(i, n) for (ll i = n; i >= 0; i--) #define forita(it...
ALGO
0.999985
3.226487
710abeb6-716f-4d78-adac-439d3fae104f
ob971/currency-converter-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.998733
6.76775
ed01c03e-be85-44aa-8260-ca8499a7ea62
ishandutta2007/codeforces
mr.robot_28/normal/1221/C.cpp
#include<bits/stdc++.h> using namespace std; int main() { int q; cin >> q; for(int i =0; i < q; i++) { int a, b, c; cin >> a >> b >> c; int k = min(a, min(b, c)); int sum = k; a -= k; b -= k; c -= k; if(a > b) { swap(a, b); } sum += min(b - a, a); k = min(a, b - a); a -= k; b -= 2 * ...
ALGO
0.999955
4.176209
7888ec6d-27ab-4710-a812-f36c79452222
Alok-Khansali/Hackerrank-Demystified
5_star_C++/Input and Output.cpp
#include <cmath> #include <cstdio> #include <vector> #include <iostream> #include <algorithm> using namespace std; int main() { int a,b,c; cin>>a>>b>>c; cout<<(a+b+c); return 0; }
ALGO
0.999694
3.819322
5dc70a24-685d-43c6-8135-9210e6996f0f
ss-MotionControl/benchmark_eigen_msvc
eigen-master/bench/spbench/sp_solver.cpp
// Small bench routine for Eigen available in Eigen // (C) Desire NUENTSA WAKAM, INRIA #include <iostream> #include <fstream> #include <iomanip> #include <Eigen/Jacobi> #include <Eigen/Householder> #include <Eigen/IterativeLinearSolvers> #include <Eigen/LU> #include <unsupported/Eigen/SparseExtra> // #include <Eigen/S...
ALGO
0.997432
4.485615
404154e7-f5c9-4325-bf71-05b9e8715319
ishandutta2007/codeforces
cerberus97/normal/1149/B.cpp
/* cerberus97 - Hanit Banga */ #include <iostream> #include <iomanip> #include <cassert> #include <cmath> #include <cstdio> #include <cstring> #include <cstdlib> #include <map> #include <set> #include <queue> #include <stack> #include <vector> #include <algorithm> using namespace std; #define pb push_back #define fa...
ALGO
0.999835
3.859744
73841a00-2e03-4ea8-a715-d56973e2c371
sxu39/TP-RPMD
lammps-stable_2Aug2023_update2/src/GPU/pair_lj_charmm_coul_long_gpu.cpp
/* ---------------------------------------------------------------------- Contributing author: Mike Brown (SNL) ------------------------------------------------------------------------- */ #include "pair_lj_charmm_coul_long_gpu.h" #include "atom.h" #include "domain.h" #include "error.h" #include "force.h" #include...
ALGO
0.997538
5.905432
42ef0bdd-0fa6-4b33-a283-0e53fd2a4bb9
abhradeepbarman/dsa-supreme
1-Array/Assignments/missing_element.cpp
#include<bits/stdc++.h> using namespace std; // // METHOD 1: Visiting Method // void findMissing(int arr[], int n) { // for(int i=0; i<n; i++) { // int index = abs(arr[i]); // if(arr[index -1] > 0) { // arr[index - 1] *= -1; // } // } // for(int i=0; i<n; i++) { // ...
ALGO
0.999944
4.712594
6014d332-ad7f-4edf-b788-1f476738c257
Bol-C14/Matrix_Solver_Benchmarking_Suite
lib/superlu/src/eigen-3.4.0/doc/examples/TemplateKeyword_flexible.cpp
#include <Eigen/Dense> #include <iostream> using namespace Eigen; template <typename Derived1, typename Derived2> void copyUpperTriangularPart(MatrixBase<Derived1>& dst, const MatrixBase<Derived2>& src) { /* Note the 'template' keywords in the following line! */ dst.template triangularView<Upper>() = src.template...
TOOL
0.948406
5.804369
2e4ea699-3474-4d2c-95de-850e3a52ee14
brianjsl/cpp_primer
.ccls-cache/@home@runner@cppprimer/ch9@9.47a.cpp
#include <iostream> #include <string> #include <vector> using namespace std; void print(vector<char> vec) { for (const auto &c : vec) { cout << c << " "; } cout << endl; } int main() { string s("ab2c3d7R4E6"); vector<char> num_vec, alpha_vec; string num = "0123456789"; string alpha = "abcdefghijklmn...
ALGO
0.941123
4.245426
39032474-a4db-49f7-8567-d4b8a2c16e79
Asim8611/Programming-codes
C++/pointer 10.cpp
#include<iostream> using namespace std; void IndirectSwap(char *Ptr1, char *Ptr2) { char temp = *Ptr1; *Ptr1 = *Ptr2; *Ptr2 = temp; } int main() { char a = 'y'; char b = 'n'; IndirectSwap(&a, &b); cout << a << b << endl; return 0; }
ALGO
0.999159
3.041363