uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
47a70b2c-b920-4598-83b0-86e25173d7b8
Altu-Bitu-6/Altu-Bitu-SoHyunA
08_DFS_BFS/2606.cpp
#include <iostream> #include <queue> #include <algorithm> #include <vector> using namespace std; void bfs(int n, vector <vector<int>>& v, vector <bool>& check) { queue <int> q; q.push(1); check[1] = true; while (!q.empty()) { int cv = q.front(); q.pop(); for (int i = 1; i <= n...
ALGO
0.999903
4.207896
0cf66d18-20d0-4354-80b4-f09a523a8295
camillamendess/EstudosFaculdade
API/CamillaMendes_lab08_questao01.cpp
/*Escreva um programa para jogar par ou mpar com o computador. O seu programa deve pedir ao jogador para escolher entre par ou mpar e em seguida escolher um nmero entre 0 e 10. Em seguida, um nmero entre 0 e 10 deve ser gerado para representar a jogada do computador. O programa ento deve dizer quem ganhou e perguntar s...
ALGO
0.999744
3.805453
bc1be158-3538-4bdf-a736-666448e3688c
2019Shun/atcoder_submission
ARC/arc038/arc038_b_13003560.cpp
#include <bits/stdc++.h> #define PI 3.14159265358979323846 #define MAXINF (1e18L) #define INF (1e9L) #define EPS (1e-9) #define MOD ((ll)(1e9+7)) #define REP(i, n) for(int i=0;i<int(n);++i) #define Rep(i,sta,n) for(int i=sta;i<n;i++) #define RREP(i, n) for(int i=int(n)-1;i>=0;--i) #define ALL(v) v.begin(),v.end() #defi...
ALGO
0.999985
3.522549
2aa0beb3-1652-4377-b735-3e8dba7580e1
Tittanc/Reponame
CompetitiveProgramming/Maths/Probability and combinatorics/FavDice.cpp
// Problem Link - https://www.spoj.com/problems/FAVDICE/ /* By Sanket Singh */ #include<bits/stdc++.h> //#include<ext/pb_ds/assoc_container.hpp> //#include<ext/pb_ds/tree_policy.hpp> //#include <ext/pb_ds/trie_policy.hpp> //using namespace __gnu_pbds; using namespace std; #define ll long long int #define ld long...
ALGO
0.999579
4.15462
4a19f3d3-4630-4919-844d-cb8723176842
xajhab/IN2354
Exercise-3/gaussian.cpp
#include "utils/io.h" #include "utils/points.h" #include "ceres/ceres.h" #include <math.h> struct GaussianCostFunction { GaussianCostFunction(const Point2D& point_) : point(point_) { } template<typename T> bool operator()(const T* const mu, const T* const sigma, T* residual) const { // TODO: Implement the ...
ALGO
0.990578
7.106438
a24be679-f1ca-4c16-be8c-c2f96f874cd4
wsix/CarND-MPC-Project
src/Eigen-3.3/doc/examples/DenseBase_template_int_middleCols.cpp
#include <Eigen/Core> #include <iostream> using namespace Eigen; using namespace std; int main(void) { int const N = 5; MatrixXi A(N,N); A.setRandom(); cout << "A =\n" << A << '\n' << endl; cout << "A(:,1..3) =\n" << A.middleCols<3>(1) << endl; return 0; }
ALGO
0.887526
3.154174
9588f972-595e-406b-9a20-4a905898cd27
ShahryarSaljoughi/algorithm_examples_c
convex_hull/GRAHAM/Graham.cpp
// written by shahryar saljoughi , may-2017 // Graham algorithm for convex hull problem . #include <vector> #include <iostream> #include <stack> #include "sort_points.h" #include "points.h" using namespace std; point get_P0(vector<point> &points); //left_turn determines if these points constitute a left turn or a ...
ALGO
0.999997
5.35114
814489a1-9a07-4008-9e02-cb98b5224563
kapoorz/cpptopics
leetcode/Edit Distance.cpp
#include <string> #include <vector> using namespace std; class Solution { public: int minDistance(string word1, string word2) { int m = word1.size(), n = word2.size(); vector<vector<int>> ans(m + 1, vector<int>(n + 1, 1e9)); for (int i = 0; i <= m; i++) { for (int j...
ALGO
0.999989
5.500124
9fb66dc5-b1c0-4320-b644-b45105c6a17a
darshanp2005/My-DSA-Codes
17DP/dp class 3 codes/code2.cpp
#include <iostream> #include<vector> using namespace std; //index = index of last element int solveUsingRecursion(int weight[], int value[], int index, int capacity) { //base case -> only 1 item if(index == 0 ) { if(weight[0] <= capacity) { return value[0]; } else return 0; } //includ...
ALGO
0.999994
5.252904
dd8aef91-c83a-4361-87be-519be4046c0e
MahmudPinon/CodeForces
A_SpellCheck.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; double pi = acos(-1.0); #define allZero(a) memset(a,0,sizeof(a)); #define allnegOne(a) memset(a,-1,sizeof(a)); #define endl "\n" #define Boost ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); #define reverseS string(curr.rbegin(),curr.re...
ALGO
0.999863
5.177478
f10c9bbd-cf91-466a-81f5-4a81f4dbff6a
Nika1ex/my-projects-vault
193691/c++/9/9.16.7.cpp
#include <iostream> enum { max_length_ar = 20 }; using filter_func = bool (*)(int, int); int sum_elem(const int* ar, size_t len, filter_func filter) { int s = 0; for (int i = 1; i < len; ++i) if (filter(ar[i - 1], ar[i])) s += ar[i]; return s; } int main(void) { int marks[max_length_ar] = {0}; int coun...
ALGO
0.997619
4.221648
72823e8b-cb43-42a0-9a44-3c4475210565
calebeof/DailyCodingProblems
Day228.cpp
#include <bits/stdc++.h> using namespace std; /* This problem was asked by Twitter. Given a list of numbers, create an algorithm that arranges them in order to form the largest possible integer. For example, given [10, 7, 76, 415], you should return 77641510. */ vector<int> arr; string toString(int a){ strin...
ALGO
0.999882
5.855499
648d6e21-65b8-4497-82a6-fd57e961cedf
john4477/simplessd
src/systemc/tests/systemc/misc/user_guide/chpt11.4/mean.cpp
/***************************************************************************** mean.cpp -- Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15 *****************************************************************************/ /***************************************************************************** ...
ALGO
0.999378
4.597202
1436acf6-54b5-463f-8857-675fd0a5729f
KunYi/pcaoa
sw_droid_accessory_mode.cpp
#include <cassert> #include <cstdio> #include <cstring> #include <unistd.h> #include <libusb-1.0/libusb.h> #include <alsa/asoundlib.h> #include <pthread.h> struct { const uint16_t vid; const uint16_t pid; } const supportlists[] = { { 0x04e8, 0x6866 }, /* Samsung GT-N7100 */ { 0x2717, 0x1220 }, /* Xaomi HougMi *...
TOOL
0.886505
4.966397
e8318253-6402-45f8-ad80-6f0d5ee4ad69
gcoronelc/UC-2021-20-15795
Semana09/Semana9Programa3.cpp
#include<iostream> using namespace std; void sumar( ) { int a, b, c; cout<<"Ingrese valor de a: \t"; cin>>a; cout<<"Ingrese valor de b: \t"; cin>>b; c = a + b; cout<<c; } int main() { sumar( ); return 0; }
TOOL
0.885095
3.504675
fe481a15-4794-42fd-948a-f69417a20242
PhillipDiCarlo/The-Corruptor
ASRC Systems Simulation Driver/boost_1_74_0/libs/iterator/example/shared_iterator_example1.cpp
#include "boost/shared_container_iterator.hpp" #include "boost/shared_ptr.hpp" #include <algorithm> #include <iostream> #include <vector> typedef boost::shared_container_iterator< std::vector<int> > iterator; void set_range(iterator& i, iterator& end) { boost::shared_ptr< std::vector<int> > ints(new std::vector<i...
TOOL
0.962919
3.427441
1b65d6ac-60ba-4252-82d2-bff3717c4e70
WHOLEACS/LeetCode
349/code.cpp
class Solution { public: //求两个数组的交集 数组中的元素可能重复,但是最终得到的交集中元素不能重复 vector<int> intersection(vector<int>& nums1, vector<int>& nums2) { int len1 = nums1.size() , len2 = nums2.size(); if(len1 == 0 || len2 == 0) return {}; vector<int> solve; solve.clear(); sort(nums1.begin(),nums1.end()); sort(nums2.begin(),nums...
ALGO
0.999918
5.273187
52a184f6-87bd-4c13-9885-6e717c5eaf9b
Riaj509/Leetcode
1539. Kth Missing Positive Number.cpp
class Solution { public: int findKthPositive(vector<int> &arr, int k) { int l = 1, r = arr.size(); while (l <= r) { int mid = (l + r) >> 1; if (arr[mid - 1] - mid < k) l = mid + 1; else r = mid - 1; } re...
ALGO
0.999949
4.883212
627336ea-2c75-4d5d-bac1-4984bc02e07c
CICM/HoaLibrary-Max
Max3D/hoa.3d.decoder_tilde.cpp
/** @file hoa.3d.decoder~.cpp @name hoa.3d.decoder~ @realname hoa.3d.decoder~ @type object @module hoa @author Julien Colafrancesco, Pierre Guillot, Eliott Paris. @digest A 3d ambisonic decoder. @description <o>hoa.3d.decoder~</o> decodes an ambisonics soundfield for several loudspea...
TOOL
0.88858
5.635488
2b385e8f-febf-409a-9604-b9c8a65bb879
NaMooJoon/problem-solve
baekjoon/silver/14729/prob.cpp
#include<bits/stdc++.h> using namespace std; priority_queue<float, vector<float>, greater<float>> pq; void inputInit() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); int N; cin >> N; float grade; while (N--) { cin >> grade; pq.push(grade); } } void printResult() { ...
ALGO
0.999706
3.914854
79f2502b-b565-4648-a5e2-8ee3de083c8d
hfukuoka/atcoder
abc/262/c.cpp
#include <bits/stdc++.h> #include <atcoder/all> using namespace std; using namespace atcoder; #define ll long long #define rep(i, n) for (ll i = 0; i < n; ++i) #define rep_up(i, a, n) for (ll i = a; i < n; ++i) #define rep_down(i, a, n) for (ll i = a; i >= n; --i) #define P pair<ll, ll> #define all(v) v.begin(), v.en...
ALGO
0.995224
4.066313
976a54cb-d6a3-4193-8e8d-c8ee9837e37a
Frixinglife/ModifiedRBM
ModifiedRBM/Implementation/BellStateReconstructionWithMixing.cpp
#include "BellStateReconstructionWithMixing.h" #include "MatrixAndVectorOperations.h" #include "MetricsAndHelperFunctions.h" #include "TransitionMatrix.h" #include <iostream> #include <fstream> #include <string> #include <chrono> #include <cmath> MKL_Complex16* GetBellStateDensityMatrixWithMixing(double alpha) { M...
ALGO
0.999471
3.196417
fa43e014-40e3-4878-87ac-fd74334a5ca0
heavenMOJANG/ICPC
.history/2024牛客多校/牛客多校9/I_20240813134316.cpp
#pragma GCC optimize(1) #pragma GCC optimize(2) #pragma GCC optimize(3,"Ofast","inline") #include<bits/stdc++.h> #define int long long using namespace std; constexpr int INF = 0x7fffffff; void read(__int128 & n){ __int128 x=0,f=1; char ch=getchar(); while(ch<'0'||ch>'9'){if(ch=='-') f=-1;ch=getchar();} ...
ALGO
0.999844
4.846038
fa11a4e4-cf99-4b15-8e94-44f4a7b55ed5
FuChaolei/leetcode_ago
783.二叉搜索树节点最小距离.cpp
/* * @lc app=leetcode.cn id=783 lang=cpp * * [783] 二叉搜索树节点最小距离 * * https://leetcode-cn.com/problems/minimum-distance-between-bst-nodes/description/ * * algorithms * Easy (56.29%) * Likes: 161 * Dislikes: 0 * Total Accepted: 50.5K * Total Submissions: 85.9K * Testcase Example: '[4,2,6,1,3]' * * 给你一...
ALGO
0.999994
6.97348
783b480e-a948-4d46-823e-9a11afb956ee
raincross7/code-similarity
codes/train_code/problem345/problem345_173.cpp
#include <bits/stdc++.h> #define pi 3.14159 using namespace std; typedef long long LL; const LL MOD = 1e9 + 7; const int N = 1e5 + 7, M = 1e7, OO = 0x3f3f3f3f; #define AC ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); cin.sync_with_stdio(0); int main() { int n,x,y; cin>>n; x=n/15; y=x*200; cout<<n*800-y; ...
ALGO
0.999554
3.234606
45d8da69-f39f-46de-bc38-5bc90d2e4513
AceMouse/HPPC2024
week3/task_farm_skeleton.cpp
/* Assignment: Make an MPI task farm. A "task" is a randomly generated integer. To "execute" a task, the worker sleeps for the given number of milliseconds. The result of a task should be send back from the worker to the master. It contains the rank of the worker */ #include <iostream> #include <random> #inclu...
ALGO
0.999506
5.477107
beaa10fb-61a9-4941-bb41-793732cf28f1
hadiya39/OOPS
syllabus_6_date.cpp
/*create a class by name date with the member data as day, month and year. Perform the following: ● Overload all relational operators <,<=,>,>=,==,= ● Overload ++ operator to increment a date by one day ● Overload + to add given number of days to find the next date ● Provide the necessary function to use the state...
ALGO
0.985062
5.958267
52e6b93f-c896-4511-8ff5-81aaa20ed3d4
Muzahid037/Online-Judge-Problems
CodeForces/B. Berland Crossword.cpp
///"--------------------Bismillahir Rahmanir Rahim"-----------------------/// #include<bits/stdc++.h> using namespace std; ///_____________________________FAST I/O__________________________________/// #define Boost() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0); ///---------------------------------------------...
ALGO
0.999829
3.716335
5706f199-8d93-4380-a1c9-20d1591495d1
FrankNielsen/FrankNielsen.github.io
HPC4DS/MPIRingBroadcast.cpp
// filename: MPIRingBroadcast.cpp #include <mpi.h> int main(int argc, char *argv[]) { int rank, value, size; MPI_Status status; MPI_Init(&argc, &argv); MPI_Comm_rank(MPI_COMM_WORLD, &rank); MPI_Comm_size(MPI_COMM_WORLD, &size); do { if (rank == 0) {scanf("%d", &value ); /* Master Node sends out the value */ MPI_Send( ...
ALGO
0.997717
4.855984
66812ca4-26fb-4700-a42b-48d204da4d38
ganlubbq/communication-system-simulation
TBCC/Rate 1_2/ML/transmitter.cpp
#include "transmitter.h" #include "LAB524Rand.h" #include "cc.h" #include "modulator.h" int *generateDataBits(int FL, LAB524Rand* rng) { int *u = new int [FL +1]; u[0] = FL; // Generate random bits for (int i=1;i<=FL;i++) { u[i] = rng->getRandBinary(); } return u; } // Such that rx can find us....
ALGO
0.996119
4.298907
a6ee5701-c723-470a-822a-d3cb94339849
KanishkRAJ29/Leetcode
0131-palindrome-partitioning/0131-palindrome-partitioning.cpp
class Solution { public: bool ispalindrome(string sub) { int i = 0, j = sub.size() - 1; while (i <= j) { if (sub[i] != sub[j]) return false; i++; j--; } return true; } void recursive(int index, vector<string>& temp, vector<vector<string>>&...
ALGO
0.999981
6.718161
a4fe84fc-ba14-4e3a-9a01-65f6b399f40d
naiemofficial/Matrix-Multi-dimensional-Vector-and-Array
C++/Array/Matrix or 2D Array - print using while loop.cpp
#include <iostream> using namespace std; int main(){ int A[3][3] = { { 1, 2, 3 }, { 4, 5, 6 }, { 7, 8, 9 } }; cout << "Matrix: A" << endl; int row = 0; while (row < sizeof(A)/sizeof(A[0])) { int col = 0; while (col < sizeof(A[row])/sizeof(A[row][0])) { ...
ALGO
0.950636
3.47507
a174fd5a-5e65-40bc-8ee0-e272711f5555
blacksph3re/parallel_programming
addThreads.cpp
#include "matrix.hpp" #include <thread> int main(int ac, char* av[]) { if(readCmdLineArgs(ac, av) != 0) return 0; Matrix<double> a(file_a); Matrix<double> b(file_b); if(a.getRows() != b.getRows() || a.getCols() != b.getCols()) { std::cout << "Dimension mismatch!" << std::endl; return -1; } auto calc = ...
ALGO
0.864657
4.205473
040779f6-e0de-44be-9336-ed24a5b6b080
nei1ee/WDAlgorithmsNote
第10章数据结构二/10.4散列表/10-7查找学生信息.cpp
#include<iostream> #include<map> using namespace std; /**ѧϢ ʹmap߼Ч */ int main() { int n; cin>>n; getchar();//Եس map<string, string> student; string key,str; for(int pos,i=0; i<n; ++i) { getline(cin,str); pos = str.find(" "); key = str.substr(0,pos); student[key...
ALGO
0.994595
4.036288
1f8cdf65-68c6-41e0-ab7e-33f425402707
Stedd/AoC_2024
days/day02.cpp
// // Created by stedd on 02.12.24. // #include "day02.h" #include <fstream> #include <iostream> #include <iterator> #include <vector> #include <bits/fs_fwd.h> #include <bits/fs_path.h> void day02::Calculate() { //std::ifstream input("input/day02short.txt"); std::ifstream input("input/day02.txt"); if (!input) {...
ALGO
0.998834
5.578453
b3d567b0-218f-4c12-8976-427c67ed6bd2
Alvf/Collision-Penalty-Analysis
ext/eigen-3.3.7/bench/benchmarkXcwise.cpp
// g++ -O3 -DNDEBUG benchmarkX.cpp -o benchmarkX && time ./benchmarkX #include <iostream> #include <Eigen/Core> using namespace std; using namespace Eigen; #ifndef VECTYPE #define VECTYPE VectorXLd #endif #ifndef VECSIZE #define VECSIZE 1000000 #endif #ifndef REPEAT #define REPEAT 1000 #endif int main(int argc, c...
ALGO
0.983853
3.896122
b7e7641f-a520-4025-a064-bb4dea93a28b
Cbravor1991/Whorms
Editor/libs/box2d-2.4.0/src/dynamics/b2_chain_circle_contact.cpp
#include "b2_chain_circle_contact.h" #include "box2d/b2_block_allocator.h" #include "box2d/b2_fixture.h" #include "box2d/b2_chain_shape.h" #include "box2d/b2_edge_shape.h" #include <new> b2Contact* b2ChainAndCircleContact::Create(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* ...
ALGO
0.989986
6.13282
aa699bff-aacf-40ef-867e-6e14644ed0f6
evasilly/jtagBIST
misc/trace_fsm.cpp
#include <iostream> #include <vector> #include <map> #include <list> #include <algorithm> #include <string> #include <fstream> using namespace std; string str_to_hex(string s) { if (s == "0000") return "0"; if (s == "0001") return "1"; if (s == "0010") return "2"; if (s == "0011") return "3"; if (...
ALGO
0.998914
3.854793
9701858e-5398-4a1f-916c-cc79bd4061fa
Aartisahoo/Cpp-programs
p3displacement.cpp
#include <iostream> using namespace std; float displacement(float a,float u,float t) { //calculating displacement float disp; //initializing variables disp=u*t+0.5*a*t*t; return disp; } int main() { //calculating displacement float a,u,t,disp; //initializing variables cout<<"AARTI SAHOO 160...
ALGO
0.984581
3.616204
d1dd0efc-e0df-419c-9dc3-f3453130c1ed
sat-yad/codeforcesSolutions
CF_891_Div3_C.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long #define uin unsigned int #define ull unsigned long long #define ld long double #define fl(i,w,n) for(ll i=w;i<n;i++) #define rfl(i,w,n) for(ll i=w;i>=n;i--) #define F firs...
ALGO
0.9999
3.881434
6d0a7a6a-9ddc-486f-b9a8-f467c3496ced
suparna-ghanvatkar/AlgoClass
graph_traversals/prims.cpp
#include<iostream> #include<queue> #include "graph.h" #include<vector> #include<algorithm> using namespace std; int shortest(Graph &G,int node_no){ int pi[G.getno_of_nodes()]; for(int i=0;i<G.getno_of_nodes();i++) pi[i]=-1; char ch; //G.display(); vector<Node*> trav; //Node *st=G.start; //Node s=*st; cout<<G...
ALGO
0.999917
4.114265
4be906b1-f171-4727-9b8d-e4f9e450b1dd
ErickPetru/android_frameworks_base
media/libstagefright/codecs/amrnb/common/src/residu.cpp
/* Pathname: ./audio/gsm-amr/c/src/residu.c ------------------------------------------------------------------------------ REVISION HISTORY Description: Updated template used to PV coding template. First attempt at optimizing code. Description: Deleted stores listed in the Local Stores Needed/Modified...
ALGO
0.999938
4.224214
fe6be85c-b209-4ab5-b0aa-011453c3ef37
KatyaGalicia19/Practicas-en-C
programacion/SI-NO.cpp
#include <stdio.h> // Funcin para verificar si una casilla est en la diagonal del alfil int enDiagonal(int fila, int columna, int falfil, int calfil) { return (fila + columna == falfil + calfil) || (fila - columna == falfil - calfil); } int main() { int falfil, calfil; int fila, columna; // Posicin d...
ALGO
0.994294
4.234455
c4e7e101-c67c-4493-89d8-9a8ca8585763
mechusatveer/Data-Structure-Algorithm
Array/A^2+B^2=C^2.cpp
/* You are given a array and you need to print all triplets which follow this property A^2 + B^2 = C^2 We want all unique triplets. 3,4,5 & 4,3,5 both are same bcoz here only A & B swapped so print only once these type triplets. 1) Array can have duplicates 5,3,2,4,3,2,4 ==>2,3,4 are duplicate 2) Array have all ...
ALGO
0.999923
4.48784
4477afa6-1a44-46c9-8d4d-91e0837baa86
cfreeze111/ncnn_face_rec
third_party/ncnn/src/layer/x86/flatten_x86.cpp
#include "flatten_x86.h" #if __SSE2__ #include <emmintrin.h> #if __AVX__ #include <immintrin.h> #endif #endif // __SSE2__ #include "x86_usability.h" namespace ncnn { Flatten_x86::Flatten_x86() { #if __SSE2__ support_packing = true; #endif // __SSE2__ } int Flatten_x86::forward(const Mat& bottom_blob, Mat& top_...
ALGO
0.957617
6.014077
32d3fe64-2855-496e-84b9-d9717f6937dd
Jooyeon-Kimm/algorithm23-01
Week1/AddingArrayNumbers.cpp
/* Input: 6 10 7 11 5 13 8 Output: 54 */ #include <vector> using namespace std; int sum(int n, vector<int> S) { int result = 0; for (int i = 1; i <= n; i++) { result += S[i]; } return result; } int main() { int n; scanf("%d", &n); vector<int> S(n + 1); for (int i = 1; i <= n...
ALGO
0.999933
5.400572
1a33778a-61eb-4152-aaf0-5cc6811c2209
ishandutta2007/codeforces
_twilight/normal/1142/E.cpp
#include <bits/stdc++.h> using namespace std; typedef bool boolean; const int N = 1e5 + 5; int query(int u, int v) { printf("? %d %d\n", u, v); fflush(stdout); scanf("%d", &u); return u; } template <typename T> void pfill(T* pst, const T* ped, T val) { for ( ; pst != ped; *(pst++) = val); } typedef class Edge ...
ALGO
0.99995
3.954347
3544596c-5775-4282-b763-2d7e21855086
ishandutta2007/codeforces
tzc_wk/normal/1213/D2.cpp
#include <bits/stdc++.h> using namespace std; int n,k,a[200005],cnt[200005][25],can[200005],ans=0x3f3f3f3f; inline void calc(int x){ int tmp=x,cur=0; while(tmp){ cnt[tmp][cur]++;can[tmp]++; tmp>>=1; cur++; } cnt[0][cur]++;can[0]++; } int main(){ cin>>n>>k; for(int i=1;i<=n;i++){ cin>>a[i]; } for(int i=1...
ALGO
0.999988
3.947049
ac282a7b-f40f-444f-b432-8c2924a6a616
inaam-ullah/Data_Structures
Calculator Language/Calculator Language.cpp
#include<iostream> #include<string> #include<fstream> #include<cstring> #include<cmath> using namespace std; template <typename Object> class StackADT { public: virtual bool isEmpty() const = 0; virtual long sSize() const = 0; virtual Object peek() const = 0; virtual void push(const Object &) = 0; virtual Object ...
ALGO
0.999675
4.089551
983f563c-4c55-410b-978c-a25093687b9a
Jiwan/RADS
thirdparty/boost/libs/msm/doc/PDF/examples/DirectEntryTutorial.cpp
#include <vector> #include <iostream> // back-end #include <boost/msm/back/state_machine.hpp> //front-end #include <boost/msm/front/state_machine_def.hpp> namespace msm = boost::msm; namespace mpl = boost::mpl; namespace { // events struct event1 {}; struct event2 {}; struct event3 {}; struct eve...
TOOL
0.918392
5.6443
d45906b8-d2df-42f4-8676-bf07bbf4ffcd
FadyFawzyOfficial/candy_store
CH09/final/candy_store/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.998528
6.785645
0944449a-6622-45e5-b8a7-5db8f7a08a7c
ruiqini/traj-opt-admm
lib/eigen3/doc/examples/Tutorial_BlockOperations_block_assignment.cpp
#include <Eigen/Dense> #include <iostream> using namespace std; using namespace Eigen; int main() { Array22f m; m << 1,2, 3,4; Array44f a = Array44f::Constant(0.6); cout << "Here is the array a:" << endl << a << endl << endl; a.block<2,2>(1,1) = m; cout << "Here is now a with m copied into its cent...
ALGO
0.955732
3.331377
1d8c7aaa-c94f-4fce-ad0b-6e484c0a4abd
reisenx/CODEFORCES
7A_Kalevitch_and_Chess.cpp
#include<bits/stdc++.h> using namespace std; vector<string> horizontal, vertical; int main() { horizontal.resize(8); for(int i = 0; i < 8; i++) { cin >> horizontal[i]; } vertical.resize(8); for(int i = 0; i < 8; i++) { string temp; for(int j = 0; j < 8; j++) { temp.push_back(horizontal[j][i]); } vertical[i]...
ALGO
0.996774
4.020503
a761b647-2fef-4734-a337-47f81f078c68
vishal112005/c-program
vishal.c program/cout.div+++.cpp
#include<iostream> using namespace std; class divi { public: int a,b,c; void setvalue() { cout<<"enter the first number:"; cin>>a; cout<<"enter the scoend number:"; cin>>b; } void printdivi() { c=a/b; cout<<"divi="<<c; } }; int main() { divi s; s.setvalue(); ...
TOOL
0.984917
3.346793
09fb58bd-c7a9-4cb6-9884-b295a6230430
harshabarlanka/Music-Player
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.998859
6.785645
c170a7c4-c833-4f12-9ac4-6a4aa829d0e1
s106030605/NERDSS_on_DNA_colloid
Nerdss_initial_configuration/src/reactions/get_distance_to_surface.cpp
#include "reactions/bimolecular/bimolecular_reactions.hpp" bool get_distance_to_surface(int pro1, int pro2, int iface1, int iface2, int rxnIndex, int rateIndex, bool isStateChangeBackRxn, double& sep, double& R1, double Rmax, std::vector<Complex>& complexList, const ForwardRxn& currRxn, std::vector<Molecule>& ...
ALGO
0.998285
5.409359
d2b2ed99-3e98-42ce-886d-f548c435565e
tinku06071999/gfg-solutions
Medium/Knight in Geekland/knight-in-geekland.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 dx[8] = {-1, -2, -2, -1, 1, 2, 2, 1}; int dy[8] = {-2, -1, 1, 2, 2, 1, -1, -2}; int knightInGeekland(int start_x,int start_y,vec...
ALGO
0.999886
5.552089
f23d8019-6996-4201-bdea-da650b91f617
AdarshSharadPandey/100DaysOfCodeChallenge
Day 35/SemiOrderedPermutation(lcEasy).cpp
int semiOrderedPermutation(vector<int>& nums) { int f=0,l=0,n=nums.size(); for (int i = 0; i < n; i++) if (nums[i] == 1) f = i; int cnt = 0; while (f != 0) { int temp = nums[f]; nums[f] = nums[f - 1]; nums[f - 1] = temp; f--; cnt++; ...
ALGO
0.999991
4.59923
bed4d6e0-ff1b-4d89-b295-f53ba61a4462
rikuTanide/atcoder_endeavor
abc014/abc014_1.cpp
#include <bits/stdc++.h> #include <cmath> using namespace std; typedef long long ll; //typedef unsigned long long ll; #define rep(i, n) for (ll i = 0; i < (n); ++i) //#define sz(x) ll(x.size()) //typedef pair<int, int> P; typedef pair<ll, ll> P; //const double INF = 1e10; const ll INF = LONG_LONG_MAX / 100; //const l...
ALGO
0.999505
3.07563
5ce96019-deef-44d5-9e65-c8308c54f7ce
JiaWenHa/CoScan_ws
src/opencv/modules/ml/src/lr.cpp
// // This is a implementation of the Logistic Regression algorithm // #include "precomp.hpp" using namespace std; namespace cv { namespace ml { class LrParams { public: LrParams() { alpha = 0.001; num_iters = 1000; norm = LogisticRegression::REG_L2; train_method = LogisticRe...
DATA
0.9969
7.460437
72628ea8-bf5d-4045-80a6-7eceb9ed4a46
anquisbarr/POO1
Octubre/Arrays_de_dos_dimensiones.cpp
#include <iostream> using namespace std; // n > 4 y suma los elementos de la cuarta columna int main(){ int n,suma=0; cout<<"Ingrese n, siempre y cuando sea mayor a 4"<<endl; cin>>n; int array[n][n]; if (n>4){ for(int i=0;i<n;i++){ for(int j=0;j<n;j++) cin>>array[i][j]; } for(int i=0;i<n;i...
ALGO
0.99889
3.711886
8b8e6adb-9356-45ba-83ea-c1c2addf77f4
eeheueklf/BOJ
2302/2164.cpp
#include <iostream> using namespace std; int queue[1000000]; int main() { ios::sync_with_stdio(0); cin.tie(0); int N, front=1, back, temp; cin >> N; for(int i=1;i<=N;i++){ queue[i]=i; } back = N; if(N==1) { cout << "1"; return 0; } while(back-front!=1){ ...
ALGO
0.999977
3.751244
92ccf86b-3413-48fd-a54e-e5da878972f3
JUANFT11/Programacion-Paralela-2020-0
Laboratorio_03/Proyecto_Send_Message_01/src/Proyecto_SendMessage_01.cpp
#include "mpi.h" #include <iostream> using namespace std; int main(int argc, char *argv[]) { int rank, contador; MPI_Status estado; MPI_Init(&argc, &argv); // Inicializamos la comunicacion de los procesos MPI_Comm_rank(MPI_COMM_WORLD, &rank); // Obtenemos el valor de nuestro identificador //Envi...
ALGO
0.890177
3.809812
bb0de436-7e9d-414f-bc95-610a00aebc5f
M-Gjerde/DeblurredSalientDSO
src/OptimizationBackend/EnergyFunctional.cpp
#include "OptimizationBackend/EnergyFunctional.h" #include "OptimizationBackend/EnergyFunctionalStructs.h" #include "FullSystem/FullSystem.h" #include "FullSystem/HessianBlocks.h" #include "FullSystem/Residuals.h" #include "OptimizationBackend/AccumulatedSCHessian.h" #include "OptimizationBackend/AccumulatedTopHessian....
ALGO
0.993405
4.977637
fee5c013-9857-4f6b-a50e-264e94740667
MemoryOfStars/rehab
test/test/源.cpp
#include<stdio.h> #include<stdlib.h> int f(int* i, int* j) { *i += 4 + *j; printf("%d, %d\n", *i, *j); return *i + *j; } void main() { int x = 2; x = f(&x, &x); printf("%d\n", x); system("pause"); }
ALGO
0.982073
3.589033
3443b725-a5c1-4e37-974c-3c749a16da14
sa-y-an/leetAction
solutions/problems/check_if_array_pairs_are_divisible_by_k/solution.cpp
#pragma GCC optimize("Ofast") #pragma GCC target("tune=native") class Solution { public: Solution(){ ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); } bool canArrange(vector<int>& arr, int k) { vector < vector <int> > modulos(k); fo...
ALGO
0.999838
4.710906
797ddc51-70f3-4b52-a82f-a775fa1bafeb
stg0123/baekjoonlearn
brute force/baekjoon2752.cpp
#include <iostream> #include <algorithm> #include <vector> using namespace std; int main(){ vector<int> num; num.resize(3); for(int i=0;i<3;i++) std::cin >> num[i]; sort(num.begin(),num.end()); for(int i : num) std::cout << i <<' '; return 0; }
ALGO
0.999555
3.435299
87c48fb2-9555-4cc8-b163-fe2680af2533
kakaoleaves/baekjoon
프로그래머스/unrated/181187. 두 원 사이의 정수 쌍/두 원 사이의 정수 쌍.cpp
#include <string> #include <vector> #include <cmath> using namespace std; long long solution(int r1, int r2) { long long answer = 0; long long pow2r1 = r1 * r1; long long pow2r2 = r2 * r2; for (int i = 0; i < r2/sqrt(2); i++) { long long pow2i = i * i; answer += sqrt(static_cast<d...
ALGO
0.99965
3.36807
f84c9337-57d2-4898-8c99-d68840f848ff
ShivamShrivastav26112005/Merge-Sort-Algorithm-
MergeSort.cpp/Mergesort.cpp
// Practices -: // Ques -: merge the given two arrays // hints -: 3 pointers // #include<iostream> // #include<vector> // using namespace std; // void merge (vector<int>&a,vector<int>&b,vector<int>&res) // { // int i=0; // int j=0; // int k=0; // while(i<a.size() && j<b.size()) // { // if...
ALGO
0.999401
4.67149
a5c0620f-0152-4278-a8ce-cae6997c4ca9
levanlong2603/KTLT_laptrinh.ptit
KTTONG004 - Tổng luỹ thừa bậc n.cpp
#include <bits/stdc++.h> using namespace std; int main() { int t; cin >> t; while (t-- > 0) { int m, n; cin >> m >> n; vector<int> a; for (int i = 1; pow(i, n) <= m; ++i) { a.push_back(pow(i, n)); } vector<int> dp(m + 1, 0); ...
ALGO
0.999815
4.777635
51b93320-9019-48f1-be63-a61e143a21b5
CIBC-Internal/boost
libs/polygon/example/gtl_custom_polygon.cpp
#include <boost/polygon/polygon.hpp> #include <cassert> #include <list> namespace gtl = boost::polygon; using namespace boost::polygon::operators; //first lets turn our polygon usage code into a generic //function parameterized by polygon type template <typename Polygon> void test_polygon() { //lets construct a 10x1...
TEST
0.954993
7.7346
d5e9d5be-b43a-45b5-a3f8-17dd2a9ba24c
adrielschmitz/URI
1961.cpp
#include <iostream> #include <cmath> using namespace std; int main(void){ int atual, anterior, p, n; cin >> p >> n >> anterior; n--; while(n--){ cin >> atual; if(fabs(anterior-atual)>p){ cout << "GAME OVER" << endl; return 0; } anterior = atual...
ALGO
0.999839
3.361657
371c5366-29e1-42f8-bfaf-8d5d26169af4
jted0537/Baekjoon
1000++/1107.cpp
#include <iostream> #include <string> using namespace std; bool broken[11] = { false, }; bool checker(int n); int length(int n); int main() { int ornum; int n; int buf; cin >> ornum; cin >> n; for (int i = 0; i < n; i++) { cin >> buf; broken[buf] = true; } int ab...
ALGO
0.999018
3.41547
e9072130-9400-42e7-87cc-b4023737445c
ranjeet7287/DSA-cpp
PrepSeason1/Linked List/Assingment/duplicate_element.cpp
// Eliminate duplicates from LL // Send Feedback // You have been given a singly linked list of integers where the elements are sorted in ascending order. Write a function that removes the consecutive duplicate values such that the given list only contains unique elements and returns the head to the updated list. // I...
ALGO
0.999372
5.356246
45bd1ac9-4e72-48bb-9818-f758a6f50cf2
ddiez/motiftools
src/align_nw.cpp
#include <Rcpp.h> #include "misc.h" using namespace Rcpp; using namespace std; // Perform Needleman-Wunsch global alignment. // [[Rcpp::export]] List nw(CharacterVector x, CharacterVector y, Rcpp::Nullable<IntegerMatrix> score_matrix = R_NilValue, int gap_score = -1, int debug = 0) { IntegerMatrix sm; if (score...
ALGO
0.996722
5.184482
92ace8b6-29e8-443c-a2b8-5258637bf4e7
linqinluli/SJTU-OJ
1599/main.cpp
#include <iostream> using namespace std; class balance { public: int top; char a[1000000]; balance() { top=-1; } bool isempty() const { return top==-1; } void push(const char&x) { a[++top]=x; } void pop() { if(top==-1) ret...
ALGO
0.999458
4.254091
19010b16-ac54-4b83-8962-a68b6af5fe2b
Shivasurya7/DSA
Binary search/1011 Capacity To Ship Packages Within D Days - binary search.cpp
/* 1011. Capacity To Ship Packages Within D Days A conveyor belt has packages that must be shipped from one port to another within days days. The ith package on the conveyor belt has a weight of weights[i]. Each day, we load the ship with packages on the conveyor belt (in the order given by weights). We may not load m...
ALGO
0.999995
5.916692
09192198-3bfa-4b17-96b4-f5f6ce290520
coleutk/leetcode
1267.cpp
class Solution { public: int countServers(vector<vector<int>>& grid) { int m = grid.size(); int n = grid[0].size(); set<pair<int, int>> seen; // Go through each row and count servers for(int i = 0; i < m; i++) { // Count the number of servers per row ...
ALGO
0.999831
7.191482
5f23d8df-bfc7-41fa-8c50-b2603ecbaefa
Tangjiahui26/CrackingCode
Others-LeetCode&Geeksforgeeks/CaseInsensitiveStringComparison/main.cpp
#include <iostream> #include <algorithm> #include <string> #include <cctype> using namespace std; // C++ 11 Approach1: Using transfrom to all lowercase int caseInsensitiveMatch(string s1, string s2){ transform(s1.begin(), s1.end(), s1.begin(), ::tolower); transform(s2.begin(), s2.end(), s2.begin(), ::tolower...
ALGO
0.999137
4.694122
b15e8c7c-818b-45b4-ba08-57fe1b6e2863
gnaneshwar86/GLearnings
DSA/BST_InOrder.cpp
#include<iostream> using namespace std; struct node{ int d; node *l,*r; }*root=NULL,*newn=NULL; node* insert(node* root,int n){ if(root==NULL){ newn=new node(); newn->d=n; newn->l=NULL; newn->r=NULL; return newn; } else{ if(n<root->d) root->l=i...
ALGO
0.999929
4.991957
930c4fd4-b77f-4a40-a8fc-aa8d0f37a5b7
IvanTicona/Competitive-Programming
Club/Vacaciones/TeoriaDeNumeros/mixedFractions.cpp
#include<bits/stdc++.h> using namespace std; int main(){ unsigned int numerator, denominator; while (cin>>numerator>>denominator&&numerator!=0&&denominator!=0){ int entire=0; while(numerator>=denominator){ numerator-=denominator; entire++; } cout<<entire<<" "<<" "<<numerator<<" / "<...
ALGO
0.999003
4.396674
b611c30d-5140-455c-9cc2-8679ba31ca50
burmyakov/exact-sched-test-gfp-2015
sched_test.cpp
#include <iostream> #include <map> #include <queue> #include <string> #include <algorithm> #include "ts.h" #include "state.h" #include "stateCompact.h" using namespace std; int m; // Global FP (priority ordering given by indices, index 1 == highest priority) bool prefer(const state& s, int i, int k) { if(s.c[i]=...
ALGO
0.999567
5.502706
51ff3fd7-ca5d-4cd4-8324-a8b03f18aa10
RenanTashiro/URI
code/Ad-Hoc/p-level-5/2301.cpp
/* Nome: Vivo ou Morto ID: 2301 Resposta: Accepted Linguagem: C++ (g++ 4.8.5, -std=c++11 -O2 -lm) [+0s] Tempo: 0.180s Tamanho: 970 Bytes Submissao: 27/10/16 11:05:03 */ #include <bits/stdc++.h> using namespace std; int main() { int P, R, teste = 1; while(scanf("%d%d", &P, &R) && P != 0) ...
ALGO
0.9989
3.541334
9507d746-2873-4311-9808-aaae0e36c919
Earqee/t-calopsita
SIMPLEX/tsp-MTZ/tsp-MTZ.cpp
#include <bits/stdc++.h> #include <ilcplex/ilocplex.h> #define E 1e-7 using namespace std; ILOSTLBEGIN int main() { try { IloEnv env; IloModel model(env); IloCplex blackBox(model); long N, M, in, out, weight; cin >> N; #define MAX_T (1e6) long long W[N][N] ...
ALGO
0.999936
3.937823
102bf92b-702b-44b2-abca-5b6831553ef1
gMihMih29/hse-cpp-2022-2023
tasks/chocolate/chocolate.cpp
#include "chocolate.h" bool CanBreakSlices(int height, int width, int slices_amount) { for (int i = 1; i < width; ++i) { if (i * height == slices_amount) { return true; } } for (int i = 1; i < height; ++i) { if (i * width == slices_amount) { return true; ...
ALGO
0.966906
4.614541
cbe81343-f85a-4aa2-b8f1-ea29b9c46f2d
zhivko-kocev/object-oriented-programming
kol2/task_4.cpp
#include <cstring> #include <iostream> using namespace std; /* Да се креира апстрактна класа Pizza за опишување пици. (5 поени) За секоја пица се чуваат следните информации: име (низа од максимум 20 знаци) состојки (низа од максимум 100 знаци) основна цена (реален број) Од оваа класа да се изведат класите FlatPizza и ...
TOOL
0.887708
4.320839
794714d3-5ddf-470a-ac84-1052d0e3ff0f
towmiess/DSA_PTIT
web_DSA/test/test2/ctdl_tohop.cpp
#include <bits/stdc++.h> using namespace std; int k; string s;int x[1005]; set<string>p; void sl(int i) { for (int j = x[i - 1] + 1; j <= s.size()- 1-k + i; j++) { x[i] = j; if (i == k) { string tmp = ""; for (int h = 1; h <= k; h++) { tmp += s[x[h]]; } p.insert(tmp); } else sl(i + 1); } } int ...
ALGO
0.999235
3.789216
60fc3092-39c5-4de2-b1cc-72a4dd16ef06
ChettriBishal/CP
LeetCode/Algorithms/Maximum_Subarray_Sum_Circular.cpp
class Solution { public: int maxSubarraySumCircular(vector<int>& nums) { int n = nums.size(); int minsum = nums[0], maxsum = nums[0]; int currmin = 0, currmax = 0; int sum = 0; for(auto &x: nums){ sum += x; currmin = min(x, currmin + ...
ALGO
0.99994
6.272301
f59e415f-5306-47ea-a5c4-adddd425f127
ferez96/Road2BlackRed
2018/100CodechefEasyProblems/NAME2.cpp
/* * NAME2.cpp * * Created on: Nov 17, 2017 * Author: thaiminh */ #include <bits/stdc++.h> using namespace std; #define size(x) ((int) x.size()) bool check(string a, string b){ int i =0, j=0; while(i<size(a)&&j<size(b)) if (a[i] == b[j]) i++, j++; else j++; return i==size(a); } void solve(){ ios_ba...
ALGO
0.999967
5.766206
0cce7b9d-4576-456f-a278-16cbe38f7c48
shokushwaha/Striver-SDE-Sheet-Challenge-2023
Binary Search/Agressive_books.cpp
bool valid(vector<int> &arr, int k, int a) { int n = arr.size(); int prev = arr[0]; int cnt = 1; for (int i = 1; i < n; i++) { if (arr[i] - prev >= a) { cnt++; prev = arr[i]; } } return cnt >= k; } int aggressiveCows(vector<int> &ar...
ALGO
0.999992
4.641417
1f1b18d1-19a1-4031-a1ba-691070a8d07f
ugozapad/xray-2212
Editors/!old/LevelEditor/Engine/interp.cpp
//====================================================================== //interp.c // //Interpolation (and extrapolation) of LightWave envelopes. // //Ernie Wright 16 Nov 00 // //The LightWave plug-in SDK provides functions for evaluating envelopes //and channels at arbitrary times, which is what plug-ins should use....
ALGO
0.998896
4.855493
f950d8d7-1203-4ea2-ad3b-5059f2561435
EeVakEn/omstu-c-labs
lab06.cpp
/* Программирование алгоритмов обработки одномерных массивов Задание 1 2. Дан массив из N чисел (10<N<15). Найти максимальное значение. Задание 2 Модифицировать программу 3_2 для функций F1(x) и F2 (x) таким образом, чтобы результаты были сформированы в виде трех одномерных массивов. Выполнить ее и сравнить резул...
ALGO
0.99983
4.893883
763962c7-ed11-4343-a13c-f6d6f4583393
acquaman/acquaman
source/Eigen/doc/snippets/MatrixBase_marked.cpp
#ifndef _MSC_VER #warning deprecated #endif /* Matrix3d m = Matrix3d::Zero(); m.part<Eigen::UpperTriangular>().setOnes(); cout << "Here is the matrix m:" << endl << m << endl; Matrix3d n = Matrix3d::Ones(); n.part<Eigen::LowerTriangular>() *= 2; cout << "Here is the matrix n:" << endl << n << endl; cout << "And now h...
ALGO
0.98809
3.752687
85f6a4af-6435-4b72-8606-d8b7e07d6500
sydbarrett/AlphaPathMoves
Sources/BK/graph.cpp
/* graph.cpp */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include "graph.h" #include <iostream> template <typename captype, typename tcaptype, typename flowtype> Graph<captype, tcaptype, flowtype>::Graph(uint64_t node_num_max, uint64_t edge_num_max, void(*err_function)(char *)) : node_num(0), no...
ALGO
0.980647
6.776531
eb39cdf8-4973-48e2-b27f-f9c5558f0138
wcysai/Calabash
2019 Multi-University Training Contest 4/G.cpp
#include<bits/stdc++.h> #define MAXN 200005 #define INF 1000000000 #define MOD 1000000007 #define F first #define S second using namespace std; typedef long long ll; typedef pair<int,int> P; int T,a[17]; bool vis[17]; int main() { scanf("%d",&T); while(T--) { int id=-1; for(int i=1;i<=16;i++...
ALGO
0.999848
3.359794
67276ba4-5ba2-4b4b-b2b4-83f963e7e9b8
synaodev/apostellein
lib/src/tmxlite/miniz.cpp
#include "miniz.h" typedef unsigned char mz_validate_uint16[sizeof(mz_uint16) == 2 ? 1 : -1]; typedef unsigned char mz_validate_uint32[sizeof(mz_uint32) == 4 ? 1 : -1]; typedef unsigned char mz_validate_uint64[sizeof(mz_uint64) == 8 ? 1 : -1]; #ifdef __cplusplus extern "C" { #endif /* ------------------- zlib-style ...
TOOL
0.979256
7.426547
c6affd79-f44c-46ff-bfd8-6ccccef65443
sneharaoganta/IPMP1921
week 6/Greedy/extra questions-hackerank,leetcode/bestTinetobuyandsellstocksII_leetcode.cpp
//https://leetcode.com/problems/best-time-to-buy-and-sell-stock-ii/ class Solution { public: int maxProfit(vector<int>& prices) { int len = (int)prices.size(); if(len <= 1) { return 0; } int sum = 0; for(int i = 1; i < len; i++) { if(prices[i] - price...
ALGO
0.999512
6.316264
912d7269-4738-4e91-9811-aac020713571
byungsujeong/Foreigner
venv/Lib/site-packages/pystan/stan/lib/stan_math/lib/boost_1.69.0/libs/units/example/radar_beam_height.cpp
/** \file \brief radar_beam_height.cpp \details Demonstrate library usage for user test cases suggested by Michael Fawcett. Output: @verbatim //[radar_beam_height_output radar range : 300 nmi earth radius : 6.37101e+06 m beam height 1 : 18169.7 m beam height 2 : 9.81085 nmi beam height 3...
TOOL
0.966973
6.463691
797ab968-4b83-49eb-95a0-8b78a7f5c140
lovely2001/DSA_Practice
Basics/variableanddatatypes/sumof2numbers.cpp
#include<iostream> using namespace std; int main(){ int num1; int num2; cout<<"Enter the value of num1 : "<<endl; cin>>num1; cout<<"Enter the value of num2 : "<<endl; cin>>num2; int sum; sum=num1+num2; cout<<"Sum of 2 number is : "<<sum<<endl; }
TOOL
0.976119
3.692505
89a73375-ddac-49d7-9221-dc830afa01d2
FrancescoSuma01/School
3_Anno/Informatica/Esercizio 13/13.4.cpp
#include <iostream> #include <time.h> using namespace std; int numeri[20]; float pari=0; int a=0; float media=0; int main(){ srand(time(NULL)); for(int i=0; i<20; i++){ numeri[i]=rand()%11; if(numeri[i]%2==0){ pari=pari+numeri[i]; a++; } } for(int b=0; b<20; b++){ cout<<numeri[b]<<endl; } media=pa...
ALGO
0.985776
3.501372