uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
e56188ae-3ccc-407c-83b2-9f5b821f04fc
TheFenrisLycaon/DSA-C--
cp/CodeForces/0300-0399/355A.cpp
#include <cstdio> int main(){ int k(0), d(0); scanf("%d %d", &k, &d); if(k == 0 || (d == 0 && k > 1)){puts("No solution");} else{printf("%c", '0' + d); for(int m = 1; m < k; m++){printf("0");}; printf("\n");} return 0; }
ALGO
0.999965
3.499825
a3560805-fc70-4b1d-891a-9fecb282ea4f
hikjik/leetcode
solutions/majority-element-ii/test.cpp
#include <catch.hpp> #include <solution.hpp> TEST_CASE("Simple") { struct TestCase { std::vector<int> nums; std::vector<int> expected; }; std::vector<TestCase> test_cases{ { .nums{3, 2, 3}, .expected{3}, }, { .nums{1}, .expected{1}, }, ...
TEST
0.864852
6.438751
415e22bc-d1b2-442a-8229-e56ae79939f3
Chet8n/InterviewPrep
1.Array and math/Compute nCr % p.cpp
/* Compute nCr % p Problem Description Given three integers A, B and C, where A represents n, B represents r and C represents p and p is a prime number greater than equal to n, find and return the value of nCr % p where nCr % p = (n! / ((n-r)! * r!)) % p. x! means factorial of x i.e. x! = 1 * 2 * 3... * x. NOTE: For...
ALGO
0.999995
4.424447
dca6fe7e-fc60-4b50-a1ec-30197415efb0
wassimalharaki/Codeforces
800/ParkwayWalk.cpp
#include <bits/stdc++.h> using namespace std; #define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0) #define int long long #define all(v) v.begin(), v.end() #define nl << '\n' #define v vector #define vi vector<int> #define pii pair<int, int> #define mp make_pair #define pb push_back #define INF LONG_LONG...
ALGO
0.999871
4.512783
828f6414-ada0-4d39-a9e0-5578948ea522
nisha2109/APS-2020
anagramsString.cpp
#include<bits/stdc++.h> #define N 256 using namespace std; bool checkAnagram(char *str1,char *str2) { int characterArray[N]={0}; //int characterArray2[N]={0}; int i=0; for(i=0;str1[i] && str2[i];i++) { characterArray[str1[i]]++; characterArray[str2[i]]--; } if(str1[i] || str2[i]) return false; for(i=0;i<...
ALGO
0.999955
3.746922
a15f9691-0ef9-4412-8afb-cb90555be2bf
JLopez662/Algo-Expert-Answers
Greedy Algorithms/Class Photos.cpp
#include <vector> #include <iostream> #include <algorithm> using namespace std; bool classPhotos(vector<int> redShirtHeights, vector<int> blueShirtHeights) { int size = redShirtHeights.size(); sort(redShirtHeights.begin(), redShirtHeights.end()); sort(blueShirtHeights.begin(), blueShirtHeights.end()); cout...
ALGO
0.999752
4.854142
e2271202-8fb1-4524-a8a9-8df83e30a3dc
lz520520/rust-1.75-ollvm
src/llvm-project/llvm/lib/Transforms/Utils/LoopPeel.cpp
#include "llvm/Transforms/Utils/LoopPeel.h" #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/Statistic.h" #include "llvm/Analysis/Loads.h" #include "llvm/Analysis/LoopInfo.h" #include "llvm/Analysis/LoopIterator.h" #include "llvm/Analysis/ScalarEvolution.h" #include "llvm/Analysis/Sca...
ALGO
0.935095
5.558605
c2070014-fe67-4bac-b4c7-c8bc7077d2e1
HPC-Fortran2CPP/Fortran2Cpp
data/readable_format/cpp/file1518.cpp
#include <iostream> #include <cmath> // for std::abs int main() { // Assuming the use of float for 'real' equivalence. If you need double precision, change float to double. float a[2]; // Arrays in C++ are 0-indexed float b[2]; // Assuming some values for a as your Fortran code does not initialize...
ALGO
0.997534
3.464098
fd683027-be33-489f-a5bd-4d55a2e466d3
greenbeanpie/OI-training
NOIP2023-ZJ/ZJ-0036/run/run.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long const int N=1e5+10; int c,T; int n,m,k,d; pair<pair<int,int>,int> a[N]; namespace BF{ ll f[N]; int b[N<<1],btot; ll val[2010][2010]; void solve() { b[++btot]=0; b[++btot]=n+1; for(int i=1;i<=m;i++) b[++btot]=a[i].first.first+1,b[++btot]=a[...
ALGO
0.999896
4.225117
7e522cda-2b79-42e5-b17d-232ce9d53bb8
fbigiolli/uba-aed3tps
tp2/ej1/misc/ej1Cubren.cpp
#include <vector> #include <list> #include <iostream> using namespace std; void dfs(vector<list<int>>& adjacency_list, vector<int>& status, vector<vector<int>>& tree_edges,vector<int>& back_edges_con_extremo_superior_en, vector<int>& back_edges_con_extremo_inferior_en, int v, int p) { // Status en 2 significa que...
ALGO
0.999461
4.857424
3ae095ff-feea-4d11-92d8-3d43101872a8
ngochahh2005/PTIT-code
CodePTIT-C/C03029.cpp
#include <stdio.h> int kt(long long n) { while (n > 0) { if ((n % 10) % 2 != 0) return 0; n /= 10; } return 1; } int main() { int t; scanf("%d", &t); while (t--) { long long n; scanf("%lld", &n); if (kt(n) == 1) printf("YES\n"); else printf("NO\n"); } }
ALGO
0.998837
4.546567
4876f6f4-8fdb-49ec-8adb-628a93878f04
mrzhuzhe/lust
test_cgal/src/simple.cpp
#include <iostream> // #include <CGAL/Simple_cartesian.h> #include <CGAL/Exact_predicates_exact_constructions_kernel.h> #include <CGAL/convex_hull_2.h> // typedef CGAL::Simple_cartesian<float> Kernel; // typedef Kernel::Point_2 Point_2; // typedef Kernel::Segment_2 Segment_2; typedef CGAL::Exact_predicates_inexact_co...
ALGO
0.998959
4.427921
fce53c21-a8eb-4dd9-bbb5-f0e693c25989
RajaKunalPandit1/Leetcode_Questions
12. Integer to Roman .cpp
Output Status : Runtime: 7 ms, faster than 88.47% of C++ online submissions for Integer to Roman. Memory Usage: 6 MB, less than 47.60% of C++ online submissions for Integer to Roman. class Solution { public: string intToRoman(int num) { string res = ""; while(num >= 1000){ ...
ALGO
0.999868
6.262639
a5a2f169-ca44-492b-8034-30a1b52a5ac7
melody97/geminifs
libgeminiFs_src/cccl/libcudacxx/test/libcudacxx/std/algorithms/alg.sorting/alg.min.max/max_init_list_comp.pass.cpp
// <algorithm> // template<class T, class Compare> // T // max(initializer_list<T> t, Compare comp); #include <cuda/std/__algorithm_> #include <cuda/std/cassert> #include <cuda/std/functional> #include <cuda/std/initializer_list> #include "test_macros.h" __host__ __device__ TEST_CONSTEXPR_CXX14 bool test() { ...
TEST
0.963645
6.127769
0bd3207b-aa1b-4842-a77b-944afb3a56da
strain7626/BaekJoon
2075_Silver3_N번째 큰 수.cpp
#include <bits/stdc++.h> using namespace std; int N; priority_queue<int, vector<int>, greater<>> PQ; int main() { ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0); cin >> N; for (int i = 0; i < N; i++) { for (int j = 0; j < N; j++) { int t; cin >> t; PQ.push(t); ...
ALGO
0.99992
3.635276
1d4fddb7-cc52-4526-b85e-47652eed332b
CS17B023/ParallelComputing
11.cpp
#include<stdio.h> #include<stdlib.h> #include<mpi.h> #include <random> #include <iostream> #include <thread> #include <chrono> using namespace std::chrono; int i=0,count=0; pthread_mutex_t lock; void iittp_barrier(int rank,int np,int tid,int num_threads) { if(rank==0&&tid==0) { MPI_Send(&i,1,MPI_INT,1...
ALGO
0.998516
3.735108
e508cf02-d65b-42ce-bfb4-f38725a3d55f
Naoki-Hiraoka/prioritized_nlp
prioritized_nlp_ifopt/src/prioritized_nlp_ifopt.cpp
#include <prioritized_nlp_ifopt/prioritized_nlp_ifopt.h> #include <ifopt/problem.h> #include <ifopt/ipopt_solver.h> #include <ifopt/constraint_set.h> #include <ifopt/variable_set.h> #include <ifopt/cost_term.h> #include <iostream> namespace prioritized_nlp_ifopt{ class MyVariables: public ifopt::VariableSet{ publ...
ALGO
0.999592
5.698704
98018a88-e9fd-4572-8805-20389c0a18fb
K0nnyaku/Code
Data/CSP-JS2021二轮提高组数据/SD-00980/airport/airport.cpp
#include<iostream> #include<cstdio> #include<queue> #include<cstring> #include<stdlib.h> #include<algorithm> using namespace std; typedef long long ll; typedef unsigned long long ull; inline int read(){ int x=0,f=1;char ch=getchar(); while(!isdigit(ch)){ if(ch=='-') f=-1; ch=getchar(); } while(isdigit(ch)){ x...
ALGO
0.99993
3.744306
81d0d8ec-b579-43d6-9235-ed6f5b3a0973
BhomikTomar/CP-DSA
800/united_we_stand.cpp
#include<iostream> #include<vector> #include<map> using namespace std; int main() { int t; cin >> t; while (t--) { int n; cin >> n; vector<int> a(n); for (int i = 0; i < n; i++) { cin >> a[i]; } map<int,int> mp; for (int i =...
ALGO
0.999906
4.146915
f6a5af35-598b-4179-96bb-b968607af619
burhanuddinbhopalwala/data-structures-DS-implementations-1st-year-app
linked_list/1_LinkedList_Node_At_Beginning.CPP
#include<iostream> using namespace std; // Linked List 1 //Inserting the node at the beginning . class Node { int data; Node* next; public: void insert(int); void print(); }; Node* head; // Global Variable. void Node::insert(int x) { Node* temp = new Node(); temp->data = x; temp->next = head; head = temp; } v...
ALGO
0.997447
3.807738
d41e53e7-72ea-4a7a-9569-b6afbe2b6ce2
OmarAlSeddik/competitive-programming-codeforces
1500/boredom.cpp
#include <bits/stdc++.h> using namespace std; #define MAX 100001 int main() { long long dp[MAX] = {0}; int n; cin >> n; for (int i = 0; i < n; i++) { int x; cin >> x; dp[x]++; } for (int i = 1; i < MAX; i++) { dp[i] = dp[i] * i; if (i > 2) dp[i] += dp[i-2...
ALGO
0.998847
3.631253
4eef139d-6b84-4a39-acca-729a19df7ac9
chiragHORSE12/SUPREME-BATCH
week03/inputdiffoutsame.cpp
#include<iostream> using namespace std; int main(){ int arr[5]={1,3,5,7,9}; for(int i=0;i<5;i++){ arr[i]=1; cout<<arr[i]<<" "; } return 0; }
ALGO
0.992893
3.088181
2d88fdab-a6bd-4716-a747-a56442809a3d
hey-frnk/teaching
Diffusion/diffusion.cpp
#include <iostream> #include <sstream> #include <fstream> #include <cmath> // Bibliothek zur Erstellung von BMP-Grafiken #include "himage.h" using namespace std; // Mit allocateMatrix wird eine neue, uninitialisierte Matrix reserviert double** allocateMatrix(int n){ // Hier Code einfuegen } // Mit deallocateMatri...
ALGO
0.99919
4.670776
07a634bf-f3c7-4d1d-ad63-260aeda09a61
Proto007/Hunter_CS135_Summer23
course-app/public/extra_content/arrays.cpp
/*** * Author: Sadab Hafiz * Class: CS135 SUMMER * A bunch of common array algorithms shown using an integer array */ #include <iostream> using namespace std; const int CAPACITY = 10; /** * @brief Print out an array in formatted way * * @param arr array that is being printed * @param size size of the array */...
TOOL
0.978594
5.873694
83f2ad58-04af-4404-861e-836e6e311178
mariospapa90/UE4-HW-4.18
Engine/Source/ThirdParty/nvTextureTools/nvTextureTools-2.0.6/src/src/nvtt/Compressor.cpp
#include <nvtt/nvtt.h> #include <nvcore/Memory.h> #include <nvcore/Ptr.h> #include <nvimage/DirectDrawSurface.h> #include <nvimage/ColorBlock.h> #include <nvimage/BlockDXT.h> #include <nvimage/Image.h> #include <nvimage/FloatImage.h> #include <nvimage/Filter.h> #include <nvimage/Quantize.h> #include <nvimage/NormalMa...
TOOL
0.890364
3.580218
e20afdf3-df99-40b8-9f7e-8f29045b4bf0
theroughcoder/codechef
Beginner/solubility.cpp
#include <iostream> using namespace std; int main() { int T, X, A, B, sugar; cin >> T; for (int i = 0; i < T; i++) { cin >> X >> A >> B; sugar = (A + (100 - X) * B) * 10; cout << sugar << endl; } }
ALGO
0.997108
3.693331
b48b6dd4-371f-4f41-834b-f4d2d12ddcbe
vlad907/algorithms
311/Project_2/AirportDriver2.cpp
#include <vector> #include <string> #include <iostream> #include <chrono> //#include <cin> //#include <cout> using namespace std; class Plane { public: int id; int time; std::string departing_or_arriving; int priority; Plane(int idty, int tm, std::string d_or_a, int py) { ...
ALGO
0.998318
4.801104
b4af766b-456c-4844-bb3d-647cff52c9f0
walkccc/LeetCode
solutions/294. Flip Game II/294.cpp
class Solution { public: bool canWin(string currentState) { const auto it = mem.find(currentState); if (it == mem.cend()) return it->second; // If any of currentState[i:i + 2] == "++" and your friend can't win after // changing currentState[i:i + 2] to "--" (or "-"), then you can win. for ...
ALGO
0.999978
6.013975
1a5000ae-8922-48c2-bfad-ee90851063aa
DeneesK/cpp-search-server
search-server/string_processing.cpp
#include "string_processing.h" #include <algorithm> using namespace std; vector<string_view> SplitIntoWords(string_view text) { int i = 0; int len = 0; vector<string_view> words; std::for_each(text.begin(), text.end(), [&](const char& c) { if (c == ' ') { if (len) ...
ALGO
0.958763
5.167922
5f758f77-5d8e-40f5-8fd5-32b2be9e9a53
CsSnow98/StudyNotes
Acwing/C++/语法课/day07/合并两个排序的链表.cpp
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ class Solution { public: ListNode* merge(ListNode* l1, ListNode* l2) { ListNode * dummy = new ListNode(-1); ListNode * p = dummy; whi...
ALGO
0.999992
5.605815
4f7af8ed-1a1f-4fb5-bd75-58ac25ee69a4
bharathsans/LeetPush
96-Unique-Binary-Search-Trees.cpp
class Solution { public: int numTrees(int n) { vector<int> dp(n + 2, 0); dp[0] = 1; // No elements 1 way... dp[1] = 1; // 1 element 1 way... dp[2] = 2; // 1 is root or 2 is root... for(int sz = 3; sz <= n; sz++){ // Go for each element as root, and sum up... ...
ALGO
0.999988
6.764952
f24b3675-4b7e-4dd3-9812-b33946ffc7ae
lesiukoksana/Lab.04.3
Lab_04_3/Lab_04_3.cpp
#include <iostream> #include <cmath> #include <iomanip> using namespace std; int main() { double F, a, b, c, x, xp, xk, dx; cout << "a = "; cin >> a; cout << "b = "; cin >> b; cout << "c = "; cin >> c; cout << "xp = "; cin >> xp; cout << "xk = "; cin >> xk; cout << "dx = "; cin >> dx; cout << fixed; cout <...
ALGO
0.99494
3.470627
29dcc187-1f83-4952-9285-b771585039c5
samfubuki/lbcodessolution
Array/minimisetheheights.cpp
// { Driver Code Starts //Initial template for C++ #include <bits/stdc++.h> using namespace std; // } Driver Code Ends //User function template for C++ class Solution{ public: int getMinDiff(int arr[], int n, int k) { vector<pair<int,int> > v; vector<int> vis(n); for(int i=0;i<n;i++) { ...
ALGO
0.999926
5.770982
a73f431c-9533-4864-9d3f-118918b44e74
stjohnfinn/project-euler-solutions
10001st-prime/10001st-prime.cpp
#include <iostream> #include <math.h> bool isPrime(int x) { for (int i = 2; i < sqrt(x) + 1; i++) { if (x % i == 0) { return false; } } return true; } int main() { int primeCount = -1; int i = 0; while (true) { if (isPrime(i)) primeCount++; ...
ALGO
0.999802
5.122146
fee17a7a-0981-46c4-9a18-5d8fc2ba8a0f
praduman7081/Tree-data-Structure
basic.cpp
#include<bits/stdc++.h> using namespace std; class Tree { public: int val; Tree* left; Tree* right; Tree(int v){ val = v; left = NULL, right = NULL; } }; void preorder(Tree* root,vector<int> &vec){ if(root == NULL){ return; } vec.push_back(root->val); preorder(root->...
ALGO
0.999938
4.714276
360d53d1-2ed4-443f-aff6-d79a94a28482
Aryanpatil2502/OOPS
selectionSort_template.cpp
#include <iostream> using namespace std; int n; #define size 10 template <class T> void sel(T A[size]) { int i, j, min; T temp; for (i = 0; i < n - 1; i++) { min = i; for (j = i + 1; j < n; j++) { if (A[j] < A[min]) min = j; } temp =...
ALGO
0.993617
3.980577
f5293395-b3e6-46fc-a73e-f00a278c6f99
jash13desai/leetcode
201-250/201-210/202. Happy Number.cpp
class Solution { int f(int n){ int sum=0; while(n){ int d = n%10; n /= 10; sum += d*d; } return sum; } public: bool isHappy(int n) { unordered_set<int> visited; // for(int i=0; i<19; i++){ while(1){ if(n==1)...
ALGO
0.999977
6.278255
b4e7598c-2a9c-4af8-9fd0-99c8bbbb30ab
iwatakeshi/dsu
CSC-482 Algorithms and Optimizations/homework/boost_1_65_1/libs/compute/perf/perf_set_difference.cpp
#include <algorithm> #include <iostream> #include <numeric> #include <vector> #include <boost/compute/system.hpp> #include <boost/compute/algorithm/set_difference.hpp> #include <boost/compute/container/vector.hpp> #include "perf.hpp" int rand_int() { return static_cast<int>((rand() / double(RAND_MAX)) * 25.0); }...
ALGO
0.940939
5.842721
76b2996d-f1fd-4a6c-9f86-dc5e49c4f680
alphaprojectv1/Programming
Competitive-Programming/Can_Go.cpp
/* Question: Input: 5 8 ######## #.A#...# #.##.#B# #......# ######## Output: Yes */ #include<bits/stdc++.h> #include <stdio.h> #define ll long long #define nl "\n" #define blk " " #ifndef ONLINE_JUDGE #define debug(a) cout<<a<<nl; #else #define debug(a) #endif using namespace std; const int N=1e5+5; char adj[1005][100...
ALGO
0.999651
4.434022
917a8c23-e5e5-4bc8-9262-c5edb75048d4
ManthanK-24/SDE_DSA_Sheet
Day8_Greedy/P45)Job_Sequencing.cpp
class Solution { public: static bool comp(Job a, Job b) { return a.profit > b.profit; } //Function to find the maximum profit and the number of jobs done. vector<int> JobScheduling(Job arr[], int n) { // your code here int jobs = 0; int profit = 0; ...
ALGO
0.999886
6.007507
8a7999fc-dfe2-49ee-a22b-2bc2ead5e800
prakashanki526/leetcode
0491-non-decreasing-subsequences/0491-non-decreasing-subsequences.cpp
class Solution { public: void func(int idx,vector<int>&nums,vector<int>&a,set<vector<int>>&ans){ int n=nums.size(); //If we have our index greater than or equal to sizeof nums then we cant go further //so we will check if there is a subarray with size greater than equal to 2 if(idx...
ALGO
0.999987
6.26679
c92e1863-785a-4b5e-8790-ecae08cf7604
ishandutta2007/codeforces
tsukiko_tsutsukakushi/normal/1461/E.cpp
/** * author: otera **/ #include<bits/stdc++.h> using namespace std; #define int long long typedef long long ll; typedef long double ld; const int inf=1e9+7; const ll INF=1LL<<60; #define rep(i, n) for(int i = 0; i < n; ++ i) #define per(i,n) for(int i=n-1;i>=0;i--) #define Rep(i,sta,n) for(int i=sta;i<n;i++)...
ALGO
0.999903
3.465009
e53b62a2-52cc-4499-ba8e-ec772d8375ca
naormatania/OnlineSCRAM
src/assigner.cpp
/* * assigner.cpp * * Created on: June, 2014 * Author: naorm */ #include <ros/ros.h> #include <algorithm> #include <move_base_msgs/MoveBaseAction.h> #include <actionlib/client/simple_action_client.h> #include <boost/algorithm/string.hpp> #include <iostream> #include <string> #include <vector> #include <fstr...
ALGO
0.999566
4.103755
25197efb-fab6-488f-b434-f38307602ef7
hljeong/cp
kattis/allcolourings.cpp
#include <bits/stdc++.h> #define A first #define B second #define vc vector using namespace std; using ll = long long; using ld = long double; using vi = vc<int>; using vll = vc<ll>; using pii = pair<int, int>; template<class T> bool ckmin(T &a, const T &b) { return b < a ? a = b, 1 : 0; } template<class T> bool ckmax...
ALGO
0.999995
4.083031
aa406e7a-9f51-4170-8433-d50fffc1a7af
DevT75/CrackYourInternship
DP_1_Climbing_Stairs.cpp
#include <bits/stdc++.h> using namespace std; class Solution { public: int solve(int n,vector<int>& dp){ if(n == 1) return 1; if(n == 2) return 2; if(dp[n] != -1) return dp[n]; else return dp[n] = solve(n-1,dp)+solve(n-2,dp); } // 1 <= n <= 46 int climbStairs(int n) { ...
ALGO
0.999975
5.423716
83ed4a06-8409-4c4f-9aa6-e047e23f5ebe
BitByteBender/Software_Engineering
Foundation/Cpp_Content/Cpp_Level02/03-Vectors/07-vec-empty-clear.cpp
#include <iostream> #include <vector> using std::cout; using std::endl; using std::vector; int main(void) { vector <short> vNumbers; vNumbers.push_back(78); vNumbers.push_back(35); vNumbers.push_back(14); vNumbers.push_back(64); vNumbers.push_back(99); vNumbers.push_back(115); vNumbers.push_back(85);...
TOOL
0.852833
3.829161
00540c1a-7546-4f48-ad89-18ec8f7154c4
phipyao/02-timSort
implementation/timSort.cpp
#include <iostream> #include <vector> #include <algorithm> using namespace std; // returns a number equal to or slighly less than a power of 2 between 32 and 64 int calculateMinRun(int n) { int r = 0; while (n >= 32) { r |= n & 1; // record if a bit will be shifted off n >>= 1; // divide n ...
ALGO
0.999995
5.6745
d6c0860b-cabe-4e8c-ab8a-8c4e514987e5
HosungJoo/BOJ_Algorithm
SWEA/D5/1248. [S/W 문제해결 응용] 3일차 - 공통조상/[S/W 문제해결 응용] 3일차 - 공통조상.cpp
#include<iostream> #include<vector> #include<cstring> using namespace std; int T; int V, E; int node1, node2; int anstop; int cnt; int parent[10001]; vector<int>tree[10001]; int visited[10001]; bool ansvisited[10001]; void init() { memset(visited, 0, sizeof(visited)); memset(ansvisited, 0, sizeof(ansvisited)); m...
ALGO
0.999897
4.309256
c9f8f313-af93-4757-a52a-75f8bd16187b
airdcpp-web/airdcpp-webclient
airdcpp-webapi/web-server/WebServerSettings.cpp
#include "stdinc.h" #include <web-server/WebServerManager.h> #include <web-server/WebServerSettings.h> #include <api/common/SettingUtils.h> #include <airdcpp/core/io/File.h> #include <airdcpp/core/timer/TimerManager.h> namespace webserver { #define CONFIG_NAME "web-server.json" #define CONFIG_DIR AppUtil::PATH_USER...
WEB
0.886072
5.848016
9e61ab64-c3e9-4dcb-a45a-08f570abfdbf
fsaadatmand/Cpp-Primer
chapter14/14.40.cpp
/* * Exercise 14.40: Rewrite the biggies function from § 10.3.2 (p. 391) to use * function-object classes in place of lambdas. * * By Faisal Saadatmand */ #include <iostream> #include <string> #include <vector> #include <algorithm> class ShorterString { public: bool operator()(const std::string &s1, const std...
TOOL
0.997289
6.342547
5fd1bf3b-7370-4431-ad88-5b1e8e924b58
ishandutta2007/codeforces
2222/normal/7/E.cpp
#include <algorithm> #include <iostream> #include <sstream> #include <complex> #include <numeric> #include <cstring> #include <vector> #include <string> #include <cstdio> #include <queue> #include <cmath> #include <map> #include <set> using namespace std; #define all(a) (a).begin(),(a).end() #define sz(a) int((a).s...
ALGO
0.996748
3.922498
0e29cd2a-e3d7-4014-acc6-26450bd1ca70
Ajay35/IPSC_assignments
a1/1_3_b.cpp
#include<bits/stdc++.h> using namespace std; class csr_matrix{ public: int row,col; vector<int> row_ptr; vector<int> col_indices; vector<int> val; void print(vector<int> arr){ for(int i=0;i<arr.size();i++){ cout<<arr[i]<<" "; } cout<<"\n"; } csr_matrix(vector<vector<int>> v){ int...
ALGO
0.999869
3.481714
b3f23ac2-cf68-4adf-a816-2384034dee85
phumipatc/C_Competitive_Programming
C++ - 2560/Pre 2_1 Camp/48_Refuel.cpp
/* Task : Author : Phumipat C. School : RYW Language :C++ */ #include<bits/stdc++.h> using namespace std; struct A{ int v,w,money,oil; bool operator < (const A&o) const{ return money>o.money; } }; vector< A> g[1100]; priority_queue< A> heap; int dis[1100][1100],oil[1100]; int main() { A now;...
ALGO
0.999913
3.53438
5382c1e6-dffc-4907-8219-4443483b9fc6
n22dcdk069/adfasf
Chapter10/Program/program7.cpp
// This program tests two C-strings for equality // using the strcmp function. #include <iostream> #include <string> using namespace std; int main() { // Two arrays for two strings. const int LENGTH = 40; char firstString[LENGTH], secondString[LENGTH]; // Read two strings. cout << "Enter a string:...
ALGO
0.932054
5.629725
bd6093c9-1114-4b2b-97d4-643e2536e183
donbasta/leetcode-submissions
Hard/1851.cpp
struct Vertex { int s, e, val; bool lz = false; Vertex *left = nullptr, *right = nullptr; Vertex(int s, int e) : s(s), e(e), val(int(2e9)) {} bool is_leaf() {return s == e;} void extend() { if (!left && s + 1 <= e) { int mid = (s + e) >> 1; left = new Vertex(s,...
ALGO
0.999986
5.89465
2f92daa7-a1c1-47ed-8291-333bdb496c30
kabsmeiou/cp-solutions
Rounds/Round 943(Div 3)/A.cpp
#include <bits/stdc++.h> #define int long long using namespace std; signed main() { ios::sync_with_stdio(false); cin.tie(0); int T; cin >> T; while (T--) { int n; cin >> n; int y = 0; for (int i = 1; i <= n - 1; i += 1) { cout << i << ' ' << __gcd(i, n) + ...
ALGO
0.999878
4.06827
f902895e-2f2b-4357-8a6b-e80235959a34
mustachemo/Algorithms-and-Data-Structures
randomizedQuicksort.cpp
#include <iostream> #include <vector> using namespace std; int partition(vector <int>&, int, int); int randomizedPartition(vector <int>&, int, int); void randomizedQuicksort(vector <int>&, int, int); void printArray(vector <int>, int); int main() { //int arrSize = 6; //vector <int> arr = {5,3,2,1,6,4}; in...
ALGO
0.999866
4.9093
f46f35f2-bedb-4346-8e56-4eb1bd382d1b
raincross7/code-similarity
codes/train_code/problem103/problem103_229.cpp
//Radhe Radhe #include<bits/stdc++.h> #define godspeed ios_base:: sync_with_stdio(false); cin.tie(0); cout.tie(0); #define ll long long #define ld long double #define fi first #define se second #define mp make_pair #define rep1(i,a,b) for(ll i=a; i<=b; i++) #define repVect(i,n) for(ll i=0; i<sum.size(); i++) #d...
ALGO
0.999977
3.729315
d7a90668-d084-499d-bca1-6cd5745eed2d
LuoQinXuan/Cplusplus-Primer-Plus-example
chapter07/fun_ptr.cpp
// fun_ptr.cpp -- pointers to functions #include<iostream> double betsy(int); double pam(int); // second argument is pointer to a type double funciton that // takes a type int argument void estimate(int lines, double (*pf)(int)); int main() { using namespace std; int code; cout << "How many lines of code do you...
TOOL
0.968974
5.893276
1baca7d4-62c8-46aa-978c-72d1fbb63212
M-E-U-E/Current
C. Yarik and Array.cpp
#include<bits/stdc++.h> #define ll long long #define endl "\n" using namespace std; bool cmp(pair<int,int>a,pair<int,int> b) { if(a.first > b.first) return true; else if(a.first == b.first and a.second<b.second) return true; return false; } void solve() { ll i, n; cin >> n; ll a...
ALGO
0.999897
5.196092
93ee8953-206e-4bc2-b78a-ab573a02b7cb
PrinceSandal20/Leetcode
2657-find-the-prefix-common-array-of-two-arrays/2657-find-the-prefix-common-array-of-two-arrays.cpp
class Solution { public: vector<int> findThePrefixCommonArray(vector<int>& A, vector<int>& B) { vector<int>ans(A.size()); set<int>st; for(int i=0;i<A.size();i++) { int cnt=0; for(int j=0;j<i+1;j++){ st.insert(A[j]); } fo...
ALGO
0.999959
6.031414
7a6155e5-8dec-4b11-84a8-af6f2183ec90
NaderEG/competitive-programming
leetcode/cpp/findTheKthCharacterInStringGame.cpp
class Solution { public: string transform_string(string current) { string app = ""; for(char letter : current) { app += (letter + 1 - 97) % 26 + 97; } return current + app; } char kthCharacter(int k) { string res = "a"; while(res.length() < k) { ...
ALGO
0.999935
5.2056
bc858435-d608-4beb-8e2e-5148723d107c
lu-xiaoshuang/computer-science
algorithms/dynamic-programming/longest_common_substring.cpp
// longest common substring problem // https://en.wikipedia.org/wiki/Longest_common_substring_problem // let dp(i, j) donate the length of longest common suffix of x1, ..., xi and y1, ..., yj // dp(i, j) = // $. dp(i - 1, j - 1) + 1 if xi == yj // $. 0 # include <cstdint> intmax_t longest_common_substring(intmax_t *...
ALGO
0.999248
4.969191
a00a78bf-3a9e-4056-83af-dac3afe7fb19
fahmidprachaw/Data_Structure
assignment 2 singly_linked_list/max_min/main.cpp
#include <bits/stdc++.h> using namespace std; class Node{ public: int val; Node *next; Node(int val){ this->val=val; this->next=NULL; } }; void insert_tail(Node *&head, Node *&tail, int val){ Node *newNode = new Node(val); if(head==NULL){ head=newNode; ...
ALGO
0.999864
4.244363
f9a0913c-4664-4733-aecf-2ba5d5f761be
ishandutta2007/codeforces
teapotd/normal/1215/F.cpp
#define _USE_MATH_DEFINES//////////////////////////////////////// #include<bits/stdc++.h>////////////////////////////////////////// #define deb(...)///////////////////////////////////////////////// #define DBP(...)///////////////////////////////////////////////// #ifdef LOC//////////////////////////////////////////////...
ALGO
0.999959
3.940054
616e1d2b-705d-4e9d-902f-7b8529959eb5
UMANG-GAKHAR/Challenges-Bitmasking
Arrays-Insertion Sort.cpp
import java.util.*; public class Main { static Scanner scn = new Scanner(System.in); public static void main(String args[]) { int[] arr; arr = take_input(); arr = insertion_sort(arr); display(arr); } public static int[] take_input() { int[] arry=null; //System.out.println(“What size array do you want?”); int n = scn.ne...
ALGO
0.998768
3.860086
574ec407-73be-4cfa-9516-f118049818e3
mlund/faunus
src/chainmove.cpp
#include "chainmove.h" #include "aux/iteratorsupport.h" #include "bonds.h" namespace Faunus::move { void ChainRotationMoveBase::_from_json(const json& j) { molname = j.at("molecule"); dprot = j.at("dprot"); allow_small_box = j.value("skiplarge", true); // todo rename the json attribute and make fa...
ALGO
0.945158
7.359817
106614f1-7ba1-4cfe-a376-8b2e9d8c6959
GYPpro/ACM
1_Trains/VP_EDU107.2/C_Yet_Another_Card_Deck.cpp
// #pragma GCC optimize(2) #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; using ord_set = tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>; #define int long long #define pii pair<int,...
ALGO
0.999968
4.229238
c3ec3e67-8b30-48cb-bdd4-938b64227311
kaijia2022/CSE141L_ISA_FZ
fz_ASSEMBLER/Assembler.cpp
#pragma once #include <iostream> #include <fstream> #include <sstream> #include <vector> #include <map> #include <stack> #include <algorithm> #include <bitset> using namespace std; const int BIT_WIDTH = 12; const string PAD_RR0 = "0000"; const string PAD_RR1 = "00"; const string PAD_RI0 = "000000"; const string PAD_R...
ALGO
0.978331
4.412328
485cbb47-063a-4da2-aae0-d41ed990b7a4
litaotju/lintcode
61_search-for-a-range/search-for-a-range.cpp
/* @Copyright:LintCode @Author: taoleetju @Problem: http://www.lintcode.com/problem/search-for-a-range @Language: C++ @Datetime: 16-03-03 16:04 */ class Solution { /** *@param A : an integer sorted array *@param target : an integer to be inserted *return : a list of length 2, [index1, index2] ...
ALGO
0.999931
6.190297
215ede79-7763-4ceb-9cc4-27fa1da61494
Munesanz/GuardianOMP
clang/lib/DirectoryWatcher/linux/DirectoryWatcher-linux.cpp
#include "DirectoryScanner.h" #include "clang/DirectoryWatcher/DirectoryWatcher.h" #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/ScopeExit.h" #include "llvm/Support/AlignOf.h" #include "llvm/Support/Errno.h" #include "llvm/Support/Error.h" #include "llvm/Support/MathExtras.h" #include "llvm/Support/Path.h" #inclu...
TOOL
0.939082
7.650752
9dd0a50c-3509-4e8b-a2d0-e20af02a35cd
dmtwong/Brush_up_2
C++/Interviewbit/math/math_VerifyPrime.cpp
#include <iostream> using namespace std; int main() { cout << "!!!Hello World!!!" << endl; // prints !!!Hello World!!! // int Solution::isPrime(int A) { int Solution::isPrime(int A) { int end_ix = int(A / 2); if (A == 0 || A == 1){ return 0; } if (A < 0){ A = -1 * A; } ...
ALGO
0.997822
3.217178
503b7751-9b10-4036-a89d-707cb12bf920
ArymanSharma/Practice
Graph_Bellman_Ford_SSSR_Algorithm.cpp
#include <iostream> #include <vector> #include <string> using namespace std; int BellmanFord(int source, int dest, vector<vector<pair<int,int>>> &g) { int vertices = g.size(); vector<int> distance(vertices, INT_MAX); distance[source] = 0; for(int i = 1 ; i < vertices ; i++) // Traversing each edge for |V|-1 t...
ALGO
0.999941
5.064248
d62aecc9-6f12-43af-9828-7c6adda74371
stellarscience/dakota-stellar
packages/pecos/src/InterpPolyApproximation.cpp
//- Class: InterpPolyApproximation //- Description: Implementation code for InterpPolyApproximation class //- //- Owner: Mike Eldred #include "InterpPolyApproximation.hpp" #include "SharedInterpPolyApproxData.hpp" //#define DEBUG namespace Pecos { int InterpPolyApproximation::min_coeff...
ALGO
0.983157
6.809888
12dd4798-fda6-4da7-8851-41ea2c71e8ba
Adidier/PlayEngine
ExternalLibs/Bullet/include/Bullet3Collision/NarrowPhaseCollision/b3CpuNarrowPhase.cpp
#include "b3CpuNarrowPhase.h" #include "Bullet3Collision/NarrowPhaseCollision/b3ConvexUtility.h" #include "Bullet3Collision/NarrowPhaseCollision/b3Config.h" #include "Bullet3Collision/NarrowPhaseCollision/shared/b3ConvexPolyhedronData.h" #include "Bullet3Collision/NarrowPhaseCollision/shared/b3ContactConvexConvexSAT.h...
ALGO
0.976965
7.12591
e2b06a4d-a9ac-4d8c-9c98-7a32f2f24bd6
Raaaaaahul/geekforgeeks
searching/first_occurence.cpp
#include<bits/stdc++.h> using namespace std; int firstOccur(vector<int>& v,int n,int ele) // 12 36 595 6 3 4 34 { int low = 0; int high = n-1; while(low<=high) { int mid = (low+high)/2; if(v[mid]>ele) { high = mid-1; } else if(v[mid]<ele) { ...
ALGO
0.99996
4.986387
53d2b5c2-c428-4ee8-9ff3-729b180c32f1
Sachindebug/LeetCode-Problems
Nearly sorted - GFG/nearly-sorted.cpp
// { Driver Code Starts #include<bits/stdc++.h> using namespace std; // } Driver Code Ends class Solution { public: //Function to return the sorted array. vector <int> nearlySorted(int arr[], int num, int K){ // Your code here priority_queue<int>q; for(int i=0;i<num;i++) { ...
ALGO
0.999961
5.579478
c1415512-52c7-4269-bf9e-a9fb6ac6863a
ishandutta2007/codeforces
isaf27/normal/1159/A.cpp
#include <bits/stdc++.h> using namespace std; int n; string s; int main() { cin >> n >> s; int m = 0; int a = 0; for (int i = n - 1; i >= 0; i--) { if (s[i] == '+') m++; else m--; a = max(a, m); } cout << a; return 0; }
ALGO
0.999967
4.159384
680ff8e2-1c74-473e-ab0e-66402d020d15
dev-kp-eloper/CrackYourPlacement
199. Binary Tree Right Side View.cpp
//Link - https://leetcode.com/problems/binary-tree-right-side-view/description/ /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nullptr), right(nullptr) {} * TreeNode(int x) : val(x), left(nullptr), righ...
ALGO
0.999933
6.35013
191b03d3-e896-48aa-8f5c-9e165e866be4
BaoTrung37/PTIT_Sources
CTDL-thayson/contest1+2/bai22.cpp
/** * authur: Bao Trung (Koi Cute) **/ #include <bits/stdc++.h> using namespace std; typedef long long i64; const int mod = 1e9+7; #define pb push_back; #define all(x) (x).begin(), (x).end() #define set_vect(a,n); vector<int>a(n); for(auto &z : a)cin>>z; int n,a[12][12],vis[12][12]; string s; vector <string> v; boo...
ALGO
0.999704
4.89039
5c234a13-6335-45eb-ae46-c22810e90248
Heretic717/Pong
Cpp_game_1/game.cpp
#define is_down(b) input->buttons[b].is_down #define pressed(b) (input->buttons[b].is_down && input->buttons[b].changed) #define released(b) (!input->buttons[b].is_down && input->buttons[b].changed) // Variables float arena_half_size_x = 850, arena_half_size_y = 450; // arena size // Player float player_1_p, player...
ALGO
0.944943
5.733253
f5c8a268-a147-49b6-ac69-a0056f65eea0
ishandutta2007/codeforces
kmjp/normal/383/B.cpp
#include <cstdlib> #include <cstring> #include <memory> #include <cstdio> #include <fstream> #include <iostream> #include <cmath> #include <string> #include <sstream> #include <stack> #include <queue> #include <vector> #include <set> #include <map> #include <algorithm> using namespace std; typedef signed long long ll;...
ALGO
0.999938
3.610574
6163fb9b-f6f9-41e3-aed3-651cbc7f59ed
Shubhanggit/LEETcode
3685-count-subarrays-of-length-three-with-a-condition/count-subarrays-of-length-three-with-a-condition.cpp
class Solution { public: int countSubarrays(vector<int>& nums) { int c=0,i; for(i=0;i<nums.size()-2;i++){ if(2*(nums[i]+nums[i+2])==nums[i+1]) c++; } return c; } };
ALGO
0.999675
5.552805
cb802ee7-eb87-416f-babb-90fc90e037d3
figurekim317/BOJ
cpp/BOJ_2591.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int,int> pii; typedef pair<ll,ll> pll; #define pb push_back #define ff first #define ss second #define MOD 1000000009 #define N 100010 #define M 3010 string a; int ans[45]={1,1}; int main(){ // freopen("input.txt","r",stdin); cin>...
ALGO
0.999838
4.04822
0475674c-d49d-4b51-9edb-a6872f41c3be
omkaranu04/CP_DSA
CodeChef/start186/dist_arrays.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long int #define endl "\n" const int mod = 998244353; void solve() { ll n; cin >> n; vector<ll> a(n); for (ll i = 0; i < n; i++) cin >> a[i]; sort(a.begin(), a.end()); ll ans = 1; for (ll i = 0; i < n; i++) { l...
ALGO
0.999848
5.26331
b5a69d04-53ca-4617-8457-f213821d3981
RevengeOS/android_frameworks_av
media/libstagefright/codecs/amrwb/src/median5.cpp
/* ------------------------------------------------------------------------------ Filename: median5.cpp Date: 05/08/2007 ------------------------------------------------------------------------------ REVISION HISTORY Description: -----------------------------------------------------------------------------...
ALGO
0.999993
6.083277
859469f2-7479-4ca4-a4a4-51b7092fdda5
ssugam10/leetcode-solutions
3195-find-the-minimum-area-to-cover-all-ones-i/3195-find-the-minimum-area-to-cover-all-ones-i.cpp
class Solution { public: int minimumArea(vector<vector<int>>& grid) { int sRow = -1; int eRow = -1; int sCol = 2000; int eCol = -1; int n = grid.size(); int m = grid[0].size(); for(int i = 0; i<n;i++){ for(int j = 0; j<m; j++){ ...
ALGO
0.999682
6.231068
4b045015-f4cb-4326-98e9-46ef9ff5eb96
Dahoon-Hong/ps
codeforces/problemset/1520c.cpp
#include <bits/stdc++.h> using namespace std; void solve() { int n; cin >> n; if(n == 1) { cout << 1 << endl; return; } if(n == 2) { cout << -1 << endl; return; } int target = 1; for(int i = 0 ; i < n ; i++) { for(int j = 0 ; j < n ...
ALGO
0.998795
4.813828
86af718b-5f13-4fd8-9458-015fed066f27
ishandutta2007/codeforces
l0tus/normal/1286/B.cpp
#include <bits/stdc++.h> #define va firsst #define vb second using namespace std; typedef long long ll; typedef pair<int,int> pii; const int INF = 1e9; const int MN = 2e5+5; int N,p,c,r,par[MN],val[MN],ans[MN]; bool ch; vector<int> T[MN]; vector<int> O[MN]; void dfs(int s) { if(ch) return; if(O[s].size()==val[...
ALGO
0.999997
3.749357
c2d8aa4e-4445-407b-af51-0919f7b51fa1
rafat1996/News-App-in-Flutter-With-Api
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.99887
6.783439
5d546130-1599-4ded-8537-9db57d94383e
WaykiChain/wicc-wasm-cdt
wasm_llvm/tools/clang/lib/Tooling/Inclusions/HeaderIncludes.cpp
#include "clang/Tooling/Inclusions/HeaderIncludes.h" #include "clang/Basic/SourceManager.h" #include "clang/Lex/Lexer.h" namespace clang { namespace tooling { namespace { LangOptions createLangOpts() { LangOptions LangOpts; LangOpts.CPlusPlus = 1; LangOpts.CPlusPlus11 = 1; LangOpts.CPlusPlus14 = 1; LangOpts...
TOOL
0.939599
7.789744
2cde2d8f-abb6-483d-80b4-1762c31d1cde
megha-812/login_form
min_max.cpp
#include <iostream> #include <vector> #include <omp.h> #include <climits> using namespace std; void min_reduction(vector<int>& arr) { int min_value = INT_MAX; #pragma omp parallel for reduction(min: min_value) for (int i = 0; i < arr.size(); i++) { if (arr[i] < min_value) { min_value = arr[i]; } } cout <...
ALGO
0.999307
4.808287
bc760ef7-5c3e-4d6a-94e6-aada4f1758d9
GREED-ED/Academic
CSIT/5th sem/Cryptography/5.vigenere.cpp
#include <iostream> #include <string> #include <cctype> using namespace std; string processText(string text) { string result = ""; for (int i = 0; i < text.length(); i++) { if (isalpha(text[i])) { result += toupper(text[i]); } } return result; } string extendKey(string key,...
ALGO
0.999245
5.36092
13f75edd-6bfd-490c-a067-6e598f595680
Art8mish/HashTable
src/main.cpp
#include "../include/hash_table.h" #include <time.h> const char *txt_f_path = "data_txt/crm_pnshmnt.txt"; int main(void) { HshTbl *hsh_tbl = tblCtor(3001); ERR_CHCK(hsh_tbl == NULL, 1); // uint64_t (*hash_funcs[7])(const char *) = {hash_cnst, hash_symb, hash_strlen, hash_ascii, hash_rol, hash_ror, hash...
ALGO
0.895189
4.044844
3ed86ee4-696c-4a56-847f-ffb984555b52
mrG7/Acoustic-Modelling-of-Virtual-Reality-Game-Environments
UE4_AMVRGE/Plugins/Wwise/Source/AkAudio/Private/StringMatchAlgos/StringMatching.cpp
/*============================================================================= StringMatching.cpp: =============================================================================*/ #include "StringMatching.h" #include "Array2D.h" float LCS::GetLCSScore(const FString& a, const FString& b) { StringComparer compare(a, b...
ALGO
0.941906
4.38479
ee18a2ca-86a2-4d9f-a0c1-bb970ab64aeb
khoaguin/PocketNN
src/pktnn_examples.cpp
#include "pktnn_examples.h" int fc_int_bp_simple() { // constructing the neural net const int dim1 = 3; const int dim2 = 5; const int numEpochs = 3; pktnn::pktmat x(1, dim1); pktnn::pktfc fc1(dim1, dim2); pktnn::pktfc fc2(dim2, 1); std::cout << "--- Weights (first layer) before initia...
DATA
0.980246
5.726551
38b5cf92-7523-413c-be4d-99ccd59e53ca
iamAbhi1992/SCALER_JULY_2024
15 DSA: Maths: Prime Numbers/Prime Sum.cpp
// https://www.scaler.com/academy/mentee-dashboard/class/297921/homework/problems/297?navref=cl_tt_lst_nm // Problem Description // Given an even number A ( greater than 2 ), return two prime numbers whose sum will be equal to the given number. // If there is more than one solution possible, return the lexicographic...
ALGO
0.999847
5.249442
7804ad48-5782-44cb-83be-955707b57a4c
supertask/icpc
aoj/acac000/c_disjoint.cpp
#include<iostream> #include<map> #include<vector> #include<algorithm> #include<cmath> #include<iomanip> #include<list> #define reps(i,p,n) for(int i=p;i<(int)(n);i++) #define rep(i,n) reps(i,0,n) #define all(c) (c).begin(), (c).end() using namespace std; list<bool*> mul_disjoints; int n,q; bool* find_point(int point) ...
ALGO
0.999174
3.85341
bcefae97-8911-4047-aa93-140523418ac3
vpk-11/IPMP
Contests/Leetcode Contests/Contest 293/maxConsecutiveFloors.cpp
// Problem Statement // Alice manages a company and has rented some floors of a building as office space. // Alice has decided some of these floors should be special floors, used for relaxation only. // You are given two integers bottom and top, // which denote that Alice has rented all the floors from bottom to top (...
ALGO
0.999955
5.490183
43c48e58-a27e-4eb1-9499-6b0359b245b3
galeindor/Battle-heart
src/EffectSrc/DmgByDistance.cpp
#include "Effects/DmgByDistance.h" #include "Characters/Character.h" DmgByDistance::DmgByDistance() {} void DmgByDistance::affect(Character* self, Character* target, float factor) { auto currHP = target->getStat(_hp); auto dmgByDefence = (self->getStat(_dmg) * factor / (target->getStat(_defence) * DEFENSE_IGNORE_R...
TOOL
0.95987
5.943266