uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
0642bba3-98cf-4342-bbf4-8ce583e3c966
Den-Git-CPP/OTUS-CPP-Professional-HomeWork_2
main_IPFilter.cpp
#include <iostream> #include "IPFilter.h" int main() { IPFilter* IP_Filter_1 = nullptr; IP_Filter_1 = new IPFilter("ip_filter.tsv"); IP_Filter_1->sort_greater(); IP_Filter_1->print_all_elem(); IP_Filter_1->subsequent_filter(1); IP_Filter_1->subsequent_filter(46, 70); IP_Filter_1->any_filter(46); delete IP_F...
TOOL
0.940141
3.323684
852a37d9-8774-4cf3-852a-b61f2876a77c
anindya028/Programming-Contest-Problems
UVa/v117/11713.cpp
#include<stdio.h> #include<string.h> bool isvow(char a) { return (a=='a' || a=='e' || a=='i' || a=='o' || a=='u'); } int main() { int t,i; char s1[30],s2[30]; scanf("%d",&t); while(t--) { scanf("%s%s",s1,s2); if(strlen(s1)==strlen(s2)) { int ok=1; for(i=0;s1[i];i++) { if(isvow(s1[i]) && isvow...
ALGO
0.999957
3.989573
2ed87a39-e9b1-4bb0-8767-0485278804cc
Chethan-L701/cpp-prog
src/prog35.cpp
//prog35.cpp //Program to Find Number of Vowels, Consonants, Digits, Spaces in String #include <iostream> #include <cstring> #include <cctype> using namespace std; int main(){ char str[100]; cout<<"Enter the string : "; fgets(str,100,stdin); int ns=0,nv=0,nc=0,nd=0; for(int i=0;i<strlen(str);i++){ if(isalpha(s...
ALGO
0.946814
3.041717
206797dd-26eb-4c7b-81ab-04c4e71590a9
Jitendrakr132/Assignment-35
find large three number.cpp
#include<iostream> using namespace std; /*template<class t1,class t2,class t3,class t4> class Max { public: t1 x; t2 y; t3 z; t4 Large() { if(x>y && x>z) return x; else if (y>z&& x<y) return y; else return z; } }; int main() { Max<...
ALGO
0.99969
3.651883
625588fb-e3c8-4080-bbcf-80c0046d47a8
jaiswalatul/babbar_sheet
stack_&queue/stack_permutation.cpp
//{ Driver Code Starts //Initial Template for C++ #include <bits/stdc++.h> using namespace std; // } Driver Code Ends //User function Template for C++ class Solution{ public: int isStackPermutation(int n,vector<int> &a,vector<int> &b){ stack<int>s; int i=0; int j=0; ...
ALGO
0.999862
5.462288
c60a8aad-f875-44c0-b1f2-9318e8fd2e62
nexus-bit/CPP_practice
LearningCPP/023_alphabet_histogram_with_ASCII_code.cpp
//20191002 book94p_16 alphabet histogram #include<iostream> using namespace std; int isAlpha(char arr[]) { int i = 0; int sum = 0; int alphabet[26] = { 0 }; //It is an array which contains number of alphabet([0]:number of a, [25]:number of z) while (arr[i] != NULL) //during the sentence ends.. { int charindex = ...
ALGO
0.993149
3.675758
d69b3f4e-8ee6-4e0b-b933-205c761e13de
debajitadhikary/cautious-octo-disco
TUF-SHEET/14_Increasing-Letter-Triangle.cpp
#include<bits/stdc++.h> using namespace std ; /* ---------------------------------------------------------------- Sample Input 1: 3 Sample Output 1: A A B A B C ---------------------------------------------------------------- Sample Input 2 : 4 Sample Output 2 : A A B A B C A B C D -------------------------------...
ALGO
0.999643
4.427141
db346ab5-c631-487b-ad47-96713668fb1b
GithubUser18974/CodeForces-ProblemsSolutions
L_Double_Cola.cpp
#include <iostream> #include <string> #include <cstring> using namespace std; int main() { int t; int h=0; int counter=0; char tmp[100]; cin>>t; string s[t] ,st[t] ; for(int i=0; i<t; i++) { cin>>s[i]; } for(int i=0; i<t; i++) { cin>>st[i]; } ...
ALGO
0.999703
3.506938
fdad252b-e917-453e-b893-dbb5e47f03dd
LKSH-for-poor/Algorithms
sieve_eratosthenes.cpp
#include <iostream> int main(){ const int RANGE = 100; int array[RANGE]; for (int i = 0; i < RANGE + 1; i++) array[i] = i; for (int p = 2; p < RANGE + 1; p++){ if (array[p] != 0){ std::cout << array[p] << std::endl; for (int j = p*p; j < RANGE + 1; j+=p) array[j] = 0; } } }
ALGO
0.999337
3.810665
7d4fbb87-9e36-44d0-8a5d-47266b72dffc
kumarshivam27december/data_structure_and_algorithm_in_c-
lec054_stack_intro/queue.cpp
#include <iostream> #include <string> struct Node { int data; Node* next; }; class Queue { private: Node* front; Node* rear; public: Queue() { front = nullptr; rear = nullptr; } // Function to check if the queue is empty bool isEmpty() { return (front == nullp...
ALGO
0.961978
6.134359
bc2c8c9c-2fba-4aec-8c19-4b0aa00a987a
vikingsword/Basic
itheima/p167_p236/06_deque.cpp
//#include "iostream" //#include "deque" //#include "algorithm" // //using namespace std; // ///** //* @author: vikingar //* @time: 2023/9/16 12:11 //* @description: deque 及基本函数 //*/ ///** // * 双端数组,可以对头端进行插入删除操作 // * deque与vector区别: // * vector对于头部的插入删除效率低,数据量越大,效率越低 // * deque相对而言,对头部的插入删除速度回比vector快 // * vector访问元素...
TOOL
0.93162
4.35505
744769f3-2e55-40f1-80b6-03541721c974
Sa1i3ri/C-plus-plus-advanced-programming
OJ/3/MyList.cpp
// MyList.cpp #include "MyList.h" using namespace std; // 构造函数 MyList::MyList() { head = NULL; } // 析构函数 MyList::~MyList() { while (head != NULL) { Node *n = head; head = head->next; delete n; } } // 添加新的节点 void MyList::add(char c) { Node *n = new Node; if (n ...
ALGO
0.998129
4.250315
a734049a-36f5-46d6-9564-fdf0881fdcb2
Erfaniaa/competitive-programming
Codeforces/312A-Whosesentenceisit?.cpp
/* SubmissionId : 3772806 ContestId : 312 Index : A ProblemName : Whose sentence is it? ProblemTags : ['implementation'] ProgrammingLanguage : GNU C++ Verdict : OK */ #include <iostream> #include <iomanip> #include <fstream> #include <sstream> #include <vector> #include <map> #include <list> #include <set> #inc...
ALGO
0.997891
3.820355
b0789671-7231-4d74-bb2f-77e037555588
git-groshan/GFG-POTD
Day4-Total Cuts.cpp
#include<bits/stdc++.h> using namespace std; class Solution{ public: int totalCuts(int N,int K,vector<int> &A){ // Code here vector<int>rightMIN(N); rightMIN[N-1] = INT_MAX; int cut =0; for(int i=N-2;i>=0;i--){ rightMIN[i] = min(A[i+1] , rightMIN[i+1]); ...
ALGO
0.999966
4.948212
a69d3189-543d-4016-94d8-1cf353a0d3d5
mojo561/school_stuff
cpp_stuff/ulam_spiral/ulam.cpp
#include <iostream> #include <iomanip> #include <memory> std::unique_ptr<size_t[]> eratos(uint32_t n); int main() { uint32_t maxPrime = 0; uint32_t dmaxPrime = 0; uint32_t len = 0; std::unique_ptr<size_t []> sieve = nullptr; std::cout << "Enter a number: "; std::cin >> len; //7069 (prime) squared is as close a...
ALGO
0.998781
4.222508
79151227-b15a-406a-8687-ccc417649b19
chriswengqi/kattis
unionfind/unionfind.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define int ll typedef vector<int> vi; typedef vector<vector<int>> vvi; typedef vector<string> vs; typedef vector<char> vc; typedef unsigned long long ull; typedef pair<int, int> pii; typedef vector<pair<int, int>> vpii; typedef tuple<int, int, int> ii...
ALGO
0.999999
4.904809
71f5ed1c-fe97-4b93-bdef-fc77165fcb15
mahak1803/cpp_practice
patterns/continuous_number_square.cpp
// File: continuous_number_square.cpp // Description: Print a square pattern with continuously increasing numbers #include<iostream> using namespace std; int main() { int n, num = 1; // Input the size of the pattern cout << "Enter the size of the pattern = "; cin >> n; // Outer loop for rows ...
ALGO
0.997227
5.078038
0ea3833f-14af-4ee7-92f3-d6d0d7312c14
yxl3210230/GitHubVS2013
LabelRank/LabelRank/DisjointM.cpp
/* * DisjointM.cpp * * Created on: Nov 16, 2011 * Author: Jerry */ #include "DisjointM.h" #include "fileOpts.h" #include "Net.h" #include "NODE.h" #include <time.h> #include <sys/types.h> #include <process.h> #include "CommonFuns_TMP_Measure.h" //bool isUseLargestComp=false; //bool isSymmetrize=true; //str...
ALGO
0.996451
4.192469
9e188627-ca8e-43d9-a1d9-336ba89ab31c
UCTECHIP/PortComputeLibrary
ComputeLibrary/src/core/NEON/kernels/convolution/winograd/winograd_transforms/weights_2x2_3x3_fp32_fp32_integers.cpp
#include "arm.hpp" #include "kernel.hpp" namespace winograd { template <> void WeightTransform<3, 3, 4, 4, float, float, WinogradRoots::Integers>::execute( const int n_output_channels, const int n_input_channels, const float* const input, float* const output, const int matrix_stride, const int matrix_row_...
ALGO
0.998516
6.167853
8949d90f-cef0-4e20-ac11-79c2aacb5f5a
Flakvard/LearningCpp
cmake_examples/example_01/src/multiply/multiply.cpp
#include "./include/multiply/multiply.h" int multiply(int a, int b){ return a*b; } float multiply(float a, float b){ return a*b; } double multiply(double a, double b){ return a*b; }
TOOL
0.970508
3.962668
eb30cf5d-279d-476d-acee-575781158e13
conradsoon/competitive_programming
cses/graph/Round_Trip_II.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long int; using ull = unsigned long long int; using ld = long double; using pii = pair<int, int>; using pll = pair<ll, ll>; using vi = vector<int>; using vl = vector<ll>; using vii = vector<pii>; using vll = vector<pll>; using vvi = vector<vi>; using vvl =...
ALGO
0.999977
4.025648
cf4bc9f5-5a6c-43e3-b7f8-b298b188c0ff
rbtamanna/HackerRank
mini-max-sum.cpp
#include<bits/stdc++.h> using namespace std; int main() { long int min=0, max=0, s=0, x[5]; for(int i=0; i<5; i++) { cin>>x[i]; s+=x[i]; } min=x[0], max=x[0]; for(int i=0; i<5; i++) { if (x[i]<min) min=x[i]; if (x[i]>max) max=x[i]; } cout<<s-max<<" "<<...
ALGO
0.999959
3.592358
4e3f5c85-d99f-4fe0-8314-4ed79ad2e501
bubanalesumit157/CPP_DSA
cpp/L13/firstlastoccurence.cpp
#include<iostream> using namespace std; int first_occur(int arr[],int n,int key){ int s=0,e=n-1; int mid=s+(e-s)/2; int ans=0; while(s<=e){ if(arr[mid]==key){ ans=mid; e=mid-1; } else if(arr[mid]<key){ s=mid+1; } else{ ...
ALGO
0.999811
4.346174
bb4c46a6-6c4a-40ed-8131-d256a2b24a34
Kriegcho/Leetcode
LeetCode/Code/0349_Intersection of Two Arrays.cpp
#include <unordered_map> #include <vector> using namespace std; class Solution { public: vector<int> intersection(vector<int>& nums1, vector<int>& nums2) { unordered_map<int, int> um; for (auto i : nums1) um[i]++; vector<int> ans; for (auto i : nums2) if (um[i] > 0) { ans.push_back(i); um[i]...
ALGO
0.999939
5.559533
589fe828-0fc1-46b3-99f9-067cc0878564
harshadmanglani/Coursework
OOPL/Book_DB.cpp
/* Create a CPP program with database functionality for storing book records for a libary */ #include <iostream> #include <string> using namespace std; static int transactions=0; class book{ //book class definition int* stock; int* ISBN; float* price; char* name; char* author; char* publisher; static int...
TOOL
0.966057
4.90112
03956f2b-82b3-41aa-8ce8-594ffd318444
sebacagnoni/juegoDeLaVida
TPI-toroide/ejercicios.cpp
#include <algorithm> #include "ejercicios.h" #include "auxiliares.h" //NO TENER EN CUENTA EL CICLICO CORRIDO // EJERCICIO 1 bool toroideValido(vector<vector<bool>> const &t) { bool resp = false; resp = esToroide(t); return resp; } // EJERCICIO 2 bool toroideMuerto(toroide const &t) { bool resp = false...
ALGO
0.999068
4.476565
f504e78f-5047-4b32-9341-2bd15e14a812
stestagg/Personal
Sierp/mtrand.cpp
// mtrand.cpp, see include file mtrand.h for information #include "mtrand.h" // non-inline function definitions and static member definitions cannot // reside in header file because of the risk of multiple declarations // initialization of static private members unsigned long MTRand_int32::state[n] = {0x0UL}; int MTR...
TOOL
0.995909
5.855755
f979901e-7e7a-4d2d-b187-ba5d3c73d009
zhuoyi99/Sudoku
Sudoku_Cpp_Shell/src/BTSolver.cpp
#include"BTSolver.hpp" #include<climits> using namespace std; // ===================================================================== // Constructors // ===================================================================== BTSolver::BTSolver ( SudokuBoard input, Trail* _trail, string val_sh, string var_sh, string c...
ALGO
0.99999
6.606232
427d2586-0f5c-44d4-a732-6c441d9fd759
YGYtl/PAT-Code
14/1060.cpp
#include<iostream> #include<cstdio> #include<cmath> using namespace std; int n; int aaa=0, bbb=0; int f1(double num) { int c = 0; while(num>1e-1) { c++; num /= 10; } return c; } double f2(double num1, double num2) { int m = n; double a, b; a = num1; b = num2; while(m--) { int k1 = int(a*10)%10; a = a*...
ALGO
0.999229
3.191066
4718c6ad-cec9-48ea-b76f-4cb703e365e2
yangteng2013/Prj-Android
Prj-iOS/lpr/lpr/Source/src/SegmentationFreeRecognizer.cpp
// // Created by Jack Yu on 28/11/2017. // #include "SegmentationFreeRecognizer.h" namespace pr { SegmentationFreeRecognizer::SegmentationFreeRecognizer(std::string prototxt, std::string caffemodel) { net = cv::dnn::readNetFromCaffe(prototxt, caffemodel); } inline int judgeCharRange(int id) {re...
DATA
0.977832
3.313471
dc443a9b-ac0c-494d-a5ea-1c29fb42c62e
masonarchhsieh/Training_LeetC
length-of-last-word/Accepted/7-15-2023, 4_48_28 PM/Solution.cpp
// https://leetcode.com/problems/length-of-last-word class Solution { public: int lengthOfLastWord(string s) { const string white_spaces(" \t\f\v\n\r"); size_t last_cend = s.find_last_not_of(white_spaces); size_t last_cbegin = s.find_last_of(white_spaces, last_cend); return (last_c...
ALGO
0.997684
6.51819
e07a6a63-76b8-4c09-b008-64d0b84cf511
varunsharma10/cpp
CodeForces/686Div3C.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; const ll mod = 1000000007; #define send {ios_base::sync_with_stdio(false);} #define help {cin.tie(NULL);} #define getunique(v) {sort(v.begin(), v.end()); v.erase(unique(v.begin(), v.end()), v.end());} void solve() { int n; cin >> n; vector<int>...
ALGO
0.999916
5.008312
581d902f-6ce8-493c-a302-51585e961580
jason-vermillion/leetcode
solutions/00000-249/00023-merge-k-sorted-lists.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) {} * }; */ // https://leetcode.com/problems/merge-k-sorted-li...
ALGO
0.999776
6.174737
dbe0b03a-a919-4872-9674-850f43f80d74
piyushdubey-pd/codeforces_cp2
lab1prog1.cpp
#include <bits/stdc++.h> using namespace std; // A Linked List Node struct Node { char data; Node* next; Node(char ch) { this->data = ch; this->next = nullptr; } }; // Construct `s1` and `s2` out of the given linked list with consecutive // list elements in the forward and back...
ALGO
0.999863
5.635036
d0db7ec5-b027-442d-b5ca-2236e4735bc4
AlejandraCZ06/Proyecto-Ale
Entregas-ALSE/Ejercicios/355.DesignTwitter.cpp
#include <iostream> #include <vector> #include <unordered_map> #include <unordered_set> #include <queue> using namespace std; class Twitter { public: int timeStamp; // Variable para llevar el contador de tiempo (timestamp) de los tweets unordered_map<int, vector<pair<int, int>>> tweets; // Mapa para almacenar...
ALGO
0.998292
7.016917
98ff82ec-1fdb-4bb3-8353-15c41e2dc133
shimon1024/dismaltc
llvm/tools/llvm-pdbutil/FormatUtil.cpp
#include "FormatUtil.h" #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/StringExtras.h" #include "llvm/BinaryFormat/COFF.h" #include "llvm/DebugInfo/CodeView/CodeView.h" #include "llvm/Support/FormatAdapters.h" #include "llvm/Support/FormatVariadic.h" using namespace llvm; using namespace llvm::codeview; using name...
TOOL
0.942873
7.576153
6a37a76a-2071-4b0f-af8c-1dfe6bba9073
GIT-heyok/PS
CF/Contests/ECF R149 Div.2/F.cpp
#include <iostream> #include <vector> #include <stack> #include <queue> #include<sstream> #include <string> #include <algorithm> #include <iomanip> #include <set> #include <map> #include <cmath> #define FAST ios::sync_with_stdio(false);\ cin.tie(nullptr);\ cout.tie(nullptr); #define endl '\n' #define all(x) (x).begin...
ALGO
0.999982
3.841621
7fec639f-1428-4130-b5c7-2a37f4efcd8a
28083606amit/Competitive_Programming_Questions
longestonedifferencesubarray.cpp
#include<bits/stdc++.h> using namespace std; int solve(vector<int>A){ int maxlen=1; int i; int minnum=A[0],maxnum=A[0]; int num=A[0]; int c=1; for(i=1; i<A.size(); i++){ if(abs(A[i]-num)<=1 && abs(A[i]-minnum)<=1 && abs(A[i]-maxnum)<=1){ num=A[i]; maxnum=max(maxnum,num); ...
ALGO
0.999807
4.539207
dad7caf4-9cb7-46cf-b7b8-eb3d0ff557a6
MontaukLaw/3568_rknn_rtmp
rknn_yolov5/libs/rknpu2/examples/rknn_api_demo/src/rknn_with_mmz_demo.cpp
/*------------------------------------------- Includes -------------------------------------------*/ #include "rk_mpi_mmz.h" #include "rknn_api.h" #include <float.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/time.h> #define STB_IMAGE_IMPLEMENTATION #include "stb/stb_imag...
DATA
0.944548
4.94275
fcda1f57-76e1-41b2-9700-d0c9334baf7b
KamaruzzamanFahad/Newbie-Problem-Solving-with-Cpp
Week-1/L_GamingForces.cpp
#include<bits/stdc++.h> using namespace std; int main(){ int t; cin >> t; while(t--){ int n,count=0; cin >> n; vector<int> monst(n); int one =0; for(int i=0; i<n; i++){ cin >> monst[i]; } sort(monst.begin(),monst.end()); for(int i=0; i<n; i++){ if(monst[i] == 1)...
ALGO
0.999543
4.230241
cf409399-764b-4a44-94cc-923d81c702e0
squaresLab/BatFix
results/transcoder-st/results/python/semantics/COUNT_WAYS_BUILD_STREET_GIVEN_CONSTRAINTS.cpp
#include <iostream> #include <cstdlib> #include <string> #include <vector> #include <fstream> #include <iomanip> #include <vector> #include <map> #include <unordered_map> #include <set> #include <unordered_set> #include <numeric> #include <algorithm> using namespace std; long f_gold ( int n ) { long dp [ 2 ] [ n + 1 ...
ALGO
0.999665
4.936336
45a364c8-a4a5-46ff-b89c-2998c26accf3
Alexmercer116/100Days_DSA
Arrays-I/isarraysorted.cpp
#include<iostream> #include<vector> using namespace std; bool isArraySorted(vector<int> v){ int i=0,n=v.size(); for(int i=0;i<n-1;i++){ if (v[i] > v[i + 1]) { return false; // If any adjacent elements are out of order, the array is not sorted } } return true; } int main(){ vector...
ALGO
0.999209
5.008795
39cc692a-51da-4073-b712-0e619a18d73a
shyamal2411/DSA-Practice
leetcodePractice/Arrays/BuySellStockGFG.cpp
/* https://www.geeksforgeeks.org/maximum-profit-by-buying-and-selling-a-share-at-most-twice/ */ #include <iostream> using namespace std; int main() { int price[] = {2, 30, 15, 10, 8, 25, 80}; int n = 7; // adding array int profit = 0; // Initializing variable // valley-peak approach /* ...
ALGO
0.999954
5.590738
f1504e7b-7b8b-47a6-b624-1e5053517195
Yangwoongmo/ComputerArchitectureStudy
Algorithm/Class01/BOJ2438/BOJ2438.cpp
#include <iostream> using namespace std; int main() { int a = 0; cin >> a; for (int i = 0; i < a; i++) { for (int j = 0; j <= i; j++) { cout << "*"; } cout << endl; } return 0; }
ALGO
0.999932
3.929281
7684e06b-0bee-4d53-b83d-c558c2c2f980
Aniketjain288/Coding---CPP
maxpathsum.cpp
#include<bits/stdc++.h> using namespace std; struct Node{ int data; struct Node* left; struct Node* right; Node(int val){ data=val; left=NULL; right=NULL; } }; int maxpathsumutil(Node* root,int &ans){ if(root == NULL){ return 0; } int left=maxpathsumu...
ALGO
0.999981
5.206448
e992d702-69fd-497e-8f5a-04bf76dd3517
RamonPortuga/TreinamentoC-_2018
Fechadura.cpp
#include <iostream> #define TAM 100 using namespace std; int n,m,vetor[TAM],maior,menor; main(){ cin>>n>>m; for(int i = 0;i < n;i++){ cin>>vetor[i]; } for(int i = 0;i < n;i++){ if(i == 0){ maior = vetor[i]; menor = vetor[i]; } else{ if(vetor[i]>maior) maior = vetor[i]; else if (vetor[i]<meno...
ALGO
0.999976
3.60744
5bba3ffb-8612-401f-b8a9-35ce364abf0a
Anchal-Mittal/Data-Structue-and-Algorithm
linkedlist/doublyLinkedList.cpp
#include<iostream> using namespace std; class Node{ public: int info; Node *next; Node *prev; Node(int el,Node *n=0,Node *p=0){ info=el; next=n; prev=p; } }; class List{ public: Node *head; Node *tail; List(){ head=NULL; tail=NULL; } void insertAtHead(); void insertAtTail(); void insertAtAnypl...
ALGO
0.984306
3.403606
6e756777-b03d-4a19-a349-56ed52cd8fe6
jedirandy/mr-robot
vsv_stack/bsplines/src/SplinePath.cpp
#include "bsplines/SplinePath.h" #include <set> #ifdef USE_GNUPLOT #include <CGnuplot.h> #endif using namespace std; using namespace splines; SplinePath::SplinePath(const Point * s, unsigned int n, double res, double vel) : BSpline(s,n), i_to_s(n) { buildSMap(res); velocity_of_s.set(-1e-3,0); velocity_of_s.set(0...
ALGO
0.997271
4.193717
ed726501-82f4-4ad0-843a-de844dbe99e1
CppOpen/LearningOpenCV3
examples/chapter20/example_20-02/example_20-02.cpp
//Example 20-02. Using the Mahalanobis distance for classification #include "stdafx.h" #include "..\..\_opencv.h" #include <iostream> #include <ctime> #include <algorithm> using namespace std; const int CLUSTER_COUNT = 4; const int SAMPLE_COUNT = 500; const cv::Scalar colorTab[] = { cv::Scalar(0, 0, 255), cv::Scal...
ALGO
0.997929
6.076484
8eda3c27-12c9-42b9-bd61-a71e576b11e3
joohyuk95/PS_from_BOJ
college_basic/19.cpp
#include <iostream> #include <algorithm> using namespace std; int sum; int height[9]; int main() { for (int i = 0; i < 9; ++i) { cin >> height[i]; sum += height[i]; } sort(height, height + 9); for (int i = 0; i < 9; ++i) { for (int j = i + 1; j < 9; ++j) { if ((sum...
ALGO
0.999167
3.353083
c86d3e0a-d42c-4345-8fa8-5b9bb33e33fd
JY1Lnz/Contests
西南民族大学第十届校赛(同步赛)/K.cpp
#include<bits/stdc++.h> #define LL long long using namespace std; const int MAXN = 1e6+10; const int MOD = 10000019; int n; int a[3][4]; int main() { int t; scanf("%d",&t); int cnt = 0; while(t--) { for (int i = 0;i<3;i++) for (int j = 0;j<4;j++) scanf("%d",&a[i]...
ALGO
0.999482
3.190952
e5554402-699e-4140-a2d1-7f1bcaf344fd
qwedsazxc1/ITSAOOP
Array1/C_AR02.cpp
#include <iostream> #include <vector> using namespace std; int main(){ int temp; vector<int> arr; while (cin >> temp){ arr.push_back(temp); } for (int i = arr.size() - 1; i >= 0; i--){ if (i != arr.size() - 1) cout << " "; cout << arr[i]; } cout << "\n"; return 0; }
ALGO
0.99868
3.892612
30c4d908-2f71-4efc-939c-c8dfec82372c
Alevtina-exe/LR6
Task_3/solution.cpp
#include "func.h" #include <iostream> void Task_3_Solution() { char* str1 = new char[20000], *str2 = new char[20000]; int c1, c2; std::cout << "Введите первую строку(длина не более 10000 символов).\n"; getchar(); c1 = input_str(str1); std::cout << "Введите вторую строку(длина не более 10000 симв...
ALGO
0.997765
3.547727
6ea667cd-281a-441f-a448-9cfc9b6b8f1f
sativa/apsim_development
Shared/data/Table_base.cpp
//--------------------------------------------------------------------------- #include <general\pch.h> #include <vcl.h> #pragma hdrstop #include "table_base.h" #include <stdio.h> #include <values.h> // MAXFLOAT #include <general\string_functions.h> #include "filter.h" #define Missing_value "*" // -------------------...
TOOL
0.894918
4.143792
9ce1d1a7-f9bf-4a4d-a032-87349f006447
makersahil/cpp-tuts
characterChecker.cpp
#include <iostream> using namespace std; int main() { char ch; cout<<"Enter a character"; cin>>ch; if (ch >= 65 && ch <= 90) { cout<<"The character is UPPERCASE!"<<endl; } else if (ch >= 97 && ch <= 122) { cout<<"The character is LOWERCASE!"<<endl; } else if (ch ...
TOOL
0.935193
3.845213
05e09ccc-83b2-434e-8718-32fe51639f65
MiguelSouza2/Learning-CPP
exercises/CPP-19-list/Cpp_19.cpp
// LISTAS --> LIST PARTE 1 /* Sort, reverse, push_front, push_back, pop_front, pop_back, size... */ #include <iostream> // BIBLIOTECA list PARA PODERMOS USAR A LIST #include <list> using namespace std; int main(){ list <int> numeros; int i, tam = 10; // O ITERATOR VAI NOS PERMITIR SELECIONAR A POSIÇÃO list <...
ALGO
0.996019
4.536419
1b291a04-fc90-44b6-944d-3a8984b9f25e
raincross7/code-similarity
codes/train_code/problem486/problem486_25.cpp
#include<iostream> #include<vector> #include<algorithm> #include<string> #include<cstring> using namespace std; typedef long long int ll; const int N_MAX = 200005; const int P_MAX = 10005; long long int modp[P_MAX]; ll mod_pow(ll x, ll n, int mod){ int res = 1; while(n > 0){ if (n & 1) res = res * x %...
ALGO
0.999942
3.932951
c36df0f4-122f-4fdc-a083-341139dd81cb
ShubhamSingh1384/code-with-SSR
Linked List 1 30/test.cpp
// Linked List :- It is a linear data structure (collection of nodes); //(Nodes k andar ek data hota hai aur ek address hota hai); // It is created in heap memory so that in every function fun(Node*->(a pointer which point an address in heap memory) &->(call by reference)name , int data) #include<bits/stdc++.h> using ...
ALGO
0.999848
4.70396
89a50ecc-82f8-4e42-861f-f8f84ece91c2
shashankkestwal/ds
GFG_practice/array/RearrangeZeroes.cpp
#include <iostream> using namespace std; void settleZeroes(int size, int array[]) { int last = size - 1; int i = 0; while(i < last){ if (array[i] == 0) { if (array[last] == 0) { last --; } else { int temp = array[last]; array[last] = 0; array[i] = temp; i++; } } else { i++; ...
ALGO
0.999179
3.72142
b18e485b-f58a-455d-95bd-db4a6e78924c
cmvandrevala/csc_122_neural_network
7_randomize_weights_and_biases.cpp
#include <array> #include <iostream> #include <numeric> using namespace std; float random_number() { return ((double)rand() / (RAND_MAX)) + 1; }; int main() { srand(time(NULL)); array<float, 4> inputs = {1.2, 5.1, 2.1, 4.7}; float weights[3][4]; for (int i = 0; i < 3; i++) { for (int j = 0; j < 4; ...
ALGO
0.999641
3.71271
238cabe7-a609-4e2e-9884-3f1d9dd9ff37
arpansahu/Queue
queue_of_tree_nodes_.cpp
#include <stdio.h> #include <malloc.h> /* nodes for queue and tree node*/ struct node { int key; struct node * left; struct node * right; }; struct qnode { struct node * point ; struct qnode * next ; }; struct qnode * start = NULL; /* function for creating new node of tree*/ struct node *newNode(in...
ALGO
0.99995
4.251086
4af97989-5144-4888-a3e6-61ab225f31e0
moonflower-Bai/OIcode
考试/CF2035/B_Everyone_Loves_Tres.cpp
#include<bits/stdc++.h> using namespace std; int T, n, m, r, c; int a[505]; int main(){ cin >> T; while(T--){ cin >> n; if(n == 1 || n == 3){ cout << "-1\n"; continue; } else if(n == 2){ cout << "66\n"; continue; } a...
ALGO
0.999892
4.00913
a24979f7-98bb-4318-bd48-2bf185ec067f
zetrfvg/Algorithm
杂题/力扣/思维、构造/1605. 给定行和列的和求可行矩阵.cpp
/* 基于贪心的一种构造 对于位置ans[i][j],他能取到的最大值为rowSum[i]和colSum[j]中的最小值 可以贪心直接令该位置取最大值即可,同时要更新rowSum[i]-=ans[i][j],colSum[j]-=ans[i][j] 利用数学归纳法可以证明满足要求 */ class Solution { public: vector<vector<int>> restoreMatrix(vector<int>& rowSum, vector<int>& colSum) { int n=rowSum.size(),m=colSum.size(); vector<vector<in...
ALGO
0.999984
6.139033
2c8e1278-d6e3-44e0-a435-977f986ba49b
Gauaravmahajan7870/DSA
pattern on loops/ex1.cpp
#include<iostream> using namespace std; int main(){ //* reactangle pattern int n,m; cin>>n>>m; for (int i=1;i<=n;i++){ for(int j=1;j<=m;j++){ cout<<"*"; } cout<<endl; } return 0; }
ALGO
0.999216
3.658754
a20d6cda-0ada-44b3-a8b0-f956072b8cc1
HuluChatMessenger/Hulugram
TMessagesProj/jni/rlottie/src/vector/vpathmesure.cpp
#include "vpathmesure.h" #include <limits> #include "vbezier.h" #include "vdasher.h" V_BEGIN_NAMESPACE /* * start and end value must be normalized to [0 - 1] * Path mesure trims the path from [start --> end] * if start > end it treates as a loop and trims as two segment * [0-->end] and [start --> 1] */ VPath VP...
TOOL
0.854202
5.782583
89238382-a146-4535-9dae-5325fa475ce8
heyitzmeaditya/Leetcode
0556-next-greater-element-iii/0556-next-greater-element-iii.cpp
class Solution { public: void solve(vector<int>&nums){ int index=-1; int n=nums.size(); for(int i=n-2;i>=0;i--){ if(nums[i]<nums[i+1]){ index=i; break; } } if(index==-1){ reverse(nums.begin(),nums.end()); ...
ALGO
0.999929
5.99834
29c1b5a0-4190-44ba-b89f-181e44d5ba05
limkskr/cpp
.ccls-cache/@home@runner@cpp/8_Heap@PriorityQueue.cpp
#include "PriorityQueue.h" #include "UsefulHeap.h" void PQueueInit(PQueue * ppq, PriorityComp pc) { HeapInit(ppq, pc); } int PQIsEmpty(PQueue * ppq) { return HIsEmpty(ppq); } void PEnqueue(PQueue * ppq, PQData data) { HInsert(ppq, data); } PQData PDequeue(PQueue * ppq) { return HDelete(ppq); }
TOOL
0.940365
4.781477
a46cb0c3-bcfd-43f6-bf50-42d392ec8398
kihyeonkwon/uiuc_cs
cpp-heapPuzzles/puzzle1.cpp
#include <iostream> using std::cout; using std::endl; int main() { int i = 2, j = 4, k = 8; int *p = &i, *q = &j, *r = &k; k = i; cout << i << j << k << *p << *q << *r << endl; p = q; cout << i << j << k << *p << *q << *r << endl; *q = *r; cout << i << j << k << *p << *q << *r << endl; ret...
ALGO
0.991147
3.071216
39e92f97-4c79-470e-afba-fdcc12b3649e
erygle/Playground
cpp-makefile/cpp-vector/ex1/main.cpp
/** * C++ program using the std::vector class. * * @author * Wade Fagen-Ulmschneider <<EMAIL>> */ #include <vector> #include <iostream> int main() { std::vector<int> v; v.push_back( 2 ); v.push_back( 3 ); v.push_back( 5 ); std::cout << v[0] << std::endl; std::cout << v[1] << std::endl; std::cou...
ALGO
0.935137
4.048762
95ba271c-348b-48d8-ab28-d4dd3ba3591b
gky2009514/leetcode
C++/255_Verify Preorder Sequence in Binary Search Tree.cpp
class Solution { public: bool verifyPreorder(vector<int>& preorder) { int n = (int)preorder.size(); if (n <= 1) return true; stack<int> stk; int lower = INT_MIN; for (int i = 0; i < preorder.size(); i++) { if (preorder[i] < lower) retur...
ALGO
0.999978
6.314471
a826ac40-34fe-49f9-9e0a-a8ee2ca04d0b
fudoge/Problem_Solving
프로그래머스/3/42892. 길 찾기 게임/길 찾기 게임.cpp
#include <iostream> #include <vector> #include <algorithm> using namespace std; struct Node { int val; int x; int y; Node *left; Node *right; Node(int value, int x, int y) : val(value), x(x), y(y), left(nullptr), right(nullptr) {} }; class Tree { private: Node *root; public: Node *g...
ALGO
0.999959
5.203107
3fb0cd1c-467e-49f8-9703-ae4f130ee381
ishandutta2007/codeforces
yz6205/normal/1208/A.cpp
#include <iostream> #include <cstdio> #include <map> #include <set> #include <vector> #include <algorithm> #include <cstdlib> #include <queue> #include <cmath> #include <cstring> using namespace std; #ifdef ENABLE_LL #define int long long #endif #ifdef ENABLE_LL #define I "%lld" #define II "%lld%lld" #define III "%ll...
ALGO
0.999735
3.462372
9065b2a4-5b59-482e-bee3-84fc81a19d72
victorjgomez/c_and_cplusplus_competitive_programming_problems
problems/cpp_tutorial/main.cpp
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<int> v; for (int i = 0; i < n; ++i) { int input; cin >> input; v.push_back(input); } sort(v.begin(), v.end()); for (int i = 0; i < n; ++i) { cout << v[i] << " "; } ...
ALGO
0.999748
4.918007
ce4d62af-07cc-445a-a177-f1cc5cddac04
hack-parthsharma/LeetCode
22-generate-parentheses/22-generate-parentheses.cpp
class Solution { public: vector<string> generateParenthesis(int n) { vector<string> ans; dfs(n, n, "", ans); return ans; } private: void dfs(int l, int r, string&& path, vector<string>& ans) { if (l == 0 && r == 0) { ans.push_back(path); return; } if (l > 0) { path.push...
ALGO
0.999741
7.044755
fe1a7e76-faba-44f8-ac9b-3d00dcab7e47
Thxssio/DEX3DPrinter
buildroot/share/PlatformIO/variants/MARLIN_F446VE/variant.cpp
#include "pins_arduino.h" #ifdef __cplusplus extern "C" { #endif // Pin number const PinName digitalPin[] = { PA_0, //D0 //A7 PA_1, //D1 //A8 PA_2, //D2 //A9 PA_3, //D3 //A0 PA_4, //D4 //A1 PA_5, //D5 //A10 PA_6, //D6 //A11 PA_7, //D7 //A12 PA_8, //D8 PA_9, //D9 PA_10, ...
CONFIG
0.905364
3.59536
a0bd0a79-f29b-4612-a30c-fca7bccd4899
wonghoifung/tips
leetcode/medium_minimum_number_of_arrows_to_burst_balloons.cpp
#include <vector> #include <queue> #include <stack> #include <iostream> #include <sstream> #include <unordered_set> #include <unordered_map> #include <map> #include <set> #include <algorithm> #include <functional> #include <stdio.h> #include <stdlib.h> using namespace std; class Solution { public: int findMinArrowSho...
ALGO
0.999971
5.512862
61f66786-e711-4f0e-9e48-d8dbf6a01454
yeti1215/Home_Practice
Gaddias/chapter 11 structure/6. Structure Weather Statistics/main.cpp
#include <iostream> #include <cstring> #include<iomanip> #include<cmath> using namespace std; struct TempYear{ string name; float rainfall; int lowT; int highT; float arvgT; }; int main(){ int size=12; float arvgR; //average rainfall float rainT=0; float sumT =0; TempYea...
TOOL
0.991738
4.319188
2c048044-8bfd-41b5-b04c-5f2cc38c9a4b
Uzer447/Code
Codeforces/petr and book.cpp
#include<bits/stdc++.h> using namespace std; int main() { int n; cin>>n; vector<int> v(7,0); for(int i=0;i<7;i++) { cin>>v[i]; } int i=0; while(true) { if(i==7) i=0; if(v[i]!=0) n-=v[i] ; //cout<<n<<" "; i++; if(n<=...
ALGO
0.999883
3.108925
293d3be5-fcba-4ac5-8343-c5b57df94ca6
Larry1280326/my-latex-notes
COMP3711 Designs and Analysis of Algorithms/Lectures/Lecture 1/mcs2.cpp
#include <iostream> using namespace std; const int MAXN = 1.1e7; int A[MAXN]; int mcs(int A[], int start, int end) { if(end<=start) return 0; int mid = (start+end)/2; int ans = max(mcs(A, start, mid), mcs(A, mid+1, end)); int sumL=0, sumR=0, bestL=0, bestR=0; for(int i=mid;i>=start;--i) { sumL...
ALGO
0.999967
4.387906
1564c3b3-738f-40a6-9b7b-ded9e4eddb14
splucs/Competitive-Programming
Codeforces/Gym/101041 I Brazilian Open Cup, Federal University Of Uberlandia/E.cpp
#include <vector> #include <math.h> #include <stdio.h> #define mod 1000000007 using namespace std; typedef long long ll; typedef vector< vector<long long > > matrix; matrix operator *(matrix a, matrix b) { int n = (int) a.size(); int m = (int) b.size(); int p = (int) b[0].size(); matrix c; c.resize(n); for (i...
ALGO
0.999984
3.838084
79d8975b-12f1-4abb-b70a-93ee0f9da0b3
aroraadivya/LeetCode-Questions
0440-k-th-smallest-in-lexicographical-order/0440-k-th-smallest-in-lexicographical-order.cpp
class Solution { public: int n, d; vector<int> noPer; bool isPerfect; long long perfect[10] = {1, 11, 111, 1111, 11111, 111111, 1111111, 11111111, 111111111, 1111111111LL}; long long tens[11] = {1, 10, ...
ALGO
0.999923
5.937152
7a6f16f1-6c34-4bcc-a3f9-7989bac8834a
WieturenPL/school
c++/rekurencja.cpp
//oblicz rekurencyjnie a^b //oblicz nwd metod euklidesa rekurencyjnie //oblicz rekurencyjnie elementy cigu fibbonaciego #include <iostream> #include <cmath> using namespace std; long int power(int x, int y){ if(y==0) return 1; else if (y==1) return x; else return power(x, y-1)*x; } int eucli(int x, int y){ if (x=...
ALGO
0.99932
3.653252
ab998557-c7e4-4e54-a861-d5310755c68f
dasturchiBro/CompetitiveProgramming
CSES.fi/Introductory_Problems/Repetitions/index.cpp
#include <iostream> using namespace std; #define ll long long #define vi vector<int> #define vll vector<long long> #define GET(a) for(auto &it:a) cin >> it #define en '\n' void solve() { string line; cin >> line; ll counter = 1; ll max_val = 1; for(string::size_type i = 1; i < line.size(); i++) { if(line[i] ==...
ALGO
0.999893
3.777502
0e5860bc-7a8f-4d32-9780-f0e3cb4c23b6
rezaaljawas21/Learning_Repo
C++/example2.cpp
#include <iostream> #include <vector> using namespace std; int main(){ vector<int> num; for(int i=1;i<=5;i++){ num.push_back(i); } cout<<"Output from the beginning to the end: "; for(auto i=num.begin();i!=num.end();i++){ cout<<*i<<" "; } }
ALGO
0.998168
3.450563
846f5852-852c-4312-999c-54f3500a7e0c
ishandutta2007/codeforces
fizzydavid/normal/655/F.cpp
//by yjz #include<bits/stdc++.h> using namespace std; #define debug(x) cerr<<#x<<"="<<x<<endl; #define FF first #define SS second #define PB push_back #define MP make_pair typedef long long ll; const ll INF=1<<28; const ll LINF=1ll<<61; //My own input/output stream #define geti(x) x=getnum() #define getii(x,y) geti(x)...
ALGO
0.999855
3.461638
2aad1dc6-1deb-4834-8e63-906e4e16c1c1
pershoot/android_frameworks_base
media/libstagefright/codecs/amrnb/common/src/l_shr_r.cpp
/* Filename: /audio/gsm_amr/c/src/l_shr_r.c ------------------------------------------------------------------------------ REVISION HISTORY Description: Created separate file for the L_shr_r function. Sync'ed up with the current template and fixed tabs. Description: Updated template. Changed function i...
ALGO
0.996977
7.2722
dd775656-873c-4cd9-bce2-ade35a3f7d32
williboy63/c-_learning
vectors.cpp
#include <iostream> #include <string> #include <cstdlib> #include <ctime> #include <vector> int main() { std::vector<int> data = {1, 2, 3}; data.push_back(12); std::cout << data[data.size() - 1] << std::endl; data.pop_back(); //This removes the last element of the vector std::cout << data.size() <...
ALGO
0.909043
3.314713
f4eff216-3b6c-452a-afc8-227741cff63f
nagacharan-tangirala/ns4
scratch/datahose/src/Core.cpp
#include "Core.h" #include "ns3/arp-cache.h" #include "ns3/ipv4-global-routing-helper.h" #include "ns3/ipv4-interface.h" #include "ns3/object-vector.h" #include "ns3/pointer.h" using namespace ns3; NS_LOG_COMPONENT_DEFINE("Core"); Core::Core(std::string configFile) { this->m_configFile = std::move(configFile); ...
TOOL
0.919888
5.546139
6b950651-52c1-423c-b556-c0402d469511
chuongg3/llvm-function-merging
mlir/lib/Dialect/SCF/Transforms/ParallelLoopTiling.cpp
#include "mlir/Dialect/SCF/Transforms/Passes.h" #include "mlir/Dialect/Affine/IR/AffineOps.h" #include "mlir/Dialect/Arith/IR/Arith.h" #include "mlir/Dialect/SCF/IR/SCF.h" #include "mlir/Dialect/SCF/Transforms/Transforms.h" #include "mlir/Dialect/SCF/Utils/Utils.h" namespace mlir { #define GEN_PASS_DEF_SCFPARALLELLOO...
ALGO
0.961104
6.836881
0dcf73ba-e56b-4b02-b611-411349b6e7bb
Lexmdlln92/tienda-virtual-lex
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
021e881c-0bf0-464e-b5a4-d9dd93f2c03a
M0D4/Competitive-Programming-Problems-Solutions
CodeForces/GNU C++17/1433E | Two Round Dances/96188394.cpp
#include "bits/stdc++.h" #pragma GCC optimize("trapv") #pragma GCC optimize("-Ofast") #pragma GCC optimize("-ffast-math") #pragma GCC optimize("-funroll-loops") #pragma GCC optimize("-funroll-all-loops,-fpeel-loops,-funswitch-loops") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,sse4.2,popcnt,abm,mmx,avx2,tune=native"...
ALGO
0.999983
4.603625
8c55bbed-05e1-4c61-9bb2-26ccf1832315
benjaminocampo/CompetitiveProgramming
01-AdHoc/Game/Card/WhatIsTheCard/whatIsTheCard.cpp
#include <bits/stdc++.h> using namespace std; #define DBG(x) cerr << #x << " = " << (x) << endl #define NCARDS 52 string cards[NCARDS] = { "2C", "3C", "4C", "5C", "6C", "7C", "8C", "9C", "TC", "JC", "QC", "KC", "AC", "2D", "3D", "4D", "5D", "6D", "7D", "8D", "9D", "TD", "JD", "QD", "KD", "AD", "2S", "3S"...
ALGO
0.998029
4.699632
e9afb120-ec3f-48b5-8b9f-79c2600dc852
climber0824/Leetcode
LinkedList/430.cpp
class Solution { public: Node* flatten(Node* head) { if (!head) return NULL; Node *curr = head; Node *p, *next; while (curr) { if (curr->child) { next = curr->next; curr->next = curr->child; curr->next->prev = curr;...
ALGO
0.999848
5.677014
42f33d25-6583-421a-8a98-37dc1669b678
NEU-REAL/REAL_DRONE_400
src/uav_simulator/so3_quadrotor_simulator/include/ode/libs/numeric/odeint/performance/generic_odeint_rk4_lorenz.cpp
#include <boost/array.hpp> //#include <boost/numeric/odeint/stepper/explicit_generic_rk.hpp> #include <boost/numeric/odeint/stepper/runge_kutta4.hpp> #include <boost/numeric/odeint/algebra/array_algebra.hpp> #include "rk_performance_test_case.hpp" #include "lorenz.hpp" using namespace boost::numeric::odeint; typed...
TEST
0.881325
5.890758
2a2a30b4-25a2-4953-b714-d8560449506b
alejobaenam/Competitive-Programming
USACO/3. Silver/Graphs/Graph Traversal/BuildingTeams.cpp
#define fast_cin() ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL) #include <bits/stdc++.h> using namespace std; typedef long long ll; const char nl = '\n'; const int MOD = 1000000007; #define pb push_back #define all(x) x.begin(), x.end() #define allr(x) x.rbegin(), x.rend() #define ff first #define ss...
ALGO
0.999988
4.647408
eba5eb9b-28b7-406f-bf68-7304ae273906
root-jeong/BOJ
10000~/15650_N과 M_2.cpp
// Ʈŷ Թ // DFS 츦 Žϴ Ʈŷ ˰. #include <iostream> #include <vector> using namespace std; vector<int> vec; int N, M; int visit[9]; void DFS(int n, int now) { if (n == M) { for (int i = 0; i < vec.size(); i++) { cout << vec[i] << " "; } cout << "\n"; return; ...
ALGO
0.999922
4.210263
d1b755b0-1454-4841-91da-f73d819fc45d
AkhileshKumar10/TCS_NQT_PRACTICE
STRINGS_PRACTICE/sum_of_numbers_in_string.cpp
#include<iostream> #include<bits/stdc++.h> using namespace std; int sum_of_numbers(string s){ int sum=0; string tempsum=""; for(int i =0; i <s.size();i++){ if(s[i]>='0'&&s[i]<='9'){ tempsum+=s[i]; } else{ sum+=atoi(tempsum.c_str()); tempsum=""; } } return sum+ atoi(tempsum.c_str()); }; in...
ALGO
0.99944
5.875237
e15a1746-f331-456e-887f-c60d7137c8d6
2316663736/homework-tj-cs
大二上/数据结构(101019)/hw3/hw2.cpp
#include<iostream> using namespace std; int get_new_pri(char* operator_bool_stack, int top_operator_stack) { for (int tem_top = top_operator_stack; tem_top > 0; --tem_top) { if (operator_bool_stack[tem_top - 1] != 'F' && operator_bool_stack[tem_top - 1] != 'V') { switch (operator_bool_stack[tem_top - 1]) {...
ALGO
0.999488
4.18156
394ed9d8-03dc-4fce-8f56-fcaa10647294
ishandutta2007/codeforces
errorgorn/normal/1167/D.cpp
#include <cstdio> #include <stack> #include <algorithm> using namespace std; int n,k,mk; stack<char> s; char c; int arr[200005]; int main(){ scanf("%d",&n); getchar(); for (int x=0;x<n;x++){ c=getchar(); if (!s.empty() && s.top()=='(' && c==')'){ s.pop(); arr[x]=k--; ...
ALGO
0.999814
3.147731
ba6af73d-a928-4dd8-bd7d-fc2003875b49
satyam-7318/Striver_SDE_Sheet_2024
Day-1 Basic Maths/6- Sum of all Divisors.cpp
/* Given a positive integer N., The task is to find the value of Σi from 1 to N F(i) where function F(i) for the number i is defined as the sum of all divisors of i. Example 1: Input: N = 4 Output: 15 Explanation: F(1) = 1 F(2) = 1 + 2 = 3 F(3) = 1 + 3 = 4 F(4) = 1 + 2 + 4 = 7 ans = F(1) + F(2) + F(3) + F(4) = 1...
ALGO
0.999915
6.529571