uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
60cd1017-ce28-475e-b748-db4c979cbd10 | AvikAB/My-LeetCode | 2170-count-number-of-maximum-bitwise-or-subsets/2170-count-number-of-maximum-bitwise-or-subsets.cpp | class Solution {
public:
int countSubsets(int idx, int currOr, int mxOr, vector<int>&nums, vector<vector<int>>&mem){
if(idx==nums.size()){
if(currOr==mxOr) return 1;
else return 0;
}
if(mem[idx][currOr] != -1) return mem[idx][currOr];
int take = countSubsets(... | ALGO | 0.999985 | 6.118153 |
52cac943-bb1a-42ae-a1b4-f4098d93ae12 | smyGitt/CS303-3 | inFixToPostFix.cpp | #include "inFixToPostFix.h"
using namespace std;
Infix_To_Postfix_Converter::Infix_To_Postfix_Converter() {
isInBracket = false;
currBracketLevel = -1;
};
string Infix_To_Postfix_Converter::convert_infix_to_postfix() {
while (!infix_stack.empty()) {
cout << "test" << endl;
return "test";
}
cout << "test" << ... | ALGO | 0.998497 | 4.77485 |
01926e2d-669d-453b-b5ce-f8c9c2ccdea5 | rain15639062780/THU9-314-tailsitter2 | src/modules/commander/airspeed_calibration.cpp | /**
* @file airspeed_calibration.cpp
* Airspeed sensor calibration routine
*/
#include "airspeed_calibration.h"
#include "calibration_messages.h"
#include "calibration_routines.h"
#include "commander_helper.h"
#include <px4_defines.h>
#include <px4_posix.h>
#include <px4_time.h>
#include <stdio.h>
#include <unistd... | TOOL | 0.901831 | 6.178109 |
68cc44b1-937d-4d86-80d2-d6650bf12d46 | poraodonando/C_plus_plus | Assuntos/18_funcoes_I.cpp | #include <iostream>
using namespace std;
//Prototipando funes (apresenta essa funo ao programa)
void texto();
void soma(int a, int b);
int soma2(int c, int d);
void tr(string tran[4]);
int main(){ // main a funo principal
int res;
string transp[4] = {"carro", "aviao", "barco", "trem"};
for(int i = 0; i < 2; ... | ALGO | 0.942663 | 4.072433 |
e03c3180-2a5e-4a0d-8582-b25f3d9f47ee | sarvex/leetcode-scratch | solution/1200-1299/1298.Maximum Candies You Can Get from Boxes/Solution.cpp | class Solution {
public:
int maxCandies(vector<int>& status, vector<int>& candies, vector<vector<int>>& keys, vector<vector<int>>& containedBoxes, vector<int>& initialBoxes) {
int ans = 0;
int n = status.size();
vector<bool> has(n);
vector<bool> took(n);
queue<int> q;
... | ALGO | 0.999981 | 5.84965 |
12eb79be-0d42-415e-96cc-51800d6046e6 | Qzxell/GOICPC | Problems/deque.cpp | #include <bits/stdc++.h>
using namespace std;
using ii = pair<int,int>;
using vii = vector<ii> ;
using vi = vector<int> ;
#define ln '\n'
#define ll long long
#define pb push_back
#define fi first
#define se second
#define sz(v) ((int)(v).size())
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v... | ALGO | 0.99992 | 3.82777 |
cf0942ef-5c2f-4998-a955-cd9f4842ef29 | LuvKobe/StudyCode-2023 | Code_01_16/AVLTree8.cpp | #pragma once
#include <assert.h>
#include <vector>
#include <queue>
#include <time.h>
#include <map>
#include <iostream>
using namespace std;
template<class K, class V>
struct AVLTreeNode
{
// 洢ļֵ
pair<K, V> _kv;
//
AVLTreeNode<K, V>* _left;
AVLTreeNode<K, V>* _right;
AVLTreeNode<K, V>* _parent;
// ƽ(balanc... | ALGO | 0.996799 | 4.756649 |
b35fffef-9115-48f3-bf34-8917b3ca0b5d | mammothb/boost_1_54_0 | libs/program_options/src/config_file.cpp | #define BOOST_PROGRAM_OPTIONS_SOURCE
#include <boost/program_options/config.hpp>
#include <boost/program_options/detail/config_file.hpp>
#include <boost/program_options/errors.hpp>
#include <boost/program_options/detail/convert.hpp>
#include <boost/throw_exception.hpp>
#include <iostream>
#include <fstream>
#include ... | TOOL | 0.963552 | 7.239641 |
f39a8556-b766-4e85-8e6f-90bfa1fed993 | miracle0609/miracle | 挑战程序设计竞赛第二部源码/第3章/Shell Sort.cpp | #include<iostream>
#include<cstdio>
#include<vector>
using namespace std;
//g数组
vector<int>G;
long long cnt;
int A[1000000 + 10];
// 间隔为g的插入排序
void insertionSort(int A[], int n, int g) {
for (int i = g; i < n; i++) {
int v = A[i];
int j = i - g;
while (j >= 0 && A[j] > v) {
A[j... | ALGO | 0.99999 | 3.280528 |
f690d674-c1a0-4a79-bf3c-2ebaf213a1d6 | geraldstanje/algorithms | data_structures/set_of_stacks.cpp | #include <iostream>
#include <stack>
#include <vector>
#include <ctime>
#include <stdio.h>
#include <stdlib.h>
using namespace std;
#define LIMIT 2
class Solution {
vector<stack<int> > s;
vector<int> counter;
public:
int push(int val) {
if (counter.empty() || counter.back() == LIMIT) {
cout << endl << "incre... | ALGO | 0.9996 | 4.326394 |
1e2684be-9a53-4924-9a4f-1d8d83b0be98 | ishandutta2007/codeforces | dragonslayerintraining/normal/645/F.cpp | #include <cstdio>
#include <vector>
const int MOD=1e9+7;
std::vector<int> factor[1000005];
int fs[1000005];
int gs[1000005];
int scale[1000005];
int ans=0;
int fact[2000005]={1,1};
int inv[2000005]={0,1};
int invfact[2000005]={1,1};
int N,K;
int choose(int n,int k){
if(k<0||k>n) return 0;
return 1LL*fact[n]*inv... | ALGO | 0.999792 | 4.023318 |
88b61d55-cb50-4476-9619-e95a535d56be | iCoder0020/Competitive-Coding | Codeforces/Educational Round 58 (Div. 2)/A. Minimum Integer.cpp | /*
ID: iCoder0020
PROG: Minimum Integer
LANG: C++
*/
#include <bits/stdc++.h>
using namespace std;
int main()
{
int Q;
cin>>Q;
for(int q = 0; q<Q; q++)
{
int L,R,D;
cin>>L>>R>>D;
if(D<L)
{
cout<<D<<endl;
}
else
{
cout<<R+(D-R%D)<<endl;
}
}
return 0;
} | ALGO | 0.999818 | 3.537893 |
3b903460-7b2a-49f1-9168-32b2ba6441d1 | itohdak/AtCoder | others/joi/joi2017yo_E.cpp | #include <bits/stdc++.h>
#include "/home/itohdak/AtCoder/000/print.hpp"
using namespace std;
#define ll long long
#define ld long double
#define REP(i,m,n) for(int i=(int)(m); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define RREP(i,m,n) for(int i=(int)(m); i>=(int)(n); i--)
#define rrep(i,n) RREP(i,(n)-1,0)
#define... | ALGO | 0.999886 | 4.251123 |
e72e3d6a-4554-4b17-a96d-65678c062fe7 | WeileiZeng/itpp-full-Docker-Image | version1/src/eigen-3.3.7/test/sparse_solvers.cpp | #include "sparse.h"
template<typename Scalar> void
initSPD(double density,
Matrix<Scalar,Dynamic,Dynamic>& refMat,
SparseMatrix<Scalar>& sparseMat)
{
Matrix<Scalar,Dynamic,Dynamic> aux(refMat.rows(),refMat.cols());
initSparse(density,refMat,sparseMat);
refMat = refMat * refMat.adjoint();
for (i... | TEST | 0.962975 | 5.216745 |
6d6c0456-3146-4e6d-b78a-78c7f6f58e0f | d-coder111/DSAmplify | C++/74_Search_a_2D_Matrix.cpp | /*
You are given an m x n integer matrix matrix with the following two properties:
Each row is sorted in non-decreasing order.
The first integer of each row is greater than the last integer of the previous row.
Given an integer target, return true if target is in matrix or false otherwise.
You must write a solution i... | ALGO | 0.999969 | 6.562518 |
6acfdf77-0b75-418d-8841-b3af8506fc88 | sarvex/leetcode-chai | solution/0700-0799/0731.My Calendar II/Solution.cpp | class MyCalendarTwo {
public:
map<int, int> m;
MyCalendarTwo() {
}
bool book(int start, int end) {
++m[start];
--m[end];
int s = 0;
for (auto& [_, v] : m) {
s += v;
if (s > 2) {
--m[start];
++m[end];
... | ALGO | 0.999925 | 6.132884 |
d376db93-b8a4-48f0-ba03-6364e6184019 | lucic71/llvm-ub-free | libcxx/test/std/algorithms/alg.modifying.operations/alg.copy/copy_n.pass.cpp | // <algorithm>
// template<InputIterator InIter, OutputIterator<auto, InIter::reference> OutIter>
// constexpr OutIter // constexpr after C++17
// copy_n(InIter first, InIter::difference_type n, OutIter result);
#include <algorithm>
#include <cassert>
#include "test_macros.h"
#include "test_iterators.h"
#inclu... | TEST | 0.912946 | 7.380221 |
84ee9934-4326-4890-a18b-8e5ac6655d8d | cpp-monk/CP-Templates | Tree Algorithms/Binary Lifting.cpp | struct BinaryLifting {
int n;
int maxLog;
ll maxRequirement;
vector<vector<int>> parent;
BinaryLifting(int n1, vector<int> *edges, ll requirement, int root) {
n = n1;
parent.resize(n1);
maxLog = log2(requirement + 1);
maxRequirement = requirement;
for (int i =... | ALGO | 0.999338 | 4.655063 |
62008d13-6d57-47c2-98a4-54424cae324d | lilexuan/codeup | 100000582C2.cpp | #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int number[100001];
int main()
{
int n, tmp, ans, flag = 0;
while (cin >> n) {
fill(number, number + 100001, 0);
vector<int> v;
for (int i = 0; i < n; i++) {
cin >> tmp;
if (!number[tmp]) {
v.push_back(tmp);
}
numb... | ALGO | 0.999943 | 4.850959 |
48883ae2-fd98-4614-a330-3f68088a03f1 | jitendrabhadoria1/competitiveprogramming | Number Theory -1/ninja_and_flowers.cpp | // Ninja and Flowers
// Send Feedback
// Ninja wants to get N flowers and he will pay i + 1 amount of money for the Ith flower, example (if n=3 he will pay {2,3,4})
// Now he wants to pack these N flowers in boxes of different colours. With one condition if the cost of a flower is a prime divisor of another flower they... | ALGO | 0.999036 | 4.478506 |
1aa8c9d5-e9bb-4cb7-a92c-9bea65540ba2 | vfolunin/archives-solutions | MCCME/113045.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <string>
using namespace std;
int main() {
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
int size;
cin >> size;
vector<int> count(11);
double sum = 0;
for (int i = 0; ... | ALGO | 0.999549 | 3.741924 |
a600fa24-95d0-4aa4-bf95-83c63d766855 | tassawer-hussain/cplusplus-assignment | Superior Uni Assignment/Problem_03-C.cpp | // Problem 03:
// Pattern C
// ********
// *******
// ******
// *****
// ****
// ***
// **
// *
#include<iostream>
using namespace std;
int main() {
for (int i = 11; i > 0; i--) {
for (int j = 0; j < i; j++) {
cout << "*";
}
cout << endl;
}
return 0;
}
| ALGO | 0.999823 | 4.407161 |
74901d31-8b2f-4be9-9e18-9fc9210b52ab | ishandutta2007/codeforces | kevin114514/normal/281/A.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
string S;
cin>>S;
if(islower(S[0]))
S[0]-=('a'-'A');
cout<<S<<endl;
return 0;
} | ALGO | 0.995513 | 4.026006 |
56f5a9ba-3ad6-4912-8a1a-77ba7a66cca5 | jbman2025/Nerdminer-v2-esp32-2432s024c-screen-fix | src/utils.cpp |
#include <Arduino.h>
#include "utils.h"
#include "mining.h"
#include "stratum.h"
#include "mbedtls/sha256.h"
#include <string.h>
#include <stdio.h>
#ifndef bswap_16
#define bswap_16(a) ((((uint16_t) (a) << 8) & 0xff00) | (((uint16_t) (a) >> 8) & 0xff))
#endif
#ifndef bswap_32
#define bswap_32(a) ((((uint32_t) (a) <... | ALGO | 0.998554 | 4.173213 |
13ff7817-3680-4cfa-8182-30ac03fa20f7 | uforco/ICPC_cpp | DSA/Z_Binary_Search.cpp | # include <bits/stdc++.h>
using namespace std;
int main(){
int n,q;
cin>>n>>q;
long long int arr[n];
for (int i = 0; i < n; i++) cin>>arr[i];
sort(arr, arr+n);
while (q--)
{
int x;
cin>>x;
int l = 0, r = n-1;
bool flag = false;
while (l <= r)
{... | ALGO | 0.999971 | 4.39969 |
3a8082ba-d67d-4622-a182-9041408d8b77 | Masterroy1210/data_structure | reverse.cpp | #include<iostream>
using namespace std;
void reverse(int arr[],int s,int e,int n)
{
int i,temp;
for(i=0;i<n/2;i++)
{
temp = arr[e];
arr[e] = arr[s];
arr[s] = temp;
s=s+1;
e=e-1;
}
cout<<"\nArray After reverse ";
for(i=0;i<n;i++)
{
cout<<arr[i]... | ALGO | 0.999663 | 4.066025 |
07d5e649-f966-46b7-9780-47198a857e89 | atharva-sarage/Codeforces-Competitive-Programming | 1136D.cpp | /******************************************
* AUTHOR: Atharva Sarage *
* INSTITUITION: IIT HYDERABAD *
******************************************/
#include<bits/stdc++.h>
#warning Check Max_Limit,Overflows
using namespace std;
# define IOS ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
# d... | ALGO | 0.999794 | 3.591649 |
940a0fe7-0e32-45ed-a767-27c7d6162fa8 | ahmedmamdouh886/codeforces-solutions | 59A_word.cpp | #include <iostream>
#include <algorithm>
#include <string>
using namespace std;
// https://codeforces.com/contest/59/problem/A
// A.Word
int main()
{
string s;
unsigned short int UpperCase = 0, LowerCase = 0;
cin >> s;
for(unsigned short int i = 0;i < s.size();i++)
{
if( s[i] <=... | ALGO | 0.999058 | 5.49063 |
d48c77da-e694-429a-82b2-3853b535c43b | slitvinov/lammps-sph-multiphase | tools/xmgrace/lammpsplot.cpp | // By Vikas Varshney @ vv0210 at gmail dot com
#include <stdlib.h>
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <cstring>
#include <cctype>
#include <cstdlib>
#include <map>
#include <iomanip>
#include <algorithm>
#include <cmath>
using namespace std;
typedef vector<string> sen... | TOOL | 0.912281 | 3.207971 |
1362a9bb-322d-4495-9901-a31701ca0832 | Not-Mostafa/CP | B_Nearest_Smaller_Values.cpp | #include <bits/stdc++.h>
using namespace std;
#define FIO ios ::sync_with_stdio(false), cin.tie(nullptr), cout.tie(NULL)
#define ll long long
#define ld long double
#define all(container) (container).begin(), (container).end()
#define cl(x,y) (x + y - 1) / y
#define lp(size) for (int i = 0; i < size; i++)
#define rlp(... | ALGO | 0.999994 | 4.579191 |
b0af929d-3a50-4460-8862-4675007c5720 | hellofxin/imageProcessing_forFun | imageProcessing.cpp | #include <stdio.h>
#include "opencv2/opencv.hpp"
#include <math.h>
#include <map>
using namespace cv;
using namespace std;
#define WIN_NAME_WIN_CONTROL "winControl"
#define KSIZE "ksize"
#define CANNY_MIN "cannyMin"
#define CANNY_MAX "cannyMax"
#define MORPH_OP "morphOp"
#define THRES_B_SIZE "thresBSiz... | ALGO | 0.993049 | 3.563442 |
f0f8edc8-784c-4a47-a2cb-bf874f53b61b | Rishabh2743/-striver-DSA-sheet-arsh-goyal | 1162-as-far-from-land-as-possible/1162-as-far-from-land-as-possible.cpp | class Solution {
public:
int maxDistance(vector<vector<int>>& grid) {
int n=grid.size();
int m=grid[0].size();
vector<vector<int>>vis(n,vector<int>(m,0));
int ans=0;
queue<pair<pair<int,int>,int>>q;
for(int i=0;i<n;i++){
for(int j=0;j<m;j++){
if(grid[i][j]==1... | ALGO | 0.999938 | 5.61226 |
110789de-addd-4165-9690-b1f4a19ba34b | mycbxzd1/myCppCode | hydro-system/zzszoi/P1290(with luogu).cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 15, M = 95;
int dp[N][M][M][M], a[N], len;
int dfs(int dep, int sum, int num, int mod, bool lim)
{
if (!dep)
return (sum == mod && !num);
if (!lim && ~dp[dep][sum][num][mod])
return dp[dep][sum][num][mod];
int res = 0, up = lim ? a[... | ALGO | 0.999458 | 4.186302 |
f34c8c77-6b60-4b5e-8ad0-8d9ef2879465 | RandomPolishNpC/prog-Informatyka | lekcja1/zadanie2.cpp | #include <iostream>
using namespace std;
int main(){
int a = 2;
int b = 3;
cout << "liczba a = " << a;
cout <<endl;
cout << "liczba b = " << b;
cout <<endl;
cout << "suma = " << a+b;
cout <<endl;
cout << "roznica = " << a-b;
cout << endl;
cout << "iloczyn = " << a*b;
cout << endl;
cout << "tada :DDD";
... | ALGO | 0.981352 | 3.173727 |
c4f22923-319b-4438-88d5-c775bb4c1b13 | zohaibakhtar28/CPP-11 | Strings/130PPCheckPalindrome.cpp | #include <iostream>
#include<string>
using namespace std;
int main()
{
string str = "MADAM";
string rev = "";
int length,j;
length = (int)str.length(); // str,length() returs value as Long Int.
rev.resize(length);
for (int i = 0, j = length-1; i < length; i++, j--)
{
rev[j] = str[i];... | ALGO | 0.999896 | 3.775862 |
9778209b-7996-4d27-a4f5-ff2e25c7e62d | Abhi-hpp/Physics-Engine-GBC | ExternalResources/reactphysics3d-0.7.1/testbed/nanogui/ext/eigen/blas/double.cpp | #define SCALAR double
#define SCALAR_SUFFIX d
#define SCALAR_SUFFIX_UP "D"
#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"
double BLASFUNC(dsdot)(int* n, float* x, int* incx, float* y, int* incy)
{
... | ALGO | 0.997218 | 5.138801 |
bece7d33-63c6-422f-8d8c-de4bbf18218f | pratippatel/LeetCode | 150-evaluate-reverse-polish-notation/150-evaluate-reverse-polish-notation.cpp | class Solution {
public:
int evalRPN(vector<string>& tokens) {
stack<int> s;
for(int i=0;i<tokens.size();i++){
if(tokens[i]=="+" || tokens[i]=="-" || tokens[i]=="*" || tokens[i]=="/"){
int a = s.top();
s.pop();
int b = s.top();
... | ALGO | 0.999905 | 5.976624 |
b547e76a-6482-4a18-8f24-dd4c44d370e8 | ishandutta2007/codeforces | mr.ilchi/normal/513/B1.cpp | #include <bits/stdc++.h>
using namespace std;
int a[100];
long long n,m;
int main(){
cin >> n >> m;
int lo = 0, hi = n-1;
for (int i=0; i<n; i++){
if (m <= (1LL<<(n-i-2)))
a[lo++] = i+1;
else{
m-= (1LL<<(n-i-2));
a[hi--] = i+1;
}
}
for (int i=0; i<n; i++)
cout << a[i] << ' ';
cout << endl;
ret... | ALGO | 0.999991 | 3.577741 |
0e76aa12-0432-4937-9223-ce2d00f2296c | Sardaan/algosi | 3lab/1521.cpp | #include <iostream>
#include <stack>
using namespace std;
int findMax(int data[], int m, int max) {
int x = 1;
while (2*x < max) {
if (data[x*2] >= m) {
x *= 2;
}
else {
m -= data[x*2];
x = x * 2 + 1;
}
}
if (data[x] == 2)
r... | ALGO | 1 | 3.370704 |
c1d43167-8e7b-4fa8-97bd-e0c93e35dcbb | upesacm/21DaysOfCode-2023 | C&C++/Garima Hansa/Day04_2.cpp | //2. Write a program to determine the roots of a quadratic equation (ax^2 + bx + c = 0) based on the values of a, b, and c entered by the user. Handle all possible cases (real and distinct roots, real and equal roots, imaginary roots) and print the appropriate message.
#include<iostream>
using namespace std;
int main... | ALGO | 0.999404 | 3.403904 |
f68f49df-9ac3-4289-acfd-66e72a3ed2af | matiasramirezbaldiviezo/C- | Codeforces/Codeforces Beta Round 25 (Div. 2 Only)/A. IQ test.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int x ;
cin>>x;
int impar= 0 ;
int par=0;
vector <int> v(x);
for(int i = 0 ; i<x ; i++){
cin>>v[i];
}
for(int i = 0 ; i<3 ; i++){
if(v[i]%2==0){
... | ALGO | 0.999879 | 3.331096 |
c0dff159-6093-4de8-af99-843d3705d305 | guoqi/toys | cpp/tpc/2021/S1/first/A.cpp | #include <iostream>
#include <vector>
using namespace std;
int main() {
int T;
cin >> T;
for (int i = 0; i < T; ++i) {
int n;
cin >> n;
int negnum = 0;
int posnum = 0;
int zero = 0;
for (int j = 0; j < n; ++j) {
int tmp;
cin >> tmp;
if (tmp > 0) {
posnum++;
... | ALGO | 0.999922 | 4.293941 |
06cbf712-8931-4589-aa90-34ae9c1ff8fa | gamjagoon/Problem-solving | BOJ-C++/01526_가장큰금민수.cpp | #include <iostream>
using namespace std;
string A;
int len;
int K = 0, result = 0;
int c[2] = { 4,7 };
int ch[9] = { 0};
void dfs(int n)
{
if (n == len) {
int tmp = 0;
for (int i = 0; i < n; ++i) {
tmp *= 10;
tmp += c[ch[i]];
}
if (tmp <= K && result < tmp) {
result = tmp;
}
else return;
}
else... | ALGO | 0.99961 | 4.318351 |
584acbab-9536-484b-af79-e7a43a780734 | i-saumy/OOPs | NCR_OF_A_NUM.cpp | #include <iostream>
using namespace std;
int Cal_Fact(int);
int main()
{
int n_5825, r_5825, ncr_5825;
cout<<"\n Please Enter the Values for N and R: \n";
cin>>n_5825>>r_5825;
ncr_5825 = Cal_Fact(n_5825) / (Cal_Fact(r_5825) * Cal_Fact(n_5825-r_5825));
cout<<"\n NCR Factorial of " << n_5825 ... | ALGO | 0.995487 | 4.992239 |
dac7527c-ebf3-455e-a571-b23a76cf88f4 | maddotexe/Competitive-contest-programs | precomputation/437b.cpp | #include<bits/stdc++.h>
using namespace std;
#define TRACE
#ifdef TRACE
#define trace1(x) cerr << #x << ": " << x << endl;
#define trace2(x, y) cerr << #x << ": " << x << " | " << #y << ": " << y << endl;
#define trace3(x, y, z) cerr << #x << ": " << x << " | " << #y <... | ALGO | 0.99997 | 3.938538 |
e79a82d4-bd51-49e1-93a2-3e7e9f59ec14 | asztell/leetcode-screenshotter | editorial_code/1000-1999/1519. Number of Nodes in the Sub-Tree With the Same Label/cpp-1.cpp | class Solution {
public:
vector<int> countSubTrees(int n, vector<vector<int>>& edges, string labels) {
unordered_map<int, unordered_set<int>> adj;
for (auto& edge : edges) {
adj[edge[0]].insert(edge[1]);
adj[edge[1]].insert(edge[0]);
}
// Store count of all a... | ALGO | 0.999879 | 6.798463 |
21a496ef-6f57-4a48-8bdd-bd06a9fe66c2 | gotliebel/algorithms_3 | contest1/g.cpp | /*#include <iostream>
#include <string>
#include <vector>
bool PrefixFunction(const std::string& str, const size_t& size_p) {
std::vector<size_t> pref(str.size(), 0);
for (size_t i = 1; i < str.size(); ++i) {
size_t previous = pref[i - 1];
while (previous > 0 && str[i] != str[previous]) {
previous = ... | ALGO | 0.999923 | 5.172219 |
c8cae0e6-d05a-4961-94fd-d54baec71dd8 | msjtw/Algorithmics | highschool/lekcje/droga/dr2.cpp | #include <iostream>
#include <climits>
using namespace std;
struct node{
int up;
int right;
};
int wyn[57][57];
bool kier[57][57];
node odl[57][57];
int roz;
int main(){
for(int i = 0; i < 57; i++){
for(int k = 0; k < 57; k++){
wyn[i][k] = INT_MAX;
}
}
wyn[0][1] = 0;
cin >> roz;
int a, b, c, d, e;
... | ALGO | 0.999426 | 3.496039 |
15dabdbc-4b5e-4349-9ca2-b15b1820ba90 | geokyr/computer-programming | lab06/format.cpp | #include <iostream>
#include <string>
using namespace std;
int main() {
int i, number, start, finish, counter, chars, current, empty, gaps, blanksize, bonusgaps;
string words[10000];
for(i=0; i<10000; i++) {
cin >> words[i];
}
i=0;
while(words[i] != "") {
i++;
}
number = i;
start = 0;
fin... | ALGO | 0.998899 | 3.79443 |
d3a136ad-6362-484c-bb48-88591b9c3b4c | kushagra-18/Leetcode-solutions | 56. Merge Intervals.cpp | class Solution {
public:
vector<vector<int>> merge(vector<vector<int>>& intervals) {
vector<vector<int>> res;
if(intervals.size()== 0){
return {};
}
sort(intervals.begin(),intervals.end());
vector <int> temp = intervals[0];... | ALGO | 0.999998 | 5.973442 |
3a8fe809-a3b2-412e-be0e-cee0eba5583d | HandidaT/DSA | 3_0_1dfs.cpp | #include <iostream>
#include <vector>
#include <list>
using std::vector;
using std::pair;
int visit(int curnt_postionon_path, int v, vector<vector<int>> &adj, vector<int> &visited){
std::cout<<"visit\n";
visited[curnt_postionon_path]=1;
int reached_v=0;
for(int j=0;j<adj[curnt_postionon_path].size();j++){
... | ALGO | 0.999844 | 4.352341 |
7ca1a8d8-28fb-4905-a3e2-c26ab19eb10b | Dipti821/DSA_Questions | Account Merge - GFG/account-merge.cpp | //{ Driver Code Starts
//Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function Template for C++
class DisjointSet {
vector<int> rank, parent, size;
public:
DisjointSet(int n) {
rank.resize(n + 1, 0);
parent.resize(n + 1);
size.resiz... | ALGO | 0.999815 | 6.434804 |
b177ccf2-a36f-4c26-919b-7d47bfbca737 | PUIPUI-MOLCAR/atcoder | abc/193/c.cpp | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const long long INF = 1LL << 60;
int ex... | ALGO | 0.999918 | 4.338123 |
6512ba2e-2bae-4315-9234-2cb12f99dfa4 | nmessa/CPlusPlus--2023 | Lab Exercise 3.17.2023/IEEE754/IEEE754/main.cpp | //Decimal to binary converter
//Added IEEE 754 representation
//Author:
//Lab Exercise 3.17.2023 Problem 4
#include <iostream>
#include <string>
#include <conio.h>
using namespace std;
#define SIZE 53 //Size of mantissa of IEEE754 floating point
//representation
//Function prototypes
void fillArray(double []... | ALGO | 0.992543 | 5.104279 |
44eee2c6-c000-4e42-9769-5fa38b9b110a | phantom23333/3D-Gaussian-Reconstruction | submodules/tetra-triangulation/CGAL-5.6.1/demo/CGAL_ipelets/cone_spanners.cpp | #include <iostream>
#include <CGAL/Exact_predicates_exact_constructions_kernel_with_root_of.h>
#include <CGAL/CGAL_Ipelet_base.h>
#include <CGAL/Construct_theta_graph_2.h>
#include <CGAL/Construct_yao_graph_2.h>
#include <CGAL/Compute_cone_boundaries_2.h>
#include <CGAL/Cone_spanners_enum_2.h>
#include <CGAL/property_m... | ALGO | 0.993211 | 6.820607 |
de984aea-c096-4a16-83ae-fa0047658e6c | MDNROnik/Competitive-Programming | Codeforces/C. Letters.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define mod 1000000007
#define fastIo() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
bool prime[90000001];
int n=90000000;
vector<int>v;
void sieve()
{
for(int i=2; i*i<=n; i++)
{
if(prime[i]==false)
{
for(... | ALGO | 0.999966 | 3.668595 |
ad6cc902-3600-4718-bd45-2e6c0acf3b90 | MMSS9402/algorithm | ProblemSolving/mincode/level38/38-2.cpp | #include <iostream>
#include <queue>
using namespace std;
int map[4][9] = {0};
struct Node {
int x,y;
int n;
};
int used[4][9]= {0};
int direct[4][2] = {
0,1,
0,-1,
1,0,
-1,0
};
queue<Node> q;
void init(){
for(int i=0;i<4;i++){
for(int j=0;j<9;j++){
cin >> map[i][j];
... | ALGO | 0.999611 | 4.517926 |
28cd6d6b-821a-489f-ac87-8b2b3ca850e5 | jeete121/Coding | Programs/Practice/Prac/GraphAlgorithms/serialize_deserealize.cpp | #include <bits/stdc++.h>
using namespace std;
//struct for treenode
struct TreeNode
{
int data;
TreeNode *left;
TreeNode *right;
TreeNode(int data)
{
this->data = data;
this->left = NULL;
this->right = NULL;
}
};
//function to encode tree into
//the string
string seriali... | ALGO | 0.999434 | 5.093534 |
7137edc3-df89-4bf4-a4ff-4ae4acf0036f | Aniruddha008/CPP-DS-Algorithms | Dynamic Programming/01Knapsack/knapsack_variation_4_min_subset_sum_diff.cpp | #include<iostream>
#include<cstring>
using namespace std;
//global array
int t[102][1002];
int minSubsetSumDiff(int a[], int c, int n)
{
//Initialize the base case
for(int i = 0; i < n+1; i++)
{
for(int j = 0; j< c+1; j++)
{
// 0th row: where number of elements remain 0 in the ... | ALGO | 0.999979 | 4.296497 |
d5f29bf4-4b59-4188-bb4f-00bc9fb5b2ad | UsoltsevaM/algorithms_and_data_structures_yandex_cpp | sprint7/taskO.cpp | #include <iostream>
#include <vector>
#include <unordered_map>
const static long long mod = 1000000007;
void dfs(int from, int finish, const std::vector<std::vector<int>>& graph, std::vector<int>& colors, std::vector<long long>& dp)
{
if (from == finish)
dp[from] = 1;
... | ALGO | 0.999954 | 5.590233 |
97c26a7c-27a3-48ce-9cf8-5ad369578bde | Mulab11/cntt2016-hw1 | TC-SRM-568-div1-250/wyz.cpp | // BEGIN CUT HERE
// END CUT HERE
#line 5 "BallsSeparating.cpp"
#include <bits/stdc++.h>
#define ll long long
using namespace std;
const int maxn=55;
class BallsSeparating {
vector<int> a[3];
bool used[maxn];
int n,t;
int b[3];
int ans;
void dfs(int u){
if (u==t){
int res=0;
for (int i=0;i<n;++i){
... | ALGO | 0.998753 | 4.80566 |
288a4cda-ed78-41b4-b84b-0b1bdb5f0b68 | romulosantos92/MathComp | main.cpp | #include <iostream>
#include "mathcomp.h"
#include <stdlib.h>
#include "matriz.h"
///5 4 7 8 9 3 2 1 6
using namespace std;
int main()
{
mathcomp m;
int run=1;
int op;
while(run==1)
{
cout << endl;
cout << "\t1-Distancia entre 2 pontos" << endl;
cout << "\t2-Norma de um v... | ALGO | 0.981791 | 3.467798 |
fc9fced1-6eb5-4e91-863b-3959cddd6e09 | hytera170726574/CplusLearn | include/Pointer/addpntrs.cpp | #include <iostream>
int main ()
{
using namespace std;
double wages[3] = {10000.0,20000.0,30000.0};
short stacks[3] = {3,2,1};
//two ways to get the address of an array
double * pw = wages; //name of an array = address = the first element of the array
short * ps = &stacks[0];
cout << "pw =... | ALGO | 0.976494 | 3.169472 |
412eb094-764c-4476-b54c-a54d762f67cf | Rob1Ham/btc-core-miniscript | src/util/serfloat.cpp | #include <util/serfloat.h>
#include <cmath>
#include <limits>
double DecodeDouble(uint64_t v) noexcept {
static constexpr double NANVAL = std::numeric_limits<double>::quiet_NaN();
static constexpr double INFVAL = std::numeric_limits<double>::infinity();
double sign = 1.0;
if (v & 0x8000000000000000) {... | TOOL | 0.872747 | 6.674354 |
974df9e2-980c-4990-a68e-0f5f602947db | ML-UCV/ML-CodeBert-DistinctSolutions | Raw Dataset/strmatch/kmp/train/336108cc-be1d-45be-bb1d-b77b038542db.cpp | #include <bits/stdc++.h>
using namespace std;
ifstream f("strmatch.in");
ofstream g("strmatch.out");
int p[2000005];
char A[2000005],B[2000005];
vector <int> Sol;
int main()
{
f>>A>>B;
int n=strlen(A);
for(int i=1,j=0; A[i];)
{
if(A[i]==A[j])
p[i]=++j,i++;
else... | ALGO | 0.999991 | 4.108883 |
ea7e7426-370d-432b-aff1-bdc4b7246661 | abhibuddy/Complete-Programing-Concepts_C_PLUS_PLUS | Data_Structures/Greedy Algorithm/largest_in_array.cpp | #include <iostream>
#include <vector>
#include <climits>
int findlargest(std::vector<int> arr)
{
if(arr.size()==0)
{
return INT_MIN;
}
int largest = arr[0];
for(auto ele : arr)
{
if(ele > largest)
largest = ele;
}
return largest;
}
int main()
{
std::vector<int... | ALGO | 0.999809 | 5.658468 |
cc21d39c-ee1e-4fb1-9a6c-7a9608d7d2a1 | PoeLoren/Leetcode | second-time/LRU Cache.cpp | class LRUCache{
public:
struct CacheEntry{
int key;
int value;
CacheEntry(int k, int v):key(k), value(v){
};
};
LRUCache(int capacity) {
mCapacity = capacity;
}
int get(int key) {
if(mMap.find(key) == mMap.end())
return -1;
Mov... | ALGO | 0.999616 | 5.72579 |
e425b134-853f-4174-8438-8d5ca820f458 | TimothyHorscroft/competitive-programming | codeforces/1916/d.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define FOR(i, a, b) for (int i=(a); i<(b); ++i)
#define ROF(i, a, b) for (int i=(a); i>(b); --i)
#define vi vector<int>
#define vvi vector<vi>
#define pii pair<int,int>
signed main() {
ios::sync_with_stdio(0), cin.tie(0);
auto solve = [&]()... | ALGO | 0.999358 | 3.943037 |
35d81849-7bff-4143-bff4-f7bc09a4f3fa | SinySkorpion/mnogopotochnoe_1 | Март/Март7/Март7.cpp | #include <iostream>
#include <filesystem>
#include <thread>
#include <mutex>
#include <condition_variable>
#include <queue>
namespace fs = std::filesystem;
std::mutex mtx;
std::condition_variable cv;
std::queue<std::pair<fs::path, fs::path>> file_queue;
void copy_file(const fs::path& source, const fs::path& target) ... | TOOL | 0.980167 | 5.558489 |
7de40492-0b60-4121-874d-46dcbe6bf4ab | ak586/Blind75 | 1850-minimum-length-of-string-after-deleting-similar-ends/minimum-length-of-string-after-deleting-similar-ends.cpp | class Solution {
public:
int minimumLength(string s) {
int i=0;
int j=s.size()-1;
while(i<j){
if(s[i]!=s[j]) break;
char temp=s[i];
while(i<j && s[i]==temp){
i++;
}
while(j>=i && s[j]==temp){
j--;
... | ALGO | 0.999961 | 6.012155 |
82b2489f-fa56-4c63-9d98-1c907acb5a69 | nitish166/HackerEarth | Math/Prime.cpp | // Return 1 if A is prime, else 0
int Solution::isPrime(int A) {
if(A==1)
return 0;
int upperLimit = sqrt(A);
for (int i = 2; i <= upperLimit; i++) {
if (i < A && A % i == 0) return 0;
}
return 1;
}
| ALGO | 0.999571 | 3.951482 |
1583690f-b710-4b2d-a958-b003d0dc3aeb | munhwas1140/PS | C++/2494.cpp | #include <bits/stdc++.h>
using namespace std;
#define fastio cin.tie(0)->sync_with_stdio(0)
using ll = long long;
int n;
string from, to;
int dp[10000][10];
int go(int idx, int left) {
if(idx == n) return 0;
int &ret = dp[idx][left];
if(ret != -1) return ret;
int now = ((from[idx] - '0') + left) % 10;... | ALGO | 0.999972 | 3.827457 |
be73e45b-f4ff-4e94-aa2b-1932d3e6beab | lord-benjamin/DSA-Learning-Codes | Trees/CreateTreeAndTraversals.cpp | #include<iostream>
using namespace std;
struct Node{
struct Node *lchild;
int data;
struct Node *rchild;
};
struct Queue{
int size;
int front;
int rear;
Node **Q;
};
void create (struct Queue *q,int size){
q->size = size;
q->front = q->rear = -1;
q->Q = (Node **)malloc(q->size... | ALGO | 0.99995 | 4.493037 |
7adb1ec3-6270-405c-9038-b0df81a74145 | Lunarixus/panfork_offscreen_rootless | src/intel/compiler/brw_fs_copy_propagation.cpp | /** @file brw_fs_copy_propagation.cpp
*
* Support for global copy propagation in two passes: A local pass that does
* intra-block copy (and constant) propagation, and a global pass that uses
* dataflow analysis on the copies available at the end of each block to re-do
* local copy propagation with more copies avai... | ALGO | 0.995689 | 3.630878 |
6f76dfe3-f129-4a7b-bee5-70777658d083 | jo-qzy/LeetCode | 118.PascalsTriangle.cpp | //杨辉三角,没啥好说的
class Solution {
public:
vector<vector<int>> generate(int numRows) {
if (numRows <= 0)
return vector<vector<int>>();
vector<vector<int>> ret = { {1} };
for (int i = 0; i < numRows - 1; i++)
{
vector<int> tmp = { 1 };
for (int j = 0; j < ret[i].size() - 1; j++)
{
tmp.push_back(ret[i... | ALGO | 0.999991 | 5.439052 |
06873794-6492-4162-a243-3e331be1a784 | keyone957/CodingTest | 프로그래머스/2/1844. 게임 맵 최단거리/게임 맵 최단거리.cpp | #include<vector>
#include<queue>
using namespace std;
int solution(vector<vector<int> > maps)
{
int answer = 0;
int dx[4]={-1,0,1,0};
int dy[4]={0,-1,0,1};
int n = maps.size();
int m = maps[0].size();
queue<pair<int,int>> q;
vector<vector<int>> dist(n,vector<int>(m,-1));
q.push({0,0});
... | ALGO | 0.999794 | 4.868357 |
462d85ad-5622-4913-87fd-5fa11157a7cf | jwoo820/Algorithm | Num11399.cpp | //
// main.cpp
// Num11399
//
// Created by Park Jungwoo on 2021/04/13.
//
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(int argc, const char * argv[]) {
// insert code here...
int input, sum=0;
vector<int> n;
cin>>input;
for(int i=0;i<input;i++){
... | ALGO | 0.999935 | 5.109625 |
c4365aab-921b-40d4-8272-6ccc0313dde6 | OisinDavey/Aipo | Prelims2019/AipoPrelim2019Q3.cpp | #include<bits/stdc++.h>
#define MX_N 202
#define INF 12345678910
#define pi 3.14159265358979323846
#define optimize() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define czek(n,i) ((n&(1<<i))?1:0)
#define rep(j,n) for(int i=j;i<n;i++)
#define revrep(j,n) for(int i=n-1;i>=j;i--)
#define rup(k,n) for(int j=k;j... | ALGO | 0.999827 | 3.668254 |
22dce7f1-1484-41ad-8926-98e1610d32a1 | gimmeitorilltell/frameworks_av | media/libstagefright/codecs/amrnb/enc/src/inter_36.cpp | /*
------------------------------------------------------------------------------
Pathname: ./audio/gsm-amr/c/src/inter_36.c
Date: 01/31/2002
------------------------------------------------------------------------------
REVISION HISTORY
Description:
1. Eliminated unused include files.
... | ALGO | 0.999472 | 5.616278 |
45d49e49-7f21-492f-8dfc-2b8192d7e66d | bfeng/CryptoGRU | third_party/cryptoTools/thirdparty/linux/boost/libs/proto/example/mini_lambda.cpp | #include <iostream>
#include <algorithm>
#include <boost/mpl/int.hpp>
#include <boost/mpl/min_max.hpp>
#include <boost/mpl/eval_if.hpp>
#include <boost/mpl/identity.hpp>
#include <boost/mpl/next_prior.hpp>
#include <boost/fusion/tuple.hpp>
#include <boost/typeof/typeof.hpp>
#include <boost/typeof/std/ostream.hpp>
#incl... | TOOL | 0.877765 | 7.523868 |
a5179c62-c4fa-4db0-9bee-582569a632fb | EASINTUHA/Coding-Journey-reset | April 2025 past/Too_many_items.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define ff first
#define ss second
#define pb push_back
#define all(x) x.begin(), x.end()
#define sz(x) (int)(x)... | ALGO | 0.999709 | 3.828643 |
d51fd4e7-f6fb-410c-adf7-7147816e9fe7 | flpdsc/basic_algorithm | cpp/12.cpp | //숫자의 총 개수 (큰 수)
#include <iostream>
using namespace std;
int main()
{
int n, c=1, d=9, sum=0, res;
cin >> n;
while(sum+d<n){
res += (c*d);
sum += d;
c++;
d *= 10;
}
res += (n-sum)*c;
cout << res << endl;
return 0;
} | ALGO | 0.999621 | 3.512655 |
5e0191d4-793f-48f1-8045-1f1e1d3cac03 | ngabo-dev/input_field_validation | 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 |
4f9a26b5-7dfe-43bd-b01f-b50494e3608b | srinath-chakravarthy/ligghts | src/fix_nve.cpp | #include <stdio.h>
#include <string.h>
#include "fix_nve.h"
#include "atom.h"
#include "force.h"
#include "update.h"
#include "respa.h"
#include "error.h"
using namespace LAMMPS_NS;
using namespace FixConst;
/* ---------------------------------------------------------------------- */
FixNVE::FixNVE(LAMMPS *lmp, int ... | ALGO | 0.993778 | 6.277599 |
224c8a0c-54c8-49e4-ada6-84e31e37fe4f | chaudhry1994harsh/Competitive-programming | Week 1/submission/addrev.cpp | #include<iostream>
#include<vector>
#include<algorithm>
#include<sstream>
using namespace std;
int main(){
int out,count;
vector<int> ip(2);
cin>>count;
string rev;
stringstream halpp;
for (int j = 0; j < count; j++)
{
for (int i = 0; i < 2; i++){ ... | ALGO | 0.999832 | 5.331755 |
3b12a7d0-885b-44cb-a9af-897f3cd53499 | GibOreh/CPP | b11.cpp | #include<bits/stdc++.h>
using namespace std;
string tinh(string x, string y){
if(x.length() > y.length()){
swap(x,y);
}
int nX= x.length();
int nY= y.length();
string result="";
reverse(x.begin(), x.end());
reverse(y.begin(), y.end());
int mem=0;
for(int i=0; i<nX; i++){
int sum= x[i] + y[i] - 96 +... | ALGO | 0.999912 | 5.802198 |
0563ff7f-30cc-4c7d-b1c6-4b43360c8857 | kimtaemin1324/C-Programing | COSPro2/goorm_6/goorm_6_6/goorm_6_6/main.cpp | #include <stdio.h>
#include <stdbool.h>
#include <stdlib.h>
// ־ йȣ Ư ϴ θ ȯϴ Լ
bool solution(char* password) {
bool answer;
// 빮, ҹ, ʱȭ
int capital_count = 0, small_count = 0, digit_count = 0;
// ־ йȣ ȸϸ鼭 빮, ҹ,
for (int i = 0; i < strlen(password); i++) {
if (password[i] >= 'A' &&... | ALGO | 0.996196 | 3.984482 |
37a0415c-171a-4e59-9845-c11a3f49546f | samson-offorjindu/HackerRank---Bill-Division-Segmentation-Error-fix- | HackerRank - Bill Division.cpp | #include <iostream>
#include <stdlib.h>
#include <vector>
#include <algorithm>
using namespace std;
//It should print Bon Appetit if the bill is fairly split, where Anna
//chooses a meal in the array she won't tak, Otherwise, it should print the integer amount of money that Brian owes Anna.
//bonAppetit has ... | ALGO | 0.998588 | 4.012184 |
654aa6a6-f6e5-48f2-a5cb-77adeaf9b9ea | raincross7/code-similarity | codes/train_code/problem382/problem382_47.cpp | #include <iostream>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <iomanip>
#include <numeric>
#include <queue>
#include <cmath>
using namespace std;
int myfind(int a, vector<int>& relation) {
if (relation[a] == a) return a;
int ... | ALGO | 0.999956 | 5.198859 |
72172457-f014-45ec-b56d-75a58c6c0b3a | jahidulkyau/water_tracker | 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.998757 | 6.771107 |
37b7a40d-c32e-42f9-908b-89a7b4f1e3bb | uniqss/leetcodecpp | 0055/55_JumpGame.cpp | #include "../inc.h"
class Solution {
public:
bool canJump(vector<int>& nums) {}
};
void test(vector<int>&& nums, bool expect) {
save4print(nums);
assert_eq_ret(expect, Solution().canJump(nums));
}
int main() {
test({0}, true);
test({0, 2, 3}, false);
test({1, 2}, true);
test({2, 3, 1, ... | TEST | 0.999945 | 6.072252 |
1782ec99-72bf-4cfb-aa22-05d161c7ef39 | parag7102/P_71 | Assigment/oops concepts/IP/Q13.cpp | /*13. Write a program to find the max number from given
two numbers using friend function */
#include<iostream>
using namespace std;
class Number {
int num;
public:
Number(int n) : num(n) {}
void display() {
cout << num << endl;
}
friend void findMax(Number& n1, Number& n2);
}... | ALGO | 0.998431 | 5.482574 |
57797230-90c7-4d65-bf11-294c9c0b30e4 | shubhkush57/DSA-LEETCODE | 0441-arranging-coins/0441-arranging-coins.cpp | class Solution {
public:
bool isPossible(int mid,int n){
long long sum = ((long long)mid*(mid+1))/2;
if(sum >n){
return false;
}
return true;
}
int arrangeCoins(int n) {
int start = 1;
int end = n;
int row = 0;
while(start<=end){
... | ALGO | 0.999967 | 6.608366 |
2255f69d-530d-42b7-b00c-dbe92a8424bf | anshika2609/coding | codechef_may_2.cpp |
/* * * * * * * * * * * * * *
# *
# @Author ANSHIKA AGRAWAL *
# *
# * * * * * * * * * * * * */
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define MOD 1000000007
#define M(x) (x%MOD + MOD)%MOD
#define _pb push_back
#define _mp make_pair
#d... | ALGO | 0.999636 | 3.428993 |
6e648cce-8899-420e-824c-bf6bb5eff1f7 | OleksiiHladyshko/MathProg | Polinom/ЧМ2новый.cpp | #include "stdafx.h"
#include <Windows.h>
#include <stdlib.h>
#include <math.h>
#include <iostream>
using namespace std;
// pow(x,3) + 2*pow(x,2) + 5
#define graphic(x) (pow(x,3) + 2*pow(x,2) + 5) //
#define lagranjGraph(x) (polinomLangranja(x))
int interval[2];
double intervalLength;
double divInterval[100];
double... | ALGO | 0.995559 | 3.836529 |
7d75199d-0f9f-4164-b6c9-4ed206ad03e0 | sitefortest/iniParser | iniParser.cpp | /**
* File: iniParser.cpp
* Author: LonelyDrifter
*
* Created: October 11, 2014, 01:46 AM
*/
/**
* include headers
*
*/
#include "iniParser.h"
#include <fstream>
#include <vector>
#include <unordered_map>
#include <utility>
/**
* global section
*
*/
#define LINETYPE_UNSUPPORT (0x00000000);
#define LINETYPE... | TOOL | 0.932766 | 4.472209 |
082981b5-6810-4dd3-a64b-177f536fe780 | kapil4457/Contests | AtCoder Contests/AtCoder Beginner Contest 303/.history/temp_20230528082416.cpp | #include <bits/stdc++.h>
#define ll long long int
#define pb push_back
#define mod 1000000007ll //998244353ll
#define mii map<int, int>
#define pii pair<int, int>
#define TEST int t=1;;while(t--)
int power(int a,int b){int result =1; while(b>0){if(b%2) result*=a; a*=a;b/=2;} return result;}
using namespace std;
vect... | ALGO | 0.999982 | 5.002039 |
573fe70f-c893-4c70-a78c-21f75fb7d922 | carlosriveraf/UVA-submissions | 11727 - Cost Cutting.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int T; cin>>T;
int i = 1;
while( T-- ) {
int a; cin>>a;
int b; cin>>b;
int c; cin>>c;
cout<<"Case "<<i<<": ";
if( ( b > a && a > c ) || ( c > a && a > b ) ) { cout<<a<<endl; }
else if( ( a > b && b > c ) || ( c > b && b > a ) ) { cout<<b<<e... | ALGO | 0.999967 | 4.160947 |
b785533d-399a-4097-8b4e-960e771449ee | dil2/ns | euler.cpp | /*
* C++ Program to Implement Euler Theorem
*/
#include<iostream>
using namespace std;
// A naive method to find modulor multiplicative inverse of
// 'a' under modulo 'm'
int modInverse(int a, int m)
{
a = a%m;
for (int x=1; x<m; x++)
if ((a*x) % m == 1)
return x;
}
// Driver... | ALGO | 0.999947 | 4.409303 |
3616a6de-f333-4b99-8401-0ef5999f1745 | ashishnagpal2498/CPP_Concepts_and_Codes | CodeChef-Problems/Atm_Beginner_2.cpp | //Atm Withdrawal
#include<iostream>
using namespace std;
int main()
{
int amt;
float balance;
cin>>amt>>balance;
float remaining = balance - amt - 0.50;
if(remaining>=0&&amt%5==0)
{cout<<remaining<<endl;}
else
{
cout<<balance<<endl;
}
return 0;
} | ALGO | 0.999081 | 3.160729 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.