uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
b73c605a-31d5-4f8d-b54d-7fdad64932e9 | a1846342933/px4framework | src/modules/fw_att_control/ecl_wheel_controller.cpp | /**
* @file ecl_wheel_controller.cpp
* Implementation of a simple PID wheel controller for heading tracking.
*
* Authors and acknowledgements in header.
*/
#include "ecl_wheel_controller.h"
#include <float.h>
#include <lib/ecl/geo/geo.h>
#include <mathlib/mathlib.h>
#include <matrix/math.hpp>
using matrix::wrap_... | ALGO | 0.99858 | 6.122068 |
735e4221-b22c-4281-893b-d1dad55927e3 | Huuthien2005/practice_DSA | practice/two_pointer/three_sum.cpp | #include<iostream>
using namespace std;
void input(int a[],int n) {
for (int i = 0; i < n; i++) {
cin >> a[i];
}
}
//find three elements in the array that sum to the target, and print the index of the elements
void three_sum(int a[], int n, int target) {
int i=0, j = i+1, k = n - 1;
int sum = 0;
while (i < n - ... | ALGO | 0.999818 | 4.133413 |
d1bb707a-9b81-4a49-995c-e9b7be1bf96a | Rahul-Shaikh/CP | Rahul/Problems/DP/equalpartition.cpp | #include <iostream>
#include <cstring>
#include <cstdlib>
#include <numeric>
using namespace std;
typedef long long ll;
int main(void) {
int n;
cin >> n;
int arr[n];
for (int i = 0; i < n; i++) cin >> arr[i];
ll _sum = accumulate(arr, arr+n, 0);
ll hsum = _sum/2;
if (_sum%2) {
cout... | ALGO | 0.999765 | 3.775247 |
edd588b6-80d5-4ce2-98ac-bb1980439f2f | qluana7/Baekjoon-Cpp | Silver/Silver 4/2485.cpp | #include <iostream>
#include <vector>
#include <numeric>
using namespace std;
int main() {
int n, t = 0; cin >> n;
vector<int> v(n);
cin >> v[0] >> v[1]; t = v[1] - v[0];
for (int i = 2; i < n; i++) {
cin >> v[i];
t = gcd(t, v[i] - v[0]);
}
int c = 0;
for (int... | ALGO | 0.999874 | 4.112771 |
ac807dd7-4654-4f1e-b68e-a7c9564d0a18 | ishandutta2007/codeforces | tutis/normal/1175/A.cpp | /*input
2
59 3
1000000000000000000 10
*/
#pragma GCC optimize ("O3")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
int t;
cin >> t;
while (t--)
{
ll n, k;
cin >> n >> k;
ll a = 0;
while (n > 0)
{
if (n % k == 0)
{
n /= k;
a++;
}
else
{
ll x = ... | ALGO | 0.999796 | 3.758884 |
41b2e371-a286-42b9-bfb4-8dc32f614f26 | InverseLight/ValoMC | cpp/2d/MC2Dmex.cpp |
#include <string>
#define _USE_MATH_DEFINES
#include <cmath>
#include <limits>
#include <inttypes.h>
#include <time.h>
#include "mex.h"
#include "Array.hpp"
#include "ArrayMEX.hpp"
#include "MC2D.hpp"
#include "../versionstring.h"
#ifdef _MAKE_CTRL_C_POSSIBLE_
extern "C" bool utIsInterruptPending();
#endif
// Comp... | ALGO | 0.994912 | 5.045122 |
9d2efc3a-f08c-421e-869d-284e17943f0b | thiagoa261/CPP-IFSP | aula3/MediaImpar.cpp | #include <iostream>
using namespace std;
int main()
{
int vetor[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
int soma = 0, quantN = 0, impar = 0;
for(int i=0; i<10; i++) {
if(vetor[i] % 2 > 0) {
impar++;
}
}
if(impar == 0) {
cout << "Vetor sem valores ímpares!"... | ALGO | 0.997546 | 4.628928 |
0805d497-d149-454f-9abe-7e34eadcec88 | MNametissa/dark_todo_app | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.9988 | 6.76073 |
b3b4e097-86d9-41ef-8d80-74d5651239f4 | ZoeELin/Bcp-1.4-NSP | Bcp/src/TM/BCP_tm_msg_node_rec.cpp | #include "CoinTime.hpp"
#include "BCP_os.hpp"
#include "BCP_USER.hpp"
#include "BCP_node_change.hpp"
#include "BCP_warmstart.hpp"
#include "BCP_branch.hpp"
#include "BCP_enum_branch.hpp"
#include "BCP_message.hpp"
#include "BCP_vector.hpp"
#include "BCP_tm.hpp"
#include "BCP_tm_user.hpp"
#include "BCP_tm_functions.hpp... | ALGO | 0.953564 | 5.185856 |
57aa925b-0d39-47bc-ae1f-2958f6846d90 | AnuragKrVerma/Cpp | question/leetcodeq231.cpp | // power of two
// given an integer n return true if it is the power of two .other wise return false.
// an integer n is power of two ,if there exist an integer x such that n==2^x.
// example
// input n =1
// output true
// explanation
// 2^0=1
// example 2
// input n = 16
// output true
// 2^4 = 16
#include <iostre... | ALGO | 0.998261 | 4.813972 |
4520f657-ae1d-4236-8005-590261e34ffb | revbayes/revbayes.archive | src/core/moves/MetropolisHastingsMove.cpp | #include "DagNode.h"
#include "MetropolisHastingsMove.h"
#include "Proposal.h"
#include "RandomNumberFactory.h"
#include "RandomNumberGenerator.h"
#include "RbException.h"
#include "RbMathLogic.h"
#include <cmath>
#include <iomanip>
#include <sstream>
#include <iostream>
using namespace RevBayesCore;
/**
* Constru... | ALGO | 0.998821 | 6.143152 |
e112febd-959b-4eb3-99d0-bf894e0a265e | privefl/bigstatsr | tmp-save/utils-mat.cpp | // [[Rcpp::depends(RcppEigen, bigmemory, BH)]]
#include <RcppEigen.h>
#include <bigmemory/MatrixAccessor.hpp>
using namespace Rcpp;
/******************************************************************************/
// [[Rcpp::export]]
NumericMatrix& scaling2(NumericMatrix& source,
const Numeric... | ALGO | 0.999628 | 6.046229 |
791c83d8-008c-4ad4-bf10-b32a3272bf4a | leverimmy/Codes | 比赛/学校/2019-10-5测试/data/2735/Standard_CPlus.cpp | #include <stdio.h>
const int maxn = 200101, maxd = 30;
int n, q, seg_tot, root[maxn];
struct Trie
{
int cnt, ch[2];
} seg[maxn * (maxd + 1)];
void update(int &rt, int dep, int x)
{
int last = rt;
seg[rt = ++seg_tot] = seg[last];
++seg[rt].cnt;
if(dep == -1)
return;
update(seg[rt].ch[(x >> dep) & 1], dep - 1, x)... | ALGO | 0.999983 | 4.537321 |
0fd73975-b095-4032-9a13-6a7739bcd3e1 | CookiesDan220603/Code-C | cpp/duaxe.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
ifstream cin ("DUAXE.INP");
ofstream cout ("DUAXE.OUT");
int n, a[100];
cin >> n;
for (int i = 0; i<n+1; i++){
cin >>a[i];
}
int dem = 0,i=0;
while (i <=n){
if (a[i]<a[i+1]) dem ++;
while (a[i]<a[i+1])i++;
i++;}
cout <<dem;
return 0;
}
| ALGO | 0.999785 | 3.41401 |
9644a08c-e406-454b-b322-d47a5e4e3143 | Z-ZHANG15/px4 | src/modules/ekf2/EKF/output_predictor.cpp | #include "output_predictor.h"
using matrix::AxisAnglef;
using matrix::Dcmf;
using matrix::Quatf;
using matrix::Vector2f;
using matrix::Vector3f;
void OutputPredictor::print_status()
{
printf("output predictor: IMU dt: %.4f, EKF dt: %.4f\n", (double)_dt_update_states_avg, (double)_dt_correct_states_avg);
printf("ou... | ALGO | 0.977195 | 6.853338 |
338d3a39-e7e0-4874-801e-770a0ba170a1 | Vitoriokaua/quues6matriz | questmatriz6.cpp | /*Leia uma matriz de ordem n, informada pelo usurio.
Calcule a soma dos elementos que esto abaixo da diagonal principal.*/
#include <iostream>
using namespace std;
void ler_matriz(int m[][20], int n) {
cout << "informe os numeros: ";
for (int i = 0; i < n; i++)
{
for (int j = 0; j < n; j++)
{
cout << "Elem... | ALGO | 0.99971 | 3.663754 |
c2ee44d2-c408-41af-aed5-0551a54de106 | MarkxOBrian/C-Programs | Deductions.cpp | #include <iostream>
using namespace std;
int main()
{
double salo,deductions,netpay;
cout<<"enter the monthly salary\t";
cin>>salo;
if (salo<10000)
{
cout<<"no deductions on your salary";
}
else if(salo<20000)
{
deductions=salo-1000;
}
else
{
deduc... | TOOL | 0.972635 | 3.124049 |
7ff9f6ab-a9fb-479f-85e5-4d5857ee6906 | JoaoVitorBarbosa/EpidemicSimulator | RandomGenerator.cpp | /*
* Project develop by João Vitor Barbosa Tavares
* *
*/
#include "RandomGenerator.h"
double RandomGenerator::exponential(double lambda) {
int seed = std::chrono::system_clock::now().time_since_epoch().count();
std::mt19937 mt(seed);
std::exponential_distribution<double> exp(lambda);
return e... | TOOL | 0.946649 | 3.422518 |
33a38952-7cda-49f2-b962-69006bda1e41 | msft-mirror-aosp/toolchain.llvm-project | libc/src/math/generic/setpayloadl.cpp | #include "src/math/setpayloadl.h"
#include "src/__support/FPUtil/BasicOperations.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(int, setpayloadl, (long double *res, long double pl)) {
return static_cast<int>(fputil::setpayload</*IsSig... | TOOL | 0.905979 | 5.772771 |
277fd07d-8719-4997-bb54-e38364b66f07 | javagovindsharma/leetscode | solution/0100-0199/0114.Flatten Binary Tree to Linked List/Solution.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.999985 | 6.422433 |
cb92d775-3632-4847-83ba-7b5dcbab112d | camilobdez/Competitive-Programming | Codeforces/1976C.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define deb(x) cout << x
#define X first
#define Y second
#define SZ(x) int(x.size())
#define all(x) x... | ALGO | 0.999985 | 3.415253 |
aa72eb85-8222-4c91-8be5-f9896901a2d6 | Kajal-Sethi/Coding | 15-3sum/15-3sum.cpp | class Solution {
public:
vector<vector<int>> threeSum(vector<int>& nums) {
// tripplet pairs with sum 0
// use binary search. result in O(n^2)
vector<vector<int>> ans;
map<vector<int>, int> mp;
sort(nums.begin(), nums.end());
int i, j, k, sum;
... | ALGO | 0.99996 | 5.827564 |
128e35ba-13e1-44c3-b706-ed3800484382 | Shadikul-Islam/Programming-Contest-Data-Structure-And-Algorithm | Chapter_2/No.24__Onushiloni_06_Pyramid (Page 32).cpp | /**
No.24__Onushiloni_06_Pyramid Print (Page 32).cpp
1
121
12321
121
1
Purpose: Solve the book "Programming Contest, Data Structure And Algorithm" by Md. Mahbubul Hasan"
@author: Md. Sadikul Islam Shuvo
*/
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,i,... | ALGO | 0.999985 | 3.560515 |
af4c0956-b4d6-4e53-a37e-541d7d599189 | n1ckfg/latk_ml_003 | SynDraw/SynDraw/libigl/tests/include/igl/cotmatrix.cpp | #include <test_common.h>
#include <igl/PI.h>
#include <igl/cotmatrix.h>
#include <igl/matrix_to_list.h>
#include <igl/polygon_corners.h>
TEST_CASE("cotmatrix: poly", "[igl]" )
{
const auto test_case = [](const std::string ¶m)
{
Eigen::MatrixXd V;
Eigen::MatrixXi F;
// Load example mesh: GetParam() ... | TEST | 0.905436 | 6.598094 |
80cd391a-e7ab-4a7f-8da8-accd26a73bf0 | NazarDD/Lab-13.1 | Lab 13.1/sum.cpp | #include <cmath>
#include "dod.h"
#include "var.h"
#include "sum.h"
using namespace nsDod;
using namespace nsVar;
void nsSum::sum() {
do {
dod();
s += a;
n++;
} while (fabs(a) > eps);
} | ALGO | 0.999078 | 3.29918 |
ee499264-b11d-4205-a9bd-32728c36a866 | KAsHiSHSET/LEETCODE-Solutions | 0494-target-sum/0494-target-sum.cpp | // class Solution {
// public:
// int helper(int ind,vector<int> nums,int target, vector<vector<int>> &dp){
// if(ind<0) return target==0;
// if(dp[ind][target]!=-1) return dp[ind][target];
// int npick=helper(ind-1,nums,target,dp);
// int pick=0;
// if(target>=nums[ind]){
//... | ALGO | 0.999992 | 6.067327 |
279262e1-bba7-4319-bc30-c57d3d0943af | shanjiang7/FEMSolver | eigen-3.4.0/doc/examples/TutorialLinAlgExSolveLDLT.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace std;
using namespace Eigen;
int main()
{
Matrix2f A, b;
A << 2, -1, -1, 3;
b << 1, 2, 3, 1;
cout << "Here is the matrix A:\n" << A << endl;
cout << "Here is the right hand side b:\n" << b << endl;
Matrix2f x = A.ldlt().solve(b);
cout << "... | ALGO | 0.999887 | 3.807622 |
c055052b-8d2c-4933-ab5a-8cb8aa86ad22 | fightingsleep/SimpleBinomialOptionPricingModel | src/main.cpp | #include <memory>
#include <iostream>
#include "binomial_model.hpp"
int main(int argc, char *argv[])
{
double spot_price = 0.0, strike_price = 0.0, years_until_expiry = 0.0,
volatility = 0.0, risk_free_rate = 0.0, dividend_yield = 0.0;
int time_steps = 0, option_type = 0, option_style = 0;
bool out... | ALGO | 0.973416 | 7.338213 |
41bc414e-16f6-436d-8485-bc8e4c22234e | sailor-ux/repo2 | leetcode_vscode/leetcode_100/leetcode_100.cpp | #include <iostream>
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(right... | ALGO | 0.999892 | 6.201101 |
7fa4822c-853f-45a7-a3c7-6626270982f8 | komalmahto/DS-Algo-Codes-2020 | BIT_MANIPULATION/all_subsequence.cpp | #include<iostream>
using namespace std;
//010
void find(int i,string s){
int j=0;
while(i>0){
int mask=(i&1);
if(mask){
cout<<s[j];
}
i=i>>1;
j++;
}
cout<<endl;
}
void func(string s){
int len=s.size();
for(int i=0;i<(1<<len);i++){
find(i,s);
}
}
int main(){
string s="abc";
... | ALGO | 0.999943 | 3.576998 |
0644211a-264b-4f70-8f07-cd5845f40694 | YichenZhou113/CS225-Data-Structure | lab_dict/fac.cpp | /**
* @file fac.cpp
* Contains factorial-calculating functions both utilizing and not
* utilizing memoization.
*
* @author Matt Joras
* @date Winter 2013
*/
#include "fac.h"
#include <iostream>
#include <map>
#include <cstring>
#include <stdexcept>
using namespace std;
const string USAGE =
"USAGE: fac [NUM] ... | ALGO | 0.999259 | 7.576778 |
ebf95cc9-7062-4f41-b283-865b0c5d1159 | p-podsiadly/llvm-stm8 | libc/src/math/generic/coshf.cpp | #include "src/math/coshf.h"
#include "src/__support/FPUtil/FPBits.h"
#include "src/__support/FPUtil/multiply_add.h"
#include "src/__support/FPUtil/rounding_mode.h"
#include "src/__support/macros/optimization.h" // LIBC_UNLIKELY
#include "src/math/generic/explogxf.h"
namespace LIBC_NAMESPACE {
LLVM_LIBC_FUNCTION(float... | ALGO | 0.993121 | 6.880188 |
3c94283d-137c-4529-962e-964497e835ab | iShagor/Phitron | Semester 2/Basic Date Structures/week 1/module 2/vec_modifiers.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
vector<int> v = {10, 20, 30, 40};
for(int i = 0; i < v.size(); i++) cout << v[i] << " ";
cout << endl;
v.pop_back();
for(int i = 0; i < v.size(); i++) cout << v[i] << " ";
cout << endl;
v.insert(v.begin() + 2, 45);
for(int ... | TOOL | 0.909896 | 3.572471 |
59eb0373-70f7-449d-baeb-e1aab617e63d | imabhishek17/Dynamic-programming | dp2.cpp | #include<bits/stdc++.h>
using namespace std;
int fib(int n)
{
int dp[1000]={};
dp[0]=0;
dp[1]=1;
for(int currnum=2;currnum<=n;currnum++)
{
dp[currnum]=dp[currnum-1]+dp[currnum-2];
}
return dp[n];
}
int main()
{
ios_base::sync_with_stdio(fa... | ALGO | 0.999942 | 4.702102 |
3291d3af-c399-4512-a8bf-d825040f6203 | cbarlin/aoc2024 | day16/main.cpp | #include "main.h"
#include <iostream>
#include <vector>
#include <fstream>
#include <sstream>
#include <cassert>
#include "../utils/graph.h"
#include "../utils/navigator.h"
namespace day16
{
typedef navigator::CostAndPathOfNavigation puzzle;
// typedef graph::Graph puzzle;
ull part2(const puzzle &input... | ALGO | 0.99935 | 5.33072 |
b9c7fcb6-0fed-404c-8997-b89ee5e208bd | yzzupgo/MFTCG | Data/abc170_b/mochi2225/wa/14333201.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int X, Y;
cin >> X >> Y;
if(Y % 2 == 1){
cout << "No" << endl;
return 0;
}
if(X * 2 > Y){
cout << "No" << endl;
}else if(X * 4 < Y){
cout << "No" << endl;
}else{
for(int i = 0; i < Y / 4; i++){
if((Y - 4 * i) / 2 == X - i){
cout << "Yes" << endl;
return 0;
}
}
... | ALGO | 0.999935 | 3.176009 |
3de78dda-d791-4365-a5b4-4e2a61ee2aa1 | PandoraLS/C-Programming | Ch04/EasyEx06.cpp | #include <cmath>
#include <iostream>
using namespace std;
int main() {
double in = 0.0;
double min = in, max = in;
while (cin >> in) {
if (in < min) {
min = in;
}
if (in >= max) {
max = in;
}
cout << "the smaller so far " << min << "\n";
... | ALGO | 0.99992 | 3.768048 |
5021dab7-3e17-4b5b-a099-de6cd12381f8 | niceharmtool/cppK57DDK | tuan2/test_def.cpp | #include <iostream>
#include <set>
using namespace std;
int main ()
{
std::set<int> myset;
int n=5;
for(int i=0;i<n;i++){
int item;
cin>>item;
myset.insert(item);
}
std::cout << "myset contains:";
for (std::set<int>::iterator it=myset.begin(); it!=myset.end(); ++it)
std::cout << ' ' << *it;... | TOOL | 0.984691 | 3.730354 |
6ffadc9e-76f5-42b4-b31c-8b427f031ab9 | dpribula/Djikstra | djikstra.cpp | /**
* @file djikstra.cpp
* @author David Pribula
*/
#include "edgeinfo.h"
#include"graph.h"
#include "pathcomppl.h"
int main(){
Graph g;
list<string> test;
PathCompPL comp;
int x;
g.addVertex("a");
g.addVertex("b");
g.addVertex("c");
g.addVertex("d");
g.addVertex("e");
g.addVertex("f");
g.addEdge("a", "c"... | ALGO | 0.996298 | 3.757001 |
ec34f945-15d2-44fe-9773-0e8361599f61 | garetroy/AlgorithmPractice | crackingthecodeinterview/arrays_strings/permutationpalendrome.cpp | /*
This program takes in a string and checks to see if there is any permutation of the string in which there exists a palidrome
*/
#import <iostream>
#import <string>
#import <algorithm>
using namespace std;
int
main(int argc, char *argv[])
{
if(argc > 3 || argc < 2){
cerr << "This only takes one stri... | ALGO | 0.99964 | 5.334305 |
87a266e3-5444-4b78-8406-2361278254c7 | SynapticSugar/CarND-Path-Planning-Project-Redux | src/Eigen-3.3/bench/sparse_lu.cpp |
// g++ -I.. sparse_lu.cpp -O3 -g0 -I /usr/include/superlu/ -lsuperlu -lgfortran -DSIZE=1000 -DDENSITY=.05 && ./a.out
#define EIGEN_SUPERLU_SUPPORT
#define EIGEN_UMFPACK_SUPPORT
#include <Eigen/Sparse>
#define NOGMM
#define NOMTL
#ifndef SIZE
#define SIZE 10
#endif
#ifndef DENSITY
#define DENSITY 0.01
#endif
#ifnd... | ALGO | 0.996396 | 4.19082 |
2308b07c-d1b5-48f9-b941-059f655d3d95 | ChenXingLing/OI-Algorithm-Template | 【杂七杂八】/对拍/myprogram.cpp | #include<algorithm>
#include<cstring>
#include<cstdio>
#include<queue>
#define LL long long
#define Re register int
using namespace std;
const int N=5e5+3;
const LL inf=4e18+5;
int n,opt,A[N],B[N];
inline void in(Re &x){
Re fu=0;x=0;char ch=getchar();
while(ch<'0'||ch>'9')fu|=ch=='-',ch=getchar();
while(ch>='0'&&ch<... | ALGO | 0.999396 | 3.337732 |
4045fd96-278d-41d5-8a33-294ce169949d | yokotech/competitive_programming | AtCoder/abc/abc_036/4_abc036_d.cpp | // 4_abc036_d
#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>
#inclu... | ALGO | 0.999898 | 4.10109 |
aac497cf-4719-442d-9e56-4866a42cd24d | niyathi18/algo_sem3 | merge.cpp | #include<iostream>
using namespace std;
void merge(int* arr,int s,int e){
int mid=(s+e)/2;
int len1=mid-s+1;
int len2=e-mid;
int* left =new int[len1]; //created array dynamically
int* right=new int[len2];
//copy
int k=s;
for(int i=0;i<len1;i++){
left[i]=arr[k];
k++;... | ALGO | 0.99997 | 4.951143 |
635a78e5-c0d8-4e15-8a60-7a3545005b80 | sarvex/leetcode-wren | solution/0500-0599/0518.Coin Change II/Solution.cpp | class Solution {
public:
int change(int amount, vector<int>& coins) {
vector<int> dp(amount + 1);
dp[0] = 1;
for (auto coin : coins) {
for (int j = coin; j <= amount; ++j) {
dp[j] += dp[j - coin];
}
}
return dp[amount];
}
}; | ALGO | 0.999972 | 6.100208 |
0070a528-e302-45d2-8d13-8fdb3fad04f4 | Techainer/flutter-camera-package | packages/pigeon/platform_tests/test_plugin/example/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.997682 | 6.785805 |
25846176-556c-4384-ba77-bd32a92de9e0 | ChristinaDiam/TravelMonitorClient | TravelMonitorClient/travelMonitorClient/helpmain.cpp | #include<iostream>
#include<cstdio>
#include<dirent.h>
#include <sys/wait.h> /* sockets */
#include <sys/types.h> /* sockets */
#include <sys/socket.h> /* sockets */
#include <netinet/in.h> /* internet sockets */
#include <netdb.h> /* gethostbyaddr */
#include<cstring>
#incl... | TOOL | 0.95653 | 3.260161 |
8c549c0f-7ae3-496b-8102-be6ac05bf20e | Starry0/ACM | jxust编程俱乐部/1907/1907.cpp | #include <iostream>
using namespace std;
int f(int x){
return x==0?3:(f(x-1)-1)*2;
}
int main(){
int n,a;
cin>>n;
while(n--){
cin>>a;
cout<<f(a)<<endl;
}
return 0;
}
| ALGO | 0.999682 | 3.937061 |
4080bb77-276c-4519-91d4-c1f1731c22a1 | ayush-gautam2708/ps3 | ps3q5.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n,m;
cin>>n>>m;
vector<int>s(n);
for(int i=0;i<n;i++)
{
cin>>s[i];
}
for(int i=0;i<n-1;i++)
{
if(abs(s[i+1]-s[i])<=m)
{
continue;
}
else
{
if(s[i]<s[i+1]... | ALGO | 0.999977 | 3.32148 |
a0db363b-c710-430a-995f-7bbfbc8c2785 | MithleshKumarSharmaa/SecureR | 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 |
f78445cc-292f-4aa8-a426-ac45e9434e1a | ishandutta2007/codeforces | arthur.nascimento/normal/1326/C.cpp | #include <bits/stdc++.h>
#define maxn 400400
#define ll long long
#define pb push_back
#define pii pair<int,int>
#define mod 998244353
#define debug(args...) printf(args)
using namespace std;
int v[maxn];
int main(){
int n,k;
scanf("%d%d",&n,&k);
ll mx = 0, qt = 1;
for(int i=0;i<n;i++... | ALGO | 0.999987 | 4.052822 |
77b3a793-3ca7-4389-8a72-52e7db2468eb | tamimachy/Data_Structure_With_C- | array_insert_value.cpp | #include<iostream>
using namespace std;
int insertA(int array[], int n, int pos, int value){
n++;
int i;
for(i=n-1; i>pos; i--){
array[i]=array[i-1];
}
array[pos] = value;
return n;
}
int main(){
int n,i;
cout << "Array size: ";
cin >> n;
int array[n];
cout<< "Array e... | ALGO | 0.999771 | 3.990213 |
0b007d98-d969-4afa-8e54-a9eb3d4c4602 | qiaozishun4/CSP2024_BJ | BJ-Junior/answers/BJ-J00165/explore/explore.cpp | #include<iostream>
#include<fstream>
#include<string>
using std::endl,std::string,std::ifstream;
ifstream cin("explore.in");
ofstream cout("explore.out");
bool map[1105][1105];
bool rendered[1105][1105];
size_t cx,cy,t,ans;
class point
{
public:
int x=0,y=0;
inline point(){}
inline point(int _x,int _y):x(_... | ALGO | 0.999835 | 3.582717 |
e68bd213-47f3-490e-95e0-481199f42854 | paolo-torres/interview-prep | leetcode/meta/all/add_strings.cpp | // 2 pointers, start from end, get sum, maintain carry
// Time: O(max(m, n))
// Space: O(max(m, n))
class Solution {
public:
string addStrings(string num1, string num2) {
int i = num1.size() - 1;
int j = num2.size() - 1;
int carry = 0;
string result = "";
... | ALGO | 0.999969 | 6.834199 |
0afe5b24-0aff-4de4-bc9d-5b6cabd22fad | NitzanWainshtein/OS_EX3 | q2/convex_hull_list.cpp | #include <iostream>
#include <list>
#include <vector>
#include <algorithm>
#include <cmath>
#include <iomanip>
/**
* Point structure for 2D coordinates
*/
struct Point {
double x, y;
Point() : x(0), y(0) {}
Point(double x, double y) : x(x), y(y) {}
};
/**
* Cross product of vectors OA and OB
* Re... | ALGO | 0.999901 | 6.9392 |
0761dbf1-bb9f-496a-8e59-6176a940f354 | Rampatil2104/DSA | Lect 3/3_lowercaseuppercaseno.cpp | #include <iostream>
using namespace std;
int main()
{
char ch;
cin >> ch;
if (ch >= 'A' && ch <= 'Z')
{
cout << "uppercase character" << endl;
}
if (ch >= 'a' && ch <= 'z')
{
cout << "lowercase character" << endl;
}
else
{
cout << "integer";
}
} | ALGO | 0.873328 | 3.692155 |
8da69840-f3ba-4a2e-86b7-3c1270ebe760 | ProteinDF/ProteinDF | src/libpdf/DfHpqX_Parallel.cpp | #include "DfHpqX_Parallel.h"
#include "DfTaskCtrl_Parallel.h"
#include "TlCommunicate.h"
#include "tl_dense_symmetric_matrix_scalapack.h"
DfHpqX_Parallel::DfHpqX_Parallel(TlSerializeData* pPdfParam)
: DfHpqX(pPdfParam) {}
DfHpqX_Parallel::~DfHpqX_Parallel() {}
void DfHpqX_Parallel::logger(const std::string& str)... | ALGO | 0.969977 | 4.359968 |
9599d79a-f120-4245-b1a3-b44554dd4069 | OhanaTyan/online_judges | luogu/1146.cpp | #include <cstdio>
#include <cstdlib>
int main(){
int n;
scanf("%d", &n);
int a[110] = {0};
printf("%d\n", n);
for (int i=0; i<n; i++){
for (int j=0; j<n; j++){
if (i!=j) {
a[j] = 1-a[j];
}
printf("%d", a[j]);
}
printf("\n")... | ALGO | 0.999902 | 3.058378 |
c491c65c-971d-4fea-90a8-543c3d0aa181 | xstart11/coin4 | src/rpcmining.cpp | #include "amount.h"
#include "base58.h"
#include "chainparams.h"
#include "core_io.h"
#include "init.h"
#include "main.h"
#include "miner.h"
#include "net.h"
#include "pow.h"
#include "rpcserver.h"
#include "util.h"
#ifdef ENABLE_WALLET
#include "db.h"
#include "wallet.h"
#endif
#include <stdint.h>
#include <boost/as... | WEB | 0.988335 | 6.153052 |
8ef42bf1-0daf-4eae-b553-e04f7c7ad4ff | EngineerZhang/PAT-Basic-Level | small test/1029.cpp | #include<stdio.h>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
int map[128] = { 0 };
int main(){
char str1[85];
char str2[85];
scanf("%s %s", str1, str2);
int len1 = strlen(str1);
int len2 = strlen(str2);
for (int i = 0; i < len2; i++){
map[str2[i]] = 1;
}
for (int i = 0; ... | ALGO | 0.999985 | 4.407093 |
f3441eb1-aaa0-4bb2-ba49-9fe3131b57b4 | raysjoshua/UnrealEngine | Engine/Source/ThirdParty/Box2D/Box2D_v2.3.1/Box2D/Collision/b2CollidePolygon.cpp | #include <Box2D/Collision/b2Collision.h>
#include <Box2D/Collision/Shapes/b2PolygonShape.h>
// Find the max separation between poly1 and poly2 using edge normals from poly1.
static float32 b2FindMaxSeparation(int32* edgeIndex,
const b2PolygonShape* poly1, const b2Transform& xf1,
const b2PolygonShape*... | ALGO | 0.999774 | 6.845006 |
5555c131-9166-44b9-8f19-2f01403096a6 | digvijay173/TY-Data | DAA/Ass5/gc.cpp | #include <stdbool.h>
#include <stdio.h>
#include <bits/stdc++.h>
#define V 5
using namespace std;
void printSolution(int color[]);
/* A utility function to check if
the current color assignment
is safe for vertex v i.e. checks
whether the edge exists or not
(i.e, graph[v][i]==1). If exist
then checks whether the color... | ALGO | 0.999799 | 5.087375 |
7d3ef8fd-211b-4422-9abd-73102cadb23c | Felle33/Competitive-Programming | codeforces/div3/954/D.cpp | #include <algorithm>
#include <iostream>
#include <cmath>
#include <vector>
#include <queue>
#include <cstring>
#include <map>
#include <set>
#include <iomanip>
#include <bitset>
#define all(x) (x).begin(), (x).end()
#define mp make_pair
#define pb push_back
#define rep(X,Y) for (int (X) = 0;(X) < (Y);++(X))
#define r... | ALGO | 0.999827 | 4.43577 |
61d94fd2-d594-4d8b-b30d-55668515f4b7 | Overstars/Practice | OJ/HDOJ题目/搜索/HDOJ1242Rescue(DFS,逆向思维).cpp | #include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;//RAʱ,ÿrʼӶȻܸ?
char matrix[205][205];//arʱСֵ
int n,m,flag[205][205],mini;
const int INF=0x3f3f3f3f;
void dfs(int x,int y,int cnt);
int main()
{
int i,j,ax,ay;
while(cin>>n>>m){
mini=INF;
for(i=0;i<n;i++){
for(j=0;j<m;j++){
scanf(" %c"... | ALGO | 0.998761 | 3.094435 |
447188c9-cb01-418c-9604-2de7f93bab67 | ROCm-Developer-Tools/llvm-project | libc/src/math/generic/atanhf.cpp | #include "src/math/atanhf.h"
#include "src/__support/FPUtil/FPBits.h"
#include "src/__support/macros/optimization.h" // LIBC_UNLIKELY
#include "src/math/generic/explogxf.h"
namespace LIBC_NAMESPACE {
LLVM_LIBC_FUNCTION(float, atanhf, (float x)) {
using FPBits = typename fputil::FPBits<float>;
using Sign = fputil:... | ALGO | 0.998501 | 6.997612 |
8fe99aa0-b8ed-4b2f-884a-61e802adf61f | N4171k/ACC-Daily-Challenge | Day 8 - Numeric palindrome Equilateral pyramid.cpp | #include <iostream>
using namespace std;
int main() {
int n;
cout << "Enter the number of rows: ";
cin >> n;
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= n - i; j++) {
cout << " ";
}
for (int j = 1; j <= i; j++) {
cout << j;
}
f... | ALGO | 0.998233 | 4.69436 |
90957788-1ec6-4761-8bb9-1aba1341c3f2 | sanjay-29-29/Cloth-Transfer | open-pose/src/openpose/net/maximumBase.cpp | #include <openpose/net/maximumBase.hpp>
// #include <thrust/extrema.h>
#include <opencv2/core/core.hpp> // cv::Mat
namespace op
{
template <typename T>
void maximumCpu(T* targetPtr, const T* const sourcePtr, const std::array<int, 4>& targetSize,
const std::array<int, 4>& sourceSize)
{
... | ALGO | 0.980612 | 5.691998 |
f6a5bed1-6699-4141-aef9-bbab5c8f11f1 | moaangel/Algorithm | SWEA/D4/1226. [S/W 문제해결 기본] 7일차 - 미로1/[S/W 문제해결 기본] 7일차 - 미로1.cpp | #include<iostream>
#include<string>
using namespace std;
int dy[4] = { 1,0,-1,0 };
int dx[4] = { 0,1,0,-1 };
int a[18][18];
int visited[18][18];
int sy, sx, ey, ex, ret;
void dfs(int y, int x) {
if (y == ey && x == ex) {
ret = 1;
return;
}
visited[y][x] = 1;
for (int i = 0; i < 4; i++) {
int ny = y + dy[i... | ALGO | 0.997318 | 3.551059 |
4e21b9b5-ebe9-44c7-9184-9023b8b0e813 | prince4panwar/CPP_Language_Programs | STL4.cpp | /*Define a class template, array, such that an instance of the class can store homogeneous data.
Define constructor to initialize the size of the array. Also define member function to insert
an item in the array, retrieve an item from specified index, count number of elements in the
array, edit an item, delete an item ... | ALGO | 0.990435 | 3.550351 |
b2e0bcf5-ac3c-462c-998c-52e4a92f9d55 | Juanseco199/UMNG | C++/Ejercicio (1) v2.cpp | #include <iostream>
#include <math.h>
using namespace std;
int main()
{
double x, resultado = 0;
cout<<"Ingrese un numero\n"; cin>>x;
resultado = (pow((x - 1),3) + (4 * (pow((1 + x),2))) - (5 * (((2 * x) + 1) / (3 * ((2 * x) - 1)))));
cout<<"El resultado es: ";
cout<<resultado;
return 0;
} | ALGO | 0.999664 | 3.719715 |
6c61eb06-268c-41b3-add4-e9b93d997f1a | yonatanbitton/SPL-Assignment1 | src/Hand.cpp | /*
* Hand.cpp
*
* Created on: Nov 18, 2016
* Author: bittoy
*/
#include <iostream>
using namespace std;
#include <string>
#include <algorithm>
#include "../include/Hand.h"
Hand::Hand():HandVec(){}
// Copy constructor
Hand::Hand (const Hand& otherHand):HandVec(){
if (this==&otherHand)
return;
clean();... | ALGO | 0.895163 | 4.565151 |
fedc2fe0-db4f-4fff-b3a6-8100a15c684d | EB4LIFE/Advanced-Programing-2023-24 | HW1OOP/Q2/EBAPHW1EmployeeMain.cpp | #include <iostream>
#include "Employee.h"
using namespace std;
int main() {
//The program is to print :
//The id and name of the worker who collected the least donations.The sum of
//collections he collected should also be printed.
//The id and name of the worker with the highest salary.His salary shou... | TOOL | 0.901083 | 3.723683 |
f196587a-ec38-426c-8f09-4fdc7c79e93a | Shaunak04/Striver-SDE-Sheet | Day 17/InPrePostSingleTraversal.cpp | // output: {{pre}, {in}, {post}}
class Solution
{
public:
vector<vector<int>> PreInPostTraversal(TreeNode* root)
{
if(root==nullptr) return {};
stack<pair<TreeNode*, int> st;
st.push({root,1});
vector<int> pre, in, post;
while(!st.empty())
{
auto ... | ALGO | 0.999984 | 6.320619 |
fb6064e0-4d3a-4039-94e4-ad348ecf3537 | mozaid7/DSA | CRT/CBT.cpp | #include<bits/stdc++.h>
using namespace std;
class Node {
public:
int data;
Node *left;
Node *right;
Node(int d) {
data = d;
left = NULL;
right = NULL;
}
};
// Starting with a 1-indexed array of zeros and a list of operations, for each op... | ALGO | 0.998863 | 4.290401 |
4edd3b0a-c065-48d6-a5e0-5bf80e56bf50 | MattCarval/beecrowd | beginner/1011.cpp | // Sphere
// Make a program that calculates and shows the volume of a sphere being provided
// the value of its radius (R) . The formula to calculate the volume is:
// (4/3) * pi * R3. Consider (assign) for pi the value 3.14159.
// Tip: Use (4/3.0) or (4.0/3) in your formula, because some languages
// (including C... | ALGO | 0.999065 | 4.792641 |
9437d711-4215-417b-b1b4-26ff0fbb2fcd | andrewservania/KMINTWeek5 | SDLFramework/SDLFramework/ProbabilityDistribution.cpp | #include "ProbabilityDistribution.h"
#include "Dashboard.h"
#include <cstdlib>
#include <assert.h>
#include <stack>
using namespace std;
////////////////////////////////////////////////////////////////////////////////////////////////////
/// <summary>
/// A class created to distribute probability among three choices ... | ALGO | 0.973048 | 4.175635 |
4105c4b1-9e0e-4394-ad1a-a2d803824b93 | GuacheSuede/MSSubmission1234567890 | submission/rsi/boost_1_69_0/libs/sort/example/stringsample.cpp | // See http://www.boost.org/libs/sort for library home page.
#include <boost/sort/spreadsort/string_sort.hpp>
#include <time.h>
#include <stdio.h>
#include <stdlib.h>
#include <algorithm>
#include <vector>
#include <iostream>
#include <fstream>
#include <string>
using std::string;
using namespace boost::sort::spreads... | ALGO | 0.992747 | 4.766698 |
d40d03af-a1f3-44d6-922d-94e3fef654d9 | SewerynKaminski/AdventOfCode | year2021/day09/day_09.cpp | //---------------------------------------------------------------------------//
//#include <string>
//#include <iostream>
//#include <sstream>
//#include <map>
//#include <unordered_map>
//#include <vector>
//#include <ranges>
//#include <fstream>
//#include <limits>
//#include <algorithm>
#include "day"
//-----------... | ALGO | 0.996185 | 7.013968 |
aff61d1e-0aba-4b4b-af2f-66943a42202a | ishandutta2007/codeforces | jiangly/normal/1379/C.cpp | #include <bits/stdc++.h>
int main() {
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
int t;
std::cin >> t;
while (t--) {
int n, m;
std::cin >> n >> m;
std::vector<int> a(m), b(m);
for (int i = 0; i < m; ++i)
std::cin >> a[i] >> b[i];
std:... | ALGO | 0.999956 | 4.082502 |
adb5f769-7f46-4221-adf4-33ba32865637 | nickdoa/cplusplus-fundamentals | BubbleSort.cpp | #include <iostream>
void sort(int array[], int size);
int main() {
int array[] = {10, 4, 2, 7, 8, 1, 3, 5, 9, 6};
int size = sizeof(array)/sizeof(array[0]);
sort(array, size);
for(int element : array) {
std::cout << element << " ";
}
}
void sort(int array[], int size) {
int te... | ALGO | 0.999879 | 4.708222 |
94198ed9-9b92-45bc-90bc-4af66d8f0dad | sikha22/PDA_Problems | PDA/Construct a Full Binary Tree.cpp | //{ Driver Code Starts
//Initial Template for C++
#include<bits/stdc++.h>
using namespace std;
struct Node
{
int data;
struct Node *left;
struct Node *right;
Node(int x){
data = x;
left = NULL;
right = NULL;
}
};
// } Driver Code Ends
/* Structre of the Node of the Binary Tree is as follows
stru... | ALGO | 0.999954 | 6.466439 |
1bed595e-f8fb-4906-8758-bbfdac9f7460 | Surajgupta63/Graph | 1319. Number of Operations to Make Network Connected.cpp | // Using Disjoint Set Union (DSU)
// T.C : O(V+E)
// T.C : O(V)
class Solution {
public:
vector<int> parent;
vector<int> rank;
int find(int i){
if(i == parent[i]) return i;
return parent[i] = find(parent[i]);
}
void Union(int x, int y){
int x_parent = find(x);
int y_... | ALGO | 0.999893 | 5.836912 |
4e853a9b-87eb-4b44-a4fc-88ce61f27f8c | zeroku-coder/c-c- | binaryserach.cpp | #include<stdio.h>
#define max 20
using namespace std;
void main()
{
int a[max],i,e,n,mid,top,min;
min=0,top=n-1;
printf("enter the number of element in array \n");
scanf("%d",&n);
printf("enter the element in sorted from:");
for(int i;i<n;i++)
{
scanf("%d",&a[i]);
}
printf("... | ALGO | 0.999942 | 3.346617 |
5a6b1e90-f165-4e61-aaef-75e9288fe529 | syntacore/snippy | libcxx/test/std/containers/sequences/vector/vector.cons/move_alloc.pass.cpp | // UNSUPPORTED: c++03 && !stdlib=libc++
// <vector>
// vector(vector&& c, const allocator_type& a);
#include <vector>
#include <cassert>
#include "test_macros.h"
#include "MoveOnly.h"
#include "test_allocator.h"
#include "min_allocator.h"
#include "asan_testing.h"
TEST_CONSTEXPR_CXX20 bool tests()
{
{
s... | TEST | 0.866865 | 6.221698 |
e551d14a-6896-4291-896d-934f853da748 | jain02/Hackerrank | bsrand - Copy.cpp | #include<stdio.h>
#include<stdlib.h>
#include<time.h>
int selectionsort(int Ar[]);
int binearysearch(int A[],int ,int ,int );
int main()
{
int a[100000],i,key,f=0,l,m;
time_t end,start;
double tc;
for(i=0;i<100000;i++)
{
a[i]=rand();
}
printf("ELEMENTS ARE: \n");
for(i=0;i<100000;i++)
{
printf("%d\n",a[i]... | ALGO | 0.999935 | 3.950716 |
f50549b1-d4c8-4ad2-84bb-ab6a8c4d9580 | CuuvuivevaSoixam/code | CodePTIT - DSA/DSA02027 - NGƯỜI DU LỊCH.cpp | // https://code.ptit.edu.vn/student/question/DSA02027
// NGƯỜI DU LỊCH
#include <bits/stdc++.h>
using namespace std;
int n, minKc, ans;
int a[20][20], vs[20];
void Try(int ind, int cou, int val) {
//! nếu chi phí hiện tại + chi phí tối thiểu để đi (n - k + 1) tp còn lại >= ans thì k cần đi nữa vì chắc chắn k tối... | ALGO | 0.999918 | 3.679855 |
49352a7a-783e-4f14-890d-ba1370a1b955 | padabap/wcipeg | WC96 - Plentiful Paths.cpp | #include<cstdio>
#include<cstring>
using namespace std;
int a[101][101];
//go from 1, 1 to m, n
int maxi(int x, int y)
{
if (x>y)
return x;
else
return y;
}
int main()
{
int m, n, x, y, i, j;
bool a[101][101];
int dist[101][101];
memset(a, false, sizeof(a));
memset(dist, 0, sizeof(dist));
//freopen("test... | ALGO | 0.999579 | 3.134847 |
4743ad36-cfb7-4747-908f-380f431ff6ed | ishandutta2007/codeforces | stonejjun/normal/1497/D.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef double dl;
typedef pair<dl,dl> pdi;
typedef pair<ll,ll> pii;
#define ff first
#define ss second
#define ep emplace_back
#define eb emplace
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
//cout<<fixed;
//cou... | ALGO | 0.999985 | 4.023673 |
e13270a7-eb22-4503-8a2a-1c3dcffd3f1f | giovanni-orciuolo/vitruvia | Vitruvia/SourceSDK/Classes/Maths/Maths.cpp | #include "Maths.h"
SOURCE_INIT
MATHS_INIT
RandomSeedFn RandomSeed;
RandomFloatFn RandomFloat;
RandomFloatExpFn RandomFloatExp;
RandomIntFn RandomInt;
RandomGaussianFloatFn RandomGaussianFloat;
// TEAMGAMERFOOD TRIGGERED >:(((((((
inline void SinCos(float radians, float *sine, float *cosine)
{
_asm
{
fld DWORD P... | ALGO | 0.993562 | 6.0197 |
bb128310-4cab-4058-9447-61f0a69ec562 | Hotchain-HOTX/Hotchain | src/merkleblock.cpp | #include "merkleblock.h"
#include "hash.h"
#include "primitives/block.h" // for MAX_BLOCK_SIZE
#include "utilstrencodings.h"
using namespace std;
CMerkleBlock::CMerkleBlock(const CBlock& block, CBloomFilter& filter)
{
header = block.GetBlockHeader();
vector<bool> vMatch;
vector<uint256> vHashes;
vM... | ALGO | 0.998857 | 5.939562 |
24ddffb2-75fb-4c33-bb91-ae4b57df83d2 | NirSeg/CSES | CSES Problem Set/Introductory Problems/bitStrings.cpp | #include <bits/stdc++.h>
using namespace std;
#define int int64_t
int modulo = 1e9 + 7;
int bitStrings(int n){
if (n == 1)
return 2;
int s = bitStrings(n / 2);
return (s * s << (n % 2)) % modulo;
}
signed main(){
int n;
cin >> n;
cout << bitStrings(n);
} | ALGO | 0.999964 | 5.476516 |
fa9bce2e-763d-4e57-942e-d8469563601e | MetalBall887/Competitive-Programming | CodeForces/CF815-D1-C.cpp | #include <bits/stdc++.h>
using namespace std;
//dp_x[i][j] - the minimum price to buy i itmes from first j children of x, where 0-th children is x itself. dp_x can be computed in
//O(N^2) by knapsack dp technique. But important is, the whole algorithm will be O(N^2) too. Each pair of vertices will both be
//descendan... | ALGO | 0.999892 | 4.032419 |
cfd92647-0332-4cac-bf62-8553410a14d6 | brentharts/inkscape_lib2geom | src/2geom/solve-bezier.cpp | #include <2geom/solver.h>
#include <2geom/choose.h>
#include <2geom/bezier.h>
#include <2geom/point.h>
#include <cmath>
#include <algorithm>
/*** Find the zeros of a Bezier. The code subdivides until it is happy with the linearity of the
* function. This requires an O(degree^2) subdivision for each step, even when... | ALGO | 0.999917 | 4.521667 |
57752f8a-619d-4bd7-acd6-2151fbae1b9b | tado/openFrameworks_workshop12_day1 | 25_OpencvParticle/src/particle.cpp | #include "particle.h"
#include "ofMain.h"
//------------------------------------------------------------
particle::particle(){
setInitialCondition(0,0,0,0);
damping = 0.08f;
}
//------------------------------------------------------------
void particle::resetForce(){
// we reset the forces every frame
frc.s... | ALGO | 0.962985 | 5.972359 |
c5245021-6484-4549-9a11-a47535ed80f4 | JaberYan/Basic_Data_Structure | MODUEL_14/QUEUE-USING_STL.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
queue<int> q;
int n;
cin>>n;
for(int i=0;i<n;i++)
{
int x;
cin>>x;
q.push(x);
}
while (q.empty()==false)
{
cout<<q.front()<<endl;
q.pop();
}
return 0;
} | ALGO | 0.999763 | 3.973889 |
4c3d1335-5f39-46e9-ac93-0ee838ba2159 | EuiSeong-Moon/Algorithm | Baekjoon/감시.cpp | #include<iostream>
#include<vector>
using namespace std;
class Node {
public:
pair<int, int> pos;
int camera;
int size;
};
int map[8][8];
int check(int N,int M,vector<Node>& nodes,vector<int>& types) {
int buf_map[8][8];
for (int i = 0; i < N; i++) {
for (int j = 0; j < M; j++) {
buf_map[i][j] = map[i][j];
... | ALGO | 0.999709 | 4.819406 |
285d00a5-3414-4271-ae1b-cfee5081f4a5 | GregWagner/Sudoku | Solver/unique_unit.cpp | #include <stdio.h>
#include <stdlib.h>
#include "cleanup_around.h"
#include "def.h"
#include "remove_candidate.h"
#include "unique_unit.h"
int unique_unit(char *what, char unit[9][2]) {
#ifdef LOG_IN_OUT
printf("--- unique_unit (%s) >>>\n", what);
#endif
int result = FALSE;
int r[10]; for (int i = 0; i < 10; i++... | ALGO | 0.990465 | 4.854892 |
b77cab47-cf51-40ca-8c3e-751396ead878 | Mehedi-Hasan-Rabbi/Online-Judge-Solution | CodeChef/START96D - C. Weeding.cpp | // In the name of Allah the merciful.
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
#define endl '\n'
#define yes cout << "Yes" << endl
... | ALGO | 0.999955 | 4.201996 |
eb224678-601d-4379-b072-cd70243518c8 | chanbi428/Algorithm | DP/[BOJ]11053_가장 긴 증가하는 부분 수열.cpp | #include <bits/stdc++.h>
using namespace std;
int DP[10001];
int num[10001];
int main(int argc, char** argv) {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
// freopen("input.txt", "rt", stdin);
int n, i, j, res, rres=0;
cin>>n;
for(i=1;i<=n;i++){
cin>>num[i];
res=0;
for(j=0;j<i;j++){
if(num[i]>nu... | ALGO | 0.999971 | 3.843363 |
8552457f-32ae-4fad-a1a7-a0db115569a6 | Mohamed-Adel2/LeetCode-Solutions | 1798-max-number-of-k-sum-pairs/max-number-of-k-sum-pairs.cpp | class Solution {
public:
int maxOperations(vector<int>& nums, int k) {
sort(nums.begin(), nums.end());
int left = 0, right = nums.size() - 1, ops = 0;
while(left < right){
if(nums[left] + nums[right] == k)
++ops, ++left, --right;
else if(nums[left] + n... | ALGO | 0.999953 | 6.150381 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.