uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
ef9d3725-37d7-45e6-abf4-55fdc54cf465
Nikitaprobuz9/cpp
Pattern35.cpp
/* * * * * * * * ********* */ #include<iostream> #include<conio.h> using namespace std; class Pattern35 { public: int lines=5; int spacecount=4; int starcount=1; void pat35() { for(int i=1;i<=lines;i++) { for(int j=1;j<=spacecount;j++) { cout<<" "; } for(int k=1;k<=...
ALGO
0.999839
3.488281
92c7dd61-7fad-4dcb-8798-231d889f40cf
DiegoMartinez2021/Portafolio_Ciclo_01_2021
Portafolio periodo 2/burbuja.cpp
#include<iostream> #include<array> #include<ctime> using namespace std; const int SIZE = 8000; //Imprie hasta num_elementos de arreglos void printArray(array<int,SIZE> &arr, int num_elementos){ for(int i=0; i<arr.size() && i<num_elementos; i++){ cout << arr[i] << endl; } } void tidyBuble(array<int, SIZE> &arr){ i...
ALGO
0.974912
3.854997
9e69cbc3-4679-4561-adf1-f476f77e560c
owl1753/Algorithm_Study
11000/11054.cpp
#include <iostream> #include <algorithm> using namespace std; int arr[1001]; int dp[1001][2]; int n, result = 0; int main() { cin >> n; for (int i = 0; i < n; i++) cin >> arr[i]; dp[0][0] = 1; dp[0][1] = 1; for (int i = 0; i < n; i++) { for (int j = 0; j < i; j++) { if (arr[i] > arr[j]) { dp[i][0] = max...
ALGO
0.999979
4.186868
7ca12868-faaf-4656-a643-beeb873bed15
isheoran/CP
dp/minimum_dsum.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define m (ll)(1e9+7) #define input(v) for (auto &i : v) cin >> i; #define print(v) for (auto &j : v) cout << j << " "; cout << "\n"; ll dp[2001][2001],s[2001],n; ll f(int l,int r) { if(l==r) return 0; if(l>r) return 0; if(l<1 || r<1 || l...
ALGO
0.999914
4.112164
c2ea14dc-dbbd-45d9-8192-e63365a9fa23
aryangupta02092002/SDE-Sheet-Fresh-Start-
Day10_RecursionAndBacktracking/46_Permutation.cpp
//Link: https://leetcode.com/problems/permutations/ /* Input: nums = [1,2,3] Output: [[1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,1,2],[3,2,1]] */ /* BRUTE FORCE Run a for loop starting from 0 to nums.size() – 1. Check if the frequency of i is unmarked, if it is unmarked then it means it has not been picked and then we pick. ...
ALGO
0.999997
7.268526
7cfd3e6f-dd97-4b61-ad3c-64ab81c8f7ce
crdroidandroid/android_frameworks_av
services/audiopolicy/common/managerdefinitions/src/AudioProfileVectorHelper.cpp
#include <algorithm> #include <set> #include <string> #define LOG_TAG "APM::AudioProfileVectorHelper" //#define LOG_NDEBUG 0 #include <media/AudioContainers.h> #include <media/AudioResamplerPublic.h> #include <utils/Errors.h> #include "AudioProfileVectorHelper.h" #include "HwModule.h" #include "PolicyAudioPort.h" #i...
TOOL
0.912106
4.914231
f19da5d9-0298-4273-8456-996868334992
uttkarsh2406/Competitive
CC/median_of_adjecnet_maximum.cpp
#include<bits/stdc++.h> using namespace std; #define ll long long #define ld long double #define MOD 1000000007 int main(){ ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); freopen("input.txt","r",stdin); freopen("output.txt","w",stdout); ll tt; cin>>tt; while (tt--) ...
ALGO
0.99917
3.424127
cfd39c77-5548-423b-ae88-e81ca71e1b52
Rookie-cprime/CS_learn
class_4/lec_2/lec/switch_test.cpp
#include <iostream> using namespace std; int main() { double arg1,arg2,result; char temp; cout<<"Please input a math expression"<<endl; cin>>arg1>>temp>>arg2; switch(temp){ case '*': result = arg1*arg2; cout<<result<<endl; break; case '+': ...
ALGO
0.993661
3.571404
2f9a2910-86a4-4793-b1d9-a2f4d62ff787
mimakyuu/AtCoder
ABC/C133.cpp
#include <bits/stdc++.h> #pragma GCC optimize("Ofast") using namespace std; //#define ACL #ifdef ACL #if __has_include(<atcoder/all>) #include <atcoder/all> using namespace atcoder; #endif #if __has_include("acl-all.h") #include "acl-all.h" //on Wandbox using namespace atcoder; #endif #endif //#ifdef ACL typedef long...
ALGO
0.999876
4.16297
76cc693a-4229-4c6d-9a7d-ebd42e34c30b
DrunkenCloud/advent_of_code_2024
20_day/solve.cpp
#include <iostream> #include <vector> #include <fstream> #include <string> #include <cstring> #include <queue> #include <functional> #include <climits> #include <iomanip> using namespace std; void readFiles(vector<string>& board, int f) { string line; string fd = (f == 1) ? "input.txt" : "trial.txt"; ifst...
ALGO
0.999812
5.536914
f659865e-ec80-4aa4-a224-2309b5267ca9
jiqishou/coding_practice
CompleteTree.cpp
/* Given a complete binary tree, count the number of nodes. Definition of a complete binary tree from Wikipedia: In a complete binary tree every level, except possibly the last, is completely filled, and all nodes in the last level are as far left as possible. It can have between 1 and 2h nodes inclusive at the last ...
ALGO
0.999699
6.390854
32b16e70-139e-47db-bda8-34b404f9f8fc
akash-899/Basic-Data-Structure
module 24/Give_Current_Min.cpp
#include<bits/stdc++.h> using namespace std; int main() { priority_queue<int,vector<int>,greater<int>> pq; int n; cin>>n; for(int i=0;i<n;i++) { int v; cin>>v; pq.push(v); } int t; cin>>t; while(t--) { int c; cin>>c; if(c==0) ...
ALGO
0.999856
4.079637
fbc11e6c-f83f-4bc8-9436-1a8ec44748b0
DionysiosB/CodeChef
JCOINS.cpp
#include <cstdio> int main(){ long t; scanf("%ld", &t); while(t--){ long x, y; scanf("%ld %ld", &x, &y); printf("%ld\n", 10 * x + 5 * y); } }
ALGO
0.999323
3.942245
424bb7da-84b8-4a7e-837b-c60780bc76be
Bungmint/competitiveprogramming
contest/cses/1744.cpp
// Problem: Rectangle Cutting // Contest: CSES - CSES Problem Set // URL: https://cses.fi/problemset/task/1744 // Memory Limit: 512 MB // Time Limit: 1000 ms // // Powered by CP Editor (https://cpeditor.org) using namespace std; using ll = long long; using vi = vector<int>; using pii = pair<int, int>; using vpi = ve...
ALGO
0.999711
4.627153
55fd92c6-6a55-4581-9350-4fc87398e53e
rabi993/phitron
algorithm/topicWise/02_Bfs_Dfs/m2.5/3 connected to the node.cpp
#include <bits/stdc++.h> using namespace std; vector<int> v[1005]; bool vis[1005]; void bfs(int src) { queue<pair<int, int>> q; q.push({src, 0}); vis[src] = true; // bool paisi = false; int cnt=0; while (!q.empty()) { pair<int, int> p = q.front(); q.pop(); int par = p...
ALGO
0.999916
3.81349
5d7c127a-6337-439f-88d1-60d87bdd2b4c
Skyxim/JetbrainRuntime
src/jdk.jpackage/share/native/applauncher/CfgFile.cpp
#include "kludge_c++11.h" #include <fstream> #include <algorithm> #include "CfgFile.h" #include "Log.h" #include "Toolbox.h" #include "FileUtils.h" #include "ErrorHandling.h" const CfgFile::Properties& CfgFile::getProperties( const SectionName& sectionName) const { const PropertyMap::const_iterator entry = da...
TOOL
0.886378
6.974122
7e7783f8-577e-469a-833f-ce73e348bd32
tamaltm/CP
Movie_Festival.cpp
#include <bits/stdc++.h> using namespace std; #define FasterIO ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0); #define ll long long void solve(){ int n;cin >> n; vector<pair<int,int>> v; for(int i=0;i<n;i++){ int x,y;cin >> x >> y; v.push_back(make_pair(x,...
ALGO
0.999933
5.119491
73ac690d-6378-494a-825f-dff7a14ece9d
lxiaoyong/Arithmetic
ZConvert.cpp
// // Created by 刘晓涌 on 2020/7/29. // // 题目:https://leetcode-cn.com/problems/zigzag-conversion/ #include<vector> #include<string> using namespace std; string convert(string s, int numRows) { if(numRows==1) return s; vector<string> vs(numRows); int current_row=0; bool direction=false; for(const char&...
ALGO
0.999632
5.371605
6b38e2cb-5be8-4728-a6f4-eaf558cec904
ishandutta2007/codeforces
irkstepanov/normal/639/C.cpp
#include <stdio.h> #include <iostream> #include <vector> #include <algorithm> #include <cstdlib> #include <cmath> #include <cstring> #include <set> #include <map> #include <stack> #include <ctime> #include <queue> using namespace std; #define sz(a) (int)a.size() #define all(a) (a).begin(), (a).end() const long long ...
ALGO
0.999923
3.715441
09fa7d16-9b16-4e3c-a189-2cd7242a804c
Cobb-Yoo/Algorithms
programmers/l3/단속카메라/단속카메라.cpp
#include <vector> #include <algorithm> using namespace std; bool cmp(vector<int> a, vector<int> b){ return a[1] < b[1]; } int solution(vector<vector<int>> routes) { int answer = 0; sort(routes.begin(),routes.end(),cmp); int camera = -30001; for(auto route : routes){ if(r...
ALGO
0.999145
5.448955
623115ce-2021-4f33-86c5-17c77fcff7ac
shuvokr/CodeForces_Online_Contest
CodeForces/Contest/Division 2/Div12/B.cpp
/************************************ Shuvo Problem name : Problem ID : Problem algo : Note : *************************************/ /**********************************Templet start***********************************/ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <...
ALGO
0.997678
3.031733
c0230561-8553-4883-9716-0364c5d7e4fe
nettee/leetcode
solutions/0773.quad-tree-intersection/0773.quad-tree-intersection.1548420432.cpp
/* // Definition for a QuadTree node. class Node { public: bool val; bool isLeaf; Node* topLeft; Node* topRight; Node* bottomLeft; Node* bottomRight; Node() {} Node(bool _val, bool _isLeaf, Node* _topLeft, Node* _topRight, Node* _bottomLeft, Node* _bottomRight) { val = _val; ...
ALGO
0.999909
6.248375
8a38a4a8-7356-43e6-b05e-e0393242fec7
tirtha-das/-6Companies30days
Serialize and Deserialize Binary Tree.cpp
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ class Codec { public: // Encodes a tree to a single string. string serialize(TreeNode* root) { if(root==NUL...
ALGO
0.999779
6.030616
b9548640-1d2f-4fb8-81d1-715fe62337bc
juhyemi/Cote
20240813/랭킹전 대기열.cpp
#include <iostream> #include <vector> #include <algorithm> #include <string> using namespace std; #define MAX 310 // 플레이어의 수 p, 플레이어의 닉네임 n, 플레이어의 레벨 l, 방 한개의 정원 m int p, l, m; string n; int groupCnt; int groupLevel[MAX][2]; // 각 방의 최소, 최대 level vector<pair<int, string>> groupPlayer[MAX]; // 각 방에 입장한 플레이어 저장 // 사전순 출...
ALGO
0.999578
4.199744
1f10f8be-81c4-40c9-80df-14f58e309f96
oliverhuo128/finance_c-
week 1/assignment/New folder/main_P3.cpp
//Solution to Problem sheet 1 question 2 //by Zhenting Oliver Huo #include <iostream> //iostream cin and cout #include <string> //include string type so no need to write std::string everytime using namespace std; // do not need to write std:: every time //first we define the swap function void swap(int* x, int* y) { ...
ALGO
0.997349
3.993327
5a114d07-9389-4dd6-84a1-10be05b8313f
AbihaFatima/LeetCode
623-add-one-row-to-tree/623-add-one-row-to-tree.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.99998
6.227897
e97302e4-3c51-4243-921a-cb13dfa496e1
RisingKratos/CannyAlgorithm
CVCannyAlgorithm/samples/cpp/distrans.cpp
#include <opencv2/core/utility.hpp> #include "opencv2/imgproc.hpp" #include "opencv2/imgcodecs.hpp" #include "opencv2/highgui.hpp" #include <stdio.h> using namespace std; using namespace cv; int maskSize0 = DIST_MASK_5; int voronoiType = -1; int edgeThresh = 100; int distType0 = DIST_L1; // The output and temporary...
ALGO
0.903641
5.513739
38836b5d-073b-4b73-aa24-466dee56e152
mukesh567/ALL-DSA-PROBLEMS
Heap/ArraySortedUsingHeap.cpp
#include <bits/stdc++.h> using namespace std; // log(n) void heapify(vector<int> &a, int n, int i) { int maxIdx = i; int l = 2 * i + 1; int r = 2 * i + 2; if (l < n && a[l] > a[maxIdx]) { maxIdx = l; } if (r < n && a[r] > a[maxIdx]) { maxIdx = r; } if (maxIdx ...
ALGO
0.999982
5.092595
afb973c0-8fa2-4313-82b7-b7426f7c5d73
harry-dev98/CompetitiveCodingSolutions
Strings/facerecognition.cpp
#include<bits/stdc++.h> using namespace std; int main(){ int n, m; cin>>n>>m; string twobytwo; char P[n][m]; for(int i=0; i<n; i++){ for(int j=0; j<m; j++){ cin>>P[i][j]; } } int ans=0; for(int i=0; i<n-1; i++){ for(int j=0; j<m-1; j++){ t...
ALGO
0.999819
4.085299
c190d2e4-3f70-43f4-a3cd-239a4bc35796
raptoravis/forwardplusrendering
thirdparty/boost_1_70_0/tools/inspect/link_check.cpp
// link_check implementation -----------------------------------------------// #include "link_check.hpp" #include "boost/regex.hpp" #include "boost/filesystem/operations.hpp" #include <boost/algorithm/string/case_conv.hpp> #include <cstdlib> #include <set> // #include <iostream> namespace fs = boost::filesystem; ...
TOOL
0.881031
7.753358
25be7fa1-4098-403b-b656-ef8f486728bf
Ansh1693/contests
codeforces/A_Binary_Search.cpp
#include <bits/stdc++.h> #include <iostream> using namespace std; #define ll long long #define ld long double bool binSearch(vector<int> &arr, int target) { int start = 0, end = arr.size() - 1; while (start <= end) { int mid = start + (end - start) / 2; if (arr[mid] == target) return true; else i...
ALGO
0.999975
4.742931
6dd42145-9020-4be8-b234-d979cf3a4518
elvin-hwang/Tile-Island
ext/opencv/sources/modules/dnn/src/nms.cpp
#include "precomp.hpp" #include "nms.inl.hpp" #include <opencv2/imgproc.hpp> namespace cv { namespace dnn { CV__DNN_INLINE_NS_BEGIN template <typename T> static inline float rectOverlap(const T& a, const T& b) { return 1.f - static_cast<float>(jaccardDistance(a, b)); } void NMSBoxes(const std::vector<Rect>& bbo...
ALGO
0.998089
7.487664
5a5c24d9-a2dd-43e0-845f-f7b738bba349
dicksiano/Dynamic-Programming
TSP/TravelingSalesmanProblem.cpp
#include <bits/stdc++.h> using namespace std; /* Time: O(n^2 2^n) Space: O(n 2^n) */ int tsp(int p, int bitmask) { if (bitmask == (1 << (n + 1)) - 1) return dist[pos][0]; // Have already visited all cities if (dpTable[pos][bitmask] == -1) { for (int next = 0; next <= n; next++) // ...
ALGO
0.999944
4.087358
bebf4e77-7acf-4d90-ba11-aa79c5ea1314
Yawn-Sean/Daily_CF_Problems
daily_problems/2024/11/1121/personal_submission/cf1068c_tsreaper.cpp
#include <bits/stdc++.h> #define MAXN 100 using namespace std; int n, m; vector<int> ans[MAXN + 5]; bool G[MAXN + 5][MAXN + 5]; int main() { scanf("%d%d", &n, &m); for (int i = 1; i <= m; i++) { int x, y; scanf("%d%d", &x, &y); G[x][y] = G[y][x] = true; } for (int i = 1; i <= n; i++)...
ALGO
0.999879
3.606452
07bf226e-0a4d-4037-93be-d6123c2161e5
yaap/external_aac
libSBRenc/src/resampler.cpp
/* ----------------------------------------------------------------------------- Software License for The Fraunhofer FDK AAC Codec Library for Android © Copyright 1995 - 2018 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V. All rights reserved. 1. INTRODUCTION The Fraunhofer FDK AAC Codec Lib...
ALGO
0.998738
4.360723
5b6d4400-cf43-452c-9d82-0750eba8f666
Dup4/competitive-programming
nowcoder/894/a.cpp
#include <bits/stdc++.h> using namespace std; #define db double db PI = acos(-1.0); int main() { int s; while (scanf("%d", &s) != EOF) { db a = s * 1.0 / PI; printf("%.3f\n", 2.0 * sqrt(a)); } return 0; }
ALGO
0.989596
3.448572
110f49d7-2537-49cc-915c-52b4895076b2
blackDogSheriff/C-Primer
chapter9/08_operate_iterator.cpp
#include <iostream> #include <vector> using namespace std; void print_vector(vector<int> &v); void t_operate_iterator(); int main(void) { t_operate_iterator(); return 0; } void t_operate_iterator() { vector<int> v = {1, 2, 3, 4, 5}; auto iter = v.begin(); while (iter != v.end()) { if (*i...
ALGO
0.997229
4.718978
43fe2517-d0b4-42da-b363-4fb497cc8c35
summerspringwei/souffle-ae
baseline/rammer/rammer_generated_models/seq2seq/main_test.cpp
#include "nnfusion_rt.h" #include <cuda_profiler_api.h> #include <limits> #include <stdlib.h> #include <stdio.h> #include <sstream> #include <stdexcept> #define CUDA_SAFE_CALL(x) \ do ...
ALGO
0.903704
4.61742
928a2110-be2e-496a-a76d-06b1acdbf351
alstn1234/CodingTest
프로그래머스/lv2/42586. 기능개발/기능개발.cpp
#include <string> #include <vector> using namespace std; vector<int> solution(vector<int> progresses, vector<int> speeds) { vector<int> answer; int cnt = 0; int all_cnt = 0; while(all_cnt != progresses.size()){ for(int i = 0+ all_cnt; i < progresses.size(); i++) progresses[i] += sp...
ALGO
0.999803
5.100291
147a3e88-61c2-4844-a028-aaa84753c296
coderpen-me/competitive_programming
interviewBit/arrays/maximum_positivity.cpp
#define ll long long vector<int> Solution::solve(vector<int> &A) { ll s = 0, e = 0, ptr1 = 0, ptr2 = 0; A.push_back(-1); for(int i = 0; i < A.size(); i++){ while(A[i] >= 0) i++; if(ptr2 - ptr1 < i - s){ ptr2 = i; ptr1 = s; } s = i+1; } vector<i...
ALGO
0.999992
4.687991
d8909242-63d3-4425-9e88-6509b917f126
Arpit957/DSA-Problem-Solving
LC/Daily challenge 26March.cpp
class Solution { public: void dfs(int node,vector<int>&edges,vector<bool>&vis,vector<bool>&extra,vector<int>&dist,int &ans,int distance){ if(node!=-1){ if(!vis[node]){ vis[node]=true; extra[node]=true; dist[node]=distance; dfs(edges[n...
ALGO
0.999958
5.314737
ebe15e08-12dd-4dd3-9559-facea7561ec1
113bommy/deepmind_codecontests_refine
cpp_source_filter_file/cpp_train_6805_7.cpp
#include <bits/stdc++.h> int a, b; int main() { scanf("%d%d", &a, &b); if (a < b) a ^= b ^= a ^= b; printf("%d %d", a + b - 1, b); }
ALGO
0.999869
3.192369
0e16aa65-5b21-4f1f-9147-d04050f954f6
the-punisher-29/leetcode
3761-maximum-difference-between-even-and-odd-frequency-ii/3761-maximum-difference-between-even-and-odd-frequency-ii.cpp
class Solution { public: int maxDifference(string s, int k) { int ans = INT_MIN; for (const auto& [a, b] : getPermutations()) { // minDiff[parityA][parityB] := min(a - b) of all valid windows with // parityA and parityB vector<vector<int>> minDiff(2, vector<int>(2, INT_MAX / 2)); vect...
ALGO
0.999932
5.978467
247e2d88-d104-400a-8cb1-4bc090ebb224
harumich/tech_publish_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
15150fb0-82cd-47ff-a5d7-cb1b2ac4c07b
jefferyyuan/AlgorithmPractices
Leetcode-cpp/intersection_of_two_linked_lists.cpp
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ class Solution { public: ListNode *getIntersectionNode(ListNode *headA, ListNode *headB) { int length_a = 0; ListNode* current = headA; ...
ALGO
0.999856
5.329739
2d5d1159-29af-4770-a3bb-fbd46fcd5e21
Fernanderson123/codes-cpp
degraus.cpp
#include <iostream> #include <cmath> using namespace std; int main() { float altcen,altm; float degraus; cin >> altcen; cin >> altm; degraus = altm*100 / altcen; cout << ceil(degraus); return 0; }
ALGO
0.982293
3.21746
93e98326-d23c-4051-a992-1b28455a88ac
mhiu05/Code_PTIT
DSA/DSA06007_Sap_xep_day_con_lien_tuc.cpp
// https://code.ptit.edu.vn/student/question/DSA06007 // SẮP XẾP DÃY CON LIÊN TỤC #include <bits/stdc++.h> using namespace std; void testCase() { int n; cin >> n; vector<int> a(n); for (int &i : a) cin >> i; vector<int> b = a; sort(a.begin(), a.end()); int i = 0, j = n - 1; wh...
ALGO
0.999871
4.225652
efe39615-683b-41fd-9715-b26b0964067c
AkashSCIENTIST/CompetitiveSolutions
HackerRank/C++/StringStream.cpp
#include <sstream> #include <vector> #include <iostream> using namespace std; vector<int> parseInts(string str) { stringstream ss(str); vector<int> v; for(int i=0; ss>>i; ss.ignore()) v.push_back(i); return v; } int main() { string str; cin >> str; vector<int> integers = parseInts(str); for(int i = 0;...
ALGO
0.992117
4.486793
16f49d4f-2b28-4d9f-a928-128b143e1e2a
Kawser-nerd/CLCDSA
Source Codes/AtCoder/arc025/D/2063586.cpp
#include <iostream> #include <vector> #include <algorithm> #include <ctime> using namespace std; #pragma warning (disable: 4996) class Matrix { public: long long dat[3][3]; int H, W; void init(int H1, int W1) { for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) dat[i][j] = 0; } H = H1; W = W1; } }; Matri...
ALGO
0.999969
3.771348
545363d0-0c9f-45e0-968c-599c73a31e1e
Suraj-Dhankad2025/DSA-Problems-Leetcode
1522-stone-game-iii/stone-game-iii.cpp
class Solution { public: int find(vector<int>&s, int i, vector<int>&dp){ if(i>=s.size()){ return 0; } if(dp[i]!=-1)return dp[i]; int ans=INT_MIN; if(i<s.size()){ ans = max(ans, s[i] - find(s, i+1, dp)); } if(i+1<s.size()){ a...
ALGO
0.999977
5.624617
9ac5dcf1-9291-4163-b22a-5dbff43e6309
khalid586/Preparation
Binary Search/very easy task.cpp
//Starting in the name of Allah(THE ALMIGHTY) #include <bits/stdc++.h> using namespace std; const int N = 1e6+7; #define int long long #define rep(i,a,b) for(int i = a; i < b;++i) #define rev(i,a,b) for(int i = a; i >= b;--i) void IO(){ #ifndef ONLINE_JUDGE freopen("in.txt","r", stdin); ...
ALGO
0.999846
3.493073
b73c69ad-cc5a-4fe5-a831-4167fdf88805
TheDev05/CARDIO
CodeForces/Rating 1400/A_YES_or_YES.cpp
/* Believe in your Karma & Keep chanting, "Hare Rama Hare Rama, Rama Rama Hare Hare, Hare Krishna Hare Krishna, Krishna Krishna Hare Hare !!" Prayers. Practice. Patience. */ #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using n...
ALGO
0.999954
4.762465
d37db1b0-d9f5-4d4b-bb2c-0a37861eaa1e
JohnDeerexx/wintergrasp
src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_bjarngrim.cpp
/* ScriptData SDName: Boss General Bjarngrim SD%Complete: 70% SDComment: Waypoint needed, we expect boss to always have 2x Stormforged Lieutenant following SDCategory: Halls of Lightning EndScriptData */ #include "ScriptPCH.h" #include "halls_of_lightning.h" enum eEnums { //Yell SAY_AGGRO ...
TOOL
0.905492
5.35468
4964c092-62d6-4ff7-9878-a6067c2702df
MuEmu-BR/pyke-s6-source
Util/cryptopp/emsa2.cpp
// emsa2.cpp - written and placed in the public domain by Wei Dai #include "pch.h" #include "emsa2.h" #ifndef CRYPTOPP_IMPORTS NAMESPACE_BEGIN(CryptoPP) void EMSA2Pad::ComputeMessageRepresentative(RandomNumberGenerator &rng, const byte *recoverableMessage, size_t recoverableMessageLength, HashTransformation &has...
ALGO
0.990295
7.77748
8b761104-64cd-4386-a845-97cad76c514e
zlccccc/ACM-Templates-by-zlc1114
数据结构/splay(板子)/题目/北邮校赛D.cpp
#include <cstdio> #include <iostream> #include <algorithm> #include <vector> #include <set> #include <map> #include <string> #include <cstring> #include <stack> #include <queue> #include <cmath> #include <ctime> #include <utility> using namespace std; #define REP(I,N) for (I=0;I<N;I++) #define rREP(I,N) for (I=N-1;I>=0...
ALGO
0.999845
3.717089
c1eb7902-ea93-4ccd-b8b8-9a6fb4aa31c9
ishandutta2007/codeforces
gyz_gyz/normal/1066/B.cpp
#include<bits/stdc++.h> #define rep(i,x,y) for(int i=(x);i<=(y);i++) #define dep(i,x,y) for(int i=(x);i>=(y);i--) #define N 200010 #define ll long long #define pb push_back #define add(x,y) x=(x+(y))%mo; #define sqr(x) ((x)*(x)) #define mo 998244353 #define inf 1000000000 #define eps 1e-8 using namespace std; int n,m,t...
ALGO
0.999991
3.81477
50d2f5f3-2fc8-471d-a786-b0576ceec90f
HasnathJami/Problem-Solving
TOPH/Problems/Grid.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define endl "\n" #define nline cout<<"\n" #define FASTER ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); #define PI acos(-1.0) int mod=1e9+7; int main () { FASTER int T; cin>>T; for(int i=1;i<=T;i++) { ...
ALGO
0.997898
3.613668
6b416f2d-a2a6-48a1-83d1-6dc18ec196ec
siddharth25pandey/CPP-Programming
Arrays/2darray.cpp
#include <iostream> using namespace std; int main() { int n, m; cout<<"Enter the row and column"<<endl; cin >> n >> m; int arr[n][m]; int x; cout << "Enter the value on number you want to search...." << endl; cin >> x; cout<<"Enter the element of array"<<endl; for (int i = 0; i < n; ...
ALGO
0.997949
3.850636
cc81ebd1-f90e-4917-9278-b221710e69e6
Abdullah-Official/DSA-CPP
Arrays and Strings/LinearSearch.cpp
#include<iostream> using namespace std; bool linearSearch(int arr[], int key){ // int length = (sizeof(arr)/sizeof(int)); for(int i = 0; i < 5; i++){ if(arr[i] == key){ return 1; } } return 0; } int main(){ int arr[5] = {1,5,23,8,0}; bool found = linearSearch(arr, -...
ALGO
0.999931
4.01295
b89df26a-6daa-4b2d-966f-3ed23874515e
NikitaZaichenko99/Lab1-13_PNIPY
Zadacha_5/zadacha_5_main.cpp
#include <C:\Users\nikit\source\repos\Zadacha_2\Money.h> #include <iostream> #include <stack> #include <vector> #include "Vector.h" using namespace std; void main() { setlocale(LC_ALL, "rus"); Money s, t; long r; int c; Vector<Money>v(3); v.Print(); Money m = v.Max(); cout << " = " << m << endl; v.Add(m); v....
ALGO
0.988099
3.54897
6e082e27-403b-42ab-a095-c0c06c04ed65
Cattle0Horse/algorithm-problem
leetcode/leetcode_139.cpp
/** * @file leetcode_139.cpp * @author Cattle_Horse (<EMAIL>) * @brief https://leetcode.cn/problems/word-break/ * @version 1.0 * @date 2024-06-11 * * @copyright Copyright (c) 2024 * */ #include <unordered_set> #include <vector> class Solution { public: bool wordBreak(std::string s, std::vector<std::string>...
ALGO
0.998838
6.173487
64c3954c-fb00-49e5-a2b3-57ee59fa5053
Nanthana2003/ipmp23
linked_list/ll13.cpp
#include<iostream> #include<unordered_set> #include<algorithm> using namespace std; struct Node { int data; struct Node *next; Node(int x){ data = x; next = NULL; } }; Node* rotate(Node* head, int k) { int l = 0; struct Node * p, *q; p = head; while(...
ALGO
0.999877
3.695812
4076b8f1-59eb-46b6-bac9-324272e794d7
Sangmin627/AlgoStudy2023
상민/백준/탐색/11725.cpp
#include <iostream> #include <vector> #include <queue> using namespace std; vector<int> graph[100001]; bool isVisited[100001]; int parent[100001]; void dfs(int n) { for (int i = 0; i<graph[n].size(); i++) { int tmp = graph[n][i]; if (!isVisited[tmp]) { isVisited[tmp] = true; ...
ALGO
0.999997
5.372265
fae30d0b-04fd-41fe-ad0f-b5125fe91f4f
TantowiPutra/Algorithms-in-C
C++ Concepts/Practice/recursivequiz.cpp
#include <iostream> using namespace std; int f(int n) { static int i = 1; if(n >= 5) return n; n = n + i; i++; return f(n); } void foo(int n, int sum) { int k = 0, j = 0; if(n == 0) return; k %= 10; j = n / 10; sum = sum + k; foo(j, sum); printf("%...
ALGO
0.999888
3.460881
c436f373-8a68-40fe-a79c-7e638dc70947
zy5969/C_Pratice_Code
04.HZOJ/210.cpp
/************************************************************************* > File Name: 210.cpp > Author: > Mail: > Created Time: Mon 27 Nov 2023 11:13:16 PM CST ************************************************************************/ #include <stdio.h> #include<iostream> using namespace std; int main() { ...
ALGO
0.999707
3.261566
44f54930-4583-4cef-b0af-f72274d0a598
muhamdasim/CPP
Basic C++ Concepts/paper/25.cpp
#include <iostream> using namespace std; int main() { int n; cin>>n; for (int i=1 ; i<=n ; i++) { for (int j=1 ; j<=i ; j++) { if (i%2!=0) { cout<<j; } else if (j%2==0) { for (int k=i ;k>=1 ;k--) { cout<<k; } break; } } cout <<endl; } }
ALGO
0.999987
3.765829
e92008a5-1af7-4cd8-90d6-012639677d35
AliOsm/CompetitiveProgramming
UVA/11559 - Event Planning.cpp
#include <iostream> #include <vector> using namespace std; int main() { long long n, b, h, w; vector<long long> hb; while(cin >> n >> b >> h >> w) { long long fp = 1e18 + 1; bool can = false; for(int i = 0; i < h; i++) { long long p; cin >> p; ...
ALGO
0.999887
3.555563
5827c443-ad13-48af-b113-5c683ea1f836
phUR99/ps
2025/01/캔디_분배.cpp
#include <bits/stdc++.h> using namespace std; #define fastio \ ios_base::sync_with_stdio(false); \ cin.tie(NULL) #define ll long long void solve() { int n, k; cin >> n >> k; ll s0 = 1, t0 = 0, r0 = -n; ll s1 = 0, t1 = 1, r1 = k; ll tmp; while (r1) { ll...
ALGO
0.999922
4.537467
d99c82fa-5b27-428e-8b23-3b7dac32f426
spyder000/bitcoinv1
src/coins.cpp
#include "coins.h" #include <assert.h> // calculate number of bytes for the bitmask, and its number of non-zero bytes // each bit in the bitmask represents the availability of one output, but the // availabilities of the first two outputs are encoded separately void CCoins::CalcMaskSize(unsigned int &nBytes, unsigned...
ALGO
0.959734
6.947765
52562e0a-f564-4e9f-814c-15b78a6bd44c
Saumitra28/cpp
Arrays/#74.cpp
#include <iostream> #include <vector> using namespace std; int cnt = 0; void merge(vector<int> &arr, int low, int mid, int high) { vector<int> temp; // temporary array int left = low; // starting index of left half of arr int right = mid + 1; // starting index of right half of arr // storing el...
ALGO
0.999877
4.884565
a3a927ea-0ba3-45b2-a9c6-001a81ef4aea
BakytSuiunbekov/musulman_birimdigi
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
03ef24e9-390d-4552-83a4-dd22e28c8a7d
ProSeCo-Planning/proseco_planning
src/proseco_planning/agent/cost_model/costModel.cpp
#include "proseco_planning/agent/cost_model/costModel.h" #include <cmath> #include <cstdlib> #include <iostream> #include "proseco_planning/agent/cost_model/costContinuous.h" #include "proseco_planning/agent/cost_model/costExponential.h" #include "proseco_planning/agent/cost_model/costLinear.h" #include "proseco_plan...
ALGO
0.921627
7.104387
c71d5248-503e-4fe1-9707-6c9042360dec
RunqiuBao/eigen
unsupported/doc/examples/PolynomialUtils1.cpp
#include <unsupported/Eigen/Polynomials> #include <iostream> using namespace Eigen; using namespace std; int main() { Vector4d roots = Vector4d::Random(); cout << "Roots: " << roots.transpose() << endl; Eigen::Matrix<double,5,1> polynomial; roots_to_monicPolynomial( roots, polynomial ); cout << "Polynomial:...
ALGO
0.999008
4.016954
5d69028c-c9b7-45ba-ab62-ab4595f15653
william1099/CP
688A-opponnt.cpp
#include <bits/stdc++.h> using namespace std; int main() { int n,d,count=0,ans=-1; string str; cin>>n>>d; for (int i=1; i<=d; i++) { cin>>str; int found=str.find("0"); if (found!=string::npos) count++; else count=0; ans=max(ans,count); } cout<<ans<<endl; }
ALGO
0.998602
3.753157
88c51c65-d73b-4a8b-b9df-897f9bfa79ec
kmurray/esta
src/esta/cell_characterize.cpp
#include <cassert> #include <iostream> #include <algorithm> #include "cell_characterize.hpp" #include "transition_eval.hpp" std::vector<std::vector<TransitionType>> cartesian_product(const std::vector<TransitionType>& set, size_t n); std::vector<std::set<std::tuple<TransitionType,TransitionType>>> identify_active_tr...
ALGO
0.996664
6.133658
94c4b257-3c25-4b77-ad69-ad3be0806320
honeyvikash/Leetcode_Solved_Problems
1002-find-common-characters/1002-find-common-characters.cpp
class Solution { public: vector<string> commonChars(vector<string>& words) { vector<unordered_map<int,int>> mp; vector<string> v; int i = -1; for(auto& a:words) { i++; mp.push_back(unordered_map<int,int>()); for(auto& b:a) ...
ALGO
0.99996
5.866731
6307f029-8cce-48fc-9bc6-86ee00324f4c
GuptaDivyansh26/DSA-Practice
codes/2025-04-26/3.cpp
#include <bits/stdc++.h> #include <unordered_set> using namespace std; struct Node { int data; Node* next; Node(int val) { data = val; next = NULL; } }; void loopHere(Node* head, Node* tail, int position) { if (position == 0) return; Node* walk = head; for (int i ...
ALGO
0.999295
4.961586
47473f5d-1e0f-4202-9bce-eb8a8f31bbc0
Char1sk/AlgorithmContestBook
Book/Unit5/Exercise5.11/UpdatingADictionary.cpp
#include <iostream> #include <sstream> #include <string> #include <map> int main() { int cases; std::cin >> cases; getchar(); while (cases--) { std::map<std::string, std::string> dicts[2]; for (int i = 0; i < 2; ++i) { std::string line; std::getline(s...
ALGO
0.99631
3.6496
a921bde0-c54d-4060-908f-801c9a4f7a9e
felipec03/Tarea1_TallerDeProgramacion
Material en Clases/Sección B2 (otra)/State.cpp
#include "State.h" // se puede cambiar char* por string State::State(int a0, int a1, State *parent, char *op) { this->a0 = a0; this->a1 = a1; this->parent = parent; this->op = op; } State::State() { a0 = -1; a1 = -1; parent = nullptr; op = (char *) ""; } void State::print() { // recor...
ALGO
0.99901
3.083742
3696b618-1108-49d7-b3b5-c29e360ce48b
Kyle-Storrier/EzPC-LLAMA-fork
SCI/tests/GC/test_msnzb.cpp
#include "BuildingBlocks/aux-protocols.h" #include <iostream> using namespace sci; using namespace std; #define MAX_THREADS 4 int party, port = 8000, dim = 1 << 16; string address = "127.0.0.1"; int op = 1; IOPack *iopackArr[MAX_THREADS]; OTPack *otpackArr[MAX_THREADS]; int bw_x = 32; int num_threads = 4; void test...
TOOL
0.909346
4.820802
21407b84-d6da-4977-88ed-a794e3fa3cc4
lemoneid/1.do-exercises
Algorithm/LeetCode/29.两数相除.cpp
/* * @lc app=leetcode.cn id=29 lang=cpp * * [29] 两数相除 */ // @lc code=start class Solution { public: int divide(int dividend, int divisor) { if (divisor == 0 || divisor == 1) return dividend; if (divisor == -1) { if (dividend == INT_MIN) return INT_MAX; return -dividend; ...
ALGO
0.999947
6.196567
1ed7f92b-0113-4357-be2c-75c91befbf26
bishnumishra98/DSA
Leetcode&Gfg/14. Graphs/23_ShortestPathInUndirectedGraph.cpp
// GFG: You are given an Undirected Graph having unit weight of the edges, find the shortest path from src to all the vertex // and if it is unreachable to reach any vertex, then return -1 for that vertex. // Example 1: // Input: // n = 9, m = 10 // edges=[[0,1],[0,3],[3,4],[4,5],[5,6],[1,2],[2,6],[6,7],[7,8],[6,8]] ...
ALGO
0.999995
6.103612
1ede32e5-a676-4b45-900f-e69b984dcaaf
name365/Algorithm-note
第五章/100000593-《算法笔记》5.6小节——数学问题-大整数运算/1952.cpp
/*1952 ˼ - һʮAAתΪȻλУתΪʮBB - ֮ǰĽתƣֻһ */ #include<stdio.h> #include<string.h> struct bign { int d[1001]; int len; bign() { memset(d, 0, sizeof(d)); len = 0; } }; bign change(char a[]){//洢 bign c; int i; for(i = strlen(a)-1; i >= 0; i--) c.d[c.len++] = a[i]-'0'; ret...
ALGO
0.999937
3.353549
4cf9a231-3b0f-48d2-b155-b2ebe1b8fe3e
M4MD24/Algorithms-and-Problem-Solving-Level-2-by-Programming-Advices
src/_3_problems_from_21_to_30/_3_10_problem_30/Problem30.cpp
#include <iostream> using namespace std; int readPositiveNumber() { int number; do { cout << "Enter positive number:" << endl; cin >> number; } while (number < 1); return number; } short randomNumber( const short FROM, const short TO ) { return rand() % (TO - FROM + 1) + FROM; ...
ALGO
0.892971
4.047106
2cd34b33-7406-4e75-be96-402b28dae7ea
david-ds/adventofcode-2020
day-01/part-2/skasch.cpp
#include <ctime> #include <iostream> #include <sstream> #include <stdexcept> #include <string> #include <unordered_set> static constexpr int kTargetSum = 2020; std::string run(const std::string& input) { // Your code goes here std::istringstream iss(input); std::unordered_set<int> values; for (std::string lin...
ALGO
0.998653
5.99546
119d5fe1-7c12-4501-8316-adc4dc70bf81
biswanaths/competition
cf/1060/b.cpp
#include <vector> #include <list> #include <map> #include <set> #include <queue> #include <deque> #include <stack> #include <bitset> #include <algorithm> #include <functional> #include <numeric> #include <utility> #include <sstream> #include <iostream> #include <iomanip> #include <cstdio> #include <cmath> #include <cst...
ALGO
0.999926
3.890161
4e8abaa4-e138-4bfc-9cb9-881fb2383405
ahao214/Algorithm
Ahao.LeetCodeCPP/971. 翻转二叉树以匹配先序遍历.cpp
#include<vector> using namespace std; /* 971. תƥ һöĸڵ root n ڵ㣬ÿڵ㶼һͬڵҴ 1 n ֵ֮ һ n ֵɵг voyage ʾ Ԥ Ķ ͨڵ ת öеڵ㡣תڵ 1 Ч£ 뷭ת нڵ㣬ʹ Ԥڵıг voyage ƥ ԣ򷵻 ת нڵֵб԰κ˳򷵻ش𰸡ܣ򷵻б [-1] */ struct TreeNode { int val; TreeNode* left; TreeNode* right; TreeNode() : val(0), left(nullptr), right(nullptr) {} TreeNode(int x) :...
ALGO
0.999988
5.249336
2e47812d-6391-45d7-a71b-b34f0cba4a01
roalgo-discord/arhiva-educationala
docs/codes/cppintro/basic_math/example1.cpp
#include <iostream> using namespace std; int main() { int a = 6, b = 8; cout << (a--) << '\n'; cout << (++b) + a << '\n'; cout << (--a) - (--b) << '\n'; cout << a << " " << b << '\n'; return 0; }
ALGO
0.978853
3.512215
da4556e8-1fdc-4bc5-b70a-5d5fd5ba46ff
satya117/DSA_CPP
STL/algo_sample.cpp
#include<iostream> #include<vector> #include<algorithm> using namespace std; int main(){ vector<int> v = {1,5,4,3,2,10,22}; cout<<"Elements are: "<<endl; for(auto i : v){ cout<<i<<" "; } cout<<endl; //use of sort function //original vector get sorted sort(v.begin(),v.end()); ...
ALGO
0.997756
4.13083
477c9f69-811f-48bb-af52-012ecadd6258
hekunlie/astrophy-research
galaxy-galaxy lensing/GGL_calculation/ggl_test.cpp
#include<FQlib.h> #include<mpi.h> #include<vector> #define foregal_data_col 5 #define backgal_data_col 17 #define g_num 100 #define mg_bin_num 12 /* area_id : argv[1] */ /* radius_id: argv[2] */ /* foreground data: argv[3] */ /* */ int main(int argc, char *argv[]) { int rank, numprocs, namelen; ...
DATA
0.997327
3.546686
e74a01a4-e0a6-4017-be5d-7c93602f2fd8
Alestaubin/Robotics_course_work
kinematic_controller/src/joint_kinematic_controller.cpp
#include <ros/ros.h> #include <sensor_msgs/JointState.h> #include <std_msgs/Bool.h> #include <std_srvs/Trigger.h> #include <Eigen/Dense> #include <math.h> #include <std_msgs/Float64MultiArray.h> #include <std_msgs/MultiArrayDimension.h> #include <std_msgs/MultiArrayLayout.h> class JSPlanner{ public: JSPlanner(ros:...
TOOL
0.866136
4.555928
f3570cbb-c8bd-4cde-834f-01d65d592289
UofT-EcoSystem/GPU-Virtualization-Benchmarks
benchmarks/DeepLearningExamples/PyTorch/Segmentation/MaskRCNN/pytorch/maskrcnn_benchmark/csrc/cpu/nms_cpu.cpp
template <typename scalar_t> at::Tensor nms_cpu_kernel(const at::Tensor& dets, const at::Tensor& scores, const float threshold) { AT_ASSERTM(!dets.type().is_cuda(), "dets must be a CPU tensor"); AT_ASSERTM(!scores.type().is_cuda(), "scores must be a CPU tensor"); ...
ALGO
0.986213
7.292679
74cc40c6-8376-4ec9-83f2-bc0e2ee376c6
bound1ess/timus-problemset
src/1910/code.cpp
#include <cstdio> const int N = 1000; int a[N], b[N]; int main() { //freopen("in.txt", "r", stdin); int n, max = 0, index = 0; scanf("%d", &n); for (int i = 0; i < n; ++i) { scanf("%d", a + i); } for (int i = 0; i < n - 2; ++i) { b[i] = a[i] + a[i + 1] + a[i + 2]; if (b[i] > max) { ma...
ALGO
0.999815
4.113634
2060914d-aab2-4a28-b751-e61ac1bcd7ab
jim-bug/school-coding
Cpp/esercizi classe/esercizio1.2(function).cpp
#include <iostream> using namespace std; int sum_prod(int, int); int main(){ // // https://ticoprof.wordpress.com/2020/09/24/esercizi-con-le-funzioni-in-cpp/ es 4 int a; int b; int result; cout << "Inserisci il valore di a: "; cin >> a; cout << "Inserisci il valore di b: "; cin >> b; ...
ALGO
0.99861
4.623602
21b447e3-5644-481d-a8e2-64b054e6ad8e
johngarrett/llvm-research
openmp/runtime/src/z_Windows_NT_util.cpp
/* * z_Windows_NT_util.cpp -- platform specific routines. */ #include "kmp.h" #include "kmp_affinity.h" #include "kmp_i18n.h" #include "kmp_io.h" #include "kmp_itt.h" #include "kmp_wait_release.h" /* This code is related to NtQuerySystemInformation() function. This function is used in the Load balance algorithm ...
TOOL
0.946731
4.081263
c0258d22-4a0e-44f6-b7a9-6f7205bdf1b2
vrushali06/LP3-SEM7
DAA/6.Quick sort-Random.cpp
#include <iostream> #include<cstdlib> #include<ctime> using namespace std; int partition(int arr[], int s, int e) { //step1: chooose pivotelement int randomindex = s+rand()%(e-s+1); int pivotElement = arr[randomindex]; swap(arr[s],arr[randomindex]); //step2: find right positio for pivot Element and place...
ALGO
0.999921
5.055893
8fca9c87-8272-484b-88a5-8a5f2aa4e9f4
kks227/BOJ
17900/17968.cpp
#include <cstdio> using namespace std; const int MAX = 1001; int main(){ int A[MAX] = {1, 1,}, N; scanf("%d", &N); for(int i = 2; i <= N; ++i){ bool flag[MAX*2] = {false,}; for(int k = 1; k*2 <= i; ++k){ int u = i - k, v = i - 2*k, x = A[u] - A[v], y = A[u] + x; if(y > 0) flag[y] = true; } for(int k =...
ALGO
0.999983
3.181238
8f5e0410-f9e9-4272-97fb-9a0524feffb8
DiegoDA04/CodeForces
A_Required_Remainder.cpp
#include<bits/stdc++.h> #define ll long long #define lli long long int #define vi vector<int> #define vll vector<long long> #define mpii map<int,int> #define si set<int> #define sll set<long long> using namespace std; void solve() { ll x, y, n; cin >> x >> y >> n; ll ans = n - n % x + y; if(ans ...
ALGO
0.999874
3.754371
e596bf22-78d0-4c13-ad10-f57ab5f82545
FlamingDev/Codigos-Matematica-Discreta-E-Logica
CH3/3.1/ex31.cpp
/****************************************************************************** Two strings are anagrams if each can be formed from the other string by rearranging its characters. Devise an algo rithm to determine whether two strings are anagrams ************************************************************************...
ALGO
0.999883
5.172072
e7c02d5d-90eb-41e2-b492-81b7f1e92e59
Hao-yu-lin/Leetcode
Graph/0841-Keys_and_Rooms.cpp
/* 題目: https://leetcode.com/problems/keys-and-rooms/ 解說: 使用 queue 紀錄手上持有的鑰匙,使用 visited 紀錄是否有拜訪過 有使用到的觀念: */ #include "../code_function.h" class Solution { public: bool canVisitAllRooms(vector<vector<int>>& rooms) { const int n = rooms.size(); vector<int> visited(n, 0); queue<int> ...
ALGO
0.999957
6.298674