uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
c4991ea1-e9fc-4d1d-b2c9-0b360bfe83ec
suryakant945/Range-TWINSSE
cnf/aes.cpp
#include <stdint.h> #include <string.h> #include "aes.h" //Replace with AES-CTR int AESENC(uint8_t *ctext,uint8_t *ptext,uint8_t *key){ __m128i key_schedule[20]; aes128_load_key(key,key_schedule); aes128_enc(key_schedule,ptext,ctext); return 0; } //Replace with AES-CTR int AESDEC(uint8_t *ptext,uint8_...
ALGO
0.91684
3.357103
20cbda0e-bada-4ebe-88e6-90f18d1cc025
vihanagarwal18/leetcode
1927-maximum-ascending-subarray-sum/1927-maximum-ascending-subarray-sum.cpp
class Solution { public: int maxAscendingSum(vector<int>& nums) { int n=nums.size(); int previousnumber=-1; int result=0; int sum=0; for(int i=0;i<n;i++){ if(nums[i]>previousnumber) sum+=nums[i]; else sum=nums[i]; previousnumber=nums[i]; ...
ALGO
0.999977
6.059761
761e9e30-029f-480e-933b-ff74b5eeb1fe
ishandutta2007/codeforces
wzyyn/normal/1366/A.cpp
#include<bits/stdc++.h> #define ll long long #define ull unsigned ll #define uint unsigned #define pii pair<int,int> #define pll pair<ll,ll> #define IT iterator #define PB push_back #define fi first #define se second #define For(i,j,k) for (int i=(int)(j);i<=(int)(k);i++) #define Rep(i,j,k) for (int i=(int)(j);i>=(int)...
ALGO
0.999897
4.769019
b89c8bf5-2d3b-4e13-9a44-e17785b03466
KHvic/uva-online-judge
11341-Term Strategy.cpp
#include <bits/stdc++.h> using namespace std; int main() { int t,n,m,v; scanf("%d",&t); while(t--){ scanf("%d %d",&n,&m); vector<int> dp(m+1); for(int i=0;i<n;i++){ vector<int> dpNext(m+1,INT_MIN); for(int j=1;j<=m;j++){ scanf("%d",&v); ...
ALGO
0.999803
3.908624
b995c87c-8ed5-4cf0-b6d6-9d5e124b8cee
brianbarbu/Brian-Barbu-Projects
C++-Assignments/Lab 10 Huffman Coding/InLab/huffmandec.cpp
//Brian Barbu (brb9da) #include <iostream> #include <fstream> #include <sstream> #include <stdlib.h> #include <vector> #include "huffmanNode.h" using namespace std; char move(huffmanNode* node, char bit); void position(huffmanNode* node,string value,char c); // main(): we want to use parameters int main (int argc, c...
ALGO
0.998371
4.167375
2c169d60-7257-49c4-8690-64ddc968ab5e
sunny2329/Codeforces-solutions
Final-450/2-maxmin.cpp
#include <bits/stdc++.h> using namespace std; int maxi(int arr[],int n) { int maxi = arr[0]; for (int i = 1; i < n; i++) { if(arr[i]>maxi) maxi = arr[i]; } return maxi; } int mini(int arr[],int n) { int mini = arr[0]; for (int i = 1; i < n; i++) { if(arr[i]<mini) m...
ALGO
0.993215
3.80791
e07fa284-6520-44d5-acb1-33f5ea9b3962
Siddharthcoding/CodeSprint-2.0
Day10/ques1.cpp
#include<bits/stdc++.h> using namespace std; void solve(int idx, string &digits, string &curr, vector<string>&ans, map<char, string>&mp) { if(idx == digits.size()) { ans.push_back(curr); return; } string temp = mp[digits[idx]]; for(char ch: temp) { curr.push_back(ch); solve(idx + 1, digits, ...
ALGO
0.999823
5.36497
91705f12-bf0b-41de-b7d9-0343beee208f
taniaban2712/dsaRepo
CodeForces problems/differentdivisors.cpp
#include<bits/stdc++.h> #define ll long long int using namespace std; const ll N=1e7; ll prime[N]; void sieveoferatosthenes(){ prime[N]={0}; for(ll i=2;i<=1e7;i++){ if(!prime[i]){ for(ll j=i*i;j<=1e7;j+=i){ prime[j]=1;//finding the prime numbers till the max limit of INT } } } } void solve(){ ll n; c...
ALGO
0.999792
4.53445
9dda4f72-d0e4-4a77-8229-f65d7b749f15
AmniSyazwani/TEB1113_ALGORITHM_AND_DATA_STRUCTURE
LAB 2/hard (1).cpp
//NUR AMNI SYAZWANI BINTI MOHAMAD NASIR // 22011748 #include <iostream> #include <climits> using namespace std; const int SIZE = 5; int findMaxDifference(int matrix[SIZE][SIZE]) { int maxDiff = INT_MIN; for (int a = 0; a < SIZE - 1; ++a) { for (int b = 0; b < SIZE - 1; ++b) { for (int d ...
ALGO
0.99992
4.712275
f4c91af0-42fa-40c1-b1d8-d8ed7d214f74
Anliya-Shaiju/2d-to-3d
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
15d7f338-961e-4363-9188-6ca44ccce593
ashishkushwaha56/LeetCode-Leethub
2385-amount-of-time-for-binary-tree-to-be-infected/2385-amount-of-time-for-binary-tree-to-be-infected.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.999972
5.604644
615ebf19-732c-4915-91ba-90bc0c1c28f5
dipeshsirohia/Cplus_programming
sorting/selection.cpp
# include <bits/stdc++.h> using namespace std; int main() { // let solve it by selection sort vector <int> nums={9,6,8,88,7,12,3,56,90,1,10}; int index=0; for(int i=0;i<nums.size();i++){ int min=nums[i]; for(int j=i+1;j<nums.size();j++){ if(min>nums[j]){ index=j; min=nums[j]; } }...
ALGO
0.999843
3.837326
45a19a91-36d5-4043-96f2-a9fe24adbc32
Choieeh/BOJ
samsung/14888.cpp
#include <iostream> #include <vector> #include <algorithm> using namespace std; long long big=-1000000000; long long small=1000000000; void dfs(long long result, vector<int> a, vector<int> op, int k){ // cout << k << " "<<result << endl; long long new_result; if(k == a.size()){ if(result > big) ...
ALGO
0.999869
3.863716
472207ad-b4d4-4af2-9462-4d1da854740d
VivanVatsa/c-collection
Trees/Binary Search Trees/ll__2__BST.cpp
#include <bits/stdc++.h> #include <stdlib.h> #include <iostream> #include <stdio.h> using namespace std; /* Method 1 (Simple) Following is a simple algorithm where we first find the middle node of the list and make it the root of the tree to be constructed. 1) Get the Middle of the linked list and make it root. 2) Re...
ALGO
0.999998
5.657393
24e52799-6dbf-479d-8f35-e8e5aa95cf9f
danielgehrig18/vacuum-world
VacuumSimulator/src/path_searcher.cpp
#include "vaccuumworld/path_searcher.hpp" using namespace std; void PathSearcher::AddChild(State &node, char action, array<int, 2> location) { State child = State(); child.Initialize(location, action, node.GetPathCost() + 1, GetHeuristic(location)); child.SetParent(&node); frontier_.push(child); v...
ALGO
0.999986
4.961972
4ab70d06-8588-4408-9beb-834e10bf7b96
RahulAwasthi314/problem-solving
leetcode/BinaryTree/validateBST.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.999987
7.007031
bfe31d7a-5a13-4a6d-8998-0a478715f514
preeejith/blooddonation
appblooddonation/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.998513
6.76073
6de074c2-3505-40cc-9d8d-b0b95f33e87e
Siddhesh-Indore/DAA
FindMissingElements.cpp
#include<iostream> using namespace std; class Array { private: int *A; int size; int length; public: Array() { size=11; length=0; A= new int [size]; } Array(int sz) { size=sz; length=0; A=new int [size]; } ~Array() { delete []A; } void Display(); void Append(in...
ALGO
0.998896
3.150089
988f7dfc-4642-4eae-8cd8-c3874b18cc0d
dgcnz/competitive-programming
codeforces/1114B-yet-another-array-partitioning-task.cpp
#ifdef DBG_MACRO_NO_WARNING #include <dbg.h> #else #define dbg(...) ((void)0) #endif #include <bits/stdc++.h> #include <cplib/utils/io> #define all(c) begin(c), end(c) #define isz(c) (int)(c).size() using namespace std; using namespace cplib; using ll = long long; using ii = pair<int, int>; using vi = vector<int>; pa...
ALGO
0.999995
4.316267
4e3a43a3-be95-4628-ab77-5908af25fc88
rafid211/online-judge-solution
LightOj/Conquering Keokradong.cpp
#include <bits/stdc++.h> using namespace std; const int MOD = 1e9+7; const double EPS = 1e-11; const double PI = 2 * acos(0.0); const int INF = 0x7f7f7f7f; typedef long long ll; typedef unsigned long long ull; typedef pair<int,int> pii; typedef pair<ll,ll> pll; typedef vector<int> vi; typedef vector<ll> vl; typedef vec...
ALGO
0.999901
3.20103
cc26b5c1-dce9-4858-9d86-581f7c6d9a24
openjdk/portola
src/hotspot/cpu/x86/macroAssembler_x86_aes.cpp
#include "precompiled.hpp" #include "asm/assembler.hpp" #include "asm/assembler.inline.hpp" #include "runtime/stubRoutines.hpp" #include "macroAssembler_x86.hpp" #ifdef _LP64 void MacroAssembler::roundEnc(XMMRegister key, int rnum) { for (int xmm_reg_no = 0; xmm_reg_no <=rnum; xmm_reg_no++) { vaesenc(as_XMM...
ALGO
0.965147
3.124269
57521115-ea26-4032-8023-98c5ce155672
quynhchi03/laptrinhc
Mang/max min.cpp
#include <stdio.h> #include<math.h> int main() { int n; printf("\n Nhap kich thuoc cua mang: "); scanf("%d", &n); int a[n]; printf("\n Nhap cac phan tu cua mang: "); for (int i = 0; i < n; i++) { printf("a[%d] = ", i); scanf("%d", &a[i]); } int max = a[0]; int min = a[0]; for (int i = 1; i < n; i++) { ...
ALGO
0.99172
3.462254
a12a36f2-71b1-4722-b9f0-268a265542f5
dmujkic1/TP
Assignment 3/2.cpp
// TP 2022/2023: Zada?a 3, Zadatak 2 #include <algorithm> #include <cmath> #include <iostream> #include <map> #include <set> #include <stdexcept> #include <string> #include <tuple> #include <vector> typedef std::map<std::string, std::vector<std::string>> Knjiga; // KreirajIndeksPojmova std::map<std::string, std::set<st...
ALGO
0.992242
5.077833
96e61bc4-5401-446d-a696-f0dff75e306f
Dipti821/DSA_Questions
Prerequisite Tasks - GFG/prerequisite-tasks.cpp
//{ Driver Code Starts #include<bits/stdc++.h> using namespace std; // } Driver Code Ends class Solution { public: bool isPossible(int N,int P, vector<pair<int, int> >& prerequisites) { // Code here vector<int>adj[N]; int cnt=0; vector<int>indegree(N,0); for(auto it: prerequisites){ ...
ALGO
0.999838
6.336705
964d7eda-5faf-4d47-a18e-1981e5e21471
stevenbai0724/DMOJ-Solutions
DMOPC/dmopc19c2p2.cpp
// #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> using namespace __gnu_pbds; using namespace std; #define int long long #define string std::string const int mod = 1e9 + 7; signed main(){ cin.tie(nullptr)->sync_with_stdio(false); int n, m; cin>>n>>m; vector<vector<int>>arr(n+1, ve...
ALGO
0.999974
4.834592
b52bae74-4c97-4631-8790-2d5a19a617d8
OpenXRay/xray-15
cs/engine/utils/xrAI/compiler_merge.cpp
#include "stdafx.h" #include "compiler.h" Marks used; BOOL NodeSimilar(vertex& N1, vertex& N2) { // sector if (N1.Sector!=N2.Sector) return FALSE; // lighting float l_eps = sim_light/256.f; if (!fsimilar(N1.LightLevel,N2.LightLevel,l_eps)) return FALSE; // plane if (N1.Plane.n.dotproduct(N2.Plan...
ALGO
0.999743
4.034696
00c07b65-e6ae-425d-a308-430096bc4622
Nabiz/AoC2023
07/main.cpp
#include <iostream> #include <string> #include <fstream> #include <sstream> #include <vector> #include "hand.h" #include <algorithm> using namespace std; bool compareCameleHands(Hand first, Hand seccond) { if(first.m_type == seccond.m_type) { int i = -1; do { i++; ...
ALGO
0.997811
4.800233
fd6977a5-c96f-4a76-ba0e-d7dfeb6e7cdf
anmarchenko/acm
Timus/T1434.cpp
#include <iostream> #include <sstream> #include <cstdio> #include <cstring> #include <string> #include <vector> #include <cmath> #include <queue> #include <stack> #include <algorithm> #include <numeric> #include <map> #include <set> using namespace std; class rs{ public: int route, stop; rs(): route(0), stop(0){} r...
ALGO
0.99992
3.616842
ca94d874-5cd9-4b70-a5ce-de589db2a975
rishig1030/cpp-problems
dynamicProgramming/fibonacci.cpp
// fibonaci series #include<iostream> #include<vector> using namespace std; // memoisation method // time complexity - O(N) // space complecity - O(N) + O(N) = O(2N) , recursion stack space and array int fibonacci(int i,vector<int>&dp){ if(i==0|| i==1){ return dp[i] = i; } if(dp[i] != -1) retu...
ALGO
0.999993
4.969752
bdde4933-5883-44ad-a0a3-4b3407034dec
sinclairr08/shy-blog
old_contents/boj_codes/C++17/9935.cpp
// https://www.acmicpc.net/problem/9935 // First Written : 20210118 // Last Modified : 20210118 #include <cstdio> #include <cstring> #include <vector> #define MAX_LEN 1000001 #define MAX_BOMB_LEN 37 using namespace std; class Stack{ private: vector<char> list; vector<int> state_list; public: void inser...
ALGO
0.999805
3.942237
662c40b6-3908-4064-886c-7c2459e8cfda
3441161929jAV/softwarw-agricola
softwarw agricola/tesseract-main/src/arch/dotproductsse.cpp
#if !defined(__SSE4_1__) # if defined(__i686__) || defined(__x86_64__) # error Implementation only for SSE 4.1 capable architectures # endif #else # include <emmintrin.h> # include <smmintrin.h> # include <cstdint> # include "dotproduct.h" namespace tesseract { // Computes and returns the dot product of the...
ALGO
0.99412
7.339538
51a5f995-e139-486a-8077-31e9902342f0
tuhin-cse/ProblemSolvingPractice
Messages/main.cpp
#include <bits/stdc++.h> using namespace std; int main() { long long n,A,B,C,T,S=0,ss,x,un=1; cin >> n >> A >> B >> C >>T; ss=n*A; long long a[n]; for(int i=0;i<n;i++) cin >> a[i]; //sort(a,a+n); for(int i=0;i<n;i++) { x=a[i]; if(i>0 && a[i-1]!=a[i]) ...
ALGO
0.99915
3.661874
0cb8d530-cbc3-42af-9a7c-d9ecfdafca44
KshitijGupta07/Leetcode__-problems
2581-divide-players-into-teams-of-equal-skill/divide-players-into-teams-of-equal-skill.cpp
class Solution { public: long long dividePlayers(vector<int>& skill) { sort(skill.begin(),skill.end()); int start=0; int end=skill.size()-1; int sum=skill[start]+skill[end]; long long ans=0; ans+=skill[start]*skill[end]; start=start+1; end=end-1; ...
ALGO
0.999969
4.955151
64ceed93-75c4-4213-937a-5b1c03024324
KRISHANU1920/DSA
DP/38_countLIS.cpp
// Question Link: https://leetcode.com/problems/number-of-longest-increasing-subsequence/ int findNumberOfLIS(vector<int>& a) { int n = a.size(); vector<int> dp(n, 1), cnt(n, 1); int maxi = 1; for(int ind=0; ind<n; ind++) { for(int prev=0; prev<ind; prev++) { if(a[prev...
ALGO
0.999977
6.228768
5d3c3597-6ccd-4d63-9429-a9c70f618e64
daviolimen/Exercises
Questões/telemarketing.cpp
#include <bits/stdc++.h> using namespace std; #define MAXN 1010 int nums[MAXN]; int main() { int N, L, T; scanf("%d%d", &N, &L); priority_queue<pair<int, int>, vector<pair<int, int>>, greater<pair<int, int>>> pq; for (int i = 1; i <= L; i++) { scanf("%d", &T); if (pq.size() == N) { ...
ALGO
0.999789
3.038485
00f10d52-23e4-46d6-aa9c-bb292ae0cecc
PranshuGupta28/DSA-CPP
Sorting/QuickSort.cpp
#include <iostream> using namespace std; int partition(int arr[], int s, int e) { int PivotIndex = s; int PivotElement = arr[s]; int Count = 0; for (int i = s + 1; i <= e; i++) { if (arr[i] <= PivotElement) { Count++; } } // Pivot Element ki right Posit...
ALGO
0.999987
5.337697
06cb019f-b2ca-4cff-9489-c9a177926a5f
layinad/CodeHelp-DSA-Course-
Lecture54/stackimplementationusinglinkedlist.cpp
#include<bits/stdc++.h> using namespace std; class Node{ public: int data; Node* next; //constructor Node(int data) { this->data=data; this->next=NULL; } }; Node* top; //initialising a top node void push(int data) { Node* newNode=new Node(data); if(!newNode)...
ALGO
0.999566
4.197248
e9abac0f-6232-4d9b-80bf-251eb867c459
raincross7/code-similarity
codes/train_code/problem067/problem067_118.cpp
#include <bits/stdc++.h> using namespace std; #define rep(i,n) for(int i = 0; i < (n);i++) #define sz(x) int(x.size()) typedef long long ll; typedef pair<int,int> P; constexpr ll INF = (1LL << 60); int main() { int a, b; cin >> a >> b; if (a % 3 == 0) { cout << "Possible" << endl; return 0; } if (b ...
ALGO
0.999892
4.03637
d1801219-ed9b-417b-9752-e81223a64d6f
ituki0426/dev_atcoder
src/ABC/314/a.cpp
#include <bits/stdc++.h> #include <atcoder/all> using namespace std; using namespace atcoder; using modint = modint1000000007; #define rep(i, n) for (int i = 0; i < (int)(n); i++) using ll = long long; string en = "1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679"; in...
ALGO
0.999849
3.685799
9a505c08-af90-4968-aa89-2a7d4df7b185
atharvkhardekar/LeetCode-Daily-Challenge
Array/SpecialArrayII.cpp
// LeetCode Problem No. 3152 // Daily Challenge - 09/12/2024 class Solution { public: vector<bool> isArraySpecial(vector<int>& nums, vector<vector<int>>& queries) { int n = nums.size(); vector<int> parityChange(n, 0); for (int i = 1; i < n; ++i) { parityChange[i] = (nums[i] % 2...
ALGO
0.999903
6.120646
fc28470e-73c6-4277-b372-bef1fc4cb9d2
reyalo/Project_Synapse
graph_algorith/bfs.cpp
#include <bits/stdc++.h> using namespace std; #define WHITE 1 #define GRAY 2 #define BLACK 3 int color[100], city, bridge; int somporko[100][100], abbaAmma[100], durotto[100]; void bfs(int startingNode) { for (int i = 1; i <= city; i++) { color[i] = WHITE; durotto[i] = INT_MIN; abbaAmma[i] = -1; } ...
ALGO
0.999612
4.29962
290fb709-5b26-4414-ad44-b9a9b1051e3c
arpitjana2103/DSA
206-reverse-linked-list/reverse-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: void insertFront(List...
ALGO
0.999858
5.530305
b3b29ecd-2972-4514-8560-8b6fe1dbdfb8
PandaChahal/Striver-DSA-Sheet
stack&Queue/postfixToInfix.cpp
#include<iostream> #include<stack> using namespace std; void postToInfix(string s) { stack<string> st; for(int i=0;i<s.length();i++) { char c = s[i]; if(c >='a' && c<='z' || c >='A' && c<='Z' || c >='0' && c<='9') { st.push(string(1,c)); } else { ...
ALGO
0.999917
4.836408
20f73121-4159-4fee-8a97-07db351a3e3c
2bsyed/Code
C++/CodeForce/Pathless.cpp
#include<bits/stdc++.h> using namespace std; int main() { int t; cin >> t; while (t--) { int n; int s; cin >> n >> s; vector<int> v(n); for (int i : v) { cin >> v[i]; } }
ALGO
0.99687
3.093372
b040d7f0-252f-4498-bf9d-ddecc820c945
jzielinski47/onearmedbandit-console-game
onearmedbandit-console-game.cpp
#include <iostream> #include <random> int main() { std::cout << "Enter any key to start the game..."; getchar(); int generationIndex = 0; std::random_device rd; std::uniform_int_distribution distr(3,5); do { std::cout << "draw n. " << ++generationIndex << std::endl; const int arrLength = 3; char arr[a...
ALGO
0.991989
4.135996
2636a2a2-36f0-4cbb-8320-e5cb0417a32e
Varlode/Code
CodeCpp/VNOJ/beadsnb.cpp
/* _ ______/ \-. _ _ __ _ _ _ .-/ ( o\_// / l..l \ / >--< \ l ___ \_/\---' \/ ll \/ \l \ l/ l_ll l_ll l_''_l l_ll_l */ #include <bits/stdc++.h> using namespace std; const int N = 1e5+10; int n, a[N], b[N], f[N], g[N]; v...
ALGO
0.999973
4.5801
cb807e34-64fb-4f04-8f7b-0610a12dc198
lucatardella/PLMIX
src/Estep.cpp
#include <Rcpp.h> using namespace Rcpp; //' E-step in the EM algorithm for MAP estimation of a Bayesian mixture of Plackett-Luce models //' //' The function \code{Estep} updates the posterior component membership probabilities in the EM algorithm for MAP estimation of a Bayesian mixture of Plackett-Luce models. //' //'...
ALGO
0.99999
6.242013
fc9fae4a-eaea-4629-b1b4-a1176f937a52
Santanu29/codeforces-solutions
A_Vasya_and_Socks.cpp
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; int days = 0; while (n != 0) { days++; n--; if (days % m == 0) n++; } cout << days; return 0; }
ALGO
0.999934
3.558488
5c94a823-2160-4b72-83d9-68176e54e608
anilpiparaiya/CP-Contests
CodeForces/Codeforces_Round_898_(Div. 4)/1873C - Target Practice.cpp
#include <bits/stdc++.h> using namespace std; const int MAX = 200007; const int MOD = 1000000007; int score[10][10] = { {1,1,1,1,1,1,1,1,1,1}, {1,2,2,2,2,2,2,2,2,1}, {1,2,3,3,3,3,3,3,2,1}, {1,2,3,4,4,4,4,3,2,1}, {1,2,3,4,5,5,4,3,2,1}, {1,2,3,4,5,5,4,3,2,1}, {1,2,3,4,4,4,4,3,2,1}, {1,2,3,3,3,3,3,3,2,1}, {...
ALGO
0.999481
4.488858
36f5203b-f4cc-4985-a5da-ecfc4c9d4c43
azecoder/Problem-Solving
E-olimp/1304. What is the Median .cpp
#include <vector> #include <list> #include <map> #include <set> #include <deque> #include <stack> #include <bitset> #include <algorithm> #include <functional> #include <numeric> #include <utility> #include <sstream> #include <iostream> #include <iomanip> #include <cstdio> #include <math.h> #include <cstdlib> #include <...
ALGO
0.999956
3.337795
6db13d7d-d5fb-4aca-8f44-ec9139317a0a
makometr/piaa_9383
Orlov/lab4/src/lab4_1.cpp
#include <iostream> #include <vector> std::vector<int> prefixFunction(std::string &str) { int n = str.length(); std:: vector<int> prefixArray(n, 0); for(int i = 1; i < str.length(); i++) { int j = prefixArray[i - 1]; while((j > 0) && (str[i] != str[j])) { j = prefi...
ALGO
0.99979
4.883086
142f7fdd-58f6-46c4-a78e-012580114a33
chao0320outlook/12.12
bank/12.11.cpp
#include"stdafx.h" #include "12.10.h" #include <cstdlib> Queue::Queue(int qs ):qsize(qs) //캯ĬֵΪ10qsֵ򸲸 { front = rear = nullptr; items = 0; } Queue::~Queue() // { node *temp; while(front!=nullptr) { temp = front; front = front->next; delete temp; } }...
TOOL
0.896593
3.723199
3ed8b575-cab5-4040-ae75-dd12d7121302
agrawaltanay08/Project-Euler-Solutions-Tanay
Problem_#23_Non-abundant_sums.cpp
#include <cmath> #include <cstdio> #include <vector> #include <iostream> #include <algorithm> using namespace std; const int M = 1e5 +5; vector<int> v(M, -1); int divs(int m){ int sum = 1; int i; for(i=2;i*i<m;i++){ if(m%i == 0){ sum += i; sum += (m/i); } } i...
ALGO
0.999614
4.627621
302b19bf-36b6-4ef9-8a91-ec76ab8120da
aatman-24/CP-3
Practice/Solved/bitmask/Maths CP/5.5 Number Therory/Modulo Arithmetic/UVa 10176 - Ocean Deep! Make It Shallow!.cpp
#include <bits/stdc++.h> #define ll long long #define REP(i,n) for(int i = 0; i < n; i++) #define REP1(i,n) for(int i = 1; i <= n; i++) #define REP2(i,n) for(int i = 2; i <= n; i++) #define debug cout << "Ok" << endl; using namespace std; typedef pair<int,int> ii; typedef vector<ii> vii; typedef map<char,int> mci; ty...
ALGO
0.99988
3.67336
fe8f8623-a99b-4b9b-b18a-ce3d288fed81
Audacium/audacium
lib-src/libnyquist/nyquist/nyqsrc/f0.cpp
// f0 -- frequency estimation #include <stdio.h> // Estimate a local minimum (or maximum) using parabolic // interpolation. The parabola is defined by the points // (x1,y1),(x2,y2), and (x3,y3). float parabolic_interp(float x1, float x2, float x3, float y1, float y2, float y3, float *min) { float a, b, c; float...
ALGO
0.999991
5.102136
76c13223-7dd9-46bd-b984-36f62c5c4e13
siyuan-zou/Data_Analysis_Algorithms
week6/INF442-td6-1-handin/libs/eigen-3.4.0/bench/benchCholesky.cpp
// g++ -DNDEBUG -O3 -I.. benchCholesky.cpp -o benchCholesky && ./benchCholesky // options: // -DBENCH_GSL -lgsl /usr/lib/libcblas.so.3 // -DEIGEN_DONT_VECTORIZE // -msse2 // -DREPEAT=100 // -DTRIES=10 // -DSCALAR=double #include <iostream> #include <Eigen/Core> #include <Eigen/Cholesky> #include <bench/BenchUt...
TEST
0.938883
5.992048
db43f07d-0776-4ffe-9fd1-c5d7789ae41b
sinha-diksha/Leetcode-Contest
Weekly Contest 310/b.cpp
/*Optimal Partition of String Difficulty:Medium Given a string s, partition the string into one or more substrings such that the characters in each substring are unique. That is, no letter appears in a single substring more than once. Return the minimum number of substrings in such a partition. Note that each charac...
ALGO
0.99998
6.513673
74fa4136-5124-4c0b-836e-e0b559f2261a
abhishek2x/-bits-stdc-.h-
stack.cpp
#include <iostream> #include <bits/stdc++.h> using namespace std; int Stack[100]; int top; void push(int x){ top++; Stack[top] = x; } void pop(){ Stack[top] = 0; top--; } bool isEmpty(){ if(top >=1) return false; else return true; } int main(){ top = 0; push(1); push(4); ...
ALGO
0.999208
4.02448
34790e81-184b-4e93-93f3-13c589e19497
Yugg007/-SdeSheetChallenge
Day2/Rotate Matrix.cpp
#include <bits/stdc++.h> using namespace std; void rotateMatrix(vector<vector<int>> &mat, int n, int m) { int row = 0, col = 0, prev, cr; while(row < n && col < m){ if(row + 1 == n || col + 1 == m){break;} prev=mat[row + 1][col]; for (int i = col; i < m; i++){ cr = mat[row][i]; ...
ALGO
0.999926
3.15529
71bf9d08-6e92-42d6-8eb3-596ef1b40f7b
DamianRozpedowski/CSCI-111-Introduction-To-Computing
RozpedowskiDamian_Lab18.1.cpp
#include <iostream> using namespace std; int sumCubes(int x); int main(){ int y; cout << sumCubes(1) << endl; //prints 1 cout << sumCubes(2) << endl ; //prints 9 cout << sumCubes(3) << endl; //prints 36 cout << "Give me a number: "; cin >> y; cout << sumCubes(y) << endl; ...
TOOL
0.92977
4.499643
cc2d5f4a-ce1a-40ec-a234-11b7f8f6d2bb
balayogigmcs/Meals_animation
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
71831f9a-2f3b-4697-9f02-3641433ad6b4
kailasspawar/DS-ALGO-PROGRAMS
Misc/functionalProgramming.cpp
#include<iostream> #include<algorithm> #include<stdlib.h> using namespace std; int main() { int arr[] = {1,2,3,4,5,6,7,8,9}; int n = sizeof(arr)/sizeof(arr[0]); int *b = arr+n; int *a = arr; b = remove_if(a,b,[] (int i) {return (i%2==1);}); for(int *i = a;i!=b;i++) cout<<*i<<" "; cout<<endl; ...
ALGO
0.996385
3.834335
6bdc0503-65e2-4c5d-8af6-2126eb5f42cd
diegocalvo05/tutoriasPOO2024
EJEMPLOS_EJERCICIOS/pooYT/poo4.cpp
//INHERITANCE #include<iostream> using namespace std; //creando clase que será heredada en la clase principal "Employee" class AbstractEmp{ virtual void AskForPromotion() = 0; }; class Employee:AbstractEmp{ //clase base private: //objetos: string Company; int Age; protected:...
TOOL
0.95731
4.433305
e8bdb9ba-7b10-4b09-b4ef-7ce3741f2057
SamKrasnoff/EC_327
Programming Assignments 1 and 2/q3.cpp
#include <iostream> #include <string> using namespace std; int main(){ int num1, num2; string numstring1, numstring2; int maxtern1 = 1; int maxtern2 = 1; int hamming = 0; cout << "Enter two numbers between 0 and 100: " << endl; cin >> num1; cin >> num2; while ( !(num1 >= 0 && num1 <...
ALGO
0.999887
4.959685
a29a5ea3-ec42-442c-8ad6-05c2fdb5901f
thatg33kyguy/CPP-Programs
buildinganaquarium.cpp
#include "bits/stdc++.h" using namespace std; #define sherlockholmes ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); #define int long long const int N=2e5+10, inf=1e9+10; const int mod1=(1e9+7); const int mod2=(998244353); void solve(){ int n,x, ans=0; cin >> n >> x; vector<int> a(n); f...
ALGO
0.999918
5.565442
68a1390f-9bc4-45a9-941d-c4d039f22be6
JoeyyMace/Re-configurable-customer-reward-system
utility.cpp
#include <iostream> #include "utility.h" /* Function Name: trim Purpose: Removes leading and trailing whitespace from a given string. Meaning of Parameters: - const std::string& s: The string to be trimmed. Description of Return Values: - Returns a new string with leading and trailing whitespace removed. - If th...
TOOL
0.940482
7.645939
a0c99c94-3dfe-4244-b2ba-59db64ba9306
vtchitruong/hsg
hsg12-tinh/2024-2025-tuyenquang/tuongdong/tuongdong.cpp
#include <iostream> #include <vector> #include <algorithm> #define input_file "tuongdong.inp" #define output_file "tuongdong.out" using namespace std; int n, X; vector<int> pictures; // Số cách cần tìm int number_of_ways = 0; void input() { ios_base::sync_with_stdio(false); cin.tie(NULL); freopen(inpu...
ALGO
0.999848
4.396505
dc32cd44-feb0-457b-91eb-785513a074f9
Superm4n97/competetive-programming
LightOJ/A.cpp
#include<bits/stdc++.h> #define ll long long int #define maxn 505 using namespace std; ll dp[37][maxn][maxn] , n; ll rec(ll pos, ll current , ll pre) { if (dp[pos][current][pre] != -1)return dp[pos][current][pre]; if (current==0)dp[pos][current][pre] = 1; ll cnt = 0; for (int i=min(pre-1,c...
ALGO
0.999963
3.54784
ed7213ec-a375-4dec-912d-e872028e63d7
raincross7/code-similarity
codes/train_code/problem008/problem008_167.cpp
#include <bits/stdc++.h> #define rep(i,N) for (int i = 0; i < (N); ++i) #define all(v) v.begin(), v.end() using namespace std; using ll = long long; using P = pair<int, int>; int main(void){ //input int N; cin >> N; vector <double> x(N); vector <string> u(N); rep(i,N) cin >> x[i] >> u[i]; double rate = 38...
ALGO
0.99807
4.724259
f8f26154-4140-4646-a2ce-3d0de538cc3c
jhavishesh/Data-Structure-Algorithm-Brahmastra
Tree/Problem-05 K distance from root .cpp
//https://practice.geeksforgeeks.org/problems/k-distance-from-root/1/# //Solution: void helper(struct Node*root,int k,vector<int>&ans) { if(root==NULL) return; if(k==0) ans.push_back(root->data); else { helper(root->left,k-1,ans); helper(roo...
ALGO
0.999979
5.021988
f11f3da3-2b73-4624-9927-02d34b50f39f
glerium/acm-life
codeforces/2125-edu/A.cpp
#include <bits/stdc++.h> #define endl '\n' #define rep(i,x,y) for(int i=x;i<=y;i++) using namespace std; typedef long long ll; constexpr int maxn = 2e5+10; constexpr ll mod = 998244353; constexpr ll inf = 0x3f3f3f3f; template<class T, class... Args> auto Vec(size_t n, Args... args) { if constexpr(sizeof...(args) ==...
ALGO
0.999539
5.293285
b307b9ba-964b-4787-af72-05b732e14ec4
Rahulrao859/LeetCode
3172-divisible-and-non-divisible-sums-difference/3172-divisible-and-non-divisible-sums-difference.cpp
class Solution { public: int differenceOfSums(int n, int m) { int sum1 = 0; int sum2 = 0; for(int i =1;i<=n;i++){ if(i%m != 0){ sum1 = sum1+ i; } else{ sum2 = sum2+i; } } return sum1 - s...
ALGO
0.999984
5.56848
86f25974-5472-49b4-ae99-0afbbe0eb05b
jee-van24/LeetCode
2529-range-product-queries-of-powers/2529-range-product-queries-of-powers.cpp
class Solution { public: vector<int> productQueries(int N, vector<vector<int>>& queries) { const int MOD = 1e9 + 7; vector<int> power; long long val = 1; while (val <= 1e9) { power.push_back(val); val *= 2; } vector<long long>...
ALGO
0.999943
6.012569
3e729351-65bd-4e04-ae46-8af9882e1d9d
hichemaichour/ACM-ICPC
Important Codes/2D.cpp
#include <iostream> #include <fstream> #include <sstream> #include <iomanip> #include <algorithm> #include <vector> #include <deque> #include <list> #include <stack> #include <queue> #include <set> #include <map> #include <bitset> #include <string> #include <iterator> #include <functional> #include <complex> #inclu...
ALGO
0.999826
3.356127
5a21008c-8344-413b-99e4-2b1dee6d8cd0
adonairc/2deg
src/poisson.cpp
#include <iostream> #include <fstream> #include <math.h> #include <complex.h> #include <string> #include <vector> #include <fftw3.h> #define N 200 template<typename T> std::vector<double> linspace(T start_in, T end_in, int num_in) { std::vector<double> linspaced; double start = static_cast<double>(start_in); d...
ALGO
0.998221
3.440325
65d5e75d-7fa4-4fac-8c13-2108971f3504
MahinAshraful/CodeWatch_Data
sample-data/p00007/s239869182.cpp
#include<iostream> using namespace std; int main(){ int n, output = 100000; cin >> n; for (int i = 0; i < n; i++){ output *= 1.05; if (output % 1000 != 0){ output += 1000; output -= output % 1000; } } cout << output << endl; return 0; }
ALGO
0.999785
3.295921
2d8dd7a6-180d-4616-a24c-1282f9b0fa28
seeitsmanish/Cpp_Competitive_Repo
Practise/13_Jul_2021/DenseArray.cpp
//LINK : https://codeforces.com/contest/1490/problem/A #include<bits/stdc++.h> using namespace std; #define ff first #define ss second #define sort(v) sort(v.begin(),v.end()) #define print(v) for(auto n:v) cout<<n<<" " #define rev(v) reverse(v.begin(), v.end()) #define int long long int #define li ...
ALGO
0.999654
4.71805
9ee21ece-8d5d-4f71-9691-25661e7c0e44
Juan-Antonio-FA/omegaUp_c-
Vida.cpp
#include<bits/stdc++.h> using namespace std; auto main()->int{ short int a; cin>>a; if(a>=0 && a<4) cout<<"BEBE"; else if(a<15) cout<<"NIÑO"; else if(a<19) cout<<"JOVEN"; else if(a<66) cout<<"ADULTO"; else cout<<"ADULTO 3RA"; return 0; }
ALGO
0.998303
4.155261
9f6ea343-e8cf-47d5-8d40-e63973f2a512
fcbruce/algorithm-game
code/TC/SRM630_div2/2.cpp
/* * * Author : fcbruce * * Date : * */ #include <cstdio> #include <iostream> #include <sstream> #include <cstdlib> #include <algorithm> #include <ctime> #include <cctype> #include <cmath> #include <string> #include <cstring> #include <stack> #include <queue> #include <list> #include <vector> #include <map> #inc...
ALGO
0.999892
3.380418
37d6afeb-cfb8-4d2d-a4f6-73bd23f249ab
uniquetrij/CarND-T2-P5-MPC
src/Eigen-3.3/unsupported/doc/examples/EulerAngles.cpp
#include <unsupported/Eigen/EulerAngles> #include <iostream> using namespace Eigen; int main() { // A common Euler system by many armies around the world, // where the first one is the azimuth(the angle from the north - // the same angle that is show in compass) // and the second one is elevation(the angl...
ALGO
0.989945
5.125681
f45d3b97-f7fd-4316-b875-c5235ff677c3
CHANDRABINDU-2003/LinkedList-CplusPlus-Queue
LinkedList/Insert.cpp
#include<bits/stdc++.h> using namespace std; class node{ public: int val; node* next; node(int data){ val=data; next=NULL; } }; void insertfir(node* &head,int val){ node* noe= new node(val); noe->next=head; head=noe; } void insertlas(node* &head,int val){ node* noe= new node(val...
ALGO
0.999673
4.163356
bc4dbff0-1396-4473-8593-3e728ac9228c
Goutam-patidar/Data-structures-Coursera_Assaignment
satke_size.cpp
#include <iostream> #include <string.h> using namespace std; struct stakearray { int top; int capacity; int *a; }; int m=0; struct stakearray* createstake(int cap) { struct stakearray *stake; stake=new (struct stakearray); stake->top = -1; stake->capacity = cap; stake->a=new int[stake...
ALGO
0.999441
3.954889
23a0860a-3113-4713-8610-577b46b21a74
wubydacherry/airflow-legacy
Airflow/base/other/checksum_crc.cpp
#include "checksum_crc.h" #include <Windows.h> #include <memory> #define big_short( val ) word_swap( val ) #define big_word( val ) word_swap( val ) #define big_long( val ) dword_swap( val ) #define big_dword( val ) dword_swap( val ) #define little_short( val ) ( val ) #define little_word( val ) ( val )...
ALGO
0.996633
5.584885
1db07f93-4021-4adf-adda-abfafe72d9b5
prestolabs/multi-party-sig-cpp
src/multi-party-sig/multi-party-ecdsa/cmp/minimal_sign_key.cpp
#include <google/protobuf/util/json_util.h> #include "crypto-suites/crypto-bn/rand.h" #include "crypto-suites/crypto-encode/base64.h" #include "crypto-suites/crypto-sss/vsss.h" #include "crypto-suites/crypto-encode/hex.h" #include "multi-party-sig/multi-party-ecdsa/cmp/minimal_sign_key.h" using std::string; using std:...
TOOL
0.874369
7.03267
e1ba0cba-b442-4df4-a777-af23fd5288f1
gaurav-bhadane/DSA-CP
Patten Printing/pattern12.cpp
/* Full Pyramid * * * * * * * * * * */ #include<iostream> using namespace std; int main() { int n; cout<<"Enter the height of pyramid: "; cin>>n; for (int i=0;i<n;i++) { for (int j=0;j<n-i-1;j++) { ...
ALGO
0.999833
4.085945
d9eb375c-8a70-44f1-8ca1-9eb72d7becae
Pedro-Calasans/Conteudo-C-
Aula 02-09/Exer6.cpp
#include <stdio.h> int main() { char ope; int n1,n2,p; printf("Digite o n1\n"); scanf("%d",&n1); printf("Digite o n2\n"); scanf("%d",&n2); printf("Digite a operacao\n "); scanf(" %c",&ope); if (ope=='+'){ p=n1+n2; printf("Soma=%d",p); } if (ope=='-'){ p=n1-n2; printf("Sub=%d",p); } if (op...
ALGO
0.990293
3.254064
272232c5-cbea-40d8-a8a6-cfbf417a6453
yeonggwangchoi/Baekjoon_Algorithm
2476.cpp
#include <iostream> using namespace std; int main() { cin.tie(nullptr); cout.tie(nullptr); ios::sync_with_stdio(false); int n; cin >> n; int maxsum = -1; for (int k = 0; k < n; k++) { int num[3]; int sum = 0; int max = 0; cin >> num[0] >> num[1] >> num[2]; if (num[0] == num[1] && num[1] == num[2]) ...
ALGO
0.998623
4.171155
b317a0b2-f731-44dc-a9da-d396c9db739b
SINGHxTUSHAR/DSA-SINGHxTUSHAR
Practise cpp Codes/STL-Codes/priority_queue_stl.cpp
/*Author: TUSHAR SINGH*/ #include<bits/stdc++.h> using namespace std; //fun to print the element of max heap void printpriorityqueue(priority_queue<int> pq){ while(!pq.empty()) { cout<<pq.top()<<"\n"; pq.pop(); } } //fun to print the min heap void print_min_heap(priority_queue<int, vector...
ALGO
0.998738
4.189329
e182b8fd-703d-4496-9032-b82c92957684
NayanAGupta/CST_370
hw9_3.cpp
/* Title: hw9_3.cpp * Abstract: Checks if an input string * is a palindrome or not. In the problem, * a palindrome means an alphanumeric * string which reads the same front to * back. For the problem, you should ignore * case and remove all non-alphanumeric * characters in the input string characters ...
ALGO
0.999635
5.553042
d95a6798-97e2-40df-bc4e-027ab72aba35
Nikola-38/Practice_1.3
delet.cpp
#include "delete.h" bool ExistColonk(const string& tableName, const string& columnName, Node* Tablehead) { if (!Tablehead) { cerr << "Ошибка: Список таблиц пуст.\n"; return false; } Node* currentTable = Tablehead; // Указатель на текущую таблицу в списке // Проходим по всем таблицам ...
DATA
0.894117
4.522461
ca8f5deb-089c-4dc0-954b-c840735f1559
abhiXsliet/Solved-DSA-Problems
GFG POTD/007-July-2024/003-remove-all-occurences-of-duplicates-in-a-linked-list.cpp
// https://www.geeksforgeeks.org/problems/remove-all-occurences-of-duplicates-in-a-linked-list/1 //{ Driver Code Starts // Initial Template for C++ #include <bits/stdc++.h> using namespace std; /* Link list node */ struct Node { int data; struct Node *next; Node(int x) { data = x; next = ...
ALGO
0.999895
5.885221
046ea2c9-d8d1-4aa3-993e-c6d4f51a5a4f
lee-honey/CodingTest-Study
07주차/피로도/hyunhee.cpp
#include <string> #include <vector> #include <algorithm> #include <iostream> using namespace std; bool visited[8] = {false,}; int answer = 0; void DFS(int k, vector<vector<int>> dungeons, int cnt) { answer = max(answer, cnt); for (int i=0; i<dungeons.size(); i++) { if (!visited[i] && dungeons[i][0] <= k...
ALGO
0.99974
4.658851
c05c8cc9-107f-4425-b2b3-a70ba25d2368
fyrsta7/LLM_on_ASAC
result_api_backup/en_without_annotation_mzn/deepseek-coder_loop10/Abacus_Mental_Arithmetic_Test-9.cpp
#include <iostream> #include <unordered_set> #include <vector> #include <algorithm> int main() { int n; std::cin >> n; std::vector<int> data(n); for (int i = 0; i < n; ++i) { std::cin >> data[i]; } std::unordered_set<int> seen; std::unordered_set<int> ans; for (int i = 0; i < ...
ALGO
0.999836
5.35752
47cd6f37-b7ac-4b7e-a8fb-9ff0cece26fe
HatunFPT/COM108
TrenLop/B5/again2.2.cpp
//Go lai bai 2.2 #include <stdio.h> #include <math.h> #include <string.h> int main(){ //Khai bao float a,b,c,delta,x,x1,x2; //Nhap xuat printf("Giai phuong trinh bac 2."); printf("\nNhap a: "); scanf("%f",&a); printf("Nhap b: "); scanf("%f",&b); printf("Nhap c: "); scanf("%f",&c); printf("\nPhuong trinh vua n...
ALGO
0.995939
3.927661
3d5e783c-9aca-4c9b-bc11-453b06e9b02e
anmoanmo/acm_exercises
acm/cf/Codeforces Round 963 (Div. 2)/a.cpp
// // Created by ᕕ(◠ڼ◠)ᕗ on 24-8-4. // #include<bits/stdc++.h> #define ll long long using namespace std; void sol() { int n; cin >> n; string s; cin >> s; map<char, int> m; for (auto i: s) { m[i]++; } int ans = 0; for (auto i: m) { if (i.first != '?') { ...
ALGO
0.999929
4.154533
33ced302-b43f-48c8-96bf-8eeeb1ba19bc
fmfalgun/A2oJ_solution
Codeforces Rating < 1300/Puzzles.cpp
#include <iostream> #include <vector> #include <algorithm> #include <climits> using namespace std; int main() { int n, m; cin >> n >> m; vector<int> f(m); for (int i=0; i<m; i++) cin >> f[i]; sort(f.begin(), f.end()); int val = INT_MAX; for (int i=0; i<=m-n; i++){ val = min(val, f[i+n-1]-f[i]); } c...
ALGO
0.999939
3.693848
b155c3e0-aaad-4d8a-9334-0eb04c171913
sybui2004/DSA---PTIT
DSA - PTIT code by C++/DSA11014 - TONG NODE LA BEN PHAI.cpp
/*Author: Bùi Thái Sỹ B22DCCN702 from ProPTIT with love DSA11014 - TONG NODE LA BEN PHAI */ #include <bits/stdc++.h> using namespace std; #define fast \ ios_base::sync_with_stdio(false); \ cin.tie(0); #define pb push_back #define ll long long #define FORU(i, a, b) for (int i = a; i < b; i++) ...
ALGO
0.999962
4.417824
0479ec49-3c1d-4939-8055-5304514162a7
Sandigupta/AlgoZenith
Method_to_find_longest_arthamatic_progration_in_a_given_array.cpp/longest_AP.cpp
/*Description You are given an array A of N integers. You have to choose a contiguous arithmetic subarray with equal difference between consecutive integers, that has the maximum length. Find the maximum possible length. Input Format The first line of the input contains one integer T - the number of test cases. Then ...
ALGO
0.999514
4.87189
9825a58f-8a5a-436e-81a1-9168e8f190fc
Taylor-Cozy/AdvancedProgramming
AdvancedProgramming/Lesson4.cpp
#include <iostream> #include "Lesson4.h" using namespace std; void Lesson4::Example() { int a = 100; cout << "Value in memory location a is " << a << "\n"; int* b = &a; cout << "Value in memory location pointer to by b is " << *b << "\n"; cout << "b is actually at memory location " << &b << endl; int** c; ...
TOOL
0.98735
3.823194
8d7da392-0ce5-4116-8172-d4037f99047c
WULEI7/WULEI7
ACM俱乐部/大二暑假训练/8.8 2020 Pacific Northwest Regional Contest/1016 Reconstruct Sum(签到).cpp
#include <iostream> #include <cstdio> using namespace std; int main() { ios::sync_with_stdio(0),cin.tie(0),cout.tie(0); int n,a[10005],sum=0; cin>>n; for(int i=0;i<n;i++) { cin>>a[i]; sum+=a[i]; } for(int i=0;i<n;i++) { if(a[i]*2==sum) { cout<<a[i]<<endl; return 0; } } cout<<"BAD"<<endl; retu...
ALGO
0.999185
4.132738