uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
16b52b66-bbe3-495c-8802-a5f948c8b401
RaisaRamazanova/Parking
test_app/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.998377
6.76073
0e96ae6a-1eba-4053-9c46-397189ce9ea5
yashwanth2804/EosSmartconstracts
smartContracts/hash.cpp
#include "__hash_table" #include "algorithm" #include "stdexcept" #include "type_traits" #ifdef __clang__ #pragma clang diagnostic ignored "-Wtautological-constant-out-of-range-compare" #endif _LIBCPP_BEGIN_NAMESPACE_STD namespace { // handle all next_prime(i) for i in [1, 210), special case 0 const unsigned small_...
ALGO
0.99969
6.660625
fbbc56f0-1d59-462f-951a-1128bb84836a
ToThaiLinh/KTLT
Source code/bai3.9.cpp
/*To Thai Linh 20215414 Ma lop thuc hanh 732826*/ #include <bits/stdc++.h> using namespace std; const int MAX = 210; int N, K1, K2, counter = 0; int a[MAX], sum = 0, dau = -1; void TRY(int k) { //Ham thu tat ca cac kha nang cua ngay thu k if(k > N) { //Duyet qua tat ca N ngay thi in ket qua for(int i = 1; i <=...
ALGO
0.999942
3.90959
e1ddbfbd-0b7b-4682-a00a-6ee8807adc25
sebas095/Competitive-Programming
Hackerrank/30 Days of Code Challenges/Handshake.cpp
#include <bits/stdc++.h> #define fast ios_base::sync_with_stdio(false);cin.tie(NULL) #define endl '\n' using namespace std; int main() { fast; long long t, n; cin >> t; while (t--) { cin >> n; cout << (n - 1) * n / 2 << endl; } return 0; }
ALGO
0.999785
5.51381
60ee5888-5878-4e1c-9bb1-51151ed04f8e
VipulChauhan89/Codeforces-solutions
4A-Watermelon/watermelon.cpp
#include<iostream> using namespace std; int main() { int w; cin>>w; (w>2)?((w%2==0)?cout<<"YES"<<endl:cout<<"NO"<<endl):cout<<"NO"<<endl; return 0; }
ALGO
0.999041
3.257532
fad0c72a-d0ab-49af-8707-243988eb218e
trueos/trueos
contrib/llvm-project/llvm/lib/CodeGen/ScoreboardHazardRecognizer.cpp
#include "llvm/CodeGen/ScoreboardHazardRecognizer.h" #include "llvm/CodeGen/ScheduleDAG.h" #include "llvm/CodeGen/TargetInstrInfo.h" #include "llvm/Config/llvm-config.h" #include "llvm/MC/MCInstrDesc.h" #include "llvm/MC/MCInstrItineraries.h" #include "llvm/Support/Compiler.h" #include "llvm/Support/Debug.h" #include "...
ALGO
0.867075
7.777762
8c67ed1a-f10d-4237-aaab-f96226169c07
Bhagwankumarsingh/LeetCodeQuestions
1833-find-the-highest-altitude/find-the-highest-altitude.cpp
class Solution { public: int largestAltitude(vector<int>& gain) { int ans=INT_MIN; int sum=0; for(int i=0;i<gain.size();i++){ sum+=gain[i]; ans=max(ans,sum); } return ans>0?ans:0; } };
ALGO
0.999901
5.571538
822fae3e-eb42-4435-98a3-1242c17fea79
movegroovy/provenance
PVGB/GB/common/videolink/vfilters/maxsthq3x.cpp
#include "maxsthq3x.h" static unsigned long blend1(unsigned long c1, unsigned long c2) { unsigned long lowbits = ((c1 & 0x030303) * 3 + (c2 & 0x030303)) & 0x030303; return (c1 * 3 + c2 - lowbits) >> 2; } static unsigned long blend2(unsigned long c1, unsigned long c2, unsigned long c3) { unsigned long lowbits = ((c...
ALGO
0.994768
5.425238
8b5f78fb-4f6b-4eb1-8e83-9ee2fc2d1c39
ntaksh42/PlayGround
Cpp/StringSpliter.cpp
#include <iostream> #include <atlstr.h> #include <vector> int main() { // 区切り文字 const auto spliter = L"@"; // 対象の文字列 CStringW targetStr(L"HogePiyoFuga@type@3"); std::vector<CStringW> vecElement; while (true) { const auto index = targetStr.Find(spliter, 0); if (index == -1) { ...
TOOL
0.944657
4.109904
d7184cea-2475-4c0a-b9c1-54e064e1c79c
PlanarG/Code
Contest/6.12/A.cpp
#include <bits/stdc++.h> using namespace std; const int N = 50010; const int mod = 998244353; typedef long long LL; inline int Pow(int x, int y) { int res = 1; for (; y; y >>= 1, x = (LL)x * x % mod) if (y & 1) res = (LL)res * x % mod; return res; } int r[N * 6]; inline void GetR(int len, int l) { ...
ALGO
0.999972
4.03989
62c97220-57ee-4a65-8947-68b234cc5660
gustinurshobah/tugaspraktek03
soal02.cpp
#include <iostream> using namespace std; int main(){ int p, s; int x, y; int L; char r; cout <<"Pilih Mau Menghitung Luas Apa \n"; cout <<"p = persegi panjang"<<endl; cout <<"s = segitiga"<<endl; cout <<"ketikan huruf [p/s]";cin>>r; cout << endl; if (r =='p'||r =='p'){ cout <<"menghitung Luas Persegi ...
TOOL
0.91611
3.404492
767c034d-5010-4899-ae18-dab2ea6a080d
Mneach/Leetcode-Solution
2824-count-pairs-whose-sum-is-less-than-target/2824-count-pairs-whose-sum-is-less-than-target.cpp
class Solution { public: int countPairs(vector<int>& nums, int target) { int answer = 0; for(int i = 0; i < nums.size(); i++){ for(int j = i + 1; j < nums.size(); j++){ if(nums[i] + nums[j] < target) answer++; } } return answer; }...
ALGO
0.999935
6.240465
cdc3be9b-8faa-4e1d-a390-24681ba05d7b
646divi/LeetCodeDSA
0152-maximum-product-subarray/0152-maximum-product-subarray.cpp
class Solution { public: int maxProduct(vector<int>& nums) { int n=nums.size(); int pref=1,suff=1; int res=INT_MIN; for(int i=0;i<n;i++){ if(pref==0)pref=1; if(suff==0)suff=1; pref*=nums[i]; suff*=nums[n-i-1]; res=max({res,p...
ALGO
0.99999
5.998284
12e5882b-6b1b-4f71-9926-9e5260e458dd
danidomenico/OpenMP_TM
cowichan/cowichan_openmp/norm.cpp
/** * \file cowichan_openmp/norm.cpp * \brief OpenMP norm implementation. * \see CowichanOpenMP::norm */ #include "cowichan_openmp.hpp" namespace cowichan_openmp { /** * Find min/max x/y coordinates. * \param points point vector. * \param n number of points. * \param minPoint min x/y values. * \param maxPoi...
ALGO
0.998972
5.975022
988eb1f4-94c7-43cf-ad30-dfc4846bdebd
TaehoLi/algorithms
Quicksort.cpp
# include <stdio.h> # define MAX_SIZE 10 # define SWAP(x, y, temp) ( (temp)=(x), (x)=(y), (y)=(temp) ) int partition(int list[], int left, int right) { int pivot, temp; int low, high; low = left; high = right + 1; pivot = list[left]; do { do { low++; } while (low <= right && list[low]<pivot); do ...
ALGO
0.999997
4.857952
cdf9a291-99ac-4c47-8a29-286317e8ae07
DrDAN6770/LeetCode
Easy/2264 Largest 3-Same-Digit Number in String.cpp
#include <iostream> #include <vector> using namespace std; template <typename T> void print_res(const T& input) { if constexpr (is_same_v<T, int> || is_same_v<T, long> || is_same_v<T, long long> || is_same_v<T, bool> || is_same_v<T, float> || is_same_v<T, double> || is_same_v<T, string>) ...
ALGO
0.999746
5.996926
56b50d2e-ea5f-47c0-9167-3866209f802c
ashdqy/Tugas-PRAK-Algo
tugas1.cpp
#include <iostream> #include <iomanip> using namespace std; struct roti { string nama_roti; float harga; int koderoti; }; roti rotianjay[5] = { {"RotiTawar", 5000, 1}, {"Roti Susu", 7000, 2}, {"Roti Coklat", 9000, 3}, {"Roti Keju", 10000, 4}, {"Roti Kacang", 8000, 5}}; void quicksortr...
ALGO
0.995896
4.573895
bc108474-1159-450c-a8fa-553f21a4a21b
lds217/lds
CLAOJ/schoolroute.cpp
// Template // #include <bits/stdc++.h> #define FOR(i, a, b) for(ll i=a, _b=b; i<=_b; i++) #define FORD(i, a, b) for(ll i=a, _b=b; i>=_b; i--) #define pb push_back #define ALL(a) a.begin(), a.end() #define fi first #define se second #define mset(a, b) memset(a, b, sizeof(a)) #define MASK(i) (1LL<<(i)) #define BIT(x, i)...
ALGO
0.999981
4.043458
ac8e8ea1-ebaa-4325-ad9a-89a052d8b77c
UtkarshChaurasia/CodeForces-Spoj-CodeChef-GFG-LeetCode-Solutions
GFG_DSA_Topicwise/Heap/Nearly-Sorted(AMAZON).cpp
/* Given an array of n elements, where each element is at most k away from its target position, you need to sort the array optimally. Example 1: Input: n = 7, k = 3 arr[] = {6,5,3,2,8,10,9} Output: 2 3 5 6 8 9 10 Explanation: The sorted array will be 2 3 5 6 8 9 10 Example 2: Input: n = 5, k = 2 arr[] = {4,3,1,2,5} ...
ALGO
0.999988
5.980823
918e016d-e722-4b21-b318-5a1beb425fac
sireeprojects/genesis
work/ipaddr_inc_dec_rnd.cpp
#include <iostream> #include <cstdint> #include <string> #include <cstring> using namespace std; enum cea_addr_type { IP, MAC }; enum cea_addr_gen_type { Random, Increment, Decrement }; void get_next_addr(unsigned char *addr, cea_addr_type type, cea_addr_gen_type action) { unsigned char MAXI...
TOOL
0.882357
4.333944
36505970-96e8-49c0-8dd3-4ee6613e70ee
djolertrk/llvm-metadataburn
llvm/lib/CodeGen/GlobalISel/GISelKnownBits.cpp
#define DEBUG_TYPE "gisel-known-bits" using namespace llvm; char llvm::GISelKnownBitsAnalysis::ID = 0; INITIALIZE_PASS(GISelKnownBitsAnalysis, DEBUG_TYPE, "Analysis for ComputingKnownBits", false, true) GISelKnownBits::GISelKnownBits(MachineFunction &MF, unsigned MaxDepth) : MF(MF), MRI(MF.getRe...
ALGO
0.989574
7.816786
60deec8b-857f-4110-98f8-fe21c6c21427
mmsarode/CarND-Path-Planning-Project
src/Eigen-3.3/doc/examples/class_CwiseBinaryOp.cpp
#include <Eigen/Core> #include <iostream> using namespace Eigen; using namespace std; // define a custom template binary functor template<typename Scalar> struct MakeComplexOp { EIGEN_EMPTY_STRUCT_CTOR(MakeComplexOp) typedef complex<Scalar> result_type; complex<Scalar> operator()(const Scalar& a, const Scalar& b...
ALGO
0.941178
6.700232
e5e7338b-a99c-4d0d-9073-4e7024e070c7
Anubhav12345678/competitive-programming
HTMLENTITYPARSERLEETCODE.cpp
/* HTML entity parser is the parser that takes HTML code as input and replace all the entities of the special characters by the characters itself. The special characters and their entities for HTML are: Quotation Mark: the entity is " and symbol character is ". Single Quote Mark: the entity is ' and symbol character...
ALGO
0.93164
5.267779
ad58c49d-56d7-4011-9088-ee6df0892704
WayneDW/More-than-Algorithms
c++/264_Ugly_Number_II.cpp
#include <iostream> #include <vector> #include <map> #include <unordered_map> #include <unordered_set> #include <queue> #include <stack> #include <cmath> #include <string> #include <sstream> #include <algorithm> #include <climits> #include "000_basic.cpp" using namespace std; /*Write a program to find the n-th ugly n...
ALGO
0.99999
5.773581
d7cbd6ff-6e62-4f8b-bb97-b1bde9e0b65a
sahilee26/Interview_Preparation
Approach Seen/Subsets_with_given_xor.cpp
// { Driver Code Starts #include<bits/stdc++.h> using namespace std; // } Driver Code Ends class Solution{ public: int subsetXOR(vector<int> arr, int N, int K) { if(N==0) return 0; int elem=0, n=N; for (int i=0; i<N; i++){ elem=max(elem, arr[i]); } ...
ALGO
0.999962
5.766782
f12678cd-0141-4830-b859-89d0df61b50c
ishandutta2007/codeforces
generic_placeholder_name/normal/1607/G.cpp
#pragma GCC optimize("Ofast") #pragma GCC optimization("unroll-loops") #pragma GCC target("avx,avx2,fma") #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/trie_policy.hpp> #include <ext/rope> using namespace std; using namespace __gnu_pbds; using namespace __gnu_cxx; mt19937 rng(...
ALGO
0.99997
3.80169
fe3ece64-dc58-4ee3-999f-211ffb2cd160
Anshojha/DataStructure_And_Algorithm
Data Structure And Alogorithm/Printing Pattern/p1_half_pyramid.cpp
#include<iostream> using namespace std; int main() { int row; cin>>row; for (int i = row; i >0 ; i--) { for (int j = 1; j <= i; j++) { cout<<"*"; } cout<<endl; } return 0; }
ALGO
0.999896
3.805519
f8781e1e-6b68-44aa-9db5-c2ffe5873119
Mac16661/DataStructuresAndAlgo
Arrray/sumTriplet.cpp
#include<bits/stdc++.h> using namespace std; int main(){ int arr[] = {12, 3, 4, 1, 6, 9}; int n = 6; int sum = 24; sort(arr,arr+n); int l,r; for(int i = 0; i < n; i++) { l = i + 1; r = n - 1; while(l < r) { if(arr[i] + arr[l] + arr[r] == sum) { ...
ALGO
0.999869
4.297807
69b99ff7-7c07-4693-afdd-03589613eb36
l3eluGA/lab13_vanda
lab13_2.cpp
#include<iostream> using namespace std; int gcd(int,int); int main(){ int x, y; cin >> x >> y; cout << gcd(x,y); return 0; } int gcd(int x,int y) { if(x%y==0) return y; else return gcd(y,x%y); }
ALGO
0.999782
4.775846
632525c5-6d74-40a6-8998-abeef3892859
farish-jamal/C-plus-plus
DSA Love Babbar/Sorting/bubble_sort.cpp
#include <bits/stdc++.h> using namespace std; //Worst case Time Complixity O(n^2); //Best case Time Complexity O(n); //Space Complexity is O(1); int printArr(int arr[], int n){ for(int i = 0; i<n; i++){ cout<<arr[i]<<" "; } cout<<endl; } int bubbleSort(int arr[], int n){ for(int i=1; i<n; i++){ bool flag = ...
ALGO
0.99965
4.790068
5ac00154-5676-4499-aff6-7001057cff17
himanshugupta09/LEETCODE_SOLUTIONS
GFG_Problems/is-binary-number-multiple-of-three.cpp
//{ Driver Code Starts #include <bits/stdc++.h> using namespace std; // } Driver Code Ends //User function template for C++ class Solution{ public: int isDivisible(string s){ //complete the function here int o=0,e = 0; for(int i=0;i<s.size();i++) { if(s[i] == '1') { ...
ALGO
0.999002
5.708711
183ccc96-d51e-4f29-8fd5-5d1bbe534814
danielmedina9/ExpressionEvaluation
Project_ScriptingLanguage/Project_ScriptingLanguage/stackEval.cpp
#include "stackEval.h" int stackEval::priority(char op) { switch (op) { case '^': return 3; case '*': case '%': case '/': return 2; case '+': case '-': return 1; case ')': case ']': return -1; default: return 0; } } string stackEval::convert(string in) { stack<char> Vstack; string posf = ""; for (int i...
ALGO
0.980285
4.99051
e4711b2b-ed0c-4ce2-ab36-6a7a7728a4f6
goentdev/mobile_ziswaf
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.998762
6.786404
3917c3ce-3cad-40b7-8811-21eae0a6825f
Addii155/DSA-with-Cpp
recurrsion/printSubarr.cpp
#include<bits/stdc++.h> using namespace std; # define ll long long void Subarray(vector<int>v,int arr[],int n,int idx) { if(idx==n) { for(auto x:v) cout<<x<<" "; cout<<"\n"; return; } Subarray(v,arr,n,idx+1); if(v.size()==0 || arr[idx-1]==v.back()) { v.pus...
ALGO
0.999728
4.26647
5ad134d6-43c4-45e0-b156-1576aef3767e
zhangori000/Codechef
SepLong_CHEFINSQ.cpp
/* CONTEST URL: https://www.codechef.com/SEPT19B?order=desc&sortBy=successful_submissions PROBLEM URL: https://www.codechef.com/SEPT19B/problems/CHEFINSQ after you sort, it is gaurenteed that the smallest k elements of the list contains the numbers that make up a "interesting subsequence" so ...
ALGO
0.999903
4.085113
f9c85e04-f5c1-4779-ac65-3246715eeb4a
GuacheSuede/MSSubmission1234567890
submission/ema/boost_1_69_0/libs/compute/perf/perf_sort_float.cpp
#include <algorithm> #include <iostream> #include <vector> #include <boost/compute/system.hpp> #include <boost/compute/algorithm/is_sorted.hpp> #include <boost/compute/algorithm/sort.hpp> #include <boost/compute/container/vector.hpp> #include "perf.hpp" float rand_float() { return ((rand() / float(RAND_MAX)) - 0...
ALGO
0.997313
5.955168
62f9cef6-a78b-4210-bce8-9bf89f967e96
alexandraback/datacollection
solutions_5695413893988352_0/C++/Anta0/test.cpp
#include <string> #include <vector> #include <algorithm> #include <numeric> #include <set> #include <map> #include <queue> #include <iostream> #include <sstream> #include <cstdio> #include <cmath> #include <ctime> #include <cstring> #include <cctype> #include <cassert> #include <limits> #include <functional> #define re...
ALGO
0.999876
4.253532
e873acb4-b2e4-4559-b9bb-c28fec8c5a42
Dandi-pyro/Flutter_Dandi-Mochamad-Reza
16_Form_Input_Button/praktikum/task2/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.997954
6.797273
eee8f2dd-9da9-48ec-9739-22c3b1e88ed2
devanshikapla/Array
Flipping an image.cpp
class Solution { public: vector<vector<int>> flipAndInvertImage(vector<vector<int>>& image) { for(vector < int > & row : image){ reverse(row.begin() , row.end()); for(auto &it : row){ if(it == 1){ it = it - 1; } else...
ALGO
0.999939
6.383237
509f35e9-cf84-4a41-96f4-673c0d143cec
ampfibi1/Regular_problem_solve
A_two_frog.cpp
#include<iostream> using namespace std; void solve(){ int n , a , b ; cin >> n >> a >> b ; cout << ((abs(b-(a+1))&1) ? "YES\n" : "NO\n") ; } int main(){ int t ; cin >> t ; while(t--) solve(); }
ALGO
0.999161
4.177632
132ee521-1ead-4864-babe-7b898d8b4e9e
ishandutta2007/codeforces
kilo_5723/normal/1733/B.cpp
#include <cstdio> #include <iostream> using namespace std; int main() { int tt; scanf("%d", &tt); while (tt--) { int n, x, y; scanf("%d%d%d", &n, &x, &y); if (x) swap(x, y); if (!y || x || (n - 1) % y) { puts("-1"); continue; } for (int i = 0; i < n - 1; i++) printf("%d ", i - ...
ALGO
0.999826
3.336127
370abee0-840d-4798-94c8-efcc86cf3bbd
elgamalsalman/cp-solutions
CF/CF_Solutions/1223D_Sequence_Sorting/1223D.cpp
#include<bits/stdc++.h> using namespace std; #define fi first #define se second typedef pair<int, int> ii; typedef pair<int, ii> iii; int tc, n; map<int, ii> eleRanges; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cin >> tc; while (tc--) { eleRanges.clear(); cin >> n; for (int i = 1; i <= n; ...
ALGO
0.999477
4.121006
dfc2d24e-17a8-403c-a292-2ffa8ec957eb
CQ-Quest/Data-structure
Dynamic-Programming/dp/树形dp/题解/二叉苹果树.cpp
#include<bits/stdc++.h> #define INF 0x3f3f3f3f using namespace std; const int N=3e4+10; int h[N<<1],ne[N<<1],e[N<<1],w[N]; int f[500][500]; int n,m,idx; void add(int x,int y,int z){ w[idx]=z; e[idx]=y,ne[idx]=h[x],h[x]=idx++; } void init(){ idx=0; memset(h,-1,sizeof h); } void dfs(int u,int fa){ f[0][0]=0; for...
ALGO
0.999971
4.142611
65e1aa35-28bb-44eb-8f46-604052c96927
Aquilegia06/5.4
Source.cpp
#include <iostream> #include <stack> #include <string> #include <sstream> #include <cctype> using namespace std; int precedence(const string& op) { if (op == "!") return 4; if (op == "&&") return 3; if (op == "||") return 2; if (op == "<" || op == ">" || op == "<=" || op == ">=" || op == "==" || op ==...
ALGO
0.998583
5.299663
9659ca14-1893-415a-bade-25d056b17369
113bommy/deepmind_codecontests_refine
cpp_gold_filter_file/cpp_train_3488_1.cpp
#include <bits/stdc++.h> #pragma comment(linker, "/STACK:102400000,102400000") using namespace std; unordered_set<int> dict; int main() { long long a, b, x; cin >> x >> a >> b; if (a % x != 0) { a += x - (a % x + x) % x; } if (a > b) { cout << 0 << endl; } else { cout << (b - a + x) / x << endl;...
ALGO
0.9998
3.865255
92575939-b65d-4032-a7c8-7a74d53c3755
lammps/lammps
lib/linalg/dormbr.cpp
#ifdef __cplusplus extern "C" { #endif #include "lmp_f2c.h" static integer c__1 = 1; static integer c_n1 = -1; static integer c__2 = 2; int dormbr_(char *vect, char *side, char *trans, integer *m, integer *n, integer *k, doublereal *a, integer *lda, doublereal *tau, doublereal *c__, integer *ldc, doublereal...
ALGO
0.991955
5.395431
2626d03f-d10c-4d7d-8319-d66ad50528f4
alps-jbnu/24ALPStudy
2024-1/Basic/oop1qu3/Array/BOJ_3273.cpp
#include <bits/stdc++.h> #define fastio cin.tie(0)->sync_with_stdio(0) using namespace std; int seq[100000] = {}; bool occur[2000000] = {}; int main() { fastio; int n, x; cin >> n; for (int i = 0; i < n; i++) cin >> seq[i]; cin >> x; int cnt = 0; for (int i = 0; i < n; i++) { ...
ALGO
0.999925
4.202974
fb13dbb6-ce48-4d65-84d2-3282d9b99697
Mostak-Ahmmed/Algorithm-problems
Algorithms/ballmanford.cpp
#include <bits/stdc++.h> #include <vector> using namespace std; const int INF = 1e9; int main() { int n, m; cout << "Enter the number of nodes and edges: "; cin >> n >> m; vector<int> dist(n + 1, INF); vector<vector<pair<int, int>>> g(n + 1); cout << "Enter the edges:\n"; for (int i = 0; i ...
ALGO
0.999978
4.301581
e8a564be-a69b-48ca-9a77-bc90f80bd536
NicerNewerCar/CS670-Team-4
SLAM/opencv/sources/samples/dnn/person_reid.cpp
#include <opencv2/imgproc.hpp> #include <opencv2/highgui.hpp> #include <opencv2/dnn.hpp> using namespace cv; using namespace cv::dnn; const char* keys = "{help h | | show help message}" "{model m | | network model}" "{query_list q | | list of query images}" "{galle...
DATA
0.898615
6.499674
3773f748-0f8e-41ca-abbe-cedf8ebd68df
shobhit0023/DSA
Leetcode/Valid_Palindrom2.cpp
LeetCode: 680 class Solution { public: bool isvalid(string s,int i,int e){ while(i<=e){ if(s[i]==s[e]){ i++; e--; } else{ return false; } } return true; } bool validPalindrome(string s) { i...
ALGO
0.999984
6.10574
4110829f-c94f-40ce-818a-3244ee850272
Daniil-Oberlev/sorting
src/binaryInsertion.sort.cpp
template <typename T> int binarySearch(T *arr, T item, int low, int high, bool ascending = true) { if (ascending) { while (low <= high) { int mid = low + (high - low) / 2; if (arr[mid] == item) return mid + 1; else if (arr[mid] < item) low = mid + 1; else high = mid...
ALGO
0.999955
5.951761
3b015d9d-e033-4f2b-b986-00114faf2af5
UgarteSalvaje/Lab-3-Ugarte-Diego-
lab_3/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.998444
6.76073
66f5a055-2088-42b3-81aa-ad63ca7bd16c
ecolab-nus/FLEX
Blockwise_Morpher_Mapper/src/CGRA_xml_compiler.cpp
#include <iostream> #include <chrono> #include <assert.h> #include <string.h> // #include <morpher/util/util.h> #include <morpher/dfg/DFG.h> #include <morpher/arch/CGRA.h> #include <morpher/mapper/HeuristicMapper.h> #include <morpher/mapper/PathFinderMapper.h> #include <morpher/mapper/SimulatedAnnealingMapper.h> #inc...
ALGO
0.989407
3.450251
93d6954b-918e-4ed1-b98f-4c73d358fb2a
HaythamHany95/E-Commerce
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.9988
6.76073
4f39bdd1-3041-4c6a-8250-4dd9d9551a2e
nileshpahari/cf
a20j-1300/tram/sol.cpp
#include <bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; int passengers=0, minCapacity=0; while(n--){ int exit, enter; cin >> exit >> enter; passengers= passengers-exit+enter; if(passengers>minCapacity){ minCapacity=passengers; } ...
ALGO
0.999274
4.249134
c85ea8fc-6520-4fcb-882a-a539a26aada3
gregoire-l/cpp9
day09/ex01/RPN.cpp
#include "RPN.hpp" RPN::RPN(){} RPN::RPN(const char **argv) { setRpnSequence(argv); } RPN::RPN(const RPN &rpn) { *this = rpn; } RPN::~RPN() {} const std::string &RPN::getRpnSequence() const { return (rpnSequence); } void RPN::setRpnSequence(const char **argv) { rpnSequence = argv[1]; if (rpnSequence.empty())...
ALGO
0.995247
4.309852
51a6c370-6174-4396-83b7-053c80193988
GrootTheDeveloper/OLP-ICPC
800+BAI_CODE_HAY/Code/fc138_nns.CPP
#include <bits/stdc++.h> using namespace std; #define int long long const int mode = 1e9 + 7; const int N = 2e5 + 5; const int base = 311; int n, q; char a[N], b[N]; int p[N]; struct Segmentree { vector<int> seg; int n; Segmentree (int _n) { n = _n; seg.assign(n * 4 + 5, 0); } void build(int id, int l, int r...
ALGO
0.99997
5.202677
364e1025-7405-42b2-99d2-e4d0bea7610b
30-Days-code/Somasekhar
day_19.cpp
// Write a C++ program to Delete an Element from an Array in which a user inputs // an element to delete, the element is then searched in the array, if found, it is // deleted and the array is displayed and if not found, then a message // “Element Not Found” is displayed. #include<iostream> #include <stdio.h> using n...
ALGO
0.99973
4.06575
db673253-80eb-4806-9458-d89d6949881b
arsh14jain/IEEE-WC-Code-Wars
up-and-down-sum.cpp
#include <iostream> using namespace std; int main() { long n; long sum; cin>>n; if(n%2==0) cout<<-(n/2)<<endl; else cout<<(n+1)/2<<endl; return 0; }
ALGO
0.998406
3.197951
b63c4973-e7d0-47a1-9b5a-702f5b7b3481
Francis0121/homework.3.2
algorithm/acm/twoNumbers_2.cpp
//#include <stdio.h> //#include <vector> //#include <algorithm> // //using namespace std; // //#define SET_MAX_SIZE 1000000 //#define TRUE 1 //#define FALSE 0 // //int main(void){ // FILE *in; // int numTestCase; // int size, numK, numTemp, i; // vector<int> vecSet; // // in = fopen("input.txt", "r"); // fscanf(in, "%...
ALGO
0.999472
3.539128
63e92133-9b13-4eeb-aaf4-1b2bf225681b
Agasthya-Samyak-Jnan/LeetCode-Problems
Easy/Add Strings.cpp
#include<bits/stdc++.h> using namespace std; // Link to the Problem : https://leetcode.com/problems/add-strings/ // Difficulty : Easy class Solution { public: string addStrings(string num1, string num2) { // If we add "0" to "something" , its "something" itself. if (num1 == "0") { return...
ALGO
0.999905
6.373396
0a8d64fc-1be1-402c-98a4-d2b3cc5da095
rickylyxon/CPP
DSA/Pattern/pattern-4.cpp
#include<iostream> using namespace std; int main(){ int n; cin>>n; int row=1; char start='A'; while (row<=n) { int col=1; while (col<=n) { cout<<start<<" "; start= start+1; col++; } cout<<endl; row++; } ...
ALGO
0.999189
3.856994
4d78ef55-3abb-42fa-b617-e2939b6e9165
HarshGaur387R/CandCpp
Find_triplets_with_zero_sum.cpp
#include <bits/stdc++.h> #include <stdlib.h> #include <iostream> using namespace std; // } Driver Code Ends /* You are required to complete the function below * arr[]: input array * n: size of array */ class Solution { public: // Function to find triplets with zero sum. bool findTriplets(int arr[], int n)...
ALGO
0.99984
5.591557
24e0e634-7d5b-4e96-b699-1f112afbb5de
anushthakur/LEETCODE
leetcode442.cpp
//442. Find All Duplicates in an Array //write optimal and brute force too??? #include<bits/stdc++.h> using namespace std; class Solution { public: vector<int> findDuplicates(vector<int>& nums) { sort(nums.begin(),nums.end()); //O(nlogn) vector<int>v; for(int i=0;i<nums.size()-1;i++) /...
ALGO
0.999991
4.971831
582d53a9-6318-4c67-a807-26a418c9d19f
ishandutta2007/codeforces
pupii/normal/582/E.cpp
#include<bits/stdc++.h> #define mod 1000000007 typedef long long ll; ll gi(){ ll x=0,f=1; char ch=getchar(); while(!isdigit(ch))f^=ch=='-',ch=getchar(); while(isdigit(ch))x=x*10+ch-'0',ch=getchar(); return f?x:-x; } char S[510]; int ls[180],rs[180],w[180],cnt; int dp[170][65569],A[65539],B[65539]; int divide(int l...
ALGO
0.999941
4.44413
6157aea1-45fe-49bc-9f29-5de1ff74afef
ishandutta2007/codeforces
ormlis/normal/1538/B.cpp
#include <bits/stdc++.h> #define range(i, n) for(int i = 0; i < (n); ++i) #define all(a) (a).begin(), (a).end() #define rall(a) (a).rbegin(), (a).rend() #define ar array using namespace std; typedef long long ll; typedef unsigned long long ull; typedef double ld; const ll INF = 2e18; const int INFi = 2e9; const int...
ALGO
0.999807
4.146954
2684e110-6f1c-4b49-a9b0-75922ef1c1cc
Sakshijha14/DSA
longestpalindromesubsequence.cpp
/* s="bbbab" subsequence:-(ab,bb,bbb,bbbb,bab) where ab is not palindrome and out of rest bbbb is largest palindrome 1.recursive(check all and pick longest) 2.power set we can use lcs s="bbabcbcab" straight fashion babcbab longest let write in reverse order: bacbcbabb if some portion is common in both the string it ...
ALGO
0.999956
5.583574
a3f5d44f-77d4-4c1a-b81e-71f84e59e9f0
soSkary/CPP_exercises
week3/assignment3_3_2/src/string_utils.cpp
#include "string_utils.h" #include <algorithm> #include <cctype> std::string reverse_string(std::string str) { std::string reversed; for (auto r_it{ str.rbegin() }; r_it != str.rend(); ++r_it) { reversed += *r_it; } return reversed; } std::string to_lower_case(std::string str) { std::tr...
TOOL
0.949575
6.299829
8aaf1eeb-278d-45b8-960b-63c009cee14a
mmunos/cpjava
cfedu127/A.cpp
#include <iostream> // #include <algorithm> // #include <vector> // #include <map> // #include <unordered_map> // #include <set> // #include <unordered_set> // #include <sstream> using namespace std; typedef long long int ll; int main(){ int T; cin >> T; while(T--){ string s; cin >> s; ...
ALGO
0.999912
4.727933
95508639-a370-4898-b859-a8fc43acfaa8
fasterisk/BA-Teil2
FreeImage/Source/OpenEXR/IlmImf/ImfRleCompressor.cpp
//----------------------------------------------------------------------------- // // class RleCompressor // //----------------------------------------------------------------------------- #include <ImfRleCompressor.h> #include <ImfCheckedArithmetic.h> #include "Iex.h" namespace Imf { namespace { const int MIN_RUN_L...
ALGO
0.922297
5.465276
665eabba-9e22-4b7a-920b-a4abeb900b9c
hamza-choudhary/DSA-Prep
08_linkedlist/06_middle_of_linked_list/main.cpp
#include "bits/stdc++.h" using namespace std; // https://leetcode.com/problems/middle-of-the-linked-list/ class ListNode { public: int val; ListNode *next; ListNode() { this->next = nullptr; this->val = 0; } // ListNode(int x) { // this->next = nullptr; // this->val = x; // } // ListN...
ALGO
0.999811
5.969625
d3c1683d-5914-434a-852b-1e28d919e569
NXIST-backup/algorithm_trans
codeforces/666A.cpp
#include <iostream> #include <cstring> #include <algorithm> #include <queue> #include <map> #include <unordered_map> #include <cmath> #include <cstdio> #include <vector> using namespace std; typedef long long ll; typedef unsigned long long ull; const int INF = 1e9; typedef pair<int,int> pii; int t; int n; int st[144...
ALGO
0.999882
4.419365
6534892f-d54f-4adf-8f7b-4eae333f7049
shakeebanwar/computervision
Resources/opencv-master/3rdparty/carotene/src/bitwise.cpp
#include "common.hpp" #include "vtransform.hpp" namespace CAROTENE_NS { #ifdef CAROTENE_NEON struct BitwiseAnd { typedef u8 type; void operator() (const uint8x16_t & v_src0, const uint8x16_t & v_src1, uint8x16_t & v_dst) const { v_dst = vandq_u8(v_src0, v_src1); } v...
TOOL
0.990791
6.675715
7244d67d-28b4-4039-add2-b5c46a521b7e
FinityFly/cp
P_5_-_Matrix_Operation.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; /* */ int n, ans=0; int mat[1501][1501], dp[1501][1501]; bool vis[1501][1501]; int longest_path(int i, int j) { if (vis[i][j]) return dp[i][j]; int cnt=0; ...
ALGO
0.999865
3.918158
4ac39c46-082b-4ec7-b20c-73e98693cc22
Muratbeko/OOP
Lab 7/Lab 7/Task1.cpp
#include <iostream> #include <algorithm> // Для std::min using namespace std; class Array { protected: unsigned* array; size_t size; static const size_t MAX_SIZE = 100; public: Array(size_t n, unsigned initialValue = 0) : size(n) { size = (n > MAX_SIZE) ? MAX_SIZE : n; array = new un...
ALGO
0.993842
4.622687
ae62122b-e305-4fa9-ab7c-4e52736ce1c8
ganeshalamuru/prg
codeforces/cr995/A_Preparing_for_the_Olympiad.cpp
#include <bits/stdc++.h> using namespace std; #define fast ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); typedef long long ll;typedef long double ld;typedef pair<int,int> pii; #define F first #define S second #define PB push_back #define MP make_pair const ll mod = 1e9+7, N = 2e6+7, M = 2e6+7, INF = INT_MAX/10; ll po...
ALGO
0.999955
4.022041
e54dd226-b97d-40a4-a7a4-0fc082da66d1
Dashkova007/Cycles
Cycles/Task/Fourth.cpp
#include <iostream> using namespace std; void fourth() { setlocale(LC_ALL, "RUS"); int number, sum = 0, quantity = 0; cout << "Введите число = "; cin >> number; while (number > 0) { sum += number % 10; number /= 10.0; quantity += 1; } cout << "Сумма цифр = " << sum << " и в числе " << quantity << " цифр\n"...
ALGO
0.994056
3.885339
afb1d946-9b73-49ca-ad1c-a4a24a879bb3
vdbergg/bursttries-for-autocompletion
methods/fuzzy-suffix-array/cpp/StaticString.cpp
/* * Title: Applying Burst-Tries for Error-Tolerant Prefix Search * Authors: Berg Ferreira · Edleno Silva de Moura · Altigran da Silva * Journal: Information Retrieval Journal (IRJ) * DOI: 10.1007/s10791-022-09416-9 * * Note: For any reference to the repository, please cite this article. */ #include "../header/...
ALGO
0.949759
5.628129
d43da353-21d6-4076-9dc7-7ced2b69907b
danielhO9/PS
BOJ/11025.cpp
#include <bits/stdc++.h> using namespace std; int N, K; int main() { ios::sync_with_stdio(0); cin.tie(0); cin >> N >> K; int ans = 0; for (int i = 1; i <= N; ++i) { ans = (ans + K) % i; } cout << ans + 1; }
ALGO
0.99997
3.971473
f513eb2a-4944-4688-b84b-51e5f1ac60cc
syedmahedi/Codeforces-Solved-Problems-Using-Cpp-
1663A Who Tested.cpp
#include <iostream> #include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(0); cin.tie(0); string s; cin>>s; cout<<"Red Panda"<<endl; return 0; }
TOOL
0.864792
3.049938
807d09d3-362f-4da9-99f6-22ffe4a316f6
AnonymousAuthorRepo/Optimization-PIC-Method-on-PM
WarpX-PM/warpx_directory/amrex/Tests/LinearSolvers/C_CellMG/macprojTest.cpp
// // In order to use this utility to mimic a MAC projection solve from the // full AMR code, the lines of code below need to be added to the top // of mac_level_driver in MacOperator.cpp. This will dump the required // information. The data sent to cout needs to be set in the input and // grid files for this test ...
ALGO
0.988159
5.351726
face1369-2ce2-4321-9541-d8a599e107f3
Vranjan7077/Var_Plat_Codes
hackerrank/algo/dp/medium/red-john-is-back.cpp
#include <cmath> #include <cstdio> #include <vector> #include <iostream> #include <algorithm> using namespace std; void binomialCoeff(int n, int k,long long C[41][11]) { //int C[n+1][k+1]; int i, j; // Caculate value of Binomial Coefficient in bottom up manner for (i = 0; i <= n; i++) { fo...
ALGO
0.999879
3.927349
5a23645f-071f-4612-b77a-7c58432ddcef
abhishek0777/CPCodes
Graph/4-cycleInUndirected.cpp
#include<bits/stdc++.h> #define ll long long int #define pb push_back using namespace std; ll V,E; bool dfs(vector<ll> adj[],bool visited[],ll s,ll p) { visited[s]=true; for(ll v: adj[s]) { if(!visited[v]) { if(dfs(adj,visited,v,s)==true){return true;} } else if(...
ALGO
0.999992
3.905073
24f2821d-d6d7-4260-8175-8b4d643b1618
paridhigulati/LeetCode
128-longest-consecutive-sequence/128-longest-consecutive-sequence.cpp
class Solution { public: int longestConsecutive(vector<int>& nums) { unordered_set<int>s; int ans=0; for(int i=0;i<nums.size();i++) { s.insert(nums[i]); } for(int i=0;i<nums.size();i++){ if(s.find(nums[i]-1) != s...
ALGO
0.999961
5.654638
0a384aa7-97ff-4f94-ae9e-ddc865442623
rusted-dreams/problem-of-the-day
2024_10/17-10-2024.cpp
// 670. Maximum Swap // link - https://leetcode.com/problems/maximum-swap/?envType=daily-question&envId=2024-10-17 #include <iostream> #include<string> #include<algorithm> using namespace std; class Solution { public: int maximumSwap(int num) { string n = to_string(num); //convert num to string st...
ALGO
0.998346
6.236354
b0f93c64-c93e-40ce-8fd3-20610349f70c
qtinsider/psychic-chainsaw
src/libs/3rdparty/botan/doc/examples/rsa_enc.cpp
/* Grab an RSA public key from the file given as an argument, grab a message from another file, and encrypt the message. Algorithms used: RSA with EME1(SHA-1) padding to encrypt the master key CAST-128 in CBC mode with PKCS#7 padding to encrypt the message. HMAC with SHA-1 is used to authenticate the...
TOOL
0.934979
6.166945
295ee436-ca29-473f-ac2f-ef17562e5127
Praful2299/CPP-and-DSA-Class
deque.cpp
#include<iostream> using namespace std; #include<queue> int main() { deque<int> q; q.push_front(10); q.push_front(20); q.push_front(30); q.push_front(40); q.push_front(50); cout<<"Size =" <<q.size()<<"\n"; cout<<"Max-Size:" <<q.max_size()<<"\n"; while(!q.empty()) { cou...
ALGO
0.994217
3.8989
6683d591-46ae-4800-9fe9-ec00e689a33a
libaoquan95/LintCode
115-不同的路径 II.cpp
#include <iostream> #include <vector> #include <algorithm> #include <time.h> using namespace std; class Solution { public: /** * http://www.lintcode.com/zh-cn/problem/unique-paths-ii/-115-ͬ· II * @param obstacleGrid: A list of lists of integers * @return: An integer */ int uniquePathsWith...
ALGO
0.998861
4.779742
dd5bc824-1c7e-496b-99de-8c4cb5988800
tetrashop/Refrigitz_v.2
SugaR 2/pawns.cpp
#include <algorithm> #include <cassert> #include "bitboard.h" #include "bitcount.h" #include "pawns.h" #include "position.h" #include "ucioption.h" namespace { #define V Value #define S(mg, eg) make_score(mg, eg) // Doubled pawn penalty by file const Score Doubled[FILE_NB] = { S(13, 43), S(20, 48), S(23,...
ALGO
0.998809
6.976201
ada17052-19f2-43e2-9dd8-1bcb6c16c41f
citybayern/cos_pro_2
23_05_08/2.cpp
#include <stdio.h> #include <stdlib.h> #include <string.h> int* solution(int* people, int people_len) { int* answer = (int*)malloc(sizeof(int) * 4); memset(answer, 0, sizeof(int) * 4); for (int i = 0; i < people_len; i++) { if (95 > people[i]) answer[0]++; else if (100 > people[i] && 95<= people[i]) answer[1]+...
ALGO
0.999634
3.967442
2be642ed-8f82-4bee-be26-1028122e3820
phoenix29122003/Leetcode_questions
0389-find-the-difference/0389-find-the-difference.cpp
class Solution { public: char findTheDifference(string s, string t) { unordered_map<char,int>mp; for(char it:t) mp[it]++; for(char it:s) mp[it]--; char ans; for(auto it:mp) if(it.second==1) ans=it.first; return ans; } };
ALGO
0.999946
6.308903
69503518-c1bc-4d3b-be70-0e42a10a5007
ishandutta2007/codeforces
_twilight/normal/1190/D.cpp
#include <bits/stdc++.h> using namespace std; typedef bool boolean; #define ll long long const int N = 2e5 + 5; typedef class Point { public: int x, y; Point(int x = 0, int y = 0) : x(x), y(y) { } boolean operator < (Point a) const { return (y ^ a.y) ? (y > a.y) : (x < a.x); } } Point; typedef class...
ALGO
0.999832
4.083845
3c165db2-f6e4-448e-8f88-47fc9e1d34fb
ArielGarciaM/CompetitiveProgramming
cses/towers.cpp
#include <bits/stdc++.h> using namespace std; typedef vector<int> vi; typedef pair<int, int> ii; vi lis(vi S) { vi prev(S.size()); vector<ii> res; for(int i = 0; i < S.size(); i++) { ii el {S[i], i}; auto it = lower_bound(res.begin(), res.end(), ii {S[i] + 1 , 0}); if(it == res.end(...
ALGO
0.999965
4.655531
1c8d0c88-421c-49d1-8a3c-12f7eb47378b
Xushi8/Code
2023/april/1125.cpp
// 2023/04/27 17:24:10 #include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); int arr[26] = {0}; int ch; while ((ch = cin.get()) != EOF) { arr[ch - 'a']++; } sort(arr, arr + 26); int tmp; for (int i = 0; i < 26; i++) { ...
ALGO
0.999974
3.987673
7fa02df2-d67f-4177-b320-d30b4c019fb8
RomaDevelop/Examples-CPP
функторы/code.cpp
#include <algorithm> #include <vector> #include <iostream> struct GreaterThan { GreaterThan() { std::cout << "Constructor called" << std::endl; } ~GreaterThan() { std::cout << "Destructor called" << std::endl; } bool operator()(const int& lhs, const int& rhs) const { ...
ALGO
0.997606
5.860389
a4c4a332-80ff-4cd2-a320-3d608489f597
NaVIn69/AlgoZenith_DSA
tree/find_distance_between_u_v.cpp
#include<bits/stdc++.h> using namespace std; #define int long long #define endl "\n" #define int long long #define endl "\n" vector<int>g[100100]; int dep[100100]; int par[100100]; void dfs(int node,int parent,int depth){ dep[node]=depth; par[node]=parent; for(auto v:g[node]){ if(v!=parent){ ...
ALGO
0.999574
4.649311
72d2eab9-b98d-435e-9e09-a8f3d396c7a0
manikanta2901/ubuntu
.history/codingChallenges/cpp/Codechef/longChallenges/july/aaa_20200712222239.cpp
#include<bits/stdc++.h> #include<vector> #include<iostream> #include<cmath> #include<algorithm> #include<iterator> #include<string> #include<map> #include<unordered_map> #define F first #define S second #define MP make_pair #define EXECUTE_FASTER ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); #define ...
ALGO
0.99995
4.084054
f270ea16-99ab-4f60-afe9-520f15d83158
StolasIn/leetcode_Submissions
content/gas-station/Accepted/3-5-2022, 12_08_06 PM/Solution.cpp
// https://leetcode.com/problems/gas-station class Solution { public: int canCompleteCircuit(vector<int>& gas, vector<int>& cost) { int mi = 1e9,ma = -1e9; int inow = 0,mnow = 0; int ipos = 0,mpos = 0,tol = 0; for(int i=0;i<gas.size();i++){ inow += gas[i] - cost[i]; ...
ALGO
0.999992
5.839027
4878ac05-ed0a-427f-854e-2977da862a6d
chock-cho/Do_Until_Melted
240906/1차원 바람/The-1D-wind-blows.cpp
#include <iostream> using namespace std; int N, M, Q; int grid[104][104]; string priorDir; void leftPush(int r){ priorDir = "L"; int tmp = grid[r][M]; for(int col = M; col >= 2; col--){ grid[r][col]= grid[r][col-1]; } grid[r][1]= tmp; } void rightPush(int r){ priorDir = "R"; int tm...
ALGO
0.999805
3.783436
b630c1dc-5144-434f-a92e-85e67a1176e6
JeffTimoman/binusOnlineJudge
00_onlineJudge/OLQ/10/e5.cpp
#include <stdio.h> int rekursi(char arr[105][105], int x, int y, int a, int b){ if (x > a || y > b || x < 0 || y < 0 || arr[x][y] == '#') return 0; else if (arr[x][y] == '*') { arr[x][y] = '#'; return 1 + rekursi(arr, x + 1, y, a, b) + rekursi(arr, x - 1, y, a, b) + rekursi(arr, x, y + 1, a, b)...
ALGO
0.995821
3.546387