uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
594ebaa5-c50c-48fa-a4fc-bf4faea1615b
yymin1022/Algorithm_Study
BOJ/14235.cpp
#include <bits/stdc++.h> using namespace std; int num[200001]; int main(){ cin.tie(NULL); cout.tie(NULL); ios_base::sync_with_stdio(false); int N; cin >> N; priority_queue<int> gift; while(N--){ int A; cin >> A; if(A == 0){ if(gift.empty()){ ...
ALGO
0.999797
3.950601
51fbf0b7-089d-420a-a898-670524e677f8
aditya2005uni/DSA_Leetcode
3415-check-if-grid-satisfies-conditions/check-if-grid-satisfies-conditions.cpp
class Solution { public: bool satisfiesConditions(vector<vector<int>>& grid) { int m=grid.size(); int n=grid[0].size(); for(int i=0;i<m;i++){ for(int j=0;j<n-1;j++){ if(grid[i][j]==grid[i][j+1]){ return false; } } ...
ALGO
0.999826
6.240724
79f0beb6-5fa0-4798-ba35-cd361e6fd7ba
tanvirmirza/cpp-code
Assign/printPositive.cpp
//Print the first hundred positive integer; #include<iostream> using namespace std; int main() { for(int i = 1; i<=100; i++) { cout<<i<<endl; } return 0; }
TOOL
0.986778
3.163765
62d3b497-b7b3-4326-a7d8-e737fca16dcb
ckxzero/codechef
SnapeAndLadder.cpp
#include <cmath> #include <cstdio> #include <vector> #include <iostream> #include <algorithm> using namespace std; double minDist(int a, int b) { if (a > b) return sqrt(a*a - b*b); return sqrt(b*b - a*a); } double maxDist(int a, int b) { return sqrt(a*a + b*b); } int main() { int t; // test cases int a, b;...
ALGO
0.9992
4.357295
2d566307-4e74-4ef1-b707-03b5318310c4
skotish06/Cplusplus-Repository
oj/chtoj/dehsgtinh10_23_24/INTP.cpp
#include <bits/stdc++.h> #define int long long #define MOD 1000000007 #define INF 1e18 #define MAXN 100005 #define FOR(i, a, b) for (int i = (a); i <= (b); i++) #define REP(i, n) FOR(i, 1, n) #define all(a) (a).begin(), (a).end() #define pb push_back #define fi first #define se second #define pii pair<int, int> #define...
ALGO
0.999864
4.452399
281264f8-bb25-4991-9bd9-191b183f4803
Viniciustda/UFMG
PDS 2 - Programação e Desenvolvimento de Software 2/Modulo 1/PDS2-At4-CircunferenciaTAD/MainCircunferencia.cpp
#include "Circunferencia.hpp" #include <iostream> #include <iomanip> using namespace std; int main() { double xc1, yc1, r1; cin >> xc1 >> yc1 >> r1; Circunferencia* circ1 = new Circunferencia(xc1, yc1, r1); double xc2, yc2, r2; cin >> xc2 >> yc2 >> r2; Circunferencia* circ2 = new Circunferencia(xc2, ...
ALGO
0.998321
4.208764
008f3df8-362f-4ab5-8050-a3172cf62611
gauravk268/Competitive_Coding
GFG/Lowest Common Ancestor in a Binary Tree.cpp
// { Driver Code Starts #include <bits/stdc++.h> using namespace std; // Tree Node struct Node { int data; Node* left; Node* right; }; Node * lca(Node* root,int n1,int n2); // Utility function to create a new Tree Node Node* newNode(int val) { Node* temp = new Node; temp->data = val; temp->left...
ALGO
0.999893
5.870451
8b3c0140-82f2-4f31-a20d-3443c21c63ff
liaoyaonline/LeetCodeNote
算法模板/通用/最长公共前缀/main.cpp
/*pow(16,i),queue.front()struct Tree{};vector<string> res(8, "");mp.find(key) == * mp.end() int a[5] = {},vector<int> num(a,a+..) set test; test.insert(1),auto * it = test.begin() bool cmp(const word &num1, const word &num2) { return num1.value != num2.value ? num1.value > num2.value: num1.name < num2.name;} v.ins...
ALGO
0.999829
4.885691
bc073eba-db47-40e5-8e1c-3ef8ec544b7a
pingjuiliao/softbound
llvm-project-13.0.0.src/llvm/tools/llvm-rc/ResourceScriptCppFilter.cpp
#include "ResourceScriptCppFilter.h" #include "llvm/ADT/StringExtras.h" #include <vector> using namespace llvm; namespace { class Filter { public: explicit Filter(StringRef Input) : Data(Input), DataLength(Input.size()) {} std::string run(); private: // Parse the line, returning whether the line should be i...
TOOL
0.903091
6.944091
761d42a7-81c1-4a51-bca7-8e8f8b6ed0f6
dmltdev/competitive-programming
leetcoding/medium-problems/medium.790/medium.790.cpp
#include <iostream> #include <vector> using namespace std; class Solution { public: int numTilings(int n) { if (n == 0) { return 0; } if (n == 1) { return 1; } if (n == 2) { } const int MOD = 1000000007; vector<i...
ALGO
0.999962
6.007301
6bf93d6a-3b59-4d5f-b88c-00653f80d790
Tranduchieu2002/leetcode_practice
Thuat toan ma hoa/hill/hill.cpp
// // Created by michael on 29/06/2023. // #include "hill.h" int main() { string encodeString = Hill().encode("HELP"); string decodeString = Hill().decode(encodeString); cout << "encodeString: " << encodeString << '\n'; cout << "decodeString: " << decodeString << '\n'; }
ALGO
0.998473
4.008278
0e00da96-0021-49e4-b811-8340c854c5e8
migueldar/42webserv
srcs/parser/CDConfigMapper.cpp
#include <iostream> #include <map> #include <vector> #include <stdexcept> enum ConfigType { SERVER_NAME, LOCATION, REDIRECT, ERROR_PAGE, PORT, ROOT, INDEX, METHODS, BRACE_CLOSE, UNKNOWN }; template <typename Payload > class ConfigMapper { public: typedef void (*FunctionPoi...
CONFIG
0.922635
4.428436
8ef3b157-356b-44d5-8f60-67346a6936e4
anissaseftiana/Tugas_flutter
flutter_foam/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.998092
6.76775
a975d21f-76a9-4ef2-896b-baf44c1a5b65
jeremie-majereno/suite-7-c-
tst362.cpp
#include <bits/stdc++.h> using namespace std; int main() { int a[10],i; for (i=0; i<10; i++) cin >> a[i]; sort (a,a+10); reverse (a,a+10); for (i=0; i<10; i++) cout << a[i] << endl; }
ALGO
0.999711
3.539498
668f5aee-de16-4d08-a0bb-7efc399b42e5
Harshkumar77/Data-Structure-Algorithm-cpp
26-two-pointers/subarray/perfect_number_size_k.cpp
#include <bits/stdc++.h> using namespace std; /** * Program to print maximum perfect numbers present in subarray of size K * * Perfect Number -> sum of divisor excluding it is equal to itself * Example - 6 = 1 + 2 + 3 * * Time Complexity : O(N) N->Size of array * Space Complexity : O(1) ...
ALGO
0.99996
4.59694
eede237d-b047-406d-b8ad-e1d81374dfb2
AMFTech512/aoc2019solutions
3/crossing-lines.cpp
#include <iostream> #include <stdlib.h> #include <sstream> #include <fstream> #include <string> #include <vector> using namespace std; struct segment { char dir; int length; }; void fillVec(vector<segment> &vec1, vector<segment> &vec2, string file) { ifstream input(file); if (!input.is_open()) { ...
ALGO
0.998037
4.299094
2de07dc8-7cb9-46dd-a54d-164119505313
Arka2009/ita3e
BoostGraph/src/KlausHuangListM.cpp
#include <iostream> #include <vector> #include <cstdlib> #include <random> #include <algorithm> #include <cmath> #include <string> #include <algorithm> #include <set> #include <queue> #include <gurobi_c++.h> #include "DataTypes.hpp" #include "ATG.hpp" /* Execute a tick */ int AppTaskGraph::execute(int M_X, double delt...
ALGO
0.999542
3.209458
c6f4d758-3bd0-4d91-91b1-f01256d74605
utmishr/codeforces
B_Traffic_Lights.cpp
#include <bits/stdc++.h> using namespace std; int main() { int l, d, v, g, r; cin >> l >> d >> v >> g >> r; double t1 = 1.0 * (d) / (v); double t2 = 1.0 * (l - d) / (v); long u = t1 / (g + r); t1 = t1 - u * (g + r); if (t1 >= g) { t1 = (u + 1) * (g + r); } cout << setprecision(10) << t1 + t2 <...
ALGO
0.996175
3.569773
22d39654-f527-420c-a545-3c90c8babc67
Mosina916/NOV22_C-_ND
Lecture26/cycledetection.cpp
#include<iostream> using namespace std; class node{ public: int data; node*next; node(int d){ next=NULL; data=d; } }; void insertathead(node* &head,node*&tail,int data){ if(head==NULL and tail==NULL){ // pehla node of ll node*n=new node(data); head=n; tail=n; } else{ // only change head no...
ALGO
0.999985
4.356845
0c3ba2c9-f9ea-402b-8518-1365ecb71470
ishandutta2007/codeforces
yyljkydr/normal/1630/D.cpp
#include<bits/stdc++.h> using namespace std; #define int long long const int N=1e6+1e3+7; int T,n,m; int a[N]; vector<int>v; int f[N][2]; signed main() { scanf("%lld",&T); while(T--) { scanf("%lld%lld",&n,&m); int ans=0,sum=0; for(int i=1;i<=n;i++) scanf("%lld",&a[...
ALGO
0.999904
3.315957
ec1a9cab-302d-40f7-aae9-246df2f78496
SEU-ACAL/reproduce-FireGuard-DAC-25
Software/parsec/pkgs/libs/tbblib/src/src/test/test_lambda.cpp
#define NOMINMAX #include "tbb/tbb.h" #include "tbb/combinable.h" #include <cstdio> #if !TBB_USE_EXCEPTIONS && _MSC_VER // Suppress "C++ exception handler used, but unwind semantics are not enabled" warning in STL headers #pragma warning (push) #pragma warning (disable: 4530) #endif #include <list> #if !...
TEST
0.916719
5.792995
ea151462-db4d-451b-87ba-1ca44a310167
monman53/online_judge
AtCoder/ARC/067/d.cpp
// header {{{ #include <iostream> #include <algorithm> #include <vector> #include <complex> #include <utility> #include <string> #include <sstream> #include <queue> #include <map> #include <list> #include <stack> #include <tuple> #include <cstdio> #include <cmath> using namespace std; #define ALPHABET 26 #define EP...
ALGO
0.999621
3.630682
9623c242-5f30-4064-9390-bcf9726563bd
lzyy2024/bustub
src/storage/index/b_plus_tree.cpp
#include <sstream> #include <string> #include "common/exception.h" #include "common/logger.h" #include "common/rid.h" #include "storage/index/b_plus_tree.h" namespace bustub { INDEX_TEMPLATE_ARGUMENTS BPLUSTREE_TYPE::BPlusTree(std::string name, page_id_t header_page_id, BufferPoolManager *buffer_pool_manager, ...
TOOL
0.952372
5.523419
0bdeb7f5-8410-4e92-b819-047de372ebd2
darlliu/gaussianuniform
src/main.cpp
#include"gucompute.h" auto routine( std::string fname, std::string pfx , bool bounded, int restarts){ std::vector<std::shared_ptr<gurunner>> gs; std::ifstream fs(fname); if (!fs.good()) { std::cerr << " Input file "<< fname <<" is not good! "<<std::endl; exit(0); } std::string s; ...
DATA
0.925782
3.1213
1c2233e5-e9d9-4a72-9a6d-9f7cf9c7d9e7
Trietptm-on-Coding-Algorithms/online-judge
codeforces/408/a.cpp
#include <iostream> #include <algorithm> using namespace std; int N; int k[101]; int t; int main() { cin >> N; for (int i = 0; i < N; i++) { cin >> k[i]; } int best = 0x7fffffff; for (int i = 0; i < N; i++) { int cur = 0; for (int j = 0; j < k[i]; j++) { cin >>...
ALGO
0.999472
3.507061
a6d08a67-842d-4fcd-aa11-62cd70dcbc71
HexHive/Sourcerer
clang-tools-extra/clangd/refactor/tweaks/ExtractFunction.cpp
#include "AST.h" #include "FindTarget.h" #include "ParsedAST.h" #include "Selection.h" #include "SourceCode.h" #include "refactor/Tweak.h" #include "support/Logger.h" #include "clang/AST/ASTContext.h" #include "clang/AST/Decl.h" #include "clang/AST/DeclBase.h" #include "clang/AST/NestedNameSpecifier.h" #include "clang/...
TOOL
0.925386
5.87307
073d0d93-1c96-4093-b4f3-00f16304507f
coding-net-cloud-studio/sf
zh-hant/codes/cpp/chapter_sorting/bubble_sort.cpp
/** * File: bubble_sort.cpp * Created Time: 2022-11-25 * Author: krahets (<EMAIL>) */ #include "../utils/common.hpp" /* 泡沫排序 */ void bubbleSort(vector<int> &nums) { // 外迴圈:未排序區間為 [0, i] for (int i = nums.size() - 1; i > 0; i--) { // 內迴圈:將未排序區間 [0, i] 中的最大元素交換至該區間的最右端 for (int j = 0; j < i;...
ALGO
0.999904
5.654388
740aa5e2-5404-42a0-8c2c-1596e133d822
luuvus/Udacity-SelfDrivingCar-T2-P5-ModelPredictiveControl
src/Eigen-3.3/doc/examples/TemplateKeyword_simple.cpp
#include <Eigen/Dense> #include <iostream> using namespace Eigen; void copyUpperTriangularPart(MatrixXf& dst, const MatrixXf& src) { dst.triangularView<Upper>() = src.triangularView<Upper>(); } int main() { MatrixXf m1 = MatrixXf::Ones(4,4); MatrixXf m2 = MatrixXf::Random(4,4); std::cout << "m2 before copy:"...
TOOL
0.976324
5.210898
177c42ab-5204-411e-bfe5-b97148bda92a
jeetmehta/hackerrank-cplusplus
STL/sets-stl.cpp
#include <cmath> #include <cstdio> #include <vector> #include <iostream> #include <set> #include <algorithm> using namespace std; int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT */ int size; cin >> size; set <int> container; for (int i = 0; i < size; i++) ...
ALGO
0.999758
4.125449
bccb8e03-a49d-4db1-aea8-8153a82d739d
Shivamchouhan7/Cpp-language
Vector/vector_09.cpp
#include <iostream> #include <vector> using namespace std; /*Give an integer array arr return the prefix sum/running sum in the same array without creating new array */ int main(){ int n; //size cout<<"Enter size of array :"; cin>>n; vector<int> arr(n); cout<<"Enter the elements of array :-\n"; ...
ALGO
0.99958
4.251905
68618a94-1d48-478c-a12a-415787edee23
AdvikarA/Comp-Coding
Bronze2021Fall/Contest0122/q3.cpp
#include <iostream> #include <algorithm> using namespace std; int main(){ long long t; cin >> t; long long rations; for(long long fi = 0; fi < t; fi++){ rations = 0; long long n; cin >> n; long long arr[n]; for(long long j = 0; j < n; j++){ cin >> arr[j]; ...
ALGO
0.999897
3.941137
c9a8b6ed-a4a5-4e62-9936-156d136f8762
ishandutta2007/codeforces
farhod_farmon/normal/1110/B.cpp
#include <bits/stdc++.h> #define fi first #define se second const int N = 100010; const int Q = 250200; const long long mod = 1e9 + 7; using namespace std; int n; int k; int m; int a[N]; int main() { //freopen("input.txt", "r", stdin); //freopen("output.txt", "w", stdout); ios_base::sync_wi...
ALGO
0.99998
3.582288
ca3ab848-6d61-48b2-8fd0-472b9264d220
gaming-hacker/jburkardt_cpp_src
vandermonde_approx_2d_test/vandermonde_approx_2d_test.cpp
# include <cmath> # include <cstdlib> # include <iostream> # include <iomanip> # include <ctime> # include <cstring> using namespace std; # include "vandermonde_approx_2d.hpp" # include "test_interp_2d.hpp" # include "qr_solve.hpp" # include "r8lib.hpp" int main ( ); void test01 ( int prob, int grid, int m ); double...
TEST
0.875988
6.134625
fbf855cc-8c54-402e-bf2b-de260a3902bf
morris821028/Testdata-generator-example
NTU-JudgeGirl/Week9practice/test.cpp
#include <iostream> #include <cstdio> #include <cstring> #include <string> #include <algorithm> #include <queue> #include <vector> #include <cmath> #include <cstdlib> #define L(rt) (rt<<1) #define R(rt) (rt<<1|1) #define ll long long #define eps 1e-6 using namespace std; const int maxn=105; int n,cnt,bestn; int G[maxn...
ALGO
0.999865
4.335675
2a792ed2-a4b5-40f3-89b5-cdfa7a73be89
abeesh/llvm-wine-patched
libc/src/math/generic/copysign.cpp
#include "src/math/copysign.h" #include "src/__support/FPUtil/ManipulationFunctions.h" #include "src/__support/common.h" namespace __llvm_libc { LLVM_LIBC_FUNCTION(double, copysign, (double x, double y)) { return fputil::copysign(x, y); } } // namespace __llvm_libc
ALGO
0.997343
5.739694
d72aa590-f65c-4868-bb0c-188bf1f87312
pa-one55/DSA-in-Cpp
Lecture 20+/L23_my_spiralArrayPrint.cpp
#include <iostream> using namespace std; int main() { //spiral printing an array int r = 5; int c = 5; int arr[5][5] ={ 1,2,3,4,5, 6,7,8,9,10, 11,12,13,14,15, 16,17,18,19,20, 21,22,23,24,25 }; // printing in o...
ALGO
0.99956
3.758011
b0ece0da-4bc1-4d4e-959e-cffac22cfcf4
AvoidAzmain/codeforces_problem
A_Lucky.cpp
#include<bits/stdc++.h> using namespace std; int main() { int n; cin>>n; while(n--){ int a; cin>>a; vector<int>s; if(a == 0) cout<<"YES"<<endl; else{ int cnt =6; while(cnt--){ s.push_back(a%10); a/=10; } if(s[0]+s[1]+s[2] == s[4]+s[3]+s[5...
ALGO
0.999881
4.121822
225e3d44-7ef1-4e1e-89c8-4f78a10c3091
MashrafiGit/Basic-C-plus-plus
string.cpp
#include <iostream> using namespace std; int main() { int x; cin >> x; string s; cin >> s; // char s[100]; // cin.ignore(); // ignore one input // cin >> s; // get whole sentence // fgets(s, 100, stdin); // cin.getline(s, 100); cout << x << " " << s << endl; ret...
TOOL
0.922666
3.648253
742e03cf-5b61-4ebe-9840-5ab7f1dd5e5f
pengcuo/armnn-android
boost/boost_1_64_0/libs/graph/example/johnson-eg.cpp
int main() { using namespace boost; typedef adjacency_list<vecS, vecS, directedS, no_property, property< edge_weight_t, int, property< edge_weight2_t, int > > > Graph; const int V = 6; typedef std::pair < int, int >Edge; Edge edge_array[] = { Edge(0, 1), Edge(0, 2), Edge(0, 3), Edge(0, 4), Edge(0, 5),...
ALGO
0.999467
4.511713
7fe237fb-f0da-4279-a6b1-4fc2972c3930
TUC117/algos
code_forces/c3q3.cpp
/* AUTHOR - TUK04 */ #include<bits/stdc++.h> #include<algorithm> using namespace std; typedef long long ll; #define all(x) x.begin(), x.end() #define mp make_pair #define pb push_back #define vec(x) vector<x> #define fi(i,a,b) for(ll i(a);i<b;i++) #define fd(i,a,b) for(ll i(a);i>=b;i--) #define juuui() (io...
ALGO
0.999401
3.751562
2243f459-772d-471b-894b-604abb8a4ac4
MedivhGO/MySolutions
CppLeetCode/0042.cpp
class Solution { public: int trap(vector<int>& height) { int sum = 0; int n = height.size(); int pre = -1; for (int i = 1; i < n-1; ++i) { int max_left = 0; for (int j = i - 1; j >= 0; j--) { if (height[j] > max_left) { max_...
ALGO
0.999998
6.68421
1896b5c7-0491-4156-9889-c187043f6a75
hahacoffee/cplusplus_programming
class_practice_7_2.cpp
#include <iostream> #include <fstream> #include <sstream> #include <vector> #include <map> #include <set> #include <iomanip> using namespace std; int main(){ setlocale(LC_ALL,"zh_TW.UTF-8"); wifstream infile("class.dat"); wstring line,str,course; int k,n,i,j; infile.imbue(locale("zh_TW.UTF-8")); map< ws...
TOOL
0.896753
3.608163
6da8f660-2061-4b03-8a81-2173da7af7e0
sefaerkan/CPP-programming-language-projects
C++/STL Kütüphanesi/Çoklu Küme Sınıfı ve Methodları/main.cpp
//oklu Kme Snf: Kmeden fark bir eleman birden fazla sayda bulunabilir #include <iostream> #include <set> using namespace std; template <typename T> void print(T& t){ typename T::iterator iter = t.begin(); while(iter != t.end()) cout<< *iter++<<" "; cout<<endl; } int main(){ multiset<int> m; cout<<m.empty()<<en...
ALGO
0.995786
4.081663
99738222-e84b-4088-8c42-90bdca76291b
CalvinL93/4883-Prog-Tech
Assignments/A04/11764/main.cpp
#include <iostream> using namespace std; int main() { int it, c = 0, up = 0, down = 0, x, y, temp; cin >> it; while(it--) { cin >> y; cin >> x; c++; temp = x; y--; while(y--) { cin >> x; if (x > temp) { up++; } if (x < temp) { down++; }...
ALGO
0.999241
3.652504
db05f160-b296-4f8f-9e1b-7a09e56f2b79
coutKaustubh/DSA_contest
CodeChef/189d/Sortable_Subarrays_Easy.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long #define f(i,n) for (ll i = 0; i < n; i++) #define ia(a,n) \ ll a[n]; \ f(i,n) cin >> a[i] #define iv(v, n) \ vector<ll> v(n); \ f(i,n) cin >> v[i] #define MOD (1000000007) #define INF 1000000000000000000LL // Infinity for ll #d...
ALGO
0.998884
3.287347
c0e31674-280d-4110-a443-c5428ada2fb4
Amr-X/CPP_How_To_Program
chapter04/Exercises/4..28_BinarytoDec.cpp
#include<iostream> using namespace std; // i did it yes i stole the other idea but its ok int main(){ int bit{0},decimal{0}; cout << "Enter a Binary Digit (1 or 0):"; cin >> bit; int originalbit = bit; // if()// how to check if it is a binary digit? // oh i need logic operators Ok Maybe no now...
ALGO
0.998365
5.243762
71927185-de0d-4d6a-90da-d49d2cea47cc
omkartapale/yearless_calendar
example/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.998848
6.76073
71381832-bf29-4de4-94b9-05e0f11c7b63
helenjw/CSC317
lab2/eigen/blas/single.cpp
#define SCALAR float #define SCALAR_SUFFIX s #define SCALAR_SUFFIX_UP "S" #define ISCOMPLEX 0 #include "level1_impl.h" #include "level1_real_impl.h" #include "level2_impl.h" #include "level2_real_impl.h" #include "level3_impl.h" float BLASFUNC(sdsdot)(int* n, float* alpha, float* x, int* incx, float* y, in...
TOOL
0.90285
3.396469
1e77641c-b128-4038-b1b7-f0638c260d5e
KAVYANSHTYAGI/pytorch
aten/src/ATen/native/FusedAdagrad.cpp
#define TORCH_ASSERT_ONLY_METHOD_OPERATORS #include <ATen/core/Tensor.h> #include <ATen/native/DispatchStub.h> #include <ATen/native/FusedAdagrad.h> #ifndef AT_PER_OPERATOR_HEADERS #include <ATen/Functions.h> #include <ATen/NativeFunctions.h> #else #include <ATen/ops/_fused_adagrad.h> #include <ATen/ops/_fused_adagrad...
TOOL
0.991641
7.442251
0f00de94-d3d0-44b5-8c49-073592358bb0
OuYangMinOa/Introduction-to-Computer-Science
hw11/hw11_1_answer.cpp
#include <iostream> using namespace std; const int s = 100; void mut(int A[s][s],int An,int Am,int B[s][s],int Bn,int Bm,int C[s][s]){ // 先 D = AxB 再 C = D; // 這樣寫可以避免 C 跟 A 是同一個記憶體位址的問題 // say for example:有人這樣CALL這個函數 mut(A,An,Am,A,An,Am,A); int D[An][Bm]; for(int i=0;i<An;i++) for(int j...
ALGO
0.999531
3.401156
7571c395-7dbf-4401-91a4-379ae0a26176
hRJ06/DSA
Leetcode/1356. Sort Integers by The Number of 1 Bits.cpp
class Solution { public: vector<int> sortByBits(vector<int>& arr) { sort(arr.begin(),arr.end(),[&](int a,int b){return __builtin_popcount(a) != __builtin_popcount(b) ? __builtin_popcount(a) < __builtin_popcount(b) : a < b;}); return arr; } };
ALGO
0.999976
5.692464
5e33ee1e-33f2-4297-a14e-e630ec86ff1e
Madhuu-k/Leetcode-Grind
Trees/Leetcode 145 - Binary Tree Postorder Traversal.cpp
// Problem Link: https://leetcode.com/problems/binary-tree-postorder-traversal/description/ // Time Complexity: O(n) /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nullptr), right(nullptr) {} * TreeNode...
ALGO
0.99998
6.55846
35e34af3-b6c6-4770-89b7-01a267695e39
SWEG-2015EC-Batch/Binary-Bombers
ETS1352_15_Yabets_Alelign/question 4, the power problem.cpp
#include<iostream> #include<ctype.h> #include<cmath> #include<string.h> using namespace std; int main(){ int x, y; cout<<"please enter the value of x: "; cin>>x; cout<<"please enter the value of y: "; cin>>y; int result = pow(x, y); cout<< "The result of " << x << "^" << y<< " is: " << resu...
ALGO
0.991438
4.543548
05f97d68-0dca-4f18-b83a-e7dcc75968a1
AmrARaouf/algorithm-detection
graph-source-code/441-D/6849504.cpp
//Language: GNU C++ //include //------------------------------------------ #include <vector> #include <list> #include <map> #include <set> #include <deque> #include <stack> #include <bitset> #include <algorithm> #include <functional> #include <numeric> #include <utility> #include <sstream> #include <iostream> #include...
ALGO
0.999989
3.079355
76297b0a-7aaa-448d-adf8-8c28073940ad
nojhan/paradiseo
eo/test/t-MGE-control.cpp
//----------------------------------------------------------------------------- // t-eoMGE.cpp //----------------------------------------------------------------------------- #ifdef HAVE_CONFIG_H #include <config.h> #endif #ifndef __GNUG__ // to avoid long name warnings #pragma warning(disable:4786) #endif // __GNUG_...
ALGO
0.998768
6.172404
fade2458-1366-47af-bbbc-d20fc8b0157f
nguyendo24/Introduction_to_Programming_with_Cpp_Daniel_Liang
book/DeckOfCards.cpp
#include <iostream> #include <ctime> #include <cstdlib> #include <string> using namespace std; int main() { const int NUMBER_OF_CARDS = 52; int deck[NUMBER_OF_CARDS]; string suits[] = {"Spades", "Hearts", "Diamonds", "Clubs"}; string ranks[] = {"Ace", "2", "3", "4", "5", "6", "7", "8", "9", "10", "Jack", "Q...
ALGO
0.964589
4.864514
16c6bb74-8977-4f0a-bcdd-03e73c875d34
ShyamNandanKumar/ninja
Backtracking/Rat_In_A_Maze_Problem.cpp
/* You are given a N*N maze with a rat placed at maze[0][0]. Find and print all paths that rat can follow to reach its destination i.e. maze[N-1][N-1]. Rat can move in any direc­tion ( left, right, up and down). Value of every cell in the maze can either be 0 or 1. Cells with value 0 are blocked means rat can­not enter...
ALGO
0.999937
4.499405
a86f59b9-4102-466a-ad5d-0db591420b34
Debraj-Das/DSA
Topic/two-pointer/Remove K integers.cpp
/* "You cannot believe in God until you believe in yourself." by Swami Vivekananda */ #pragma GCC optimize("Ofast") #pragma GCC optimize("unroll-loops") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #include <bits/stdc++.h> using namespace s...
ALGO
0.999936
4.057573
4e64ba4a-6613-4cf4-91f8-d6fed1ae67d6
manshantsingh/street-coding
kattis/oddities - Oddities.cpp
#include <iostream> using namespace std; int main(){ int t;cin>>t; while(t--){ int n;cin>>n; cout<<n; if(n<0) n*=-1; cout<<" is "<<(n%2==1?"odd":"even")<<endl; } return 0; }
ALGO
0.999819
4.211734
3c473897-f2cf-4d78-acf4-c2c11e359426
SalahDevp/Competitive-Programming
codeforces/912/C.cpp
#include <bits/stdc++.h> using namespace std; #define SPEED \ ios::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0); typedef long long ll; #define MAX_N 1'000'00 int a[MAX_N]; ll s[MAX_N + 1]; void sol() { int n; cin >> n; s[n] = 0; for (int i = 0; i < n; i++) cin >> a[i]; ll res =...
ALGO
0.999739
4.258761
b74aa0c7-3b7e-41d9-97bc-fd72926fdc9b
DrumilHV/DSA
CODEFORCES/CP-31/CP-31-900/OldGrassHopper.cpp
#include <bits/stdc++.h> using namespace std; int main() { int t; // freopen("input.txt", "r", stdin); // freopen("output.txt", "w", stdout); cin >> t; while (t--) { long long x, n; cin >> x >> n; long long i; for (i = n - n % 4 + 1; i <= n; i++) { ...
ALGO
0.999966
3.662053
846f0ff2-2ab0-49ae-aa85-e601d4b11aba
yoon-yk/LeetcodeSubmission
0990-satisfiability-of-equality-equations/0990-satisfiability-of-equality-equations.cpp
class Solution { public: vector<int> parent; int find(int v) { if (parent[v] == v) return v; return parent[v] = find(parent[v]); } void unionn(int v1, int v2) { int p1 = find(v1), p2 = find(v2); if (p1 == p2) return; parent[p1] = parent[p2]; } bo...
ALGO
0.999962
5.827485
09f4e451-3b02-4c96-843c-46d9779dcabc
FriptuT/Data-Structures-and-Algorithms
4.Graphs/1.Grades treatment/Problems about grades/problem5/problem5.cpp
// verifica daca contine varfuri izolate , gr = 0; #include <iostream> #include <fstream> using namespace std; int a[100][100],n,i,j,x,m,y; int grad(int x) { int s,j; s = 0; for (int i = 1; i <= n; i++) { s += a[x][j]; } return s; } int main() { // ifstream inFile("input.txt"); ...
ALGO
0.999506
5.083306
cd3a8138-0936-45c8-b483-4bc43e07d123
xrankit/virtual_ace_x_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.9988
6.76073
63a975fc-2dc8-4f38-b215-ec487567a5c6
eat-swap/LeetCodeDaily
cpp/2205/220510.cpp
#include <vector> #include <functional> #include <iostream> /** * 216. Combination Sum III * Find all valid combinations of k numbers that sum up to n such that the following conditions are true: * * Only numbers 1 through 9 are used. * Each number is used at most once. * Return a list of all possible valid comb...
ALGO
0.999773
7.022127
edcb1202-568b-48fa-b6a8-c10fe082be9d
rgrig/plad
code/CountDistinctGen.cpp
// g++ -std=c++11 -O3 CountDistinctGen.cpp -o CountDistinctGen #include <cassert> #include <cinttypes> #include <cstdint> #include <cstdio> #include <random> using namespace std; int m = 10; // number of distinct IPs int64_t n = 100; // length of stream int seed = 123; typedef uint32_t ip_t; minstd_rand0 G; int mai...
TEST
0.996225
4.825035
66505f2f-75c5-4903-b449-162e8f6394a7
Med16-11/365daysOfCode
DSA_Problems/LeetCodeDaily/sept1.cpp
//Count Good Nodes in Binary Tree void countgoodnodes(TreeNode * root, int& count, int maxforthissum){ if(root == NULL)return; if(root->val >= maxforthissum){ count++; maxforthissum=root->val; } countgoodnodes(root->left, count, maxforthissum); countgoodno...
ALGO
0.999954
6.42942
b3caf0c6-c02e-4085-8ffd-9edebc0deb51
AnonymousALifer/alife_2024_supplement
MABE2/source/third-party/empirical/demos/utils/extras/calc_log.cpp
/** * @note This file is part of Empirical, https://github.com/devosoft/Empirical * @copyright Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md * @date 2021 * * @file calc_log.cpp */ #include <cmath> #include <iostream> int main() { const double steps = 1024.0; for (doub...
ALGO
0.940477
4.285251
7657720f-63c3-4f0c-864c-31c39f79601a
toufique-imam/SOLVED-PROBLEMS
LightOJ/LOJ 1414 - February 29.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> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>; template <typename T> using ordered_set_rev = tr...
ALGO
0.999972
4.239786
12b33844-7107-4cc0-bc08-999f890c1552
Re-bro/Algorithm-PS
USACO/USACO 2018 December Contest/[BOJ 16763] Fine Dining.cpp
/* [BOJ 16763] Fine Dining Algorithm : Dijkstra */ #include<bits/stdc++.h> using namespace std; using pii = pair<int, int>; const int MAX = (int)2e9; int n, m, k; vector<pii> adj[50505]; int yum[50505]; int dis[50505][2]; int main(void) { ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); cin >> n...
ALGO
0.999976
4.115243
b3fcea1f-65d9-4cd6-92a1-7185d5a9346f
rutujnagrale/demo
cd.cpp
#include <iostream> #include <stack> #include <string> using namespace std; string backspace(string s) { stack<char> st; for (char c : s) { if (c == '0' || c == '1') { st.push(c); } else if (c == 'B') { if (!st.empty()) { st.pop(); } ...
ALGO
0.999828
4.843854
e6d4a530-d321-4863-a4de-1b9a2deb431c
ajakhotia/eyeKin
boost/boost/boost_1_57_0/libs/icl/example/partys_height_average_/partys_height_average.cpp
/** Example partys_height_average.cpp \file partys_height_average.cpp \brief Using <i>aggregate on overlap</i> a history of height averages of party guests is computed. In partys_height_average.cpp we compute yet another aggregation: The average height of guests as it changes over time. This is...
ALGO
0.959718
6.924452
98d8c027-853c-4ee4-8fd5-9995c8ba7c12
Abd-UlRahman-Khalid/Practice-Fundamentals
Practice_C++/Switch/simple_calculator2.cpp
#include <iostream> using namespace std; int main() { int n1, n2, choose; cout << "Enter Two Numbers\n"; cin >> n1 >> n2; cout << "Choose Operation Number \n"; cout << "[1] Add \n"; cout << "[2] Subtract \n"; cout << "[3] Multiply \n"; cout << "[4] Divide \n"; cin >> choose; swi...
TOOL
0.961807
3.584513
1bb5e9f2-6042-4f07-8243-8a76533d7f08
parrotsky/AutoDiCE
src/layer/x86/scale_x86.cpp
#include "scale_x86.h" #if __SSE2__ #include <emmintrin.h> #if __AVX__ #include <immintrin.h> #endif // __AVX__ #endif // __SSE2__ namespace ncnn { Scale_x86::Scale_x86() { #if __SSE2__ support_packing = true; #endif // __SSE2__ } int Scale_x86::forward_inplace(std::vector<Mat>& bottom_top_blobs, const Option& ...
ALGO
0.899827
6.095566
41872b63-c218-42f1-a8cd-cf72cffdd16c
Jhowpix/Estudo_em_C
exercicio_2/codigoFuncionario.cpp
#include <iostream> #include <stdio.h> using namespace std; // habilitando cout e cin int main() { int num; double salario; string nome; double salarioAtual; cout << "\n\nNome do funcionario.\n"; cin >> nome; cout << "\n Informe salario.\nR$ "; cin >> salario; cout << " \n\n Escolha um numero ref...
TOOL
0.921104
3.636508
34487c57-9d60-44ea-a7c9-c5a9cbe122e2
shubham-deshmukh/CP-Contests
Atcoder/abc389/C_Snake_Queue.cpp
#include <bits/stdc++.h> using namespace std; // #ifndef ONLINE_JUDGE // #include "./debug.h" // #else // #define debug(x...) // #endif #define endl "\n" #define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0) #include <ext/pb_ds/assoc_container.hpp> // Common file #include <ext/pb_ds/tree_policy.hpp> //...
ALGO
0.998563
4.4271
5cd8eb5f-5030-4eb9-a63d-95e777b3d4a8
arafathosense/Codeforces-Problems-Solution
Measure amgle between minute and hour.cpp
#include<bits/stdc++.h> using namespace std; int main(){ int h,m; float a,b,c,d; while(scanf("%d:%d",&h,&m)==2){ if(h==0&&m==0) break; a=(0.5*(h*60+m)); b=(6*m); if(a>b) {c=a-b;} else c=b-a; //c=(.5*((60*h)-(11*m))); if(c>180){ d=360-c; printf("%.3f",d); } else printf("%.3f",c);} return 0; }
ALGO
0.999773
3.226348
d6398f6e-95c0-4425-9a97-14814bb76af6
Soham2020/CodeForces
712A.cpp
#include<bits/stdc++.h> using namespace std; typedef long long int ll; #define pb push_back #define pi pair <int, int> int main() { ll n; cin >> n; vector <ll> v; for(int i=0; i<n; i++) { ll val; cin >> val; v.pb(val); } vector <ll> res; for(int i=0; i<n-1; i++) res.pb(v[i] + v[i+1]); res.pb(v[n-1]); ...
ALGO
0.999937
3.165907
b538602f-bc64-49a3-ab53-63d784e9d807
Shreyaprasad02/DSA_With_CPP
Introduction to C++/Test 1/star_number_pattern.cpp
/* Number Star Pattern Print the following pattern for given number of rows. Input format : Line 1 : N (Total number of rows) Sample Input : 5 Sample Output : 1234554321 1234**4321 123****321 12******21 1********1 */ #include<iostream> using namespace std; int main(){ int n; cin>>n; for(int i =1; i<=n; i+...
ALGO
0.999954
4.357655
ad8d1f47-d1e5-4271-b65b-5092d6ae72c6
zhyack/LeetCode
211.cpp
class WordDictionary { public: /** Initialize your data structure here. */ unordered_map<char, WordDictionary*> d; bool is_vocab; WordDictionary() { d.clear(); is_vocab=false; } /** Adds a word into the data structure. */ void addWord(string word) { WordDictionar...
ALGO
0.998729
6.526109
77cb44a3-4ba0-4cbb-865a-f10cd9bf3e9d
ishandutta2007/codeforces
ikatanic/normal/891/C.cpp
#include <algorithm> #include <cassert> #include <cstring> #include <iostream> #include <stack> using namespace std; #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define REP(i, n) FOR(i, 0, n) #define TRACE(x) cout << #x << " = " << x << endl #define _ << " _ " << typedef long long llint; const int MAX = 50...
ALGO
0.999981
4.423383
08b56bc4-6791-4393-ae87-66b4bcfc7740
visheshgargavi/mission_faang
D2C/5_Frequency.cpp
// // // #include<bits/stdc++.h> // // // using namespace std; // // // int main() // // // { // // // string str; // // // cin>>str; // // // int n=str.length(); // // // map<char,int>mp; // // // int i; // // // for(i=0;i<n/2;i++) // // // { // // // mp[str[i]]++; // // // } /...
ALGO
0.999021
3.555202
9181ca17-1a9a-49ea-859d-85bc8ada9f80
jk-jung/problem-solving
codeforces/Codeforces Round 84x/R841_div2_B.cpp
#include <cstring> #include <cstdio> #include <cmath> #include <cassert> #include <set> #include <map> #include <array> #include <stack> #include <queue> #include <vector> #include <numeric> #include <iostream> #include <algorithm> using namespace std; typedef long long ll; typedef pair<int, int> pi; typedef vector<i...
ALGO
0.999819
4.351143
2935c4a4-4555-461a-b2a4-0cac267b648b
kovaxis/progcomp
problems/taller/semana3/d.cpp
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(NULL); int n, l; cin >> n; cin >> l; vector<int> lants; lants.reserve(n); for (int i = 0; i < n; i++) { int x; cin >> x; lants.push_back(x); } sort(lants.begi...
ALGO
0.999485
3.827978
a9357de8-b812-4e56-a577-ff7c5e049aec
pravin817/365DaysOfCodeChallenge
floorSqrt.cpp
/* Day 44: 12/02/2023 Platform : GFG Problem Link : https://practice.geeksforgeeks.org/problems/square-root/1 */ class Solution{ public: long long int floorSqrt(long long int x) { int i = 1; while(i*i <= x) i++; return (i-1); } }; /* ...
ALGO
0.99983
5.444992
242951ee-4d6c-41f4-8b2b-50393126663b
thermotools/lammps_mie_fh
src/compute_property_chunk.cpp
// clang-format off #include "compute_property_chunk.h" #include <cstring> #include "atom.h" #include "update.h" #include "modify.h" #include "compute_chunk_atom.h" #include "memory.h" #include "error.h" using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ Compute...
TOOL
0.85357
6.784649
85172ec6-b359-4401-abcb-3bc6e71a7ff2
icenfly/myleetcode
25.reverse-nodes-in-k-group.cpp
/* * @lc app=leetcode id=25 lang=cpp * * [25] Reverse Nodes in k-Group */ // @lc code=start /** * 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, Lis...
ALGO
0.99999
6.38118
dbfc8cf0-9eaa-4424-a214-926447d8d0a5
AbredagnKebede/flutter_application_student_helper
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
a1475750-e1b1-47a5-98d0-48e21d6ce423
RohitAsegaonkar/DataStructures-Algorithms
Linked List/CreateSingleLinkedlist.cpp
#include<bits/stdc++.h> using namespace std; /* 1.Created Singly Linked List in Stack Area. 2.RASNL - Return Address of Second Last Node Function. */ struct node { int data; struct node *next;/* data */ }; struct node* RASLN(struct node* s){ if(s==nullptr || s->next==nullptr){ return(NULL); }...
ALGO
0.999701
3.576847
0c33efa0-5f2c-45cf-aef7-6eb746705bff
zyz0000/LaGMaR
R/mvest.cpp
#include<Rmath.h> #include<RcppCommon.h> #include<RcppArmadillo.h> // [[Rcpp::depends(RcppArmadillo)]] using std::string; using Rcpp::Named; using namespace arma; // [[Rcpp::export]] extern "C" SEXP mvest(const cube& Yt){ const int p = Yt.n_rows, q = Yt.n_cols, n = Yt.n_slices; cube MR0(p, p, n, fill::zeros);...
ALGO
0.999969
5.813545
a283ab58-42c4-4f98-a11e-2a745ba117ac
ishandutta2007/codeforces
rafbill/normal/848/B.cpp
#ifndef __clang__ #pragma GCC optimize "-O3" #pragma GCC target "tune=native" #endif #ifdef ONLINE_JUDGE #define NDEBUG 1 #endif #include <stdio.h> #include <bits/stdc++.h> #define DESTRUCT2(p, a, b) \ auto a = get<0>(p); \ auto b = get<1>(p); #define DESTRUCT3(p, a,...
ALGO
0.999957
3.595582
da7f8fae-070c-4b9b-a7e2-b2b63769d5f9
Reddragoon244/Quake-4-Source-Code
idlib/rvMemSys.cpp
// // rvMemSys.cpp - Memory management system // Date: 12/17/04 // Created by: Dwight Luetscher // #include "../idlib/precompiled.h" #pragma hdrstop #ifdef _RV_MEM_SYS_SUPPORT static memoryStats_t mem_total_allocs = { 0, 0x0fffffff, -1, 0 }; static memoryStats_t mem_frame_allocs; static memoryStats_t mem_frame_frees...
TOOL
0.865634
5.462162
faea30c2-0fdb-46bb-8ee9-376ade842142
sanyaarora2/DSAseries
day16.cpp
ques 1 class Solution { public: int midcol(vector<vector<int>>& mat, int k) { int max=mat[k][0]; int maxidx=0; for(int i=1; i<mat[0].size();i++){ if(mat[k][i]>max){ max=mat[k][i]; maxidx=i; } } return maxidx; } vector<int> findPea...
ALGO
0.999988
5.59413
86941315-5cc4-4d26-a639-673560646391
phoenix0706/HackerRank
cpp/STL/Vector sort.cpp
#include <cmath> #include <cstdio> #include <vector> #include <iostream> #include <algorithm> using namespace std; int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT */ int n; cin>>n; vector <int> v; for(int i=0;i<n;i++){ int inp; cin>>inp; ...
ALGO
0.999797
4.150856
5b2fe96f-6b62-4df3-ba15-0b38f2d3e402
aniketkumargiri/Codechef
01-2023 (January)/Apples and Oranges.cpp
/* Author: Aniket Giri */ #include <bits/stdc++.h> using namespace std; /*********************templete********************/ #define ll long long int #define ld long double #define fl(i, a, n) for (ll i = a; i < n; i++) #define vl vector<ll> #define pl pair<ll, ll> #define um unordered_map<ll, ll> #define all(v) (v).beg...
ALGO
0.999804
3.480489
446fec82-05e6-48b3-a1b3-e5ac27f8573b
maurycortes/InterviewBit
InterviewBit/Backtracking/LetterPhone.cpp
string mapping(int d){ switch(d) { case 0: return "0"; case 1: return "1"; case 2: return "abc"; case 3: return "def"; case 4: return "ghi"; case 5: return "jkl"; case 6: r...
ALGO
0.999292
5.690755
e7320d26-f134-48f2-b25f-ad6c0f4dfcae
HuichuanLI/play_with_algo_cplusplus
Sort/SelectionSort/selectionsort.cpp
// // Created by 李汇川 on 2022/3/13. // #include <iostream> #include "SortTestHelper.h" using namespace std; template<typename T> void selectionSort(T arr[], int n){ for(int i = 0 ; i < n ; i ++){ int minIndex = i; for( int j = i + 1 ; j < n ; j ++ ) if( arr[j] < arr[minIndex] ) minIndex = j;...
ALGO
0.998245
4.969579
63b91196-a16d-4b6a-a268-b5c003617bb9
kayaru28/programming_contest
old_contest/at_coder_abc164_B.cpp
#include <iostream> #include <stdio.h> #include <algorithm> using namespace std; #include <vector> #define rep(i,n) for (int i = 0; i < (n) ; i++) #define INF 1e9 #define llINF 1e18 #define MOD 1000000007 #define pb push_back #define ll long long #define ull unsigned long long #define vint vector<int> #define vll vec...
ALGO
0.999934
3.107929
aba39349-e4f5-4b14-90dd-c171fda8739f
nnhphong/Competitive-programming
UVA/540.cpp
#include <bits/stdc++.h> using namespace std; #define fastIO ios::sync_with_stdio(false); cin.tie(0); int main() { fastIO; freopen("540.inp", "r", stdin); int t, k = 1; while (cin >> t, t) { vector<int> group(1000001, 0); vector<queue<int>> teamQueue(1001); for (int i = 0; i < t; i++) { in...
ALGO
0.999453
3.988477
9032f336-21a9-4266-902d-e967f9cf2086
park-hg/swjungle-algorithm-study
BOJ-14627/connieya.cpp
#include "bits/stdc++.h" #define MX 1000000 typedef long long ll; using namespace std; ll arr[MX + 1]; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); ll s, c; cin >> s >> c; ll lt = 1, rt = 0, sum = 0 , ans; for (int i = 0; i < s; ++i) { cin >> arr[i]; ...
ALGO
0.999981
3.228675