uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
62547d6c-1367-4b13-bfdd-210b3aac79e2
alexandraback/datacollection
solutions_2453486_0/C++/jayi/A.cpp
/* * Filename: A.cpp * * Description: * * Version: 1.0 * Created: 04/13/2013 12:59:41 PM * Revision: none * Compiler: gcc * * Author: Hong Jinyi (hongjy), <EMAIL> * Organization: chinanetcenter */ #include <stdlib.h> #include <stdio.h> bool has4(char a[][5], int x, in...
ALGO
0.999919
4.775268
4a01bf95-188b-4739-b235-73f41fe0efe5
rajendrachy/OOPS-IN-2024-SEP
OPERATOR OVERLOADINGS/MANIPULATION OF STRING/manlength1.cpp
// __________String Length_____________ #include<iostream> #include<string> #include<conio.h> // About this header (conio.h) -> link -> https://chatgpt.com/share/671766bc-0154-800b-be52-3836704309ca using namespace std; int main (){ string s = "Some text"; int len = s.length(); cout << len; // 9 (output)...
ALGO
0.878844
3.167455
daafd6f3-78b4-4c00-9f08-bb2382b64d45
ishandutta2007/codeforces
ztxz16/normal/339/D.cpp
#include <stdio.h> #include <stdlib.h> #include <iostream> #include <algorithm> using namespace std; int n, N, m, i, x, y, op[1000005], a[1000005]; int Left[1000005], Right[1000005], Val[1000005]; void Make(int l, int r, int i); int Ask(int i, int x, int y); int main() { for (i = 2; i <= 1000000; (i <<= 1)) op[i...
ALGO
0.999992
4.388707
7782e922-90b0-43e2-8dd1-fe7f2dc98597
jporter0731/CS_300_James_Porter
Driver.cpp
#include "BinarySearchTree.h" #include "Course.h" #include <iostream> #include <conio.h> #include <fstream> void LoadData() { } //Driver class to run the program and get information int main() { //Instance variable used to run the program and functions below BinarySearchTree searchTree; int choice = 0; string se...
TOOL
0.957455
3.242354
f72d7997-13be-48b2-b238-6a8879d3cfe3
mxy9591528/Remote-link
2022_7_5.cpp
#include<iostream> #include<algorithm> #include<vector> #include<string> using namespace std; void test01() { vector<int>v; for (int i = 0; i < 10; i++) v.push_back(i); auto pos = find(v.begin(), v.end(), 5); if (pos != v.end()) cout << "ҵ:" << *pos << endl; else cout << "ûҵ" << endl; } class Person { public...
ALGO
0.992155
3.527305
c97a9626-4fe2-4558-99ff-c9be4c560337
Sudhir769/leetcode-solutions
350-intersection-of-two-arrays-ii/intersection-of-two-arrays-ii.cpp
class Solution { public: vector<int> intersect(vector<int>& nums1, vector<int>& nums2) { vector<int>ans; sort(nums1.begin(), nums1.end()); sort(nums2.begin(), nums2.end()); int n = nums1.size(), m = nums2.size(); int i=0, j=0; while(i < n and j < m){ ...
ALGO
0.999995
5.755956
43e717d6-47b9-40b4-8ecf-1d523673cad5
tahsinturag/Codeforces
A - Buy a Shovel.cpp
#include<bits/stdc++.h> using namespace std; int main() { int k,r; cin>>k>>r; int value=k; int count=1; int i=2; while(true){ if(value%10==0){ cout<<count<<endl; break; } else if(value%10==r){ cout<<count<<endl; break; } else{ value...
ALGO
0.999354
3.168849
820cfaf1-1029-47ba-af67-60f058b1645e
Arkum-Sheikh/Sorting-Algorithms
quicksort.cpp
#include <iostream> #include <chrono> #include <cstdlib> #include <ctime> using namespace std; using namespace std::chrono; 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++; sw...
ALGO
0.999078
6.339328
48f97ed4-5502-4d7a-8862-1c36774689ea
malvikpandey/CB_DSA
Strings/countPalindromicSubstring.cpp
#include<iostream> #include<cstring> using namespace std; int cPS(string str){ int count = 0; bool flag = false; int n = str.size(); for (int i = 0; i <= n - 1; i++) { for (int j = i; j <= n - 1; j++) { string subString = str.substr(i, j - i + 1); int k=0; int l=subSt...
ALGO
0.999958
4.055593
26f66e2d-dad3-44e3-a3f3-13e323c63db4
lawtonsclass/s23-code-from-class
csci40-in-person/lec26/bitwise.cpp
#include <iostream> using namespace std; // returns -n using two's complement int negate_2s_complement(int n) { return ~n + 1; } int main() { cout << (11 & 6) << endl; cout << (11 & 8) << endl; // because the result wasn't 0, bit 3 was set cout << endl; cout << (9 | 12) << endl; cout << (10 | 1) << endl...
ALGO
0.997646
6.068622
7c414aef-ac74-4476-9cf6-e8115cab5634
Ivanfangsc/OI
treap.cpp
#include <cstdio> #include <iostream> using namespace std; class treap { private: const int size = 100005; int root, l[size], r[size], val[size], dup[size], h[size], s = 0; int _find(const int root, const int k) { int c = 0, x = root; while(x != 0) if(val[x] <= k) { c = x; x = r[x]; ...
ALGO
0.999836
3.913747
081ce4ce-ef32-44ff-abfb-7c9bea514641
sunbines/log
boost/libs/exception/src/clone_current_exception_non_intrusive.cpp
//This MSVC-specific cpp file implements non-intrusive cloning of exception objects. //Based on an exception_ptr implementation by Anthony Williams. #ifdef BOOST_NO_EXCEPTIONS #error This file requires exception handling to be enabled. #endif #include <boost/config.hpp> #include <boost/exception/detail/clone_current_...
TOOL
0.881948
6.434059
1949d3fb-5958-40aa-898e-f90cdf29a45e
stephen-njiu/DSA_Analysis
matrix_class.cpp
#ifndef MATRIX_H #define MATRIX_H #include <iostream> #include <vector> using namespace std; template <typename object> class matrix { public: matrix(int rows, int cols) : array(rows) { for (auto & thisrow :array){ thisrow.resize(cols); } } matrix(vector<vector<object>> v)...
TOOL
0.887638
4.107055
e2e0d9c0-22bc-4a91-b9de-f3ed141498fb
mnkhmtv/HumanAI-Lab
venv/lib/python3.10/site-packages/sklearn/svm/src/liblinear/tron.cpp
#include <math.h> #include <stdio.h> #include <string.h> #include <stdarg.h> #include "tron.h" #ifndef min template <class T> static inline T min(T x,T y) { return (x<y)?x:y; } #endif #ifndef max template <class T> static inline T max(T x,T y) { return (x>y)?x:y; } #endif static void default_print(const char *buf) {...
ALGO
0.999496
5.847107
a6ab9748-2c48-4373-99dc-0bb0d60e05be
suhanikalra/practice-problems
0617-merge-two-binary-trees/0617-merge-two-binary-trees.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.99997
5.736844
bc3b32fe-498f-4180-b0b2-69ff18e1051d
ngocngoc0406/laptrinhCcongcong
bai 14.cpp
#include <iostream> using namespace std; int main() { int n, s = 0; cout << "Nhap so N = "; cin >> n; for(int i = 1; i <= n; i++) if(i % 2 != 0) s += i; cout << "Tong S = 1 + 3 + 5 + ... + N = " << s; return 0; }
ALGO
0.999726
3.61498
2d36d289-2a26-482a-924f-3771551e217a
anonys6/CSE202-CPP-Programs
2_check_triangle.cpp
#include <iostream> using namespace std; int main() { int a, b, c; cout << "Enter angles of triangle: "; cin >> a >> b >> c; if (a * a + b * b == c * c || a * a + c * c == b * b || b * b + c * c == a * a) cout << "Right Angle"; else cout << "Not Right Angle"; return 0; ...
ALGO
0.999303
4.168295
7e67cf62-7cba-428e-9726-9770aa53141c
Rakib-Mahmud/OOP
32.cpp
#include<bits/stdc++.h> using namespace std; double division(double x,double y) { if(y==0){ throw "Error msg"; } else {return x/y;} } int main() { double x,y,d; try{ cout<<"Enter divident(1st) and divisor "<<endl; cin>>x>>y; if(cin.fail()){ throw "Error Input"; ...
ALGO
0.975419
3.757153
66849bd5-3eca-4ff2-b2b3-0af3cdfaee78
arash16/prayers
UVA/vol-100/10082.cpp
/* >>~~ UVa Online Judge ACM Problem Solution ~~<< ID: 10082 Name: WERTYU Problem: https://onlinejudge.org/external/100/10082.pdf Language: C++ Author: Arash Shakery Email: <EMAIL> */ #include <stdio.h> #include <cstring> #include <iostream> using namespace std; char lines[] = "`1234567890-=\tqwertyui...
ALGO
0.996784
3.885066
a9821889-3132-4f24-88af-7ac90995c6aa
anujagrawal699/CSES-Solutions
Introductory_Problems/gray_code.cpp
#include <iostream> #include <string> #include <vector> using namespace std; vector<string> solve(int n) { if (n == 1) { return {"0", "1"}; } vector<string> prev = solve(n - 1); vector<string> res; for (int i = 0; i < prev.size(); i++) { res.push_back("0" + prev[i]); }...
ALGO
0.999979
4.68537
f7152f35-278d-4648-a5a1-defc4890e890
sinian666/code_86_8
cpp_副本16/chapter_searching/linear_search.cpp
/** * File: linear_search.cpp * Created Time: 2022-11-25 * Author: Krahets (<EMAIL>) */ #include "../utils/common.hpp" /* 线性查找(数组) */ int linearSearchArray(vector<int> &nums, int target) { // 遍历数组 for (int i = 0; i < nums.size(); i++) { // 找到目标元素,返回其索引 if (nums[i] == target) re...
ALGO
0.999669
5.586348
f18b07a9-6703-4d9c-bfb8-f8bfe58d183b
pjump3226/baekjoon
Q7662.cpp
#include <iostream> #include <map> using namespace std; int main() { long long t, k, num; char c; cin >> t; for (int i = 0; i < t; i++) { cin >> k; multimap<long long, bool> m; for (int j = 0; j < k; j++) { cin >> c >> num; if (c == 'I') m.insert(make_pair(num, 1)); else { if (!m.empty()) { ...
ALGO
0.998862
3.414258
426c3343-b863-46b9-a802-9b84bf164536
lavishmlk/My-leetcode-and-gfg-solutions-in-Cpp
Ancestors in Binary Tree - GFG/ancestors-in-binary-tree.cpp
// { Driver Code Starts #include<bits/stdc++.h> using namespace std; // Tree Node struct Node { int data; Node* left; Node* right; }; // Utility function to create a new Tree Node Node* newNode(int val) { Node* temp = new Node; temp->data = val; temp->left = NULL; temp->right = NULL; ...
ALGO
0.999789
6.271214
21013bf4-48e1-4297-aae4-2b6a7f3bf4b3
Sachin-Rawat07/LearningCplusplus
sets/uniqueElements.cpp
#include<bits/stdc++.h> using namespace std; int main(){ int n; cin>>n; vector<int> arr(n); for(int i=0;i<n;i++){ cin>>arr[i]; } unordered_set<int>s; for(auto i:arr){ s.insert(i); } cout<<s.size()<<endl; return 0; }
ALGO
0.999275
4.132679
63f3ac17-132f-4634-bcf2-e15820aee207
green-fox-academy/Gabor11
week-07/day-01/10.cpp
#include <iostream> #include <stdexcept> using namespace std; /** * Create a function that prints out the fist "N" positive odd numbers. * It should take the "N" number as a parameter, and print the output to the console. * * The output should look like this for 5 as parameter: * 1, 3, 5, 7, 9 * * Non-positiv...
ALGO
0.980591
6.623825
6aadf081-a0db-4d26-985c-e597f52e7461
ishandutta2007/codeforces
sdya/normal/504/A.cpp
#define _CRT_SECURE_NO_WARNINGS #include <iostream> #include <cstdio> #include <vector> #include <algorithm> #include <cstring> #include <string> #include <queue> #include <set> #include <map> #include <bitset> #include <cmath> #include <stack> #include <ctime> #include <unordered_map> #include <unordered_set> #include...
ALGO
0.999897
3.320036
e092708d-f95a-46f0-8e6d-194ed08b7426
Shashank01729/CodeStudio
sort01.cpp
#include<iostream> using namespace std; void PrintArray(int arr[],int n){ for(int i = 0; i < n; i++){ cout << arr[i] << " "; } cout << endl; } void SortOne(int arr[],int n){ int i=0,j=n-1; while(i<=j){ if(arr[i]==0){ i++; } if(arr[j]==1){ ...
ALGO
0.999979
4.682837
2725abcb-909d-487e-8363-4cc22acf7674
SamuelRoettgermann/TicTacToe
src/simulation.cpp
#include <iostream> #include <cstdint> #include <array> #include <utility> #include <format> #include "games/TicTacToe/game.hpp" #include "simulation.hpp" using std::uint16_t; namespace sim { Strategy::position Strategy::evaluate(uint16_t bitboard_white, uint16_t bitboard_black) { (void) bitboard_white;...
ALGO
0.999087
6.943953
92a7ec44-1b90-4a00-8067-d6f4f4a4b461
hasunghwa/algorithm
C/star17.cpp
#include <stdio.h> int main() { int N=0; scanf("%d", &N); for(int i=1; i<=N; i++){ for(int j=1; j<N+i; j++){ if(i+j>N){ if(N==i){ printf("*"); continue; } if((i+j==N+1||j==N+i-1)&&N!=i){ printf("*"); } else printf(" "); }else{ printf(" "); } } printf("\n"...
ALGO
0.999959
3.216765
2b23305a-326e-41c2-9d2a-8a11fc310767
mrcchef/CP
problems/Traffic_Network.cpp
//LinkedIn:https://www.linkedin.com/in/abhijeettamrakar/ //GitHub:https://github.com/mrcchef/ #include <bits/stdc++.h> using namespace std; #define fastio ios_base::sync_with_stdio(false); cin.tie(0) ; cout.tie(0); #ifndef ONLINE_JUDGE #define debug(x) cerr << #x <<" "; _print(x); cerr << endl; #else #define d...
ALGO
0.999661
4.68689
484855dc-bc4f-4642-ba74-15a65464c56d
SUFIAG/Implement-B-Plus-Tree-C-
insertion.cpp
#include <iostream> #include <fstream> #include <algorithm> #include <vector> #include "B+ Tree.h" using namespace std; void BPTree::insert(int key, FILE* filePtr) { //in Leaf Node /* 1. If the node has an empty space, insert the key/reference pair into the node. 2. If the node is already full, split it into...
ALGO
0.998473
3.371269
bfdcf4aa-f4d3-42c5-a5cd-d9cba420fe20
HeberIniguez/Actividades_Algoritmos-EstrucutradeDatos
recursividad_Fibonacci.cpp
#include<iostream> int fibonacci(int n){ if(n<2){ return n; } else{ return fibonacci(n-1) + fibonacci(n-2); } } int main(){ int numero; std::cout<<"Digite un numero: "; std::cin>>numero; std::cout<<"\nSerie Fibonacci del numero "<<numero<<" es: "; for(int i=0; i<=numero; i++){ std::cout<<fibonacc...
ALGO
0.99919
3.864813
25ae2743-4049-4888-a87c-2ea6a44fff31
Ayan645/DSA
graphTraversal6.cpp
#include <iostream> #include <cstdlib> #include <cstdio> #include <cstring> using namespace std; typedef struct Node { int data; struct Node *next; }NODE; class stack { int data[30]; int top; public: stack() { top=-1; } int empty() { if(top==-1) return 1; return 0; ...
ALGO
0.998381
3.903892
9d69f370-2537-4990-9757-96e76c5acd77
Afra-937-Biva/algorithm-c-
margesort.cpp
#include<iostream> using namespace std; #define lim 200 int temp[lim]; void Merge(int arr[],int l,int mid,int h) { int i,j,k=0; i=l; j=mid+1; while(i<=mid && j<=h) { if(arr[i]<arr[j]) { temp[k++]=arr[i++]; // i++; // k++; } else ...
ALGO
0.999957
4.338889
28f48904-0dfe-49b6-87fb-191be974be25
khushisinha20/Data-Structures-and-Algorithms
Strings/Knuth-Morris-Pratt-Algo/pattern_search.cpp
//leetcode.com/problems/implement-strstr #include <bits/stdc++.h> using namespace std; class Solution { public: vector<int> lpsArray(string& s) { vector<int> lps(s.length(), 0); int i = 1; int len = 0; while (i < s.length()) { if (s[i] == s[len]) { ++len...
ALGO
0.99996
6.146031
315e8977-b218-4ea2-9558-094a36a52302
Bibimotik/Study
4 semester/МатПрог/lab02/lab02.1/main.cpp
#include <iostream> #include <vector> using namespace std; void printSet(const vector<int>& set) { for (int num : set) { cout << num << " "; } cout << endl; } // Функция для генерации подмножеств void generateSubsets(const vector<int>& set, vector<int>& subset, int index) { // Выводим текущее...
ALGO
0.999575
5.29991
77bdcc1c-200c-4370-b49f-c50300e4e08d
Uzair-90/db-projects
tools/btree_bench/btree_bench.cpp
#include <chrono> #include <iostream> #include <memory> #include <mutex> // NOLINT #include <random> #include <sstream> #include <string> #include <thread> #include <vector> #include <cpp_random_distributions/zipfian_int_distribution.h> #include "argparse/argparse.hpp" #include "binder/binder.h" #include "buffer/buf...
TEST
0.927051
6.440714
0d532424-927d-4788-b313-5499de92bb97
matter-labs/compiler-llvm
clang-tools-extra/clang-tidy/ClangTidy.cpp
#include "ClangTidy.h" #include "ClangTidyCheck.h" #include "ClangTidyDiagnosticConsumer.h" #include "ClangTidyModuleRegistry.h" #include "ClangTidyProfiling.h" #include "ExpandModularHeadersPPCallbacks.h" #include "clang-tidy-config.h" #include "clang/AST/ASTConsumer.h" #include "clang/ASTMatchers/ASTMatchFinder.h" #i...
TOOL
0.912312
3.788866
f8ba77d0-2303-4589-bee6-444fdef5bb9e
oxygen-hunter/Flashboom
data/big-vul-100/add_attention_code/CodeLlama/top0-100/partition-array-into-two-arrays-to-minimize-sum-difference-Solution.minimumDifference/177771_nan.cpp
int dns_read_name(unsigned char *buffer, unsigned char *bufend, unsigned char *name, char *destination, int dest_len, int *offset) { int nb_bytes = 0, n = 0; int label_len; unsigned char *reader = name; char *dest = destination; while (1) { /* Name compression ...
ALGO
0.99854
4.842412
31aff205-0861-4901-ace7-e1df23682ae9
NipunRathore/GFGPracticeSolutions
Medium/Nuts and Bolts Problem/nuts-and-bolts-problem.cpp
//{ Driver Code Starts #include <bits/stdc++.h> using namespace std; // } Driver Code Ends // User function template for C++ class Solution { public: void matchPairs(int n, char nuts[], char bolts[]) { // code here sort(nuts, nuts + n) ; sort(bolts, bolts + n) ; } }; //{ Driver Cod...
ALGO
0.999731
5.242262
5f76cf0b-303b-4b1a-8fb1-eb4a6767c748
Jpduker/Cpp-Brushup
hello.cpp
#include <iostream> using namespace std; int sub(int a, int b) { return a - b; } int main() { int A; int B; string name = "j0"; cout << "Enter the first number:"; cin >> A; cout << "Enter the secod number:"; cin >> B; cout << "The subtraction is " << sub(A, B) << endl; cout << n...
ALGO
0.924571
3.318054
04623928-29fd-45a2-9848-6c0f68f87ea3
Kaulwarmythri/DSA
problems/merge_sorted_array/solution.cpp
class Solution { public: void merge(vector<int>& nums1, int m, vector<int>& nums2, int n) { int i=m-1, j=n-1,sum = m+n-1; while(j >=0){ nums1[sum--] = i>=0 && nums1[i] > nums2[j] ? nums1[i--] : nums2[j--]; } } };
ALGO
0.999965
5.418538
a2add299-5cc9-4195-9c6e-03eaf42d6024
Adiihub/DSA
01 - Array/4 - Strings/CB_BrokenKeys.cpp
#include <iostream> #include <set> using namespace std; int main() { string s; cin >> s; set<char> workingKeys; int n = s.length(); for (int i = 0; i < n; i++) { if (i < n - 1 && s[i] == s[i + 1]) { i++; // Skip the next character as it's part of a malfunctioning key ...
ALGO
0.999911
4.626273
8d3309f3-5166-4ef9-a7d3-c2975b0edff1
makio93/competitive-atcoder
abc312/abc312_g/main1.cpp
// 解説AC #include <bits/stdc++.h> #include <atcoder/all> using namespace std; using namespace atcoder; using ll = long long; #define rep(i, n) for (int i=0; i<(int)(n); ++(i)) #define rep3(i, m, n) for (int i=(m); (i)<(int)(n); ++(i)) #define repr(i, n) for (int i=(int)(n)-1; (i)>=0; --(i)) #define rep3r(i, m, n) for...
ALGO
0.999828
4.504417
f0096603-f872-488c-bc51-1e3437a98959
techlism/LeetCode-Solutions
0149-max-points-on-a-line/0149-max-points-on-a-line.cpp
class Solution { public: int maxPoints(vector<vector<int>>& points) { if (points.size() <= 2) return points.size(); int maxPoints = 2; for (int i = 0; i < points.size() - 1; i++) { auto p = points[i]; unordered_map<double, int> slopeCount; int sam...
ALGO
0.999974
6.539135
e98070d4-33ce-4c01-9cc5-0598ab497210
rhs99/cp_templates
tri.cpp
#include<bits/stdc++.h> using namespace std; #define ll long long #define pii pair<ll,ll> #define p 101 #define p2 31 #define MOD 1000000007 #define MOD2 1000000009 #define MX 100001 string str; int n; ll arr[MX]; unsigned long long int power[MX],power2[MX],prefix[MX],prefix2[MX]; unsigned long long int modPow(unsig...
ALGO
0.999929
4.587073
b224df6d-9845-40dd-b5c8-f594008ad6ba
ucsb-cs24-w23/cs24-w23-lectures
lect16/queue/bst.cpp
// BST.cpp // Modified version of lab04 starter code for demo purposes #include <iostream> #include <queue> #include "bst.h" using std::cout; // constructor sets up empty tree BST::BST() : root(nullptr) { } // destructor deletes all nodes BST::~BST() { clear(root); } void BST::preorderInsert(Node *r){ if(!r)...
ALGO
0.994995
5.2804
8f7fb2f1-6b5e-4832-aaa0-a90951cba8f4
sagarchapara/cp
a2oj/1700+/494b.cpp
// g++ -o out <filename>.cpp // .\out.exe #define SAGAR #include <bits/stdc++.h> using namespace std; template<typename A, typename B> ostream& operator<<(ostream &os, const pair<A, B> &p) { return os << p.first << " " << p.second ;} template<typename T_container, typename T = ty...
ALGO
0.999914
4.480685
aecc41e7-7d3d-4f8c-bdb7-ba351b2c7f0d
Shrey-Dubey-25/Leetcode
numberofcoinsgfg.cpp
#include<iostream> #include<vector> #include<bits/stdc++.h> using namespace std; int helper(int arr[],int n,int v,int i){ int step=0; int cl=v; while(i<n || v<0){ if(v==0){ return step; } if(arr[i]<=v){ step+=v/arr[i]; v=v%arr[i]; } ...
ALGO
0.999993
4.77767
64a331fa-fa8c-47d2-a86a-f6ea115ec392
UtkarshTrivedi2934/LoveBabbar450
Sort by Set Bit Count.cpp
//{ Driver Code Starts #include <bits/stdc++.h> using namespace std; class Solution { public: static bool comp(int a, int b) { // __builtin_popcount - Counts set bits of a given number return __builtin_popcount(a) > __builtin_popcount(b); } void sortBySetBitCount(int arr[], int n) {...
ALGO
0.999955
6.070178
5f43a0c9-13c1-42eb-a16d-267ef98992bd
chauhansatyam3112/Codeforces-Problems-
adda1.cpp
int getMaximumPower(int arr[], int power[], int n, int k) { int p = k / 2; int maxpower = 0; for (int i = 0; i < p; i++) { int power1 = 0; int j = power[i]; int m = power[k - i - 1]; for (int r = j; r < m + 1; r++) { maxpower += arr[r]; } ...
ALGO
0.999977
4.669481
d7fe1c9a-2e61-4143-9583-fb868d160693
Eaglebrave/the-C-repository
整数中数的个数.cpp
#include <bits/stdc++.h> using namespace std; int main() {int a[100],m,n,flag=0,i; cin>>n; for(i=0;i<n;i++) cin>>a[i]; cin>>m; for(i=0;i<n;i++) {if(a[i]==m)flag++; } cout<<flag; return 0; }
ALGO
0.999845
3.398225
a31139d0-54a6-4b54-a55e-8ba869316801
ishandutta2007/codeforces
aarr/normal/230/A.cpp
#include <iostream> #include <algorithm> #include <set> #include <iomanip> #include <vector> #include <cmath> using namespace std; const int N = 100 * 1000 + 5; pair<int, int> a[N]; int get(int x, int y) { return (x >> y) & 1; } bool pal(string s) { for (int i = 0; i < s.size(); i++) { if (s[i] != s[s.size() ...
ALGO
0.99995
3.60627
37b7c335-15eb-4f3a-ad8c-b641c5819a07
hgeorge21/Physical_Animation
libigl/tutorial/303_LaplaceEquation/main.cpp
#include <igl/boundary_facets.h> #include <igl/colon.h> #include <igl/cotmatrix.h> #include <igl/jet.h> #include <igl/min_quad_with_fixed.h> #include <igl/readOFF.h> #include <igl/setdiff.h> #include <igl/slice.h> #include <igl/slice_into.h> #include <igl/unique.h> #include <igl/opengl/glfw/Viewer.h> #include <Eigen/Sp...
ALGO
0.998694
6.359447
3072c907-d5b9-413e-97f2-145e6d2a734b
tsnguyen/Algorithms
algo1/kruskal/heap.cpp
#include "heap.h" Heap::Heap(unsigned key, unsigned width){ mKey = key; mWidth = width; mHeapData.clear(); std::vector<long> v(mWidth, 0); mHeapData.push_back(v); // the zeroth element is for place - holder only } void Heap::BubbleUp(unsigned index){ unsigned child = index, parent = child/2...
ALGO
0.999276
4.888914
313cac00-128e-44be-a4ff-8696a4993a0e
HCaelrs/NeRF-DetS
mmdet3d/mmcv/ops/csrc/onnxruntime/cpu/roi_align_rotated.cpp
#include "../ort_mmcv_utils.h" struct PreCalc { int pos1; int pos2; int pos3; int pos4; float w1; float w2; float w3; float w4; }; void pre_calc_for_bilinear_interpolate( const int height, const int width, const int pooled_height, const int pooled_width, const int iy_upper, const int ix_upper,...
DATA
0.994302
7.152699
89c492fa-7d6e-4ef7-89b4-8284139099db
AnujSinghal21/cses-solutions
P3_Dynamic_Programming/Q064_Edit_Distance.cpp
// Question: https://codeforces.com/problemset/problem/33/A #ifdef LOCAL #include "./lib/cpmlib.hpp" // #define MULTIPLE_TESTS #define USE_LL //#define INTERACTIVE //#define BUILD_SIMPLE #endif int solve(int testCaseNumber){ int n, x, k; string s1, s2; cin >> s1 >> s2; n = s1.size(); int m = s2.siz...
ALGO
0.999977
5.006528
f0ec5f74-6c3d-4218-bfab-aeb1a2a9154d
Hemant-Stellar/CP_SELF_PRACTICE
Graph/GFG No. of good components.cpp
#pragma GCC optimize("Ofast") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,fma") #pragma GCC optimize("unroll-loops") #include <bits/stdc++.h> #include <complex> #include <queue> #include <set> #include <unordered_set> #include <list> #include <chrono> #include <random> #include <iostream> #incl...
ALGO
0.999986
5.064599
943c8e17-53cc-426f-8114-8bafbadf0a8a
ilie1988/work
tests/core_tests/block_reward.cpp
#include "chaingen.h" #include "block_reward.h" using namespace epee; using namespace cryptonote; namespace { bool construct_miner_tx_by_weight(transaction& miner_tx, uint64_t height, uint64_t already_generated_coins, const account_public_address& miner_address, std::vector<size_t>& block_weights, size_t target...
TEST
0.949409
6.648396
d808ec63-9f70-4969-9dfe-2d81e7ada8f8
aparadoxicalglitch/Codes
0.Hackerrank/30-Days of code/Day6/drawingbook.cpp
#include<iostream> using namespace std; int main(){ int n,p,front,back; cout<<"Enter the number of pages : "; cin>>n; cout<<"Enter the page number you want to go to : "; cin>>p; front = p/2; back = n/2-p/2; if(front<back) { cout<<"You will have to turn "<<front<<" pages from...
ALGO
0.995088
3.574518
e9f3d74d-807d-4639-bdce-d24c0f618d72
yaoyuannnn/cava
cam_vision_pipe/src/nnet_lib/third_party/eigen/doc/examples/TutorialLinAlgSelfAdjointEigenSolver.cpp
#include <iostream> #include <Eigen/Dense> using namespace std; using namespace Eigen; int main() { Matrix2f A; A << 1, 2, 2, 3; cout << "Here is the matrix A:\n" << A << endl; SelfAdjointEigenSolver<Matrix2f> eigensolver(A); if (eigensolver.info() != Success) abort(); cout << "The eigenvalues of A ...
ALGO
0.997884
3.846247
6914c4d0-0e43-4a5b-a1e0-76f69389eafb
MagneticMartian/BlockChainExample
Block.cpp
#include "Block.h" #include "sha256.h" /* Initializing the block. The values for nIndexIn and sDataIn * are stored into _nIndex and _sData respectively. */ Block::Block(uint32_t nIndexIn, const string &sDataIn): _nIndex(nIndexIn), _sData(sDataIn) { _nNonce = -1; /* That magical number */ _tTime = time(nullpt...
ALGO
0.993488
5.375505
4008811a-1471-48d8-a3de-16dca7f12416
chancesmith/WGU_C867_Lessons
3-2-Assignments/3-2-5_Variable-assignments.cpp
#include <iostream> using namespace std; int main() { int w = -2; int x = -7; int y = -8; int z; z = x - y; z = z * w; z = z / w; cout << z << endl; }
ALGO
0.997534
3.210933
57a36914-0028-4cba-bbc1-e034f0d7f2f6
Papaniyachirag/Program
LIST_2/p-2-5.cpp
#include<iostream> #include<iomanip> using namespace std; int main() { // function setw & endl float m = 3.14567; cout<<"Papaniya chirag"<<endl; cout<<"220130318059"<<endl; cout<<"---------------------"<<endl; //cout<<"The Value of A is ::"<<m; cout<<"This is for function setprecision : "<<setprecision(3)<<m...
TOOL
0.987409
3.231676
c7c63bac-1908-4e20-9a2f-e5ee91797a09
Mohamed-Elhabashy/Leetcode
1514-path-with-maximum-probability/1514-path-with-maximum-probability.cpp
class Solution { public: vector<pair<int,double>>adj[10000+2]; double probability[10002]; double maxProbability(int n, vector<vector<int>>& edges, vector<double>& succProb, int start, int end) { for(int i=0;i<edges.size();i++){ int u=edges[i][0],v=edges[i][1]; double c=succPr...
ALGO
0.999949
4.984762
f32c0a0b-d118-4753-b43a-d68b58542471
Chandra-Atul/StriverSDEChallenge
Day1/Pascal's Triangle.cpp
#include <bits/stdc++.h> using namespace std; vector<vector<long long int>> printPascal(int n) { // Write your code here. vector<vector<long long> > ans; vector<long long>prev; prev.push_back(1); ans.push_back(prev); for(int k=2;k<=n;k++){ vector<long long>temp; temp.push_back(prev[0]); for(...
ALGO
0.999981
4.442757
754fc65d-f775-4e86-9d64-bf114390f072
mzun/adventofcode
puzzle5/main.cpp
#include <iostream> #include "md5.h" #include <cstdio> using std::cout; using std::endl; int getCipherCnt(int nb) { int res = 0; while (nb%10 || nb) { ++res; nb/=10; } return res; } bool checkIfZerosString(const char* val, int len) { for (int i = 0; i<len; ++i) { ...
ALGO
0.992336
4.153916
c4950f82-b8e7-4f90-af1b-539e41c02ea3
masoudbehzadinasab/Trilinos_12_11
packages/sacado/src/Sacado_radops2.cpp
// Support routines for Hessian-vector products via the RAD package // (Reverse Automatic Differentiation) -- a package specialized for // function and gradient evaluations, and herewith extended for Hessian- // vector products. This specialization is for several Hessian-vector // products at one point, where the vect...
TOOL
0.918979
4.509171
3672ffec-88b6-4f83-a9a5-c96f27ba9d47
THU-DSP-LAB/llvm-project
llvm/lib/CodeGen/MachineDominanceFrontier.cpp
#include "llvm/CodeGen/MachineDominanceFrontier.h" #include "llvm/CodeGen/MachineDominators.h" #include "llvm/CodeGen/Passes.h" #include "llvm/InitializePasses.h" #include "llvm/Pass.h" #include "llvm/PassRegistry.h" using namespace llvm; namespace llvm { template class DominanceFrontierBase<MachineBasicBlock, false>...
ALGO
0.994365
7.47855
46bd6612-0657-4fbd-834c-b908ebc261a4
anthony-chaudhary/self-driving-car-nanodegree-nd013
p10-model-predictive-control/src/Eigen-3.3/doc/examples/tut_arithmetic_redux_basic.cpp
#include <iostream> #include <Eigen/Dense> using namespace std; int main() { Eigen::Matrix2d mat; mat << 1, 2, 3, 4; cout << "Here is mat.sum(): " << mat.sum() << endl; cout << "Here is mat.prod(): " << mat.prod() << endl; cout << "Here is mat.mean(): " << mat.mean() ...
ALGO
0.996636
3.872858
7a2df876-3885-4259-b36a-84dd1690846a
daemonX10/DSA
CodeChef/Basic Array/little_chefAndSum.cpp
#include <iostream> #include <vector> using namespace std; int main(){ int testcase; cin>>testcase; for(int i=0;i<testcase;i++) { int size_of_input,digit_sum=0,max_for_comparing; cin>>size_of_input; int arr[size_of_input]; int prefix_sum[size_of_input]; int sum[s...
ALGO
0.999962
4.341523
05398c30-44bb-4e98-9fd2-38829dce61b6
giovanni1351/OpenCVOpenGL02
OpenCV4-6/sources/3rdparty/openexr/IlmImf/ImfRle.cpp
#include <string.h> #include "ImfRle.h" #include "ImfNamespace.h" OPENEXR_IMF_INTERNAL_NAMESPACE_SOURCE_ENTER namespace { const int MIN_RUN_LENGTH = 3; const int MAX_RUN_LENGTH = 127; } // // Compress an array of bytes, using run-length encoding, // and return the length of the compressed data. // int rleCompress...
ALGO
0.993972
5.188163
3350316e-9b38-48b8-91d9-bec4b0e6e0a6
rsr180004/BRLCAD-UAT
brl-cad/brlcad/src/other/ext/gdal/alg/gdalproximity.cpp
#include "cpl_port.h" #include "gdal_alg.h" #include <cmath> #include <cstdlib> #include <algorithm> #include "cpl_conv.h" #include "cpl_error.h" #include "cpl_progress.h" #include "cpl_string.h" #include "cpl_vsi.h" #include "gdal.h" CPL_CVSID("$Id$") static CPLErr ProcessProximityLine(GInt32 *panSrcScanline, int...
ALGO
0.995515
6.937477
5d275c7c-fe56-402b-a818-b6e9561fefd9
kevinsu628/simon-xwindow
a1.cpp
#include <unistd.h> #include <stdlib.h> #include <cstdlib> #include <iostream> #include <vector> #include <math.h> #include <X11/X.h> #include <X11/Intrinsic.h> #include <X11/StringDefs.h> #include <X11/Xutil.h> #include <X11/Shell.h> #include <X11/Xlib.h> #include <sys/time.h> #define PI 3.14159265 using namespace st...
ALGO
0.886093
3.332217
9e8012f2-d8da-4a01-8d51-3f32e8239a2e
pigalsofine/llvm
lib/Transforms/Scalar/SpeculateAroundPHIs.cpp
#include "llvm/Transforms/Scalar/SpeculateAroundPHIs.h" #include "llvm/ADT/PostOrderIterator.h" #include "llvm/ADT/Sequence.h" #include "llvm/ADT/SetVector.h" #include "llvm/ADT/Statistic.h" #include "llvm/Analysis/TargetTransformInfo.h" #include "llvm/Analysis/ValueTracking.h" #include "llvm/IR/BasicBlock.h" #include ...
ALGO
0.975617
7.883502
c0be9452-8e42-4ab2-a81a-25b0400fef20
redoy1102/Phitron-CP-Course
3 - Basic Data Structure/Week-3/Module-10/_6_Element Access/_2_front.cpp
#include<bits/stdc++.h> using namespace std; void print(list<int> n) { for(int i: n){ cout << i << " "; } } void solve(){ list<int> n; int s; cin>>s; while(s--){ int v; cin >> v; n.push_back(v); } int head = n.front(); cout << head << endl; } int main...
ALGO
0.998783
3.477273
711b0e57-c167-435d-98eb-f0f2a4e48b59
zuselegacy/leetcode
recursion_backtracking/46-permutations.cpp
class Solution { public: vector<vector<int>> soln; bool validChoice(int num,const vector<int>& perm) { for(int i=0;i<perm.size();i++) { if(perm[i] == num) return false; } return true; } void generate(vector<int>& nums,vector<int>& perm) { if(pe...
ALGO
0.999993
6.223523
44e2287c-f6c1-43a7-8e34-83ee0aa2245d
AbdullahAmir06/PD-5
Task4.cpp
#include<iostream> #include<string> using namespace std; int main() // // { // // string dep; // // int year,rollno; // // cout<<"Enter your rollno: "; // // cin>>rollno; // // cout<<"Enter your year: "; // // cin>>year; // // cout<<"Enter your department: "; // // cin>>dep; // // i...
ALGO
0.861962
4.119161
959bf75a-4b75-41fa-bfc1-2defa400caa5
IvyLH03/algo-contest-archive
contest-algo-archive/lg/1219.cpp
#include<cstdio> using namespace std; int n,a[14],tot; bool b[14],c[26],d[26]; int print(); int search(int t) { int i; for(i=1;i<=n;i++) { if((!b[i])&&(!c[i+t])&&(!d[i-t+n/2])) { a[t]=i;b[i]=1;c[i+t]=1;d[i-t+n/2]=1; if(t==n)print(); else search(t+1); a[t]=0;b[i]=0;c[i+t]=0;d[i-t+n/2]=0; } } } int ...
ALGO
0.999973
3.056691
71fdbf1b-762b-429e-9d0e-d5ec0f92c674
renhaofan/Source-Archive
OpenCV/opencv-4.5.2/modules/core/src/split.dispatch.cpp
#include "precomp.hpp" #include "opencl_kernels_core.hpp" #include "split.simd.hpp" #include "split.simd_declarations.hpp" // defines CV_CPU_DISPATCH_MODES_ALL=AVX2,...,BASELINE based on CMakeLists.txt content namespace cv { namespace hal { void split8u(const uchar* src, uchar** dst, int len, int cn ) { CV_INSTR...
TOOL
0.97636
6.685225
2058fe6a-44fe-4666-8c4d-ea70751b74cb
Roopam-mishra/CPP_Algorithms_and_Problems
Algorithm/GRAPHS/Shortest_Path_algorithms/Dijkstra(naive_ForDenseGraphs).cpp
/* Roopam Mishra RESOURCES: https://cp-algorithms.com/graph/dijkstra.html https://www.geeksforgeeks.org/dijkstras-shortest-path-algorithm-greedy-algo-7/ https://www.youtube.com/watch?v=XB4MIexjvY0&vl=en */ ********************************************************************************...
ALGO
0.999995
4.602627
e5a61ebc-2400-4de0-b8df-0b69f37c3c33
virtualsecureplatform/llvm-rv16k
llvm/lib/Analysis/DivergenceAnalysis.cpp
#include "llvm/Analysis/DivergenceAnalysis.h" #include "llvm/Analysis/LoopInfo.h" #include "llvm/Analysis/Passes.h" #include "llvm/Analysis/PostDominators.h" #include "llvm/Analysis/TargetTransformInfo.h" #include "llvm/IR/Dominators.h" #include "llvm/IR/InstIterator.h" #include "llvm/IR/Instructions.h" #include "llvm/...
ALGO
0.971306
7.782836
09aee4e8-7c01-4863-ad15-0c218f34bb1d
237K/ProblemSolving
SAMSUNG_SWEA#9280.cpp
// // OS Windows // 2020.01.28 // // [Algorithm Problem Solving] // // SAMSUNG SW Expert Academy <#9280> (D3) ̳ Ÿ // #define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <memory.h> #include <queue> using namespace std; #define MAX_PARKING 101 #define MAX_CAR 2001 static int parkingfee[MAX_PARKING], parkinglot[MA...
ALGO
0.998175
3.326475
8e03c435-6200-4837-a175-409556f23b65
VarickQ/ACM
HaveDone/UVa/最长回文子串UVa12378.cpp
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> #include <queue> #include <vector> #include <string> #include <iostream> #include <algorithm> using namespace std; #define CLR(arr,val) memset(arr,val,sizeof(arr)); const int N=300010; int n, p[N]; char s[N], str[N], ss[N]; #define _min(x, y...
ALGO
0.999586
4.236786
af1cedaa-6eb9-4dfb-a92b-d192c73e2303
tridibsamanta/Data-Structures-and-Algorithms
Strings/LongestSubstringWithoutRepeatingCharacters.cpp
/** * Title : Longest Substring Without Repeating Characters * Author : Tridib Samanta **/ #include<bits/stdc++.h> using namespace std; #define ALL_CHARS 256 int findLength(string s) { vector<int> lastIndex(ALL_CHARS, -1); int maxLength = 0, start = 0; for (int j = 0; j < s.size(); ++j) { ...
ALGO
0.999931
5.204329
0dc6a705-1e97-416b-92dd-587927df1fcd
Raajzz/leetcode-dsa
dijkstras-shortest-path-algorithm/dijkstras-shortest-path-algorithm.cpp
class comparator{ public: bool operator()(const vector<int> &a, const vector<int> &b){ return a[1] >= b[1]; } }; class Solution { public: //Function to find the shortest distance of all the vertices //from the source vertex S. vector <int> dijkstra(int V, vector<vector<int>> adj[], int S)...
ALGO
0.999937
5.124025
c43f7184-8bf8-4f74-a25a-ddb4d7e98216
skjmp/ProCon
ABC/130/d.cpp
#include <bits/stdc++.h> long long syakutori(const std::vector<long long> &A, std::function<bool(int)> cond) { // 尺取り法の実装例。 https://atcoder.jp/contests/abc130/tasks/abc130_d // Aの連続する部分列で、和がcondを満たすような区間[s, t)の数を数える。 // なお仮定として「Ai>=0であり、区間の和は区間の始点を決めた時単調増加」を置いている。 // O(N) long long ans = 0...
ALGO
0.999913
5.482544
58dd5f41-dc71-49e5-b949-d45f4718a2b5
li924579/ACM
2015暑假集训/DAY-4/I.cpp
const double eps=1e-9; const double pi=acos(-1); typedef long long ll; using namespace std; map<string,int> arrl; map<string,int> arrv; int get_num(string s){ int sum=0; for (int i=0;s[i];i++){ sum=sum*10+s[i]-'0'; } return sum; } int get_arrv(string s){ int flag=0; for (int i=0;s[i];i++) if (isplpha(s[i])...
ALGO
0.959812
3.277392
786047d3-4c8c-45f9-8e07-059036523b4c
divyasingh23499/DSA-450-Solved-Question
ARRAY/4_sortArrayContaining0_1_2.cpp
/* Put all your eggs in one basket Author : Divya Singh */ #include<bits/stdc++.h> using namespace std; #define int long long int #define fast ios_base::sync_with_stdio(false); cin.tie(NULL); //O(N * logN) void sortArrayContaining_0_1_2_Method1(int arr[] , int sizeOfArray) { sort(arr , arr + sizeOfArray)...
ALGO
0.999943
4.517962
f5645f44-d0c2-4df4-9fd0-f5a9cb9558a9
masatoi/cl-libworld
lib/World/src/synthesis.cpp
#include <math.h> #include "world/common.h" #include "world/constantnumbers.h" #include "world/matlabfunctions.h" namespace { static void GetNoiseSpectrum(int noise_size, int fft_size, const ForwardRealFFT *forward_real_fft) { double average = 0.0; for (int i = 0; i < noise_size; ++i) { forward_real_fft-...
ALGO
0.992872
5.940219
5db049e4-2561-43b2-bd4a-716465fba014
Superlee506/Correlation_Filtering_Tracking_Lib
src/3rdparty/piotr/src/gradientMex.cpp
#include "gradientMex.hpp" #include <math.h> #include "string.h" #include "sse.hpp" #include <iostream> #define PI 3.14159265f namespace piotr { // compute x and y gradients for just one column (uses sse) void grad1(float *I, float *Gx, float *Gy, int h, int w, int x) { int y, y1; float *Ip, *In, r; _...
ALGO
0.999808
6.476702
17f7c837-adfc-4179-bee6-8a911c374a9f
ykagano/atcoder
IronRulesOfCompetitiveProgramming/a56.cpp
#include <iostream> using namespace std; long long N, Q; string S; long long a[200009], b[200009], c[200009], d[200009]; // ハッシュ値を計算するための変数 long long mod = 2147483647; long long T[200009], H[200009]; long long Power100[200009]; // S[l, r] のハッシュ値を返す関数 // 余りの計算に注意!(5.3節) long long Hash_value(int l, int r) { long l...
ALGO
0.999863
4.73571
b2151dc0-4dea-422a-9956-ca47500614d5
nmaxwell/research_old
nu_diff/nu_reg_diff/code/test.cpp
#include <mathlib/math/std_math.h> #include <mathlib/math/kernels/FDkernels.h> #include <mathlib/math/hdaf/hdaf.h> #include <mathlib/math/transforms/FFT.h> #include <mathlib/math/random/ml_random.h> #include <mathlib/link.cpp> #include <mathlib/non-lib_things.h> int main() { int n = 16; double a = 0.0; ...
ALGO
0.999716
4.043788
9ac196ca-d72c-445c-b8b0-b368d0f4b20c
khanfar/ft8_lib
ft8/v1/encode.cpp
#include "encode.h" // Define the LDPC sizes constexpr int N = 174; // Number of bits in the encoded message constexpr int K = 87; // Number of payload bits constexpr int M = N - K; // Number of checksum bits constexpr uint16_t POLYNOMIAL = 0xC06; // CRC-12 polynomial without the leading (...
ALGO
0.998293
6.369393
e47daa8c-d453-40a5-9de8-10b7ae3c8494
Jirachotsaonram/Structure-Programming-LAB
Lap6/6706021411288test2.cpp
#include <iostream> #include <iomanip> #include <cstdlib> using namespace std; int main() { srand(time(0)); int num_candidates; int total_students = 500; int total_votes = rand()%500+1; int total = total_votes; int not_votes; int votes[100]; float percent[100]; cout << "Enter num...
ALGO
0.995908
4.627425
0781581a-a66c-4332-88a1-5da5da3af7aa
HONGYANGGAN/leetcode
solution/0700-0799/0790.Domino and Tromino Tiling/Solution.cpp
class Solution { public: const int mod = 1e9 + 7; int numTilings(int n) { long f[4] = {1, 0, 0, 0}; for (int i = 1; i <= n; ++i) { long g[4] = {0, 0, 0, 0}; g[0] = (f[0] + f[1] + f[2] + f[3]) % mod; g[1] = (f[2] + f[3]) % mod; g[2] = (f[1] + f[3])...
ALGO
0.999991
5.822878
9e68f7aa-8510-48e9-88cb-d257f14537bb
ishandutta2007/codeforces
sandytea/normal/108/A.cpp
//program 108A #include<iostream> #include<cstdio> #include<cstdlib> #include<cstring> #include<algorithm> using namespace std; int main() { int HH,MM;char T;cin>>HH>>T>>MM; while(MM++,HH+=MM/60,MM%=60,HH%=24,HH!=(MM%10)*10+MM/10); cout<<HH/10<<HH%10<<':'<<MM/10<<MM%10<<endl; return 0; }
ALGO
0.998153
3.156685
1a1966b0-7640-4d1b-9bbf-33e8214eb44d
SurajWarrier/cses-problem-set
src/josephus-prob-1.cpp
#include<bits/stdc++.h> using namespace std; #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; #define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> int main() { int n; cin>>n; int k=1; ordered_set s; for(int ...
ALGO
0.999932
3.46543
7e52dd17-4e78-4b42-b3f1-8e57fca36b3d
Keshav005Jhalani/Leetcode
2471-minimum-amount-of-time-to-collect-garbage/2471-minimum-amount-of-time-to-collect-garbage.cpp
class Solution { public: int garbageCollection(vector<string>& garbage, vector<int>& travel) { int pickP=0; int travelP=0; int lastHouseP=0; int pickG=0; int travelG=0; int lastHouseG=0; int pickM=0; int travelM=0; int lastHouseM=0; for...
ALGO
0.999696
5.541785
d9fc9a1b-2136-417f-b697-81f3fcdec790
mxiaole/algorithm
贪心算法/02-摇摆序列.cpp
// // Created by mengjiale on 2018/5/15. // #include <iostream> #include <vector> class Solution { public: /** * 使用状态机解决该问题 * @param num * @return */ int wiggleMaxLength(std::vector<int> &num) { // 初始的时候定义三个状态 static const int BEGIN = 0; static const int UP = 1;...
ALGO
0.999985
5.515831