uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
7c3e3bf7-c3a3-466a-a7f8-2ad26a8804b5
piankabianka/MES
BiankaDudaProjektMES/Grid.cpp
#include "stdafx.h" #include "Node.h" #include "Element.h" #include "GlobalData.h" #include "Grid.h" #include <iostream> using namespace std; void Gauss(double**macierz, double*X, int n); Grid::Grid() { conductivity = 25; convection = 300; specyficHeat = 700; density = 7800; ambientTemp = 1200; timeStep = 1; i...
ALGO
0.999779
4.050346
b1cafb41-3296-48c4-a860-bdb5615e2599
AbhishekHacks/DSA-Solutions
Arrays/LeetCode_238.cpp
/*Given an integer array nums, return an array answer such that answer[i] is equal to the product of all the elements of nums except nums[i]. The product of any prefix or suffix of nums is guaranteed to fit in a 32-bit integer. You must write an algorithm that runs in O(n) time and without using the division operatio...
ALGO
0.999937
6.04235
a3f5303a-3b39-4d0b-bdce-471c94abcbc4
SeyfertCode/SeyfertUvaCode
455 - Periodic Strings.cpp
//Laxus - Seyfert #include<iostream> #include<set> using namespace std; int repeat(string); int main(){ int N; cin>>N; for(int i=0;i<N;i++){ string s; if(i>0)cout<<endl<<endl; cin>>s; cout<<repeat(s); } cout<<endl; return 0; } int repeat(string s){ int aux=1,lon=s.length();...
ALGO
0.999865
3.448337
8bca9839-6fa9-4dec-8b9b-33f8c8bbca35
vlada270/VladaVoronina_CSC_51074_EP
TD4/src/LaplacianMesh.cpp
#include "LaplacianMesh.h" #include "Eigen/IterativeLinearSolvers" using Eigen::MatrixXd, Eigen::MatrixXi, Eigen::VectorXd, Eigen::Vector3d; LaplacianMesh::LaplacianMesh(/* args */){} LaplacianMesh::~LaplacianMesh(){} void LaplacianMesh::compute_dirichlet(){ //TODO std::vector<Eigen::Triplet<double>> triple...
ALGO
0.999532
5.406993
c96346a9-7e0b-414c-9b1b-d5cf90b39ada
ssqstc/Cpp_Primer_Plus
Chapter_17/04_main_Chapter17.cpp
#include <iostream> // 标准输入输出流库 /* 知识点总结: 1. `cout.width()`:设置输出字段的宽度。此设置只对下一个输出有效,之后会自动恢复默认宽度。 2. `cout` 的返回值:`cout.width()` 返回上一次设置的字段宽度。 3. 循环结构:通过循环控制不同数字的输出格式,观察宽度设置的效果。 注意点: 1. `cout.width()` 只影响紧随其后的输出操作。 2. 设置的宽度若小于输出内容的实际长度,则内容会超出指定宽度。 */ using namespace std; int main() { // 设置并获取默认的字段宽度...
TOOL
0.98367
4.912666
09b5b60f-ab32-4b8f-99fa-6128a58d0c86
Boberito25/ButlerBot
armplanning_test/Eigen/bench/spbench/sp_solver.cpp
// Small bench routine for Eigen available in Eigen // (C) Desire NUENTSA WAKAM, INRIA #include <iostream> #include <fstream> #include <iomanip> #include <Eigen/Jacobi> #include <Eigen/Householder> #include <Eigen/IterativeLinearSolvers> #include <Eigen/LU> #include <unsupported/Eigen/SparseExtra> //#include <Eigen/Sp...
ALGO
0.982341
4.29849
b94efec0-8d74-4d1d-9e9f-877f34d4bc2e
KhaledHegazy222/Problem-Solving
UVA/10459/main.cpp
// #include <bits/stdc++.h> // #ifndef Khaled // #define endl '\n' // #endif // #define fast cin.tie(0),ios::sync_with_stdio(0),cout.tie(); // #define all(a) a.begin(),a.end() // typedef long long ll; // typedef unsigned long long ull; // using namespace std; // const int N = 5e3 + 5,M = 2*N; // int head[N],to[...
ALGO
0.999457
4.47504
82f119fd-e27e-4147-baf8-a4a78a216f2a
enria/algorithm-problem
pta/pat_a/1032.cpp
#include <string.h> #include <iostream> using namespace std; int nextp[100000]; int len(int start) { int l = 0; while (start > -1) { l++; start = nextp[start]; } return l; } int main() { memset(nextp, -1, sizeof(int) * 100000); int s1, s2, n; cin >> s1 >> s2 >> n; for...
ALGO
0.999982
3.514676
d80aca91-4bf6-4273-bb40-8f8e6b5dcd1b
SwaksharDebnath/Competitive-Programming-Templates
sorting/insertion sort.cpp
#include<bits/stdc++.h> using namespace std; #define ll long long int int main() { ll n,j; cout<<"n:"; cin>>n; vector<ll>v(n+1); for(ll i=1;i<=n;++i) cin>>v[i]; for(ll i=2;i<=n;++i) { j=i; while(j>1 && v[j]<v[j-1]) { swap(v[j],v[j-1]); ...
ALGO
0.999985
3.997137
39e9f303-9495-4671-90ac-7ef844116421
qwix456/Confirm-Quit
jni/include/cocos2dx/math/MathUtil.cpp
#include "math/MathUtil.h" #include "base/ccMacros.h" #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) #include <cpu-features.h> #endif //#define USE_NEON32 : neon 32 code will be used //#define USE_NEON64 : neon 64 code will be used //#define INCLUDE_NEON32 : neon 32 code included //#define INCLUDE_N...
TOOL
0.97243
6.360316
7b18c595-4884-4028-a8e4-3c6f0f3f5639
reverg/PS
boj/2580.cpp
#include <iostream> using namespace std; bool col[10][10], row[10][10], sqr[10][10]; int ans[10][10]; bool fill(int k) { if (k == 81) return true; int i = k % 9; int j = k / 9; if (ans[i][j] == 0) { for (int t = 1; t <= 9; t++) { if (!col[j][t] && !row[i][t] ...
ALGO
0.999891
4.660499
16b15d0f-254e-4cda-89b9-fe891ec18ad6
ashish7472/DSA
GRAPH/Bridge.cpp
#include<unordered_map> #include <list> #include<vector> void dfs(int node, int parent, vector<int> &discT, vector<int> &low, vector<bool> &visited, vector<vector<int>> &result, unordered_map<int, list <int> > &adj, int &timer) { visited[node] = true; discT[node] = low[node] = timer++; for(auto neighbo...
ALGO
0.999952
5.483106
494b5c01-f33d-48aa-8d7b-628459e4adbf
Akhileshramks/LeetCode_Solution
0222-count-complete-tree-nodes/0222-count-complete-tree-nodes.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.99991
6.511303
ace71ffa-5be6-4d5c-a0ac-51cf7405e654
YunanZzz/Disk_based_vector
faiss/utils/NeuralNet.cpp
#include <faiss/utils/NeuralNet.h> #include <algorithm> #include <cstddef> #include <cstring> #include <faiss/impl/FaissAssert.h> #include <faiss/utils/distances.h> /* declare BLAS functions, see http://www.netlib.org/clapack/cblas/ */ extern "C" { int sgemm_( const char* transa, const char* transb...
ALGO
0.994521
6.58403
dad0360c-1f22-4644-9615-f06ba86ef0e9
Mouni560/leetcode
40-combination-sum-ii/combination-sum-ii.cpp
class Solution { public: void backtrack(vector<int>& candidates, int target, int start, vector<int>& current, vector<vector<int>>& result) { if (target == 0) { result.push_back(current); return; } for (int i = start; i < candidates.size(); ++i) { ...
ALGO
0.999989
6.668136
317564de-c1ca-4408-a38d-701ba856e466
Ashsifat1511/CP-Solves
Bi_shoe_and_Phi_shoe.cpp
#include <bits/stdc++.h> using namespace std; bitset<6000008> mark; void sieve() { mark[0] = mark[1] = 1; for (int i = 4; i <= 4e6; i += 2) mark[i] = 1; for (int i = 3; i * i <= 4e6; i += 2) { if (!mark[i]) { for (int j = i * i; j <= 4e6; j += 2 * i) m...
ALGO
0.999332
3.465514
dc1201ec-373c-4192-9780-351e4ae3b271
Fss7/dataset
AtCoder dataset/abc043/A/3584251.cpp
#include <iostream> using namespace std; int main() { int N; cin >> N; cout << N * (N + 1) / 2 << endl; return 0; }
ALGO
0.998652
4.991715
05c70838-0d87-486f-9b55-4b87611023de
lnghiemum/RMIR-paper
RMIR/RMIR_MCEM_update_allcontinuous+qbinary.cpp
#include <RcppArmadillo.h> using namespace Rcpp; // [[Rcpp::depends(RcppArmadillo)]] using namespace arma; static double const log2pi = std::log(2.0 * M_PI); void inplace_tri_mat_mult(arma::rowvec &x, arma::mat const &trimat){ arma::uword const n = trimat.n_cols; for(unsigned j = n; j-- > 0;){ double tmp(0...
ALGO
0.999966
6.213262
7a218b3b-bcdd-47d9-94b2-9a7b85bc7872
nalfod/SudokuSolver
Project1/main.cpp
#include <iostream> #include <vector> #include <bitset> #include <vector> #include <utility> //Converter: std::vector<short> convertBitmaskToShorts(short const bitmask); //Excluders: void excludeSingleNumInRow(char num, int currentRow, int currentColumn, std::vector<std::vector<short>>& bitsetBoard, std::vector<std::...
ALGO
0.998084
4.961781
99975e8e-2fe8-4b1e-b8f7-7c27a5b74fe9
pronad1/Problem_Solving_Part1
MEX_Game.cpp
//Author : PROSENJIT MONDOL #include<bits/stdc++.h> #define lower(s) transform(s.begin(), s.end(), s.begin(), ::tolower); #define upper(s) transform(s.begin(), s.end(), s.begin(), ::toupper); using namespace std; const int inf = 3e5; using ll=long long ; ll mod = 1e9 + 7; //-----------------------------------------...
ALGO
0.999909
4.521689
90cbb226-e79e-4dc7-84fc-970695a1b4b2
MaheshSharan/LeetCode_Automation
solutions/1500-1599/1546.Maximum Number of Non-Overlapping Subarrays With Sum Equals Target/Solution.cpp
class Solution { public: int maxNonOverlapping(vector<int>& nums, int target) { int ans = 0, n = nums.size(); for (int i = 0; i < n; ++i) { unordered_set<int> vis{{0}}; int s = 0; while (i < n) { s += nums[i]; if (vis.count(s - targ...
ALGO
0.999971
6.172557
654ef5e9-ef05-4628-9714-950f62944bce
Inferno20055/C-zadachi
ConsoleApplication12/ConsoleApplication12/ConsoleApplication12.cpp
#include <iostream> using namespace std; int main() { setlocale(LC_ALL, "Ru"); /*const int a = 12; int train[a]; train[0] = 3; train[1] = 1; train[2] = 4; cout << "start adress " << train << endl; cout << "train[0] = "<<train[0]<<endl; cout << "train[1] = " << train[1] << endl; c...
ALGO
0.998989
3.42837
05e0bbda-4fa5-43a2-a25f-8451398fcee3
its-leviosaa/cpp-pattern-type-questions
Q5.cpp
//While giving input 4 this is the output // * // * * // * * * // * * * * #include<iostream> using namespace std; int main() { int n; cin>>n; int i=1; while(i<=n) { int j=1;//column 1 se start while(j<=i) { cout<<"* "; j++; } i++; ...
ALGO
0.999957
3.826908
1ff016b7-6858-4d04-a211-1b0cfc95b7ef
sirilcodes/Praat_Test
praat-master/dwsys/NUMsort2.cpp
/* djmw 20030121 Initial version djmw 20030627 Removed bug in MACRO_NUMindex djmw 20120305 Latest modification */ #include "NUM2.h" #include "melder.h" /* NUMsort2 uses heapsort to sort the second array in parallel with the first one. Algorithm follows p. 145 and 642 in: Donald E. Knuth (1998): The art of comp...
ALGO
0.99999
5.585526
710231a4-2bba-4fc9-992d-eb6324e23188
nealsaxena27/LAB-CS207
exp02a.cpp
# include <bits/stdc++.h> using namespace std; class job{ public: int arrival_time; int burst_time; int job_id; }; void input_jobs(job arr[], int n){ int r, e; for(int i = 0; i < n; i++){ cout<<"Enter release time: "; cin>>r; cout<<"Enter execution time: "; cin>>e; ...
ALGO
0.999875
3.977059
b78b21c8-2900-4c87-b984-b4ca55fca55c
PaoloGraziani/TA1
examples/example-contest/mediana_x/cor/correttore.cpp
// problem: ordina_x, Romeo Rizzi Mar 2015 #include <iostream> #include <fstream> #include <cstdlib> #include <string> #include <map> using namespace std; ifstream *fin; ifstream *fcor; ifstream *fout; void ex(const char *msg, float res) { if(msg) { fprintf(stderr, "%s ", msg); } printf("%f\n", res); exi...
ALGO
0.986073
3.422778
de2061e0-d80b-4f5a-b49d-7bdd8fc0ad7a
chitresh-git/leetCode
45-insertionBST.cpp
#include <iostream> #include <math.h> using namespace std; // INSERTION IN BST // 26.7.22 struct Node { int data; Node *right; Node *left; }; Node *create(int data) { Node *n = new Node; n->data = data; n->left = NULL; n->right = NULL; return n; } void linked(Node *root, Node *l, No...
ALGO
0.999888
4.81264
4768b360-56af-4c7d-855e-e9594d4f8aad
AbhJ/some-cp-files-2
codeforces1557C.cpp
/** * @author : abhj * @created : Monday Aug 16, 2021 11:09:42 IST * @filename : c.cpp */ #include "bits/stdc++.h" #define int long long int #define mp make_pair #define pb emplace_back #define F first #define S second using vi = std::vector<...
ALGO
0.999955
4.486471
35239cc7-e5c9-47f2-a8ca-e674a8b42726
SouravJyotiNath/SQL50
23124-835-56-merge-intervals/23124-835-56-merge-intervals.cpp
class Solution { public: vector<vector<int>> merge(vector<vector<int>>& intervals) { int n = intervals.size(); vector<vector<int>> ans; sort(begin(intervals), end(intervals)); ans.push_back(intervals[0]); for(int i = 1; i<n; i++){ if(intervals[i][0] <= ans.bac...
ALGO
1
6.077281
51526ff5-16d1-4f25-89a1-d23238275294
vikashmalakar275/Data_Structure_and_Algorithm
takeUforward/Strivers_A2Z_DSA_Course/Solve_Problems_on_Arrays/Easy/Find_the_missing_number_in_an_array.cpp
/* Problem Statement: Given an integer N and an array of size N-1 containing N-1 numbers between 1 to N. Find the number(between 1 to N), that is not present in the given array. Examples Example 1: Input Format: N = 5, array[] = {1,2,4,5} Result: 3 Explanation: In the given array, number 3 is missing. So, 3 is the ans...
ALGO
0.999899
5.797132
6341a562-982b-4ed9-ad4d-e176c14fe0a8
volpx/kompot
src/numerov.cpp
#include <numerov.hpp> #include <iostream> // Normal numerov integration using y[0],y[1] as initial conditions void numerov_integrate( double y[], const double a, const double h, const uint64_t N, std::function<double(double)> V, const double E) { const double h2 = h * h; double k2, k_i2, k_ii2; k_ii2 = 2. * (E...
ALGO
0.999921
4.51375
3f5a338b-bf5d-4344-a4e3-6c5cdf17f7f0
Jadecity/SoftSeg
Graph_seg/Graph_seg_gray.cpp
// Graph_seg_gray.cpp : Defines the entry point for the DLL application. // #include "stdafx.h" #include "Graph_seg_gray.h" #include "mex.h" //MATLAB API #include "c_GraphSeg_gray.h" /* #pragma comment(lib, "libmx.lib") #pragma comment(lib, "libmat.lib") #pragma comment(lib, "libmex.lib") BOOL APIENTRY DllMain( H...
ALGO
0.991136
3.170545
025ef15d-487e-46bb-ab12-103649b56a71
tylee11/cppWorkspace
baseC/baseC/CommuMultipleOperation.cpp
#include <iostream> using namespace std; class Point { private : int xpos, ypos; public : Point(int x =0,int y=0) :xpos(x),ypos(y) {} void ShowPosition() const { cout << xpos << ' ' << ypos << endl; } Point operator*(int times) { Point pos(xpos * times, ypos * times); return pos; } friend Point operator*(...
TOOL
0.961738
4.322676
8135df79-c234-46f6-9315-115a6110e79b
Sivasathwik/192211146
10.Summing up cubes of n numbers.cpp
#include<stdio.h> #include<conio.h> int main() { int n,sum; printf("enter the value of n:"); scanf("%d",&n); sum=(n*n)*((n+1)*(n+1))/4; printf("sum of square of %d natural numbers = %d",n,sum); }
ALGO
0.999585
3.385546
d4696ceb-da9c-495f-b25c-dd2115c18c2f
DhruvPandey1509/Vscode-Program-Folders
Problem-Solutions/String_Compression.cpp
#include "bits/stdc++.h" using namespace std; class Solution { public: int compress(vector<char> &chars) { int i = 0, idx = 0; int n = chars.size(); while (i < n) { int j = i; while (j < n and chars[j] == chars[i]) { j++; ...
ALGO
0.999969
6.029301
43450c72-fd6e-4bfb-b562-6c303bf0c933
mathlover777/OSLAB
labtest.cpp
#include <stdlib.h> #include <stdio.h> #include <sys/ipc.h> #include <sys/sem.h> #include <sys/shm.h> #include <sys/wait.h> #include <unistd.h> #include <time.h> #include <math.h> /*********************** Constants to control *******************/ #define BMAX 5 #define MAXPRODSLEEP 5 #define MAXCONSUMERSLEEP 5 #define...
TOOL
0.938942
4.092842
b776b5db-fc36-4ff6-a305-f8813575ed18
guilhemheinrich/XEcryption
stringhelper.cpp
#include "stringhelper.h" std::vector<ul> findAll(std::string in_sInputString, std::string in_sSplitter) { std::vector<ul> out_vVectorIndexOfMatches; size_t stPositionOfMatch = in_sInputString.find(in_sSplitter, 0);; while (stPositionOfMatch != std::string::npos) { out_vVectorIndexOfMatches.pu...
TOOL
0.996015
4.770982
f967d02d-60d4-4d65-9cdc-f66762eca424
ishandutta2007/codeforces
cephian/normal/1055/C.cpp
#include <bits/stdc++.h> #define print(x) cerr << #x << " = " << x << endl; using namespace std; typedef pair<int, int> pii; typedef long long ll; int main() { ios::sync_with_stdio(0),cin.tie(0),cout.tie(0); ll l, r, t; ll L, R, T; cin >> l >> r >> t; cin >> L >> R >> T; if(T > t) { swap(l, L); swap(r, R); ...
ALGO
0.999956
4.075838
12476e76-babc-41a3-9779-295f8701f568
brobwind/pie-device-brobwind-rpi3-mesa3d
src/compiler/glsl/loop_unroll.cpp
#include "compiler/glsl_types.h" #include "loop_analysis.h" #include "ir_hierarchical_visitor.h" #include "main/mtypes.h" namespace { class loop_unroll_visitor : public ir_hierarchical_visitor { public: loop_unroll_visitor(loop_state *state, const struct gl_shader_compiler_options *options)...
ALGO
0.997958
3.124173
e3a5d2b4-a574-4c77-a81b-a8abb2e8442d
kunyavskiy/competitive-programming-archive
opencup/16-17/170205/F.cpp
#include <bits/stdc++.h> #define mp make_pair #define pb push_back #ifdef LOCAL #define eprintf(...) fprintf(stderr,__VA_ARGS__) #else #define eprintf(...) #endif #define TIMESTAMP(x) eprintf("["#x"] Time : %.3lf s.\n", clock()*1.0/CLOCKS_PER_SEC) #define TIMESTAMPf(x,...) eprintf("[" x "] Time : %.3lf s.\n", __VA_AR...
ALGO
0.999851
3.840678
c28c01e8-34e0-4c74-bf9f-196313de2039
ishita37381/CrackYourPlacement
day 36/Implement Trie (Prefix Tree).cpp
class TrieNode { public: TrieNode *child[26]; bool isWord; TrieNode() { isWord = false; for (auto &a : child) a = nullptr; } }; class Trie { TrieNode* root; public: Trie() { root = new TrieNode(); } void insert(string s) { TrieNode *p = root; for (...
ALGO
0.99994
5.693677
eb044468-a156-417d-8b5c-e0c195c780da
chapuni/llvm
lib/CodeGen/MachineCombiner.cpp
#include "llvm/ADT/Statistic.h" #include "llvm/ADT/DenseMap.h" #include "llvm/CodeGen/MachineDominators.h" #include "llvm/CodeGen/MachineFunction.h" #include "llvm/CodeGen/MachineFunctionPass.h" #include "llvm/CodeGen/MachineInstrBuilder.h" #include "llvm/CodeGen/MachineLoopInfo.h" #include "llvm/CodeGen/MachineRegiste...
ALGO
0.990194
6.347738
b3df1cc5-b021-47a2-9e91-38b406dc2490
vmware-archive/safekeeping
nssm/process.cpp
#include "nssm.h" extern imports_t imports; HANDLE get_debug_token() { long error; HANDLE token; if (! OpenThreadToken(GetCurrentThread(), TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, false, &token)) { error = GetLastError(); if (error == ERROR_NO_TOKEN) { (void) ImpersonateSelf(SecurityImpersonation); ...
TOOL
0.944932
4.643471
5638f663-b75d-4a32-957b-2701304c1943
wallflower1/PopularProgrammingProblems
Word-Break-Problem/word-break.cpp
#include<iostream> #include<vector> #include<set> #include<string> using namespace std; #define it vector <string>::iterator string words[] = {"i", "like", "sam", "sung", "samsung", "mobile", "ice", "cream", "icecream", "man", "go", "mango"}; set<string> dict(words,words+(sizeof(words)/sizeof(words[0]))); vector<strin...
ALGO
0.986727
3.823107
747990a1-2df4-4e69-9b25-0593d487fe03
EmonHira135923/XPSC-Club-05---Probleam-Solving
XPSC - 05 Probleam Solving Club/Week 18/Day 120/Day 121/D_Satisfying_Constraints.cpp
#include<bits/stdc++.h> #include<string.h> #include<string> #include<ext/pb_ds/assoc_container.hpp> #include<ext/pb_ds/tree_policy.hpp> #define endl '\n' #define ll long long #define yes cout << "YES" << endl; #define no cout << "NO" << endl; #define FASTIO ios::sync_with_stdio(false);cin.tie(nullptr); using namespace ...
ALGO
0.99981
4.677996
16087264-2b10-44c8-badc-8d7fb63508bd
royal-dargon/data-struct
Class_Code/KeyTree/main.cpp
// 利用字典树来实现一个小型全文检索系统 // 值得注意的是每个单词的结尾使用的是$来表示一个单词的结束 /* 我打算采取的思路是在文件中先将文章的内容给提取出来每个单词的提取 然后单独对文章中的内容构建一个字典树,然后开始统计每个单词出现的频率 */ #include <iostream> #include <string.h> #include <fstream> #include <string> #include <algorithm> using namespace std; // struct Node // { // string elem; // // 用来存放兄弟节点的指针 // N...
ALGO
0.982879
4.528499
618954c6-6abd-427c-b58e-63c6a20b3e98
tarowatanabe/cicada
utils/lockfree_list_queue_main.cpp
#include <iostream> #include <vector> #include <set> #include <boost/thread.hpp> #include <boost/shared_ptr.hpp> #include "utils/lockfree_list_queue.hpp" #include "utils/hashmurmur.hpp" typedef boost::shared_ptr<int> ptr_int_type; typedef std::set<ptr_int_type> integers_type; typedef utils::lockfree_list_queue<ptr_i...
TOOL
0.940818
4.487585
ba8a8b7c-3438-4d18-8ad7-3114d6a2e36c
nikhil0441/DSA
STL/Dynamic Programming/fib.cpp
#include<iostream> #include<vector> using namespace std; int fib(int n,vector<int> &dp){ if(n==1 || n==0){ return n; } if(dp[n]!=-1){ return dp[n]; } dp[n]=fib(n-1,dp)+fib(n-2,dp); return dp[n]; } int main(){ int n; cin>>n; vector<int>dp(n+1...
ALGO
0.999996
5.447829
7d3ca55e-6a86-4a5e-aaed-8b1fc249fee7
Puneetbisarwal/DTU-Coding-Practice-Questions
Practice New/bit.cpp
#include <iostream> using namespace std; // Returns a number which has same bit // count as n and has only first and last // bits as set. int takeLandFsetbits(int n) { // set all the bit of the number n |= n >> 1; n |= n >> 2; n |= n >> 4; n |= n >> 8; n |= n >> 16; // Adding one to n now...
ALGO
0.999753
4.933265
52377eb3-511d-4421-a818-69bdb058dcb6
htw-inka/idiary
src/iDiary2/libs/Box2D/Collision/Shapes/b2LoopShape.cpp
#include <Box2D/Collision/Shapes/b2LoopShape.h> #include <Box2D/Collision/Shapes/b2EdgeShape.h> #include <new> #include <cstring> using namespace std; b2LoopShape::~b2LoopShape() { b2Free(m_vertices); m_vertices = NULL; m_count = 0; } void b2LoopShape::Create(const b2Vec2* vertices, int32 count) { b2Assert(m_vert...
ALGO
0.960428
7.542184
264b4b94-afe7-4af3-8c57-02abe7d6bd27
tang415a/algorithms
numbers/medianOfTwoSortedArray.cpp
/* Given two sorted arrays nums1 and nums2 of size m and n respectively, return the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)). Example 1: Input: nums1 = [1,3], nums2 = [2] Output: 2.00000 Explanation: merged array = [1,2,3] and median is 2. Example 2: Input: nums1 = [1,...
ALGO
0.999998
7.163723
30068d85-a106-4b28-be22-3494b623f1a8
interactivevislab/ORB_SLAM2
orbslam-windows/Thirdparty/opencv/sources/modules/features2d/perf/opencl/perf_brute_force_matcher.cpp
/*M/////////////////////////////////////////////////////////////////////////////////////// // // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. // // By downloading, copying, installing or using the software you agree to this license. // If you do not agree to this license, do not download, instal...
TEST
0.869108
6.782664
0a0c78f9-a1cc-422b-9147-659bb267ed6c
CalebMason/FirstGame
Engine/Source/ThirdParty/openexr/openexr-3.1.6/src/lib/OpenEXR/ImfWav.cpp
//----------------------------------------------------------------------------- // // 16-bit Haar Wavelet encoding and decoding // // The source code in this file is derived from the encoding // and decoding routines written by Christian Rouet for his // PIZ image file format. // //-------------------------------------...
ALGO
0.984619
6.290501
d9cfa132-3d75-4145-8a8c-0402220f2f1b
GabrielEstevam/icpc_contest_training
uri/uri_cpp/estruturas_e_bibliotecas/p2560.cpp
#include <iostream> #include <sstream> #include <string> #include <stdlib.h> #include <stdio.h> #include <math.h> #include <vector> #include <algorithm> #include <queue> using namespace std; int main() { int N, B; int i, k, n; vector <int> listMax; vector <int> listMin; int score = 0, partialScore = 0; while (...
ALGO
0.999421
3.418213
c3b37f71-26e6-4c27-9533-59373c8f3145
Galaxies99/Algorithms-of-Strings
Compaction Algorithm/Huffman-1.cpp
// 704 / 1600 (could be wrong because of eof) # include "core.h" # include <map> # include <queue> # include <iostream> std :: map <char, int> mp; std :: map <char, std :: string > code; std :: priority_queue < std :: pair <int, int>, std :: vector< std :: pair <int, int> >, std :: greater < std :: pair <int, int> >...
ALGO
0.999575
3.354762
5dad4b9f-394f-4f75-a74f-34112f867d83
solomonooo/leetcode
227.基本计算器-ii.cpp
/* * @lc app=leetcode.cn id=227 lang=cpp * * [227] 基本计算器 II */ // @lc code=start class Solution { public: int64_t getNum(string& s, int& idx) { int64_t val = 0, n = s.length(); while (idx < n && s[idx] == ' ') idx++; while (idx < n && s[idx] != ' ') { if (s[idx] < '0' || s[i...
ALGO
0.999508
5.52613
381dc6e6-600c-4c79-bd9c-8e9615d9f9a4
Sindyang/Algorithm
LeetCode/326. Power of Three.cpp
class Solution { public: bool isPowerOfThree(int n) { double num = log10(n) / log10(3); //判断是否为整数 if (num - int(num) == 0) { return true; } return false; } };
ALGO
0.999741
5.674086
dc5f1b2e-6cde-49c6-98a9-30be2da5ad0b
Mu-Ahmad/Uva-Solutions
ch2-problems/Linear-DS/grey_code-11173.cpp
#include <bits/stdc++.h> using namespace std; int main() { int t, n, k; cin >> t; while (t--) { cin >> n >> k; cout << (k ^ (k >> 1)) << '\n'; } return 0; }
ALGO
0.999829
4.308603
b3283a73-89ac-4bfb-9e15-8789def7d4b4
Bvangoor/LeetCode
implementQueueUsingStacks.cpp
class Queue { public: struct node{ int value; node *next; }; node *queueHead, *stack1=NULL, *stack2=NULL; node* stackPush(node *node1, int k){ node *temp2; temp2=(struct node*)malloc(sizeof(struct node)); temp2->value=k; temp2->next=NULL; if(node1==NULL) ...
ALGO
0.999486
4.618447
db05ba31-5a64-410c-9dfe-7fdff86896dc
zitengzela/mangos-tbc
src/game/AI/ScriptDevAI/scripts/eastern_kingdoms/zulaman/boss_halazzi.cpp
/* ScriptData SDName: Boss_Halazzi SD%Complete: 90 SDComment: A few details and timers need check. SDCategory: Zul'Aman EndScriptData */ #include "AI/ScriptDevAI/include/sc_common.h" #include "zulaman.h" #include "AI/ScriptDevAI/base/CombatAI.h" enum { SAY_AGGRO = -1568034, SAY_SPLIT ...
TOOL
0.913378
5.175832
91df3d73-c5ea-473b-bcfa-9a963fb18608
lazzermann/discreteGroup
discreteGroup/Group.cpp
#include "Plurality.cpp" #include<String> #include <iostream> class Group { private: Plurality plur; int* first, * second; public: Group() { intializeArrays(); gameLoop(); }; Group(Plurality pl) :plur(pl) { intializeArrays(); gameLoop(); }; ~Group() { deleteArr(first); deleteArr(second); }; void ...
ALGO
0.998917
3.577249
a84a3e62-f0e2-48fc-941d-ac571ec157f2
adityasharma36/Data-Structures-And-Algorithm
11.HomeWork/Q5_ismorphicString.cpp
#include<iostream> #include<algorithm> #include<string> using namespace std; bool ismorphicString(string first,string second){ int hash[256] = {0}; bool istCharsMapped[256] = {0}; for(int i = 0;i<first.length();i++){ if(hash[first[i]]==0 && istCharsMapped[second[i]]==0){ hash[first[i]] =...
ALGO
0.99995
4.105112
d0f69461-7fc1-4722-8f05-09002f3c21c1
dongchen-coder/symFP
test_facility/ref_trace_src/jacobi_1d_ref_arr.cpp
#include "../utility/rt.h" #include "../utility/data_size.h" #ifdef ORG #define TSTEPS 10 #define N 1024 #elif defined (TX) #elif defined (FX) #elif defined (EX) #endif #define A_OFFSET 0 #define B_OFFSET N void jacobi_1d_trace(double* A, double* B) { int t, i; for (t = 0; t < TSTEPS; t++) { for (i = 1; i <...
ALGO
0.999858
3.733613
b9c9f29e-71f7-4a54-946d-d23753bf9eb9
NathalieLima/residenciatic18_2023
PI_Programacao-Imperativa/instrucoes-praticas/P011/exc8_conta-primos.cpp
/* Escreva um programa em C++ que imprima todos os números primos de 1 a 100. */ #include <iostream> using namespace std; int conta_primos(int *vet, int qtde); int main (void) { int vetor[] = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,23}; int tam = sizeof vetor / sizeof vetor[0]; int qtde_pri...
ALGO
0.997711
4.668706
b61ad993-768d-4a0b-a81e-028298b57515
victor-nadalini/cara_ou_coroa_app_flutter
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
eb4c9170-6ab4-4de5-bfab-6eb62d36d6ea
xiaonimo/ACcode
OFFER/038_isNumeric.cpp
/* Title: * ˻ */ #include <iostream> #include <vector> #include <algorithm> using namespace std; class Solution { public: bool isNumeric(char* str) { bool e = false; bool dot = false; int eindex = INT_MAX; for (int i =0;str[i] != '\0';++i) { if (isNum(str[i])) ...
ALGO
0.974704
3.865628
fb3dc520-6c80-47cd-a189-c6b9506d3751
MdRifathSharker/Competitive-programming
A_Alyona_and_a_Square_Jigsaw_Puzzle.cpp
#include<bits/stdc++.h> using namespace std; int main () { int t; cin>>t; while(t--){ int n; cin>>n; int a[n]; for(int i=0;i<n;i++){ cin>>a[i]; } int b[n]; b[0]=a[0]; for(int i=1;i<n;i++){ b[i]=a[i]+b[i-1]; }...
ALGO
0.999399
3.620003
a2133eb5-3405-4797-b91b-5be8c4c8ad91
Sabuj-Kumar/MyCodes
codeforces/Problem A/A. Love Triangle.cpp
#include<bits/stdc++.h> #define pi acos(-1) #define ll long long #define ull unsigned long long #define db double #define ldb long double #define pii pair< int,int > #define pll pair<ll,ll> #define ft first #define sd second #define pb push_back #define pf push_front #define sc( n ) scanf("%d",&n) #define sl( n ) scanf...
ALGO
0.999995
3.631607
617480cb-fe31-4e1b-ad8a-edf401e7c6eb
grga1/SP
Laboratoriski za vtor kolokvium/zadaca52.cpp
/*Од стандарден влез се вчитува квадратна матрица со n редици и колони. Прво се вчитува бројот n, па потоа и n x n елементите на матрицата. Вашата задача е да напишете програма во C++ која ќе определува дали дадената матрица е "магичен квадрат". Магичен квадрат е квадратна матрица каде што збирот на елементите во секој...
ALGO
0.999494
4.018293
6c903b7a-0a87-4b0c-b446-ce85a29d693a
myriadrf/lms-suite
LMS7002M/lms7suite/controlLogic/PLL_CGEN.cpp
/** @file PLL_CGEN.cpp @author Lime Microsystems @brief Parameter calculations for CLKGEN PLL */ #include "PLL_CGEN.h" #include <math.h> #include <fstream> #include <string.h> using namespace std; /** * Class constructor. Initialization of VCO frequencies, Min, Max * PLL frequesncies is done there. */ PLL_CGEN::PLL_C...
TOOL
0.903526
5.31413
8a3c1fea-1f6f-4a15-925d-61622761cda5
mrestevez/BitcoinTransfer
src/bitcoin-cli.cpp
#if defined(HAVE_CONFIG_H) #include "config/bitcoin-config.h" #endif #include "base58.h" #include "chainparams.h" #include "chainparamsbase.h" #include "clientversion.h" #include "fs.h" #include "rpc/client.h" #include "rpc/protocol.h" #include "util.h" #include "utilstrencodings.h" #include <stdio.h> #include <even...
WEB
0.978274
6.463808
d30f34c1-d00d-4b07-b641-9a394266d33d
Mar9707/CheapCloudTasks
ConstructorsAndDestructors/main.cpp
#include <QApplication> #include <QVector> #include <QFile> #include <QTextStream> #include <QInputDialog> class SortingStrategy { public: virtual void sort(QVector<int>&) const = 0; virtual ~SortingStrategy () {} }; class BubbleSort : public SortingStrategy{ public: void sort (QVector<int>& vec) const ov...
TOOL
0.901395
5.968038
bd5c8a48-5786-4bb0-9ad1-012e7916ad0b
ishandutta2007/codeforces
suika_predator/normal/1632/C.cpp
#include<bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); int T; cin>>T; while(T--) { int a,b; cin>>a>>b; int ans=b-a; for(int i=0;i<=b-a;i++) { //a,b+i int t=a|(b+i),tt=(a+i)|b; ans=min(ans,i+1+min(t-(b+i),tt-b)); } cout<<ans<<endl; } return 0; }
ALGO
0.999883
4.300033
f51cf33a-116f-4a5b-9936-b8d023eb8c42
MzMahmud/problem-solving
Light OJ/LOJ My Solution/1065 - Number Sequence.cpp
///Implementation with n x n /* 1065 - Number Sequence Author: Moaz Mahmud Date : 02 Nov,2017 My Solution: Matrix Exponentiation. This version is implemented for n*n matrix. END :D :D */ #include <bits/stdc++.h> #include <cstdio> #include <cmath> #define DIM 2 using namespace std...
ALGO
0.99987
4.087229
ad49429a-21b7-4a79-bff4-64a678d7585d
andrewwang2015/Caltech-CS2
Week8_2016/fourier/src/SpectralSynthesizer.cpp
/** * @file SpectralSynthesizer.cpp * @author Justin Johnson, revised by Ellen Price <<<EMAIL>>> * @version 1.0 * @date 2013-2014 * @copyright see License section * * @brief Functions for SpectralSynthesizer class. * * @section License * Copyright (c) 2013-2014 California Institute of Technology. * All right...
ALGO
0.985057
5.486978
752c4513-7682-4191-a39a-cb6c4aff0e01
eggag32/Competitive-Programming
Topcoder/BadNeighbors.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> vi; typedef pair<int, int> pi; #define debug(x) cout << #x << ": " << x << endl #define repn(i, a, b) for(int i = (a); i < (b); i++) #define rep(i, a) for(int i = 0; i < (a); i++) #define all(v) v.begin(), v.end() #define mp make_p...
ALGO
0.999645
3.706627
d5927821-833d-41fa-af6b-4b6dce9b7375
Ferick10/Programacion-1
PRACTICA_02/Ejercicio_02_08.cpp
// Materia: Programación I, Paralelo 3 // Autor: Fernando Erick Quispe Ichuta // Fecha creación: 26/03/2025 // Número de ejercicio: 8 // Problema planteado: Generar patrones de numeros #include <iostream> using namespace std; int main() { int n; cout << "Introduce el valor de n: "; cin >> n; for (in...
ALGO
0.999831
4.671689
4542cca5-9a3c-4c78-957c-3cc433c44280
raincross7/code-similarity
codes/train_code/problem394/problem394_463.cpp
#include<iostream> #include<cctype> using namespace std; int main() { char ma; int sum[123] = {}, i, j=0; while (cin.get(ma)) { if (ma == '\n')j++; if (j >= 5)break; ma = tolower(ma); if (isalpha(ma))sum[ma]++; } for (i = 97; i <= 122; i++) cout << static_cast<char>(i) << " : " << sum[i] << endl; retur...
ALGO
0.994434
3.042127
e20e1624-cc8e-4745-a9ab-22d2dd91fd07
ishandutta2007/codeforces
jasiekstrz/normal/1062/A.cpp
#include<bits/stdc++.h> using namespace std; int tab[210]; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int n,ile,w,i; cin>>n; ile=0; w=0; tab[0]=0; for(i=1;i<=n;i++) { cin>>tab[i]; if(tab[i]==tab[i-1]+1) ile++; else { w=max(w,ile-1); ile=0; } } if(tab[n]=...
ALGO
0.999901
3.272427
3e27899e-74f9-4d22-92c4-b05d333981cb
wawzysys/Algorithm
2024bishi/01手撕/1120.cpp
#include <bits/stdc++.h> using namespace std; int main() { std::cin.sync_with_stdio(false); std::cin.tie(0); vector<int> nums = {1, 5, 11, 5}; int n = nums.size(), m = 0; for (int x : nums) m += x; if (m % 2) return false; m /= 2; vector<bool> f(m + 1); f[0] = true; ...
ALGO
0.999942
4.338961
3e037f7f-8240-4424-8ff0-bb3c78b17002
KimmiGYH/LeetCode_Notes_Public
Solutions_0001-1000/0187_Repeated DNA Sequences_重复的DNA序列/cpp_2_字符串哈希.cpp
class Solution { using ULL = unsigned long long; ULL P = 13331; public: vector<string> findRepeatedDnaSequences(string s) { int n = s.length(), L = 10; vector<string> res; vector<ULL> h(n + 1); vector<ULL> p(n + 1); p[0] = 1; for (int i = 1; i <= n; i...
ALGO
0.999979
5.839773
16230819-ad75-4438-a3ff-862dee85c3bc
a6cenna/osninfor
toki/pkd/07/b.cpp
#include <bits/stdc++.h> using namespace std; int k; pair<int,int> wh[100]; bool comp[101][2001]; int memo[101][2001]; bool picked[101][2001]; int dp(int i, int c) { if(i==0 || c==0) return 0; if(comp[i][c]) return memo[i][c]; int best = dp(i-1, c); if(c>=wh[i-1].first) { int include = dp(i-...
ALGO
0.99999
3.302761
7c1adb13-0b37-433b-8013-e162600f6a6f
dipenjava/patternsc-
pattern8.cpp
#include<iostream> using namespace std; int main() { int n=4; int i=1; while(i<=n) { int j=1; while(j<=n-i) { cout<<"*"; j++; } cout<<"\n"; i++; } } /*output: *** ** * */ // // Created by 91919 on 07-07-2023. //
ALGO
0.999959
4.480794
98f204a4-2a3b-4d34-b45a-7115f44a0c1c
23ksw10/LeetCode
algorithm/787_Cheapest_Flights_Within_K_Stops/solution.cpp
#include <iostream> #include <vector> #include <queue> using namespace std; class Solution { public: int findCheapestPrice(int n, vector<vector<int>>& flights, int src, int dst, int K) { vector<vector<pair<int, int>>>v(n); for (auto f : flights) { v[f[0]].push_back({ f[1],f[2] }); } priority_queue<vector<...
ALGO
0.999868
5.252627
36c60317-18d8-48aa-8a55-019a15dcb5db
yollotltamayo/Online-Judges-Solutions
code_forces/160_A.cpp
#include<iostream> #include<algorithm> #include<vector> using namespace std; vector<int>p; int main(){ int v,x,cta = 0,c = 0,a ,k= 0; cin>>v; while(v--){ cin>>x; p.push_back(x); cta += x; } sort(p.begin(),p.end()); a = p.size()-1; while(cta >= c){ c += p[a]; cta -= p[a]; a--; k++; } cout<<k; }
ALGO
0.999919
3.80628
f3af5b32-5303-4415-9fdb-51b657888c3e
JaeWon1717/comvision
3) GaussianLowPassFilter.cpp
///////////////////////////////////////////////////////////////////////////////// // // // þ ͸ // // // //////////////...
ALGO
0.997984
4.650831
d4b4f38c-9e59-4a11-8401-dac184174af4
beastieGer/schildt
chapter02/gl02_ex07_stackD.cpp
/* Класс стек для хранения символов */ #include<iostream> using namespace std; class stack { char *stck; int tos; int size; public: stack(int n); ~stack(); void push(char ch); char pop(); }; stack::stack(int n) { size = n; stck = new char[size]; tos = 0; } stack::~stack() { ...
ALGO
0.896466
3.767624
692824b7-5e36-40cb-9a86-eebab76f1547
mihaelagledacheva/Raytracer
geometries.cpp
#include <string> #include "ray.cpp" #include <iostream> class Geometry { public: Vector albedo; bool light; double i; bool mirror; bool transparent; double n_in; double n_out; Geometry() {} void set_light(double intensity) { light = true; i = intensity; } ...
ALGO
0.917867
6.263049
58cf020a-2b3a-443a-a203-a418710712a0
manikanta2901/ubuntu
.history/practice/cpp/Codechef/simpleStatistics_20200720135525.cpp
#include<bits/stdc++.h> #include<vector> #include<iostream> #include<cmath> #include<algorithm> #include<iterator> #include<string> #include<map> #define vv vector #define F first #define S second #define MP make_pair #define EXECUTE_FASTER ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); #define printM...
ALGO
0.999773
3.546276
b69f526a-66a4-46eb-96dc-af17d3d4d4fe
CarbonROM/android_external_icu
icu4c/source/test/intltest/punyref.cpp
/**********************************************************/ /* Implementation (would normally go in its own .c file): */ #include <string.h> #include "unicode/utypes.h" #if !UCONFIG_NO_IDNA #include "punyref.h" /*** Bootstring parameters for Punycode ***/ enum { base = 36, tmin = 1, tmax = 26, skew = 38, damp = ...
TOOL
0.96921
6.816564
0f198944-1ecd-4744-bf9f-b38c7120220c
iamarjitgoyal/Leetcode_Practice
1011-capacity-to-ship-packages-within-d-days/1011-capacity-to-ship-packages-within-d-days.cpp
class Solution { public: int shipWithinDays(vector<int>& weights, int days) { int left = *max_element(weights.begin(), weights.end()); int right = accumulate(weights.begin(), weights.end(), 0); while (left < right) { int mid = left + (right - left) / 2; int c...
ALGO
0.999989
6.089344
90f96696-a646-4645-ace5-ced8858922c7
rafidghanim/codewars
kyu-8/invert-values.cpp
#include <vector> std::vector<int> invert(std::vector<int> values) { std::vector<int> invert; for (int i:values){ invert.push_back(i*-1); } return invert; }
ALGO
0.997951
5.424777
af84b86d-6cac-408e-980a-4cec7beb97d8
weinaike/GalSim_PhotonShoot_CUDA
src/Polygon.cpp
/* * ------------------------------------------------------------------------------ * Author: Craig Lage, UC Davis * Date: Jan 13, 2016 * Polygon utilities */ //#define DEBUGLOGGING #include <cstdlib> #include <algorithm> #include <cmath> #include "Std.h" #include "Polygon.h" namespace galsim { void Polygo...
TOOL
0.987289
7.734839
9ec9c84d-0d24-49a3-a125-81b987d01b1d
MahinAshraful/CodeWatch_Data
sample-data/p00007/s366958253.cpp
#include <iostream> using namespace std; int main() { int n; int s=100000; cin>>n; for(int f=1;f<=n;f++) { s=s*1.05; if(s%1000!=0) { int u =s%1000; u=1000-u; s+=u; } } cout<<s<<endl; return 0; }
ALGO
0.999559
3.140676
28677bc2-2255-49f3-885e-e6b6f8e98fef
mohitdtumce/Competitive-Coding
DataStructure&Algorithm/interview/codeforces/456A.cpp
#include<bits/stdc++.h> using namespace std; struct dragon { int x; int y; }; bool cmp(const dragon& left, const dragon& right) { return left.x < right.x; } int main(){ int n; cin>> n; dragon d[100000]; for(int i = 0;i < n; ++i) { cin >> d[i].x >> d[i].y; } sort(d, d + n, cmp); ...
ALGO
0.999915
3.478306
c53c243d-8f61-4375-aed8-e088fabe3bc8
AndHager/SysCallStubber
llvm-project/llvm/lib/Analysis/IntervalPartition.cpp
#include "llvm/Analysis/IntervalPartition.h" #include "llvm/Analysis/Interval.h" #include "llvm/Analysis/IntervalIterator.h" #include "llvm/InitializePasses.h" #include "llvm/Pass.h" #include <cassert> #include <utility> using namespace llvm; char IntervalPartition::ID = 0; IntervalPartition::IntervalPartition() : F...
ALGO
0.989855
7.602342
9ba7e92a-6577-412a-8301-6b07cbf8b537
jimlin2004/UVA
Easy/11764/11764.cpp
#include <iostream> using namespace std; int main() { int T, n; int highJump, lowJump; int prev, curr; scanf("%d", &T); for (int t = 1; t <= T; ++t) { highJump = 0; lowJump = 0; scanf("%d", &n); scanf("%d", &prev); for (int i = 1; i < n; ++i) { ...
ALGO
0.999467
3.517485
df438bb7-099c-447b-b92a-7182b86ae1c1
09asad/Cpp-Programs
LinkedList/8_insertAtHead1.cpp
#include<iostream> using namespace std; class node{ // user defined data type public: int val; node* next; node(int val){ this->val=val; this->next=NULL; } }; class LinkedList{ // user defined data structure public: node* head; node* tail; int size; LinkedList(){ ...
ALGO
0.994158
4.079656
29d55ea5-444a-4bb3-a263-9a52410bf8ff
sonimoo/OOP
lab2.cpp
#include <iostream> #include <cmath> using namespace std; const double PI = 3.141592653589793; class Point {}; class Circle : public Point { public: double radius; Circle(double radius) { this->radius = radius; } }; class Sphere : public Circle { public: Sphere(double radius) : Circle(radi...
ALGO
0.998638
4.763684
bf8ce48c-5676-4e4b-9f4d-0b09811a1143
graemeleehickey/joineRML
src/expW.cpp
#include <RcppArmadillo.h> // [[Rcpp::depends(RcppArmadillo)]] using namespace Rcpp; //' @keywords internal // [[Rcpp::export]] List expWArma(const Rcpp::List& iz_, const Rcpp::List& b_, const arma::mat& gam, const Rcpp::List& h_) { // Calculation of exp{W(tj, b)} List expw(b_.size()); for (int...
ALGO
0.995349
5.7335