uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
ec56aa99-4e4c-45bb-b877-b0a1de9a0176 | shuto1441/atcoder_archive | atcoder.jp/abc129/abc129_d/Main.cpp | using namespace std;
#include <bits/stdc++.h>
#define rep(i, s) for (int i = 0; i < s; ++i)
#define repr(i, n) for(int i = n-1; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define all(v) (v.begin(), v.end())
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)
#define V... | ALGO | 0.999865 | 4.241663 |
8b717ae8-5ace-4064-9ffa-675a2ea3d9a5 | Di-Gro/FireEngine | engine/core/SimpleMath.cpp | #include "SimpleMath.h"
std::string ToString(const Vector2& vec) {
return "("
+ std::to_string(vec.x) + ", "
+ std::to_string(vec.y) + ")";
}
std::string ToString(const Vector3& vec) {
return "("
+ std::to_string(vec.x) + ", "
+ std::to_string(vec.y) + ", "
+ std::to_string(vec.z) + ")";
}
std::string To... | TOOL | 0.935614 | 6.585321 |
e08209f9-f84c-4a26-9335-9c8e39bf8ff9 | nikhilgahlaut/DSA-ALGO | DSA/mergeSort.cpp | #include <iostream>
//function to merge
void merge(int arr[],int l, int mid, int r){
int an = mid - l + 1;
int bn = r- mid;
int a[an],b[bn];
for(int i = 0 ; i<an ; i++){
a[i] = arr[l+i];
}
for(int j = 0 ; j < bn ; j++){
b[j] = arr[mid+1 + j];
}
int i =0, j =0, k=l;
... | ALGO | 0.99998 | 5.102973 |
2a5dbfea-36f5-43b1-882e-b3a1a0044ded | julianobst/xtlw6-marlin-community | Marlin/src/feature/bedlevel/abl/abl.cpp | #include "../../../inc/MarlinConfig.h"
#if ENABLED(AUTO_BED_LEVELING_BILINEAR)
#include "../bedlevel.h"
#include "../../../module/motion.h"
#define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE)
#include "../../../core/debug_out.h"
#if ENABLED(EXTENSIBLE_UI)
#include "../../../lcd/extensible_ui/ui_api.h"
#endif
xy_p... | ALGO | 0.984523 | 6.399069 |
700cf025-0941-457d-ad91-f40ca9a20ad6 | groggi/eth-algolab | ant-challenge/main.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <tuple>
#include <cmath>
#include <climits>
#include <algorithm>
#include <climits>
#include <boost/config.hpp>
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/kruskal_min_spanning_tree.hpp>
#include <boost/graph/dijkstra_shortest_paths.hp... | ALGO | 0.999657 | 3.938638 |
44d8c3a0-2300-4713-89e7-71133337bf7f | pingchungchang/CP | CF1915F.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pll pair<ll,ll>
#define pii pair<int,int>
#define fs first
#define sc second
#define tlll tuple<ll,ll,ll>
const int mxn = 4e5+10;
int bit[mxn];
vector<int> all;
int n;
pii arr[mxn];
void modify(int p,int v){
for(;p<mxn;p+=p&-p)bit[p] += v;
... | ALGO | 0.999833 | 4.063486 |
30672885-947e-4bb8-9d1a-7b8a3015b183 | RandoNandoz/cs12 | Textbook Exercises/C2E10/main.cpp | #include <iostream>
using namespace std;
int main(int argc, char const *argv[])
{
int computingPower = 1;
for (int i = 1980; i < 2001; i += 3)
{
cout << i << "\t" << (computingPower *= 4) << endl;
}
return 0;
}
| ALGO | 0.998525 | 3.254578 |
17607e45-1c9d-4f6a-9d3a-284a57a1ce41 | lukezheng1/c-language | FUNC/FUNC/func.cpp | #include<stdio.h>
int get_max(int x, int y)
{
if (x > y)
return x;
else
return y;
}
int main() {
int a, b;
scanf_s("%d %d", &a, &b);
int m = get_max(a, b);
printf("%d\n", m);
return 0;
} | ALGO | 0.999089 | 3.106161 |
f906f2b3-85ef-400a-ad44-73427379a39c | ishandutta2007/codeforces | huangxiaohua/normal/1438/A.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int n,m,x,y,i,j,t;
int main(){
scanf("%d",&t);
while(t--){
scanf("%d",&n);
for(i=1;i<=n;i++){
printf("1 ");
}puts("");
}
} | ALGO | 0.999649 | 3.22018 |
1eaf2ba7-43ad-4fc8-9003-f291bdb60916 | kunaldas01/Cpp-Programs | 20_Stack/07_Reverse_Stack.cpp | // Reverse Stack
#include <iostream>
#include <stack>
using namespace std;
void insertAtBot(stack<int> &inputStack, int data)
{
if (inputStack.empty())
{
inputStack.push(data);
return;
}
int num = inputStack.top();
inputStack.pop();
// Recursive call
insertAtBot(inputStack... | ALGO | 0.999926 | 5.428747 |
1f2df414-3db6-4e7c-947a-ecbcf321e009 | ikaushalmartin/Data-Structure-And-Algorithm | Priority Queue/Upheapify.cpp | #include<iostream>
using namespace std;
class qnode{
public:
int *val;
int front;
int end;
qnode(){
val=new int[5];
front=-1;
end=-1;
}
void isempty(){
if(front==-1 && front>end){
cout<<"queue is empty"<<endl;
}
else{
cout<<"Not empty"<<endl;
}
}
void insert(int data)... | ALGO | 0.9997 | 4.074316 |
7d517e66-2a7f-465d-b84d-a756dcb960af | sarvex/leetcode-haskell | solution/1600-1699/1665.Minimum Initial Energy to Finish Tasks/Solution.cpp | class Solution {
public:
int minimumEffort(vector<vector<int>>& tasks) {
sort(tasks.begin(), tasks.end(), [&](const auto& a, const auto& b) { return a[0] - a[1] < b[0] - b[1]; });
int ans = 0, cur = 0;
for (auto& task : tasks) {
int a = task[0], m = task[1];
if (cur <... | ALGO | 0.999992 | 6.376627 |
c3ac0b45-d992-4eaf-acc9-789e5beee11d | iamdeepakdass/GFG-Practice | Medium/Reverse each word in a given string/reverse-each-word-in-a-given-string.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
public:
string reverseWords (string s)
{
int n = s.size();
int l = 0, r;
for(int i=0; i<n; i++){
if(s[i] == '.'){
reverse(s.begin()+... | ALGO | 0.998565 | 5.887568 |
dd2547dd-9c68-456e-b0a6-6033ec897722 | pandarudra/DS | 455-assign-cookies/assign-cookies.cpp | #define all(v) begin(v),end(v)
class Solution {
public:
int findContentChildren(vector<int>& g, vector<int>& s) {
sort(all(g)) ;
sort(all(s)) ;
int cnt = 0 ;
int si = 0 , gi = 0 ;
while(gi < g.size() && si < s.size()) {
if(s[si] >= g[gi]) {
cnt++ ;... | ALGO | 0.999943 | 6.008646 |
77fee88f-126c-4942-8a18-0d51c567d6ac | ipdor/Leetcode | 406. Queue Reconstruction by Height.cpp | //https://leetcode.com/problems/queue-reconstruction-by-height/
//https://github.com/youngyangyang04/leetcode-master/blob/master/problems/0406.%E6%A0%B9%E6%8D%AE%E8%BA%AB%E9%AB%98%E9%87%8D%E5%BB%BA%E9%98%9F%E5%88%97.md
//先考虑身高h再考虑k。一定是往高个里面插入矮个,这样不会影响k
bool comp(vector<int> &a, vector<int>&b)
{
return a[0]==b[0]? a... | ALGO | 0.999989 | 5.568077 |
95314dc0-cadf-473e-81b6-11a6864d993c | EnjoyW0rld/GodotPerformanceComparison | Engine/thirdparty/oidn/mkl-dnn/src/cpu/jit_sse42_1x1_conv_kernel_f32.cpp | #include "c_types_map.hpp"
#include "nstl.hpp"
#include "type_helpers.hpp"
#include "utils.hpp"
#include "cpu_memory.hpp"
#include "jit_sse42_1x1_conv_kernel_f32.hpp"
#define GET_OFF(field) offsetof(jit_1x1_conv_call_s, field)
namespace mkldnn {
namespace impl {
namespace cpu {
using namespace mkldnn::impl::format_... | ALGO | 0.995652 | 5.767502 |
7c1090a4-52c1-4e7b-94a4-fd9c8da13ab6 | ganeshprasad21/data_structures_practice | stack/try.cpp | // C++ program for Merge Sort
#include <iostream>
using namespace std;
// Merges two subarrays of arr[].
// First subarray is arr[l..m]
// Second subarray is arr[m+1..r]
void merge(int arr[], int l, int m, int r)
{
int n1 = m - l + 1;
int n2 = r - m;
// Create temp arrays
int L[n1], R[n2];
// ... | ALGO | 0.999992 | 6.010742 |
11d1490f-a35c-47e0-9bee-4d7f761a7de6 | crpoudyal/Hacktoberfest2022 | c++/Trees/ZigZag_Traversal.cpp | // C++ implementation of a O(n) time method for
// Zigzag order traversal
#include <bits/stdc++.h>
#include <iostream>
using namespace std;
// Binary Tree node
class Node
{
public:
int data;
Node *left, *right;
};
// Function to print the zigzag traversal
vector<int> zigZagTraversal(Node *root)
{
if (root... | ALGO | 0.999999 | 6.189701 |
d5a43672-acfa-4784-a6a8-9d487403a6ed | minkimgyu/TIL | CodingTest/15666/15666/main.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int n, m;
const int maxSize = 9;
int arr[maxSize];
int inputArr[maxSize];
void dfs(int count)
{
if (count == m)
{
for (int i = 0; i < m; i++)
{
cout << arr[i];
if (i != m - 1) cout << " ";
}
cout << '\n';
}
else
{
int item = 0;
for ... | ALGO | 0.999953 | 4.577783 |
6716406c-67f9-42ff-92de-8bd8b64dd06c | vamcrizer/cpp-ptit | vam/unique_number_in_a_file.cpp | #include <fstream>
#include <sstream>
#include <string>
#include <iostream>
#include <limits.h>
using ll = long long;
using namespace std;
int main() {
ifstream file;
file.open("DATA.in");
string word;
int X[1001] = {0};
while (file >> word) {
stringstream ss(word);
int num;
... | ALGO | 0.999017 | 3.656823 |
00286792-1d0f-4af1-a076-1c3614ffc061 | benayalaskar/learning_app_benaya_latest | 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 |
27e2a204-6507-4df0-9f11-1df69f727ec3 | jtcriswell/safecode-llvm37 | lib/CodeGen/MachineScheduler.cpp | #include "llvm/CodeGen/MachineScheduler.h"
#include "llvm/ADT/PriorityQueue.h"
#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/CodeGen/LiveIntervalAnalysis.h"
#include "llvm/CodeGen/MachineDominators.h"
#include "llvm/CodeGen/MachineLoopInfo.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGe... | ALGO | 0.9357 | 7.63239 |
8c9e305c-d74e-493a-8671-20603d43528e | psood708/DSA | LeetCode/Easy/349.cpp | #include<bits/stdc++.h>
using namespace std;
vector<int> intersection(vector<int>& nums1, vector<int>& nums2) {
set<int> st1(nums1.begin(),nums1.end());
set<int> st2(nums2.begin(),nums2.end());
vector<int> res;
for(int num:st1){
if(st2.find(num)!=st2.end()){
... | ALGO | 0.999638 | 4.811908 |
74e36afb-2afa-4d2e-8915-fcfdcaeb8705 | leehi0110/Algorithm | BaekjoonAlgorithm/P2001_P4000/P2908.cpp | // Baekjoon 2908
// 문제
// 상수
#include <iostream>
#include <vector>
#include <string>
using namespace std;
int reverse(string number);
int main()
{
ios_base :: sync_with_stdio(false);
cin.tie(NULL);
string a ,b;
cin >> a >> b;
for(int i=2;i>-1;i--){
if(a[i] - '0' > b[i] - '0'){
cout << revers... | ALGO | 0.999938 | 3.917977 |
8a381b4a-f9b8-4367-baab-4680c8f6082c | yahowang/Wumpus-World-Game-AI | src/MyAI.cpp | // ======================================================================
// FILE: MyAI.cpp
//
// AUTHOR: Abdullah Younis
//
// DESCRIPTION: This file contains your agent class, which you will
// implement. You are responsible for implementing the
// 'getAction' function and any he... | ALGO | 0.939685 | 4.347692 |
944755eb-e92f-421b-aca8-5956afefebb9 | sscanf/mtx15 | v4.1/digistring.cpp | #include "stdafx.h"
#include "Digistring.h"
#include "Curvefit.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
// Segment numbering:
// ----- 13 ----- 0
//|\ | /| 8 0 12 | | 1 2
//| \|/ | 1 2 | |
// ... | TOOL | 0.891832 | 5.260527 |
5a7bb39e-415c-46ba-87c3-30d45718f283 | KojiShiono/SelfDrivingCar | Path_Planning_Project/src/Eigen-3.3/bench/product_threshold.cpp |
#include <iostream>
#include <Eigen/Core>
#include <bench/BenchTimer.h>
using namespace Eigen;
using namespace std;
#define END 9
template<int S> struct map_size { enum { ret = S }; };
template<> struct map_size<10> { enum { ret = 20 }; };
template<> struct map_size<11> { enum { ret = 50 }; };
template<> struct ... | TOOL | 0.958927 | 5.102006 |
a2ed2bd2-2f1d-499f-9a81-c9d22b30299e | kirill7785/AliceFlow-2D | ALICEFLOW0_02/ALICEFLOW0_02/my_elmatr_quad_f.cpp | // Файл my_elmatr_quad_f.cpp
// сборка матрицы для обобщённого
// уравнения конвекции-диффузии на
// совмещённой сетке.
#pragma once
#ifndef MY_ELMATR_QUAD_F_CPP
#define MY_ELMATR_QUAD_F_CPP 1
#include "amg1r5.cpp" // Алгебраический многосеточный метод Джона Руге и Клауса Штубена 1984 год.
#include "my_linalg.cpp"... | ALGO | 0.999817 | 3.736306 |
336f3618-ccb7-452c-b8fd-0259afe76540 | JimYYang/CS106B | Life/lib/StanfordCPPLib/strlib.cpp | /*
* File: strlib.cpp
* ----------------
* This file implements the strlib.h interface.
*
* @version 2015/08/02
* - added htmlEncode/Decode functions (not 100% perfect but works for common cases)
* @version 2015/06/19
* - slight bug fix to make stringToInteger functions compile with int radix
* @version 2015/... | TOOL | 0.879103 | 6.294838 |
51bedd96-cf46-49c8-a19c-662c3c427c49 | abhigrover101/leetcode | numDecoding.cpp | #include<string>
#include<vector>
#include<map>
#include<set>
#include<iostream>
using namespace std;
int numDecodings(string s) {
if(s.length()==0 || stoi(s)<0)
return 0;
int dp[s.length()];
dp[0]=1;
if(s.length()>1 && stoi(s.substr(0,2))<=26)
dp[1]=1;
... | ALGO | 0.999113 | 4.725121 |
d2c3d989-d409-4e85-9172-f359c74fbd14 | MostafaMohamed2001/C-Data-Structure | .history/hello_20240703163013.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
void calcSum(int arr[] , int count){
int r
}
int main() {
int arr[] = {10, 20, 30};
int arrSize = sizeof(arr);
cout << arrSize << endl;
} | ALGO | 0.922748 | 3.216775 |
6f114d7b-47a9-485a-843f-4379ead42d66 | viCodexm/LeetCode | 0404-sum-of-left-leaves/0404-sum-of-left-leaves.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.999885 | 6.560324 |
e6c0f342-baea-46a1-8ece-19ad73ab2d31 | andyyang200/CP | Competitive Programming/Contests/USACO/USACO Plat Lessons/4/HW Files/3/wrong2.cpp | #include <iostream>
#include <cstring>
#include <string>
using namespace std;
long long n,pow,hs,hst,ht[100005],ht2[200005],cnt,cnt2;
string s,t,t2;
int main(){
cin>>n>>s>>t;
t2=t+t;
pow=1;
for(int i=0;i<s.size();i++){
hs+=s[i]*pow;
pow*=1000000009;
}
pow=1;
for(int i=0;i<t.size();i++){
ht[i+1]=t[i]*pow... | ALGO | 0.999332 | 3.844965 |
8615a58f-b7d3-408e-8026-6757b023eac9 | miyatis/atcoder | atcoder-workspase/abc364/A/main.cpp | #include <iostream>
#include <sstream>
#include <fstream>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <stack>
#include <set>
#include <unordered_set>
#include <map>
#include <algorithm>
#include <functional>
#include <utility>
#include <bitset>
#include <cmath>
#include <cstdlib>
#inc... | ALGO | 0.999852 | 4.727099 |
09a2b523-6e7b-4ac3-8e76-cae9d56a7596 | Gj0705/RELOCALIZATION | 第一章 概述/lidar_localization/third_part/gtsam-4.0.2/gtsam/3rdparty/Eigen/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.997206 | 5.772194 |
69939c0f-7ad0-41d0-868a-432a7d550c47 | ishandutta2007/codeforces | njwrz/normal/1738/C.cpp | #include<bits/stdc++.h>
#define int long long
#define gmax(x,y) x=max(x,y)
#define gmin(x,y) x=min(x,y)
#define F first
#define S second
#define P pair
#define FOR(i,a,b) for(int i=a;i<=b;i++)
#define rep(i,a,b) for(int i=a;i<b;i++)
#define V vector
#define RE return
#define ALL(a) a.begin(),a.end()
#define MP make_pai... | ALGO | 0.999986 | 4.494633 |
a8206c3d-57ef-4f5f-9ac2-39752d7d28db | JOUNHO/BaekjoonOJ | BF/6054.cpp | #include<iostream>
#include<algorithm>
using namespace std;
int main(){
int t;
int m,n;
int x,y;
cin>>t;
for(int i=0;i<t;i++){
int result=0;
cin >>m>>n>>x>>y;
x=x-1; y=y-1;
for(int j=0;j<n;j++){
if(x%n == y){
result=x;
}else{
x=x+m;
}
}
if(result==0)... | ALGO | 0.999865 | 3.202968 |
14c78e84-88ae-4506-b173-36edadc51ccf | priyanshi585/DSA | Array/linear_search.cpp | #include<iostream>
using namespace std;
void inputArray(int arr[], int size)
{
cout<<"Enter te array elements: "<<endl;
for(int i=0;i<size;i++)
{
cin>>arr[i];
}
}
void printArray(int arr[] , int size)
{
cout<<"Array elements: "<<endl;
for(int i=0;i<size;i++)
{
cout<<arr[i]<<... | ALGO | 0.999238 | 4.643871 |
b9fb2e90-1df6-41ae-acca-d1ef267c8989 | ChetanThorat18/LeetCode | Leetcode_Problems/0300-longest-increasing-subsequence/Approach2.cpp | class Solution {
public:
int n;
vector<vector<int>>dp;
// Recursive function to find the length of the longest increasing subsequence
// idx: the current index in the nums array
// prevIdx: the index of the previous element in the subsequence
int solve(vector<int>& nums, int idx, int prevIdx) ... | ALGO | 0.999993 | 6.59102 |
ee18fd72-87d2-4080-aeda-1e8c143753ff | Tarun0312/DSA-Supreme | Week3/Live/06September2023/arrayLevel1.cpp | #include<iostream>
#include<limits>
using namespace std;
void printArray(int a[],int size){
for(int i=0;i<size;i++){
a[i]=a[i]*2;
cout<<a[i]<<" ";
}
cout<<endl;
}
//Linear Serach in an array
bool isTargetElementExist(int arr[],int size,int target){
for(int i=0;i<size;i++){
if(... | ALGO | 0.994291 | 4.076625 |
d2277d18-022e-4462-b33b-d4c528b5bc6e | AdrianArceredillo/GarapenIngurumenak | 2_Dev_C/Bukleak_ariketak/a9_zenb_baten_potentzia.cpp | #include <stdio.h>
#include <string.h>
int main() {
int zenbaki;
int digit;
int exp;
int resultado = 1;
printf("Sartu zenbaki bat: ");
scanf("%d",&zenbaki);
printf("Sartu exponentea: ");
scanf("%d",&exp);
fo... | ALGO | 0.999967 | 3.533596 |
a4456a2c-bb07-4ae8-a624-b84527f4729f | qt/qtwebengine-chromium | chromium/third_party/mesa/src/src/glsl/opt_constant_folding.cpp | /**
* \file opt_constant_folding.cpp
* Replace constant-valued expressions with references to constant values.
*/
#include "ir.h"
#include "ir_visitor.h"
#include "ir_rvalue_visitor.h"
#include "ir_optimization.h"
#include "glsl_types.h"
namespace {
/**
* Visitor class for replacing expressions with ir_constant ... | TOOL | 0.922381 | 7.928605 |
be2bf2a1-27ac-4013-aba9-c0899e85b5cd | abhiktech/leetcode-solutions | Graphs/839_SimilarStringGroups.cpp | class Solution {
public:
class Graph {
private:
unordered_map<string, unordered_set<string>> aList;
unordered_map<string, bool> visited;
int num_groups;
public:
Graph() : num_groups(0) {}
void insertEdge(... | ALGO | 0.999909 | 6.048086 |
c538511f-f2e5-406f-9178-c7862ff4ab9e | ishandutta2007/codeforces | kevin114514/normal/1515/E.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define mp make_pair
#define ALL(x) (x).begin(),(x).end()
#define rALL(x) (x).rbegin(),(x).rend()
#define srt(x) sort(ALL(x))
#define rev(x) reverse(ALL(x))
#define rsrt(x) sort(rALL(x))
#define sz(x) (int)(x.size())
void die(string ... | ALGO | 0.999959 | 4.062486 |
dd1335a7-4105-4560-8b28-53ff82e3fc8c | KelevraFromRuine/MAandSCAT | onelabhub/5/5/5.cpp | #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
class BigInteger {
private:
vector<int> digits;
bool negative;
public:
// Конструктор по умолчанию
BigInteger() : negative(false) {}
// Конструктор из строки
BigInteger(const string& numStr) {
... | ALGO | 0.998916 | 5.262808 |
82bef7b6-e422-46cd-bf0c-0a43683cea58 | vikas-4402/Codeforces | 281A-Word Capitalization.cpp | #include<iostream>
using namespace std;
int main(){
string str ;
cin >> str;
char c=str[0];
if(islower(c)){
str[0]=toupper(c);
}
cout << str << endl;
} | ALGO | 0.989689 | 4.446445 |
ad16df28-e64c-498a-9fc4-1812ea550a77 | mrmh-code/My_problem_solution_different_OJ | 2.CodeForces/89.A - Required Remainder.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin>>t;
while (t--)
{
int x,y,n;
cin>>x>>y>>n;
if(n-n%x+y<=n){
cout<<n-n%x+y<<endl;
}else{
cout<<n-n%x-(x-y)<<endl;
}
}
} | ALGO | 0.999946 | 3.781772 |
71c314a2-3782-40d4-bd11-966f0a0b3594 | JaiSehgal007/ContestArchives | Codeforces/Round920/e.cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long
#define vi vector<int>
#define vvi vector<vector<int>>
#define ll long long
#define pii pair<int,int>
#define vii vector<pii>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define ff first
#define ss second
#define setBits(x) __builtin_popcount(x)
#define om... | ALGO | 0.999568 | 3.741963 |
5c4f9c8f-1ea4-42fd-84eb-60bbeaa91885 | yjbong/problem-solving | algospot/NUMBERGAME/NUMBERGAME.cpp | #include <cstdio>
#define NODATA -1000000000
int c,n;
int a[55];
int cache[55][55][2];
int max2(int a, int b){
return a>b?a:b;
}
int min2(int a, int b){
return a<b?a:b;
}
// return maximum (player0 score-player1 score)
// turn=0 if player0's turn, 1 if player1's turn
// item[left~right] is valid
int g... | ALGO | 0.999968 | 3.772927 |
1efa75b6-40c3-46d8-8a85-eebaae75bee0 | raincross7/code-similarity | codes/train_code/problem468/problem468_169.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
int x, a;
cin >> x >> a;
if(x<a) cout << "0\n";
else cout << "10\n";
return 0;
}
| ALGO | 0.997554 | 3.381706 |
eca8b53b-008e-464c-92f6-fca72b767a95 | Mohammed-Adel107/problem-sloving | Codefroces/Codeforces Round #634/1335A.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
void slove(){
ll n;
cin>>n;
cout<<(n-1)/2<<"\n";
}
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
ll t;
cin>>t;
while(t--)
slove();
}
| ALGO | 0.999476 | 4.864095 |
c5ad8859-9cd8-4bb5-a644-2b831d3078b4 | XianMengxi/Leetcode_train | 54.螺旋矩阵.cpp | /*
* @lc app=leetcode.cn id=54 lang=cpp
*
* [54] 螺旋矩阵
*/
#include <vector>
using namespace std;
#include <unordered_map>
// @lc code=start
class Solution
{
public:
vector<int> spiralOrder(vector<vector<int>> &matrix)
{
if (matrix.empty())
{
return vector<int>();
}
... | ALGO | 0.999992 | 6.356733 |
c5df7c28-580c-4d00-bc8e-5043c135b901 | thegamer1907/Code_Analysis | Codes/AC/2494.cpp |
#include<bits/stdc++.h>
#define DEBUG(x) cout << #x << " = " << x << endl
const int NMAX = 1e6 + 5;
const int XMAX = 1e7 + 5;
using namespace std;
int n, x[NMAX], mx, m;
long long ic[XMAX];
vector<pair<int, long long> > prime;
vector<pair<int, long long> > pf;
bool marked[XMAX];
int main() {
ios_base::sync_with_... | ALGO | 0.999972 | 3.651093 |
9e766cb8-8062-402f-a03c-33a0c90ebe51 | f4t4nt/competitive-programming | archive/CodeForces/Regular/Rd906 Div1+2/qingshanlovesstrings2.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using cd = complex<long double>;
using ld = long double;
using ch = char;
using str = string;
#include <bits/extc++.h>
using namespace __gnu_pbds;
using indexed_set = tree<
pair<ll, ll>,
null_type,
le... | ALGO | 0.999389 | 4.867948 |
d52bab92-0f1a-47b4-a913-f8c6ce2b6706 | ml1150258/CSC_CIS_5 | Lab/MarkSort_Class_V1/main.cpp | /*
* File: main.cpp
* Author: mlehr
* Created on July 18, 2023, 11:25 AM
* Purpose: Mark Sort
*/
//System Libraries
#include <iostream> //I/O Stream Library
#include <cstdlib> //Random Functions
#include <ctime> //Time Library
using namespace std;
//User Libraries
#include "Array.h"
//Global Constant... | ALGO | 0.998837 | 4.424289 |
15b2b381-6b45-40a1-a9bd-7f1fab9c3b5f | huzch/Algorithm | test_9_21/test_9_21/Test.cpp | #include<iostream>
#include<vector>
#include<unordered_map>
using namespace std;
class Solution
{
public:
bool validateStackSequences(vector<int>& pushed, vector<int>& popped)
{
vector<int> st;
int i = 0, j = 0, n = pushed.size();
while (i < n)
{
st.push_back(pushed... | ALGO | 0.974142 | 6.098323 |
9a035270-5a47-49db-886b-46ad615454d2 | anisahu99/GFG_Daily_Problems | Medium/Insertion Sort for Singly Linked List/insertion-sort-for-singly-linked-list.cpp | //{ Driver Code Starts
//Initial Template for C++
#include<bits/stdc++.h>
using namespace std;
/* Link list node */
struct Node {
int data;
struct Node *next;
Node(int x) {
data = x;
next = NULL;
}
};
/* Function to print linked list */
void printList(struct Node *head)
{
struct Node *temp = head;
while (t... | ALGO | 0.999916 | 6.378548 |
49f1cf92-5bed-4634-8911-bc279443a837 | akotadi/Competitive-Programming | Code Forces/1216D.cpp | #include <bits/stdc++.h>
using namespace std;
typedef int64_t lli;
int main(){
int n;
cin >> n;
vector<int> a(n);
for(auto &it : a) cin >> it;
int maxNumber = *max_element(a.begin(), a.end());
int numGCD = maxNumber - a.front();
for(int i = 1; i < a.size(); i++)
numGCD = __gcd(numGCD, maxNumber - a[i]);
ll... | ALGO | 0.999952 | 3.430913 |
35bfac94-851d-4456-9791-e15bc55afb3a | thaplague/android_frameworks_base | media/libstagefright/codecs/amrnb/common/src/gc_pred.cpp | /*
Pathname: ./audio/gsm-amr/c/src/gc_pred.c
Functions:
gc_pred_reset
gc_pred
gc_pred_update
gc_pred_average_limited
------------------------------------------------------------------------------
MODULE DESCRIPTION
This file contains the functions that perform code... | ALGO | 0.999592 | 6.23973 |
d2230a0e-e2ec-4166-9f9e-4bbc8be31468 | CAgAG/Algorithms_CPP | algorithm2/14_test/27_remove_last_K_node.cpp | /*************************
* @file : 27_remove_last_K_node.cpp
* @encode : UTF-8
* @note : None
* @date : 2024/6/14 10
*************************/
#include "iostream"
#include "vector"
#include "algorithm"
#include "set"
using namespace std;
struct ListNode {
int val;
ListNode *next;
ListNode(... | ALGO | 0.999959 | 6.120317 |
39794d2c-a80d-4bfa-8a69-858d0cca7464 | ak5113165/cp | Practice/p12.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int n;
cin>>n;
vector<string>v;
for(int i=0;i<n;i++)
{
string ch;
cin>>ch;
v.push_back(ch);
}
int count=0;
for(int i=0;i<n;i++)... | ALGO | 0.999963 | 4.188866 |
887f9646-5151-4a1e-8169-91777f5a2550 | sunnyx33/leetcode | 154.寻找旋转排序数组中的最小值-ii.cpp | /*
* @lc app=leetcode.cn id=154 lang=cpp
*
* [154] 寻找旋转排序数组中的最小值 II
*/
#include <vector>
using namespace std;
// @lc code=start
class Solution {
public:
int findMin(vector<int>& nums) {
int i = 0;
int j = nums.size() - 1;
while (i < j) {
int m = (j + i) / 2;
if (n... | ALGO | 0.999974 | 6.655753 |
8b414923-e8f5-4aa9-bdb7-5e5f0e5f5092 | anonymouspc/anonymous | module/unincluded/math/old/1d/convolve.cpp | constexpr array_type auto convolve ( const array_type auto& left, const array_type auto& right )
requires ( left. dimension() == 1 ) and ( numeric<typename decay<decltype(left )>::value_type > or complex_type<typename decay<decltype(left )>::value_type > ) and
( right.dimension() == 1 ) and ( numeric<t... | ALGO | 0.998601 | 4.951768 |
ea6a540d-03e1-48db-b2ae-2369d3615c5c | hossainahmed359/Phitron-Course-2024-2025- | course-3/week-3/module-12-assignment-mid-term/references/reverse_doubly_linked_list.cpp | #include <bits/stdc++.h>
using namespace std;
// INSERTION
class Node
{
public:
int val;
Node *prev = NULL;
Node *next = NULL;
Node(int val)
{
this->val = val;
}
};
void print_forward(Node *head)
{
Node *tmp = head;
while (tmp != NULL)
{
cout << tmp->val << " ";
... | ALGO | 0.999642 | 5.359083 |
18778fb2-88c7-4676-baf6-cb254578f7ce | code-help-tutor/CS520-Assignment-3-Inverse-Kinematics-with-Skinning | starter/eigen/doc/examples/TutorialLinAlgExComputeSolveError.cpp | WeChat: cstutorcs
QQ: 749389476
Email: <EMAIL>
#include <iostream>
#include <Eigen/Dense>
using namespace std;
using namespace Eigen;
int main()
{
MatrixXd A = MatrixXd::Random(100,100);
MatrixXd b = MatrixXd::Random(100,50);
MatrixXd x = A.fullPivLu().solve(b);
double relative_error = (A*x - b).norm() / ... | ALGO | 0.999892 | 3.159204 |
9da1db97-d7db-47f3-9bb6-3a7eee97061a | harshbakori/classic_py_repo | opencv/opencv-master/samples/cpp/train_HOG.cpp | #include "opencv2/imgproc.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/ml.hpp"
#include "opencv2/objdetect.hpp"
#include <iostream>
#include <time.h>
using namespace cv;
using namespace cv::ml;
using namespace std;
vector< float > get_svm_detector( const Ptr< SVM >& svm );
void convert_to_ml( const std::vec... | ALGO | 0.976 | 6.498669 |
d4d453b0-67d3-4bf5-8afe-4ceadcf48901 | cactiglitch/C-C-exercises | cpp/3.9_recursion.cpp | #include <iostream>
using namespace std;
int GetFib(int fibIndex)
{
if(fibIndex < 2)
return fibIndex;
else
return GetFib(fibIndex - 1) + GetFib(fibIndex - 2);
}
int main()
{
cout << "Enter 0-based index of desired Fibonnaci Number: ";
int index = 0;
cin >> index;
cout << "Fibonacci number is: " << GetFib... | ALGO | 0.9936 | 5.026865 |
a3da53e3-9cc0-4c36-b460-8f342845f88b | bhanujabh/DSA-using-CPP | recursion/checkPalindrome.cpp | //if string and its reverse string is equal ex abba abba then its palindrome
#include<iostream>
using namespace std;
bool checkPalindrome(string str, int i, int j){
if(i>j){
return true;
}
if(str[i]!=str[j]){
return false;
}
else{
return checkPalindrome(str, i+1, j-1);
... | ALGO | 0.999831 | 4.34726 |
7078d30d-d98e-415b-bef0-e48d81570c93 | adong001/C-DS-CPP | Boost库/boost_1_58_0/libs/math/performance/bernoulli_performance.cpp | #include <boost/math/special_functions/bernoulli.hpp>
#include <boost/chrono.hpp>
#include <boost/multiprecision/cpp_dec_float.hpp>
template <class Clock>
struct stopwatch
{
typedef typename Clock::duration duration;
stopwatch()
{
m_start = Clock::now();
}
duration elapsed()
{
return Cloc... | TEST | 0.987116 | 6.574449 |
05e2e85f-1880-44a3-82eb-c07ae11f453d | bjh5098/2019_CSE4007_12852 | assignment4/z3-master/z3-master/src/ast/expr_functors.cpp | #include "ast/expr_functors.h"
// ----------
// check_pred
bool check_pred::operator()(expr* e) {
if (!m_visited.is_marked(e)) {
m_refs.push_back(e);
visit(e);
}
SASSERT(m_visited.is_marked(e));
return m_pred_holds.is_marked(e);
}
void check_pred::visit(expr* e) {
ptr_vect... | ALGO | 0.928735 | 5.543954 |
734d5c5d-a579-482c-a9e5-4bb15a50e2fa | PandeyAditya14/APS2020 | CodeLibrary/Buzz_number.cpp | //A buzz number is a number that is either divisble by 7 or has last digit as 7.
#include <iostream>
using namespace std;
int main()
{
int n, t;
cin >> t;
while (t--)
{
cin >> n;
if ((n % 7 == 0) || (n % 10 == 7))
cout << n << " is a buzz number" << endl;
else
cout << n << " is not a buz... | ALGO | 0.999548 | 4.550123 |
48ea1d2d-8bd4-447f-83e3-d786563eaf25 | amansinghbisht029/apnacollege_courseyt | deleteinBST.cpp | #include <iostream>
using namespace std;
struct Node
{
int data;
Node *left, *right;
Node(int val)
{
data = val;
left = NULL;
right = NULL;
}
};
Node *inorderSucc(Node *root)
{
Node *curr = root;
while (curr && curr->left != NULL)
{
curr = curr->left;
... | ALGO | 0.999997 | 5.588453 |
2be67d46-a019-4831-9443-8e3eafaba706 | LMFRomero/SRS_Cards | boost/libs/numeric/ublas/doc/samples/banded_matrix.cpp | #include <boost/numeric/ublas/banded.hpp>
#include <boost/numeric/ublas/io.hpp>
int main () {
using namespace boost::numeric::ublas;
banded_matrix<double> m (3, 3, 1, 1);
for (signed i = 0; i < signed (m.size1 ()); ++ i)
for (signed j = (std::max) (i - 1, 0); j < (std::min) (i + 2, signed (m.size2 ... | ALGO | 0.982099 | 3.750736 |
d22406ce-0bc7-4315-b431-cab40245a67b | Sologala/pyStag | src/PoseRefiner.cpp | #include <numeric>
#include "PoseRefiner.h"
#include "Ellipse.h"
#include "utility.h"
using cv::Point2d;
using cv::Mat;
Mat optEllipse;
class Refine;
void PoseRefiner::refineMarkerPose(EDInterface* edInterface, Marker& marker)
{
// we find an edge segment loop that belongs to the circular border, and fit an ellipse... | ALGO | 0.999635 | 4.102409 |
6a0b316a-c4d3-4f1a-9cd8-d41875c11d9d | MYXHcode/Sword-Finger-Offer-Learning-Code | 剑指Offer:名企面试官精讲典型编程题 编程练习/CodingInterviewChinese2-master/55_02_BalancedBinaryTree/BalancedBinaryTree.cpp | //==================================================================
// ָOfferԹپͱ⡷
// ߣκ
//==================================================================
// 55ƽ
// Ŀһöĸ㣬жϸDzƽij
// 1ôһƽ
#include <cstdio>
#include "..\Utilities\BinaryTree.h"
// ====================1====================
int TreeDepth(const BinaryT... | ALGO | 0.999255 | 5.863194 |
10b30093-a0e0-4760-80f1-740f8d0ecd01 | Masud-Abdullah/Online-Judges | Problem_Solving_on_Codeforces_OLD/405A. Gravity Flip.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n,i;
cin>>n;
int a[n];
for(i=0;i<n;i++)cin>>a[i];
sort(a,a+n);
for(i=0;i<n;i++)cout<<a[i]<<" ";
cout<<endl;
return 0;
}
| ALGO | 0.999757 | 3.538586 |
fe4f64ab-b6d8-4847-bd02-3fe706bb281c | Debashish-CSE/Cpp | largest_prime_factor.cpp | #include <iostream>
#include <cmath>
using namespace std;
int main()
{
int t;
cin >> t;
int largest_fact[t];
for(int i = 0; i < t; i++){
int n;
cin >> n;
int max_prime = -1;
// Removing all factors of 2
while (n % 2 == 0) {
... | ALGO | 0.999966 | 4.740712 |
c8c457e3-27ac-4e31-b0ca-dafa99327990 | iCodeIN/BOJ | C++/2739 - Gugudan.cpp | #include <iostream>
int main(int argc, char* argv[])
{
int n = 0;
std::cin >> n;
for (int i = 1; i <= 9; ++i)
{
std::cout << n << " * " << i << " = " << n * i << '\n';
}
return 0;
} | ALGO | 0.998378 | 4.363169 |
47d61d07-fcb0-4dbf-99a2-7388e5093edd | Vaibhav388120/Cpp-Course-CWH | 12.Arrays&PointerArithmetic.cpp | #include<iostream>
using namespace std;
int main(){
//Array Example
int marks[]={23,45,56,89};
int mathMarks[4];
mathMarks[0]=2278;
mathMarks[1]=738;
mathMarks[2]=378;
mathMarks[3]=578;
cout<<"These are math marks"<<endl;
cout<<mathMarks[0]<<endl;
cout<<mathMarks[1]<<endl;
... | ALGO | 0.947968 | 3.079152 |
d59d1212-703e-4bc2-a6eb-d9393064fe29 | parallel101/course | 07/03_prefetch/07/main.cpp | #include <iostream>
#include <vector>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <array>
#include <benchmark/benchmark.h>
#include <x86intrin.h>
#include <omp.h>
// L1: 32KB
// L2: 256KB
// L3: 12MB
constexpr size_t n = 1<<27; // 512MB
std::vector<int> a(n);
void BM_write0(benchmark::State &bm... | TOOL | 0.959326 | 5.679784 |
c326ad60-efed-4790-8ccf-3dc1635420ab | nupur-7/LeetCode-Solutions-Showcasing-Problem-Solving | BinarySearch/Easy/LeetCode278-First-Bad-Version.cpp | /*
LeetCode 278 First Bad Version
Topics: BinarySearch,Interactive
Approach:
> we set the search range from version 0 to n, where n represents the total number of versions.
> We then iteratively narrow down this search range by calculating the middle version (mid) and determining whether it is a bad version or not usi... | ALGO | 0.999897 | 7.219354 |
1f0072ff-bcab-475b-a120-ccd7e3f933c9 | mrvanny/Cpp-All-concepts- | unaryoverloading.cpp | #include<iostream>
using namespace std;
class Test
{
private:
int x,y;
public:
void accept(int a, int b)
{
x=a;
y=b;
}
void show()
{
cout<<"Value of X:"<<x<<endl;
cout<<"Value of Y:"<<y<<endl;
}
Test operator-()
{
Test temp;
... | ALGO | 0.932969 | 4.813316 |
cfb21224-e490-43b7-b19b-c5096c9af079 | GRIS-UdeM/SpatGRIS-legacy | JuceLibraryCode/modules/juce_gui_basics/filebrowser/juce_DirectoryContentsList.cpp | namespace juce
{
DirectoryContentsList::DirectoryContentsList (const FileFilter* f, TimeSliceThread& t)
: fileFilter (f), thread (t),
fileTypeFlags (File::ignoreHiddenFiles | File::findFiles),
shouldStop (true)
{
}
DirectoryContentsList::~DirectoryContentsList()
{
stopSearching();
}
void DirectoryCo... | TOOL | 0.898785 | 6.952988 |
10b02dfb-a153-4e06-a386-8d943c202277 | LordaeronESZ/LeetCode | 1576替换所有的问号/替换所有的问号.cpp | #include<iostream>
#include<string>
using namespace std;
class Solution {
public:
string modifyString(string s) {
for (int i = 0; i < s.size(); i++) {
if (s[i] == '?') {
s[i] = 'a';
if (i > 0 && s[i - 1] == s[i])
s[i] = char((s[i] - 'a' + 1) % ... | ALGO | 0.999981 | 3.852415 |
e1742aa5-51d1-4afe-9f13-92dd203a0f6a | leftrk/tools | archives/ncut_book/c11/11.1 石油探测.cpp | #include <iostream>
#include <string>
using namespace std;
char a[100][100];
int b[100][100];
int m;
int n;
int x[] = { 0,-1,-1,-1,0,1,1,1 };
int y[] = { 1,1,0,-1,-1,-1,0,1 };
void dfs(int i, int j)
{
b[i][j] = 0;
int tx;
int ty;
for (int k = 0; k < 8; k++)
{
tx = i + x[k];
ty = ... | ALGO | 0.999882 | 4.716215 |
e2bfdad3-6675-4195-965d-ba7b97531547 | siamx/UVA_Problems | 10685_Nature.cpp | #include <iostream>
#include <stdio.h>
#include <map>
using namespace std;
int c, r;
map<string, string> p;
map<string, int> cnt;
string find(string x) {
return p[x] == x ? x : p[x] = find(p[x]);
}
void merge(string x, string y) {
x = p[x], y = p[y];
if (cnt[x] > cnt[y]) {
p[y] = x;
cnt[... | ALGO | 0.999669 | 4.14143 |
a2c4d4a2-f514-4553-82fb-ef31fe8ff352 | AnnaYurch/ffund_alg | 5/2+/main.cpp | #include <iostream>
#include <vector>
#include <fstream>
#include <string>
class encoder {
private:
std::vector<std::byte> key;
void key_init(std::vector<std::byte> &s) const {
size_t k_len = key.size();
for (size_t i = 0; i < 256; ++i) {
s[i] = static_cast<std::byte>(i);
}... | TOOL | 0.987685 | 4.775016 |
9289e48b-9bb1-4cd1-9d36-0fb4c5b61c57 | ArthurWANGZHE/GSoC_challenge | cpp_challenge/labyrinth.cpp | #include<iostream>
#include<map>
#include<vector>
#define rm cin.tie(nullptr)->sync_with_stdio(false),cout.setf(ios::fixed,ios::floatfield);
using namespace std;
int read()
{
int s=0,w=1; char ch=getchar();
while(ch<'0'||ch>'9') {if(ch=='-') w=-1;ch=getchar();}
while(ch>='0'&&ch<='9') {s=(s<<3)+(s<<1)+ch-'0';... | ALGO | 0.99982 | 3.331948 |
d1b5f76b-d701-423a-9ae9-2b08918d0f79 | biabuarque/MFPchallenge | Problem102/sol102.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <cmath>
using namespace std;
// Calculates the area of a triangle by its cartesian coordinates by the use of [shoelace formula](https://en.wikipedia.org/wiki/Shoelace_formula)
int shoelace(int x1, int y1, int x2, int y2, int x3, int y3) {
return ab... | ALGO | 0.998692 | 5.47342 |
070b2d45-525b-4643-a9eb-18725d7025d9 | IkramBagban/Data-Structures-And-Algorithm | Supreme 2.0/11-BasicMathsAndPointers/Lecture-3_Pointers_1/2-sizeOfPointers.cpp | // Author: Ikram Bagban
// Email: <EMAIL>
// GitHub: https://github.com/ikrambagban
#include <iostream>
using namespace std;
int main() {
// Understanding Pointer Sizes in C++
// In this C++ program, we explore the concept of pointer sizes.
// We'll declare variables of different data types, such as int... | TOOL | 0.981961 | 4.854867 |
99a4eb6d-0edc-4ddc-b0eb-9ca7e45d3959 | saikatbishal/final450 | myfolder/binaryTree.cpp | #include<iostream>
using namespace std;
struct Node
{
Node *left;
Node *right;
int data;
};
Node* GetNewNode(int data)
{
Node *newNode = new Node();
newNode->data = data;
newNode->left = newNode->right = 0;
return newNode;
}
Node* Insert(Node* root, int data)
{
if(root == NULL)
{
... | ALGO | 0.999982 | 4.129137 |
27c7d567-6411-4081-9ac3-51613cfd4bf7 | bglick13/nexa_gym | src/versionbits.cpp | #include "versionbits.h"
#include "consensus/params.h"
// bip135 begin fill out entire table
struct ForkDeploymentInfo VersionBitsDeploymentInfo[Consensus::MAX_VERSION_BITS_DEPLOYMENTS] = {
{/*.name =*/(char *)"", // unallocated bit 0
/*.gbt_force =*/true,
/*myVote = */ false},
{/*.name =*/(ch... | CONFIG | 0.951645 | 7.073743 |
53501c8f-5f8c-420b-b8fb-4f17c2d21bb2 | alexsimina/Tabara2K25 | Ziua2/Half1/AIBArhiva/main.cpp | #include <bits/stdc++.h>
using namespace std;
ifstream fin ("aib.in");
ofstream fout("aib.out");
int lsb(int x)
{
return x & (-x);
}
struct AIB
{
vector<long long int> aib;
AIB(int n)
{
aib.resize(n + 9);
}
long long int query(int x)
{
if(x >= aib.size()) return 0;
... | ALGO | 0.99927 | 4.262987 |
569309d4-4b6c-440f-bfe6-0fe18cf8b7dd | ksrawat19/Data-Structure--Algo | Solving Lab/stack/implementation3.cpp | #include <iostream>
using namespace std;
struct Node {
int data;
Node* next;
Node(int val) {
data = val;
next = nullptr;
}
};
class Stack {
private:
Node* top;
public:
Stack() {
top = nullptr;
}
void push(int val) {
Node* newNode = new Node(val);
... | ALGO | 0.994788 | 6.039223 |
a774b4ad-cfea-41e8-81b2-6faff9a4be33 | khushigupta20/Coding-Questions | Reverse an array without using extra space.cpp | /* Write a program to reverse an array without using extra space using C++ */
#include<iostream>
using namespace std;
void printArr(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};
int n = sizeof(arr) / sizeof(int);
int sta... | ALGO | 0.999861 | 5.215574 |
bf7f33dd-3e56-467d-a7b9-65c56f23609c | kim-hwi/Algorithm | 그리디/설탕배달.cpp | #include<iostream>
using namespace std;
int main (void){
int suger,limit,ea=0;
cin>>suger;
limit=suger;
if (suger == 1 || suger == 2 || suger == 4)//쉬운 계산을 위해 초반부에 if문을 생성
{
cout << -1;
return 0;
}
while( suger > 0)//5를 계속해서 빼줌.
{
suger -= 5;
ea++;
}
... | ALGO | 0.999967 | 3.694766 |
da413734-1f1c-4721-990f-eb1d629edb5f | satyajeetkrjha/interviewbit-solutions | Stepping NumbersBookmark Suggest Edit.cpp | vector <int> ans;
void bfs(int s,int n,int m){
queue <int> q;
q.push(s);
while(!q.empty()){
int u=q.front();
q.pop();
if(u>=n && u<=m )
ans.push_back(u);
if(u==0 || u>m)// if stepping number is zero or greater than m
continue;
int lastdigit=u%10;
int neighbor1=(u*... | ALGO | 0.999947 | 4.504987 |
0b7ad1b3-5511-4783-99d3-2442d85fce59 | vasaniyakush/myCodingSpace | My_Space/InsertionSort.cpp | #include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <stack>
#include <algorithm>
using namespace std;
int main()
{
int size = 0;
cin >> size;
int ar[size];
for (int i = 0; i < size; i++)
{
cin >> ar[i];
}
for (int i = 1; i < size - 1; i++)
{
... | ALGO | 0.999996 | 3.753325 |
699fdf22-38be-4888-add5-2ef421ce57f6 | ynonenull/Leetcode | Best_Time_to_Buy_and_Sell_Stock_AC_16ms_find_max_interval.cpp | #include <iostream>
#include <vector>
using namespace std;
//Best Time to Buy and Sell Stock
// https://oj.leetcode.com/problems/best-time-to-buy-and-sell-stock/
//only on transaction, just buy once and sell once,
class Solution
{
public:
int maxProfit( vector<int> &prices )
{
if ( prices.size() <= 1 )
return 0... | ALGO | 0.999027 | 5.800753 |
171fe3d3-3606-4722-a5da-b2a6ada1da81 | Ch1pStar/marlin_custom_config | buildroot/share/PlatformIO/variants/MARLIN_F103Vx/variant.cpp | #include "pins_arduino.h"
#ifdef __cplusplus
extern "C" {
#endif
// Digital PinName array
const PinName digitalPin[] = {
PA_0, //D0
PA_1, //D1
PA_2, //D2
PA_3, //D3
PA_4, //D4
PA_5, //D5
PA_6, //D6
PA_7, //D7
PA_8, //D8
PA_9, //D9
PA_10, //D10
PA_11, //D11
PA_12, //D12
PA_13, //D... | CONFIG | 0.92431 | 3.751779 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.