uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
555f20ad-fffc-4ef6-a389-f0d50995b331
colinmccormick/CarND-Path-Planning-Project
src/Eigen-3.3/doc/examples/tut_arithmetic_dot_cross.cpp
#include <iostream> #include <Eigen/Dense> using namespace Eigen; using namespace std; int main() { Vector3d v(1,2,3); Vector3d w(0,1,2); cout << "Dot product: " << v.dot(w) << endl; double dp = v.adjoint()*w; // automatic conversion of the inner product to a scalar cout << "Dot product via a matrix product...
ALGO
0.997952
4.042919
2c1bf395-877b-44c5-b8a6-08ccef60bfb0
harshcoder7/my-dsa
arrays/swapalternate.cpp
#include<iostream> using namespace std; void printarray(int arr[],int n) { for(int i=0;i<n;i++) { cout<<arr[i]<<" "; }cout<<endl; } void swapalternate(int arr[],int size) { for(int i=0;i<size;i+=2) { if(i+1<size) { swap(arr[i],arr[i+1]); } } } int mai...
ALGO
0.9994
4.526826
006046ab-160d-44d0-a93d-48d7919d921e
1197730304/c
代码程序/通讯录管理系统.cpp
#define MAX 1000 #include<iostream> #include<string> using namespace std; //ϵ˵Ľṹ struct person { string m_Name; int m_Sex;//1. 2.Ů int m_Age; string m_Tel;//绰 string m_Ad;//סַ }; struct Addressbooks { struct person personArray[MAX];//ͨѶ¼ϵ int m_Size; }; //ͨѶ¼Ľṹ void menu() { cout << " ------------------------...
TOOL
0.900797
3.285
3ba0e0cd-2b9d-4327-a8cf-634f8ee47660
ishandutta2007/codeforces
mangooste/normal/1689/D.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; #define all(a) begin(a), end(a) #define len(a) int((a).size()) #ifdef LOCAL #include "debug.h" #else #define dbg(...) #endif // LOCAL void solve(int test_num) { int n, m; cin >> n >> m; vector<string> a(n...
ALGO
0.999978
5.987182
cb913945-1e8f-4737-9b11-80287465bdb9
Atharv2433/DSA
n_numbers.cpp
#include<iostream> using namespace std; void fun(int i,int n){ if(i>n)return; else { cout<<i<<endl; } fun(i,n-1); } int main(){ int n; cin>>n; fun(1,n); }
ALGO
0.999701
4.148602
8bcdde65-ba15-4e76-9ef1-613ef66a2ac3
xuau34/competitive-programming
codejamforwomen/2016C.cpp
#include <bits/stdc++.h> using namespace std; int T, C, V, L; long long c, v, p; void ini(void){ scanf("%d %d %d", &C, &V, &L); } void sol(void){ long long tc, tv; c = 0; v = V; while(--L){ tc = (v * C) % p; tv = ((c + v) * V) % p; c = tc; v = tv; //printf("c = %lld v = %lld\n", c, v); ...
ALGO
0.999773
3.588133
2a823137-d614-445d-9386-a7175fc4c69f
arpatil01/scViewer
app/library/Rcpp/tinytest/cpp/Matrix.cpp
#include <Rcpp.h> using namespace Rcpp ; // [[Rcpp::export]] double matrix_numeric( NumericMatrix m){ double trace = 0.0 ; for( size_t i=0 ; i<4; i++){ trace += m(i,i) ; } return trace ; } // [[Rcpp::export]] std::string matrix_character( CharacterMatrix m){ std::string trace ; for( s...
TOOL
0.965408
5.294543
1279fa97-08c1-4c15-9f8d-7b3640575fdc
evan-ite/CPP
module_08/ex01/Span.cpp
#include "Span.hpp" Span::Span(): _n(0), _array(0) {} Span::Span(unsigned int N): _n(N) { this->_array.clear(); } Span::Span(const Span &copy): _n(copy._n), _array(copy._array) {} Span::~Span() {} Span& Span::operator=(const Span &assign) { if (this != &assign) { this->_n = assign._n; this->_array = assign....
ALGO
0.971659
4.815929
66078389-2ae5-4254-b0e3-fe8796002717
KaziRifatMorshed/Learning-C-Cpp-Language
CP/A_Tram.cpp
#include <iostream> using namespace std; int main(void) { int max = 0, sum = 0, a = 0, b = 0; int num_of_stopage = 0; cin >> num_of_stopage; while (num_of_stopage--) { cin >> a >> b; sum += b - a; if (max < sum) { max = sum; } } cout << max; } // DONE
ALGO
0.999213
3.514615
694b7710-f1e5-4fc6-84d8-3b513892ed4c
cryptowen/code_labs
algorithms/snippets/next_permutation.cpp
// next_permutation example // http://www.cplusplus.com/reference/algorithm/next_permutation/ #include <iostream> // std::cout #include <algorithm> // std::next_permutation, std::sort int main () { int myints[] = {1,2,3}; std::sort (myints,myints+3); std::cout << "The 3! possible permutations with 3 ele...
ALGO
0.999447
4.766792
778a4e24-d125-4595-8659-842474330c6f
hyojeonglee/algo
sample_01/Main.cpp
#include <iostream> #include <string> #include <vector> # define NO_OF_CHARS 128 using namespace std; int freq; // A utility function to get maximum of two integers int max(int a, int b) { return (a > b) ? a : b; } // The preprocessing function for Boyer Moore's bad character heuristic void badCharHeuristic(st...
ALGO
0.999025
4.983534
f7f5577e-43bb-4d89-ad65-f7d59503acca
ShrutiRani7029/SHEET_PLACEMENT
MINEAT.cpp
/*#include<bits/stdc++.h> using namespace std; #define ll long long const int N=1e6+10; ll n,h; ll a[N]; bool eat(int m) { ll k=0; //int min=INT_MAX; cout<<m; for(int i=0;i<n;i++) { if(a[i]<=m) { k+=1; } else { if(a[i]%m==0) ...
ALGO
0.999962
3.771537
9c03393e-ed41-4b0a-9184-96afe465781c
ahester57/style_transfer
src/cla_parse.cpp
// cla_parse.cpp : Parse given command line arguments. // Austin Hester CS542o nov 2020 // g++.exe (x86_64-posix-seh-rev0, Built by MinGW-W64 project) 8.1.0 #include <opencv2/core/core.hpp> #include <map> #include "cla_parse.hpp" #include "style_enum.hpp" // parse command line arguments int parse_arguments( in...
TOOL
0.872908
5.688337
3391a6e3-6e12-45f0-b06f-4ce76e9ac089
Mayankkumar1903/LeetCode
2351-first-letter-to-appear-twice/2351-first-letter-to-appear-twice.cpp
class Solution { public: char repeatedCharacter(string s) { unordered_map<int,int> mp; char ans; for(auto it:s){ if(mp.find(it)!=mp.end()){ ans=it; break; } mp[it]++; } return ans; } };
ALGO
0.999965
5.609857
71666848-a247-47fa-b77d-63e786956d38
youngsam-byun/my-notes.github.io
leetcode/src/test/java/Recursion/1088.Confusing-Number-II/1088.Confusing-Number-II_v2.cpp
class Solution { public: unordered_map<char,char>Map={{'0','0'},{'1','1'},{'6','9'},{'8','8'},{'9','6'}}; int count = 0; int N; string n; long perm(int l) { return 4*pow(5,l-1); } long symmetric(int l) { if (l%2==0) return...
ALGO
0.999282
5.92173
d5fb0938-ac54-4b21-adea-17dc4d9b07a3
shinanca/LMSlicer
src/libigl/igl/embree/reorient_facets_raycast.cpp
template < typename DerivedV, typename DerivedF, typename DerivedI, typename DerivedC> IGL_INLINE void igl::embree::reorient_facets_raycast( const Eigen::PlainObjectBase<DerivedV> & V, const Eigen::PlainObjectBase<DerivedF> & F, int rays_total, int rays_minimum, bool facet_wise, bool use_parity, b...
ALGO
0.998613
7.070845
202b2315-4b9d-4723-a350-1aefe2cb283c
dcroper/WavesTuneRTMidiController
JuceLibraryCode/modules/juce_graphics/images/juce_ImageConvolutionKernel.cpp
namespace juce { ImageConvolutionKernel::ImageConvolutionKernel (int sizeToUse) : values ((size_t) (sizeToUse * sizeToUse)), size (sizeToUse) { clear(); } ImageConvolutionKernel::~ImageConvolutionKernel() { } //============================================================================== float ImageCo...
TOOL
0.957133
7.025126
b7c8d17e-17d8-4706-9d46-c6fefa7ad38d
JonathonMacleod/Distributed-Game-Architecture
libs/BOOST1.82.0/libs/graph/example/clustering_coefficient.cpp
//[code_clustering_coefficient #include <iostream> #include <iomanip> #include <boost/graph/undirected_graph.hpp> #include <boost/graph/exterior_property.hpp> #include <boost/graph/clustering_coefficient.hpp> #include "helper.hpp" using namespace std; using namespace boost; // The Actor type stores the name of each ...
ALGO
0.999691
6.878436
3cac927a-dbbc-459e-97c8-1302d689dbcb
Sagarbha1991/com.example.trilinos
packages/rol/example/PDE-OPT/adv-diff-react/example_02.cpp
/*! \file example_01.cpp \brief Solves a source inversion problem governed by the advection-diffusion equation. Performs optimal experimental design (OED). */ #include "Teuchos_Comm.hpp" #include "Teuchos_oblackholestream.hpp" #include "Teuchos_GlobalMPISession.hpp" #include "Teuchos_XMLPar...
ALGO
0.998681
4.85836
eb04f3c1-45f3-4c69-9fb0-4b76434b405a
Gaurav221205/C-If_else-_question-
result.cpp
#include <iostream> using namespace std; int main() { float a, b, c, d, e; cout << "enter marks of best five subjest "; cin >> a >> b >> c >> d >> e; float percentage = (a + b + c + d + e) / 5; cout << "your percentage is:" << percentage; if (percentage >= 90) { cout << "Grade-A an...
TOOL
0.910011
3.262543
611e77fc-ce8d-44f8-8119-83ebf99c19ca
Sarwar05/LightOJ
1062 - Crossed Ladders.cpp
#include<bits/stdc++.h> using namespace std; int main() { int tc,cs=1; double x,y,c,p,q,lo,hi,m; scanf("%d",&tc); while(tc--){ scanf("%lf%lf%lf",&x,&y,&c); lo = 0, hi = max(x,y); for(int i=1; i<=100; i++){ m = (lo + hi)/2; p = sqrt( x*x - m*m ); ...
ALGO
0.999896
3.441936
4bf0b7ed-c5f3-48ee-ae20-12f6cbc033ef
dxhisboy/lammps-sunway
reaxc_system_props_sunway.cpp
#include "pair_reaxc_sunway.h" #include "reaxc_system_props_sunway.h" #include "reaxc_tool_box_sunway.h" #include "reaxc_vector_sunway.h" namespace REAXC_SUNWAY_NS{ void Compute_System_Energy( reax_system *system, simulation_data *data, MPI_Comm comm ) { double my_en[15], sys_en[15]; ...
ALGO
0.999436
4.073984
c2b34889-61d8-4910-9685-f7a9de1f0659
aex-tmp/platform_frameworks_base
libs/hwui/PropertyValuesHolder.cpp
#include "PropertyValuesHolder.h" #include "utils/Color.h" #include "utils/VectorDrawableUtils.h" #include <utils/Log.h> namespace android { namespace uirenderer { using namespace VectorDrawable; inline constexpr float lerp(float fromValue, float toValue, float fraction) { return float(fromValue * (1 - fractio...
TOOL
0.919782
7.43673
9cb9d5e3-29e6-478f-ae4e-af02dd24a0a2
annube/Chifit
src/tmFS.dR.fn.cpp
#include <ginac/ginac.h> using namespace GiNaC; #include <Rcpp.h> using namespace Rcpp; #include "utils.h" #include "tmFS.dR.fn.h" #include "tmFS.R.fn.h" #include "tmFS.R.g.fn.h" /** * integrand for the R function with g' instead of g */ double dR_integrand(double y,void *params){ // static int fnEvalCount=...
ALGO
0.991235
7.542411
55b04706-e84d-4e55-825e-078db68bd82f
cjlworld/OJ
Luogu/P5787.cpp
#include<vector> #include<cstdio> #include<cstring> #include<iostream> #include<algorithm> using namespace std; typedef pair<int,int> PII; template<class T> inline void relax(T& a,const T& b) { a=((a>b) ? a : b); } const int N=2e5+5; struct DSU { int par[N],rank[N],d[N]; PII stk[N]; int top; void build(int n)...
ALGO
0.999991
3.67946
14920e55-c7f8-4397-b257-b9cb510405d2
imakshaysoni/LeetCode
0312-burst-balloons/0312-burst-balloons.cpp
class Solution { public: int maxCoins(vector<int>& nums) { int n=nums.size(); nums.push_back(1); nums.insert(nums.begin(),1); // vector<vector<int>> dp(n+1, vector<int> (n+1, -1)); // return solve(nums,1,n, dp); // Tabulation // i -> 1, n & j-> n-0 REvese...
ALGO
0.999989
5.085135
258d53b0-d37e-42de-8c6c-56e8b8da22a0
krishjagetiya17/Module-3
String/4_no_of_words.cpp
//Write a program in C to count the total number of words in a string #include <stdio.h> #include <ctype.h> int main() { char str[1000]; int words = 0; int inWord = 0; printf("\n\n\t Enter a string: "); fgets(str, sizeof(str), stdin); for (int i = 0; str[i] != '\0'; i++) { // Check i...
ALGO
0.999426
5.186725
75f3f2a4-7ae2-4356-ab2e-d969f549ecdf
ayushsrivastav0811/Leetcode
746-min-cost-climbing-stairs/746-min-cost-climbing-stairs.cpp
class Solution { int cost(int n,vector<int>&nums,vector<int>&dp) { if(n<0) return 0; if(n==0 || n==1) return nums[n]; if(dp[n]!=-1) return dp[n]; int onestep=nums[n]+cost(n-1,nums,dp); int twostep=nums[n]+cost(n-2,nums,dp); return dp...
ALGO
0.99999
6.216599
864380be-6352-4a8d-86f1-008db4293765
Dhanush-dk/CPP
SDE-Sheet/Day11-BinarySearch/findMedianInRowWiseSortedMatrix.cpp
// InterviewBit solution int countSmallerThanMid(vector<int> &row, int mid){ int l = 0, h = row.size()-1; while(l <= h){ int m = (l + h)/2; if(row[m] <= mid) l = m+1; else h = m-1; } return l; } int Solution::findMedian(vector<vector<int> > &A) { int low = 1; int hi...
ALGO
0.999972
5.606099
08eb534d-34a0-4e07-909a-16b2fbdd9afd
kmv2025/practical
6.cpp
#include <iostream> #include <graphics.h> #include <cmath> using namespace std; int main() { int tx = 2, ty = 5; // Translation factors int window1 = initwindow(800, 800); // Initialize graphics window int i, j, k; float P[2][3]; // Array to hold the coordinates of the line in homogeneous form //...
ALGO
0.971666
4.48453
935c9af3-872c-45ba-8dbb-602bf648a29f
avavavsf/Udacity-Path-Planning-Project
src/Eigen-3.3/unsupported/doc/examples/MatrixSquareRoot.cpp
#include <unsupported/Eigen/MatrixFunctions> #include <iostream> using namespace Eigen; int main() { const double pi = std::acos(-1.0); MatrixXd A(2,2); A << cos(pi/3), -sin(pi/3), sin(pi/3), cos(pi/3); std::cout << "The matrix A is:\n" << A << "\n\n"; std::cout << "The matrix square root of A is:...
ALGO
0.998938
3.930508
4b0cfbbf-f97b-4fc9-b0a7-248768db0d55
meherun05/Basic-Data-Structures
Algorithms/Module-14.1/Reach Value.cpp
#include <bits/stdc++.h> using namespace std; bool reachValue(long long int cur,long long int n){ if(cur == n){ return true; } if(cur > n){ return false; } return reachValue(cur * 10,n) || reachValue(cur * 20,n); } int main(){ int t; cin >> t; while(t--){ long l...
ALGO
0.999688
4.989642
f417a5d4-2f4b-4c5f-aa0e-37bad6d479d7
VicoandMe/HW
SwiSchedule/source/SwiSchedule.cpp
/************************************************************************************************* ˵ж swiId жID prio жȼ proc жϴ ֵ ɹ0 -1 **************************************************************************************************/ #include<queue> #include<map> #include<stdlib.h> using namespac...
ALGO
0.998916
3.951912
17f7458e-d410-4d0c-8b5c-c04783217e73
metatomato/SceneGraph
SceneGraph/jni/Bullet/BulletCollision/Gimpact/btGImpactQuantizedBvh.cpp
/*! \file gim_box_set.h \author Francisco Leon Najera */ #include "btGImpactQuantizedBvh.h" #include "LinearMath/btQuickprof.h" #ifdef TRI_COLLISION_PROFILING btClock g_q_tree_clock; float g_q_accum_tree_collision_time = 0; int g_q_count_traversing = 0; void bt_begin_gim02_q_tree_time() { g_q_tree_clock.reset(); }...
ALGO
0.998774
7.06359
2330d8e8-838c-4276-a7a6-bc707edcd46e
OMPRAKASHKUSHWAHA123/calculator
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
8a3f8996-ca4f-4028-95d0-bb109abf0083
Project-LegionOS/android_system_core
init/ueventd_parser.cpp
#include "ueventd_parser.h" #include <grp.h> #include <pwd.h> #include <android-base/parseint.h> #include "import_parser.h" #include "keyword_map.h" #include "parser.h" using android::base::ParseByteCount; namespace android { namespace init { Result<void> ParsePermissionsLine(std::vector<std::string>&& args, ...
TOOL
0.952323
6.398682
7b3f8a32-a63f-431e-bec1-1f6afe9d868e
AidenWang0511/CompetitiveCoding
BackToSchool17WetMud.cpp
#include <bits/stdc++.h> using namespace std; const int MAXN = 100002, INF = 0x3f3f3f3f; int N, M, J, dp[MAXN], dis[MAXN]; pair<int,int> arr[MAXN]; priority_queue<pair<int,int>, vector<pair<int,int>>, greater<pair<int,int>>> pq; int main () { cin.sync_with_stdio(0); cin.tie(0); cout.sync_with_stdio(0); ...
ALGO
0.999967
3.867051
dd8e7eb7-1d83-469f-aaab-e7ec27b457c8
vosaica/Cpp-Prac
PrimerFifthEdition/Chapter_16/16.5.cpp
#include <iostream> template <typename T, unsigned int size> void print(T (&array)[size]) { for (unsigned int i = 0; i < size; ++i) { std::cout << array[i] << ' '; } std::cout << std::endl; } int main() { int a[4] = {1, 2, 3, 4}; int b[100]; print(a); print(b); return 0; ...
ALGO
0.905928
4.534859
de00ef95-c653-4129-b84f-47c6b7c477c2
rkoranga/Oops-Study-Material
oops previous year Qp solutions-2/midsem21/1bii.cpp
//Ques 1-b(ii) #include<iostream> using namespace std; //distance is an inbuilt function so use name distance1 class distance1 { int m; int cm; public: void input(); void disp(); //This function will add two objects to a temp obj and return that object. //return type will be distance1 as it ret...
ALGO
0.98472
3.382082
67bdd8f2-b101-448a-802e-a2e609d2d39f
blockspacer/chrome-view
chrome/src/buildtools/third_party/libc++/trunk/test/std/algorithms/alg.modifying.operations/alg.transform/binary_transform.pass.cpp
// <algorithm> // template<InputIterator InIter1, InputIterator InIter2, class OutIter, // Callable<auto, const InIter1::value_type&, const InIter2::value_type&> BinaryOp> // requires OutputIterator<OutIter, BinaryOp::result_type> && CopyConstructible<BinaryOp> // constexpr OutIter // constexpr after C...
TEST
0.961485
6.936614
2f8b625f-0f25-458e-8085-b5f5e79921c3
tekassh1/Redis-TCP
Server/src/CommandManager.cpp
#include <vector> #include <string> #include <memory> #include <numeric> #include <unordered_map> #include <spdlog/spdlog.h> #include "CommandManager.h" #include "util.h" using namespace std; unordered_map<string, unique_ptr<Command>> CommandManager::command_map; void CommandManager::init_commands() { command_ma...
WEB
0.860909
5.087284
cbb09044-567d-4b4f-be43-06d4f9158938
0xedb/algo-ds
c++/leetcode/151. Reverse Words in a String.cpp
class Solution { public: string reverseWords(string s) { string ans {}; stack<string> stk; string temp {}; for(const auto& i : s) { if(i == ' ' && !temp.empty()) stk.push(temp), temp = ""; else if (i != ' ') ...
ALGO
0.999984
6.532428
81c4c91c-43b3-4a50-81b5-a394cf90e936
franfill1/cses.fi-solutions
src/Geometry/2190-Line Segment Intersection.cpp
/* Task: 2190 Line Segment Intersection Sender: franfill Submission time: 2021-05-22 21:30:44 Language: C++11 Result: ACCEPTED */ #include <bits/stdc++.h> using namespace std; typedef long long ll; struct line; struct pt; pt operator * (pt p, ll a); pt operator + (p...
ALGO
0.999856
4.882363
dafa3897-e04f-4dc4-b2a1-80643eadc5a4
SatansFather/kf
src/engine/game/config.cpp
#if !_SERVER #include "config.h" #include "engine/global/paths.h" #include "local_player.h" #include <fstream> #include "engine/render/interface/render_interface.h" #include "../game_instance.h" #include "../audio/audio.h" #include "../net/net_interface.h" #include "../input/input_processor.h" #include "../input/key_n...
CONFIG
0.918633
4.582396
7db9eb95-9d08-406f-ae34-c70852f91d8c
AdityaHegde02/Leetcode-Solved
Missing number in matrix - GFG/missing-number-in-matrix.cpp
//{ Driver Code Starts #include<bits/stdc++.h> using namespace std; // } Driver Code Ends class Solution { public: long long int MissingNo(vector<vector<int>>& matrix) { // Code here int n = matrix.size(); int x=-1,y=-1; for(int i=0;i<n;i++){ for(int j=0;j<n;j++){ ...
ALGO
0.999931
5.849654
da015c84-0bc9-45f8-a001-3edc5605a8b7
joelaohk/cs4185_proj
Project2/CircleMain.cpp
/* * CircleMain.cpp * Experimental file for CS4185 Project * Created by LAO Choi Hin (54045244) * */ /************************************************************************************************************ * To Markers: * * 1. This file is created just for experiment, * * it...
TOOL
0.983707
3.18083
dc1bf7a0-3586-4bf4-a651-9c31420ec58d
zhoule888/functions
AprilTag/src/GLineSegment2D.cpp
#include "GLineSegment2D.h" #include <limits> namespace AprilTags { GLineSegment2D::GLineSegment2D(const std::pair<float,float>& p0Arg, const std::pair<float,float>& p1Arg) : line(p0Arg,p1Arg), p0(p0Arg), p1(p1Arg), weight() {} GLineSegment2D GLineSegment2D::lsqFitXYW(const std::vector<XYWeight>& xyweight) { GLine2...
ALGO
0.98053
6.324193
568b29f3-c65e-42af-92c8-346a17f1e53e
yongwhan/codeforces
825B.cpp
#include<bits/stdc++.h> using namespace std; const int n=10; int dx[]={1,0,-1,0,1,1,-1,-1}, dy[]={0,1,0,-1,1,-1,1,-1}; bool ok(int x) { return 0<=x&&x<n; } int main() { cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0); char grid[n][n]; for (int i=0; i<n; i++) for (int j=0; j<n; j++) cin>>grid[i][j]; ...
ALGO
0.999981
4.98996
5d72be9e-dcd0-4595-bc0f-ed08f6bf1ce6
heyitsrobert9/C-Code
CS332C/Lab1/Problem2/main.cpp
#include <iostream> #include <ctime> #include <cstdlib> using namespace std; void winner(int, int); int main(int argc, const char * argv[]) { int choice; int computer_choice; srand(time(NULL)); computer_choice = rand() % 3 + 1; cout << " Welcome to Rock, Paper, Scissors \n"; cout << " To pick ...
TOOL
0.866215
3.650332
1721d2f3-6d91-405e-bebf-6bebbb696b64
Project-Flare-Staging/frameworks_av
media/module/codecs/amrnb/common/src/gmed_n.cpp
/* Pathname: ./audio/gsm-amr/c/src/gmed_n.c ------------------------------------------------------------------------------ REVISION HISTORY Description: Put file into template and first pass at optimization. Description: Made changes based on comments from the review meeting. Used pointers instead of index a...
ALGO
0.999989
6.595037
8971d324-996a-43c8-87b1-5842fa070d54
MohamedAzizBellaaj/Competitive-Programming
Classic/Wasted Time/A_Wasted_Time.cpp
#pragma GCC optimize("Ofast") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,fma") #pragma GCC optimize("unroll-loops") #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; typedef long long ll; ty...
ALGO
0.999815
4.444312
4cf803e3-3fde-4bc4-ad43-8d8e776a5886
josemalm32/platform_frameworks_av
media/libstagefright/codecs/m4v_h263/dec/src/pp_semaphore_luma.cpp
/* ------------------------------------------------------------------------------ INPUT AND OUTPUT DEFINITIONS Inputs: xpred = x-axis coordinate of the MB used for prediction (int) ypred = y-axis coordinate of the MB used for prediction (int) pp_dec_y = pointer to the post processing semaphore for curren...
ALGO
0.999655
6.601039
435bc0b2-ea1e-463e-a1b5-548cbffc3e05
kishantalekar/180_DAYS_OF_CODE_CHALLENGE
073/1464. Maximum Product of Two Elements in an Array.cpp
class Solution { public: int maxProduct(vector<int>& nums) { int n = nums.size(); int n1 = -1; int n2 = -1; for(int i = 0; i <n; i++){ if(nums[i] > n1){ n2 = n1; n1 = nums[i]; }else if(nums[i] >n2){ n2 = nums[i...
ALGO
0.999929
5.586711
1ce194cd-bf11-42c8-8534-f2301d47524e
RYFan-RS/NLP-1
6.E代驾智能客服知识库项目/CustomerServiceChat/GeneralChat/WordNearMeaning.cpp
#include "WordNearMeaning.h" #include "Common/lib4/Definations.hpp" namespace robosay { namespace general { bool WordNearRule::read(const acl::String& line){ std::vector<std::string> vWords = line.separate(g_WordMeanRule__Internal_Separator); if(vWords.size()==0){ return false; } vFrom = vWords; if(filter(...
TOOL
0.966947
4.421016
e8f79721-68f8-4dff-8551-6263b98727ef
darshanprajapati2023/assignments
SE - Fundamentals of Programming/ClassWork/29.cpp
#include <stdio.h> #include <string.h> int main() { char name[10]; int i,length=0; printf (" \n Enter a string to be reversed: "); gets(name); for(i=0;name[i]!='\0';i++){ length++; } for(i=length;i>=0;i--){ printf("%c",name[i]); } // printf (" \n After th...
ALGO
0.992757
3.081512
82e2e059-75a7-4cd3-b3b1-ec01f43f34fc
BIC-MNI/EZminc
distortion_correction/fit_harmonics_grids_regularize.cpp
#include <iostream> #include <fstream> #include "gsl_glue.h" #include "gsl_gauss.h" #include <itkBSplineInterpolateImageFunction.h> #include <unistd.h> #include <getopt.h> #include "itkMincHelpers.h" #include "sphericalHarmonicsTransform.h" #include <gsl/gsl_rng.h> #include <time.h> #include <sys/time.h> using name...
ALGO
0.980377
5.03939
e08bdab1-a45c-447d-b376-5e5ef9c28f23
SINBRO/Huffman
util/file_compressor.cpp
// // Created by andrey on 11.10.18. // #include <iostream> #include "h/file_compressor.h" file_compressor::file_compressor(std::string const &file_name) : reader(file_name), compressor( count_symbols()) { } void file_compressor::compress(std::string const &dst) { writer.set_file(dst); auto converte...
TOOL
0.907734
4.983941
357e9094-1384-406b-9336-016de4fa8b47
xmlb88/algorithm
leetcode/bit/260.singleNumber-III.cpp
#include <iostream> #include <vector> #include <unordered_map> using namespace std; vector<int> singleNumber(vector<int>& nums) { int x = 0; for (int num : nums) { x ^= num; } int div = 1; while ((div & x) == 0) { div <<= 1; } int a = 0, b = 0; for (int num : nums) { ...
ALGO
0.999905
5.206958
ce9b4229-39b4-444c-8405-be85ec1b9c19
RajAditya01/DSA-PRACTICE
LINKLIST/ReverseLLAtRecursive method.cpp
// Recursive METHOD #include <iostream> using namespace std; class Node { public: int data; Node *next; // Constructor Node(int val) { data = val; next = NULL; } }; void insertAtTail(Node *&head, int val) { Node *n = new Node(val); if (head == NULL) { head...
ALGO
0.999953
5.636559
f6c2b7c8-2286-427d-a72f-5ba64d82ef95
jdowens/Bakery
frameworks/cocos2d-x/extensions/Particle3D/PU/CCPUSimpleSpline.cpp
#include "CCPUSimpleSpline.h" #include "base/ccMacros.h" NS_CC_BEGIN //--------------------------------------------------------------------- PUSimpleSpline::PUSimpleSpline() { // Set up matrix // Hermite polynomial _coeffs.m[0] = 2; _coeffs.m[1] = -2; _coeffs.m[2] = 1; _coeffs.m[3] = 1; _co...
ALGO
0.996339
6.908819
dd8b6529-deaf-4604-bafc-2d3633726727
Struna1292/LeetCode
1252-cells-with-odd-values-in-a-matrix/1252-cells-with-odd-values-in-a-matrix.cpp
class Solution { public: int oddCells(int m, int n, vector<vector<int>>& indices) { vector<vector<int>> matrix(m, vector<int>(n, 0)); for (int i = 0; i < indices.size(); i++) { for (int j = 0; j < n; j++) { matrix[indices[i][0]][j]++; } ...
ALGO
0.999994
6.454454
f069cec5-8c11-4f19-85b8-219e9239939b
cxyfer/OJ
Leetcode/@Contest/Weekly/Weekly Contest 403/c.cpp
// import math // from typing import * // from collections import * // from functools import * // from heapq import * // from bisect import * // from itertools import * // class Solution: // def maximumTotalCost(self, nums: List[int]) -> int: // n = len(nums) // s1, s2 = [0] * (n + 1), [0] * (n + 1...
ALGO
0.999952
5.782626
cf00d4d3-defb-49d0-8fe3-46be982d4834
dsy20240609/cppProgramming
week10/1.cpp
#include<iostream> using namespace std; class Number { public: int num; Number(int n=0): num(n) {} Number & operator*(const Number n1) { return *(new Number(num * n1.num)); //return Number(num*n1.num); this is not going to work } operator int() { return num; } }; int main() { ...
TOOL
0.937803
4.294129
06ffd765-b5db-45b3-a349-b6f20a596fad
Yanyu-CQU/CodingInterviews
28.字符串的排列.cpp
#include <iostream> #include <vector> #include <algorithm> using namespace std; void perCore(string & str, int start, vector<string> & res) { if (start == str.size() - 1) { res.push_back(str); } else { for (int i = start; i < str.size(); ++i) { int temp = str[start]; str[start] = str[i]; str[i] = t...
ALGO
0.999956
5.281413
80c35d7c-8fef-4955-944b-3b06ee7f0608
stanny880913/leetcode
c++/hard/leetcode1402.cpp
#include <iostream> #include <vector> #include <algorithm> using namespace std; int maxSatisfaction(vector<int> &satisfaction) { // greedy // int sat_size = satisfaction.size(); // int total = 0, max_num = 0; // sort(satisfaction.begin(), satisfaction.end()); // for (int i = sat_size - 1; i >=...
ALGO
0.999987
4.98643
f7b52aed-ed6d-4695-b588-2e9565c53987
Ridwan60/CP
dfs.cpp
/* BISMILLAHIR-RAHMANIR-RAHIM MichaelScott */ #include <bits/stdc++.h> using namespace std; #define ll long long /*vector<int> dfs(int node,vector<int> vis, vector<int> adj[], vector<int> strDFS){ strDFS.push_back(node); // cout << node << " " ; vis[node] = 1; for(auto it : adj[node]){ if(vis[it] != 1){ ...
ALGO
0.999973
4.358904
0bea546a-b521-41eb-a7aa-3c27e4db1530
Cruxcodes/flutter_devcamp_1
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.998799
6.776823
56bed4d3-541e-491a-ba9b-f6e71469d558
dineshkumar071/geeks-for-geeks
reversearray.cpp
using namespace std; int main(void) { int t; cin>>t; while(t--) { int n; cin>>n; int a[n]; for(int i=0;i<n;i++)cin>>a[i]; for(int i=n-1;i>=0;i--)cout<<a[i]<<" "; cout<<endl; } }
ALGO
0.999592
3.676333
b70bc125-faba-4e6b-a90f-95243df7efac
MAARUUU/ASM
n_62/n_62/n_62/n_62.cpp
//задача 62 // определить является ли число четным #include "pch.h" #include <iostream> using namespace std; int main() {//определить является ли число четным unsigned short a, z = 0; cout << "Enter "; cin >> a; __asm { mov dx, 0 mov ax, a mov bx, 2 div bx mov z, 0 mov bx, 0 cmp dx, bx jne end1...
ALGO
0.991346
3.176149
5829f235-42b7-4b26-af9b-01eb017dcde8
SagenHansda19/Contest
Codeforces_Round_1003_(Div.4)/D.cpp
#include <bits/stdc++.h> using namespace std; void solve() { int n, m; cin >> n >> m; vector<vector<int>> a(n, vector<int>(m)); for(auto &i : a) { for(int &j : i) cin >> j; } vector<long long> sum(n); for (int i = 0; i < n; ++i) { sum[i] = accumulate(a[i].begin(), a[i].end()...
ALGO
0.999978
4.367111
e2d5a854-5271-497b-a704-c93052aa2bc7
ThunderEmperors/CSES-Solves
I_ArrayDivision.cpp
#include<bits/stdc++.h> using namespace std; #define ll long long ll mod = 10e9+7; bool isPossible(vector<ll>& x, ll max_sum, ll k){ //Checks if maximum of sums of subarrays is possible to be less than max_sum in less than or equal to k divisions ll sum = 0; ll divisions = 0; for(int i = 0; i < x.size(); i++)...
ALGO
0.999983
4.621015
cfa7581d-adda-4c98-9d39-32239cb48e24
insieme/insieme
code/core/src/arithmetic/arithmetic_utils.cpp
#include "insieme/core/arithmetic/arithmetic_utils.h" #include "insieme/core/ir_node.h" #include "insieme/core/ir_builder.h" #include "insieme/core/ir_visitor.h" #include "insieme/core/transform/node_replacer.h" #include "insieme/core/transform/manipulation.h" #include "insieme/core/types/subtyping.h" #include "insie...
TOOL
0.928102
6.940729
ac1697ef-f58e-4ce5-916c-7860f8f09ae4
Alexander-0x80/violet-vm
src/etc/utils.cpp
#include "utils.h" namespace violet { namespace utils { std::vector<u16> load_program_file(const std::string filename) { u16 instr; u8 bytes[2]; std::vector<u16> result; std::ifstream file(filename, std::ios::binary); if (fi...
TOOL
0.981097
6.019675
50a8d4f0-260d-4670-8b0b-01cf9c08585a
Devanshh07/Two-Pointer-Sliding-Window
nextPermutation.cpp
#include<bits/stdc++.h> using namespace std; //Next Permutation //https://leetcode.com/problems/next-permutation/?envType=problem-list-v2&envId=two-pointers& //to solve this question: -> next_permutation(arr.begin(),arr.end()); void solution(vector<int> &nums){ next_permutation(nums.begin(),nums.end()); } class ...
ALGO
0.999982
5.191236
6c7988ab-5773-4dfb-a911-d9ebefcc650b
Exalibur77/Data-Structure-and-Algorithm
Tree's/BinarySearchTree/CreationBST.cpp
#include<iostream> #include<vector> using namespace std; class Node{ public: int data; Node * left; Node * right; // constructor Node (int x){ data = x; left = NULL; right = NULL; } }; // Insertion Time Complexity is O(N) Node * insertIntoBST(Node ...
ALGO
0.999976
5.175891
9c5557cf-50e9-4165-9398-ade53e3937b0
JJANGORITHM/Programmers
Week10/H-Index/dong.cpp
#include <string> #include <vector> #include <algorithm> using namespace std; int solution(vector<int> citations) { int answer = 0; sort(citations.begin(), citations.end()); int max = citations.back(); int h_index = 0; for (int h_index = 0; h_index <= max; h_index++) { int count =...
ALGO
0.999995
6.230089
b233fb37-696a-42c7-95a9-5fce1516a539
tsda04/AaDS1
AaDS1/AaDS1.cpp
#include <iostream> #include <random> #include <clocale> #include <stdexcept> #include <cmath> #include <complex> template<typename T> class Vector { private: //size_t - помещает максимально возможный размер массива на данной архитектуре (и при этом не переполняется как int) size_t size; T* coordinate; ...
TOOL
0.919859
4.034876
50a0e5f8-c8a0-488c-a394-21e843709fda
sujalpahwa30/-CrackYourInternship
LinkedList/RemoveLinkedListElements.cpp
class Solution { public: ListNode* removeElements(ListNode* head, int val) { ListNode* temp = head; while(temp && temp->val == val){ temp = temp->next; } head = temp; while(temp){ if(temp->next && temp->next->val == val) temp->next = temp->...
ALGO
0.999946
6.101991
538a721b-1525-4907-ac18-590efed7f297
ishandutta2007/codeforces
mnbvmar/normal/1621/D.cpp
//~ while (clock()<=69*CLOCKS_PER_SEC) //~ #pragma comment(linker, "/stack:200000000") #ifndef LOCAL #pragma GCC optimize("O3") #endif //~ #pragma GCC optimize("Ofast") //~ #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") //~ #pragma GCC optimize("unroll-loops") #include <bits/stdc++.h> #in...
ALGO
0.999921
4.838511
1cf23cfd-a36a-49b2-a4ce-c95055db3982
maheshraut07/DSA-Practise
binray_tree_to_graph.cpp
#include<bits/stdc++.h> using namespace std; int main(){ return 0; } class TreeNode{ public: int val; TreeNode *left; TreeNode *right; }; void constructGraph(TreeNode* root) { unordered_map<int, vector<int>> graph; if (!root) return; if (root->left) { g...
ALGO
0.999864
5.109076
8d6d7b48-2f2e-43e3-91c7-6e7efcd20aa7
SkylineUI/external_libcxx
test/std/containers/sequences/vector.bool/emplace.pass.cpp
// UNSUPPORTED: c++98, c++03, c++11 // <vector> // vector<bool> // template <class... Args> iterator emplace(const_iterator pos, Args&&... args); #include <vector> #include <cassert> #include "min_allocator.h" int main() { { typedef std::vector<bool> C; C c; C::iterator i = c.emplace(c....
TEST
0.968694
5.194771
8f543afc-1129-48a9-a3de-e22af956a8dc
Ravi-kumar178/DSA
SearchinAndSorting/paintersPartitionProblem.cpp
class Solution { public: bool isPossibleSolution(int arr[],int n, int k, long long int mid){ int count = 1; long long int totalSum = 0; for(int i = 0; i < n; i++){ if(arr[i] > mid){ return false; } if(totalSum + arr[i] > mid){ ...
ALGO
0.999978
5.297384
b5e71dc2-f02e-4fa9-8154-21fdf13c9d01
lds217/lds
CLAOJ/vp48divisors.cpp
// Template // #include <bits/stdc++.h> #define FOR(i, a, b) for(ll i=a, _b=b; i<=_b; i++) #define FORD(i, a, b) for(ll i=a, _b=b; i>=_b; i--) #define pb push_back #define ALL(a) a.begin(), a.end() #define mp make_pair #define fi first #define se second #define mset(a, b) memset(a, b, sizeof(a)) #define MASK(i) (1LL<<(...
ALGO
0.999625
3.904144
759ecb4d-9acc-44e0-9130-177907b390ec
sane-aalam/Algorithm-Playground
DP 100/63. Unique Paths II.cpp
class Solution { public: // problem me block cell value = 1 bhaiJaan int uniquePathsWithObstacles(vector<vector<int>>& obstacleGrid) { int m = obstacleGrid.size(); int n = obstacleGrid[0].size(); // start me obstacle ho - not possible way to reach // block value...
ALGO
0.999762
5.487926
d4cff656-301c-4004-a898-8329e423c177
Lchuxian/SLAM-Environment
OpenCV3_and_OpenCV4_coexist/opencv-4.5.5-build/opencv_contrib-4.5.5/modules/surface_matching/src/ppf_match_3d.cpp
#include "precomp.hpp" #include "hash_murmur.hpp" namespace cv { namespace ppf_match_3d { static const size_t PPF_LENGTH = 5; // routines for assisting sort static bool pose3DPtrCompare(const Pose3DPtr& a, const Pose3DPtr& b) { CV_Assert(!a.empty() && !b.empty()); return ( a->numVotes > b->numVotes ); } static ...
ALGO
0.998037
6.550878
e5ab7290-8929-4c9f-907e-513f8a5f0a41
noabauma/stat_phys_projekt
mdatom_backup/source_code/lib/PeriodicBoundaryConditions.cpp
#include "PeriodicBoundaryConditions.h" inline int nearestInteger(double x) { return x > 0 ? static_cast<int>(x + 0.5) : static_cast<int>(x - 0.5); } void PeriodicBoundaryConditions::recenterAtoms(int nat, std::vector<double>& positions, double const *box){ double origin[3]; for (int m = 0; m < 3; m++) { ...
ALGO
0.992029
5.040183
acdc56c8-d317-4b20-8f05-861541fdf80f
ShucunZhao/Leetcode
C++/09BinaryTree/112PathSum/solwithSimplify.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.999903
6.291368
d9dc7c7e-6c9e-4d48-83ae-a8bbea137423
PhuocVinhLee/LuanVan_CNTT
online_exam_system_backend/temp/0jr3y58.cpp
#include<stdio.h> int add(int a, int b) {return a+b;} int main() { printf("%d", add(-5, 2)); return 0; }
TOOL
0.912344
4.086676
eec121e7-15c7-4dfc-9ff7-dc1a29219cf9
mjwybrow/adaptagrams
cola/libavoid/tests/junction02.cpp
#include "libavoid/libavoid.h" using namespace Avoid; int main(void) { Router *router = new Router(OrthogonalRouting); router->setRoutingPenalty((PenaltyType)0, 50); router->setRoutingPenalty((PenaltyType)1, 0); router->setRoutingPenalty((PenaltyType)2, 0); router->setRoutingPenalty((PenaltyType)3, ...
ALGO
0.998041
5.07418
e167d400-4438-4079-a683-58b6db7848ae
TomokaReina/cses_practice_problems
Bit Strings.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long int main(){ ll n, s=1; cin >> n; for(int i=0; i<n; ++i){ s=2*s%((ll)1e9+7); } cout << s; }
ALGO
0.999974
4.044442
2fccc145-bd45-4aa2-8094-e419205d5702
ishandutta2007/codeforces
quailty/normal/727/F.cpp
#include<cstdio> #include<cstring> #include<cstdlib> #include<cmath> #include<iostream> #include<algorithm> using namespace std; typedef long long ll; const int MAXN=755; const ll INF=(1LL<<62)-1; ll a[MAXN],dp[MAXN][MAXN]; int main() { int n,m; scanf("%d%d",&n,&m); for(int i=1;i<=n;i++) scanf("%I64...
ALGO
0.999936
3.336464
bf3d085f-9e53-4d9b-82cd-22481675ef0e
lychees/ACM-Training
Note/集训队作业/2014/作业1/解题报告/zhonghaoxi/hw1/tsinsen/2000E.cpp
#include<cstdio> #include<cstdlib> #include<cstring> #include<algorithm> using namespace std; const int maxn=110; const int maxm=maxn*maxn<<1; const int INF=0x3f3f3f3f; int n,en,s,t,m,q[maxn],depth[maxn]; struct edge { int e,f; edge *next,*op; }*v[maxn],ed[maxm]; void add_edge(int s,int e,int f) { en++; ed[en]...
ALGO
0.999892
4.57578
ed3bb32d-50f7-4ea7-b5e2-b0ee941952a0
firemancha/2020_Algorithm
Sorting/InsertionSort.cpp
#include <iostream> #include <string> #include <vector> #include <utility> using namespace std; int main(void) { int n; vector<pair<int, string> > v; cin >> n; for (int i=0; i<n; i++){ int d; string s; cin >> d >> s; v.push_back(pair<int,string>(d,s)); }...
ALGO
0.999887
4.575181
1835104f-c0cb-4661-a6ea-5caaf457bccd
jark006/SummerTTS_VS
eigen-3.4.0/bench/product_threshold.cpp
#include <iostream> #include <Eigen/Core> #include <bench/BenchTimer.h> using namespace Eigen; using namespace std; #define END 9 template<int S> struct map_size { enum { ret = S }; }; template<> struct map_size<10> { enum { ret = 20 }; }; template<> struct map_size<11> { enum { ret = 50 }; }; template<> struct ...
TOOL
0.940724
5.102006
9f423871-0f1c-4619-86e4-9109d4d662cd
ArsenyPogosov/olympiad_programs
codeforces/Лиза и книга.cpp
#include<bits/stdc++.h> using namespace std; long long m; long long f(long long x) { return (x + m - 1) / m; } struct node { long long y, x, cnt, size; node *l, *r; node(long long x): x(x), y(rand() * RAND_MAX + rand()), cnt(f(x)), size(1), l(nullptr), r(nullptr) {} }; typedef node* treap; long long cnt(treap ...
ALGO
0.999705
4.218782
ffd787bc-77a1-4f79-99d7-ead7f1b9a807
Phoe-nix-89/Graphs-DSA
Leetcode200.cpp
#include<bits/stdc++.h> using namespace std; /* https://leetcode.com/problems/number-of-islands/ */ class Solution { public: vector<vector<char>> v; unordered_map<int,unordered_set<int>> m; void DFS(int i,int j){ m[i].insert(j); if(i-1>=0 && v[i-1][j] == '1' && (m.find(i-1) == m.end() || ...
ALGO
0.999971
6.38445
a3af45d0-9ec8-4244-b799-eda01d55ea55
chakku000/algorithm
string/Levenshtein_Distance.cpp
#include <iostream> #include <vector> #include <algorithm> using namespace std; /* * 文字列sと文字列tの編集距離 * 文字列sに対して、文字の「挿入」「削除」「置換」をコスト1で行い、文字列tに一致する最小コストを計算する * * Algorithn: 動的計画法 * 定義 * dp[i][j] := s[0,i),t[0,j)の編集距離 * 遷移 * 挿入 dp[i][j] <- dp[i-1][j]+1 * 削除 dp[i][j] <- dp[i][j...
ALGO
0.99998
5.275294
86922cd9-d95d-4b80-9f80-a85b061ff7b4
huangdepeng99/cpp-primer-plus-answer
chapter_06/ex_01.cpp
#include <iostream> #include <cctype> using namespace std; int main(void) { char c; cin.get(c); while (c != '@') { if (isdigit(c)) ; else if (isupper(c)) cout << (char) tolower(c); else if (islower(c)) cout << (char) toupper(c); else cout << c; cin.get(c); } return 0; }
ALGO
0.959861
4.073298
ebe32463-a8b5-4248-8796-86a55b08f115
ShivaniPathak10/-6companies30days
Wiggle-Sort.cpp
class Solution { public: void wiggleSort(vector<int>& nums) { vector<int > temp (nums); sort(temp.begin(),temp.end()); int n=nums.size(); int j=n-1; for(int i=1;i<n;i+=2) { nums[i]=temp[j]; j--; } for(int i=0;i<n;i+=2) { ...
ALGO
0.999997
5.396676
1613bdfc-0f1f-46ef-9676-b1987f8fdc13
YuzhenYe/WET
hackerrank/larry.cpp
#include <iostream> using namespace::std; int main() { int s, n, m, i, j, k, tmp, a[1001]; bool solution; cin >> n; for(s = 0; s < n; s ++) { cin >> m; for(i = 1; i <= m; i ++) { cin >> a[i]; } solution = true; int diff = 0; for(i = 1; i <= m; i ++) { if(a[i] > i) diff += a[i] - i; } if(diff %...
ALGO
0.999434
3.47099