uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
c6f04d43-81d5-43af-98f0-5eded2378665
ishandutta2007/codeforces
xyz2606/normal/717/D.cpp
#include <bits/stdc++.h> using namespace std; const int N = 128; struct mat { double a[N][N]; mat() {memset(a, 0, sizeof(a));} }; mat operator * (const mat &a, const mat &b) { mat c = mat(); for (int i = 0; i < N; ++ i) { for (int j = 0; j < N; ++ j) { for (int k = 0; k < N; ++ k) { c.a[i][j] += a.a[i][k] ...
ALGO
0.999864
3.799615
3a976452-5483-4fc0-ac41-8ef752243b31
phitronio/XPSC_Batch_02
CodeChef Starter 94 Contest Discussion/The_Vowel_Matrix.cpp
/* ||-----------------------------------|| || Rahat Khan Pathan || || Programming Hero || ||-----------------------------------|| */ #include <bits/stdc++.h> #define ll long long int #define pub push_back #define pob pop_back #define PI 3.14159265359 #define vll vector<ll> #define All(X...
ALGO
0.999977
5.283345
cf26e172-1af4-47dd-804f-3fb2025a8bd0
Maf1ozaMFG/bmstu
sem_2/test/logic.cpp
#include "logic.h" unsigned int charToInt(char sym) { return (sym >= '0' && sym <= '9') ? (sym - '0') : (sym >= 'A' && sym <= 'F') ? (sym - 'A' + 10) : ERR; } char intToChar(unsigned int digit) { return (digit >= 0 && digit <= 9) ? ('0' + digit) : (digit >= A && digit <= F) ? ('A' + digit - 10) : '!'; } std:...
ALGO
0.991712
5.065399
9f517622-d9c6-467d-8042-2308f04e3ea2
moqsad/solved-problems
UVA/1331 – Agent J(L).cpp
#include <cstdio> #include <cmath> #include <iostream> using namespace std; int main() { int t, cnt; double r1, r2, r3, area, a, b, c, angleA, angleB, angleC, x, y, z, s, q; scanf("%d", &t); for(cnt = 1; cnt <= t; ++cnt) { scanf("%lf %lf %lf", &r1, &r2, &r3); a = r2 + r3; b = r1 + r...
ALGO
0.998664
4.061943
02e22075-ba3e-4d24-bce9-347cc98fc9d1
6108/codetree-TILs
240323/입력받아 계산 5/input-calculate-5.cpp
#include <iostream> using namespace std; int main() { int a, b; cin >> a >> b; cout << a + b; return 0; }
ALGO
0.986917
3.560027
7057492e-0b01-47c8-8341-fedcac502d55
ethman/slakh-generation
RenderMan-master/JuceLibraryCode/modules/juce_gui_basics/positioning/juce_RelativeParallelogram.cpp
namespace juce { RelativeParallelogram::RelativeParallelogram() { } RelativeParallelogram::RelativeParallelogram (const Rectangle<float>& r) : topLeft (r.getTopLeft()), topRight (r.getTopRight()), bottomLeft (r.getBottomLeft()) { } RelativeParallelogram::RelativeParallelogram (const RelativePoint& topLeft_, cons...
TOOL
0.869998
5.853718
fafe7719-17ff-4a0d-b841-7a80d67da914
khanhtc1202/cp
orange/greedy/wine.cpp
#include <iostream> #include <algorithm> #include <vector> using namespace std; typedef long long ll; int main() { int n; while (cin >> n, n != 0) { ll sum = 0, mov = 0; int a; for (int i = 0; i < n; i++) { cin >> a; sum += a; mov += abs(...
ALGO
0.999038
3.729897
a1dbc539-0fa5-439b-b71d-4b511103d54c
TheOniMikira/AdventOfCode2024
21/A.cpp
/* Author : Mikira Sun 22 Dec 2024 11:36:09 PM HKT */ #include "bits/stdc++.h" using namespace std; typedef long long LL; typedef vector<int> vi; typedef vector<LL> vl; typedef vector<vi> vvi; typedef vector<vl> vvl; typedef pair<int, int> PII; typedef pair<int, int> pii; typedef pair<LL, LL> PLL; typedef pair<LL, LL...
ALGO
0.996682
4.655114
0dbac830-e8ad-4e8c-b377-338a7fde858b
RohanshuSharma/Updated_5G_AKA
oai-cn5g-fed/component/oai-amf/src/amf-app/amf_config.cpp
#include "amf_config.hpp" #include <boost/algorithm/string.hpp> #include <boost/algorithm/string/classification.hpp> #include <boost/algorithm/string/split.hpp> #include <iostream> #include <libconfig.h++> #include "3gpp_29.502.h" #include "3gpp_ts24501.hpp" #include "amf_app.hpp" #include "conversions.hpp" #include ...
CONFIG
0.92632
5.849395
3b3c6bf0-063c-4662-99d8-6df19a3e925c
Isaace19/Past_Class_Notes
s2023/cosc202/labs/lab8/lab08sub/Prog8.cpp
// John Cordwell III // This program tests the goldbach conjecture (sum of three primes) #include <iostream> #include <set> #include "Support.h" using namespace std; bool is_forward = false; bool is_verbose = false; int main(int argc, char *argv[]) { prime_partition goldbach; if (argc < 2 || argc > 3) // bad o...
ALGO
0.999039
4.365867
c4ee34f2-ecdb-4551-81f1-847e74ab4b96
md-mohabbat-ezekiel/Phitron-3
c++/module 1/float.cpp
#include<iostream> #include<iomanip> using namespace std; int main() { float a; cin>>a; // cout<<a; cout<<fixed<<setprecision(2)<<a<<endl; return 0; } // cout<<fixed<<setprecision(2)<<a<<endl; // cout<<fixed<<setprecision(2)<<a<<endl; // cout<<fixed<<setprecision(2)<<a<<endl;
ALGO
0.97994
3.552503
d2df226e-6d77-471b-b61b-c10b93a2f596
mnahirnyy/ShalamayneCore
dep/g3dlite/source/Crypto_md5.cpp
/** @file Crypto_md5.cpp @author Morgan McGuire, http://graphics.cs.williams.edu Copyright 2006-2007, Morgan McGuire. All rights reserved. @created 2006-03-28 @edited 2006-04-06 */ #include "G3D/platform.h" #include "G3D/Crypto.h" #include "G3D/BinaryInput.h" #include "G3D/BinaryOutput.h" #include <cstring>...
ALGO
0.988929
7.205337
b9fed43a-3c17-417a-8557-f58676e189d3
sakibul-shovon/cpp-practice
CodeChef/A_Vanya_and_Fence.cpp
// File Name: A_Vanya_and_Fence.cpp // Date: 2023-07-14 // Time: 11:27:13 #include <bits/stdc++.h> using namespace std; int main(){ int a,b;//a total b height cin>>a>>b; int ans = 0; for(int i=1;i<=a;i++) { int x; cin>>x; if(x>b) { ans = ans + 2; ...
ALGO
0.999859
3.522146
21aa4805-58ab-4be9-ac09-b432e2886958
parasrawat007/DSA
41_GetSetMaxMinSumAvgArray.cpp
#include <iostream> using namespace std; struct Array { int A[20]; int size; int length; }; void Display(struct Array arr) { cout <<endl<< "Elements are :: "; for (int i = 0; i < arr.length; i++) { cout << arr.A[i] << " "; } } void Append(struct Array *arr, int x) { if (arr->l...
TOOL
0.999634
3.86572
660d4170-be37-4457-9982-6b49583f5c67
shadab375/important-interview-questions
arrays/easy/largestElement.cpp
#include <bits/stdc++.h> using namespace std; int largestElement(vector<int> &arr, int n) { int largest = arr[0]; for (int i=1; i<n; i++) { if (arr[i] > largest) largest = arr[i]; } return largest; }
ALGO
0.989916
4.377707
65d5a2ea-95d9-4307-912d-8e3138437862
OstaninAndrey/cplusplusExperience
ИО2/ИО(25 окт)/F.mcd/mcd.cpp
#include<iostream> #include<fstream> using namespace std; int a=0,b=0; int mcd=1; int k=0; int mas[35],j=0; int gcd(int a,int b) { int ans=0,c=0; if (b>a) {c=b;b=a;a=c;} while(a%b!=0) { b=a%b; ans=b; a=ans; } return ans; } void in() { ...
ALGO
0.999942
3.58625
ae77d63c-48ee-48d0-9d79-0426f87545c6
ADPer0705/AIML_CTF
python_env/Lib/site-packages/sklearn/svm/src/liblinear/tron.cpp
#include <math.h> #include <stdio.h> #include <string.h> #include <stdarg.h> #include "tron.h" #ifndef min template <class T> static inline T min(T x,T y) { return (x<y)?x:y; } #endif #ifndef max template <class T> static inline T max(T x,T y) { return (x>y)?x:y; } #endif static void default_print(const char *buf) {...
ALGO
0.999438
5.847107
67ec3897-5f97-4563-b60b-0c28d047b78e
Sejalkathane/Complete_dsa_cpp
Linked_list/03_insert_at_end_of_ll.cpp
#include <bits/stdc++.h> using namespace std; struct Node { int data; Node *next; Node(int x) { data = x; next = NULL; } }; Node *insert_end(Node *head, int x) { // Node *temp = new Node(x); // if (head == NULL) // return temp; // Node *curr = head; ...
ALGO
0.994265
4.339108
ccdeb21a-4fae-44f9-aaf4-4c4fc06a22fc
mez3n/PS-sheet
Solutions/Div2-B/Students and Shoelaces/tempCodeRunnerFile.cpp
/* CF129-D2-B.cpp 14/08/2023 14/05/06 --------------------------------------------- */ #include<bits/stdc++.h> using namespace std; int main() { int m,n; cin>>n>>m; vector<vector<int>> arr(n+1); vector<int>del; for(int i =0;i<m;i++) { int x,y; cin>>x>>y; arr[x].push_back(y); arr[y].push_b...
ALGO
0.999901
4.13977
4567d25c-9f0f-4431-921e-b4098d34d19a
LuisBarcenas14/Programacion-Competitiva
COJ - AC/LuisBarcenas14-p3064-Accepted-s1021397.cpp
#include <bits/stdc++.h> using namespace std; typedef pair <int, int> ii; typedef vector<ii> vii; typedef vector<int> vi; #define end '\n' #define VISITED 1 #define UNVISITED 0 vi dfs_num; vector<bool> friends; vector<vii> AdjList; int i,j; int sum,maxi; void dfs(int u, int dist){ //dfs_num[u]=VISITED; //cout...
ALGO
0.999787
4.097665
fdc9df4d-1124-4be8-a24a-8bbceaef4cf8
shermz-lim/kattis-problems
apaxiaaans.cpp
#include <bits/stdc++.h> #include <unordered_set> #include <unordered_map> using namespace std; #define ar array #define ll long long void solve() { string line; getline(cin,line); string o=""; char curr=' '; for(char c:line){ if(c==curr){ continue; }else{ ...
ALGO
0.999796
4.510839
5f4f2e2f-0213-4818-986f-9d81593761da
ishandutta2007/codeforces
molamola/normal/382/D.cpp
#include<stdio.h> #include<algorithm> #include<string.h> #include<vector> #include<math.h> #include<stdlib.h> #include<set> #include<ctype.h> using namespace std; #define X first #define Y second typedef long long ll; typedef pair<int,int> Pi; #define Cache(x,y) (m*(x)+(y)) int xx[4] = {0,-1,0,1}, yy[4] = {-1,0,1,0}...
ALGO
0.999995
3.31989
c0dd5755-941d-46e7-bc14-8584205f97cf
WhiteCells/code
algo/lc/7_backtrack/restore-ip-addresses.cpp
#include "D:/distake/Coding/head_file.h" class Solution { public: int stringToInt(const string& s, int start, int end) { int res = 0; for (int i = end, j = 0; i >= start; --i, ++j) { res += (s[i] - '0') * pow(10, j); } return res; } }; int main() { Solution s; ...
ALGO
0.998998
5.30411
d48b9b65-6532-494c-b316-0ebf2134e8ba
KanishkRAJ29/Leetcode
3627-find-minimum-time-to-reach-last-room-i/3627-find-minimum-time-to-reach-last-room-i.cpp
#include <vector> #include <queue> #include <tuple> #include <algorithm> #include <climits> using namespace std; class Solution { public: static constexpr int DIRS[4][2] = { {1,0},{-1,0},{0,1},{0,-1} }; int minTimeToReach(vector<vector<int>>& m) { int n = m.size(); if (n == 0 |...
ALGO
0.999964
6.296944
51681768-c338-44ac-975c-27762c400344
andreaswanninger/Kratos_conservative_levelset-contact_line
applications/MPMApplication/custom_constitutive/hyperelastic_plane_strain_2D_law.cpp
// System includes // External includes // Project includes #include "custom_constitutive/hyperelastic_plane_strain_2D_law.hpp" #include "mpm_application_variables.h" namespace Kratos { //******************************CONSTRUCTOR******************************************* //****************************************...
ALGO
0.921785
3.926939
cde61fca-5256-437e-8090-c269886330b2
KMalaravan/C-Assignment5
main.cpp
#include<iostream> #include<string> #include<vector> #include<cmath> #include<memory> #include<random> #include "radioactive_nucleus.h" #include "stable_nucleus.h" #include "electron.h" #include "photon.h" using std::vector; using std::shared_ptr; // Photoelectric effect function returns energy of photon double photo...
TOOL
0.956825
6.251064
6b1a03b6-06e9-4141-b9ab-4cbb52835d7c
Curious-Goblin/DSA-Sheet
MajorityElement.cpp
#include <iostream> #include <vector> #include <algorithm> #include <unordered_map> #include <map> #include<climits> using namespace std; /* OPTIMAL SOLUTION T.C = O(N) S.C = O(1) class Solution { public: vector<int> majorityElement(vector<int> &nums) { int num1=INT_MIN,num2=INT_MIN; int ...
ALGO
0.999985
4.862594
172dee4b-e360-4ad4-8878-6229b4e886d3
113bommy/deepmind_codecontests_refine
cpp_gold_filter_file/cpp_train_5296_49.cpp
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; cout << N * (N + 1) / 2 << endl; }
ALGO
0.999683
5.259415
09157734-b7a6-45c6-b692-12564937622f
ishandutta2007/codeforces
ershov.stanislav/normal/248/E.cpp
#include <iostream> #include <algorithm> #include <vector> #include <queue> #include <set> #include <string> #include <deque> #include <iomanip> #include <map> #include <cmath> using namespace std; int n, a[111111], q, u, v, k, b[111111]; double x[111111][111], tmp[111], ans=0; double c(int a, int b) { double r...
ALGO
0.999881
3.474194
c68ffd6b-c6dd-4b56-bd38-ac994a1f8a84
MarcosViniciusG/Competitive-Programming
Problems/CF/2085C/main.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; using vll = vector<ll>; using pll = pair<ll, ll>; using vpll = vector<pll>; // 010 // 101 // 1001 // 0110 // 0101 // 1000 signed main() { cin.tie(nullptr)->sync_with_stdio(false); ll t; cin >> t; while(t--) { ll x, y; ...
ALGO
0.99984
4.802773
56124344-bbc3-460b-bb32-2bedb8e1d10f
Hammad335/nearby_places_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
c461ab48-f3f2-48cc-a50a-c630cf0954a1
SahilRout/CrackYourInternship-Challenge
Number of paths - GFG/number-of-paths.cpp
// { Driver Code Starts #include <bits/stdc++.h> using namespace std; // } Driver Code Ends long long numberOfPaths(int m, int n) { int dp[m+1][n+1]; for(int i=0;i<=m;i++) { for(int j=0;j<=n;j++) { if(i<1||j<1)dp[i][j]=0; if(i==1&&j==1)dp[i...
ALGO
0.999969
6.041721
dc37c3f0-89b7-4b32-b4c1-55bd682a8b3e
wn-na/leetcode
leetcode-75/level1/day7/278. First Bad Version.cpp
// The API isBadVersion is defined for you. // bool isBadVersion(int version); class Solution { public: int firstBadVersion(int n) { int left = 1; int right = n; while (left <= right) { int mid = ((long)right + left) / 2; if (isBadVersion(mid)) { righ...
ALGO
0.999923
6.758871
4eddc76a-8019-4d23-91e5-1eccf3910ed4
StanPlatinum/proofGen
llvm/lib/MCA/Support.cpp
#include "llvm/MCA/Support.h" #include "llvm/MC/MCSchedule.h" namespace llvm { namespace mca { #define DEBUG_TYPE "llvm-mca" ResourceCycles &ResourceCycles::operator+=(const ResourceCycles &RHS) { if (Denominator == RHS.Denominator) Numerator += RHS.Numerator; else { // Create a common denominator for LH...
TOOL
0.936756
6.959136
795f3aee-c6b0-4bd5-a881-995745bdb24c
YP-Yang-hub/OpenStreetMap-Route-Planner
src/route_planner.cpp
#include "route_planner.h" #include <algorithm> #include <iostream> RoutePlanner::RoutePlanner(RouteModel &model, float start_x, float start_y, float end_x, float end_y): m_Model(model) { // Convert inputs to percentage: start_x *= 0.01; start_y *= 0.01; end_x *= 0.01; end_y *= 0.01; // TODO 2...
ALGO
0.989578
4.977737
69f37151-7960-469c-88d5-dfd788eb7d73
RG-Avinay/GitHubTraining
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.998733
6.76775
3cc34850-76a4-44fc-859e-7a2a2b96dba9
ishandutta2007/codeforces
eexyz/normal/696/E.cpp
#include<bits/stdc++.h> using namespace std; #define N 100005 #define ls k<<1 #define rs k<<1|1 #define mid (l+r>>1) #define int long long struct node{ int x,y; bool operator < (node aa)const{ return y==aa.y?x>aa.x:y>aa.y; } }tmp,t[N<<2],ret; priority_queue<node>pq[N<<2]; vector<int>son[N]; int dep[N],sz[N],n,cnt,...
ALGO
0.999978
3.958283
d743464f-4e3c-49c1-83d6-d9101af7f467
caosong/minimal_scene
lib/Eigen/doc/examples/class_CwiseUnaryOp_ptrfun.cpp
#include <Eigen/Core> #include <iostream> using namespace Eigen; using namespace std; // define function to be applied coefficient-wise double ramp(double x) { if (x > 0) return x; else return 0; } int main(int, char**) { Matrix4d m1 = Matrix4d::Random(); cout << m1 << endl << "becomes: " << endl << ...
ALGO
0.959185
4.120226
636a67f9-ea1a-49a8-901c-92208f5c92ca
phanthang04/DSA_CODEPTIT
DSA08006.cpp
// SỐ 0 VÀ SỐ 9 #include <bits/stdc++.h> using namespace std; int check(string s, int n){ long long x = 0; for (int i = 0; i < s.length(); i++){ x = x*10 + (s[i] - '0'); } return x % n == 0; } void testcase(){ int n; cin >> n; queue<string> qe; qe.push("9"); while(true){ ...
ALGO
0.999162
5.95704
4432855d-e0f0-40e0-b29d-04b84bd1ce22
pranjalken32/LeetCode
167-two-sum-ii-input-array-is-sorted/167-two-sum-ii-input-array-is-sorted.cpp
class Solution { public: vector<int> twoSum(vector<int>& numbers, int target) { int l=0,r=numbers.size()-1; vector<int>v; while(l<=r) { if(target==numbers[l]+numbers[r]) { v.push_back(l+1); v.push_back(r+1); break; ...
ALGO
0.999842
6.357982
5b0973df-970e-4bc6-a14a-1327ff097168
JasonH15/Practica-5
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.998733
6.76775
5144a578-8be5-42c4-8c04-fa067a88614b
PracticumGrade/algorithms
cpp/Работа с деревьями/фин-B/code.cpp
#ifndef REMOTE_JUDGE struct Node { int value; Node* left = nullptr; Node* right = nullptr; Node(Node* left, Node* right, int value) : value(value), left(left), right(right) {} }; #endif #ifdef REMOTE_JUDGE #include "solution.h" #endif #include <cassert> Node* remove(Node* root, int key) { // Your c...
ALGO
0.999995
5.580391
bba04843-773a-44a7-978f-d0fb119304d5
QApolo/Competitive_Programming_3_book_problems
Introduction/GettingStarted_the_Easy_problems/Medium/11586_Train_Tracks.cpp
//11586 - Train Tracks (uva) #include <bits/stdc++.h> using namespace std; void leetrack(string *s) { char a; while((a=getchar())>10) { if(a!=32) (*s).push_back(a); } } int posible(string s) { int cm=0,cf=0; for(int i=0;i<s.size();i++) if(s[i]=='M')cm++; else cf++; if(cm==1)return 0; if(cf!=cm)return...
ALGO
0.999903
3.834651
141ba9ba-32b6-4aac-ab54-885b04f1edff
113bommy/deepmind_codecontests_refine
cpp_source_filter_file/cpp_valid_35_4.cpp
#include <bits/stdc++.h> using namespace std; int solve(int n, int m, int k) { if (n > m) return 0; if (n == 0) return min(m + 1, (1 << (k + 1))); if ((1 << k) & n) { int c = solve(n - (1 << k), m - (1 << k), k - 1); if (c == (1 << k)) return (1 << (k + 1)); else return c; } else { i...
ALGO
0.999936
4.652112
e0727450-372d-4646-8a23-ffd8e8a2371c
Noxitu/contests
amppz/2014/wsp.cpp
#include <cstdio> #include <vector> #include <algorithm> std::vector<int> V[200001]; int main() { int n, m; scanf("%d %d", &n, &m ); while( m --> 0 ) { int a, b; scanf("%d %d", &a, &b ); V[a].push_back(b); V[b].push_back(a); } for( int i = 1; i <= n; i++ ) std::sort( V[i].begin(), V[i].end() ); int q...
ALGO
0.999876
4.026235
8724647b-4fd1-44fa-ab7d-935f9142cee7
sarthak4399/CPP
GFG/prob1.cpp
#include <iostream> #include <vector> using namespace std; class Solution { public: int longestPalinSubseq(string A) { int n = A.length(); // Create a 2D array to store the lengths of longest palindromic subsequences vector<vector<int> > dp(n, vector<int>(n, 0)); // All substring...
ALGO
0.999933
6.877136
fffcb688-bc2f-4692-a15d-21495fc98b79
mohitpant05/Encryption_CPP
classCodes/transpositionPure.cpp
#include <iostream> #include <string> #include <algorithm> using namespace std; // Function to encrypt a given text using the transposition cipher method string encryptTransposition(const string &text, int key) { string encrypted = text; // Copy original text to preserve and manipulate during encryption // Loo...
ALGO
0.999977
6.035988
2781f35a-dfa6-4a3c-9446-b55b10031ff9
nichen2/math_lib
math_lib.cpp
#include "math_lib.h" namespace math_lib { double mean(const std::vector<double> &data) { // Implement mean double sum = 0.0; // Iterate through items in data where we calculate the sum for (double val : data) { sum += val; } double result = s...
ALGO
0.999722
5.799537
075f2238-b507-4778-b560-553c90c060ac
kimurash/typical90
038/main.cpp
// #define _GLIBCXX_DEBUG #include <bits/stdc++.h> #define rep(i, s, n) for (int i = s; i <= (int)(n); i++) #define all(v) v.begin(), v.end() #define rall(v) v.rbegin(), v.rend() #define arrout(a, s, n) rep(i, s, n)cout<<a[i]<<" "; cout<<endl; #define vecout(v) for(auto elm : (v))cout<<elm<<" "; cout<<endl; using n...
ALGO
0.999951
3.73676
66a4ffcb-1fda-4097-8722-5f05ff964dee
SnehalMarutiSalokhe/CrackYourPlacement
2-String/print-all-the-duplicates-in-the-input-string.cpp
#include<bits/stdc++.h> using namespace std; void printDuplicates(string str) { int len = str.length(); sort(str.begin(), str.end()); for (int i = 0; i < len; i++) { int count = 1; while (i < len - 1 && str[i] == str[i + 1]) { count++; i++; } ...
ALGO
0.999342
4.704014
b455209a-2d70-44a0-964a-418d50740485
anusjc/CPP
LinkedlistADT.cpp
#include<bits/stdc++.h> using namespace std; struct node { int data; struct node *next; }; struct node *start{nullptr}; void create() { struct node *temp,*ptr; temp=new node; if(temp == nullptr) { cout<<"Out of menory\n"; exit(0); } cout<<"Enter the Date value for node\n"...
ALGO
0.996746
3.951684
43e1571c-86be-40c0-abaf-1b0780ed5d78
hasnain-cyber/competitive-programming
codeforces/D_Jellyfish_and_Mex.cpp
#include <bits/stdc++.h> #define MOD 1000000007 // #define MOD 998244353 #define infinity numeric_limits<int>::max() #define int long long int #define double long double #define endl '\n' using namespace std; template <typename T> void print_arr(vector<T>& arr) { for (T element : arr) cout << element <...
ALGO
0.999905
5.659298
c3f69b54-7466-4827-a0c8-dc7d1d18619a
explicite/wipp
gwo.cpp
#include "gwo.h" QVector<double> *GWO::min(unsigned int numberOfWolfs, unsigned int numberOfIterations) { return GWO::optimize(MIN, numberOfWolfs, numberOfIterations); } QVector<double> *GWO::max(unsigned int numberOfWolfs, unsigned int numberOfIterations) { return GWO::optimize(MAX, numberOfWolfs, numberOfIt...
ALGO
0.999967
5.24284
b3053b4c-0b94-4700-82e4-4ac381e15750
Lanninger08/LeetCode
LeetCode101/贪心算法/605.cpp
#include <vector> using namespace std; bool canPlaceFlowers(vector<int>& flowerbed, int n) { int cnt = 0; for(int i=0; i< flowerbed.size(); i++){ // 如果当前位置没有花 而且符合种花条件 就种花 if(flowerbed[i]==0 && (i==0 || flowerbed[i-1]==0) && (i==flowerbed.size()-1 || flowerbed[i+1]==0)){ flowerbed[i...
ALGO
0.999998
6.431158
f98ee40e-7442-4cb9-b862-b122460d8db8
Jarlene/eigen
doc/examples/tut_arithmetic_scalar_mul_div.cpp
#include <iostream> #include <Eigen/Dense> using namespace Eigen; int main() { Matrix2d a; a << 1, 2, 3, 4; Vector3d v(1,2,3); std::cout << "a * 2.5 =\n" << a * 2.5 << std::endl; std::cout << "0.1 * v =\n" << 0.1 * v << std::endl; std::cout << "Doing v *= 2;" << std::endl; v *= 2; std::cout << ...
ALGO
0.99329
3.669638
d7d1ba9c-9d20-4e59-8683-ba981b867642
Uves0786/90-days-coding-challenge
leetcode/day 1/arraysign(leetcode).cpp
//question link https://leetcode.com/problems/average-salary-excluding-the-minimum-and-maximum-salary/ //solution: class Solution { public: int arraySign(vector<int>& nums) { int ans=0; for(auto index:nums) { if(index<0) { ans++; } ...
ALGO
0.99995
5.325176
a93a161b-720f-4d44-b386-074886058d9b
piotrbar250/Cpp-Algorithmics-Set
OI/Koleje/main.cpp
#include <bits/stdc++.h> using namespace std; constexpr int M = 1 << 16, ini = 0; int n,m,z; //vector <int> map<int,int> tree, lazy; class Node { public: int l,r,id; Node(int L, int R, int X) { l = L; r = R; id = X; lazy_update(); } Node left() { retu...
ALGO
0.999845
3.950076
cd0014d8-e0ed-4905-9b25-00a626f33d05
KSP-07/LeetCode-Questions
Merge two BST 's - GFG/merge-two-bst-s.cpp
//{ Driver Code Starts #include <bits/stdc++.h> using namespace std; #define MAX_HEIGHT 100000 // Tree Node struct Node { int data; Node *left; Node *right; Node(int val) { data = val; left = right = NULL; } }; // Function to Build Tree Node* buildTree(string str) { // Corner C...
ALGO
0.999978
6.331185
4fca758b-4cb9-4a1b-bb62-0352e2dd02f1
zee-bit/FINAL450
Graph/Minimum edges to reverse.cpp
#include <bits/stdc++.h> using namespace std; using namespace std::chrono; typedef long long ll; typedef long double ld; struct custom_hash; #define ff first #define I insert #define ss second #define maxN 300002 #define inf INT_MAX #define ninf INT_MIN #define pb push_back #define popb pop_back #define pf push_front #...
ALGO
0.999968
5.060958
abee779e-0fce-4cda-a8d5-762f20619e4f
gfacciol/DCTdenoising
main.cpp
#include <stdio.h> #include <stdlib.h> #include <iostream> #include <fstream> #include <vector> #include <cmath> #include <cstring> #include "DCTdenoising.h" #include "utils.hpp" #include "demoutils.hpp" using imgutils::pick_option; using imgutils::read_image; using imgutils::save_image; using imgutils::Image; using ...
TOOL
0.970792
5.758161
d28b4413-7c07-42c8-8538-37b73680b778
arcanexanth/cs452
cs452_lab3_f15-master/src/RBTree.cpp
/* * C++ Program to Implement Red Black Tree */ #include <iostream> #include <cstdio> #include <cstring> #include <algorithm> #include <cmath> #include <vector> #include <cstdlib> #include <cassert> #include <cstdint> #include "RBTree.hpp" #include "Process.hpp" #define INDENT_STEP 4 using namespace std; /* * Retu...
ALGO
0.998924
5.32666
6c070d4e-c23a-41e2-89c2-4efc306d0be7
yoon-H/algorithm_baekjoon
class1/2739.cpp
#include <iostream> using namespace std; int main() { int n{ 0 }; cin >> n; for (int i = 1; i < 10; i++) cout << n << " * " << i << " = " << n * i << endl; }
ALGO
0.996292
3.671133
ecf9dfd5-fbdc-4805-a17a-4a5f08e574c3
Pouriahasani22/Smaug_test
gem5-aladdin/src/systemc/tests/systemc/misc/synth/combo/switch3/switch3.cpp
/***************************************************************************** switch3.cpp -- Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15 *****************************************************************************/ /****************************************************************************...
TOOL
0.931168
4.535574
32af1af4-b86c-4fd8-9794-f5ea69b6b306
Evolution-X-Devices/device_xiaomi_mondrian
gps/utils/loc_misc_utils.cpp
#define LOG_NDEBUG 0 #define LOG_TAG "LocSvc_misc_utils" #include <stdio.h> #include <string.h> #include <inttypes.h> #include <dlfcn.h> #include <math.h> #include <log_util.h> #include <loc_misc_utils.h> #include <ctype.h> #include <fcntl.h> #include <inttypes.h> #include <sys/stat.h> #ifndef MSEC_IN_ONE_SEC #define ...
TOOL
0.956765
5.809645
c528f16c-290a-4496-804b-6639567e729b
EthanKim8683/High-School-Competitive-Programming
USACO/Guide/Platinum/Convex Hull Trick/commando.cpp
#include<bits/stdc++.h> using namespace std; using I=int; using Lli=long long int; using B=bool; const I N=1e6; const I LOGN=20; const I FIXN=1<<LOGN; const I MAX=1e9; const Lli MIN=-1e18; pair<I,I>segs[4*FIXN]; vector<I>cpss; Lli dp[N]; Lli a,b,c; I exp(I i){ if(i>=cpss.size())return cpss.back()+i; return cpss[i];...
ALGO
0.999747
4.602726
3cda0038-d508-441d-9b09-cf36510f954e
architiiit/Data-Structures-And-Algorithms
WEEK7/level2d.cpp
//SOME OPERATIONS WITH STRINGS //INPUT "LOVEBABBAR" //KEY "R" //find key using recursion #include<iostream> using namespace std; //try krenge variables ko by reference pass krna kyon ki space kam use hoga by reference pass krna bool checkKey(string& str,int i,int& n,char& key) {//base case if(i>=n) { //key ...
ALGO
0.99997
4.17952
b62b88ef-1cc6-4d80-b02f-f0ff158a9902
sarvex/leetcode-carbon
solution/0900-0999/0944.Delete Columns to Make Sorted/Solution.cpp
class Solution { public: int minDeletionSize(vector<string>& strs) { int n = strs.size(); int m = strs[0].size(); int res = 0; for (int i = 0; i < m; ++i) { for (int j = 0; j < n - 1; ++j) { if (strs[j][i] > strs[j + 1][i]) { res++; ...
ALGO
0.999991
6.254441
660f9933-20b2-4b1b-8339-72c16c654007
pidanself/about-my-change
poj/POJ-3295-构造-1.cpp
#include<iostream> #include<stack> #include<cstring> using namespace std; #define K(w,x) (w&&x) #define A(w,x) (w||x) #define C(w,x) ((!w)||x) #define E(w,x) (w==x) char s[120]; int getc(char s,int i); //K, A, N, C, E, p, q, r, s, t bool cal(int l,int i); int main(){ cin>>s; while(s[0]!='0'){ //32б for(uns...
ALGO
0.997653
3.042932
0f99da32-a757-4a20-89a1-f2787609b4eb
Prajjawal-Vaishya/Leetcode
C++/540.cpp
#include <iostream> #include <vector> using namespace std; int singleNonDuplicate(vector<int>& nums) { int left = 0; int right = nums.size()-1; while (left < right) { int mid = (left+right)/2; if ((mid%2 == 0 && nums[mid]== nums[mid+1]) || (mid%2 == 1 && nums[mid] == nums[mid-1])) { ...
ALGO
0.999452
5.36405
c93e04de-9ada-40d5-b457-5e954f5772dd
Shivanshwho/Problem-Solving
56-merge-intervals/56-merge-intervals.cpp
class Solution { public: vector<vector<int>> merge(vector<vector<int>>& intervals) { vector<vector<int>>ans; sort(intervals.begin(),intervals.end()); ans.push_back({intervals[0][0],intervals[0][1]}); for(int i=1;i<intervals.size();i++) { if(intervals[i][0]<=ans[an...
ALGO
1
6.083885
0595f8c2-60a1-4e5f-a17e-3f60a6e2c965
joybhuiya36/Problem-Solving
Leetcode/Daily Challenge/December 2023/11 Dec_1287_Element Appearing More Than 25% In Sorted Array.cpp
class Solution { public: int findSpecialInteger(vector<int>& arr) { int n=arr.size(); int mx=arr[0], ap=1, cnt=1; for(int i=1;i<n;i++) { if(arr[i-1]==arr[i]) cnt++; else cnt=1; if(cnt>ap) { mx=arr[i]; ...
ALGO
0.999886
5.499103
d8b769b2-d850-4ff6-99c7-c46115b872d7
SourVoice/c-leetcode-Experiment
leetcode/2034. Stock Price Fluctuation .cpp
#include <set> #include <unordered_map> using namespace std; class StockPrice { public: unordered_map<int, int> timePrice_mp; multiset<int> prices; int maxTimeStamp; StockPrice() { this->maxTimeStamp = 0; } void update(int timestamp, int price) { maxTimeStamp = max(time...
ALGO
0.998282
6.344364
a20449fd-d792-4cc7-96bc-e640b4f93bb6
the1coder-pro/fateen
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.998733
6.76775
89874f6c-4d91-462d-9206-32e02f93073c
AjayPratapSingh810/DSA-Questions-LeetCode-etc.-
1050-construct-binary-search-tree-from-preorder-traversal/construct-binary-search-tree-from-preorder-traversal.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.999995
6.664348
f5c53065-37a6-426b-b536-7521d785f32f
hjiang13/LLMs-in-IR
processed_data/Human_x_164_O3/CPP_34/CPP_34.cpp
/* Return sorted unique elements in a vector >>> unique({5, 3, 5, 2, 3, 3, 9, 0, 123}) {0, 2, 3, 5, 9, 123} */ #include<stdio.h> #include<vector> #include<algorithm> using namespace std; vector<int> unique(vector<int> l){ vector<int> out={}; for (int i=0;i<l.size();i++) if (find(out.begin(),out.end(),l...
ALGO
0.999728
5.33946
c37d5171-8b08-4dab-9e3c-cbce5486e31c
liviu-liviu/pseudocode
LeetCode Non-Contest Solutions/#127 Word Ladder/Simple BFS with Visited Map.cpp
class Solution { public: int ladderLength(string beginWord, string endWord, vector<string>& wordList); }; /* Returns the the number of nodes in the shortest path to the target word */ int Solution :: ladderLength(string beginWord, string endWord, vector<string>& wordList) { unordered_set<string> dictionary, vi...
ALGO
0.999959
6.104675
405893a5-8740-45b0-a058-d462e63dba3c
ravireddy07/cpp-book
src/Leetcode/121_best-time-to-buy-and-sell-stock.cpp
// Problem Statement: https://leetcode.com/problems/best-time-to-buy-and-sell-stock-iii/ #include <bits/stdc++.h> using namespace std; class Solution { public: int maxProfit(vector<int> prices) { int min_till_now = INT_MAX; int max_profit = 0; for (int i = 0; i < prices.size(); i++) ...
ALGO
0.998333
6.190531
7443da58-e26c-44f9-b3ef-7ff97f9ea7ab
hack-parthsharma/LeetCode
2840-check-if-strings-can-be-made-equal-with-operations-ii/2840-check-if-strings-can-be-made-equal-with-operations-ii.cpp
class Solution { public: bool checkStrings(string s1, string s2) { vector<vector<int>> count(2, vector<int>(26)); for (int i = 0; i < s1.length(); ++i) { ++count[i % 2][s1[i] - 'a']; --count[i % 2][s2[i] - 'a']; } for (int i = 0; i < 26; ++i) if (count[0][i] > 0 || count[1][i] > 0...
ALGO
0.999803
5.821288
272c4605-8256-44dc-85d6-2840d0a88155
samishibli/Data_Structures
HomeWork3/bintree.cpp
// FILE: bintree.template // IMPLEMENTS: The binary_tree node class (see bintree.h for documentation). #include <cassert> // Provides assert #include <cstdlib> // Provides NULL, std::size_t #include <iomanip> // Provides std::setw #include <iostream> // Provides std::cout #include "bintree.h" namespace main_savitch...
ALGO
0.99789
6.061459
b3b17097-bc73-4019-90f1-bfbbfd3aa9f5
yksake/NakigoeDB
NakigoeDB/Array.cpp
#include "Array.hpp" #include "Shlwapi.h" namespace NakigoeDB::NSort { Array<String>& Sort(Array<String>& texts) { return texts.sort_by([](const String& s1, const String& s2) { // s1 < s2 return StrCmpLogicalW(s1.toWstr().c_str(), s2.toWstr().c_str()) < 1; }); } Array<String> Sorted(const Array<String...
ALGO
0.989222
5.2633
d24fee81-0473-451e-a271-134e7369a374
tanishqg5325/CodeChef
GCD2.cpp
#include <bits/stdc++.h> #include <string> using namespace std; int gcd(int a, int b) { if(b==0) return a; return gcd(b,a%b); } int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int t,a,n,rem; string b; cin>>t; while(t--) { cin>>a>>b; if(a==0) {cout<<b<<endl...
ALGO
0.99936
4.108151
777e0047-3c71-4166-b342-0be4fcbb5776
KmrAnish04/Codeforces_TLE_CP-31
800/03_Cover_In_Water.cpp
#include<bits/stdc++.h> using namespace std; int main(){ int noOfTestCases; cin>>noOfTestCases; for (int i = 0; i < noOfTestCases; ++i) { // ************************************ Taking Inputs ************************************ int lengthOfStr; cin>>lengthOfStr; string str; cin>>str; // ***********...
ALGO
0.999753
4.67581
4d48d94a-7087-4fb4-b434-350225d7a04e
PushpendraUikey/Data-Structures-Algorithm
DAA/significantInversion.cpp
#include <bits/stdc++.h> using namespace std; // significant inversion problem: Finding the number of instances such that // i<j and arr[i] > 2*arr[j] int significantInversion(std::vector<int>&arr){ int cnt=0; for(int i=0; i<arr.size(); i++){ for(int j=i+1; j<arr.size(); j++){ if(arr[i] > 2...
ALGO
0.999111
4.08057
936d845a-02e8-41a0-9a1b-4a5d2a11749b
ignasms12/antraUzduotis
b strategija/lists/funcs.cpp
#include "vars.h" Studentas tuscias; void bubbleSort(std::list<Studentas>::iterator pavyzdys, int n) { bool exchanges; do { exchanges = false; for (int c = 0; c < n - 1; c++) { if (pavyzdys->nd_rezultatas[c] > pavyzdys->nd_rezultatas[c + 1]) { double temp = pavyzdys->nd_rezultatas[c]; pavyzdys->nd_rez...
TOOL
0.989345
4.364634
b5c0d206-9947-4ea0-8078-106659bf362e
zaemon1251-hesty/kyopuro_cpp_env
AtCoder/abc/abc235/a.cpp
#include <bits/stdc++.h> #include <atcoder/all> using namespace std; using namespace atcoder; #define rep(i, a, b) for (int i = (a); i < (b); i++) int main() { vector<int> b; rep(i, 0, 3) cin >> b[i]; int ans = b[0] + b[1] + b[2]; cout << 111 * ans << endl; return 0; }
ALGO
0.999463
3.758089
906216c4-25e1-4511-8243-d8abf37b4951
Jackiemin233/tram-mast3r
thirdparty/DROID-SLAM/thirdparty/lietorch/eigen/test/sparse_permutations.cpp
static long int nb_transposed_copies; #define EIGEN_SPARSE_TRANSPOSED_COPY_PLUGIN {nb_transposed_copies++;} #define VERIFY_TRANSPOSITION_COUNT(XPR,N) {\ nb_transposed_copies = 0; \ XPR; \ if(nb_transposed_copies!=N) std::cerr << "nb_transposed_copies == " << nb_transposed_copies << "\n"; \ VERIFY( (#XPR...
TEST
0.93527
6.328657
a2fdefde-a755-4ed1-ad98-1292f3cf0b6f
rudrakaiser/Contest_Solutions
Sheet #2/I - Palindrome.cpp
#include<bits/stdc++.h> using namespace std; int main() { string s; // 's' is for the main string cin >> s; if(s.length() == 1) cout << s << "\nYES"; else { int c1 = 0, c2 = 0; for(int i = 0; i < s.length(); i++) // counting leading zero '0' in 's' { if(s[i] == '0...
ALGO
0.99973
4.339586
ce3bedee-4044-436b-83b2-b50f3f330549
alexandraback/datacollection
solutions_5630113748090880_0/C++/ayushanshul07/round1b.cpp
#include <iostream> #include <cstdio> #include <vector> #include <deque> using namespace std; int main() { int T,z = 1; scanf("%d",&T); getchar(); while(T--) { int N,arr[2550][2]= {0},tmp = 0; scanf("%d",&N); int len = 2*N - 1; for(int i = 1 ; i <= len ; ++i) { for(int j = 1; j <= N; ++j) { ...
ALGO
0.99902
3.447402
7342adef-0e03-457f-81e9-3ccd22d7442a
tlsgkdns/study
String/1357_reverseAdd.cpp
#include <iostream> #include <string> #include <algorithm> using namespace std; string X, Y; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); cin >> X >> Y; reverse(X.begin(), X.end()); reverse(Y.begin(), Y.end()); int x = stoi(X), y = stoi(Y); x += y; string a = to_string(x); re...
ALGO
0.999926
5.068456
559ed6d8-76ef-4fc1-a3e4-b3ba4f099e76
sarachour/legno-compiler-internal
lab_bench/arduino/grendel_interp_V1/lib/AnalogLibV1/dac.cpp
#include "AnalogLib.h" #include <float.h> #include "assert.h" #include "calib_util.h" #include "slice.h" #include "dac.h" float Fabric::Chip::Tile::Slice::Dac::computeInput(dac_code_t& codes, float output){ float sign = util::sign_to_coeff(codes.inv); float rng = util::range_to_coeff(codes.range); return output/...
TOOL
0.875145
6.24271
658587e4-1792-4d67-a245-ad4b6b579fb7
ishandutta2007/codeforces
w0nsh/normal/1194/E.cpp
#include <bits/stdc++.h> #define FOR(i, n) for(int i = 0; i < (n); ++i) #define REP(i, a, b) for(int i = (a); i < (b); ++i) #define TRAV(i, n) for(auto &i : n) #define SZ(x) (int)(x).size() #define PR std::pair #define MP std::make_pair #define X first #define Y second typedef long long ll; typedef std::pair<int, int> ...
ALGO
0.998966
3.802714
e45f7e0d-b523-407d-be47-ceb843e2a522
mottoteen/daily_leetcode
9.palindrome-number.cpp
/* 判断一个整数是否是回文数。回文数是指正序(从左向右)和倒序(从右向左)读都是一样的整数。 示例 1: 输入: 121 输出: true 示例 2: 输入: -121 输出: false 解释: 从左向右读, 为 -121 。 从右向左读, 为 121- 。因此它不是一个回文数。 示例 3: 输入: 10 输出: false 解释: 从右向左读, 为 01 。因此它不是一个回文数。 进阶: 你能不将整数转为字符串来解决这个问题吗? */ class Solution { public: bool isPalindrome(int x) { if (x < 0...
ALGO
0.999663
5.74204
85b34cec-608f-4216-adac-adc6e8dde21c
willkill07/AdventOfCode2021
tests/Day21.cpp
#include <catch2/catch_all.hpp> #include "AdventTest.hpp" #include "AdventDay.hpp" #include "Day21.hpp" using namespace day21; namespace { char const* input = R"MULTILINE(Player 1 starting position: 4 Player 2 starting position: 8)MULTILINE"; auto const expected_part1 = 739785u; auto const expected_part2 = 4443560...
TEST
0.938699
5.414997
32e52d44-d372-4b78-9daf-b748248490ab
developer-ravi-03/100-day-dsa-challange
day-37/03_next_greater_element_I.cpp
// Leetcode : 496 // Next Greater Element I // TC : O(n) #include <iostream> #include <vector> #include <unordered_map> #include <stack> using namespace std; class Solution { public: vector<int> nextGreaterElement(vector<int> &nums1, vector<int> &nums2) { unordered_map<int, int> m; // nums2[i], NG stack<in...
ALGO
0.999834
5.834352
efbab9f2-e549-4f4e-ba9d-7eb0365bc834
Prosto-Chel228/siaod_practics
practice_7/LZ_77.cpp
#include <iostream> #include <vector> #include <string> using namespace std; void LZ77_alg(string input) { #define maxWindow 10 struct code { int off; int len; char nextChar; }; vector<code> vt; string str = input; int window1, window2; for(int i = 0; i < str.length(...
ALGO
0.999856
3.616249
360cfdd4-fa4a-4e12-9de0-263856b7bef0
parthpadia/Competitive-programming
T22.cpp
#include<bits/stdc++.h> using namespace std; int main() { int t; cin>>t; int p[25]={2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97}; while(t--) { int n; cin>>n; int a[n]; for(int i=0;i<n;i++) { cin>>a[i]; } ...
ALGO
0.999846
3.702024
381ed700-d50d-4ebb-9465-3ebdd9cb5fca
Eppurdream/Algorithm_Problems
Algorithm_Problems/_Programmers/CodeFiles/부족한 금액 계산하기.cpp
using namespace std; long long solution(int price, int money, int count) { long long answer = -1; long long sum = 0; for(int i = 0; i < count; i++) { sum += price * (i + 1); } if(money - sum > 0) { answer = 0; } else { answer = sum - money; ...
ALGO
0.999897
3.926631
ca68cf4b-af11-4780-85a6-1c97336c6a5d
Yuessiah/Destiny_Record
CodeJam/Kickstart/2018/A/B_Lucky_Dip.cpp
#include<cstdio> const int maxn = 2e4 + 10; int main() { int T, kase = 0; scanf("%d", &T); int N, K; long long V[maxn], sum ; double E; while(T--) { sum = E = 0; scanf("%d%d", &N, &K); for(int i = 0; i < N; i++) { scanf("%lld", &V[i]); sum += V[i]; } E = (double)sum / (double)N; while(K--) {...
ALGO
0.999739
3.521399
99813d63-a6a5-46a9-a699-7b216e2ad6c7
CodeFromRahul/DSA-c-
_DSA/charArray.cpp
#include<iostream> using namespace std; void reverse(char name[],int n ){ int s =0; int e = n-1; if(s<e){ swap(name[s],name[e]); s++; e--; } } int lengthString(char name[]){ int count = 0; for (int i = 0; name[i]!='\0'; i++) { count++; } return count;...
ALGO
0.998801
3.857295
492abdba-0e05-4765-ab21-188a846dbf53
maha201/Codeforces
74A-RoomLeader.cpp
#include <cstdio> #include <iostream> #include <map> int main(){ int n; scanf("%d\n", &n); std::map<std::string, int> scores; for(int k = 0; k < n; k++){ char name[20]; scanf("%s", name); int temp(0), total(0); scanf("%d", &temp);total += 100 * temp; scanf("%d", &temp);tota...
ALGO
0.990272
3.785387