uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
285d76d4-aec6-4814-9386-b3aa172a72af
AliOsm/CompetitiveProgramming
CodeForces/349B. Color the Fenc.cpp
#include <stdio.h> using namespace std; int arr[9]; int main() { int n; scanf("%i", &n); for (int i = 0; i < 9; i++) scanf("%i", &arr[i]); bool f = true; for (int i = 0; i < 9; i++) if (n >= arr[i]) f = false; if (f) puts("-1"); else { int min_v = 1e9, min_n = 1e9, mx_v, mx_n; for (int i = 0...
ALGO
0.999885
3.46245
2a008f91-32fd-443d-b399-d45da302a8fc
NicCarp11/gem5
src/systemc/tests/systemc/misc/unit/data/datawidth_bool_to_unsigned/truncation/datawidth.cpp
/***************************************************************************** datawidth.cpp -- Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15 *****************************************************************************/ /**************************************************************************...
ALGO
0.964648
5.742909
93df4fa0-ee85-4022-a98a-f57a52268cae
SabinaHj/MAT201B_Final
vid_03.cpp
// Vid vis . Ars Electronica // angle added. // angular momentum required. // Blood cell experiment . //Covid is 100nm. //Red blood cell 10,000 nm #include <cmath> #include "al/app/al_App.hpp" #include "al/graphics/al_Shapes.hpp" #include "al/math/al_Functions.hpp" #include "al/math/al_Random.hpp" #include "al/app...
ALGO
0.995096
3.615568
cbeaa58e-68bf-4e3c-af70-2b59c6dc5ffa
ishandutta2007/codeforces
fake_a05/normal/652/E.cpp
#include<bits/stdc++.h> using namespace std; #define loop(i, l, r) for(int i = (int) l; i <= (int) r; i++) #define rloop(i, r, l) for(int i = (int) r; i >= (int) l; i--) #define vi vector<int> #define ii pair<int, int> #define fi first #define se second #define eb push_back #define all(x) begin(x), end(x) #define...
ALGO
0.99998
4.897378
97096349-9758-4de7-8250-980741801190
Bassel-Ak/Workspace
DS_Course/Section2_Vectors/main.cpp
#include <iostream> #include "Vectors.hpp" using namespace std; /* Vectors Problems: Problem #1: Right rotation Problem #2: Left rotation Problem #3: Right rotation with index Problem #4: Left rotation with index Problem #5: */ int main() { int n = 10; Vector v(n); for(int i = 0; i < ...
ALGO
0.98116
3.671484
2d7b8d4a-8814-4b73-ab16-eeb5feb6f6ab
ishandutta2007/codeforces
muffinhead/normal/1444/C.cpp
#pragma GCC optimize ("O3") #pragma GCC target ("sse4") #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef complex<ld> cd; typedef pair<int, int> pi; typedef pair<ll,ll> pl; typedef pair<ld,ld> pd; typedef vector<int> vi; typedef vector<ld> vd; typedef vector<l...
ALGO
0.999973
4.243601
36dc0c1f-6e0e-4698-8c1b-48f518e2424d
Leslie-Jiang-Hamster/CS106L-labs
4/main.cpp
/* Assignment 4: Weather Forecast This assignment works with template functions and lambdas to become the best weather forecaster at the Stanford Daily. Be sure to read the assignment details in the PDF. Submit to Paperless by 11:59pm on 5/10/2024. */ // TODO: import anything from the STL that might be useful! #inc...
TOOL
0.98468
6.595154
a3f7cd1c-d622-41d9-8b7e-95907a460bf3
ICS3U-Programming-FinnK/Unit3-02-CPP
numGuess.cpp
// Created by: Finn Kitor // Date: October 11th, 2023 // this program checks if the number the user guessed is correct. #include <iostream> int main () { // this function checks if the number is incorrect const int CORRECT_NUMBER = 4; int number; // user inputs the number into the terminal std::...
ALGO
0.901588
5.371309
2dd3341f-e691-41cc-8f4c-968c482d9ded
Kamlesh-Mahar/LeetCode-Problems
leetcode 705.cpp
#include <vector> class MyHashSet { private: std::vector<bool> data; public: MyHashSet() : data(1000001, false) {} void add(int key) { if (key >= data.size()) { data.resize(key + 1, false); } data[key] = true; } void remove(int key) { if (key < ...
ALGO
0.997397
4.996251
1000cb54-070c-4517-97be-ccce3eca8937
yashikota/contests
abc/294/c.cpp
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) int main() { int n, m; cin >> n >> m; vector<int> a(n); vector<int> b(m); vector<int> c; rep(i, n) cin >> a.at(i); rep(i, m) cin >> b.at(i); copy(a.begin(), a.end(), back_inserter(c)); c...
ALGO
0.999969
3.812681
59959d83-b18c-4ceb-bb05-76dd3f7ccce2
secondo-database/secondo
Algebras/Rose/RoseJava/twodsack/util/meshgenerator/NetGen/libsrc/meshing/meshfunc.cpp
#include <mystdlib.h> #include "meshing.hpp" using namespace std; namespace netgen { extern const char * tetrules[]; // extern const char * tetrules2[]; extern const char * prismrules2[]; extern const char * pyramidrules[]; extern const char * pyramidrules2[]; extern double teterrpow; MESHING3_RESULT ...
ALGO
0.94567
5.078067
9415a975-58a6-49b2-b609-e7dd1d0e2c28
GoWest279/Gem5-RISCV-FullSystem
src/systemc/tests/systemc/misc/unit/data/datawidth_bool_to_unsigned/truncation/datawidth.cpp
/***************************************************************************** datawidth.cpp -- Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15 *****************************************************************************/ /**************************************************************************...
ALGO
0.967003
5.750748
38fb11e7-bb1b-4d42-86df-fbbf58a22aca
ArionDas/Leetcode_Solutions
3291-find-if-array-can-be-sorted/find-if-array-can-be-sorted.cpp
class Solution { public: bool canSortArray(vector<int>& nums) { int len = nums.size(); vector<int> num2(len, 0); for(int i=0; i<len; i++) { int temp = nums[i]; int count = 0; while(temp) { if(temp&1) count += 1;...
ALGO
0.999991
5.138472
3924c611-4904-462a-be95-e33a2fd9fa10
Vivashwan/LeetCodes
2299-merge-nodes-in-between-zeros/merge-nodes-in-between-zeros.cpp
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode() : val(0), next(nullptr) {} * ListNode(int x) : val(x), next(nullptr) {} * ListNode(int x, ListNode *next) : val(x), next(next) {} * }; */ class Solution { public: ListNode* mergeNodes(...
ALGO
0.999942
5.440422
f8d2818c-1ae2-4754-abf3-f2230406ceb0
ranjeetxsingh/contest
codeforces/codeforces-928/1926A.cpp
#include<bits/stdc++.h> using namespace std; int main(){ int t; cin >> t; while(t--){ string s; cin >> s; vector<int> v(2, 0); for(auto x: s){ if(x == 'A') v[0]++; else v[1]++; } if(v[0]>v[1]) cout << "A" << endl; else cout << "B" << endl; } }
ALGO
0.999986
5.120545
53cd6b06-7b3d-46f6-abda-26e715e94195
kasa021/atcoder-archives
abc279/abc279_e_36842061_AC.cpp
/* * Author: kAsA02 * Submission URL: https://atcoder.jp/contests/abc279/submissions/36842061 * Submitted at: 2022-11-27 06:07:51 * Problem URL: https://atcoder.jp/contests/abc279/tasks/abc279_e * Result: AC * Execution Time: 344 ms */ #include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i ...
ALGO
0.999995
3.738406
bd6f19e5-26d1-4feb-b628-8ce9ff278dcd
DanielTLouis/HackerRank
CPP/Prepare_Cpp_Classes_BoxIt!.cpp
#include<bits/stdc++.h> using namespace std; //Implement the class Box //l,b,h are integers representing the dimensions of the box // The class should have the following functions : // Constructors: // Box(); // Box(int,int,int); // Box(Box); // int getLength(); // Return box's length // int getBreadth (); // R...
ALGO
0.989571
3.686172
2c741138-4064-41f7-be1e-882a0464062d
ishandutta2007/codeforces
wxhtzdy/normal/1175/B.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long const long long inf=(1ll<<32)-1; int n,cnt[105]; stack<int> stk; void no() { printf("OVERFLOW!!!\n"); exit(0); } int main() { scanf("%d",&n); vector<ll> ans; ll val=0; for(int i=1;i<=n;i++) { char op[5]; scanf("%s",op); if(op[0]=='a') { ...
ALGO
0.998796
3.440747
1d334f37-0d31-474d-8d29-85c82a805b7e
RobinSchmidt/RS-MET
Libraries/RobsJuceModules/rs_testing/Experiments/MiscExperiments.cpp
// todo: SinusoidalSynthesizer to RAPT to make it available here using namespace RAPT; // convenience function: std::vector<double> synthesizeSinusoidal( const RAPT::rsSinusoidalModel<double>& model, double sampleRate, double fadeTime) { std::cout << "Synthesizing sinusoidal model with " << model.getNumPartials()...
ALGO
0.974803
5.204353
08ef506e-a892-4b4b-9734-aa98de092730
A-Badola/NumPuzzle
getConfigs.cpp
#include<bits/stdc++.h> using namespace std; set<vector<pair<int,int>>> ans; int mat[5][5] = { {16,0,0,0,0}, {8,8,0,0,0}, {4,4,4,0,0}, {2,2,2,2,0}, {1,1,1,1,1} }; void printMat(int mat[5][5]){ for(int i = 0; i < 5; i++){ for(int j = 0; j < i+1; j++){ cout << mat[i][j] << " "; } ...
ALGO
0.99907
3.486996
a34cca99-4a15-4bc7-baca-6d80b2039b17
Moyu0730/CP-Question-Record
CSES/3226. Subarray Sum Queries II.cpp
/* Question : CSES 3226. Subarray Sum Queries II */ #include<bits/stdc++.h> using namespace std; /* Pragma */ #pragma GCC optimize("Ofast") #pragma GCC optimize("Ofast,unroll-loops,no-stack-protector,fast-math") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") /* Self Define */ #define I...
ALGO
0.999755
4.917779
8c412c0f-bae2-4145-9414-58cbc1a64952
golu242/Programming
codechef's solution/LTIME.cpp
#include<iostream> using namespace std; int main(){ int t; cin>>t; while(t--){ int x; cin>>x; if(1<=x && x<=4){ cout<<"YES"<<endl; } else{ cout<<"NO"<<endl; } } return 0; }
ALGO
0.999387
3.728501
e24d7f28-2368-4ec5-b68e-7433ab6b8cc1
azanafzal3/Cpp-Fundamentals-Assignments
Assignment 2/q8_i221741.cpp
/*Muhammad Azan Afzal Roll no:1741 Assignment no:2 Section:BCY Problem no:8 */ #include<iostream> #include<string> using namespace std; int main() { int a,b; string colour_a,colour_b; cout<<"Enter first number:"<<endl; cin>>a; cout<<"Enter second numbers:"<<endl; cin>>b; switch (a){ case 1: case 6: case 7: case 12...
ALGO
0.98405
3.468725
507a1578-1d60-43ae-a7b1-de459f56d660
luckoo1/algorithm
CPP/programmers_R2/PROG_3_1.모범답1_전화번호 목록.cpp
/* 문제를 잘 파악하는 것에 대한 중요성을 한번더 생각해볼 수 있다. sort한 다음에 i번째것과 i+1번째것만 비교해보면 된다 i+2, i+3째는 볼 필요도 없다. */ #include <vector> #include <string> #include <algorithm> #include <iostream> using namespace std; bool solution(vector<string> phone_book) { bool answer = true; //sort한후에 i와 i+1만 확인해본다는 아이디어 sort(phone_book.beg...
ALGO
0.999754
4.986601
37624df5-a102-41ca-82d7-b3d96d884d02
ShalvexNovachrono/Tic-Tac-Toe
Tic Tac Toe/Tic Tac Toe.cpp
#include <iostream> #include <string> #include <random> using namespace std; void print(string message) { // this print with a newline cout << message << endl; } void printNoNewLine(string message) { // this function print with out a new line cout << message; } string input(string message) { // this functio...
ALGO
0.997383
5.227018
dd9965d5-2ea0-40f7-91f2-f56602c65220
Avionics-Propulsion-Landers-GT/MonopropUAV
ControlLoop/LQR/lqr.cpp
#include "lqr.h" #include "../CustomLinear/Vector.h" #include "../CustomLinear/Matrix.h" #include <cmath> #include <iostream> #include <iomanip> #include "solveCARE.h" LQR lqrController; double clamp(double x, double lower, double upper) { return std::max(lower, std::min(x, upper)); } double LQR::frobeniusNormDi...
ALGO
0.991922
6.100928
410f06be-b42d-414e-b523-d1e22ad7a84b
raincross7/code-similarity
codes/train_code/problem022/problem022_421.cpp
#include <bits/stdc++.h> #define rep(i,n) for (int i=0;i<(n);i++) using namespace std; using ll = long long; using P = pair<int,int>; int main() { int a,b; cin >> a >> b; if(a%2==b%2) cout << (a+b)/2 << endl; else cout << (a+b)/2+1 << endl; }
ALGO
0.999882
3.426778
9f3037d7-d215-4467-8c93-df59e45ed610
Prithvi04/Competitive-Coding
mincosttickets_dp.cpp
In a country popular for train travel, you have planned some train travelling one year in advance. The days of the year that you will travel is given as an array days. Each day is an integer from 1 to 365. Train tickets are sold in 3 different ways: a 1-day pass is sold for costs[0] dollars; a 7-day pass is sold fo...
ALGO
0.999853
5.496823
d973bb30-bd70-440a-8b42-334c65c612da
mathletedev/cp
USACO/738.cpp
#include <algorithm> #include <cstdio> #include <iostream> #include <vector> int N; std::vector<std::pair<int, int>> cows; int main() { std::ios::sync_with_stdio(false); std::cin.tie(NULL); freopen("pairup.in", "r", stdin); freopen("pairup.out", "w", stdout); std::cin >> N; for (int i = 0; i < N; ++i) { in...
ALGO
0.999741
4.275462
9467b9bf-375d-4de6-aec4-023ea9a4a405
bartvbl/Shapebench
lib/CGAL-5.6.1/examples/Periodic_2_triangulation_2/p2t2_geometric_access.cpp
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h> #include <CGAL/Periodic_2_Delaunay_triangulation_2.h> #include <CGAL/Periodic_2_Delaunay_triangulation_traits_2.h> typedef CGAL::Exact_predicates_inexact_constructions_kernel K; typedef CGAL::Periodic_2_Delaunay_triangulation_traits_2<K> PK; typedef CGAL...
ALGO
0.99385
6.281974
55c54831-d68a-4f3a-b275-35d5d3729fb9
pgq18/HiBao_Pro
Taurus/third_party/src/opencv/modules/stitching/src/util.cpp
#include "precomp.hpp" namespace cv { namespace detail { void DisjointSets::createOneElemSets(int n) { rank_.assign(n, 0); size.assign(n, 1); parent.resize(n); for (int i = 0; i < n; ++i) parent[i] = i; } int DisjointSets::findSetByElem(int elem) { int set = elem; while (set != parent...
ALGO
0.995728
5.481909
1f001cf8-60d7-493c-a328-083239eb9e0a
bothemrun/CAP-Complete-Algorithmic-Programming
Leetcode_All_Solved/1834.cpp
#include<algorithm> #include<queue> #include<utility> #include<assert.h> bool cmp_fn(const vector<int>& a, const vector<int>& b){ return a[0] < b[0];//ascending only in enqueueTime } class cmp_class{ public: bool operator()(const pair<int,int>& a, const pair<int,int>& b){ if(a.first != b.first)return a...
ALGO
0.999996
5.815727
d863a0af-663b-4594-b6d3-0139f3db1bcd
PrincePandeycode/DS_ALGO
arrays/22_2_betterLongestSequence.cpp
#include<bits/stdc++.h> using namespace std; int Longest(vector<int>&v){ sort(v.begin(),v.end()); int n = v.size(); if(n == 0) return 0; int last_Smaller = INT_MIN; int longest = 1; int currentLong = 0; for(int i = 0;i<n;i++){ if(v[i]-1 == last_Smaller){ currentLong +=1...
ALGO
0.999849
4.310829
740093e2-3374-44d9-8c24-ee74fc146497
free43/AdventOfCode2024
16/2.cpp
#include<iostream> #include<fstream> #include<sstream> #include<vector> #include<algorithm> #include<optional> #include<math.h> #include<unordered_set> #include<valarray> #include<stack> #include<queue> using namespace std; const array lu = {'^', '>', 'v', '<'}; using pos = valarray<int>; pos get_offset(char c) { ...
ALGO
0.999813
3.932811
9a868b57-96d0-469e-b802-02cbdd450270
ishandutta2007/codeforces
cyand1317/normal/893/A.cpp
#include <cstdio> int main() { int spec, winner, new_winner; int n; scanf("%d%d", &n, &winner); if (winner == 3) { puts("NO"); return 0; } spec = 6 - 3 - winner; for (int i = 1; i < n; ++i) { scanf("%d", &new_winner); if (new_winner == spec) { puts("NO"); return 0; } w...
ALGO
0.99999
3.788625
c9aec346-76f0-4b7d-a1ad-8790a08066e7
sarvex/leetcode-kotlin
solution/2600-2699/2654.Minimum Number of Operations to Make All Array Elements Equal to 1/Solution.cpp
class Solution { public: int minOperations(vector<int>& nums) { int n = nums.size(); int cnt = 0; for (int x : nums) { if (x == 1) { ++cnt; } } if (cnt) { return n - cnt; } int mi = n + 1; for (int i ...
ALGO
0.99998
5.583485
db62c2b5-42cb-47e5-83c1-dc8c0b576c3d
Vandan121/VS-code
Coding/ICPC practice session/Express the Number.cpp
#include<bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace chrono; using namespace __gnu_pbds; #define ll long long int #define ld long double #define cd complex<ld> #define pi pair<int, int> #define pl pair<ll,ll> #define pd pair<ld,ld> #d...
ALGO
0.999832
4.726737
6f9c96e3-5a17-4f26-97c0-d8042aa998e9
alihan1999/Cgrad
Cgrad/engine.cpp
#include <functional> #include <unordered_set> #include <string> #include <iostream> #include <memory> #include <vector> #include <cmath> #include "engine.h" Value::Value(float data, std::unordered_set<std::shared_ptr<Value>> _children, std::string op) { this->data = data; this->grad = 0.0; this->_children...
ALGO
0.98636
5.476992
7150f794-8f1f-4fc5-92dd-c7eb1e624c57
xut-e/Cpp-Exercises
Topic_5/Exercise5_06.cpp
/* 6. Crea un programa que para cada elemento de un array de enteros pida un número al usuario y lo multiplique por la posición del array equivalente, luego muestra el resultado. */ #include <iostream> void main() { int const times = 5; int posicion, vector[times], multiplicador; for (int i = 0; i < times; i++...
ALGO
0.990412
3.247553
945c15ab-6feb-4394-a7d0-56b37b4b0839
Teru3301/KFU
Contests/Contest-2024-10-23/04/main.cpp
#include <iostream> #include <string> #include <vector> class Any{ enum class Type{ INT, DOUBLE, STRING, VECTOR_ANY_PTR }; void* data; Type type; public: Any(int* data); Any(double* data); Any(std::string* data); Any(std::vector<Any*>* data); ~Any()...
TOOL
0.98136
4.889677
31c1d855-bfd7-4422-a335-d5e563ae2e4e
bendavid/firmware-mod-kit
src/others/squashfs-3.2-r2-lzma/CPP/7zip/UI/Common/SortUtils.cpp
// SortUtils.cpp #include "StdAfx.h" #include "SortUtils.h" #include "Common/Wildcard.h" static int CompareStrings(const int *p1, const int *p2, void *param) { const UStringVector &strings = *(const UStringVector *)param; return CompareFileNames(strings[*p1], strings[*p2]); } void SortFileNames(const UStringVec...
TOOL
0.933342
6.468472
c739a967-1465-4bf3-ae22-e6533143c998
adherent9870/data-structures-and-algorithm
linked list/move_last_to_front.cpp
#include <iostream> using namespace std; #include "node.cpp" node *takeinput(){ int data; cin >> data; node *head=NULL; node *tail=NULL; while(data != -1){ node *newnode=new node(data); if(head==NULL){ head=newnode; tail=newnode; } else { ...
ALGO
0.999979
4.429675
71e9b01b-2069-4a30-a9c8-712529664a5a
purple-jwl/atcoder
src/ABC/129/A.cpp
#include <bits/stdc++.h> #define REP(i, x, n) for (int i = x; i < (int)(n); i++) #define rep(i, n) REP (i, 0, n) #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() #define sz(x) (int)(x.size()) #define popcount(x) __builtin_popcount(x) #define popcountll(x) __builtin_popcountll(x) #define u...
ALGO
0.999894
3.84495
28aa4a27-e2fa-4412-9bf0-42af3163cab1
ahmedsabrymohamed/UVA-Problems
10714.cpp
#include <bits/stdc++.h> #define ll long long #define ld long double using namespace std; void ok() { ios::sync_with_stdio(0); ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); } int main() { ok(); long l,n,t; cin>>t; while(t--){ cin>>l>>n; long x,maxl=0,minl=0; for(int i=0;i<n;i++) { cin...
ALGO
0.999776
3.89784
7f6cace5-44a4-4fb8-ac13-6cf7b01806d6
cxiaozhi/TinyWebServer
src/timer/lstTimer.cpp
#include "../../include/timer/lstTimer.h" #include "../../include/http/httpConn.h" SortTimerLst::SortTimerLst() { head = NULL; tail = NULL; } SortTimerLst::~SortTimerLst() { UtilTimer* tmp = head; while (tmp) { head = tmp->next; delete tmp; tmp = head; } } void SortTimer...
TOOL
0.859225
4.335335
428cc510-d307-4a9d-a73b-65bd6d30b0b4
Cyanogens/Compilation-principle-experiment
twoandthree/three/baseclass/LR.cpp
#include"LR.h" #include <bits/stdc++.h> #include <utility> using namespace std; using namespace lr_grammar; using namespace public_tool; //projectʵ Project::Project(int elemKey, int expressIndex, int point) { this->elemKey = elemKey; this->expressIndex = expressIndex; this->projectPoint = point; } bool ...
ALGO
0.993926
3.582142
79cd67b5-1c61-4993-a424-2961907b16dc
oiu850714/leetcode2022
266-palindrome-permutation.cpp
#include "headers.hpp" class Solution { public: bool canPermutePalindrome(const std::string &S) { std::vector<int> CharCount(26); for (auto C : S) { CharCount[C - 'a']++; } int CharWithOddOccurence = 0; for (auto Count : CharCount) { CharWithOddOccurence += Count & 1; } return...
ALGO
0.998995
6.155147
11b9aaa5-121b-426c-aee0-f5529cbff1e6
chriswengqi/kattis
damsindistress/damsindistress.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; typedef long long ll; #define int ll typedef vector<int> vi; typedef vector<vector<int>> vvi; typedef vector<string> vs; typedef vector<double> vd; typedef vector<vd> ...
ALGO
0.99993
3.785164
2841459d-36a2-4737-b424-163ce1717a76
QaoKi/algo_go
11.dp/6.股票买卖问题/demo0_通用情况/demo0_通用情况.cpp
#include <iostream> #include <string> #include <vector> #include <algorithm> using namespace std; /* 参考,https://mp.weixin.qq.com/s/61CU8PcT2z4Po7cVdwTprg 股票问题,通用条件是 给定一个数组,它的第 i 个元素是一支给定股票第 i 天的价格。 会加上各种限制条件,比如限制交易次数等,让你求能赚到的最大利润。 考虑问题的【状态】,也就是说什么因素决定了可以获得的最大收益? 1,交易的天数 2,允许交易的次数,注...
ALGO
0.99988
4.967672
376108fb-6253-4bf9-93d9-7b27f9d5f69d
PacktPublishing/Learning-R-Programming
Chapter 13/rcpp-parallel.cpp
// [[Rcpp::plugins(cpp11)]] // [[Rcpp::depends(RcppParallel)]] #include <Rcpp.h> #include <RcppParallel.h> using namespace Rcpp; using namespace RcppParallel; struct Transformer : public Worker { const RMatrix<double> input; RMatrix<double> output; Transformer(const NumericMatrix input, NumericMatrix output) ...
ALGO
0.999608
6.276914
108a27aa-9f2e-417c-bd93-33ec3077d10e
fournarin/Programming.in.th
1079_pot/ver1.cpp
#include<bits/stdc++.h> using namespace std; int dp[100010]; int main(){ int n,k; scanf("%d%d", &n,&k); dp[0]=1; int tmp=0; for(int i=1;i<=k;i++){ dp[i]+=dp[i-1]+tmp; tmp+=dp[i-1]; dp[i]+=2009; tmp+=2009; dp[i]%=2009; tmp%=2009; } for(int i=1+k;i<=n;i++){ ...
ALGO
0.999906
3.553469
f94310b9-e040-452f-b34a-3f269bf0d6d3
OtiumCodeInvest/plainH264
viewer/writetext.cpp
#include <stdio.h> #include <stdarg.h> #include <stdlib.h> #include <string.h> #include <math.h> #include <vector> #include "shared/file.h" #include "shared/output.h" #include "writetext.h" #include "atlas.h" struct Vertex { V2 pos; V2 uv; V2 uvscale; V4 region; uint32_t col; }; void AddQuadVertices(std::vector<...
TOOL
0.91424
5.014574
4e05a2ca-fb61-4ee8-bb8c-ec06aed0c6db
pratapshingane18/String
ChangingUpperTOLowerCase.cpp
#include<iostream> using namespace std; int main(){ char s[] = "WELCOME"; int i; for(i=0; s[i]!='\0'; i++){ s[i] = s[i]+32; } cout<<"Changed string is::"<<s<<endl; return 0; }
ALGO
0.987704
3.715268
d9980f01-68ae-44ce-993e-53b1ff6339a4
vishal1677/SE_LAB
DSA_LAB/Assignment_3_Circular_Q/Assignment_3.cpp
#include<bits/stdc++.h> using namespace std; #define size 5 class CircularQ { private: int front=-1; int rear=-1; int arr[size]; public: CircularQ() { for(int i=0; i<size; i++) { arr[i]=-1; } } bool isEmpty() { if(front == rear) { return true; } return false; ...
ALGO
0.998772
4.327142
5ea28416-e629-4957-8da1-475d7b8a465b
ehnryx/acm
ecna-2019/b.cpp
#include <bits/stdc++.h> using namespace std; #define _USE_MATH_DEFINES #include <ext/rope> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_cxx; using namespace __gnu_pbds; template <typename T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_...
ALGO
0.999973
4.142952
f7d00646-daaf-412c-b7d6-1d13a6f1e76a
vishal11912056/StriverSdeSheetChallenge
Heaps/Kth Smallest and Largest Element of Array.cpp
#include<bits/stdc++.h> int findKthSmallest(vector<int>& nums, int k) { priority_queue<int,vector<int>,greater<int>> pq; for(auto it:nums) { pq.push(it); } while(k!=1) { pq.pop(); k--; } return pq.top(); ...
ALGO
0.999986
4.866753
aa2624b2-2b12-4aaa-b7f1-cda284a68eb4
BrainScreame/truth-table
calculator/output.cpp
#include <vector> #include "output.h" using namespace std; bool output(vector<int> &perem, stack <char> funk, stack <char> oper) { bool result; while (!oper.empty()) { char op = oper.top(); oper.pop(); if (op == '!') { char two = funk.top(); funk.pop(); result = operation(op, perem, two); } ...
ALGO
0.999494
4.099507
96dbb1f8-7254-4861-90d0-25f7165b5a3c
isj0/Modern-Cpp
06_Pattern Printing/BinaryTriangle.cpp
#include<iostream> using namespace std; int main() { int n; cout << "Enter height of triangle: "; cin >> n; int a = 1; for (int i = 1; i <= n; i++) { for (int j = 1; j <= i; j++) { if ((i + j) % 2 == 0) { cout << "1 "; } else { ...
ALGO
0.99996
4.980644
b0c7001b-e976-4cb2-b297-c45b5b8fade7
indianaranger/Notification
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
dd745f88-dedd-4b3c-b841-50cbad66c4b5
alexandraback/datacollection
solutions_5766201229705216_0/C++/socketnaut/fullbin.cpp
#include<fstream> #include<vector> #include<algorithm> using namespace std; ifstream fin("fullbinsmall.in"); ofstream fout("fullbinsmall.out"); int N, X, Y; vector<int> edg[1005]; int size(int root, int par){ int ans = 1; for(int i = 0; i<edg[root].size(); i++){ if(edg[root][i] == par) continue; ...
ALGO
0.999394
4.67643
a242d133-25cf-4c17-b36c-1ebedb596527
CodingKingDoyun/Algorithm_Project
TwoPointers/1253.cpp
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int n; cin >> n; vector<int> arr(n, 0); for (int i = 0; i < n; i++) cin >> arr[i]; sort(arr.begin(), arr.end()); int cnt = 0; for (int i = 0; i ...
ALGO
0.999925
5.001762
4957a840-8ea7-4fbb-a0b5-1ae3ad891b1b
NB-T/misc-cpp
flatten.cpp
#include <iostream> #include <numeric> #include <vector> #include "nbtlog.hpp" template <typename T> std::vector<T> flatten(std::vector<std::vector<T>>& input) { // in reverse order, eliminate zero vectors until first nonzero vector // at least in case there are more threads than reads /* for (int i = inp...
ALGO
0.998626
4.872734
4aed01b9-f1c6-4849-8eb5-920a988803be
Duonghbtt/CODEPTIT
PTIT-Source-main/PTIT-Source-main/CodePTIT - DSA/DSA08020 - BIẾN ĐỔI SỐ NGUYÊN TỐ.cpp
// https://code.ptit.edu.vn/student/question/DSA08020 // BIẾN ĐỔI SỐ NGUYÊN TỐ #include <bits/stdc++.h> using namespace std; vector<bool> prime(1e5, 1); void Sieve() { prime[0] = prime[1] = false; for (int i = 2; i * i < 1e5; ++i) { if (prime[i]) { for (int j = i * i; j < 1e5; j += i) { ...
ALGO
0.999796
5.436457
26b51fdc-e17d-414f-b812-d1d962587232
hako-975/file-dev-cpp
semester 4/struktur data/pertemuan 5/lat5_1.cpp
#include<iostream> #include<conio.h> using namespace std; void Tukar(int *a, int *b); int main() { int a, b; cout<<"Masukkan nilai a: "; cin>>a; cout<<"Masukkan nilai b: "; cin>>b; cout<<"Nilai a dan b sebelumnya: "<<a<<" & "<<b; Tukar(&a, &b); cout<<"\nNilai a dan b setelah ditukar: "<<a<<" & "<<b; getch();...
ALGO
0.999362
3.954989
3d8a2fe8-4bf5-4b15-837e-ed09de9f9ad4
ThiagoFBastos/programacao-competitiva
atcoder/D - All Assign Point Add.cpp
#include "bits/stdc++.h" using namespace std; #define INF 1000000000 #define INFLL 1000000000000000000ll #define EPS 1e-9 #define all(x) x.begin(),x.end() #define rall(x) x.rbegin(),x.rend() #define pb push_back #define fi first #define sc second using i64 = long long; using u64 = unsigned long long; using ld = lon...
ALGO
0.999738
4.50378
fb2c29c5-ec81-4ecb-a339-e3b336f4b113
ineyok/Algos
Math/matrix .cpp
using matrix = vector<vector<int>>; // Умножение матриц O(n**3) matrix matmul(matrix &a, matrix &b) { int n = siz(a), k = siz(a[0]), m = siz(b); matrix c(n, vector<int>(m)); for(int i = 0; i < n; ++i) { for(int j = 0; j < m; ++j) { for(int y = 0; y < k; ++y) { c[i][j] +...
ALGO
0.999726
4.578781
d4686b54-54f7-49a9-85ee-ca62fea3ec28
vishalsahare/TLE-Eliminator
Level-3/2223.SumOfScoresOfBuiltStrings.cpp
#ifndef ONLINE_JUDGE #include "../debugger.hpp" #else #include <bits/stdc++.h> using namespace std; #endif //------------ #define endl "\n" // #define uint uint64_t #define ll long long #define ull unsigned long long const int MOD = 1e9 + 7; const int INF = LONG_MAX > 1; //------------ struct MyHash { const in...
ALGO
0.999855
4.793326
5133b868-2e4b-496b-8265-c8c3f490cdad
cs-23-pt-9-01/rapl-interface
benchmarks/quicksort/cpp/bench.cpp
#include <iostream> #include <fstream> #include <sstream> using namespace std; extern "C" { void start_rapl(); void stop_rapl(); } #include <iterator> #include <algorithm> #include <functional> #include <string> #include <vector> // @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ // Code from rosetta s...
ALGO
0.99962
4.357192
dba343a9-45ec-401f-bbfa-57fae52b74f7
JakobChen/DataStructureAndAlogorithm
Algorithm/radixSort/arrayPartition.cpp
/* 561. Array Partition I Given an integer array nums of 2n integers, group these integers into n pairs (a1, b1), (a2, b2), ..., (an, bn) such that the sum of min(ai, bi) for all i is maximized. Return the maximized sum. Example 1: Input: nums = [1,4,3,2] Output: 4 Explanation: All possible pairings (ignoring the ord...
ALGO
0.999983
6.391576
18c93372-c63f-4a64-b020-73aa65005627
renbaoshuo/OI-codes
S2OJ/480/480.cpp
#include <bits/stdc++.h> using namespace std; long long n, m, t, ans, x; long long gcd(long long a, long long b) { if (!b) return a; return gcd(b, a % b); } int main() { cin >> n >> m >> t; if (!m) { cout << -1 << endl; exit(0); } if (!n) { cout << 0 << endl; ...
ALGO
0.99998
5.304885
d5c60add-74f9-472c-9de5-d94698d7d64a
lymph12138/Algorithm-notes-finaltest
LeetCode/DP/Generate_parentheses.cpp
/* 22 class Solution { public: vector<string> generateParenthesis(int n) { vector<string> ans; DFS(ans,0,0,n,""); return ans; } private: void DFS(vector<string> &ans,int open,int close,int n,string cur){ if(cur.size()==2*n){ ans.push_back(cur); return ...
ALGO
0.999888
4.54696
1c635e83-b82f-4c9e-b2d7-8b40770bcda7
thekodidala/LeetCode-CF
0322-coin-change/0322-coin-change.cpp
class Solution { public: /*int possible(int ind,vector<vector<int>>&dp,vector<int>&coins,int amount){ if(ind==0){ if(amount%coins[0]==0)return amount/coins[0]; return 1e9; } if(amount==0)return 0; if(dp[ind][amount]!=-1){return dp[ind][amount];} int no...
ALGO
0.999812
5.830246
33ebd135-b156-4aa9-801c-d127b120d1e0
superQCman/pytorch-gpgpusim
aten/src/ATen/native/cpu/ReduceOpsKernel.cpp
#include "ATen/native/cpu/ReduceOpsKernel.h" #include <numeric> #include <iterator> #include <algorithm> #include "ATen/Dispatch.h" #include "ATen/Parallel.h" #include "ATen/cpu/vec256/vec256.h" #include "ATen/optional.h" namespace at { namespace native { namespace { using namespace vec256; static inline int64_t r...
ALGO
0.993523
7.284568
bdc663ad-bb8f-4767-ac61-bcb8eb77692d
rpavlik/openscenegraph-oldstable-ubuntu
OpenSceneGraph/src/osg/LOD.cpp
#include <osg/LOD> #include <osg/CullStack> #include <algorithm> using namespace osg; LOD::LOD(): _centerMode(USE_BOUNDING_SPHERE_CENTER), _radius(-1.0f), _rangeMode(DISTANCE_FROM_EYE_POINT) { } LOD::LOD(const LOD& lod,const CopyOp& copyop): Group(lod,copyop), _centerMode(lod._centerMode...
TOOL
0.896753
6.671743
6ffa1edc-bed1-484b-a5fa-c811ae4d9ec6
omkumarjha/LeetCode-Problems
2095-delete-the-middle-node-of-a-linked-list/2095-delete-the-middle-node-of-a-linked-list.cpp
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode() : val(0), next(nullptr) {} * ListNode(int x) : val(x), next(nullptr) {} * ListNode(int x, ListNode *next) : val(x), next(next) {} * }; */ class Solution { public: ListNode * middle(Lis...
ALGO
0.999876
5.93601
0e008b2d-78ca-4561-988d-f371acaa2795
nomenas/Algorithms
hackerrank/dynamicprogramming/candieswithreorder.cpp
#include <cmath> #include <cstdio> #include <vector> #include <iostream> #include <algorithm> using namespace std; int main() { #ifdef FILEINPUT freopen("candies.dat","r",stdin); #endif unsigned N = 0; std::cin >> N; std::vector<unsigned> ranks; ranks.resize(N); std::vector<unsigned> ordered; ...
ALGO
0.999983
4.080255
7eb95d6a-80cd-45c7-b6a2-fe38f5323950
wenqing-2021/Leetcode_practice
Algo_DP/offer62_圆圈中剩下的数字.cpp
class Solution { public: int lastRemaining(int n, int m) { int result = 0; for (int i = 2; i <= n; ++i) { result = (result + m) % i; } return result; } };
ALGO
0.999969
6.482308
38f375f0-3250-43c6-9a6a-dcde98acad12
ishandutta2007/codeforces
arthurpd/normal/1244/G.cpp
#pragma once #include <bits/stdc++.h> using namespace std; template <class TH> void _dbg(const char *sdbg, TH h) { cerr << sdbg << '=' << h << endl; } template <class TH, class... TA> void _dbg(const char *sdbg, TH h, TA... a) { while (*sdbg != ',') cerr << *sdbg++; cerr << '=' << h << ','; _dbg(sdbg + 1, a...)...
ALGO
0.999967
3.62205
547a178c-0b9d-4d89-af82-75599f9189df
MansiLad/CS590-Algorithms
HW5/graph.cpp
#include "limits.h" #include "graph.h" #include <list> #include <iostream> using namespace std; #include <cassert> graph::graph(int n, int m, int w) { assert(n > 2 && "Alert! Enter n > 2"); assert(m > 1 && "Alert! Enter m > 1"); int max_edges = n * n - n; assert(m <= max_edges && "Alert! Enter m <= ...
ALGO
0.99947
4.10987
77cbed35-e1f8-401f-b578-6fde42af1a06
Andrew-liu/Leetcode
MinimumPathSum.cpp
#include <iostream> #include <vector> #include <cmath> using namespace std; class Solution { public: int minPathSum(vector<vector<int> >& grid) { if(grid.size() == 0) { return 0; } int row = grid.size(), col = grid[0].size(); vector<vector<int> > min_mat(row + 1, vector<...
ALGO
0.999948
4.862768
1dbd8183-d574-4134-8a3d-88ac303d380f
JustDoom/8ChocChip
src/util/MiscUtil.cpp
#include "MiscUtil.h" #include <SDL3_ttf/SDL_ttf.h> #include <algorithm> #include <cctype> #include <cstring> #include <fstream> #include <iostream> #include <memory> #include <vector> #ifdef _WIN32 #include <windows.h> #include <bcrypt.h> #pragma comment(lib, "bcrypt.lib") #else #include <openssl/sha.h> #endif std...
TOOL
0.97277
6.254348
c81db05b-4539-46b1-bab6-fc48fdb92b51
apurbaaaa/VITwork
6th Sem/Cryptography and Network Security Raja SP/Lab/Lab 5/rc4perm.cpp
#include <iostream> #include <vector> using namespace std; void printS(const vector<int>& S) { for (int val : S) { cout << val << " "; } cout << endl; } void rc4_permutation(vector<int>& S, const vector<int>& T) { int j = 0; for (int i = 0; i < 8; i++) { j = (j + S[i] + T[i]) % 8;...
ALGO
0.999655
4.065602
88029cc2-5132-4446-b36b-6193723985c8
renbaoshuo/OI-codes
Luogu/P2074/P2074.cpp
#include <bits/stdc++.h> using namespace std; int n, m, k, t, x, y, ans, sum; int main() { cin >> n >> m >> k >> t; for (int i = 0; i < k; i++) { sum = 0; cin >> x >> y; for (int i = max(1, x - t); i <= min(n, x + t); i++) { for (int j = max(1, y - t); j <= min(m, y + t); ...
ALGO
0.999923
4.251298
737976bd-4be8-4c8c-b8e0-136d0b7e8ebf
dinesh-2047/GeekForGeeks-POTD-Solutions
April-2025-POTDs/25th April - Majority Element.cpp
// Majority Element // Approach 1 class Solution { public: int majorityElement(vector<int>& arr) { int n = arr.size(); unordered_map<int , int>mp ; for(auto &num : arr) mp[num]++; int ans = -1 ; int count = 0 ; for(auto &pair : mp...
ALGO
0.999968
5.361532
892b2871-8a74-4daf-a594-441ebbd50357
ASSIST-IoT-SRIPAS/infinitime-heart-rate
src/components/heartrate/Ptagc.cpp
#include "components/heartrate/Ptagc.h" #include <cmath> using namespace Pinetime::Controllers; /** Original implementation from wasp-os : https://github.com/daniel-thompson/wasp-os/blob/master/wasp/ppg.py */ Ptagc::Ptagc(float start, float decay, float threshold) : peak {start}, decay {decay}, boost {1.0f / decay}, ...
ALGO
0.96459
6.360389
ca4be68d-2bcf-4ce9-9459-44c8bde0a9e7
KohanAlex26/SortingVisualizer
Sorting/Algorithms.cpp
#include "Algorithms.h" #include <QCoreApplication> #include <QTime> #include <QPointF> Algorithms::Algorithms(int el,QSlider* slider){ this->el=el; this->slider=slider; } Algorithms::~Algorithms(){ } void Algorithms::delay() { if(slider->value()==0) { QTime dieTime= QTime::currentTime().ad...
ALGO
0.99905
4.656246
99832d38-8edf-4b69-a8e0-6a495d45940f
strategist614/ACM-Code
刷题比赛/LUOGU/P3817 小A的糖果.cpp
/* 独立思考 一个题不会做,收获5%,写了代码10%,提交对了30%,总结吃透了这个题才是100%. */ #include<bits/stdc++.h> using namespace std; template <typename T> void read(T &x) { x = 0; char c = getchar(); int sgn = 1; while (c < '0' || c > '9') {if (c == '-')sgn = -1; c = getchar();} while (c >= '0' && c <= '9')x = x * 10 + c - '0', c = getchar();...
ALGO
0.999982
3.408978
65506de8-3513-41c8-a181-fb8ff362a8ea
jscblack/Oceanbase_Competition_2023_Final
src/storage/multi_data_source/ob_mds_table_merge_dag.cpp
#include "storage/multi_data_source/ob_mds_table_merge_dag.h" #include "lib/ob_errno.h" #include "lib/utility/ob_print_utils.h" #include "storage/multi_data_source/ob_mds_table_merge_task.h" #include "storage/multi_data_source/ob_mds_table_merge_dag_param.h" #include "share/scheduler/ob_dag_warning_history_mgr.h" #def...
TOOL
0.925442
6.521307
5ddcb464-44e3-4804-995d-90e8160459a7
liangkang233/leetcode-cpp
刷题计划/美团专题/meituan-011.cpp
/* * meituan-011. 搭配出售 * * https://leetcode-cn.com/problems/0JzXQB/ */ #include <iostream> #include <vector> #include <algorithm> using namespace std; typedef pair<int, int> pi; int main () { int a, b, c, d, e, f, g; long long ans = 0; // 翻译翻译 共d个选择, 选 a b c 分别赚 e f g 求赚取方案的最大值 // 注意 long long 溢出...
ALGO
0.999178
3.475736
1bf92a94-8082-4713-851a-d034d7393e3e
Brihat9/CPP_Programming
exam/powertemplate.cpp
#include<iostream> #include<cmath> using namespace std; template<typename T> T powerr(T b,int p) { if(p<0) p=-p; return pow(b,p); } int main(void) { cout<<"Enter base and power : "; int base,power; cin>>base>>power; cout<<"result : "<<powerr(base,power); return 0; }
ALGO
0.999915
5.068598
190f4163-1641-43a8-83ce-01e2df67a3b7
pborky/openvibe
openvibe-plugins/signal-processing/trunc/src/box-algorithms/filters/ovpCBoxAlgorithmSpatialFilter.cpp
#include "ovpCBoxAlgorithmSpatialFilter.h" #include <system/Memory.h> #include <sstream> #include <string> #include <cstdio> using namespace OpenViBE; using namespace OpenViBE::Kernel; using namespace OpenViBE::Plugins; using namespace OpenViBEPlugins; using namespace OpenViBEPlugins::SignalProcessing; OpenViBE::u...
ALGO
0.953291
5.918925
f239e72b-2870-4d87-b09a-779f6d7d4b64
abdallah-shehawey/PS_Assuit_Sheet
Sheet_2/Y.cpp
#include <iostream> int main() { int n, i, fib[45]; fib[1] = 0; fib[2] = 1; scanf("%d", &n); for (i = 1; i <= n; i++) { if (i == 1 || i == 2) printf("%d ", fib[i]); else { fib[i] = fib[i - 1] + fib[i - 2]; printf("%d ", fib[i]); } } return 0; }
ALGO
0.999922
3.968532
0ab8b009-f443-4a40-b0e9-09854aff1585
sosp24p269/relay
crdb_relay/crdb_relay/c-deps/geos/src/noding/FastSegmentSetIntersectionFinder.cpp
#include <geos/noding/FastSegmentSetIntersectionFinder.h> #include <geos/noding/SegmentString.h> #include <geos/noding/SegmentIntersectionDetector.h> #include <geos/noding/SegmentSetMutualIntersector.h> #include <geos/noding/MCIndexSegmentSetMutualIntersector.h> #include <geos/algorithm/LineIntersector.h> namespace ge...
ALGO
0.997766
7.263789
f2db6198-6dbe-4ed6-b822-347fdf81686c
Thre4dripper/LeetCode
2154-keep-multiplying-found-values-by-two/2154-keep-multiplying-found-values-by-two.cpp
class Solution { public: int findFinalValue(vector<int>& nums, int original) { for(int i=0;i<nums.size();i++) { if(nums[i]==original) { original*=2; i=-1; } } return original; } };
ALGO
0.999906
5.404175
57299a55-4aab-4020-9d61-abe2236ce21a
ishandutta2007/codeforces
azberjibiou/normal/1486/E.cpp
#include <bits/stdc++.h> #define fir first #define sec second #define ll long long #define pll pair<ll, ll> #define pii pair<int, int> #pragma GCC optimize("O3") #pragma GCC optimize("Ofast") #pragma GCC optimize("unroll-loops") using namespace std; const int mxN=100100; const ll INF=1000000000000000001; typedef struct...
ALGO
0.999941
3.705184
447ae902-5336-4675-b606-8d386c3f2073
MuhammadMueez/Assignment_-_2
4.22.cpp
#include <iostream> using namespace std; int main() { int row {12}; unsigned int column; while ( row >= 0 ) { column = 1; while ( column <= 6 ) { if (row % 3 == 0) { cout << "#"; } else { cout << ( column % 6 ? "-" : ">" ); // output } ++column; } --row; cout << endl; } } /* it prints : ###### ---...
ALGO
0.995772
3.433699
e365766f-745c-43ed-8d91-1c48f0903ff3
amitrbhagat/C-WORK
Tree/pr25_Tree.cpp
#include <iostream> using namespace std; class Node { public: Node *lchild; int data, height; Node *rchild; } *root = NULL; int Height(Node *p) { int hl, hr; hl = p && p->lchild ? p->lchild->height : 0; hr = p && p->rchild ? p->rchild->height : 0; return hl > hr ? hl + 1 : hr + 1; } int ...
ALGO
0.99999
5.370794
cb2e8e7c-d5c9-4a78-b9da-1c0dbe91f966
DevLuchez/PanfitApp-Front
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.998799
6.776823
03b3ea76-be5c-4acb-950d-74c72badc403
Shinimani/CompC
C++/Forces/div2_637/a.cpp
#include<bits/stdc++.h> using namespace std; #define repn(i,n) for(int i=0;i<n;i++) #define io ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0); #define ll long long #define pb push_back #define endl '\n' // #define pii pair<ll int,ll int> // #define vi vector<...
ALGO
0.999208
3.767286
ef40fffd-6142-42e2-b94f-92bd6e4472f9
Slava/competitiveProgramming
spoj/arda1.cpp
#include <cstdio> typedef unsigned long long ull; const int N = 310; const int M = 2010; int n1, m1, n2, m2; char s[N][N], m[M][M]; ull h[N], h2[M][N], p_pow[M]; int main () { p_pow[0] = 1; for (int i = 0; i < M; i++) p_pow[i] = 31 * p_pow[i - 1]; scanf ("%d %d\n", &n1, &m1); for (int i = 0; i < n1; i++) scan...
ALGO
0.999086
3.247888