uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
a73275ab-1e2c-472a-8a4d-847b9db77d23
linyicheng1/visual_mapping_localization
Thirdparty/g2o/g2o/core/sparse_optimizer.cpp
#include "sparse_optimizer.h" #include <iostream> #include <iomanip> #include <algorithm> #include <iterator> #include <cassert> #include <algorithm> #include "estimate_propagator.h" #include "optimization_algorithm.h" #include "batch_stats.h" #include "hyper_graph_action.h" #include "robust_kernel.h" #include "../st...
ALGO
0.99966
6.976369
b1fb7b72-6b2d-4571-a5c9-77678c5e6c9e
daokhoi2k2/LearnCPP
B04/Ex26.cpp
#include <iostream> #include <math.h> #include <iomanip> using namespace std; int main() { int a, b, c; cin >> a >> b >> c; int max, min; if (a > b) { max = a; min = b; } else { max = b; min = a; } if (c > max) { max = c; } ...
ALGO
0.999178
3.605441
f4a4ce12-52f2-4b64-8838-c6987a9ee4f3
siyovushchik1414/Data-Science-Projects
Other/Acm Timus Solutions/1924.cpp
#include <iostream> #include <vector> using namespace std; int main() { int x, ans = 0; cin >> x; for(int i = 0; i <= x; i++) ans += i; if(ans % 2 == 0) cout << "black"; else cout << "grimy"; }
ALGO
0.999329
3.974375
74d32e16-3c68-4239-ab44-9224a14342c7
GuiHSM/Competicoes
Code Force Rounds/Participated/Round 653/B_Multiply_by_2_divide_by_6.cpp
#include <bits/stdc++.h> using namespace std; int main(){ int t; scanf("%d",&t); for (int l = 0; l < t; ++l) { int n,tres=0,dois=0; scanf("%d",&n); while(n%3==0){ tres+=1; n/=3; } while(n%2==0){ dois+=1; n/=2; } if(n==1&&dois<=tres){ printf("%d\n",tres+(tres-dois)); }else{ printf(...
ALGO
0.999808
3.87369
859a6fc5-79a1-4fa0-b8b8-83e59e535fcd
datablade-io/daisy
src/Interpreters/PredicateExpressionsOptimizer.cpp
#include <Interpreters/PredicateExpressionsOptimizer.h> #include <Parsers/IAST.h> #include <Parsers/ASTFunction.h> #include <Parsers/ASTSelectQuery.h> #include <Parsers/ASTTablesInSelectQuery.h> #include <Interpreters/Context.h> #include <Interpreters/getTableExpressions.h> #include <Interpreters/PredicateRewriteVisit...
ALGO
0.928269
7.705137
d6227363-2a65-4497-aae6-675124e98b41
SHAHYASHNILESH/Competitive_Programming
City_Tour.cpp
//City Tour #include <iostream> #include<bits/stdc++.h> using namespace std; int main() { int t; cin >> t; while(t--){ long long n; cin >> n; cout << 4*n <<endl; } return 0; }
ALGO
0.999214
3.945573
4dd4bfb6-606a-4cb0-844f-cae7f397c335
k8440009/Algorithm
BOJ/3085_2.cpp
// 사탕 게임 // https://www.acmicpc.net/problem/3085 #include <iostream> #include <string> #include <algorithm> using namespace std; const int MAX = 50; int N, answer = 0; char board[MAX][MAX]; int cntCandy() { int result = 1; // 좌, 우 for (int y = 0; y < N; y++) { int cnt = 1; for (int x = 0...
ALGO
0.999957
4.792629
474dccf6-c939-4429-94c6-5525608392ec
bigLRRH/Group_Programming_Lodder_Tournament
L1/L1-010 比较大小.cpp
#include <iostream> #include <cstdio> #include <algorithm> using namespace std; int main() { int a[3]; cin>>a[0]>>a[1]>>a[2]; sort(a,a+3); printf("%d->%d->%d\n",a[0],a[1],a[2]); return 0; }
ALGO
0.999515
3.41923
7db8bf5e-361e-4626-ac85-ff7d2f215814
adetaylor/android-frameworks-base-with-remote-control-service
libs/rs/rsMatrix4x4.cpp
#include "rsMatrix2x2.h" #include "rsMatrix3x3.h" #include "rsMatrix4x4.h" #include "stdlib.h" #include "string.h" #include "math.h" using namespace android; using namespace android::renderscript; ////////////////////////////////////////////////////////////////////////////// // Heavy math functions /////////////////...
TOOL
0.948016
6.982016
7cfd7d6f-9fe2-4bea-82f2-8f6c1129f839
ezberlin/cppprojects
primeTester.cpp
#include <iostream> using namespace std; int main() { bool is_prime = true; long long int number {0}; cout << "Enter number: "; cin >> number; if(number == 1) is_prime = false; for (long long int t = 2; t < number; t++) { if (number % t == 0) { is_prime = false; break; ...
ALGO
0.999536
4.324935
0b727cd0-c3f9-4eb5-9a9f-fd4e4b05b6f1
sarvex/leetcode-mini-kanren
solution/1600-1699/1614.Maximum Nesting Depth of the Parentheses/Solution.cpp
class Solution { public: int maxDepth(string s) { int ans = 0, d = 0; for (char& c : s) { if (c == '(') { ans = max(ans, ++d); } else if (c == ')') { --d; } } return ans; } };
ALGO
0.999526
5.703394
d0b27ce8-2ba9-4ae1-baab-bc585dbb85cf
n7tae/2urfd
transcoder/imbe/decode.cpp
#include "typedef.h" #include "globals.h" #include "imbe.h" #include "ch_decode.h" #include "sa_decode.h" #include "sa_enh.h" #include "v_synt.h" #include "uv_synt.h" #include "basic_op.h" #include "aux_sub.h" #include "encode.h" #include "dsp_sub.h" #include "imbe_vocoder.h" #include <cstring> const uint8_t BIT_MAS...
ALGO
0.943959
4.531568
8df2b3f6-f854-408c-9d00-3438a6186f4c
anagno/gama
tests/gama-local/scripts/check_xyz.cpp
#include "check_xyz.h" #include <iostream> #include <gnu_gama/ellipsoids.h> #include <gnu_gama/xml/gkfparser.h> #include <gnu_gama/local/network.h> #include <gnu_gama/local/language.h> #include <gnu_gama/local/acord/acord2.h> #include <gnu_gama/local/test_linearization_visitor.h> #include <gnu_gama/local/results/text/r...
ALGO
0.987373
5.085526
cb6663c2-bce8-47f7-8484-5c58e81efaac
Rachit-31/DSA_Ques
CSES/Labyrinth.cpp
#include <bits/stdc++.h> using namespace std; #define int long long // Replaces 'endl' with '\n' for faster output (as 'endl' flushes output buffer) #define endl '\n' #define fast_io() ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL) const int MOD = 1e9 + 7; // For mod...
ALGO
0.999996
5.886425
dd8d3cd0-229e-4081-ad16-fda07ab07645
EsraelSousa/Online-Judge
BEECROWD/Onda_Critica_1027.cpp
#include <bits/stdc++.h> using namespace std; int main(){ ios::sync_with_stdio(0); cin.tie(nullptr); cout.tie(nullptr); int n, x, y; while(cin >> n){ map<int, vector<int>> cod; map<int, vector<int>>:: iterator it, it1; vector<int>:: iterator it2, it3; for(int i=0; i<n; i++)...
ALGO
0.999571
3.876371
11fc0724-ce14-4126-89aa-04030415bc2d
KermiteO/CS1D
Lab 2/PrintHeaderString.cpp
/*********************************************************************** * AUTHOR : BEAK & Kermite * LAB #2 : Intro to Functions - GCD * CLASS : CS1B * SECTION : TTH 0800 * DUE DATE : 3FEB2015 ***********************************************************************/ #include "LAB2_HEADER.h" /******...
TOOL
0.907007
3.126571
6ac8eeda-4d5c-4042-be82-2636c0a64b05
SohamKumar123/Dsa-Cpp
10. Problems on Array/problem8.cpp
#include <iostream> using namespace std; void printArray(int arr[],int size){ for(int i=0;i<size;i++){ cout<<arr[i]<<" "; } } void sortOne(int arr[],int size){ int left=0,right=size-1; while(left<right){ while(arr[left]==0 && left<right){ left++; } while(arr...
ALGO
0.999946
4.288744
c6cc7c82-a29a-4c0f-a0f3-239371983765
rawanadil/c-Project
project18.cpp
// Write a c++ program to print the summation of two array with size 3 #include <iostream> using namespace std; int main() { int arr1[3], arr2[3], arr3[3]; cout <<"Enter Numbers of arr1: "; for(int i = 0; i<3; i++) cin>> arr1[i]; cout <<"Enter Numbers of arr2: "; for(int i = 0; i<3; i++) cin>> arr2[i]; for(int ...
ALGO
0.999106
4.273994
0bd9234e-c602-4755-b6be-72f7cf79734f
kkaneko-42/cpp-modules
9/ex01/srcs/RPN.cpp
#include "RPN.hpp" #include <cstring> #include <stdexcept> const std::string ft::RPN::kInvalidTokenMsg = "Invalid token found"; const std::string ft::RPN::kOperandsNotEnoughMsg = "Operands not enough for operation"; const std::string ft::RPN::kInvalidOperationMsg = "Invalid operation"; const std::string ft::RPN::kInva...
ALGO
0.983526
6.068545
f6e27a1e-9ee1-45f7-98b1-e259535f4f34
PedroBerardo0410/cpp-bsi
funcao por referencia/main.cpp
#include <iostream> #include <cstring> using namespace std; void troca(int &a, int &b){ int temp; temp = a; a = b; b = temp; } int main() { int a, b; cout << "Entre com dois numeros: "; cin >> a >> b; troca(a, b); cout << "Os numeros trocados fica: "<< a << " e " << b << endl; ...
ALGO
0.991034
3.193406
fc40b0e3-73ed-48c1-b28d-600fd4f0eaa4
sujancse5bu/CP-Journy-with-C-CPP
ALL/Sharif/26 Function overloading.cpp
///ShreeHarichad Smarane #include <iostream> using namespace std; int add (int a, int b) { return a+b; } float add (float a, float b) { return (a+b)*2; } double add (double a, double b) { return (a+b)*3; } int main () { cout<<add((float)7.5,(float)7.6)<<endl; return 0; }
TOOL
0.906051
4.160079
1e60cb21-c25e-4309-b27b-dddb82170474
UnioTrump/python-C-plus-prime_code
c++/lab5/lab5_1.cpp
//lab5_1.cpp #include <iostream> using namespace std; void fn1(); int x = 1, y = 2; int main() { cout << "Begin..." << endl; cout << "x = " << x << endl; cout << "y = " << y << endl; cout << "Evaluate x and y in main()..." << endl; int x = 10, y = 20; cout << "x = " << x << endl; cout << "...
TOOL
0.97813
4.618077
32153b16-db66-4078-9e6c-ebdc24c0988e
juarezpaulino/coderemite
problemsets/SPOJ/SPOJ/PT07X.cpp
/** * * Author: Juarez Paulino(coderemite) * Email: <EMAIL> * */ #include <cstdio> #include <vector> #include <queue> #include <algorithm> #include <cstring> using namespace std; typedef vector<int> VI; VI ADJ[100000]; int DEG[100000]; bool V[100000], DISC[100000]; int N; int main() { queue<int> q; ...
ALGO
0.998808
5.061697
916119a5-5428-4b1d-9758-799e881c1714
slllldka/Algorithm_PS
Baekjoon/15685 드래곤 커브.cpp
#include <iostream> #include <vector> using namespace std; typedef pair<int, int> i2; int N; bool map[101][101]; vector<i2> points; i2 Rotate_Point(i2, i2); void Dragon_Curve(int, int, int, int); int main() { int x, y, d, g, result = 0; for (int i = 0; i < 101; i++) { for (int j = 0; j < 101; j++) { map[i][...
ALGO
0.99964
3.974201
2181ab55-e993-47e0-9019-4dbcda42f8d0
dastbe/Yahtzee-AI
project/myai.cpp
#include "myai.h" // Implements MyAI as defined in myai.h // // Created By: David Bell // Edited: July 24, 2012 // Default object MyAI YahtzeeAI(std::cout); // Constructor MyAI::MyAI(std::ostream& out) : GameAI(out) { // Build a map of key-set => expected value pairs std::ifstream ev_file; ev_file.open("data/ev...
ALGO
0.964002
5.583768
9b88fda1-b860-41ed-addf-bcc51d8df972
AlexanderStein1978/AlexanderStein1978
NR_C301/legacy/nr2/CPP_211/recipes/sprsin.cpp
#include <cmath> #include "nr.h" using namespace std; void NR::sprsin(Mat_I_DP &a, const DP thresh, Vec_O_DP &sa, Vec_O_INT &ija) { int i,j,k; int n=a.nrows(); int nmax=sa.size(); for (j=0;j<n;j++) sa[j]=a[j][j]; ija[0]=n+1; k=n; for (i=0;i<n;i++) { for (j=0;j<n;j++) { if (fabs(a[i][j]) >= thresh && i != ...
ALGO
0.999931
3.290685
5444808f-e7bf-458e-b644-c6abd0a5982f
whyandong/icu
source/tools/toolutil/uoptions.cpp
#include "unicode/utypes.h" #include "cstring.h" #include "uoptions.h" U_CAPI int U_EXPORT2 u_parseArgs(int argc, char* argv[], int optionCount, UOption options[]) { char *arg; int i=1, remaining=1; char c, stopOptions=0; while(i<argc) { arg=argv[i]; if(!stopOptions && *arg...
TOOL
0.912415
4.815145
9715345f-ad41-47ed-a37a-2ebc9c2f0677
Kavyansh-Bagdi/CP
cses/Grid_Paths_I.cpp
#include <bits/stdc++.h> using namespace std; #define fastio() \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); \ cout.tie(NULL) #define inf LLONG_MAX #define mod 1000000007 #define nline "\n" #define pb push_back #define pp pop_back #define ff first #define ss s...
ALGO
0.999973
5.160142
a3ca15fa-ba7d-4415-aae4-6681cbeb67be
ishandutta2007/codeforces
errichto/normal/377/D.cpp
#include<cstdio> #include<vector> #include<algorithm> #include<set> #include<map> #include<cstring> #include<cmath> #include<iostream> #include<ctime> #include<cstdlib> using namespace std; #define ll long long #define ld long double #define vi vector<int> #define pii pair<int,int> #define pld pair<ld,ld> #define pb pu...
ALGO
0.999852
3.536082
ae983de3-65b0-46c7-b20e-8cf0badd8226
LiangliangNan/ManhattanModeler
3rd_ransac/Plane.cpp
#include "Plane.h" //#include "pca.h" #include <MiscLib/Performance.h> #include "LevMarFitting.h" #include <GfxTL/VectorXD.h> #include <GfxTL/IndexedIterator.h> #include <GfxTL/Plane.h> #include <GfxTL/Mean.h> Plane::Plane(Vec3f p1, Vec3f p2, Vec3f p3) { m_normal= (p2-p1).cross(p3-p2); m_normal.normalize(); ...
ALGO
0.935431
5.503177
6fded6b4-7c36-4fd1-8773-b55757ca32f1
Prince-in-the-wood/2022-02-2110327_Algorithm-Design_Grader
ex02e1_fibo/ex02e1_fibo.cpp
#include <iostream> using namespace std; int main(){ int n; int f0 = 0, f1 = 1, tmp; cin >> n; for( int i = 1 ; i < n ; i++ ){ tmp = f1; f1 = f1 + f0; f0 = tmp; } cout << f1; }
ALGO
0.999897
3.957049
6e93be7d-964f-4f0f-b5fe-9a3bd13cee57
aboeuf/AdventOfCode
common.cpp
#include <QDebug> #include <common.h> namespace common { void throwRunTimeError(const QString &message) { throw std::runtime_error(message.toStdString()); } void throwInvalidArgumentError(const QString &message) { throw std::invalid_argument(message.toStdString()); } QStringList splitLines(const QString &input,...
TOOL
0.928803
6.393513
7b6b965e-2345-4371-a77d-26151fbcf44d
anirudhgupta03/450-DSA-Sheet
Backtracking/Longest Route.cpp
//https://www.codingninjas.com/codestudio/problems/longest-route_1170525?leftPanelTab=0 #include<bits/stdc++.h> using namespace std; int px[4] = {-1,1,0,0}; int py[4] = {0,0,-1,1}; void solve(int x, int y, int dx, int dy, int &ans, int len, vector<vector<int>> &mat, vector<vector<int>> &vis){ if(x == dx && y ...
ALGO
0.99937
5.258123
2e49bafd-bc26-45a7-bdaa-94f5cc3f0be4
LowPolyCount/LowPolyCount-Raytracer
lib/boost_1_57_0/libs/numeric/odeint/examples/gmpxx/lorenz_gmpxx.cpp
#include <iostream> #include <boost/array.hpp> #include <gmpxx.h> #include <boost/numeric/odeint.hpp> using namespace std; using namespace boost::numeric::odeint; //[ gmpxx_lorenz typedef mpf_class value_type; typedef boost::array< value_type , 3 > state_type; struct lorenz { void operator()( const state_type ...
ALGO
0.987506
6.689046
b35874fc-44fa-41e1-b5e4-5ffb9c3a04f5
libigl/libigl-python-bindings
attic/todo-old/seam_edges.cpp
#include <npe.h> #include <typedefs.h> #include <igl/seam_edges.h> const char* ds_seam_edges = R"igl_Qu8mg5v7( Parameters ---------- Returns ------- See also -------- Notes ----- None Examples -------- Finds all UV-space boundaries of a mesh. Inputs: V #V by dim list of positions of the input mesh. ...
ALGO
0.991102
7.15943
a4f49778-d5dc-4831-a9e4-79e7293f16c9
hwsel/HybridTEE
darknet_SGX/App/data.cpp
#include "data.h" #include "utils.h" #include "image.h" //#include "cuda.h" #include <stdio.h> #include <stdlib.h> #include <string.h> pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; list *get_paths(char *filename) { char *path; FILE *file = fopen(filename, "r"); if(!file) file_error(filename); li...
DATA
0.963845
3.26542
4b6495e1-33f6-41f9-9703-a0f4effe6725
rettihovka/prd
src/coins.cpp
#include "coins.h" #include "consensus/consensus.h" #include "memusage.h" #include "random.h" #include <assert.h> bool CCoinsView::GetCoin(const COutPoint &outpoint, Coin &coin) const { return false; } uint256 CCoinsView::GetBestBlock() const { return uint256(); } std::vector<uint256> CCoinsView::GetHeadBlocks() co...
TOOL
0.881377
7.739428
c9f80098-7fbe-415c-a012-67ba899d959a
atharvagadkari05/DSA_questions
C++/COCONUT.cpp
#include <iostream> using namespace std; int main(){ int t; cin>>t; while(t--){ int x1,x2,X1,X2; cin>>x1>>x2>>X1>>X2; int a = X1/x1; int b = X2/x2; int sum = a+b; cout<<sum<<endl; } return 0; }
ALGO
0.999253
3.605208
bd783d58-d594-4d92-ab26-3d938d9a2ed5
chopndolphy/LearnOpenGL
lib/glm/test/core/core_func_integer_find_lsb.cpp
#include <glm/glm.hpp> #include <cstdio> #include <cstdlib> //To define "exit", req'd by XLC. #include <ctime> #ifdef NDEBUG static int pop(unsigned x) { x = x - ((x >> 1) & 0x55555555); x = (x & 0x33333333) + ((x >> 2) & 0x33333333); x = (x + (x >> 4)) & 0x0F0F0F0F; x = x + (x << 8); x = x + (x << 16); ret...
ALGO
0.994565
4.289132
98f46e88-031a-4599-89c1-f5b9f9abc748
PsYchiiC8/CSE3150
Week5/PA4-startercode/RemoveDupPointers.cpp
// // RemoveDupPointers.cpp // // // Created by Yufeng Wu on 1/18/21. // // #include <string> #include <vector> #include <algorithm> using namespace std; bool compareStringPointers(string* a, string* b) { return *a == *b; } void RemoveDupPointers(vector<string *> &arrayPtrs) { // arrayPtrs: STL vector of...
ALGO
0.983908
5.333827
0e4c23b7-c583-4b75-be50-4315103ba472
cou929/topcoder
TextStatistics.cpp
// BEGIN CUT HERE // END CUT HERE #include <sstream> #include <string> #include <vector> #include <map> #include <algorithm> #include <iostream> #include <cstdio> #include <cstdlib> #include <cmath> #include <utility> #include <set> #include <cctype> using namespace std; class TextStatistics { public: double averageL...
ALGO
0.965454
4.508381
d0ba9f60-23e0-4dc9-94b1-53c6828aea3d
ishandutta2007/codeforces
sirshokoladina/normal/1023/E.cpp
#include <bits/stdc++.h> using namespace std; #ifdef SG #include <debug.h> #else template<typename T> struct outputer; struct outputable {}; #define PRINT(...) #define OUTPUT(...) #define show(...) #define debug(...) #define deepen(...) #define timer(...) #define fbegin(...) #define fend #define pbegin(......
ALGO
0.999934
3.033644
278e1d21-38d3-461a-b997-fc22511c4a80
0GreenClover0/ArchKomp
borlandc/CLASSLIB/SOURCE/BTREELFN.CPP
#if !defined( CHECKS_H ) #include <Checks.h> #endif // CHECKS_H #if !defined( __BTREE_H ) #include <BTree.h> #endif // __BTREE_H #ifndef __STDLIB_H #include <stdlib.h> #endif #ifndef __IOSTREAM_H #include <iostream.h> #endif //====== LeafNode functions ======= LeafNode::LeafNode(InnerNode* P, Sortable* O, Btree*...
ALGO
0.959048
5.399807
e3ad3e80-d1b0-4b75-b1d1-17bd859e2533
AdeshChoudhar/CPPractice
ASCI/2021/07.cpp
// Problem: Cyclically rotate an array by one #include <bits/stdc++.h> using namespace std; void solve(int[], int); void printArray(string, int[], int); int main() { int arr[] = {1, 2, 3, 4, 5}; int n = sizeof(arr) / sizeof(arr[0]); cout << "INPUT(s):" << endl; printArray("arr", arr, n); solve...
ALGO
0.999812
5.308712
f2d7d401-e293-4a45-b269-e1f081101fd0
alexandraback/datacollection
solutions_5639104758808576_1/C++/vipulsharma/in.cpp
#include<iostream> #include<fstream> #include<string> using namespace std; int main() { ifstream in("abc.txt"); ofstream out("b.txt"); int t,tt=1; cin >> t; while(t--) { int n; string s; cin >> n >> s; int ans = 0 ; int val =...
ALGO
0.999618
3.28623
fb84b2ed-f26c-46ea-9595-f4afce236982
okaryo/CompetitiveProgramming
AtCoder/ABC/001~100/081~090/085/C.cpp
#include <bits/stdc++.h> using namespace std; int main() { int n, y; cin >> n >> y; int a = y / 10000; int b = y / 5000; int c = y / 1000; for (int i = 0; i <= a; i ++) { for (int j = 0; j <= b; j ++) { if (10000 * i + 5000 * j + 1000 * (n - i - j) == y && n - i - j >= 0) { cout << i << ...
ALGO
0.999663
4.010725
6a299901-2c98-495f-bb66-3bdcd72fe9cf
dapengbusi/incubator-brpc
src/brpc/policy/sofa_pbrpc_protocol.cpp
#include <google/protobuf/descriptor.h> // MethodDescriptor #include <google/protobuf/message.h> // Message #include <google/protobuf/io/zero_copy_stream_impl_lite.h> #include <google/protobuf/io/coded_stream.h> #include "butil/time.h" #include "brpc/controller.h" // Controller #incl...
WEB
0.896006
7.309366
cbd07ad4-4b5e-4c84-b92c-593f96b21415
ApurvGupta001/Assignment
10.cpp
#include <bits/stdc++.h> using namespace std; class add { private: int n1,n2; public: void input() { cin>>n1; cin>>n2; return; } int sum() { int sum=n1+n2; return sum; } }; int main() { add obj; obj.input(); cout<<obj.sum()<<endl; return 0; }
ALGO
0.974684
3.684656
53a64b6f-9414-47dc-a03a-7b6351e1f87f
Adrian-Sciepura/Studies
Algorithms and Data Structures/Claw/Claw.cpp
#include <iostream> using std::cout; using std::cin; int main() { int numberOfLines = 0; cin >> numberOfLines; for (int i = 0; i < numberOfLines; i++) { int matrixSize = 0; cin >> matrixSize; bool isClawFree = true; char** matrix = new char* [matrixSize]; for ...
ALGO
0.998792
4.260926
92e05382-f1d1-48bf-9f4c-747c78fc734f
BasitAziz-18/cpp
Chapter-6/11.cpp
/* Modify the four-function fraction calculator of Exercise 12 in Chapter 5 to use a fraction class rather than a structure. There should be member functions for input and output, as well as for the four arithmetical operations. While you’re at it, you might as well install the capability to reduce fractions to lowest ...
TOOL
0.933295
6.197609
eb64bc99-ad29-44c4-a1ae-7b8cfcf33f16
sprkrd/rise-implementation
Source/rise_classifier.cpp
#include "algorithm.h" #include <cmath> #include <iostream> #include <string> struct Options { std::string datafile, metafile; rise::Dataframe::NDistance dtype; double q; int folds; }; bool read_options(int argc, char* argv[], Options& options) { if (argc < 4) return false; if (argc > 5) return false; o...
DATA
0.968726
6.164059
db92767b-ca40-4967-b25b-ef1dc31d771d
SharifdotG/SharifdotG-s-CodeVault
AtCoder/ABC Class (Atcoder Beginner Contest)/AtCoder Beginner Contest 042/C - Iroha's Obsession/arc058_a.cpp
#include <bits/stdc++.h> using namespace std; int main() { int n, k; cin >> n >> k; vector<int> d(k); for (int i = 0; i < k; i++) { cin >> d[i]; } for (int i = n; ; i++) { string s = to_string(i); bool doesLike = true; for (int j = 0; j < s.size(); j++) { ...
ALGO
0.999969
4.228549
f00b99df-746c-4fc9-b01c-e8f2f5807377
a00012025/Online_Judge_Code
TIOJ/1691.cpp
#include<bits/stdc++.h> #define F first #define S second using namespace std; map<int,vector<int> > mp ; main() { int n ; scanf("%d",&n) ; for(int i=1;i<=n;i++) { int x ; scanf("%d",&x) ; mp[x].push_back(i) ; } int mi=n ; for(auto i : mp) for(int j=0;j<(int)i.S.size()-1;j++) ...
ALGO
0.999645
3.5665
dbd1030e-1f6a-41d7-bed2-29ace7f73d90
sahilkhan03/CF-Solutions
codeforces/1323/C.cpp
/* Author : DemonStar */ #pragma GCC optimize("Ofast") #pragma GCC target ("sse4") #include <bits/stdc++.h> using namespace std; typedef long long ll; #define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); #define all(x) x.begin(), x.end() #define loop(i, n) for(ll i = 0; i < n; i++) #define mset(v, a...
ALGO
0.999863
4.264006
468d0088-6f74-47bf-8a2d-73a041018b90
proteus-core/libra
libra-llvm/mlir/lib/Dialect/SCF/Transforms/LoopSpecialization.cpp
#include "mlir/Dialect/SCF/Transforms/Passes.h" #include "mlir/Dialect/Affine/Analysis/AffineStructures.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/Aff...
TOOL
0.909596
7.386669
dcc7abdf-753a-4612-9dc1-db8ba063b37c
xmg2024/Leetcode-Solutions
1501-2000/1866-Number-of-Ways-to-Rearrange-Sticks-With-K-Sticks-Visible/cpp-1866/main3.cpp
/// Source : https://leetcode.com/problems/number-of-ways-to-rearrange-sticks-with-k-sticks-visible/ /// Author : liuyubobobo /// Time : 2021-05-18 #include <iostream> #include <vector> using namespace std; /// Dynamic Programming /// Time Complexity: O(nk) /// Space Complexity: O(nk) class Solution { private: ...
ALGO
0.999991
5.740148
f1b1a436-2fd5-4125-b9fc-bda67ed40cfe
raincross7/code-similarity
codes/train_code/problem198/problem198_336.cpp
#include <bits/stdc++.h> using namespace std; int main(){ string o,e; cin >> o >> e; for(int i = 0; i < o.length()+e.length(); i++){ if(i%2==0){ cout << o[i/2]; }else{ cout << e[i/2]; } } cout << endl; return 0; }
ALGO
0.999979
3.192961
2b655300-2678-4834-91ca-dc9efa0dd9fc
PowerYingMu/ScanMatchingLocalization
workspace/c3-project/libcarla-install/include/carla/road/element/LaneCrossingCalculator.cpp
#include "carla/road/element/LaneCrossingCalculator.h" #include "carla/road/element/LaneMarking.h" #include "carla/geom/Location.h" #include "carla/road/Map.h" namespace carla { namespace road { namespace element { /// @todo Temporary flags to search lanes where we can find road marks. /// This needs to be expan...
TOOL
0.998767
7.612737
26d3cf71-cd65-4681-a117-9b2002ffb8bf
Deepali-14/OOPS_LAB
5A_4.cpp
//Program to calculate area of circle, rectangle, triangle and square using inline function #include<iostream> using namespace std; class Number { float l,b,s,B,H,r; public: void getdata() { cout<<"\n Enter radius of circle : "; cin>>r; cout<<"\n Enter length and breadth of rectangle respectivel...
ALGO
0.954394
3.752646
0dd44e77-d163-4f1c-9c20-7c8b79ba4dfb
MinaFaried3/Junior-Training-Sheet-Dr-Mostafa-Sad
B-problems/code_forces/SorttheArray.cpp
#include <set> #include <map> #include <array> #include <list> #include <iomanip> #include <cmath> #include <climits> #include <string> #include <vector> #include <queue> #include <stack> #include <complex> #include <sstream> #include <iostream> #include <fstream> #include <algorithm> #include <numeric> #include <utili...
ALGO
0.999557
3.954008
601f3ad4-31be-4b6e-a9d0-055f2b5316df
rfflmrrs/cs1prSpringCoursework
tutorial-codes/spring/4/w4ex6.cpp
#include <iostream> using namespace std; template <typename T> void fun(const T& x) { static int count = 0; cout << "x = " << x << " count = " << count << endl; ++count; return; } int main() { fun<int>(1); cout << endl; fun<int>(1); cout << endl; fun<unsigned>(1); cout << endl;...
TOOL
0.858341
5.975983
b123adce-3e7d-4a97-82c8-ff18441ede8b
Chanderkan7/100lines
September-2020/5-Sept-2020/main.cpp
/*#include <iostream> // for console io operations #include <cstdlib> // for rand() funtion #include <ctime> // for time() function #include <math.h> // for ceil() function using namespace std; class Warrior { private: int attkMax; int blockMax; public: string name; int health; Warrior (string name, int hea...
TOOL
0.942303
3.16283
dd701403-e44a-4795-8335-62389fd27bef
Rushikesh0107/DSA-Concepts-Questions
Hashing/max-freq-min-freq-in-array.cpp
// Online C++ compiler to run C++ program online #include<bits/stdc++.h> using namespace std; int main(){ vector<int> arr = {7,9,9,15,5}; int n = arr.size(); int minFreq = 1e5; int maxFreq = 0; int minElement , maxElement; unordered_map<int,int> mpp; for(int i = 0; i < n; i++){ ...
ALGO
0.999943
3.83406
a0664e98-9ca5-4bf9-85d3-4dfde7e17b0d
subhankar-coder/LeetCode_Rebel
407_trapping_rain_water_II.cpp
#include<bits/stdc++.h> using namespace std; bool isOutBoundary(vector<vector<int>> &heightMap,int r,int c,int R,int C){ if(r>=R || r<0 || c<0 || c>=C) return true; return false; } bool isOnBoundary(int r,int c,int R,int C){ if(r==R-1 || r==0 || c==C-1 || c==0) return true; return false; } str...
ALGO
0.999783
3.969068
9cd17228-e57f-46f5-a2f3-66a3d74e0933
abhishekbiswas772/DSA
DSA_Files/src/love_babar_sol/Array/CyclicallyRotateByOne.cpp
#include <iostream> #include <vector> using namespace std; void cycleRotateByOne(std::vector<int> &arr){ int n = arr.size(); int temp = arr[n - 1]; for(int i = n - 1; i >= 1; i--){ arr[i] = arr[i - 1]; } arr[0] = temp; } int main(){ std::vector<int> arr = {1, 2, 3, 4, 5}; cycleRot...
ALGO
0.999775
5.084659
66b67bd4-6f9d-4861-abe1-d66bc551eb88
gclx/leetcode
524_通过删除字母匹配到字典里最长单词(水题).cpp
class Solution { public: int check(string s, string t){ int cnt = 0; int pos = 0; for (int i = 0; i < t.size(); i++){ for (int j = pos; j < s.size(); j++, pos++){ if (s[j] == t[i]){ cnt++; pos++; break; ...
ALGO
0.999788
5.974418
20eb4935-966c-4c5b-aad4-dbadf2ea8ba4
amirhnajafiz/leetcodz
bfs/easy.cpp
#include <iostream> #include <vector> #include <queue> using namespace std; // Simple BFS traversal for an unweighted graph void bfs(int start, const vector<vector<int>>& adj) { int n = adj.size(); vector<bool> visited(n, false); queue<int> q; visited[start] = true; q.push(start); while (!q....
ALGO
0.999881
6.524238
e4bea7d1-3acb-41c4-91ad-858caf0eca0b
raincross7/code-similarity
codes/train_code/problem129/problem129_379.cpp
#include <bits/stdc++.h> using namespace std; int main(){ long long X,Y,A=pow(10,18); cin >> X >> Y; if(X%Y==0){ cout << -1 << endl; } else{ cout << X << endl; } }
ALGO
0.999665
3.47956
18d02f03-7170-4c8e-85ab-820269df7a52
thegamer1907/Code_Analysis
scrape/data/Tokitsukaze and Discard Items/KasuganoSora6_A.cpp
#include<bits/stdc++.h> using namespace std; const int maxm=1e5+13; long long a[maxm]; int main(){ long long n; long long m,k; cin>>n>>m>>k; for(int i=1;i<=m;i++) scanf("%lld",&a[i]); long long dsy=0,dis=0,pos=1,nk=k; while(dis<m){ if(a[pos]-dis>nk){long long z=(a[pos]-dis-nk)/k;nk=nk+z*k;if(a[pos]-dis>nk) nk+=...
ALGO
0.999924
3.3345
18c78d09-cb31-4f26-879c-3fd1e0fe9737
harsh3sahu/DSA
9linkedlist/1prac.cpp
#include<iostream> using namespace std; class Node{ public: int data; Node *next; Node(int data){ this->data=data; this->next=NULL; } }; void insertAtTail(Node* n1,int data){ Node *n2=n1; while(n2->next!=NULL){ n2=n2->next; } Node *temp=new Node(data); ...
ALGO
0.999537
4.927907
90e4ef6f-6bb4-40bd-8537-b18c1932cbd4
SuperFoolGirl/algorithm_learning
基础/3.搜索与图论/二分图/匈牙利算法.cpp
// 二分图是一种特殊的图,它的顶点可以被分为两个不相交的集合,且所有边都连接这两个集合中的顶点。 // 但二分图所抽象出来的两个集合,并不一定满足单射的关系(也不满足满射,但不予讨论) // 匹配是二分图中的一个边集,其中任意两条边都没有共同的顶点。这个匹配中的每一条边都代表了左右两个集合之间的一个一对一(单射)配对。 // 匈牙利算法就是为了找到一个最大匹配,即边数最多的那个匹配。 // 这个算法最终找到了一个最大数量的单射配对集合,而这个集合的边数就是二分图的最大匹配数。 // 下方示例代码的前提:左集合来匹配右集合 #include <algorithm> #include <cstring> #include <ios...
ALGO
0.999908
5.156536
3731232d-796c-4fa1-97dd-9c4210cadf73
Jordi-Ab/Dissertation
C++/1D_NF_mmult/RungeKutta4Solver.cpp
#include "RungeKutta4Solver.hpp" RK4Solver::RK4Solver(ODEInterface& an_ODESystem, const Vector& initial_value, const double initial_time, const double final_time, const double step_size, const std::string output_fi...
ALGO
0.983282
6.322998
004fc02d-3e97-4a2a-8d43-e7d166199dd7
amir-hosen7/LeetCode
AC-Submissions/problems/where_will_the_ball_fall/solution.cpp
//will solve class Solution { public: bool valid(int rsize,int csize,int r,int c){ if(rsize<=r||csize<=c||c<0||r<0)return false; return true; } int DFS(vector<vector<int>>& grid,int r,int c){ if(r==grid.size())return c; if(valid(grid.size(),grid[0].size(),r,c)){ ...
ALGO
0.999967
5.492912
ff94f44b-975f-4bf7-81bb-5f20a378eb92
mahbubul-haq/Data-Structures-And-Algorithms
string/Robin_Karp_String_Matching_and_Hashing.cpp
#include<iostream> #include<cstdio> #include<set> #include<queue> #include<cstring> #include<math.h> #include<map> #include<string> #include<climits> #include<algorithm> #include <iomanip> #include <vector> #include <stack> #include <list> #include <iterator> using namespace std; #define pb push_back #define pii pair<...
ALGO
0.999875
4.101748
6c0fa5fd-afea-4945-9e5d-69258489db2d
TNishimoto/rlbwt_iterator
src/debug/slcp_main.cpp
#include <cassert> #include <chrono> //#include "../common/cmdline.h" //#include "../common/print.hpp" //#include "../common/io.h" #include "../include/rlbwt_iterator.hpp" #include "../include/bwt.hpp" #include "../include/sampling_lcp/succinct_slcp_constructor.hpp" #include "../include/weiner/weiner.hpp" #include ".....
ALGO
0.98517
4.072421
82258a6f-8e86-4b04-a34a-6212f00f84aa
Cattmonkey/openWork
webWork_backup/webflask/templates/examples/xcntab1.cpp
#include <string> #include <fstream> #include <iostream> #include <iomanip> #include <strstream> #include "nr.h" using namespace std; // Driver for routine cntab1 int main(void) { const int NDAT=9,NMON=12; int i,j; DP ccc,chisq,cramrv,df,prob; string txt,txt2,fate[NDAT],mon; Ma...
DATA
0.927197
3.409071
7d54368a-1a8a-4270-bd42-60118343e28b
ThuThuy06/2-11
Chapter2,3,4,5,6,/Chapter7C++/ThiCuoiKi/4.IOk22/1.io.cpp
#include<iostream> #include <iomanip> using namespace std; int main(){ int r; cin>>r; if(0<r&&r<50){ double v = (4.0/3.0)*3.14*r*r*r; cout << fixed << setprecision(2) << v; } else { cout<<"N"; } return 0; }
ALGO
0.999884
3.41626
e0a4c909-38f3-4843-9cb1-641c1ccb80e4
JeansAthiwat/CU_2ndYear-1stSemester
IntroData/d62_q3a_heap_node_relation/main.cpp
#include <iostream> using namespace std; int main() { int n,m; cin >> n >> m; for(int i = 0; i < m; i++) { int a,b; cin >> a >> b; if(a == b) { cout << "a and b are the same node\n"; } else if(a > b) { bool isAnc = false; while(a > 0) {...
ALGO
0.999808
3.732841
74725ee0-2054-474a-bf87-77dd8c96e343
PaukIsUha/optimizing_formating_code
predictions/submissions-aizu-coop-gpt35/Codenet/p01370/302816359/response_7.cpp
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <vector> using namespace std; #define rep(i, b) for (int i = 0; i < b; i++) #define m_t 60 #define max (3 * m_t * (m_t + 1) + 1) #define zero (max / 2) #define mp make_pair int dx[6] = { 0, 1, -1, 1, -1, 0 }; int dy[...
ALGO
0.999861
4.491239
f131ce7b-991f-48ca-b9ff-dda6453e2146
foxtroat09/dsa
recursion/recursion.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long int #define ld long double #define mod 1000000007 #define inf 1e18 //print N to 1 void printN_to_1(int num, int n) { if (num < 1) return; cout << num << "\n"; printN_to_1(num - 1, n); } //print 1 to N void print1_to_N(int num, int n) { ...
ALGO
0.999668
3.828861
2df50079-e684-4ef7-bda7-82780a28d0d3
smithan7/discreteCoordination
discreteCoordination/discrete_coordination.cpp
#include <iostream> #include <stdlib.h> #include <stdio.h> #include <vector> #include <string> #include <fstream> #include <iostream> #include "opencv2/core/core.hpp" #include "opencv2/imgproc/imgproc.hpp" #include "opencv2/highgui/highgui.hpp" #include "Graph.h" #include "MiniGraph.h" #include "Agent.h" #include "Fr...
ALGO
0.997364
3.36791
e9da6027-272a-4f2e-b000-ccde521e2447
raincross7/code-similarity
codes/train_code/problem333/problem333_191.cpp
#include <iostream> #include <algorithm> using namespace std; const int MAX_N = 100009; int n, k, a[MAX_N]; int s[MAX_N]; int main() { while (true) { s[0] = 0; cin >> n >> k; if (n == 0 && k == 0) break; for (int i = 0; i < n; i++) { cin >> a[i]; s[i+1] ...
ALGO
0.999925
4.233151
9b6d214d-9398-4aa1-8fbb-c118d6fa6e03
j-c-w/DSPAcceleratorSupport
benchmarks/Suites/UT-DSP/ut_dsp_wrapper.cpp
#include<vector> #include<nlohmann/json.hpp> #include<fstream> #include<iomanip> #include "1024/arrays/fft_1024.c" char *output_file; char *pre_accel_dump_file; // optional dump file. using json = nlohmann::json; void write_output(float * data_real, float * data_imag, float * coef_real, float * coef_imag) { json...
ALGO
0.973651
5.037628
6dae6b0b-f69e-4991-83e1-e31f3298e04e
MrFrenik/gs_core
third_party/include/recast/DetourCrowd/Source/DetourCrowd.cpp
#define _USE_MATH_DEFINES #include <string.h> #include <float.h> #include <stdlib.h> #include <new> #include "DetourCrowd.h" #include "DetourNavMesh.h" #include "DetourNavMeshQuery.h" #include "DetourObstacleAvoidance.h" #include "DetourCommon.h" #include "DetourMath.h" #include "DetourAssert.h" #include "DetourAlloc.h...
ALGO
0.999233
6.039815
2c61086e-b123-4d5d-89be-e6a10a401354
JonDoe1454/Evolution-Simulator
src/Organism.cpp
#include "Organism.h" namespace IB{ Organism::Organism(Coord initialPosition){ position = initialPosition; genomeStep = 0; } void Organism::SetGenome(int geneSeed, int genomeLength){ for(int i = 0; i < genomeLength; i++){ std::string gene = std::to_string(rnGen.GetRandomInt(0,3)); genome +...
ALGO
0.991431
4.880893
118ed78f-3ffc-469b-bfaf-1a57b25976d5
ishandutta2007/codeforces
realcomplex/normal/1387/A.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef long double ld; #define fi first #define se second #define mp make_pair #define fastIO ios::sync_with_stdio(false);cin.tie(0);cout.tie(0); const int N = (int)1e5 + 10; const ld EPS = 1e-9; bool vis[N]; ld a[N], b...
ALGO
0.999988
3.449712
621deeeb-454f-4000-9d15-4178ca173f94
ishandutta2007/codeforces
holyk/normal/1427/B.cpp
#include <bits/stdc++.h> template <class T> inline void readInt(T &w) { char c, p = 0; while (!isdigit(c = getchar())) p = c == '-'; for (w = c & 15; isdigit(c = getchar()); w = w * 10 + (c & 15)); if (p) w = -w; } template <class T, class... Args> inline void readInt(T &w, Args &... args) { readInt(w), readIn...
ALGO
0.999954
3.361838
c5460312-fb05-49e7-af26-ed46d4048e22
Ank9472/dsa-practise
C++basic/T.cpp
#include<bits/stdc++.h> using namespace std; int main(){ int N,Q; cin>>N>>Q; long long arr[N+1]={0}; for(long long i=1;i<N;i++) { cin>>arr[i]; } for(long long i =1;i<=Q;i++) { long long L,R; cin >>L>>R; long long sum =0; for(long long i=L;i<=R;i++){ sum = sum + arr[i]; }...
ALGO
0.999937
4.09653
75146e36-f9d9-4df9-be5b-59aafa0178bf
paramarora09/Cpp-Assignments
C++ Assignments/Set 2/lab1/ques5.cpp
#include <iostream> int main(){ using namespace std; int choice = 1; while( choice == 1 ){ int a; cout << "Enter a number to check even or odd" << endl; cin >> a; //input number //check whether number is even or odd if( a%2 == 0 ){ cout << "Your number is even" << endl; } else{ cout << "Your...
ALGO
0.916368
3.473591
c14d8c11-efc8-4196-aaa6-671bc25f09e1
yinghuo302/OJ
luogu/3373.cpp
/* * @Author: zanilia * @Date: 2023-03-15 18:24:17 * @LastEditTime: 2023-03-16 15:22:19 * @Descripttion: */ #include <iostream> #define MAX_N 100001 int n,m,op,x,y,k,p; struct Info{ int val,cnt; Info():val(0),cnt(0){} Info(int val,int cnt):val(val),cnt(cnt){} Info operator+(const Info& other)const { return ...
ALGO
0.999915
4.290303
3637bfcb-17c3-49af-a5b6-d88e61eb635b
omkaranu04/CP_DSA
Codeforecs/1-1998/1399A.cpp
#include <bits/stdc++.h> using namespace std; int main(int argc, char const *argv[]) { int t; cin >> t; while (t--) { int n; cin >> n; int a[n]; for (int i = 0; i < n; i++) { cin >> a[i]; } sort(a, a + n); int count = 0; ...
ALGO
0.999957
4.233663
a679ab47-1b41-4919-af80-f6024ed4d43e
QbitQuantum/Basics
Исходники/ago_haf_cpu_histogram.cpp
static int HafCpu_Histogram3Thresholds_DATA_U8 ( vx_uint32 dstHist[], vx_uint8 distThreshold0, vx_uint8 distThreshold1, vx_uint8 distThreshold2, vx_uint32 srcWidth, vx_uint32 srcHeight, vx_uint8 * pSrcImage, vx_uint32 srcImageStrideInBytes ) { // offset: to convert t...
ALGO
0.983079
5.482264
b9856c4a-ff90-47a0-b788-64de620744fd
ishandutta2007/codeforces
robezh/normal/1671/C.cpp
#include <bits/stdc++.h> using namespace std; #define rep(i, a, b) for(int i = a; i < (b); ++i) #define trav(a, x) for(auto& a : x) #define all(x) begin(x), end(x) #define sz(x) (int)(x).size() #define subnb true #define Lnb true typedef long long ll; typedef long double ld; typedef pair<int, int> pii; typedef pair<ll...
ALGO
0.999901
3.928778
873ae1f4-24c6-4c7b-9369-f74ccc259879
pilkch/library
src/Box2D/Dynamics/b2ContactManager.cpp
#include <Box2D/Dynamics/b2ContactManager.h> #include <Box2D/Dynamics/b2Body.h> #include <Box2D/Dynamics/b2Fixture.h> #include <Box2D/Dynamics/b2WorldCallbacks.h> #include <Box2D/Dynamics/Contacts/b2Contact.h> b2ContactFilter b2_defaultFilter; b2ContactListener b2_defaultListener; b2ContactManager::b2ContactManager()...
ALGO
0.958789
6.945851
59cb912c-0222-4a55-9d43-bd4425a109d9
bhavana-shegokar/LogicBuilding
LB C++ CODE on 6 June 2023 : Problems on Bitwise oprator (HARD)/drive-download-20230607T041014Z-001/program243.cpp
#include<iostream> using namespace std; typedef unsigned int UINT; bool CheckBit(UINT iNo, UINT iPos1, UINT iPos2) { UINT iMask1 = 0X00000001; UINT iMask2 = 0X00000001; UINT iResult = 0; if((iPos1 < 1) || (iPos1 > 32) || (iPos2 < 1) || (iPos2 > 32)) { cout<<"Invalid position"<<"\n"; ...
ALGO
0.997606
4.855986
686b488d-6ed0-4eae-b7c4-b39e478ebcc7
HnpawsPham/CP-PROBLEMS
IT_Squad_Journey/THPT/Khai_code/2025/EXORDIUM14.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; #define el "\n" int n; ll sum = 0; int main(){ ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); cin>>n; int d = (n % 2); for(int i = d; i <= n; i+=2) sum += i; cout<<sum; return 0; }
ALGO
0.999808
4.21114
1a9abbba-bfe8-4aec-99b0-eeb864434ae6
TedYav/CodingChallenges
HackerRank/Algorithms/dp/coinchange.cpp
// recurrence: // W(n,m) = number of ways to make n with first m coins // W(n,m) = W(n,m-1) + W(n-C[m], m) where C[m] = value of coin m // thank you to a hacker rank poster for pointing this out as I was double counting // I was doing: W(n,m) = W(n-C[m], m) + W(C[m],m) == double counting lots of cases #include <iostre...
ALGO
0.999996
4.52116
ae2b87b5-88f8-4e38-9670-9dd69dcfaf8f
maaayan3330/OS-exe4-2025
Configuration.cpp
#include "Configuration.h" #include <fstream> #include <sstream> #include <iostream> #include <stdexcept> Configuration parseConfigurationFile(const std::string& filename) { Configuration config; std::ifstream file(filename); if (!file.is_open()) { throw std::runtime_error("Could not open configur...
CONFIG
0.890019
6.762407
5d428c17-83f3-4dc5-999d-9195bb56c3eb
duongtrieuelec/LeetSolve
cpp-leetcode/leetcode557-reverse-words-in-a-string-iii_solution1.cpp
#include<vector> #include<string> #include<algorithm> #include<sstream> /* 含有stringstream类 */ #include<iostream> using namespace std; class Solution { public: string reverseWords(string s) { string res; // 把word放进vector vector<string> words; istringstream iss(s); whi...
ALGO
0.999911
4.425761
b5f5e9d7-70da-4cbb-abe7-dec62556dd71
sarvex/leetcode-clisp
solution/0300-0399/0303.Range Sum Query - Immutable/Solution.cpp
class NumArray { public: vector<int> s; NumArray(vector<int>& nums) { int n = nums.size(); s.resize(n + 1); for (int i = 0; i < n; ++i) s[i + 1] = s[i] + nums[i]; } int sumRange(int left, int right) { return s[right + 1] - s[left]; } }; /** * Your NumArray object ...
ALGO
0.999865
6.644038