uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
3b8e8d6d-0f14-4b3f-8f5c-e92344e59b07 | vmmc2/Competitive-Programming | LeetCode/Top Interview Questions/Miscellaneous/HashTable/How Many Numbers Are Smaller Than the Current Number (Solution 1).cpp | class Solution {
public:
vector<int> smallerNumbersThanCurrent(vector<int>& nums) {
vector<int> answer;
map<int,int> freq;
for(int i = 0; i < (int)nums.size(); i++){
freq[nums[i]]++;
}
for(int i = 0; i < (int)nums.size(); i++){
int target = nums[i];
... | ALGO | 0.999996 | 6.278366 |
78ff1227-0575-4c7d-a969-d0daf463a1e6 | danielyc0304/Code | Practice/C++/Sort/Comparison Sort/Heap Sort/heap_sort.cpp | #include <iostream>
using namespace std;
void Print(vector<int> &num) {
for (int i = 0; i < num.size(); i++) {
printf("%d ", num[i]);
}
printf("\n");
}
void MaxHeapify(vector<int> &num, int root, int size) {
int left = 2 * root, right = 2 * root + 1, largest;
if (left <= size && num[left]... | ALGO | 0.999977 | 4.761192 |
0b989b80-10f6-449f-928c-fe3b97d950ef | Tang1705/Happy-Reconstruction | Lib/opencv/sources/modules/photo/src/calibrate.cpp | #include "precomp.hpp"
#include "opencv2/photo.hpp"
#include "opencv2/imgproc.hpp"
#include "hdr_common.hpp"
namespace cv
{
class CalibrateDebevecImpl CV_FINAL : public CalibrateDebevec
{
public:
CalibrateDebevecImpl(int _samples, float _lambda, bool _random) :
name("CalibrateDebevec"),
samples(_s... | ALGO | 0.997071 | 6.254205 |
c13dd3a8-689b-4830-a858-8c0505b7639f | alibaba/nann | blaze-benchmark/thirdparty/boost_1_53_0/libs/graph/example/king_ordering.cpp | #include <boost/config.hpp>
#include <vector>
#include <iostream>
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/king_ordering.hpp>
#include <boost/graph/properties.hpp>
#include <boost/graph/bandwidth.hpp>
/*
Sample Output
original bandwidth: 8
Reverse Cuthill-McKee ordering starting at: 6
... | ALGO | 0.999993 | 5.667625 |
2e9af9d1-5a1a-4ed4-8746-c01579b69436 | tagging-danger/computer-graphics | Edge_Fill_DDA_EvenOdd_Algo.cpp | #include <graphics.h>
#include <stdlib.h>
// Define a linked list node to store pixel coordinates
typedef struct Pixel
{
int x;
int y;
struct Pixel *next;
} Pixel;
// Define a stack to store pixels
typedef struct Stack
{
Pixel *top;
} Stack;
// Push a pixel onto the stack
void push(Stack *stack, int ... | ALGO | 0.999336 | 5.842362 |
d9686397-8607-4b19-8a38-a292974f9148 | pawankumar088/Data_structure | Stack/Paranthesis_checking.cpp | #include <iostream>
#include <stack>
using namespace std;
bool isBalancedExp(string s)
{
stack<char> stk;
char x;
for (int i = 0; i < s.length(); i++)
{
if (s[i] == '(' || s[i] == '[' || s[i] == '{')
{
stk.push(s[i]);
continue;
}
if (stk.e... | ALGO | 0.995073 | 5.097374 |
74d939ab-11e8-4352-9579-f2053f8b7efc | GabLikesCoffee/LeetCode-Problems | ValidParentheses/ValidParenthesesC++.cpp | class Solution {
public:
bool isValid(string s) {
string stack = "";
for(int i = 0; i < s.length(); i++){
if(stack.length() == 0 && (s[i] == '(' || s[i] == '{' || s[i] == '[')){
stack+=(s[i]);
}
else if(stack.length() == 0){
return ... | ALGO | 0.999108 | 6.270036 |
0c0b5cc0-b8f5-4994-8f87-4b7e088511d9 | dtvk027/c-code | sum of series.cpp | #include <stdio.h>
int main()
{
int n, i;
float a=0.0;
printf("Enter number of terms: ");
scanf("%d", &n);
for (i=1; i<=n; i++)
{
a = a+1.0/i;
}
printf("%.2f", a);
}
| ALGO | 0.999387 | 3.181447 |
889f6f61-de9f-495a-80ff-04ebf47b57cf | vipinkarthic/My-Cp-journey | vibs.cpp | #include<bits/stdc++.h>
using namespace std;
#define mod (1000000007)
#define INF INT_MAX
#define FOR(a, c) for (int(a) = 0; (a) < (c); (a)++)
#define FORL(a, b, c) for (int(a) = (b); (a) <= (c); (a)++)
#define FORR(a, b, c) for (int(a) = (b); (a) >= (c); (a)--)
typedef long long int ll;
typedef vector<int> vi;
t... | ALGO | 0.99541 | 4.141019 |
f8abb24c-9749-4d08-82d2-a97b83639bae | bollu/competitive | codeforces/contest-714/A/main.cpp | #include <iostream>
using namespace std;
#define endl '\n'
int main() {
std::ios::sync_with_stdio(false);
cin.tie(NULL);
long long l1, r1, l2, r2, k;
cin>>l1>>r1>>l2>>r2>>k;
long long begin_spend = max(l1, l2);
long long end_spend = min(r1, r2);
long long duration = end_spend - begin_sp... | ALGO | 0.999592 | 3.674602 |
0f396a80-3ed5-4982-b39a-71d9177b3bb0 | Evertume/PP1 | assignment_8/H.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
using namespace std;
int main(){
int n;
cin >> n;
vector<int> v;
for(int i = 0; i < n; i++){
int x;
cin >> x;
v.push_back(x);
}
int x;
cin >> x;
sort(v.begin(), v.end());
for(int i... | ALGO | 0.999902 | 3.712358 |
eacc2b14-4cdd-4d62-8394-09dbb6bc7e69 | zzangss/algorithm-study | baekjoon/10820_문자열분석.cpp | #include<iostream>
#include<string>
using namespace std;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
string str;
int check[4] = {0,0,0,0};
while(true){
getline(cin,str);
if(cin.eof()) break;
for(int i = 0; i<4; i++){
chec... | ALGO | 0.997457 | 3.384539 |
63ff274e-beef-48a8-8c74-4c1ead7dfb0d | hanhandi-git/lqbz_public | hot100/121/test.cpp | #include <vector>
#include <iostream>
#include <functional>
#include <climits>
using namespace std;
class Solution {
public:
int maxProfit(vector<int>& prices) {
if (prices.size() <= 1) return 0;
int max_profit = INT_MIN;
int min_price = INT_MAX;
for (int i = 0; i < prices.size(); ... | ALGO | 0.999565 | 6.584332 |
afdfc69f-48e9-471a-beb3-53d94a3d84b7 | Tazri/Problem-Solving-By-C-and-C-Plus-Plus | codechef/before-2025-1-jan-24/ChefandHappyString .cpp | // link : https://www.codechef.com/problems/HAPPYSTR
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double dl;
#define optimize() \
ios_base::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0)
#define fraction() \
cout.unsetf(i... | ALGO | 0.999896 | 4.979007 |
df7a8f45-b610-45ef-b8f0-98f8cce283bd | suhaninayal/mostly_asked_leetcode | online_stock_SPAM_BRUTE.cpp | #include <bits/stdc++.h>
using namespace std;
class StockSpanner {
private:
vector<int>arr;
public:
StockSpanner() {}
int next(int value) {
arr.push_back(value); // Add the new value to the array
int count = 1;
for (int i = arr.size() - 2; i >= 0; i--) {
if (arr[i] <=... | ALGO | 0.999959 | 6.149046 |
c931fc4a-884c-4c17-9065-de92e47ac5ad | taniaban2712/dsaRepo | CodeForces problems/naturalsum.cpp | #include<bits/stdc++.h>
#define ll long long int
using namespace std;
void solve(){
ll n;
cin>>n;
vector<int>pref(n+2,0);
pref[0]=0;
for(int i=1;i<=n;i++){
pref[i]=pref[i-1]+i;
}
int start=0,low=0;
}
int main(){
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen(... | ALGO | 0.999627 | 3.796899 |
6bb46fa9-fadc-4785-800d-4f83fa226cbc | codecommander03/LeetCode | 0292. Nim Game.cpp | class Solution {
public:
bool canWinNim(int n) {
return n%4;
}
};
| ALGO | 0.999856 | 5.992769 |
568370c8-ab3e-497f-aa73-c7242e342ec0 | SayflyAM/cpp | integerpart1.cpp | #include <iostream>
int main(){
int value1{10};
int value2{-300};
std::cout<<"value1 : "<<value1<<std::endl;
std::cout<<"value2 : "<<value2<<std::endl;
std::cout<<"sizeof value1 : "<<sizeof(value1)<<std::endl;
std::cout<<"sizeof value2 : "<<sizeof(value2)<<std::endl;
return 0;
} | TOOL | 0.873541 | 3.518269 |
7409d083-6fa1-4288-9908-06ac483e0441 | Qipu1220/BaiTapMang1Chieu | 23520493_23521082_23521462_23521604_23521672_BT03/Bai17/Bai017.cpp | #include <iostream>
#include <iomanip>
using namespace std;
void Nhap(int a[], int& n);
void LietKe(int a[], int n);
int main()
{
int a[500];
int k;
Nhap(a, k);
LietKe(a, k);
return 0;
}
void Nhap(int a[], int& n)
{
cout << "Nhap n : ";
cin >> n;
for (int i = 0; i <= n - 1; i++)
{
cout << "Nhap a[" << i <<... | ALGO | 0.99849 | 3.968513 |
2f305c58-8d50-41f9-80b1-6b8e381c93e6 | MahraibFatima/LeeJam-codes | 392-is-subsequence/is-subsequence.cpp | class Solution {
public:
bool isSubsequence(string s, string t) {
int temp=0;
for(int i=0; i<s.length(); ++i){
int count=0;
for(int j=temp; j<t.length(); ++j){
if(s[i] == t[j]){
temp = j+1;
count = 1;
... | ALGO | 0.999928 | 6.216189 |
7eb01607-fe60-402e-a66a-f53be99e3e6f | mooleetzi/ICPC | contest/cf555/A.cpp | #include<bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
inline int read(){
register int f = 1, ans = 0;
char ch = getchar();
while (!isdigit(ch))
{
if (ch=='-')
f = -1;
ch = getchar();
}
while (isdigit(ch))
{
ans = (ans << 1) + (ans << 3) +... | ALGO | 0.999678 | 4.365038 |
f8440a79-f1b2-4297-acc9-1352cbf6ac29 | raincross7/code-similarity | codes/train_code/problem451/problem451_179.cpp | #include<iostream>
#include<queue>
#include<algorithm>
#include<numeric>
#include<string>
#include<map>
#include<bitset>
using namespace std;
using int_greater_PQ = priority_queue<int,vector<int>,greater<int>>;
int main()
{
int N,K;
cin>>N>>K;
vector<int>H;
for(int i=0;i<N;++i)
{
int h;
... | ALGO | 0.999922 | 4.225985 |
e4b142cb-bdff-4b2d-88d1-564f54c6c688 | madhurapardeshi25/-6companies30days | Adobe/Question1.cpp | Q1 - SUBARRAY WITH GIVEN SUM
#include<bits/stdc++.h>
using namespace std;
vector<int> subarraySum(int arr[], int n, long long s)
{
// Your code here
int l=0;
long long sum=0;
for(int i=0;i<n;i++){
sum+=arr[i];
while(sum>=s){
if(sum==s){
return v... | ALGO | 0.99994 | 3.983933 |
05ca736f-6a61-42d0-b09a-ed6a21fd1fd9 | jjiny0716/Algorithm | Codewars/c++/6kyu_Binaries.cpp | #include <string>
#include <cmath>
using namespace std;
namespace coding
{
std::string code(const std::string& strng)
{
string result = "";
for (char c : strng) {
int digit = c - '0';
string binary = "";
while (digit != 0) {
binary.insert(0, t... | ALGO | 0.999865 | 5.447367 |
3ab1aad3-0c7d-4f6b-85ed-5f09d26cd43a | aashimasaxena91/Data-Structures-and-Algorithms | 1214-two-sum-bsts/1214-two-sum-bsts.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.999978 | 6.493379 |
89a40a7c-97b6-49da-9775-3c0309b20864 | thangkh02/DSA_samsung_ptit | graph/CHUYỂN MA TRẬN KỀ SANG DANH SÁCH KỀ.cpp | /* ma tran ke sang canh ke */
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main(){
int n ;
cin>>n;
set<int> adj[1001];
int a[n+1][n+1];
for(int i=1;i<=n;i++)
for(int j=1;j<=n;j++) cin>>a[i][j];
for(int i=1;i<=n;i++)
for(int j=1;j<=n;j++){
... | ALGO | 0.999902 | 3.100022 |
a3ad88d3-d44d-4b72-a0c3-c4a06afd2238 | allenge007/my_cpp_code | codeforces/Codeforces Round 907 (Div. 2)/A.cpp | #include <bits/stdc++.h>
using namespace std;
const int maxn = 25;
int a[maxn];
void solve() {
int n;
scanf("%d", &n);
for(int i = 1; i <= n; i ++) scanf("%d", &a[i]);
for(int i = 0; i <= 4; i ++) {
if((1 << i) > n) break;
for(int j = 1; j < (1 << i); j ++) {
if(a[j + 1] < a... | ALGO | 0.999784 | 3.950116 |
b1f6caaf-8e46-41ea-8693-7ece492a9fb1 | tanguy8001/SLAM | thirdparty/eigen/bench/sparse_transpose.cpp |
// g++ -O3 -g0 -DNDEBUG sparse_transpose.cpp -I.. -I/home/gael/Coding/LinearAlgebra/mtl4/ -DDENSITY=0.005 -DSIZE=10000
// && ./a.out
// -DNOGMM -DNOMTL
// -DCSPARSE -I /home/gael/Coding/LinearAlgebra/CSparse/Include/
// /home/gael/Coding/LinearAlgebra/CSparse/Lib/libcsparse.a
#ifndef SIZE
#define SIZE 10000
#endi... | ALGO | 0.995954 | 5.175951 |
84257345-bd7f-43ce-9032-398d1a3a6650 | sanyagargg/LeetcodeSolutions | BinarySearch/Search-Insert-Position.cpp | class Solution {
public:
int searchInsert(vector<int>& nums, int target) {
int left = 0, right = nums.size() - 1;
while (left <= right) {
int mid = left + (right - left) / 2; // Prevent overflow
if (nums[mid] == target)
return mid;
else if (nums[m... | ALGO | 0.999976 | 6.765323 |
cb12e672-3008-4ace-a8d2-2f66ef6d7850 | bijoybiswas21/GFG-160-Day-s | GeeksforGeeks-POTD-main/GeeksforGeeks-POTD-main/August 2024 GFG SOLUTION/August-26.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
int wildCard(string pattern, string str) {
int m = str.length();
int n = pattern.length();
vector<int> dp(n + 1, 0);
dp[0] = 1;
for (int j = 1; j <= n; j++) {... | ALGO | 0.999926 | 5.827848 |
84f35253-0e5a-46c6-88aa-491e15cc933d | sinian666/code_102_8 | cpp_副本29/chapter_backtracking/n_queens.cpp | /**
* File: n_queens.cpp
* Created Time: 2023-05-04
* Author: Krahets (<EMAIL>)
*/
#include "../utils/common.hpp"
/* 回溯算法:N 皇后 */
void backtrack(int row, int n, vector<vector<string>> &state, vector<vector<vector<string>>> &res, vector<bool> &cols,
vector<bool> &diags1, vector<bool> &diags2) {
... | ALGO | 0.999455 | 5.895102 |
e8dcb821-1577-4c32-be0f-1c06ec10d44e | TanXiang7o/cmu15445 | src/optimizer/merge_projection.cpp | #include <algorithm>
#include <memory>
#include "catalog/column.h"
#include "catalog/schema.h"
#include "execution/expressions/column_value_expression.h"
#include "execution/plans/abstract_plan.h"
#include "execution/plans/projection_plan.h"
#include "optimizer/optimizer.h"
namespace bustub {
auto Optimizer::Optimize... | ALGO | 0.965666 | 7.269292 |
4a290a0f-5e45-4ce6-bb23-e44bc1da7c0e | amilali/codespaces-blank | MyCodes/string/capatlize_first_last.cpp | // Function to Capalize first and last letter of word from a given string
#include <bits/stdc++.h>
using namespace std;
string removeSpaces(string str)
{
for(int i=0; i<str.length(); i++)
{
if(str[i]==' ')
{
str[i+1] = (str[i+1])-32;
str[i-1] = (str[i-1])-32;
}
else if(... | ALGO | 0.990631 | 4.064395 |
def20883-0b95-42d9-95bd-c3e31fca7c75 | soldier-sky/DS_and_ALGO | DS/linkedList/doublyLinkedList_class.cpp | /***********************************************************
* LinkedList
* Author: Sunil Kumar Yadav
* Date: 15 Oct 2021
* Description: Implementing (doubly) linked list class
*
* Note: Incomplete
************************************************************/
#include<iostream>
using namespace std;
//---------------... | ALGO | 0.98515 | 5.522172 |
980157c5-f0c5-4761-9926-ad07ea2bd763 | ishandutta2007/codeforces | lucina/normal/1627/E.cpp | #include<bits/stdc++.h>
using namespace std;
using ll = int64_t;
const ll INF = 1e17;
const int nax = 1e6 + 10;
int n, m, k;
ll x[nax];
array <int, 5> a[nax];
void solve() {
cin >> n >> m >> k;
for (int i = 1 ; i <= n ; ++ i)
cin >> x[i];
vector < vector <int>> g(n + 10);
vector < vector <ll>>... | ALGO | 0.999943 | 4.884711 |
07356c57-84f4-4753-bcaf-ae12dea1f2e5 | sherali143/DATA-STRUCTURE | ASSIGNMENTS/P21-8024_ASSIGNMENT 2_ QUESTION 1.cpp | #include<iostream>
#include<stack>
#include<math.h>
using namespace std;
int postfix_evaluation(string s)
{
stack<char> st;
for(int i=0;i<s.length();i++)
{
if(s[i]>='0' && s[i]<='9')
{
st.push(s[i]-'0'); // TO CONVERT A CHARACTER IN TO INTEGER I MINUS THE INTEGER WITH THE ASCII VALUE OF 0 ;
}
... | ALGO | 0.999771 | 4.073945 |
7d5f0dcc-8ce9-4903-b409-23cbd861e42c | lingxDEV/LegacyMoP_private | src/server/game/Movement/Spline/Spline.cpp | #include "Spline.h"
#include <sstream>
#include <G3D/Matrix4.h>
namespace Movement{
SplineBase::EvaluationMethtod SplineBase::evaluators[SplineBase::ModesEnd] =
{
&SplineBase::EvaluateLinear,
&SplineBase::EvaluateCatmullRom,
&SplineBase::EvaluateBezier3,
(EvaluationMethtod)&SplineBase::UninitializedSp... | ALGO | 0.956195 | 6.38396 |
c6291954-df47-42d7-9e99-e58a3f471e41 | theoden42/code-store | atcoder/HUAWEI Programming Contest 2024(AtCoder Beginner Contest 342)/B.cpp |
/* author: (g)theoden42 */
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define all(a) a.begin(), a.end()
#ifdef ON_PC
#include <debug.h>
#else
#define debug(x...)
#endif
template<typename T>
using o... | ALGO | 0.999993 | 4.375413 |
bf377656-de35-43e2-8a6a-37a6a85b1b9c | kushaltiwari18/C-PW | Questions/Vector/Chpt-12/Array/maxvimum_value.cpp | #include<iostream>
using namespace std;
int main(){
int array[]={3,7,18,9,111};
int max = array[0];
for(int i=1; i<5; i++){
if(array[i]>max){
max=array[i];
}
}
cout<<max<<endl;
return 0;
} | ALGO | 0.99643 | 3.484928 |
fcdd2cb1-76d1-4e82-b008-a76c510e13da | sailor-ux/mycodes | leetcode_vscode/reverseList/reverseList.cpp | #include <iostream>
#include <vector>
using namespace std;
struct ListNode {
int val;
ListNode* next;
ListNode() : val(0), next(nullptr) {}
ListNode(int x) : val(x), next(nullptr) {}
ListNode(int x, ListNode* next) : val(x), next(next) {}
};
class Solution {
public:
bool isPalindrome(ListNode* h... | ALGO | 0.999973 | 5.819132 |
25928538-c9d7-4d4e-93c5-ab817ede37fa | JackosDev/desmume-x432r | desmume/src/windows/agg/src/agg_vpgen_clip_polygon.cpp | #include "agg_vpgen_clip_polygon.h"
#include "agg_clip_liang_barsky.h"
namespace agg
{
//------------------------------------------------------------------------
// Determine the clipping code of the vertex according to the
// Cyrus-Beck line clipping algorithm
//
// | |
// 011... | ALGO | 0.998179 | 6.605059 |
6cb6842e-2d4b-4f02-bfed-2758490de2ac | sakshamgoel-github/LeetCode-Solutions | 234PalindromeLinkedList.cpp | #include <bits/stdc++.h>
using namespace std;
#define turbo \
ios_base::sync_with_stdio(false); \
cin.tie(NULL);
struct ListNode
{
int val;
ListNode *next;
ListNode() : val(0), next(nullptr) {}
ListNode(int x) : val(x), next(nullptr) {}
ListNode(int x, ListNode *next... | ALGO | 0.99976 | 5.676413 |
e2cc7f74-5e5a-4b37-ab2e-8db5d115c364 | annahauk/CS385 | unique.cpp | /*******************************************************************************
* Name : unique.cpp
* Author : Anna Hauk
* Date : 10/2/2023
* Description : Determining uniqueness of chars with int as bit vector.
* Pledge : I pledge my honor that I have abided by the Stevens Honor System
*... | ALGO | 0.973281 | 6.343414 |
b6966033-c109-49ab-a372-259779e17020 | Sunny-Saurya/Cpp_Programming | Stack/Questions/08_celebrityProblem.cpp | #include <iostream>
#include <stack>
#include<vector>
using namespace std;
class Solution
{
private:
bool knows(vector<vector<int>> &arr, int a, int b)
{
return arr[a][b] == 1;
}
public:
int isCelebrity(vector<vector<int>> &arr, int n)
{
stack<int> s;
for (int i = 0; i < ... | ALGO | 0.99978 | 6.397749 |
b69085c2-4432-4fc9-b4b4-6a4ba2e327a1 | ravaliB/MLEA | src/parser.cpp | #include <vector>
#include <fstream>
#include <string>
#include <fstream>
#include <iostream>
#include "parser.h"
using namespace std;
Parser::Parser()
{
}
Parser::~Parser()
{
}
vector<string> Parser::getFiles_1()
{
return files_1;
}
vector<string> Parser::getFiles_2()
{
return files_2;
}
void Parser::parse(str... | TOOL | 0.853203 | 3.982144 |
908bb341-5bb9-473a-a7d4-da2ebf28f618 | ishandutta2007/codeforces | sonechko/normal/854/B.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ss second
#define ff first
#define endl "\n"
#define ld long double
#define ull unsigned long long
#define mp make_pair
#define pb push_back
const int N = 1e5 + 11;
const ll MOD = 1e9 + 7;
#define mod %MOD
int main()
{
ios_base::sync_with_... | ALGO | 0.999986 | 3.361047 |
d82a84e5-62b4-4991-abf4-ca19a3153663 | AndanteKim/AP_Archive | C++_Project/guess_num.cpp | #include <iostream>
#include<sstream>
#include<time.h> //added for the random number generator seed
#include<cstdlib> //added to use the rand function
using namespace std;
int main()
{
//declare all the values
int target, int_test;
int guess = -1;
string decision;
string userString;
srand(time(... | ALGO | 0.944407 | 3.420673 |
c029f483-1125-4714-a6b4-8b70569d0c34 | jsong233/dissertation_supp | code/motion/differential_nl_cmb/cellclass_def.cpp | #include "cellclass.h"
#include <cmath>
#include <cfloat>
#include <fstream>
#include <random>
/************************************************************************************
Cadherin
************************************************************************************/
void Cadh... | ALGO | 0.999262 | 3.790627 |
63df7151-16af-45f3-ab8a-41de004ebe1f | 18ivan18/DataStructuresAndProgramming2024 | week03 - queue/solutions/7.cpp | #include <iostream>
#include <queue>
#include <vector>
#include <climits>
#include <cstring>
// A Queue Node
struct Node
{
// (x, y) represents matrix cell coordinates, and
// `dist` represents their minimum distance from the source
int x, y, dist;
};
// Below arrays detail all four possible movements fro... | ALGO | 0.999982 | 5.804751 |
0eb12661-acd5-45e0-8b6a-c1a1c6b261fb | Battery-Intelligence-Lab/dtw-cpp | dtwc/Problem_IO.cpp | /**
* @file Problem_IO.cpp
* @brief Implementation of input/output functions for the Problem class.
*
* @details These functions handle the writing of medoids, clusters, silhouettes, and
* distance matrices to files, as well as reading distance matrices from files.
*
* @date 25 Dec 2023
* @author Volkan Kumtepe... | ALGO | 0.930989 | 7.596882 |
126e6335-ff92-4646-9e4d-68744ccba485 | obono/ATtiny85FallingSand | sands.cpp | #include "common.h"
/* Defines */
#define COUNTER_FREEZE 30
/* Local Functions */
static void arrangeWalls(uint8_t wallType);
static void scatterSands(uint8_t amountType, uint8_t wallType);
static void moveSands(int16_t vx, int16_t vy);
static void moveSand(int8_t x, int8_t y, int16_t vx, int16_t vy);
static i... | TOOL | 0.969351 | 5.328931 |
59f5aee6-47a6-414e-81e4-26d2e20729a0 | chenshanzhi/OJ | POJ/3614.cpp | // =====================================================================================================================
// http://poj.org/problem?id=3614
// =====================================================================================================================
#include <algorithm>
#include <iostream>
#in... | ALGO | 0.999951 | 3.806863 |
e6b68ab1-e14c-474b-9629-257f43b03df2 | JN513/codigosc- | contest2.cpp/kkk.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
int dist[1010],t;
vector<pair<int,int>> adj [1010];
void dijkstra(){
priority_queue<pair<int,int> , vector<pair<int,int>> , greater<pair<int,int>>>fila;
fila.push({0,t});
dist[t]= 0;
while(!fila.empty()){
int node = fila.... | ALGO | 0.999889 | 4.770243 |
7836923d-cd1a-49f3-a88c-02c02cd8b4ad | faithscript/Algorithm-Patterns-in-Cpp | two-pointers/shortest-unsorted-continuous-subarray.cpp | // Given an integer array nums, you need to find one continuous subarray such that if you only sort this subarray in non-decreasing order, then the whole array will be sorted in non-decreasing order.
// Return the shortest such subarray and output its length.
// Example 1:
// Input: nums = [2,6,4,8,10,9,15]
// Outpu... | ALGO | 0.999997 | 5.940628 |
27b6229f-47d6-4576-97cc-d57aa444b7e0 | PaukIsUha/optimizing_formating_code | predictions/submissions-aizu-gpt4/Codenet/p01802/509820068/response_6.cpp | #include <iostream>
#include <cmath>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int d, e;
while (cin >> d >> e && (d || e)) {
double min_gap = 1e9;
for (int i = 0; i <= d; ++i) {
int j = d - i;
double cost = sqrt(i * i +... | ALGO | 0.999904 | 4.440985 |
f8b58782-7cdc-460b-88b7-45623a0815d6 | BrookyBurak/Homeworks | Telefon Rehberi.cpp | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
//kayt iin gerekli bir fonksiyon bellek pointer belli bir text dosyasna atlabilir oradan ekilebilir.
void kayitlar()
{
char ad[50], soyad[50], telefon[20];
FILE *dosya;
// Dosyay ama veya oluturma ilemi
dosya = fopen("rehber.txt", "a+"); // "a+... | TOOL | 0.900528 | 3.382256 |
7789b6c1-bcd9-4d7d-b673-8d819bb03dc2 | llvm/clangir | libcxx/src/filesystem/directory_iterator.cpp | #include <__assert>
#include <__config>
#include <__memory/shared_ptr.h>
#include <errno.h>
#include <filesystem>
#include <stack>
#include <utility>
#include "error.h"
#include "file_descriptor.h"
#if defined(_LIBCPP_WIN32API)
# define WIN32_LEAN_AND_MEAN
# define NOMINMAX
# include <windows.h>
#else
# include <... | TOOL | 0.890989 | 7.779719 |
0a2bc588-b1f0-4764-867b-52834146b4ba | PeppyDays/Algorithm-Solving | BOJ/P11723.cpp | #include <cstdio>
using namespace std;
char buf;
int nextInt() {
int ret = 0;
while (buf < '0' || buf > '9') buf = getchar();
while (buf >= '0' && buf <= '9') {ret = 10 * ret + buf - '0'; buf = getchar();}
return ret;
}
int nextOp() {
int ret; char op[2];
while (buf < 'a' || buf > 'z') buf = ... | ALGO | 0.997906 | 4.826535 |
4af47f97-1eff-49da-aa62-f9735d076690 | leggedrobotics/rsl_panoptic_mapping | dynamic_mapping/thirdparty/eigen/failtest/colpivqr_int.cpp | #include "../Eigen/QR"
#ifdef EIGEN_SHOULD_FAIL_TO_BUILD
#define SCALAR int
#else
#define SCALAR float
#endif
using namespace Eigen;
int main()
{
ColPivHouseholderQR<Matrix<SCALAR,Dynamic,Dynamic> > qr(Matrix<SCALAR,Dynamic,Dynamic>::Random(10,10));
}
| TEST | 0.954323 | 3.159166 |
7bc0e37c-1017-405d-a6da-c1d64dd9596e | i-ramoss/Introducao-a-Logica-de-Programacao---MATA37 | Lista 5/faxina.cpp | #include <iostream>
#include <string>
using namespace std;
int main () {
int nlivro, nconso, cont;
string book;
cin >> nlivro >> nconso;
cin.ignore();
for (int i=0; i<nlivro; i++){
cont=0;
getline(cin,book);
for (int j=0; j<book.size(); j++){
if (book[j] != 'a' && book[j] != 'e' && book... | ALGO | 0.999326 | 3.383077 |
a6c9a394-e639-43d4-b56a-d631424b1f17 | P41NT/Competitive-Programming | Codeforces/2037B_InterceptedInputs/B. Intercepted Inputs.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#ifndef ONLINE_JUDGE
#include "/home/shobwq/CompetitiveProgramming/debug.cpp"
#define debug(...) std::cerr << __LINE__ << ": [", __DEBUG_UTIL__::printer(#__VA_ARGS__,... | ALGO | 0.999938 | 4.128011 |
4342012e-2f0a-4f6e-bfa4-7fa48aa3b574 | eloqdata/eloqdoc | src/third_party/mozjs-45/extract/js/src/jit/BacktrackingAllocator.cpp | #include "jit/BacktrackingAllocator.h"
#include "jsprf.h"
#include "jit/BitSet.h"
using namespace js;
using namespace js::jit;
using mozilla::DebugOnly;
/////////////////////////////////////////////////////////////////////
// Utility
/////////////////////////////////////////////////////////////////////
static inl... | TOOL | 0.989823 | 7.556415 |
81e09e91-ae99-4dec-b772-d461b8e475d0 | ishandutta2007/codeforces | hogloid/normal/383/C.cpp | #include<bits/stdc++.h>
#define REP(i,m) for(int i=0;i<(m);++i)
#define REPN(i,m,in) for(int i=(in);i<(m);++i)
#define ALL(t) (t).begin(),(t).end()
#define CLR(a) memset((a),0,sizeof(a))
#define pb push_back
#define mp make_pair
#define fr first
#define sc second
using namespace std;
#ifndef ONLINE_JUDGE
#define dump... | ALGO | 0.999931 | 4.026343 |
051ef30b-8f54-4774-9611-3078c4043255 | MADMechaniculus/ConsoleFPS | ConFPS/ConFPS.cpp | // ConFPS.cpp : Этот файл содержит функцию "main". Здесь начинается и заканчивается выполнение программы.
//
#define SCREEN_WIDTH 120
#define SCREEN_HEIGHT 40
#include <Windows.h>
#include <iostream>
#include <chrono>
#include <vector>
#include <algorithm>
using namespace std;
float fPlayerX = 8.0f;
float fPlayerY = ... | TOOL | 0.930989 | 3.937845 |
cb8d5c99-6b24-4406-ae32-7ee9a8d59bb9 | G0T-cha/G0T-cha.github.io | thirdparty/win/miracl/miracl_osmt/source/curve/pairing/bn.cpp | //
// cl /O2 /GX bn.cpp zzn2.cpp zzn.cpp ecn2.cpp ecn.cpp big.cpp miracl.lib
// Program to generate BN curves for use by ake12*.cpp
//
#include <iostream>
#include "big.h"
#include "ecn.h"
#include "ecn2.h"
//#include "zzn12.h"
using namespace std;
Miracl precision=100;
int main()
{
int i,ns;
int sign;
... | ALGO | 0.997947 | 4.069626 |
bd615702-563d-437b-87ba-dcb77f5d00fe | raincross7/code-similarity | codes/train_code/problem147/problem147_186.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<int, int> Pi;
typedef vector<ll> Vec;
typedef vector<int> Vi;
typedef vector<string> Vs;
typedef vector<vector<ll>> VV;
typedef vector<vector<int>> VVi;
#define REP(i, a, b) for(ll i=(a); i<(b); i++)
#define PER(... | ALGO | 0.999882 | 4.022644 |
ef22b7af-4455-495f-a21b-34cfa9397476 | YoungCoderboy/CP_question | beautyfullarray.cpp | #include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#incl... | ALGO | 0.999793 | 3.153141 |
862304b1-00e8-4968-bd5b-ac09d355a514 | anshyyy/CPP | Codeforces/1669C.cpp | #include <bits/stdc++.h>
#define IOS ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define loop(i,a,n) for(int i=a;i<n;i++)
#define all(v) (v).begin(),(v).end()
#define all1(v) (v).begin()+1,(v).end()
#define allr(v) (v).rbegin(),(v).rend()
#define allr1(v) (v).rbegin()+1,(v).rend()
#define ff first
... | ALGO | 0.999839 | 4.192806 |
bb990aa4-d5b9-42a2-b0e2-701c960e2cb1 | hwang131/BOJ | 01000-09999/08000-08999/8012.cpp | // 8012 한동이는 영업사원!
// https://www.acmicpc.net/problem/8012
#include <iostream>
#include <vector>
#include <cstring>
using namespace std;
int N, M;
vector<int> Village[30001];
int visit_order[5001], depth[30001];
int parent[30001][16];
void MakeTree(int v){
int next;
for (int i = 0; i < Village[v].size(); i++){
ne... | ALGO | 0.99993 | 4.720958 |
5a166bb0-8f41-4ed7-9db9-aca9ed1f7e5f | lsuinl/Baekjoon | C++/gdsc/2week/1934.cpp | #include <iostream>
using namespace std;
int main(){
int T,A,B;
cin>>T;
for(int i=0;i<T;i++){
cin>>A>>B;
int max=A>B?A:B;
int min=A>B?B:A;
int plus=max;
while(max%min!=0){
max+=plus;
}
cout<<max<<endl;
}
return 0;
} | ALGO | 0.999957 | 3.962424 |
0bc24830-ee61-47bc-8df0-5bb45b2d86be | 98andwin/Kattis_solutions | Problems/Soylent/soylent.cpp | #include <iostream>
#include <math.h>
using namespace std;
int main(){
int amount;
cin >> amount;
for (int i=0; i<amount; i++){
double value;
cin >> value;
cout << ceil(value/400) << '\n';
}
} | ALGO | 0.994294 | 3.632059 |
5a95c5c2-59e6-4c01-9907-2469d4ea60a8 | amipatel-gitthub/Cpp | polymorphism/friend_function.cpp | #include<iostream>
using namespace std;
class box
{
int l,w,h;
public :
void setdata(int len, int wid, int hei)
{
l = len;
w = wid;
h = hei;
}
int getdata()
{
return l * w * h;
}
friend box operator+(box ... | TOOL | 0.975622 | 4.199654 |
3537880f-9e8f-4448-b301-24e280197bc7 | Imagaverse/CitraEmu | externals/teakra/src/makedsp1/main.cpp | #include <cstdio>
#include <fstream>
#include <iostream>
#include <string>
#include "../common_types.h"
#include "../parser.h"
#include "sha256.h"
template <typename T>
std::vector<u8> Sha256(const std::vector<T>& data) {
SHA256_CTX ctx;
sha256_init(&ctx);
sha256_update(&ctx, (const BYTE*)data.data(), data... | TOOL | 0.90405 | 5.420929 |
32dbf1df-791c-43c6-a1cf-6a2347fc14cc | ksnmartin/1337 | codeforces/a/a1460.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
int t;
cin>>t;
while(t--){
int n,tmp,a=0,b=0,i=0,j=0;
cin>>n;
int arr[101]={};
for (int i = 0; i < n; ++i)
{
cin>>tmp;
arr[tmp]++;
}
while... | ALGO | 0.999871 | 3.947145 |
acd332a6-3ecb-496a-b596-4b273004d144 | pnjha/OS_Snapshot | initialcopy.cpp | #include<stdio.h>
#include<iostream>
#include<stdlib.h>
#include <fcntl.h> // for open()
#include<pwd.h>
#include <vector>
#include <time.h>
#include <fstream>
#include<string.h>
#include<unistd.h> //for getcwd()
#include<dirent.h> // opendir()
#include <sys/stat.h> // for stat
using namespace std;
class CopyFunction... | TOOL | 0.928762 | 3.912116 |
20c17fdf-8d33-4009-b413-d00c8c98ac49 | komal9580/ECE5504 | gem5/src/systemc/tests/systemc/misc/unit/data/datawidth_bool_to_signed/extension/datawidth.cpp | /*****************************************************************************
datawidth.cpp --
Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
*****************************************************************************/
/**************************************************************************... | ALGO | 0.940793 | 5.61622 |
68f7634b-61a6-4597-8cb6-fc8296a93369 | StackDoubleFlow/LLVMStackPU | libcxx/test/std/containers/sequences/vector/vector.cons/move.pass.cpp | // UNSUPPORTED: c++03
// <vector>
// vector(vector&& c);
#include <vector>
#include <cassert>
#include "test_macros.h"
#include "MoveOnly.h"
#include "test_allocator.h"
#include "min_allocator.h"
#include "asan_testing.h"
int main(int, char**)
{
{
std::vector<MoveOnly, test_allocator<MoveOnly> > l(test... | TEST | 0.894315 | 5.502059 |
64847dc1-7434-441e-9c28-b4801b761274 | conan1005/DSA-Questions | Leetcode/8-heaps-priority-queue/medium/1642-furthest-building-you-can-reach.cpp | /*******************************************************************
Ladder can reach upto any height
Minheap of size "ladders"
When minheap size == ladders + 1,
pop out minHeight from it and
subtract this height from bricks
Time O(NlogK)
Space O(K)
************************************************************... | ALGO | 0.999953 | 5.916454 |
ecc44a53-6318-4947-84b6-f091548fb87b | tnqkr98/Algorithm-Study | BeakjoonOnlineJudge/baek04880(다음수).cpp | #include <iostream>
using namespace std;
int main() {
while (1) {
int a, b, c;
cin >> a >> b >> c;
if (a == 0 && b == a) break;
if (b - a == c - b)
cout << "AP " << c+b - a<<endl;
else cout << "GP " << c * (b / a) << endl;
}
return 0;
} | ALGO | 0.998185 | 3.381021 |
68a3b240-ccf4-4a46-8483-5339ed3f46a4 | MiletoCarmelo/frm | assignements/hackerRank/20.disscussion_instantanée_with_class.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <random>
#include <iomanip>
#include <sstream>
#include <utility>
#include <set>
#include <cstdlib>
using namespace std;
class Message {
private:
string msg;
int pos;
public:
Message() {}
Message(string val, int p) ... | ALGO | 0.995841 | 5.186816 |
fbe9e5e0-5339-43dc-b103-ee4dc77e9fcd | kchu-z/arena | 2023.04.09/uhfewiuhfiuwfbuwiufiwe.cpp | #include <bits/stdc++.h>
using namespace std;
long long a[1000000], sol[1000000];
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
long long n, last = -1;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> a[i];
}
for (long long i = 0; i < n; i++) {
... | ALGO | 0.99997 | 3.672396 |
292827e6-da9f-47b3-abed-88d33001390b | ishandutta2007/codeforces | heart_blue/normal/287/A.cpp | #include <cstdlib>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <iostream>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <fstream>
#include <numeric>
#include <iomanip>
#include <bi... | ALGO | 0.99976 | 3.838358 |
81750dee-98b2-4438-9beb-6448cfb3b329 | cxx-hep/root-cern | interpreter/llvm/src/lib/Transforms/Scalar/LoopRotation.cpp | #define DEBUG_TYPE "loop-rotate"
#include "llvm/Transforms/Scalar.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/CodeMetrics.h"
#include "llvm/Analysis/InstructionSimplify.h"
#include "llvm/Analysis/LoopPass.h"
#include "llvm/Analysis/ScalarEvolution.h"
#include "llvm/Analysis/TargetTransformInfo.h"
#includ... | ALGO | 0.981685 | 5.985056 |
5710a656-f71d-4cf2-b973-7d228e4760ab | RulerOfCakes/BOJ | DP/22358.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pi = pair<int, int>;
int N, M, K, S, T;
const ll INF = 1e15;
vector<vector<pi>> v;
vector<vector<int>> lift;
ll dp[100002][11];
ll sol(int x, int k)
{
if (k < 0)
return -INF;
ll &ret = dp[x][k];
if (ret != -1)
return... | ALGO | 0.999939 | 4.321641 |
add8791c-cf02-4551-9a1e-398f1faa0527 | bjornarhem/competitive | codeforces/1549/D/D.cpp | #include <iostream>
#include <vector>
#include <cmath>
using namespace std;
long long gcd(long long a, long long b) {
// Euclid's algorithm
if (b == 0) {
return a;
}
return gcd(b, a % b);
}
vector<vector<long long>> gcd_sparse_table (vector<long long>& d) {
int N = d.size();
int K = c... | ALGO | 0.999831 | 4.254901 |
75dd3516-5dbb-42bf-8914-056b9b96f5d0 | Greentwip/cocos2d-x | tools/simulator/libsimulator/lib/runtime/ConfigParser.cpp | #include "ConfigParser.h"
#include "json/filereadstream.h"
#include "json/stringbuffer.h"
#include "json/writer.h"
#include "FileServer.h"
// ConfigParser
ConfigParser *ConfigParser::s_sharedConfigParserInstance = NULL;
ConfigParser *ConfigParser::getInstance(void)
{
if (!s_sharedConfigParserInstance)
{
... | TOOL | 0.928824 | 5.376458 |
47f85aa3-89ab-407a-b265-8d54fcf155c2 | CIFASIS/object-detection-sptam | ros/sptam/src/ros/utils/opencv_parsers.cpp | #include "opencv_parsers.hpp"
#ifdef SHOW_PROFILING
#include "../../sptam/utils/log/Logger.hpp"
#endif
// since the algorithm->set method is not present in opencv3,
// we have two different implementations, depending on the opencv version.
#include <opencv2/core/version.hpp>
#if CV_MAJOR_VERSION == 2
#include <op... | TOOL | 0.851053 | 6.793567 |
03a1a522-acbf-4829-8e82-5569bbc11969 | Fresh-hongsi/BaekjoonCpp | 16430-제리와 톰.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int main(void)
{
int a = 0;
int b = 0;
cin >> a >> b;
int c = b - a;
for (int i = 1; i <= c; i++)
{
if (i % c == 0 && i % b == 0)
{
c = c / i;
b = b / i;
}
}
cout << c <<' '<< b;
return 0;
}
| ALGO | 0.999855 | 4.070234 |
9978ec6a-f2d3-4de9-b4eb-d384a0144b76 | ademchelli22/pathole-detection-and-smart-navigation | App/App1/infrability/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.998446 | 6.76073 |
975a8863-03dc-4eb0-a3a7-b998ec9527c0 | joaopaulocastilho/aBNT-Codes | URI/uri1221-CASTILHO.cpp | #include <stdio.h>
#include <math.h>
int eh_primo(int n){
int raiz, i;
if(n==2) return 1;
if(n%2==0 || n<2) return 0;
raiz = sqrt(n);
for(i=3; i<=raiz; i+=2){
if(n%i == 0) return 0;
}
return 1;
}
int main(void){
int num, n;
scanf("%d", &n);
while(n--){
scanf("%d", &num);
eh_primo(num) ... | ALGO | 0.998825 | 4.074204 |
87a1be31-f530-41a3-82dc-491ae6db61e4 | zhang60626/leetcode | 189.rotate-array/189.rotate-array.cpp | /*
* @lc app=leetcode id=189 lang=cpp
*
* [189] Rotate Array
*/
// @lc code=start
class Solution {
public:
// time complexity: o(n)
// space complexity: o(k % n)
void rotate(vector<int>& nums, int k) {
if (k > nums.size()) k %= nums.size();
if (k == 0) return;
vector<int> temp(n... | ALGO | 0.999919 | 6.846831 |
1a42216d-fca0-41db-ad8e-806e33cef787 | DevashishPathrabe/LeetCode | LeetCode Solutions/Binary Search Tree/Insert into a Binary Search Tree/Insert into a Binary Search 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.999804 | 6.273292 |
0f900ebb-dba9-4d48-beb6-06e0377513a1 | deepesh16b/expense-tracker-reactjs | src/components/NewExpense/temp.cpp | #include <iostream>
#include <algorithm>
using namespace std;
const int N = 1e5+5;
int L[N], R[N], cnt[N], diff[N];
struct Node {
int val, size;
Node *left, *right;
Node(int v) {
val = v;
size = 1;
left = nullptr;
right = nullptr;
}
};
int getSize(Node *node) {
r... | ALGO | 0.999648 | 4.153978 |
164af695-1927-45f6-9fce-d9f62da24fc7 | Reda-ELOUAHABI/Cplusplus-cpp-multidimentional_array | multiDimentionalArrays/Exo2f.cpp | //include section
#include <iostream>
#include <cstdlib>
//using section
using std::cin;
using std::cout;
using std::endl;
//main section
int main()
{
// 10 rows 15 colums
int rows = 10, columns = 15;
int matrix[rows][columns] = {
{0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0},
... | ALGO | 0.998939 | 3.510157 |
e7f2a87e-a9a4-4013-b584-58e45c66b0c4 | Sl-Alex/CppLearn | L01/main.cpp | #include <iostream>
using namespace std;
void task1(void);
void task2(void);
int main()
{
const int max_task = 1;
int task;
cout << "Enter task number (0..1)" << endl;
cin >> task;
if ((task > max_task) || (task < 0))
{
cout << "Wrong number" << endl;
return -1;
}
... | ALGO | 0.959348 | 3.71954 |
a8fca304-6d74-497d-8c28-9d7b12231a08 | niranjan35/coding-practise | 823-binary-trees-with-factors/823-binary-trees-with-factors.cpp | class Solution {
public:
int dp[1020];
int mod=1000000007;
int numFactoredBinaryTrees(vector<int>& arr) {
memset(dp,0,sizeof(dp));
sort(arr.begin(),arr.end());
map<int,int> mp;
int n=arr.size();
for(int i=0;i<n;i++) {
mp[arr[i]]=i+1;
}
for(... | ALGO | 0.999965 | 5.642454 |
513aa18e-8bb7-4cd1-853e-94c769050d5d | SemyonSemenov/Basics-of-Cpp-Development-Red-Belt | Week 1/Deque.cpp | #include <cstddef>
#include <stdexcept>
#include <utility>
#include <vector>
using namespace std;
template <typename T>
class Deque {
private:
vector<T> head, tail;
T& AtImpl(size_t i) {
return i < head.size() ? head[head.size() - i - 1] : tail[i - head.size()];
}
const T& AtImpl(size_t i) c... | ALGO | 0.985849 | 5.968547 |
a5ac67ea-06eb-43ff-b48e-ae64daca9c62 | DawnteaStudio/TIL | coding-test/Baekjoon/14000/14038.cpp | #include <iostream>
#define fast ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL)
using namespace std;
int main() {
fast;
int cnt = 0;
char n;
for (int i = 0; i < 6; i++) {
cin >> n;
if (n == 'W')
cnt++;
}
if (cnt >= 5)
cout << 1;
else if (cnt ... | ALGO | 0.999693 | 3.79471 |
b6c10d3e-cb61-49c5-9d39-35e3f8bb8bbf | root00198/CodeChef | EASY/DECSTR.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin>>t;
while(t--)
{
int n;
cin>>n;
string s1 = "zyxwvutsrqponmlkjihgfedcba";
int x= n/25,y=n%25;
if(y!=0)
{
for(int i=25-y;i<=25;i++)
c... | ALGO | 0.999755 | 4.173058 |
5d968ba0-21ac-4bf5-9365-81a8cea39875 | prprprpony/oj | zj/c548/c548-dp-bitset-nn.cpp | #include<bits/stdc++.h>
using namespace std;
const int N = 1e5;
bitset<N*2> dp[2];
int a[N],fi[N];
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
int n,k;
cin >> n >> k;
for (int i = 0; i < n; ++i) {
cin >> a[i];
a[i] %= k;
}
for (int i = 0, b = 0; i < n && !fi[0]; ++i, b ... | ALGO | 0.999995 | 3.393263 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.