uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
fcf47bc8-a801-4ee0-8e67-3962ef895551 | ishandutta2007/codeforces | sofapuden/normal/124/A.cpp | #include <bits/stdc++.h>
#include <bits/extc++.h>
using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
typedef long double ld;
typedef double db;
typedef string str;
typedef pair<int,int> pi;
typedef pair<ll,ll> pl;
typedef pair<db,db> pd;
typedef vector<int> vi;
typedef vector<ll> vl;
typ... | ALGO | 0.999715 | 4.452847 |
63472a6b-f19d-4fbb-bed2-24f1683bab71 | RomainG06/TaskView-Calendar | task_calendar/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.998155 | 6.76073 |
eabbf623-9b79-4954-844d-460c6656675d | Anashikforu/LeetCode-DSA | 100-same-tree/100-same-tree.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.999941 | 6.234026 |
3652ad4f-6da5-4635-b7fd-92e945dd8aad | IshanC05/LeetCode-Questions | Preorder Traversal and BST - GFG/preorder-traversal-and-bst.cpp | //{ Driver Code Starts
// Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// User function Template for C++
class Solution {
public:
int canRepresentBST(int arr[], int N) {
// code here
stack<int>st;
int root = INT_MIN;
for(i... | ALGO | 0.999572 | 6.594143 |
2ba59aee-9e28-442f-bb8c-d767c8718b0d | Anuj-S62/DSA_problems_cpp | dynamic_initializ_of_obj.cpp | #include<iostream>
using namespace std;
class bankdeposite{
int principal;
int year;
float interest;
float returnvalue;
public:
bankdeposite();
bankdeposite(int a,int y,float r);
bankdeposite(int a,int y,int r);
void display(){
cout<<returnvalue<<endl;
... | TOOL | 0.920426 | 3.697037 |
50f8d868-b7ad-4f38-8d3b-58d449d30717 | rikarani/online-judge | Kattis/faktor.cpp | // Source : https://open.kattis.com/problems/faktor
#include <iostream>
using namespace std;
int main()
{
// deklarasi variable
int A; // number of article you want to publish
int I; // the impact factor the owners require
int hasil = 0;
// minta inputan dari user
cin >> A >> I;
hasil = A... | ALGO | 0.999381 | 3.461776 |
fae3eca8-abfe-4cd2-8733-14ec09db5863 | johny1122/C-Cpp | C++/Ex4/MlpNetwork.cpp | /**
* @file MlpNetwork.cpp
* @author Jonathan Birnbaum
* @date 08/06/2020
*
* @brief MlpNetwork class implementation
*/
#include "MlpNetwork.h"
/**
* @brief constructor
*/
MlpNetwork::MlpNetwork(const Matrix* weights, const Matrix* biases) :
_layer1(weights[0], biases[0], Relu),
... | ALGO | 0.936683 | 4.29246 |
b52b91ac-4deb-4989-aa54-79f5c96e1839 | xm45/OJ | poj/3710/9659291_AC_735MS_4952K.cpp | #include <cstdio>
#include <vector>
#include <cstring>
using namespace std;
int N;
int M,K;
vector<int> G[1100];
int sg[1100];
int ans[1100];
bool used[1100];
int Ismany[1100][1100];
void rang(int ct,int be,int f,int cnt,int &ans,int &last)
{
used[be] = 1;
for(int i=G[be].size()-1;i>=0;i--)
{
if(Ismany[be][G[be... | ALGO | 0.999897 | 3.438166 |
029a4b29-2193-40c8-8a8c-b2b6e054ef4e | lineage4munch/android_frameworks_av | media/codecs/amrwb/dec/src/band_pass_6k_7k.cpp | /*
------------------------------------------------------------------------------
Filename: band_pass_6k_7k.cpp
Date: 05/08/2004
------------------------------------------------------------------------------
REVISION HISTORY
Description:
---------------------------------------------------------------------... | ALGO | 0.999857 | 5.574719 |
23eed699-f286-4fa7-b65b-d95c50fdffbb | jayin92/competitive-programming | sprout/794.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<int, ll> pil;
typedef pair<ll, int> pli;
typedef pair<double,double> pdd;
#define SQ(i) ((i)*(i))
#define MEM(a, b) memset(a, (b), sizeof(a))
#define SZ(i) int(i.size())
#define FOR(i, ... | ALGO | 0.999998 | 4.4864 |
1f3a549f-f21a-4cce-b058-5e5b03682d93 | cwhuang1937/CP | practice/CODEFORCES 1165A Remainder/main.cpp | #include<bits/stdc++.h>
#define ll long long
#define ld long double
using namespace std;
int main() {
ios::sync_with_stdio(0), cin.tie(0);
int n, x, y, res = 0;;
string s;
cin >> n >> x >> y;
getline(cin, s);
getline(cin, s);
reverse(s.begin(), s.end());
for(int i = 0; i < x; ++i) {
... | ALGO | 0.999713 | 4.057614 |
e4569f03-dae1-4f8c-87ec-bac9208c3f7d | dl8sd11/online-judge | codeforces/527D.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pii;
typedef pair<double,double> pdd;
#define MEM(a, b) memset(a, (b), sizeof(a))
#define SZ(i) ll(i.size())
#define FOR(i, j, k, in) for (ll i=j ; i<k ; i+=in)
#define RFOR(i, j, k, in) for (ll i=j ; i>=k ; i-=in)
#define REP(i, j... | ALGO | 0.999954 | 4.085049 |
8972dcf5-7ded-4892-9e83-b6c673374dbb | aborlean/LeetCode | longest-repeating-character-replacement.cpp | class Solution {
public:
int characterReplacement(string s, int k) {
int n = s.length(), i = 0, j = 0, ma = 0, ans = -1;
unordered_map<char, int> map;
while(j < n) {
map[s[j]]++;
ma = max(ma, map[s[j]]);
int current = j - i + 1;
if(current - ma... | ALGO | 0.999992 | 6.368221 |
ed63b16b-9fc1-4c04-828a-93f7f69d1d21 | Hann1bal/SortVizualizeCpp | Engine.cpp | //
// Created by Andrey on 07.11.2023.
//
#include "Engine.h"
bool Engine::Init(int SCREEN_WIDTH, int SCREEN_HEIGHT) {
bool success = true;
if (SDL_SetHint("OpenGL", "OpenGL")) {
}
if (SDL_Init(SDL_INIT_EVERYTHING) < 0) {
std::cout << "SDL could not initialize! SDL_Error:" << SDL_GetError() <... | TOOL | 0.925933 | 5.307529 |
614c1ec7-58ef-4058-b666-873088670078 | cjh9368/LeetCode | Regular_Expression_Matching.cpp | //#include "iostream"
#include "stdio.h"
#include "string"
#include "string.h"
using namespace std;
class Solution
{
public:
bool isMatch(string s, string p)
{
return helper( s, p, 0, 0);
}
bool helper(string s, string p, int i, int j)
{
if (0 == p[j])
{
return 0 == s[i... | ALGO | 0.999904 | 3.586571 |
a60e5525-b149-4f9f-a31f-26f2b3bb0508 | Shapooo/leetcode | 2956.找到两个数组中的公共元素.cpp | #include <cstdio>
#include <vector>
using namespace std;
/*
* @lc app=leetcode.cn id=2956 lang=cpp
*
* [2956] 找到两个数组中的公共元素
*/
// @lc code=start
class Solution {
public:
vector<int> findIntersectionValues(vector<int> &nums1, vector<int> &nums2) {
int m1[101]{}, m2[101]{};
for (auto const &x : nums1) {
... | ALGO | 0.999618 | 5.708693 |
31f8ddb7-a62a-4abf-bc30-0dd498052a36 | aswaunni/Cpp-Progamming-Questions | Tree/buildTreeFromPreInorder.cpp | /******************************************************************************
Online C++ Compiler.
Code, Compile, Run and Debug C++ program online.
Write your code in this editor and press "Run" button to compile and execute it.
******************************************... | ALGO | 0.999985 | 5.853888 |
29bbf559-7bd6-4fcf-ad2b-ee05484f943e | 132001012-Tarun/coders | 20-08-23.cpp | // Reverse K Digits
// intuion is like removing the greater elemnt from the first
class Solution {
public:
string removeKdigits(string num, int k) {
if(num.length() <= k)
return "0";
if(k == 0)
return num;
string res = "";// result string
... | ALGO | 0.999994 | 6.036294 |
6305808f-cfce-48e6-af3e-4a033eb8e809 | ishandutta2007/codeforces | hank55663/normal/1738/F.cpp |
#include<bits/stdc++.h>
#define pb push_back
#define x first
#define y second
#define pdd pair<double,double>
#define pii pair<int,int>
#define pll pair<LL,LL>
#define mp make_pair
#define LL long long
#define ULL unsigned long long
#define sqr(x) ((x)*(x))
#define pi acosl(-1)
#define MEM(x) memset(x,0,sizeof(x))
#de... | ALGO | 0.999942 | 3.385225 |
ffb87620-774b-42bc-8593-0cfd65ffd945 | Eeman1113/Leetcode | Problems/645.cpp | class Solution {
public:
int findLongestChain(vector<vector<int>>& pairs) {
int ans = 0;
int prevEnd = INT_MIN;
ranges::sort(pairs,
[](const auto& a, const auto& b) { return a[1] < b[1]; });
for (const vector<int>& pair : pairs)
if (pair[0] > prevEnd) {
++ans;
... | ALGO | 0.999749 | 6.015677 |
a1a99d07-10bc-430b-a834-4fe7e6c5b5f1 | amsraman/Competitive_Programming | VT HSPC/2018/E.cpp | #include <bits/stdc++.h>
using namespace std;
int n, tb, rl, ans;
char a, b, c, d;
int main()
{
cin >> n;
for(int i = 0; i<n; i++)
{
cin >> a >> b >> c >> d;
tb+=(2-(a-'0')-(b-'0'));
rl+=(2-(c-'0')-(d-'0'));
}
ans = min(tb/2,rl/2);
tb-=2*ans, rl-=2*ans;
cout << ans... | ALGO | 0.999566 | 3.039536 |
2ab5e86f-5e0d-44ee-b502-e9a6c0d649be | ishandutta2007/codeforces | romka/normal/178/C1.cpp | #include <cstdio>
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <memory.h>
#include <cstring>
#include <ctime>
#include <cmath>
#include <set>
#include <map>
#include <algorithm>
using namespace std;
#define forn( i,n ) for ( int i=0; i<(int)(n); i++ )
#define pb push_back
typedef... | ALGO | 0.999893 | 3.852951 |
90da4973-5be7-49e3-9ab0-5edc0abfc19e | bhumireddyakshaya/c-programing- | 5.avg of array.cpp | #include <stdio.h>
int main() {
int arr[] = {2, 4, 6, 8, 10};
int n = sizeof(arr) / sizeof(arr[0]);
int sum = 0;
float average;
for (int i = 0; i < n; i++) {
sum += arr[i];
}
average = (float)sum / n;
printf("The average of the array is: %.2f", average);
return 0;
}
| ALGO | 0.992751 | 4.197055 |
6d3cb93e-c032-439c-9736-e29c4f2d5ead | aiviaghost/Kattis_solutions | Open-Kattis/arcticnetwork.cpp | #include <bits/stdc++.h>
using namespace std;
#define INF 2e9
using ll = long long;
using pii = pair<int, int>;
using pdd = pair<double, double>;
struct edge {
int u, v;
double w;
};
struct edge_cmp {
inline auto operator() (edge &e1, edge &e2) -> bool {
return e1.w < e2.w;
}
};
struct Uni... | ALGO | 0.999963 | 4.318126 |
e500a288-e3e4-4210-8451-6be42fb33e01 | zhuhu00/ORB_SLAM3_ROS | Thirdparty/g2o/g2o/types/types_six_dof_expmap.cpp | #include "types_six_dof_expmap.h"
#include "../core/factory.h"
#include "../stuff/macros.h"
namespace g2o {
using namespace std;
Vector2d project2d(const Vector3d& v) {
Vector2d res;
res(0) = v(0)/v(2);
res(1) = v(1)/v(2);
return res;
}
Vector3d unproject2d(const Vector2d& v) {
Vector3d res;
res(0) =... | ALGO | 0.966405 | 5.55332 |
5a7d94d1-bf6c-497d-8cf0-4445ce1372c6 | morris821028/UVa | volume100/10039 - Railroads.cpp | #include <stdio.h>
#include <iostream>
#include <string.h>
#include <map>
#include <queue>
using namespace std;
struct edge {
int to;
short startTime, endTime;
edge(int a, short b, short c):
to(a),startTime(b),endTime(c) {}
};
vector<edge> g[105];
short dist[2400][105];
void solve(char *name1, char ... | ALGO | 0.999791 | 3.926147 |
970d66be-3efc-48de-b1b9-064327963bd2 | oxygen-hunter/Flashboom | data/big-vul-100/add_attention_code/Phi/top0-100/count-all-possible-routes-Solution.countRoutes/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.999115 | 5.461751 |
73753e3d-9f2e-469a-9968-fb0ad86e9ebe | MilenaPellegrino/Programming_Problems | coderforces/3_Round_1009/C_XOR_and_Triangle.cpp | #include<bits/stdc++.h>
using namespace std;
#define fore(i,a,b) for(ll i=(a);i<(b);i++)
#define rof(i, a, b) for(ll i=(b);i>(a);i--)
#define forn(e,c) for(const auto &e : (c))
#define db(x) cout<<#x<< " = "<<(x)<<endl
#define RAYA cout<<"=============="<<"\n"
#define sz(x) ((int)x.size())
#define all(x) (x).begin(),(x... | ALGO | 0.998398 | 3.965313 |
208d17ae-d3af-4fa1-b671-d262a59f4991 | johnding1996/HKUST-COMP5411 | assignment_1_2/ext/eigen/unsupported/doc/examples/PolynomialSolver1.cpp | #include <unsupported/Eigen/Polynomials>
#include <vector>
#include <iostream>
using namespace Eigen;
using namespace std;
int main()
{
typedef Matrix<double,5,1> Vector5d;
Vector5d roots = Vector5d::Random();
cout << "Roots: " << roots.transpose() << endl;
Eigen::Matrix<double,6,1> polynomial;
roots_to_mo... | TEST | 0.998415 | 4.659281 |
8f57fc8d-66f5-4ec5-adc5-4f49355b993e | Phimie/Coding-Exercises | C,C++Exercises/C++PracticeCodes01/动态内存分配练习(杨辉三角).cpp | //̬ڴϰ()
#include<stdio.h>
#include<stdlib.h>
void CreatTriangle(int n);
int main (){
int rows;
printf(":");
scanf("%d",&rows); //
CreatTriangle(rows);
return 0;
}
void CreatTriangle(int n){
int **triangle = (int **)malloc(n * sizeof(int));
if (triangle == NULL){
printf("ڴʧ\n");
return;
}
//ڴ
f... | ALGO | 0.99964 | 3.196772 |
7fe4bfdc-c75f-4bed-a604-52e0d626c88d | Dipanshuofficial/HR | CPP/weightedUniformStrings.cpp | #include <bits/stdc++.h>
using namespace std;
string ltrim(const string &);
string rtrim(const string &);
/*
* Complete the 'weightedUniformStrings' function below.
*
* The function is expected to return a STRING_ARRAY.
* The function accepts following parameters:
* 1. STRING s
* 2. INTEGER_ARRAY queries
*/... | ALGO | 0.999944 | 5.750621 |
292807ad-baf4-4df3-a84e-8c37ff790b48 | lucky529/Leetcode | 最长和谐子序列/最长和谐子序列/test.cpp | //144msͨ 1.map¼ÿֵĸֽ 2.жڵǷһ 3.Ǹµǰmaxֵ
class Solution {
public:
int findLHS(vector<int>& nums) {
if (nums.size() == 0) return 0;
map<int, int> mp;
for (auto& e : nums)
{
mp[e]++;
}
auto pre = mp.begin();
auto cur = ++mp.begin();
int max = 0;
while (cur != mp.end())
{
if (cur->first - pre->first... | ALGO | 0.999952 | 5.495457 |
0735db4c-c324-4459-afe4-6dc83a533600 | yangyuan333/UnrealEngine | Engine/Plugins/Experimental/ProxyLODPlugin/Source/ThirdParty/UVAtlasCode/UVAtlas/isochart/packingcharts.cpp | /*
[Levy 2002]Levy, B. Pettjean, S., Ray, N.,And Mallet, J.-L. 2002
Least squares conformal maps for automatic texture atlas generation.
In Processings of SIGGRAPH 2002. 362-371.
[SGSH02] SANDER P., GORTLER S., SNYDER J., HOPPE H.:
Signal-specialized parameterization
In Proceedings of Eurograph... | ALGO | 0.999546 | 4.343414 |
5a01ac8d-a3d9-41ea-ba53-b2b6fc34bb4b | Abhifs001/C-and-CPP-Programs | kthmaxmin_inarray.cpp | #include<iostream>
#include<vector>
#include<map>
// create a map and store the frequencies of the element and sum frequencies till it becomes equal to k and return corresponding element
using namespace std;
class Kth_MAXMIN {
public :
int kthmaxi(vector<int>&array, int K){
map<int,int>mp;
for(... | ALGO | 0.999983 | 4.628512 |
559bf35f-3b4c-4d19-aee3-79a512e7c654 | sr0409/BankSimulation | BankSimulation.cpp | //
// Created by Stanley Razumov on 2019-04-18.
//
#include "BankSimulation.h"
#include <queue> // std::queue
#include <cstdlib>
#include <fstream>
#include <iostream>
std::ifstream data{"input.dat"};
void BankSimulation::fillQueue() {
while (data >> order >> time) {
lineQueue.push(order);
... | ALGO | 0.935361 | 4.121213 |
4a995e33-0471-4e97-b092-f107f67ff9f8 | piyushmarya/Data-Structures | Queue/1)Queue using array.cpp | #include <iostream>
using namespace std;
class queue
{
int front ,rear,size;
int *arr;
public:
queue()
{
size=0;
}
queue(int n)
{
front=-1;
rear=-1;
arr=new int[n];
size=n;
}
void enqueue(int a)
{
if(rear==size-1)
{
... | ALGO | 0.995101 | 3.65872 |
6aace0d1-a04c-47f7-9af1-a250eaa24395 | SoniAkash9140/DSA | 62 Tree/65 Binary FAANG/kAncestor.cpp | #include <bits/stdc++.h>
using namespace std;
struct Node
{
int data;
struct Node *left;
struct Node *right;
};
Node* newNode(int val)
{
Node* temp = new Node;
temp->data = val;
temp->left = NULL;
temp->right = NULL;
return temp;
}
Node* buildTree(string str)
{
// Corner Cas... | ALGO | 0.999931 | 4.254692 |
14b9d0ea-abee-47b4-a3a5-29efe76124c0 | alalhossain94/Algorithms | Module 12 Merge Sort Recap/merge_sort.cpp | #include<bits/stdc++.h>
using namespace std;
void merge(int a[],int l,int m,int r)
{
int leftSize = m-l+1;
int rightSize = r-m;
int L[leftSize],R[rightSize];
int k=0;
for(int i=l;i<=m;i++)
{
L[k]=a[i];
k++;
}
k=0;
for(int i=m+1;i<=r;i++)
{
R[k]=a[i];
... | ALGO | 0.999993 | 4.580133 |
c4d6b8b7-cb7d-4587-872d-6804d282a283 | VladislavVostok/BW411GROUP | W14_1_Pointers_Practice/w14_1_pointers_pactice.cpp | // : [M] B[N] (M N ).
// ,
// .
#include <iostream>
using namespace std;
void randomPush(int* A, int &N) {
for (int i = 0; i < N; i++) {
*(A + i) = rand() % 10 + 1;
}
}
void printArr(int* A, int& N) {
for (int i = 0; i < N; i++) {
cout << *(A + i) << " ";
}
cout << endl;
}
int* mergeA... | ALGO | 0.999608 | 3.122933 |
dac2d840-3507-4ecb-9c73-480712390cc2 | faizan346/Ds-Algo-Cplusplus | stack-queue/15queqe.cpp | #include<bits/stdc++.h>
using namespace std;
class Queue {
public:
int front;
int size;
int cap;
int *a;
Queue(int capacity = 10) {
cap = capacity;
a = new int[cap];
front = 0;
size = 0;
}
void push(int v) {
if(size == cap) {
//cout <<... | ALGO | 0.995691 | 4.316084 |
3cefeec2-9541-4579-a3b5-65fcd6f103c4 | NoirNorie/STL_P | simulation/2476.cpp | // 2476: 주사위 게임
#include <iostream>
#include <cmath>
using namespace std;
int mx = 0;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL); cout.tie(NULL);
int n; cin >> n;
while(n--)
{
int a, b, c; cin >> a >> b >> c;
int sum = 0;
if (a == b && b == c && c == a) su... | ALGO | 0.997148 | 4.56945 |
fbbb7e96-9b70-4e42-bef4-65782ee0c85a | kmm-2459308/Practice | Practice/MaxOfThree_test/MaxOfThree_test/ArrayLinkedListSample_Rev2.cpp | //==========================================================
// AC`XgTv
//==========================================================
#define _CRT_SECURE_NO_WARNINGS
#include "member.h"
#include "Array_LinkedList.h"
#include <stdio.h> // printf(),scanf()
typedef enum {
TERMINATE,
INSERT_FRONT,
INSERT_REAR,
REMOVE_F... | TOOL | 0.98401 | 3.711935 |
e233d12d-06dc-43e5-9f32-d71eff5c8fa6 | raincross7/code-similarity | codes/train_code/problem079/problem079_131.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
int main(){
ll MOD = 1000000007;
int n, m;
cin >> n >> m;
vi broken(n+1);
vi a(n);
rep(i,m){
cin >> a[i];
broken[a[i]] = 1;
}
... | ALGO | 0.999995 | 4.291136 |
4258a802-cc77-4097-8aa8-73946786e635 | IAmShaaann/DSA-Codes | Leetcode/Medium/richestCustomerWealth.cpp | /*You are given an m x n integer grid accounts where accounts[i][j] is the amount of money the ith customer has in the jth bank. Return the wealth that the richest customer has.
A customer's wealth is the amount of money they have in all their bank accounts. The richest customer is the customer that has the maximum we... | ALGO | 0.999178 | 5.982675 |
e1c684f1-8dae-4184-bdfd-c9fe86bfaa17 | D4isy/procademy_full_procademy | BinaryTree/BinaryTree/main.cpp | #include <iostream>
#include "BinaryTree.h"
using namespace std;
int main()
{
BinaryTree Tree;
Tree.InsertNode(10);
Tree.InsertNode(11);
Tree.InsertNode(12);
Tree.InsertNode(5);
Tree.InsertNode(6);
Tree.InsertNode(3);
Tree.InsertNode(9);
Tree.InsertNode(100);
Tree.InsertNode(20);
Tree.InsertNode(1);
Tree... | ALGO | 0.995681 | 5.610206 |
fc92be52-218c-4bae-a46e-213c7a876007 | shah-zx/plus-plus-C | .history/IBM/sd_20220730213631.cpp | #include <bits/stdc++.h>
#include <stack>
#include <queue>
#include <math.h>
#include <limits.h>
#include <algorithm>
#include <unordered_set>
#include <unordered_map>
using namespace std;
#define vi vector<int>
#define vii vector<pair<int, int>>
#define pii pair<int, int>
#define rep(i, a, b) for (int i = a; i < b; i+... | ALGO | 0.998962 | 3.195941 |
c51867b6-a037-4ea4-aea2-ca74d4b853f6 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_5369_2.cpp | #include <bits/stdc++.h>
using namespace std;
char dic[50] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
char a[10][10];
char ans[10000][5];
int la;
void U(int y) {
ans[++la][0] = 'U', ans[la][1] = y + '0';
char t = a[1][y];
for (int i = (1); i <= (5); ++i) a[i][y] = a[i + 1][y];
a[6][y] = t;
}
void D(int y) {
an... | ALGO | 0.999936 | 3.132381 |
a419c4ac-5157-4d67-9b8e-cd16fa030e51 | Cyclic3/murk | src/crypto/hash/hmac.cpp | #pragma once
#include "murk/crypto/hash.hpp"
#include <cppthings/iota_iter.hpp>
#include <atomic>
#include <thread>
namespace murk::crypto {
murk::data gen_hmac_key_collision(Botan::HashFunction& hf,
flow_t<murk::data_const_ref, bool> is_hash_ok,
... | ALGO | 0.978164 | 6.161413 |
9434485e-d334-4f40-99b2-cdc9766ab2a2 | yhtang/MESO | src/USER-MISC/compute_ackland_atom.cpp | #include "string.h"
#include "compute_ackland_atom.h"
#include "atom.h"
#include "update.h"
#include "modify.h"
#include "neighbor.h"
#include "neigh_list.h"
#include "neigh_request.h"
#include "force.h"
#include "pair.h"
#include "comm.h"
#include "memory.h"
#include "error.h"
#include <math.h>
using namespace LAMMPS... | ALGO | 0.998162 | 4.80379 |
73c2d45b-1493-477a-8fad-c260481b53d6 | SoyOscarRH/CompetitiveSolutions | Leetcode/129-SumRootToLeafNumbers.cpp | class Solution {
private:
int sum = 0;
public:
auto sumNumbers(TreeNode* const root, const int current_sum = 0) -> int {
if (!root) return 0;
const auto current = current_sum * 10 + root->val;
if (!root->left and !root->right) sum += current;
if (root->left) sumNumbers(root->left, current);
... | ALGO | 0.999906 | 6.952699 |
445d54cc-89c2-41b7-8748-0917da504449 | ibqn/cses | 1669-round-trip/trip.cpp | #include <iostream>
#include <vector>
using namespace std;
int dfs(int node, vector<vector<int>> &adj, vector<bool> &visited, vector<int> &parent)
{
for (int neighbor : adj[node])
{
if (!visited[neighbor])
{
visited[neighbor] = true;
parent[neighbor] = node;
... | ALGO | 0.999978 | 4.817479 |
38150b82-ea31-4b23-be12-bc2fb666925b | Leiru-Cat-Developer/CPP-Educational | Programas Básicos [CURSO]/1 - Introduccion ENTRADA Y SALIDA - Ejercicio 4 - SUMA, RESTA, MULTIPLICACION y DIVISION.cpp | #include<iostream>
using namespace std;
int main(){
int numero1 = 0, numero2 = 0, suma = 0, resta = 0, multiplicacion = 0, division = 0;
cout<<"DIGITE NUMEROS 1: "; cin>>numero1;
cout<<"DIGITE NUMEROS 2: "; cin>>numero2;
suma = numero1+numero2;
resta = numero1-numero2;
multiplicacion = numero1*numero2;
division ... | ALGO | 0.943215 | 3.150133 |
872e0f3e-09b3-48de-8361-63404e0ea082 | DanMint/leetcode-solving | add_two_numbers/main.cpp | #include "solution.cpp"
#include <iostream>
using std::cout;
using std::endl;
int main () {
Solution solution;
/// create l1 and l2 (input data)
auto* l1 = new ListNode(2);
l1->next = new ListNode(4);
l1->next->next = new ListNode(3);
auto* l2 = new ListNode(5);
l2->next = new ListNode(... | ALGO | 0.999372 | 6.203623 |
5119fa78-f37c-4e9f-82a6-0e972f3256d4 | simiknainwal/DSA-2025 | Recursion/03.cpp | //***** Backtracking *****
#include<iostream>
using namespace std;
int f1(int i,int n){
if(i<1){
return 1;
}
f1(i-1,n);
cout<<i;// print line is always after the function call
return 1;
}
int f2(int i,int n){
if(i==n){
return 1;
}
f2(i+1,n);
cout<<i;
return 1;
}
int main(){
f2(1,5);
} | ALGO | 0.999604 | 3.674591 |
538015dc-eb01-4d82-8a8c-935aa80c8227 | jsupancic/AStar_Dual_Tree_HandPose | Trees/ZSpanTree.cpp | #include "ZSpanTree.hpp"
#include <opencv2/opencv.hpp>
#include "util.hpp"
namespace deformable_depth
{
using namespace cv;
using namespace boost;
GraphHash hashMST(const ImRGBZ&imsc, vector<Edge_Type> &mst)
{
GraphHash treeMap;
for(int iter = 0; iter < mst.size(); iter++)
{
Edge_Type&edge = mst... | ALGO | 0.998286 | 3.979465 |
6d3fac20-ccfc-4576-af46-75400a1dca42 | VINAYKUMARKUNDER/DSA-Problem | 13_Dec/40_Gas Stations/Ideal Solutions/gasStations.cpp | #include <bits/stdc++.h>
using namespace std;
int gasStations(int gas[], int cost[], int n) {
// Function to find the index of the starting gas station around the circuit once
int totalDiff = 0, diff = 0;
int index = 0;
for (int i = 0; i < n; i++) {
diff += gas[i] - cost[i];
totalDiff +=... | ALGO | 0.999933 | 5.441037 |
80564428-fb3e-4bb8-a56d-e7244a5bf29e | youngsam-byun/my-notes.github.io | leetcode/src/test/java/Math/296.Best-Meeting-Point/296.Best-Meeting-Point.cpp | class Solution {
public:
int minTotalDistance(vector<vector<int>>& grid)
{
vector<vector<int>>persons;
int M = grid.size();
int N = grid[0].size();
vector<int>rows;
vector<int>cols;
for (int i=0; i<M; i++)
for (int j=0; j<N; j++)
... | ALGO | 0.999888 | 6.255653 |
9bda0a30-ca54-4c40-ba4d-1ee3ab6734c5 | AmirUCR/ALLEGRO | src/scorers/uCRISPR/RNAstructure/orega/GeneticAlgorithm.cpp | #include "GeneticAlgorithm.h"
#define OUTPUT
#define ITERATIONS_PER_SAVE 1 // Save the state file after this many iterations.
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <sstream>
#include <cassert>
#include "../src/random.h"
using std::cout;
using std::cer... | ALGO | 0.99916 | 6.149807 |
d2d69c53-b51a-4997-8fe4-e0fe06d8b8fd | simonyhong/Blip | _Utilties/Trial_Viewer/AdjustAxis.cpp |
#include "stdafx.h"
#include "Analysis.h"
#include<stdlib.h>
#include<stdio.h>
#include<math.h>
#include "AnalysisDoc.h"
#include "Figure.h"
#include "AnalysisView.h"
#include "SinTable.h"
void CAnalysisView::AdjustScale(double &minY, double &maxY)
{
int i, howManyDivisionsY=4;
int multiplied=0;
#define Multiplie... | TOOL | 0.894807 | 3.861453 |
b30184c7-eb17-412f-be86-93843844e676 | zkj201607295/CNN-GNN | LearningFilters/gspbox/3rdparty/sources/flann-1.8.4-src/examples/flann_example.cpp |
#include <flann/flann.hpp>
#include <flann/io/hdf5.h>
#include <stdio.h>
using namespace flann;
int main(int argc, char** argv)
{
int nn = 3;
Matrix<float> dataset;
Matrix<float> query;
load_from_file(dataset, "dataset.hdf5","dataset");
load_from_file(query, "dataset.hdf5","query");
Matrix... | ALGO | 0.98929 | 5.355836 |
225ff4ca-b838-4d44-8d5c-6227408de877 | bitcoinanatomy/bitcoinanatomy | src/codebase/bitcoin-0.5.2 Github 2e555237d/src/crypter.cpp | #include <openssl/aes.h>
#include <openssl/evp.h>
#include <vector>
#include <string>
#include "headers.h"
#ifdef WIN32
#include <windows.h>
#endif
#include "crypter.h"
#include "main.h"
#include "util.h"
bool CCrypter::SetKeyFromPassphrase(const SecureString& strKeyData, const std::vector<unsigned char>& chSalt, con... | TOOL | 0.904314 | 7.024763 |
4fc97405-2b1c-4231-a671-b8fc5f0f0ac6 | GuacheSuede/MSSubmission1234567890 | submission/ema/boost_1_69_0/libs/msm/example/mpl_graph/msm_adaptor.cpp | #include <iostream>
// back-end
#include <boost/msm/back/state_machine.hpp>
//front-end
#include <boost/msm/front/state_machine_def.hpp>
// mpl_graph graph implementation and depth first search
#include <boost/msm/mpl_graph/incidence_list_graph.hpp>
#include <boost/msm/mpl_graph/depth_first_search.hpp>
#include <boost... | TOOL | 0.966969 | 6.488255 |
65109e4c-77c2-4e60-9341-8b53e7e075a7 | ishandutta2007/codeforces | icecuber/normal/1095/B.cpp | #include <bits/stdc++.h>
using namespace std;
int a[100000];
int main() {
ios::sync_with_stdio(0);
int n;
cin >> n;
for (int i = 0; i < n; i++)
cin >> a[i];
sort(a, a+n);
cout << min(a[n-1]-a[1], a[n-2]-a[0]) << endl;
} | ALGO | 0.999834 | 3.730197 |
3b0e9adc-92ee-49f1-b842-1c1129c4f668 | ishandutta2007/codeforces | pwild/normal/1278/C.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef pair<ll,ll> pll;
typedef vector<bool> vb;
const ll oo = 0x3f3f3f3f3f3f3f3f;
const double eps = 1e-9;
#define sz(c) ll((c).size())
#define all(c) begin(c), end(c)
#define FOR(i,a,b) for (ll i = (a)... | ALGO | 0.999874 | 4.412158 |
b1e1390f-7872-4929-ae0a-3a6618106997 | hhhnnn2112/NOI-ACcode-Explanation | Explanation2/P6170.cpp | #include <bits/stdc++.h>
using namespace std;
int n, a[100020];
long long z;
int main()
{
scanf("%d", &n);
for (int i = 0; i < n; i++)
{
scanf("%d", &a[i]);
}
for (int i = 0, j; i < n; i = j + 1)
{
z = 0;
queue<int> q;
for (j = i; j < i + n; j++)
{
for (int k = 0; k < a[j % n]; k++)
{
q.push(j... | ALGO | 0.999898 | 3.465934 |
99b1b50c-5d59-48c5-ab50-e5e53df8e706 | sguzwf/Algorithms | Numerical/Differential-Evolution/main.cpp | #include <iostream>
#include <cstdio>
#include <vector>
#include <functional>
#include <cassert>
#include <utility>
#include <cmath>
#include "Evolution.h"
using namespace std;
double testFunc(const vector<double>& vec);
double testFunc2(const vector<double>& vec);
int main()
{
const unsigned int iter_num = 100;... | ALGO | 0.999586 | 4.564147 |
3f2bb0f0-033a-427a-beb2-b44a46595ab3 | mrugacz95/TSP | Sources/GeneticAlgorithm/Path.cpp | //
// Created by Mrugi on 2016-01-06.
//
#include <algorithm>
#include "../../Headers/GeneticAlgorithm/Path.h"
#include "../../Headers/Utilities.h"
#include <profileapi.h>
Path::Path(unsigned int size, Graph* graph) {
LARGE_INTEGER time;
QueryPerformanceCounter(&time);
randomGenerator.seed((unsigned) time... | ALGO | 0.998291 | 3.672842 |
78a59cc3-f6a8-4ec8-a3a9-74dc92df9052 | xil12008/adaptive_modularity | binary_networks/Sources/cc.cpp |
int common_neighbors(int a, int b, deque<set<int> > & en) {
if(en[a].size()>en[b].size())
return common_neighbors(b, a, en);
int number_of_triangles=0;
for (set<int>::iterator iti=en[a].begin(); iti!=en[a].end(); iti++)
if(en[b].find(*iti)!=en[b].end())
number_of_triangles++;
return number_of_triangl... | ALGO | 0.999838 | 4.545972 |
d1c5c5d3-f295-4178-8a2a-f8df306f70c0 | genericSpecimen/problem-solving | dsa/primitive-types/5.9_check-integer-palindrome.cpp | /*
int reverse_nonnegative(int x) {
const int MAX = std::numeric_limits<int>::max();
int x_rev = 0;
int rem = 0;
while (x != 0) {
rem = x % 10;
if ( (x_rev == MAX/10 && rem > 7) || (x_rev >= (MAX/10)+1) ) {
return 0;
}
x_rev = x_rev * 10 + rem;
x = x/1... | ALGO | 0.999569 | 5.564839 |
f6beb815-9597-4f6d-b18a-d96d5b1741c5 | AnkitShrestha911/StAndrew-CPP | Queue/Rotten_Oranges,.cpp | #include <bits/stdc++.h>
// #include<iostream>
using namespace std;
// rotten oranges //
/*
adjacent(up(i-1,j) right(i,j+1), down(i+1,j), left(i,j-1))
--> fetch all the rotten oranges index and time
while(queue is not empty) doing the below task
--> extract the fetch i... | ALGO | 0.999873 | 5.542966 |
b4579b82-0ef7-4b50-b093-fb00defa7fa1 | yonutix/Settlers-economy-OpenMP- | main.cpp | #include "lib_seq.h"
int Pmin, Pmax;
int iterations;
/**
* \param Are the four values agregated
*/
std::vector<Report> reports;
void Year::memAlloc(int n)
{
this->n = n;
res = new int*[n];
price = new int*[n];
boudget = new int*[n];
boudgetInventory = new int*[n];
for(int i = 0; i < n; i++){
res[i] = ... | ALGO | 0.995375 | 3.720988 |
f6160c99-95db-4a1d-88b2-9df86731b7b3 | nickcellar/qtbase-applesilicon | src/3rdparty/angle/src/third_party/murmurhash/MurmurHash3.cpp | // Note - The x86 and x64 versions do _not_ produce the same results, as the
// algorithms are optimized for their respective platforms. You can still
// compile and run any of them on any platform, but your performance with the
// non-native version will be less than optimal.
#include "MurmurHash3.h"
//-------------... | ALGO | 0.998958 | 7.235088 |
9a568a7d-20d9-48ab-85c3-e97e933a4d6a | shitu13/DSA-Practice | Algorithms/Recursion/linearSearch.cpp | #include <iostream>
using namespace std;
bool linearSearch(int *arr, int size, int key){
//base case
if(size==0)
return false;
else if(arr[0]==key)
return true;
//Progressive criteria
else{
bool val = linearSearch(arr+1, size-1, key);
return val;
}
}
int m... | ALGO | 0.99993 | 4.672969 |
f8e28d75-9f7b-42aa-b57f-95cc10fe3a8c | 6108/codetree-TILs | 240504/n개의 숫자 중 최대 2개/two-max-of-n-num.cpp | #include <iostream>
#include <climits>
using namespace std;
int main() {
int n;
int m[100] = {};
cin >> n;
for (int i = 0; i < n; i++)
cin >> m[i];
for (int i = 0; i < n; i++) {
for (int j = 1; j < n; j++) {
if (m[j - 1] < m[j]) {
int temp = m[j - 1];... | ALGO | 0.999955 | 3.362328 |
039a62cc-08f2-494d-a040-be9f7f5ef663 | ishandutta2007/codeforces | jiangly/normal/1702/G2.cpp | #include <bits/stdc++.h>
using i64 = long long;
int main() {
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
int n;
std::cin >> n;
std::vector<std::vector<int>> adj(n);
for (int i = 1; i < n; i++) {
int u, v;
std::cin >> u >> v;
u--;
v--;
... | ALGO | 0.999988 | 5.299983 |
44697f4e-5060-40d1-a2b5-8785613f4b7d | jorgenunezsiri/competitive-programming-solutions | COJ/2519.cpp | #include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <cstdio>
#include <stack>
#include <queue>
#include <functional>
#include <sstream>
using namespace std;
int t, num1, num2, num3, num4, num5, num6;
string cadena;
int resultado;
stack<int> st;
queue<int> qst;
priority_queue<int, vector<... | ALGO | 0.998923 | 4.032342 |
0f4afa42-a4bf-4161-9a52-4a4bd0836dae | berdanakyurek/CS202-Fundamental-Structures-Of-Computer-Science-II | HW2/BinaryNode.cpp | /*
* Title: Binary Search Trees
* Author: Berdan Akyurek
* ID: 21600904
* Section: 2
* Assignment: 2
* Description: description of your code
*/
#include "BinaryNode.h"
#include <ios>
#include <iostream>
#include <sys/types.h>
BinaryNode::BinaryNode(int n)
{
left = NULL;
right = NULL;
value = n;
}
Binar... | ALGO | 0.998665 | 3.756857 |
5be3153e-e2e3-42cf-8232-d67a1261e70a | TalhaAhmed2001/Particle-Simulation | Particle Simulation/Particle Simulation.cpp | #include <SDL.h>
#include <stdio.h>
#include <iostream>
#include <SDL_image.h>
#include <vector>
#include "particle.h"
#include <chrono>
#include <SDL_thread.h>
using namespace std;
using namespace std::chrono;
//screen dimensions
const int SCREEN_WIDTH = 720;
const int SCREEN_HEIGHT = 720;
const int N = 1600;
const... | TOOL | 0.957656 | 4.657928 |
f0efe604-15ff-4d93-8160-1fbd9062826c | amol1211/DSAWithC-CPP | 03.SolvingLeetcodeProblems/Stack/TrappingRainWater/main.cpp | //42. Trapping Rain Water
#include <iostream>
#include <vector>
using namespace std;
class Solution {
private:
// Helper function to compute the left maximum for each element in the array
vector<int> getLeftMaxArray(vector<int> &height, int &n) {
// Initialize a vector to store left maximum values
... | ALGO | 0.999973 | 7.346471 |
d03ba591-c20d-4093-a1ae-81694de110a7 | 2013612/CP-algorithm | AtCoder/abc207/abc207C.cpp | #include<iostream>
#include<algorithm>
#include<utility>
using namespace std;
typedef pair<int, int> pii;
int N, ans;
pii a[2004];
int main() {
scanf("%d", &N);
for (int i = 0; i < N; i++) {
int t, l, r;
scanf("%d %d %d", &t, &l, &r);
l *= 2;
r *= 2;
if (t == 3 || t == 4) {
l++;
}
if (t == 2 || t ==... | ALGO | 0.99973 | 3.974109 |
d6dd1e63-a6a7-439f-99b0-4ecc3912af74 | Sarthak92101/CPP-DSA | Arrays/Pract/ArrayReverse.cpp | #include<iostream>
using namespace std;
int print(int *arr, int n ){
for(int i=0; i<n; i++){
cout << arr[i]<<",";
}
cout<<endl;
}
int main(){
int arr[]={1,2,3,4,5,6,7};
int n=sizeof(arr)/sizeof(int);
int copyarr[n];
for(int i=0; i<n; i++){
int j=n-i-1;
copya... | ALGO | 0.996184 | 3.676579 |
8e981aa3-cb33-42d4-8fda-047ed499b2c8 | IDA-TUBS/CC_LinkMonitor | thirdparty/boost_1_73_0/libs/compute/example/print_vector.cpp | #include <iostream>
#include <vector>
#include <boost/compute/system.hpp>
#include <boost/compute/algorithm/copy.hpp>
#include <boost/compute/algorithm/iota.hpp>
#include <boost/compute/container/vector.hpp>
namespace compute = boost::compute;
// this example demonstrates how to print the values in a vector
int main... | TOOL | 0.976363 | 3.46787 |
931468d7-ac78-4812-804b-5180a67b6ad4 | ishandutta2007/codeforces | simonlindholm/normal/573/A.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i, from, to) for (int i = from; i < int(to); ++i)
#define trav(a, x) for (auto& a : x)
#define all(x) x.begin(), x.end()
#define sz(x) (int)(x).size()
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
int main() {
cin.sync_with_stdio(f... | ALGO | 0.999957 | 3.892987 |
283bc603-2d38-4502-9f8b-9d0fb0891464 | andyyang200/CP | Competitive Programming/Contests/CodeForces/Contests/Global Rounds/Codeforces Global Round 2/a.cpp | #include <bits/stdc++.h>
using namespace std;
#define FOR(index, start, end) for(int index = start; index < end; ++index)
#define RFOR(index, start, end) for(int index = start; index > end; --index)
#define FOREACH(itr, b) for(auto itr = b.begin(); itr != b.end(); ++itr)
#define RFOREACH(itr, b) qfor(auto itr = b.rbeg... | ALGO | 0.999962 | 3.841734 |
2852b865-fa15-4b91-9082-80ceb44fd2ca | tkoike880/atcoder-logs | abc/abc365/b/main.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define rep1(i, n) for (int i = 1; i <= (int)(n); ++i)
#define defin(type, var) type var; cin >> var
typedef long long ll;
int main() {
int n;
cin >> n;
vector<pair<int, int>> a(n);
rep(i, n) {
int aa;
c... | ALGO | 0.999916 | 3.942866 |
01905089-09c1-4b38-a1cc-978b150e19c4 | sapna833/DSA-Supremebatch | vector/pairsum.cpp | #include<iostream>
#include<vector>
using namespace std;
int main(){
vector<int>arr{1,2,3,4,5,};
int sum=8;
for (int i = 0; i <arr.size(); i++)
{
int element=arr[i];
for (int j= i+1; j< arr.size(); j++)
{
if(element+arr[j]==sum){
cout<<"pair found"<<el... | ALGO | 0.999789 | 4.005823 |
dac12dfe-ad2e-4b73-9704-c8cad2bc637b | NishchayBhokare/DSA_Code_Files | 2_Arrays/5.1__pairSum.cpp | //Example for returning count of pairs whose sum equals to s.
//GFG
//Approach 1: One traversal approach. TC-O(N) SC(N);
int getPairsCount(int arr[], int n, int k) {
unordered_map<int,int>m;
int c=0;
for(int i=0;i<n;i++){
c+=m[k-arr[i]]; //for every ith element checking how many elements are there ... | ALGO | 0.999618 | 6.028699 |
80b59055-87ca-4dc4-925d-e67d34cb87a3 | chengshunzhang/my_leetcode | 101-200/189_Rotate_Array/189_Rotate_Array.cpp | #include <vector>
#include <iostream>
using namespace std;
class Solution {
public:
void rotate(vector<int>& nums, int k) {
int n = nums.size();
if(k == 0 || n == 1) {
return;
}
int div = (n - k) > 0 ? n - k : n - k % n;
if(div == n) {
return;
... | ALGO | 0.999901 | 4.931331 |
4c213223-64d4-44e9-bae7-e9d11a3243db | MehradShm/AlgorithmCodes | ACM-Sgu.ru/297.cpp | #include <iostream>
using namespace std;
int a[105] , b[105];
int main()
{
int n , m;
cin >> n >> m;
for(int i=0;i<m;i++)
cin >> b[i];
int k=1;
for(int i=0;i<m;i++)
for(int j=0;j<b[i];j++)
{
a[k]++;
k++;
if(k==n+1)
k=1;
}
for(int i=1;i<n;i++)
if(a[i]==a[i+1]+1)
{
cout << i << endl;
... | ALGO | 0.999996 | 3.24471 |
397fbb8d-26ff-471a-b007-ba3b06f8b454 | TomHyer/DA_Bones_Mirror | __Interp.cpp |
#include "__Platform.h"
#include "Strict.h"
#include "Interp.h"
#include "InterpCubic.h"
#include "Quadrature.h"
#include "Smooth.h"
namespace
{
/*IF--------------------------------------------------------------------------
public Interp1_New_Linear
Create a linear interpolator
&inputs
name is string
A name fo... | ALGO | 0.994991 | 6.305798 |
7726472d-daa1-4c1b-beaf-fc1f6152fb0e | trandaidong/Programming_Technique | Recursive.cpp | #include<iostream>
#include<ctime>
#include<math.h>
using namespace std;
float recursive(int x, int n) {
if (n == 1)return x;
long long Factorial = 1;
for (int i = 1; i <= n; i++) {
Factorial *= i;
}
return (1.0 * pow(x, n) / (Factorial)) + recursive(x, n - 1);
}
float notRecursive(int x, int n) {
float sum = 0... | ALGO | 0.999786 | 4.146108 |
8ed85b4b-43e0-474d-93fc-5ddf86f5e48e | Boardcoin/BOARD | src/zerocoin/Coin.cpp | /**
* @file Coin.cpp
*
* @brief PublicCoin and PrivateCoin classes for the Zerocoin library.
*
* @author Ian Miers, Christina Garman and Matthew Green
* @date June 2013
*
* @copyright Copyright 2013 Ian Miers, Christina Garman and Matthew Green
* @license This project is released under... | TOOL | 0.91657 | 6.317863 |
4aa52730-932d-4a2c-b16a-cccc592f2221 | JudsonSS/ED2 | Labs/Lab19/Respostas/Estruturado/Processos.cpp | // ------------------------------------------------------------
// Fila de Prioridades - C++ estruturado com variveis globais
// ------------------------------------------------------------
#include <iostream>
#include <string>
using namespace std;
struct Processo
{
int chave;
string nome;
bool operator>(Processo... | ALGO | 0.999281 | 4.339085 |
a9fc78fc-a2a7-41d9-9e2b-de264c88c067 | Abhijeet145/A2OJ-ladder | 1300__1399/315A.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
int n;
cin >> n;
unordered_map<int,int> mp;
vector<pair<int,int>> vec;
for(int i=0;i<n;i++)
{
int a,b;
cin >> a >> b;
mp[b]++;
vec.push_back({a,b});
}
int ans= 0;
for(auto ... | ALGO | 0.999603 | 4.071044 |
c5ca889f-60fa-47b2-b35c-032431d97039 | ASFIYAKHAN/Cpp-AsfiyaKhan-A.C.E.T-MorningBatch | Day06/Q4SmallestofIntegers.cpp | #include<iostream>
using namespace std;
int main(){
int a,b,c;
cout<<"enter the three numbers"<<endl;
cin>>a>>b>>c;
if(a < b && a < c ){
cout<<a<<"is the smallest number"<<endl;
}
else if(c < a && c < b){
cout<<c<<"is the smallest number"<<endl;
}
else{
cout<<b<<"... | ALGO | 0.999577 | 3.357923 |
a5016a5e-2b9b-4959-918b-5d2f933c25f1 | Devansh176/TodoList | 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 |
6c81a460-96df-420c-8ae2-2f47947d1cb5 | suxutao/LeetcodeList | cn/138-copy-list-with-random-pointer .cpp | #include "../../../stdc.h"
using namespace std;
//leetcode submit region begin(Prohibit modification and deletion)
// Definition for a Node.
//class Node {
//public:
// int val;
// Node* next;
// Node* random;
//
// Node(int _val) {
// val = _val;
// next = NULL;
// random = NULL;
// ... | ALGO | 0.997891 | 4.974554 |
d85e360f-d81f-4f99-8c90-fc36f5ce4944 | navyg18/dsa-tracker | LinkedList-2/Multiply.cpp | void add(Node * head, Node * ansItr) {
Node * c1 = head;
Node * c2 = ansItr;
int carry = 0;
while (c1 != NULL || carry != 0) {
int sum = carry + (c1 != NULL? c1->data:0) + (c2 != NULL? c2->data:0);
int digit = sum%10;
carry = sum/10;
if (c2->next != NULL) c2->next->data =... | ALGO | 0.999961 | 4.604357 |
a97958f4-2b51-4ecb-9eb8-50b205627db1 | ishandutta2007/codeforces | sexpert/normal/1418/D.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
map<int, int> df;
set<int> guys;
int cnt;
void add(int x) {
if(guys.empty()) {
guys.insert(x);
return;
}
auto it = guys.upper_bound(x);
if(it == guys.begin()) {
df[*it - x]++;
guys.insert(x);
re... | ALGO | 0.999796 | 4.554275 |
057716fd-ed6c-46d0-9f9a-f06bb186767a | ventus617/Linux-data-structure | BinaryTree3.cpp | #include<iostream>
using namespace std;
typedef struct node
{
struct node* pLeft;
int value;
struct node* pRight;
struct node* pFather;
}Binarytree;
Binarytree* CreateTree()
{
Binarytree* pTree = NULL;
pTree = (Binarytree*)malloc(sizeof(Binarytree));
pTree->value = 1;
pTree->pFather = NULL;
//
pTree->pLeft ... | ALGO | 0.999998 | 4.395453 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.