uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
dcfce7b8-3191-40fa-9e3d-48ae47cb808f | ishandutta2007/codeforces | hitman623/normal/463/D.cpp | #include <bits/stdc++.h>
#define pb push_back
#define long long long
#define pll pair < long , long >
#define vll vector < pll >
#define ml map < long , long >
#define mll map < pll , long >
#define x first
#define y second
#define vl vector < long >
#define io ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NU... | ALGO | 0.999956 | 3.753158 |
01b401ca-656f-4842-b8a2-3e8c5774fa96 | mkp0/CP | CodeForce/1418B - Negative Prefixes.cpp | #include <bits/stdc++.h>
#define ll long long
#define pi (3.141592653589)
#define all(x) (x).begin(), (x).end()
#define vi vector<int>
#define vll vector<long long>
#define pii pair<int, int>
#define pll pair<long long, long long>
#define pb push_back
#define mp make_pair
#define S second
#define loop(i, a, b, c) for ... | ALGO | 0.999513 | 3.409112 |
674f8c7c-b21b-417b-8f44-b7f2b500db6e | perjahn/PerJahnUtils | difffind/difffind.cpp | //**********************************************************
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
//**********************************************************
struct file
{
char szFullPath[MAX_PATH];
WIN32_FIND_DATA Data;
bool diff;
} g_filedata[1000000];
char** g_excludepatterns;
unsigned... | TOOL | 0.956425 | 4.690885 |
0969bb89-a427-41d1-b9a3-aecc3d2e8add | soham1192k/Genetic-Algorithms | guess_string.cpp | #include<bits/stdc++.h>
#include <time.h>
#include<windows.h>
using namespace std;
struct Member{
string DNA;
int deviation;
};
struct Population{
vector<Member>Members=vector<Member>(50000);
};
bool cmp(Member &a,Member &b){
return a.deviation<b.deviation;
}
int main(){
string DNA="urhuwhthowhtuigw... | ALGO | 0.99977 | 3.639463 |
458287b1-90bf-4ee6-83a0-303a3b9f7a49 | tahacngl/to_do_mobile_programming | 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 |
babc63be-a057-41b2-bf5a-9ba1cedb83aa | SWEG-2015EC-Batch/Binary-Bombers | ETS1437_15_Yohannes_Gezahegn/string/no_1.cpp | #include <iostream>
#include <cctype>
using namespace std;
int main()
{
string text;
cout << "Enter a string: ";
cin>>text;
int v = 0, c = 0;
for (int i = 0; i < text.length(); i++)
{
char l = text[i];
if (isalpha(l))
{
l = tolower(l);
if (l == ... | ALGO | 0.994317 | 4.064858 |
8a8d8004-5b70-4aac-aca8-4702a9535ec4 | nouwaarom/glados | LPC/Cepstrumc.cpp | #include "Cepstrumc.h"
#include "DTW.h"
#include "oo_DESTROY.h"
#include "Cepstrumc_def.h"
#include "oo_COPY.h"
#include "Cepstrumc_def.h"
#include "oo_EQUAL.h"
#include "Cepstrumc_def.h"
#include "oo_CAN_WRITE_AS_ENCODING.h"
#include "Cepstrumc_def.h"
#include "oo_WRITE_TEXT.h"
#include "Cepstrumc_def.h"
#include "oo... | ALGO | 0.997908 | 6.106016 |
3aafabb1-472c-49f8-8661-9bb3eb7dadd8 | sarvex/leetcode-chef | solution/1700-1799/1720.Decode XORed Array/Solution.cpp | class Solution {
public:
vector<int> decode(vector<int>& encoded, int first) {
vector<int> ans{{first}};
for (int i = 0; i < encoded.size(); ++i)
ans.push_back(ans[i] ^ encoded[i]);
return ans;
}
}; | ALGO | 0.999991 | 5.141685 |
57aae819-0fbc-4474-b309-418d07d14453 | shristysingh996/cpp-program | for loop 3.cpp | #include <iostream>
using namespace std;
int main() {
int evenSum = 0;
int oddSum = 0;
// Sum of even numbers between 1 and 100
for (int i = 2; i <= 100; i += 2) {
evenSum += i;
}
// Sum of odd numbers between 1 and 100
for (int i = 1; i <= 99; i += 2) {
oddSum += i;
}... | ALGO | 0.999819 | 4.803083 |
292c07e1-7907-4f08-9cac-8f09b07d2ea8 | sir-rasel/Online_Judge_Problem_Solve | Codeforces/codeforces_1335A.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<int,int> pii;
const int mod = 1e9+7;
int main(){
int test;
scanf("%d",&test);
while(test--){
ll n;
scanf("%lld",&n);
if(n<=2)
printf("0\n");
else{
ll a = n/2;
... | ALGO | 0.999847 | 4.198143 |
33cedac8-9898-4c3a-93f7-54660e066dd8 | andrewstalin/contest | 1614-maximum-nesting-depth-of-the-parentheses/1614-maximum-nesting-depth-of-the-parentheses.cpp | class Solution {
public:
int maxDepth(string s) {
int res = 0;
int count = 0;
for (int i = 0; i < s.size(); ++i) {
if (s[i] == '(') {
++count;
} else if (s[i] == ')') {
res = std::max(res, count);
--count;
}
... | ALGO | 0.999494 | 5.937709 |
75a22f7a-e52b-4f95-a63e-a4a001611766 | yhw-yhw/MOVER | thirdparty/scene_initialization/Manifold/3rd/igl/embree/bone_heat.cpp | bool igl::embree::bone_heat(
const Eigen::MatrixXd & V,
const Eigen::MatrixXi & F,
const Eigen::MatrixXd & C,
const Eigen::VectorXi & P,
const Eigen::MatrixXi & BE,
const Eigen::MatrixXi & CE,
Eigen::MatrixXd & W)
{
using namespace std;
using namespace Eigen;
assert(CE.rows() == 0 && "Cage edges not... | ALGO | 0.97149 | 5.700325 |
44489217-6988-494a-9c58-ffc2a9cd7a1f | mohamedtalhaouii/Programmation-Cpp | TD's/TD1/EXS10.cpp | // Nom : Mohamed Talhaoui
// Filière : IIA (S4) | 2024/2025
#include <iostream>
using namespace std;
int factorielleItr(int n){
if (n == 0 || n == 1)
{
return 1;
}
else {
int F=1;
for (int i = 1; i <= n; i++)
{
F*=i;
}
return F;
}
}
int ... | ALGO | 0.999572 | 6.115723 |
38f2a06d-ce76-4eca-9661-ec336e7dd217 | LSH3333/PS | programmers/택배배달과수거하기.cpp | #include <string>
#include <vector>
#include <iostream>
using namespace std;
int Cal(vector<int> &v, int cap, int idx) {
if(idx < 0) return -1;
for(int i = idx; i >= 0; i--) {
if(v[i] == 0) continue;
if(cap <= 0) return i;
int cnt = min(cap, v[i]);
v[i] -= cnt;
cap -= cn... | ALGO | 0.998975 | 4.807486 |
5ee6458e-de03-455d-9142-6d2d5f0a01db | Labby0811/3D_Data_Labs_ | Lab_3/src/Registration.cpp | #include "Registration.h"
struct PointDistance
{
//TASK 3
////////////////////////////////////////////////////////////////////////////////////////////////////
// This class should include an auto-differentiable cost function.
// To rotate a point given an axis-angle rotation, use
// the Ceres function:
/... | ALGO | 0.995376 | 3.793673 |
da72b9cf-78c5-48cd-b560-3ffd4acf79f1 | ivanyurov/Homework | loops/number 13.cpp | char letter(int num)
{
if (num == 1000)
return 'M';
else if (num == 500)
return 'D';
else if (num == 100)
return 'C';
else if (num == 50)
return 'L';
else if (num == 10)
return 'X';
else if (num == 5)
return 'V';
else
return 'I';
}
int... | ALGO | 0.999765 | 5.021679 |
07a84450-1710-45db-b2bf-dd36c8046f4e | ishandutta2007/codeforces | chen_zexing/normal/1633/D.cpp | #include <cstdio>
#include <iostream>
#include <unordered_map>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <climits>
#include <algorithm>
#include <complex>
#include <string.h>
#include <iomanip>
using namespace std;
vector <int> v[1005];
int d[1005],b[1005],c[1005],p[1005];
int dp[12005];
... | ALGO | 0.999921 | 3.3358 |
5aa8a650-777e-47e5-a128-8945a5196615 | ishandutta2007/codeforces | deemo/normal/1266/A.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef long double ld;
#define F first
#define S second
const int MOD = 1e9 + 7;//XXX
const int C = 26;//XXX
void add(int &x, int y){
x += y;
while (x >= MOD) x -= MOD;
while (x < 0) x += MOD;
}
int fix(int x){
whi... | ALGO | 0.998915 | 3.901379 |
de6dc7f7-0037-465f-9db3-9f3d6fd19002 | czartur/competitive_programming | contest/855_d3/f.cpp | #include <bits/stdc++.h>
using namespace std;
#define db(x) cerr << #x << " == " << x << endl
#define dbs(x) cerr << x << endl
#define st first
#define nd second
#define pb push_back
#define mp make_pair
#define cl(x,y) memset(x, y, sizeof(x))
#define endl '\n'
typedef long long ll;
typedef pair<int, int> pii;
typede... | ALGO | 0.999926 | 4.403782 |
e628b219-fc05-4416-aa56-343bee9cbe8d | KVSchandra/LeetCode | 2121-find-if-path-exists-in-graph/find-if-path-exists-in-graph.cpp | class DisjointSet{
public:
vector<int>rank, parent, size;
DisjointSet(int n){
rank.resize(n+1, 0);
parent.resize(n+1);
size.resize(n+1);
for(int i = 0;i<=n;i++) {
parent[i] = i;
size[i] = 1;
}
}
int findUParent(int node){
i... | ALGO | 0.99999 | 5.867548 |
2d4039e2-06d8-4c02-b807-48cf7dd7914f | bhavyagoel/LeetCode | 1. Septermber'21/break-a-palindrome/break-a-palindrome.cpp | class Solution {
public:
string breakPalindrome(string palindrome) {
return helper(palindrome);
}
private:
string helper(string &s) {
int n = s.size();
if(n<=1) {
return "";
}
bool flag = false;
for(int i = 0 ; i <... | ALGO | 0.998256 | 4.668246 |
c3e31dcd-a3ae-4f5f-bd78-9e4a18bc309e | vonJOKER/2023guosai | ssc-solarpilot_v1.3.1/ssc/cmod_sco2_design_cycle.cpp | #include "core.h"
//#include "sco2_pc_core.h"
#include "sco2_recompression_cycle.h"
#include <vector>
// This compute module finds the optimal cycle efficiency given design point conditions
// the user must provide the recuperator UA
static var_info _cm_vtab_sco2_design_cycle[] = {
/* VARTYPE DATATYPE ... | ALGO | 0.969407 | 6.364769 |
71d18295-8520-4db4-a5cc-e668ee934ea3 | t3m1X/Shortcircuit-Pinball | Box2D/Box2D/Collision/b2CollideCircle.cpp | #include <Box2D/Collision/b2Collision.h>
#include <Box2D/Collision/Shapes/b2CircleShape.h>
#include <Box2D/Collision/Shapes/b2PolygonShape.h>
void b2CollideCircles(
b2Manifold* manifold,
const b2CircleShape* circleA, const b2Transform& xfA,
const b2CircleShape* circleB, const b2Transform& xfB)
{
manifold->pointCou... | ALGO | 0.999133 | 7.760263 |
dd5dc497-54cc-4131-bd6d-7a0b34835569 | ishandutta2007/codeforces | unused/normal/708/B.cpp | #include <stdio.h>
int main()
{
int a, b, c, d;
scanf("%d%d%d%d", &a, &b, &c, &d);
int zero = -1, one = -1;
{
int lo = 0, hi = 1000000;
while (lo <= hi)
{
int mid = (lo + hi) / 2;
long long t = (long long)mid * (mid + 1) / 2;
if (t == a)
{
zero = mid + 1;
break;
}
else if (t < a) lo ... | ALGO | 0.99973 | 3.131416 |
14ae2efa-bdbc-4ef2-8c5d-5d401cccf764 | ArnabDas9039/DS_Library | Graph_test.cpp | // #include<bits/stdc++.h>
#include<iostream>
#include<map>
#include<list>
#include<queue>
#include<stack>
using namespace std;
class Graph{
public:
class Node{
public:
int data;
};
map<Node*, list<Node*> > adj;
int graphsize(){
return adj.size();
}
void createVertex(Node... | ALGO | 0.999572 | 4.69564 |
f182fa5e-bb40-418f-9949-8d518806d4b0 | vaibhavsiingh/SOC-2024 | week6/submit/w6_q1.cpp | #include <bits/stdc++.h>
using namespace std;
typedef int64_t ll;
typedef vector<ll> vll;
typedef pair<ll, ll> pll;
#define pb push_back
#define pob pop_back
#define ff first
#define ss second
#define sz size
#define reach cout << "Reached" << endl;
#define o1(a) cout << a << "\n"
#define o2(a, b) cout << a << ' ' <<... | ALGO | 0.999971 | 3.545821 |
e0311ba0-b873-4009-bf8b-eafb22787759 | shakiliitju/Phitron | Semester 2/Introduction-to-Algorithms/Module 14/Building_Roads.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int parent[N];
int group_size[N];
void dsu_initialize(int n)
{
for (int i = 1; i <= n; i++)
{
parent[i] = -1;
group_size[i] = 1;
}
}
int dsu_find(int node)
{
if (parent[node] == -1)
return node;
int leader =... | ALGO | 0.999994 | 4.283428 |
a203868d-821b-4bea-8da8-76e381d3108e | im2781975/Algorithm_solved | List/Execution/Make Head.cpp | //make middle node as head of linked list.
#include <bits/stdc++.h>
using namespace std;
class Node
{
public:
int data;
Node* next;
};
void setMiddleHead(Node** head)
{
if (*head == NULL)
return;
// To traverse list nodes one by one
Node* one_node = (*head);
// To traver... | ALGO | 0.99998 | 5.218536 |
2dd5a74b-ad57-470c-80f1-b5e0afd97228 | kimcodingvv/Problem-solving | Codeforces/Codeforces Global Round 7/B - Maximums.cpp | #include <bits/stdc++.h>
#define FIO ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define FOR(a,b,c) for(int a = (b); a <= (c); a++)
#define RFOR(a,b,c) for(int a = (b); a >= (c); a--)
#define all(x) (x).begin(), (x).end()
#define vi vector <int>
#define vvi vector <vi>
#define ll long long
#define vll vector <ll>
... | ALGO | 0.999964 | 4.202244 |
71f1ed88-9407-4183-996c-cbda2eae28ff | minblock/gsapples | src/wallet/rpcdump.cpp | #include <chain.h>
#include <core_io.h>
#include <interfaces/chain.h>
#include <key_io.h>
#include <merkleblock.h>
#include <rpc/server.h>
#include <rpc/util.h>
#include <script/descriptor.h>
#include <script/script.h>
#include <script/standard.h>
#include <sync.h>
#include <util/bip32.h>
#include <util/system.h>
#incl... | WEB | 0.960862 | 7.567113 |
cdd8e5ae-ad16-4385-8621-54a645728ce4 | himanshugupta09/LEETCODE_SOLUTIONS | Dynamic_Programming/minimum-path-sum.cpp | class Solution {
public:
int minPathSum(vector<vector<int>>& grid) {
vector<vector<int>>dp(grid.size(),vector<int>(grid[0].size(),0));
for(int i=0;i<grid.size();i++)
{
for(int j=0;j<grid[0].size();j++)
{
if(i == 0 && j == 0)
{
... | ALGO | 0.999964 | 5.938351 |
c7cf65b2-9845-4142-aa46-90d260d1ddfc | yushengtzou/Leetcode | 1.ProgrammingSkills/2_389_FindTheDifference/main.cpp | // 389. Find the Difference
// 鄒雨笙 2023.12.21
#include <iostream>
#include <map>
using namespace std;
char findTheDifference(string s, string t) {
map<char, int> mapS;
map<char, int> mapT;
// Count frequency of each character in s and t
for (auto ch : s) {
mapS[ch]++;
}
for (auto ch :... | ALGO | 0.999947 | 5.825736 |
6c412a22-2067-48c2-97e9-466bf20e6618 | huxingyi/simpleuv | thirdparty/libigl/include/igl/vector_area_matrix.cpp | // Bug in unsupported/Eigen/SparseExtra needs iostream first
#include <iostream>
#include <unsupported/Eigen/SparseExtra>
template <typename DerivedF, typename Scalar>
IGL_INLINE void igl::vector_area_matrix(
const Eigen::PlainObjectBase<DerivedF> & F,
Eigen::SparseMatrix<Scalar>& A)
{
using namespace Eigen;
u... | ALGO | 0.985705 | 5.213735 |
c81eae5f-31b5-4d1e-95a5-7a55871844de | Zisma601/PEL | pila/main.cpp | #include <iostream>
struct Node {
int data;
Node* next;
};
class Stack {
private:
Node* top;
public:
Stack() { top = nullptr; }
void push(int data) {
Node* newNode = new Node();
newNode->data = data;
newNode->next = top;
top = newNode;
}
int pop() {
... | ALGO | 0.957134 | 5.681928 |
d4cf3b44-e5b3-487f-96d2-d13c58f4b372 | amangupta2486/6Companies30DaysChallenge | GS/Q6_Greatest Common Divisor of Strings.cpp | #include <bits/stdc++.h>
class Solution {
public:
string gcdOfStrings(string a, string b) {
int n=a.size();
int m=b.size();
if(a+b==b+a)
{
int i = __gcd(n,m);
return b.substr(0,i);
}
return "";
}
}; | ALGO | 0.999643 | 5.432083 |
54f28f99-2609-41c0-ae1c-2e2952cd6fcf | Thejellyfish1024/cpp-explore | helloWorld/patterns/numberPatterns/prc-1.cpp | // Input : 5
// Output :
// 1
// 1 2
// 1 2 3
// 1 2 3 4
// 1 2 3 4 5
#include <iostream>
using namespace std;
int main()
{
#ifndef ONLINE_JUDGE
freopen("../../../input.txt", "r", stdin);
freopen("../../../output.txt", "w", stdout);
#endif
int n, space;
scanf("%d", &n);
space = n - 1;
... | ALGO | 0.999981 | 4.134521 |
33042554-f0b4-4210-a8ed-1ba373a3b9e7 | Heejun-0219/algo | CPP/baekjoon/9934.cpp | #include <bits/stdc++.h>
using namespace std;
int k;
int visited[1024], building[1024];
vector<int> a[11];
string s;
void dfs(int here, int depth, int step) {
if (visited[here] || step < 0) return;
visited[here] = 1;
// cout << depth << " " << here << " " << step << " " << building[here] << endl;
a[d... | ALGO | 0.999978 | 3.897567 |
a22e3a35-6db2-484f-b8cf-7791b3506186 | veljko2404/Programming_Competition | binary_search.cpp | #include <iostream>
using namespace std;
int f(int arr[], int n, int x){
int start = 0;
int end = n-1;
while(start <= end){
int mid = start + ((end - start) / 2);
if(x==arr[mid]){
return mid;
} else if(x<arr[mid]){
end = mid - 1;
} else if(x>arr[mid]){... | ALGO | 0.999795 | 5.483202 |
e6a236de-4c33-419d-8dcc-ebaabbd24663 | raincross7/code-similarity | codes/train_code/problem087/problem087_1.cpp | #include<iostream>
using namespace std;
long long fact(long long a){
if(a<=1)return 1;
return fact(a-1)*a;
}
int main(){
int n;
cin >> n;
cout << fact(n) << endl;
} | ALGO | 0.99998 | 4.858373 |
77a63e11-96f0-4fb9-8ba0-e24a2260cc42 | Yuvraj2172/myleetcode | 0232-implement-queue-using-stacks/0232-implement-queue-using-stacks.cpp | class MyQueue {
public:
queue<int> q;
MyQueue() {
}
void push(int x) {
q.push(x);
}
int pop() {
if(q.size()!=0){
int ele = q.front();
q.pop();
return ele;
}
return -1;
}
int peek() {
if(!q.empty()... | ALGO | 0.99947 | 5.035149 |
af7f71c6-263e-479b-b8a8-a821c9817b07 | atharvsankpal7/Placement-Prep | accenture/PYQs/_04_oddEven.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
int arr[n];
string solution = "";
for(int i = 0; i < n; i++){
cin >> arr[i];
if(arr[i] & 1){
solution += "Odd";
}else{
solution += "Even";
}
}
cout << solution;
return 0;
}
| ALGO | 0.999992 | 4.753601 |
2e757722-cd87-4a72-bac6-b5733dc18552 | timmyjose-experiments/competitive-programming | lc/coreprep/implementation/dp_reference_implementation/knapsack_brute.cpp | #include <algorithm>
#include <cmath>
#include <iostream>
#include <limits>
#include <list>
#include <queue>
#include <random>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
using namespace std;
int next_random(int low, int high) {
random_device rd;
mt19937 engine(rd());
u... | ALGO | 0.999999 | 4.617311 |
c60022db-6b98-426e-91a1-cd678e84cd46 | ishandutta2007/codeforces | oierwanhong/normal/1077/B.cpp | #include<iostream>
#include<cstdio>
using namespace std;
typedef long long ll;
ll a[1001];
ll n,ans=0;
int main()
{
cin>>n;
for(ll i=1;i<=n;i++)cin>>a[i];
for(ll i=2;i<n;i++)
{
if(a[i]==0&&a[i-1]==1&&a[i+1]==1)
{
a[i+1]=0;
ans++;
}
}
cout<<ans;
return 0;
} | ALGO | 0.999969 | 3.688182 |
372265a4-53cc-49a5-bb01-1a55f8fe8aad | herculeslopes/codewars-katas | katas_cpp/kata_018.cpp | /* [5 kyu] Primes in numbers
Given a positive number n > 1 find the prime factor decomposition of n. The result will be a string with the following form :
"(p1**n1)(p2**n2)...(pk**nk)"
with the p(i) in increasing order and n(i) empty if n(i) is 1.
Example: n = 86240 should return "(2**5)(5)(7**2)(11)... | ALGO | 0.999712 | 6.484382 |
354cfa5a-5b3e-411d-a828-4f05f99cef21 | forbidden404/algorithms | interview/largestRectHistogram.cpp | #include <bits/stdc++.h>
using namespace std;
int maxArea(vector<int>& A) {
stack<int> s;
int area = 0;
int i = 0;
while (i < A.size()) {
if (s.empty() || A[s.top()] <= A[i]) {
s.push(i);
i++;
} else {
int curMax = s.top();
s.pop();
... | ALGO | 0.999942 | 5.971227 |
0267fc43-260d-496b-9cca-a7579b15f259 | ADITYABAMANE/Leetcode | 0525-contiguous-array/0525-contiguous-array.cpp | class Solution {
public:
int maxlen=0;
int currsum=0;
int findMaxLength(vector<int>& nums) {
map<int,int>mp;
mp[0]=-1;
for(int i=0;i<nums.size();i++){
if(nums[i]==0) {
currsum-=1;
}
else{
currsum+=1;
}
... | ALGO | 0.999963 | 5.925233 |
fb5502b9-2a92-46c6-948f-c0b575c58a83 | SnowySparks/Algorithm_Solve | BackJoon_solved/그리디/11399_그리디.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(void ) {
ios_base::sync_with_stdio(false); cin.tie(NULL);
int N; cin >> N;
vector<int> lst(N+1);
vector<int> arr(N+1);
for (int i = 1; i <= N; i++) {
cin >> lst[i]; }
sort(lst.begin(), lst.end());
... | ALGO | 0.999862 | 3.570519 |
799c05e6-e0b3-4823-a1df-5bcb6116b512 | yyywkhd/LeetCode-C-Java | leetcode/34. Find First and Last Position of Element in Sorted Array.cpp | class Solution {
public:
vector<int> searchRange(vector<int>& nums, int target) {
int low = lower_b(nums,target);
int high = higher_b(nums,target);
if(low == high){
return {-1,-1};
}else{
return {low,high - 1};
}
}
int lower_b(vector<int>& nums, in... | ALGO | 0.999978 | 6.573896 |
73091bdc-dbd8-4387-ab63-4e0811945c24 | prathampithalia/CP | Codeforces/Div_3_966/B_Seating_in_a_Bus.cpp | #include<bits/stdc++.h>
using namespace std;
#define all(a) a.begin(), a.end()
#define fi first
#define se second
#define pb push_back
#define pyes cout << "YES" << endl
#define pno cout << "NO" << endl
#define ce cout << endl
#define forr(i, n) for (int i = 0; i < n; i++)
#define e... | ALGO | 0.99988 | 3.782614 |
dea3fb7d-0440-4460-ba99-c1ee6f0e1065 | SWEG-2015EC-Batch/Pixel-Pioneers | ETS_1062_15_NATNAEL_SOLOMON/Activity_4.2/Array_1D/Equivalent_addition.cpp | #include <iostream>
#define MAX 10
using namespace std;
int main()
{
int ROWS,COLS;
do
{
cout<<"Enter number of rows(max 10): ";
cin>>ROWS;
} while (ROWS > 10);
do
{
cout<<"Enter number of columns (max 10):";
cin>>COLS;
} while (COLS>10);
int first[MAX][MAX], second[MAX]... | ALGO | 0.954972 | 3.539444 |
af215478-7c33-41df-ab6e-275203495d51 | pullasunil/elements-of-programming-interviews | rabin-karp.cpp | #include <cassert>
#include <cmath>
#include <iostream>
#include <random>
#include <string>
#include <vector>
using std::cout;
using std::default_random_engine;
using std::endl;
using std::random_device;
using std::string;
using std::uniform_int_distribution;
using std::vector;
// @include
const int kBase = 26, kMod ... | ALGO | 0.999647 | 6.078634 |
a9b549c4-22a1-45c9-abf5-328217d64e1a | cmariot/Matrix | exercises/ex01.cpp | /*
Exercise 01 : Linear Combination
*/
#include <iostream>
#include "matrix.hpp"
#include "vector.hpp"
#include "utils.hpp"
#include <list>
int main()
{
ft::Vector<double> i = {1, 0}; // length 1 pointing to the right
ft::Vector<double> j = {0, 1}; // length 1 pointing upwards
// The vectors i and j ar... | ALGO | 0.997084 | 3.680027 |
83eed391-5a4b-4364-b0dc-c85d0ddd7662 | gajgeospatial/proj-9.3.0 | src/apps/proj.cpp | /* <<<< Cartographic projection filter program >>>> */
#include "proj.h"
#include "emess.h"
#include "proj_experimental.h"
#include "proj_internal.h"
#include "utils.h"
#include <ctype.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <proj/crs.hpp>
#include <vector>
#if define... | TOOL | 0.906449 | 5.565079 |
122943f1-b8e5-4af8-9057-99085fcc6b52 | rafaelcaetite/beecrowd | 1008-salario.cpp | #include <iostream>
#include <iomanip>
using namespace std;
int main ( ) {
int num, horatrab;
double recebe, salario;
cin >> num >> horatrab >> recebe;
salario = horatrab * recebe;
cout << "NUMBER = " << num << endl;
cout << "SALARY = U$ " << fixed << setprecision (2) << salario << e... | ALGO | 0.923562 | 3.801991 |
1bbcff49-636c-4d1a-a4c7-ff9a141297be | PraharshaJ1/Posture-Detection-using-Arduino-Nano | tflite-micro-arduino-examples-main/tflite-micro-arduino-examples-main/src/tensorflow/lite/micro/kernels/l2norm.cpp | #include "tensorflow/lite/c/common.h"
#include "tensorflow/lite/kernels/internal/portable_tensor.h"
#include "tensorflow/lite/kernels/internal/reference/integer_ops/l2normalization.h"
#include "tensorflow/lite/kernels/internal/reference/l2normalization.h"
#include "tensorflow/lite/kernels/kernel_util.h"
#include "tenso... | DATA | 0.94937 | 7.488694 |
aedd69f9-6b46-4fc0-a4c9-5f9b1b81c62c | quyifei23/gem5-CXL | gem5/src/systemc/tests/systemc/misc/unit/data/datawidth_bool_to_unsigned/extension/datawidth.cpp | /*****************************************************************************
datawidth.cpp --
Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
*****************************************************************************/
/**************************************************************************... | ALGO | 0.948077 | 5.705563 |
67934029-4857-460c-99f1-bb2ba1b0105f | studosi-fer/UMJINT | labosi/lab-3/2009-10/by_KOKOBOKI/UmjImt3/UmjInt3.cpp | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
struct perceptron{
float w0, w1, w2, w3;
int izlaz;
}perceptron;
struct uzorak{
float x0, x1, x2, x3;
int y;
};
struct uzorak primjer[8];
float eta = 0.02;
void ucitaj_dat(){
FILE *f;
char niz[100];
... | ALGO | 0.997784 | 3.137543 |
c083154e-4aa8-44bb-879e-a2c49c8969b0 | ma-benjamin/physics_engine | environment.cpp | #include "environment.h"
Environment::Environment() {};
Environment::~Environment() {
m_objects.clear();
};
void Environment::AddObject(verletObject* ob) {
m_objects.push_back(ob);
ob->ID = m_objects.size();
}
void Environment::AddObject(float xpos, float ypos, float radius, vec2 velocity) {
verletObject* v = n... | TOOL | 0.918826 | 4.57236 |
21dc6fb4-ddcb-4c0d-812f-b8a0d865f13b | anas-haq/XPSC | Week 17 SuperZone/Day 02/F_Forever_Winter.cpp | /*
Author: Anas
Date: 12-08-2024
Time: 20:18:33
File: F_Forever_Winter.cpp
*/
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
ios::sync_with_stdio(false);
cin.tie(NULL);
ll t=1;
cin >> t;
auto Anas = [&]() {
ll n,m;
cin>>... | ALGO | 0.999972 | 5.101768 |
8ea042e6-cb9c-403c-bfdd-23a1f46ac040 | alifalhasan/CP-code-vault | AtCoder/abc228/abc228_e/27399944.cpp | #include<bits/stdc++.h>
#include<ext/pb_ds/tree_policy.hpp>
#include<ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
template<typename temp>using ordered_set = tree<temp, null_type, less_equal<temp>, rb_tree_tag,tree_order_statistics_node_update>;
//order_of_key(k) : Number of items s... | ALGO | 0.999988 | 4.580761 |
433f6aea-4efe-4dc7-9cd4-546fccb9c49b | rudrasingh001/week1-DSA-3-CipherSchools | LECTURE 45/lec45..cpp | #include <bits/stdc++.h>
using namespace std;
//! Cycle detection in a un-directed graph
bool bfs(int src, vector<int> adj[], int vis[])
{
queue<pair<int, int>> q;
vis[src] = 1;
q.push(make_pair(src, -1));
while (!q.empty())
{
int node = q.front().first;
int parent = q.front().seco... | ALGO | 0.999974 | 5.252842 |
55a4fc43-e744-417e-8505-829d587d2165 | sourabh59-coder/LeetCode | 1061-lexicographically-smallest-equivalent-string/1061-lexicographically-smallest-equivalent-string.cpp | class Solution {
public:
int par[26];
int find(int x){
if(par[x]==-1) return x;
return par[x]=find(par[x]);
}
void Union(int x, int y) {
x = find(x);
y = find(y);
if (x != y)
par[max(x, y)] = min(x, y);
}
string smallestEqu... | ALGO | 0.999982 | 6.347077 |
8c3759fe-49f7-44cf-b02c-ecd0be272f29 | uday2005/CP | LEETCODE/560.cpp | class Solution {
public:
int subarraySum(vector<int>& nums, int k) {
unordered_map<int, int> subNum;
subNum[0] = 1;
int total = 0, count = 0;
for (int n : nums) {
total += n;
if (subNum.find(total - k) != subNum.end()) {
count += subNum[total... | ALGO | 0.99994 | 6.500423 |
60ab5188-af68-46e9-a07d-d40525cc3cf6 | ishandutta2007/codeforces | dottle/normal/1566/E.cpp | #include<bits/stdc++.h>
const int N=1000050;
using namespace std;
#define _to e[i].to
#define fore(k) for(int i=hd[k];i;i=e[i].nx)
struct edge{
int to,nx;
}e[N];int hd[N],S;
void add(int fr,int to){
e[++S]=(edge){to,hd[fr]},hd[fr]=S;
}
int t,n,b[N],ans;
void clr(){
S=0;
for(int i=1;i<=n;i++)hd[i]=b[i]=0;
}
... | ALGO | 0.99988 | 4.525624 |
319d3581-cc01-409b-8c41-598a17868b2f | Rajdip-Pal/LeetCode | 2641. Cousins in Binary Tree II/solution-one.cpp | #include <iostream>
#include <queue>
#include <unordered_map>
/**
* Solution 2641. Cousins in Binary Tree II
*
* @Start
*/
struct TreeNode
{
int val;
TreeNode *left;
TreeNode *right;
TreeNode() : val(0), left(nullptr), right(nullptr) {}
TreeNode(int x) : val(x), left(nullptr), right(nullptr) {... | ALGO | 0.999991 | 6.45349 |
d34c2ff3-6fc4-4d0f-a523-93744511e1a1 | nawngs/CompetitiveProgramming | VNOI/bedao_r09_treetravel.cpp | #pragma GCC optimize ("O2")
#include <bits/stdc++.h>
#define int ll
#define ll long long
#define ld long double
#define fi first
#define se second
#define pll pair < ll, ll >
#define pii pair < int, int >
#define fast ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
using namespace std;
const string NAME = "";
const... | ALGO | 0.999987 | 3.655717 |
db97558d-f67e-400f-9efa-87dfe7da13c5 | DatNTHE140692/Print-Shapes-using-C | tgcr.cpp | #include <stdio.h>
#include <stdlib.h>
int main()
{
int size;
scanf("%d",&size);
for(int i=size-1;i>=0;i--)
{
for(int j=i;j>0;j--)
{
printf(" ");
}
for(int j=0;j<size-i;j++)
{
if(i!=0 && j>0 && j<size-i-1) printf(" ");
else printf("*");
}
size++;
printf("\n");
}
return 0;
}
| ALGO | 0.999945 | 3.362345 |
80912825-6062-4a71-9346-e033c64a6245 | lamphanviet/competitive-programming | uva-online-judge/accepted-solutions/1235 - Anti Brute Force Lock.cpp | //============================================================================
// Author : LAM PHAN VIET - <EMAIL>
// Problem Name : 1235 - Anti Brute Force Lock - UVa
// Time Limit : .000s
// Description :
//============================================================================
#include <algorithm>
#in... | ALGO | 0.99992 | 3.998623 |
69186417-b5d3-424b-9a42-8a2d82c43ba5 | spellberry/Owlet | Engine/source/graph/euclidean_graph.cpp | #include "graph/euclidean_graph.hpp"
#include <glm/glm.hpp>
#include <map>
#include <glm/gtx/norm.hpp>
using Segment = std::pair<glm::vec2, glm::vec2>;
using namespace bee::graph;
using namespace bee::geometry2d;
void EuclideanGraph::AddVertex(const glm::vec3& pos) { Graph<VertexWithPosition>::AddVertex(VertexWithPo... | ALGO | 0.99957 | 7.57436 |
f0aabb03-4700-4c28-b0a5-a6196620cbca | AnujaGD/Snippets | C++/rod_cutting_dp_2d.cpp | /**
The Problem
There is a rod of length N lying on x-axis with its left end at x = 0 and right end at x = N. Now, there are M weak points on this rod denoted by positive integer values(all less than N) A1, A2, …, AM. You have to cut rod at all these weak points. You can perform these cuts in any order. After a cut, ... | ALGO | 0.999999 | 5.024598 |
d6b8c63d-b926-43a0-9d7a-138454f41e5c | dxhisboy/lammps-sunway | USER-OMP/npair_full_nsq_ghost_omp.cpp | #include "npair_full_nsq_ghost_omp.h"
#include "npair_omp.h"
#include "neighbor.h"
#include "neigh_list.h"
#include "atom.h"
#include "atom_vec.h"
#include "molecule.h"
#include "domain.h"
#include "my_page.h"
#include "error.h"
using namespace LAMMPS_NS;
using namespace NeighConst;
/* -------------------------------... | ALGO | 0.997642 | 5.185213 |
03213d6d-7027-489b-a38a-16a0f130b215 | alitelli/FreeBSD-ports | multimedia/libv4l/files/patch-utils_v4l2-ctl_v4l2-ctl.cpp | --- utils/v4l2-ctl/v4l2-ctl.cpp.orig 2015-06-14 00:23:03.316457000 -0400
+++ utils/v4l2-ctl/v4l2-ctl.cpp 2015-06-14 00:28:46.421843000 -0400
@@ -614,9 +614,50 @@ static std::string cap2s(unsigned cap)
return s;
}
+#if __FreeBSD_version < 1000000
+
+
+char *strchrnul(const char *p, int ch);
+
+char *
+strchrnul(con... | TOOL | 0.872582 | 6.006849 |
2f623453-f2e7-4f74-8fe5-c1e5aa406234 | raincross7/code-similarity | codes/train_code/problem392/problem392_454.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
char S;
char check[100] = {'a', 'i' ,'u', 'e', 'o'};
bool flag = false;
cin >> S;
for (int i = 0; i < 5; i++){
if (S == check[i]) flag = true;
}
if(flag) {
cout << "vowel" ... | ALGO | 0.9998 | 4.225774 |
0262519d-45f9-4316-8e39-10f8d9fdb8d8 | tado/openFrameworks_examples_v0073 | 44_FFT_Alpha/src/fft.cpp | /**********************************************************************
fft.cpp
This class is a C++ wrapper for original code
written by Dominic Mazzoni in September 2000
This file contains a few FFT routines, including a real-FFT
routine that is almost twice as fast as a normal complex FFT,
and a power spe... | ALGO | 0.999255 | 6.099455 |
22e85fca-532b-48f4-b881-ee1f792da3db | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_11883_2.cpp | #include <bits/stdc++.h>
using namespace std;
long long n, m, m1, len, ans, nex[1000000], wen[1000000], hea[1000000],
l[1000000], r[1000000], a[1000000], fa[1000000];
vector<long long> v;
struct arr {
long long x, y, z, p;
} b[1000000];
long long find(long long x) { return fa[x] == x ? x : fa[x] = find(fa[x]); }
... | ALGO | 0.999892 | 3.855346 |
e320e93d-182a-43ac-86f4-3b22fcece6d8 | M-A-D-A-R-A/CP | S_CP_Sheet/A/10.cpp | #include <bits/stdc++.h>
using namespace std;
#define IOS \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(NULL);
#define pii <pair<int,int>
#define vi vector<int>
#define vp vector<pair<int, int>>
#define vpp vector<pair<pair<int, int>, int>>
#def... | ALGO | 0.997885 | 3.646936 |
a38221c8-316d-4f3a-b83f-8af80f750fe9 | HongSon28/Training | Contest training/VOI25 Training/marvinthang#3B.cpp | #include<bits/stdc++.h>
using namespace std;
const int N=2e5;
int n,q,inf=1e9;
vector<pair<int,int>>adj[N+5];
int a[N+5];
struct query{
int type,u,v;
} qu[N+5];
int t[N+5];
int d[N+5];
int res[N+5];
void dfs(int u,int par) {
for (auto [v,w]:adj[u]) {
if (v==par) continue;
d[v]=d[u]+1;
a[v]=(a[u]^w);
dfs(v,u);... | ALGO | 0.999776 | 5.113808 |
3ba30a3e-842d-4ff3-aec8-ef9ef98b149b | alexandraback/datacollection | solutions_5695413893988352_0/C++/TrePe/B.cpp | #include <stdio.h>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
using namespace std;
int T, t, i, j, k, n;
char sa[1000], sb[1000];
char si[1000], sj[1000];
int abs(int a) {
if (a < 0) return -a;
return a;
}
int main() {
scanf("%d", &T);
for (t = 1; t <= T; t+... | ALGO | 0.999929 | 3.163653 |
73020dd3-3b55-4d5b-ac11-ac7018d538ed | Ang3lino/SistemasDistribuidos | 08Semaforo/7sem3.cpp |
#include <iostream>
#include <unistd.h>
#include <thread>
#include "Semaforo.h"
#define n 10
using namespace std;
int global = 10;
Semaforo sem1, sem2, sem3;
void funcion1() {
while(global > 0){
sem1.wait();
printf("Soy el hilo 1, y esta es la impresion %d\n", global-- );
sem2.post();
... | ALGO | 0.943015 | 4.30123 |
b94028a7-d9f0-4841-bb56-e96e269104fb | ishandutta2007/codeforces | aidos/normal/960/A.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
#include <set>
#include <map>
#include <queue>
#include <ctime>
#define pb push_back
#define ll long long
#define mp make_pair
#define f first
#define s second
#define pii pair < int, int ... | ALGO | 0.999689 | 3.374982 |
4ea17fc2-b70a-4c7f-87a4-5d8840839a3d | ganwenyao/opencv_js | opencv/modules/ml/src/testset.cpp | #include "precomp.hpp"
namespace cv { namespace ml {
struct PairDI
{
double d;
int i;
};
struct CmpPairDI
{
bool operator ()(const PairDI& e1, const PairDI& e2) const
{
return (e1.d < e2.d) || (e1.d == e2.d && e1.i < e2.i);
}
};
void createConcentricSpheresTestSet( int num_samples, in... | TEST | 0.967426 | 6.612592 |
033cebf0-4d97-41dc-9441-d1b3c4290b25 | APeculiarCamber/BEV | detectron2/detectron2/layers/csrc/cocoeval/cocoeval.cpp | using namespace pybind11::literals;
namespace detectron2 {
namespace COCOeval {
// Sort detections from highest score to lowest, such that
// detection_instances[detection_sorted_indices[t]] >=
// detection_instances[detection_sorted_indices[t+1]]. Use stable_sort to match
// original COCO API
void SortInstancesByD... | DATA | 0.99645 | 7.85893 |
fd664aed-5b4c-4110-bb23-a1ecaa10c831 | gitcrusher/Cpp_codes | strucutures Unions and enums/default_arguments.cpp | #include <iostream>
#include <iomanip>
using namespace std;
int main() {
double value = 1234.56789;
cout << setw(10) << setfill('*') << value;
return 0;
} | ALGO | 0.993658 | 3.538724 |
7c88f3d8-fcac-40c0-8209-55489932ce12 | Xushi8/Code | 2024/June/lyd/8.cpp | // 2024/06/20 15:07:36
#ifdef LOCAL
#include <basic_std_lib.h>
#else
#include <bits/stdc++.h>
#endif
using namespace std;
using i64 = int64_t;
using u64 = uint64_t;
using pii = pair<int, int>;
using pll = pair<i64, i64>;
constexpr int N = 1000005;
void solve()
{
int n, W1, W2;
cin >> n >> W1 >> W2;
vector... | ALGO | 0.999981 | 5.185221 |
90595cae-23fe-489a-8261-5a51b1aea897 | master-hkshenoycse/CP | DailyPractice/20240803/LC_1460.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution {
public:
bool canBeEqual(vector<int>& target, vector<int>& arr) {
vector<int> cnt(1001,0);
for(auto t:target){
cnt[t]++;
}
for(auto t:arr){
cnt[t]--;
}
for(int i=1;i<=1000;i++){
... | ALGO | 0.999891 | 5.371787 |
e8710a1f-d5fe-4413-9d0a-64582ca61e8a | Wally4Ever/Programare_C_1 | Valentin.P_L7_03.cpp | //Program de calculare a unui termen la n putere
//Valentin Ples, grupa 2012
#include <iostream>
#define _CRT_SECURE_NO_WARNINGS
using namespace std;
int putere (int, int);
int main()
{
int a, n;
a=2;
printf("Introduceti n : ");
scanf("%d",&n);
printf("Valoarea finala este %d", putere(a, n));
}
int putere(... | ALGO | 0.999835 | 4.730684 |
1c5d4832-9e6e-45d0-a908-1080795eff65 | oakesjoshuad/cs1205 | homework4/bonushwk4.cpp | // Beginning of Source
// Name: Joshua Oakes
// ID No: 2411639
// Course Number and Section: 1205-601
// Date: 06/02/2011
// Assignment: Bonus Homework 4
#include <iostream>
using namespace std;
void printMinimum(int minimum){
cout << "Minimum of sequence is: " << minimum << endl;
}
int getNumber(){
int result(0);... | ALGO | 0.996356 | 4.941904 |
3697bd1f-f9ea-4420-863d-31091236bb23 | sigvs/Solver | Algoithms/NSGA-II/NSGA2PopulationAdder.cpp | #include "NSGA2PopulationAdder.h"
//************************************************************************************************
NSGA2PopulationAdder::NSGA2PopulationAdder()
{
};
//************************************************************************************************
NSGA2PopulationAdder::NSGA2PopulationA... | ALGO | 0.947685 | 4.614097 |
6debe2c8-7971-4fdc-91f8-28fd44d54c09 | lakshaygoyal425/DS-Algorithmic-Questions | Data Structure/Sorting/Selection Sort.cpp | #include<bits/stdc++.h>
using namespace std;
int SelectionSort(int arr[], int n){
for(int i=0;i<n-1;i++){
int min = i;
for(int j=i+1;j<n;j++){
if(arr[j] < arr[min]){
min = j;
}
}
swap(arr[min], arr[i]);
}
}
int main()
{
int arr[] = {15, 36, 7, 38, 10, 20, 68};
int n = sizeof(arr)/sizeof(arr[0]);... | ALGO | 0.999793 | 4.242883 |
2e22a570-6f73-4658-bce1-509725f5c83e | Anas-Hamo23/Codeforces-Solutions | A/A - Plus or Minus.cpp | #include<iostream>
#include<math.h>
#include<algorithm>
#include<string.h>
#include<vector>
#include<map>
#include<bitset>
#include<set>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int anas; cin >> anas;
while (anas--)
{
int x, y, z;
cin >> x >> y >> z;
if ((x + y) ... | ALGO | 0.999843 | 4.613526 |
47ea9d94-c069-4303-98a9-6e3523bd0fdd | KrutagyaKaneria/leetcode | 73-set-matrix-zeroes/set-matrix-zeroes.cpp | class Solution {
public:
void setZeroes(vector<vector<int>>& matrix) {
int m = matrix.size();
int n = matrix[0].size();
bool firstRowZero = false;
bool firstColZero = false;
// Step 1: Check if first row has any zeros
for (int j = 0; j < n; j++) {
if (mat... | ALGO | 0.999468 | 7.458203 |
50473974-5141-4bd3-8da9-62413be7db94 | ishandutta2007/codeforces | andreasyan/normal/1156/A.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 102;
int n;
int a[N];
int ans;
int main()
{
cin >> n;
for (int i = 1; i <= n; ++i)
cin >> a[i];
for (int i = 2; i <= n; ++i)
{
if (a[i] == 1 && a[i - 1] == 2)
ans += 3;
else if (a[i] == 1 && a[i - 1] == 3)... | ALGO | 0.99993 | 3.710729 |
932a3576-4fb9-4627-9f68-87f2ba90571d | arifuljannatarif/programming-solutions | 678__A - Johny Likes Numbers__Accepted.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int a,b,x,ans;
cin>>a>>b;
x=a/b;
if(x*b==a)
{
cout<<a+b;
}
else
{
cout<<b*(x+1);
}
return 0;
} | ALGO | 0.999879 | 3.227399 |
9ef48f64-e6a9-4d19-8989-91facbaab44c | saxenaparas/Cplusplus | Questions of C++/Array/Spiral_Order_Matrix_Transversal.cpp | /*
------------ SPIRAL ORDER MATRIX TRANSVERSAL : -----------------
================================================================
Lecture 26 [2D-Array] of C++ [APNA COLLAGE] watch to understand.
================================================================
*/
#include <bits/stdc++.h>
using namespace std;
int m... | ALGO | 0.999666 | 4.423248 |
48aedd66-2747-4630-ad68-809f41b1a3c8 | Nithin6252-reddy/data-structures | stacks/queue.cpp | #include<bits/stdc++.h>
using namespace std;
class Queue{
int *arr;
int front;
int rear;
int size;
public:
Queue(int s)
{
arr = new int[s];
front = -1;
rear = -1;
size = s;
}
void enqueue(int key)
{
if(rear= size)
{
c... | ALGO | 0.938285 | 3.672149 |
efcf3a89-f1c1-414a-ab37-5099615d3946 | tjakra-birawa/Algoritma_Struktur_Data | Pointer Malloc Struct/dasar_aritmatika.cpp | #include<iostream>
using namespace std;
struct Poli
{
int bil;
};
Poli P1[10],*P2[10],P3[10];
void isiPolinom()
{
P1[0].bil=15;
P1[3].bil=1;
P1[5].bil=5;
P1[7].bil=8;
P1[8].bil=6;
P2[0]->bil=10;
P2[2]->bil=2;
P2[3]->bil=2;
P2[4]->bil=3;
P2[7]->bil=4;
P2[9]->bil=3;
P3[0].bil=5;
P3[2].bil=1;
}
vo... | ALGO | 0.999426 | 3.685168 |
68b1318c-04c2-4fec-a364-3cf863a2c21f | hhu1506010220/ACM_Repository | cf481/B.cpp | #include<bits/stdc++.h>
using namespace std;
int main() {
int n;
cin>>n;
int num=0;
char s[105];
cin>>s;
for(int i=0; i<n; i++) {
if(s[i]=='x'&&s[i+1]=='x') {
while(s[i+2]=='x') {
num++;
int j;
for( j=i+2; j<n-1; j++) {
s[j]=s[j+1];
}
s[j]='\0';
}
}
}
cout<<num<<endl;
return... | ALGO | 0.999219 | 3.13406 |
f5e5d5e0-52db-42f4-ae68-9dca27551de2 | mshafqats/HackerEarth | Data Structure/Advanced Data Structures/Fenwick (Binary Indexed) Trees/One Girl One Sequence.cpp | /*
=====================
| ID: mshafqats |
| LANG: C++ |
=====================
Mohammad Shafqat Siddiqui
*/
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e6 + 8;
int fen[MAXN], n;
pair<int, int> a[MAXN];
void add(int ind, int x)
{
for(; ind <= n; ind += ind & -ind)
fen[ind] += x;
re... | ALGO | 0.999927 | 4.157756 |
82212400-bf9b-470a-83e5-967f2aef673d | vietnux/CodeEditorMobile | examples/cpp/average-arrays.cpp | // C++ Program to Calculate Average of Numbers Using Arrays
// This program takes n number of element from user (where, n is specified by user), stores data in an array and calculates the average of those numbers.
#include <iostream>
using namespace std;
int main()
{
int n, i;
float num[100], sum=0.0, averag... | ALGO | 0.997027 | 5.198829 |
ee4fd6d9-bb36-466e-992f-0208beb959d1 | ManuelGonzalezL/MPGOLOGY | main.cpp | #include <iomanip>
#include <chrono>
#include <ctime>
#include <ratio>
#include <algorithm>
using namespace std;
using namespace std::chrono;
#include "heapsort.h"
#include "quicksort.h"
int main() {
vector<Vehicle> v; //original vector
vector<Vehicle> h; //heap sort vector
vector<Vehicle> q; //quick sort vecto... | ALGO | 0.984577 | 4.30695 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.