uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
ceeee1bf-e037-43c8-a53b-bd33c868ff99 | Prakhar-08/LeetCode | Recursions/10. Subsets2.cpp | // Leetcode - 90
// Given an integer array nums that may contain duplicates, return all possible subsets (the power set).
// The solution set must not contain duplicate subsets. Return the solution in any order.
class Solution {
public:
set<vector<int>> res;
void solve(vector<int> nums, vector<int> output... | ALGO | 0.999896 | 6.357223 |
5d0f26cf-ffd5-4ae7-9760-1a78085a8283 | veacks/porco | src/plugins/ammo.js/bullet/src/BulletSoftBody/btSoftRigidCollisionAlgorithm.cpp | #include "btSoftRigidCollisionAlgorithm.h"
#include "BulletCollision/CollisionDispatch/btCollisionDispatcher.h"
#include "BulletCollision/CollisionShapes/btSphereShape.h"
#include "BulletCollision/CollisionShapes/btBoxShape.h"
#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
#include "btSoftBody.h"
#inc... | ALGO | 0.995325 | 4.0597 |
6bfb1cb6-a7fd-47c0-b99c-15213ce228c3 | JuliusIsPerfect/leetcode | array/42.cpp | #include <algorithm>
#include <iostream>
#include <vector>
class Solution {
public:
int trap(std::vector<int>& height) {
int n = height.size();
if (n == 1) {
return 0;
}
std::vector<int> leftMAX(n, 0);
std::vector<int> rightMAX(n, 0);
leftMAX[0] = height[... | ALGO | 0.999929 | 7.096438 |
f22085d6-d9be-4b23-a5d7-bcd8b2c1c7dd | Imracist/Project-1 | simulation.cpp | #include "simulation.h"
#include <iostream>
Simulation::Simulation(const Config& config, Region& region)
: config(config), region(region) {}
void Simulation::run() {
int maxTimeSteps = config.getMaxTimeSteps();
int refreshRate = config.getRefreshRate();
region.printRegion(0); // Print initial state
... | ALGO | 0.957951 | 6.124172 |
09537975-c4d7-4f80-aaab-ab831363e606 | naimulhassan2001/Flutter-Stripe-payment | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.9988 | 6.76073 |
a6c4fadb-8fea-415a-a40a-e040a6c9bbf9 | ishandutta2007/codeforces | keko37/normal/843/B.cpp | #include<iostream>
#include<cstdio>
#include<algorithm>
#include<vector>
using namespace std;
typedef long long llint;
const int MAXN = 50005;
const int LIM = 250;
int n, s, x, val[MAXN], nxt[MAXN];
int bio[MAXN];
llint m=1000000007, num=65464, k=1682525, r=7243;
vector < pair <int, int> > v;
void gen () {
num=(k... | ALGO | 0.99998 | 3.118816 |
cba6c8b5-9295-4e62-a094-590ee79884d9 | HeteshBatta/Algorithms | Sorting/quicksort.cpp | #include <stdio.h>
void swap(int *a ,int *b)
{
int temp;
temp = *a;
*a = *b;
*b = temp;
}
int partition(int *array , int left , int right)
{
int index = left - 1;
int j;
int pivot_element=array[right];
for(j=left;j<right-1;j++)
{
if(array[j]<=pivot_element)
{
index++;
swap(&array[index] , &array[j]... | ALGO | 0.999981 | 4.110487 |
e2bdeadd-4a60-4494-bcd7-4f302e7d9f3e | Santhosh2508/DSA-BOOTCAMP-ASSIGNMENT | Q1Swap_b.cpp | /* Write a program to swap to two numbers*/
/*b. By without using third variable*/
#include <iostream>
using namespace std;
int main()
{
int a, b, temp;
cout << "Enter the two numbers: ";
cin >> a >> b;
cout << "Before Swaping : a =" << a << " and b = " << b << endl;
a = a + b;
b = a - b;
a... | ALGO | 0.999663 | 3.742125 |
486fed45-cef3-4ef4-b80d-3a3b46857deb | mehrajhr/some-codeforces-800-rating-problem-solution | 1676b.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];
}
sort(arr,arr+n);
int sum = 0;
for(int i=1;i<n;i++)
{
... | ALGO | 0.99977 | 3.695608 |
dc8a7f4b-bcf2-4111-8a69-dd4d3fc3b561 | Albgondiga/icpc | CPC3/Equipos/Concurso11/j/j.cpp | #include <bits/stdc++.h>
using namespace std;
#define forr(i, a, b) for (int i=a; i<b; i++)
#define forn(i, n) forr(i, 0, n)
#define sz(c) ((int)c.size())
#define zero(v) memset(v, 0, sizeof(v))
#define forall(it, v) for (auto it=v.begin(); it!=v.end(); ++it)
#define pb push_back
#define pf push_front
#define mp make_... | ALGO | 0.999741 | 3.651231 |
67f51321-0f01-4e62-923c-7118f8c50cb8 | MicrochipTech/some-ip | vsomeip/implementation/endpoints/src/local_server_endpoint_impl.cpp | #include <deque>
#include <iomanip>
#include <sstream>
#include <sys/types.h>
#include <boost/asio/write.hpp>
#include "../include/endpoint_host.hpp"
#include "../include/local_server_endpoint_impl.hpp"
#include "../../logging/include/logger.hpp"
#include "../../utility/include/byteorder.hpp"
#include "../../configu... | WEB | 0.890876 | 6.748147 |
678b85a3-f030-4942-8afe-feb8c99a145c | prabanjanraja/Compettitive-Programming | march long challenge/interesting xor.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define ar array
#define vt vector
#define pb push_back
#define all(c) (c).begin(), (c).end()
#define sz(x) (int)(x).size()
#define F_OR(i, a, b, s) for (int i = (a); (s) > 0 ? i < (b) : i > (b); i += (s))
#define F_OR1(e) F_OR... | ALGO | 0.999765 | 4.611384 |
01ddf126-beae-4e33-a634-16618353f998 | StyleList94/problem-solving | baekjoon/2250.cpp | #include<iostream>
#include<vector>
using namespace std;
// 트리 노드 정보(루트, 왼쪽, 오른쪽, 부모 노드)
struct TreeNode {
int root, left, right, parent;
};
vector<TreeNode> T; // 트리 배열
// 열 번호, 트리 깊이
int colCount = 1, depth = 1;
vector<int> minLev, maxLev; // (min/max)Lev[x]: x 레벨 일 때, 열의 최소/최댓값
int min(int a, int b) { return a ... | ALGO | 0.999959 | 4.504076 |
024a1137-8e33-4945-8953-07fa29e96ce9 | willsheffler/rpxdock | rpxdock/cluster/cookie_cutter.cpp | /*/*cppimport
<%
cfg['include_dirs'] = ['../..','../extern']
cfg['compiler_args'] = ['-std=c++2a', '-w', '-Ofast']
cfg['dependencies'] = ['../util/types.hpp']
cfg['parallel'] = False
setup_pybind11(cfg)
%>
*/
/** \file */
#include <pybind11/eigen.h>
#include <pybind11/numpy.h>
#include <pybind11/pybind11.h>
#includ... | TOOL | 0.90316 | 6.772028 |
39524523-787d-4dd0-b670-ce86792d658a | stack-queue-coder/CP-DSA | Codeforces/CF-Implementation/C. Alphabetic Removals.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL);
void solve(){
int n , k;
cin >> n>> k;
string s;
cin >> s;
vector<pair<char , int> > v(n);
map<char , int>m;
for(int i=0;i<n;i++){
m[s[i]]++;
}
int x=0;
for(auto ele:m){
x += e... | ALGO | 0.999999 | 3.945909 |
9670ff45-25f2-4034-a07a-2269879ddbfc | alen0216056/ProgramContest | BasicDataStructures/UVA11350.cpp | #include <iostream>
#include <string>
using namespace std;
int main()
{
long long int ncase, l_son, l_mom, r_son, r_mom, ans_son, ans_mom;
string s;
cin>>ncase;
while( ncase-- )
{
cin>>s;
l_son = 0;
l_mom = 1;
r_son = 1;
r_mom = 0;
ans_son = 1;
... | ALGO | 0.999537 | 3.316717 |
604d9f69-0498-4f56-8d7a-3e0841a5c437 | dzisreal/Ung-dung-thuat-toan-Haui | Buoi 1.cpp | #include<bits/stdc++.h>
using namespace std;
void input(long *&a,int &n)
{
ifstream fin("input.txt");
fin >> n;
a = new long[n];
for(int i=0; i<n; i++)
fin >> a[i];
fin.close();
}
void display(long *a,int n)
{
for(int i=0; i<n; i++)
cout << a[i] << " ";
cout << endl;
}
long algo1(long *a, int n, int &lef... | ALGO | 0.999917 | 3.44033 |
e9854973-babc-490a-ab39-c3e579c4bb21 | balckwilliam/tengine_opendla_note | opencv-4.5.4/modules/stitching/src/util.cpp | #include "precomp.hpp"
namespace cv {
namespace detail {
void DisjointSets::createOneElemSets(int n)
{
rank_.assign(n, 0);
size.assign(n, 1);
parent.resize(n);
for (int i = 0; i < n; ++i)
parent[i] = i;
}
int DisjointSets::findSetByElem(int elem)
{
int set = elem;
while (set != parent... | ALGO | 0.992496 | 5.520399 |
66b11d9e-3dbf-4d33-8087-48c0872525b9 | ishandutta2007/codeforces | dpair/normal/1492/E.cpp | /*
author: DPair
language: C++11
description:
*/
#pragma GCC optimize(2, 3, "Ofast")
#include <cstdio>
#include <vector>
using std :: vector;
namespace IO{
#define getcha() (SS == TT && (TT = (SS = BB) + fread(BB, 1, 1 << 23, stdin), SS == TT) ? EOF : *SS++)
char BB[1 << 23], *SS = BB, *TT = B... | ALGO | 0.999979 | 3.223736 |
16ed9e3b-abca-4c41-a872-c16e0b3bdf6d | KUMUDSHANDILYA/CP | no_time_to_wait.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int N, H, x;
cin>>N>>H>>x;
int arr[N];
for(int i=0;i<N;i++)
{
cin>>arr[i];
}
sort(arr, arr+N);
if(arr[N-1]>=H-x)
{
cout<<"YES\n";
}
else cout<<"NO\n";
return 0;
}
| ALGO | 0.999947 | 3.784528 |
f9a66994-6aa6-4bc3-a5b2-a2dcbf6ced4c | a7med-830/Elzero-cpp-assignments | 55-66/assignment_7.cpp | #include <iostream>
using namespace std;
int beforeresult(int main, int last) {
int res = 0;
for (int i = main; i >= main - last; i--) {
res += i;
}
return res;
}
int main() {
cout << beforeresult(10, 5) << "\n"; // 10 + 9 + 8 + 7 + 6 + 5 = 45
// Main Number [10]
// Numbers Before ... | ALGO | 0.999855 | 4.388848 |
04e99300-0c32-4e98-a10e-761fafd2e263 | greatzero728/Remotasks | Dolphin/Codeforces/gym/(6464087a5ea42ac81d024654 Stairs)/(6464087a5ea42ac81d024654 Stairs).cpp | #include<bits/stdc++.h>
#define y second
#define x first
using namespace std;
using INT = long long;
using pii = pair<int, int>;
using DO = double;
DO RA, RB;
const DO eps = 1e-6;
struct point {
DO x, y, z;
point(DO x = 0, DO y = 0, DO z = 0) : x(x), y(y), z(z) {}
point operator + (point a) {return point(x + a.x,... | ALGO | 0.999911 | 3.790847 |
1796d4c6-7ff7-41ea-b12e-e46f7cec6c74 | whichxjy/ray-tracer | src/hittable.cpp | #include "hittable.hpp"
#include "bvh.hpp"
void HitRecord::set_face_normal(const Ray& ray, const Vec3& outward_normal) {
front_face = dot(ray.direction, outward_normal) < 0;
normal = front_face ? outward_normal : -outward_normal;
}
bool HittableList::hit(const Ray& ray, double t_min, double t_max,
... | ALGO | 0.991294 | 7.172037 |
e67f54a1-ea52-4133-82a1-0481706b2fcd | amartya-k/LeetCode-Journey | 867-transpose-matrix/867-transpose-matrix.cpp | class Solution {
public:
vector<vector<int>> transpose(vector<vector<int>>& m) {
int r=0,c=0;
vector<vector<int>>res;
for(c=0;c<m[0].size();c++){
vector<int>temp;
for(r=0;r<m.size();r++){
temp.push_back(m[r][c]);
}
... | ALGO | 0.999976 | 6.222633 |
3cd63314-9747-431b-b3b9-6663d088c183 | zm2417/luogu-cpp | 1211.cpp | #include <iostream>
using namespace std;
int n;
int d[10], mark[10];
int ans;
bool check(int a, int s)
{
while (a > 0)
{
if (d[a % 10] == 0)
return false;
s--;
a /= 10;
}
return s == 0;
}
void dfs()
{
for (int i = 0; i < n; i++)
{
for (int j = 0; j ... | ALGO | 0.999699 | 4.338295 |
282eebaf-4802-42cb-b977-044277ad64a6 | icapucap/coding-practice | Day8/segments.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
vector<int> v(n);
for(int i=0;i<n;i++){
cin>>v[i];
}
int a,count=0,k=0,x,y;
while(v.size()){
int max=0;
for(int i=0;i<v.size();i++){
a=v[i];
k=1;
while(i+k<v.s... | ALGO | 0.999838 | 3.735311 |
954bed10-2ee1-4c1e-a560-d46dc3ec0994 | henriqueferreira04/3Ano | 1S/SO/P/lesson-3/code/bounded-buffer/ex3_v2.cpp | #include <stdio.h>
#include <unistd.h>
#include <stdint.h>
#include <libgen.h>
#include <stdlib.h>
#include <pthread.h>
#include <string.h>
#include "fifo.h"
#include "process.h"
#define CHILD1 0
#define CHILD2 1
int main() {
int shmid = pshmget(IPC_PRIVATE, sizeof(int), IPC_CREAT | 0666);
// Anexando a me... | TOOL | 0.927633 | 4.189943 |
43f467b2-8032-4daf-b26b-23237af74b34 | selhatinenc/Algo | Algo/cpp_algo/count_triplets.cpp | //
// Created by selhatin on 31.1.2023.
//
#include <bits/stdc++.h>
using namespace std;
string ltrim(const string &);
string rtrim(const string &);
vector<string> split(const string &);
// Complete the countTriplets function below.
long countTriplets(vector<long> arr, long r) {
unordered_map<long, long> left, r... | ALGO | 0.999819 | 5.202697 |
c1234e6a-eeb2-4c5f-a3c2-331f19fbcda7 | dujingyao/Yao | 算法学习/蓝桥杯训练/罗马数字.cpp | #include<iostream>
#include<string>
using namespace std;
int func(string ch){
int len=ch.size();
int sum=0;
for(int i=0;i<len;){
int value=0;
switch(ch[i]){
case 'I':value=1;break;
case 'V':value=5;break;
case 'X':value=10;break;
case 'L':value... | ALGO | 0.999838 | 4.451409 |
6b57c7fd-f827-4493-ad24-f0c11afdd393 | tchaikov/ceph-boost | debian/tests/srcs/graph/demo1.cpp | // https://www.boost.org/doc/libs/1_67_0/libs/graph/example/family-tree-eg.cpp
enum family { Jeanie, Debbie, Rick, John, Amanda, Margaret, Benjamin, N };
int main() {
using namespace boost;
const char *name[] = {"Jeanie", "Debbie", "Rick", "John",
"Amanda", "Margaret", "Benjamin"};
... | ALGO | 0.998363 | 4.809213 |
edf2e559-006f-4f73-b9ef-135fb4564ab3 | Sookmyung-Algos/2021algos | algos_assignment/3rd_grade/윤서영_ysyoung1011/week5/2533.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
vector <int> v[1000001];
int dp[10000001][2] = { 0, };
void dpDfs(int x, int parent) {
for (int i = 0; i < v[x].size(); i++) {
int next = v[x][i];
if (next == parent) continue;
dpDfs(next, x);
}
dp[x][0] = 0;
dp[x][1] = 1;
fo... | ALGO | 0.999858 | 4.621062 |
178ebcb9-70bc-447b-aefc-274e02f56624 | moves-rwth/storm | src/storm/modelchecker/prctl/helper/rewardbounded/EpochModel.cpp | #include "storm/modelchecker/prctl/helper/rewardbounded/EpochModel.h"
#include "storm/modelchecker/prctl/helper/rewardbounded/MultiDimensionalRewardUnfolding.h"
#include "storm/environment/solver/MinMaxSolverEnvironment.h"
#include "storm/environment/solver/SolverEnvironment.h"
#include "storm/utility/graph.h"
#inclu... | ALGO | 0.999521 | 6.943908 |
c6e34970-9a29-44ba-8cd3-5912da9403ab | papi656/a2ojLadder | L5-Div2B/littlePonyAndSortByShift.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int main(){
int n;
cin >> n;
int arr[n];
int p = 0, pos = -1;
for(int i = 0, val; i < n; i++){
cin >> val;
arr[i] = val;
if(p > val && pos == -1)
pos = i;
p = val;
}
bool possible = true;
int maxhalf = 0;
if(pos != -1){
int pval = arr... | ALGO | 0.999952 | 4.051932 |
bf930857-78c9-46f7-ba17-05848e8ead5f | kailashpradhan-inventyv/Training | Basic_Training/MulUptoN.cpp | #include<iostream>
using namespace std;
int main(){
int n,res=1;
cout<<"Enter N : ";
cin>>n;
for(int i=1;i<=n;i++){
res*=i;
}
cout<<res;
return 0;
} | ALGO | 0.999751 | 4.347288 |
03813c5d-f9d4-48bf-893e-c29c67107126 | CandyRoms-staging/frameworks_av | media/libaudioprocessing/AudioResamplerCubic.cpp | #define LOG_TAG "AudioResamplerCubic"
#include <stdint.h>
#include <string.h>
#include <sys/types.h>
#include <log/log.h>
#include "AudioResamplerCubic.h"
namespace android {
// ----------------------------------------------------------------------------
void AudioResamplerCubic::init() {
memset(&left, 0, size... | ALGO | 0.926321 | 6.907433 |
64c16b06-2295-49d9-a3e4-851441eaeeb7 | Aman-Meenia/LeetcodeSolutions | 1671-minimum-number-of-removals-to-make-mountain-array/1671-minimum-number-of-removals-to-make-mountain-array.cpp | class Solution {
public:
int minimumMountainRemovals(vector<int>& v) {
int n=v.size();
vector<int> dp1(n,1);
vector<int> dp2(n,1);
for(int i=0; i<n; i++){
for(int j=0; j<i; j++){
if(v[j]<v[i]&&dp1[j]+1>dp1[i]){
dp1[i]=dp1[j]+1;
... | ALGO | 0.999994 | 5.245505 |
a1d4e50b-df46-4c4b-a8c2-a7cf121e6fa5 | Partha-SUST16/100_Days_Coding_Challange | CodeForces/From Begining/Lucky Division.cpp | #include <iostream>
#include <vector>
#include <cmath>
#include <set>
#include <queue>
#include <map>
#include <cstdio>
#include <cstring>
#include <string>
#include <stack>
#include <algorithm>
#include <limits.h>
#include <bits/stdc++.h>
#define fw(x) freopen("x.txt", "w", stdout)
#define For(i, a, b, c) for (int i =... | ALGO | 0.999813 | 3.390202 |
6aaba604-9213-48aa-b494-7434a5a75fb5 | Reifly-io/basalt_jp | thirdparty/basalt-headers/thirdparty/eigen/doc/snippets/SelfAdjointEigenSolver_SelfAdjointEigenSolver_MatrixType.cpp | MatrixXd X = MatrixXd::Random(5,5);
MatrixXd A = X + X.transpose();
cout << "Here is a random symmetric 5x5 matrix, A:" << endl << A << endl << endl;
SelfAdjointEigenSolver<MatrixXd> es(A);
cout << "The eigenvalues of A are:" << endl << es.eigenvalues() << endl;
cout << "The matrix of eigenvectors, V, is:" << endl << ... | ALGO | 0.999713 | 3.056724 |
6e2d7713-7f97-4010-904f-b7cd1e417e81 | Shiny-Shine/CPP-practice | STL-Find_if.cpp | using namespace std;
#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
int main() {
vector<int>v = { 1, 2, 5, 4, 3, 2, 4, 3, 1, 2 ,6 };
//function variable, bool ȯϰ intŰ Լ ̷ .
vector<function<bool(int)>> op;
op.push_back([](int x) {
return (x % 2 == 0);
});
op.push_back([](int ... | ALGO | 0.999379 | 4.032021 |
a391b374-a143-4ebd-b338-915d07509055 | ro9n/lc.amz.revisited | 6.dp/1.longest.pali.substr.cpp | /**
* @file 1.longest.pali.substr
* @author Touhid Alam <<EMAIL>>
*
* @date Friday February 05 2021
*
* @brief
*/
#include <bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
typedef pair<int, int> ii;
class Solution {
public:
string longestPalindrome(string s) {
if (s.empty()) re... | ALGO | 0.999982 | 5.993811 |
2e3d3fde-2b66-401b-9e42-1b180587aafa | l-modolo/UrQt | Segmentation.cpp | #include "Segmentation.hpp"
// Definition of the static stuff
bool Segmentation::m_phred_computed = false;
double Segmentation::m_phred[MAX_QUAL-1];
void Segmentation::phred_compute(int threshold, bool classic)
{
if(!m_phred_computed)
{
if(classic)
{
for(int j = 1; j < (double)MAX_QUAL; j++)
{
m_phred... | ALGO | 0.993462 | 4.229036 |
10eb64ef-94ca-4583-961a-536b403637b3 | LeoGJC/Data-Structures-and-Algorithms | Lab/lab_ml/main.cpp | #include "NimLearner.h"
#include <vector>
#include "edge.h"
int main() {
NimLearner nim(10);
// Play 10,000 games of Nim:
const int gamesPlayed = 10000;
for (int i = 0; i < gamesPlayed; i++) {
vector<Edge> path = nim.playRandomGame();
nim.updateEdgeWeights(path);
}
nim.labelEdgesFromThreshold(game... | ALGO | 0.989542 | 4.42666 |
61806431-eb16-42b3-bcb6-2c5e0a39f6e7 | davletmegahorosh/dlib-copy | examples/sequence_segmenter_ex.cpp | /*
This example shows how to use dlib to learn to do sequence segmentation. In a sequence
segmentation task we are given a sequence of objects (e.g. words in a sentence) and we
are supposed to detect certain subsequences (e.g. the names of people). Therefore, in
the code below we create some very sim... | ALGO | 0.918096 | 7.789237 |
cae43884-8cd8-4f08-ae8f-3fca6afe54e6 | KausBoss/G3_Codes | 54C.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
class dance{
public:
ll id;
ll diff;
dance(ll id, ll diff){
this->id=id;
this->diff=diff;
}
};
struct comp{
bool operator()(dance a, dance b){
return a.diff < b.diff;
}
};
int main(){
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", s... | ALGO | 0.99917 | 3.742325 |
166fd553-bcd6-4ee7-a484-85fe3fb56636 | taniaban2712/dsaRepo | CodeForces problems/repeatingcipher.cpp | #include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main(){
ll n,i=0,count=0;
cin>>n;
string s="",w="";
cin>>s;
while(i!=n){
w+=s[i];
count++;
i+=count;
}
... | ALGO | 0.999968 | 3.20282 |
40e90458-ba3d-48b6-b161-1b4fa984f700 | Akshatsah04/Dsa-cpp- | vector/pairsum.cpp | #include<iostream>
#include<vector>
using namespace std;
int main(){
vector<int> num={2 , 7 , 11 , 15};
int t =18;
int st = 0;
int end = num.size()-1;
while (st<end){
if(num[st]+num[end]>t){
end--;
}
else if(num[st]+num[end]<t){
st++;
}
... | ALGO | 0.999853 | 4.228116 |
7df1f5a9-d439-4664-b3a6-5e0629a9ab27 | anfastech/Coding-Challenge | 7 - Arrays/Solution.cpp | #include <algorithm>
#include <iostream>
using namespace std;
int main() {
int N;
cin >> N;
int arr[N];
for (int i = 0; i < N; i++) {
cin >> arr[i];
}
reverse(arr, arr + N);
for (int i = 0; i < N; i++) {
cout << arr[i] << " ";
}
return 0;
}
| ALGO | 0.999948 | 4.92516 |
4eb3a90a-366b-4f4c-92aa-509e4066b165 | NalinDalal/codeforces | 88.1703A.cpp | /* https://codeforces.com/problemset/problem/1703/A
A. YES or YES?
There is a string 𝑠 of length 3, consisting of uppercase and lowercase English
letters. Check if it is equal to "YES" (without quotes), where each letter can
be in any case. For example, "yES", "Yes", "yes" are all allowable.
Input
The first line of... | ALGO | 0.999728 | 5.044181 |
1c8a30d8-26d8-41b9-a38e-eca35b2edecc | sarvex/leetcode-c | solution/1100-1199/1162.As Far from Land as Possible/Solution.cpp | class Solution {
public:
int maxDistance(vector<vector<int>>& grid) {
int n = grid.size();
queue<pair<int, int>> q;
for (int i = 0; i < n; ++i) {
for (int j = 0; j < n; ++j) {
if (grid[i][j]) {
q.emplace(i, j);
}
}
... | ALGO | 0.999914 | 5.832357 |
a9f7329d-ef7b-4712-8b75-bd44113c73db | ARTSAT/DESPATCH | ground_station/tracker/software/core/Shinen2Tracker/eigen-eigen-6b38706d90a9/bench/sparse_dense_product.cpp |
//g++ -O3 -g0 -DNDEBUG sparse_product.cpp -I.. -I/home/gael/Coding/LinearAlgebra/mtl4/ -DDENSITY=0.005 -DSIZE=10000 && ./a.out
//g++ -O3 -g0 -DNDEBUG sparse_product.cpp -I.. -I/home/gael/Coding/LinearAlgebra/mtl4/ -DDENSITY=0.05 -DSIZE=2000 && ./a.out
// -DNOGMM -DNOMTL -DCSPARSE
// -I /home/gael/Coding/LinearAlgebr... | ALGO | 0.998711 | 4.386344 |
a9cec86b-3130-4b82-8895-601ffd8a4f36 | sakin-of-bd/Codeforces-Solutions | 1950D.cpp | #include<bits/stdc++.h>
#define fi1(i,n) for(int i=0;i<n;i++)
#define fi2(i,n) for(int i=1;i<=n;i++)
#define fd1(i,n) for(int i=n-1;i>=0;i--)
#define fd2(i,n) for(int i=n;i>=1;i--)
#define endl '\n'
#define int long long
using namespace std;
vector<int>res(1e5+10,0);
bool cheak(int n)
{
while(n>0)
{
int z... | ALGO | 0.99913 | 4.958386 |
6ac14d7a-60c4-488f-948d-395dca1b1c15 | iphands/printing | firmware/Marlin-2.0.x/Marlin/src/lcd/menu/menu_bed_corners.cpp | //
// Level Bed Corners menu
//
#include "../../inc/MarlinConfigPre.h"
#if BOTH(HAS_LCD_MENU, LEVEL_BED_CORNERS)
#include "menu_item.h"
#include "../../module/motion.h"
#include "../../module/planner.h"
#if HAS_LEVELING
#include "../../feature/bedlevel/bedlevel.h"
#endif
#ifndef LEVEL_CORNERS_Z_HOP
#define LEV... | TOOL | 0.859429 | 6.438262 |
d3c4e99a-8917-4f2d-b9e6-19fad06a3ec5 | Shankar-Singh-Mahanty/ApnaCollege-DSA-Sheet | Arrays/extraFind2ndMinimum.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution {
public:
vector<int> minAnd2ndMin(vector<int> &arr) {
int min = INT_MAX;
int min2 = INT_MAX;
for(int i = 0; i < arr.size(); i++) {
if(arr[i] < min) {
min2 = min;
min = arr[i];
... | ALGO | 0.999993 | 5.887418 |
5c3478d8-f81c-4c1d-b82d-63d89624a4e4 | srishkee/codepath_cybersecurity | Natrij.cpp | #include <iostream>
#include <string>
using namespace std;
string convertToTime(int arg)
{
string time = to_string(arg);
time = (time.size() == 1) ? "0" + time : time;
return time;
}
string parseTime(int diff)
{
int hours = diff / 3600;
int remain = diff % 3600;
int min = remain / 60;
int sec = remain % 60;
... | ALGO | 0.99908 | 5.019612 |
d75c853d-f6e4-4e60-880c-93a4e30d4cc9 | abhradeepbarman/dsa-supreme | 6- Recursion & Backtracking/Assignments/wild_card_matching.cpp | #include <bits/stdc++.h>
using namespace std;
// More Readable solution
class Solution
{
bool solve(string &s, string &p, int i, int j) {
// base case
if (i >= s.length() && j >= p.length()) {
return true;
}
if (i >= s.length() && j < p.length()) {
// s = "... | ALGO | 0.999893 | 4.565166 |
c541d024-a120-4eea-8c2b-daa88e78588a | huanhuanonly/Codeforces | FHQ Treap/P4567 [AHOI2006] 文本编辑器.cpp | /**
* => P4567 [AHOI2006] 文本编辑器
*
* -> https://www.luogu.com.cn/problem/P4567
*
* @b FHQ-Treap
*
* @from: https://www.luogu.com.cn/training/147262#problems
*/
#include <bits/stdc++.h>
using uint = unsigned int;
using llong = long long int;
using ullong = unsigned long long int;
using ldouble = long do... | ALGO | 0.999187 | 5.132731 |
a39a5d6a-fd3f-42b6-8a0f-9911bf5bdd3f | mtereshkin/coursera-white-belt-cpp | week 3/names2.cpp | #include <iostream>
#include<vector>
#include<set>
#include <map>
#include <string>
using namespace std;
struct PersonNameByYear {
map<int, string> first_name;
map <int, string> last_name;
};
class Person {
public:
void ChangeFirstName(int year, const string& first_name) {
person_name.first_name... | ALGO | 0.912166 | 4.938902 |
2bf069a5-a877-4dcc-b2a2-52c795987fc7 | RBzhang/regular_expression | suffix.cpp | #include<stack>
#include"suffix.h"
using namespace std;
const string& Suffix::getstr() const{return this -> str;}
bool Suffix::isw(const char& c){
return ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'));
}
int Suffix::sear(const char& c){
int result = 0;
switch(c){
case ')':
result = ... | ALGO | 0.999735 | 3.59392 |
afdbc9ca-948e-49b3-944b-602f1f1b53e5 | HunterMahmud/geeks-for-geeks | 8. Second Largest.cpp | // url = https://practice.geeksforgeeks.org/problems/second-largest3735/1
//{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function template for C++
class Solution{
public:
// Function returns the second
// largest elements
int print2largest(int arr[], int n) {
... | ALGO | 0.999947 | 5.169815 |
0d682927-d8d0-4b53-8b40-7d0560c32e65 | vermakriti/Leetcode | Linked List/Add Two Numbers II/program.cpp | class Solution {
public:
ListNode*reverse(ListNode*head){
ListNode*curr=nullptr,*prev=nullptr,*next=head;
while(next){
prev=curr;
curr=next;
next=next->next;
curr->next=prev;
}
return curr;
}
ListNode* addTwoNumbers(ListNode* l1... | ALGO | 0.999991 | 6.095012 |
322912c0-f983-426f-88da-62b998c267f2 | bechirzarrouki/java_ML | src/opencv/sources/modules/calib3d/src/ptsetreg.cpp | #include "precomp.hpp"
#include <algorithm>
#include <iterator>
#include <limits>
#include "usac.hpp"
namespace cv
{
int RANSACUpdateNumIters( double p, double ep, int modelPoints, int maxIters )
{
if( modelPoints <= 0 )
CV_Error( Error::StsOutOfRange, "the number of model points should be positive" );
... | ALGO | 0.999095 | 6.006679 |
08a561df-d6fa-4b0d-a134-68e4e796f7d2 | ssbb1166/algorithm-problem-solving | dp/boj1915.cpp | #include <algorithm>
#include <iostream>
#include <string>
using namespace std;
int n, m, len, dp[1001][1001];
string arr[1000];
int main()
{
cin >> n >> m;
for (int y = 0; y < n; y++)
cin >> arr[y];
for (int y = 1; y <= n; y++) {
for (int x = 1; x <= m; x++) {
if (arr[y - 1]... | ALGO | 0.999554 | 3.845289 |
c24bf834-7340-4237-9eaf-73c09629b206 | AkshitMital/LeetCode | 2181-merge-nodes-in-between-zeros/2181-merge-nodes-in-between-zeros.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
// class Solution {
// public:
// ListNode* me... | ALGO | 0.999974 | 5.422633 |
3b3fb549-8282-48e4-9847-d35e85d9bdd4 | yewei600/Crack-the-Code-Interview | Bit Manipulation/InsertMintoN.cpp | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <fstream>
using namespace std;
#define SIZE 20
void InsertMintoN(int M,int N){
}
int main(){
int i=3,j=5;
double tmp;
double n=1111111111;
for(int cnt=i;cnt<=j;cnt++){
tmp= ~(1<<cnt);
cout<<tmp<<endl... | ALGO | 0.998956 | 3.012726 |
f5336f81-6058-4a55-8ac7-d179521eacbd | Mulab11/cntt2016-hw1 | TC-SRM-580-div1-250/lx.cpp | #include <bits/stdc++.h>
#define rep(i, x, y) for (int i = (x), _ = (y); i <= _; ++i)
#define down(i, x, y) for (int i = (x), _ = (y); i >= _; --i)
#define x first
#define y second
#define mp make_pair
#define pb push_back
#define LX_JUDGE
using namespace std;
typedef long long LL;
template<typename T> inline void u... | ALGO | 0.999847 | 3.937216 |
05e252f0-49cc-4519-a3ea-7a0d9e4ff892 | vimee-project/vimee-core | src/wallet/crypter.cpp | #include <wallet/crypter.h>
#include <crypto/aes.h>
#include <crypto/sha512.h>
#include <script/script.h>
#include <script/standard.h>
#include <util/system.h>
#include <string>
#include <vector>
int CCrypter::BytesToKeySHA512AES(const std::vector<unsigned char>& chSalt, const SecureString& strKeyData, int count, un... | TOOL | 0.895485 | 7.606264 |
460a6555-0a71-4b15-a2c0-c11e2ccb5934 | shasuri/AlgorithmStudy | songGol/hw3.cpp | #include <iostream>
#include <string>
using namespace std;
bool maze[7][7]; // given table
string path; // input path
int routeCnt = 0; // number of route
void travel(int depth, int col, int row, char dir)
// depth : steps we moved
// col : our column location
// row : our row location
// dir : previous move d... | ALGO | 0.999964 | 3.966446 |
17d39a38-1adc-4dc4-82ca-dfbe24a1d40b | prajvalpase06/DSA | Linked LISt/sort_012_linkedList.cpp | class Solution
{
public:
//Function to sort a linked list of 0s, 1s and 2s.
Node* segregate(Node *head) {
// Add code here
int c0,c1,c2;
c0=c1=c2=0;
Node* newhead = nullptr;
Node* n = head;
while(n){
if(n->data == 0) c0++;
else if (n->... | ALGO | 0.999967 | 5.270296 |
ee468be4-8ef4-4a61-aa59-588c9d80607c | ishandutta2007/codeforces | toxel/normal/831/B.cpp | #include<bits/stdc++.h>
const int N = 1010;
const int M = 26;
int inv[M];
char a[N], b[N], s[N];
int main(){
scanf("%s%s%s", a, b, s);
for (int i = 0; i < M; ++ i){
inv[a[i] - 'a'] = b[i] - 'a';
}
int len = strlen(s);
for (int i = 0; i < len; ++ i){
if (s[i] >= '0' && s[i] <= '9'){
putchar(s[i]);
}
e... | ALGO | 0.999863 | 4.171934 |
2253a179-fc7c-4c4f-b6ab-d46dcda23317 | HPCRL/STeF | inc/mttkrp_atomic_last_logic.cpp | {
TYPE* __restrict__ xx , * __restrict__ yy;
const idx_t row_id = t->ind[nmode-1][it];
xx = vals + row_id*r;
yy = partial_products + (nmode-2) * r ;
//if(vec == 0)
#ifndef VEC
{
//if(it == 1)
// printf("saxpy code\n");
TYPE tval = t->val[it];
#ifdef OMP
mutex_set_lock(mutex,row_id);
#endif
//if(r... | ALGO | 0.998123 | 3.177775 |
770ecb87-93c4-4834-8c75-b7dfbef4cd93 | mox601/grafica | blender/V2OGL101/Src/GeometryUtils.cpp | #include <stdio.h>
#include <math.h>
#include "GeometryUtils.h" // needed for typedefs from "SharedDefs.h"
#include "Vrml2OGL.h" // needed for debugMode extern var definition
/////////////////////////////////////////////////////////////////////////////////////////////
// Function Name: getBoxCenter()
//
// Descript... | TOOL | 0.999302 | 5.687905 |
14bdddc1-8ff7-461c-b72e-4dcdcf75724f | mahfuz1703/Competitive-Programming-Beginner-To-Advanced | Practice Problem/STL/problem1.cpp | // Problem: You are given a list of 2D integer cordinates. You have to sort them based on their distance from the origin. How will you do it??
#include <bits/stdc++.h>
using namespace std;
int main(){
int n; cin >> n;
vector<tuple<double, int, int>> v;
for(int i = 0; i < n; i++){
int x, y; cin >> x >> y;
doub... | ALGO | 0.999918 | 5.314918 |
ae13cdcb-549a-45d2-ae8f-a2ab6d734e28 | obalcells/problemas | graphs/traversal/tasks.cpp | #include <bits/stdc++.h>
using namespace std;
vector<vector<int>> before;
vector<bool> done;
bool doable(int task) {
for(int i = 0; i < (int)before[task].size(); ++i) {
if(!done[before[task][i]]) return false;
}
return true;
}
int main() {
int n, m;
while(scanf("%d %d", &n, &m)) {
if(n == 0 && m == 0... | ALGO | 0.999942 | 4.104792 |
c0fbad13-22b1-4db7-a5e6-5529787f54e8 | iamviethung/OceanRingToss | Production/TrainingFW/lib/BulletPhysic/src/physicBullet/src/Bullet3Collision/BroadPhaseCollision/b3OverlappingPairCache.cpp | #include "b3OverlappingPairCache.h"
//#include "b3Dispatcher.h"
//#include "b3CollisionAlgorithm.h"
#include "Bullet3Geometry/b3AabbUtil.h"
#include <stdio.h>
int b3g_overlappingPairs = 0;
int b3g_removePairs =0;
int b3g_addedPairs =0;
int b3g_findPairs =0;
b3HashedOverlappingPairCache::b3HashedOverlappingPairCache... | TOOL | 0.960698 | 4.848375 |
3a925700-bb91-4b30-b5b8-531b6caa0229 | ishandutta2007/codeforces | ra16bit/normal/31/A.cpp | #include <stdio.h>
int a[111],n,i,j,k;
int main() {
scanf("%d",&n);
for (i=0; i<n; i++) scanf("%d",&a[i]);
for (i=0; i<n; i++) for (j=0; j<n; j++) for (k=j+1; k<n; k++) if (a[i]==a[j]+a[k]) {
printf("%d %d %d\n",i+1,j+1,k+1); return 0;
}
puts("-1"); return 0;
} | ALGO | 0.99989 | 3.330953 |
6bd56db8-03f3-43de-a3f8-82e2c9de0803 | shubpl7/CrackingTheCode | DP/dp19.cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long
#define MP make_pair
#define PB push_back
#define MOD 1000000007
#define fi first
#define se second
typedef pair<int,int> PII;
typedef vector<int> VI;
typedef vector<PII> VPII;
typedef vector<VI> VVI;
typedef map<int,int> MPII;
typedef set<int> SETI;
t... | ALGO | 0.999961 | 4.440434 |
f1dfd9a3-88ef-47da-95be-8858452238bc | Subbuleo23/finding-nemo | InterviewPrep/LinkedList/OccurenceOfAnumberInLinkedList.cpp | #include <iostream>
#include <vector>
#include <string>
#include <unordered_map>
using namespace std;
class Node
{
public:
int data;
Node *next;
Node(int data, Node *next)
{
this->data = data;
this->next = next;
}
};
Node *head = NULL;
/*
* Input Param... | ALGO | 0.999243 | 3.524626 |
7f8cb9f8-6fcb-4c72-95b4-4ce363d8533e | Zowlyfon/AoC-2021 | day_4.cpp | //
// Created by zowlyfon on 05/12/2021.
//
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <algorithm>
#include <regex>
#include <sstream>
struct bingoNumber {
int value = 0;
bool marked = false;
};
struct bingoBoard {
bingoNumber bingoNumbers[5][5];
bool bingo = ... | ALGO | 0.999184 | 5.357059 |
c90f7cb0-30f7-4f2e-bab4-56c9887d3b9d | artiam99/GeeksforGeeks | 10 Dynamic Programming/1 Basic Problems/91 Number of Permutations to Get N using Coins.cpp | #include<bits/stdc++.h>
using namespace std;
int NoofWays(vector<int> &a,int n,int N)
{
vector<int> dp(N+1);
dp[0] = 1;
for(int i=1;i<=N;i++)
for(int j=0;j<n;j++)
if(i >= a[j])
dp[i] += dp[i-a[j]];
return dp[N];
}
signed main()
{
vector<int> a = {1,5,6};
int n = a.size();
int N = 7;
cout<< NoofWays(a... | ALGO | 0.999936 | 4.628408 |
5a077849-2c53-4b7e-9ad5-574cfdc4ecf1 | mzib18/CompetitiveCoding | MinimumCostPathWithAtMostKStops.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// time - O(flights.size())
// } Driver Code Ends
class Solution {
public:
int CheapestFLight(int n, vector<vector<int>>& flights, int src, int dst, int K) {
vector<pair<int,int>> adj[n];
for(auto it : flights){
adj[... | ALGO | 0.999867 | 5.672302 |
a011d53d-6388-4abf-a4fd-2cd869d0216e | kkyehit/AlgoPratics | WildCard.cpp | #include<stdio.h>
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<cstdlib>
#include<string.h>
using namespace std;
void test1(char *pattern){
int i=0;
while(pattern[i] != '\0'){
printf("%c",pattern[i++]);
}
printf("\n");
}
bool check(string a){
for(int i = 0; i<a.size(); i++)
... | ALGO | 0.999961 | 3.294942 |
ff370de9-d48a-4543-8ed2-849009698da4 | pvs-hd-tea/TCrules | c2c-translator/data/geeks_for_geeks_dataset/cpp/GIVEN_A_SORTED_AND_ROTATED_ARRAY_FIND_IF_THERE_IS_A_PAIR_WITH_A_GIVEN_SUM.cpp | #include <iostream>
#include <cstdlib>
#include <string>
#include <vector>
#include <fstream>
#include <iomanip>
#include <bits/stdc++.h>
using namespace std;
bool f_gold ( int arr [ ], int n, int x ) {
int i;
for ( i = 0;
i < n - 1;
i ++ ) if ( arr [ i ] > arr [ i + 1 ] ) break;
int l = ( i + 1 ) % n;
int ... | ALGO | 0.999793 | 4.987893 |
c67e61b0-d614-43ce-89e5-d4a517fa8d07 | hakki123mrk/OOC | C++/exm1.cpp | class CompoundInterest {
private:
int p, n, t;
float r, A;
public:
void getData(int, int, int, float);
float calcCI();
}
void CompoundInterest
float CompoundInterest :: calcCI () {
} | ALGO | 0.926699 | 3.879647 |
510fbae8-4381-4a7c-b5c2-1a95b15b7ca9 | Himanshu07-debug/Competitive-Programming | 07-Two Pointers/Concept/C-04-Sliding_Window.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;
typedef tree<pair<int,int>,null_type,less<pair<int,int>>,rb_tree_tag,tree_order_statistics_node_update> PBDS;
#define endl '\n'
const long long MOD = 1e9 + 7;
cons... | ALGO | 0.999846 | 4.914879 |
59f8beba-cf61-405b-b9a7-ca8ef6dac5bd | ShubhraKumari/GeeksForGeeks-array-school-level-codes | Count of smaller elements.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
int countOfElements(int arr[], int n, int x);
int main() {
int t;
cin >> t;
while (t--) {
int n, x;
cin >> n;
int arr[n];
for (int i = 0; i < n; i++) cin >> arr[i];
cin >> x;
cout... | ALGO | 0.999499 | 6.100377 |
adbe8426-f601-4091-bacf-bb1353b26ab5 | HarshGupta02/Data-Structure-And-Algorithm | BackTracking/Letter Combinations of a Phone Number.cpp | class Solution {
public:
vector<vector<char>>v;
void precompute(){
v.resize(10);
char ch = 'a';
for(int i = 2; i <= 9; i ++){
if(i == 7 or i == 9){
v[i].push_back(ch); v[i].push_back(ch + 1);
v[i].push_back(ch + 2); v[i].push_back(ch... | ALGO | 0.99978 | 6.626565 |
af86f114-ee4a-4587-921c-e1bed07b216f | rodalladea/tcc2 | collector-project/opencv-2.4.9/samples/cpp/kalman.cpp | #include "opencv2/video/tracking.hpp"
#include "opencv2/highgui/highgui.hpp"
#include <stdio.h>
using namespace cv;
static inline Point calcPoint(Point2f center, double R, double angle)
{
return center + Point2f((float)cos(angle), (float)-sin(angle))*(float)R;
}
static void help()
{
printf( "\nExamle of c c... | ALGO | 0.97452 | 5.9321 |
c2371f82-c96e-465c-93c0-8a78e92ede3f | maxy218/leetcode | BinaryTreeZigzagLevelOrderTraversal/main.cpp | /*
* =====================================================================================
*
* Filename: main.cpp
*
* Description: Binary Tree Zigzag Level Order Traversal
*
* Version: 1.0
* Created: 09/12/2013 12:05:36 AM
* Revision: none
* Compiler: gcc
*
* ... | ALGO | 0.999987 | 5.82018 |
be330e65-ef10-443a-b68a-e8c5c06406c9 | angshn/algorithm | plats/poj/2388.cpp | #include<cstdio>
#include<algorithm>
#include<iostream>
using namespace std;
inline int read(){int x=0,f=1;char ch=getchar();while (ch<'0'||ch>'9'){if (ch=='-') f=-1;ch=getchar();}while (ch>='0'&&ch<='9'){x=x*10+ch-48;ch=getchar();}return x*f;}
const int N = 5e6+10;
int a[N];
int qsort(int left,int right,int k){
... | ALGO | 0.999984 | 3.870234 |
c596dc1c-25a5-4242-9971-38ad3ec61fa5 | ZohaibSaraj12/DSA-Data_Cpp | DEQUEUE.cpp | #include <iostream>
using namespace std;
class Deque {
int arr[5]; // Array to store deque elements (size 5 for example)
int front, rear; // Indices for front and rear of the deque
public:
Deque() {
front = -1; // Initialize front
rear = -1; // Initialize rear
}
// Check if t... | ALGO | 0.984946 | 6.408028 |
64a5497e-a910-4c80-848b-03a07c10c6b4 | asdadeeeee/OJ | leetcode/844/b.cpp |
#include <iostream>
#include <string>
using namespace std;
class Solution {
public:
string back(string str) {
string res;
int len = 0;
int n = str.length();
int ptr1 = n - 1;
while (ptr1 >= 0) {
if (str[ptr1] == '#') {
int ptr2 = ptr1 - 1;
while (ptr2 >= 0) {
if (s... | ALGO | 0.99991 | 4.670693 |
c882a2b5-0aab-427d-ba23-a94c88f6c571 | zcae1020/algorithm_problems | baekjoon/exercise/25304/25304.cpp | #include <bits/stdc++.h>
#define FASTIO ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
#define pii pair<int, int>
#define ll long long
#define llu unsigned long long
#define fs first
#define sd second
using namespace std;
int X, N, sum;
void Solution()
{
cin >> X >> N;
for (int i = 0; i < N; i++... | ALGO | 0.999928 | 4.646579 |
ce9450a9-62de-4ebd-86eb-96c40b113378 | soumen1208/LearningCPP | countdigitsamenos.cpp | #include <iostream>
using namespace std;
int countDigitsamenumbers(int n, int input)
{
int count =0;
while (n != 0)
{
if (n%10==input)
count++;
n=n/10;
}
return count;
}
int main()
{
int N=10;
int D=12;
cout<<countDigitsamenumbers(N, D);
return 0;
} | ALGO | 0.999653 | 4.112824 |
dab5fff9-9e8d-4aba-a0ff-6749254cd7a4 | lakshits11/LeetCode | 0513-find-bottom-left-tree-value/0513-find-bottom-left-tree-value.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.99999 | 6.196459 |
08699a35-3f4f-43c7-ab5d-24a51c7c5e08 | ishandutta2007/codeforces | waynetuinfor/normal/109/C.cpp | #include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
vector<pair<int, int>> graf[maxn];
int sz[2][maxn];
long long ans = 0;
void dfssz(int now, int fa) {
sz[0][now] = 1; sz[1][now] = 0;
for (auto u : graf[now]) if (u.first != fa) {
dfssz(u.first, now);
sz[1][now] += sz[1][u.... | ALGO | 0.999758 | 4.30195 |
64174d8a-ece5-4901-9c03-73bb17885362 | shohan11d/competitive-code-practise | playground/main.cpp | #include <bits/stdc++.h>
using namespace std;
char grid[100][105];
bool vis[105][105];
vector<pair<int, int>> d = {{-1, 0}, {1, 0}, {0, -1}, {0, 1}};
int n, m;
bool valid(int i, int j) {
if (i < 0 || i >= n || j < 0 || j >= m) return false;
return true;
}
void dfs(int si, int sj) {
// base case
cout << si << "... | ALGO | 0.999393 | 3.602754 |
b79c0f35-340c-48d6-b5da-b871a5b86dbd | kks227/BOJ | 2400/2490.cpp | #include <iostream>
using namespace std;
int main(){
int n;
int cnt;
char y[5] = {'E', 'A', 'B', 'C', 'D'};
char result[3];
for(int i=0; i<3; i++){
cnt = 0;
for(int j=0; j<4; j++){
cin >> n;
if(n == 0) cnt++;
}
result[i] = y[cnt];
}
for(int i=0; i<3; i++)
cout << result[i] << endl;
return... | ALGO | 0.999564 | 3.275459 |
37fc5345-3ece-44cf-b859-36c2b024eb66 | WinDaLex/Programming | AOAPC-BACTG/Chapter 1. Algorithm Design/General Problem Solving Techniques/Exercises Beginner/UVa_1509.cpp | // UVa 1509
// Leet
// by A Code Rabbit
#include <cstdio>
#include <cstring>
const int LEN = 47;
const int MAXK = 5;
int K;
char alpha[LEN], leet[LEN];
char map[26][MAXK];
bool bo[26];
bool got;
void search(int x, int y) {
if (got) return;
if (x == strlen(alpha)) {
if (y == strlen(leet)) got = tru... | ALGO | 0.999783 | 3.616712 |
ceb40ea0-985c-465f-864c-be2c87575d5a | supernalu/CP-solutions-and-templates | rozwiazania/pa-2021-oranzada/x.cpp | #include <bits/stdc++.h>
constexpr int MAXN = 5e5 + 10;
using namespace std;
int n, k;
int a[MAXN];
bool ma[MAXN];
int wys[MAXN];
int main()
{
cout.tie(0); cin.tie(0); ios_base::sync_with_stdio(0);
cin >> n >> k;
int il = 0;
for (int i = 1; i <= n; i++)
{
cin >> a[i];
if (... | ALGO | 0.999942 | 3.873128 |
ea0fc92a-fb4a-4922-959f-87456b0d4c08 | raincross7/code-similarity | codes/train_code/problem456/problem456_333.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
void merge(int l,int mid,int r,vector<pair<int,int>> &array){
int n = mid - l;
int m = r - mid;
vector<pair<int,int>> left_array(n),right_array(m);
for(int i=0;i<n;i++){
left_array.at(i) = array.at(l+i);
}
for(int i=0;i... | ALGO | 0.999982 | 4.459739 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.