uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
abc6abde-5c7e-455f-9642-e8ddeb728e9b | Cypher1002/dsa | heap/mergeTwoBInaryTree.cpp | #include<bits/stdc++.h>
usinh namespace std;
void heapify(int arr[], int l , int n ){
int largest = i;
int left = 2*i;
int right = 2*i+1;
if(left<n && arr[largest]<arr[left]){
largest = left;
}
if(right<n&&arr[largest]<arr[right]){
largest= right;
}
if(i!= largest){
... | ALGO | 0.999953 | 3.640026 |
68257562-df86-4e28-9f10-8e073aaa5b9d | heavenMOJANG/ICPC | .history/Codeforces/CF2/B_20240819094432.cpp | #pragma GCC optimize(1)
#pragma GCC optimize(2)
#pragma GCC optimize(3,"Ofast","inline")
#include<bits/stdc++.h>
#define int long long
using namespace std;
constexpr int INF = 0x7fffffff;
void solve() {
int n; cin >> n;
vector dp(n + 1, vector (n + 1, vector<int> (2)));
vector path(n + 1, vector (n + 1, vec... | ALGO | 0.99998 | 3.68347 |
2bd9efa6-7243-4b00-91f5-95c4cb44027f | aestheticisma/leetcode_daily | cpp/1047_删除字符串中的所有相邻重复项_easy.cpp | class Solution {
public:
string removeDuplicates(string S) {
string stk;
for (auto ch : S){
if (!stk.empty() && stk.back()==ch)
stk.pop_back();
else
stk.push_back(ch);
}
return stk;
}
}; | ALGO | 0.999946 | 6.313131 |
8b8fd45a-3842-4e85-98b3-b36f001ae2cb | DhirajGadekar/Cpp_programming | STL/Vector/6_VectorReverseIterator.cpp | #include<iostream>
#include<vector>
int main() {
std::vector<int> vobj = {10, 20, 30, 40, 50};
std::vector<int>::reverse_iterator itr;
for(itr = vobj.rbegin(); itr < vobj.rend(); itr++) {
std::cout << *itr << std::endl;
}
return 0;
}
| TOOL | 0.977915 | 4.100955 |
c4e5ccf8-621b-449f-b18a-5c2d253c1e6f | JuanPabloRivera/CompetitiveProgramming | ICPC/CF-A/CF268-D2-A.cpp | #ifdef LOCAL
#include <iostream>
#define debug(x) cerr<<"["<<#x<<"]: "<<x<<endl;
#define EPS 0.0000001
#else
#include <bits/stdc++.h>
#define debug(x) 42
#define debug_c(a) 42
#endif
#include <string>
#include <vector>
using namespace std;
int count_number(int arr[], int x, int n) {
int *low = lower_bound(arr... | ALGO | 0.99986 | 4.122388 |
d277df0a-4aaf-4d66-afd5-56978d9e5679 | pavellevap/code_antiplagiat | final_test/15/u2547_436_C_6882067.cpp | #undef NDEBUG
#ifdef SU2_PROJ
#define _GLIBCXX_DEBUG
#endif
#include <iostream>
#include <iomanip>
#include <sstream>
#include <fstream>
#include <string>
#include <cstdlib>
#include <cstdio>
#include <climits>
#include <cstring>
#include <ctime>
#include <cmath>
#include <cassert>
#include <vector>
#include <queue>
#... | ALGO | 0.999899 | 3.660645 |
1199419c-0d0d-4f7b-aea2-f34f777665b6 | KumarRobotics/spomp | src/aerial_map.cpp | #include <opencv2/imgproc/imgproc.hpp>
#include "spomp/aerial_map.h"
namespace spomp {
/*********************************************************
* AERIAL MAP PRIOR
*********************************************************/
void AerialMapPrior::updateMap(const cv::Mat& sem_map,
const std::vector<cv::Mat>& dm, ... | ALGO | 0.998274 | 3.50055 |
5f2b5f01-8c6a-4d45-a041-52c340fb3cdd | GameDevTecnico/cubos | engine/src/physics/solver/plugin.cpp | #include "penetration_constraint/plugin.hpp"
#include <cubos/engine/fixed_step/plugin.hpp>
#include <cubos/engine/physics/plugin.hpp>
#include <cubos/engine/physics/solver/plugin.hpp>
#include "../fixed_substep/plugin.hpp"
#include "distance_constraint/plugin.hpp"
#include "integration/plugin.hpp"
CUBOS_DEFINE_TAG(c... | TOOL | 0.881635 | 6.636306 |
f8cd19fc-fd92-4ecd-bddc-8783bc4cb0a6 | Nicolas-Sarmiento/CodeForces | J-WaitingFor.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
ios_base::sync_with_stdio(false);cin.tie(0);
int t; cin >> t;
char e; ll i;
ll st = 0;
while(t--){
cin >> e >> i;
if( e == 'P'){
st += i;
}else{
if( (i - st) >= 1){
... | ALGO | 0.999308 | 3.755656 |
7de0f819-0518-471e-b9ab-00349d9d948d | mohsaied/rtl2booksim | booksim/allocators/maxsize.cpp | // $Id$
#include "booksim.hpp"
#include <iostream>
#include "maxsize.hpp"
// shortest augmenting path:
//
// for all unmatched left nodes,
// push node onto work stack
// end
//
// for all j,
// from[j] = undefined
// end
//
// do,
//
// while( !stack.empty ),
//
// nl = stack.pop
// for each edg... | ALGO | 0.985071 | 5.352593 |
2be60aed-e75e-4521-8ca2-2505542f7962 | bowang007/Leetcode | 201-250/problem207.cpp | //
// Created by brayden on 2020-06-05.
//
#include "problem207.h"
#include <queue>
using std::vector;
// DFS
bool dfs(vector<vector<int>> &graph, vector<bool> &visited, vector<bool> &on_stack, int vertex) {
visited[vertex] = true;
on_stack[vertex] = true;
for (int adj : graph[vertex]) {
if (!vis... | ALGO | 0.999445 | 6.36349 |
de9183c6-25ef-4697-9de2-d33ede8f9c49 | redpinetree/potts-sim | src/union_find.cpp | #include "union_find.hpp"
uint64_t __attribute__((noinline)) UnionFind::find(size_t v,std::vector<uint64_t>& clusters){
uint64_t u=v;
while(u!=clusters[u]){
clusters[u]=clusters[clusters[u]];
u=clusters[u];
}
return u;
}
//this function generates data races! but can be ignored since the only critical ... | ALGO | 0.998192 | 4.744891 |
38c3f7ce-fc81-4d9e-a22f-8fdb01ffce44 | meganosro/c-c- | ritchi/1/test2_4/test2_4/Исходный код.cpp | #include <stdio.h>
#include<iostream>
int len;
void squeeze(char s1[], char s2[]);
int strlen(char s[]);
int main()
{
char s1[] = "BHiartpphdayy\0";
printf("s1 = %s\n", s1);
char s2[] = "Happy\0";
printf("s2 = %s\n", s2);
len = strlen(s2);
squeeze(s1, s2);
prin... | ALGO | 0.999386 | 3.244734 |
6e607e0d-0a3c-4c5f-991d-c13e9e7af5f4 | Anuj-Gupta79/Implementation | Cpp-Code/greatestnumber.cpp | #include<iostream>
using namespace std;
int main()
{
int a,b,c;
cout<<"enter the value of 1st number: ";
cin>>a;
cout<<"enter the value of 2nd number: ";
cin>>b;
cout<<"enter the value of 3rd number: ";
cin>>c;
if((a>b)&&(a>c))
{
cout<<a<<" is the greatest number";
}
... | ALGO | 0.999777 | 3.457328 |
6a81365c-10e8-4d75-a19c-96393e26bced | HamzaHassanain/CP_Templates | Range-Queries/LazyPropagationSegmentTree.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
// Preferable Not to use a struct for the segment tree node, for efficiency
struct LazyPropagationSegmentTree // 1-Based Indexing
{
int size;
long long DATA_DEFAULT, LAZY_DEFAULT;
vector<long long> data, lazy;
void init(int n, long long... | ALGO | 0.99988 | 3.774403 |
74df1e23-3aee-4c52-a5b6-6118e9d5fc2c | boettcherb/Competitive-Programming | Codeforces/Codeforces-Round-0304/E.cpp | /*
Problem Statement: https://codeforces.com/contest/546/problem/E
This problem can be solved using a max-flow algorithm. Create 2 'layers' of
nodes, each with all n vertices of the given graph, as well as a source and
sink node. Connect the source node to all nodes in layer 1 with the capacity of
the edge to node i ... | ALGO | 0.99995 | 5.196784 |
03608f45-b6b2-450f-b2a4-63afcc8ecf50 | vaibhavi-srivastava/DAA-Assignment | week5/count_sort.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
int no;
cin >> no;
for (int f = 0; f < no; f++)
{
int n;
cin >> ... | ALGO | 0.999819 | 4.015895 |
1882f783-acaf-4870-8000-83969a8cc207 | MalgeumChallenge/Yeori | Mar/[BOJ]1406.cpp | //#include <iostream>
#include <bits/stdc++.h>
using namespace std;
int main() {
string str;
cin >> str;
list<char> L;
for(auto c : str) L.push_back(c);
auto cursor = L.end();
int q; // test 개수
cin >> q;
while(q--) {
char op;
cin >> op;
if(op == 'P') {
... | ALGO | 0.999219 | 4.858438 |
d95f473b-c23e-4b34-8d24-3175591a4132 | ontario-tech-pw-II/stack-and-exceptions-somansheikh | RPN.cpp | // RPN calculator
#include <iostream>
#include <string>
#include <stack>
using namespace std;
bool is_str_digit(string); // returns true if input parameter string is and integer (e.g., "127343")
bool is_str_operator(string); // returns true if the input parameter is an operator character (e.g., "+", "*")
int main... | ALGO | 0.999799 | 4.647608 |
016c4fa0-0a00-4550-a867-20faba6e2429 | itzuditsharma/GFG-Solved | Difficulty: Medium/Shortest path in Directed Acyclic Graph/shortest-path-in-directed-acyclic-graph.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:
void toposort(int node, vector<int> &vis, vector<vector<pair<int, int>>> &adj, stack<int> &st){
vis[node] = 1;
... | ALGO | 0.999825 | 5.823231 |
827f694a-f202-433c-8bf4-8bce2a848d85 | smlnj/smlnj-llvm-18.1 | llvm/lib/Transforms/Utils/CloneFunction.cpp | #include "llvm/ADT/SetVector.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/Analysis/DomTreeUpdater.h"
#include "llvm/Analysis/InstructionSimplify.h"
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/IR/CFG.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DebugInfo.h"
#include "llvm/IR/DerivedTypes.h"
#include... | TOOL | 0.944552 | 7.89378 |
e9bd4e24-2913-43ab-95aa-8425d9700f7e | ShellRedia/Algorithm-CPlusPlus | graph/TreeDiameter.cpp | #include <iostream>
#include <vector>
using namespace std;
struct TreeDiameter{
const static int N = 50010;
int n, diameter = 0;
int d1[N], d2[N];
vector<pair<int, int>> (&E)[N];
void dfs(int u, int fa) {
d1[u] = d2[u] = 0;
for (auto p : E[u]) {
int v = p.first, w = p.... | ALGO | 0.999917 | 4.874198 |
580b2b4e-5927-4a30-9627-930a8c0f5139 | sevencomma/Problem-Solving | 프로그래머스/2/12949. 행렬의 곱셈/행렬의 곱셈.cpp | #include <iostream>
#include <string>
#include <vector>
using namespace std;
vector<vector<int>> solution(vector<vector<int>> arr1, vector<vector<int>> arr2) {
vector<vector<int>> answer;
answer.assign(arr1.size(), vector<int>(arr2[0].size(), 0));
for (int i = 0; i < arr1.size(); i++) {
for (int... | ALGO | 0.999875 | 5.131612 |
077f0500-a93d-458a-a014-1702712f7a03 | hybridSMT/hybridSMT | source_code/src/api/api_polynomial.cpp | #include "api/z3.h"
#include "api/api_log_macros.h"
#include "api/api_context.h"
#include "api/api_polynomial.h"
#include "api/api_ast_vector.h"
#include "ast/expr2polynomial.h"
#include "util/cancel_eh.h"
#include "util/scoped_timer.h"
#include "ast/expr2var.h"
extern "C" {
Z3_ast_vector Z3_API Z3_polynomial_sub... | ALGO | 0.980242 | 6.104103 |
5f156d16-3ba3-431a-b433-49593948483d | marioyc/Online-Judge-Solutions | TJU/2189 - The Key Stations.cpp | #include<queue>
#include<vector>
#include<string>
#include<sstream>
#include<iostream>
using namespace std;
int N,key;
vector< vector<int> > v;
bool M[1000];
int dfs(int n){
M[n]=1;
int cont=1;
queue<int> Q;
for(int i=0;i<v[n].size();i++)
if(v[n][i]!=key) Q.push(v[n][i]);
w... | ALGO | 0.999613 | 4.045301 |
da8346fd-3f54-4332-ba9f-6ea5e717b475 | mauricelos/Frenet-Coordinate-Transformer | src/main.cpp | ///
/// @file main.cpp
///
#include <iostream>
#include "protobuf_message_parser.h"
#include "reference_points.pb.h"
#include "reference_points_transformer.h"
int main()
{
double user_x_coordinate, user_y_coordinate;
std::cout << "Please enter your coordinate's x value: ";
std::cin >> user_x_coordinate;... | TOOL | 0.896358 | 5.749146 |
f1020809-81a8-4e2f-ac69-e3d1b4981214 | Kolsha/HackerRank | Algorithms/Search/Count Luck.cpp | #include <bits/stdc++.h>
/*
* Difficulty Medium
* Max Score 50
* https://www.hackerrank.com/challenges/count-luck/
*/
using namespace std;
vector <string> split_string(string);
using point = pair<int, int>;
bool checkBounds(const vector <string> &matrix, int x, int y) {
if (x < 0 || y < 0) {
return ... | ALGO | 0.999843 | 6.128019 |
e80f3347-24ed-4fad-a0e5-377e029b640d | side-projects-all/works | Leetcodes/binary_tree/q_1609.cpp | /*
A binary tree is named Even-Odd if it meets the following conditions:
The root of the binary tree is at level index 0, its children are at level index 1, their children are at level index 2, etc.
For every even-indexed level, all nodes at the level have odd integer values in strictly increasing order (from ... | ALGO | 0.999985 | 6.787194 |
f31f3e2a-25b4-4d51-82ca-bd42c2970008 | aniketpathak028/LeetCode | 191-number-of-1-bits/191-number-of-1-bits.cpp | class Solution {
public:
int hammingWeight(uint32_t n) {
int cnt= 0;
while(n){
cnt++;
n= n&(n-1);
}
return cnt;
}
}; | ALGO | 0.99988 | 6.372061 |
d537d66c-9b47-49b6-a0ec-fc5cc396fd64 | Tanishgupta007/DSA-CPP | TCS COIGN/25_decimal-to-octal.cpp | #include<iostream>
using namespace std;
int main()
{
int arr[100];
int num;
cin>>num;
int i = 0;
while(num){
int rem = num % 8;
arr[i] = rem;
num = num/8;
i++;
}
for (int j = i-1; j >= 0; j--)
{
cout<<arr[j];
}
} | ALGO | 0.999787 | 3.660289 |
608c3340-a1a2-438e-9a40-4210cd494022 | vijay-pankaj/CPP_Problems_Solving | NewCpp4/Array/CharArray/Assignment2/Q5.cpp | /*
5. Remove Characters from a String (except digits)
-> Problem Statement: Remove all non-numeric characters from a char array (string).
Explanation:
-> Iterate through the string and copy only digits to a new string.
Input:
-> char str[] = "abc123!@#456";
Output:
-> Numeric String: "123456"
*/
#include<iostream>
u... | ALGO | 0.955445 | 4.199728 |
5d1d9cf7-de13-45b4-b38f-414c1ee67c2b | Pablo12345678901/cpp_training | ZZ_CodesSource_livre/chap28/Multimapc.cpp | // Multimap
#include <iostream>
#include <map>
using namespace std ;
void affiche (const multimap<char, int> &) ;
int main()
{ multimap<char, int> m, m_bis ;
m.insert(make_pair('c', 10)) ; m.insert(make_pair('f', 20)) ;
m.insert(make_pair('x', 30)) ; m.insert(make_pair('p', 40)) ;
m.insert(make_pair('y', 40)) ;... | TEST | 0.933009 | 3.849701 |
6435f1d0-07e2-4b8c-a47f-f2222e0fc353 | Nobel-ruettt/Poj | A amanda.cpp | #include <bits/stdc++.h>
using namespace std;
/***template***/
#define ll long long
#define LL long long
#define dd double
#define scl(n) scanf("%lld",&n)
#define sl(n) scanf("%lld",&n)
#define scd(n) scanf("%lf",&n)
#defin... | ALGO | 0.999664 | 3.919454 |
13ab29ce-12bc-4cdf-bdbe-d3297b07465c | SaiDushyant/Mastering-DSA-CPP | Day - 08 (Number System)/Binary_to_Decimal.cpp | #include <iostream>
using namespace std;
int binaryToDecimal(int binary)
{
int decimal = 0;
int power = 1;
while (binary > 0)
{
int lastDig = binary % 10;
decimal += lastDig * power;
power *= 2;
binary /= 10;
}
cout << decimal << endl;
}
int main()
{
binar... | ALGO | 0.998872 | 5.078442 |
6092c286-09ed-42f0-840e-2b0629af80a8 | aroud/c-plus-plus-modern-development | Желтый пояс/w1/3. Region database/Source.cpp | #include <map>
#include <tuple>
#include <vector>
#include <iostream>
#include "Header.h"
#include <algorithm>
using namespace std;
bool operator<(const Region& lhs, const Region& rhs) {
return tie(lhs.std_name, lhs.parent_std_name, lhs.names, lhs.population) <
tie(rhs.std_name, rhs.parent_std_name, rhs.na... | ALGO | 0.967644 | 4.229414 |
6f52a89c-e246-4cfa-b9c7-8de2d1a7db4b | Patchcoat/logdraw | include/glm/test/core/core_func_integer_find_msb.cpp | #include <glm/glm.hpp>
#include <cstdio>
#include <cstdlib> // To define "exit", req'd by XLC.
#include <ctime>
#define LE 1 // 1 for little-endian, 0 for big-endian.
int pop(unsigned x) {
x = x - ((x >> 1) & 0x55555555);
x = (x & 0x33333333) + ((x >> 2) & 0x33333333);
x = (x + (x >> 4)) & 0x0... | ALGO | 0.99888 | 3.533907 |
57530c7d-f64f-46a7-9370-3969ba8c37b7 | RustyStove/LabAssignments | lab5/jolibi.cpp | #include <stdio.h>
int main(){
int T;
int score[3];
int jlbscore;
int score2[100];
int sum = 0;
int average;
scanf("%d",&T);
for (int i = 0; i<3; i++){
scanf("%d", &score[i]);
jlbscore += score[i];
}
for (int i = 0; i<T; i++){
scanf("%d", &score2[i]);
... | ALGO | 0.999906 | 3.29421 |
f1d3148a-299c-41b9-a918-fb8be6fcede8 | Vinidamasceno22/CSES-Solutions | introductory_problems/Repetitions.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int curr = 1, MAX = 1;
string s;
cin >> s;
for(int i = 1; i < s.size(); i++){
if(s[i] == s[i-1]){
curr++;
}
else{
curr = 1;
}
MAX = max(MAX, curr);
}
cout << MAX << '\n';
} | ALGO | 0.999837 | 3.620971 |
7da60e1c-7d7e-4e71-89c2-aa9338da165b | kaziabdullahfuad/Codeforces-Grind | contest/round 969 (div-2)/doraandc.cpp | #include<iostream>
#include<numeric>
#include<cmath>
#include<algorithm>
#include<string>
#include<vector>
#include<set>
#include<unordered_set>
#include<unordered_map>
#include<map>
using namespace std;
#define ll long long
#define endl "\n"
#define debug(x) cout<<#x<<":"<<x<<endl;
#define all(x) (x).begin(),(x).end()... | ALGO | 0.998065 | 3.278204 |
255c4faf-36c5-43b4-ad66-bd0e9e910b0f | Liesegang/Procon | AtCoder/abc195/a/main.cpp | #include <bits/stdc++.h>
using namespace std;
// Type alias
using ll=long long;
using ld=double;
using pi=pair<int,int>;
using pll=pair<ll,ll>;
using pld=pair<ld,ld>;
using ti3=tuple<int, int, int>;
using vi=vector<int>;
using vll=vector<ll>;
using vld=vector<ld>;
using vpi=vector<pi>;
using vpll=vector<ll>;
using v... | ALGO | 0.99993 | 3.96025 |
b91f41c2-8c90-4024-9145-9abb15aa7824 | shawakation/CSP | 201903-3/main.cpp | #include <bits/stdc++.h>
#define maxn 1001
using namespace std;
vector<string> disks[maxn];
unordered_set<int> exist;
int blocknum;
int main()
{
int n,s,l,m;
scanf("%d%d%d",&n,&s,&l);
for (int i=0;i<l;i++) {
int num;
string s;
scanf("%d",&num);
cin>>s;
exist.insert(num);
for... | ALGO | 0.987015 | 3.284143 |
c9e1d838-0e81-4147-87b9-7788e277c371 | GendalfBlack/P21_Lessons | ConsoleApplication32/ConsoleApplication32/ConsoleApplication32.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <Windows.h>
#include <iostream>
using namespace std;
/*
Задача 1. Створити структуру "Фільми". В якій буде "Назва", "рік випуску", "Студія"
Задача 2. Створити масив структур на 5 фільмів.
Задача 3. Реалізувати можливість редагувати один з фільмів за допомогою функції.
Задача... | TOOL | 0.993374 | 3.999642 |
60f61d38-e12d-4b93-a9b8-413fd232a92c | Lin-jingy/ACM | codeforces/Codeforces Round 878 (Div. 3)/1840C.cpp | #include<bits/stdc++.h>
#include<unordered_map>
#include<unordered_set>
using namespace std;
#define int long long
using PII = pair<int ,int>;
using PSI = pair<string, int>;
using PIS = pair<int, string>;
#define inf LONG_LONG_MAX
#define yes cout << "Yes\n"
#define no cout << "No\n"
const int N = 2e5 + 5;
int a[N],... | ALGO | 0.999737 | 3.671607 |
739633c7-0227-4820-9e0c-5a1772e80ed5 | gsandeep1231/Udacity-CarND-Path-Planning-Project | src/Eigen-3.3/bench/benchmarkX.cpp | // g++ -fopenmp -I .. -O3 -DNDEBUG -finline-limit=1000 benchmarkX.cpp -o b && time ./b
#include <iostream>
#include <Eigen/Core>
using namespace std;
using namespace Eigen;
#ifndef MATTYPE
#define MATTYPE MatrixXLd
#endif
#ifndef MATSIZE
#define MATSIZE 400
#endif
#ifndef REPEAT
#define REPEAT 100
#endif
int mai... | ALGO | 0.921614 | 3.370773 |
7f936d45-0400-4f74-952c-466b9962bb2f | KordonskiiA/Kordonskii | Нова папка/LB17/task2.cpp | #include <iostream>
#include <cmath>
using namespace std;
bool isPrime(int num) {
if (num < 2) return false;
for (int i = 2; i * i <= num; i++) {
if (num % i == 0) return false;
}
return true;
}
int main() {
for (int i = 0; i <= 21; i++) {
if (isPrime(i)) {
cout << i... | ALGO | 0.994309 | 4.612787 |
d5a08a7e-6f08-4b0c-9b30-99148d841101 | faizan123-mansuri/ADA-program | 119program2(b)Recursive.cpp | //recursive procedure for binary search
#include<bits/stdc++.h>
using namespace std;
int binarySearch(int a[],int l,int r,int item)
{
if(r>=l)
{
int mid=l+(r-l)/2;
if (a[mid]==item)
return mid;
if (a[mid]>item)
return binarySearch(a,l,mid-1,item);
return binarySearch(a,mid+1,r,item);
}
... | ALGO | 0.999709 | 5.209127 |
15f4eb45-a1de-4af9-8bc2-097c6cf048c5 | LongSei/Competitive-Training | SPJ - VBGRASS.cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long
const int MAX = 101;
char board[MAX][MAX];
int n, m;
int ans = 0;
int dx[] = {0,0,-1,1};
int dy[] = {1,-1,0,0};
void ff(int x, int y) {
board[x][y] = '.';
for (int i = 0; i < 4; i++) {
int nx = x + dx[i];
int ny = y + dy[i];
if (nx >= 0 && nx ... | ALGO | 0.999711 | 4.295899 |
5956587e-3728-47eb-b24a-581b333cf701 | amod404/DSA_notes_inC- | Phase-3/lec82.cpp | // Backtracking-01 with questions
#include<iostream>
#include<cstdlib>
#include<vector>
#include<stack>
#include<queue>
#include<string>
#include<map>
#include<unordered_map>
using namespace std;
bool isSafe(int newx, int newy, vector<vector<bool>> &vis, vector<vector<int>>& arr, int n){
if(( newx>=0 && newx<=0) ... | ALGO | 0.999914 | 4.977818 |
98062333-8c8a-4b14-8321-b9d5712649cf | Abhishekkumar2021/Coding | ConvexHull.cpp | #include<bits/stdc++.h>
using namespace std;
class Vector{
public:
long long x;
long long y;
Vector(){
x = 0;
y = 0;
}
Vector(long long x, long long y){
this->x = x;
this->y = y;
}
// Read
void read(){
cin >> x >> y;
}
// Vector... | ALGO | 0.999992 | 5.074531 |
23159c2b-28a4-4e01-afc1-a31a29bf68fc | RainSureZhao/code_snippet_cpp | KD-Tree(3D).cpp | struct Point {
int x, y, z;
Point(int x, int y, int z) : x(x), y(y), z(z) {}
};
struct Node {
Point point;
Node* left;
Node* right;
Node(Point p) : point(p), left(nullptr), right(nullptr) {}
};
struct KDNode {
Point point;
int leftChild;
int rightChild;
KDNode(Point p) : poi... | ALGO | 0.999889 | 5.430023 |
87c0a3fd-83f5-4806-a569-d190b7727ffe | ORNL-QCI/exatn | tpls/antlr/runtime/src/dfa/DFAState.cpp | #include "atn/ATNConfigSet.h"
#include "atn/SemanticContext.h"
#include "atn/ATNConfig.h"
#include "misc/MurmurHash.h"
#include "dfa/DFAState.h"
using namespace antlr4::dfa;
using namespace antlr4::atn;
DFAState::PredPrediction::PredPrediction(const Ref<SemanticContext> &pred, int alt) : pred(pred) {
InitializeIns... | ALGO | 0.955303 | 6.929675 |
a34d6068-a32b-432c-b629-52c3abed88b1 | aykut-bozkurt/Algos | backtracking/permutations-of-string.cpp | #include "permutations-of-string.h"
#include <cinttypes>
#include <iostream>
void permutation_of_string(std::string& s, int start_idx, int end_idx){
if(start_idx == end_idx){
std::cout << s << std::endl;
}
else{
for(std::size_t i = start_idx; i <= end_idx; i++){
std::swap(s[sta... | ALGO | 0.999328 | 6.123835 |
a8573190-26ec-4a9b-8f8c-955f16bc3a85 | aclinic/ProjectEuler | Solutions/p6/main.cpp | #include <cmath>
#include <iostream>
// Find the sum of squares up to k > 0.
int sumOfSquares(int k) {
auto output = 0;
for (int i = 1; i <= k; ++i) {
output += pow(i, 2);
}
return output;
}
// Find the square of the sum up to k > 0.
int squareOfSum(int k) {
auto sum = 0;
for (int i = ... | ALGO | 0.997024 | 5.625594 |
bda8404b-73e3-484c-89e8-5d0ccedeb40d | medwards/darkreign2 | source/util/sunpos.cpp | #include "mathtypes.h"
#include "sunpos.h"
//
// the epoch upon which these astronomical calculations are based is
// 1990 january 0.0, 631065600 seconds since the beginning of the
// "unix epoch" (00:00:00 GMT, Jan. 1, 1970)
//
// given a number of seconds since the start of the unix epoch,
// DaysSinceEpoch() comput... | ALGO | 0.999729 | 3.326758 |
f8f7a3f8-49aa-4ed4-a626-7efdac475096 | heyhooman/0xDSA | striver/step1/1.2/pattern11.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
void printTriangle(int n) {
for(int i=1; i<n+1; i++){
for( int y =i; y>0; y--){
if(i%2 != 0){
if(y%2 !=0){
... | ALGO | 0.999951 | 6.043915 |
d6434a5f-3800-465d-b9f1-e4fdd4fa6697 | ShyamB123/Learning_cpp | Bit Manipulation/Decimal_to_Binary.cpp | #include<iostream>
#include<bits/stdc++.h>
using namespace std;
void decimal_to_binary(int n)
{
int p = 1;
int ans = 0;
while(n>0)
{
ans +=(n&1)*p;
n=n/2;
p *=10;
}
cout << ans<<endl;
}
void decimal_to_binary_bits(int n)
{
int p = 1;
int ans = 0;
while(n>... | ALGO | 0.99992 | 4.99432 |
18b8b18c-5bc6-4f5c-bfed-bcc06abd4f75 | Abhinav7076/My-Codes | Stacks & Queues/Find the next Greater element.cpp | //jo bhi bada hoga use wo stack k top ka next greater hoga
vector<long long> nextLargerElement(vector<long long> arr, int n){
// Your code here
stack<long long> s;
unordered_map<long long,long long> u;
for(long long i=0;i<n;){
if(s.empty())
s.push(arr[i++]);
... | ALGO | 0.999987 | 4.702693 |
b4b7d784-ca51-4b78-8cc3-4305a583208c | rverma510/Coding-Problems | 13_Graphs/20_bottom.cpp | #include<bits/stdc++.h>
using namespace std;
stack<int> st;
vector<int> adjList[5010];
vector<int> adjListT[5010];
bool visited[5010];
int n, e;
void dfs1(int source) {
visited[source] = true;
for (int i = 0; i < adjList[source].size(); i++) {
int next = adjList[source][i];
if (visited[next])
... | ALGO | 0.999947 | 4.574984 |
8341000c-3e6a-4bbf-b56b-ce470b5ea720 | bioexcel/bioexcel-exascale-co-design-benchmarks | GROMACS/nonbonded_benchmark/gromacs_source_code/src/gromacs/mdlib/expanded.cpp | #include "gmxpre.h"
#include "expanded.h"
#include <cmath>
#include <cstdio>
#include <algorithm>
#include "gromacs/domdec/domdec.h"
#include "gromacs/fileio/confio.h"
#include "gromacs/fileio/gmxfio.h"
#include "gromacs/fileio/xtcio.h"
#include "gromacs/gmxlib/chargegroup.h"
#include "gromacs/gmxlib/network.h"
#in... | ALGO | 0.999876 | 6.372239 |
5d6c70c2-3fa4-4061-baec-8718bdb427c8 | Dheerajchaudhary9401/dheeraj.kumar-asssignment | program.36c.cpp | #include <stdio.h>
#define ARRAY_SIZE 10
int main(void) {
int array[ARRAY_SIZE] = {1, 2, 3, 3, 4, 4, 4, 5, 5, 5};
int i, j;
int count = 0;
for (i = 0; i < ARRAY_SIZE; i++) {
for (j = i + 1; j < ARRAY_SIZE; j++) {
if (array[i] == array[j]) {
count++;
break;
}
}
}
print... | ALGO | 0.997547 | 5.165346 |
5d18882b-5866-4136-8cb3-720463bbee14 | ishandutta2007/codeforces | oipotato/normal/1325/B.cpp | #include<cmath>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<ctime>
#include<iostream>
#include<vector>
#include<queue>
#include<bitset>
#include<set>
#include<unordered_map>
#include<unordered_set>
#include<map>
#include<cassert>
#include<string>
using namespace std;
#define pb push_back
#define mp ... | ALGO | 0.999715 | 3.668659 |
a091039d-48dc-423b-b9e2-60a9ba903c0e | ufidon/cpp | lectures/bookcode/chapter04/GuessBirthday.cpp | #include <iostream>
using namespace std;
int main()
{
int day = 0; // Day to be determined
char answer;
// Prompt the user for Set1
cout << "Is your birthday in Set1?" << endl;
cout << " 1 3 5 7\n" <<
" 9 11 13 15\n" <<
"17 19 21 23\n" <<
"25 27 29 31" << endl;
cout << "En... | ALGO | 0.9973 | 3.655733 |
8977108d-88f8-430e-8cdf-f66a0ec724f0 | all1m-algorithm-study/2021-1-Algorithm-Study | week1/Group2/boj2231_kir3i.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <string>
using namespace std;
int div_sum(int n) {
string ns = to_string(n);
int rtn = n;
for (const char c: ns)
rtn += c - '0';
return rtn;
}
int main(void) {
ios_base::sync_with_stdio(false);
cin.tie(0);
int N;... | ALGO | 0.999918 | 4.898857 |
7ffe6a96-501b-4d6e-901d-cc0de11f103b | md-rafiul-islam/Problem-Solving-Repo | the_play_never_ends.cpp | #include<bits/stdc++.h>
using namespace std;
#define nl '\n'
#define LL long long
void solve(){
int n; cin >> n;
n--;
if(n%3==0){
cout << "YES" << nl;
return;
}
cout << "NO" << nl;
}
int main(){
ios::sync_with_stdio(false);
cin.tie(NULL);
int t; cin >> t;
while(t--)
solve();
... | ALGO | 0.99962 | 4.011826 |
73865978-f717-486e-a256-14bfc4f8a5b0 | Abunyawa/contests | YaCup21Qual/a.cpp | // chrono::system_clock::now().time_since_epoch().count()
#include <bits/stdc++.h>
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second
#define all(x) (x).begin(), (x).end()
#define sz(x) (int)(x).size()
#define rep(i, a, b) for (int i = (a); i < (b); ++i)
#define debug(... | ALGO | 0.99993 | 3.515608 |
c6c7fb9f-060e-432e-a502-da7581c1ba38 | farhanniloy/Cpp | UdacityCpp/Advanced_OOP/composition_exercise.cpp | #include <iostream>
#define PI 3.14159
class LineSegment {
private:
double length;
public:
LineSegment(double len) : length(len) {}
double GetLength() const {
return length;
}
};
class Circle {
private:
LineSegment radius;
public:
Circle(double r) : radius(r) {}
double A... | TOOL | 0.970019 | 5.844703 |
6b3bf697-45fb-477f-9ba6-e3a3e359bf7d | Student-FastDev/Problems | InstaKolko/Thanos.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int N;
cin >> N;
int array[N];
for (int i = 0; i < N; i++) {
cin >> array[i];
}
int Q;
cin >> Q;
int start = 0;
int end = N - 1;
bool empty = false;
for (int i = 0; i < Q; i++) {
int middle = (start + end) / 2;
... | ALGO | 0.999964 | 4.024547 |
bbf5ca84-5045-4110-9123-9b23598d1f08 | kwikius/kwikius-ardupilot | libraries/AP_HAL_Linux/Flow_PX4.cpp | #include <AP_HAL/AP_HAL.h>
#if CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_BEBOP
#include "Flow_PX4.h"
#include <cmath>
#include <stdio.h>
#include <stdlib.h>
extern const AP_HAL::HAL& hal;
using namespace Linux;
Flow_PX4::Flow_PX4(uint32_t width, uint32_t bytesperline,
uint32_t max_flow_... | ALGO | 0.992542 | 5.151992 |
0c301e8f-5c16-4bc5-b896-473c09e04e95 | gch144/Data-Structures | DSA_problems/Array/leftsmallrightgreater.cpp | #include <bits/stdc++.h>
using namespace std;
// Characcter arrays
/*QQ6 - Given an integer array containing n elements. Find the element in the array for which all the elements to its
left are smaller than it and all the elements to the right of it are larger than it.Here 1<n<101
&x: arr=[1,6,5,7,10,8,9]
Output: 7
E... | ALGO | 0.999958 | 4.285495 |
3c7b94c4-e1ab-4105-8ada-b796f4899b27 | tarushi98/data-struct-algo | trees/bst/deletion.cpp | #include <iostream>
#include<queue>
using namespace std;
class node{
public:
node *left;
node *right;
int data;
node(int key)
{
data = key;
left = NULL;
right = NULL;
}
};
node* insertinbst(node* root,int d)
{
if(root == NULL)
return new node(d);
... | ALGO | 0.999985 | 4.266091 |
59354aab-296e-4708-ad79-aec003bff8bb | jenishk20/LeetCode-GFG | 0703-kth-largest-element-in-a-stream/0703-kth-largest-element-in-a-stream.cpp | class KthLargest {
public:
priority_queue<int,vector<int>,greater<int>>pq;
int size = 0;
KthLargest(int k, vector<int>& nums) {
size = k;
for(auto it : nums){
pq.push(it);
if(pq.size() > k) pq.pop();
}
}
int add(int val) {
pq.push... | ALGO | 0.99997 | 6.036685 |
477310a4-a26f-464f-b662-6c8f74e61e35 | KitsuneDev/Blender | extern/bullet2/src/BulletCollision/CollisionShapes/btConvex2dShape.cpp | #include "btConvex2dShape.h"
btConvex2dShape::btConvex2dShape(btConvexShape* convexChildShape) : btConvexShape(), m_childConvexShape(convexChildShape)
{
m_shapeType = CONVEX_2D_SHAPE_PROXYTYPE;
}
btConvex2dShape::~btConvex2dShape()
{
}
btVector3 btConvex2dShape::localGetSupportingVertexWithoutMargin(const btVector3... | ALGO | 0.963379 | 7.572961 |
e1736053-e4a4-4738-af87-25c8764212a0 | Hambar17umyan/CSES | 1661.cpp | #include <iostream>
#include <map>
#include <vector>
#define ll long long
using namespace std;
map<ll, ll>mp;
int main()
{
ll i, j, x, l, k, m, n, o, p;
cin >> n >> x;
ll res = 0;
k = 0;
for (i = 0; i < n; i++)
{
cin >> o;
k += o;
if (k == x)
{
res++;
}
l = k - x;
res += mp[l];
mp[k]++;
}
co... | ALGO | 0.99989 | 3.612863 |
89490899-fe8b-4312-bc84-e342c1bcb6ac | poca1212/Algorithm | BAEKJOON_1357.cpp | #include <iostream>
#include <cmath>
#include <string>
#include <algorithm>
using namespace std;
int main()
{
string num, num1;
int ans;
cin >> num >> num1;
reverse(num.begin(), num.end());
reverse(num1.begin(), num1.end());
ans = stoi(num) + stoi(num1);
string a = to_string(ans);
reverse(a.begin(), a.end(... | ALGO | 0.999914 | 4.054347 |
5eedf763-6af6-4990-bdf6-6e748083dfe6 | sdmg15/coin-pipeline | src/test/fuzz/script_sign.cpp | #include <chainparams.h>
#include <chainparamsbase.h>
#include <key.h>
#include <pubkey.h>
#include <script/keyorigin.h>
#include <script/sign.h>
#include <script/signingprovider.h>
#include <streams.h>
#include <test/fuzz/FuzzedDataProvider.h>
#include <test/fuzz/fuzz.h>
#include <test/fuzz/util.h>
#include <cassert>... | TEST | 0.85915 | 5.79174 |
1a5fc337-da78-4a09-a003-1328a09ce864 | mailtoharutyunyan/LeetCode-Solutions | solutions/1282. Group the People Given the Group Size They Belong To/1282.cpp | class Solution {
public:
vector<vector<int>> groupThePeople(vector<int>& groupSizes) {
vector<vector<int>> ans;
unordered_map<int, vector<int>> groupSizeToIndices;
for (int i = 0; i < groupSizes.size(); ++i)
groupSizeToIndices[groupSizes[i]].push_back(i);
for (const auto& [groupSize, indices]... | ALGO | 0.999913 | 7.056469 |
bd6540ce-e87b-4b24-b03c-ebca333f6330 | Aditya-41/DSA-Codes | Bakwas/rec1.cpp | #include<bits/stdc++.h>
using namespace std;
void solve(int n){
if(n==0){
return;
}
cout<<n%10<<" ";
solve(n/10);
}
int main(){
int n = 11234234;
solve(n);
return 0;
} | ALGO | 0.999888 | 4.352447 |
69ab49af-6094-4ff1-a96c-80fe1bd44974 | Akemax/Cpp_Palindrome | Cpp_Palindrome/Cpp_Palindrome/Cpp_Palindrome.cpp | #include <iostream>
std::string Reverse(std::string x)
{
std::string y;
for (int i = x.length() - 1; i >= 0; i--)
{
y += x.at(i);
}
return y;
}
bool isPalindromeWithReverse(std::string x)
{
return (x == Reverse(x)) ? true : false;
}
bool isPalindrome(std::string x)
{
for (int i = 0; i < x.length() / 2; i+... | ALGO | 0.998281 | 4.944722 |
90dd958e-4ccc-4660-aa37-e01a4608ea15 | alvinnardo/licode | leetcode/558.cpp | #include "../template/head.h"
#include <bits/stdc++.h>
class Node {
public:
bool val;
bool isLeaf;
Node *topLeft;
Node *topRight;
Node *bottomLeft;
Node *bottomRight;
Node() {
val = false;
isLeaf = false;
topLeft = NULL;
topRight = NULL;
bottomLeft... | ALGO | 0.999908 | 4.805258 |
85f50b37-adc9-4bd3-b88e-ea32d332704b | Harshish/SPOJ | ACTIV.cpp | //Credits:
//Sumit Vohra
//https://www.quora.com/How-do-I-come-up-with-a-solution-for-SPOJ-ACTIV-Activities
#include <bits/stdc++.h>
using namespace std;
#define MOD 100000000
#define MAX 100003
int dp[MAX][2];
void getPermutation(vector< pair<int,int> > &v,int n)
{
vector<int> entime;
memset(dp,0,sizeof(dp[0][0... | ALGO | 0.998543 | 4.160221 |
39cd3644-7c34-49aa-adc3-cdca20707b71 | raincross7/code-similarity | codes/train_code/problem206/problem206_399.cpp | /*------------------------------------
........Bismillahir Rahmanir Rahim....
..........created by Abdul Aziz.......
------------------------------------*/
#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <cstring>
#include <unordered_... | ALGO | 0.964325 | 3.89382 |
76eb3706-b629-4e10-8f5a-790e25bdbf0e | surajshelke2/Leetcode | Difficulty: Medium/Subset Sums/subset-sums.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
vector<int>ans;
void solve(vector<int>&arr , int i, int sum){
if(i>=arr.size()){
ans.push_back(sum);
return;
}
... | ALGO | 0.997167 | 6.839348 |
a2481875-443d-4158-b82d-aba94fb5b379 | vish2002/GFG-POTD | Max sum path in two arrays.cpp | // Max sum path in two arrays
// GFG : Medium 01-09-2024
int maxPathSum(vector<int> &arr1, vector<int> &arr2)
{
int m = arr1.size();
int n = arr2.size();
int ans = 0, s1 = 0, s2 = 0;
int i = 0, j = 0;
while (i < m && j < n)
{
if (arr1[i] == arr2[j])
{
ans += max(s1, ... | ALGO | 0.999956 | 5.367334 |
a74daa2b-fc5e-40ff-aea6-4a0a9f5af7b9 | MSP07/LeetCode-Solutions-CPLUSPLUS | ValidPalindrome3.cpp | /*approach
two pointers, greedy
interate from both ends if both chars are same shrink the window
else we check for palindrome in either left+1 to right substring or left,right-1 substring
if either returns true then it is possible to make this string palindorme after one deletion
else not*/
class Solution{
pr... | ALGO | 0.999989 | 6.517485 |
178a1cbe-1b73-43c9-b876-a8f045d8aa55 | mamasaki/flyffsf | SRC/OFFI SRC!/boost_1_34_1/boost_1_34_1/libs/iterator/example/filter_iterator_example.cpp | #include <boost/config.hpp>
#include <algorithm>
#include <functional>
#include <iostream>
#include <boost/iterator/filter_iterator.hpp>
#include <boost/cstdlib.hpp> // for exit_success
struct is_positive_number {
bool operator()(int x) { return 0 < x; }
};
int main()
{
int numbers_[] = { 0, -1, 4, -3, 5, 8, -2 }... | ALGO | 0.96879 | 5.656033 |
3595f899-78f5-4ca0-b6da-e7ad44e4541b | WelderFoundation/WelderEngineSpirvTools | tools/stats/stats.cpp | #include <cassert>
#include <cstring>
#include <fstream>
#include <iostream>
#include <unordered_map>
#include <vector>
#include "spirv-tools/libspirv.h"
#include "tools/io.h"
#include "tools/stats/spirv_stats.h"
#include "tools/stats/stats_analyzer.h"
namespace {
void PrintUsage(char* argv0) {
printf(
R"(%s... | TOOL | 0.922237 | 7.562739 |
6cee605e-d7a7-4154-a2d1-55999eed89cf | Urho-Net/Urho3D | Source/ThirdParty/Bullet/src/BulletDynamics/Featherstone/btMultiBodySphericalJointMotor.cpp | ///This file was written by Erwin Coumans
#include "btMultiBodySphericalJointMotor.h"
#include "btMultiBody.h"
#include "btMultiBodyLinkCollider.h"
#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
#include "LinearMath/btTransformUtil.h"
#include "BulletDynamics/ConstraintSolver/btGeneric6DofSpring2Cons... | ALGO | 0.897357 | 7.288224 |
60fdb608-e392-4f11-81ca-ff62e23f69fb | dils12001/C_Practice | C++/hw7-6.cpp | #include <iostream>
int Fill_array(double*,int);
void Show_array(double*,int);
void Reverse_array(double*,int);
using namespace std;
int main()
{
double myArr[10];
int realSize = Fill_array(myArr,10);
Show_array(myArr,realSize);
Reverse_array(myArr,realSize);
Show_array(myArr,realSize);
Reverse_array(myArr+1,r... | ALGO | 0.996838 | 3.795276 |
db4d73a2-3881-49d9-b3f1-56c38073cf81 | qiatongxueshaonianC/CaiZebin-Code_warehouse | PAT/第一轮/未归档/A1012/排序/main.cpp | #include<bits/stdc++.h>
using namespace std;
const int maxn=2010;
struct Node{
int grade[4];
string id;
int rank[4];
Node(string s,int x,int y,int z){
id=s;
grade[1]=x;
grade[2]=y;
grade[3]=z;
grade[0]=x+y+z;
}
Node(){ }
};
map<string,Node> mp;
vector<Node> vct;
string c="ACME";
int n,m,now;
bool cmp(N... | ALGO | 0.999843 | 5.014815 |
51edda1f-419c-4aab-bb77-612f63b2482a | codeaholic-shub/ALGO-ADDICT | LEETCODE/C++/gray-code.cpp | // Time: (2^n)
// Space: O(1)
class Solution {
public:
vector<int> grayCode(int n) {
vector<int> result = {0};
for (int i = 0; i < n; ++i) {
for (int j = result.size() - 1; j >= 0; --j) {
result.emplace_back(1 << i | result[j]);
}
}
return re... | ALGO | 0.999908 | 6.600447 |
0f7fcdc7-c419-4d26-a677-12bbc1851874 | abdul-aual/Codeforces-Solution | 486A - Calculating Function.cpp | #include<iostream>
using namespace std;
int main(){
long long n,sum;
cin>>n;
if(n%2==0) sum=n/2;
else sum=((n+1)/2)*(-1);
cout<<sum<<endl;
}
| ALGO | 0.999959 | 3.440606 |
739cb718-317c-4468-b486-9ee01d67e5ec | ddyeon/IT-DA-4rd | study/C++/week08/BOJ_2011_백다연.cpp | #include <string>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
//2011 ȣڵ
//ڸ or ڸ .
string s;
int arr[5001];
int dp[5001];
int main()
{
cin >> s;
if(s[0] == '0')
{
cout << 0;
return 0;
}
dp[0]= dp[1] = 1;
for(int i = 2; i <= s.size(); i++)... | ALGO | 0.999932 | 3.4398 |
afec8b1d-5274-45cc-8b3c-5f252a3c1e3f | KhoiBui16/Fullhouse_Code_Online | C++/Source code/Buoi_10/Bai09_CapSoCoTongNhoHonK.cpp | /*
C++ Buổi 10_Bài 09.Cặp số có tổng nhỏ hơn K.
Cho mảng a gồm n phần tử và số nguyên dương k. Đếm số lượng cặp số ai, aj (i != j) có tổng nhỏ hơn k.
Input Format
Dòng thứ 1 là số lượng phần tử trong mảng và số nguyên dương k. Dòng thứ 2 là n phần tử trong mảng. (2<=n<=10^6; 1<=k<=10^6; 0<=a[i]<=10^6)
Output For... | ALGO | 0.999959 | 5.034749 |
d6f2413d-dc33-484a-bb35-941e9ca455b9 | QuaziSamiha/C-and-CPP | OOP and Basic/C Parts/8. String/string_25.cpp | // tolower() function : convert upper case to lower case
// touper() function : convert lower case to upper case
#include<stdio.h>
#include<ctype.h>
int main()
{
char v1;
printf("Enter a upper case character : ");
scanf("%c", &v1);
printf("Before using tolower() function : \n");
printf("v1 : %c \n... | ALGO | 0.954638 | 4.127881 |
1f4ee31a-eaa4-4551-aa0c-1f26ba028368 | Aman-Keshri/DSA-450 | 3__Singly LinkedList/31_Reverse_LL.cpp | #include <iostream>
#include <algorithm>
#include <bits/stdc++.h>
using namespace std;
class Node
{
public:
int data;
Node *next;
// constructor
Node(int data)
{
this->data = data;
this->next = NULL;
}
};
Node *ReverseIter(Node *head)
{
Node *prev = NULL, *cur = head;
... | ALGO | 0.999627 | 5.093492 |
143c31ad-93b2-4a3d-b8fe-be329ea088df | amit0-git/Data-Structures | Recursion/recursion1.cpp | //for recursion deifne the recursion in the functions term
#include <iostream>
#include <bitset>
using namespace std;
//function for factorial
long long int factorial(int n){
//base case
if(n==0)
return 1;
return n*factorial(n-1);
}
//fn to find power of number
int power(int base,int pow){
... | ALGO | 0.999699 | 5.045396 |
88857368-06be-4fc3-8f7a-fb85420b7cd3 | alexandraback/datacollection | solutions_5709773144064000_0/C++/yannis/codejam_b.cpp | #include <stdio.h>
#include <stdlib.h>
#define eps 1e-7
int main(void) {
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
long double c, f, x;
long double rate, ans;
int T, t;
scanf("%d", &T);
for (t=1; t<=T; t++) {
rate = 2;
ans = 0;
scanf("%L... | ALGO | 0.999617 | 3.2973 |
80c42b9c-5c81-4694-be02-a52c7c72a8c9 | azizur-rahaman/Problem-solving-with-c-plus-plus | cpp practice/algorithms/recurson/print_n_1_bactracking.cpp | #include<bits/stdc++.h>
using namespace std;
void print_n_to_1_using_bactracking(int i, int n){
if(i>n) return;
print_n_to_1_using_bactracking(i+1, 5);
cout<<i<<endl;
}
int main(){
print_n_to_1_using_bactracking(1,5);
}
| ALGO | 0.998684 | 3.413666 |
dfdc9039-4417-4608-9b3c-ad0f3b47ec9f | hoonably/sorting-project | test_algo/main.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <chrono>
#include <iomanip>
#include <cmath>
// #include PLACEHOLDER
std::vector<int> read_input(const std::string& filename) {
std::vector<int> data;
std::ifstream infile(filename);
int num;
while (infile >> num) data.... | ALGO | 0.999224 | 5.617692 |
5ee3d0fb-9b8c-41c7-a01c-3f3f016be1af | maksonchik20/Codeforces | Codeforces Round 960 (Div. 2)/c.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/rope>
using namespace std;
using namespace __gnu_pbds;
using namespace __gnu_cxx;
#define all(x) x.begin(), x.end()
#define for0(i, n) for (ll i = 0; i < (n); ++i)
#define for1(i, n) for (ll i = 1; i < (n); ++i)
#define rfor0(i, n) fo... | ALGO | 0.999928 | 4.665754 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.