uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
66d9443e-f716-4d7a-a66c-8557df9a2989 | roshankumarsinha/DSA | General-DSA-Questions/Tree/7_zigZagTraversalOfTree.cpp | // Write a function to perform zigzag traversal of a binary tree.
// Zig-Zag traversal of a binary tree means:
// Level 1 → Left to Right
// Level 2 → Right to Left
// Level 3 → Left to Right
// Level 4 → Right to Left
// … and so on.
// Example : Tree considered here is :
// 1
// / \
// 2 3
// ... | ALGO | 0.999999 | 6.713059 |
aaaa26d4-e18d-4a8c-8680-b9e1c84b790c | namnguyen16082008/VJUDGE | AtCoder-arc107_b.cpp | #include <bits/stdc++.h>
#define ll long long int
using namespace std;
const ll N=100000;
ll n,k,ans=0,o=1,a[2*N+5];
void Build(){
for (ll i=2;i<=2*n;i++) a[i]=min(n,i-1)-max(o,i-n)+1;
}
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cin>>n>>k;
Build();
for (ll i=2;i<=2*n;i++)
... | ALGO | 0.999662 | 3.459321 |
824c3501-f258-4d24-858d-8169e791b7ee | manishgautam9494/Leetcode-Progamm | patterns/c++/TopKElements.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <unordered_map>
#include <algorithm>
using namespace std;
class TopKElements {
public:
// K Largest Elements using Sorting
vector<int> kLargestElementsSortingAppraoch(vector<int>& nums, int k) {
sort(nums.begin(), nums.end(), greater<int>... | ALGO | 0.999985 | 5.473588 |
15f3192f-5e83-42f6-9525-0a1b71d2cb4e | Bharat2044/365-days-coding-challanges | Day_171/01_copyList.cpp | // Question Link: https://www.interviewbit.com/problems/copy-list/
/*
Copy List
A linked list is given such that each node contains an additional random pointer which could point to any node in the list or NULL.
Return a deep copy of the list.
Example:
Given list
1 -> 2 -> 3
with random pointers going from
1 -... | ALGO | 0.99582 | 4.670965 |
4d40f7e6-f08a-4456-a4c2-05f282231adc | sarvex/leetcode-solidity | solution/2300-2399/2380.Time Needed to Rearrange a Binary String/Solution.cpp | class Solution {
public:
int secondsToRemoveOccurrences(string s) {
int ans = 0, cnt = 0;
for (char c : s) {
if (c == '0') {
++cnt;
} else if (cnt) {
ans = max(ans + 1, cnt);
}
}
return ans;
}
}; | ALGO | 0.999813 | 6.088374 |
97d2ef46-8712-410b-9a1e-05ea3b455f04 | oigomezz/Retos | Hackerearth/Data-Structures/Advanced-Data-Structures/Suffix-Arrays/Unique-Gems/solution.cpp | #include <bits/stdc++.h>
using namespace std;
string s;
int tag[100001][22], mxPow, n;
void buildSA(string &s)
{
n = s.size();
pair<int, pair<int, int>> v[100001];
for (int i = 0; i < n; i++)
{
v[i].first = s[i] - 'a' + 1;
v[i].second.first = -1;
v[i].second.second = i;
tag[i][0] = v[i].first;
... | ALGO | 0.999974 | 5.000412 |
6febc2cc-b3fb-41e3-b142-25f29edcde65 | Mysterioucz/2110327-ALGORITHM-DESIGN- | Grader/ex03e2_mcm/main.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
vector<int> dm(n+1);
vector<vector<int>> dp(n+1,vector<int>(n+1,1e7));
for(int i = 1;i < n + 1;i++) dp[i][i] = 0;
for(int i = 0;i < n + 1;i++) cin >> dm[i];
for(int i = 0;i < n - 1;i++){
int c = 2 + i;
... | ALGO | 0.99987 | 3.511852 |
749dacfe-9c65-426d-b571-2c67d5b34a74 | Anemois/Codeforces | GoodBye_2023-B.cpp | //2023/12/30 https://codeforces.com/contest/1916/problem/B
#include <bits/stdc++.h>
#define HAS_T true
#define INT
#define Anemoi ios_base::sync_with_stdio(false);cin.tie(0);
#define int long long
using namespace std;
#if defined(VOID)
void
#elif defined(INT)
int
#elif defined(BOOL)
bool
#elif defined(STRING)
string... | ALGO | 0.999878 | 5.620926 |
bac31238-0891-471b-838d-9caf1398d7d5 | feel-coding/algorithm-practice | 백준 3474.cpp | #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main() {
cin.tie(NULL);
ios_base::sync_with_stdio(false);
int n;
cin >> n;
for (int i = 0; i < n; i++) {
int num;
cin >> num;
int count = 0;
for (int j = 5; j <= num; j *= 5) {
count += num / j;
}
cout << count << '... | ALGO | 0.9999 | 3.966099 |
2c63379e-7dff-4fd1-8bf0-e686902b3ab5 | dhabenishant/CPP | cpp/string/Day.cpp | #include<iostream>
using namespace std;
int main()
{
int day;
cin>>day;
switch(day)
{
case 1:
cout<<"Monday";
break;
case 2:
cout<<"Tuesday";
break;
case 3:
cout<<"Wednesday";
break;
case 4:
cout<<"Thursday";
break;
case 5:
cout<<"Friday";
break;
case 6:
cout<<"Saturday"... | ALGO | 0.987077 | 3.517327 |
29550826-8de2-4fca-a979-a7fbccf20e4c | ParamThakkar123/DSA | 450DSA/Arrays/Reverse an array/Approach2.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int arr[5000];
int n;
cin >> n;
for(int i = 0; i < n; i++){
cin >> arr[i];
}
for(int i = n - 1; i >= 0; i--){
cout << arr[i] << " ";
}
}
| ALGO | 0.999912 | 4.458682 |
6579e22b-cf34-4239-8b73-0b0c618311e9 | otnim/tjip-leetcode-repo | week12/329. Longest Increasing Path in a Matrix.cpp | //TC: O(m x n)
//MC: O(m x n)
class Solution {
public:
vector<int> dir{0, -1, 0, 1, 0};
vector< vector<int> > dp;
int getLIP(int r, int c, vector<vector<int>>& matrix){
if(dp[r][c] != -1) return dp[r][c];
//dp[r][c] means r,c cell theke LIP
int curMaxPathLen = 1;
for(int i... | ALGO | 0.999973 | 6.085799 |
33d68a60-6512-4204-978d-e46daa37b651 | Ayush-Chauhan-7/Competitive-Programming | Dynamic Programming/DP on strings/Minimum Delete Operation for Two Strings.cpp | // https://leetcode.com/problems/delete-operation-for-two-strings/
#include <bits/stdc++.h>
typedef long long ll;
#define fo(i, n) for(ll i=0;i<n;i++)
#define vi vector<ll>
#define vp vector< pair <ll,ll> >
#define f first
#define s second
#define pb push_back
#define endl '... | ALGO | 0.999948 | 5.401101 |
fa18680f-764a-4bf4-8671-47342f899de1 | Mindjolt2406/Competitive-Programming | Codechef/COOKOFFS/COOKOCT/BINIM2.cpp | #include<bits/stdc++.h>
#define mt make_tuple
#define mp make_pair
#define pu push_back
#define INF 1000000001
#define MOD 1000000007
#define ll long long int
#define ld long double
#define vi vector<int>
#define vll vector<long long int>
#define sc(n) scanf("%d",&n);
#define scll(n) scanf("%lld",&n);
#define scld(n) s... | ALGO | 0.999738 | 3.625488 |
cf409edc-24b2-4d8a-bfd0-3bd3730e184b | manamnathtiwari/CPP | c++ STL Ask Senior/Count_Numbers.cpp | // COUNT NUMBERS
#include<bits/stdc++.h>
using namespace std;
int main(){
int n , q;cin>>n>>q;
vector<int> arr(n+1,0);
while(q--){
int a , b;
cin>>a>>b;
if(a==1){
arr[b]++;
}
else if (a==2){
cout<<arr[b]<<endl;
}
}
} | ALGO | 0.999664 | 4.064697 |
58a02df6-7cee-4800-bbff-ff6ba31f6bb2 | hechima256/numerically-balanced-dice-public | main.cpp | #include <iostream>
#include <set>
#include <vector>
#include <algorithm>
#include "vertex.h"
#include "edge.h"
#include "face.h"
#include "dice.h"
enum restriction {
NONE= 0,
O= 1, // 001
V= 2, // 010
F= 4, // 100
NUM_RESTRICTION=8,
};
void print_sum(int satisfy_count[NUM_RESTRICTION]){
std:... | ALGO | 0.990418 | 5.508375 |
fa59fbad-485b-47db-9784-c98a2b3ae7ea | ishandutta2007/codeforces | ludo/normal/754/C.cpp | #include<bits/stdc++.h>
using namespace std;
const int MAX = 110;
using pii = pair<int, int>;
int nnames;
map<string, int> nameIdx;
string names[MAX];
int nmsg, sender[MAX];
string msg[MAX];
vector<pii> possible[MAX]; // which senders are possible at this point, with which previously?
bool isWordCh(char ch)
{
i... | ALGO | 0.999315 | 4.250742 |
fcbc2337-a189-4a13-a2b6-4b5005a2f77f | momomorgentau/code | atcoder/abc/abc158/a_station_and_bus.cpp | //16
//abc158_a_station_and_bus
#include<bits/stdc++.h>
#define rep(i,n) for(int i =0;i<n;++i)
#define reps(i,s,n) for(int i =s;i<n;++i)
using namespace std;
using P = pair<int,int>;
int main()
{
string s;
cin >> s;
if(s == "AAA" || s == "BBB") cout << "No" <<endl;
else cout << "Yes" << endl;
retu... | ALGO | 0.999982 | 3.558567 |
a2954cc3-f6c3-44b2-8ff0-0a931ed9ab7f | samyak1512/coding | C++ Code/codeforcesedu.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int t;
cin>>t;
while (t--){
int n;
cin>>n;
int arr[n];
for (int i = 0; i < n; ++i)
{
cin>>arr[i];
}
int m;
cin>>m;
int array[m];
for (int j = 0; j < m; ++j)
{
cin>>array[j];
}
int a = *max_element(arr, arr + n);
int b = *... | ALGO | 0.999902 | 3.710065 |
06ea6c10-7bb4-40c7-b79d-a54f5dd80bd6 | oustani-anas/cp_bootcamp | day01/A.cpp |
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
int main()
{
int n_seq, num;
std::cin >> n_seq;
for (size_t i = 0; i < n_seq; i++)
{
std::cin >> num;
if(num >= 0)
num = num + 2;
std::cout << num << " ";
}
} | ALGO | 0.999144 | 3.762077 |
1f7ff36e-d383-4a90-8bf9-680ab2e4a54a | liardanc3/algorithm | cpp/17411.cpp | #include <bits/stdc++.h>
#define DIV 1'000'000'007
using namespace std;
typedef pair<int, int> pii;
vector<int> lis, vect[1000000];
int N, tmp, arr[1000002];
int dynamic(int idx, int now) {
if (idx == 0)
return 1;
int ret = 0;
int nextidx = upper_bound(vect[idx - 1].begin(), vect[idx - 1].end(), now - 1) - vec... | ALGO | 0.999977 | 4.463533 |
aca2a22b-32bc-4fb6-833c-6e3ee32734cd | lywoo04/CPP2409 | challenge/week10/student_vector.cpp | #include <vector>
#include <iostream>
using namespace std;
int main() {
vector<int> v;
int score;
int total = 0;
int count= 0;
while (true) {
cout << "성적을 입력하시오(종료는 -1) : ";
cin >> score;
if (score == -1) {
break;
}
v.push_back(score);
c... | TOOL | 0.992883 | 3.938806 |
9bb45a29-22ae-4bda-a330-0c11d7c2851d | VaishnaviTyagi23/CrackYourPlacement | DAY4/Q2/WithoutSorting.cpp | class Solution {
public:
int maximumProduct(vector<int>& nums) {
int max1 = INT_MIN, max2 = INT_MIN, max3 = INT_MIN;
int min1 = INT_MAX, min2 = INT_MAX, min3 = INT_MAX;
for(int i = 0; i < nums.size(); i++){
if(nums[i] <= min1){
min2 = min1;
min1 = nums[i];
}
else if(nums[i] <= min2){
min2 =... | ALGO | 0.999986 | 5.605385 |
172a7b70-9f82-40f0-8314-058cf3ba0053 | hemanggs/Comptetitive-Programming | Galin Colin library with problems/Persistent Segment Tree.cpp | int n, m, ct=0, num=0;
int root[N], st[21*N], lc[21*N], rc[21*N];
int build(int L, int R)
{
int node = ++ct;
if(L==R)
return node;
int M = (L+R)/2;
lc[node] = build(L, M);
rc[node] = build(M+1, R);
return node;
}
int update(int onode, int L, int R, int pos)
{
int node = ++ct;
if(L==R)
{
st[node] = st[ono... | ALGO | 0.999975 | 3.805094 |
5049315a-ad43-4f51-9441-62502f96533c | trnkien/Data-Structure-and-Algorithms | Lab/Lab03 - Liên kết đơn/Task02.cpp | //STT: 16
//Họ và tên: Trần Trọng Kiên
//Buổi 03 - Bài 02
#include <iostream>
#include <string>
#include <time.h>
#include <cstdlib>
using namespace std;
struct Data
{
string Name;
float GPA;
};
struct DNode
{
Data info;
DNode* Next;
};
struct DList
{
DNode* Head;
DNode* Tail;
};
int menu();
DNode* CreateNod... | TOOL | 0.998859 | 3.398187 |
93830fdf-2de8-40b1-b5bb-5605141a77b0 | Ddaaan/BOJ_CPP | BOJ_18870_좌표압축.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
ios::sync_with_stdio (false);
cin.tie(NULL);
cout.tie(NULL);
int n, temp, count = 0;
vector <pair<int,int>> dot, ans; //dot 입력 배열 , ans 정답 출력 배열
cin >> n;
for (int i=0; i<n; i++) {
cin >> ... | ALGO | 0.999983 | 4.206024 |
025787c2-c808-4012-a57b-4f5ba245be8b | Raemerrr/LeetCode | 0001-two-sum/0001-two-sum.cpp | class Solution {
public:
vector<int> twoSum(vector<int> &nums, int target) {
for (int i = 0; i < nums.size() - 1; i++) {
for (int j = i + 1; j < nums.size(); j++) {
int sum = nums[i] + nums[j];
if (nums[i] + nums[j] == target) {
return vector<i... | ALGO | 0.999918 | 6.300211 |
bdfca733-1fcd-4ff3-a53b-9a9e52b3f5aa | badma025/competitive-programming | Competitive Programming/DSA/Algorithms/Searching Algorithms/Binary Search/recursiveBinarySearch.cpp | #include <bits/stdc++.h>
using namespace std;
int binarySearch(int l, int r, int number, vector<int> numbers) {
if (l <= r) {
int middle = (l+r)/2;
if (number == numbers[middle])
return middle;
if (number > numbers[middle])
return binarySearch(middle+1, r, number, ... | ALGO | 0.999624 | 5.295607 |
691b2c15-ba92-4f3e-889b-8645ca794dcd | ishandutta2007/codeforces | cerberus97/normal/707/C.cpp | #include <iostream>
using namespace std;
int main()
{
long long n, n2;
cin >> n;
n2 = n*n;
if (n < 3)
cout << -1;
else if (n%2)
cout << (n2 + 1)/2 << ' ' << (n2 - 1)/2;
else
cout << (n2 + 4)/4 << ' ' << (n2 - 4)/4;
} | ALGO | 0.999401 | 3.950192 |
62a58483-1965-4093-9e24-ab9781028b42 | ishandutta2007/codeforces | maroonrk/normal/981/E.cpp | #include <bits/stdc++.h>
using namespace std;
using ll=int64_t;
//#define int ll
#define FOR(i,a,b) for(int i=int(a);i<int(b);i++)
#define REP(i,b) FOR(i,0,b)
#define MP make_pair
#define PB push_back
#define ALL(x) x.begin(),x.end()
#ifdef MAROON_LOCAL
#define cerr (cerr<<"-- line "<<__LINE__<<" -- ")
#else
class Ce... | ALGO | 0.99997 | 3.457301 |
2684eb2d-2707-4b8c-9e4b-007ec37f637f | nisze/fatec-c-Estrutura-de-dados | Beecrowd/Lista 3/1169.cpp | #include <stdio.h>
#include <math.h>
typedef struct {
int casas;
double resultado;
} CasoTeste;
int main() {
int casos_teste, i;
CasoTeste *casos;
scanf("%d", &casos_teste);
casos = (CasoTeste *)malloc(casos_teste * sizeof(CasoTeste));
for (i = 0; i < casos_teste; i++) {
... | ALGO | 0.995645 | 3.00275 |
810a125c-abde-4ade-9644-a2e7e4eacd59 | Devaanshraheja/DSA_Cpp | extra_lec_02/09_pattern.cpp | #include<iostream>
using namespace stdint main(){
int n;
cin>>n;
for (int i = 0; i < n; i++)
{
for (int j = 0; j< n; j++)
{
if(i==0||i==n-1) {cout<<"* ";}
else {
if(j==0||j==n-1) {cout<<"* ";}
else {cout<< " ";}
}
}
cout<<endl;
}
return 0;
} | ALGO | 0.999866 | 3.327504 |
bcea1610-14e3-4723-b887-0eec2f0e1528 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_12751_4.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 505;
int a[N];
int z[2][N][N];
int main() {
int n, bl, bugs, md;
scanf("%d %d %d %d", &n, &bl, &bugs, &md);
for (int i = 0; i < int(n); i++) scanf("%d", &a[i]);
z[0][0][0] = 1;
for (int it = 1; it <= n; it++) {
int i = it & 1;
for (int j = 0;... | ALGO | 0.99995 | 3.566519 |
1995b1f6-cf1c-41bc-968e-5855af401095 | jordirocha/FIB | EXAMENS_DE_P1/EXAMEN_PARCIALS_P1/p0002_representant_comercial.cpp | //
// Created by jordy on 22/03/2025.
//
#include <iostream>
using namespace std;
bool es_ascendent(int n)
{
int d1 = n % 10;
n = n / 10;
bool asc = true;
while (asc and n > 0)
{
int d2 = n % 10;
if (d1 == 0 and d2 != 9) { asc = false; }
else if ((d1 != 0 and d2 != 9... | ALGO | 0.999927 | 5.210948 |
c92abcd5-eaec-480c-8163-8cc67836d841 | hrithik-v/DS_Lab_2K22CO217 | 11_QuickSort.cpp | #include <stdio.h>
#include <bits/stdc++.h>
using namespace std;
/* Function to print an array */
void printArray(int arr[], int size)
{
int i;
for (i = 0; i < size; i++)
printf("%d ", arr[i]);
printf("\n");
}
int partition(int arr[], int low, int high)
{
int i = low;
int j = high;
int... | ALGO | 0.999994 | 5.56743 |
cca78935-c863-47b6-935c-921f31a8f223 | PedroH2003/Programacao-Cplusplus | CodeForces/Problemset/amusingJoke.cpp | /*A. Amusing Joke
time limit per test2 seconds
memory limit per test256 megabytes
inputstandard input
outputstandard output
So, the New Year holidays are over. Santa Claus and his colleagues can take a rest and have guests at last. When two "New Year and Christmas Men" meet, thear assistants cut out of cardboard the le... | ALGO | 0.999978 | 3.885797 |
e6456bfc-d871-4337-9615-774da293a2b6 | chetan0402/LeetCode | 2894.cpp | class Solution {
public:
int differenceOfSums(int n, int m) {
int sumDiv=0;
for(int i=m;i<=n;i++) if(i%m==0) sumDiv+=i;
int sumTotal=n*(n+1)/2;
return sumTotal-(2*sumDiv);
}
}; | ALGO | 0.999975 | 5.674259 |
d3efe29a-3334-4b1e-9107-c7805e32706d | JinYeJin/algorithm-study | June~October, 2020/2020-08-01/1654_진예진_랜선자르기.cpp | /*
[백준 1654 랜선 자르기] https://www.acmicpc.net/problem/1654
*/
#include <stdio.h>
#include <limits.h>
#include <algorithm>
using namespace std;
int cables[10000];
int main(){
FILE *stream =freopen("S2\\9\\input\\1654_input.txt", "r", stdin);
if(!stream) perror("freopen");
int K, N;
long long left, righ... | ALGO | 0.999945 | 4.365574 |
1b8de0ac-dfc7-48e3-89e7-0a032f345ff2 | Dev12092003/C-with-DSA | array/reverse_array.cpp |
//revers array with specific positon
#include<iostream>
#include<vector>
using namespace std;
vector<int> reverse(vector<int> v,int n){
int s=n+1;
int e=v.size()-1;
while(s<=e){
swap(v[s],v[e]);
s++;
e--;
}
return v;
}
vector<int> print(vector<int> v){
for(int i=0;... | ALGO | 0.999835 | 4.560266 |
39ffaac5-c38e-41d0-b973-5dacc9ceda76 | ratnesh-maurya/my-coding-stuff | ALL mine/data-structure-by-abdul-bari/recursion/indirect-recursion.cpp | /*
tree recursion
code by @ratnesh maurya
14/10/2022
*/
#include <stdio.h>
void funB(int n);
void funA(int n)
{
if(n>0)
{
printf("%d ",n);
funB(n-1);
}
}
void funB(int n)
{
if(n>1)
{
printf("%d ",n);
... | ALGO | 0.999983 | 4.368641 |
bd2f8614-d3aa-4a18-ae85-325dbd38bdac | ashish-jha-73/CodeCrucible | G_Sum_of_Two_Values.cpp | #include<bits/stdc++.h>
using namespace std;
/*
************************************************************************************************************************************************
Author :- Ashish Jha
Yug :- Kaliyug
**********************************************************************************... | ALGO | 0.999853 | 4.012879 |
b47d5d2f-6deb-43d1-b58b-f1c5e3eeccc3 | roy-becker/Wet2 | PlayerTable.cpp | //
// Created by roybe on 30-Dec-22.
//
#include "PlayerTable.h"
PlayerTable::PlayerTable()
{
this->count = 0;
this->size = INITIAL_SIZE;
this->table = new Chain*[this->size];
for (int i = 0; i < this->size; ++i)
{
this->table[i] = nullptr;
}
}
PlayerTable::~PlayerTable()
{
for (i... | TOOL | 0.861306 | 4.215439 |
97280f68-9134-4eac-b4e9-538ff33ea2c4 | andreasterrius/algos | archive/BS-consecutive-1-binary.cpp | #include <iostream>
#include <vector>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <climits>
#include <cmath>
#include <algorithm>
#include <stack>
#include <string>
using namespace std;
typedef long long ll;
#define debuglist(x) for(int i = 0; i < x.size(); ++i) { cout << x[i] << " "; } ... | ALGO | 0.999688 | 3.936814 |
28b2422a-26ec-478f-844e-47e0bc711477 | japnit01/coding | C_Set_or_Decrease.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define all(x) x.begin(), x.end()
#define vi vector<int>
void solve()
{
ll n,k;
cin>>n>>k;
vector<long long> A(n);
vector<long long> S(n+1,0);
// cout<<k;
ll sum = 0;
for(int i=0;i<n;i++)
{
cin>>A[i];
... | ALGO | 0.999917 | 3.403834 |
f38e90cd-5440-4143-bbe1-8381c3e8376f | prakHr/CSES-CPBeginnerJourney | Introductory Problems/Two Sets-VVIMP.cpp | #include <bits/stdc++.h>
#define FAST_IO ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define int long long
#define double long double
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define mt make_tuple
#define PI acos(-1)
#define sqr(a) ((a)*(a))
#define ff first
#define ss second
#de... | ALGO | 0.999364 | 3.087075 |
26bb8bb6-fdef-46ff-b8af-a59bb797f1c1 | Shivika-Rawat/practice-codes | stackCopyStack.cpp | //Copy contents of one stack to another in same order.Whenever we transfer data from one stack to another stack, it gets reversed. hum 2 stack lenge ek temp or ek result , pehle temp m data dalenge then phir temp se result m , an then we get appropriate result. TC: o(n) Sc: o(n)
#include<iostream>
#include<stack>
us... | ALGO | 0.999657 | 4.892164 |
a0f32ab3-053e-490a-b7fa-95fa34bb1af6 | Juanito98/Competitive-Programming | Codeforces/2053B_outstanding_impressionist.cpp | #include <limits.h>
#include <math.h>
#include <stdio.h>
#include <algorithm>
#include <complex>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <uti... | ALGO | 0.999783 | 3.818099 |
524dc9e4-ecb6-49b0-a9aa-4211d046d75f | hoshimaruu/Data-Structures---Algorithms | LeetCode mock DSA test/Binary Search/Search in Rotated Sorted Array.cpp | #include <bits/stdc++.h>
/*
Problem Statement:
You are given a sorted array that has been rotated at some unknown pivot.
Original sorted: [0, 1, 2, 4, 5, 6, 7]
After rotation: [4, 5, 6, 7, 0, 1, 2]
You are given the array nums and a target value.
Return the i... | ALGO | 0.999981 | 6.868218 |
be6f131b-9646-487d-9563-fff5d7c6df32 | utsavtyagi01/Leetcode | Next_Permutation.cpp | class Solution {
public:
void nextPermutation(vector<int>& nums) {
int n=nums.size()-1;
int i=n;
while(i>0 && nums[i-1] >= nums[i])
i--;
if(i>0){
int j=i;
while(j<=n && nums[i-1]<nums[j]){
j++;
}
swap(nums[i-1],nums[j-1])... | ALGO | 0.99999 | 5.813725 |
ccdf1d8c-0e0a-4d86-b01d-f0d6dff225ef | NishantTomer5601/LeetCode-Questions-Repo-nishanttomer5601- | 2762-continuous-subarrays/2762-continuous-subarrays.cpp | class Solution {
public:
long long continuousSubarrays(vector<int>& nums) {
int n = nums.size();
multiset<int>st;
int i=0,j=0;
long long ans=0;
while(i<n){
while(j<n && (st.size()==0 || max(nums[j],*(--st.end()))-min(*st.begin(),nums[j])<=2)){
... | ALGO | 0.999945 | 6.020817 |
263faacc-281a-4d2a-939e-3d882759c1a4 | lewsn2008/leetcode | UniqueBinarySearchTrees2/UniqueBinarySearchTrees2.cpp |
#include <vector>
using namespace std;
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode(int x) : val(x), left(NULL), right(NULL) {}
};
class Solution {
public:
~Solution() {
/* release tree created by new operaator */
for (auto p : m_res) {
releaseTree(p);
}
}
vector<T... | ALGO | 0.99988 | 6.060577 |
7ece74a8-cf6d-42d3-b41a-3560193ed0a7 | sabernaserifar/RexPoN | src/USER-SMD/compute_smd_tlsph_strain_rate.cpp | #include <string.h>
#include "compute_smd_tlsph_strain_rate.h"
#include "atom.h"
#include "update.h"
#include "modify.h"
#include "comm.h"
#include "force.h"
#include "memory.h"
#include "error.h"
#include "pair.h"
#include <Eigen/Eigen>
using namespace Eigen;
using namespace LAMMPS_NS;
/* ----------------------------... | TOOL | 0.977046 | 5.768802 |
a517e5a5-67ef-4bcd-9904-e1ce0227adc0 | Adribv/main-pax | untitled3/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.998074 | 6.761023 |
4abee2cb-6a20-481c-a767-278245636ee8 | Swotz97/PK2 | Praktikum6/main.cpp | #include <iostream>
#include "linkedList.cpp"
using namespace std;
void ausgabe(const char *text)
{
cout << "Ausgabe: " << text << endl;
}
int main()
{
LinkedList list;
list.append("a");
list.append("a");
list.append("a");
list.append("a");
list.append("a");
list.append("a");
list.... | ALGO | 0.905052 | 3.556071 |
b57248e2-b7e1-477f-b0a0-a0ae5a156a39 | Jesikagonsalves/secure-messaging-system | venv/Lib/site-packages/sklearn/svm/src/liblinear/tron.cpp | #include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdarg.h>
#include "tron.h"
#ifndef min
template <class T> static inline T min(T x,T y) { return (x<y)?x:y; }
#endif
#ifndef max
template <class T> static inline T max(T x,T y) { return (x>y)?x:y; }
#endif
static void default_print(const char *buf)
{... | ALGO | 0.999563 | 5.847107 |
41eac4d0-4a40-4754-82fe-e090a1ce97d3 | naymur92/CompetitiveProgramming_or_DSA_CPP | codeforces/800_2029_A_Set.cpp | /*
https://codeforces.com/problemset/problem/2029/A
*/
#include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
int l, r, k;
cin >> l >> r >> k;
int ans = (r / k + 1) - l;
cout << max(ans, 0) << "\n";
}
}
/*
8
3 9 2
4 9 1
7 9 2
2 10 2
154 220 2
147 294 2
998 24435 3
1... | ALGO | 0.999831 | 4.205724 |
bfc67621-726b-4213-9aa2-761387ae108c | AmeenMuhammad/Data-Sturcute-C- | Dry_StudentPresent.cpp | #include <iostream>
#include <string>
#include <vector>
using namespace std;
const int m = 1000;
const int n = 200;
int StudentID[n];
int Absentees[m];
void AbsentStudents(int n , int m, int StudentID[], int Absents[]){
for (int i = 0; i < m; i++)
{
int id = Absents[i];
bool found = false;
... | ALGO | 0.951251 | 3.866022 |
c6cd11c4-185c-47f8-a21e-407bd8592301 | fedetoro/AED-1 | 03-Bisiesto/IsBisiesto.cpp | /******************************************
*
* Trabajo Práctico N° 3 - Años Bisiestos
*
* por Fernando Gustavo Riganti (159.146-0)
*
*
*******************************************/
// Atención! Asumimos que se ingresan años superiores a 1582, no negativos. Años anteriores a
// 1852 no son ni bisiestos ni no bisiesto... | ALGO | 0.991841 | 5.175848 |
65d1d456-b98c-4fc8-88fa-c0f0896bd0e7 | diana26060/firstrep | LabAsm_3/Task1/Task1.cpp | #include <iostream>
int main() {
int num, den, gcd;
std::cout << "Enter numerator: ";
std::cin >> num;
std::cout << "Enter denomenator: ";
std::cin >> den;
if (den <= 0) {
std::cout << "Error";
return 1;
}
int orig_num = num;
int orig_den = den;
_asm {
... | ALGO | 0.997542 | 5.542029 |
c3c14708-2802-4193-9b2e-c04a5d524e81 | yinqy0808/Project1 | 二叉树的深度.cpp | #include <iostream>
using namespace std;
struct BiNode {
char data;
BiNode* Lchild;
BiNode* Rchild;
};
class BiTree {
public:
BiTree() {root = Creat();}
~BiTree() {Release(root);}
int Depth() {return Depth(root);}
private:
BiNode* Creat();
void Release(BiNode* bt);
int Depth(BiNode* bt);
BiNode* root;
};
Bi... | ALGO | 0.999107 | 3.825146 |
e42a8d64-ed91-41b1-acb4-954a13a1fbed | hanriiver/algorithm | step solved/17298.cpp | #include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <queue>
#include <math.h>
#include <stack>
using namespace std;
stack<int> st;
int arr[1000001];
vector<int> ans;
int main() {
ios_base::sync_with_stdio(false), cin.tie(NULL);
int n;
cin >> n;
for (int i = 1; i <= n; i++) {
cin ... | ALGO | 0.999992 | 4.171592 |
5c08dd7e-6d7f-416c-a2aa-758225cc0086 | MaxSally/Competitive_Programming | Others/C_Queue.cpp | ///https://vjudge.net/contest/363384#problem/C
/*
* Author : MaxSally
*/
/******** All Required Header Files ********/
#include<bits/stdc++.h>
using namespace std;
/******* All Required define Pre-Processors and typedef Constants *******/
#define SCD(t) scanf("%d",&t)
#define SCLD(t) scanf("%ld",&t)
#define SCLLD(t)... | ALGO | 0.99999 | 3.667048 |
d2d99490-7939-4ae9-8740-0af6f55c0cbf | ZJWang9928/PAT-Solutions | OtherOJ/ECNU/18/3528.cpp | #include <iostream>
#include <cstdio>
#include <cmath>
#include <string>
#include <cstring>
#include <algorithm>
using namespace std;
int n, m;
//int pie[102][102];
int res = 0;
int rowm, pie;
int main() {
scanf("%d %d", &n, &m);
int i, j;
for (i = 0; i < n; i++) {
rowm = -1;
for (j = 0; j < m; j++) {
scan... | ALGO | 0.999928 | 3.659363 |
d6a080a0-8668-439e-ad63-236815577676 | aokblast/LeetCode_Problem_Solving | Hard/1012_Numbers_With_Repeated_Digits.cpp | //dp
//Runtime 0
//Memory 6
class Solution {
public:
int numDupDigitsAtMostN(int n) {
int res = 0;
const string s = to_string(n + 1);
int len = s.size();
unordered_set<int> vis;
for(int i = 1; i < len; ++i)
res += 9 * C(9, i - 1);
... | ALGO | 0.999971 | 5.737744 |
9455aa11-1f7c-413e-85d8-bb0b5c3a63ba | malcolmreynolds/GTSAM | examples/UGM_chain.cpp | /**
* @file small.cpp
* @brief UGM (undirected graphical model) examples: chain
* @author Frank Dellaert
* @author Abhijit Kundu
*
* See http://www.di.ens.fr/~mschmidt/Software/UGM/chain.html
* for more explanation. This code demos the same example using GTSAM.
*/
#include <gtsam/discrete/DiscreteFactorGraph.h... | ALGO | 0.999381 | 7.878385 |
2c41f364-5e46-4ef1-8959-659906c69c3d | nerd-toolkit/nerd | nerd/evolution/neuroEvolution/Collections/NeuroEvolutionSelector.cpp | #include "NeuroEvolutionSelector.h"
#include <iostream>
#include <QList>
#include "Core/Core.h"
#include "Evolution/Evolution.h"
#include "Evolution/EvolutionManager.h"
#include "Evolution/World.h"
#include "Evolution/Population.h"
#include "Fitness/Fitness.h"
#include "FitnessFunctions/SurvivalTimeFitnessFunction.h"
#... | ALGO | 0.980255 | 5.901 |
1db25fcf-4415-45cd-8a70-9c4d0b23a1f8 | nerdyabhi/C-Plus-Plus | CP environment/main.cpp | #include <iostream>
using namespace std;
int main()
{
int w;
cin>>w;
if(w%2==0) cout<<"YES";
else cout<<"NO";
return 0;
} | ALGO | 0.998897 | 3.795952 |
d96904ab-a266-48eb-9000-54f6573106b0 | vitor1535/Exercicios-Cpp | algoritmo14b.cpp | #include <iostream>
#include <string>
using namespace std;
int main ()
{
char gabarito[100];
string aluno[100];
char resposta[100];
int nota[100];
int auxiliar = 0;
int mediaTurma = 0;
cout << "----------------------" << endl;
cout << "CADASTRO DE GABARITO" << endl;
cout << "-----... | ALGO | 0.972247 | 4.036882 |
529ce35d-c482-4eb4-99c6-69703ed59381 | qiqika/my_CarND-MPC-Project | src/Eigen-3.3/doc/examples/TutorialLinAlgSVDSolve.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace std;
using namespace Eigen;
int main()
{
MatrixXf A = MatrixXf::Random(3, 2);
cout << "Here is the matrix A:\n" << A << endl;
VectorXf b = VectorXf::Random(3);
cout << "Here is the right hand side b:\n" << b << endl;
cout << "The least-squares ... | ALGO | 0.999659 | 3.908823 |
4be75d9d-52a3-42ee-8bd1-9e8e6167c89e | ConstantinPeticila/PA | lab3/task-1/main.cpp | #include <fstream>
#include <iomanip>
#include <vector>
#include <algorithm>
using namespace std;
#define INF 9999
class Task {
public:
void solve() {
read_input();
print_output(get_result());
}
private:
int n, S;
vector<int> v;
void read_input() {
ifstream fin("in");
fin >> n >> S;
// printf("%d\n",... | ALGO | 0.999853 | 3.537246 |
c1ba0d86-9420-42a5-aa15-567f5fd322ae | Phitan27/ENGCE117 | LAP/LAP6/6-6.cpp | #include <stdio.h>
#include <stdlib.h>
struct Node {
int Data;
struct Node *Next;
struct Node *Back;
} typedef N;
void AddNode(N **, int *Data);
void InsertNode(N **, int *Data, int *pos);
void DeleteNode(N **, int *pos);
void SwapNode(N **, int *pos1, int *pos2);
void ShowFront(N **);
void ShowBack(N **)... | ALGO | 0.999825 | 4.850146 |
55db6823-ecbf-4893-a057-df44be5e1945 | vivek081202/DSA | sumeven.cpp | #include <iostream>
using namespace std;
int main(int argc, char const *argv[])
{
int even = 2, i = 0, sum = 0,n;
cin>>n;
while(i < n){
sum = sum + even;
even = even + 2;
i++;
}
cout<<sum;
return 0;
}
| ALGO | 0.999682 | 4.187531 |
f0058045-801a-40e0-8744-908d7d79e5cc | powerLEO101/Work | Code/LG/LG1659/code.cpp | /**************************
* Writer : Leo101
* Problem : Luogu P1659 [国家集训队]拉拉队排练
* Tags : Manacher, Q_pow
**************************/
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#define File(s) freopen(#s".in", "r", stdin); freopen(#s".out", "w", stdout)
#define gi get_int()
... | ALGO | 0.999986 | 4.188358 |
a847a49b-6335-4c0b-a79c-b1f2e18d931b | Ayush-Pandey0/LinkedList | deletekth.cpp | #include <bits/stdc++.h>
using namespace std;
class Node {
public:
int data;
Node* next;
Node(int data, Node* next) {
this->data = data;
this->next = next;
}
Node(int data) {
this->data = data;
this->next = nullptr;
}
};
void traversal(Node* head) {
Node* te... | ALGO | 0.999984 | 5.932451 |
ce3c97f1-e168-452c-a2a9-ea98b09e177b | akiyomov/ComputerProgramming-202301-IGS1232-001 | Exercises/insertion-sort.cpp | #include <iostream>
int insertionSort(int arr[],int n){
for (int i = 1;i < n; ++i){
int key = arr[i];
int j = i - 1;
while (j >= 0 && arr[j]>key){
arr[j+1] = arr[j];
j--;
}
arr[j+1] = key;
}
}
int main() {
int arr[] = { 5, 2, 8, 12, 1, 6 };
... | ALGO | 0.999985 | 5.424988 |
62ab58e1-a566-455c-a46a-958597e8652e | iadarshanand/ISA_CB_DEC22 | Lecture03/partitionOfArrayIntoDisjointSet.cpp | #include<bits/stdc++.h>
using namespace std;
int partitionDisjoint(vector<int>& a) {
int n=a.size();
//leftMax array
// left[i]==>max elements till ith index
vector<int>leftMax(n);
leftMax[0]=a[0];
for(int i=1;i<n;i++)
{
leftMax[i]=max(leftMax[i-... | ALGO | 0.999903 | 4.923843 |
6d563777-c1a7-4f0f-a777-329ecb12fea1 | raincross7/code-similarity | codes/train_code/problem270/problem270_458.cpp | #include<iostream>
#include<cmath>
#define rep(i,a) for(int i=0;i<a;i++)
using namespace std;
int main(){
int num[101]={0};
int a,maxin=0;
while(cin>>a){
num[a]++;
maxin=max(maxin,num[a]);
}
rep(i,101){
if(num[i]==maxin)cout<<i<<endl;
}
return 0;
} | ALGO | 0.999863 | 3.480659 |
796f6142-324c-4f46-ba37-470083249c48 | AbdullahZahra/problemsolving | complexity of algorithms/A. Anton and Danik.cpp | // A. Anton and Danik
/*
Anton likes to play chess, and so does his friend Danik.
Once they have played n games in a row. For each game it's known who was the winner — Anton or Danik. None of the games ended with a tie.
Now Anton wonders, who won more games, he or Danik? Help him determine this.
Input
The first line... | ALGO | 0.999959 | 5.080087 |
f4007737-acc7-4407-9062-7756273e5545 | Shivendra1702/DSA | recursion/isSorted.cpp | #include<iostream>
using namespace std;
bool isSorted(int arr[],int size){
if(size==0||size==1)
return true;
if(arr[0]>arr[1])
return false;
else
return isSorted(arr+1,size-1);
}
int main(){
int arr[] = {10,20,30,40,50};
int size = 5;
if(isSorted(arr,size))
cout<<"Ar... | ALGO | 0.999819 | 4.985887 |
17de023f-61a1-492f-9225-85b7f62434dc | luqmanarifin/cp | Codeforces Round #491/e.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 25;
long long fact[N];
int cnt[N];
int st[N], tot;
long long ans;
void dfs(int i) {
if (i == 10) {
// printf("tot %d\n", tot);
// for (int p = 0; p <= 9; p++) printf("%d ", st[p]); printf("\n");
for (int start = 1; start <= 9; start++) {
... | ALGO | 0.999892 | 5.100505 |
e3ee0e93-48ce-4873-aecd-90299fee127f | gabet1337/adventofcode | day16.cpp | #include <iostream>
#include <vector>
#include <set>
#include <map>
#include <string>
using namespace std;
// children: 3
// cats: 7
// samoyeds: 2
// pomeranians: 3
// akitas: 0
// vizslas: 0
// goldfish: 5
// trees: 3
// cars: 2
// perfumes: 1
int main() {
string skip;
string key;
int val;
vector<map<string... | ALGO | 0.99811 | 3.902874 |
fa9f7d1a-6b37-46b4-8a40-426d28523313 | xbmc/atv2 | xbmc/visualizations/XBMCProjectM/libprojectM/win32-dirent.cpp | /*
Implementation of POSIX directory browsing functions and types for Win32.
Author: Kevlin Henney (<EMAIL>, <EMAIL>)
History: Created March 1997. Updated June 2003.
Rights: See end of file.
*/
#include "win32-dirent.h"
#include <errno.h>
#include <io.h> /* _findfirst and _findnext set errno iff t... | TOOL | 0.942735 | 6.439903 |
a7659d69-0f31-43a5-8e0f-03851d5a522c | KDAC-80153/CPP | ASSIGNMENT_cpp8/assn8.2.cpp |
// Q2. Modify Stack class from previous assignment to implement copy constructor and overload = operator.
#include <iostream>
using namespace std;
class stack
{
private:
int top;
int size;
int *arr = new int[size];
public:
stack() : top(-1), size(5)
{
}
stack(int size)
{
thi... | ALGO | 0.919187 | 4.624546 |
adc8ef10-03ec-4f15-bf1f-813bb0fcb4ca | am0654/Basic-codes | CheckPalindromeOrNot.cpp | #include <iostream>
using namespace std;
bool checkPalindrome(char a[],int n){
int s=0;
int e=n-1;
while(s<=e){
if(a[s]==a[e]){
s++;
e--;
}else{
return 0;
}
}
return 1;
}
int getLength(char name[]){
int count=0;
for(int i=0;name[i]!=... | ALGO | 0.998874 | 3.948643 |
fc51e05d-b7d0-4427-987a-35980d660525 | cyp0633/homework | CSP-Training/2/10.spellechecker.cpp | //拼写检查 POJ 1035
#include <cstdio>
#include <iostream>
using namespace std;
bool checkReplace(const string &a, const string &b);
bool checkDelete(const string &a, const string &b);
int main()
{
string dict[10000], temp;
int dictCount = 0, i;
while (getline(cin, temp))
{
if (temp == "#")
{... | ALGO | 0.998455 | 3.607174 |
d63cd58b-fb0b-4029-8275-93806647a86d | TyposBro/UNIST | advanced/assignment-2/main.cpp | #include <iostream>
#include <cmath>
#include <limits> //std::numeric_limits
#include "array.h"
#include <iomanip>
void print_daily_highs(double *values, size_t length)
{
using namespace std;
cout << "Daily highs" << endl
<< "==========="
<< endl;
for (size_t i = 0; i < length; i++)
{... | ALGO | 0.993146 | 4.86169 |
daa74836-1be1-40a2-bd64-5b045fbe84df | nolandonley14/csc245 | Lab6/radixS.cpp | #include <iostream>
#include <cstdlib>
#include <queue>
#include <vector>
#include <string>
#include <math.h>
using namespace std;
int maxElemLength(const vector<string> &v); //Return # of chars of largest string in v
char GetChar(string entry, int k); // Return the kth char of entry
vector< queue<string> > ItemsToQu... | ALGO | 0.999684 | 4.672157 |
877ba095-2f43-47b9-8490-27d308851d87 | rohith2506/Algo-world | ibibo/unique_char/unique.cpp | #include <iostream>
#include <stdio.h>
#include <vector>
#include <algorithm>
#include <cstring>
#include <string>
#include <cmath>
using namespace std;
bool IsUnique(string str) {
/*
Here, we assume string contains only ASCII characters.
If it is greater than 256 characters, return false (duplicate character... | ALGO | 0.999805 | 4.560751 |
b5079613-6caa-4a30-ab94-a9751f94f975 | rdstihz/Learning-and-Coding | src/LYD-BOOK/LYD-CH4/ACW206.cpp | #include <cctype>
#include <cstring>
#include <iostream>
#include <vector>
using namespace std;
typedef long long LL;
typedef vector<LL> vec;
typedef vector<vec> mat;
int n, m, t, act;
char M[12][12];
char ops[12][12], len[12];
mat A, B[61];
inline int id(int x, int y) {
int res = (x - 1) * m + y;
if (res ... | ALGO | 0.999925 | 4.404851 |
fb043c01-42e3-4a42-878c-96180c678ad0 | CODE-U-S/Coding_Test_Study | 3st/Jaeyoung/두 수의 나눗셈.cpp | #include <string>
#include <vector>
using namespace std;
int solution(int num1, int num2) {
return ( float(num1) / num2 )* 1000;
} | ALGO | 0.989306 | 4.457905 |
dd02ee2b-ebd8-4b46-9c24-6470879cab85 | VAR-solutions/Algorithms | Mathematics/reverse number/reverse-number.cpp | #include <bits/stdc++.h>
using namespace std;
long long reverse_number(long long n) {
long long res = 0;
while(n > 0) {
res = res*10 + n % 10;
n /= 10;
}
return res;
}
int main() {
long long n; cin >> n;
cout << reverse_number(n);
}
| ALGO | 0.99992 | 5.525152 |
c957af61-aced-460f-a345-aeb92b1a69be | SpMV-Opt/spmv | src/csc_omp.cpp | /*
* CSC(Compressed Sparse Column) format for sparse matrix.
*
*/
#ifdef OMP
#include <omp.h>
#endif
// N: columns of sparse matrix
// nz_vals: non-zero elements of sparse matrix
// x: source vector, it has N x 1 double elements
// y: destination vector, it has M x 1 doule elements
void csc(const int &N, double *... | ALGO | 0.991053 | 3.121077 |
1028a6cd-ad79-4a0b-8260-d8d65b0ea6ee | partho222/programming | lightOJ/loj1123.cpp | /* Tariq ahmed khan - Daffodil */
#include <bits/stdc++.h>
#define _ ios_base::sync_with_stdio(0);cin.tie(0); // I/O optimization
#define pi 2*acos(0.0)
#define scan(x) scanf("%d",&x)
#define sf scanf
#define pf printf
#define pb push_back
#define memoclr(n,x) memset(n,x,sizeof(n) )
#define INF 1 << 30
typedef long... | ALGO | 0.99984 | 4.030291 |
a8c182c5-8350-4d34-8adc-98999c859c39 | jbush001/NyuziToolchain | lib/Transforms/IPO/Inliner.cpp | #include "llvm/Transforms/IPO/Inliner.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/None.h"
#include "llvm/ADT/Optional.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/ADT/StringR... | TOOL | 0.883281 | 4.790247 |
570771a8-bf85-4a12-b75d-878c3a219a51 | manikanta2901/ubuntu | .history/HashCode/A_20210226003625.cpp | #include<bits/stdc++.h>
#include<vector>
#include<iostream>
#include<cmath>
#include<algorithm>
#include<iterator>
#include<string>
#include<map>
#define vv vector
#define F first
#define S second
#define MP make_pair
#define EXECUTE_FASTER ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define printM... | ALGO | 0.999858 | 4.000075 |
a35d639c-91f9-4b1a-b28b-57d11edb741b | manikanta2901/ubuntu | .history/codingChallenges/cpp/Codechef/longChallenges/july/ChefinaAndSwaps_20200705170949.cpp | #include<bits/stdc++.h>
#include<vector>
#include<iostream>
#include<cmath>
#include<algorithm>
#include<iterator>
#include<string>
#include<map>
#include<unordered_map>
#define F first
#define S second
#define MP make_pair
#define EXECUTE_FASTER ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define ... | ALGO | 0.999965 | 3.223217 |
0af489e2-4b07-4d8f-8f88-fe2259821cad | tukl-msd/finance.americanoption.zynq.hls | HLS/LSRegDataCol/LSRegDataCol_Accum/accumWrapper_tb.cpp | #include "accumWrapper_hls.hpp"
#include "accumulator_hls.hpp"
#include <stdio.h>
//-----------------------
#include <hls_stream.h>
#include <stdlib.h>
#include <stdint.h>
//-----------------------
#define STEPSMC 10
#define PATHSMC 100
// -----------------------------------------------------------
void accumSW( con... | ALGO | 0.988792 | 3.804903 |
f9b4cb6a-a6f1-4cac-9f01-7acd99841570 | Gianmarco2002/IO2 | ojio/PERT.cpp | #include<iostream>
#include <string.h>
typedef class Activity2
{
public:
char Id[5];
float duracion;
int Est;
int Lst;
int Eet;
int Let;
struct Activity2 *Sucesores[100];
struct Activity2 *Predecesores[100];
}actividades2;
int na2,critico2;
actividades2 *List[100],*check,*che... | ALGO | 0.990692 | 3.013993 |
92fa4d0c-809f-4115-bef6-405af769a785 | coutamg/mongodb | mongo/src/mongo/db/exec/projection_exec.cpp | #include "mongo/db/exec/projection_exec.h"
#include "mongo/bson/mutable/document.h"
#include "mongo/db/exec/working_set_computed_data.h"
#include "mongo/db/matcher/expression.h"
#include "mongo/db/matcher/expression_parser.h"
#include "mongo/db/query/collation/collator_interface.h"
#include "mongo/db/query/query_reque... | TOOL | 0.892084 | 7.922678 |
8522d199-79c4-4914-bf42-86395e6fecb8 | Utkarsh-Nanda/Competitive | Graphs/LCA_Dist_bet_two_nodes.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define boost \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(NULL)
#define testcases \
int t; \
cin >> t; \
while (t--)
#define rep(i, j, k) for (int i = j; ... | ALGO | 0.999975 | 4.553459 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.