uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
944bf475-6458-4b30-b5d4-eb65ab984054 | Santanujana2001/My-Leetcode-Solutions | 2274-maximum-consecutive-floors-without-special-floors/2274-maximum-consecutive-floors-without-special-floors.cpp | class Solution {
public:
int maxConsecutive(int bottom, int top, vector<int>& special) {
sort(special.begin(),special.end());
int m = special.front()-bottom;
for(int i=1;i<special.size();i++){
m=max(m,special[i]-special[i-1]-1);
}
return max(m,top-special.back());... | ALGO | 0.999824 | 5.458413 |
b4eb2ec2-2f85-4420-886e-4b30c5dfb8ec | Adarshsingh2k/codeforces- | A. number of Apartments.cpp | /*
A. Number of Apartments
time limit per test1 second
memory limit per test256 megabytes
inputstandard input
outputstandard output
Recently a new building with a new layout was constructed in Monocarp's hometown. According to this new layout, the ... | ALGO | 0.999865 | 4.388288 |
b44bbeb7-1c4a-459e-8895-02e8c26fcce5 | kidclone3/CP | olp/week3/fct022_robots.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#pragma GCC optimize("O3,unroll-loops")
#define pb push_back
#define vi vector<int>
#define vl vector<long long>
#define vb vector<bool>
#define ll long long
#define ... | ALGO | 0.999907 | 3.529149 |
82799884-e422-4ac3-bc52-a28d9c312d5f | Jazzcharles/ACM-ICPC-Code | shuoj/1165/1165.cpp | #include <bits/stdc++.h>
using namespace std;
#define XINF INT_MAX
#define INF 0x3FFFFFFF
#define EPS 1e-8
#define MP(X,Y) make_pair(X,Y)
#define PB(X) push_back(X)
#define REP(X,N) for(int X=0;X<N;X++)
#define REP2(X,L,R) for(int X=L;X<=R;X++)
#define DEP(X,R,L) for(int X=R;X>=L;X--)
#define CLR(A,X) memset(A,X,sizeof... | ALGO | 0.999803 | 3.527247 |
e477d92a-b515-4609-a6d9-3c630d030c5a | ShanoToni/PhysicsAnimation | Task1.cpp | #if 0
#include "Particle.h"
#include "Application.h"
#include "Shader.h"
#include <random>
// Std. Includes
#include <string>
#include <time.h>
#include <array>
// Other Libs
#include "SOIL2/SOIL2.h"
/*
Vectors and Arrays
*/
glm::vec3 cpoint = glm::vec3(-6.0f, 0.0f, -6.0f);
glm::vec3 size = glm::vec3(12.0f, 12.0f, ... | ALGO | 0.960129 | 5.110471 |
71c75037-0984-4807-ad83-5e60ef0e7fab | chl218/Underwater-Acoustic-Detection | src/hw_soln/peaks.cpp | #include "peaks.h"
void peaks(DSTREAM_FLO &samples,
DSTREAM_FLO &litude,
DSTREAM_INT &locations) {
DTYPE_FLO shift_buf[3] = {0};
#pragma HLS ARRAY_PARTITION variable=shift_buf complete dim=1
Local_Maxima: for(int i = 0; i < SIZE; i++) {
#pragma HLS PIPELINE II=1
shift_buf[2] = shift_buf[1];
shift... | ALGO | 0.998853 | 3.603023 |
60ab1ec2-62e5-4737-bb2b-c7800f395367 | 5ko99/FMI-Semester-6 | check/exam2-2021-05-29/82161.cpp | //
// СУ "Св. Климент Охридски"
// Факултет по математика и информатика
// Курс Обектно-ориентирано програмиране 2020/21
// Контролно 2
//
// Име: Панайот Маринов
// ФН: 82161
// Специалност: Компютърни науки
// Курс: Първи
// Административна група: Втора
// Ден, в който се явявате на контролното: 29.05.2021
// Нача... | TOOL | 0.885136 | 4.44371 |
37752460-ffa6-43f8-9f18-6979a9e31c39 | Nikhil-251/Code | 1007-minimum-domino-rotations-for-equal-row/1007-minimum-domino-rotations-for-equal-row.cpp | class Solution {
public:
int minDominoRotations(vector<int>& tops, vector<int>& bottoms) {
int n = tops.size();
map<int,int> arr1;
map<int,int> arr2;
map<int,int> dup;
for(int i=0;i<n;i++){
arr1[tops[i]]++;
arr2[bottoms[i]]++;
if(tops[i]==b... | ALGO | 0.999979 | 6.088744 |
0e08654c-4421-430c-8963-596ec6e4ebab | JrSousaJ/Uri-Solved-Problems | 1944.cpp | #include<bits/stdc++.h>
using namespace std;
int siz=0;
struct st
{
int id;
string ss;
};
struct no
{
int n;
struct no *prox;
};
struct pilha
{
struct no *topo;
};
void create(pilha *s)
{
s->topo=NULL;
}
void push(pilha *s,int d)
{
siz++;
struct no *aux;
aux=(struct no*)malloc(size... | ALGO | 0.999632 | 3.42864 |
9056ca7d-fffc-425b-817f-5cbe594bb038 | Fudore/Module17 | Module17/Module17.cpp |
#include <cmath>
#include <iostream>
class Vector
{
public:
Vector():x2(), y2(), z2()
{}
Vector(double a, double b, double c) : x2(a), y2(b), z2(c)
{
}
void Show()
{
std::cin >> x2 >> y2 >> z2; //вводим координаты для второй точки
std::cout << '\n' << x1 << ' ' << y1 << ' ' << z1; //выводим координаты... | ALGO | 0.998526 | 3.935353 |
733c4f22-7989-4129-9185-0ad38508ae85 | Vaibhav0911/LeetCode | 0022-generate-parentheses/0022-generate-parentheses.cpp | class Solution {
public:
vector<string> generateParenthesis(int n) {
vector<string> ans;
ans.push_back("()");
for(int i=2 ; i<=n ; i++){
set<string> temp;
for(auto str : ans){
for(int j=0 ; j<=str.length() ; j++){
string te... | ALGO | 0.9989 | 6.208779 |
301d573d-ae22-4440-8623-1ec60bf113f6 | ejohntemperatura/wordPuz | 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.998733 | 6.76775 |
69776a80-f0cf-4e86-8511-1835a1db3075 | MOHDDANISH007/Question1 | Maximum_Area_of_Longest_Diagonal_Rectangle.cpp | class Solution {
public:
int areaOfMaxDiagonal(vector<vector<int>>& dimensions) {
int area = 0;
int max_diagonal = 0;
for(auto it: dimensions) {
int t = it[0] * it[0] + it[1] * it[1];
if(t > max_diagonal || (t == max_diagonal && it[0] * it[1] > area)) {
... | ALGO | 0.999267 | 5.747704 |
a01f14e8-cd28-457f-a869-534be85b53b6 | GustavoMacrini/estudos | C++/exercicios/Lista1/exercicio02.cpp | #include <iostream>
using namespace std;
int main(){
float altura, menor_altura, maior_altura, altura_f, media_f;
int i, j, num_m;
char sexo;
for(i = j = num_m = 0 ; i < 50; ++i){
cout << "Digite uma altura: ";
cin >> altura;
cout << "Digite o sexo[M,F]: ";
cin >> sex... | ALGO | 0.994541 | 3.425996 |
ea1f2f35-fa31-4459-95eb-24a16f9de527 | MajkutP/CPP-Third-semester | 5.ClassFraction/Fraction.cpp | #include "Fraction.h"
Fraction::Fraction(const int x, const int y){
licznik = x;
mianownik = y;
}
void Fraction::Print(){
int calkowita = licznik/mianownik;
if(calkowita == 0) std::cout<<licznik<<"/"<<mianownik;
else std::cout<< calkowita<<" "<<licznik%mianownik<<"/"<<mianownik;
std::cout<<"\n";
}
Fraction Fra... | TOOL | 0.946029 | 4.691851 |
42310cfc-9121-4349-90f2-7a3e3573b757 | LaiLaK918/OOP | Thuc_hanh/Sort-Algorithm/DSA/dup.cpp | #include<iostream>
using namespace std;
struct node {
int data;
node* left;
node* right;
};
node* insert(node* t, int x) {
if (t == NULL) {
node* temp = new node;
temp->data = x;
temp->left = NULL;
temp->right = NULL;
return temp;
}
else {
if (x < t->data) {
t->left = insert(t->left, x);
}
el... | ALGO | 0.999959 | 5.411949 |
238c0f0a-9aca-4fa3-ada3-b46f4daa07f6 | hongwueryi/opencv | opencv/samples/dnn/person_reid.cpp | #include <opencv2/imgproc.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/dnn.hpp>
using namespace cv;
using namespace cv::dnn;
const char* keys =
"{help h | | show help message}"
"{model m | | network model}"
"{query_list q | | list of query images}"
"{galle... | DATA | 0.931813 | 6.504936 |
b07d865d-9c12-4fcf-b876-a1d77d2b6e4f | virtyaluk/leetcode | problems/1716/solution.cpp | class Solution {
public:
int totalMoney(int n) {
int ans = 0;
for (int i = 0; i < n; i++) {
cout << i % 7 << endl;
ans += (i / 7) + 1 + (i % 7);
}
return ans;
}
}; | ALGO | 0.999321 | 4.032933 |
25c5a284-86b8-4c71-8e71-0f9f8cd7752e | loggerJK/BOJ | Recursion/5639.cpp | #include <iostream>
#include <vector>
#include <cassert>
using namespace std;
vector<int> vec;
void recursionSearch(int start, int end)
{
// 인덱싱을 이용한 종료 조건
int size = 0;
size = (start - end) + 1;
if (size <= 0)
return;
// 루트만 존재하는 경우
if (size == 1)
{
assert(start == end);
... | ALGO | 0.999987 | 5.125199 |
b0682a9c-33d3-403d-86c4-1fefbd15325e | hybridSMT/hybridSMT | source_code/src/tactic/bv/bvarray2uf_tactic.cpp | #include "tactic/tactical.h"
#include "ast/bv_decl_plugin.h"
#include "ast/rewriter/expr_replacer.h"
#include "tactic/generic_model_converter.h"
#include "ast/ast_smt2_pp.h"
#include "tactic/bv/bvarray2uf_tactic.h"
#include "tactic/bv/bvarray2uf_rewriter.h"
class bvarray2uf_tactic : public tactic {
struct imp {
... | TOOL | 0.855987 | 6.882412 |
cf4b1295-2587-440e-815e-eead95799249 | kuantingchen04/model-fitting-solvers | thirdparty/eigen/bench/sparse_setter.cpp |
//g++ -O3 -g0 -DNDEBUG sparse_product.cpp -I.. -I/home/gael/Coding/LinearAlgebra/mtl4/ -DDENSITY=0.005 -DSIZE=10000 && ./a.out
//g++ -O3 -g0 -DNDEBUG sparse_product.cpp -I.. -I/home/gael/Coding/LinearAlgebra/mtl4/ -DDENSITY=0.05 -DSIZE=2000 && ./a.out
// -DNOGMM -DNOMTL -DCSPARSE
// -I /home/gael/Coding/LinearAlgebr... | ALGO | 0.986332 | 4.145121 |
4d415197-cc5c-48fb-8d39-1a0f10427383 | anwar-arif/acm-code | spoj/COU - Counter-Smack.cpp | #include <cassert>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <sstream>
#include <iomanip>
#include <string>
#include <vector>
#include <deque>
#include <list>
#include <set>
#include <map>
#include <bitset>
#include <stack>
#include <queue>
#... | ALGO | 0.999798 | 3.929451 |
1d5ded2c-5a21-4a02-961c-4aa3795ac0bc | martapereira0/DAA | Preparação_Testes/Preparação-Teste1/DAA011.cpp | #include <iostream>
#include <algorithm>
using namespace std;
bool avaliar(int value,int arr[], int N,int k){
int c = 0; // contar o nº de partções necessárias
int soma = 0; //somar nºs para definir cada partição
for(int i=0;i<N;i++){
soma = soma + arr[i];
if(arr[i] > value) return fa... | ALGO | 0.999928 | 3.793263 |
e06b3cd7-9aa9-490d-9690-432a770b1d93 | japerry911/Algorithms_and_Data_Structures | Coding_Questions/C++/SmallestDifference.cpp | // ---Smallest Difference---
#include <vector>
int calculate_difference(int num1, int num2) {
return abs(num1 - num2);
}
std::vector<int> smallest_difference(std::vector<int> array1, std::vector<int> array2) {
std::sort(array1.begin(), array1.end());
std::sort(array2.begin(), array2.end());
int poin... | ALGO | 0.999978 | 5.576811 |
5eb04a3e-0a29-4cab-8329-d4dd2326d27b | soheil647/SystemC_SystemC-AMS_Projects | systemc-2.3.3/examples/sysc/fir/fir_fsm.cpp | /*****************************************************************************
fir_fsm.cpp --
Original Author: Rocco Jonack, Synopsys, Inc.
*****************************************************************************/
/*****************************************************************************
MODI... | TOOL | 0.912327 | 5.009658 |
bd40b4be-d863-4dcb-9ca0-5fa2e13818f7 | raincross7/code-similarity | codes/train_code/problem476/problem476_398.cpp | #include<iostream>
#include<string>
#include<vector>
#include<cmath>
#include<algorithm>
#include<map>
using namespace std;
// 2 で割り切れる回数を返す
int f(int x) {
int res = 0;
while (x % 2 == 0) {
x /= 2;
res++;
}
return res;
}
// 最大公約数を返す
long long gcd(long long a, long long b) {
if (b == 0) {
return a;
}
ret... | ALGO | 0.999999 | 4.144943 |
c3620540-9902-4796-8771-bb32036e47be | Nidhi2215/HOME_sankalpana | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998859 | 6.785645 |
95b5997e-d153-4033-a69b-ead21f70337c | fengxiaohu/jzoffer | test07/ConstructBinaryTree.cpp | //==================================================================
// 《剑指Offer——名企面试官精讲典型编程题》代码
// 作者:何海涛
//==================================================================
#include <exception>
#include <cstdio>
struct BinaryTreeNode
{
int m_nValue;
BinaryTreeNode* m_pLeft;
... | ALGO | 0.998802 | 5.048476 |
247555e2-2f17-4e80-abd7-58bbd706d802 | Leaves333/leetcode | cpp/104_maximum_depth_of_binary_tree.cpp | #include <bits/stdc++.h>
using namespace std;
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode() : val(0), left(nullptr), right(nullptr) {}
TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), left(left), right... | ALGO | 0.999636 | 6.325857 |
354189ae-b15b-4cdc-8dae-b5a1cb4f4a22 | inikep/lzbench | bwt/libbsc/libbsc/bwt/bwt.cpp | /*-----------------------------------------------------------*/
/* Block Sorting, Lossless Data Compression Library. */
/* Burrows Wheeler Transform */
/*-----------------------------------------------------------*/
#include <stdlib.h>
#include <memory.h>
#include "bwt.h"
#inc... | ALGO | 0.999711 | 7.335643 |
a15ad62d-8be3-408e-9e81-20ed836b90e4 | devangk20/CNSL | Simple Columnar Transposition Cipher.cpp | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
std::string removeSpaces(const std::string& text) {
std::string result;
for (char ch : text) {
if (ch != ' ') {
result += ch;
}
}
return result;
}
std::string encrypt(std::string text, std::string key) {
int keyLength = key.size();
int textLen... | ALGO | 0.999853 | 5.635395 |
2c01bedb-c2b9-44c5-93e3-2e145985f8b1 | ishandutta2007/codeforces | popovicirobert/normal/884/C.cpp | #include <bits/stdc++.h>
#define ll long long
#define lsb(x) (x & (-x))
using namespace std;
const int MAXN = (int) 1e5;
int p[MAXN + 1];
bool viz[MAXN + 1];
vector <int> v;
int main() {
//fstream cin("A.in");
//ofstream cout("A.out");
int i, n;
ios::sync_with_stdio(false);
cin >> n;
for(i ... | ALGO | 0.999924 | 3.339816 |
a2081bda-a1b7-4540-a3b1-1aa1eb1530ae | dzuizz/codeforces | A_Bear_and_Prime.cpp | #include <iostream>
using namespace std;
typedef long long ll;
int primes[15] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47};
int ind, cnt;
string s;
int main() {
while(ind++ < 15 && cnt < 2) {
int cur = primes[ind-1];
cout << cur << endl;
Loop:
cin >> s;
if... | ALGO | 0.999772 | 4.00824 |
cf084e6f-1565-4b79-b3d0-56d13cbaa918 | Jaymin4724/learning-dsa-striver | Step-3 Problems on Array/Array Easy/10_FindMissingNumBruteforce.cpp | #include <bits/stdc++.h>
using namespace std;
// TC : O(n^2)
// SC : O(1)
int missingNumber(vector<int> &a, int N)
{
for (int i = 1; i <= N; i++)
{
int flag = 0;
for (int j = 0; j < N - 1; j++)
{
if (a[j] == i)
{
flag = 1;
break;
... | ALGO | 0.999499 | 5.127019 |
847c37e5-f0de-48e8-b848-be72bfdcda38 | zszyellow/leetcode | Cpp/120_triangle/solution.cpp | class Solution {
public:
int minimumTotal(vector<vector<int>>& triangle) {
int n = triangle.size();
vector<int> minLen(triangle.back());
for (int layer = n-2; layer >= 0; layer --)
{
for (int i = 0; i <= layer; i ++)
{
minLen[i] = std::min(minL... | ALGO | 0.999975 | 6.246081 |
797fbea7-495d-43b9-b6a0-df24cec63d47 | akshaybaviskar/mlir | libcxx/test/std/containers/sequences/vector/vector.capacity/reserve.pass.cpp | // <vector>
// void reserve(size_type n);
#include <vector>
#include <cassert>
#include "test_macros.h"
#include "test_allocator.h"
#include "min_allocator.h"
#include "asan_testing.h"
int main(int, char**)
{
{
std::vector<int> v;
v.reserve(10);
assert(v.capacity() >= 10);
assert(... | TEST | 0.885929 | 7.034523 |
48ee1b1d-4707-4dbe-949d-7004459c0839 | badembed/OpenArkCompiler | src/mapleall/maple_me/src/me_ssa_update.cpp | #include "me_ssa_update.h"
// Create or update HSSA representation for variables given by *updateCands;
// for each variable, the mapped bb set gives the bbs that have newly inserted
// dassign's to the variable.
// If some assignments have been deleted, the current implementation does not
// delete useless phi's, and... | ALGO | 0.954748 | 5.988181 |
afc63b0a-2ab6-481c-996d-8a5ea3b04063 | waliulrayhan/cpp-Competitive-Programming | C++ Practice/268A_Games.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n, count=0;
cin>>n;
int h[n],a[n];
for (int i = 0; i < n; i++)
{
cin>>h[i]>>a[i];
}
for (int i = 0; i < n; i++)
{
for (int j = 0; j < n; j++)
{
if (i!=j and (h[i]==a[j]))
{
... | ALGO | 0.999788 | 3.253423 |
54282b99-1960-4547-aa21-03894a7552ce | Nakib-Arman/CSE318---ArtificialIntelligence | 4.DecisionTree/.history/decision_tree_20250705171631.cpp | #include<bits/stdc++.h>
using namespace std;
class Node {
string label;
unordered_map<string,Node*> children;
Node* parent;
public:
Node(string label){
this->label = label;
this->parent = NULL;
}
string getLabel(){
return label;
}
void setParent(Node* parent){... | ALGO | 0.998601 | 5.4953 |
32957710-a285-4d23-9346-be1111d8c7a2 | 2019Shun/atcoder_submission | ABC/abc095/arc096_a_6409926.cpp | #include <bits/stdc++.h>
#include <vector>
#include <numeric>
#define PI 3.14159265358979323846
#define MAXINF (1e18L)
#define INF (1e9L)
#define EPS (1e-9)
#define MOD ((ll)(1e9+7))
#define REP(i, n) for(int i=0;i<int(n);++i)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define RREP(i, n) for(int i=int(n)-1;i>=0;--i)
#... | ALGO | 0.99981 | 3.509405 |
f994f0b7-1c8f-4501-9ae3-6c559dc46bfc | tic40/atcoder | arc/arc068/d/main.cpp | #include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0;i<n;i++)
using ll = long long;
int n;
vector<int> a;
void solve() {
map<int,int> m;
REP(i,n) m[a[i]]++;
int cnt = 0;
for (auto v: m) cnt += v.second-1;
int ans = (cnt%2) ? n-(cnt+1) : n-cnt;
cout << ans << endl;
return;
}
int ... | ALGO | 0.999904 | 4.071233 |
1132955d-e990-4974-af82-3d42eece85c8 | deepin-community/scipy | scipy/special/special_wrappers.cpp | #include "special_wrappers.h"
#include "special.h"
#include "special/airy.h"
#include "special/amos.h"
#include "special/bessel.h"
#include "special/binom.h"
#include "special/expint.h"
#include "special/fresnel.h"
#include "special/gamma.h"
#include "special/hyp2f1.h"
#include "special/kelvin.h"
#include "special/lamb... | TOOL | 0.963474 | 5.48167 |
908205ef-27fe-4b53-b2bd-fc4917c70ea4 | mansilakhani/CPP | PROJECT/7)-Signer/2.cpp | // WAP to add two distance using binary plus(+) operator overloading . - Method-1
#include<iostream>
#include<string.h>
using namespace std;
class Distance
{
private :
int inches;
int feet;
public :
void setData()
{
cout <<"-> Enter feet : ";
cin >> this->feet;
cout <<"-> Enter inches : ";
... | ALGO | 0.977299 | 4.977108 |
d8af79d2-8b9d-44a5-8b17-20d40f8e9792 | SWMFsoftware/AMPS | srcSEP/shock_analytical_model.cpp | #include "sep.h"
//analytic model of a shock wave (Tenishev-2005-AIAA-4928
#if _PIC_COUPLER_MODE_ == _PIC_COUPLER_MODE__SWMF_
#include "../srcInterface/amps2swmf.h"
#endif
double SEP::ParticleSource::ShockWave::Tenishev2005::rShock =1.0E-5*_SUN__RADIUS_;
bool SEP::ParticleSource::ShockWave::Tenishev2005::InitFlag=fal... | ALGO | 0.998683 | 5.199699 |
4ee4407e-fc43-4b22-889f-fb219ae9d5b0 | likhithkanigolla/DSA-PREPARATION | C++/Striver-A2Z-Sheet/Step 1 - Learn the Basics/Step 1.4 - Maths/numberofdigits.cpp | // Logarithmic Approach
#include <cmath>
int countDigitsLogarithmic(int n) {
if (n == 0) return 1;
return floor(log10(n)) + 1;
}
// Iterative Division
int countDigitsIterative(int n) {
if (n == 0) return 1;
int count = 0;
while (n != 0) {
n /= 10;
count++;
}
return count;
}... | ALGO | 0.999298 | 6.848077 |
b348ed2b-ef36-4466-8bbd-1fd904c8969a | MOHDDANISH007/Question1 | Insert_An_Element_At_Its_Bottom_In_A_Given_Stack.cpp | #include <bits/stdc++.h>
#include <stack>
void solve(stack<int>& myStack, int x){
if(myStack.empty() == true){
myStack.push(x);
return;
}
int num = myStack.top();
myStack.pop();
solve(myStack, x); // Recursive call here
myStack.push(num);
return;
}
stack<int> pushAtBottom(s... | ALGO | 0.999971 | 5.559632 |
0c02a08c-81a8-48d5-b038-22d651290976 | ChaitanyDalvi06/chaitanyaD_SEM2_DSA | 13binarysearch.cpp | // Binary Search algorithm to search an element in an array
#include <iostream>
using namespace std;
int binarySearch(int arr[], int n, int a)
{
int l = 0, r = n - 1;
while (l <= r)
{
int m = l + (r - l) / 2;
if (arr[m] == a)
{
return m;
}
if (arr[m] < a)... | ALGO | 0.99989 | 6.476997 |
8a4200d5-618d-43ff-bbf6-42933f46deaf | cafenoctua/at-corder | full_exploration/B-KthCommonDivisor.cpp | #include <iostream>
using namespace std;
int main() {
int a, b, k;
cin >> a >> b >> k;
int min;
if (a > b) min = b;
else min = a;
if (min == 1) {
cout << 1 << endl;
return 0;
}
int c[100001] ;
int cnt = 0;
for (int i = min; i > 0; i--) {
if (a % i == 0 &&... | ALGO | 0.999976 | 3.849412 |
34d78cec-4baf-43f6-a030-e94f686c809b | Medic01/Distributed-computer-systems | Proces1.cpp | /*
Napisati program korištenjem C++ funkcija u kojem će jedan proces poslati vektor
od 100 elemenata svim ostalim procesima, nakon čega će svaki proces vratiti taj vektor
pošiljatelju, ali uvećan za N+1, gdje je N broj procesa.
*/
#include <iostream>
#include <vector>
#include <mpi.h>
using namespace std;
void send_... | ALGO | 0.999401 | 5.267016 |
d97bf03f-cfb5-4d16-824a-9f0772fe6c02 | rudrasingh001/week1-DSA-3-CipherSchools | LECTURE 25/lec_25.cpp | // Q1(root to leaf max sum)
bool isLeaf(TreeNode *root){
return (root!=NULL && root->left==NULL && root->right==NULL);
}
void maxSumPath(TreeNode* root, int sum,int &maxSum){
if(root==NULL) return;
sum+=root->val;
if(isLeaf(root)){
maxSum=max(maxSum,sum);
return ; //leaf node reached... | ALGO | 0.999971 | 5.328774 |
9b21ef8d-4ec9-419c-a658-ab7ede5911d1 | fgc/torcs_udacity | src/modules/track/trackutil.cpp | #include <stdlib.h>
#include <math.h>
#include <tgf.h>
#include <track.h>
#include <robottools.h>
void
TrackLocal2Global(tTrkLocPos *p, tdble *X, tdble *Y)
{
RtTrackLocal2Global(p, X, Y, TR_TORIGHT);
}
void
TrackGlobal2Local(tTrackSeg *segment, tdble X, tdble Y, tTrkLocPos *p, int type)
{
RtTrackGlobal2Loca... | ALGO | 0.999304 | 4.837461 |
0bdcc102-561d-4b5b-aefb-f4eaa0049868 | DushyantBhardwaj07/CodeForces-DSA | A_Guess_the_Maximum.cpp | #include<bits/stdc++.h>
using namespace std;
#define yes "YES"
#define no "NO"
#define ll long long
#define mod 1000000007
void display(vector<ll>v){ for(ll i=0;i<v.size();i++) cout<<v[i]<<' ';cout<<endl;}
void display2d(vector<vector<ll>> v){for(ll i=0;i<v.size();i++){for(ll j=0;j<v[i].size();j++){cout<<v[i][j]<<' ';}... | ALGO | 0.99959 | 4.394764 |
eca71762-e477-4f49-971a-839cfb726202 | samuel21119/Cpp | Zero Judge/a010.cpp | #include <iostream>
#include <cstdlib>
#include <cstring>
#include <cmath>
using namespace std;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
int input, _input, count;
bool if_first_print, print, find;
while (cin >> input) {
count = 0;
if_first_print = true;
print = true;... | ALGO | 0.999939 | 3.678864 |
f552f91f-847a-42dd-9b2b-2685b50aea40 | m4oughi/100DaysofCode | pureCPP/0039. Day 39/STL Algorithms/059. Numeric Algorithms - transform_reduce/010. Using State in the Transformation/main.cpp | #include <iostream>
#include <numeric>
#include <vector>
int main() {
std::vector<int> nums{1, 2, 3, 4, 5};
int factor = 3;
int result = std::transform_reduce(nums.begin(), nums.end(), 0, std::plus<>(), [factor](int n) {
return n * factor;
});
std::cout << "Result with factor: " << result... | ALGO | 0.999835 | 5.765659 |
4667127a-367e-4ce6-982e-5ae4fa9dfa91 | RahulScripted/DSA | Vector/PrintOddIndexElement.cpp | // Write a C++ program to print all odd index element
#include<iostream>
#include<vector>
using namespace std;
int main(){
int size;
cout<<"Enter the size of the array : ";
cin>>size;
vector<int>arr;
cout<<"Give input : ";
for(int i = 0;i < size;i++){
int x;
cin>>x;
arr.... | ALGO | 0.985496 | 4.704065 |
0eaac199-42bf-4d66-b11e-a802df08bca0 | ishandutta2007/codeforces | intothenight/normal/1621/G.cpp | #include <bits/stdc++.h>
using namespace std;
#if __cplusplus > 201703L
#include <ranges>
using namespace numbers;
#endif
template<typename T>
struct modular_base{
using Type = typename decay<decltype(T::value)>::type;
static vector<Type> _MOD_INV;
constexpr modular_base(): value(){ }
template<typename U> modular_... | ALGO | 0.999979 | 5.111928 |
b445a96f-b568-4695-945b-e18670115fac | luciocf/CP-Problems | Seletiva IOI/Seletiva 2018/comida.cpp | // Seletiva IOI 2018 - Competição de Comida
// Lúcio Cardoso
// Sadly there's no OJ to submit it yet, so it's untested for now :(
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 1e5+10;
const ll inf = 1e18+10;
int n;
int a[maxn], soma[maxn];
ll tree[4*maxn], tree2[4*maxn], la... | ALGO | 0.99995 | 3.802585 |
f95eb343-80da-481d-847e-fc2224b14ee4 | toufu-24/AtCoder | ABC/ABC343/A.cpp | #include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
#define all(v) v.begin(), v.end()
#define SORT(v) sort(v.begin(), v.end())
#define RSORT(v) sort(v.rbegin(), v.rend())
#define REVERSE(v) reverse(v.begin(), v.end())
#define ll int64_t
#define ld long double
int main()
{
... | ALGO | 0.999538 | 4.311145 |
3c05f24b-c5eb-49eb-bfe0-9237a12253a5 | b202001162/DSA | Tree/Check two binary trees are Identical or not.cpp | class Solution
{
public:
//Function to check if two trees are identical.
bool isIdentical(Node *r1, Node *r2)
{
//Your Code here
// if both are NULLs then it is okey
if(r1 == NULL && r2 == NULL) return 1;
// if any one is NULL, then also there not identical
else... | ALGO | 0.999928 | 6.17232 |
0c4b7542-8699-41bb-8ec3-8e6f1b095692 | emelyantsev/cpp20_get_the_details | 02_StandardLibrary/230_safeComparison2/safeComparison2.cpp | #include <iostream>
#include <utility>
int main()
{
double x = -3.5;
unsigned int y = 7;
// std::cout << "-3.5 < 7: " << std::cmp_less( x, y ) << '\n'; // Error
} | ALGO | 0.972636 | 3.30059 |
41787b00-072f-4cb6-befc-73d6f4db3479 | RyotaroAbe45123/cpp-sandbox | workspace/2/ABC/ABC277/a.cpp | #include <iostream>
using namespace std;
int main() {
int N, X;
cin >> N >> X;
for (int i = 1; i <= N; ++i) {
int x;
cin >> x;
if (x == X) {
cout << i << endl;
}
}
} | ALGO | 0.999836 | 4.443239 |
b1328a53-b5e0-4604-89e3-0596e1fbda96 | acnokego/LeetCode | 735_Asteroid_Collision/stack.cpp | class Solution {
public:
/*
* Complexity: O(n)
* Space: O(n)
*/
vector<int> asteroidCollision(vector<int>& asteroids) {
vector<int>ans;
vector<int>right; // the asteroids go right
for(int i = 0; i < asteroids.size(); ++i){
if(asteroids[i] > 0){
... | ALGO | 0.999984 | 5.838131 |
8df2e2dc-889f-492f-8793-9ed9627be529 | Thrinaria/Codebase | boost_1_34_1/boost_1_34_1/libs/graph/test/astar_search_test.cpp | #include <boost/graph/astar_search.hpp>
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/random.hpp>
#include <boost/random.hpp>
#include <vector>
#include <list>
#include <iostream>
#include <math.h> // for sqrt
#include <time.h>
using namespace boost;
using namespace std;
// auxiliary types
struct... | ALGO | 0.999873 | 5.90612 |
39ad0c89-fe9a-40e2-b240-9bcc7f39a87e | PushpamSingh/DSA-Problems | tree/ConstructAtreefrominorderpreorder.cpp | class Solution {
public:
int findPos(vector<int>& in, int n, int ele){
for(int i=0; i<n; i++){
if(in[i]==ele){
return i;
}
}
return -1;
}
Node* solve(vector<int> &in, vector<int> &pre, int &index, int inorderStart, int inorderEnd, int n){
if(... | ALGO | 0.999989 | 6.474442 |
acedd9da-3cdb-4fad-afc4-5df324bfbead | Scoots1215/GDEV41-RayLib | Physics_demo.cpp | #include <raylib.h>
#include <raymath.h>
#include <iostream>
const int WINDOW_WIDTH = 800;
const int WINDOW_HEIGHT = 600;
const int numberOfCircles = 2;
const float FPS = 60;
const float TIMESTEP = 1 / FPS; // Sets the timestep to 1 / FPS. But timestep can be any very small value.
const float FRICTION = 0.5;
struct B... | ALGO | 0.99702 | 5.335291 |
ffe28c61-1b25-4092-8f8a-df9b025e998a | sebas411/lab2_paralela | clasificador_par_ini.cpp | #include <iostream>
#include <fstream>
#include <string>
#include <unistd.h>
#include <time.h>
#include <omp.h>
#define N 10000000
#define MAX 100000000
#define THREAD_NUM 4
using namespace std;
void par_qsort(int *data, int lo, int hi, int recursion_num=0) {
if(lo > hi) return;
int l = lo;
int h = hi;
int p ... | ALGO | 0.999851 | 3.885345 |
feb06bea-60b8-49d5-aa66-2cef229059b2 | axelu/leetcode | cpp/03000-03499/shortestsubarraywithoratleastkii.cpp |
// 3097. Shortest Subarray With OR at Least K II
// https://leetcode.com/problems/shortest-subarray-with-or-at-least-k-ii/
class Solution {
public:
int minimumSubarrayLength(vector<int>& nums, int k) {
int n = nums.size();
int ans = INT_MAX;
// sliding window
int cnt[30];memset(c... | ALGO | 0.9999 | 6.066502 |
e5a18df9-b0d8-462a-853d-b56da8110d1e | danatzmi/Animation-Assignment1 | igl/marching_tets.cpp | #include "marching_tets.h"
#include <unordered_map>
#include <vector>
#include <utility>
#include <cstdint>
#include <iostream>
template <typename DerivedTV,
typename DerivedTT,
typename DerivedS,
typename DerivedSV,
typename DerivedSF,
typename DerivedJ,
ty... | ALGO | 0.998812 | 6.191436 |
9c67530f-409c-4cf7-87c6-34ee77d08171 | SupetZYK/PointPairFeature | src/PPFFeature.cpp | #include "PPFFeature.h"
using namespace zyk;
zyk::PPF_Space::PPF_Space()
{
}
zyk::PPF_Space::~PPF_Space()
{
for (int32_t i = 0; i < ppf_box_vector.size();i++)
if (ppf_box_vector[i] != NULL) delete ppf_box_vector[i];
}
bool zyk::PPF_Space::init(pcl::PointCloud<PointType>::Ptr pointcloud, pcl::PointCloud<Normal>::Pt... | ALGO | 0.998774 | 3.45113 |
39414482-ea96-4f98-a272-db765eaef809 | yzu1103309/OpenCV-HW | s1103309_HW1.cpp | #include <opencv2/opencv.hpp>
#include <vector>
#include <iostream>
using namespace std;
using namespace cv;
int main(int argc, char * argv[] )
{
Mat img = imread(argv[1]), grayScaled, whiteOnly;
cvtColor(img, grayScaled, COLOR_BGR2GRAY);
threshold(grayScaled, whiteOnly, 250 , 255, THRESH_BINARY);
vect... | ALGO | 0.944376 | 5.450706 |
e704de9d-916f-4caa-bd92-8d7041b13527 | linneszyx/CP-Problems | Easy/Remove Duplicates/remove-duplicates.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function template for C++
class Solution{
public:
string removeDups(string s)
{unordered_map<char,int>mp;
string ans="";
for(int i=0;i<s.length();i++)
{
mp[s[i]]++;
i... | ALGO | 0.999868 | 6.393956 |
a2fc4669-2c36-4450-8d52-bb4ac1f4a46f | Kulezi/oi | xv/etap3/dzien2/sta/sta97.cpp | // Rozwiązanie do zadania 'Stacja' z III etapu XV OI.
// Autor rozwiązania: Paweł Putra
// Złożoność czasowa: O(n)
// Złożoność pamięciowa: O(n)
// Punkty: 97 (upsolve)
#include <bits/stdc++.h>
using namespace std;
constexpr int MAXN = 1'000'005;
vector<int> g[MAXN];
int sub[MAXN], d[MAXN];
void dfs(int v) {
sub[v]... | ALGO | 0.999675 | 4.737938 |
3d2c9b37-8178-4ded-a0a1-3665df3a4a78 | lclutz/Levenshtein-Distance | src/main.cpp | // Calculates the edit distance (through deletions, insertions and substitutions
// of characters) to get from a to b.
size_t levenshteinDistance(std::string_view a, std::string_view b)
{
std::vector<std::vector<size_t>> table(
b.size() + 1, std::vector<size_t>(a.size() + 1, 0));
for (size_t i = 1; i <... | ALGO | 0.99208 | 6.969654 |
b5f9d5b7-d625-4693-8d48-fdfc561424c4 | thomascvitale/herbsters | src/bloom.cpp | #include "bloom.h"
#include "primitives/transaction.h"
#include "hash.h"
#include "script/script.h"
#include "script/standard.h"
#include "random.h"
#include "streams.h"
#include <math.h>
#include <stdlib.h>
#define LN2SQUARED 0.4804530139182014246671025263266649717305529515945455
#define LN2 0.693147180559945309417... | ALGO | 0.951943 | 7.139627 |
7e6ff918-ace9-476c-a5ec-1a48c16f99e3 | sandip9593/DSA_With_CPP | DSA-C++/product_0f_array.cpp |
#include<iostream>
#include<vector>
using namespace std;
class Solution {
public:
vector<int> productExceptSelf(vector<int>& nums) {
int n = nums.size() ;
vector <int> answer (n,1) ;
int l_product = 1 ;
for (int i = 0 ; i <n ; i++ ){
answer [i] = l_product... | ALGO | 0.999976 | 5.677104 |
2bbcfea5-0fa7-45ee-8eb9-596bd0aefff4 | MustafizSaadi/pibt | src/solver/solver.cpp | /*
* solver.cpp
*
* Purpose: utility of solver class
* Created by: Keisuke Okumura <<EMAIL>>
*/
#include "solver.h"
#include <random>
#include "../util/util.h"
#include <typeinfo>
#include<bits/stdc++.h>
Solver::Solver(Problem* _P) : P(_P) {
std::random_device seed_gen;
MT = new std::mt19937(seed_gen());
i... | ALGO | 0.999625 | 4.251724 |
7b228a57-16c9-4cee-8368-8d43afe2826c | sa-satakshi/Cpp | SortAlgorithm.cpp | #include <iostream>
#include <algorithm>
#include<string>
using namespace std;
//for string in decreasing order
bool compareStrings(const string &a, const string &b) {
return a > b;
}
void quickSort(string arr[], int n){
sort(arr, arr + n, compareStrings);
}
int main() {
int n;
cout << "Enter the number... | ALGO | 0.999863 | 5.640301 |
75f5be4f-5ce5-46ed-818e-11e046f3f716 | lfortran/lfortran | src/libasr/pass/do_loops.cpp | #include <libasr/asr.h>
#include <libasr/containers.h>
#include <libasr/exception.h>
#include <libasr/asr_utils.h>
#include <libasr/asr_verify.h>
#include <libasr/pass/replace_do_loops.h>
#include <libasr/pass/stmt_walk_visitor.h>
#include <libasr/pass/pass_utils.h>
namespace LCompilers {
using ASR::down_cast;
using ... | TOOL | 0.866907 | 7.892497 |
db90adf4-55e4-4987-83fe-9ae252a43e7d | muhammadahmadazhar/my-whole-programing | c++ programs/structured c++/184 nested loop/5 45 345 2345 12345/main.cpp | #include <iostream>
using namespace std;
int main()
{
int x,y;
x=5;
while(x>=1)
{
y=x;
while(y<=5)
{
cout<<y;
y++;
}
x--;
cout<<endl;
}
return 0;
}
| ALGO | 0.999666 | 3.146023 |
f306205d-87bb-47c3-9ca7-dde3d54e891a | LostSunset/nextfoam-cfd-202407 | ThirdParty-2407/sources/cgal/CGAL-4.14.3/demo/CGAL_ipelets/alpha_shapes.cpp | #include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/CGAL_Ipelet_base.h>
#include <CGAL/Regular_triangulation_2.h>
#include <CGAL/Constrained_Delaunay_triangulation_2.h>
#include <CGAL/Delaunay_triangulation_2.h>
#include <CGAL/Alpha_shape_2.h>
#include <CGAL/Alpha_shape_face_base_2.h>
#inclu... | ALGO | 0.998291 | 6.800084 |
5274a4ab-2498-430d-bb05-3a81656cc3bd | shivammishra2004/Competitive_Programming_CPP | encrypt.cpp | #include <bits/stdc++.h>
using namespace std;
int binarySearch(const std::vector<char>& arr, char key) {
int left = 0;
int right = arr.size() - 1;
while (left <= right) {
int mid = left + (right - left) / 2;
if (arr[mid] == key) {
return mid;
} else if (arr[mid] < key... | ALGO | 0.999986 | 5.000623 |
327b6b0e-1282-459b-872f-38a481b600fc | cormoran/CompetitiveProgramming | src/contest/codeforces/337div2/B/main.comp.cpp | // codeforces-337div2-B / 2015-12-27
#include<iostream>
#include<vector>
#include<cassert>
#include<string>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<stack>
#include<queue>
#include<set>
#include<map>
#include<tuple>
using namespace std;
typedef long long ll;
typedef pair<ll,ll>... | ALGO | 0.999887 | 3.608797 |
98e9d591-fca2-4df7-9c25-8504f121f131 | Armawill/evernote_clone | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998859 | 6.785645 |
8a2ae96e-b0fb-4065-bf75-5608a35830a2 | haseebulamin/Data-Structures-Algorithms | Find_max_in_array.cpp | // Programme of array to take five numbers from user and and find maximum
#include<iostream>
using namespace std;
int main()
{
int a[5];
cout<<"Enter the element of array: "<<endl;
for(int i=0; i<5; i++)
{
cin>>a[i];
}
cout<<"Element of array are: "<<endl;
for(int i=0; i<5; i++)
{
... | ALGO | 0.998076 | 3.159225 |
d534ca41-997d-4f94-9de7-8676ade1780d | priyamshankar/100daysOfCode | day31/generateParantheses.cpp | class Solution {
public:
void rec(vector<string> &ans, int n, int left, int right,string temp){
if(left==n && right==n){
ans.push_back(temp);
return;
}
if(left>n || right >n)return;
string temp1=temp;
if(left>right){
temp+=')';
... | ALGO | 0.999869 | 5.973553 |
482128a5-a371-4562-bf84-2fc9766de0a1 | offamitkumar/UVA--Online-Judge | Solution/Problem_000572/572 Oil Deposits.cpp | #include <bits/stdc++.h>
using namespace std;
#define int int64_t
vector<string>graph;
const int DSIZE = 8;
array<int,8>X{-1,-1,-1,0,0 ,1,1,1};
array<int,8>Y{-1, 0, 1,1,-1,1,-1,0};
bool check(int i , int j){
if(i < 0 || j<0 || i>=graph.size() || j>= graph.at(i).size() || graph[i][j]=='*' || graph[i][j]=='$'){
... | ALGO | 0.999718 | 4.3171 |
6771fcaa-c68b-4148-a4f6-32d3b664b255 | raincross7/code-similarity | codes/train_code/problem180/problem180_180.cpp | #include <iostream>
using namespace std;
int main()
{
int a;
int b;
int c;
cin >> a >> b >> c;
if (a <= 500 && a >= 1 && b <= 500 && b >= 1){
if (c <= 1000){
if (a + b >= c){
cout << "Yes";
}else{
cout << "No";
}
}
}
return 0;
}
| ALGO | 0.999698 | 3.498456 |
2e0758a1-b7e8-4764-99de-f65ec2206fec | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_1158_11.cpp | #include <bits/stdc++.h>
using namespace std;
int n, m, k;
vector<int> g[250010];
int dep[250010], fa[250010];
int isleaf[250010];
void dfs(int now, int f) {
fa[now] = f;
dep[now] = dep[f] + 1;
isleaf[now] = 1;
for (int i = 0; i < g[now].size(); i++) {
if (dep[g[now][i]]) continue;
dfs(g[now][i], now);
... | ALGO | 0.999909 | 3.773957 |
9fe65620-0f9a-4e30-a25f-cc8c63d0b896 | Aaron617/AgentGen | src/utils/VAL/src/dynaMain.cpp | #include <cstdio>
#include <iostream>
#include <fstream>
#include "ptree.h"
#include <FlexLexer.h>
#include "instantiation.h"
#include "SimpleEval.h"
#include "DebugWriteController.h"
#include "typecheck.h"
#include "TIM.h"
#include "graphconstruct.h"
#include "SearchSpace.h"
#include "PartialPlan.h"
using std::ifstr... | ALGO | 0.86999 | 3.361668 |
dfb13820-107e-4c50-b2e2-8315548ef111 | AnnYN/cmake-build-debug | p94.cpp | //
// Created by Ya Nan on 2018/5/28.
//
//change the first word to all uppercase
#include <iostream>
#include <string>
using namespace std;
int main(){
string s("hellow world!");
for (decltype(s.size()) index =0;
index !=s.size() && !isspace(s[index]);++index)
s[index] = toupper(s[index]);
co... | ALGO | 0.920672 | 3.730821 |
50dd10b2-cfa1-4feb-b125-6740c9145cec | AHEAD94/coding-problems | 프로그래머스/1/72410. 신규 아이디 추천/신규 아이디 추천.cpp | #include <string>
#include <vector>
#include <iostream>
using namespace std;
void PrintString(const string s) {
for (auto iter = s.begin(); iter != s.end(); iter++) {
cout << *iter;
}
}
string solution(string new_id) {
string answer = "";
// 1단계
for (auto iter = new_id.begin(); iter ... | ALGO | 0.999033 | 5.793696 |
b4d2befb-1787-4658-9091-afaae7705cd6 | 1tygoime/a | ntu/PQUEUE1.CPP | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define pb push_back
#define pii pair<int,int>
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
priority_queue <int> pq;
int n;
for(cin >> n; n--; ){
int cmd;
ci... | ALGO | 0.999613 | 4.279464 |
c0a09e70-1362-404a-9fe4-dc3acecfc0b9 | Muhammad-abdullah7/Muhammad-abdullah7 | lab6/greatest.cpp | #include <iostream>
using namespace std;
double findGreatest( double n1,double n2, double n3);
int main(){
double num1,num2,num3;
cout<<"Enter the numbers to find the greatest:";
cin>>num1>>num2>>num3;
double res=findGreatest(num1,num2,num3);
cout<< " The greatest number among " << num1 <<" "<<num... | ALGO | 0.999282 | 4.032847 |
aa528c8a-0dab-48ec-befc-3cde5070b106 | GideokKim/algorithm | 프로그래머스/0/120899. 가장 큰 수 찾기/가장 큰 수 찾기.cpp | #include <string>
#include <vector>
using namespace std;
vector<int> solution(vector<int> array) {
vector<int> answer;
answer.resize(2, -1);
for (size_t index = 0; index < array.size(); ++index) {
if (answer[0] < array[index]) {
answer[0] = array[index];
answer[1] = index;
... | ALGO | 0.999951 | 5.520551 |
39a6535e-fd70-40f0-a904-2f14d37d2a42 | 0xedb/algo-ds | c++/leetcode/509. Fibonacci Number.cpp | class Solution
{
public:
int fib(int N)
{
if (N == 0)
return 0;
if (N == 1)
return 1;
int first = 0;
int second = 1;
for (int i = 2; i <= N; i++)
{
int third = first + second;
first = second;
second = third;
}
return second;
}
}; | ALGO | 0.99996 | 6.291165 |
b084fb72-1ea5-43ee-abad-d13263c0ed74 | Huaiyuan-Jing/Edx | Introduction to Programming in C++/Week3/bmiimperial.cpp | #include<bits/stdc++.h>
using namespace std;
int main() {
float height;
float weight;
// Input height and weight
cout << "Please enter weight in pounds: ";
cin >> weight;
cout << "Please enter height in inches: ";
cin >> height;
// Calculate BMI
weight *= 0.453592;
height *... | TOOL | 0.875808 | 6.219071 |
056a3d5e-d434-4442-9f87-6b8f48450250 | intel/quantum-intrinsics | libcxx/test/std/utilities/template.bitset/bitset.cons/string_ctor.pass.cpp | // bitset(string, pos, n, zero, one); // constexpr since C++23
#include <algorithm> // for 'min' and 'max'
#include <bitset>
#include <cassert>
#include <stdexcept> // for 'invalid_argument'
#include <string>
#include <type_traits>
#include "test_macros.h"
template <std::size_t N>
TEST_CONSTEXPR_CXX23 void test_stri... | TEST | 0.954458 | 7.826469 |
c06e2301-804c-4bf8-8c47-6732d6fb2e73 | vorsv/code | leet/2000.cpp | #include<bits/stdc++.h>
using namespace std;
class Solution {
public:
Solution(){
string a = "abcdefd";
char b = 'z';
cout << reversePrefix(a,b);
}
string reversePrefix(string a, char b){
int n = a.size(),i=0;
auto it = a.begin();
for (; ... | ALGO | 0.999769 | 4.210846 |
d32961d2-cd78-4dea-8ad0-5a0732ebb988 | vicentejluz/desafios-programacao | Beecrowd/2930 TCC da Depressão Natalino/main.cpp | #include <iostream>
using namespace std;
int main(){
int e, d;
cin >> e >> d;
if(e < (d - 2))
cout << "Muito bem! Apresenta antes do Natal!" << endl;
else if(e <= d){
cout << "Parece o trabalho do meu filho!" << endl;
if((d + 1) < 24)
cout << "TCC Apresentado!" <<... | ALGO | 0.99952 | 3.541151 |
007161d8-dde9-48fe-85a7-6a28be24e288 | ploffer11/CPP | probablity2.cpp | #include <stdio.h>
#include <random>
#include <vector>
#include <utility>
#include <cmath>
#include <ctime>
#include <algorithm>
#include <map>
using namespace std;
#define X_MEAN 50
#define X_STDDEV 10
#define NUMBER 100
#define BIGNUMBER 10000
random_device random;
mt19937 gen(random());
normal_distribution<> X_n... | DATA | 0.903814 | 3.436716 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.