uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
6169d295-b172-41ee-a8cd-148641288463 | SwordWong/FunctionalRecovery | algorithm/kdtree/AABB.cpp | #include "AABB.h"
namespace ldp
{
namespace kdtree
{
Point AABB::getCorner(uint8_t corner) const {
return Point(corner & 1 ? max[0] : min[0],
corner & 2 ? max[1] : min[1],
corner & 4 ? max[2] : min[2]);
}
bool AABB::overlaps(const BSphere &sphere) const {
real distance = 0;
for (int i = 0; i... | ALGO | 0.970151 | 6.305297 |
779d1859-a1fe-41ea-978f-e41db7be3bca | aanu2021/Leetcode-Solutions | Number of 1 Bits - GFG/number-of-1-bits.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
int setBits(int n) {
return __builtin_popcount(n);
}
};
//{ Driver Code Starts.
int main() {
int t;
cin >> t;
while (t--) {
int N;
cin >> N;
Soluti... | ALGO | 0.999959 | 6.433685 |
be4ca14c-7482-418a-8cdc-367ec8eca1f6 | Ayushluthra2001/LeetCodeTop150 | Triangle(TLE).cpp |
class Solution {
public:
int solve(int index , vector<vector<int>>& triangle, int currRow , int size){
if( currRow >= size) return 0;
int down = triangle[currRow][index]+solve(index,triangle,currRow+1,size);
int downRight = triangle[currRow][index]+solve(index+1,triangle,currRo... | ALGO | 0.999978 | 6.352672 |
b725349f-90b5-4377-b193-1aa3cfe8d3b1 | ishandutta2007/codeforces | weakesttopology/normal/1495/D.cpp | #include "bits/stdc++.h"
using namespace std;
#define _ ios_base::sync_with_stdio(0);cin.tie(0);
#define endl '\n'
#define debug(x) cerr << #x << " == " << (x) << '\n';
#define all(X) begin(X), end(X)
#define size(X) (int)std::size(X)
using ll = long long;
const int INF = 0x3f3f3f3f;
const ll LINF = 0x3f3f3f3f3f3f3... | ALGO | 0.999968 | 5.108043 |
16999551-ae43-4d67-a94d-238c8efdda31 | Andruixxd31/Competitive-Programming | CF-A/CF732-D2-A.cpp | #include <iostream>
using namespace std;
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
int k, r;
int i;
cin >> k >> r;
for (i = 1;; i++)
if (k * i % 10 == 0 || (k * i - r) % 10 == 0)
break;
cout << i;
}
// 31 ms 0 KB | ALGO | 0.999646 | 3.512051 |
488f6ff5-aaad-4c3f-a45e-445ca99cf282 | GauthamPrabhuM/LeetCode | pascalstriangle.cpp | class Solution {
public:
vector<vector<int>> generate(int numRows) {
vector<vector<int>> res;
for(int i=0; i<numRows; i++)
{
vector<int>row(i+1, 1);
for(int j=1; j<i; j++)
{
row[j]=res[i-1][j]+res[i-1][j-1];
}
r... | ALGO | 0.999957 | 5.601486 |
988edd68-082b-4429-bd60-51c7eb237ad6 | Krishnachandarana11/bhagavt_gita | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998733 | 6.76775 |
eaa999f9-39d4-4eb7-8f9e-ee195e758d85 | alexandraback/datacollection | solutions_5769900270288896_0/C++/kusumit/b.cpp | #include <bits/stdc++.h>
using namespace std;
int minV = 1000000;
bool o[16][16];
//int save[16][16];
int numWalls(int r, int c)
{
int rightW = 0, downW = 0;
for (int i = 0; i < r; ++i) {
for (int j = 0; j < c; ++j) {
if (j != c - 1 && o[i][j] && o[i][j + 1]) {
++rightW;
}
if (i != r - 1 &... | ALGO | 0.99933 | 4.13371 |
9befacc5-bbed-46fc-ba4b-baee6c7d532b | hieule22/cwizard | third_party/boost/upstream/intrusive/example/doc_slist_algorithms.cpp | struct my_node
{
my_node *next_;
//other members...
};
//Define our own slist_node_traits
struct my_slist_node_traits
{
typedef my_node node;
typedef my_node * node_ptr;
typedef const my_node * const_node_ptr;
stati... | TOOL | 0.983551 | 6.203195 |
50880658-ec40-4c09-b056-21c8572edf64 | jaymalave/CompetitiveCoding | LeetCode/revnum.cpp | #include<iostream>
using namespace std;
int main(){
signed int num, reversedNum = 0, rem; //we have to define revNum as it will o/w store a garbage value
cout<<"Enter an integer: ";
cin>>num;
while(num != 0){
rem = num%10;
reversedNum = reversedNum*10 + rem;
num /= 10;
}
cout<<"Reverse... | ALGO | 0.999496 | 3.37991 |
d6f1f594-b4f3-4682-99f9-e62788b1178b | Shahbaz898414/Codeforces | Practice Question/Div 3/Codeforces Round #481 (Div. 3)/q1.cpp | #include<bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
using namespace std;
int UnOrderLinearSearch(ll a[],ll n,ll m ){
for (int i = 0; i <n; i++) {
if(a[i]==m){
return i;
}
}
return -1;
}
int SortedLinearSreach(ll a[],ll n,ll m){
for (int i = 0; i <n; i++)
{
... | ALGO | 0.999992 | 5.436037 |
939c4b48-375d-45ce-bf41-65b109859ea4 | WhiteCells/code | algo/daily/24/03/21.cpp | #include "../../head_file.h"
/*
problme:
url:
*/
class FrequencyTracker {
public:
FrequencyTracker():freq(N), freq_cnt(N) {
}
void add(int number) {
--freq_cnt[freq[number]];
++freq[number];
++freq_cnt[freq[number]];
}
void deleteOne(int number) {
... | ALGO | 0.974257 | 5.1369 |
ab900698-87e1-4df7-887b-8e8558342d6f | ishandutta2007/codeforces | coderanshu/normal/1644/E.cpp | // Har Har Mahadev
#include<bits/stdc++.h>
using namespace std ;
#define ll long long
#define pb push_back
#define all(v) v.begin(),v.end()
#define sz(a) (ll)a.size()
#define F first
#define S second
#define INF 2000000000000000000
#... | ALGO | 0.999883 | 4.107874 |
b9c0f317-4177-45b3-a8fd-fb29f01f79a7 | stefanos1316/Rosetta-Code-Research | Scripts/Task/van-der-corput-sequence/c++/van-der-corput-sequence.cpp | #include <cmath>
#include <iostream>
double vdc(int n, double base = 2)
{
double vdc = 0, denom = 1;
while (n)
{
vdc += fmod(n, base) / (denom *= base);
n /= base; // note: conversion from 'double' to 'int'
}
return vdc;
}
int main()
{
for (double base = 2; base < 6; ++base)
... | ALGO | 0.979582 | 6.434432 |
dbbb49b8-5b3a-4954-9d6c-284a80e91c8b | kummandas/400DSA | STRING/73.cpp | // C++ implementation of the approach
#include <bits/stdc++.h>
using namespace std;
// Function to return the minimum number of
// characters of the given binary string
// to be replaced to make the string alternating
int minReplacement(string s, int len)
{
int ans = 0;
for (int i = 0; i < len; i++) {
// If there... | ALGO | 0.99993 | 5.879382 |
200135ff-1191-420d-bbde-85b76c850f90 | cornliu26/LeetCode_800_CPP | 101-200/115. Distinct Subsequences/dynamic_programming.cpp | #include <iostream>
using namespace std;
class Solution {
public:
int numDistinct(string s, string t) {
int count{0};
unsigned long long dp1[s.size()], dp2[s.size()];
unsigned long long *pre{dp1}, *crt{dp2}, *temp;
for (int j{0}; j < s.size(); ++j) {
if (s[j] == t[0])... | ALGO | 0.999959 | 6.239152 |
eb4819f7-81ba-4fee-a7f6-8f72967d2f55 | zhong-zh15/Multi_Flyby_Dynamic_Programming | code/src/main.cpp | #include "GTOC4_Problem.h"
#include "DP_flyby_2impulse.h"
#include "GTOC11_problem.h"
#include <chrono>
#include <fstream>
#include <iostream>
#include "DP_flyby_2impulse_user_function.h"
int main()
{
read_data_GTOC11();
GTOC11_sequence_process();
read_asteroid_data_GTOC4();
GTOC4_sequence_process();
//{... | ALGO | 0.997463 | 5.316782 |
93900651-c00e-4c8b-9d2b-caec3efa440b | plenilune3/problem_solving_cpp | beakjoon/BaaaaaaaarkingDog/Trie/5446_용량 부족.cpp | #include <iostream>
using namespace std;
const int MAX = 1e3 + 1;
class node
{
private:
node* child[96];
bool finished, deleted;
int count;
public:
node();
~node();
void insert(const char* word, bool d);
int char_to_index(const char a);
int count_delete();
};
int N, M;
char files_A[M... | ALGO | 0.999788 | 4.510257 |
15e4e3f5-b58a-4411-a91c-143615b33c9f | beeplovsharma/Coding-Mania | 1450-delete-leaves-with-a-given-value/delete-leaves-with-a-given-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.999835 | 6.430237 |
380d64ad-56b9-4891-a74a-5fffcf6cdfa6 | gaodechen/OI_History | problems/poj1419.cpp | #include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
const int N = 105;
int t, n, m, ans, tmp[N], mark[N], group[N], G[N][N];
bool DFS( int u, int ans_ )
{
for( int i = u + 1; i <= n; i++ )
{
if( mark[i] + ans_ <= ans )
return 0;
if( G[u][i]... | ALGO | 0.999869 | 4.832225 |
7407da2e-0155-49eb-93ec-2ce8e7f2cd90 | vishnu510/LeetCode_Problem | 1329-sort-the-matrix-diagonally/1329-sort-the-matrix-diagonally.cpp | class Solution {
public:
vector<vector<int>> diagonalSort(vector<vector<int>>& mat) {
vector<int> temp;
int m = mat.size(), n = mat[0].size();
for(int r = 0;r<m;r++){
temp.clear();
for(int j =0,i =r;j<n && i<m;i++,j++){
temp.push_back... | ALGO | 0.999989 | 6.093296 |
00c79be3-1f2b-4273-8397-6c81ecaad9eb | TrucJ/codeforces-submissions | contest/2061/C.cpp | // Problem: C. Kevin and Puzzle
// Contest: Codeforces - IAEPC Preliminary Contest (Codeforces Round 999, Div. 1 + Div. 2)
// URL: https://codeforces.com/contest/2061/problem/C
// Memory Limit: 256 MB
// Time Limit: 2000 ms
//
// Powered by CP Editor (https://cpeditor.org)
/*
__/\\\\\\\\\\\\\\\_______________________... | ALGO | 0.999945 | 4.861802 |
fdd9f0f6-ebc6-44b5-a377-825e0b6d3243 | msipos/syntaxic | src/core/util.cpp | #include "core/util.hpp"
#include <chrono>
#include <cctype>
#include <stdexcept>
#include <QCoreApplication>
#include <QDir>
#include <QFileInfo>
double get_current_time() {
auto tp = std::chrono::high_resolution_clock::now().time_since_epoch();
return std::chrono::duration_cast<std::chrono::milliseconds>(tp).co... | TOOL | 0.92836 | 6.374364 |
06d98334-8f5d-4578-887a-48210d664889 | Riyasuthar1/100-days-of-Embedded-systems-programming- | level2/qus 10.cpp | //Write a loop program to print the sum of two-digit odd numbers, whose ten's digit is 7.
#include<stdio.h>
int main(){
int sum;
for(int i=10;i<=99;i++){
if(i%2!=0){
if(i/10==7){
sum=sum+i;
}
}
}
printf("%d",sum);
return 0;
}
| ALGO | 0.99863 | 4.346509 |
500d543a-d722-45ce-b486-d2819e8f8c71 | sifat-hossain-niloy/CodeForces-Solutions | A_Linear_Keyboard.cpp | #include<bits/stdc++.h>
#include<stdio.h>
using namespace std;
#define MOD 1000000007
#define ll long long
#define TC(t) int t;cin >> t;while(t--)
#define FL(t) for(int i=0;i<t;i++)
#define Y cout << "YES\n"
#define N cout << "NO\n"
#define ff first
#define ss second
#d... | ALGO | 0.999859 | 4.43114 |
d70338e7-5a64-4b74-ba71-3917d4e3e45d | PRADUMN-2020/LeetCode_Solutions | 3113-beautiful-towers-ii/beautiful-towers-ii.cpp | class Solution {
public:
long long maximumSumOfHeights(vector<int>& mxh) {
// Time:O(n), Space:O(n)
int n=mxh.size();
vector<int>nsr(n,n),nsl(n,-1);
// calculating next greater to right
stack<int>st;
for(int i=n-1;i>=0;i--)
{
if(st.size())
... | ALGO | 0.999925 | 5.699957 |
7bcfc8c4-4907-4e63-bf97-cee5c468a848 | mirinta/leet_code | dynamic_programming/basic_I/0376_wiggle_subsequence.cpp | #include <array>
#include <vector>
/**
* A wiggle sequence is a sequence where the differences between successive numbers strictly
* alternate between positive and negative. The first difference (if one exists) may be either
* positive or negative. A sequence with one element and a sequence with two non-equal eleme... | ALGO | 0.999971 | 6.541677 |
99d41490-6ad4-476b-b11a-f3b543d74833 | chandreyeeshome/CPP | ASSIGNMENT_1/Q10.cpp | //ASSIGNMENT 1 Q) 10)
//Write a program to Generate Characters from ASCII Values.
#include<iostream>
using namespace std;
int main()
{
int ascii;
cout<<"Enter an ASCII value: ";
cin>>ascii;
cout<<"The equivalent character for ASCII value "<<ascii<<" is: "<<char(ascii);
return 0;
} | TOOL | 0.964949 | 3.444993 |
f043176a-f659-48e3-99ee-0259966f918c | bahador96/Tetromino-Game | 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.998841 | 6.783336 |
bde51eb3-1ae3-4a98-bfea-362c8c9414e1 | BoiMombe/projects | lab3/BitWiseOperators.cpp | #include <iostream>
using namespace std;
main()
{
unsigned int a = 60;
unsigned int b = 13;
int c = 0;
c = a & b;
cout << "Line 1 - Value of c is :" << c << endl;
c = a | b;
cout << "Line 2 - Value of c is :" << c << endl;
c = a ^ b;
cout << "Line 3 - Value of c is :" << c << end... | ALGO | 0.991648 | 4.200502 |
512d7fe0-9310-41a9-9e15-b200ec499555 | NguyenTaiAnh/course_flutter_basic | favorite_images/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.999073 | 6.785645 |
23f8ba12-4cd7-4d21-b9f7-7dca74567531 | cianjinks/raytracing | dependencies/glm/test/core/core_func_matrix.cpp | #include <glm/matrix.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtc/ulp.hpp>
#include <glm/gtc/epsilon.hpp>
#include <glm/gtc/constants.hpp>
#include <vector>
#include <ctime>
#include <cstdio>
using namespace glm;
int test_matrixCompMult()
{
int Error(0);
{
mat2 m(0, 1, 2, 3);
mat2 n = matrixC... | TEST | 0.934741 | 6.693093 |
dd3e9e17-805a-4621-9fac-1318b2c0b0c9 | prashant-smart/Leetcode-Daily-Questions | 606-construct-string-from-binary-tree/606-construct-string-from-binary-tree.cpp |
class Solution {
public:
static string tree2str(const TreeNode* root) {
string ans;
tree2Str(root, ans);
return ans;
}
static void tree2Str(const TreeNode* node, string& ans) {
if (!node) return;
ans += to_string(node->val);
if (node->left) { //left side ... | ALGO | 0.999884 | 6.600806 |
f68045e1-a8f1-4b84-9f88-ee340e137d81 | sh19910711/memo | codeforces.com/problemset/202402.093422/1647a.cpp | #include <bits/stdc++.h>
using namespace std;
#define loop ri(__num_cases); rep(__case,__num_cases)
#define rep(i, n) for (int i = 0; i < n; ++i)
#define per(i, n) for (int i = n-1; i >= 0; --i)
template <class ...Args> auto& __ri(Args &...args) { return (cin >> ... >> args); }
#define ri(...) int_t __VA_ARGS__; __ri(_... | ALGO | 0.999849 | 4.309902 |
98ef766d-39d6-4e92-92f2-7fa6f9324e23 | jayendra1107/data-structure-and-algorithms | Linked List/08_reverse_linked_list.cpp | // Program to reverse linked list
#include<iostream>
#include "Node.cpp" // This line calls the Node.cpp where a class is created to build linked list data type
using namespace std;
// Input Linked List
// This function takes input until -1
Node *take_input() {
int data;
cin>>data;
Node *head = nullptr;
... | ALGO | 0.999873 | 5.5909 |
6c4bd0cc-d01e-47cb-895a-eb6622a9d70c | zmy235/DP-ProblemsList | 最长上升子序列.cpp | /*10:Pku acm 2533 Longest Ordered Subsequence最长上升子序列*/
#include "iostream"
using namespace std;
int f[10000];
int a[10000];
int main()
{
int n,i,j,max;
while(scanf("%d",&n)!=EOF)
{
for(i=0;i<n;i++)
{
scanf("%d",&a[i]);
}
memset(f,0,sizeof(f));
max=0;
for(i=1;i<=n;i++)
{
f[i]=1;
for(j=0;j<=i;j+... | ALGO | 0.99983 | 3.848191 |
33798801-7bf3-488f-a433-d57212458a1f | jeha0714/Algorithm | Algorithm/Sieve of Eratosthenes/20230930_1929/solution.cpp | #include <iostream>
#include <cmath> // sqrt
/* Main */
int main(void)
{
std::ios_base::sync_with_stdio(false);
std::cout.tie(NULL);
std::cin.tie(NULL);
int N,M;
int *sequence;
/* Set initial input */
std::cin >> M >> N;
sequence = new int[N + 1];
for (int n = 1; n <= N; n++)
sequence[n] = 1;
/* Sieve o... | ALGO | 0.999982 | 3.410824 |
8a513d5f-edd6-4a24-87fc-7c25baba3b32 | AaftabPatel/cppPrograms | dataStructures/minheap.cpp | //program for implementing min heap
#include<iostream>
using namespace std;
struct node{
int data;
node *left, *right, *prev;
};
class heap{
public:
node *root;
heap(){ //constructor
root=NULL;
}
void insert(int num){ //function to add elem... | ALGO | 0.999822 | 4.912666 |
c9ce14e1-fe94-4018-8c89-6333100c13f4 | harshalthakre123/cpp-practice | 18NOV/hcfLCM.cpp | #include<iostream>
using namespace std;
int main()
{
int a, b, ans, lcm;
cout<<"Enter any two no.";
cin>>a>>b;
// HCF-----------
if(a>b)
{
for(int i=1; i<=b; i++)
{if(a%i==0 && b%i==0)
{
ans=i;
}
}
cout<<ans<<"HCF"<<endl;
lcm=(a... | ALGO | 0.999201 | 3.35497 |
5d02bfb9-7d1c-4603-922f-c841da0cb989 | vishnu1345/dsa | old/trees/isbst2.cpp | #include<iostream>
using namespace std;
class Node{
public:
int data;
Node* left;
Node* right;
Node(int d){
this->data = d;
this->left = NULL;
this->right = NULL;
}
};
void insert(Node* &root , int d){
if(root==NULL){
root = new Node(d);
return ;
... | ALGO | 0.999958 | 6.682641 |
b7338001-ca3e-49d3-970b-d352dc43f471 | rajeshwarareddy2127/csa5193cryptography | ciser_cipher.cpp | #include <stdio.h>
#include <string.h>
void encryption(char s[], char res[], int k,int n) {
int index = 0;
for (int i = 0; i < n; i++) {
int num = (int)s[i] + k;
res[index++] = (char)num;
}
res[index] = '\0';
printf("Encrypted string: %s\n", res);
}
void decryption(char res[]... | ALGO | 0.999833 | 4.223009 |
80813120-81c6-4950-bb5b-d76c9916ced2 | Haricharan1212/CP | oldcode/1843F1.cpp | // Haricharan
#include <bits/stdc++.h>
using namespace std;
#define int long long int
#define vi vector<int>
#define vii vector<vector<int>>
#define vb vector<bool>
#define pi pair<int, int>
#define si set<int>
#define rep(var, l, r) for (int var = l; var < r; var++)
void solve()
{
int n;
cin >> n;
int c... | ALGO | 0.999731 | 4.461544 |
dc8fee45-2798-457d-a84c-04d1ea795376 | neerajcodes888/GFG | Easy/Does array represent Heap/does-array-represent-heap.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution{
public:
bool isMaxHeap(int arr[], int n)
{
for(int i=0;i<n/2;i++)
{
if((arr[i]<arr[2*i+1]) || (arr[i]<arr[2*i+2]))
return false;
}
return true;... | ALGO | 0.990331 | 4.960089 |
1c1a0d05-05b9-409a-be87-1ec3741dbc0e | pioneerAlpha/CP_Beginner_B1 | Class 12 - solve class 5/I.cpp | #include<bits/stdc++.h>
#define fastio ios_base::sync_with_stdio(false),cin.tie(NULL)
#define endl "\n"
#define ll long long
#define N ((int)(3e5 + 5))
#define MOD ((int)(1e9 + 7))
using namespace std;
/*fast io
ios_base::sync_with_stdio(false);
cin.tie(NULL);
*/
int main()
{
fastio;
int n;
cin>>n;
i... | ALGO | 0.999933 | 3.551658 |
2941a364-3cf5-4b71-ac53-6d46748f7136 | aashish1309/leetcode | 2677-cousins-in-binary-tree-ii/cousins-in-binary-tree-ii.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.999972 | 5.777951 |
6ce90424-53fc-40bb-b7cf-30f8b646fbfd | niexiaokun/my_solutions_to_leetcode | 00414-Third-Maximum-Number.cpp | #include <bits/stdc++.h>
using namespace std;
//class Solution {
//public:
// int thirdMax(vector<int> &nums) {
// int res1 = INT_MIN, res2 = INT_MIN, res3 = INT_MIN;
// sort(nums.begin(), nums.end());
// nums.erase(unique(nums.begin(), nums.end()), nums.end());
// for (int i = 0; i < n... | ALGO | 0.999925 | 4.712986 |
06f549b4-c588-47c1-97af-fc3d38c6b10c | bttazkiya/Decision-If---Else- | 2.cpp | // Menentukan Diskon dan Total Pembayaran
#include <iostream>
using namespace std;
int main () {
float total_pembelian, discount;
cout << "\n=== Diskon dan Total Pembayaran ===\n" << endl;
cout << "Masukkan Total Pembelian: ";
cin >> total_pembelian;
if(total_pembelian >= 100000){
discount ... | TOOL | 0.971796 | 3.997107 |
cb59e123-efef-4923-813e-1e4ddf0982e4 | Daffodils-and-Chocolates/Cpp | Tution/Basic/CheckIfPrime.cpp | #include <iostream>
using namespace std;
void checkPrime(int n){
bool prime=true;
for(int i=2;i<n;i++){
if(n%i==0){
prime = false;
break;
}
}
if(prime==1){
cout<<"True";
}
else{
cout<<"False";
}
}
int main(){
int n;
cout << "E... | ALGO | 0.999336 | 4.361372 |
ffc7f6f7-5653-47e5-bec4-b767f34110bd | var500/Cpp | SubArray/MaxSum.cpp | #include <iostream>
#include <climits>
using namespace std;
//Kadane's Algorithm O(n)
int main(){
int n=6;
int arr[n]={-1,4,1,2,3,4};
int maxSum=INT_MIN;
int currentSum = 0;
for(int i=0;i<n;i++){
currentSum += arr[i];
if(currentSum <0){
currentSum=0;
}
m... | ALGO | 0.99991 | 4.776073 |
fb7d7467-1f47-426b-80f2-52308438e4d0 | opencv/opencv_attic | opencv/samples/cpp/tutorial_code/Histograms_Matching/calcHist_Demo.cpp | /**
* @function calcHist_Demo.cpp
* @brief Demo code to use the function calcHist
* @author
*/
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include <iostream>
#include <stdio.h>
using namespace std;
using namespace cv;
/**
* @function main
*/
int main( int argc, char** argv )
... | ALGO | 0.903521 | 6.579911 |
2cfe6ffc-72ce-41e6-9c5b-23fb278e16ed | jpdotcom/comp_prog-archive | Auto_Upload_Codeforces/Codeforces_Round_815_Div_2/C_Corners.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define pb push_back
#define FOR(b) for(int i=0;i<(int)b;i++)
#define mp(a,b) make_pair(a,b)
typedef std::vector<long long> vi;
typedef std::pair<int,int> pi;
typedef long long ll;
#define F first
#define S second
... | ALGO | 0.999909 | 4.400062 |
5b93eb27-0280-433b-9e2c-f847c09795fb | NikhilYadavCoder/AdvanceArrays | longestconsecutiveseq.cpp | // optimal
// O(n+m)
// #include<bits/stdc++.h>
// using namespace std;
// int main(){
// int n;
// cin>>n;
// int arr[n];
// for(int i=0;i<n;i++){
// cin>>arr[i];
// }
// int max = INT_MIN;
// for(int i=0;i<n;i++){
// if(arr[i]>max){
// max = arr[i];
// ... | ALGO | 0.999963 | 4.798222 |
32f4edce-8b28-4193-acfc-8a33a56720d4 | mdarafat1819/Codeforces | 1355A - Sequence with Digits.cpp | #include <bits/stdc++.h>
using namespace std;
long long solve(long long n)
{
int mn = n % 10, mx = n % 10;
while(n)
{
int rem = n % 10;
mn = min(mn, rem);
mx = max(mx, rem);
if(!mn) return 0;
n /= 10;
}
return mn * mx;
}
int main()
{
long long t, n, k;
... | ALGO | 0.999952 | 4.500465 |
76a2a89a-6541-49e9-9d11-0e8bb2e29129 | AndrewSSB/Advanced-Algorithms | Lab5/TSP_with_convex_hull.cpp | #include <iterator>
#include <vector>
#include <iostream>
#include <algorithm>
#include <math.h>
#include <climits>
using namespace std;
struct coords{
int x;
int y;
friend istream&operator>>(istream& in, coords & obj){
in >> obj.x;
in >> obj.y;
return in;
}
friend ostrea... | ALGO | 0.999999 | 4.257084 |
a1f60557-9411-45a5-93bb-5d4c1f8f16d6 | RodionKratPlvision/sai_hw | bm/behavioral-model/src/bm_sim/lookup_structures.cpp | /*
* Gordon Bailey (<EMAIL>)
* Antonin Bas (<EMAIL>)
*
*/
#include <bm/bm_sim/lookup_structures.h>
#include <bm/bm_sim/match_key_types.h>
#include <algorithm> // for std::swap
#include <unordered_map>
#include <vector>
#include <tuple>
#include <limits>
#include <list>
#include <mutex>
#include "lpm_trie.h"
na... | TOOL | 0.933823 | 4.220575 |
0a591de0-05f0-4f7b-944a-35c3ec5c6e36 | priyanshi585/DSA | Stack/twoStacks_in_array.cpp | #include <iostream>
using namespace std;
class twoStack
{
public:
int *arr;
int top1;
int top2;
int size;
twoStack(int size)
{
this->size = size;
top1 = -1;
top2 = size;
arr = new int[size];
}
void push1(int elem)
{
if (top2 - top1 > 1)
... | ALGO | 0.99953 | 4.411121 |
4dfc97e2-7e4e-47be-b2c9-43ea74775cc8 | Nikitiwe/Leetcode | 2034-minimum-absolute-difference-queries/2034-minimum-absolute-difference-queries.cpp | class Solution {
public:
vector<int> minDifference(vector<int>& nums, vector<vector<int>>& q) {
vector<vector<int>> arr(nums.size()+1, vector<int> (101, 0));
arr[1][nums[0]]++;
for (int i=1; i<nums.size(); i++)
{
arr[i+1]=arr[i];
arr[i+1][nums[i]]++;
}... | ALGO | 0.999786 | 5.013446 |
26a6da67-d2b9-4a16-b0ba-b80db53a5180 | risacker/Leetcode_Solutions | 106-construct-binary-tree-from-inorder-and-postorder-traversal/106-construct-binary-tree-from-inorder-and-postorder-traversal.cpp | class Solution {
public:
TreeNode* buildTree(vector<int>& inorder, vector<int>& postorder) {
unordered_map<int, int> mp;
for (int i = 0; i < inorder.size(); ++i) mp[inorder[i]] = i;
stack<TreeNode*> stk;
TreeNode *root = nullptr, *node = nullptr;
for (int i = pos... | ALGO | 0.999977 | 6.343149 |
d01b8277-028a-41c4-b19a-7ac331620b82 | KEY60228/paiza_learning | src/skillcheck-archive/B/word_chain/02/main.cpp | #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
int main() {
int n, k, m;
cin >> n >> k >> m;
vector<string> wv(k);
for (int i = 0; i < k; i++) {
cin >> wv[i];
}
vector<bool> lv(n, true);
vector<string> uv;
string bs = "";
... | ALGO | 0.999971 | 3.615817 |
b9379559-09e8-403a-87d8-179ddb8f092c | ishandutta2007/codeforces | abc864197532/normal/489/D.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
#define lli long long int
#define fop(i,m,n) for (int i=(m);i<(n);i++)
#define FOP(i,m,n) for (int i=(m)-1;i>=(n);--i)
#define test(x) cout << #x << ' ' << x << endl;
#define print(a) {\
for (... | ALGO | 0.99989 | 5.121838 |
3153301c-bdca-4f61-b9ff-72bf1e9fdeba | 0at01/Templates | CSES/Mathematics/counting_divisors.cpp | #include<iostream>
#include<bits/stdc++.h>
using namespace std;
#define fastio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define mod 1000000007
#define ll long long
#define nln "\n"
#define vi vector<int>
#define vll vector<ll>
#define pi pair<int, int>
#define pll pair<ll, ll>
#define begend(x) x.begin(),... | ALGO | 0.999582 | 4.511597 |
4eec2b0d-a74c-4622-93cd-f05de99fad79 | brightlaboratory/llvm-project | libcxx/test/std/algorithms/alg.modifying.operations/alg.unique/unique_copy_pred.pass.cpp | // <algorithm>
// template<InputIterator InIter, class OutIter,
// EquivalenceRelation<auto, InIter::value_type> Pred>
// requires OutputIterator<OutIter, RvalueOf<InIter::value_type>::type>
// && HasAssign<InIter::value_type, InIter::reference>
// && Constructible<InIter::value_type, InIter... | TEST | 0.978594 | 6.260609 |
061f1866-59e4-400d-9d63-2fa0cdd253d8 | amithasan16Hstu/CF_Contest_problem | maximize.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin >> t;
while (t--)
{
long long l, r;
cin >> l >> r;
long long diff = r - l;
long long k = (1 + sqrt(1 + 8 * diff)) / 2;
cout << k << endl;
}
return 0;
}
| ALGO | 0.999867 | 4.086955 |
da16f871-3331-44a9-aa6e-d24ea85d7bf0 | Amit-unchartered/Code_with_CPP | StriverDSAsheet/Arrays/sort_an_array_0s_1s_2s_better.cpp | //brute force --> merge sort --> TC => O(NlogN)+O(N),
// SC => O(N) --> for storing the temporary array
#include<bits/stdc++.h>
using namespace std;
vector<int> sort_z_o(vector<int> &nums){
int n = nums.size();
int cnt0=0, cnt1=0, cnt2=0;
for(int i = 0; i < n; i++) {
if(nums[i] == 0){
... | ALGO | 0.999951 | 4.200873 |
0a3bf59d-a21b-48e4-810a-ceafef91101e | sarvex/leetcode-ada | lcci/02.01.Remove Duplicate Node/Solution.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
ListNode* removeDuplicateNodes(ListNode* head) {
if (head == nullptr || head->next == nullptr) {
return head;
... | ALGO | 0.999928 | 6.093602 |
9ec092f8-5f06-4e86-9bcd-80ebf38b24a7 | medina16/pemrog | Prog5_G6401211096.cpp | #include <bits/stdc++.h>
using namespace std;
vector<int> getValues(){
vector<int> v;
for(int i=0;i<10;i++)
v.push_back(i + 1);
return v;
}
int main(){
vector<int> get;
get = getValues();
for(auto it:get) cout << it << " ";
return 0;
} | ALGO | 0.982872 | 3.311023 |
6599e3cb-ca80-4666-850f-6a90c0ac913b | elielprado/OJ | SPOJ_BR/1386.cpp | #include <stdio.h>
int main(){
int r = 0;
int a = 0;
int b = 0;
int x = 0;
int res = 0;
int resf = 0;
int contador = 1;
do{
scanf("%d", &r);
if(r == 0){
return 0;
}
for(x = 0; x < r; x++){
scanf("%d", &a);
scanf("%d... | ALGO | 0.990846 | 3.37325 |
4d2d6bfe-d5d3-48a1-ad88-5dfc46604378 | Yejin-Moon/algorithm | C++/Baekjoon/Problem9465.cpp | #include <iostream>
using namespace std;
int maxx(int a, int b) {
if (a > b) return a;
else return b;
}
int main() {
int T;
cin >> T;
for (int testcase = 0; testcase < T; testcase++) {
int dp[2][100001];
int arr[2][100001];
int n;
cin >> n;
for (int i = 0... | ALGO | 0.999961 | 4.113204 |
da3d4726-0faf-49eb-9132-db5c35a1b826 | chunyangx/ProjetE2 | src/alglibmisc.cpp | #include "stdafx.h"
#include "alglibmisc.h"
// disable some irrelevant warnings
#if (AE_COMPILER==AE_MSVC)
#pragma warning(disable:4100)
#pragma warning(disable:4127)
#pragma warning(disable:4702)
#pragma warning(disable:4996)
#endif
using namespace std;
///////////////////////////////////////////////////////////////... | ALGO | 0.964826 | 4.827475 |
09cec400-8823-4dec-8054-f2526e764880 | kevindra/MyCodes | MyCodes/MyCodes/Arrays/RowWithMax1s.cpp | /**
* Find the row with maximum number of 1s
*
Given a boolean 2D array, where each row is sorted. Find the row with the maximum number of 1s.
Example
Input matrix
0 1 1 1
0 0 1 1
1 1 1 1 // this row has maximum 1s
0 0 0 0
Output: 2
*/
#include <iostream>
using namespace std;
// ==========================... | ALGO | 0.999848 | 5.68472 |
aec0c9b8-c4de-436c-b602-98829944a64b | waydroid/android_external_llvm90 | lib/CodeGen/LiveRangeShrink.cpp | #include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/ADT/iterator_range.h"
#include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/CodeGen/MachineOperand.h"
#include... | ALGO | 0.991304 | 7.947615 |
e26827b6-df00-4d4e-96a9-727694a3cae7 | vSzemkel/CppStuff | usaco/chapter5/fc.cpp | /*
ID: marcin.8
LANG: C++17
TASK: fc
PROBLEM STATEMENT: https://train.usaco.org/usacoprob2?a=QRAusS0iKMr&S=fc
*/
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <fstream>
#include <vector>
std::ifstream task_in("fc.in");
std::ofstream task_out("fc.out");
template <typename T = int64_t> struct point... | ALGO | 0.999704 | 5.159052 |
e4a4dc0f-f80f-4f2f-8a69-b3b57e6c5947 | taltrums/cpp_practice | algorithims/lcm.cpp | #include <iostream>
long long lcm_naive(int a, int b) {
for (long l = 1; l <= (long long) a * b; ++l)
if (l % a == 0 && l % b == 0)
return l;
return (long long) a * b;
}
long long gcd(int a, int b) {
if(b == 0) {
return a;
}
return gcd(b, (long long)a%b);
}
long long lcm_fast(int a,... | ALGO | 0.999906 | 5.016763 |
4ca5f5d8-c737-47e3-b3d2-797f63fa6032 | alexandraback/datacollection | solutions_5738606668808192_0/C++/Mathlover/main.cpp | #include<cstdio>
#include<cstdlib>
#include<cmath>
#include<algorithm>
#include<set>
#include<map>
#include<queue>
#include<stack>
#include<vector>
#include<iostream>
#include<time.h>
#include<stdlib.h>
using namespace std;
long long tran(int p,int n)
{
long long ans=0;
long long base=1;
while(p)
{
... | ALGO | 0.999723 | 3.518991 |
f596786a-9ef2-4cf4-9e7d-8d35ab49caac | feddieminas/HackerRank | Cpp/Merge_two_sorted_linked_lists.cpp | //
// https://www.hackerrank.com/challenges/merge-two-sorted-linked-lists
//
// Merge_two_sorted_linked_lists.cpp
// HacckerrankCpp
//
/*
Solution. Fully accepted
Ex. first testcase of testcase 0
while (headA && headB)
1<2 q.(A)
3<2 q.(B)
3<4 q.(A)
5<4 q.(B)
5<7 q.(A)
6<7 q.(A)
exit
1-2-3-4-5-6
A-B-A-B-A-A
wh... | ALGO | 0.999973 | 5.495224 |
6d90a91e-3e6c-460a-a3a4-e5a967477938 | saarang123/Competitive-Programming | codeforces/1239B.cpp | #include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define f first
#define s second
typedef long long ll;
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);cout.tie(0);
//freopen("input.txt", "r", stdin);
int n,t,i,j;
cin >> t;
string s;
while(t--)
{
... | ALGO | 0.99969 | 4.017982 |
9f410520-52b5-4775-b6f7-26d06feb8744 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_3273_17.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
long long int a[100001] = {0}, n, i, j, k;
cin >> n;
long long int b[n];
for (i = 0; i < n; i++) {
cin >> j >> b[i];
a[j]++;
}
for (i = 0; i < n; i++) {
cout << n - 1 + a[b[i]] << " " << n - 1 - a[b[i]] << endl;
}
return 0;
}
| ALGO | 0.999775 | 3.564181 |
582273a4-a91c-4c57-a71d-14ef7f34899d | utyujinn/Competitive-programming | atcoder/abc363/f.cpp | #include<iostream>
#include<vector>
using namespace std;
long N;
bool isPalindoromic(long N){
vector<long> tmp;
while(N){
tmp.push_back(N%10);N/=10;
}
for(int i=0;i<N;i++){
if(tmp[i]!=tmp[N-i-1])return false;
}
return true;
:
vector<long> divisor(long N){
vector<long> ret;
for(int i=2;i*i<=N;i++){
if(N%... | ALGO | 0.999851 | 4.588546 |
1902b358-78b4-4101-8a30-a43dd716d9af | mayank3005/LeetCode-Solutions | 2641-cousins-in-binary-tree-ii/2641-cousins-in-binary-tree-ii.cpp | class Solution {
public:
vector<int> l_sum;
void level_sum(TreeNode* n, int d = 0) {
if (n == nullptr)
return;
l_sum.resize(max((int)l_sum.size(), d + 1));
l_sum[d] += n->val;
level_sum(n->left, d + 1);
level_sum(n->right, d + 1);
}
void update_sum(Tre... | ALGO | 0.99998 | 6.312455 |
4e8e5360-58fc-4ed6-9dc6-b7b98772f8a7 | coder-devansh/DSA | 3332-minimum-operations-to-exceed-threshold-value-ii/minimum-operations-to-exceed-threshold-value-ii.cpp | class Solution {
public:
int minOperations(vector<int>& nums, int k) {
priority_queue<long long, vector<long long>, greater<long long>>q;
// Push some elements
for(auto it:nums){
q.push(it);
}
long long opr=0;
while(q.size()>=2){
long long element=q.top();
q.pop();
... | ALGO | 0.999913 | 5.555459 |
db2a6436-ecb3-4ee2-9ee8-1af68dba1895 | GbLeem/codetree-TILs | 241129/데이터 비교/data-comparison.cpp | #include <iostream>
#include <unordered_set>
using namespace std;
int n, m;
unordered_set<int> s1;
int board[100'002];
int main()
{
cin >> n;
for(int i = 0; i < n; ++i)
{
int num;
cin >> num;
s1.insert(num);
}
cin >> m;
for(int i = 0; i < m; ++i)
{
ci... | ALGO | 0.999911 | 3.854021 |
bd7635b8-714c-4088-b27d-9775c62a37e9 | UynUyn2k10103/Alogrithm_SamSung_in_the_Summer | Bai_7_Ghep_hinh.cpp | #include<stdio.h>
#include<math.h>
void swap(int *a, int *b){
int temp = *a;
*a = *b;
*b = temp;
}
int main(){
int n, i, a, b, c, d, e, f;
scanf("%d", &n);
while(n--){
int x, s=0, max=0;
scanf("%d%d%d%d%d%d", &a, &b, &c, &d, &e, &f);
s = a*b + c*d + e*f;
x = sqrt(s);
if(s != x * x) printf("NO\n");
els... | ALGO | 0.999904 | 3.19397 |
6df79bef-d318-4d67-a630-f65c38632c40 | jameskkk/UVCCamera | opencv_2.4.13.2/sources/samples/cpp/matching_to_many_images.cpp | #include "opencv2/highgui/highgui.hpp"
#include "opencv2/features2d/features2d.hpp"
#include "opencv2/contrib/contrib.hpp"
#include <iostream>
#include <fstream>
using namespace cv;
using namespace std;
const string defaultDetectorType = "SURF";
const string defaultDescriptorType = "SURF";
const string defaultMatche... | ALGO | 0.866109 | 6.173709 |
69f98a2a-923e-4828-90d1-69f7419c49f2 | SahilSharma54/Computer-Lab-Project | Computer Lab Project Final/Square Star Pattern.cpp | //Program To Print Square Star Pattern
#include<stdio.h>
int main(){
int i,j,n;
printf("Enter no. of rows: "); //Taking Size Of Rows
scanf("%d",&n);
for(i=1;i<=n;i++){ //For Rows
for(j=1;j<=n;j++){ //For Columns
printf("* ");
}
printf("\n"); //For Next Line
}
return 0;
}
| ALGO | 0.980825 | 3.348829 |
77687a81-0c1d-4869-9610-367badb22b09 | luwei0917/GlpG_Nature_Communication | src/fix_nve_noforce.cpp | #include <stdio.h>
#include <string.h>
#include "fix_nve_noforce.h"
#include "atom.h"
#include "update.h"
#include "respa.h"
#include "error.h"
using namespace LAMMPS_NS;
using namespace FixConst;
/* ---------------------------------------------------------------------- */
FixNVENoforce::FixNVENoforce(LAMMPS *lmp, i... | ALGO | 0.991926 | 6.618199 |
9f400f9a-58ca-4b51-bb2f-8a726fa68622 | anayy09/LeetCode | 0142-linked-list-cycle-ii/0142-linked-list-cycle-ii.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
ListNode *detectCycle(ListNode *head) {
if (head == nullptr || head->next == nullptr) {
return nullptr;
... | ALGO | 0.999942 | 5.708516 |
ddd1ef18-993f-4aa8-8a74-a6deda46b71f | aangel4/AngelAaron_CSC5_43952 | Hmwk/Assignment 2/Gaddis_8thEd_Chap3_Prob2/main.cpp | /*
* File: main.cpp
* Author: Aaron Angel
*
* Created on March 16, 2015, 11:28 AM
* Purpose: Stadium Seating Problem
*/
//System Libraries
#include <iostream>
#include <iomanip>
using namespace std;
//User Libraries
//Global Constants
//Function Prototypes
//Execution Begins Here!!
int main(int argc,... | ALGO | 0.970963 | 4.73592 |
fe8c294b-6963-43a5-b6e9-468a2309d04c | clemy/prime | threaded/prime.cpp | #include <cmath>
#include <pthread.h>
#include <array>
#include <chrono>
#include <iostream>
using namespace std;
constexpr int kStart{ 1000000 };
constexpr int kCount{ 20971520 };
constexpr int kThreads{ 8 };
static_assert(kCount % kThreads == 0);
struct ThreadInfo {
pthread_t handle;
int start_value;
... | ALGO | 0.999334 | 5.25625 |
82cf7601-ac00-42f6-8c5e-c4f4a1487e38 | CoderS2020/Cpp-Algo-DS | DP/Ultimate_DP/02_DP On Subsequences_Subsets/10_UnboundedKnapsack.cpp | /*
A thief wants to rob a store. He is carrying a bag of capacity W. The store has ‘n’ items of infinite supply. Its weight is given by the ‘wt’ array and its value by the ‘val’ array. He can either include an item in its knapsack or exclude it but can’t partially have it as a fraction. We need to find the maximum valu... | ALGO | 0.999999 | 5.655147 |
293bced2-4b2f-496f-b1b3-1a320d979f9c | sarvex/leetcode-harbour | solution/1600-1699/1617.Count Subtrees With Max Distance Between Cities/Solution.cpp | class Solution {
public:
vector<int> countSubgraphsForEachDiameter(int n, vector<vector<int>>& edges) {
vector<vector<int>> g(n);
for (auto& e : edges) {
int u = e[0] - 1, v = e[1] - 1;
g[u].emplace_back(v);
g[v].emplace_back(u);
}
vector<int> ans(... | ALGO | 0.999912 | 5.788897 |
4720afc0-c02e-4f74-a8ca-82b2ca5703ab | Lady-Lex/humanoid_navigation_ws | src/humanoid_navigation/footstep_planner/src/helper.cpp | #include <footstep_planner/helper.h>
namespace footstep_planner
{
bool
collision_check(double x, double y, double theta, double height,
double width, int accuracy,
const gridmap_2d::GridMap2D& distance_map)
{
double d = distance_map.distanceMapAt(x, y);
if (d < 0.0) // if out of bou... | ALGO | 0.999247 | 6.908371 |
a0008aee-0a2d-4852-8341-a292da787704 | bisht-arun/DSA-in-Cpp | Lecture 4 - Recursion/L4_replace.cpp | #include<iostream>
using namespace std;
void replace(char s[],char gvn , char rplc)
{
//Base case
if(s[0]=='\0')
{
return;
}
if(s[0]==gvn)
{
s[0]=rplc;
}
//Recursive call
replace(s+1,gvn,rplc);
}
int main()
{
char str[100];
cin>>str;
char gvn,rplc;
... | ALGO | 0.998499 | 3.60813 |
9373dee7-aeb9-426a-960c-59cb402036c8 | TanviDeshmukh23/Codes | program228.cpp | #include<iostream>
using namespace std;
void DisplayHexadecimal(int iNo)
{
int iDigit = 0;
cout<<"Hexadecimal conversion of : "<<iNo<<"is : "<<"\n";
while(iNo != 0)
{
iDigit = iNo % 16;
cout<<iDigit;
iNo = iNo / 16;
}
cout<<"\n";
}
int main()
{
int iValue = 0;
... | ALGO | 0.964733 | 3.587699 |
e6cd43d3-ddcf-4f76-8fcb-b1ae3ed8e9b2 | ratnas2005/Programming | DAY16.CPP | #include <iostream>
using namespace std;
//Function prototype
//Syntax:type function_name (arguments);
//int sum(int a, int b);//-->Acceptable
//int sum(int a, b);//-->Not Acceptable
int sum(int, int);//-->Acceptable
//void g(void);//-->Acceptable
void g();//-->Acceptable
int main(){
int num1,num2;
//num1 and... | TOOL | 0.942208 | 3.763137 |
48cde105-207e-4b24-988a-6158b3c29beb | ishandutta2007/codeforces | nigus/normal/1148/E.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define trav(a, x) for(auto& a : x)
#define all(x) x.begin(), x.end()
#define sz(x) (int)(x).size()
#define hash dhsjakhd
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
t... | ALGO | 0.999973 | 3.53995 |
1c72b94c-c61c-4ce5-b382-dea2236bc3e5 | edubrunaldi/Delaunay-divide-and-conquer | src/main.cpp |
#include "../include/utils.hpp"
#include <iostream>
#include <random>
using namespace std;
int main(){
//InputPoints
ofstream coutFile;
coutFile.open("Cout.txt");
srand((unsigned int)time(NULL));
auto points = InputPoints();
coutFile.close();
for(size_t i = 0; i < points.size(); ++i) {
cout << poi... | ALGO | 0.956698 | 4.397165 |
4e00de5a-c87a-4b10-aade-9891b877030c | mmarryll/Threads | cmake/solver/Solver.cpp | #include "Solver.h"
#include "ThreadSafeStack.h"
#include <iostream>
#include <fstream>
#include <vector>
#include <thread>
#include <atomic>
Solver::Solver(const std::string& filename, size_t thread_count)
: filename_(filename), thread_count_(thread_count) {
}
static bool IsPrime(int value) {
if (value <= 1... | ALGO | 0.999083 | 5.398136 |
7b15368e-f936-400c-8405-7210887b0c30 | samkas125/CSP_solver | libraries/armadillo-14.2.2/examples/example1.cpp | #include <iostream>
#include <armadillo>
using std::cout;
using std::endl;
using namespace arma;
// Armadillo documentation is available at:
// http://arma.sourceforge.net/docs.html
// NOTE: the C++11 "auto" keyword is not recommended for use with Armadillo objects and functions
int
main(int argc, char** argv)
{... | ALGO | 0.972113 | 4.620787 |
30b40b43-06ca-4b74-a64d-ddbf89b8ed34 | hocvn/Online-judge | LuyenCode/LKNGOAC.cpp | #include <iostream>
#include <stack>
#include <cstring>
using namespace std;
char s[100001];
int n, luu[100001];
int main(){
scanf("%s", s + 1);
n = strlen(s+1);
stack <int> st;
for (int i = 1; i <= n; i++){
if (s[i] == '(') st.push(i);
else{
luu[i] = st.top();
... | ALGO | 0.992312 | 3.121188 |
cb8a4ef1-b1df-4b02-8a3d-adb1b947375b | sash2104/library | test/aoj/CGL_1_C.test.cpp | #define PROBLEM "http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=CGL_1_C"
#define ERROR "0.00000001"
#include "../../geometry/template.hpp"
#include <cassert>
#include <iostream>
using namespace std;
int main() {
Point p0, p1; cin >> p0 >> p1;
int q; cin >> q;
for (int i = 0; i < q; ++i) {
Point p2;... | ALGO | 0.999677 | 5.391646 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.