uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
14fe4254-d9ab-4c45-9da4-8ce5d86c6c18 | isaaclino/quick-merge-sort | main.cpp | #include <iostream>
#include <vector>
#include <string>
#include <fstream>
#include <sstream>
#include <stdlib.h>
#include "Quicksort.H"
#include "Mergesort.H"
using namespace std;
int main(int argc, const char * argv[]) {
// definition of pivots
string first = "first";
string random = "random";
... | ALGO | 0.988752 | 5.253777 |
65b12e1d-523a-4370-a1d4-01b678690f1f | ishandutta2007/codeforces | imeimi/normal/853/B.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <deque>
using namespace std;
typedef long long llong;
struct flight {
int day;
int city;
int cost;
bool operator<(const flight &x) const {
return day < x.day;
}
bool operator!=(const flight &x) const {
return day != x.day || city != x.city ... | ALGO | 0.999975 | 3.781361 |
42b2c7fe-1ae5-4483-857f-b8cd3143fcf9 | jjoonleo/baekjoon | baekjoon/8980_택배.cpp | /**/
#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <queue>
using namespace std;
struct Package {
int send;
int recieve;
int boxNumber;
};
bool compare(const Package& p1, const Package& p2) {
if (p1.recieve == p2.recieve) {
return p1.send > p2.send;
}
else
... | ALGO | 0.999933 | 4.563456 |
e3a39446-63be-4a77-a95c-e38dc183fd74 | farzamdorostkar/amon | llvm-project-17.0.6.src/llvm/lib/DebugInfo/CodeView/TypeRecordMapping.cpp | #include "llvm/DebugInfo/CodeView/TypeRecordMapping.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/DebugInfo/CodeView/CVTypeVisitor.h"
#include "llvm/DebugInfo/CodeView/CodeViewRecordIO... | TOOL | 0.91775 | 7.418917 |
d067055f-4cd8-42c9-8706-c5463aa656d7 | h1542462994/homework.gallery | computer science/cppfirst/homework26.cpp | #include<iostream>
using namespace std;
void getrow_maxofsquare(int(*n)[3], int re[])
{
for (int i = 0; i < 3; i++)
{
int max = **n;
for (int j = 1; j < 3; j++)
{
if (*(*n + j) > max)
{
max = *(*n + j);
}
}
re[i] = max;
if (i < 2)
{
n++;
}
}
}
int main()
{
cout << "求3*3矩阵每行最大值" << e... | ALGO | 0.999905 | 3.588911 |
bfbbf309-bf66-41e3-b7e1-a5da23af39f8 | raincross7/code-similarity | codes/train_code/problem026/problem026_430.cpp | #include<iostream>
using namespace std;
int main()
{
int a,b;
cin>>a>>b;
if(a==1 && b!=1)
{
cout<<"Alice"<<endl;
}
else if(b==1 && a!=1)
{
cout<<"Bob"<<endl;
}
else if(a!=1 && b!=1 && a>b)
{
cout<<"Alice"<<endl;
}
else if(a!=1 && b!=1 && b>a)
{... | ALGO | 0.999975 | 3.135138 |
1167b1d2-e3b7-434f-b99d-2fa5d9d2f2ac | nikolapesic2802/Programming-Practice | Codeforces Round #568 (Div. 2)/D.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/rope>
#define ll long long
#define pb push_back
#define sz(x) (int)(x).size()
#define mp make_pair
#define f first
#define s second
#define all(x) x.begin(), x.end()
#define D(x) cerr << #x << " is " <<... | ALGO | 0.999964 | 3.523423 |
61c40534-818f-489a-8553-22c4e1d2e3f6 | AlgoSeoLee/backjooncpp | Project1/11659/11659.cpp | //https://www.acmicpc.net/problem/11659
//ǥ
#include <iostream>
using namespace std;
int N, M, pSum[100001];
int main() {
ios_base::sync_with_stdio(false);
cout.tie(NULL); cin.tie(NULL);
cin >> N >> M;
for (int i = 0; i < N; ++i) {
int A;
cin >> A;
pSum[i + 1] = pSum[i] + A;... | ALGO | 0.999956 | 5.10532 |
9f34f387-3e68-4963-bbb3-04f4a8aaf97f | gauarj2320/Arrays | arrayIntro.cpp | #include <iostream>
int main() {
int numbers[10] {1, 2, 3, 4, 5, 6, 7, 8, 9, 7};
for (int i = 0; i < 10; i++) {
std::cout << numbers[i] << '\n';
}
}
| ALGO | 0.9911 | 3.37633 |
41fd26ba-80b9-426d-8b15-5054e0757973 | pawan-nirpal-031/Algorithms-And-ProblemSolving | Active/CodeForces/A_Tanya_and_Stairways.cpp | // Problem Link :
#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long int ull;
typedef long long int ll;
typedef long double ld;
#define Mod 1000000007
#define Infinity (ll)1e18
#define Append(a) push_back(a)
#define Pair(a,b) make_pair(a,b)
#define Clear(a) for(ll &x : a){x=0;}
#define Point(x) s... | ALGO | 0.999983 | 3.798936 |
eaad60ee-2ba8-4437-aafa-dfdc7e76dab7 | Lunexa-Project/Lunexa | src/daemon/main.cpp | #include "common/command_line.h"
#include "common/scoped_message_writer.h"
#include "common/password.h"
#include "common/util.h"
#include "cryptonote_core/cryptonote_core.h"
#include "cryptonote_basic/miner.h"
#include "daemon/command_server.h"
#include "daemon/daemon.h"
#include "daemon/executor.h"
#include "daemonize... | TOOL | 0.896126 | 6.785266 |
7a5b176d-3ce6-47fe-bb9e-3e4915c3aedc | THU-DSP-LAB/llvm-project | libc/src/math/generic/nextafterf.cpp | #include "src/math/nextafterf.h"
#include "src/__support/FPUtil/ManipulationFunctions.h"
#include "src/__support/common.h"
namespace __llvm_libc {
LLVM_LIBC_FUNCTION(float, nextafterf, (float x, float y)) {
return fputil::nextafter(x, y);
}
} // namespace __llvm_libc
| TOOL | 0.933945 | 4.889169 |
c02b5935-8a46-4893-869d-5df801b3e007 | manishgoyal30/Data_Structure | GFG/Ques_Sorting/intersections.cpp |
#include <bits/stdc++.h>
using namespace std;
int inter(int arr1[], int arr2[], int N, int M){
int i=0, j=0;
while(i<N && j<M){
if(i>0 && arr1[i]==arr1[i-1]){
i++;
continue;
}
if(arr1[i]<arr2[i]){
i++;
}
else if(arr1[i]>arr2[j]){
... | ALGO | 0.999957 | 3.568831 |
054c7272-ff37-4210-90ab-a2cb4b4ceac3 | Yang-Ho/Competitive | USACO/done/ride.cpp | /*
ID: yho1
PROG: ride
LANG: C++
*/
#include <iostream>
#include <fstream>
#include <string>
using namespace::std;
int main() {
ofstream fout("ride.out");
ifstream fin("ride.in");
string line1;
string line2;
fin>>line1;
fin>>line2;
int group = 1;
int comet = 1;
for (int i... | ALGO | 0.999945 | 3.52479 |
83a619e6-2538-4f2c-b8b9-0ca54415a50b | LroseC/OI | Luogu/P2152/main.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long LL;
const int BASE = 1e9;
class BigInt
{
private:
int len;
vector<int> val;
void maintain(void)
{
len = val.size();
for (int i = len - 1; i >= 0; --i) {
if (val[i]) break; --len;
}
val.resize(len);
}
int& operator[](int x)
{
return v... | ALGO | 0.999897 | 4.422865 |
33a8adfa-d92a-4677-9ffb-99ce9be7785a | RaulitoGC/competitive-programming | online-judge/codeforces/B. Ilya and Queries.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
string ss;
int n,m,temp,l,r;
while(cin>>ss){
scanf("%d",&m);
n = ss.size();
int v[n+2];
temp = 0;
v[1] = 0;
for(int i=1;i<n;i++){
if(ss[i]==ss[i-1]) temp++;
v[i+1] = temp;
}
while(m--){
scanf("%d %d",&l,&r);
printf("%d\n",v[r] -... | ALGO | 0.999514 | 3.806267 |
4ddb0a18-e562-4fbb-b182-bf994222ab50 | domcode4em/LeetCode-Grind | Solutions/Arrays/136_Single_Number.cpp | /*
Given a non-empty array of integers nums, every element appears twice except for one. Find that single one.
You must implement a solution with a linear runtime complexity and use only constant extra space.
Example 1:
Input: nums = [2,2,1]
Output: 1
Example 2:
Input: nums = [4,1,2,1,2]
Output: 4
Example 3:
Input: ... | ALGO | 0.999954 | 6.077009 |
f7c8c4b3-7f04-4c64-b26b-57e4bfa89e6c | occidere/leetcode | Challenge/June_LeetCoding_Challenge/Week_2:_June_8th–June_14th/75_Sort_Colors/Solution.cpp | #include <cstdio>
#include <vector>
using namespace std;
class Solution {
public:
void sortColors(vector<int>& nums) {
// Algorithm of Dutch National Flag Problem by Dijkstra
// ref: https://en.wikipedia.org/wiki/Dutch_national_flag_problem
int top_of_underclass = 0;
int top_of_midd... | ALGO | 0.99986 | 5.855426 |
22262ada-3fef-4dbf-8936-385f596b4da8 | kingkk31/BOJ | source code/1495_기타리스트.cpp | #include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <queue>
#include <vector>
#include <stack>
#include <set>
#include <map>
#include <list>
#include <string>
#include <string.h>
#include <math.h>
#include <algorithm>
#include <malloc.h>
#include <functional>
#include <time.h>
#include <cctype>
#pragma ... | ALGO | 0.999986 | 3.710183 |
7e5cb2b7-6e21-4908-8048-0c486069a6ea | Mahin-GitHub/Compitative_Programming | N_Shift_Zeros.cpp | #include <bits/stdc++.h>
using namespace std;
void fun(int n, int arr[])
{
for (int i = 0; i < n; i++)
{
for (int j = i + 1; j < n; j++)
{
if (arr[i] <= arr[j])
{
int temp = arr[i];
arr[i] = arr[j];
arr[j] = temp;
... | ALGO | 0.999964 | 4.387184 |
5f30912a-3882-45ac-9ae9-f6e8516a4754 | Viraj1975/DSA_C- | PW_Decode/Sorting_Algorithms/merge_sort.cpp | #include<bits/stdc++.h>
using namespace std;
void merge(vector<int>&v,int start,int mid,int end){
// forming temporary vectors of reqd size;
vector<int>a(mid-start+1);
vector<int>b(end-mid);
for(int i=0;i<a.size();i++){
a[i] = v[start+i];
}
for(int i=0;i<b.size();i++){
b[i] = v[... | ALGO | 0.99999 | 4.994869 |
731584b2-8007-4dec-9401-b04cc489cb08 | zahinwahab/Direct-Vector-Routing-DVR-Implementation-CSE322 | Source code/router.cpp | #include <cstdio>
#include <cstring>
#include <cstdlib>
#include <vector>
#include <set>
#include <iostream>
#include <fstream>
#include <string>
#include <bits/stdc++.h>
#include <arpa/inet.h>
#include <sys/socket.h>
#include <unistd.h>
using namespace std;
#define INF 99999
int bytes_received;
int sockfd;
class Ro... | ALGO | 0.975963 | 3.18372 |
902f6b5b-2dda-4066-b1e4-07ef078d20b0 | Abhinavchad/UBI | Abhinav_chaudhary-project-1_inferencing/src/edge-impulse-sdk/tensorflow/lite/micro/kernels/sub.cpp | #include "edge-impulse-sdk/tensorflow/lite/micro/kernels/sub.h"
#include "edge-impulse-sdk/tensorflow/lite/c/builtin_op_data.h"
#include "edge-impulse-sdk/tensorflow/lite/c/common.h"
#include "edge-impulse-sdk/tensorflow/lite/kernels/internal/common.h"
#include "edge-impulse-sdk/tensorflow/lite/kernels/internal/quanti... | ALGO | 0.959176 | 7.838318 |
64fc1cbe-0ffe-433c-bd71-9f4a0866958f | AmrARaouf/algorithm-detection | graph-source-code/34-D/790940.cpp | //Language: GNU C++
#include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <cstring>
#define MAXN 50005
using namespace std;
int n, ai, ri, pi, pos, items[MAXN];
bool used[MAXN];
vector<int> graph[MAXN];
... | ALGO | 0.999984 | 3.143523 |
5a7c9146-a666-48d7-914a-a5b57c310745 | Ankesh-Kushwaha/DATA-STRUCTURE_UPDATED | 2Darray/staircasealgo.cpp | #include <iostream>
using namespace std;
bool stair_case(int arr[][4],int n ,int m,int key){
int row=0,numrow=4;
int numcol=4,col=3;
while(row<numrow && col>=0){
if(arr[row][col]==key){
return true;
}
if(arr[row][col]<key){
row++;
}
... | ALGO | 0.999294 | 3.487775 |
95f4fc2b-bce9-45cf-8a8d-cf0e99afb90e | xymxyz/DUCKDB-API | third_party/fsst/fsst_avx512.cpp | #if DUCKDB_FSST_ENABLE_INTRINSINCS && (defined(__x86_64__) || defined(_M_X64))
#include <immintrin.h>
#ifdef _WIN32
bool duckdb_fsst_hasAVX512() {
int info[4];
__cpuidex(info, 0x00000007, 0);
return (info[1]>>16)&1;
}
#else
#include <cpuid.h>
bool duckdb_fsst_hasAVX512() {
int info[4];
__cpuid_count(0x00000007, 0... | ALGO | 0.90121 | 6.182903 |
73e415b4-6f2c-4f80-826f-f8fa3aa18ec0 | vrangr1/competitive-programming | contests/codeforces/cf_rounds/cf_round_9--/codeforces_913_div3/c.cpp | /***************************************************
* Author : Anav Prasad
* Nick : vrangr
* Created : Tue Dec 5 20:26:30 IST 2023
****************************************************/
#include <iostream>
#include <vector>
#include <string.h>
#include <ctype.h>
#include <set>
#include <stdlib.h>
#include <map>
#i... | ALGO | 0.999995 | 4.315758 |
1ac671b5-522c-478d-8f50-a800f0d8943e | pranavjawale01/cp.exe | LeetCode/1310-xor-queries-of-a-subarray/1310-xor-queries-of-a-subarray.cpp | class Solution {
public:
vector<int> xorQueries(vector<int>& arr, vector<vector<int>>& queries) {
int n = arr.size();
for (int i = 1; i < n; i++) {
arr[i] ^= arr[i-1];
}
int m = queries.size();
vector<int> ans(m, 0);
for (int i = 0; i < m; i++) {
... | ALGO | 0.99998 | 5.948661 |
ec41f207-ea78-493c-adc4-cc0971d182ca | sean-chester/SkyBench | src/qflow/qflow.cpp | /*
* qflow.cpp
*
* Created on: Feb 12, 2014
* Author: schester
*/
#include "qflow/qflow.h"
#include <cstdio>
#include <cassert>
#if defined(_OPENMP)
#include <omp.h>
#include <parallel/algorithm>
#else
#include <algorithm>
#define omp_get_thread_num() 0
#define omp_set_num_threads( t ) 0
#endif
QFlow::QF... | ALGO | 0.997818 | 4.831586 |
9217ceed-7865-413d-8da7-4e106b947e74 | Riczzoe/CS106B | Section/section_3/GUI/GUIUtils.cpp | #include "GUIUtils.h"
#include "gobjects.h"
#include "filelib.h"
#include <sstream>
#include <vector>
#include <cmath>
using namespace std;
namespace {
/* Multiplier of the line height to use between natural linebreaks. */
const double kLineSpacing = 1.1;
/* Multiplier of the line height to use between pa... | TOOL | 0.954258 | 6.357454 |
5eab5400-0200-4f7b-8221-a423e63c487b | poshithNandyala/cp-pratice | anonymous/TLE/1200/C_Stable_Groups.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define endl '\n'
#define fastio \
ios_base::sync_with_stdio(false); \
cin.tie(nullptr);
int main()
{
fastio
ll n,
k, x;
cin >> n >> k >> x;
vector<ll> a(n);
for (int i = 0; i < n; i++)
... | ALGO | 0.999933 | 4.416084 |
33a58731-f425-4f46-b793-c640a293e33d | StanislavSorochak/laba6.3.1 | laba6.3.1/Source.cpp | // Lab_06_3_1.cpp
// < >
// 6.2.2
//
// 24
#include <iostream>
#include <iomanip>
#include <time.h>
using namespace std;
void create(int* a, const int size, const int Low, const int High)
{
for (int i = 0; i < size; i++)
a[i] = Low + rand() % (High - Low + 1);
}
void Print(int* a, const int ... | TOOL | 0.901045 | 4.632289 |
dccfa4b6-dedf-467a-80af-a01684d557aa | vinayakchandra/DSA-cpp | linked-List/linkedList.cpp | #include <iostream>
using namespace std;
class Node {
public:
int data;
Node *next;
//constructor
Node(int data) {
this->data = data;
this->next = NULL;
}
//destructor
~Node() {
int value = this->data;
//freeing the memory
if (this->next != NULL) {... | ALGO | 0.998855 | 5.076377 |
35861614-5fbc-4d05-bd2a-235142778dc2 | notacallforhelp/cses | dp/ad.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define int long long
typedef long long ll;
typedef long double ld;
//ordered_sets
template <typename T>
using ordered_set = tree<T,null_type,less<T>,rb_tree_tag,tre... | ALGO | 0.999963 | 5.286203 |
58b89e89-270f-438c-87fb-475e24077fb6 | LimHyun-ji/CodingTest | 두 정수 사이의 합.cpp | #include <string>
#include <vector>
using namespace std;
long long solution(int a, int b) {
long long answer = 0;
answer = (a + b) * abs(b - a + 1) / 2;
return answer;
}
/*
#include <string>
#include <vector>
using namespace std;
long long solution(int a, int b) {
long long answer = 0;
if... | ALGO | 0.999781 | 4.844779 |
b1231f4f-e359-4df9-b1f7-c4757a48b656 | Experiment5X/CryptoFunctionDetection | crypto_implementations/cryptopp/basecode.cpp | // basecode.cpp - originally written and placed in the public domain by Wei Dai
#include "pch.h"
#include "config.h"
#if CRYPTOPP_MSC_VERSION
# pragma warning(disable: 4100)
#endif
#if CRYPTOPP_GCC_DIAGNOSTIC_AVAILABLE
# pragma GCC diagnostic ignored "-Wunused-value"
#endif
#ifndef CRYPTOPP_IMPORTS
#include "basec... | TOOL | 0.951118 | 7.281364 |
51a048f0-fe20-4669-8d51-0661d572b752 | Varshini11113/TechDose_Training | 209-minimum-size-subarray-sum/minimum-size-subarray-sum.cpp | class Solution {
public:
int minSubArrayLen(int target, vector<int>& nums) {
int n = nums.size();
int left = 0, right = 0, ans = 0, minSub = INT_MAX;
while(right < n){
ans += nums[right];
if(ans >= target){
while(ans >= target){
ans... | ALGO | 0.999995 | 6.465762 |
c5809104-167a-4cfe-a0a2-a8bb88e2f8e8 | tahsinrahman/uva | 12144.cpp | #include <bits/stdc++.h>
using namespace std;
int n, dis[502], graph[502][502];
vector <int> parent[502];
struct data {
int city, dist;
bool operator < (const data &p) const {
return dist > p.dist;
}
};
void remove_path(int source)
{
for(int i = 0; i < parent[source].size(); i++) {
graph[parent[source][i]][s... | ALGO | 0.999906 | 3.91586 |
91493fd6-0759-4bae-bd9c-179cf5f35596 | tomswinburne/tammber | core/NeighborList.cpp | #include "NeighborList.hpp"
#include "BoundaryConditions.hpp"
#include <array>
#include <numeric>
#include <cmath>
#include <set>
std::vector<std::vector<int> > generateShifts(int nDim,int iMin,int iMax, int increment, std::vector<std::vector<int> > shifts){
std::vector<std::vector<int> > exp;
if(shifts.size()==0)... | ALGO | 0.999248 | 4.312486 |
ddba9f12-1b79-4370-bd8f-3804aca9dd64 | Emysanto/DSA-2024 | stack_array.cpp | #include <iostream>
using namespace std;
class myclass
{public:
void create(int n)
{
int stack[n];
int top=-1;
cout<<"enter elements for the stack";
for(int i=0;i<n;i++)
{
top++;
cin>>stack[top];
}
int r=n+1;
display(n,stack... | ALGO | 0.975516 | 3.47386 |
13cc1fe3-21b6-4ca0-804d-e2c26169bb41 | Lakshit2604/CPP_Practice | Step4-Lec2/4.2.14_kthElementInArray.cpp | # include <iostream>
# include <vector>
using namespace std;
// Optimal
class Solution {
public:
int kthElement(vector<int>& a, vector<int>& b, int k) {
// code here
int n1 = a.size();
int n2 = b.size();
if (n1 > n2) return kthElement(b,a,k);
int n = n1 + n2;
int l... | ALGO | 0.999989 | 4.877775 |
caa02439-c175-4a3e-bdd4-b77fb526badd | MilosS2024/godot | thirdparty/embree/kernels/bvh/bvh.cpp | #include "bvh.h"
#include "bvh_statistics.h"
namespace embree
{
template<int N>
BVHN<N>::BVHN (const PrimitiveType& primTy, Scene* scene)
: AccelData((N==4) ? AccelData::TY_BVH4 : (N==8) ? AccelData::TY_BVH8 : AccelData::TY_UNKNOWN),
primTy(&primTy), device(scene->device), scene(scene),
root(emptyN... | ALGO | 0.878892 | 7.064544 |
6b4382ec-7f4b-45cd-a88e-917a888589b5 | wenching33/leetcodePrac | bubbleSort/main.cpp | #include <iostream>
#include <vector>
using namespace std;
int solution(vector<int> &A);
int main(){
vector<int> a;
a.push_back(1);
a.push_back(2);
a.push_back(3);
a.push_back(4);
int ans=solution(a);
cout<<"ans is "<<ans<<endl;
return 0;
}
int solution(vector<int> &A) {
// write your code in C++14 ... | ALGO | 0.999907 | 4.291832 |
96ed97eb-7623-4801-9688-bf43fac046d8 | Nilesh219/Leetcode_DSA_100days | Maximal_rectangle_85.cpp | class Solution {
public:
int maximalRectangle(vector<vector<char>>& matrix) {
if (matrix.empty()) return 0;
int m = matrix.size();
int n = matrix[0].size();
vector<vector<int>> dp(m, vector<int>(n, 0));
int maxArea = 0;
// Fill the dp array with t... | ALGO | 0.999948 | 6.996465 |
6aa93751-fcfc-43b9-9cb6-ac1dc97de969 | prakhar7017/DSA-CPP | Graphs/DSU/DSU.cpp | vector<int> rank;
vector<int> parent;
int findParent(int node, vector<int> &parent)
{
if (node == parent[node])
{
return node;
}
return parent[node] = findParent(parent[node], parent);
}
void unionSet(int u, int v, vector<int> &parent, vector<int> &rank)
{
u = findParent(u, parent);
v = ... | ALGO | 0.999965 | 4.53123 |
7c4f00ac-34e6-4660-bce7-86a7bd3dfbd0 | wwwllm/C-- | codeforces/div.3(1029)2025.6.8/E.cpp | #include <bits/stdc++.h>
#define int long long
using namespace std;
void solve()
{
int n;
cin >> n;
vector<int> a(n), b(n);
for (auto &x : a)
cin >> x;
for (auto &x : b)
cin >> x;
int pos = 0;
for (int i = 0; i < n; i++)
if (a[i] == b[i])
pos = i;
vec... | ALGO | 0.999978 | 4.804491 |
dd0990cc-0a1a-4d7b-a69f-a39acccf5657 | Vokkels/Drone_Automation-Border_Patrol | opencv/samples/cpp/tutorial_code/gpu/gpu-basics-similarity/gpu-basics-similarity.cpp | #include <iostream> // Console I/O
#include <sstream> // String to number conversion
#include <opencv2/core.hpp> // Basic OpenCV structures
#include <opencv2/core/utility.hpp>
#include <opencv2/imgproc.hpp>// Image processing methods for the CPU
#include <opencv2/imgcodecs.hpp... | TOOL | 0.948816 | 5.459361 |
118f9c72-a709-4573-ac10-5bfe127cd462 | FFMG/myoddweb.piger | myodd/boost/libs/multiprecision/example/floating_point_examples.cpp | #include <boost/math/constants/constants.hpp>
#include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/math/special_functions/gamma.hpp>
#include <boost/math/special_functions/bessel.hpp>
#include <iostream>
#include <iomanip>
#if !defined(BOOST_NO_CXX11_HDR_ARRAY) && !defined(BOOST_NO_CXX11_LAMBDAS)
#includ... | TOOL | 0.996415 | 7.001774 |
7db3e942-42ea-4757-a3d5-5497bbc6efff | jo3-l/cp-practice | src/main/cpp/binarysearch/bipartite_graph.cpp | #include <bits/stdc++.h>
using namespace std;
template <class Fun> class y_combinator_result {
Fun fun_;
public:
template <class T> explicit y_combinator_result(T &&fun) : fun_(std::forward<T>(fun)) {}
template <class... Args> decltype(auto) operator()(Args &&...args) { return fun_(std::ref(*this), std::forward<A... | ALGO | 0.999859 | 5.586346 |
82931b8e-892b-4df6-9e9f-5d590be7bc30 | bhrtsnegi/LeetCheat | cpp/1642.cpp | /*
You are given an integer array heights representing the heights of buildings, some bricks, and some ladders.
You start your journey from building 0 and move to the next building by possibly using bricks or ladders.
While moving from building i to building i+1 (0-indexed),
If the current building's height is great... | ALGO | 0.999982 | 6.440394 |
f45e819e-b2a1-42d6-9001-97456c4a5d46 | abdullah-nadim/DSA_CPP | heapSort.cpp | #include<iostream>
using namespace std;
void heapify(int *arr,int n,int p)
{
int largest = p;
int l = 2*p+1;
int r = 2*p+2;
if(l<n && arr[largest]<arr[l])
largest=l;
if(r<n && arr[largest]<arr[r])
largest=r;
if(largest!=p)
swap(arr[largest],arr[p]);
if(p<n)
... | ALGO | 0.999978 | 4.999253 |
b5675c44-5d2f-4f5b-8927-cdbb0a75b5a7 | doublethefish/tmap_ogdf | test/src/basic/heap.cpp | #include <vector>
#include <queue>
#include <set>
#include <algorithm>
#include <numeric>
#include <ogdf/basic/comparer.h>
#include <ogdf/basic/graph_generators.h>
#include <ogdf/basic/PriorityQueue.h>
#include <ogdf/graphalg/Dijkstra.h>
#include <ogdf/basic/heap/BinaryHeap.h>
#include <ogdf/basic/heap/BinomialHeap.h... | TEST | 0.932192 | 5.508308 |
8431ce23-9504-46d5-b40a-685a34fbdd73 | Adrien-LACROIX/myPacman | src/pacman/src/Doc_Prof/game.cpp | #include <iostream>
#include "src/pacman/headers/Doc_Prof/game.h"
#include "src/pacman/headers/Doc_Prof/params.h"
#include "src/pacman/headers/Doc_Prof/gridmanagement.h"
#include <map>
using namespace std;
template <class T, class U>
void ShowMap (const map<T,U> & AMap){
for (const pair <T,U> & Val : AMap) ... | TOOL | 0.89591 | 3.281087 |
143056be-c93e-472e-be4c-82820828cc6b | eeeeeeeeeeeeasyhun/cotestudy | cote0901/15649.cpp | #include<iostream>
using namespace std;
#define Max 9
int N, M;
int arr[Max];
bool visited[Max];
void dfs(int num, int k)
{
if (k == M)
{
for (int i = 0; i < M; i++)
{
cout << arr[i] << " ";
}
cout << endl;
}
else
{
for (int i = num; i < N; i++)
{
if (!visited[i])
{
visited[i] = true;
... | ALGO | 0.99992 | 3.770875 |
c11d8352-1415-4253-a67a-911aa4759e56 | ammarhakim/gkeyll1 | slvrs/LcSOLGeneralIntegralAtNodeCalc.cpp | /**
* @file LcSOLGeneralIntegralAtNodeCalc.cpp
*
* @brief Compute an integral at each node in configuration space using a (v,mu) integration
*/
// config stuff
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
// lucee includes
#include <LcSOLGeneralIntegralAtNodeCalc.h>
namespace Lucee
{
const char *SOLGeneral... | ALGO | 0.993414 | 5.888867 |
dcf88235-d623-4a88-8113-b915989ce041 | ehnryx/acm | codeforces/1381/b.cpp | //#pragma GCC optimize("O3")
//#pragma GCC target("sse4,avx2,abm,fma,tune=native")
#include <bits/stdc++.h>
using namespace std;
#define _USE_MATH_DEFINES
#define FILENAME sadcactussociety
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
template <typename T>
u... | ALGO | 0.999968 | 4.804017 |
040d1882-7940-452d-8696-23aa3e566edc | xoovakes/noi_practices | noi 1.5 39cc.cpp | #include<cstdio>
#include<iostream>
using namespace std;
int main()
{
int n;
cin>>n;
long long total=0;int it;
for(int i=1;i<=n;i++){
if(i%7==0||i/10==7||i%10==7) continue;
it=i*i;
total+=it;
}
cout<<total;
return 0;
}
| ALGO | 0.999598 | 3.674253 |
cf6e8db7-1455-4354-979d-f99e8addd63c | ishandutta2007/codeforces | akulyat/normal/1326/D1.cpp | #include <bits/stdc++.h>
#pragma GCC optimize ("O3", "unroll-all-loops")
using namespace std;
#define F first
#define S second
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pll;
ifstream in;
ofstream out;
const long long kk = 1000;
const long long ml = kk * kk;
const ll p[2] = {123457, 239};... | ALGO | 0.999958 | 3.612383 |
5c042a58-3572-4d5d-8c8f-4d67e1e1f883 | Ngyyen/UIT_Together_Danh_sach_lien_ket_don | Du_an_1/Du_an_1.cpp | #include <iostream>
#include "Linked_list.h"
using namespace std;
int main()
{
Linked_list lst;
int n;
cin >> n;
for (int i = 0; i < n; ++i) {
int x;
cin >> x;
lst.append(x);
}
lst.Interchange_sort();
lst.print(cout);
return 0;
} | ALGO | 0.999886 | 5.165222 |
2fc84fe5-a4d5-4dde-9554-475ba1ce7538 | Bevia/RSA_Cpp | RSA_Signing/signing_no_openssl.cpp | #include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <random>
#include <iomanip>
// Function to generate a random prime number
int generatePrime(int lower, int upper) {
std::vector<int> primes;
for (int i = lower; i <= upper; ++i) {
bool isPrime = true;
for (int j =... | ALGO | 0.999713 | 6.984229 |
ea6bd3f5-a229-412a-8ac7-df8ee7bf05c7 | MPAGS-CPP-2024/mpags-software-development-with-c-course-2024-25-classroom-mpags-day-3-Day-3-Starter-Code | src/MPAGSCipher/ProcessCommandLine.cpp | #include "ProcessCommandLine.hpp"
#include <iostream>
#include <string>
#include <vector>
bool processCommandLine(const std::vector<std::string>& cmdLineArgs,
bool& helpRequested, bool& versionRequested,
std::string& inputFile, std::string& outputFile,
... | TOOL | 0.966925 | 6.787511 |
6239ca0d-6cfc-4fe5-82dc-22a7ec049ddb | jefferyyellow/UE4 | UnrealEngine-4.26/Engine/Source/ThirdParty/Intel/TBB/IntelTBB-2019u8/examples/parallel_do/parallel_preorder/parallel_preorder.cpp | #include "tbb/parallel_do.h"
#include <vector>
#include <algorithm>
#include "Graph.h"
class Body {
public:
Body() {};
//------------------------------------------------------------------------
// Following signatures are required by parallel_do
//------------------------------------------------------... | ALGO | 0.999283 | 5.855957 |
e2b50267-d0b4-4c41-bea1-57436632ec43 | R-Priyadarshi/DSA_cpp | pattern.cpp | #include<iostream>
using namespace std;
int main()
{
int n;
cin>>n;
int i=1;
while(i<=n)
{
int j=1;
while (j<=n)
{
cout<<i;
j=j+1;
}
cout<<endl;
i=i+1;
}
} | ALGO | 0.999837 | 3.758891 |
d421685a-1560-4e07-b5f7-314120203520 | Jajajou/CodeLearningProcess | CSES_DP/EDIT_DISTANCE/editDistance.cpp | /* __ (\_/)
._( .)<(MEOW) (WOOF)('V')
\____) (U U)
*/
#include <bits/stdc++.h>
using namespace std;
#define name "editDistance" //pls dont forget your task's name
#define maxn 101001
#define pri_q priority_queue
#define pf push_front
#define pb push_back
#define popb pop_back
#define po... | ALGO | 0.999994 | 4.283585 |
6578a132-c6a3-4602-8c22-80c122370b03 | chyroshan066/cpp | Enhancements_in_C++/setw_manipulator.cpp | #include<iostream>
#include<iomanip>
using namespace std;
int main(){
long pop1=5425678, pop2=47000, pop3=76890;
cout<< setw(8)<< "LOCATION"<< setw(12)<< "POPULATION"<< endl
<<setw(8)<< "Patan"<< setw(12)<< pop1<< endl
<<setw(8)<< "Khotang"<< setw(12)<< pop2<< endl
<<setw(8)<< "Butwal"<< setw(12)<< pop3<< end... | TOOL | 0.966357 | 3.319094 |
e162b268-113c-4329-8a7d-a1810eaec7dc | Amrutha26/Datastructures-Algorithms | Recursion/towerofhanoi.cpp | #include <bits/stdc++.h>
using namespace std;
void TOH(int n, char source, char aux, char dest) {
if(n==1) {
cout << "Move Disk " << n << " from " << source << " to " << dest << endl;
return;
}
TOH(n-1, source, dest, aux);
cout << "Move Disk " << n << " from " << source << " to " << de... | ALGO | 0.999693 | 5.706937 |
3ad25dd1-ce1f-44ca-b9fe-62a0035cbe06 | tienph91/IT_Class_12_Y2017 | doigiatri.cpp | // Nhap vao 2 so a va b. Doi gia tri 2 so nay
//Input: a = 1, b = 3
// Output: a = 3, b = 1;
#include <iostream>
#include <conio.h>
using namespace std;
main()
{
int a,b;
cout<<"Nhap a: ";
cin>>a;
cout<<"Nhap b: ";
cin>>b;
a=a^b;
b=a^b;
a=a^b;
cout<<" a = "<< a<<endl;
cout<<" b = "<< b;
getch();... | ALGO | 0.998782 | 3.220315 |
d3ba2211-49cd-4a22-943e-a1282a1e102d | br0farhan/fundamental_rest_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.998859 | 6.785645 |
e6ad18d3-2cc8-4f74-a2f7-01442e405925 | shilpagarg/WHdenovo | trioasm/whatshap_trioasm/src/pedigreepartitions.cpp | #include <cassert>
#include "pedigreepartitions.h"
using namespace std;
PedigreePartitions::PedigreePartitions(const Pedigree& pedigree, unsigned int transmission_vector) : pedigree(pedigree), transmission_vector(transmission_vector), haplotype_to_partition_map(pedigree.size(), {-1,-1}) {
partition_count = 2 * (ped... | ALGO | 0.968047 | 6.000992 |
136a7ae5-181d-4d61-9d0b-2fead6956949 | PrinceIoT/Arduino_ESP32_ESP8266_Projects | libraries/Harvard_TinyMLx/src/tensorflow/lite/micro/kernels/transpose_conv.cpp | #include "tensorflow/lite/kernels/internal/reference/transpose_conv.h"
#include "tensorflow/lite/c/builtin_op_data.h"
#include "tensorflow/lite/c/common.h"
#include "tensorflow/lite/kernels/internal/common.h"
#include "tensorflow/lite/kernels/internal/quantization_util.h"
#include "tensorflow/lite/kernels/internal/ref... | ALGO | 0.946327 | 7.820435 |
84286590-758b-463d-831c-2d0903232499 | MaTianmao/src | src/boost/libs/geometry/doc/index/src/examples/rtree/mapped_file.cpp | //[rtree_mapped_file
#include <iostream>
#include <boost/interprocess/managed_mapped_file.hpp>
#include <boost/geometry.hpp>
#include <boost/geometry/geometries/point.hpp>
#include <boost/geometry/index/rtree.hpp>
namespace bi = boost::interprocess;
namespace bg = boost::geometry;
namespace bgm = bg::model;
namespa... | ALGO | 0.918404 | 5.736688 |
f2bb8eef-636c-4504-bbdd-bb0db2c2c008 | ishubhamsingh/AEXOTA | jni/boost_1_57_0/libs/graph/example/print-out-edges.cpp | using namespace boost;
template < typename Graph, typename VertexNamePropertyMap > void
read_graph_file(std::istream & graph_in, std::istream & name_in,
Graph & g, VertexNamePropertyMap name_map)
{
typedef typename graph_traits < Graph >::vertices_size_type size_type;
size_type n_vertices;
typena... | ALGO | 0.944756 | 5.857584 |
82a4a678-8c5c-4a37-9bd6-999e25ad6384 | lucashuati/maratona | URI/2026.cpp | #include <bits/stdc++.h>
using namespace std;
long long int pe[101],v[101], mat[101][1001];
long long int mochila(long long int n, long long int l){
for(long long int i = 1; i <= n; i++){
for(long long int j = 1; j <= l; j++){
if(j >= pe[i]){
mat[i][j] = max(mat[i-1][j],mat[i-1][j-pe[i]] + v[i]);
... | ALGO | 0.999856 | 3.80805 |
d987cc4a-9778-4660-80e3-6cdc420c9aee | imtiaz1710/competitive-programming | mixed programme Part1/Dev skill contest 2/s.cpp | #include <bits/stdc++.h>
#define ll long long
#define fin freopen("in.txt", "r", stdin)
#define fout freopen("out.txt","w", stdout)
#define dbg(x) cerr << #x << ": " << x << endl
#define fastio ios::sync_with_stdio (false); cin.tie (0);
using namespace std;
int main(){
int n;
vector <pair<int,int>> v;
cin>... | ALGO | 0.999861 | 3.740232 |
c12d5572-1d68-4f38-863d-8a9422580802 | viniscoelho/uva | 10104.cpp | #include <iostream>
using namespace std;
typedef pair<long long, long long> ll;
ll find_bezout(long long x, long long y)
{
if (y == 0)
return ll(1, 0);
ll u = find_bezout(y, x % y);
return ll(u.second, u.first - (x / y) * u.second);
}
int main()
{
ios::sync_with_stdio(false);
long long x... | ALGO | 0.999877 | 3.862458 |
16f764fe-f701-41dd-b6bf-ddf0010f4889 | judge27/Stylish | 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.998784 | 6.761023 |
e12bb85d-c145-4635-8040-90c49faf6fc4 | Sumanth-NR/CompetitiveProgramming | Platforms/USACO/Gold/DP_Longest_Increasing_Subsequence/Rabbit_Carrot.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
/**
* Follows https://usaco.guide/problems/lmio-2019triusis/solution
*
* We count the number of poles we don't change
* Suppose the poles i1, i2, ..., ik don't change
* Condition 1. a[i_j] <= M * i_j
* Condition 2. a[i_{j+1}] <= a[i_j] + M * (i... | ALGO | 0.999979 | 4.135513 |
87f23cd2-75e1-41c8-b336-5c24d1c0a711 | james-harder/CS211 | Lab/20180925lab.cpp | /*
* NAME: James Harder
* WSUID: s674k343
* HW #: lab07
* Description: This program creates an array of ten integers, and fills it
* with the even numbers from 2 to 20. The program then
* outputs the numbers on a single line.
*
*
*/
#include <iostream>
using namespace std;
int main(void){
const int MAX... | ALGO | 0.950128 | 4.680766 |
b3228d2b-8524-4557-9b38-4866777ee245 | damibran/Simple_ASCII_Renderer | Dependencies/assimp/code/PostProcessing/CalcTangentsProcess.cpp | /** @file Implementation of the post processing step to calculate
* tangents and bitangents for all imported meshes
*/
// internal headers
#include "CalcTangentsProcess.h"
#include "ProcessHelper.h"
#include <assimp/TinyFormatter.h>
#include <assimp/qnan.h>
using namespace Assimp;
// -----------------------------... | TOOL | 0.986576 | 3.730495 |
e6955a85-330a-4ed4-9e49-5b34bfd92078 | ishandutta2007/codeforces | voidmax/normal/1266/A.cpp | //
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
#define pb push_back
#define x first
#define y second
... | ALGO | 0.998312 | 3.351695 |
e019faf9-cb2c-433e-9375-4e06a1226abd | aakanksha-m20/Cpp_codes | AddNo.cpp | #include <iostream>
using namespace std;
int main()
{
int first_num, second_num, sum;
cout << "Enter two integers: ";
cin >> first_num >> second_num;
// sum of two numbers in stored in variable sumOfTwoNumbers
sum = first_num + second_num;
// prints sum
cout << first_num<< " + " << second_num ... | TOOL | 0.989262 | 4.229624 |
41df0cb6-22b9-499f-a7b3-590150f4a8b7 | bhattaman0001/CodeLeetCode | 88-merge-sorted-array/88-merge-sorted-array.cpp | class Solution
{
public:
void merge(vector<int> &A, int m, vector<int> &B, int n)
{
int a = m - 1, b = n - 1, c = m + n - 1;
while(a >= 0 and b >= 0){
if(A[a] > B[b]) A[c--] = A[a--];
else A[c--] = B[b--];
}
... | ALGO | 0.999933 | 4.517787 |
fe412783-461f-4203-a6aa-0348c977d445 | supernalu/CP-solutions-and-templates | rozwiazania/cses-mountain-range/x.cpp | #include <bits/stdc++.h>
using namespace std;
constexpr int MAXN = 2e5+10;
int n;
pair<int,int> h[MAXN];
int dp[MAXN];
int main() {
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
cin >> n;
for (int i = 1; i <= n; i++) {
cin >> h[i].first;
h[i].second = i;
}
int res = 0;
s... | ALGO | 0.999978 | 4.537426 |
4a944e81-b2e8-4b6f-acc0-c92219d74e52 | OUNAVCON/imxRT1060_example | sdk/middleware/openh264/codec/decoder/core/src/error_concealment.cpp | #include "error_code.h"
#include "expand_pic.h"
#include "manage_dec_ref.h"
#include "copy_mb.h"
#include "error_concealment.h"
#include "cpu_core.h"
namespace WelsDec {
//Init
void InitErrorCon (PWelsDecoderContext pCtx) {
if ((pCtx->pParam->eEcActiveIdc == ERROR_CON_SLICE_COPY)
|| (pCtx->pParam->eEcActiveIdc... | TOOL | 0.920973 | 5.001188 |
70cab043-22ab-4ea6-961f-681d72f486bf | vfolunin/archives-solutions | LeetCode/3011.cpp | class Solution {
int ones(int n) {
int res = 0;
while (n) {
res++;
n &= n - 1;
}
return res;
}
public:
bool canSortArray(vector<int> &a) {
vector<int> part = { a[0] }, res;
for (int i = 1; i < a.size(); i++) {
if (ones(par... | ALGO | 0.999989 | 5.530908 |
8becaba4-8299-462d-9a4b-331dafde5e02 | rladmschd235/codetree-TILs | 240221/문자열 돌리기/SPin-SPring.cpp | #include <iostream>
#include <string>
using namespace std;
int main() {
string str;
cin >> str;
for(int i = 0; i < str.length()+1; i++)
{
cout << str << endl;
str = str.substr(str.length()-1, 1) + str.substr(0, str.length()-1);
}
return 0;
} | ALGO | 0.999887 | 4.091874 |
8fd8349f-b568-4ed1-adc0-0c4c14c24c28 | Xemum0/playing... | c++/challenges/exo12.cpp | //program to divide two given integers without
//using the multiplication, division and mod operator
#include <iostream>
#include <limits>
using namespace std;
//................................................................
int division(int dividend ,int divisor){
int count =0;
while (dividend>=divisor){
... | ALGO | 0.999735 | 4.994602 |
342dde49-f037-42fe-888f-d21bc36105b0 | MhammedAhmmed/LeetCode-Solutions | 2232-adding-spaces-to-a-string/2232-adding-spaces-to-a-string.cpp | class Solution {
public:
string addSpaces(string s, vector<int>& spaces) {
int n = s.size(), ns = spaces.size();
string res = "";
int j = 0;
for (int i = 0; i < n; i++) {
if (j < ns && i == spaces[j]) {
res.push_back(' ');
i--;
... | ALGO | 0.999879 | 6.226174 |
dc81629d-5cfa-47cd-8ca1-6d9c372771e0 | tatsuhikotashiro/joukyuensyu | 11/kadai34.cpp | #include<iostream>
#include<cmath>
#include<algorithm>
#include<vector>
#include<random>
struct Point {
double x;
double y;
};
double distance(Point a, Point b) {
return std::hypot(a.x-b.x, a.y-b.y);
}
Point generate_random_point(std::mt19937& random) {
Point a;
std::uniform_real_distribution<double... | ALGO | 0.978521 | 4.266018 |
7312e2b5-2fdc-4375-bb3f-4b09cd7257f6 | LOLZKERNEL/android_bootable_recovery | updater/updater_runtime.cpp | #include "updater/updater_runtime.h"
#include <string.h>
#include <sys/mount.h>
#include <sys/stat.h>
#include <sys/wait.h>
#include <unistd.h>
#include <android-base/file.h>
#include <android-base/logging.h>
#include <android-base/properties.h>
#include <android-base/strings.h>
#include <android-base/unique_fd.h>
#i... | TOOL | 0.956695 | 7.598969 |
235492f1-9169-41c1-acd7-33f32bc58657 | roobiul/codeforce | A. Special Characters.cpp | //بسم الله الرحمن الرحيم
//محمد روبيول الإسلام
//roobiul~Githab
#include<iostream>
#include<string>
#include<bits/stdc++.h>
#define ll long long int
#define ctt cout<<
#define Robiul ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
using namespace std;
solve(){
ll n; cin>> n;
if(n%2!=0)
ctt"NO... | ALGO | 0.999868 | 4.388193 |
a4f66aac-e5e1-46eb-9861-d9e0fba6e146 | ou3slati/competitive-programming | Implementations/MyChecklist/CEOI/CEOI 19 D2/A.cpp | //Never stop trying
#include "bits/stdc++.h"
using namespace std;
#define boost ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
typedef long long ll;
typedef string str;
typedef long double ld;
typedef pair<int, int> pi;
#define fi first
#define se second
typedef vector<int> vi;
typedef vector<pi> vpi;
#defi... | ALGO | 0.999904 | 4.801155 |
2b4eecf5-3a8e-458a-85cd-3f60d976d29b | GarryKharoud/Cpp-all-files | whileprime.cpp | #include<iostream>
using namespace std;
main()
{
int a,i;
cout<<"a=";
cin>>a;
i=2;
while(a>1)
if(a%i==0)
{
cout<<i;
a=a/i;
if(a==1)
{
cout<<" ";
}
else
{
cout<<"*";
}
}
else
{
i=i+1;
}
}
| ALGO | 0.999914 | 3.04161 |
f8d27283-d425-48ff-8001-27f7636e2482 | Nishant-Bhosale/Competitive-Programming-CPP | CodeForces_Problems/MediumStringProblems/Minority.cpp | #include<bits/stdc++.h>
using namespace std;
#define vi vector<int>
#define vii vector<int,int>
#define rep(a,b) for(int i = a;i<b;i++)
#define pi pair<int,int>
typedef long long ll;
int main(){
ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
ll t;
cin>>t;
while(t--){
string s;
... | ALGO | 0.999923 | 4.260465 |
cc702e6d-4e7f-4521-af18-8bb6992008bf | slowmotiooon/algorithm-cpp | leetcode/2962_CountSubarraysWhereMaxElementAppearsAtLeastKTimes/2962.cpp | #include <iostream>
#include "solution2.h"
using namespace std;
int main() {
int total;
cin >> total;
vector<int> nums;
for (int i = 0; i < total; i++) {
int buffer;
cin >> buffer;
nums.push_back(buffer);
}
int k;
cin >> k;
cout << countSubarrays(nums, k) << endl;
return 0;
}
// https://leetcode.cn/p... | ALGO | 0.999947 | 5.055757 |
3a4e0d08-b9ff-4347-b4f0-837ffb12a0d2 | miracl/amcl | version3/cpp/fp2.cpp | /* AMCL Fp^2 functions */
/* SU=m, m is Stack Usage (no lazy )*/
/* FP2 elements are of the form a+ib, where i is sqrt(-1) */
#include "fp2_YYY.h"
//namespace YYY {
//extern int fp2muls;
//extern int fp2sqrs;
//}
using namespace XXX;
/* test x==0 ? */
/* SU= 8 */
int YYY::FP2_iszilch(FP2 *x)
{
if (FP_iszilch(&... | ALGO | 0.970073 | 3.810641 |
e98d457c-a72b-4db3-86db-6a8cc56d261b | ngtranminhtuan/Algorithm-Immediately | 11. Binary Search/6. [spoj] HACKRNDM - Hacking the random number generator.cpp | // Problem: HACKRNDM - Hacking the random number generator
// Link: https://www.spoj.com/problems/HACKRNDM/
//
// Complexity: O(NlogN)
#include <iostream>
#include <algorithm>
using namespace std;
#define MAX 100000
int arr[MAX];
int binarySearch(int* arr, int l, int r, int x) {
int m;
while (l <= r) {
... | ALGO | 0.999974 | 4.787309 |
88b95254-8e0a-4d41-89db-0a0f2d70ffaa | alemuntoni/meshlab-external-libraries | downloads/boost_1_87_0/libs/graph/example/ordered_out_edges.cpp | /*
IMPORTANT:
~~~~~~~~~~
This example appears to be broken and crashes at runtime, see
https://github.com/boostorg/graph/issues/149
*/
#include <boost/config.hpp>
#include <iostream>
#include <functional>
#include <string>
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/properties.hpp>
... | TEST | 0.99545 | 6.615337 |
bfd654df-65b2-4194-9d18-456ec2af7b8d | aeongiing/codetree-TILs | 240110/ab 사이에 없는 c/c-between-a-and-b-2.cpp | #include <iostream>
using namespace std;
int main() {
int a, b, c;
cin >> a >> b >> c;
bool tf=false;
for(int i=a; i<=b; i++){
if(i%c==0){
tf=true;
}
}
if(tf==true){
cout << "NO";
}
else
cout << "YES";
return 0;
} | ALGO | 0.999971 | 4.22793 |
f6653246-2284-4b62-8e3f-73329a9d9b78 | satya-supercluster/Leetcode | 1720-crawler-log-folder/1720-crawler-log-folder.cpp | class Solution {
public:
int minOperations(vector<string>& logs) {
int count{};
for(auto s:logs){
if(s=="../"){
if(count!=0)count--;
}
else if(s=="./")continue;
else count++;
// cout<<count<<" ";
}
return cou... | ALGO | 0.991493 | 4.693746 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.