uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
d237ec6e-c0cc-4457-8c3d-df1e17c6a001 | kessyus/Algorithms | hackerrank/Algorithms/Implementation/Divisible Sum Pairs/solve.cpp | /**
* Author: Kessyus Fofano
* Email: <EMAIL>
**/
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
int n, k, count {};
cin >> n >> k;
int ar[n];
for(int i=0; i<n; ++i){
cin >> ar[i];
}
for(int i=0; i<(n-1); ++i){
for(int j... | ALGO | 0.999799 | 4.25661 |
e2506173-33b9-422d-8f8e-31193f8fff2e | sifat-hossain-niloy/CodeForces-Solutions | B_Array_Eversion.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.999549 | 4.224334 |
a2c7a5bd-7d95-4d52-8502-cca056b3c171 | PSKyun/Difficult | 11049.cpp | #include <iostream>
#include <algorithm>
using namespace std;
long long n,d[501],m[501][501],ans=10000000000;
int main (){
cin >> n;
for(int i=0;i<n;i++){
cin >> d[i] >> d[i+1];
}
for(int i=1;i<=n-1;i++){
for(int j=1; j<=n-i;j++){
for(int k=j;k<=j+i-1;k++){
a... | ALGO | 0.999694 | 3.5356 |
b87948cf-6331-49bc-9120-fe74626bc198 | SandulescuRazvanAlexandru/Parallel-Programming | prime-counter-parallelization/prime-counter-parallelization/Source.cpp | #include <string>
#include <vector>
#include <stdio.h>
#include <omp.h>
#include "Methods.h"
int main() {
const long N = 5e5;
const int noCores = omp_get_num_procs();
printf("\n Available cores = %d", noCores);
//benchmark("Sequential solution", N, sequentialSolution);
//benchmark("Parallel solution with reace... | ALGO | 0.997685 | 4.073021 |
c6092db1-46f8-41d9-abec-17e26b405568 | shubhamgyd/mission_TCS | CSEC/DP/9_Edit_Distance.cpp | #include <bits/stdc++.h>
#define fast() \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(NULL);
using namespace std;
#define endl '\n'
#define nline cout<<"\n"
#define max_pq priority_queue<int>
#define min_pq priority_queue<int, vector<int>, greater<... | ALGO | 0.999979 | 4.735333 |
8276894d-0b88-46e8-91a9-61ee5a83bd48 | CGAL/cgal-dev | Polygon_mesh_processing/test/Polygon_mesh_processing/test_orient_cc.cpp | #include <CGAL/Polygon_mesh_processing/orientation.h>
#include <CGAL/Polygon_mesh_processing/corefinement.h>
#include <CGAL/Surface_mesh.h>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/boost/graph/named_params_helper.h>
#include <CGAL/Timer.h>
#include <iostream>
#include <fstream>
... | TEST | 0.88697 | 6.129184 |
9f21e802-a61b-4970-ab99-8a2fe94c9800 | Sanchit-mathur/Leetcode | flatten-binary-tree-to-linked-list/flatten-binary-tree-to-linked-list.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.999965 | 6.190901 |
5bd54ca8-046d-4cf6-9542-90a5ec1cb5d7 | ravichoudhary123/LeetCode | Cpp/GreatTree.cpp | //
// Created by ravi on 5/19/17.
//
// Definition for a binary tree node.
#include <iostream>
using namespace std;
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode(int x) : val(x), left(NULL), right(NULL) {}
};
class Solution {
public:
int temp=0;
void helper(Tre... | ALGO | 0.999961 | 6.186098 |
9f5889dc-0340-4c3b-8fca-376ef6028d84 | Akashkewat5220/Complete-DSA | Day_79 (Recursion on Strings)/Case.cpp | #include <iostream>
using namespace std;
void LowertoUpper(string &str , int index )
{
/// base case
if(index == -1)
return ;
str[index] = 'A' + str[index] - 'a';
LowertoUpper(str , index-1);
}
int main(){
string str = "akash";
LowertoUpper(str , 4);
cout<<str<<endl;
} | ALGO | 0.998492 | 4.266238 |
da94da0e-997e-496d-bf9b-c299960c9884 | puffcoder333/learn_data_structure | Tree/binarySearchTree.cpp | /**
* 二叉搜索树
* 判断二叉树是否是二叉搜索树
**/
#include <iostream>
#include "tree.h"
// 递归
int preMaxValue = 0;
bool isBinarySearchTree_recursion(TreeNode *head)
{
if (head == nullptr)
{
return true;
}
bool left = isBinarySearchTree_recursion(head->left);
if (!left)
return false;
if (head... | ALGO | 0.999923 | 5.06841 |
3ef55ae7-95c4-41d4-9cdd-1c176e54c440 | kkorona/BOJ_Rche | 11729/main.cpp | #include <cstdio>
using namespace std;
inline int pow(int x,int p) {
int ret=1, t=p;
while(t--) ret*=x;
return ret;
}
void hanoi(int N,int st,int ed, int po) {
if(N == 0) return;
//N-1 st po
hanoi(N-1, st, po, ed);
//N° st ed
printf("%d %d\n",st,ed);
//N-1 po ed
hanoi(N... | ALGO | 0.999844 | 3.878697 |
ad52c661-0a56-4837-afab-f61fedf2e92d | Sajal-97/cseku_apl_24_230205 | task1/New_Code/Matrix_multification_new.cpp | #include<iostream>
using namespace std;
int main() {
// Input dimensions for matrix A
int rowsA;
int colsA;
cout << "Number of rows in matrix A: ";
cin >> rowsA;
cout << "Number of columns in matrix A: ";
cin >> colsA;
// Declare matrix A
int matrixA[rowsA][colsA];
// Input el... | ALGO | 0.999908 | 5.338453 |
867ced70-59f4-4f4d-a356-a0a63b7d4507 | jccarvalhosa/maratona | uva/asian/phuket/baggage.cpp | #include <iostream>
using namespace std;
int main() {
int T;
cin>>T;
int sum=0;
while(T--) {
int valid=0;
double l, wi, d, we;
cin>>l>>wi>>d>>we;
if(l < 56+1e-9 && wi < 45+1e-9 && d < 25+1e-9) valid=1;
if(l + wi + d < 125+1e-9) valid=1;
if(we >= 7+1e-9) valid=0;
cout<<valid<<endl;
sum += valid;
}
... | ALGO | 0.991159 | 3.341892 |
7619e1a1-44a9-44d4-affb-c715e9574b34 | Nagar203/Leetcode | 1765. Map of Highest Peak/Approach01.cpp | class Solution {
public:
vector<vector<int>> highestPeak(vector<vector<int>>& isWater) {
constexpr int directions[4][2] = {{0, 1}, {1, 0}, {0, -1}, {-1, 0}};
const int rows = isWater.size();
const int cols = isWater[0].size();
vector<vector<int>> heights(rows, vector<int>(cols, -1));
queue<pair<i... | ALGO | 0.999983 | 7.516714 |
1255b157-b501-420d-8122-41280a1fac04 | KARMAKAR7/DailyLeetCode | 896-smallest-subtree-with-all-the-deepest-nodes/smallest-subtree-with-all-the-deepest-nodes.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.999253 | 6.410282 |
4a6c6ea2-025f-4584-ad45-f14b89974f9d | madhav-bits/Coding_Practice | leetLargeNumTwiceToElse.cpp | /*
*
//**************************************************747. Largest Number At Least Twice of Others.******************************************
In a given integer array nums, there is always exactly one largest element.
Find whether the largest element in the array is at least twice as much as every other number in ... | ALGO | 0.99997 | 6.032089 |
001a4890-d30c-4f86-b06c-c227f8e4bd62 | davisnguyen111195/Algorithm | 15_Xau/bai15.cpp | // [Xâu Ký Tự Cơ Bản]. Bài 15. Từ chẵn lẻ
// Cho xâu kí tự S, trong xâu S có nhiều từ được phân cách nhau bởi 1 hoặc 1 vài dấu cách.
// Nhiệm vụ của bạn là đối với những từ xuất hiện ở vị trí lẻ thì thì in ra từ đó, còn những từ xuất hiện ở vị trí chẵn thì trước khi in từ đó bạn phải lật ngược từ đó trước.
// Đầu vào... | ALGO | 0.999915 | 4.575443 |
843664ae-57c5-4e9f-a31e-5aa5457a74dc | cieslarmichal/glossary | src/common/fileSystem/src/DefaultFileAccess.cpp | #include "DefaultFileAccess.h"
#include <boost/algorithm/cxx11/any_of.hpp>
#include <filesystem>
#include <fstream>
#include "fmt/core.h"
#include "exceptions/DirectoryNotFound.h"
#include "exceptions/FileNotFound.h"
namespace common::fileSystem
{
void DefaultFileAccess::write(const std::string& absolutePath, const... | TOOL | 0.946127 | 6.969416 |
dd0fc110-c826-43b4-9dab-0c0fbc91d5e0 | GitHub-LYY/interestingresources | datastructure/math/jz17.cpp | /*
** Author: Yangyang Liu
** Date: 2022-09-07
** Description: 剑指 Offer 17. 打印从1到最大的n位数
** link: https://leetcode.cn/problems/da-yin-cong-1dao-zui-da-de-nwei-shu-lcof/
** reference: https://www.bilibili.com/video/BV1pv411B7yD?spm_id_from=333.337.search-card.all.click&vd_source=2359173fba44be579729aa03546398fa
** Bobbi5... | ALGO | 0.999458 | 5.772923 |
10e2008a-f251-47dd-9bbc-ba1a74baf81f | alexandraback/datacollection | solutions_5634697451274240_0/C++/tjdrn/J.cpp | #include <string>
#include <iostream>
#include <cstdio>
#include <map>
#include <vector>
#include <algorithm>
#include <queue>
#include <cstring>
using namespace std;
#define N 105
#define mod 1000000007
#define LL long long
inline int read() {//used to read 32bit positive integer
char c = getchar();
while (... | ALGO | 0.999946 | 4.140676 |
cda3846e-c15e-4257-b591-1fefe2cd782f | HusseinYoussef/Interview-Preparation | leetcode/Easy/Binary Tree Postorder Traversal.cpp | #include <iostream>
#include <vector>
#include <stack>
using namespace std;
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 *rig... | ALGO | 0.999994 | 5.974096 |
05b53bd5-d039-4c53-8eac-2140ec1af55f | miank108/CompetitiveProgramming | GeeksForGeeks/NonRepeatingCharacter/NonRepeatingCharacter.cpp | // NonRepeatingCharacter.cpp
#include <iostream>
#include <string>
#include <map>
using namespace std;
class Solution
{
public:
//Function to find the first non-repeating character in a string.
char nonrepeatingCharacter(string s)
{
//Your code here
map<char, int>m;
for (auto it : s)
m[it]++;
for (aut... | ALGO | 0.999918 | 4.817224 |
4fd90c70-a581-48c6-a465-7df73e6b326d | hyl946/llvm7.0.1 | tools/clang/lib/Sema/SemaCodeComplete.cpp | using namespace clang;
using namespace sema;
namespace {
/// A container of code-completion results.
class ResultBuilder {
public:
/// The type of a name-lookup filter, which can be provided to the
/// name-lookup routines to specify which declarations should be included in
/// the result set (when i... | TOOL | 0.90914 | 6.216351 |
a56c5e56-65a3-46ed-acf8-f1af93a2efd7 | KshitijShinde/competitive-programming-using-c- | expt 2 bitwise even odd expt 2/main.cpp | #include <iostream>
using namespace std;
void evenorodd(int n){
if((n&1)==0){
cout<<"even number";
}
else{
cout<<"odd number";
}
}
int main()
{
int n;
cout<<"enter the integer";
cin>>n;
evenorodd(n);
return 0;
} | ALGO | 0.99899 | 4.073364 |
4d020c93-df81-4b39-b653-c4d6844f4c5d | gakimaru/public | test/Program/C++/Thread/OpenMP/src/main.cpp | #include <stdio.h>
#include <stdlib.h>
#include <Windows.h>
#ifdef _OPENMP
#include <omp.h>
#endif
//f
bool isPrime(const int n)
{
if (n < 2)
return false;
else if (n == 2)
return true;
else if (n % 2 == 0)
return false;
for (int i = 3; i <= n / i; i += 2)
{
if (n % i == 0)
return false;
}
return tr... | ALGO | 0.985684 | 3.102459 |
dbbce82b-9897-47c8-93f8-2676f9eb434b | josemiguelmo2/image_id_ardu | lib/face_recognition_inferencing/src/edge-impulse-sdk/tensorflow/lite/micro/kernels/pack.cpp | #include "edge-impulse-sdk/tensorflow/lite/c/builtin_op_data.h"
#include "edge-impulse-sdk/tensorflow/lite/c/common.h"
#include "edge-impulse-sdk/tensorflow/lite/kernels/internal/tensor_ctypes.h"
#include "edge-impulse-sdk/tensorflow/lite/micro/kernels/kernel_util.h"
namespace tflite {
namespace ops {
namespace micro ... | ALGO | 0.942063 | 7.604219 |
fdbec220-57dc-43ca-a3c3-1149c99bfc84 | mkp0/CP | GeekForGeek/Two Repeated Elements GFG.cpp | class Solution
{
public:
// Function to find the two repeated element
// arr: input array
// N: denoting that the size of array is N + 2 and range of elements is [1, N]
pair<int, int> twoRepeated(int arr[], int n)
{
int combi = 0;
for (int i = 0; i < n + 2; i++)
{
... | ALGO | 0.999986 | 4.648415 |
e30eef7d-3499-42ec-9346-e9b6de0e70b8 | alexandraback/datacollection | solutions_2692487_1/C++/SevagD/R2B_prob1.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <map>
#include <algorithm>
using namespace std;
vector <int> motes;
map < pair<int,int> , int> DP;
int getmin(int pos, int A_size)
{
if (pos==motes.size() || A_size>1000000)
return 0;
if (DP.count(make_pair(pos,A_size))>0)
return DP[make_pair(p... | ALGO | 0.999649 | 4.206264 |
76441aa2-edbf-432a-917b-d553d1e0067b | sulthana-parveen/Expense_TrackerApp | 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 |
75f9c2c2-f372-4fcb-ba45-2c33a7c73f52 | Liaukx/SXU_Algorithm | SXU_03/split_int.cpp | #include <iostream>
using namespace std;
void solve(int n){
bool flag = false;
for (int i = 1; i <= n/2; ++ i ){
for(int k = 1; k < n/i + 1; ++ k ){
if(k * i + (k *(k - 1))/2 == n){
flag = true;
for (int cur = 0; cur < k; ++ cur){
if(cur == k... | ALGO | 0.999983 | 4.803714 |
7d4c6a44-f57c-44e3-b84c-37a277f83701 | abc873693/bank-counter-2022 | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998859 | 6.785645 |
fb9ca1dd-8526-4b4b-b11d-6181a7029a08 | jiakechong1991/crfpp | encoder.cpp | #if defined(_WIN32) && !defined(__CYGWIN__)
#define NOMINMAX
#include <windows.h>
#endif
#include <algorithm>
#include <fstream>
#include "param.h"
#include "encoder.h"
#include "timer.h"
#include "tagger.h"
#include "lbfgs.h"
#include "common.h"
#include "feature_index.h"
#include "scoped_ptr.h"
#include "thread.h"
... | DATA | 0.997572 | 4.916015 |
9606a8c5-f2fe-4e5e-9ec8-d4809f38156b | buiquochuy2508/CPP_CODE_PTIT | CPP0444-TIMKIEMTRONGDAYSAPXEPVONG.cpp | #include <bits/stdc++.h>
using namespace std;
#define ms(s,n) memset(s,n,sizeof(s))
#define all(a) a.begin(),a.end()
#define sz(a) int((a).size())
#define f0(i,n) for (int i=0; i<n; i++)
#define f1(i,n) for (int i=1; i<=n; i++)
#define FastIO ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define pb push_back
#de... | ALGO | 0.999511 | 4.150679 |
890c7181-9296-4fe9-96f0-6258d0b3f049 | oxygen-hunter/Flashboom | data/big-vul-100/add_attention_code/CodeLlama/top0-100/find-the-level-of-tree-with-minimum-sum-Solution.minimumLevel/177832_nan.cpp | walk_string(fz_context *ctx, int uni, int remove, editable_str *str)
{
int rune;
if (str->utf8 == NULL)
return;
do
{
char *s = &str->utf8[str->pos];
size_t len;
int n = fz_chartorune(&rune, s);
if (rune == uni)
{
/* Match. Skip over that one. */
str->pos += n... | ALGO | 0.998428 | 5.308643 |
53ca38f7-f2c0-4627-bfb7-62df5d2023f8 | TanishaMehta17/Leetcode | movieFestival.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin >> n;
vector<pair<int, int>> v(n);
for (int i = 0; i < n; i++) {
cin >> v[i].first >> v[i].second;
}
sort(v.begin(), v.end());sort(v.begin(), v.end(), [](const pair<int, int> &a, const pair<int, int> &b) {
... | ALGO | 0.999989 | 5.249394 |
81d78484-20ec-49fa-bf62-2e87501b940a | anjali29singh/dsa | segment-tree/maxm_and_times.cpp | // find the maximum number in give range and how many times it appears
#include <bits/stdc++.h>
using namespace std;
const int maxn = int(1e6);
int n;
pair<int, int> T[maxn];
pair<int, int> combine(pair<int, int> a, pair<int, int> b)
{
if (a.first > b.first)
return a;
if (b.first > a.first)
ret... | ALGO | 0.999954 | 5.474967 |
3bf3b004-1b2c-499c-9abf-ef247fc553b7 | SonJH7/codetree-TILs | 240731/그 계절, 그 날/that-season-that-day.cpp | #include <iostream>
using namespace std;
const char* isdate(int m, int d,int y){
if((m == 5 || m == 3 || m == 1 || m == 7 || m == 8 || m == 10 || m == 12) && (d == 31) ){
if(m==3 || m== 5)
return "Spring";
else if(m== 7 || m== 8)
return "Summer";
else if( m == ... | ALGO | 0.999613 | 4.017141 |
b15f7e65-a8da-4017-a744-e5deeb7ea383 | Sadat-09/Codeforces | A_Free_Cash.cpp |
#include <bits/stdc++.h>
#define IO \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(NULL)
typedef long long int ll;
typedef long double LD;
#define w(t) \
int t; \
cin >> t; \
while (t--) \
{ \
so... | ALGO | 0.999696 | 4.068754 |
4385cb51-3ea9-4407-8751-a4d3f1b3055d | suhaskvittal/foresight-cpp | include/boost_1_78_0/libs/spirit/example/qi/key_value_sequence_ordered.cpp | // The purpose of this example is to show how to parse arbitrary key/value
// pairs delimited by some separator into a std::vector. The difference to
// the example 'key_value_sequence.cpp' is that we preserve the order of the
// elements in the parsed seqeunce as well as possibly existing duplicates.
//
// For a mor... | TEST | 0.939724 | 5.985384 |
6596be44-b8e1-46f0-ac30-1458f8c867f1 | shivanshsanoria1/LeetcodeSolutions | CPP [501-1000]/740.earn_and_delete [3].cpp | class Solution {
public:
// T.C.=O(n*logn), S.C.=O(n)
// DP-Tabulation with Space-Optimization
int deleteAndEarn(vector<int>& nums) {
// num -> freq
unordered_map<int, int> mp;
for(int num: nums)
mp[num]++;
vector<int> vec;
for(auto [num, fr... | ALGO | 0.999944 | 6.424139 |
95a40fd4-6dcf-488c-a541-f7a9e297900e | RanaEssam03/BMI_Calculator | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998859 | 6.785645 |
ef1d41f7-ddea-4def-8010-bab65e6b3c30 | coder-ss/TotooLeet | cpp/SearchInsertPosition.cpp | #include <iostream>
#include <vector>
#include <cstdlib>
using namespace std;
/**
* Given a sorted array and a target value, return the index if the target is found.
* If not, return the index where it would be if it were inserted in order.
* You may assume no duplicates in the array.
* Here are few examples.... | ALGO | 0.999988 | 6.312847 |
2ce6f83e-2b70-4ed9-96b1-33e345eac8c8 | Junbug331/cpp-algorithm | Recursion/FillAlgorithm/main.cpp | #include <iostream>
using namespace std;
const int Nmax = 1005;
char a[Nmax][Nmax];
bool vis[Nmax][Nmax];
const static int dx[4] = {-1, 0, 1, 0};
const static int dy[4] = {0, 1, 0, -1};
bool isValid(int row, int col, int n, int m)
{
if(row < 1 || row > n || col < 1 || col > m)
return false;
if (a[... | ALGO | 0.999696 | 4.813307 |
1d00d33f-0c97-47c6-88f0-e886351c39d5 | Mikadore/llvm-project | clang/lib/Analysis/LiveVariables.cpp | #include "clang/Analysis/Analyses/LiveVariables.h"
#include "clang/AST/Stmt.h"
#include "clang/AST/StmtVisitor.h"
#include "clang/Analysis/AnalysisDeclContext.h"
#include "clang/Analysis/CFG.h"
#include "clang/Analysis/FlowSensitive/DataflowWorklist.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/Support/raw_ostream.h... | TOOL | 0.911421 | 7.669033 |
252fa307-5a75-4937-9c47-b88fb9bc2d19 | raincross7/code-similarity | codes/train_code/problem308/problem308_393.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<pair<int,int>> vpii;
#define F first
#define S second
#define PU push
#define PUF push_front
#define PUB push_back
#define PO pop
#define POF pop_front
#define POB pop_back
#defi... | ALGO | 0.999973 | 4.65189 |
1b88d040-ab2e-4313-a737-994db833d1b3 | mansoorcheema/SMPL | Pinocchio/refinement.cpp | #include "pinocchioApi.h"
#include "deriv.h"
#include "debugging.h"
struct RP //information for refined embedding
{
RP(TreeType *inD, const Skeleton &inSk, const vector<Vector3> &medialSurface)
: distanceField(inD), given(inSk)
{
vector<Vec3Object> mpts;
for(int i = 0; i < (int)medialSu... | ALGO | 0.999126 | 4.069075 |
36278888-9c10-44d1-8cbd-ba1921d2ebe9 | vijayakumar-h/firebase_notification | 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.998799 | 6.776823 |
56f686e0-8ae6-4b8a-b56a-68357b07a6bb | v2v3v4/xray-csky | engine/utils/xrAI/compiler_cover.cpp | #include "stdafx.h"
#include "compiler.h"
#include "cl_intersect.h"
#include "xrThread.h"
#include <mmsystem.h>
#include "quadtree.h"
#include "cover_point.h"
#include "object_broker.h"
Shader_xrLC_LIB* g_shaders_xrlc ;
xr_vector<b_material> g_materials ;
xr_vector<b_shader> g_shader_render ;
xr_vector<b_sha... | ALGO | 0.988084 | 4.437505 |
89e50d08-c135-44ef-ae4d-3f4d9eb082cc | pangbo13/SJTU-OJ | 3012.cpp | #include<iostream>
using namespace std;
template <class elemType>
class stack{
public:
virtual bool isEmpty() const = 0; //ջ
virtual void push(const elemType&x) = 0; // ջ
virtual elemType pop() = 0; // ջ
virtual elemType top() const = 0; // ȡջԪ
virtual ~stack() {} //
};
template <class elemType>
class seqSt... | ALGO | 0.99972 | 3.985339 |
dd6fe424-f2f4-48de-859e-525b2abb8b6f | imkiller32/CompiCodes | TWEND(spoj).cpp | #include<bits/stdc++.h>
using namespace std;
int dp[1024][1024];
int sol(int i,int j,int a[])
{
if(i>j)
return 0;
if(dp[i][j]!=-1)
return dp[i][j];
int sum1,sum2;
if(a[i+1]>=a[j])
sum1=a[i]+sol(i+2,j,a);
else if(a[i+1]<a[j])
sum1=a[i]+sol(i+1,j-1,a);
if(a[i]>=a[j-1])
sum2=a[j]+sol(i+1,j-1,a);
else if(... | ALGO | 0.999909 | 3.782402 |
2d86a71d-98cf-43c8-8d72-2f6a359dafac | vishnukhokhar/LeetCode | Binary Search Tree/two_sum_in_BST.cpp | #include <bits/stdc++.h>
using namespace std;
/**
* 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... | ALGO | 0.999982 | 5.963109 |
da9e43a5-b940-4eb3-b5b1-734b7d030588 | Vinitx67/CPP-PROGRAMS | pattern.cpp | #include <iostream>
using namespace std;
int main()
{
int n, i, j;
cout << "ENTER A NUMBER : ";
cin >> n;
for (i = n; i >= 1; i--)
{
for (j = 1; j <= i; j++)
{
cout << "* ";
}
cout << "\n";
}
for (i = 1; i <= n; i++)
{
for (j = 1; j <=... | ALGO | 0.999453 | 4.057153 |
ce82590c-0a21-46d2-a19c-d5be88afb2b1 | shyam640/Data-Structure-and-Algorithm | Linked Lists/Leetcode Problems Solutions/Linear Linked List/15. Intersection of Two Linked List.cpp | //Question Link - https://leetcode.com/problems/intersection-of-two-linked-lists/
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
int lengthOfList(ListNode* head){
int len... | ALGO | 0.999557 | 5.482075 |
c9ceb3fe-c458-45a7-9fbc-a9ca5549b447 | kjyoa09/Cpp | Programmers/level 2/Jarden Case .cpp | #include <string>
using namespace std;
string solution(string s) {
string answer = "";
for (char ss:s){
switch(ss){
case '0':case '1':case '2':case '3':case '4':case '5':case '6':case '7':case '8':case '9':case ' ':
answer += ss;
break;
default:
... | ALGO | 0.995091 | 4.939968 |
42755d9c-49e5-43bb-90af-52dbc2aee396 | Divyanshu9794/cpp_practice | A - Save Water Save Life.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int t;
cin>>t;
while(t--){
int a,b,c,d;
cin>>a>>b>>c>>d;
int e = b+c/2;
if(a*e<=d){
cout<<"YES"<<endl;
}
else{
cout<<"NO"<<endl;
}
}
} | ALGO | 0.999198 | 3.781117 |
2f4ba308-a90c-4e44-975f-5e7be7f69ab3 | PixelMedia1/f4 | perf/perf_nth_element.cpp | #include <algorithm>
#include <iostream>
#include <numeric>
#include <vector>
#include <boost/compute/system.hpp>
#include <boost/compute/algorithm/nth_element.hpp>
#include <boost/compute/container/vector.hpp>
#include "perf.hpp"
int rand_int()
{
return static_cast<int>((rand() / double(RAND_MAX)) * 25.0);
}
i... | ALGO | 0.992596 | 5.48058 |
6bd92d7f-19f9-42cd-80a2-acc14562fa59 | ishandutta2007/codeforces | cyand1317/normal/525/E.cpp | #include <cstdio>
#include <map>
typedef long long int64;
static const int MAXN = 25;
static const int UBD_FACT = 18;
int n, k; int64 s;
int a[MAXN];
int64 fact[UBD_FACT + 1];
std::map<int64, int> count[MAXN + 1];
int main()
{
fact[0] = 1;
for (int i = 1; i <= UBD_FACT; ++i) fact[i] = fact[i - 1] * i;
sc... | ALGO | 0.99983 | 3.561919 |
a32f7469-4b59-4a31-b2a5-76ded620c62a | Qwertyygdervbuhn/NewRepo6 | ConsoleApplication16/ConsoleApplication16.cpp | int main()
{
int arr[5]{ 1,2,3,4,5 };
for (int a = 0; a < 5; a++) {
cout << arr[a] << "\t";
}
for (int i = 5; i > -1; i--) {
cout << arr[i] << endl;
}
return 0;
}
| ALGO | 0.986242 | 3.124142 |
b8103581-f2e3-4179-9d87-08d007130638 | Derious/cuMPC | dependence/eigen-3.4.0/bench/benchEigenSolver.cpp |
// g++ -DNDEBUG -O3 -I.. benchEigenSolver.cpp -o benchEigenSolver && ./benchEigenSolver
// options:
// -DBENCH_GMM
// -DBENCH_GSL -lgsl /usr/lib/libcblas.so.3
// -DEIGEN_DONT_VECTORIZE
// -msse2
// -DREPEAT=100
// -DTRIES=10
// -DSCALAR=double
#include <iostream>
#include <Eigen/Core>
#include <Eigen/QR>
#in... | TOOL | 0.980316 | 5.772194 |
acf8d5c0-6cdd-46a0-87d1-839eca64acf8 | windreamer/tire | test/algorithm/benchmark.cpp | #include "algorithm/consthash.hpp"
#include <stdexcept>
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <cmath>
using namespace algorithm;
using namespace std;
int random (int a, int b)
{
if (b < a)
{
throw std::invalid_argument("b is less than a");
}
if ((b-a) > RAND_MAX)
... | ALGO | 0.998215 | 4.853364 |
c28dc6f0-92ab-4e8e-9334-3e81b0db867a | obiwac/freebsd-gsoc | contrib/llvm-project/llvm/lib/Analysis/ScalarEvolutionNormalization.cpp | #include "llvm/Analysis/ScalarEvolutionNormalization.h"
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/Analysis/ScalarEvolution.h"
#include "llvm/Analysis/ScalarEvolutionExpressions.h"
using namespace llvm;
/// TransformKind - Different types of transformations that
/// TransformForPostIncUse can do.
enum Transfor... | TOOL | 0.944848 | 6.340514 |
8d5d3266-3922-476c-8b64-e0ae70927d8f | 2745518585/code | U1746.cpp | #include<cstdio>
#include<algorithm>
using namespace std;
typedef long long ll;
const int N=1000001;
struct tree
{
int l,r;
ll s;
}T[N<<2];
int a[N];
void pushup(int x)
{
T[x].s=max(T[x<<1].s,T[x<<1|1].s);
}
void build(int x,int l,int r)
{
T[x].l=l;
T[x].r=r;
if(l==r) return;
int z=l+r>>1;
... | ALGO | 0.999851 | 3.888723 |
9725c5c8-ab4f-45c2-ba4d-661c57965639 | Ashuu21/DSA-with-CPP | 06DSA/DSA using C++/01Types of Algorithm/Simple Algorithm.cpp | #include<iostream>
using namespace std;
int main()
{
int n1, n2, s;
cout<<"Enter first number\n";
cin>>n1;
cout<<"Enter second number\n";
cin>>n2;
s = n1 + n2;
cout<<"Sum of "<<n1<<" and "<<n2<<" is "<<s;
return 0;
}
| TOOL | 0.938753 | 3.792905 |
fc380cd7-4344-4eca-b55b-6aa6b0160347 | ks-kushagra/Interviewbit | 11.Tree Data Structure/22.Order of People Heights.cpp |
You are given the following :
A positive number N
Heights : A list of heights of N persons standing in a queue
Infronts : A list of numbers corresponding to each person (P) that gives the number of persons who are taller than P and standing in front of P
You need to return list of actual order of person... | ALGO | 0.999999 | 5.228251 |
037aea4a-6a31-45ba-bab9-bbdfa094df41 | Himanshu07-debug/Competitive-Programming | 12-Greedy/Problems/Problem-03-1.cpp | // In this problem, you are initially given an empty multiset. You have to process two types of queries:
// ADD x — add an element equal to 2^x to the multiset;
// GET w — say whether it is possible to take the sum of some subset of the current multiset and get a value equal to w
// Each query with t and v --> t = 1 ... | ALGO | 0.998976 | 5.620104 |
9b98ba24-bc13-47a6-94bd-fe0a4a336ce0 | jpazarzis/development | samples/cpp-samples/parallel_processor.cpp | #include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <iostream>
#include <memory>
#include <vector>
#include <assert.h>
#include <mutex>
#include <condition_variable>
#include <thread>
#include <deque>
#include <time.h>
#include "Pool.h"
#include "ParallelProcessor.h"
using namespace std... | TOOL | 0.932626 | 3.986624 |
14cd9917-2a76-498c-8aba-7f007e95c16e | sk10salman/placement | floting.cpp | #include<iostream>
#include<bits/stdc++.h>
using namespace std;
int check(int y)
{
for(int i=10;i<=2000;i=i+10)
{
if(y<=i)
{return i;break;}
}
}
int main() {
//code
int t;
cin>>t;
for(int i=0;i<t;i++)
{
int x,y;
if(x%y==0)
cout<<int(x/y)<<endl;
else{
in... | ALGO | 0.999261 | 4.530765 |
6feb7fb7-fa6b-4fa2-b81f-434ff7face33 | Xutzu11/Advent-Of-Code | 2024/1/silver.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
freopen("file.in", "r", stdin);
freopen("file.out", "w", stdout);
long long x, y, tot = 0;
vector < long long > vx, vy;
while (cin >> x >> y) {
vx.push_back(x);
vy.push_back(y);
}
so... | ALGO | 0.99978 | 4.213578 |
eead3f17-3495-4ed2-8ae8-67cbe480581e | zcobell/hmdf | thirdparty/boost_1_73_0/libs/geometry/test/algorithms/disjoint/disjoint_coverage_l_a.cpp | // Boost.Geometry (aka GGL, Generic Geometry Library)
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
#ifndef BOOST_TEST_MODULE
#define BOOST_TEST_MODULE test_disjoint_coverage
#endif
// unit test to test disjoint for al... | TEST | 0.883396 | 7.854252 |
35398efe-905c-4a49-8f71-e1912df83331 | nicklinesla/4.21-arcore | Engine/Source/ThirdParty/PhysX/PhysX_3.4/Source/SimulationController/src/ScConstraintGroupNode.cpp | #include "ScConstraintGroupNode.h"
#include "ScConstraintProjectionManager.h"
#include "PsFoundation.h"
#include "ScBodySim.h"
#include "ScConstraintSim.h"
#include "ScConstraintInteraction.h"
using namespace physx;
Sc::ConstraintGroupNode::ConstraintGroupNode(BodySim& b) :
body(&b),
parent(this),
tail(this),
ra... | TOOL | 0.879469 | 5.915551 |
059df163-476c-42a5-b498-726f003b1579 | ConicalRom/platform_frameworks_base | media/libstagefright/codecs/mp3dec/src/pvmp3_dequantize_sample.cpp | /*
------------------------------------------------------------------------------
PacketVideo Corp.
MP3 Decoder Library
Filename: pvmp3_dequantize_sample.cpp
Functions:
power_1_third
pvmp3_dequantize_sample
Date: 09/21/2007
--------------------------------------------------------------... | ALGO | 0.999678 | 3.89465 |
074effbb-adc8-47e2-ac18-17406b0b3ce9 | RoushanKhalid/CP_Clown | CF_S - Sum of Consecutive Odd Numbers.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int t; cin>>t;
while(t--){
int a,b,sum=0; cin>>a>>b;
if(a>b) swap(a,b);
for(int i=a+1;i<=b-1;i++){
if(i%2!=0) sum+=i;
}
cout<<sum<<endl;
}
return 0;
} | ALGO | 0.999929 | 4.200252 |
fb0ec286-3fa3-443e-8852-472d375dd3d0 | AGistinger/Udemy_Beginning_CPP_Programming | OverloadingOperatorsChallengeTwo/OverloadingOperatorsChallengeTwo.cpp | #include "OverloadingOperatorsChallengeTwo.h"
#include <iostream>
#include <cstring>
//No-Args Constructor
Mystring::Mystring()
:str{nullptr}
{
str = new char[1];
*str = '\0';
}
//Overloaded Constructor
Mystring::Mystring(const char *s)
:str{nullptr}
{
if(s == nullptr)
{
str = new char... | TOOL | 0.987403 | 4.639906 |
1c7b7baf-d86c-4dd3-b0dd-0d7f9e8dca0d | ibmcnxdev/test1 | third_party/SCIPR/libff/depends/xbyak/sample/bf.cpp | #define XBYAK_NO_OP_NAMES
#include "xbyak/xbyak.h"
#include <stdio.h>
#include <stdlib.h>
#include <stack>
#include <fstream>
#ifdef _MSC_VER
#pragma warning(disable : 4996) // scanf
#define snprintf _snprintf_s
#endif
class Brainfuck : public Xbyak::CodeGenerator {
private:
enum Direction { B, F };
std::string to... | TOOL | 0.934266 | 5.715415 |
77c4993f-1c41-4314-acbe-adaab650f78f | benkatzir/CIS22C | 6.7.1 Lab Singly-Linked List (Display)/main.cpp | /*
CIS 22C
This program builds and displays a sorted list.
The list is sorted in ascending order by name.
Requirement
Overload the displayList() function as shown below:
list.displayList(); // displays the entire list
list.displayList(3.0); // displays all students with the gpa below or equal to 3.0.
li... | TOOL | 0.876596 | 5.725912 |
2e64b166-9c6c-4654-9e7f-fc5a80068bfa | notiom/Mystudy | leetcode/hot100/68_二分查找_寻找两个正序数组的中位数.cpp | // 1.我自己的解
// 使用原地快速排序之后在查找中位数
class Solution
{
public:
double findMedianSortedArrays(vector<int>& nums1, vector<int>& nums2)
{
// 我能想到的第一思路是通过排序算法之后在寻找中位数
nums1.insert(nums1.end(), nums2.begin(), nums2.end());
quickSort(nums1,0,nums1.size() - 1);
int n = nums1.size();
... | ALGO | 0.999998 | 5.854825 |
1dcff248-0d86-4194-99a0-26710de82a85 | SylarAnh/docker-colrio | 3rd_party/gtsam-4.2a8/examples/Pose2SLAMExample_graphviz.cpp | /**
* @file Pose2SLAMExample_graphviz.cpp
* @brief Save factor graph as graphviz dot file
* @date Sept 6, 2013
* @author Frank Dellaert
*/
// For an explanation of headers below, please see Pose2SLAMExample.cpp
#include <gtsam/slam/BetweenFactor.h>
#include <gtsam/geometry/Pose2.h>
#include <gtsam/nonlinear/Leven... | ALGO | 0.950852 | 6.251012 |
e44c0873-e5ec-402d-bab6-9e9daeee5eb1 | xiataoyue/VE475-Cryptography | homework/h4/ex3/ex3_4.cpp | //
// Created by James Xia on 2021/6/16 0016.
//
#include <iostream>
#include <cmath>
using namespace std;
unsigned int modulo(unsigned int a, unsigned int b, unsigned int e) {
unsigned int c = 1;
if(b == 1) return 0;
for(int i = 0; i < e; i++) {
c = (c * a) % b;
}
return c;
}
int main(){... | ALGO | 0.999936 | 4.551165 |
4a37f0d7-ee2d-41c7-9abb-cc65aa99acbe | Faerbit/Saxum | extern/bullet/src/BulletCollision/Gimpact/btGImpactBvh.cpp | /*! \file gim_box_set.h
\author Francisco Leon Najera
*/
#include "btGImpactBvh.h"
#include "LinearMath/btQuickprof.h"
#ifdef TRI_COLLISION_PROFILING
btClock g_tree_clock;
float g_accum_tree_collision_time = 0;
int g_count_traversing = 0;
void bt_begin_gim02_tree_time()
{
g_tree_clock.reset();
}
void bt_end_gim0... | ALGO | 0.99958 | 7.141726 |
131f45d0-433b-4337-8904-4e1dc737cb3f | sastava007/Tech-Interview-Preparation | Hackerrank + Geeks for Geeks + DS Courseware/Dequeue Array.cpp | #include<bits/stdc++.h>
#define max 100
using namespace std;
struct dequeue
{
int array[max];
int rear;
int fron;
};
bool isempty(struct dequeue *q)
{
if(q->fron==-1 && q->rear==-1)
return true;
}
bool isfull(struct dequeue *q)
{
if(q->fron==0&&q->rear==max-1 || q->fron=q->rear+1)
re... | ALGO | 0.996624 | 3.290137 |
bc9d5366-2623-47fc-85fc-d14cc5405fe9 | chi-city/Labyrinth-Escape | ExploreTheTwistyLabyrinth.cpp | // -----------------------------------------------------------------------
// Project 4 - Labyrinth Escape II, ExploreTheTwistyLabyrinth.cpp
//
// Escaping the twirly labyrinth
//
// Author: Zaid Awaidah
// Date: 2 / 23 / 2022
// Class: CS 251, Spring 2022, UIC
// ----------------------------------------------------... | ALGO | 0.98506 | 4.2522 |
3f06ba3b-5d81-4011-8e99-7f740fb248b1 | Sheiger/yes_no_app | 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.998799 | 6.776823 |
abf709c4-7104-409e-8c06-80062da87b8f | osdc/AttendX | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998784 | 6.761023 |
cd159a0b-e33a-43e3-a0b6-a5be663a63db | trmr/code | atcoder/APG4b/EX12.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
int N = S.size();
int a;
int sum = 0;
char op;
for (int i = 0; i < N; i++) {
if (i % 2 == 0) {
a = S.at(i) - '0';
if (op == '+') sum += a;
else if (op == '-') sum -= a;
else sum... | ALGO | 0.999977 | 4.799637 |
46ae1250-e153-4d44-ba29-603699af55f0 | Br-cider/programmin-g-C-and-C- | to check if the no. is neon or not.cpp | #include<iostream>
using namespace std;
int main(){
int num,sum;
cout<<"give an more then one digit number: ";
cin>>num;
while(num>0){
int remind=num%10;
int sum= remind;
num/=10;
cout<<"the product of digits should be"<<sum<<endl;
}
int square= sum^2;
if(square == num)
cout<<"the number is an neon number";
else... | ALGO | 0.999688 | 3.844458 |
6a0143ee-d5b6-4c23-a3dc-6e93a9ee51ea | kaho0/CPP | vector/pairSUm.cpp | #include<iostream>
#include<vector>
using namespace std;
vector <int> pairsum(vector<int>arr,int target)
{
int st=0,end=arr.size()-1;
int currSum=0;
vector<int>ans;
while(st<end)
{
currSum=arr[st]+arr[end];
if(currSum==target)
{
ans.push_back(st);
ans.pu... | ALGO | 0.999856 | 4.927098 |
32b4709b-06d5-4cc6-bd1c-6dc27564b2ae | LoveWX/kickstart | 2020RoundF/a.cpp | #include <iostream>
#include <vector>
#include <array>
#include <algorithm>
using namespace std;
const int SIZE = 100000;
int main()
{
vector<array<int, 2>> vp(SIZE);
int ncase;
cin >> ncase;
for (int icase = 1; icase <= ncase; ++icase)
{
int N, X;
cin >> N >> X;
vp.resize(N);
... | ALGO | 0.998159 | 3.580155 |
8c2ddb88-1384-40e3-913e-8d94300c7cbb | dongpy78/Code_C_C- | Toan-Roi-Rac/1.truong (bai tap tuan)/code giai thuat/Chuong ly thuyet do thi/Kiem tra do thi lien thong/DFS_lien_thong.cpp | #include <iostream>
#include <fstream>
using namespace std;
short size, so_dinh_tham = 0;
short a[100][100];
bool Tham[100];
void LayDuLieu() {
ifstream file ("do_thi.txt");
file >> size;
for (short i = 1; i <= size; i++) {
for (short j = 1; j <= size; j++) {
file >> a[i][j];
}... | ALGO | 0.999767 | 4.021283 |
a99202cc-161d-43dc-bc95-a47e697b49f6 | rezwan4029/UVA-CODES | 10249 - The Grand Dinner.cpp | /*
AUST_royal.flush
*/
#include <bits/stdc++.h>
#define pb push_back
#define all(x) x.begin(),x.end()
#define ms(a,v) memset(a,v,sizeof a)
#define II ({int a; scanf("%d", &a); a;})
#define LL ({Long a; scanf("%lld", &a); a;})
#define DD ({double a; scanf("%lf", &a); a;})
#define EPS 1e-10
#define pi 3.1415926535897... | ALGO | 0.999951 | 3.526089 |
2fc16f65-d5d2-4d28-a3b5-ba1534e70833 | DoanTrungHuy/exercises-and-solutions-to-algorithmic-problems | OTHER/olp_kc21_distance.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int MN = 1e5 + 10;
int n, m, q;
int a[MN], b[MN], c[MN];
int tree[4*MN];
void update(int node, int left, int right, int index, int value) {
if (index < left or index > right) {
return;
}
if (left == right) {
tree[no... | ALGO | 0.999996 | 5.210268 |
b037da63-fe3d-4f9a-9ddb-846913c45360 | abdallamourad/Competitive-programming | UVA/Dynamic-Programming/10405.cpp | #include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define ll long long int
int main() {
string s, t;
while(1) {
if (getline(cin, s).eof() ||
getline(cin, t).eof()) break;
int n = (int) s.size(), m = (int) t.size();
vector<vector<int>> dp(n + 1, vector<int>(m + 1, 0));
... | ALGO | 0.999664 | 4.285386 |
c116efc6-c9d5-433d-b206-4029594adee9 | Madhav-Ahuja27/CPP | sumNatrual.cpp | #include <iostream>
using namespace std;
int pSum(int n){
// int sum=n*(n+1)/2;
int sum=0;
for(int i=1;i<=n;i++){
sum+=i;
}
return sum;
}
int main(){
int n;
cin>>n;
cout<<pSum(n);
}
| ALGO | 0.999852 | 4.675372 |
5856dead-4dd8-4bb2-9c78-bf5a88f5d316 | ogvanetwork/ogva-core | src/crypto/aes.cpp | #include <crypto/aes.h>
#include <string.h>
extern "C" {
#include <crypto/ctaes/ctaes.c>
}
AES256Encrypt::AES256Encrypt(const unsigned char key[32])
{
AES256_init(&ctx, key);
}
AES256Encrypt::~AES256Encrypt()
{
memset(&ctx, 0, sizeof(ctx));
}
void AES256Encrypt::Encrypt(unsigned char ciphertext[16], const ... | TOOL | 0.880316 | 7.549944 |
133d3836-feb1-48e2-859d-658cd381662c | ygzaydn/Kattis | Kattis/Prsteni/prsteni.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
void turn_calculator(vector<int> &input);
int main(int argc, char **argv)
{
int number_of_ring;
cin >> number_of_ring;
vector <int> rings(number_of_ring);
for (int i=0;i<number_of_ring;i++){
cin >> rings.at(i);
}
turn_calculato... | ALGO | 0.999907 | 4.066694 |
8d710ac5-3176-4289-8b0b-756e3e27b3f3 | Erick-Andrade/Exercises | obi/2021/p1/zero.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, num, total = 0;
vector<int> numeros;
cin >> n;
while (n--) {
cin >> num;
if (num != 0) {
numeros.push_back(num);
} else {
if (!numeros.empty()) {
numeros.pop_back();
... | ALGO | 0.999774 | 4.132367 |
50f94fc8-6181-41c8-821a-7504c7e2366f | itohdak/AtCoder | ABC/new/A-E/16-/162/E.cpp | #include <bits/stdc++.h>
// #include "/home/itohdak/AtCoder/000/print.hpp"
using namespace std;
#define ll long long
#define REP(i,m,n) for(int i=(int)(m); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define RREP(i,m,n) for(int i=(int)(m); i>=(int)(n); i--)
#define rrep(i,n) RREP(i,n-1,0)
#define REPL(i,m,n) for(ll i=... | ALGO | 0.999958 | 4.549222 |
e0a44b25-11be-450a-8d4d-2826acc931ce | Autumn1998/relion | CudaFBP/multisirt/atom.cpp | //gcc -o atom atom.c mrcfile.c -lm
#include <time.h>
#include "mrcfile_atom.h"
#include "atom.h"
#ifndef TEXT_LINE_MAX
#define TEXT_LINE_MAX 500
#endif
#define MILLION 1000000
//float ANG[ANG_MAX];
//float BNG[ANG_MAX];
/**********************************************************************************/
/**********... | ALGO | 0.98736 | 3.02093 |
5f0e2cbc-8892-472a-91ed-e1aa2805dde8 | ivaibhavraheja/gfg-problems | convert BST to max heap.cpp | class Solution{
private:
void getInorder(Node* root, vector<int> &inorder){
if(root == NULL){
return;
}
getInorder(root->left, inorder);
inorder.push_back(root->data);
getInorder(root->right, inorder);
}
void convertToPostorder(Node* root, vector<int> &i... | ALGO | 0.999957 | 5.732281 |
1f01a12c-6b94-459e-8ebb-8c684334d3eb | shiva0123m/DSA | 133-clone-graph/clone-graph.cpp | /*
// Definition for a Node.
class Node {
public:
int val;
vector<Node*> neighbors;
Node() {
val = 0;
neighbors = vector<Node*>();
}
Node(int _val) {
val = _val;
neighbors = vector<Node*>();
}
Node(int _val, vector<Node*> _neighbors) {
val = _val;
... | ALGO | 0.999756 | 6.434136 |
bafe2965-e1a2-45c5-888c-fe6dbcddda2b | ujjwal0020/DSA-Problems | TREE/02 BINARY TREE CREATION .CPP | #include<iostream>
using namespace std;
struct node{
int data;
node* left;
node* right;
};
node *push(int x)
{
node *child=new node();
child->data=x;
child->left=NULL;
child->right=NULL;
return child;
}
void printtree(node *n)
{
while(n!=NULL)
{
cout<<n->data<... | ALGO | 0.999778 | 4.075285 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.