uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
06d1dc1e-e310-4749-857b-4d8a11b2dea0
percivalyan/c-cpp-algo-data-structure
Praktikum Struktur Data/Pertemuan 7/tugas_pendahuluan_no_4.cpp
#include <iostream> using namespace std; void Identitas() { cout << "Tugas Pendahuluan Pertemuan 7 No. 4" << endl; cout << "Nama : Ryanda Deanova" << endl; cout << "NIM : 211011450036" << endl; cout << "Kelas : 04TPLP001" << endl << endl; } void bubbleSort(int arr[], int n) { for (int i = ...
ALGO
0.999906
4.46182
4281dffe-bfd7-4fe8-a7bf-4af86a8a8fd1
ishandutta2007/codeforces
andreasyan/normal/282/A.cpp
#include <iostream> using namespace std; int main() { int i, j, n,m=0; char x, y, z; cin >> n; for (i = 0; i < n; i++) { cin >> x >> y >> z; if (y == '+') m++; if (y == '-') m--; } cout << m<<endl; return 0; }
ALGO
0.999921
4.106238
afcf22b3-19ca-42f2-b984-df98814ad187
7ganam/autonomus-shortest-path-codes-ROS-Gazeboo
codes/250 maps/rrt_250/rrtextended_suitable.cpp
//c++ `Magick++-config --cxxflags --cppflags` -O2 -o rrtextended_suitable rrtextended_suitable.cpp `Magick++-config --ldflags --libs` #include <Magick++.h> #include <iostream> #include <fstream> #include <math.h> #include <iomanip> #include <stdlib.h> #include <cstdlib> #include <ctime> #include <iostream> #include...
ALGO
0.997136
4.02932
fa531de7-834d-4485-8672-37f53786d351
antalszava/cpp_examples
src/HackerRank/find_pairs.cpp
#include <iostream> #include <vector> #include <algorithm> int sockMerchant(const std::vector<int> & ar_) { int pairs = 0; std::vector<int> ar = ar_; std::sort(ar.begin(), ar.end()); int temp = ar[0]; int temp_count = 1; for (auto i : ar){ std::cout << i; } std::cout << std::endl;...
ALGO
0.999508
5.141887
b87f2c6d-f560-42c0-b8db-c49e64747668
Islam-Tarek/CompetitiveProgramming
codeforces/B. Balanced Remainders 2 .cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define all(v) ((v).begin()),((v).end()) #define clr(arr,x) memset(arr,x,sizeof(arr)) #define pb push_back void fast() { ios_base::sync_with_stdio(NULL); cin.tie(0); cout.tie(0); } void input() { freopen(...
ALGO
0.999725
4.208581
be5a87e6-1985-4efe-89f6-7dd6d1a6e9db
fu3mo6/leetcode_cpp
src/Basic/MergeSort.cpp
vector<int> sortArray(vector<int>& nums) { // Mergesort vector<int> result = nums; mergesort(result, 0, nums.size()-1); return result; } void mergesort(vector<int>& nums, int left, int right) { if (left >= right) return; int mid = (left + right)/2; mergesort(nums, left, mi...
ALGO
0.999962
5.870097
c777601e-23c3-4828-89e4-985e058818f6
cjc523/AutoAudio
opencv-3.1.0/samples/cpp/tutorial_code/ShapeDescriptors/generalContours_demo1.cpp
/** * @function generalContours_demo1.cpp * @brief Demo code to find contours in an image * @author OpenCV team */ #include "opencv2/imgcodecs.hpp" #include "opencv2/highgui/highgui.hpp" #include "opencv2/imgproc/imgproc.hpp" #include <iostream> #include <stdio.h> #include <stdlib.h> using namespace cv; using nam...
ALGO
0.990059
7.280235
ceb7ad26-d768-414b-a812-fa6e3bbbcf29
DominikWierszen/advent_of_code
2021/day_1/p1.cpp
#include <fstream> #include <iostream> #include <vector> using namespace std; // day1 int main(int argc, char *argv[]) { ifstream myFile; vector<int> data; myFile.open("data.txt"); int lines = 0; int count = 0; while (myFile >> lines) { data.push_back(lines); } myFile.close(); int previous = data...
ALGO
0.999084
4.059984
fe10992b-6342-4db4-8472-daf51a34105f
ggh-png/PS
백준/7785.cpp
#include <iostream> #include <map> using namespace std; int main() { ios_base :: sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int num; cin >> num; map<string, bool, greater<>> map; for(int i=0; i < num; i++) { string name; string state; cin >> name >...
ALGO
0.998946
3.590148
c3473b16-a994-4e6d-9fc1-69505163bb0e
yunnn426/baekjoon
프로그래머스/1/42576. 완주하지 못한 선수/완주하지 못한 선수.cpp
#include <string> #include <vector> #include <map> using namespace std; string solution(vector<string> participant, vector<string> completion) { string answer = ""; map<string, int> m; for (int i = 0; i < participant.size(); i++) { m[participant[i]] += 1; } for (int i = 0; i < co...
ALGO
0.999651
5.588493
b85f9bdd-d187-4fc0-a583-851beca8c9a0
mkoehnke/CarND-Path-Planning-Project
src/Eigen-3.3/doc/examples/TutorialLinAlgComputeTwice.cpp
#include <iostream> #include <Eigen/Dense> using namespace std; using namespace Eigen; int main() { Matrix2f A, b; LLT<Matrix2f> llt; A << 2, -1, -1, 3; b << 1, 2, 3, 1; cout << "Here is the matrix A:\n" << A << endl; cout << "Here is the right hand side b:\n" << b << endl; cout << "Computing LLT...
ALGO
0.999903
3.145425
779828e4-5bcb-43a4-aa73-8fe77c4c5748
luam0oliveira/competitive_programming
topicos-especiais-II/lista-3/f.cpp
#include<bits/stdc++.h> #include<bits/extc++.h> #define ll long long #define ii pair<int,int> #define INF 1e9 #define EPS 1e-9 #define ALL(X) X.begin(), X.end() #define LSOne(S) (S & -(S)) #define ZZZZ ios_base::sync_with_stdio(0);cin.tie(0); using namespace std; using namespace __gnu_pbds; // Template to use pbds temp...
ALGO
0.999869
4.693949
fac7bb82-62b5-47c8-afcd-ca5a865e1c85
AbhJ/some-cp-files-2
codeforces371D.cpp
#include <bits/stdc++.h> // #include <numeric> #define ll long long int #define ibs ios_base::sync_with_stdio(false) #define cti cin.tie(0) #define bp __builtin_popcount #define pb push_back using namespace std;//coded by abhijay mitra const int N=2e5+10; const ll M = 1e9+7; // Mulo #define F first #define S second #de...
ALGO
0.999907
3.925787
2e7cddcb-9002-450f-9aac-f05973b69ee6
buptzqr/play-leetcode
40.组合总和-ii.cpp
/* * @lc app=leetcode.cn id=40 lang=cpp * * [40] 组合总和 II */ // @lc code=start //这里避免重复的方式就是先排序,然后统计每个出现的次数,然后按选择或者不选择当前元素 // 来寻找排列,如果选择当前元素的话,要考虑选择多少个当前元素 class Solution { private: vector<vector<int>> res; vector<pair<int, int>> frequency; public: void solve(int target,int index,vector<int>&rec){ ...
ALGO
0.999985
6.463397
4c342a51-fac6-414c-999c-61a819896899
Joselu549/PracticasAOC
Practica1/peak-performance/peak-freq.cpp
#include <cassert> #include <cstdio> #include <memory> #include <atomic> #include <thread> #include <chrono> #include <fstream> #include <algorithm> #include <omp.h> #include "util.h" using namespace std; const int array_size = 4096; const int max_threads = 1024; struct { double test_duration = 15; size_t thread...
TOOL
0.964103
5.701972
8bf1f01a-24ad-48ee-9424-297683711b1b
ishandutta2007/codeforces
ljecll/normal/1326/A.cpp
#include <bits/stdc++.h> using namespace std; template<class T, class U> void ckmin(T &a, U b) { if (a > b) a = b; } template<class T, class U> void ckmax(T &a, U b) { if (a < b) a = b; } #define MP make_pair #define PB push_back #define LB lower_bound #define UB upper_bound #define fi first #define se seco...
ALGO
0.99959
3.87663
d41e2673-0f98-4ce5-ae18-1914c40d9045
nguyentuss/Competitive-Programming
CP/OnlineJudge/VNOJ/potato.cpp
#include <bits/stdc++.h> using namespace std; int main(){ ios::sync_with_stdio(0); cin.tie(NULL); string s; while (cin >> s) { if (s != "[CASE]") break; if (s == "[END]") return 0; int n; cin >> n; if (n % 5 == 2 || n % 5 == 0) cout << "Hanako" << '\n'; else cout << "Taro" << '\n'; } return 0; }
ALGO
0.998016
4.234237
16404d56-396c-4726-80f3-075c7c9fcaee
magyarakoos/contest-prog
cses/1746/main.cpp
#include <bits/stdc++.h> #define cinv(v) for (auto& e : v) cin >> e; #define all(v) v.begin(), v.end() #define rall(v) v.rbegin(), v.rend() #define size(v) (int)v.size() using namespace std; using ll = long long; constexpr int MOD = 1e9 + 7; int main() { cin.tie(0), ios::sync_with_stdio(0); int N, M; c...
ALGO
0.999996
4.66389
aceb4720-b452-4a16-99f0-661a12259945
ArundhotiKar/Algorithm-Lab-work-2.2-sem-220136
Problem_02.cpp
#include <bits/stdc++.h> using namespace std; using namespace chrono; int binarySearch(int arr[], int n, int target, int& comparisons) { int left = 0, right = n - 1; while (left <= right) { comparisons++; int mid = left + (right - left) / 2; if (arr[mid] == target) retur...
ALGO
0.999623
6.428977
4c656b35-d8a9-4cb2-a342-40d3c421509f
turtlegold-nation/derogold
src/zedwallet++/ParseArguments.cpp
/////////////////////////////////////// #include <zedwallet++/ParseArguments.h> /////////////////////////////////////// #include <cxxopts.hpp> #include <config/CliHeader.h> #include <config/Config.h> #include <config/CryptoNoteConfig.h> #include <config/WalletConfig.h> #include <Utilities/Utilities.h> #include "ver...
CONFIG
0.934808
5.69817
495b1eb4-0e18-428c-816e-abc96cbcb421
Chinmayd2112/competitive_Programming
B_Array_Reodering.cpp
#include<bits/stdc++.h> using namespace std; int main() { int t; cin>>t; while(t--) { int n; cin>>n; int a[n]; vector<int> v; vector<int> v1; for (int i = 0; i < n; i++) { cin>>a[i]; /* code */ } int count...
ALGO
0.999656
3.782032
75a075e2-5dd4-4c16-ac93-f16181c6685e
ishandutta2007/codeforces
romka/normal/135/A.cpp
#include <iostream> #include <cstdio> #include <string> #include <vector> #include <memory.h> #include <cstring> #include <ctime> #include <cmath> #include <set> #include <map> #include <algorithm> using namespace std; #define forn( i,n ) for ( int i=0; i<(int)(n); i++ ) #define foreach( it, a ) for ( __typeof((a).beg...
ALGO
0.999921
3.281065
ed72aced-7371-4ba1-8f9e-0e25aa56e5e7
Mindjolt2406/Competitive-Programming
AtCoder/EduDP/R.cpp
#include<bits/stdc++.h> // g++ -std=c++17 -Wl,-stack_size -Wl,0x10000000 main.cpp #define mt make_tuple #define mp make_pair #define pu push_back #define INF 1000000001 #define MOD 1000000007 #define EPS 1e-6 #define ll long long int #define ld long double #define fi first #define se second #define all(v) v.begin(),v.e...
ALGO
0.999994
4.533345
6397ffe2-7b3b-416d-8d5d-f32180c89b00
Vimal2023/GFG-_21days-POTDs-Challenge
Day2/middle-of-a-linked-list.cpp
#include <iostream> #include <sstream> #include <string> #include <vector> using namespace std; struct Node { int data; struct Node* next; Node(int x) { data = x; next = NULL; } }; void printList(Node* node) { while (node != NULL) { cout << node->data << " "; node ...
ALGO
0.999722
5.549278
51260a33-2442-4757-8572-ec206811fb99
stas2z/marlin-aquila
buildroot/share/PlatformIO/variants/MARLIN_LERDGE/variant.cpp
#include "pins_arduino.h" #ifdef __cplusplus extern "C" { #endif const PinName digitalPin[] = { PB_12, PB_13, PB_14, PB_15, PD_8, PD_9, PD_10, PD_11, PD_12, PD_13, PD_14, PD_15, PG_2, PG_3, PG_4, PG_5, PG_6, PG_7, PG_8, PC_6, PC_7, PC_8, PC_9, PA_8, PA_9, PA_10, PA_11, PA_12, PA_13, PA_1...
CONFIG
0.941526
5.010884
5b5515b1-0c75-417c-b93e-42ecc87aff53
fanghao1024/poj
2524.cpp
#include<cstdio> #include<cstring> #include<algorithm> using namespace std; const int max_n=5e4+10; int par[max_n]; int N,M; void init(int n){ for(int i=1;i<=n;i++) par[i]=i; } int find(int x){ if(x!=par[x]){ par[x]=find(par[x]); } return par[x]; } void unite(int x,int y){ int rx=find(x); int ry=find(y); if(r...
ALGO
0.999892
4.524856
1624ce72-876d-4351-818e-84f58e6cd7ac
KartikeyJadli/LEETCODE
0027-remove-element/0027-remove-element.cpp
class Solution { public: int removeElement(vector<int>& nums, int val) { int i = 0; int n = nums.size(); for(int j=0;j<n;j++){ if(nums[j] != val){ nums[i] = nums[j]; i++; } } return i; } };
ALGO
0.998873
6.123937
4ce522f7-d4e2-4df8-aa26-90071ec3aeaa
mohammadShamimReza/c_programming
Data-structure/final_assignment/Pairs.cpp
#include<bits/stdc++.h> using namespace std; bool cmp(pair<string, int> a, pair<string, int> b ) { if(a.first > b.first){ return false; }else if(a.first == b.first){ if(a.second > b.second){ return true; }else{ return false; } }else{ return tr...
ALGO
0.999597
4.567259
27e13616-af36-423e-8e60-dcaba24f8812
VladOS-byte/algo-itmo
term-4-1/C.cpp
#include<iostream> #include<vector> struct Node { int id; Node(int id) { this->id = id; } struct Edge { Node * from; Node * to; Edge(Node * from, Node * to) { this->from = from; this->to = to; } }; bool visit = false; bool i...
ALGO
0.999863
4.141769
1220b74c-2b9a-4b7a-9435-68bfeeed1056
ishangoyal13/fullstackDevelopment
C++/Random_programs/Counting Paths.cpp
#include<bits/stdc++.h> // #include <ext/pb_ds/assoc_container.hpp> // #include <ext/pb_ds/tree_policy.hpp> // using namespace __gnu_pbds; using namespace std; template<typename... T> void see(T&... args) { ((cin >> args), ...);} template<typename... T> void put(T&&... args) { ((cout << args << " "), ...);} template<ty...
ALGO
0.999779
3.917904
77f67fe4-c958-429b-b273-7ef4e6a2f4ce
Radhesh-Sarma/Competitive-Coding
codeforces/1140/D.cpp
#include<bits/stdc++.h> using namespace std; #define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); #define endl "\n" #define SQ(a) (a)*(a)you #define f first #define s second #define int long long #define PB push_back #define MP make_pair #define db long double #define all(a) a.begin(), a.end() #define trace1(x...
ALGO
0.999924
4.7151
3b99efd8-d584-4074-a89c-1437f98e0e32
ed38uM17Q7DQmWbT/LC75
LC75/38.cpp
//328. Odd Even Linked List /** * 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 { publi...
ALGO
0.999687
5.623681
c4681fe3-2c45-4f71-822f-812b8b93d7c7
TCGBench/TCGBench
data/human_performance_code/human_performance_code_canonical/P3812/ac_1.cpp
#include<bits/stdc++.h> #define int long long using namespace std; struct XXJ { vector<int>bit; XXJ (int x) { bit.resize(x); } void insert(int x) { int i; for(i=49;i>=0;i--) { if(((x>>i)&1ll)==0) continue; if(bit[i]==0) ...
ALGO
0.999952
4.277312
224d2233-04e2-4574-97e6-81d00a9c236f
Bevia/RSA_Cpp
RSA_Signing/signing.cpp
#include <iostream> #include <openssl/rsa.h> #include <openssl/pem.h> #include <openssl/err.h> #include <openssl/sha.h> #include <cstring> void handleErrors() { ERR_print_errors_fp(stderr); abort(); } // Function to generate RSA key pair RSA* generateKeyPair() { int bits = 2048; unsigned long e = RSA_...
ALGO
0.998731
6.751603
70893796-93d0-4a0d-b7a0-7643e7ca3f5c
AcaiHi/Sunny
4A.cpp
#include<iostream> using namespace std; int n; bool flag; int main(){ cin >> n; flag = n % 2 || n < 4; cout << ((flag)?"NO\n":"YES\n"); }
ALGO
0.999716
3.351972
3b0520de-68f7-49ef-99ca-3bd6bef6df4e
Loki-chen/Compile_via_MLIR
third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.merge/inplace_merge.pass.cpp
// <algorithm> // template<BidirectionalIterator Iter> // requires ShuffleIterator<Iter> // && LessThanComparable<Iter::value_type> // void // inplace_merge(Iter first, Iter middle, Iter last); #include <algorithm> #include <random> #include <cassert> #include "test_macros.h" #include "test_iterators.h...
TEST
0.996196
6.51271
e4faa232-de7e-4dd1-a15f-b23f5e3ee131
Lakedemon/DynamicSound
NativeCode/Plugin_Spatializer.cpp
// Please note that this will only work on Unity 5.2 or higher. #include "AudioPluginUtil.h" #include "VisualStudio/Context.h" #include "VisualStudio/RayTracer.h" #include "cmath" extern float hrtfSrcData[]; namespace Spatializer { enum { P_ID, P_ENERGY_REFLECTION_FRACTION, P_ENERGY_L...
ALGO
0.973645
6.964268
b3cd0bb0-3e8c-4974-90d9-4815f6b7a273
Been98/Study
Study/baekjoon/bj_AC.cpp
#include <string> #include <iostream> #include <deque> using namespace std; int main() { int T; cin >> T; for(int j = 0; j <T; j++){ string s; int n; //arr size string arr; cin>>s>>n>>arr; deque<int> dq; string num = ""; for(int i =0; i < arr.leng...
ALGO
0.999438
4.540706
681851e7-2331-471e-9c3c-e74bdaae50f2
hayashi-ryo/atcoder
docker/problems/cpp/tessoku-book/a19/main.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, x) for (int i = 0; i < (x); i++) int main() { int N, W; cin >> N >> W; vector<pair<ll, ll>> goods(N + 1); rep(i, N) cin >> goods[i + 1].first >> goods[i + 1].second; vector<vector<ll>> dp(N + 1, vector<ll>(W + 1, 0)); for ...
ALGO
0.999926
4.265435
8c7f66a0-2e10-4cb5-bd0b-1e4f53c8df05
Piyush-daryapurkar/conditional-statements-in-c-
type_of_input.cpp
#include<iostream> using namespace std; int main () { char n; cout<<"enter char : "; cin>>n; switch(n>=65 and n<=90) { case:1 { print("capital letter") break; } case:0{ switch(n>=97 and n<=122) { case:1{ cout<<"small latter"; break; } } break; } return 0; }
ALGO
0.994662
3.027306
142e0d98-88b9-469a-8297-f2191f09d4fb
anurag-sketch/Practice-Questions
2185-counting-words-with-a-given-prefix/2185-counting-words-with-a-given-prefix.cpp
class Solution { public: int prefixCount(vector<string>& words, string pref) { int count = 0; int x = pref.size(); for(int i=0;i<words.size();i++) { string s; s= words[i].substr(0,x); if(pref == s) { count++; ...
ALGO
0.999886
6.041153
726f1567-cafc-44e2-96f7-d116bc023322
bruce1408/Alogrithm_Datastruct
Linked_List/21_Merge_two_sorted_list.cpp
#include <iostream> #include <vector> using namespace std; /** * Merge two sorted linked lists and return it as a new list. * The new list should be made by splicing together the nodes of the first two lists. * * Example: * Input: 1->2->4, 1->3->4 * Output: 1->1->2->3->4->4 * * 给定两个升序排列的链表,然后他们合并成一个新的升序排列的链表...
ALGO
0.99997
5.639021
cfa2a846-f992-4419-bbd5-efe221c51d01
doorOfChoice/algorithm
coj/1061.cpp
#include <iostream> #include <string> #include <vector> #include <deque> #include <set> #include <algorithm> #include <math.h> #include <memory.h> #include <ctype.h> #define MAX(a, b) a > b ? a : b #define MIN(a, b) a > b ? b : a #define FILE_IN "D:\\linuxshare\\c\\algorithm\\data.in" #define FILE_OUT "D:\\linuxshare\\...
ALGO
0.999717
3.521556
fb7dae16-ba32-4749-851d-6153e45e52ec
ishandutta2007/codeforces
rainair/normal/1383/E.cpp
#include <algorithm> #include <iostream> #include <cstring> #include <climits> #include <cstdlib> #include <cstdio> #include <bitset> #include <vector> #include <cmath> #include <ctime> #include <queue> #include <stack> #include <map> #include <set> #define fi first #define se second #define db double #define U unsign...
ALGO
0.999977
3.80205
84b9ed2f-bc36-4d45-ac19-badf2350bd0b
jsyeh/2023aaib3
week09/week09-5.cpp
// SOIT108_Base_013 // UgD #include <iostream> using namespace std; int main() { int now, total=0; while( cin >> now ){ if(now==0) break; if(now>0) total += now; } cout << total; }
ALGO
0.999326
3.495532
c34598d9-186f-4dd2-b092-95a2157f7425
JHeon-Lee/Baekjoon-advanced1
Baekjoon advanced1/2444.cpp
#include <iostream> using namespace std; int main() { int n; cin >> n; while (n > 100 || n < 1) cin >> n; for (int i = 0; i < n; i++) { for (int j = 0; j < n - i -1; j++) { cout << " "; } for (int k = 0; k < 2 * i + 1; k++) { cout << "*"; } cout << endl; } for (int i = 0; i < n - 1; i++...
ALGO
0.999754
3.247251
2d65a2f2-371b-4c06-a9ee-fe7d4a7fe1b9
qtcyy/LeetCode-Record-3.17
动态规划/chapter9/9.1/No2403/main.cpp
#include <bit> #include <climits> #include <cmath> #include <iostream> #include <vector> using namespace std; class Solution { public: long long minimumTime(vector<int> &power) { int n = power.size(); vector<long long> f(1 << n, LLONG_MAX); f[0] = 0; for (int s = 1; s < 1 << n; s++) { int i = p...
ALGO
0.999775
5.715527
6050bf71-21e7-48ae-9e0e-b4720c20ebd4
andrewmegaris/mpc_project
src/Eigen-3.3/doc/examples/TutorialInplaceLU.cpp
#include <iostream> struct init { init() { std::cout << "[" << "init" << "]" << std::endl; } }; init init_obj; // [init] #include <iostream> #include <Eigen/Dense> using namespace std; using namespace Eigen; int main() { MatrixXd A(2,2); A << 2, -1, 1, 3; cout << "Here is the input matrix A before decompositi...
ALGO
0.999433
3.804785
b9a5e5da-a481-4b05-a537-2ca6eacea356
ishandutta2007/codeforces
nikolapesic2802/normal/1133/D.cpp
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #include <ext/rope> #define ll long long #define pb push_back #define sz(x) (int)(x).size() #define mp make_pair #define f first #define s second #define all(x) x.begin(), x.end() #define D(x) cerr << #x << " is " <<...
ALGO
0.999966
3.687433
ab781775-fffc-496b-ba17-573375027da6
minSsan/algorithm
삼성SW역량기출/240926/[24.09.26]2021하반기(오후1번).cpp
// 문제 링크 - https://www.acmicpc.net/problem/23290 // 시간 - 2시간 50분 소요 (!힌트 보고 문제 해결) #include <iostream> #include <queue> #include <vector> #include <algorithm> using namespace std; int m, s; // m: 물고기 수, s: 연습 횟수 queue<int> grid[4][4]; // {i, j}에 있는 물고기의 방향들을 저장 queue<int> temp[4][4]; // 복제를 위한 임시 배열 queue<int> move_...
ALGO
0.999752
5.153583
d1f11bd3-add5-4d71-9bc7-9d8e5fd289e2
makeevmr/LeetCode
Medium/0206/ReverseLinkedList.cpp
/* Given the head of a singly linked list, reverse the list, and return the reversed list. Time complexity: O(n) Additional memory complexity: O(1) Idea: use three pointers (prev, curr, next) */ // Definition for singly-linked list. struct ListNode { int val; ListNode* next; ListNode() : val(0), ne...
ALGO
0.999167
6.073711
721d2ada-267f-4d09-9f85-6e07a103c37b
WithNotebook/WithLaptop
aeri.youn/220908_backjoon2138.cpp
#include <iostream> #include <string> using namespace std; int main() { int N = 0; cin >> N; bool before[100001]; bool after1[100001]; bool after2[100001]; string a = ""; cin >> a; for (int i = 0; i < a.size(); i++) { before[i + 1] = a[i] - '0'; } string b = ""; cin >> b; for (int i = 0; i < b.size();...
ALGO
0.99999
3.430573
442131d5-e47f-4d10-91c0-2334d45890c6
davidlorenzo47/cpp-java-and-dsa
Competitive Programming in cpp/Microsoft/53_MaximumSubarray_Array_DynamicProgramming_DivideAndConquer_Medium.cpp
#include <iostream> #include <bits/stdc++.h> #include <algorithm> #include <vector> using namespace std; template <class T> void display(vector<T> &v) { for (int i = 0; i < v.size(); i++) { cout<<v[i]<<" "; //cout<<v.at(i)<<" "; } cout<<endl; } template <class T> void vecip(vector<T> &...
ALGO
0.999477
4.469698
436712ad-80b5-4222-9008-f316b6555013
simplest-ayush/Cpp-Programming
pattern13.cpp
#include<iostream> using namespace std; int main(){ int n; cin>>n; int i=1; while(i<=n){ int j=1; while(j<=i){ char ch='A'+i-1; cout<<ch<<" "; j=j+1; } cout<<endl; i=i+1; } }
ALGO
0.999674
3.878582
f45ba842-e0fe-4251-a6fe-e11cfc5555d0
raincross7/code-similarity
codes/train_code/problem008/problem008_266.cpp
#include <bits/stdc++.h> using namespace std; int main(void){ int N; cin >> N; double x[N]; string y[N]; double total = 0; for(int i = 0 ; i < N ; i++){ cin >> x[i] >> y[i]; if(y[i] == "JPY"){ total += x[i]; }else{ total += x[i] * 380000.0; ...
ALGO
0.998203
4.071438
67607b3f-f72b-4aa2-afab-e5aef64d616d
gallu/CareerCollege
C/2020/12限/LatterPeriod/34.cpp
// 34.cpp // cl /EHsc 34.cpp #include <iostream> #include <string> class Hoge { public: Hoge(int v) : i(v), j(v) {} void print(); // int operator+ (int v); Hoge operator= (int v); // Hoge operator+ (const Hoge &v); Hoge operator= (const Hoge &v); private: int i; int j; ...
TOOL
0.8828
3.751508
18d5e9f1-3b2a-4d05-8880-84952a3082f4
md-jonayed/Phitron_Course
Semester 1/C++/Module 7.5(Practice Problems)/4.problem4.cpp
#include<bits/stdc++.h> using namespace std; class Student{ public: string name; int roll; float marks; }; bool cmp(Student a, Student b){ if(a.marks>=b.marks) return true; else if(a.marks==b.marks){ if(a.roll>b.roll)return true; } else return false; } int main(){ int size; ...
ALGO
0.999072
4.024937
228a7155-7189-478f-ae21-81d6a092b2c4
raincross7/code-similarity
codes/train_code/problem482/problem482_70.cpp
# include <iostream> # include <iomanip> int main() { int H, W; while(true){ std::cin >> H >> W; if(H == 0 && W == 0) break; for(int y = 0; y < H; y++){ for(int x = 0; x < W; x++){ if( x == 0 || y == 0 || x == W-1 || y == H-1) std::cout << "#"; else std:...
ALGO
0.998072
3.677095
0211dcf6-cf4f-45f7-9a01-b6bbdf5ae024
113bommy/deepmind_codecontests_refine
cpp_gold_filter_file/cpp_train_5246_16.cpp
#include <bits/stdc++.h> using namespace std; int main() { int n; string steps; cin >> n >> steps; int start; ; int finish; for (int i = 1; i < n; i++) { if (steps[i] != '.') { start = i + 1; break; } } for (int i = 0; i < n; i++) { if (steps[i - 1] == 'R' && steps[i] != 'R') {...
ALGO
0.999943
3.359284
332beec2-ad12-4d12-b776-7d1692214856
JaipreethTiruvaipati/ANALYSING_PATTERNS_OF_CP
2_prefix_and_partial_sum.cpp/2_prefix_sum_range_query.cpp
/* Problem: Prefix Sum Range Queries You are given an array `A` of `N` integers and `Q` queries. Each query contains two integers `L` and `R`. For each query, output the sum (A[L] + A[L+1] + ... + A[R]) modulo 10^9+7. Constraints: - 1 ≤ N, Q ≤ 10^6 - -1e9 ≤ Ai ≤ 1e9 - 1 ≤ L ≤ R ≤ N Efficient Approach: - Precompute p...
ALGO
0.999939
5.506903
2436cb98-3ba2-470b-b973-086f4540c491
denizumuteser/CS_201
HW 2/denizumut_THE2.cpp
#include <iostream> #include <iomanip> #include <string> #include "strutils.h" using namespace std; bool check_input(string color, double width, double height, double length) { if (width > 0 && height > 0 && length > 0) { return true; } else { cout << "Invalid entry for " << color << " cuboid. Dimensions should...
TOOL
0.853345
4.45212
c2d6b229-1ca5-42c5-aa1c-a158863d8603
momalab/e3
src/cpp_share/util/def_palisade_ckks_util1.cpp
// Palisade serialization #include "ciphertext-ser.h" #include "cryptocontext-ser.h" #include "pubkeylp-ser.h" #include "scheme/ckks/ckks-ser.h" #include "utils/serialize-binary.h" #include "e3util.h" #include "base64.h" #include "def_palisade_ckks1.h" using namespace std; namespace e3 { namespace palisade_ckks { ...
TOOL
0.939566
6.308431
9b4b19db-6e02-4bf2-b5f3-a2f3af46b698
wit543/UVA
Hartals.cpp
#include "iostream" #include "string" using namespace std; main(){ int n; cin >> n; for(int i=0;i<n;i++) { int d; cin >> d; int t; cin >> t; int array[t]; for(int j =0;j<t;j++){ cin>>array[j]; } int c=0; for(int a=1;a<=d;a...
ALGO
0.999095
3.24021
c0f4bda4-c9fb-4f89-a53c-febe2f34a275
AmerMehmedovic/Cplusplus-projects
Najveci broj od tri broja.cpp
#include <iostream> using namespace std; int main() { double n1, n2, n3; cout << "Unesite tri broja: " << endl; cin >> n1 >> n2 >> n3; if (n1 >= n2 && n1 >= n3) { cout << n1 << " Je najveci broj" << endl; } else if (n2 >= n1 && n2 >= n3) { cout << n2 << " Je najveci broj" << endl; } else { cout <...
ALGO
0.995091
4.205202
8fd9a329-c7bb-4d28-af30-deac3ac82bf7
UnderratedGignac/ecommerce
windows/runner/utils.cpp
#include "utils.h" #include <flutter_windows.h> #include <io.h> #include <stdio.h> #include <windows.h> #include <iostream> void CreateAndAttachConsole() { if (::AllocConsole()) { FILE *unused; if (freopen_s(&unused, "CONOUT$", "w", stdout)) { _dup2(_fileno(stdout), 1); } if (freopen_s(&unuse...
TOOL
0.998733
6.76775
a7e2a038-c93f-407f-a888-47c81e6cde3d
toantang/AlgorithmCodeLearn
Medium/primeDivisor.cpp
#include <bits/stdc++.h> using namespace std; vector<int> v; int countDivisor(int n) { int cnt = 0; int sign = false; for (int i = 2; i <= n; i++) { while(n%i == 0) { n = n/i; sign = true; } if (sign == true) { v.push_back(i); cnt++;...
ALGO
0.999804
4.132923
5bb00a3f-0e3b-48aa-87d1-1013143dcba9
raincross7/code-similarity
codes/train_code/problem479/problem479_214.cpp
/*-------------------------------* | Name: Ayush Kumar | | Site: CSES | | Email: <EMAIL> | *-------------------------------*/ #include<bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define mp make_pair #define mod 1000000007 #define INF (ll) 1e18 cons...
ALGO
0.999956
4.381706
b4f97b6c-8f08-4e8b-9470-822ee0a2b465
Future-Internet-Research-Lab-TJU/AGCSketch
heavy_hitter.cpp
#include<stdio.h> #include<fstream> #include<set> #include<vector> #include <chrono> #include "agc.h" using namespace std; #define START_FILE_NO 1 #define END_FILE_NO 1 #define HEAVY_HITTER_THRESHOLD(total_packet) (total_packet * 0.02/100) #define Guide_Candidate_Mem (50 * 1024) #define BUCKET_NUM ((TOT_MEM_IN_BYT...
DATA
0.920557
3.382429
3d46246a-3b9f-460f-ae17-c086849d3361
yliow/work-study
courses/ciss350/n/asymptotics/tmp/main.cpp
#include <iostream> #include <vector> std::ostream & operator<<(std::ostream & cout, const std::vector< int > & x) { for (auto e: x) { cout << e << ' '; } return cout; } std::vector< int > swap(std::vector< int > x, int i, int j) { int t = x[i]; x[i] = x[j]; x[j] = t; return x;...
ALGO
0.999814
5.192442
9b87ad49-6fc0-47ed-81d4-b5fc9ed10f33
gandrewstone/GameMaker
tools/BORLANDC/TVISION/SOURCE/TLSTVIEW.CPP
/*------------------------------------------------------------*/ /* filename - tlstview.cpp */ /* */ /* function(s) */ /* TListViewer member functions ...
TOOL
0.936647
5.464362
a501fe39-60e9-45dd-a6dd-a4d6007bd177
vrnanshuman/Leetcode
42-trapping-rain-water/42-trapping-rain-water.cpp
class Solution { public: int trap(vector<int>& height) { int l,r,lmax,rmax, water = 0; l=0;r=height.size()-1; lmax = rmax = 0; while(l<r) { lmax = max(lmax, height[l]); rmax = max(rmax, height[r]); if(lmax < rmax) { ...
ALGO
0.999992
6.825041
a2dd2642-faf0-4ae2-8ee0-f20c6357158a
sanchawla17/100DaysOfCoding
Day 050/isSubsequence.cpp
//392 class Solution { public: bool isSubsequence(string s, string t) { int idx=0; for(int i=0 ; i<t.size() ; i++){ if(t[i] == s[idx]) idx++; } if(idx == s.size()) return true; else return false; } };
ALGO
0.999958
6.052982
2e3b77ae-3de1-4981-ab27-07ac372e4e24
jamarshon/Leetcode
200-209/201BitwiseANDofNumbersRange.cpp
/* 201. Bitwise AND of Numbers Range Given a range [m, n] where 0 <= m <= n <= 2147483647, return the bitwise AND of all numbers in this range, inclusive. For example, given the range [5, 7], you should return 4. /* Submission Date: 2017-07-25 Runtime: 29 ms Difficulty: MEDIUM */ #include <climits> #incl...
ALGO
0.999512
6.526526
d79a8737-cecd-4716-bcbf-7b9269e69759
prince4panwar/DSA-CPP
11. Queue_Dynamic_Array.cpp
#include<iostream> #include<conio.h> using namespace std; class Queue_Array { private: int capacity; int front; int rear; int *ptr; public: Queue_Array(){ptr=NULL;capacity=0;rear=-1;front=-1;} void create_Queue(int cap); void push(int data); void pop(); void queue_front(); void q...
ALGO
0.997641
3.520192
ca084be6-9c40-4da2-862f-88f4ebdbdeb6
MLamarcq/42-School
Common-Core/Pool_c++/cpp09/ex02/PmergeMe.cpp
#include "PmergeMe.hpp" PmergeMe::PmergeMe(void) { return ; } PmergeMe::PmergeMe(int argc, char**argv) { for(int i = 1; i < argc; i++) { std::string str(argv[i]); this->_vector.push_back(std::atoi(str.c_str())); this->_deque.push_back(std::atoi(str.c_str())); } return ; } PmergeMe::PmergeMe(PmergeMe const...
ALGO
0.998604
4.250125
b990cd31-bd1f-497a-880e-084b86e6fb9d
Pulkit1822/GeeksforGeeks
Medium/Top k numbers in a stream/top-k-numbers-in-a-stream.cpp
//{ Driver Code Starts #include<bits/stdc++.h> using namespace std; class Array { public: template <class T> static void input(vector<T> &A,int n) { for (int i = 0; i < n; i++) { scanf("%d ",&A[i]); } } template <class T> static void print(vector<T> &A) ...
ALGO
0.999906
5.542973
345c1d89-da8a-406a-bde9-e49b2e0df961
Haise-Kuragani/Daniyal
Assignment 1/Task 2/Assignment 2/Main.cpp
#include"Header.h" using namespace std; int main() { MyChar first_Object; char p; cout << "Enter the value of MyNum :" << endl; cin >> p; first_Object.setcharacter(p); first_Object.getcharacter(); first_Object.display(); int size; cout << "Enter size" << endl; cin >> size; MyChar* Object_Array = ...
ALGO
0.985249
3.661494
0ba3f50d-c0f9-427f-9e53-a89e16d65974
yuchenle/ppc-bsc-llvm-taskgraph
libcxx/test/std/algorithms/alg.sorting/alg.merge/inplace_merge_comp.pass.cpp
// <algorithm> // template<BidirectionalIterator Iter, StrictWeakOrder<auto, Iter::value_type> Compare> // requires ShuffleIterator<Iter> // && CopyConstructible<Compare> // void // inplace_merge(Iter first, Iter middle, Iter last, Compare comp); #include <algorithm> #include <functional> #include <rand...
TEST
0.998705
6.536275
cc559259-d9b2-495e-9179-2695c12f4f2d
Ghoul2077/CPP-DS-Programs
Binary Search Tree/PrintSumOfVerticalFromLinesLeftToRight/Untitled.cpp
#include <bits/stdc++.h> using namespace std; typedef long long unsigned int bigInt; #define mod 1000000007; struct Node { int data; Node *left; Node *right; Node(int val) { data = val; left = NULL; right = NULL; } }; class Tree { private: Node *root; Node* push(Node *roo...
ALGO
0.999915
4.335527
98431753-981b-4d56-b800-6acdebc2b622
shogun-toolbox/shogun
src/shogun/mathematics/linalg/ratapprox/tracesampler/ProbingSampler.cpp
#include <shogun/lib/common.h> #ifdef HAVE_COLPACK #include <ColPackHeaders.h> #include <vector> #include <string> #include <cstring> #include <shogun/lib/SGVector.h> #include <shogun/mathematics/eigen3.h> #include <shogun/mathematics/linalg/linop/SparseMatrixOperator.h> #include <shogun/mathematics/linalg/ratapprox/...
ALGO
0.990109
6.799427
67fcecfc-d108-4932-87bb-645c8f07702a
iiaa12345/acmp
task71.cpp
#include <iostream> #include <vector> #include <limits> using namespace std; int main() { int n; cin >> n; int t; vector<int> a; for (int i = 0; i < n; i++) { cin >> t; a.push_back(t); } int min_diff = numeric_limits<int>::max(); vector<int> b(n, 0); while (true)...
ALGO
0.999989
4.358134
3f0e0cec-406f-4521-886e-281ae1044710
linbinwu/XCPC-Template
图论/Kruskal.cpp
int pre[N], m; struct edge { int u, v, w; bool operator < (const edge &rhs) const { return w < rhs.w; } } e[M * M]; int find(int x) { return x == pre[x] ? x : pre[x] = find(pre[x]); } int kruskal() { int cnt = 0, ans = 0; for (int i = 1; i <= m; i++) { int u = find(e[i].u), v = f...
ALGO
0.999922
3.945326
e38cc261-b8cd-4442-9aa3-fac521a64f93
saturnboy/Physics
CrateStacker/CrateStacker/libs/Box2D/Dynamics/Joints/b2PulleyJoint.cpp
#include <Box2D/Dynamics/Joints/b2PulleyJoint.h> #include <Box2D/Dynamics/b2Body.h> #include <Box2D/Dynamics/b2TimeStep.h> // Pulley: // length1 = norm(p1 - s1) // length2 = norm(p2 - s2) // C0 = (length1 + ratio * length2)_initial // C = C0 - (length1 + ratio * length2) // u1 = (p1 - s1) / norm(p1 - s1) // u2 = (p2 -...
ALGO
0.986867
6.996031
9accfa42-e1c9-4c95-be79-f37914062711
ishandutta2007/codeforces
gyz_gyz/normal/1092/D2.cpp
#include<bits/stdc++.h> #define rep(i,x,y) for(int i=(x);i<=(y);++i) #define dep(i,x,y) for(int i=(x);i>=(y);--i) #define add(x,y) x=(x+(y))%mo #define sqr(x) ((x)*(x)) #define pb push_back #define fr first #define sc second #define clz __builtin_clz #define N 300000 #define mo 1000000007 #define eps 1e-8 #define inf 1...
ALGO
0.999993
3.428229
e9a2d7c5-29c8-4048-a346-d3f1c80331da
meghana-ganesh/Coding-Practice
BinarySearch/on Answers/MinDaysToMakeMBouqets.cpp
#include<bits/stdc++.h> int possible(vector<int> arr,int k,int m,int day) { int count=0; int noofB=0; for(int i=0;i<arr.size();i++) { if(arr[i] <= day) count++; else { noofB += (count/k); count = 0; } } noofB += (count/k); if(noofB >= m) return 1; else return 0; } int binary_search(vector<...
ALGO
0.999988
4.754587
aceae981-0cb9-44ce-ad9d-2dccdcfb6b8c
ishandutta2007/codeforces
sakurakoujiruna/normal/546/D.cpp
#include <bits/stdc++.h> using namespace std; const int N = 5000011; int pre[N]; int main() { //ios :: sync_with_stdio(false); for(int i = 2; i < N; i ++) if(pre[i] == 0) for(int j = i; j < N; j += i) for(int k = j; k % i == 0; k /= i) pre[j] ++; for(int i = 1; i < N; i ++) pre[i] += pre[i - 1]; ...
ALGO
0.999681
4.218537
54b9caf6-a259-4499-9db7-2983ff9b7655
shanzhou2186/olb-xeon-phi-0.8.0
src/core/offBoundaryCondition2D.cpp
#include "offBoundaryCondition2D.h" #include "offBoundaryCondition2D.hh" #include "latticeDescriptors.h" #include "latticeDescriptors.hh" namespace olb { template class OffBoundaryConditionInstantiator2D < double, descriptors::D2Q9Descriptor, BouzidiBoundaryManager2D < double, descriptors::D2Q9Descriptor, ...
ALGO
0.877553
5.575191
2de77f77-9521-42ef-afd4-e6323d7ac4b7
ishandutta2007/codeforces
alternatingcurrent/normal/706/C.cpp
#include<bits/stdc++.h> #define int long long using namespace std; int dp[100100][2]; int n; int a[100100]; string s[2][100100]; signed main(){ cin >> n; for(int i = 0; i < n; i++){ cin >> a[i]; } for(int i = 0; i < n; i++){ cin >> s[0][i]; s[1][i] = s[0][i]; reverse(s[1][i].begin(), s[1][i].end()); } mem...
ALGO
0.999989
3.639129
19143fe1-7424-4aba-96a0-8cb0afde92c2
ahmadsohail404/Cpp-DSA
Sorting Algorithm/01sort.cpp
#include <bits/stdc++.h> using namespace std; /* *Internal working of sort() function:- It is a hybrid of quick sort, heap sort and insertion sort. Worst case and average case --> O(nlogn). */ struct point { int x, y; }; bool myCmp(point p1, point p2) { return (p1.x < p2.x); } int main() { #ifndef ONLINE_J...
ALGO
0.999966
4.822792
550ec691-2295-473c-a397-3945659e7c3d
PolyhedraZK/Expander-cpp
benchmarks/bench_keccak.cpp
#include "field/M31.hpp" #include "LinearGKR/LinearGKR.hpp" #include <thread> #include <utility> #include <unistd.h> #include <mutex> #include <string.h> #include <stdio.h> #include <sched.h> using namespace gkr; using F = gkr::M31_field::VectorizedM31; using F_primitive = gkr::M31_field::M31; const bool debug = fals...
TOOL
0.968949
3.886569
df6163de-77c4-4355-b2a4-748e22e22fe7
Davi-Perdigao/Submit_College-C.C-UIT
1° Período/Lab. Int. C.C/Lista 1/1.cpp
/* Faa um programa para a leitura de duas notas parciais de um aluno. O programa deve calcular a mdia alcanada por aluno e apresentar: - A mensagem "Aprovado", se a mdia alcanada for maior ou igual a sete e menor que 10; - A mensagem "Reprovado", se a mdia for menor do que sete; - A mensagem "Aprova...
TOOL
0.976864
4.691785
20a4b810-a60f-4ec8-96b3-e15cb34c6e23
mamunur1296/C-learning
Data Stracture/module-2.5/F_Reversing.cpp
#include <bits/stdc++.h> #include <iostream> #include <vector> using namespace std; int main() { int n; cin>>n; vector<int>a(n); for (int i = 0; i < n; i++) { cin>>a[i]; } for (int i = n-1; i >=0; i--) { cout << a[i] << " "; } return 0; }
ALGO
0.999889
4.022171
daea06b5-d443-4f30-804a-d009add743cd
Prachi04Sharma/5th-Training
17.cpp
#include <iostream> using namespace std; //in an array 1 for insert 2 for del 3 for update 4 for select/read or 5 exit void show(int arr[], int size) { cout << "Array elements: "; for (int i = 0; i < size; i++) { cout << arr[i] << " "; } cout << endl; } void insert(int arr[], int& size, int v...
TOOL
0.986714
4.99871
44d5951e-a74a-4c09-80a0-b99bc041668c
JelmerHinssen/shadercompiler
src/functions.cpp
#include "parser.h" #include <iostream> #include <vector> #include <sstream> using namespace std; string Function::getPrototype() const{ stringstream prototype; if(line) { prototype << "inline "; } if(virt) { prototype << "virtual "; } prototype << type << " "; prototype <...
TOOL
0.868536
4.563549
a69b1b0d-a66d-4abf-a69d-363806f30dcf
VasiPeycheva/Introduction-to-Programming--2017-2020
09_memory_management/seminar/references_basics.cpp
/**************************************************************************** * This file is part of the "Introduction to programming" course. FMI 2019/20 *****************************************************************************/ /** * @file references_basics.cpp * @author Ivan Filipov * @date 12.2019 * ...
TOOL
0.895959
5.753272
596842ec-2037-4565-832f-31be0c8f3ff9
pnookala/X-OpenMP
llvm/lib/Option/OptTable.cpp
#include "llvm/ADT/STLExtras.h" #include "llvm/ADT/StringRef.h" #include "llvm/ADT/StringSet.h" #include "llvm/Option/Arg.h" #include "llvm/Option/ArgList.h" #include "llvm/Option/Option.h" #include "llvm/Option/OptSpecifier.h" #include "llvm/Option/OptTable.h" #include "llvm/Support/Compiler.h" #include "llvm/Support/...
TOOL
0.980118
5.23738
ee697389-5599-4277-a939-8c0a08efffcf
Jaanvi/leetcode
2054-two-best-non-overlapping-events/2054-two-best-non-overlapping-events.cpp
class Solution { public: int maxTwoEvents(vector<vector<int>>& events) { // Step 1: Sort events by their end times sort(events.begin(), events.end(), [](const vector<int>& a, const vector<int>& b) { return a[1] < b[1]; }); int n = events.size(); vector<int> maxVa...
ALGO
0.999576
6.727333
6f714d89-5e4f-4ccd-a078-a2515094ff73
raincross7/code-similarity
codes/train_code/problem422/problem422_149.cpp
#include <bits/stdc++.h> using namespace std; int main() { int targetAmount, yen1; cin >> targetAmount >> yen1; // 500で割ったあまりを算出する int surplus = targetAmount % 500; // 割ったあまりより1円玉が多ければ支払える if (yen1 >= surplus) { cout << "Yes" << endl; } else { cout << "No" << endl; } }
ALGO
0.99985
3.780039
6d9d8ecc-7e4f-448a-8f1e-5fc36bc06c10
azharnian/COMPUTERIGS2425
10/INFORMATIKA/C++/10-5/08/soal02.cpp
#include <iostream> #include <vector> using namespace std; int main() { vector<string> petList = {"Dog"}; petList.push_back("Cat"); petList.push_back("Fish"); petList.insert(petList.begin() + 1, "Golden Bandicoot"); petList.erase(petList.begin() + 0); for (string item : petList) { ...
TOOL
0.903668
4.094468
0ac2a70b-4efc-4375-b8d5-4e8e4c03cc86
rishichawla/CompetitiveProgramming
CodeChef/Chef And Operators.cpp
// https://www.codechef.com/problems/CHOPRT #include <iostream> #include <math.h> using namespace std; int main() { int t = 0; cin >> t; while (t--) { int a = 0, b = 0; cin >> a >> b; if (a > b) { cout << ">" << endl; } else if (a < b) ...
ALGO
0.999984
4.238647