uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
9662eddf-3a95-40ad-a3f2-eec023e6b026
kudotoan/PTIT-CPP
CPP0518.cpp
#include <iostream> #include <sstream> #include <algorithm> using namespace std; static int d=1; struct date { int day,month,year; }; struct NhanVien { string ma, name, sex, address, MSthue; date NS, NgayHD; }; istream& operator>>(istream& in, date &a) { string tmp; in >> tmp; stringstream ss(t...
ALGO
0.955754
3.629436
c490b93b-efbf-49ec-84b5-a755f3760f1d
Vaibhav0810/leethub
0621-task-scheduler/0621-task-scheduler.cpp
class Solution { public: int leastInterval(vector<char>& tasks, int n) { priority_queue<int>pq; unordered_map<char,int>mp; for(auto it:tasks){ mp[it]++; } for(auto it:mp){ pq.push(it.second); } int time=0; whi...
ALGO
0.999977
6.492321
991d09fe-1707-4b6a-ac42-79abe724153c
SeifeddineTalks/Codewars_Sol
kyu 8/Square(n) Sum.cpp
#include <iostream> #include <vector> using namespace std; int square_sum(const vector<int>& numbers){ int result=0; for (int i=0; i<numbers.size(); i++){ result+=numbers[i] * numbers[i]; } return result; } int main(){ cout << square_sum({}); return 0; }
ALGO
0.856914
4.053728
75a83dbc-47d7-4893-bab5-2494c93cc87e
ishandutta2007/codeforces
turmax/normal/1439/B.cpp
#include <bits/stdc++.h> using namespace std; #define int long long vector <int> d; int m; bool check(vector <int> z) { if(z.size()*(z.size()-1)>=(2*m+10)) { return false; } for(int i=0;i<z.size();++i) { for(int j=0;j<i;++j) { int o=z[i]*1e9+z[j]; if(...
ALGO
0.999977
3.99754
f20258ec-971b-4b04-ba02-d5411263ea90
Maheen-S/Chess-Game-OOP
Queen.cpp
#include "Queen.h" void Queen::valid_move(Piece*** const board, int** p_array, int p_moves) { if (valid_move_array != NULL) { for (int i = 0; i < v_moves; i++) { delete[] valid_move_array[i]; } delete[] valid_move_array; } v_moves = 0; //up for (int i = y_position + 1; i < 8; i++) { if (board[x_p...
ALGO
0.961208
3.094158
6aaf5be6-c5e6-4f00-8235-6ed1e60fa7b4
chnlmshr/cppdsa
recursion/butcketsAndTanks.cpp
#include <bits/stdc++.h> using namespace std; void solve(vector<int> a, vector<int> b, int m, int n, int A, int B, int days, unordered_map<int, bool> &hash) { if(days) { if(days & 1) { for(int i = 0; i < m; i++) { vector<int> at(a.begin(), a.end()), bt(b.begin(), b.end()); at.erase(at.begi...
ALGO
0.999955
3.434106
e52536e8-21fd-4fa5-b9fe-8146b668f484
KochevDmitry/da
kp/generator_tests.cpp
#include <iostream> #include <fstream> #include <vector> #include <random> #include <set> #include <algorithm> int sum_point = 0; int sum_another_point = 0; struct Point { int x, y; // Оператор < для сравнения точек bool operator<(const Point& other) const { return x < other.x || (x == other.x &&...
TEST
0.91669
6.174198
d017ee19-a510-44d7-a063-fdabd818d227
markandzuo/-sorting-algorithms
main.cpp
#include <iostream> #include <fstream> #include <chrono> #include <cstdlib> #include <algorithm> #include <time.h> using namespace std; void selectionSort(int arr[], int n) { int i, j, min_idx; // One by one move boundary of unsorted subarray for (i = 0; i < n-1; i++) { // Find the minimum el...
ALGO
0.99961
4.915631
b9b6d0bb-1bda-473f-9870-062abce9cbd3
rogerkj/master
mpimain.cpp
#include "setup.h" #include "mcintegrator.h" #include "Minimizer.h" #include <iostream> #include <mpi.h> using namespace std; int main (int argc, char* argv[]) { double R = 2.282; double alpha = CHARGE; double beta = 0.3; double delta_alpha = 0.1; double delta_beta = 0.03; int my_rank,num_procs; ...
ALGO
0.998701
3.247695
fd89e1df-525d-4c95-b5d6-957dd8dedb2e
fetch150zy/algorithm
leetcode/tree/144.二叉树的前序遍历.cpp
/* * @lc app=leetcode.cn id=144 lang=cpp * * [144] 二叉树的前序遍历 * * https://leetcode.cn/problems/binary-tree-preorder-traversal/description/ * * algorithms * Easy (71.26%) * Likes: 1081 * Dislikes: 0 * Total Accepted: 876.6K * Total Submissions: 1.2M * Testcase Example: '[1,null,2,3]' * * 给你二叉树的根节点 ro...
ALGO
0.999951
7.004284
7a67f980-3415-4f65-87c5-a8ff7d9808c2
heechan3006/CS
BOJ/BOJ_2110/BOJ_2110/소스.cpp
#define _CRT_SECURE_NO_WARNINGS #include <iostream> #include <vector> #include <algorithm> #define MAX_N 200001 using namespace std; int N, C; vector<int> house; bool possible(long long dist) { int cnt = 1; int prev = house[0]; for (int i = 0; i < house.size(); i++) { if (house[i] - prev >= dist) { cnt++; ...
ALGO
0.999997
4.198468
51ed4b06-f808-4e7d-87c5-b7633a09363c
MueezKhalid/Func-string-file-PSL-Student-Management-system
t2_sum_array.cpp
#include<iostream> using namespace std; int sum(int array2[5]){ int array_element_sum = 0; for(int i=0 ; i<5 ; i++){ array_element_sum+=array2[i]; } return array_element_sum; } int main (){ int array2[5] , array_sum; for(int i=0 ; i<5 ; i++){ cout<<"ENTER "<<i+1<<" NUMBER OS E...
ALGO
0.996626
3.757164
9c48b09f-8445-4c4d-bfe6-07aa4f63aade
10renu/classworkass
test6.cpp
#include <iostream> using namespace std; int main() { string cars[5] = { "volvo", "toyota", "ford", "tesla", "honda" }; int n = sizeof(cars) / sizeof(string); for (int i = 0; i < n; i++) { cout << cars[i] << "\n"; } return 0; }
ALGO
0.86743
4.06194
c8189da5-ac59-4c39-a3c5-9b4f43840f9c
Proeli0Coin/Source-Wallet
scr/merkleblock.cpp
#include "merkleblock.h" #include "hash.h" #include "primitives/block.h" // for MAX_BLOCK_SIZE #include "utilstrencodings.h" using namespace std; CMerkleBlock::CMerkleBlock(const CBlock& block, CBloomFilter& filter) { header = block.GetBlockHeader(); vector<bool> vMatch; vector<uint256> vHashes; vM...
ALGO
0.998254
5.928164
f78a2b9d-1a61-4d92-9739-662c5077c1e7
StoneColdJutsu3/DSA-Lab
quicksort.cpp
#include<bits/stdc++.h> using namespace std; int partition(int *arr,int start,int end){ int pivot=arr[start]; int i=start; int j=end; do{ do{ i++; }while( i<=end &&arr[i]<=pivot); do{ j--; }while(j>=start && arr[j]>=pivot); if(i<j){ swap(arr[i],arr[j]); } }while(i<j); swap(arr[sta...
ALGO
0.999896
4.870944
89ce1df1-91bb-4734-bab2-605e93b07fff
Isoo-Pal/DSA_with_C-
gcd.cpp
#include<iostream> using namespace std; int EuclidsAlgoUsingSubtraction(int n1, int n2){ while(n1>0 && n2>0){ if(n1>n2){ n1 = n1-n2; } else{ n2=n2-n1; } } if(n1==0) return n2; return n1; } int EuclidsAlgoUsingdivision(int n1, int n2){ ...
ALGO
0.99986
4.393049
b9854529-3c26-40e2-b781-6026b812acf9
LaoZZZZZ/bartender-1.1
src/simulation_test.cpp
#include "clusterpipeline.h" #include "clusteralgorithm.h" #include "clusteroutput.h" #include "csvreader.h" #include "barcodeeditor.hpp" #include "errorrateestimator.h" #include "formats.h" #include "inputprocessor.hpp" #include "rawbarcodeprocessor.hpp" #include "countbarcodeprocessor.hpp" #include "mergebycenters.h...
ALGO
0.987327
4.998917
48433e9a-4a23-4365-b7f1-0b31679eb932
Abrahul-107/DSA_CHALLENGE
SlidingWindow/04_longestSubarraySumWithK.cpp
//https://www.geeksforgeeks.org/problems/longest-sub-array-with-sum-k0809/1 #include<iostream> using namespace std; int longestSubarrayWithSumK(vector<int>arr,int k) { } int main() { int n;cin>>n;vector<int>arr; for(int i=0;i<n;i++) { int x; cin>>x; arr.push_back(x); } int k;cin>...
ALGO
0.999824
4.789199
b836cd01-6b35-4fd9-8c94-33c00edb0438
prachi214/CrackYourPlacement
Greedy/insertDeleteGetRandomO(1).cpp
class RandomizedCollection { vector<int> v; unordered_map<int, unordered_set<int>> mpp; public: RandomizedCollection() { } bool insert(int val) { v.push_back(val); int index = v.size() - 1; mpp[val].insert(index); return mpp[val].size() == 1; } bool re...
ALGO
0.996074
5.631042
39daa6dd-da46-4725-9d8d-03f04acf93f9
semenInRussia/cf
gym/geom/o.cpp
// semenInRussia 2024 #include <cassert> #include <cmath> #include <complex> #include <cstdio> #include <iomanip> #include <iostream> using namespace std; using C = double; using P = complex<C>; istream &operator>>(istream &in, P &v) { C x, y; in >> x >> y; v = {x, y}; return in; } #define X real() #define Y...
ALGO
0.999558
3.588905
08f19b0f-2cc5-4787-a2f5-45101d39f3f8
rahulaunni/toddy
src/MovingAverageFilter.cpp
#include "MovingAverageFilter.h" MovingAverageFilter::MovingAverageFilter(unsigned int newDataPointsCount) { k = 0; //initialize so that we start to write at index 0 out = 0;//initialize first output to zero if (newDataPointsCount < MAX_DATA_POINTS) dataPointsCount = newDataPointsCount; else dataPointsCo...
ALGO
0.943609
4.873658
9a204e55-3084-4b35-855c-b2e8674132f2
vrnanshuman/Leetcode
1614-maximum-nesting-depth-of-the-parentheses/1614-maximum-nesting-depth-of-the-parentheses.cpp
class Solution { public: int maxDepth(string s) { int maxdepth = 0; int currentDepth = 0; for(int i=0;i<s.size();i++) { if(s[i] == '('){ currentDepth += 1; maxdepth = max(maxdepth, currentDepth); } else if(s[i] == ')') { ...
ALGO
0.999337
5.534165
9eac5267-6cdc-4679-a6b1-b800f349d600
vidhsss/Data-stractures-and-algorithms
ARRAYS/heaps/nearest_hostel.cpp
#include<iostream> #include<queue> using namespace std; int main() { priority_queue<int,vector<int>,greater<int> > pq; int q,k; cin>>q>>k; int m,x,y; vector<int> v; for(int i=0;i<q;i++) { cin>>m; if(m==1) { cin>>x; cin>>y; pq.push(x*x + y*y); } else if( m==2) { for(int j=0;j<k-1;j...
ALGO
0.9998
3.278032
861c3bb1-3d48-4751-9475-3a2c8508b52e
swapnilsparsh/devsVPN
daemon/References/Windows/Native Projects/privateLINE Split Tunnel Driver/others/SplitTunTestConsole/main.cpp
#include <iostream> #include "../common/SplitTunDrvControl/privatelineSplitTunDrvControl.h" void Log(std::wstring logMes) { // ensure the string ends with a new line if (!logMes.empty() && logMes[logMes.length() - 1] != '\n') { logMes += L"\n"; } wprintf(L" [log]: %s", logMes.c_str()); } void doStartDriver...
TOOL
0.929385
5.146722
167b8458-46c5-4e58-a8f6-8415efb218ec
borojac/problem-solving
ProjectEuler/__prob0078.cpp
#include <bits/stdc++.h> using namespace std; long long cnt; long long countt(long long x, long long parts) { long long im = 1; for (int i = 1; i <= x + parts - 1; i++) im *= i; long long br1 = 1; long long br2 = 1; for (int i = 1; i <= parts - 1; i++) br1 *= i; for (int i = 1...
ALGO
0.999842
4.157722
78a38000-20d7-4019-9fca-886fb31c55eb
isolent/ADS
midterm/H.cpp
#include <bits/stdc++.h> using namespace std; struct Heap{ int a[1000087]; int size; Heap(){ size = 0; } int parent(int i){ return (i - 1)/2; } int left(int i){ return 2 * i + 1; } int right(int i){ return 2 * i + 2; } void shift_up...
ALGO
0.999932
4.221076
944ee414-8825-4caf-8dab-b10ff83d33cb
K0nnyaku/Code
Training/ZROI_21.8/Day3/LG1350.cpp
#include<cstdio> #include<algorithm> using namespace std; const int MAXN = 2e3 + 10; const int P = 1e5 + 3; int A[MAXN][MAXN]; int a, b, c, d, k; int main() { scanf("%d%d%d%d%d", &a, &b, &c, &d, &k); for(int i = 1; i <= d + b; i++) A[i][0] = 1; A[0][0] = 1; for(int i = 1; i <= c; i++) { for(int j = 0; j <= k;...
ALGO
0.999925
3.874907
f327ab1c-7e3a-4818-8445-69fd74d8d3ab
fiefaneves/Data-Structures-and-Algorithms
Data-Structures-and-Algorithms/listas/lista 5/topologicalsort.cpp
#include <bits/stdc++.h> #define endl '\n' using namespace std; struct Graph{ vector<vector<pair<int, int> > > list; int numEdge; int numVert; vector<int> indegree; Graph(int n){ numVert = n; numEdge = 0; list.resize(n); indegree.resize(n, 0); } }; int n(Graph...
ALGO
0.999997
4.74632
201ff9cc-c90b-4ca2-a0b9-02fcb1167a34
Yaro2709/AlgoProblems
17/1207B.cpp
#include<iostream> using namespace std; int a[1000][1000]; int ans[3000][10]; int main() { int m, n, k; cin >> n >> m; for (int i = 1; i <= n; i++) for (int j = 1; j <= m; j++) cin >> a[i][j]; for (int i = 1; i <= n + 1; i++) for (int j = 1; j <= m + 1; j++) { if (abs(a[i][j])) if (abs(a[i - 1][j...
ALGO
0.999942
3.191132
0e8b08a0-8bfc-47c6-b7ec-8eba0948bf29
Ankuryadav0001/OS-Lab-File
OS-Lab-File/LRU.cpp
#include <iostream> #include <unordered_map> #include <list> using namespace std; class LRUCache { public: LRUCache(int capacity) : _capacity(capacity) {} int get(int key) { auto it = _cache.find(key); if (it == _cache.end()) return -1; // Move accessed page to the front of the list ...
ALGO
0.999884
7.105599
56548bfe-0937-42c8-9d01-6408e33fb79b
leonardoAnjos16/Competitive-Programming
Codeforces/tit_for_tat.cpp
#include <bits/stdc++.h> using namespace std; #define long long long int #define pii pair<int, int> #define pll pair<long, long> #define fst first #define snd second #define all(ds) (ds).begin(), (ds).end() #define size(ds) (int) (ds).size() #define pq priority_queue #define vi vector<int> #define pb push_back #de...
ALGO
0.999966
3.382046
498eb7f1-e01c-4145-9ca9-2f8561b56180
jjy0918/Algorithm
Algorithm 문제/boj/boj_12015.cpp
#include <bits/stdc++.h> #include <unordered_map> using namespace std; int numbers[1000001]; vector<int> bb; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int N; cin >> N; int a; int maxLength = 0; int index = 0; for (int i = 0; i < N; i++) { cin >> a; numbers[i] =...
ALGO
0.999847
4.36086
d9b79da8-15cb-42a4-9a6a-8968e0e10624
ttamx/Competitive-Programming
codeforces/1793D.cpp
#include<bits/stdc++.h> using namespace std; void runcase(){ long long n; cin >> n; vector<long long> l(n+1),r(n+1); for(long long i=1;i<=n;i++){ long long x; cin >> x; l[x]=i; } for(long long i=1;i<=n;i++){ long long x; cin >> x; r[x]=i; } ...
ALGO
0.999916
3.781297
b5e70163-cf2c-4f8c-80f4-c111ab70ec0a
kirori-1/c_code_test_repo
practical_exercises/key_exercises/类模板之栈.cpp
#include<iostream> using namespace std; template<typename T,int MAXSIZE> class Stack{ public: Stack(){} void init(){ top=-1; } bool isFull(){ if(top>=MAXSIZE-1) return true; else return false; } bo...
ALGO
0.995335
4.135668
8ebcd214-66cd-4abf-83ca-56429c841cf7
illusionarydream/I_render
eigen-3.4.0/doc/examples/TutorialLinAlgInverseDeterminant.cpp
#include <iostream> #include <Eigen/Dense> using namespace std; using namespace Eigen; int main() { Matrix3f A; A << 1, 2, 1, 2, 1, 0, -1, 1, 2; cout << "Here is the matrix A:\n" << A << endl; cout << "The determinant of A is " << A.determinant() << endl; cout << "The inverse of A is:\n...
ALGO
0.99965
4.186114
d3450c99-df06-4d0d-a2e1-b595883d0fc6
khs960616/Algorithm
boj1647.cpp
#include <bits/stdc++.h> #define MAX_SIZE 100000 using namespace std; /* https://www.acmicpc.net/problem/1647 도시분할계획 --- 1. 최소 스패닝 트리를 구한다. 2. 최소 스패닝 트리를 구성하는 edge중 cost가 가장 작은 것을 제외한다. 크루스칼 알고리즘 사용 */ int n, m; int sub_set[MAX_SIZE]; int get_root(int node) { if (sub_set[node] == node) return node; r...
ALGO
0.99997
4.601563
4fb6f040-3202-4849-a1a3-d74e04dde3ca
IIIIIIIIIU/TXT
20171016/vijos1000.cpp
#include <cstdio> #include <cstring> #include <iostream> #include <algorithm> int main() { int a,b; std::cin>>a>>b; std::cout<<a+b; return 0; }
ALGO
0.980366
3.066293
49eaf787-14ed-4e5f-819d-e01c51215241
201311113/BaekjoonCode
구현/농구경기_1159.cpp
#define _CRT_SECURE_NO_WARNINGS #include<iostream> #include<cstring> #include<string> #include<cstdio> #include<stack> #include<algorithm> #include<cmath> #include<vector> #include<queue> #include<ctime> #include<set> #include<sstream> using namespace std; int arr[26]; int n; int main() { cin >> n; for (int i = 0; i ...
ALGO
0.999876
3.951455
4e1cd12a-dfce-4e5a-93b6-83b2a6237c98
coolyuyuyu/leetcode
algorithm_2000-2999/2353-Design a Food Rating System/main.cpp
class FoodRatings { public: FoodRatings(vector<string>& foods, vector<string>& cuisines, vector<int>& ratings) { for (int i = 0, n = foods.size(); i < n; ++i) { m_food2cuisine[foods[i]] = cuisines[i]; m_food2rating[foods[i]] = ratings[i]; m_cuisine2foods[cuisines[i]].empl...
ALGO
0.999911
6.184994
f54087fa-2959-4b58-95a3-51fd853245d9
codeshuttler/CodeGenCangjie
data/transcoder_evaluation_gfg/cpp/FIND_SUM_NON_REPEATING_DISTINCT_ELEMENTS_ARRAY.cpp
#include <iostream> #include <cstdlib> #include <string> #include <vector> #include <fstream> #include <iomanip> #include <bits/stdc++.h> using namespace std; int f_gold ( int arr [ ], int n ) { int sum = 0; unordered_set < int > s; for ( int i = 0; i < n; i ++ ) { if ( s . find ( arr [ i ] ) == s . end (...
ALGO
0.998975
5.302763
0a402c73-347b-4b87-b9e1-b07d794f1b2d
ay8s/CineMoco
CineMocoUpdate/hardware/CineMoco/cores/arduino/USBCore.cpp
#include "Platform.h" #include "USBAPI.h" #include "USBDesc.h" #if defined(USBCON) #define EP_TYPE_CONTROL 0x00 #define EP_TYPE_BULK_IN 0x81 #define EP_TYPE_BULK_OUT 0x80 #define EP_TYPE_INTERRUPT_IN 0xC1 #define EP_TYPE_INTERRUPT_OUT 0xC0 #define EP_TYPE_ISOCHRONOUS_IN 0x41 #define EP_TYPE_ISOCHRONOUS_OUT...
TOOL
0.889657
6.059622
9ed61ad9-c7ac-444b-abf7-13546eda98d5
MateuszKwiat/codeWars
cpp/7kyu/FindTheStrayNumber.cpp
#include <algorithm> int stray(std::vector<int> numbers) { std::sort(numbers.begin(), numbers.end()); return numbers[0] != numbers[numbers.size()/2] ? numbers[0] : numbers[numbers.size() -1]; };
ALGO
0.99433
5.243876
9c9c8708-39fa-4293-bae7-81eca647a248
YogeshSawant0422/Data_Structure
Program227.cpp
#include<iostream> using namespace std; template <typename T> struct node { T data; struct node *next; }; template <class T> class SinglyLL { private: node<T>* first; int size; public: SinglyLL(); void InsertFirst(T); void InsertLast(T); void InsertAtPos(T ,int); void DeleteFirst(...
ALGO
0.998084
4.215075
2b712bc5-656d-4522-9a24-c82acbd2bb9c
muneeb203/object-oriented-programming
insert remove search func.cpp
#include <iostream> using namespace std; class Container { private: int* values; int capacity; int counter; public: Container(int c) { capacity = c; values = new int[capacity]; counter = 0; } bool isFull() { return counter == capacity; } void...
ALGO
0.987968
5.309619
a944d57c-322f-485c-8079-d2d2c8a5e17c
ArsenyPogosov/olympiad_programs
cses.fi/Necessary Roads.cpp
#include <bits/stdc++.h> #include <unordered_map> using namespace std; int n, m; vector<vector<int>> graph; int t = 0; vector<int> tin; void dfstin(int v) { if (tin[v] != -1) return; tin[v] = t++; for (auto& i : graph[v]) dfstin(i); } vector<int> tup; vector<pair<int, int>> res; void dfstup(int v, int p = -1) ...
ALGO
0.999955
4.5958
5cabd8a7-3d2c-43df-94e4-55991f93efd1
Th0masAndy/KKRT16
thirdparty/win/miracl/miracl_osmt/source/curve/poly2xy.cpp
/* * C++ class to implement a bivariate polynomial type and to allow * arithmetic on such polynomials whose coefficients are from * the finite field of characteristic 2 * * WARNING: This class has been cobbled together for a specific use with * the MIRACL library. It is not complete, and may not work in other ...
ALGO
0.991207
4.477162
daef41b4-6aa5-4df0-a7d4-5c6ef7f45952
AmarjeetJyotis/GeeksForGeeks-
Difficulty: Hard/Articulation Point - II/articulation-point-ii.cpp
//{ Driver Code Starts #include <bits/stdc++.h> using namespace std; // } Driver Code Ends class Solution { public: vector<int> articulationPoints(int V, vector<vector<int>>& edges) { vector<vector<int>> adj(V); for (auto& e : edges) { adj[e[0]].push_back(e[1]); adj[e[1]]...
ALGO
0.999895
6.347166
6796efbb-096e-4563-a058-ad9780d56f02
amitkrjha-geek/leetcode
538-convert-bst-to-greater-tree/538-convert-bst-to-greater-tree.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.999977
6.548006
40c4a769-d896-42ae-ac76-595176eee8dd
dagil02/PCOM
UVa 10980/UVa 10980/Source.cpp
#include <iostream> #include <iomanip> #include <fstream> #include <vector> #include <algorithm> #include <string> #include <sstream> using namespace std; typedef pair <int, double> venta; bool resuelveCaso(int numCase) { // leer los datos de la entrada int n; double precioUni; cin >> precioUni >> n; if (!ci...
ALGO
0.972139
4.425292
18e2afe0-ac33-4d16-85a2-baf8bc3bcafb
ishandutta2007/codeforces
tadijasebez/normal/5/C.cpp
#include <stdio.h> #include <cstring> const int N=1000500; int S[N],L[N],t,sol,cnt=1; char x[N]; int main() { scanf("%s",&x); int n=strlen(x); for(int i=0;i<n;i++) { if(x[i]=='(') S[++t]=i; else if(t) { L[i]=i-S[t]+1+L[S[t--]-1]; if(L[i]==sol) cnt++; if(L[i]>sol) sol=L[i],cnt=1; } } printf("%i %i...
ALGO
0.999368
3.590381
02942adb-5d68-48be-b682-36b440ac6189
pkk007/Dynamic-Programing
target_sum.cpp
#include<bits/stdc++.h> using namespace std; //this problem is same as count subset with given difference int countSos(int s[], int t, int n){ //create a dp matrix int dp[n+1][t+1]; //intialize for(int j=0; j<=t; j++) dp[0][j] = 0; for(int i=0; i<=n; i++) dp[i][0] = 1; //...
ALGO
0.999844
4.17652
d246b24a-235e-4d1c-99c9-d72e19092d8d
Hritik003/cpp-problems
Leetcode 9 Palidrome.cpp
class Solution { public: bool isPalindrome(long int x) { long int num=x; long int rem,val=0; while(num>0){ rem = num%10; val = val*10 + rem; num = num/10; } if(x==val) return true; else return false; } }...
ALGO
0.999706
5.400732
4f83e4f7-ef4c-4e6a-b2bd-af85b862db4e
zerowinter0/AI-assignment
project1/2-2.cpp
#include<bits/stdc++.h> #define int long long using namespace std; vector<string> next_States(string x){ vector<string> v; for(int i=0;i<=8;i++){ if(x[i]=='x'){ if(i>=3){ swap(x[i],x[i-3]); v.push_back(x); swap(x[i],x[i-3]); } ...
ALGO
0.99995
4.132915
c95d68bb-6758-4137-b001-3b2acce76495
operator08/LeetCode
941-sort-array-by-parity/sort-array-by-parity.cpp
class Solution { public: vector<int> sortArrayByParity(vector<int>& nums) { int n = nums.size(); int j = 0; for (int i = 0; i < n; i++) { if (nums[i] % 2 == 0) { swap(nums[i], nums[j++]); } } return nums; } };
ALGO
0.999986
5.77897
4510479f-f433-455d-87c0-73128219919c
Rahman-Mofizur/CPP-Codes
CPP Codes/Function.cpp
#include <iostream> using namespace std; void addition(int a, int b, int c) { int sum; sum = a + b + c; cout << "The Summation of 2 numbers= " << sum << endl; } void multiplication(int x, int y) { int mul; mul = x * y; cout << "Multiplication of " << x << " and " << y << " is= " << mul << endl...
TOOL
0.966766
4.075557
0495d320-290b-404f-a4b0-cbd0fe9c191f
mejibyte/live-archive
3155 - Two-Stacks Solitaire/3155.2.cpp
/* Accepted. Idea: http://forums.topcoder.com/?module=Thread&threadID=627088&start=0 */ using namespace std; #include <algorithm> #include <iostream> #include <iterator> #include <sstream> #include <fstream> #include <cassert> #include <climits> #include <cstdlib> #include <cstring> #include <string> #include <cs...
ALGO
0.999956
3.568847
75bad918-5dc4-4318-9c8b-4baf6a4f7bde
GamerDude27/halo-source
mp/src/mathlib/bumpvects.cpp
#if !defined(_STATIC_LINKED) || defined(_SHARED_LIB) #ifdef QUIVER #include "r_local.h" #endif #include "mathlib/bumpvects.h" #include "mathlib/vector.h" #include <assert.h> // memdbgon must be the last include file in a .cpp file!!! #include "tier0/memdbgon.h" // z is coming out of the face. void GetBumpNormals( c...
TOOL
0.984312
6.820726
ec6b659a-ed01-4749-8aee-55de9e591dfc
rogeryoungh/algorithm-cpp
test/yosupo/sqrt-mod.test.cpp
#define PROBLEM "https://judge.yosupo.jp/problem/sqrt_mod" #define ALGO_IO_NUMBER_ONLY #include "../../src/other/fastio.hpp" #include "../../src/other/modint/dynamic-modint.hpp" #include "../../src/other/modint/dynamic-montgomery-space.hpp" using Space = DynamicMontgomerySpace<u32, 1>; using ModT = DynamicModint<Spa...
ALGO
0.999645
5.18162
b1f54a41-7a12-4339-a28e-bcbda71b98f1
jcd1994/MatlabTools
Compiled/blaze-3.2/blazemark/src/blaze/TVec6Mat6Mult.cpp
//================================================================================================= //================================================================================================= //************************************************************************************************* // Includes //****...
ALGO
0.964524
5.677083
cb72d2de-83b7-47b9-b184-e84c753e51f0
Nhara777/competitive_programming
library/lazysegtree_rsq.cpp
class LazySegTree { vector<int> dat,lazy; vector<bool> change; public: int n2 = 1; LazySegTree(int m) { while (n2 < m) n2 *= 2; for (int i=0;i<n2*2-1;i++) { dat.emplace_back(0); lazy.emplace_back(0); change.emplace_back(false); } } void eval(int k, int l, int r) { if (cha...
ALGO
0.999824
4.894968
557f14a8-2f16-487f-927f-a068cfc73914
sunnyajit/My_Leetcode_sol
1975-180-2466-count-ways-to-build-good-strings/1975-180-2466-count-ways-to-build-good-strings.cpp
class Solution { public: // code written by sunny int countGoodStrings(int low, int high, int zero, int one) { const int MOD = 1e9 + 7; vector<int> dp(high + 1, 0); dp[0] = 1; for (int i = 1; i <= high; ++i) { if (i >= zero) { dp[i] = (dp[i] + d...
ALGO
0.99993
5.286204
ef1fcd4c-675e-4600-8e26-ded505f1efff
argosmaia/Algorithms
Buscas/Binária/buscabinaria.cpp
#include <iostream> #include <stdlib.h> int buscabinaria(int vet[], int esq, int dir, int x) { if(dir >= esq){ int meio = (esq + dir) / 2; if(vet[meio] == x) return meio; if (vet[meio] >= x) return buscabinaria(vet, esq, meio - 1, x); return buscabinaria(v...
ALGO
0.999796
5.687083
a48b875f-27dc-4ee8-9be6-a11ad0d22925
cvora23/CodingInterviewQ
Graphs/FindSearchCheck/FindAndColorCodeNoIslands.cpp
/* * FindAndColorCodeNoIslands.cpp * * Created on: Oct 8, 2014 * Author: cvora */ /* * FindNoIslands.cpp * * Created on: Oct 8, 2014 * Author: cvora */ /* * Given a boolean 2D matrix, find the number of islands. * This is an variation of the standard problem: “Counting number of connected compo...
ALGO
0.999308
5.60708
c6d84d10-3613-41b0-a712-59900f3f428a
imrann2005/cp-dsa-cf-lc-cc
2118.cpp
#include <bits/stdc++.h> using namespace std; #define fast_io \ ios::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0) #define ll long long #define vi vector<int> #define vll vector<ll> #define pb push_back #define all(v) v.begin(), v.end() #define sz(v) ((int)(v).size()) #define ye...
ALGO
0.999899
4.083886
14a7f4e2-cf3f-4da8-9328-85835b4a98b4
Mehulcoder/Codeforces
596 DIV2/D.cpp
/* Name: Mehul Chaturvedi IIT-Guwahati */ /* PROBLEM STATEMENT */ #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unordered_map<ll, ll> umapii; typedef unordered_map<ll, bool> umapib; typedef unordered_map<string, ll> umapsi; typedef unordered_map<string, string> umapss; ty...
ALGO
0.999848
3.546868
f7a99c26-a07b-4ead-a36b-6ee243f66462
changhyeonnam/Problem_Solving
boj/2470.cpp
//// //// Created by changhyeonnam on 2021/07/17. //// // //#include <iostream> //#include <cstring> //#include <string> //#include <vector> //#include<algorithm> // //using namespace std; //typedef long long ll; //ll n; //ll ans = 9876543210; //int main(){ // ios::sync_with_stdio(false); // cin.tie(NULL); // ...
ALGO
0.999992
4.284162
da06ea9c-ed3f-45ac-a434-3175507a55e7
MadhukrishnaNipankar/DSA-Problems-and-Solutions
Non-Repeating Element - GFG/non-repeating-element.cpp
//{ Driver Code Starts #include <iostream> #include <bits/stdc++.h> using namespace std; // } Driver Code Ends class Solution{ public: int firstNonRepeating(int arr[], int n) { unordered_map<int, int> freqMap; // To store element frequencies // Count the frequency of each element in the arra...
ALGO
0.999902
5.74663
935153e1-f1c2-4595-933b-6039835d3e33
RuiHuangNUS/MARS-FTCC
Dynamical_Trajectory/src/utils/include/igl/bbw.cpp
igl::BBWData::BBWData(): partition_unity(false), W0(), active_set_params(), verbosity(0) { // We know that the Bilaplacian is positive semi-definite active_set_params.Auu_pd = true; } void igl::BBWData::print() { using namespace std; cout<<"partition_unity: "<<partition_unity<<endl; cout<<"W0=["<<end...
ALGO
0.997927
6.467953
9f694dd2-15b1-4e91-987d-dc19a9e1ff1e
hsoft-star/CLeetcode
70. Climbing Stairs.cpp
/* * @lc app=leetcode id=70 lang=cpp * * [70] Climbing Stairs */ // @lc code=start class Solution { public: int climbStairs(int n) { if (n <= 1) return 1; vector<int> dp(n + 1, 0); dp[0] = 1; dp[1] = 1; int i = 2; while (i <= n) { dp[i] = dp[i - 1] + ...
ALGO
0.999901
6.595122
9f9d8b71-59e2-402a-83dd-a2c8880f91da
Pratik-Ninawe/GeeksforGeeks---DSA
Difficulty: Medium/Minimum Jumps/minimum-jumps.cpp
class Solution { public: int minJumps(vector<int>& arr) { // code here int n = arr.size(); int max_reach=0; for(int i=0;i<n;i++){ if(i<=max_reach){ max_reach = max(max_reach, i+arr[i]); } } if(max_reach<n-1) return -1; ...
ALGO
0.999993
5.51739
9e9b3590-fcec-4253-b735-754250eb1995
Ting2003/pggrid_parallel
block.cpp
// ----------------------------------------------------------------// // Filename : block.cpp // Author : Xiao Zigang <<EMAIL>> // // implementation of block class // ----------------------------------------------------------------// // - Zigang Xiao - Tue Jan 18 21:46:13 CST 2011 // * added opeartor != // * added ...
TOOL
0.977082
3.004671
cec38f74-30c6-4fb9-8952-c09bb4bb0682
Djuk1c/codeforces
800/old/546A/546A.cpp
#include <iostream> using namespace std; int main() { int k,n,w; cin >> k; cin >> n; cin >> w; for (int i = 0; i < w; i++) { n -= k*i; } cout << n; return 0; }
ALGO
0.999871
3.253496
952403de-466d-4b7e-bbc0-f40d7a955f48
calculuslmvt/datastructures
lab file/i_part_b.cpp
#include <iostream> #include<string.h> using namespace std; void merge(int*a,int s,int e) // merge function { int mid=(s+e)/2; int i=s; int j=mid+1; int*temp=(int*)malloc(sizeof(int*)); int k=s; while(i<=mid && j<=e) { if(a[i]<a[j]) temp[k++]=a[i++]; ...
ALGO
0.999983
4.388982
ca2fd712-c0ba-4bd5-8689-07635603282f
sexybear/July--------
2.2.1.cpp
#include <iostream> #include <string> using namespace std; int main() { string str1 = "ABCDEFGHLMNOPQRS"; string str2 = "DCGSRQPOM"; int hash[26] = {0} int num = 0 for(int j = 0;j < str2.length();j++) { int index = str1[j] - 'A'; if(hash[index] == 0) { hash[index] = 1; num++; } } for(int k...
ALGO
0.99994
3.755116
8d78eaff-42f9-474d-ac26-ca25e178a039
cg99/projecteuler
pe9.cpp
#include <iostream> #include <cmath> using namespace std; int pythagoreanTriplet() { // given // a2 + b2 = c2 // a + b + c = 1000 int a, b, c; int sum = 1000; int product; //for square: pow(base,power); //for squareroot: sqrt(square); // loop through a which is always smaller than the sum for(int a =...
ALGO
0.999503
3.932033
d6830399-f78d-4f87-954a-2ac8886d0e0f
musou1500/atcoder_answers
abc158/a.cpp
#include <iostream> #include <string> using namespace std; int main(int argc, const char *argv[]) { string s; cin >> s; char prev_ch = s[0]; bool result = false; for (int i = 0; i < s.size(); i++) { if (prev_ch != s[i]) { result = true; break; } } cout << (result ? "Yes\n" : "No\n")...
ALGO
0.999982
4.097775
8fa27334-5541-4b35-b872-93d0329200cc
raincross7/code-similarity
codes/train_code/problem125/problem125_194.cpp
#include <bits/stdc++.h> #define ALL(a) (a).begin(), (a).end() #define RALL(a) (a).rbegin(), (a).rend() #define pb push_back #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define rep(i, n) FOR(i, 0, n) #define ll long long using namespace std; const ll P = 1000000007; int gcd(int a, int b) { return b != 0 ? gcd...
ALGO
0.999852
3.417653
01d0117c-9161-4e0a-92f1-e74fa76178b7
nguyentuss/Competitive-Programming
CP/OnlineJudge/Hackerearth/searchengine.cpp
#include <iostream> #include <cmath> #include <algorithm> #include <vector> #include <string> #include <map> using namespace std; int n , q , weight; map <char , int> m; string s , v; struct node { bool isEnd; int maxiWeight = -1; node *child[26]; }; void init(){ for (int i = 'a' ; i <= 'z' ; i++) m[i] = i -...
ALGO
0.999928
4.196971
f687a63e-0912-481b-9659-29a824488367
Archana-Kumarkhaniya/plus-plus
3 day/salary.cpp
#include <iostream> using namespace std; int main() { float basesalary, HRA , DA ,TA , grosssalary; cout << "Enter the base salary:"; cin >> basesalary; cout <<"enter the percentage of HRA="; cin >> HRA; cout <<"enter the percentage of DA="; cin >> DA; cout <<"enter the percentage of ...
TOOL
0.87361
3.133234
2d62c3de-1fba-419c-98d5-75e7e42b7af7
jecox85/CPlusPlusEarlyObjectProgrammingChallenges
05. Looping/04.CelsiusToFahrenheitTable/04.CelsiusToFahrenheitTable/04.CelsiusToFahrenheitTable.cpp
#include <iostream> #include <iomanip> using namespace std; double celciusToFahrenheit(double c); int main() { /* In one of the Chapter 3 Programming Challenges you were asked to write a program that converts a Celsius temperature to Fahrenheit. Modify that program so it uses a loop to display a table of the C...
TOOL
0.989142
4.201157
908209a5-8ccf-48cb-92ba-3724f1547901
devyaniChoubey/My-Solutions-DS-Algo
Hashing/2 Sum.cpp
https://www.interviewbit.com/problems/2-sum/ vector<int> Solution::twoSum(const vector<int> &nums, int target) { unordered_map<int,int>mp; vector<int>result; int n = nums.size(); for(int i=0;i < n;i++){ int complement = target - nums[i]; if(mp.find(complement) != mp.e...
ALGO
0.99995
5.981068
6e6b6646-b293-45d6-908f-c3ee9c2eb5f2
manikanta2901/ubuntu
.history/SRM/DAA/Final_20210425171331.cpp
#include<bits/stdc++.h> using namespace std; int row,column; void PrintGrid(int row,int column,vector<vector<int> >grid){ for(int i = 0; i < row; i++){ for(int j = 0; j < column; j++){ cout << grid[i][j] << " "; } cout << endl; } } void isValidPath(int i,int j,vector<vecto...
ALGO
0.999941
4.578881
32538bf2-62d6-44e3-ac3d-6e04f9d559bb
akshat-kumar2109/Strivers-CP-Sheet
Implementation and Constructive/40.cpp
#include <bits/stdc++.h> #define int long long int using namespace std; int32_t main() { #ifndef ONLINE_JUDGE freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); #endif int n; cin>>n; int arr[n]; for (int i=0; i<n; i++) cin>>arr[i]; int curr_min = arr[n-1] - 1; int res = arr[n-1]; fo...
ALGO
0.999971
3.742826
f424a732-3826-4244-9f9c-7c9a117ce520
Frikallo/Computers12
CCO/cco16p5.cpp
#include <bits/stdc++.h> using namespace std; struct line { int x1,x2,y,t; line(int x, int xx, int yy, int tt) : x1(x), x2(xx), y(yy), t(tt){} }; int n, m; vector<pair<int,int>> aa; long long sz(int q) { vector<int> rr (5000, 0), xs; vector<line> lin; map<int,int> mp; for (auto &x : aa) ...
ALGO
0.999835
3.879465
16dd039c-efbd-49c6-b539-680eb533f695
e7ite/BO1DLL
BO1DLL/aimbot.cpp
#include "aimbot.h" vec3_t Aimbot::targetAngles; bool Aimbot::Execute() { if (InGame()) { int target = GetTarget(); if (target != -1) { AimTarget_GetTagPos(CG_GetEntity(0, target), "j_head", targetAngles); vectoangles(targetAngles - cgameGlob->...
TOOL
0.992004
4.834073
f6fe4395-b5f2-485d-836d-19f6313947e1
beelisais2793/FX
Synthesizer/Waves/Oscillators/NOISE/Noises/noise/DiffSamp/src/code/Main/UniformWhiteNoise.cpp
/* UniformWhiteNoise.cpp use rejection method to generate general isotropic uniform white noise Li-Yi Wei 09/06/2010 */ #include <iostream> #include <fstream> #include <vector> #include <deque> #include <string> #include <memory> using namespace std; #include <stdlib.h> #include <math.h> #include "FrameBu...
TOOL
0.942046
5.663634
e212f28c-8e4a-4453-a2d4-9939bfb760ca
RinCloud/TrickCatcher
Datasets/TrickyBugs/GenProgs/dpp_generated_progs_cpp/p03331/p03331_num6_parsed.cpp
#include <iostream> int sumOfDigits(int num) { int sum = 0; while (num > 0) { sum += num % 10; num /= 10; } return sum; } int main() { int N; std::cin >> N; int minSum = INT_MAX; for (int A = 1; A <= N / 2; A++) { int B = N - A; int sum = sumOfDigits(A)...
ALGO
0.999906
6.264123
c02240c9-f385-4b4e-a801-c16831660892
zzerross/algorithm
search/binary/bound/main.cpp
#include <stdio.h> #include <algorithm> using namespace std; int* bnd(int* l, int* h, int t, bool u = false) { while (l < h) { int* m = l + (h - l) / 2; if (*m < t || (u && *m == t)) l = m + 1; else h = m; } return l; } int main() { #define S 3 int A[...
ALGO
0.996347
3.780549
35508f28-c929-4bfe-b0b4-4a53692a5f16
sane-aalam/DSA-Sheet-for-Coding-Interviews
4 Months/Leetcode/827. Making A Large Island.cpp
// The focus should always be on progress, not perfection. // Step-1 you know to how to traversal matrix using DFS // Step-2 After reading problem, same to same // NUMBER OF ISLANDS - count the maximum of island problems // Apporach to solved this problem // - You are allowed to change at most one 0 to be 1 // - Ge...
ALGO
0.999956
6.40416
a2b9c004-8aac-4fb5-a811-dbc7e065054a
shivam1253/gfg-problem-of-the-day-solutions
Difficulty: Basic/Odd or Even/odd-or-even.cpp
//{ Driver Code Starts #include <bits/stdc++.h> using namespace std; // } Driver Code Ends class Solution { public: string oddEven(int n) { if(n&1) return "odd"; return "even"; // code here } }; //{ Driver Code Starts. int main() { int t; cin >> t; while (t--) { int N...
ALGO
0.999893
5.750104
5546f478-fb35-460c-a248-8c42f3b43144
Rennatus/cxx-demo
src/thread/spin_lock_demo.cpp
#include <atomic> #include <format> #include <iostream> #include <mutex> #include <thread> #include <vector> class SpinLock { public: void lock() { while (locked.test_and_set(std::memory_order_acquire)) { // 自旋等待,直到成功获取锁 } } void unlock() { locked.clear(std::memory_order_release); } private: ...
TOOL
0.980715
5.529342
93ff44ca-7a47-4f49-b3fb-77d733fd6a8d
huruiyi/cpp-samples
C++基础课程/CPPBasic01/9.cpp
#include<stdio.h> #include<stdlib.h> #include<math.h> #include<iostream> #include<string> using namespace std; //Ŀһֽ磺90,ӡ90=2*3*3*5 // Ƿһ 97 =1*97; void Nature_(int num) { printf("\n%d", num); int a = 0; if (num) { printf("\n1޷ֽ"); } else if (num == 2) { printf("\n2=1*2"); } else if (num == 3) { p...
ALGO
0.99923
3.485305
cfbe0877-c5f5-4e90-8b69-2454e3eec7cf
GustavoPereira-Dev/Estudos-em-Cpp
EstruturaFuncional/Fatorial.cpp
#include <iostream> int calcularFatorial(int num); int main(){ int num; std::cont << "Digite a fatorial do número: "; std::cin >> num; std::cont << "O resultado do fatorial de " << num << " é de " << calcularFatorial(num); return 0; } int calcularFatorial(int num){ int fat; for(int i ...
ALGO
0.999197
4.715003
b9743356-951d-469b-8fa4-f380e4436409
sjenterrement/Pat_based
1021/Single digit statistics.cpp
#include<iostream> #include<vector> #include<string> using namespace std; int main() { vector<int>v(10,int(0)); string str; cin >> str; for (int i = 0; i < str.length(); i++) { v[str[i] - 48]++; } for (int i = 0; i < 10; i++) { if (v[i]!=0) { cout << i << ":" << v[i] << endl; } } return 0; }
ALGO
0.99944
3.437405
bbf62773-8e3a-4544-bf7c-651e66c9258e
shashikantpawar21/DSA-practice
5-Recursion/Recursion-KunalSeries/2-Arrays/2-LinearySearch.cpp
// Linear find array // arr - 1 2 5 15 54 -- target 15 #include <iostream> #include<vector> using namespace std; bool find(int* arr, int target, int index, int size) { if(index == size) return false; return ((arr[index] == target) || find(arr, target, index + 1, size)); } int findIndex(int* arr, i...
ALGO
0.999458
4.377178
92b4cdfa-1874-4676-bc69-28a62eccf16e
evpo/EncryptPad
deps/botan/src/lib/utils/filesystem.cpp
#include <botan/exceptn.h> #include <botan/internal/filesystem.h> #include <algorithm> #include <deque> #include <memory> #if defined(BOTAN_TARGET_OS_HAS_POSIX1) #include <sys/types.h> #include <sys/stat.h> #include <dirent.h> #include <functional> #elif defined(BOTAN_TARGET_OS_HAS_WIN32) #define NOMINMAX 1 ...
TOOL
0.883836
6.666715
a974f50e-b4b3-4927-b1da-0df516322147
ravenn3105/LeetCode
3241-divide-array-into-arrays-with-max-difference/divide-array-into-arrays-with-max-difference.cpp
class Solution { public: vector<vector<int>> divideArray(vector<int>& nums, int k) { sort(nums.begin(), nums.end()); vector<vector<int>> ans; vector<int> p; for (int i=0; i<nums.size(); i+=3){ if (nums[i+2]- nums[i]<= k){ p.push_back(nums[i]); ...
ALGO
0.999935
5.373112
f95e8a4b-dcff-416e-b1a5-2acd3d736c4b
PaukIsUha/optimizing_formating_code
predictions/submissions-aizu-gpt4/Codenet/p02268/232357024/response_5.cpp
#include <cstdio> #include <algorithm> using namespace std; int main() { int n; scanf("%d", &n); int* S = new int[n]; for (int i = 0; i < n; ++i) { scanf("%d", &S[i]); } sort(S, S + n); int cnt = 0; int q; scanf("%d", &q); for (int i = 0; i < q; ++i) { int T; ...
ALGO
0.999873
4.393127
8d7602f6-6392-4d99-953f-f76321bfa802
palluthapa/Cpp-For-Finance
part1-ex1.cpp
/* Program to compute maximum of two numbers. */ # include<iostream> using namespace std; int main() { int a = 5; int b = 10; int max =( (a>b)?a:b); // Conditional ternary operator. cout << "The maximum between " << a << " and " << b << " is " << max << ".\n"; return 0; }
ALGO
0.998447
4.581882
a072a7cb-c8f3-4ff0-b935-e5e6aedcc22e
daegwang/problem-solving
acmicpc.net/Two Pointer/2003.cpp
#include <cstdio> #include <cstring> #include <iostream> #include <algorithm> #include <vector> using namespace std; typedef long long ll; int main() { freopen("input.txt", "r", stdin); int n; ll m; cin >> n >> m; int d[10005]; for(int i=0; i<n; i++){ cin >> d[i]; } int ans = 0; ...
ALGO
0.999982
3.857926