uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
c796449e-4971-4ef2-b680-fd9f079b6ea3
lohith171/Coding-Practice-Problems
Graphs/Detect cycle in a undirected graph.cpp
//https://www.interviewbit.com/old/problems/cycle-in-undirected-graph/ bool issolve(int val,int parent,vector<int> adj[],vector<bool>& visi){ visi[val]=1; for(auto x:adj[val]){ if(!visi[x]){ if(issolve(x,val,adj,visi))return 1; }else{ if(x!=parent)return 1; } ...
ALGO
0.999944
5.405594
8fff3cbb-3d2d-4b97-84a2-78ca963e3f6e
rickyqin005/DMOJ-Solutions
main/olyhwk 7.cpp
#include <bits/stdc++.h> #include <iostream> using namespace std; #define mp make_pair #define pb push_back #define f first #define s second #define MAX_INT 2147483647 #define MAX_LONG 9223372036854775807 #define MAX_DOUBLE 1e18 typedef long long int ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef pai...
ALGO
0.999922
4.112457
dc5a69c8-1629-45f5-8472-993e911d291a
Rashed112/LeetCode-Solutions
solutions/395_longest_substring_with_at_least_k_repeating_characters.cpp
class Solution { public: int longestSubstring(string s, int k) { if(s.size()==0 || k>s.size()){ return 0; } if(k==0) { return s.size(); } unordered_map<char, int>m; for(int i=0;i<s.size();i++){ m[s[i]]++; } int idx ...
ALGO
0.999959
6.300195
7f1146be-00c5-435d-a43c-f2072ea401ac
manikanta2901/ubuntu
.history/codingChallenges/cpp/Codechef/longChallenges/Year2021/May/ModularEquation_20210510122416.cpp
#include<bits/stdc++.h> #include<iostream> using namespace std; int Modulo(int m,int a ,int b){ return (m % a) %b; } int main(){ int t; cin >> t; while(t--){ int n,m; cin >> n >> m; set< pair<int,int> > freq; for(int i = 1; i <= n; i++){ for(int j = i + 1; j...
ALGO
0.999886
4.492622
e4c332fb-1500-450b-aac5-e3a8293eacba
Illus1onist/2-sem
lesson2.7/Source.cpp
#include <iostream> #include <cstdio> using namespace std; void binary(long long int a) { int b = a % 2; if (a / 2 != 0) binary(a / 2); cout << b; } int main() { long int a; cin >> a; binary(a); return 0; }
ALGO
0.999954
3.773197
367412e6-6015-4925-9999-39a0973790b6
rahulnagurtha/Mycode
amritapur/3.cpp
#include <bits/stdc++.h> using namespace std; #define si(i) scanf("%d",&i) #define si2(i,j) scanf("%d %d",&i,&j) #define si3(i,j,k) scanf("%d %d %d",&i,&j,&k) #define slli(i) scanf("%I64d",&i) #define slli2(i,j) scanf("%I64d %I64d",&i,&j) #def...
ALGO
0.999448
3.57447
605ed08a-5dc4-470b-82b1-9ab745385736
steineggerlab/petasearch
lib/mmseqs/src/prefiltering/ExtendedSubstitutionMatrix.cpp
#include "ExtendedSubstitutionMatrix.h" #include "Indexer.h" #include "Util.h" #include "simd.h" #include <iterator> #include <cmath> #include <cstdlib> #ifdef OPENMP #include <omp.h> #endif struct sort_by_score { bool operator()(const std::pair<short,unsigned int> &left, const std::pair<short,unsigned int> &rig...
ALGO
0.998654
5.942199
26537286-1b74-40eb-8346-08beacfcc710
avinashdhakne/LeetCode
Binary matrix having maximum number of 1s - GFG/binary-matrix-having-maximum-number-of-1s.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: vector<int> findMaxRow(vector<vector<int>> mat, int N) { vector<int> result(2); for(int i=0; i<N; i++){ int ...
ALGO
0.999937
6.069932
4d5300d4-f22e-403d-be6d-52ca5744ba8f
Pantynopants/algorithm
future_net/HUAWEI_dfs_Dijk/Common.cpp
#include "Common.h" //ȡļ---num void readFile(vector<Line>& lines,int& num){ fstream topo("topo.csv"); if(!topo){ cout<<"topo.csv򿪴"<<endl; return; } string buffer; //int linkedId,destinationId,cost,sourceId; while(getline(topo,buffer)){ //cout<<buffer<<endl; vector<string> splitResult; split...
ALGO
0.995875
3.149966
a7bc6daf-8b52-4048-b518-3b6989d49b03
suxutao/LeetcodeList
cn/1835-find-xor-sum-of-all-pairs-bitwise-and .cpp
#include "../../../stdc.h" using namespace std; //leetcode submit region begin(Prohibit modification and deletion) class Solution { public: int getXORSum(vector<int>& arr1, vector<int>& arr2) { int a= accumulate(arr1.begin(),arr1.end(),0,bit_xor<>()); int b= accumulate(arr2.begin(),arr2.end(),0,bit...
ALGO
0.999918
5.514756
3447731e-56b0-40a7-bfaf-9a28839e7aa9
ibrahimdweikat2/sorting-algorithm
QuickSort/QuickSort/QuickSort.cpp
#include <iostream> using namespace std; int partition(int arr[], int low, int high) { int pivot = arr[high]; int i = (low - 1); for (int j = low;j < high;j++) { if (arr[j] < pivot) { i++; swap(arr[i], arr[j]); } } //Swap pivot swap(arr[i + 1], arr[high]); return (i + 1); } void QuickSort(int arr[], ...
ALGO
0.999953
5.199113
13b3d67e-998d-46a2-b90e-31fdde6c6227
KapoorAkash/javaa
exp8.cpp
#include<iostream> using namespace std; void insertionsort(int a[],int n) { int i,j,k,temp,m; for(i=0;i<n;i++) { m=a[i]; j=i; while(a[j-1]>m && j>0) { a[j]=a[j-1]; j--; } a[j]=m; } } int main() { int i,a[20],n; cout<<"Enter...
ALGO
0.999943
3.725759
b52f8c3b-c375-4628-a8dd-1ae0251da9b8
yujiaoki/competitive-programming
精進/2020:04/abc117a.cpp
#include <bits/stdc++.h> #define rep(i,n) for(int i=0;i<n;i++) #define FOR(i,start,end) for(int i=start;i<=end;i++) const int INF = 1001001001; typedef long long ll; const ll MOD=1000000007; using namespace std; template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template<class ...
ALGO
0.991038
4.002468
f5cbf663-51ec-4ad0-8e70-4ae81b9d44bd
johannesgerer/jburkardt-cpp
triangle_monte_carlo/triangle_monte_carlo.cpp
# include <cstdlib> # include <iostream> # include <iomanip> # include <cmath> # include <ctime> # include <cstring> using namespace std; # include "triangle_monte_carlo.hpp" //****************************************************************************80 double *monomial_value ( int m, int n, int e[], double x[] )...
ALGO
0.998455
4.339152
00665e99-60a5-4461-a87a-983d59635ddf
Amirrezasoleimani/datastructure1
circularlist.cpp
#include <iostream> using namespace std; struct Node { int data; Node* next; Node(int data) { this->data = data; next = nullptr; } }; class CircularLinkedList { public: Node* head; CircularLinkedList() { head = nullptr; } void Display() { i...
ALGO
0.999736
5.424531
05b5d892-0e41-4c6b-b818-031c05e15978
BlauHimmel/Hikari
ext/eigen/doc/examples/Tutorial_ArrayClass_interop_matrix.cpp
#include <Eigen/Dense> #include <iostream> using namespace Eigen; using namespace std; int main() { MatrixXf m(2,2); MatrixXf n(2,2); MatrixXf result(2,2); m << 1,2, 3,4; n << 5,6, 7,8; result = m * n; cout << "-- Matrix m*n: --" << endl << result << endl << endl; result = m.array() * ...
ALGO
0.998453
4.306757
337217f2-3bd0-40c1-959c-01df3631819c
raihanuldev/Problem-Solving
codeChef/Chef_and_Dolls.cpp
/** * Bismillahhir Rahmanir Rahim * author: Raihanul Islam Sharif * Problem : Chef_and_Dolls.cpp DSA ARRAy * platform: * Date: 16 - 05 - 2025 */ #include <bits/stdc++.h> using namespace std; void solve() { int n; cin >> n; int x, result = 0; for (int i = 0; i < n; i++) { cin >> x; ...
ALGO
0.999981
5.315569
a90bc732-a2e2-4e16-8af3-a59da41d8930
Fatemehsharifk/dsa
Fasl_3/7.cpp
#include <iostream> using namespace std; bool isTranspose(int a[][50], int b[][50], int n) { // بررسی ابعاد و مقادیر for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { // بررسی اینکه آیا عنصر i,j در a برابر با عنصر j,i در b است if (a[i][j] != b[j][i]) { ...
ALGO
0.999755
6.022589
6a2d7a67-e67c-403f-8370-0ae718925ad3
xlfsummer/codewar-solutions
c++/other/Count of positives sum of negatives.cpp
#include <vector> std::vector<int> countPositivesSumNegatives(std::vector<int> input) { if(input.empty()) return {}; int countP = 0; int sumN = 0; for(int i: input) i > 0 ? countP++ : (sumN += i); return {countP , sumN}; }
ALGO
0.998414
5.260078
e6740482-e8ab-4cc7-90b9-b207b5151342
Nancyisrael/192210285-DSA0193-c-programming
P38.SUM IN ARRAY.cpp
#include <iostream> using namespace std; int main() { int n; cout << "Enter the number of elements in the array: "; cin >> n; int arr[n]; cout << "Enter " << n << " elements:" << endl; for (int i = 0; i < n; i++) { cin >> arr[i]; } int sum = 0; // Initialize sum to 0 // ...
ALGO
0.989694
4.661597
4da56f10-0e7c-477f-9743-711066f24769
UniqueUpToPermutation/ImageMerge
CImageMerge/main.cpp
#include <iostream> #include <fstream> #include <vector> #include <assert.h> #include <string> #include <algorithm> #include "lodepng.h" #include "CutGrid.h" #define DEFAULT_IMAGE_SOURCE_1 "goat2.png" #define DEFAULT_IMAGE_SOURCE_2 "cat.png" #define DEFAULT_IMAGE_OUTPUT "result.png" #define DEFAULT_STITCH_MARGIN 100 ...
TOOL
0.897827
6.189418
1e3862b6-3843-458c-9fbd-cf61f702166e
jxx-sx/BOJ_Study
solved/segtree/2517.cpp
#include <iostream> #include <vector> using namespace std; vector<int> tree[2000000]; int arr[500001]; int ans[500001]; int n; void tree_init(int s, int e, int i) { if (s == e) { tree[i].emplace_back(s); return; } tree_init(s, (s + e) / 2, i << 1); tree_init((s + e) / 2 + 1, e, i << ...
ALGO
0.999993
4.412393
54e84a9f-6b7d-4893-8e03-fe43af7e57a2
DHHai313/setmap
B0.SetMap/map.cpp
#include <bits/stdc++.h> using namespace std; int main() { // map la 1 cap (key,value) map<int, int> mp; // ham insert() them 1 cap gia tri trong map mp.insert({1, 2}); mp.insert({2, 5}); mp.insert({3, 2}); mp.insert({4, 9}); mp.insert({3, 5}); // key khong duoc trung nhau,neu trung thi ko them duoc ...
TOOL
0.949958
4.102936
caacfbfa-6d00-4b6e-8d3e-cdef1f4de925
alejandrocheca/EjerciciosProgramacion
C++/LetraDNI/LetraDNI/LetraDNI/LetraDNI.cpp
#include <iostream> #include <string> char CalcularLetraDNI(int numero) { std::string letras = "TRWAGMYFPDXBNJZSQVHLCKE"; int indice = numero % 23; return letras[indice]; } int main() { std::cout << "Introduce el numero de DNI (sin la letra): "; std::string numeroDNI; std::cin >> numeroDNI; ...
TOOL
0.95501
5.675239
cf751029-573a-4b05-b9da-8b58092aebfc
FredinVazquez/cpcfi-club
Codeforces/Greedy/A_Stone_Game.cpp
#include<bits/stdc++.h> using namespace std; int main() { int t; cin>>t; while(t--){ int n; cin>>n; vector<int> v(n); int maximo = -1e9; int minimo = 1e9; for(int i=0;i<n;i++){ cin>>v[i]; ...
ALGO
0.999691
4.550407
41e4b999-03a1-4035-bef6-241bcf386aa6
H-Shen/MyCodeCollection
校招Collection/Others/挑7.cpp
#include <bits/stdc++.h> // https://www.nowcoder.com/practice/ba241b85371c409ea01ac0aa1a8d957b using namespace std; const int MAXN = 30000; vector<int> A; int main() { // pre for (int i = 7; i <= MAXN; ++i) { if (i % 7 == 0 || to_string(i).find('7') != string::npos) { A.emplace_back(i);...
ALGO
0.999221
4.061703
13fbcfc6-ea91-4cec-9ee2-e4bd2a726f64
openjdk/amber
src/hotspot/share/opto/vtransform.cpp
#include "opto/castnode.hpp" #include "opto/convertnode.hpp" #include "opto/vectorization.hpp" #include "opto/vectornode.hpp" #include "opto/vtransform.hpp" void VTransformGraph::add_vtnode(VTransformNode* vtnode) { assert(vtnode->_idx == _vtnodes.length(), "position must match idx"); _vtnodes.push(vtnode); } // ...
ALGO
0.857268
7.578381
79d89c4d-81c2-4a1e-ac7b-fee867ed6e2b
Justinshao33/competitive_programming
done/AtCoder/029_Long_Bricks_5.cpp
#pragma GCC optimize("O3,unroll-loops") #pragma GCC target("avx,popcnt,sse4,abm") #include<bits/stdc++.h> using namespace std; #define ZTMYACANESOCUTE ios_base::sync_with_stdio(0), cin.tie(0) #define ll long long #define ull unsigned long long #define pb push_back #define all(a) (a).begin(), (a).end() #define debug(x) ...
ALGO
0.999931
4.341234
b9c91596-a7eb-419f-b278-0aac91ee83c1
ZYLZhuPP/OI
Luogu/P3369.cpp
#include<bits/stdc++.h> using namespace std; struct IO { int c, f; #define gc() getchar() template<class C> inline IO& operator >> (C &x) { x = 0; f = 1; while (!isdigit(c = gc()) && ~c) f |= -!(c ^ 45); while (isdigit(c)) x = (x << 3) + (x << 1) + (c ^ 48), c = gc(); x *= f...
ALGO
0.999942
4.246924
c8f3d55e-422e-4ab1-8bc0-6ee5bf512fdd
joy-mollick/Codeforces-B-C-D-Problem-Solutions
Codeforce 604 B.Beautiful Numbers.cpp
#include<bits/stdc++.h> using namespace std; // All time keep update minimum position we get and maximum position we get typedef long long ll; int main() { ios_base::sync_with_stdio(false); int tc; cin>>tc; int n; while(tc--) { cin>>n; int a[n]; int x; for(in...
ALGO
0.999917
3.854854
0fafa96e-151d-44f9-a1f4-fd984167b51e
ishabhray/Competitive-Programming
codeforces/1706A.cpp
#include <bits/stdc++.h> using namespace std; #define PI 3.141592653589 #define ll long long int #define ld long double #define vi vector<int> #define vl vector<ll> #define ii pair<int,int> #define pb push_back #define mp make_pair #define ff first #define ss second #define pll pair<ll,ll> #define vv vector #define al...
ALGO
0.999764
4.180401
0daf3490-baf3-4c87-b5e6-b92418b9a14d
iiicp/leetcode_practice
0714-Best-Time-To-Buy-And-Sell-Stock-With-Transaction-Fee/main.cpp
/*********************************** * File: main.cpp * * Author: caipeng * * Email: <EMAIL> * * Date: 2020/12/31 ***********************************/ #include <vector> #include <iostream> using namespace std; class Solution { public: /** * T[i][k][0] 第i天后,身上没有股票的总收益 * T[i][k][1] 第i天后,身...
ALGO
0.999952
5.273829
9bfcfd99-f388-4ade-9a92-91440f80d4b6
riadhasanmitul/Competitive-Programming
Solved Problems/G_Square_Square_Everywhere.cpp
#include<bits/stdc++.h> using namespace std; #define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0); #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; template<class T> using iset=tree<T,null_type,less<T>, rb_tree_tag,tree_order_statistics_node_update>...
ALGO
0.99952
4.222865
e37a061d-7f91-485d-a18b-2cae6472ce53
Anastasiawangyx/GAMES202-homework
Assignment2/prt/ext/openexr/OpenEXR/IlmImf/ImfLut.cpp
//----------------------------------------------------------------------------- // // Lookup tables for efficient application // of half --> half functions to pixel data, // and some commonly applied functions. // //----------------------------------------------------------------------------- #include <ImfLut.h> #incl...
TOOL
0.950472
6.544207
a5d9eb92-f865-4c6c-bbb2-8534c5bce0ee
ishandutta2007/codeforces
abdude824/normal/1468/E.cpp
#include<iostream> #include<bits/stdc++.h> #define int long long int using namespace std; int32_t main() { ios_base::sync_with_stdio(false); cin.tie(0); // #ifndef ONLINE_JUDGE // freopen("input.txt", "r", stdin); // freopen("output.txt", "w", stdout); // #endif int t;cin>>t; whil...
ALGO
0.999944
4.351021
d71ed713-cd47-49fe-a166-07b7fb53a022
graysonpike/cpp-primer-exercises
ch3/array_equality.cpp
// Program to check the equality of two arrays #include <iostream> // true if two arrays are equal, false otherwise // (up to but not including length l) bool equal(int *a1, int *a2, int l) { for(int i = 0; i < l; i++) { if(a1[i] != a2[i]) { return false; } } return true; } us...
ALGO
0.999617
5.52197
358bf0cb-21d6-4d14-b888-00dd2ad89766
LalithAdithyanSuresh/CollegeStuff
Sem-2/CS1804T - Data Structures Lab/Lab_5_(22_02_2024)/BrowserHistory.cpp
// Doubly Linked list implementation in c++ for the usage of browser hhistory management #include <stdio.h> #include <stdlib.h> class DLList{ private: struct DNode{ struct DNode *P_Node; int data; struct DNode *N_Node; }; struct DNode *Head; stru...
ALGO
0.985982
4.02133
61a738a7-7f69-460c-b64b-7a7a23e119a1
MLops34/DSA-Preparation
Data-Structures& Algorithm/Sliding Window/Alternating Colors.cpp
class Solution { public: int numberOfAlternatingGroups(vector<int>& colors, int k) { int N=colors.size()+k-1; for(int i=0;i<(k-1);i++){ colors.push_back(colors[i]); } int i=0,j=1,res=0; while(j<N){ if(colors[j]==colo...
ALGO
0.999847
6.177359
893dc8dc-b6e3-4a73-8af1-79d9124e784d
BDFYB/Data_Structure_and_Algorithm
self_test/algorithm.bak/4_shell_sort/method1/main.cpp
#include <iostream> #include <vector> using std::vector; void swap(int& a, int& b) { int tmp = a; a = b; b = tmp; }; void shell_sort(vector<int>& inputs) { int length = inputs.size(); for (int gap = length/2; gap > 0; gap /= 2) { for (int i = gap; i < length; i++) { for (int j...
ALGO
0.999831
5.115247
b1859486-9009-44fd-a001-b836cc1da7eb
jiho7407/PS
Codeforce/Div2/Round 972/E1.cpp
#include <bits/stdc++.h> #define ll long long #define lll __int128 #define ld long double #define rep(i,l,r)for(int i=(l);i<(r);i++) using namespace std; typedef pair<int, int> pii; typedef pair<ll, ll> pll; void fastio(){ cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(false); } int L, N, M; int board...
ALGO
0.999368
4.427103
cbdd05d4-4ee1-4e06-b060-af1da541c855
Rishi483/codeforces
Theatre Square.cpp
#include <bits/stdc++.h> using namespace std; #define int long long #define end1 "\n" int gcd(int a, int b) { return __gcd(a,b); } void solve(){ int m,n,a; cin>>m>>n>>a; int x=m/a; int y=n/a; if(m%a!=0) x++; if(n%a!=0) y++; cout<<x*y<<endl; } int32_t main() { ios_base::sync_with_stdio(0); ci...
ALGO
0.999257
3.967571
0f4edf88-d825-4fe3-a4c2-a2186b0bd012
scnb/Cpp-Primer-Plus-Exercise
5-3/5-3.cpp
// 5-3.cpp : ̨Ӧóڵ㡣 // #include "stdafx.h" #include <iostream> using namespace std; int main() { int sum = 0; int val; cout << "Enter the number:"; cin >> val; while (0 != val) { sum = sum + val; cout << "Ŀǰĺǣ" << sum << endl; cin >> val; } getchar(); return 0; }
ALGO
0.977375
3.151839
4a7cd754-14c0-4a28-974e-76e02752c8b2
onward0101/leetcode
靈神_基礎算法精講/02_sliding_window/209_Minimum Size Subarray Sum/solution1.cpp
/* * @lc app=leetcode id=209 lang=cpp * * [209] Minimum Size Subarray Sum */ // @lc code=start class Solution { public: int minSubArrayLen(int target, vector<int>& nums) { int min_length = nums.size() + 1; int left = 0; int current_sum = 0; for (int right...
ALGO
0.999991
6.802539
297974cd-b61c-4ca0-88f8-bff3808be686
matumoto1234/cp-crawler
AtCoder/arc120/arc120_c/22882995.cpp
// detail: https://atcoder.jp/contests/arc120/submissions/22882995 #include <bits/stdc++.h> #include <atcoder/fenwicktree.hpp> using namespace atcoder; using namespace std; // clang-format off #define range(i, l, r) for ( int i = (int)(l); i < (int)(r); (i) += 1 ) #define rrange(i, l, r) for ( int i = (int)(r)-1; i >=...
ALGO
0.99995
4.487564
9abe8efe-7320-4326-a99b-446e8ab52886
Tithi-Paul/Codeforces
soldier & Bananas.cpp
#include<bits/stdc++.h> using namespace std; int main(){ long long int i, k, n, w,p, h, sum=0; cin >> k >> n >> w; for(i=1; i<=w; i++){ p=k*i; sum=sum+p; h=sum-n; } if(h>0) cout << h << " "; else cout << 0 << " "; return 0; }
ALGO
0.999951
3.167359
c8f80025-6239-4756-b27e-88adc64c9763
113bommy/deepmind_codecontests_refine
cpp_source_filter_file/cpp_train_3237_5.cpp
#include <bits/stdc++.h> using namespace std; const int MAX = 2e3 + 10; const int MOD = 1e9 + 7; struct Point { long long x, y; } p[MAX]; int cmp(const Point& A, const Point& B) { return A.x < B.x; } Point operator-(Point A, Point B) { return (Point){A.x - B.x, A.y - B.y}; } long long operator^(Point A, Point B) { re...
ALGO
0.999974
3.611567
cb0da044-fedb-4aad-a90c-551e34afb322
jaywangpku/Algorithm
ccf-2/函数例题/例1.4.cpp
#include <iostream> using namespace std; void swap(int &a, int &b){ int t = a; a = b; b = t; } int main() { int a, b; cin >> a >> b; swap(a, b); cout << a << " " << b << endl; return 0; }
ALGO
0.99948
4.167172
f53c085d-5add-4563-8a6e-28e67f0da7de
dopiaza/Glitch-Run
GlitchRun/libs/Box2D/Dynamics/Joints/b2LineJoint.cpp
#include <Box2D/Dynamics/Joints/b2LineJoint.h> #include <Box2D/Dynamics/b2Body.h> #include <Box2D/Dynamics/b2TimeStep.h> // Linear constraint (point-to-line) // d = p2 - p1 = x2 + r2 - x1 - r1 // C = dot(perp, d) // Cdot = dot(d, cross(w1, perp)) + dot(perp, v2 + cross(w2, r2) - v1 - cross(w1, r1)) // = -dot(perp...
ALGO
0.998723
5.718181
129fab8b-8f98-4d9e-995c-d83d7a8e0690
hitenSharm/LeetCode
516-longest-palindromic-subsequence/516-longest-palindromic-subsequence.cpp
class Solution { public: vector<vector<int>>dp; int recu(string& s,string& s2,int i,int j) { if(i>=s.size() || j>=s2.size())return 0; if(dp[i][j]!=-1)return dp[i][j]; if(s[i]==s2[j])return dp[i][j]=(1+recu(s,s2,i+1,j+1)); return dp[i][j]=max(recu(...
ALGO
0.999957
6.059488
17b1a76c-577b-4eee-b9d0-b5e5046fbe17
righthand0521/LeetCode
src/1910.cpp
#include <algorithm> #include <iostream> #include <stack> #include <vector> using namespace std; class Solution { private: bool checkMatch(stack<char>& stk, string& part, int partLength) { bool retVal = true; stack<char> temp = stk; for (int partIndex = partLength - 1; partIndex >= 0; ...
ALGO
0.999766
6.828652
e1127ec3-6a28-4b5b-ad81-99157b3f408e
ryanzhang15/RJ_HKOI
M0811.cpp
#pragma gcc optim #include <cstdlib> #include <iostream> #include <cstdio> #include <iomanip> #include <fstream> #include <cmath> #include <cstring> #include <ctime> #include <deque> #include <string> #include <stack> #include <vector> #include <map> #include <queue> #include <list> #include <set> #include <algori...
ALGO
0.999292
4.370483
d48f4f5a-7b30-497a-857f-c4f250650d1c
MasumRaza1/dsa-cpp
Array/kadenalgo.cpp
#include<bits/stdc++.h> using namespace std; int maxSubArray(int arr[], int n) { int maxSum = 0; int curSum = 0; for(int i = 0; i<n; i++) { curSum = curSum + arr[i]; if(curSum>maxSum) { maxSum = curSum; } else if(curSum<0) { curSum = 0; } } return maxSum; } void print(int arr[], int n) {...
ALGO
0.999648
4.915926
c08a0ba3-cd7d-4723-ad5b-3ecd942e2698
ib13/Coding-Practice
GFG/activity_selection.cpp
#include <bits/stdc++.h> using namespace std; int main() { int t; cin>>t; while(t--) { int n; cin>>n; vector<int> start(n); vector<int> end(n); for(int i=0;i<n;i++) cin>>start[i]; for(int i=0;i<n;i++) cin>>end[i]; vector<pa...
ALGO
0.99978
3.97425
ae207fbb-cc97-47c2-8e12-d01229a007ac
computervisionlearner/unimrcp_with_huaweicloud_asr
plugins/huawei-recog/huaweicloud_asr/third_party/boost-src/libs/msm/example/mpl_graph/depth_first_search.cpp
#include <boost/msm/mpl_graph/depth_first_search.hpp> #include <boost/msm/mpl_graph/adjacency_list_graph.hpp> #include <boost/msm/mpl_graph/incidence_list_graph.hpp> #include <iostream> namespace mpl_graph = boost::msm::mpl_graph; namespace mpl = boost::mpl; // vertices struct A{}; struct B{}; struct C{}; struct D{}...
ALGO
0.994479
6.199827
8e86b909-c852-45b0-97b8-f64955a6253d
VISiiitl25/leetcode
2059-unique-length-3-palindromic-subsequences/unique-length-3-palindromic-subsequences.cpp
class Solution { public: int countPalindromicSubsequence(string s) { int count=0; for(int i=0;i<26;i++){ char c='a'+i; int l=s.find(c); int r=s.rfind(c); if(l!=-1&&r!=-1&& l<r){ count+=(set<char>(s.begin()+l+1,s.begin()+r).size()); ...
ALGO
0.999348
6.135649
f4cd2e3c-846c-4c19-a924-25f966b5490b
miiitomi/atcoder
mayocon/20240606/7.cpp
// https://atcoder.jp/contests/abc205/tasks/abc205_e #include <bits/stdc++.h> #include <atcoder/modint> using namespace std; using namespace atcoder; using mint = modint1000000007; vector<mint> F(1e+7, 1); mint C(int n, int r) {return F[n]/(F[n-r]*F[r]);} void solve() { int N, M, K; cin >> N >> M >> K; i...
ALGO
0.999977
4.939233
2124ce8a-29d6-4ed7-b25e-d4a401bb9889
antep2727/CSGO-Source-Fixed-Search
game/shared/activitylist.cpp
#include "filesystem.h" #include <keyvalues.h> #include "utldict.h" // memdbgon must be the last include file in a .cpp file!!! #include "tier0/memdbgon.h" extern IFileSystem *filesystem; // NOTE: If CStringRegistry allowed storing arbitrary data, we could just use that. // in this case we have the "isPrivate" membe...
CONFIG
0.852586
6.002857
dce615f9-033a-42fb-94f9-4910c01a77b4
aanda-stcloudstate-edu/WebSpace
cs201/Gaddis/8e/SourceCode/Chapter 03/Pr3-15.cpp
// This program demonstrates how setprecision rounds a // floating point value. #include <iostream> #include <iomanip> using namespace std; int main() { double quotient, number1 = 132.364, number2 = 26.91; quotient = number1 / number2; cout << quotient << endl; cout << setprecision(5) << quotient << endl;...
ALGO
0.988887
4.75997
9ce2f61f-93b6-4e0c-a78b-377681da062f
Neeraj-Koshyari/DSA
Two Pointer/B. Total Length.cpp
// Problem Link: https://codeforces.com/edu/course/2/lesson/9/3/practice/contest/307094/problem/B // Solution Link: https://www.youtube.com/watch?v=zGNYIljFR5A // Read the statement for why at line 34 we added sum of all length in segment again // Because according to the question add the length of all element which i...
ALGO
0.999811
4.342403
bff17e96-573d-475c-8526-6392e2b57a9b
Jesusrac31/Codeforces
CF R 880 (Div. 2) 18-jun-23/A. Destroyer.cpp
#include <bits/stdc++.h> #include <iostream> #include <stdlib.h> using namespace std; typedef vector<int> vi; typedef vector<long long int> vll; typedef long long int lli; typedef pair<int, int> pii; typedef map<string, int> msi; typedef map<int, vector<int>> miv; // Funciones vector #define PB(a) push_back(a); bool...
ALGO
0.999963
4.614304
e32b54c0-f29b-4a13-a334-dabee9af92da
Sadid-USN/rick_and_morty_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.998693
6.797273
704f2e07-8961-43d0-b771-f183a8d6e11f
Gavnishkumar/DSA-practice
POD/1043. Partition Array f.cpp
Given an integer array arr, partition the array into (contiguous) subarrays of length at most k. After partitioning, each subarray has their values changed to become the maximum value of that subarray. Return the largest sum of the given array after partitioning. Test cases are generated so that the answer fits in a 3...
ALGO
0.999957
6.126534
e95cc7ae-b402-4107-8bc5-9831d0c84202
TinkerTechLLC/CubicBezier
CubicBezier.cpp
# include "CubicBezier.h" /* This library provides the ability to compute cubic bezier curves */ /********** OrderedPair class functions **********/ #pragma region OrderedPair Class Functions OrderedPair::OrderedPair(){} OrderedPair::OrderedPair(float p_x, float p_y){ val(0, p_x); val(1, p_y); } float Orde...
ALGO
0.938861
5.836271
cbd8e885-33a1-4aae-8d15-bc2929f7496a
Ishas-Dikshit/Competitive-coding
GeeksforGeeks/28 - Insert in middle of linked list.cpp
/*Please note that it's Function problem i.e. you need to write your solution in the form of Function(s) only. Driver Code to call/invoke your function is mentioned above.*/ /* Structure of the Node of the linked list is as struct Node { int data; Node* next; }; */ // function should insert node at the middle // of...
ALGO
0.999977
4.781765
164b1152-8367-4374-b57e-6ceda9de5200
piyush168713/DSA-CPP
15-Trees/16-K-sum-paths.cpp
/* Problem statement K Sum Paths - GFG Given a binary tree and an integer K. Find the number of paths in the tree which have their sum equal to K. A path may start from any node and end at any node in the downward direction. Example 1: Input: Tree = 1 / \ ...
ALGO
0.999985
5.710456
8a6f0f0a-8c45-49e7-aeb2-d2831e050b7a
augnesrose/Xylophone-app
windows/runner/utils.cpp
#include "utils.h" #include <flutter_windows.h> #include <io.h> #include <stdio.h> #include <windows.h> #include <iostream> void CreateAndAttachConsole() { if (::AllocConsole()) { FILE *unused; if (freopen_s(&unused, "CONOUT$", "w", stdout)) { _dup2(_fileno(stdout), 1); } if (freopen_s(&unuse...
TOOL
0.9988
6.76073
438c4f16-c94c-44f5-a547-01ce2e80d84b
zulfiansyah404/Persiapan-OSN-P-SMAU-CT-Foundation-2022
runtuh.cpp
#include<bits/stdc++.h> using namespace std; int main() { int R,C; cin >> R >> C; string arr[R]; for (int i = 0; i < R; i++) { cin >> arr[i]; } while(true) { int runtuh = 0, barisRuntuh = -1; bool apakahAdaYangDiruntuhkan = false; for (int i = R-1; i >= 0; ...
ALGO
0.999977
4.086864
0af8bb4b-4282-4375-b1ce-deaccccb618e
colin-arnet/DSL-crypto-bench-tls
Vitis_Libraries/graph/L2/tests/louvain_fast/host/utilityFunctions.cpp
#include "defs.h" #include "RngStream.h" using namespace std; void generateRandomNumbers(double *RandVec, long size) { int nT; #pragma omp parallel { nT = omp_get_num_threads(); } #ifdef PRINT_DETAILED_STATS_ printf("Within generateRandomNumbers() -- Number of threads: %d\n", nT); #endif //Initialize paral...
TOOL
0.942979
3.054136
a35cbaa2-1858-4cbb-a807-62d2e54cfee4
ishandutta2007/codeforces
rniya/normal/1375/C.cpp
#include <bits/stdc++.h> using namespace std; #define LOCAL #pragma region Macros typedef long long ll; #define ALL(x) (x).begin(),(x).end() const long long MOD=1e9+7; // const long long MOD=998244353; const int INF=1e9; const long long IINF=1e18; const int dx[4]={1,0,-1,0},dy[4]={0,1,0,-1}; const char dir[4]={'D','R',...
ALGO
0.999718
4.754796
a9557924-f7d9-46f3-8006-b344d83e9037
xuzx1210/LeetCode
36. Valid Sudoku.cpp
class Solution { private: bool contradiction(vector<vector<char>> &board, const int x, const int y, vector<bool> &exist) { const char cur = board[x][y]; if (cur == '.') return false; const int index = cur - '1'; if (exist[index]) return true; exist...
ALGO
0.999472
6.477186
2de2b386-952f-4ca9-8600-0d3b042c6830
GiulianoTo/arduino-speed-motor-control
MotorSpeedControlProject/utils.cpp
/* * Utility functions implementation for DC Motor Speed Control Project */ #include "utils.h" #include "globals.h" #include "pid.h" // Function to adjust selected parameter value void adjustSelectedValue(bool increase) { switch(selectedItem) { case ITEM_CURRENT_FS: if (increase) { ...
TOOL
0.997769
6.679985
375e54cd-bad7-4634-9e8d-8f6334e69304
emon-swe-sust/Data-Structure-Rafi-Sir-
STL/stack_implement.cpp
#include<bits/stdc++.h> using namespace std; struct Stack{ int top; int data[1000]; }; void push(Stack *st,int num) { if(st->top<1000) { st->data[st->top]=num; st->top++; } } int pop(Stack *st) { if(st->top!=0) { st->top--; return st->data[st->top]; } } int ma...
ALGO
0.988919
3.661446
6ef4191a-884a-4250-8302-17597f4db8a7
microsoft/openjdk-jdk24u
src/hotspot/share/opto/reg_split.cpp
#include "precompiled.hpp" #include "libadt/vectset.hpp" #include "memory/allocation.inline.hpp" #include "memory/resourceArea.inline.hpp" #include "opto/addnode.hpp" #include "opto/c2compiler.hpp" #include "opto/callnode.hpp" #include "opto/cfgnode.hpp" #include "opto/chaitin.hpp" #include "opto/loopnode.hpp" #include...
ALGO
0.993613
7.280215
786d2072-5de7-4b7b-bf6c-0094e0c51356
paraspipre/dp-solution
dp/count_subset_with_sum_k.cpp
int fun(int n, int sum, int arr[]) { if (sum == 0) return 1; if (n == 0) { if (sum == arr[0]) return 1; else return 0; } int t = 0; if (sum >= arr[n]) t = fun(n - 1, sum - arr[n], arr); int nt = fun(n - 1, sum, arr); return t + nt; } int perfectSum(int a...
ALGO
0.999989
4.920119
6b1b7ace-ccd8-4953-b8b7-935fcbfba085
vishnu-1817/codeforces
div2_156/c.cpp
#include <bits/stdc++.h> using namespace std; int main(){ int t; cin>> t; for (int z=0; z<t; z++){ string s; cin >> s; int n; cin >> n; int k=1, i=0, m= -1 ; unordered_map <int,int> mpp; int j= s.size(); while (k!=n){ if (i==j...
ALGO
0.9999
3.62221
d989ce9f-576e-46ac-a981-b3a8a1820a8d
CaoCoder/cpp
二叉树实验/二叉树实验/BiTree.cpp
#define _CRT_SECURE_NO_WARNINGS 1 #include <iostream> #include <fstream> #include <cstring> #include <queue> using namespace std; // 㶨 typedef struct BiNode { BiNode() {}; char data; // BiNode* lChild; // ָ BiNode* rChild; // ָ BiNode(int d) { data = d; lChild = NULL; ...
ALGO
0.998676
3.850226
fa0fb5b4-0885-4f9e-92b6-49d38392cd2f
SolangeRibeiro/Algoritmos_2
recursividade_potencia.cpp
#include<iostream> using namespace std; int potencia(int num, int p) { if (p == 0) { return 1; } else { return num * potencia(num, p-1); } } int main () { int a, n, resp; cin >> a >> n; resp = potencia(a, n); cout << resp; return 0; }
ALGO
0.999987
4.43345
523b4759-5e24-4f3d-86c7-bd79b62ba499
SamudraUduwaka/Todo-App
windows/runner/utils.cpp
#include "utils.h" #include <flutter_windows.h> #include <io.h> #include <stdio.h> #include <windows.h> #include <iostream> void CreateAndAttachConsole() { if (::AllocConsole()) { FILE *unused; if (freopen_s(&unused, "CONOUT$", "w", stdout)) { _dup2(_fileno(stdout), 1); } if (freopen_s(&unuse...
TOOL
0.9988
6.76073
ff4b73bc-7436-4560-a35a-877ab8c30e6a
Rishi19Pandey/Sorting_and_Tries
Sorting Algo/mergeSortAlgo.cpp
#include<iostream> #include<bits/stdc++.h> using namespace std; void merge(vector<int>& vec , int low , int mid , int high){ vector<int> ans; int i = low , j = mid+1; while(i <= mid && j <= high){ if(vec[i] <= vec[j]){ ans.push_back(vec[i]); i++; } else if(v...
ALGO
0.999962
4.561121
ef43028e-b0e2-4c23-ae78-7c484ea0b48d
JH-LEE-Dev/Problem-Solving
BOJ/Union_find/14868.cpp
#include <iostream> #include <vector> #include <queue> #include <stack> #include <unordered_set> #include <unordered_map> #include <set> #include <map> #include <algorithm> #include <limits> #include <tuple> #include <string> #include <cmath> #include <bitset> #include <iomanip> using namespace std; #define endl '\n'...
ALGO
0.999858
4.017291
7b38f4ef-af5e-4465-b69b-98a3b76cd2d5
ishandutta2007/codeforces
aropan/normal/1336/A.cpp
#include <iostream> #include <cstdio> #include <cassert> #include <ctime> #include <cmath> #include <cstring> #include <string> #include <algorithm> #include <vector> #include <queue> #include <stack> #include <map> #include <set> using namespace std; #define all(x) (x).begin(), (x).end() #ifdef LOCAL #define dbg(x)...
ALGO
0.99997
4.101839
8f1b90d9-2c53-4a8a-a986-6f6505c7309a
raincross7/code-similarity
codes/train_code/problem186/problem186_140.cpp
#pragma GCC optimize("Ofast") #include "bits/stdc++.h" using namespace std; using ll = long long; using ull = unsigned long long; #define PI 3.141592 #define MOD7 1000000007 #define LL_INF 9000000000000000000 #define LL_MINF -9000000000000000000 #define INT_INF 2000000000 #define INT_MINF -2000000000 #define all(a) (a)...
ALGO
0.999718
4.070518
5e9afb58-7c7d-47dc-a426-11e442429184
xtrahue/Striver-DSA-Sheet
Binary_Tree/Inorder Traversal.cpp
#include <bits/stdc++.h> /* Following is Binary Tree Node structure: class TreeNode { public: int data; TreeNode *left, *right; TreeNode() : data(0), left(NULL), right(NULL) {} TreeNode(int x) : data(x), left(NULL), right(NULL) {} TreeNode(int x, TreeNode *left, ...
ALGO
0.999996
6.495213
caf4969d-d8ec-4cda-af92-07def721e85a
kifah-s/Problem_Solving
Programming_Advices_Academy/Cou_04_Alg_and_Pro_Sol_Lev_1_Sol/Problem_19_Circle_Area_2/Solution_Problem_19_Circle_Area_2_V1.cpp
#include <iostream> #include <cmath> using namespace std; //* Structs struct stDimensionsCircle { const float PI = 3.14; float d = 0; float area = 0; }; //* End Structs //* Functions void welcomeMessageFun() { cout << "\n\nWelcome to the Problem Solving ..\n" << endl; } stDimensionsCircl...
ALGO
0.9907
4.073922
f4e5a477-5cce-425d-9422-4cf4f9e5e106
Bharat-Drago/SEM-4
DSA/G6/Graph/AlienDictionary.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: string findOrder(string dict[], int N, int K) { //code here vector<int> graph[K]; for(int i=1;i<N;i++){ ...
ALGO
0.999935
5.610221
08632913-8f4c-4aa8-97c7-976c7d664b30
sarvex/leetcode-clojurescript
solution/0400-0499/0451.Sort Characters By Frequency/Solution.cpp
class Solution { public: string frequencySort(string s) { unordered_map<char, int> cnt; for (char& c : s) { ++cnt[c]; } vector<char> cs; for (auto& [c, _] : cnt) { cs.push_back(c); } sort(cs.begin(), cs.end(), [&](char& a, char& b) { ...
ALGO
0.999998
6.335366
ce354984-3fb8-4a86-8de8-183b227f07c8
Hozny/programming-solutions
dynamic programming/MatrixChainMultiplication.cpp
/* Classic matrix chain multiplication problem can be judged at: https://onlinejudge.u-aizu.ac.jp/problems/ALDS1_10_B verdict: accepted */ #include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int r, c; vector<pair<int, int>> v; vector<int> dims; for (int i = 0; i <...
ALGO
0.99994
4.143262
814a3675-4436-49dc-a3dd-1a0c213b1371
abdeccan/puzzles
targetdiff.cpp
#include <iostream> using namespace std; int main() { cout << "Count the number of subset with a given difference" << endl; // logic here: lets split the array into two parts, each having sum S1 and S2. // we know that S1 + S2 = S where S is the sum of all elem of array. // problem statement gives a ...
ALGO
0.999646
4.527242
a3610959-8477-430a-bca4-1a5db99d3b3b
oscarlaaaa/fun-algo-stuff
LeetCode/Medium/0814_Binary_Tree_Pruning/Solution.cpp
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), left(left), right(right) {} }; // 2022-09-05 (dfs) class Soluti...
ALGO
0.999921
6.353183
f4a8a315-96f3-4382-82c0-4a5d2e06a14e
goelashwin36/coding-interviews-prep
Graphs/dijkstras.cpp
/* * Author: Ashwin Goel */ // Dijkstra's Algorithm #include <bits/stdc++.h> using namespace std; #define mp make_pair #define INF 99999999 template <typename T> class Graph { int V; map<T, list<pair<int, T>>> l; public: Graph(int v){ V = v; }; void addEdge(T src, T dest, int wt) { l[src].pus...
ALGO
0.999976
4.571748
b4d40a77-d505-4d30-b0d5-1a86ca853efa
manikanta2901/ubuntu
.history/codingChallenges/cpp/Codechef/longChallenges/july/new_20200706002831.cpp
#include<bits/stdc++.h> #include<vector> #include<iostream> #include<cmath> #include<algorithm> #include<iterator> #include<string> #include<map> #include<unordered_map> #define F first #define S second #define MP make_pair #define EXECUTE_FASTER ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); #define ...
ALGO
0.99995
3.308866
ff219d4e-5035-461e-b392-dd974c9f568e
GaisaiYuno/OI-Record-exe-deleted
Grade 10-12/2018 autumn/NOIP/NOIP2018提高组Day2程序包/answers/GD-0250/travel/travel.cpp
#include<cstdio> #include<iostream> #include<cstring> #include<algorithm> using namespace std; int n,m,vi[5085],top,flag=0,flag2=0,cnt=0,f,mp[5085][5085],ans[5088],fa[5089],fro[5087],r[5086]; int a=0,b=0; void addEdge(int x,int y){ mp[x][0]++; mp[x][mp[x][0]]=y; } int getf(int x){ if(fa[x]==x)return x; int k=getf(f...
ALGO
0.999965
3.551384
f6e30b22-f4ce-46ea-9e20-7e5d91691c52
Miguel26-pixel/PAPARICA_CAL_proj
src/Algorithms/Tarjan.cpp
#include "headers/Tarjan.h" using namespace std; Tarjan::Tarjan(const Graph<int>* graph) { this->graph = graph; this->sccs.clear(); this->nrIndex = 1; } unordered_map<int, int> Tarjan::run() { auto vertexSet = graph->getVertexSet(); for (auto it = vertexSet.begin(); it != vertexSet.end(); it++) {...
ALGO
0.998894
5.551252
b85a857b-9ab6-44b0-a8dd-257b4bc94573
Devil-DL/Local-C-Code
源代码/我的结构/最小堆.cpp
#include <iostream> #define DEFAULTSIZE_MINHEAP 2 using namespace std; template <class T> class MinHeap { private: T *arr; int maxSize; int last; void _shiftDown (int start,int ende); void _shiftUp (int current); void _reSize (); public: T &Front(){return arr[0];} void Put(T x); T R...
ALGO
0.999721
4.169808
42721ede-34f3-4fbd-bece-99820fe06267
mvancompernolle/ai_project
data/vmac.cpp
// vmac.cpp - written and placed in the public domain by Wei Dai // based on Ted Krovetz's public domain vmac.c and draft-krovetz-vmac-01.txt #include "pch.h" #include "vmac.h" #include "argnames.h" #include "cpu.h" NAMESPACE_BEGIN(CryptoPP) #if defined(_MSC_VER) && !CRYPTOPP_BOOL_SLOW_WORD64 #include <intrin.h> #en...
ALGO
0.945638
6.08424
3d837207-eb46-4132-9001-9b4fe7d406f7
vivianjeng/tachyon
vendors/circom/circomlib/generated/common/calcwit.cpp
#include <iomanip> #include <sstream> #include <assert.h> #include <iostream> #include <fstream> #include <sstream> #include <iomanip> #include <sys/stat.h> #include <sys/mman.h> #include <fcntl.h> #include <unistd.h> #include <vector> #include <chrono> #include "calcwit.hpp" #include "nlohmann/json.hpp" using json = ...
TOOL
0.939594
4.37221
6e648611-5345-47bd-b60d-9a1f59f6650c
alifalhasan/CP-code-vault
Codeforces/Codeforces Round/Codeforces Round 572 (Div. 2)/A - Keanu Reeves/56591356.cpp
#include<bits/stdc++.h> using namespace std; #define S scanf #define P printf #define G getline #define SZ size() #define C clear() #define B begin() #define F front() #define T top() #define E end() #define EM empty() #define V vector #define Q queue #define DQ deque #define PQ priority_queue #define ST stack #define ...
ALGO
0.999948
3.027864
5216e680-53f5-414c-a3be-d14e865f63b7
MardoCordova/portafolio-amp0-ciclo02-2021
practicas/Tic Tac/equis_cero.cpp
//JOSE MARDOQUEO CORDOVA MENA CM100417 #include <iostream> #include <string> #include <cstdlib> #include <ctime> #include <cctype> using namespace std; const int LADO = 3; void imprimirTablero (char tablero[][LADO]){ // Guia: ............... ............... cout << "\n 0 1 2\n -----------" << endl; f...
ALGO
0.995015
3.973131
d998b7dd-185e-49f5-a97f-55b9090372aa
ivanpostolski/sed2017
src/persona42.cpp
#include <random> #include <string> #include "message.h" #include "parsimu.h" #include "real.h" #include "tuple_value.h" #include "intmsg.h" #include "persona42.h" #define debug true using namespace std; Persona42::Persona42(const string &name) : Atomic(name), name(name), infect(addInputPort("infect")), in0(addI...
ALGO
0.885825
4.830017
765ed336-7945-465f-b898-8913aad05c8c
amnydv17/POTD_LeetCode_GFG
GFG_POTD/Hashmap/Sorting Elements of an Array by Frequency_28_08_24.cpp
class Solution { public: static bool condition(pair<int,int>&p1,pair<int,int>&p2){ return (p1.second==p2.second)?p1.first<p2.first :p1.second>p2.second; } vector<int> sortByFreq(vector<int>& arr) { // Aman Yadav map<int,int>mp; for(int i=0;i<arr.size();i++) mp[arr[i]]++; ...
ALGO
0.999996
5.446897