uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
d36c2e98-8131-459d-b623-c141f1c1781a
obiwac/freebsd-s0ix
contrib/llvm-project/llvm/lib/CodeGen/SpillPlacement.cpp
#include "SpillPlacement.h" #include "llvm/ADT/BitVector.h" #include "llvm/CodeGen/EdgeBundles.h" #include "llvm/CodeGen/MachineBasicBlock.h" #include "llvm/CodeGen/MachineBlockFrequencyInfo.h" #include "llvm/CodeGen/MachineFunction.h" #include "llvm/CodeGen/Passes.h" #include "llvm/InitializePasses.h" #include "llvm/P...
ALGO
0.998818
7.687396
24e5dd74-94b5-4a35-9ea7-3bfa83c3344b
NatanaelGui/Cpp
lab17/aprendizagem/exercicio1.cpp
#include<iostream> using namespace std; void lerNumeros(int vetorA[], int vetorB[], int qtdVetorA, int qtdVetorB); void exibeNumeros(int vetorA[], int vetorB[], int qtdVetorA, int qtdVetorB); void somaNumeros(int vetorA[], int vetorB[], int qtdVetorA, int qtdVetorB); int main(){ int vetorA[5]; int vetorB[...
ALGO
0.998575
4.02386
07087ce7-65df-4f79-9ad9-44fb980581b8
GambitBSM/gambit_2.0
contrib/MassSpectra/flexiblesusy/models/MSSMNoFVatMGUT/MSSMNoFVatMGUT_a_muon.cpp
// File generated at Thu 10 May 2018 14:52:06 /** * @file MSSMNoFVatMGUT_a_muon.cpp * * This file was generated at Thu 10 May 2018 14:52:06 with FlexibleSUSY * 2.0.1 and SARAH 4.12.2 . */ #include "MSSMNoFVatMGUT_a_muon.hpp" #include "MSSMNoFVatMGUT_mass_eigenstates.hpp" #include "MSSMNoFVatMGUT_cxx_diagrams.hp...
ALGO
0.953884
5.684405
a292b53f-9c44-4be0-9237-e335bf7eb33d
tumbaba/C-
백준/11726.cpp
#include <iostream> #include <vector> using namespace std; int main() { vector<unsigned long long> Arr; Arr.push_back(1); Arr.push_back(1); Arr.push_back(2); Arr.resize(1000); vector<unsigned long long> Arr_back; vector<unsigned long long> Arr_temp1; Arr_temp1.push_back(1); Arr_temp1.push_back(1); A...
ALGO
0.999986
4.074612
5999883a-c206-445d-a01a-204e45871184
extenvision/SpbSU-Homeworks
1 semester/Task 1-7/Task 1-7/Исходный код.cpp
#include <iostream> using namespace std; int main() { setlocale(0, ""); char string[100] = { 0 }; cout << " . 100 . \n"; cin >> string; int openBracket = 0; int closeBracket = 0; int i = 0; bool answer = true; while (string[i] != 0) { if (closeBracket > openBracket) { answer = false; } if (s...
ALGO
0.999949
3.9064
881a7631-0b9c-4753-b95e-4f7bdbbe6845
pari-1920/godot.py
thirdparty/basis_universal/encoder/basisu_enc.cpp
#define MINIZ_HEADER_FILE_ONLY #define MINIZ_NO_ZLIB_COMPATIBLE_NAMES #include "basisu_miniz.h" #if defined(_WIN32) // For QueryPerformanceCounter/QueryPerformanceFrequency #define WIN32_LEAN_AND_MEAN #include <windows.h> #endif namespace basisu { uint64_t interval_timer::g_init_ticks, interval_timer::g_freq; doubl...
TOOL
0.915771
3.485017
0c71cfc7-0fac-4ec4-aaaf-f4ff00b13ad4
ak1rou/CPPcourse
HW25/HW25/graph.cpp
#include "graph.h" GraphAdjList::GraphAdjList(int vertices, ConnectionType type) : Graph(vertices, type) { m_list.resize(vertices); } void GraphAdjList::addEdge(int v, int w) { m_list[v].push_back(w); if (m_connectionType == ConnectionType::undirected) { m_list[w].push_back(v); } } GraphA...
ALGO
0.992244
5.359933
62fc337f-0f15-41fa-a580-99cab227381d
VaiibhavThatai/TaskCraft-Empowered-TaskSet-Synthesis
Algorithms' Implementations/TaskSetGen1.cpp
#include<bits/stdc++.h> #define int long long int #define ff first #define ss second #define pb push_back using namespace :: std; class Task{ public: double u; // utilisation of a task double c; // worst case utilisation time of a task double t; // inter-arrival time period int d; // deadline ...
ALGO
0.973325
3.927208
8d1bfc8b-4b0c-46e7-99a2-066e6acac346
chungers/lab616
third_party/cpp/boost_1_46_1/libs/signals/example/maximum.cpp
// Boost.Signals library // For more information, see http://www.boost.org #include <algorithm> #include <iostream> #include <boost/signals/signal2.hpp> template<typename T> struct maximum { typedef T result_type; template<typename InputIterator> T operator()(InputIterator first, InputIterator last) const {...
ALGO
0.935569
5.350942
91a800d4-a811-4446-94b9-7c81b70c83f2
underscoreanuj/Codes
Hackerearth/Basic Programming/Bit Manipulation/MYSTERY.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long int ll solve(ll n) { ll result = 0; while (n) { if (n % 2) ++result; n >>= 1; } return result; } int main() { ll n = 0; while (cin >> n) { cout << solve(n) << "\n"; } ret...
ALGO
0.9999
5.249366
9cbfd542-1623-439f-97ba-0a44726f0b73
yannickl/Box2D-Examples
box2dcocos2dexamples/libs/Box2D/Dynamics/b2ContactManager.cpp
#include <Box2D/Dynamics/b2ContactManager.h> #include <Box2D/Dynamics/b2Body.h> #include <Box2D/Dynamics/b2Fixture.h> #include <Box2D/Dynamics/b2WorldCallbacks.h> #include <Box2D/Dynamics/Contacts/b2Contact.h> b2ContactFilter b2_defaultFilter; b2ContactListener b2_defaultListener; b2ContactManager::b2ContactManager()...
ALGO
0.975769
7.013261
75afb02d-f732-4ab5-930d-bfb582122c87
YangKlee/LTCB
4651050044.cpp
#include<stdio.h> int max = 0; int findmax(int n) { // dung de quy de tach so int num; if(n == 0) { return max; } else { num = n%10; if(num > max) { max = num; } return findmax(n/10); } } int main() { int n; printf("Nhap day so : "); scanf("%d", &n); printf("So lon nhat trong day la: %d ",fi...
ALGO
0.999097
3.270752
3c7b551b-2112-402c-978b-92d9af286ad9
exynos9820-Backup/android_hardware_samsung_slsi-linaro_exynos
libvision/kernel/opencl/vx_minmaxloc.cpp
/*! * \file * \brief The Min and Maximum Locations Kernel. * \author Erik Rainey <<EMAIL>> */ #include <VX/vx.h> #include <VX/vx_helper.h> #include <vxcl_kernel_module.h> static vx_status VX_CALLBACK vxMinMaxLocInputValidator(vx_node node, vx_uint32 index) { vx_status status = VX_ERROR_INVALID_PARAMETERS; ...
ALGO
0.951549
5.713815
5dc5dad2-f442-4694-95ef-3b5b4bd50213
goodstudyqaq/ACM
codeforces/1600-1699/1678/B2.cpp
#include <bits/stdc++.h> using namespace std; #ifdef LOCAL #include "copypaste/debug.h" #else #define debug(...) 42 #endif #define endl '\n' typedef long long ll; struct fast_ios { fast_ios() { cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(10); }; } fas...
ALGO
0.999925
4.268429
582c2141-a8b7-4222-b0dc-7c953c6bbd49
jeffwindsor/learn
Coursera/Data Structures and Algorithms/C4 Algoritms on Strings/W1/trie_matching_extended/trie_matching_extended.cpp
#include <algorithm> #include <cassert> #include <cstdio> #include <iostream> #include <string> #include <vector> using namespace std; int const Letters = 4; int const NA = -1; struct Node { int next [Letters]; bool patternEnd; Node () { fill (next, next + Letters, NA); patternEnd = false; } }; ...
ALGO
0.999964
4.931042
821f9862-0c19-444a-a0b6-da9c2ac5be6e
Ratel13/VitrumProjects
VitrumPuzzle/cocos2d/plugin/jsbindings/manual/pluginxUTF8.cpp
#include "pluginxUTF8.h" namespace pluginx { #define CCLOGERROR(...) do {} while(0) #ifndef NULL #define NULL 0 #endif int cc_wcslen(const unsigned short* str) { int i=0; while(*str++) i++; return i; } /* Code from GLIB gutf8.c starts here. */ #define UTF8_COMPUTE(Char, Mask, Len) \ if (Char <...
TOOL
0.900845
6.108515
550c5bdf-ff11-4d51-ba54-1a98f51b0461
yousuf-cse-bd/RandomCodes
SumOfDigits.cpp
#include <iostream> using namespace std; int main(int argc, char const *argv[]) { /* code */ int num = 1234; int rem, div, sum = 0; while (num!=0) { rem = num % 10; // cout<<rem*10<<" "; sum += rem; num = num / 10; } cout<<"\nSum of Digits: "<<sum<<endl...
ALGO
0.999591
4.799576
d1efdbde-bfad-4b13-8088-ac62764856b2
WXY666541/cplusplus
Iterator.cpp
#include<iostream> #include<list> #pragma warning(disable:4996); class String; class Iterator { public: //캯 Iterator(String& str, int idx) :pstring(&str), index(idx) {} //!=غ bool operator!=(const Iterator& rhs) { return index != rhs.index; } char& operator*(); //üӼ const Iterator operator++(int) { ...
TOOL
0.900429
3.699698
c47a57c4-0faf-4839-ab21-2197a1d43d1a
creiterer/prol16-tools
prol16-shared/src/main/cpp/NumberUtils.cpp
/** * @author creiterer * @date 2019-03-17 * @copyright Copyright (c) 2019 Christopher Reiterer * @brief Utilities regarding numbers in the PROL16 context. */ #include "NumberUtils.h" #include <algorithm> #include <cctype> // NOLINTNEXTLINE(readability-identifier-naming) namespace PROL16 { namespace util ...
ALGO
0.952338
7.480917
7962c5c0-46ff-4547-ad3d-d8bee941e12e
ForteEscape/ProblemSolvingSkill
Week2/Problem11.cpp
#include <stdio.h> #pragma warning(disable:4996) int main() { int posx1, posy1; int posx2, posy2; int posx3, posy3; int rightTrunFlag = 0; int leftTurnFlag = 0; int straightFlag = 0; int uTurnFlag = 0; scanf("%d %d", &posx1, &posy1); scanf("%d %d", &posx2, &posy2); scanf("%d %d", &posx3, &posy3); if (pos...
ALGO
0.999972
4.104424
a6114e1d-9107-4e28-9557-971316f1ee9b
jerry0339/Study_Note
Algorithm/PS_library/DP/TopDown_DP_ex.cpp
// [1520 내리막길 코드](https://www.acmicpc.net/problem/1520) #include<bits/stdc++.h> using namespace std; int N,M; int m[501][501]{}; int dp[501][501]{}; int dy[4] = {-1,1,0,0}; int dx[4] = {0,0,-1,1}; int solve(int y, int x) { if(y==0 && x==0) return 1; if(dp[y][x]!=-1) return dp[y][x]; int &ret = dp[y][x]; ...
ALGO
0.999919
4.137989
95a10cef-f6fb-4bde-bccd-39cc00fe9d6b
kovaxis/progcomp
problems/training/JoinTwoKingdoms.cpp
#pragma GCC optimize("Ofast") #include <bits/stdc++.h> using namespace std; typedef long long ll; #define REPGET(_1, _2, _3, NAME, ...) NAME #define rep3(i, b, n) for (int i = (int)(b); i < (int)(n); i++) #define rep2(i, n) rep3(i, 0, (n)) #define rep(...) REPGET(__VA_ARGS__, rep3, rep2)(__VA_ARGS__) #define invrep3(...
ALGO
0.99487
4.380424
f5840870-4464-4960-9955-d3479f50debe
dheeraj557/PROBLEM-SOLVING
173-binary-search-tree-iterator/173-binary-search-tree-iterator.cpp
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nullptr), right(nullptr) {} * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} * TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l...
ALGO
0.99988
6.292737
8d4f2b17-b12a-4190-9233-a5b11268c329
gustavomuller99/Algo
zOld/peculiar apple-tree/main.cpp
#include <bits/stdc++.h> using namespace std; vector<vector<int>> t; vector<int> d; void dfs(int n = 0, int f = -1, int dp = 0) { d[dp]++; for(int adj : t[n]) { if(adj == f) continue; dfs(adj, n, dp+1); } } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int n; cin >> n; ...
ALGO
0.999694
4.772298
f6a3bd56-3fc6-4989-8d6c-209161b467bd
lijunray/LeetCode
cpp/easy/88-Merge Sorted Array.cpp
class Solution { public: void merge(vector<int>& nums1, int m, vector<int>& nums2, int n) { if (!nums2.empty()) { nums1.resize(m); int x = 0; while (x < n) { nums1.push_back(nums2[x]); x++; } n = m + n; x...
ALGO
0.999974
5.690013
de413210-08d0-4cc2-8f45-bca2eb954af1
tridhapuku/DSP_MLIR
llvm/lib/CodeGen/MachineLateInstrsCleanup.cpp
#include "llvm/ADT/BitVector.h" #include "llvm/ADT/PostOrderIterator.h" #include "llvm/ADT/Statistic.h" #include "llvm/CodeGen/MachineBasicBlock.h" #include "llvm/CodeGen/MachineFunction.h" #include "llvm/CodeGen/MachineFunctionPass.h" #include "llvm/CodeGen/MachineInstr.h" #include "llvm/CodeGen/MachineOperand.h" #inc...
TOOL
0.939012
7.93664
54638b8a-d1d3-40df-83ec-b13bea7a791e
minhnguyeenx/HaUI_OOP
Thuchanh/TH5/Cau5_5_NguyenThiMinh_396.cpp
#include <bits/stdc++.h> using namespace std; class Sanpham{ protected: char Masp[15], Tensp[30], Ngaysx[15], Mausac[15]; float Trongluong; public: void nhap(); void xuat(); }; void Sanpham::nhap(){ cout << "Nhap ma sp: "; fflush(stdin); gets(Masp); cout << "Nhap ten sp...
TOOL
0.987587
3.313038
bed04cbb-b7ec-4115-8f9a-65cd0188314a
leexinai/2025aaia
week08/week08-3.cpp
///week08-3.cpp ///LeetCode 2843. Count Symmertric Integers ///qlow....highƦr [@b] [_==k[_ class Solution { public: int countSymmetricIntegers(int low, int high) { int ans = 0;///jeansO0 for(int i=low; i<=high; i++){ int a = i/1000;///d(߽ a6P ¦) int b = i/100%10;///ʦ ...
ALGO
0.999705
6.175174
8fe269d2-d629-4a6d-97a2-dae30cd3c9dc
Randowlh/Project_ACM_2021
code/competition/Educational Codeforces Round 101/1.cpp
#include <bits/stdc++.h> using namespace std; #pragma optimize(2) //#pragma GCC optimize("Ofast,no-stack-protector") //#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native") const int inf = 0x7FFFFFFF; typedef long long ll; typedef double db; typedef long double ld; template<class T>inline v...
ALGO
0.999921
3.611712
ee12656a-376c-4d77-a72c-1ea7c6c25452
Achira16/My_codes
codeforces/cf18.cpp
#include<bits/stdc++.h> using namespace std; #define IOS ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); #define endl '\n' #define ll long long ll sum(ll x,ll k){ if(x <= k) return (x*(x+1))/2; ll n1 = k-(x-k)-1; ll n2 = k-1; ll sum = (n2 * (n2+1))/2 - (n1 * (n1+1))/2; sum += (k * (k+1))/2; ret...
ALGO
0.999918
4.030992
8809849e-074a-4146-8bc9-45219b729397
deepakiiitkota/Competitive
C++/Amazon/amazon_largest_path_through_node.cpp
/* https://www.reddit.com/r/leetcode/comments/1ayxehk/amazon_oa_sde1/ Given a graph, 1. Find the minimum distance between two nodes. 2. Find the largest distance passing through a node and return the distance. The graph is undirected and weights are positive. Example: A -- 2 -- B -- 6 -- C --4-- D | ...
ALGO
0.99965
5.062509
1db42ae6-a574-44c8-b604-c9fe7573d807
cooljacket/algo2015
dp/cv-1017-乘积最大.cpp
#include <iostream> #include <string> using namespace std; typedef long long LL; LL dp[50][50]; LL toDigit(string& s, int beg, int end) { LL ans = 0; for (int i = beg; i <= end; ++i) { ans *= 10; ans += LL(s[i] - '0'); } return ans; } int main() { int n, k; string s; cin >> n >> k >> s; LL maxN = -1; ...
ALGO
0.999659
3.780897
f6ccbb9d-a929-4f4e-b557-b51875a5842c
TETEURYAN/CompetitiveProgramming
Online Judges/CodeForces/1915F.cpp
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; const int N1 = (int)2e5 + 100; #define PI 3.14159265358979323846264338327 #define forn for(i=0;i<n;i++) #define fornn for(i=1;i<=n;i++) #define all(x) (x).begin(), (x).end() #define f first #def...
ALGO
0.999668
4.308137
c5a6f1fa-67b3-4b34-9679-c9b146af1cb2
Surekhadhote/Basic_DataStructures
transposeofmatrix.cpp
#include <stdio.h> // This function stores transpose of A[][] in B[][] int read(int A[3][3],int ,int); int print(int A[3][3] ,int k,int l ) ; int transpose(int A[3][3] ,int k,int l ) ; int main() { printf("input matrix of 3"); int A[3][3],B[3][3]; read(A,3,3); printf(" \n"); print(A,3,3); print...
ALGO
0.999852
3.114675
cf2f47de-5fbc-4780-95e9-446bdd6af913
ishandutta2007/codeforces
353cerega/normal/1648/C.cpp
#pragma GCC optimize("Ofast") #include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; #define X first #define Y second //const ll mod = 1000000007; const ll mod = 998244353; ll gcd(ll a, ll b) { a = abs(a); b = abs(b); if (a==0 or b==0) return a+b; return gcd(b,a...
ALGO
0.999987
4.650941
e13330b3-93b6-4a52-9cd5-018a665bb3dc
pantarhei42/archilyse-view
thirdparty/glm/test/gtx/gtx_fast_trigonometry.cpp
#define GLM_ENABLE_EXPERIMENTAL #include <glm/gtc/type_precision.hpp> #include <glm/gtx/fast_trigonometry.hpp> #include <glm/gtx/integer.hpp> #include <glm/gtx/common.hpp> #include <glm/gtc/constants.hpp> #include <glm/gtc/ulp.hpp> #include <glm/gtc/vec1.hpp> #include <glm/trigonometric.hpp> #include <cmath> #include <...
TEST
0.974896
6.20777
2762eecc-39b1-48c5-88c6-12b56fd6b900
zxyDEDIRE/ACM_CODE
CodeForces/Codeforces Round 690 (Div. 3)/a.cpp
#include<bits/stdc++.h> using namespace std; using ll=long long; using pii=pair<int,int>; const int maxn=1e6; int p[maxn]; int n; void solve() { cin>>n; for(int i=1;i<=n;i++) cin>>p[i]; int l=1,r=n; for(int i=1;i<=n;i++) { if(i&1)cout<<p[l]<<" ",l++; else cout<<p[r]<<" ",r--; } cout<<endl; } int main(){ ...
ALGO
0.999981
4.279707
4bed85b7-550d-49ce-b262-72c995a4bc36
TSCTeam/tsc_pow_sha3
src/wallet/feebumper.cpp
#include "consensus/validation.h" #include "wallet/coincontrol.h" #include "wallet/feebumper.h" #include "wallet/wallet.h" #include "policy/fees.h" #include "policy/policy.h" #include "policy/rbf.h" #include "validation.h" //for mempool access #include "txmempool.h" #include "utilmoneystr.h" #include "util.h" #include ...
TOOL
0.993972
6.946136
97b10c79-d00e-41e5-8635-8da7cfdc5dba
eloquentarduino/tflm_cortexm
src/tensorflow/lite/micro/kernels/log_softmax.cpp
#include "tensorflow/lite/kernels/internal/reference/log_softmax.h" #include <cstddef> #include <cstdint> #include "tensorflow/lite/c/common.h" #include "tensorflow/lite/kernels/internal/quantization_util.h" #include "tensorflow/lite/kernels/internal/tensor_ctypes.h" #include "tensorflow/lite/kernels/internal/types.h...
ALGO
0.958474
7.562087
80106596-5f85-4ec1-8803-03532b74ef48
shivam802/DS-A-Assignments
ShivamSolanki_2013502/Day10/Q51.cpp
class Solution { public: string addStrings(string num1, string num2) { int n=num1.size(); string res=""; int m=num2.size(); int carry=0; for(int i=n-1,j=m-1;i>=0||j>=0;i--,j--) {int sum=0;int n1=0,n2=0; if(i>=0) n1=num1[i]-'0'; if(j>=0)...
ALGO
0.999829
6.246945
95746921-a493-4e1f-abb3-30957a58377c
ORNL/ReSolve
resolve/matrix/MatrixHandlerHip.cpp
#include "MatrixHandlerHip.hpp" #include <algorithm> #include <resolve/hip/hipKernels.h> #include <resolve/hip/hipVectorKernels.h> #include <resolve/matrix/Coo.hpp> #include <resolve/matrix/Csc.hpp> #include <resolve/matrix/Csr.hpp> #include <resolve/utilities/logger/Logger.hpp> #include <resolve/vector/Vector.hpp> ...
TOOL
0.926185
6.2533
8960bc66-836e-4377-8eec-b2408b4fb603
manikanta2901/ubuntu
.history/codingChallenges/cpp/Codechef/longChallenges/Year2021/May/TickTockToe_20210509140142.cpp
#include<bits/stdc++.h> using namespace std; bool isCon1(vector<vector<char> > mat,char a){ // first row if(mat[0][0] == mat[0][1] == mat[0][2] == a){ return true; } // second row if(mat[1][0] == mat[1][1] == mat[1][2] == a){ return true; } // Third row if(mat[2][0] == ...
ALGO
0.999987
3.975474
f7a2075b-cdd2-4c2c-8940-27c64f9d76d9
takumi152/atcoder
abc189d.cpp
#include <iostream> #include <iomanip> #include <vector> #include <algorithm> #include <utility> #include <string> #include <queue> #include <stack> using namespace std; typedef long long int ll; typedef pair<int, int> Pii; const ll mod = 1000000007; int main() { cin.tie(0); ios::sync_with_stdio(false); int ...
ALGO
0.999943
4.909531
de9b7af3-defb-491b-8cc6-2feba6d03f92
Zarka0/Leetcode
0020-valid-parentheses/0020-valid-parentheses.cpp
//Iterate over the characters //if character is opening bracket then push into stack //store top of the stack and compare if it is closing bracket or not //return if stack is empty(valid) or not class Solution { public: bool isValid(string s) { stack<char> stack; for(int i=0; i<s.length(); i++){ ...
ALGO
0.999828
6.33875
b3396595-786a-4e9c-9034-24325926bced
Sinha1523/Competitive-Programming
2044A - Easy Problem.cpp
// week 3 #include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int t ; cin >> t ; while(t--){ int n ; cin >> n ; cout << n - 1 << endl ; } return 0; }
ALGO
0.999773
4.336901
751c9c86-e751-483e-b989-63d1588761ca
DanielHCorreia/competitive-programming
ad-hoc/fuses.cpp
//source: https://uva.onlinejudge.org/external/6/p661.pdf #include <bits/stdc++.h> using namespace std; int main(){ int n, d; long long int m, c, actual = 0, max = 0, seq = 1, cd; pair<int, bool> disp; vector <pair<int, bool> > disps; bool blown = false; while(scanf("%d %lld %lld", &n, &m, &c) && !(n == 0 &&...
ALGO
0.999204
3.547187
e635b39c-3e57-48d9-80c1-2ab8bdc60a20
Abhishekkute234/Data-Structure-and-Algorithm-in-CPP
STRIVE_A_to_Z_Sheet/Step 08 ~ Bit Manipulation/PRIME-FACTORS-OF-A-NUMBER.CPP
#include <bits/stdc++.h> using namespace std ; class Solution{ public: vector<int>AllPrimeFactors(int N) { // Code here vector<int> ans ; for(int i =2 ; i <= N ; i++){ if(N%i ==0){ ans.push_back(i) ; while(N%i==0){ N /= i ; ...
ALGO
0.999903
4.480595
9fc4ecbc-4d13-49c6-a007-e80fb84da344
EasonHu2022/RT
third_party/boost_1_80_0/libs/multiprecision/example/cpp_int_snips.cpp
#include <boost/multiprecision/cpp_int.hpp> #include <iostream> void t1() { //[cpp_int_eg //=#include <boost/multiprecision/cpp_int.hpp> //=#include <iostream> //= //=int main() //={ using namespace boost::multiprecision; int128_t v = 1; // Do some fixed precision arithmetic: for(unsigned i = 1; i <= 20;...
ALGO
0.933464
4.55331
78d9f875-8fd2-4a6b-8460-e1431c9f3102
lucashenriquejbe/desafios
Exercicio/junina/junina.cpp
#include <iostream> #include <values.h> #include <cstdlib> #include <cstdio> #include <vector> short n, i, j, k, lim; short set[21]; bool E[21][21]; using namespace std; void junina(short u, short nset) { if( u > n ) { if( lim < nset ) lim = nset; return; } if( (nset+n-u+1) <= lim ) return; bool is =...
ALGO
0.9921
3.890822
bef13719-28d2-4e8e-b343-7e264bc4f5fb
hjiang13/LLMs-in-IR
POJ-104/53/119.cpp
#include <iostream> using namespace std; int main() { int n,a[300],*p1,*p2,i,num=0,b[300],j,flag; cin>>n; for(i=0; i<n; i++) cin>>a[i]; p1=a; p2=b; b[num]=*p1; num++; for(i=0; i<n; i++) { flag=0; for(j=0; j<num; j++) { if(*(p1+i)==*(p2+j)) flag=1; } if(flag==0) { *(p2+num)=*(p1+i); num++; } } for(i=0; i<num; i++) { if(...
ALGO
0.999989
3.194934
eb70d92e-3760-4513-9f02-2ca214543e18
muhammadzkralla/Problem_Solving_Notes
BS & TP/1358. Number of Substrings Containing All Three Characters.cpp
#include<bits/stdc++.h> using namespace std; class Solution { public: int numberOfSubstrings(string s) { int n = s.size(), l = 0, ans = 0; map<char, int> freq; for (int i = 0; i < n; ++i) { freq[s[i]]++; while (freq['a'] > 0 && freq['b'] > 0 && freq['c'] > 0) { ...
ALGO
0.999932
5.347903
b771dacf-de3c-47b4-b467-5ff253b0541e
Justdwiwt/Cpp_basic
src/leetcode/105.cpp
#include <vector> using namespace std; struct TreeNode { int val; TreeNode *left; TreeNode *right; explicit TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} }; class Solution { public: TreeNode *buildTree(vector<int> &preorder, vector<int> &inorder) { return recFunc(preorder, i...
ALGO
0.999984
6.497881
26a9087e-8a4b-4eb9-83bb-367f8f884059
SandeBastian/ENTRENAMIENTO
Mode2/slot1.1.cpp
/*Ejemplo 2: Para un conjunto de N edades en e rango de 15 a 40 anios. Se desea averiguar el numero de apariciones de cada una de ellas Ejemplo: N=6: Edades: 16, 20, 16, 24, 20, 27 Salida: Edad Apariciones 16 2 20 2 24 1 27 1*/ #include <iostream> using namespace std; int main(){ int n,Edad,i; do{ c...
ALGO
0.872699
3.204632
3dcd471f-8d7b-4766-b47b-44cce748f49e
neboat/opencilk-ppopp-23-ae
oneTBB/examples/getting_started/sub_string_finder/sub_string_finder.cpp
#include <iostream> #include <string> #include <vector> #include <algorithm> // std::max #include "oneapi/tbb/parallel_for.h" #include "oneapi/tbb/blocked_range.h" #include "common/utility/utility.hpp" bool silent = false; static const std::size_t N = 23; class SubStringFinder { const std::string &str; std...
ALGO
0.999672
5.923072
51358e11-c30e-459a-b80b-7d565a2641d4
AhmedMorgan/morganslib
Binary search/167 - The Sultan's Successors.cpp
#include <bits/stdc++.h> #define ll long long #define mp make_pair #define PI 3.1415926535897932384626433832 #define MOD 1000000007 #define MOD2 1000000009 #define bas 29 #define bas2 19 using namespace std; const int len = 1e3 + 9; int arr[len]; int n, m, x; int valid(int mid, int x){ return arr[mid] - x; } int b...
ALGO
0.999905
4.823232
e49e7655-ab87-4cd1-b880-2583ea7f3c0a
TheSanvi/c_plus_plus_programming
DAILY_LC_questions/1380.cpp
#include <vector> #include <algorithm> using namespace std; class Solution { public: vector<int> luckyNumbers (vector<vector<int>>& matrix) { vector<int> luckyNumbers; int m = matrix.size(); int n = matrix[0].size(); for (int i = 0; i < m; ++i) { int minElement...
ALGO
0.999958
7.016877
c234def2-17da-4970-8fb0-61c9f1eb6805
ishandutta2007/codeforces
noimi/normal/722/B.cpp
#pragma region Macros #pragma GCC optimize("O3") #include <bits/stdc++.h> #define ll long long #define ld long double #define rep2(i, a, b) for(ll i = a; i <= b; ++i) #define rep(i, n) for(ll i = 0; i < n; ++i) #define rep3(i, a, b) for(ll i = a; i >= b; --i) #define pii pair<int, int> #define pll pair<ll, ll> #define ...
ALGO
0.999838
4.48351
f474671c-cdaa-48d1-9893-f585eda393b5
honggilgim/algorithm_study
0198-house-robber/0198-house-robber.cpp
class Solution { public: int rob(vector<int>& nums) { int arr[101] = {0}; arr[0] = nums[0]; if(nums.size() == 1) return nums[0]; if(nums.size() == 0) return 0; arr[1] = max(arr[0],nums[1]); for(int i=2; i<nums.size(); i++) { arr[i] = max(nums[i]+arr[i-2],...
ALGO
0.999901
5.877974
746f4bc9-e263-4a7d-bec2-1d69423f3ddf
SophiaSilveira/AlestI
04_EstruturasLineares/listasEncadeadas/dupla/reverse18.cpp
#include <iostream> using namespace std; struct Node { int info; Node *prev, *next; Node(int i) { info = i; prev = next = nullptr; cout << "+ Node(" << info << ") criado..." << endl; } ~Node() { cout << "- Node(" << info << ") destruido..." << endl; } }; void reverse(Node **head, Node **tail) { Node *...
ALGO
0.999703
4.956897
76241313-ec25-4979-9ee2-bc21c2ce5666
vansh-kapila/Coding_Blocks_CPP
number_query.cpp
/* Author : VANSH KAPILA */ /* "The greatest glory in living lies not in never falling, but in rising every time we fall." -*/ #include <bits/stdc++.h> #define pb(x) push_back(x) #define all(x) x.begin(), x.end() #define debug(x) cout << '>' << #x << ':' << x << endl; #define int long long #define ld long doubl...
ALGO
0.999835
4.172333
ea4d94ca-121a-41ba-890e-4096081f4372
vtothsvk/cov-v-4-lite
pbkdfAuth.cpp
#include "pbkdfAuth.h" int rDasAuth::makeKey(char *password, char *salt, int iterations){ int ret; mbedtls_md_context_t sha1_ctx; const mbedtls_md_info_t *info_sha1; size_t plen = strlen(password); size_t slen = strlen(salt); const unsigned char *pwd = (unsigned char*)password; const unsign...
ALGO
0.910594
3.725905
36163871-237c-42e1-92ca-ccca92ac579f
0xAriseAizen-404/LeetCode-Solutions
2323-minimum-bit-flips-to-convert-number/2323-minimum-bit-flips-to-convert-number.cpp
class Solution { public: int minBitFlips(int start, int goal) { // return __builtin_popcount(start ^ goal); int notEqualBits_cnt = 0; for (int i=0; i<32; ++i) { if ((start&(1 << i)) != (goal&(1 << i))) notEqualBits_cnt += 1; } return notEqualBits_c...
ALGO
0.999979
5.766472
3ab60c78-32de-4971-a40a-7cc5db06e63c
srikanthsabhavat/Data-structures
merge_sort.cpp
#include<iostream> #include<bits/stdc++.h> using namespace std; int merge_sort(int arr[],int n) { int mid,low=0,high=n-1; if(low<high) { mid =(low+high)/2; merge_sort(low,mid); merge_sort(mid+1,high); merge(arr,low,mid,high); } return 0; } int merge(int arr,int low,int mid,int high) { int b[...
ALGO
0.999987
4.730628
1f56d6c4-e2c7-4a01-92a4-547c8d79cc95
DSC-Banasthali-Vidyapith/Code-Crossroad
Linked list/Finding_middle_element_in_a_linked_list.cpp
/* Algorithm : Initialize two pointers, slow and fast to head. When traversing the list with a pointer slow, pointer fast traverses twice as fast. When fast reaches the end of the list, slow must be in the middle. */ #include <iostream> using namespace std; //Node class struct Node { int data; Node* next; ...
ALGO
0.99995
6.303152
f0e18763-0de5-41b1-beca-e4f684413c58
ai-nikolaev/repo-cppboost
libs/bimap/example/bimap_and_boost/range.cpp
// VC++ 8.0 warns on usage of certain Standard Library and API functions that // can be cause buffer overruns or other possible security issues if misused. // See http://msdn.microsoft.com/msdnmag/issues/05/05/SafeCandC/default.aspx // But the wording of the warning is misleading and unsettling, there are no // po...
TOOL
0.954783
6.180969
034f7873-1686-47a7-a6b7-aa9951e3e48d
Vinaypatil-Ev/aniket
6.POINTERS/2.call_by_address.cpp
// Demonstrate addition of two floating type numbers by using call by address #include<iostream> using namespace std; double sumd(double *x, double *y) { double sum = *x + *y; return sum; } int main() { double a = 10.5, b = 5.2, sum; sum = sumd(&a, &b); cout << "sum of " << a << " and " << b << "...
ALGO
0.994769
5.577656
8e14e1c7-a416-4f52-a2a3-a5726e31626a
sanjib-sen/bracu-acm
contests/3rd Long Contest/B.cpp
#include <bits/stdc++.h> using namespace std; int t,n; int main(){ map<int,int> m; vector <pair<int,int>> v; vector <int> v1; while(cin>>t){ if (m.count(t)==0){ m[t]=1; v1.push_back(t); } else{ m[t]+=1; } } for (int i=0;i<v1.s...
ALGO
0.999407
3.524326
92d560d3-583b-48b2-a6ec-8e0c15a8e8f6
holmes64/Atcoder
ABC65/ABC065C.cpp
#include <iostream> #include <vector> #include <string> #include <math.h> #include <algorithm> #define ll long long using namespace std; int main(){ ll NN = 1e+9; NN += 7; ll n; ll m; cin >> n >> m; ll result=1; if(n >= m+2 || m >= n+2){ cout << 0 << endl; }else if(n == m)...
ALGO
0.999977
3.848357
8f6359e0-e90d-4022-afbf-b2e79c539b93
tanmay777/DSA-Implementations
Linked List/linkedList.cpp
#include<iostream> #include <unistd.h> using namespace std; struct Node{ int info; Node *next; }*start,*ptr,*save,*newptr,*rear; Node* createNewNode(int); void insertBeg(Node *); void display(Node *); void insertEnd(Node *); void del(); Node* InsertNth(Node *head, int data, int position); int main(){ st...
ALGO
0.994876
3.588267
b8d06914-55a1-4602-ad51-1478c16ef9a2
semenInRussia/cf
toff/qual/_bb/c.cpp
// semenInRussia 2024 #include <cassert> #include <iostream> using namespace std; using ll = long long; #pragma GCC optimize("unroll-loops,Ofast") const int N = 1 << 17; struct node { int sum = 0; int lazy = -1; }; node t[2 * N]; // push() void upd(int x, int len, int val) { t[x].sum = len * val; t[x].lazy...
ALGO
0.999953
4.508496
9dd07597-293c-46aa-80d8-30255da7bc5f
bioexcel/bioexcel-code-releases
GROMACS/gromacs-2019-beta1/src/gromacs/pbcutil/rmpbc.cpp
#include "gmxpre.h" #include "rmpbc.h" #include <cmath> #include <cstdlib> #include <algorithm> #include "gromacs/math/vec.h" #include "gromacs/pbcutil/mshift.h" #include "gromacs/pbcutil/pbc.h" #include "gromacs/topology/atoms.h" #include "gromacs/topology/idef.h" #include "gromacs/trajectory/trajectoryframe.h" #i...
TOOL
0.995689
7.30938
c6dd633b-9ee0-41ff-a261-f106c7a310ae
VipulNikam41/DSA
7) MST/v4.cpp
#include<iostream> #include<fstream> #include<stdlib.h> using namespace std; int cost[10000][10000],k,visit,visited[150000],l,v,count,count1,vst,p; ofstream outf("out.txt"); int cal_size(int took[10000][2],int *c,int l) { int size=1,k=0,num1,num2; while(k!=l) { int flg1=1,flg2=1; num1=took[k][0]; num2=took[k]...
ALGO
0.999932
3.712771
a2427af7-9971-4273-960b-c22100dc4a06
MaxiM863/Animation_AAA
Library/Source_Files/10_Helper_Recipes/compacte.cpp
#include "10_Helper_Recipes/compacte.h" namespace VulkanCookbook { Matrix4x4 PrepareTranslationMatrix( float x, float y, float z ) { Matrix4x4 translation_matrix = { 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f...
TOOL
0.958866
4.762903
d9234060-1b0b-4de9-b0c0-4b4e8c87e7a9
ishandutta2007/codeforces
bolshevik/normal/1599/G.cpp
#include<cstdio> #include<algorithm> #include<utility> #include<cmath> using namespace std; const int o=4e5+10; int n,K,a[o],b[o],yny,whx,st[o],tp,sp,st2[o],tp2;long double ans=1e18,s; inline bool chk(int i,int j,int k){return (b[j]-b[i])*1ll*(a[k]-a[i])==(b[k]-b[i])*1ll*(a[j]-a[i]);} inline void slv(int x,int y){ int...
ALGO
0.999963
3.874409
86e2dbba-4be7-4cca-815f-78dd19aa3b90
s23319-pjatk/Graph-coloring
Graph-color/main.cpp
// // main.cpp // Graph-color // // Created by Marceli Gosztyła on 11/05/2024. // #include <iostream> #include <queue> #include <sstream> #include <algorithm> #include <vector> using namespace std; class Graph { int V; //liczba wierzchołków vector<vector<int> > adj; // lista sąsiedztwa public: Gr...
ALGO
0.99875
5.953566
c591824a-d004-4a06-99ad-02f096ceb8c2
ishandutta2007/codeforces
sakurakoujiruna/normal/166/B.cpp
#include <iostream> using namespace std; const int N = 100011; typedef long long intl; struct Point { intl x, y; Point operator -(Point p) { return {x - p.x, y - p.y}; } intl cross(Point p) { return x * p.y - y * p.x; } }p[N]; intl xmul(Point a, Point b, Point c) { return (b - a).cross(c - a); } int main(...
ALGO
0.999994
4.8765
b7cf58aa-ad94-4b4f-ad75-661ddd5e860d
AntonioPGR/anthony_parking
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
780eb37a-ddf8-49b8-9f17-b5fdf0f5ce55
NamanZelawat/Algorithms
lab2/cyclecheck.cpp
#include<bits/stdc++.h> using namespace std; void cycler(int vis[],int i,int j,int n); int a[1000][1000]; int main() { int n; cout<<"Give the total number of nodes"<<endl; cin>>n; int vis[n+1]; for(int i = 0;i<=n;i++) { vis[i] = 0; } for(int i = 0;i<=n;i++) { for(int j = 0;j<=n;j++) { a[i][j] = 0;...
ALGO
0.999809
3.609068
57019a90-00ba-4f91-b153-c9fb7dc091f3
bazelment/boost
chrono/example/min_time_point.cpp
// min_time_point.cpp ----------------------------------------------------------// #include <boost/chrono/typeof/boost/chrono/chrono.hpp> #include <boost/type_traits.hpp> #include <iostream> using namespace boost::chrono; template <class Rep, class Period> void print_duration(std::ostream& os, duration<Rep, Perio...
TOOL
0.896478
5.73795
8863097d-b7e9-48a9-af66-96df8a745528
nicollecnunes/ufop
BCC204/tp2/FordFulkerson.cpp
#include "FordFulkerson.hpp" #define LIMITE_INFERIOR 0 #define DIRETO 1 #define REVERSO -1 #define SOMA 1 #define SUBTRAI 2 Grafo:: Grafo(int qV, int qA):qtdVertices(qV), qtdArcos(qA){} Grafo:: ~Grafo(){} Vertice:: Vertice(int i, int fR):id(i), foiRotulado(fR){} Vertice:: ~Vertice(){} string handleRotuloTipoArco(...
ALGO
0.999527
4.471641
f617e176-049b-410d-9b92-1e820f66413c
LingerDavid/UVA
uva_brute_force/524.cpp
#include<iostream> #include<string.h> using namespace std; bool flag[17]; int a[100][16], k; bool is_prime(int num){ for(int i = 2; i < int(num / 1.41); i++){ if(num % i == 0)return false; } return true; } bool is_legal(int* s, int n){ for(int i = 0; i < n; i++){ if(!is_prime(s[i] + s[(i + 1) % n])){ retur...
ALGO
0.999749
3.544998
d496b46f-a1a8-49d9-8c68-9b4ad3dd8d33
YongJ7/Algorithm
HASH/[백준] 9375-패션왕 신해빈/용제/9375-패션왕 신해빈.cpp
#include <iostream> #include <unordered_map> using namespace std; unordered_map<string, int> arr; int main() { cin.tie(0); cin.sync_with_stdio(0); int ans = 1; int testcase, n; cin >> testcase; while (testcase--) { cin >> n; string cloth, kind; for (int i = 0; i < n; i++) { cin >> cloth >> kind; arr[...
ALGO
0.999316
4.228224
9ef54126-e83f-4ee5-85aa-f36b72aa04b8
amanharitsh123/Algorithms-DataStructures
CodeChef/KINGCON.cpp
#include<bits/stdc++.h> using namespace std; typedef long long int lli; #define N 3001 #define all(arr) arr.begin(),arr.end() #define f first #define s second #define debug1(x) cout<<x<<"\n" #define debug2(x,y) cout<<x<<" "<<y<<"\n" #define debug3(x,y,z) cout<<x<<" "<<y<<" "<<z<<"\n" #define nl cout<<"\n"; #define pq ...
ALGO
0.999976
4.323735
fdacfd93-1a3b-4b1f-b729-ac50e79127ae
simonlynen/tbb-arm
examples/parallel_do/parallel_preorder/parallel_preorder.cpp
#include "tbb/parallel_do.h" #include <vector> #include <algorithm> #include "Graph.h" class Body { public: Body() {}; //------------------------------------------------------------------------ // Following signatures are required by parallel_do //------------------------------------------------------...
ALGO
0.999664
5.85554
d8cdc78f-a716-4aee-a9db-70a76d8d449d
InTheShadow/PAT-Advanced-Level
1007 Maximum Subsequence Sum .cpp
#include <cstdio>' #include <vector> using namespace std; int main(){ int n,flag = 0,sum = -1,temp = 0,left = 0,right = 0,tempIndex = 0; scanf("%d",&n); vector<int> v(n); for(int i = 0;i<n;i++){ scanf("%d",&v[i]); if(v[i] >= 0) flag = 1; temp = temp+v[i]; if(temp > sum){ sum = temp; right = i; lef...
ALGO
0.999891
3.30428
c0a03a3e-2e7e-4083-9296-e74a548c4dd4
omarkahol/Parallel-PDE-solvers
FEM_CODE/main.cpp
#include <iostream> #include "solver.h" int main(int argc, char **argv) { dealii::Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); solver<2> solv; solv.run(); }
ALGO
0.850755
4.647169
68d361e6-ab71-4c48-89d0-ea662de5bf40
hoanxuanbach/Competitive-Programming
ICPC/Universal Cup/2nd/Stage 10 Harbin/H.cpp
// Judges with GCC >= 12 only needs Ofast // #pragma GCC optimize("O3,no-stack-protector,fast-math,unroll-loops,tree-vectorize") // MLE optimization // #pragma GCC optimize("conserve-stack") // Old judges // #pragma GCC target("sse4.2,popcnt,lzcnt,abm,mmx,fma,bmi,bmi2") // New judges. Test with assert(__builtin_cpu_sup...
ALGO
0.999902
4.475849
8329ff9e-40ca-40bd-bde5-109b05404208
nikhil-robinson/opencv-esp32
opencv_contrib/modules/text/samples/segmented_word_recognition.cpp
/* * segmented_word_recognition.cpp * * A demo program on segmented word recognition. * Shows the use of the OCRHMMDecoder API with the two provided default character classifiers. * * Created on: Jul 31, 2015 * Author: Lluis Gomez i Bigorda <lgomez AT cvc.uab.es> */ #include "opencv2/text.hpp" #include "op...
TOOL
0.906664
6.348693
21b7230c-257a-4595-8884-02d9ee412980
halogenOS/android_device_google_cuttlefish
host/libs/config/config_utils.cpp
#include "host/libs/config/config_utils.h" #include <string.h> #include <iomanip> #include <sstream> #include <android-base/logging.h> #include <android-base/strings.h> #include "common/libs/utils/contains.h" #include "common/libs/utils/environment.h" #include "common/libs/utils/in_sandbox.h" #include "common/libs/...
CONFIG
0.933989
6.526149
1d08ded6-aec7-4bb9-b6f4-e55bf926494d
jnava1612/Teambook-Sindicato-de-Transporte-2880
Graphs/Eulerian.cpp
// A C++ program to check if a given graph is Eulerian or not #include<iostream> #include <list> using namespace std; // A class that represents an undirected graph class Graph { int V; // No. of vertices list<int> *adj; // A dynamic array of adjacency lists public: // Constructor and destructor Graph(int V) {this-...
ALGO
0.99757
5.799079
88cd94c2-9afd-4b6d-9afc-3c328b90263c
lanukk/cp
cses/sortingAndSearching/playlist.cpp
#include<bits/stdc++.h> using namespace std; int n; int *a; int main() { cin >> n; a = new int[n]; map<int, int> mp; for (int i = 0 ; i < n; i++) { cin >> a[i]; } int ans = 1 ; int l = 0, r = 1; mp[a[l]]++; //cout << ans; map<int, int> index; index[a[l]] = l; while (r < n) { mp[a[r]]++; if (mp[a[r]]...
ALGO
0.999893
4.158269
c255a3a1-15a5-4b53-a82d-2de93e5128b6
TheBlokker/gtav-for-half-life
cl_dll/view.cpp
// view/refresh setup functions #include "hud.h" #include "cl_util.h" #include "cvardef.h" #include "usercmd.h" #include "const.h" #include "entity_state.h" #include "cl_entity.h" #include "ref_params.h" #include "in_defs.h" // PITCH YAW ROLL #include "pm_movevars.h" #include "pm_shared.h" #include "pm_defs.h" #inclu...
TOOL
0.890002
3.068952
2b50d524-0ea1-4588-a32c-b8e5c59fb3f7
Nezz7/Competitive-programming
UVA/10174 - Couple-Bachelor-Spinster Numbers..cpp
#include <bits/stdc++.h> #define endl '\n' #define LL long long #define LD long double #define pb push_back #define sz(a) (int)a.size() #define all(a) a.begin(),a.end() #define rall(a) a.rbegin(),a.rend() #define debug(x) cerr << #x << " is " << x << endl; using namespace std; int const MAXN = 1e5 + 9; LL a[MAXN]; void...
ALGO
0.999163
3.418835
4ba3280f-1bec-4652-bab8-a262eaad61c2
imulan/procon
codeforces/1066B.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i)) #define all(x) (x).begin(),(x).end() #define pb push_back #define fi first #define se second #define dbg(x) cout<<#x" = "<<((x))<<endl template<class T,class U> ostream& operator<<(ostream& o, const pa...
ALGO
0.999811
3.891232
65d78277-1860-49c1-9fbc-b0bedfed2565
LRL52/ACM-ICPC
2023-ICPC-寒假&春季训练/5.20/D_Flipper.cpp
/*** * @Author: LRL52 * @Date: 2023-05-19 23:11:13 * @LastEditTime: 2023-05-19 23:22:43 */ #include <bits/stdc++.h> #define rep(i, a, b) for(int i = (a); i <= (b); ++i) using namespace std; using i64 = long long; using pii = pair<int, int>; const int N = 2e5 + 55, inf = 0x3f3f3f3f, MOD = 1e9 + 7; int n, a[N]; sig...
ALGO
0.999992
4.330134
c69d522b-824a-4167-881e-43d5ea42f1f3
sripadma-git/gfg-solutions
Difficulty: Hard/Burning Tree/burning-tree.cpp
//{ Driver Code Starts // Initial Template for C++ #include <bits/stdc++.h> using namespace std; class Node { public: int data; Node *left; Node *right; Node(int val) { data = val; left = right = NULL; } }; Node *buildTree(string str) { // Corner Case if (str.length() =...
ALGO
0.998577
6.630954
dd7a4370-b380-41d3-ad02-5e33b8dc26fb
eff3ct/Baekjoon-Online-Judge-Problem-Solving
1043/1043.cpp
// https://www.acmicpc.net/problem/1043 // #include <iostream> #include <vector> using namespace std; int find(vector<int>& parent, int a) { if(parent[a] == a) return a; else return parent[a] = find(parent, parent[a]); } void uni(vector<int>& parent, int a, int b) { int aP = find(parent, a); int bP =...
ALGO
0.999857
4.518157
15902f22-56cc-4ad5-ae45-48743a3bfa44
SCS2017/Leetcode-Solution
图和并查集/547_FriendCircles.cpp
/* 班上有N名学生。其中有些人是朋友,有些则不是。他们的友谊具有是传递性。如果已知A是B的朋友,B是C的朋友,那么我们可以认为A也是C的朋友。所谓的朋友圈,是指所有朋友的集合。 给定一个N*N的矩阵M,表示班级中学生之间的朋友关系。如果M[i][j] = 1,表示已知第i个和j个学生互为朋友关系,否则为不知道。 你必须输出所有学生中的已知的朋友圈总数。 示例 1: 输入: [[1,1,0], [1,1,0], [0,0,1]] 输出: 2 说明:已知学生0和学生1互为朋友,他们在一个朋友圈。 第2个学生自己在一个朋友圈。所以返回2。 示例 2: 输入: [[1,1,0], [1,1,1], [0,1,1]] 输...
ALGO
0.999991
5.770308
821937a7-8785-4a3a-b2a9-eef49e426a76
chaos4ros2/moveit2
moveit_planners/sbpl/core/sbpl_interface/src/sbpl_interface.cpp
#include <sbpl_interface/sbpl_interface.h> #include <planning_models/conversions.h> //#include <valgrind/callgrind.h> namespace sbpl_interface { bool SBPLInterface::solve(const planning_scene::PlanningSceneConstPtr& planning_scene, const moveit_msgs::srv::GetMotionPlan::Request& req, ...
TOOL
0.946737
5.672612
8918e659-9e39-40ee-89d1-63231bced0f8
bhilllai/Leetcode-DSA-Solutions
1074-38-2342-max-sum-of-a-pair-with-equal-sum-of-digits/1074-38-2342-max-sum-of-a-pair-with-equal-sum-of-digits.cpp
class Solution { public: int sumdigits(int num){ int ans=num%10; while(num/=10){ ans+=num%10; } return ans; } int maximumSum(vector<int>& nums) { int n=nums.size(); unordered_map<int,vector<int>> m; int maxi=0; for(int i=0;i<n...
ALGO
0.999963
5.533728