uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
0800abab-770c-434f-96bd-498bcc941492
ishandutta2007/codeforces
.tx/normal/999/B.cpp
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; template <typename K, typename V = __gnu_pbds::null_type> using tree = __gnu_pbds::tree<K, V, less<K>, __gnu_pbds::rb_tree_tag, __gnu_pbds::tree_order_statistics_node_update>; using llong = long ...
ALGO
0.999998
5.079601
894f28f1-4df3-44cf-b692-0333b67b6745
JTuthill01/Subs-Ahoy
Subs Ahoy v1.0.1/Collision/Collision.cpp
#include "pch.hpp" #include "Collision.hpp" #include <map> #include <SFML/Graphics.hpp> /* * File: collision.cpp * Author: Nick (original version), ahnonay (SFML2 compatibility) */ namespace Collision { class BitmaskManager { public: ~BitmaskManager() { std::map<const sf::Texture*, sf::Uint8*>::const_ite...
TEST
0.887468
6.156658
67d634b8-7232-4b8f-9bef-232622f59cd7
Berries-Wang/DSAA-Berries
LeetCode/3. Longest Substring Without Repeating Characters/SolutionOne.cpp
// // Created by wei on 9/21/18. // #include <iostream> #include <map> #include <string> using namespace std; /** * 思想:双指针分离 */ class Solution { public: int lengthOfLongestSubstring(string s) { if (s.length() == 0) { return 0; } int front, end, len, lenpre; front =...
ALGO
0.999218
4.895785
767cee5d-a33c-4e7c-af94-9b2b2b7a90b1
JakeMaximus/AlgorithmsAndDataStructures
AlgorithmDataStructures/dataset2.cpp
#include <iostream> #include <vector> #include <cmath> #include <random> #include <algorithm> #include <set> #include <map> #include <iterator> using namespace std; struct Station { string name; int x, y, z, weight, profit; }; double calculateDistance(const Station& a, const Station& b) { return sqrt(pow...
ALGO
0.986838
4.739778
c019f730-a200-4a4d-9520-d6c6a0e668e8
tariorangeller/space
source/func.cpp
#include <SFML/Graphics.hpp> #include <stdlib.h> #include <stdio.h> #include <iostream> #include <cmath> #include "Header.hpp" using namespace sf; void cl::Calc::run() { x1 += dx1; y1 += dy1; if ((x1 + r1 > W) || (x1 - r1 < 0)) { dx1 = -dx1; } if ((y1 + r1 > H) || (y1 - r1 < 0)) { ...
ALGO
0.999514
3.856681
50b9a0d4-221e-46c6-9f86-9b3d2bd5115f
ishandutta2007/codeforces
samjia2000/normal/734/D.cpp
#include<iostream> #include<algorithm> #include<cstdio> #include<cmath> #include<cstring> #define fo(i,a,b) for(int i=a;i<=b;i++) #define fd(i,a,b) for(int i=a;i>=b;i--) using namespace std; int get(){ char ch; int s=0; bool bz=0; while(ch=getchar(),(ch<'0'||ch>'9')&&ch!='-'); if (ch=='-')bz=1;else s=ch-'0'; w...
ALGO
0.999715
3.54307
8f0d9c34-c086-4248-a608-bab97aedebb8
HaoTse/acm
UVA/UVA-11621.cpp
#include <cstdio> #include <vector> #include <cmath> #include <climits> #include <algorithm> using namespace std; int main(){ vector<long long> v; long long a; for(int i = 0; i < 32; i++){ for(int j = 0; j < 32; j++){ long long tmp = pow(2, i) * pow(3, j); if(tmp - 1 > LON...
ALGO
0.999769
3.72689
04ab9b3a-5255-4536-b63c-c316802467f6
Leopardim26/Neps_resolution
geral/lampadas.cpp
#include <iostream> using namespace std; int main(){ int n; scanf("%d", &n); int a[n]; int b = -1, c = -1; for(int i = 0; i < n; i++){ scanf("%d", &a[i]); if(a[i] == 1){ b *= -1; }else{ c *= -1; b *= -1; } } printf("%d \n...
ALGO
0.999948
3.467352
b30968a3-829b-4096-b33d-03177a4ba56f
JonathanAlderson/Mesh-Deformation
mesh_deformation/MousePick.cpp
/////////////////////////////////////////////////// // // Jonathan Alderson // October, 2020 // // ------------------------ // MousePick.h // ------------------------ // // Class to get mouse position in world space from screen space // /////////////////////////////////////////////////// #include "MousePick.h" #inclu...
ALGO
0.883279
5.390999
a9388893-4be7-433e-aa6e-46a535fae1f1
kamiltalipov/295-a2
stajiker09@gmail.com/Term 1/Task 3/fenwick_tree/fenwick_tree.cpp
#include <iostream> #include <vector> using namespace std; class fenwick_tree { public: fenwick_tree(int Size) { size=Size; buffer=new int[size]; for(int i=0; i<size; ++i) buffer[i]=0; } ~fenwick_tree() { delete[] buffer; } int sum(int left, int right) { return sum(right)-sum(left-1); } void upda...
ALGO
0.999864
4.351174
1a2c572c-3964-49aa-baf0-f6301d8f5fca
alexandraback/datacollection
solutions_2464487_1/C++/fuqinho/main.cpp
#include <iostream> #include <sstream> #include <vector> #include <queue> #include <stack> #include <set> #include <map> #include <algorithm> #include <numeric> #include <cstdio> #include <cstdlib> #include <cmath> #include <ctime> #include <cstring> #include <cassert> using namespace std; #define REP(i,n) for(int...
ALGO
0.999704
4.468439
5a210d5a-8601-44f4-8fcf-2e1eedcb141e
Oxeus/Computer-Science-Education-
cs161/Labs/Lab04/Lab04Part01.cpp
/*********************************************** By: Adam La Fleur Sources: ASCII Table: http://www.ascii-code.com/ ***********************************************/ #include <iostream> using namespace std; int main() { int yourNum; cout << "Please enter a number between 1 and 61: "; cin >> yourNum; if (yourNum >...
TOOL
0.976779
3.749866
69792dfa-ddee-489f-b936-e5076e6a8f8a
Code-Practitioners/Diversified-Programming
Heap/sortKSortedArray.cpp
#include <iostream> #include <queue> using namespace std; int main() { int cases; cin >> cases; while (cases--) { int n, k; cin >> n >> k; int arr[n]; for (int i = 0; i < n; i++) cin >> arr[i]; priority_queue<int, vector<int>, greater<int>> pq(arr,...
ALGO
0.999948
3.46951
1ea3b0eb-7a1d-4e25-8273-50ec2cb011d2
ericliuu/flux
FLUX/libc/src/math/aarch64/roundf.cpp
#include "src/math/roundf.h" #include "src/__support/common.h" namespace __llvm_libc { LLVM_LIBC_FUNCTION(float, roundf, (float x)) { float y; __asm__ __volatile__("frinta %s0, %s1\n\t" : "=w"(y) : "w"(x)); return y; } } // namespace __llvm_libc
ALGO
0.975644
5.899105
6c47d6c3-b2b8-40d0-94cb-a0dec6494671
Venkatesan-M/DAA-Lab
Lab-7/code.cpp
#include <iostream> #include <vector> #include <chrono> using namespace std; #define N 4 void printSolution(int board[N][N]) { for (int i = 0; i < N; i++) { for (int j = 0; j < N; j++) { cout << (board[i][j] ? "Q " : ". "); } cout << endl; } cout << endl; } // Check i...
ALGO
0.999625
5.803656
91ee6c3e-6856-4060-a104-cbf3f0d806c0
Mond45/data_struct
interval_count.cpp
#include <vector> #include <iostream> #include <algorithm> int main() { using namespace std; ios_base::sync_with_stdio(false); cin.tie(0); int n, m, k; cin >> n >> m >> k; vector<int> nums(n); for (int i = 0; i < n; ++i) { int x; cin >> x; nums[i] = x; } ...
ALGO
0.999978
4.233345
0f1af2c9-c8a5-4c7f-a168-1182838b0873
pokaa3a/LeetCode
problems/0853_Car_Fleet.cpp
#include <iostream> #include <vector> #include <stack> #include <map> using namespace std; class Solution { public: int carFleet(int target, vector<int>& position, vector<int>& speed) { map<int, double> m; for (int i = 0; i < position.size(); ++i) { // ceil(target / speed[i]) m[position[i]] = (double)(ta...
ALGO
0.998314
5.827218
f589f97f-1325-4517-bb56-9b8fb9fe5ccc
Ivikhostrup/sP-MiniProject
StochasticSimulation/src/SimulationMethods.cpp
// // Created by Ivik Hostrup. // #include <future> #include "CovidSimulator.h" #include "SpeciesQuantityMonitorCallBack.h" #include "CircadianSimulator.h" #include "SimpleSimulator.h" void PlotSimple(){ std::vector<std::string> speciesToMonitor = {"A", "B", "C"}; SpeciesQuantityMonitorCallBack speciesMonitor...
ALGO
0.992073
5.291061
2ef1c5f8-a482-400f-b6e9-bdf2169357b1
zhenkunhe/LeetCode
589. N-ary Tree Preorder Traversal/src/main.cpp
#include <iostream> #include <stack> #include <tree.hpp> using namespace std; class Solution { public: vector<int> preorder(Node* root) { vector<int> res; if ( root ) { res.push_back(root->val); vector<int> child_res; for (auto child : root->children) { child_res = preorder(child); res.ins...
ALGO
0.99991
5.513974
e4bac46e-2f08-452f-824d-902d07eacd80
AmanSharma0710/cp
Codeforces Round #803/D_Fixed_Point_Guessing.cpp
#include<bits/stdc++.h> using namespace std; #define int long long int #define vi vector<int> #define pii pair<int,int> #define vii vector<pii> #define rep(i,a,b) for(int i=a; i<b; i++) bool sortbysec(const pair<int,int> &a, const pair<int,int> &b){ //to sort vii by second element use sort(v.begin(), v.e...
ALGO
0.999875
3.953679
8b7e1241-f41b-4e3b-9368-846e0cfa016f
kavin-mani/HackerRank
FunnyString.cpp
#include <cmath> #include <cstdio> #include <vector> #include <iostream> #include <string.h> #include <algorithm> using namespace std; int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT */ int t,i,j,flag=0; string str; cin>>t; for(int a0=0;a0<t;a0++) { ...
ALGO
0.986487
4.672513
78e16826-a0e2-4b4c-9b19-c8f5f3ce6a6d
mick909/topcoder
tco/tco_2012/Round1C/PasswordXGuessing.cpp
/* 騙された! 返り値型がlong longなので総当たりで間に合わないの? と思わされたが、 すべての入力について1文字が異なる文字集合を生成しても => 9*50*50 = 22500通り なので、そもそもintに収まるじゃん。。。 生成した文字列がすべての入力にたいして1文字だけ異なるかの判定 => 22500 * 50 * 50 = 56,250,000 なのでギリギリに思えるけれど、すべて異なる文字列を生成して それがすべて条件にあてはまる、なんてことはないので(証明未) 時間は余裕。 (実際、SystemTestでも最大60m...
TEST
0.995179
4.202783
3d4006a7-7daf-4846-9460-e2cf1b5bc673
Los-Buggati/Pinball-Bugatti
Pinball/Box2D/Box2D/Collision/b2CollideEdge.cpp
#include <Box2D/Collision/b2Collision.h> #include <Box2D/Collision/Shapes/b2CircleShape.h> #include <Box2D/Collision/Shapes/b2EdgeShape.h> #include <Box2D/Collision/Shapes/b2PolygonShape.h> // Compute contact points for edge versus circle. // This accounts for edge connectivity. void b2CollideEdgeAndCircle(b2Manifold*...
ALGO
0.999801
7.537254
c504e77d-9ca2-4123-865a-aef7f4aebe4a
Nishant-Bhosale/Competitive-Programming-CPP
LeetCodeProblems/BiweeklyContestProblems/NumberOfZeroFilledSubarrays.cpp
class Solution { public: long long zeroFilledSubarray(vector<int>& nums) { long long ans = 0; long long consec = 0; for(int i = 0; i < nums.size(); i++){ if(nums[i] == 0){ consec++; }else{ ans += (consec*(consec + 1)) / 2; ...
ALGO
0.999965
6.19839
d1d9c95c-8f74-4e93-b6d4-241fbf3385b1
siddhanttomar2003/CP
Buying_New_Tablet.cpp
#include <iostream> #include<bits/stdc++.h> using namespace std; int main() { // your code goes here int t; cin>>t; while(t--) { int n,b; cin>>n>>b; int arr[n][3]; for(int i=0;i<n;i++){ for(int j=0;j<3;j++){ cin>>arr[i][j]; } } int ans=0; int flag=...
ALGO
0.999869
3.762769
4e973837-2c5b-4ada-b741-4486c9fb95f3
ftiasch/acm-icpc
codeforces/319-codeforces-round-189/B.cpp
// Codeforces Round #189 // Problem B -- Psychos in a Line #include <cstdio> #include <cstring> #include <set> #include <algorithm> #define foreach(i, v) for (__typeof((v).begin()) i = (v).begin(); i != (v).end(); ++ i) const int N = 100000; int n, a[N]; int main() { scanf("%d", &n); std::set <int> position...
ALGO
0.999982
4.02213
aadcbc6d-a3ef-4673-91ff-5c247f543f7d
Akki5/spoj-solutions
VHELSING.cpp
#include<cstdio> #include<iostream> #include<math.h> #include <sstream> #include <string> #include <iomanip> using namespace std; int main() { int t,r; cin>>t; double ans,d=8.0*(2-sqrt(2.0));; for(int i=1;i<=t;i++) { cin>>r; ans=d*1.0*r*r*r; cout<<setprecision(4)<<fixed<<ans<<"\n"; } }
ALGO
0.998468
3.936318
40d8303a-8db0-46f9-a884-8b27639949a2
ShrutiNikam997/PPA
GenericX.cpp
#include<iostream> using namespace std; template <class T> T Addition (T No1, T No2) { T Ans; Ans = No1+No2; return Ans; } template<class T> T Maximum (T No1, T No2) { if(No1 > No2) { return No1; } else { return No2; } } int main() { int A = 11, B= 21, Ans = 0; ...
ALGO
0.995903
4.09541
588ad2d9-5c1b-460f-81a3-e1ba80020d1a
shahjalalgit/Competitive-Programming
insertionSort.cpp
#include <iostream> #include <stdio.h> #include <string> #include <algorithm> #include <vector> using namespace std; // insertion sort function // void insertionSort(int n, int num[n]) // { // int i,j; // for (i = 1; i <= n; i++) // { // x = num[i]; // j = i − 1; // while (j >= 1 && ...
ALGO
0.999938
4.273575
0322c5b8-e05c-4bc7-a8c1-803becc11bb3
ishandutta2007/codeforces
neal/normal/1251/D.cpp
// https://probablydance.com/2016/12/27/i-wrote-a-faster-sorting-algorithm/ #include <cstdint> #include <algorithm> namespace detail { inline unsigned int to_unsigned_or_bool(int i) { return static_cast<unsigned int>(i) + static_cast<unsigned int>(1 << (sizeof(int) * 8 - 1)); } inline unsigned int to_unsigned_or_...
ALGO
0.999984
6.231282
ed1f6616-764f-4ee9-8cf5-5b9fb2d3fac2
santoshdahal2016/LearningVisualOdometry
Feature Extraction/FastFeature.cpp
#include "opencv2/highgui.hpp" #include "opencv2/imgproc.hpp" #include <iostream> #include <cv.hpp> using namespace cv; using namespace std; Mat src, src_gray ; int thresh = 20; int max_thresh = 255; const char* source_window = "Source image"; const char* corners_window = "Corners detected"; void fast_demo( int, voi...
ALGO
0.978042
6.212675
7be19134-b39e-4b19-9ad7-f89c8690f0b3
CSI-SRM-NCR-Chapter/100-Days-of-Code
Krishna Kant/Day 2/Q2.cpp
class Solution { public: void merge(vector<int>& nums1, int m, vector<int>& nums2, int n) { int i = m-1; int j = n-1; int k = m+n-1; while(i>=0 && j>=0){ if(nums1[i] > nums2[j]){ nums1[k] = nums1[i]; i--; k--; } els...
ALGO
0.999955
5.28896
d3c83cf9-a5ab-4726-a717-9bbf0e5edd98
Bingurrr/algorithm_pratice
프로그래머스/unrated/147355. 크기가 작은 부분문자열/크기가 작은 부분문자열.cpp
#include <string> #include <vector> #include <iostream> using namespace std; int solution(string t, string p) { int answer = 0; for(int i = 0; i < t.size()-p.size()+1; i++){ for(int j = 0; j < p.size(); j++){ int x = t[j+i] - '0'; int y = p[j] - '0'; if(x <...
ALGO
0.999923
5.270862
291216a4-69d0-41ea-96e8-5207aa03a4ed
manchewwww/OOP
OOP-PRACT-SOL/OOP-CreateAndRemoveUsers/ConsoleApplication1/ConsoleApplication1.cpp
#include <iostream> #include <fstream> #include <cstring> #include <ctime> unsigned computeHash(const unsigned char* memory, int length) { unsigned hash = 0xbeaf; for (int c = 0; c < length; c++) { hash += memory[c]; hash += hash << 10; hash ^= hash >> 6; } hash += hash << 3; ...
TOOL
0.945197
4.549059
053e4beb-5be6-4b31-b4ec-73ebbca2811b
ibex-team/ibex-lib
src/symbolic/ibex_ExprSimplify.cpp
#include "ibex_ExprSimplify.h" #include "ibex_Expr.h" #include "ibex_ExprSubNodes.h" #include "ibex_NodeMap.h" using namespace std; #define CLONE_VEC vector<pair<DoubleIndex, const ExprNode*> > namespace ibex { namespace { bool is_cst(const ExprNode& e) { const ExprConstant* c=dynamic_cast<const ExprConstant*>(&e...
ALGO
0.999754
5.235865
9ea3fc61-9580-4014-b943-4915e865ebf9
ErNikhil0/DSA-2nd-Year
Assignment 4/Kangaroo.cpp
#include <bits/stdc++.h> using namespace std; string ltrim(const string &); string rtrim(const string &); vector<string> split(const string &); int main(){ int x1; int v1; int x2; int v2; cin >> x1 >> v1 >> x2 >> v2; if ((v1 <= v2) || ((x2 - x1) % (v2 - v1))) { puts("NO"); } else ...
ALGO
0.99981
3.717056
dc7d3b8d-9fe3-4f35-85b9-ce05553335bc
icEngineer-tech/LeetCode
Hard - Merge_k_Sorted_Lists.cpp
ListNode* merge2List(ListNode* a, ListNode* b) { ListNode* result = nullptr; if (a == nullptr) return b; else if (b == nullptr) return a; if (a->val <= b->val) { result = a; result->next = merge2List(a->next, b); } else { result = b; ...
ALGO
0.99986
5.585286
9de9ed92-72f1-40b2-b0d1-fb0529d5dfcd
Aadij724/Dsa
Binary Search Tree/bottomViewBinaryTree.cpp
#include<iostream> #include<bits/stdc++.h> using namespace std; class Node { public: int key; Node* left; Node* right; Node( int x ) { key=x; left=NULL; right=NULL; } }; void bottomView( Node* root ) { map<int, int> mp; if( root==NULL ) retu...
ALGO
0.999979
5.475238
cb62adba-efb9-4dad-af85-5611087bb9cf
Um-ded/problem-solving
SPOJ Codes/6.QUEUEEZ.cpp
///*/////////////////////////////*/// /// IN THE NAME OF ALMIGHTY ALLAH /// ///*/////////////////////////////*/// ///*////////////////////*/// /// Author : SAIFULLAH29 /// ///*////////////////////*/// ///*//////////////////////////////////////////*/// /// "When you want something, all the universe /// /// conspires ...
ALGO
0.998834
5.050273
f736766d-2498-4675-87f5-c68004f8a9c2
G1veng/BubbleSelectionInsertShellFastSorts
third_work/ISort.cpp
#include "ISort.h" #include <iostream> BubbleSort::BubbleSort() { changes = 0; compares = 0; } int BubbleSort::get_changes(void) const { return changes; } int BubbleSort::get_compares(void) const { return compares; } std::unique_ptr<Carray> BubbleSort::copyForSort(const Carray& array) { auto arrinner = new Car...
ALGO
0.998865
4.445859
20533075-66fe-43de-8aab-79412b8678b8
radrbiz/radard
src/ripple/app/tx/impl/ClaimCT.cpp
//------------------------------------------------------------------------------ //============================================================================== #include <BeastConfig.h> #include <boost/algorithm/string.hpp> #include <ripple/app/tx/impl/ClaimCT.h> #include <ripple/app/main/Application.h> #include <ri...
TOOL
0.938756
7.386412
70b91d36-3789-4d06-b05e-5a4ed1274480
AndriyFedorenko/CommandsService
CommandsService/Utils.cpp
// // Created by andrii on 29.08.21. // #include "Utils.h" #include <sstream> using namespace std; namespace { const string COMMAND_SEPARATOR = " "; } Command Utils::parseCommand(const string& strCommand) { Command cmd; istringstream iss(strCommand); iss >> cmd.command; for (string arg; iss >> ...
TOOL
0.922575
5.94519
ae483e03-b901-4cc6-8be3-0f34999525bd
proRamLOGO/Competitive_Programming
CF_650_D3/D.cpp
// Author: proRam // Name: Shubh Bansal // Dated: // Question #include <bits/stdc++.h> #pragma GCC target ("sse4.2") // #include <ext/pb_ds/assoc_container.hpp> // #include <ext/pb_ds/tree_policy.hpp> // using namespace __gnu_pbds; using namespace std; #ifndef ONLINE_JUDGE class Timer { private: chrono::time_po...
ALGO
0.999986
4.870516
483aaf54-9cfd-4115-a624-0fc4f67034d6
M0ra/Core
dep/g3dlite/source/Line.cpp
/** @file Line.cpp Line class @maintainer Morgan McGuire, graphics3d.com @created 2001-06-02 @edited 2006-01-28 */ #include "G3D/Line.h" #include "G3D/Plane.h" namespace G3D { Vector3 Line::intersection(const Plane& plane) const { float d; Vector3 normal = plane.normal(); plane.getEquat...
TOOL
0.915341
5.643387
0ded5230-3959-47d7-bb94-866b47b2f043
SeMyeongJin/DataStructure
List/linkedlist.cpp
#include <cstdio> #include <cstdlib> #include <cstring> #include "linkedlist.h" LinkedList* createLinkedList() { LinkedList* pReturn = NULL; pReturn = (LinkedList*)malloc(sizeof(LinkedList)); if (pReturn != NULL) { memset(pReturn, 0, sizeof(LinkedList)); } else { printf("ḮƮ \n"); return NULL; } retur...
ALGO
0.993413
4.0611
26e82b20-8bd9-4b41-8298-8d2c2b328790
theatapro/Atcoder
ABC/ABC280/A.cpp
#include <bits/stdc++.h> #include <atcoder/all> #define rep(i, l, r) for (int i = (l); i < (r); i++) typedef long long ll; const ll LINF = 1e18; const int INF = 1e9; using namespace std; int main(void) { int H,W; int ans = 0; cin >> H >>W; rep(i,0,H*W) { char c; cin >> c; if(c == '#') ans++; } cout ...
ALGO
0.998894
4.295791
5e6480a4-697f-4221-aeb0-773bfa3bca9a
nalifanova/raycasting
src/Physics.cpp
#include "Physics.hpp" Intersect Physics::lineIntersect(const Vec2& a, const Vec2& b, const Vec2& c, const Vec2& d) { const Vec2 r = b - a; // vector r const Vec2 s = d - c; // vector s const float rxs = r.cross2d(s); // 2d cross product const Vec2 cma = c - a; const float t = cma.cross2d(s) / rxs;...
ALGO
0.99524
4.916295
82bfe7a7-1aaa-449f-8b5d-615f067ecbcc
junlong-gao/recreations
src/code_practise/leetcode/cpp/00337.cpp
#define CATCH_CONFIG_MAIN #include "catch.hpp" #include <vector> #include <deque> #include <algorithm> #include <unordered_map> #include <unordered_set> namespace{ using namespace std; struct TreeNode { int val; TreeNode *left; TreeNode *right; TreeNode(int x) : val(x), left(NULL), right(NULL) {} }; class ...
ALGO
0.999793
6.159137
0083cc38-69ba-4824-9eb7-8ecbd402f790
xsunnysongx/SE_HW4
Shell_Sort_and_Quick_Sort.cpp
#include <iostream> // cout, endl #include <fstream> // open, is_open #include <string> // string #include <vector> // vector #include <cstdlib> // atoi, system #include <iomanip> // setw #include <ctime> // clock, CLOCKS_PER_SEC #define PAGE_SIZE 30 // number of output per page using namespace std; // standard naming ...
TOOL
0.970709
3.374869
fd2335d1-fabc-4f4a-816d-7277440c212a
Kunjshah84/leet
2581-divide-players-into-teams-of-equal-skill/2581-divide-players-into-teams-of-equal-skill.cpp
class Solution { public: long long dividePlayers(vector<int>& skill) { if(skill.size()==2) return skill[0]*skill[1]; sort(skill.begin(),skill.end()); int s=1,e=skill.size()-2; long long ans=skill[0]*skill[skill.size()-1]; int pre=skill[0]+skill[skill.size()-1]; ...
ALGO
0.999956
4.841017
91e1bbd8-9a43-44eb-ae53-16e277774065
29rj/LeetCode_Problems
518-coin-change-2/518-coin-change-2.cpp
class Solution { public: vector<vector<int>>dp; int helper(vector<int>& coins, int amount ,int i){ if(amount == 0) return 1; if(i==coins.size()) return 0; if(dp[i][amount]!=-1) return dp[i][amount]; int...
ALGO
0.999977
5.972251
399e2d53-dd8b-4f5a-a615-ed36ef497a6b
Jtun53/PersonalProjects
DSPrac/Tests/SortingAlgos.cpp
#include <stdio.h> #include "SortingAlgos.h" #include <vector> #include <string> #include <algorithm> template <class t> void SortingAlgos<t>::bubbleSort(std::vector<t> &arr){ for (int i = 1; i != arr.size(); i++){ for (int j = 0; j != arr.size() - i; j++) if (arr[j] > arr[j+1]) ...
ALGO
0.999344
5.13469
060a3930-cb83-42e5-8786-b4bc34732b2f
ishandutta2007/codeforces
maroonrk/normal/1548/C.cpp
#ifndef LOCAL #pragma GCC optimize ("-Ofast") #pragma GCC optimize ("unroll-loops") #endif #include <bits/stdc++.h> using namespace std; using ll=long long; #define int ll #define rng(i,a,b) for(int i=int(a);i<int(b);i++) #define rep(i,b) rng(i,0,b) #define gnr(i,a,b) for(int i=int(b)-1;i>=int(a);i--) #define per(i,...
ALGO
0.999835
3.809243
ed51f108-52d9-4661-8028-bcf263b8f327
darkshuige/codecode
c code/Box.cpp
#include<bits/stdc++.h> #define jiasu ios::sync_with_stdio(false),cin.tie(0),cout.tie(0) #define int long long #define INF 0x3f3f3f3f #define endl "\n" using namespace std; const int maxn=1000005; int a[maxn],b[maxn]; int dp[maxn][2]; signed main() { jiasu; int n; cin>>n; memset(dp,0,sizeof dp); for(int i=1;i<=n;i...
ALGO
0.999958
3.466418
bc9effaf-126b-463a-8feb-2dc4c33b5be8
bhaveshgarg2000/LeetCode-GFG-DailyChallenge
November 2024/1154.cpp
class Solution { public: bool isLeapYear(int year) { return (year % 400 == 0) || (year % 100 != 0 && year % 4 == 0); } int dayOfYear(string date) { int year = stoi(date.substr(0, 4)); int month = stoi(date.substr(5, 2)); int day = stoi(date.substr(8, 4)); int...
ALGO
0.999683
5.393091
bc5bdcf9-dd8f-4f36-b358-1255aa25fcb6
113bommy/deepmind_codecontests_refine
cpp_source_filter_file/cpp_train_239_1.cpp
#include <bits/stdc++.h> using namespace std; bool ok(long long x, long long y) { if (x > y) swap(x, y); if (x == 0) return 0; if (!ok(x, y % x)) return 1; long long d = (y / x) - 1LL; return ((d % (x + 1LL)) % 2 + 100) % 2 == 1; } int main() { int n; cin >> n; for (int i = 0; i < n; i++) { long lon...
ALGO
0.99996
4.62143
ba20bff1-2525-4e8d-b8ec-ddabe45e4027
Arvln/LeetCode
Tree/987.Vertical-Order-Traversal-of-a-Binary-Tree/987.Vertical-Order-Traversal-of-a-Binary-Tree_v2.cpp
class Solution { unordered_map<int, vector<pair<int, int>>>Map; // col->[{depth, val}] int minCol=0; public: vector<vector<int>> verticalTraversal(TreeNode* root) { dfs(root, 0, 0); vector<vector<int>>rets; while (!Map.empty()) { sort(Map[minCol].begin(), Map[minC...
ALGO
0.999992
6.189044
74bc0608-8fda-49cc-8bd9-8f8e8730e1fc
TheMartian0x48/CP
UVa/volume-006/686.cpp
/* * TheMartian0x48 * UVa 686 */ #include <bits/stdc++.h> using namespace std; // clang-format off #define rep(i, a, b) for (int i = a; i < (b); ++i) #define per(i, a, b) for (int i = a; i >= (b); --i) #define trav(a, x) for (auto &a : x) #define all(x) x.begin(), x.end() #define rll(x) x.rbegin(), x.rend() #define...
ALGO
0.999883
4.263044
55526b6d-0ea1-4adc-9893-9af30666f754
Rajesh351/Leetcodeall
0725-split-linked-list-in-parts/0725-split-linked-list-in-parts.cpp
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode() : val(0), next(nullptr) {} * ListNode(int x) : val(x), next(nullptr) {} * ListNode(int x, ListNode *next) : val(x), next(next) {} * }; */ class Solution { public: vector<ListNode*> spl...
ALGO
0.999927
5.448439
4459c22e-eea8-4d67-9ba1-d0cc45d38636
ishandutta2007/codeforces
alireza_kaviani/normal/604/B.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef pair<int,int> pii; typedef pair<ll,ll> pll; typedef pair<double,double> pdd; typedef pair<ld,ld> pld; typedef pair<string , string>...
ALGO
0.999916
3.573871
7371b95b-a04e-42d5-885d-02965102a782
diegobodas/testingMOEA_frameworks_with_R
workspacecpp/jMetalCpp_FromR_Final/src/core/Algorithm.cpp
#include "Algorithm.h" /** * Constructor * @param problem **/ Algorithm::Algorithm(Problem *problem) { problem_ = problem; } /** * Destructor */ Algorithm::~Algorithm() { delete problem_; } // ~Algorithm /** * Offers facilities for add new operators for the algorithm. To use an * operator, an algorithm has...
ALGO
0.99946
4.631467
6314f71f-787e-4b20-8350-df8b2af88b52
ishandutta2007/codeforces
jhin/normal/1238/C.cpp
#include <bits/stdc++.h> using namespace std; const int mod=1e9+7; vector<long long> p; int ho,mi,se,ho1,mi1; void fix_time() { if(se>59)mi+=se/60,se=se%60;if(se<0)se+=60,mi--; if(mi>59)ho+=mi/60,mi=mi%60;if(mi<0)mi...
ALGO
0.999832
4.272954
75421dc6-d727-4514-aecb-3af4e53e6ee0
CodeBySushant/SolvedLeetcode
leetcode-main/leetcode-main/solution/2000-2099/2034.Stock Price Fluctuation/Solution.cpp
class StockPrice { public: StockPrice() { } void update(int timestamp, int price) { if (d.count(timestamp)) { ls.erase(ls.find(d[timestamp])); } d[timestamp] = price; ls.insert(price); last = max(last, timestamp); } int current() { return...
ALGO
0.999139
6.765613
e7f6975b-4daf-412f-a282-88b4c7e47358
saarang123/Competitive-Programming
IOITC2021/TST/3/edge-subsets-39$linux/solutions/umniksoln.cpp
#include <iostream> #include <cstdio> #include <cstdlib> #include <algorithm> #include <cmath> #include <vector> #include <set> #include <map> #include <unordered_set> #include <unordered_map> #include <queue> #include <ctime> #include <cassert> #include <complex> #include <string> #include <cstring> #include <chrono> ...
ALGO
0.999751
3.813175
ac674d31-8afa-4023-8f4f-f6ed6adf16e4
Esratjahanmare/Code
Codeforces/A. Sasha and Array Coloring.cpp
#include<bits/stdc++.h> using namespace std; int main() { int t; cin>>t; while(t--) { int n, sum=0; cin>>n; vector<int>v(n); for(int i=0; i<n; i++) { cin>>v[i]; } sort(v.begin(), v.end()); int l=0, r=n-1; while(l<r) {...
ALGO
0.999908
4.187848
6ae44197-6f2f-4f63-abd2-dc73f6759ddb
AnnaBohaiets/lab04.2
Lab_04.2/lab04.2.cpp
#include <iostream> #include <iomanip> #include <cmath> using namespace std; int main() { double x, xp, xk, dx, A, B, y; cout << "xp = "; cin >> xp; cout << "xk = "; cin >> xk; cout << "dx = "; cin >> dx; cout << fixed; cout << "---------------------------" << endl; cout << "|" << setw(5) << "x" << " |" << set...
ALGO
0.996197
3.640134
fd3c224f-2419-412b-8d68-efcf99057781
rukiyecanli1/C-Coding-Examples
prolabSonKodum/main.cpp
#include <stdio.h> #include <stdlib.h> #include <math.h> #include <string.h> #include <graphics.h> struct Nokta { double x; double y; }; struct Cember { struct Nokta m; double yc; }; FILE *dosya, *dosya2; int i=0,satir=0; char karakter1[40],karakter2[40], karakter3[40],karakter4[40]; int ch=0; void x...
ALGO
0.999688
3.431264
46809f97-3116-4504-b1d0-f88b1cfda362
Anand4405/DSA-Complete-codes
Linked-List/insert_begin_end_circu_doubly.cpp
#include<bits/stdc++.h> using namespace std; struct Node{ int data; Node *next,*prev; Node(int x){ data = x; next = NULL; prev = NULL; } }; Node *insert_at_begin(Node*head,int x){ Node *temp = new Node(x); if(head==NULL){ temp->next = temp; temp->prev = te...
ALGO
0.999824
3.873912
21b0b0d9-29c6-4651-8c63-e39ac0eb557e
EnamulKhan2525/Phitron
3 Basic Data Structures with C++/Module 05 Singly Linked List/Dynamic_Node.cpp
#include<bits/stdc++.h> using namespace std; class Node { public: int val; Node* next; Node(int val) { this->val=val; this->next=NULL; } }; int main() { Node* head = new Node (10); Node* b = new Node (20); Node* c = new Node (30); head->next=b; b->next=c; ...
ALGO
0.994874
3.098999
b1b26b19-345b-45f5-b65d-007faca6db8d
JonathonMacleod/Distributed-Game-Architecture
libs/BOOST1.82.0/libs/unordered/benchmark/word_count.cpp
#define _SILENCE_CXX17_OLD_ALLOCATOR_MEMBERS_DEPRECATION_WARNING #define _SILENCE_CXX20_CISO646_REMOVED_WARNING #include <boost/unordered_map.hpp> #include <boost/unordered/unordered_node_map.hpp> #include <boost/unordered/unordered_flat_map.hpp> #include <boost/regex.hpp> #ifdef HAVE_ABSEIL # include "absl/container/...
TEST
0.902677
6.711401
0e105a47-3f55-48d4-a1dc-dc7629aad369
adamlaska/bitconnectcoin-bitconnectcoin
src/pbkdf2.cpp
#include <string.h> #include "pbkdf2.h" static inline uint32_t be32dec(const void *pp) { const uint8_t *p = (uint8_t const *)pp; return ((uint32_t)(p[3]) + ((uint32_t)(p[2]) << 8) + ((uint32_t)(p[1]) << 16) + ((uint32_t)(p[0]) << 24)); } static inline void be32enc(void *pp, uint32_t x) { uint8_t ...
ALGO
0.997248
6.905365
363c3bdb-675e-4def-bdb7-40bd9b03e8ba
hanriiver/algorithm
backtracking/6603.cpp
#include <iostream> #include <vector> using namespace std; int k; int arr[14]; bool check[14]; vector<int> ans; void go(int start, int index) { if (index == 6) { for (int i = 0; i < 6; i++) { cout << ans[i] << " "; } cout << "\n"; return; } for (int i = start; i < k; i++) { if (check[i]) continue; ans...
ALGO
0.999556
4.36887
2d453d7b-d456-4e55-b103-4d0a7501a518
BTS-MicroNet/BTS-magic-wand
arduino_x86_64/prj/micro_speech/arduino/src/tensorflow/lite/micro/kernels/l2norm.cpp
#include "tensorflow/lite/c/common.h" #include "tensorflow/lite/kernels/internal/portable_tensor.h" #include "tensorflow/lite/kernels/internal/reference/integer_ops/l2normalization.h" #include "tensorflow/lite/kernels/internal/reference/l2normalization.h" #include "tensorflow/lite/kernels/kernel_util.h" #include "tenso...
DATA
0.900614
7.607632
cf2504f1-8f76-4fd4-b667-349c4892903f
kassabronald/Competitive-Programming
CSES/1) Introductory Problems/Two Sets.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; const long long MAXVAL = 10000000; long long arr[MAXVAL]; int main() { ios_base::sync_with_stdio(0); cin.tie(0); ll n; cin >> n; ll sum = (n * (n + 1)) / 2; if (sum % 2 != 0) { cout << "NO" << endl; } else...
ALGO
0.999938
3.749826
ec7a8ebb-4534-4029-a99e-ad15402aeb68
AlcivanLucas/Beecrowd
ad-hoc/1136/1136.cpp
#include <iostream> #include <cstdlib> #include <vector> #include <set> using namespace std; int main() { int N, B; vector<int> bolas; set<int> possibilidades; while (cin >> N >> B) { if (!N && !B) break; possibilidades.clear(); possibilidades.insert(0); ...
ALGO
0.99983
3.919646
01e51d78-271b-430b-b85b-9507c2a8240f
Yaseungho/myCodes
Algorithm_Study/큐_ITES.cpp
#include <iostream> #include <algorithm> #include <queue> using namespace std; struct Rand { unsigned value; Rand() : value(1983) {} unsigned next() { unsigned ret = value; value = (value * 214013u) + 2531011u; return ret % 10000 + 1; } }; int func(int K, int N) { Rand Generator; queue<int> arr; int ret ...
ALGO
0.999819
4.268785
55516f97-49d5-4989-9f39-c737fefa7f76
namhai0510/C--
C--/purple02C.cpp
#include<bits/stdc++.h> using namespace std; #define nothing ios_base::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL); #define endl "\n"; #define ll long long #define ull unsigned long long #define fi first #define se second #define pb push_back const ll oo = 1e13; const ll modd = 1e9 + 7; const ll maxn = 1e6 + 2; ...
ALGO
0.999964
4.528178
eb3038a1-a7f2-49fc-aec0-6b5abca62286
Neuronsmatrix/workspace
codeForce problem set/2p=DP/computer_game.cpp
#include <bits\stdc++.h> using namespace std; using ll = long long; using ull = unsigned long long; using ld = long double; constexpr int INF = INT_MAX-1; constexpr ll LINF = LLONG_MAX-1; constexpr char nl = '\n'; #define pb push_back #define F first #define S second #define pii pair<int,int> #define tiii tuple<int,...
ALGO
0.999904
5.615883
cefa079c-69da-4835-baad-21f71f7d3f69
ishandutta2007/codeforces
compute/normal/1250/H.cpp
#include<bits/stdc++.h> using namespace std; #ifndef ONLINE_JUDGE #define dbg(x...) do{cout << "\033[32;1m" << #x << "->" ; err(x);} while(0) void err(){cout << "\033[39;0m" << endl;} template<template<typename...> class T,typename t,typename... A> void err(T<t> a,A... x){for (auto v:a) cout << v << ' '; err(x...);} te...
ALGO
0.999992
4.546922
1ee9b005-42ba-4d3b-9bd6-2f45be878231
andrewrozenblit/CS15
lab05/maze.cpp
/* * maze.cpp * * Comp 15 Lab 4 * Originally created by Chris Gregg (Feb 2014) based on maze creater at * http://azerdark.wordpress.com/2009/03/29/588/ * Edited and updated by: * Eliza Schreibman and Mark A. Sheldon (Feb 2017) * Tonya Sinha and Matias Korman (Feb 2019) * ...
ALGO
0.997289
6.621597
b596c28e-79f2-4c6c-83a1-7cde12242d1d
Pranit5895/LeetCode
26. Remove-Duplicates-from-sorted-arrays.cpp
//Runtime: 160 ms, faster than 16.92% of C++ online submissions for Remove Duplicates from Sorted Array. //Memory Usage: 10 MB, less than 99.23% of C++ online submissions for Remove Duplicates from Sorted Array. class Solution { public: int removeDuplicates(vector<int> &nums) { if (nums.size() == 0) ...
ALGO
0.99991
6.505765
8bcca77a-702b-45f8-a9c3-d23b253e452a
525jw/BOJ
2024_05/1208/1208TLE.cpp
#include <iostream> #include <vector> #include <algorithm> #include <set> using namespace std; int n,W; //- indicates whether the ith element is included vector<bool> include; vector<int> w; vector<int> il,ir; int mid; int cnt; void sum_of_subsets(int i,int weight,bool left){ if(i<(left?mid-1:n)){ include[...
ALGO
0.999956
3.997302
b9f71f4e-689e-4372-b464-c4cf958491b0
Li-enguang/Cpp-project
银行家算法/银行家算法/main.cpp
#define _CRT_SECURE_NO_WARNINGS 1 #include<iostream> using namespace std; int n, m; //ϵͳнnԴm int Available[100]; //Դ int Max[100][100]; // int Allocation[100][100] = { 0 }; //ǰÿ̵ĸԴ int Need[100][100];//ǰÿ̻ĸԴ int Work[100]; //ǰɷԴ bool Finish[100]; //Ƿ //ʾ void show_function() { cout << "\n\n* ѡ *" << ...
ALGO
0.999774
3.394779
078903ef-7765-424e-9bb4-ea13d7f59797
ketan-suthar/Competitve_Programming
HackerRank/Algorithms/Greedy/Sherlock and The Beast/SherlockandTheBeast.cpp
int getPivot(int n) { while(n > 0) { if(n%3 == 0) break; else n -= 5; } return n; } void decentNumber(int n) { int pivot = getPivot(n); if(pivot < 0) cout << "-1" << endl; else { int repeat = pivot/3; while(repeat--) ...
ALGO
0.999948
4.283689
625fc731-bc7b-40ee-92b1-5e78ede8b2b0
phiysng/leetcode
leetcode/cpp/75.sort-colors.cpp
#include "oj_header.h" class Solution { public: void sortColors(vector<int>& nums) { // 两个指针分别指向 0 || 2 当前的边界 int zero = -1; //左边及 zero 都是0 int two = nums.size(); //右边及two都是2 int one = 0; while (one < two) { if (nums[one] == 0) { // 左边是00011这...
ALGO
0.999938
5.756293
10cd91e5-49c1-4f9e-b8b6-426a8085f599
ShubhamRaj98/clearbnb
node-v14.17.6/deps/icu-small/source/tools/toolutil/uparse.cpp
#include "unicode/utypes.h" #include "unicode/uchar.h" #include "unicode/ustring.h" #include "unicode/utf16.h" #include "cstring.h" #include "filestrm.h" #include "uparse.h" #include "ustr_imp.h" #include <stdio.h> U_CAPI const char * U_EXPORT2 u_skipWhitespace(const char *s) { while(U_IS_INV_WHITESPACE(*s)) { ...
TOOL
0.966116
6.184056
124e3f85-5739-4665-8319-89ba3f50021a
JaphethLin/nifH_palmscan
src/slcu.cpp
#include "myutils.h" #include "pssm.h" #include "sfasta.h" #include "pssmsearch.h" #include "sort.h" #include <set> // Input is output from assignv: Query TargetV PctId // CDR3 sequence is in label. // readid=HV2697C05FUMVM;spec=113;stage=Acute;repl=A;cdr3=AKFGYSSTWFTQGLDV; IGHV1-69 89.5 unsigned SLCSet(co...
ALGO
0.985531
4.347249
88e8ee8d-db5a-4adb-b5be-e4140bd7e208
vapurv843/leet-code
Amazon_interview_practice/add_two_linkedlist.cpp
#include <bits/stdc++.h> using namespace std; /* Linked list Node */ class Node { public: int data; Node* next; Node(int x) { data = x; next = NULL; } }; Node* buildList(int size) { int val; cin>> val; Node* head = new Node(val); Node* tail = head; fo...
ALGO
0.999882
4.051022
65812e14-0a5e-44df-a85a-53634889f2fa
raulreal/Qgis_TST
src/analysis/raster/qgsslopefilter.cpp
#include "qgsslopefilter.h" QgsSlopeFilter::QgsSlopeFilter( const QString& inputFile, const QString& outputFile, const QString& outputFormat ) : QgsDerivativeFilter( inputFile, outputFile, outputFormat ) { } QgsSlopeFilter::~QgsSlopeFilter() { } float QgsSlopeFilter::processNineCellWindow( float* x11, float* x...
TOOL
0.886479
5.904174
1e67134b-254b-49c0-8c12-a9a4d83c81e5
qpwoeirut/competitive-programming
USACO/practice/GoldMarathon/Dec2015/cardgame.cpp
//cardgame.cpp created at 11/12/20 16:45:16 #include <bits/stdc++.h> using namespace std; const int MN = 50005; int N; set<int> low, high, bessie; int main() { freopen("cardgame.in", "r", stdin); freopen("cardgame.out", "w", stdout); cin.tie(0)->sync_with_stdio(0); cin >> N; for (int i=1; i<=...
ALGO
0.999756
3.828957
581066bd-f193-4131-bab3-f2a97c0ba777
steven2985/COP3014-Foundations-of-Computer-Science
Programming Assignment #4/all_area_semi/all_area_semi/all_area_semi.cpp
/* Steven Fernandez Total Points: 10 Due Date: 06/23/20 Course: C0P3014 Assignment: Programming Assignment 4 Professor: Dr. Lofton Bullard Description: Program that computes the area of an arbitraty triangle, if sides of triangle are not valid display invalid message ...
ALGO
0.993805
4.89953
66a6e665-4c83-48f8-bed3-f310a3c0bf30
komalkumari12/leetCode-submissions
24-swap-nodes-in-pairs/24-swap-nodes-in-pairs.cpp
class Solution { public: ListNode* swapPairs(ListNode* head) { if(!head || !head->next) return head ; ListNode* ptr =new ListNode(0) ; ListNode* prev=ptr ,*curr=head ; while(curr && curr->next){ ListNode* next ,*nextPair ; next= curr->next ; ...
ALGO
0.999997
5.874827
ff775f39-088e-4de3-9875-18385bfdd8df
HAL9K000/PercolationModels
analysis/Mass Action/DP/22Apret/Apres 256+512/512/7/MultiTransformersDP.cpp
#include "cluster_dynamics.h" int main() { auto start = high_resolution_clock::now(); // Auto variable deduces type of variable by itself. increase_stack_limit(1024); int grid_size; //float birth_probability; //int r_init; int how_many; //int lag; //int number_of_census; int divisions; int t_to_eq; /*...
ALGO
0.999772
3.826926
d15e7d88-b5c2-487d-91cf-9a9bcc7a3433
AhJo53589/leetcode-cn
problems/where-will-the-ball-fall/SOLUTION.cpp
////////////////////////////////////////////////////////////////////////// class Solution { public: vector<int> findBall(vector<vector<int>>& grid) { vector<int> ans(grid[0].size()); for (int i = 0; i < ans.size(); i++) { ans[i] = dfs(grid, 0, i); } return ans; } ...
ALGO
0.999953
5.645997
07fac9a5-5f17-4414-8929-8c0050e355e2
morrischen890717/Leetcode
C++/1399.cpp
class Solution { public: int countDigits(int num){ int res = 0; while(num){ res += num % 10; num /= 10; } return res; } int countLargestGroup(int n) { int size = 0, cnt = 0; unordered_map<int, int> m; for(int i = 1; i <= n; i++)...
ALGO
0.999895
6.55728
b112569b-4a8f-496b-b934-d506284841e8
thegamer1907/Code_Analysis
Codes/AC/471.cpp
#include <bits/stdc++.h> #define int long long using namespace std; vector<int> vals; int32_t main() { ios::sync_with_stdio(0), cin.tie(0); for(int i = 0; vals.size() < 1e4; i++) { int aux = i, sum = 0; while(aux) { sum += aux % 10; aux /= 10; } if(sum == 10) { vals.push_back(i); } ...
ALGO
0.999651
4.308568
d400b4d3-e496-401e-905b-b69a0eb9753b
ebbll/BOJ
cpp/13023.cpp
#include <iostream> #include <vector> int N, M; int v1, v2; std::vector<int> graph[2001]; int visited[2001]; bool res; void dfs(int start, int depth) { if (depth == 5) { res = true; return; } for (size_t i = 0; i < graph[start].size(); ++i) { int next = graph[start][i]; if (visited[next]) continue; v...
ALGO
0.999809
5.167344
67726434-0128-4fae-b667-75b58d3a70a0
22jinwoO/CodingTest
프로그래머스/0/181865. 간단한 식 계산하기/간단한 식 계산하기.cpp
#include <bits/stdc++.h> using namespace std; int solution(string binomial) { int answer = 0; string a,b = ""; int bStartIndex = 0; for(int i = 0; i < binomial.size(); i++) { if(binomial[i] == '+' || binomial[i] == '-' || binomial[i] == '*') { bStartIndex =...
ALGO
0.999897
4.394596
6aabc1f8-b9c6-425a-aa31-d334c8a0a90a
karadalex/opengl-skin-simulation
project/Particle.cpp
#include "Particle.h" #include <glm/gtc/matrix_transform.hpp> #include <common/model.h> #include <iostream> using namespace glm; using namespace std; Particle::Particle(vec3 pos, vec3 vel, float mass, float length, vec3 anchor, float stiffness, float damping, float restLength) { x = pos; v = vel; ...
ALGO
0.884946
5.204557
18ca5208-d3d9-4a64-a2cf-ca8e3c50d8a1
sarvex/leetcode-q-sharp
solution/1800-1899/1837.Sum of Digits in Base K/Solution.cpp
class Solution { public: int sumBase(int n, int k) { int ans = 0; while (n) { ans += n % k; n /= k; } return ans; } };
ALGO
0.999928
5.474509