uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
c2d43cbc-e775-4219-aa06-d77149d25556 | KrSahil/Projects | DSA Level Up Prateek Narang/Graph Problem Solving/SnakeAndLadder.cpp | #include<iostream>
#include<queue>
#include<list>
using namespace std;
class Graph{
int V;
list<int>*l;
public:
Graph(int v){
V=v;
l = new list<int>[V+1];
}
void addEdge(int i, int j){
l[i].push_back(j);
}
int minCostBFS(int source, int dest){
queue<in... | ALGO | 0.999532 | 5.264673 |
efeecb8a-48fc-4649-83ca-82b4a6d7121c | aadeshp1/AILab | missionaries_and_cannibals_DFS.cpp | #include <iostream>
#include <vector>
using namespace std;
const int MAX_MISSIONARIES = 3;
const int MAX_CANNIBALS = 3;
struct State
{
int missionariesLeft;
int cannibalsLeft;
int boat;
int missionariesRight;
int cannibalsRight;
};
bool is_valid(const State &state)
{
if (state.missionariesLe... | ALGO | 0.999919 | 5.566787 |
5b2fdfd6-0441-4a74-b906-9f0cdffbe7ba | shiver/blaze-lib | blazemark/src/gmm/TSMatTSMatMult.cpp | //=================================================================================================
//=================================================================================================
//*************************************************************************************************
// Includes
//****... | ALGO | 0.999548 | 5.885384 |
35275c18-a04e-4934-ad07-7720833ff052 | kiran-yadav-13/DSA | Queues/CicularTour.cpp | // { Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
struct petrolPump
{
int petrol;
int distance;
};
// } Driver Code Ends
/*
The structure of petrolPump is
struct petrolPump
{
int petrol;
int distance;
};*/
/*You are required to complete this method*/
class Solution{
public:
... | ALGO | 0.999738 | 5.403438 |
394f7e9e-1de9-49e4-ba6c-c243f084d1e7 | panzerhong/C-ADD-ADD | Advance Concept in C++/Class Template.cpp | #include<iostream>
using namespace std;
template<class T>
class min_max
{
public :
int min(T&a, T&b)
{
return (a<b)? a:b;
}
int max(T&a, T&b)
{
return (a>b)? a:b;
}
};
int main()
{
int a,b,result;
cout<<"Enter any two number to find mininum of ";cin>>a>>b;
result = min(a,b);
cout<<"\nMinimum... | ALGO | 0.998557 | 4.028666 |
17cc055c-bc5e-4196-9b1f-4565b21dc15c | sachinprasanna7/DSA-Everyday | Day 8/ConvertTheTemperature.cpp | #include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
vector<double> convertTemperature(double celsius) {
vector<double> ans;
ans.push_back(celsius + 273.15);
ans.push_back(celsius*1.80 + 32.00);
return ans;
}
};
int main(){
return 0;... | ALGO | 0.979672 | 5.133251 |
cd58c92a-3da9-4ae7-9336-c3946d3234ca | raincross7/code-similarity | codes/train_code/problem095/problem095_400.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
string s1,s2,s3;
int henkan = 'A'-'a';
cin >> s1 >> s2 >> s3;
char a=s1.at(0)+henkan;
char b=s2.at(0)+henkan;
char c=s3.at(0)+henkan;
cout << a << b << c << endl;
} | ALGO | 0.999713 | 3.621809 |
61e1e6cc-105d-4ead-a6b1-b172a50d633b | Mytherin/minimal-icu-collation | icu/i18n/collationrootelements.cpp | #include "unicode/utypes.h"
#if !UCONFIG_NO_COLLATION
#include "collation.h"
#include "collationrootelements.h"
#include "uassert.h"
U_NAMESPACE_BEGIN
int64_t
CollationRootElements::lastCEWithPrimaryBefore(uint32_t p) const {
if(p == 0) { return 0; }
U_ASSERT(p > elements[elements[IX_FIRST_PRIMARY_INDEX]]);... | ALGO | 0.966343 | 7.259431 |
7a9a1375-5abc-40bb-927b-f7f888306b0f | chuprakov/trilinos | packages/ifpack/src/Ifpack_UserPartitioner.cpp | #include "Ifpack_ConfigDefs.h"
#include "Ifpack_Partitioner.h"
#include "Ifpack_OverlappingPartitioner.h"
#include "Ifpack_UserPartitioner.h"
#include "Epetra_CrsGraph.h"
//==============================================================================
int Ifpack_UserPartitioner::ComputePartitions()
{
if (Map_ == ... | ALGO | 0.996246 | 4.820139 |
d7458600-0aff-493e-af82-9c23d23d6797 | Nakib-Arman/CSE318---ArtificialIntelligence | 3.ChainReaction/.history/main_20250609214301.cpp | #include <bits/stdc++.h>
using namespace std;
class Cell {
int orb_num;
int critical_mass;
char color;
public:
Cell() {
this->orb_num = 0;
this->color = 'W';
this->critical_mass = 4;
}
// Cell(int orb_num, char color) {
// this->orb_num = orb_num;
// t... | ALGO | 0.997884 | 4.00033 |
4776e43c-5e93-4435-81ab-b318cec4a197 | SAIGOWTHAM0306/Leetcode | 11-container-with-most-water/container-with-most-water.cpp | class Solution {
public:
int maxArea(vector<int>& height) {
int left=0,right=height.size()-1;
int maxWater=0;
while(left<=right){
int mini=min(height[left],height[right]);
maxWater=max(maxWater,mini*(right-left));
if(height[left]<height[right]){
... | ALGO | 0.999975 | 6.728058 |
cbdbe001-3f55-433a-b0e3-b769532c6f9d | FicoBR20/SO_Laborarorio_1 | display_numbers.cpp | #include<iostream>
#include <string>
#include <vector>
#include <math.h>
#include <sstream>
#include <bits/stdc++.h>
using namespace std;
/**
* funcion que entrega el mayor exponente de factores de 2
* que contiene x.
* TAL CUAL como log2(x)
* x <= pow(2, [pot_Dos(x)])
* |---> valor que entrega... | ALGO | 0.953121 | 4.326653 |
3aea9e42-4cd7-4d10-bd4e-857358990ad3 | EnzoFerrari430/Cpp-primer5th | chapter5/5-4-2作业1.cpp | #include <iostream>
#include <vector>
using namespace std;
int main()
{
/*
5.15 a ѭixsz ixforѭڲ壬
5.15 b ixҪʼ
5.15 c 2 ++ һʼѭͳѭ
*/
int i,sum,i2,sum2,num,num2;
sum = sum2 = 0;
vector<int> vi;
for(i = 1; i <= 10 ;++i)
{
sum += i;
}
i2 = 1;
while(i2 ... | ALGO | 0.986384 | 3.144625 |
61e45a2f-01af-4763-9bcb-12313bb2f43d | NotSimone/foo_cnn_bpm | include/librosa/eigen3/doc/special_examples/Tutorial_sparse_example_details.cpp | #include <Eigen/Sparse>
#include <vector>
#include <QImage>
typedef Eigen::SparseMatrix<double> SpMat; // declares a column-major sparse matrix type of double
typedef Eigen::Triplet<double> T;
void insertCoefficient(int id, int i, int j, double w, std::vector<T>& coeffs,
Eigen::VectorXd& b, con... | ALGO | 0.999057 | 5.388735 |
d1da577c-c9be-4314-b9db-627a7a20eebc | wdndev/personal | leetcode/03_algo_note/01_algo_array/1.5_double_pointer/345.反转字符串中的元音字母.cpp | /*
* @lc app=leetcode.cn id=345 lang=cpp
*
* [345] 反转字符串中的元音字母
*
* https://leetcode.cn/problems/reverse-vowels-of-a-string/description/
*
* algorithms
* Easy (54.66%)
* Likes: 340
* Dislikes: 0
* Total Accepted: 186.9K
* Total Submissions: 341.8K
* Testcase Example: '"hello"'
*
* 给你一个字符串 s ,仅反转字符串... | ALGO | 0.999499 | 6.485474 |
21a60d6e-b866-4ba1-a3ed-fca040d1ca11 | Ultraschall/ultraschall-hub | PublicUtility/CASpectralProcessor.cpp | //#include "AudioFormulas.h"
#include "CASpectralProcessor.h"
#include "CABitOperations.h"
#include <Accelerate/Accelerate.h>
#define OFFSETOF(class, field)((size_t)&((class*)0)->field)
CASpectralProcessor::CASpectralProcessor(UInt32 inFFTSize, UInt32 inHopSize, UInt32 inNumChannels, UInt32 inMaxFrames)
: mFFTSize(... | ALGO | 0.987348 | 4.949773 |
471620e1-602a-46c5-9aae-fe970e1a96a9 | SWEG-2014-EC-Batch/META | FoP-I/Leul Alemayehu Gessesse/SymbolChecker.cpp | #include <iostream>
#include <ctype.h>
int main(){
char symbol;
std::cout << "Input variable to check: ";
std::cin >> symbol;
if(isupper(symbol)){
std::cout << symbol << " is an uppercase alphabetic character. Also, ";
if(symbol == 'A' || symbol == 'E' || symbol == 'I' || symbol == 'O' |... | ALGO | 0.995251 | 3.851022 |
da776ac0-e107-4354-8e09-6a70b0900cc5 | realcoin/realcoin | src/key.cpp | #include <map>
#include <openssl/ecdsa.h>
#include <openssl/obj_mac.h>
#include "key.h"
// Generate a private key from just the secret parameter
int EC_KEY_regenerate_key(EC_KEY *eckey, BIGNUM *priv_key)
{
int ok = 0;
BN_CTX *ctx = NULL;
EC_POINT *pub_key = NULL;
if (!eckey) return 0;
const EC_... | TOOL | 0.964427 | 7.220924 |
15db0a70-1f24-4abb-9873-2b258ad9af0a | RyoSci/AtCoder | くじかつ/20220706/b.cpp | // #define _GLIBCXX_DEBUG
#include <algorithm>
#include <atcoder/all>
#include <atcoder/modint>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
using namespace atcoder;
usin... | ALGO | 0.999991 | 4.509094 |
d9c07fce-6cfd-4753-89e1-f82e2bb9e37d | jungahshin/algorithm | c:c++/LeetCode_72.cpp | class Solution {
public:
int minDistance(string word1, string word2) {
int n = word1.size();
int m = word2.size();
int dp[502][502] = {0, };
for(int i=1; i<=n; i++){
dp[i][0] = i;
}
for(int j=1; j<=m; j++){
dp[0][j] = j;
... | ALGO | 0.999989 | 5.952428 |
f9374462-e5a3-4ba0-9375-2f15b94285ad | 21omkarsase/CPP | Data Structures/Hashing/1.cpp | #include <iostream>
#include <math.h>
using namespace std;
#define MAX 1000
bool hashTable[MAX + 1][2]; /// globally declared assign all values=0;
bool search(int x)
{
if (x >= 0)
{
if (hashTable[x][0])
{
return true;
}
return false;
}
else
{
x =... | ALGO | 0.999954 | 4.837508 |
077386c7-7bf0-4b75-a7ba-09e78059aa69 | ishandutta2007/codeforces | kalptaru/normal/1359/D.cpp | #include <bits/stdc++.h>
#include <string>
#include <cmath>
#include <sstream>
//#include <unordered_map>
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define FORD(i, a, b) for(int i = (a-1); i >= (b); i--)
#define pb(a) push_back(a)
#define mp(a,b) make_pair(a,b)
typedef long long int ll;
using namespace std;
... | ALGO | 0.999548 | 3.673371 |
b41a46a0-c15f-405a-998b-592a5ed767df | ishandutta2007/codeforces | deemo/normal/3/D.cpp | #include<iostream>
#include<string>
#include<algorithm>
#include<set>
#include<utility>
#include<vector>
using namespace std;
typedef long long ll;
#define F first
#define S second
const int MAXN = 5e4 + 10;
const ll INF = 1e11;
ll ans;
pair<ll, ll> vec[MAXN];
int n;
string s;
multiset<pair<ll, ll>> st;
int main(... | ALGO | 0.99988 | 3.470209 |
5baf5334-9aba-4205-ba07-2a7d354b1840 | siiyayu/Yandex-MIPT-Cpp-specialization | others/Тесты для функции IsPalindrom/main.cpp | #include <iostream>
#include <map>
#include <set>
#include <sstream>
#include <stdexcept>
#include <string>
#include <vector>
using namespace std;
template <class T>
ostream& operator << (ostream& os, const vector<T>& s) {
os << "{";
bool first = true;
for (const auto& x : s) {
if (!first) {
... | TEST | 0.866547 | 5.739937 |
59da3113-1843-4eb7-84e0-b1ad7b2e4cf2 | IprahimThsanTutuncu/LOG725 | petite vie/dependencies/glm/test/gtx/gtx_simd_mat4.cpp | ///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentatio... | TEST | 0.986111 | 6.515547 |
1fd42a42-bf25-478c-a477-90047749661a | rks-031/DSA-codehelp-LB | Recursion/calculating_power.cpp | #include <bits/stdc++.h>
using namespace std;
int calculatePower(int x, int n)
{
if (n == 0)
{
return 1;
}
int ans = calculatePower(x, n / 2);
// even
if (n % 2 == 0)
{
return ans * ans;
}
else
{
... | ALGO | 0.99997 | 5.542385 |
37066a5a-4e44-4f2c-ae38-e41a1a0be6a4 | Andreixzc/neet_code | cpp/backtrack/combinationSum2.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define all(x) x.begin(), x.end()
#define endl '\n'
void dfs(vector<vector<int>>& ans,
vector<int>& candidates,
vector<int>& current,
int target,
int start,
int sum) {
if (sum == t... | ALGO | 0.999931 | 5.620139 |
6bb72b8e-6708-4c33-8713-8efc5ac64327 | ishandutta2007/codeforces | t1dus/normal/1109/A.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define int ll
typedef vector <int> vi;
typedef vector<vi> vvi;
typedef map<int,int> mii;
typedef pair<int,int> pii;
#define pb push_back
#define INF 1000000000
#define mp make_pair
#define MOD 1000000007
#define F first
#define S second
const double ... | ALGO | 0.99999 | 3.897145 |
7d0b3cf5-b8c7-43da-b994-5bd72321a0f6 | hack-parthsharma/LeetCode | 2374-node-with-highest-edge-score/2374-node-with-highest-edge-score.cpp | class Solution {
public:
int edgeScore(vector<int>& edges) {
vector<long long> scores(edges.size());
for (int i = 0; i < edges.size(); ++i)
scores[edges[i]] += i;
return max_element(begin(scores), end(scores)) - begin(scores);
}
};
| ALGO | 0.998993 | 5.432721 |
9a5caa95-1d64-434d-a04f-e16ad20e1ad9 | cs308lap/group_9 | gcd.cpp | #include <bits/stdc++.h>
#include <iostream>
using namespace std;
int gcd(int a, int b)
{
if (a == 0)
return b;
else if (b == 0)
return a;
if (a == b)
return a;
if (a > b)
return gcd(a-b, b);
return gcd(a, b-a);
}
int main()
{
int a ,b;
cin>>a;
cin>>b;
cout << gcd(a, b) << end... | ALGO | 0.999422 | 4.499613 |
5b094823-7367-49f1-889d-292a6d6a1294 | UestcXiye/C-Primer-Plus-exercise | chapter10/10.4.cpp | #include <stdio.h>
#include <stdlib.h>
int arr_max_index(double arr[], int n);
int main(void)
{
double a[5] = {1.0, 3.0, 5.0, 7.0, 9.0};
printf("The index of the max element in array is %d.\n", arr_max_index(a, 5));
system("pause");
return 0;
}
int arr_max_index(double arr[], int n)
{
double max = ... | ALGO | 0.999957 | 4.980182 |
d0cdf000-877d-4d89-9872-a8cdb6f8c48c | irina-rud/concurrency | MPI/CTorus.cpp | //
// Created by riv on 10.09.16.
//
#include "CTorus.h"
CTorus::CTorus(int len, int heig) : length(len), height(heig) {
torus.resize(length * height, notchanged);
}
void CTorus::set(std::vector<int> &input) {
torus = input;
}
int CTorus::getHeight() {
return height;
}
int CTorus::getLength() {
ret... | ALGO | 0.999248 | 4.33912 |
68edff3b-e4d1-46b9-be22-596bf9757362 | lizhe960118/Machine-Learning | C++_code/quick_learn/yinyong.cpp | #include <iostream>
using namespace std;
double vals[] = {10.1, 12.6, 33.1, 24.1, 50.0};
double& setValues(int i){
return vals[i];
}
int main(){
cout << "value before change" << endl;
for(int i=0; i < 5; i++){
cout << "vals[" << i << "]=";
cout << vals[i] << endl;
}
setValues(1) = 20.23;
// һʱһֵָʽ... | ALGO | 0.990661 | 3.386378 |
805f5e91-3c30-4d93-9d03-fead2c238339 | ishandutta2007/codeforces | asuka/normal/1555/F.cpp | #include<bits/stdc++.h>
#define ll long long
#define N 500015
#define rep(i,a,n) for (int i=(a);i<=(n);i++)
#define per(i,a,n) for (int i=(n);i>=(a);i--)
#define inf 0x3f3f3f3f
#define infll 0x3f3f3f3f3f3f3f3f
#define pb push_back
#define mp make_pair
#define pii pair<int,int>
#define fi first
#define se second
#define... | ALGO | 0.999946 | 4.398985 |
beb2d92e-7e02-4d15-a91e-613ced6279af | coderheck/learning-programming-languages | why-am-i-learning-cpp-now/grade-9/TrenTruong/feb 13th 2025/loonglqd_13-2-2025_sang/pstoigian.cpp | #include"iostream"
using namespace std;
#define ll long long
ll gcd(ll a,ll b){return(b==0)?a:gcd(b,a%b);}
ll a,b,gc;
int main(){
cin>>a>>b;gc=gcd(a,b);a/=gc;b/=gc;
if(b<0){
cout<<a*-1<<"/"<<b*-1;
}else{
cout<<a<<"/"<<b;
}
} | ALGO | 0.999686 | 4.400531 |
5d4e5925-48c5-4671-8ae5-2c9708b09655 | edwu0029/LeetCode-Solutions | Medium/49. Group Anagrams/GroupAnagrams.cpp | /*
LeetCode Medium: 49. Group Anagrams
https://leetcode.com/problems/group-anagrams/description/
Brief Solution Explanation:
N = Length of strs
M = Maximum Length of strs[i] for 0<=i<N
- We can generate a frequency array, freq, for each string, str[i] to figure out the anagram groups
- freq[j] = Number of times ch... | ALGO | 0.999988 | 6.941464 |
4a518368-1313-40ab-9a80-15c52930bbc9 | ihaagrawal/Leetcode-Daily-Questions | Day-0256: 1829. Maximum XOR for Each Query.cpp | // 1829. Maximum XOR for Each Query (MEDIUM)
// https://leetcode.com/problems/maximum-xor-for-each-query/description/?envType=daily-question&envId=2024-11-08
class Solution {
public:
vector<int> getMaximumXor(vector<int>& nums, int maximumBit) {
int n = nums.size(), xr = nums[0], max_xor = pow(2, maximumBi... | ALGO | 0.999969 | 5.679104 |
3cc649bb-3ab8-4872-ac5f-c49a42aa2c72 | fengchiyiya/C- | 0~n-1中缺失的数字.cpp | /*一个长度为n-1的递增排序数组中的所有数字都是唯一的,并且每个数字都在范围0~n-1之内。
在范围0~n-1内的n个数字中有且只有一个数字不在该数组中,请找出这个数字。
*/
#include<vector>
#include<iostream>
using namespace std;
//二分法:注意如何寻找判断条件。数组是递增且数字唯一的,可以判断是否相等。
//如果数组的数组递增,且不唯一,可以判断是否大于等于等。
class Solution {
public:
//注意递增排序数组中是从0开始的
int missingNumber(vector<int>& nums) {
if (nu... | ALGO | 0.999439 | 4.456248 |
1fdd6c8d-fff8-4959-882b-b44b102769e8 | pingchungchang/CP | CF1551B2.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pll pair<ll,ll>
#define pii pair<int,int>
#define fs first
#define sc second
#define io ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ld long double
void solve(){
int n,k;
cin>>n>>k;
vector<pii> v(n);
vector<set<int>> used(k+1);
... | ALGO | 0.999988 | 3.88482 |
7a2914ba-7988-4e01-b5c8-6ce467da651b | mmz-zmm/LeetCode | 0011-Container-With-Most-Water.cpp | class Solution {
public:
int maxArea(vector<int>& height) {
/*
双指针法,从两端到中间进行扫描
*/
int left = 0;
int right = height.size() - 1;
int max_area = 0;
while(left < right){
max_area = max(max_area, min(height[left], height[right]) *(right - left));
... | ALGO | 0.999963 | 6.519543 |
bc8d0cd1-4030-48d0-828a-3814905b6a0d | kkpan11/apple-llvm-project | libcxx/test/std/algorithms/alg.nonmodifying/alg.starts_with/ranges.starts_with.pass.cpp | // <algorithm>
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
// template<input_iterator I1, sentinel_for<I1> S1, input_iterator I2, sentinel_for<I2> S2,
// class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity>
// requires indirectly_comparable<I1, I2, Pred, Proj1, Proj2>
// c... | TEST | 0.856667 | 7.323939 |
9b694520-84ac-4928-98f7-f83bb22a5b79 | hansol4412/algorithm | number76_3.cpp | #include <stdio.h>
using namespace std;
int dy[20][20];
int C(int n, int r){
if(dy[n][r]>0) return dy[n][r]; // ʰ ߺǴ .
if(n==r || r==0) return 1;
else return dy[n][r] = C(n-1, r) + C(n-1,r-1);
}
int main() {
//76_3. װ
/*װ N Ҹ տ R Ҹ ̾ κ
nCr ǥѴ. */
// ̼
int n;
printf("n ԷϽÿ: ... | ALGO | 0.99902 | 4.336534 |
89fdc639-082d-4ad9-8dbd-ca25b294160b | KlausEusford/Chinese-English-recognize | lstm/parallel.cpp | #include "parallel.h"
#ifdef _OPENMP
#include <omp.h>
#endif
#include "functions.h" // For conditional undef of _OPENMP.
#include "networkscratch.h"
namespace tesseract {
// ni_ and no_ will be set by AddToStack.
Parallel::Parallel(const STRING& name, NetworkType type) : Plumbing(name) {
type_ = type;
}
Paralle... | ALGO | 0.956735 | 7.560051 |
d86bf107-81a4-4ed0-bad6-b65e6b29e697 | ishandutta2007/codeforces | natsugiri/normal/1673/B.cpp | #pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
#pragma GCC optimize("unroll-loops")
#include<stdio.h>
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<string.h>
#ifdef LOCAL
#define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
#define NDEBUG
#define eprintf(...) do {} while... | ALGO | 0.999905 | 4.322957 |
a6d63cc7-6c6b-439e-af95-5e4bca5ac497 | ayush010898/ADA-LAB | sodoku.cpp | #include <iostream>
using namespace std;
#define UNASSIGNED 0
#define N 9
bool FindUnassignedLocation(int grid[N][N], int &row, int &col);
bool isSafe(int grid[N][N], int row, int col, int num);
bool SolveSudoku(int grid[N][N])
{
int row, col;
if (!FindUnassignedLocation(grid, row, col))
return true;... | ALGO | 0.999958 | 6.483567 |
4bfba2f7-edbe-4c2d-b9f7-f4a00679a868 | serbantasss/Competitive-Programming | Infoarena/Cpal/cpal.cpp | #include<fstream>
using namespace std;
int main()
{
ifstream in("cpal.in");
ofstream out("cpal.out");
int t=10,f,nr,p;
while(t--)
{
nr=0;
p=0;
for(int i=1;i<=9;i++)
{
in>>f;
if(f)
p=1;
nr+=f%2;
}
if(n... | ALGO | 0.999719 | 3.255327 |
4be58ec4-2529-464b-ae7d-1be4aa443222 | Elfo69/invert-core-master | tests/CoreTests/Chaingen.cpp | #include "Chaingen.h"
#include <vector>
#include <iostream>
#include <stdint.h>
#include <boost/archive/binary_oarchive.hpp>
#include <boost/archive/binary_iarchive.hpp>
#include <boost/program_options.hpp>
#include "Common/CommandLine.h"
#include "CryptoNoteCore/CryptoNoteBasic.h"
#include "CryptoNoteCore/CryptoNot... | TOOL | 0.892227 | 4.868166 |
1f2be7e0-b6d5-4003-9c95-093e28d70dfd | WildfootW/Online-Judge | UVa Online Judge/441/UVa441.cpp | // backtracking
// WildfootW 2018
// https://github.com/Wildfoot
// Accepted
#include <iostream>
#include <ctime>
#define INF 2147483647
#define EPS 1e-9
using namespace std;
#define MAX 13
static int arr[MAX], ans[6], k;
void backtrack(int remain_num, int ptr)
{
if(!remain_num)
{
for(int i = 0;i ... | ALGO | 0.9998 | 3.776582 |
99bed488-74e4-4602-8ed7-e88cabd753b6 | yangchang-n/study-cpp | acmicpc/11053_S2_가장 긴 증가하는 부분 수열.cpp | #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
int N;
cin >> N;
vector<int> nm(N);
vector<int> tb(N, 1);
for (int i = 0; i < N; ++i) cin >> nm[i];
for (int i = 0; i < N; ++i)
{
for (int j = i - 1; j >= 0; --j)
... | ALGO | 0.999914 | 4.09383 |
0da77c85-f6c0-4038-be15-61aaa5da89c7 | Wanger-SJTU/leetcode-solutions | cpp/166.分数到小数.cpp | #include "leetcode.h"
class Solution {
public:
string fractionToDecimal(int numerator, int denominator) {
if(denominator==0) return "";//边界条件,分母为0
if(numerator==0) return "0";//边界条件,分子为0
string result;
//转换为longlong防止溢出
long long num = static_cast<long long>(numera... | ALGO | 0.999584 | 6.49082 |
f220dc9e-2419-4e07-88e4-e0ed7449dab4 | shiyangyang24/hdl_graph_slam_plus | src/hdl/src/hdl_graph_slam/map_cloud_generator.cpp | #include <hdl_graph_slam/map_cloud_generator.hpp>
#include <pcl/octree/octree_search.h>
namespace hdl_graph_slam {
MapCloudGenerator::MapCloudGenerator() {
}
MapCloudGenerator::~MapCloudGenerator() {
}
pcl::PointCloud<MapCloudGenerator::PointT>::Ptr MapCloudGenerator::generate(const std::vector<KeyFrameSnapshot::... | DATA | 0.928114 | 6.8592 |
941aba51-2ce7-4f7e-b22e-bf4217310ee4 | AmritanshTiwari2160/CodeHelp-DSA-Busted-Series | Lecture051 Linked List Day8/add.cpp | class Solution
{
private:
Node* reverse(Node* head) {
Node* curr = head;
Node* prev = NULL;
Node* next = NULL;
while(curr != NULL) {
next = curr -> next;
curr -> next = prev;
prev = curr;
curr = next;
}
... | ALGO | 0.999996 | 6.210594 |
7c4e218f-4a47-4934-b44a-0bd8a97bffe0 | Rajankumar9955/CPP-Programming | Assignment of CPP/Assignment 2/ques16.cpp | #include<iostream>
using namespace std;
int main()
{
int n,reverse=0,rem;
cout<<"enter the number:";
cin>>n;
while(n!=0)
{
rem=n%10;
reverse=reverse * 10 + rem;
n=n/10;
}
cout<<"Reverse number:"<<reverse;
}
/*
output:-
enter the number:1234
Reverse number:4321
*/ | ALGO | 0.99956 | 3.789864 |
781f75dc-32d0-4188-affd-872634907a69 | mkiuur/Knights-and-Monsters | ray-tracing/src/reflect.cpp | #include <Eigen/Core>
Eigen::Vector3d reflect(const Eigen::Vector3d & in, const Eigen::Vector3d & n)
{
return (in - (2*in.dot(n)*n)).normalized();
}
| ALGO | 0.996786 | 4.988445 |
e9208c3c-5ca2-4aab-9f97-70b93c4ca545 | DivySolanki/DSA | 7_Arrays/Easy_problems.cpp | #include <bits/stdc++.h>
using namespace std;
/*
For all the below problems. Learn in the following way
1. Brute
2. Better
3. Optimal
All the listed solution below are implemented in Optimal way.
*/
int largest_element(vector <int> &arr) {
int largest = arr[0];
for (int i = 1; i < arr.size(); i++) {
... | ALGO | 0.999718 | 4.336323 |
786e9ffb-f457-4bca-80f0-f85c1386a38c | bqmnhat/CompetitiveProgramming | BigOCoding/SkyCode/main.cpp | #include <iostream>
#include <bits/stdc++.h>
#define MaxN 10050
using namespace std;
typedef long long ll;
bool Sieve[MaxN+1];
ll cnt[MaxN+1], d[MaxN+1], p[MaxN+1], n, a[MaxN+1];
void MakeSieve() {
for (int i=1; i<=MaxN; i++)
d[i] = 1;
Sieve[0] = Sieve[1] = true;
for (int i=2; i<=MaxN; i++) {
... | ALGO | 0.99982 | 4.282854 |
b7c65fef-cfb1-4e05-a4f5-d7b1c4965d44 | AchmadRidho-07/Ridho-07 | dev c++/praktikum2.cpp | #include <iostream>
using namespace std;
int main()
{
int bilangan[5], value = 0;
cout << "Masukan 5 angka yang akan dicari angka terbesar" << endl;
for(int i = 0; i < 5; i++)
{
cout << "Masukkan Data-Datanya: ";
cin >> bilangan[i];
if(bilangan[i] > value)
value = bi... | ALGO | 0.99845 | 3.571979 |
c411e4d2-31d4-4f76-a609-d9c91c26ef18 | Divya063/programming | atcoder/141/B.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define N 100005
#define MOD 1000000007
#define dd double
#define DEBUG(x) cout << '>' << #x << ':' << x << endl;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
//ios_base& scientific (ios_base& str);
string s;
cin >> s;
ll flag = 0;
for... | ALGO | 0.999981 | 3.748995 |
50e8d872-1755-4d69-94ee-45fb1465ff82 | jkim1108/xresearch | eigen3/doc/snippets/EigenSolver_EigenSolver_MatrixType.cpp | MatrixXd A = MatrixXd::Random(6,6);
cout << "Here is a random 6x6 matrix, A:" << endl << A << endl << endl;
EigenSolver<MatrixXd> es(A);
cout << "The eigenvalues of A are:" << endl << es.eigenvalues() << endl;
cout << "The matrix of eigenvectors, V, is:" << endl << es.eigenvectors() << endl << endl;
complex<double> l... | ALGO | 0.999348 | 3.093769 |
85877c45-6b5f-42bf-9a16-eba30bcecd32 | bishopfunc/AtCoder | typical90/lv4/26.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define MAX_M 100001
// 彩色問題
// 木は必ず2部グラフらしい
//
// color -1 0 1
vector<int> G[MAX_M];
int color[MAX_M];
void dfs(int v, int c) {
// cout << "v: " << v << endl;
color[v] = c;
for (auto& u : G[v]) {
if (color[u] != -1) continue;
dfs(u, 1 -... | ALGO | 0.999992 | 4.331276 |
4e76e066-deb8-4a16-853a-335db4afe80e | ChuanF1998/Algorithm | Algorithm_53/Algorithm_53/main.cpp | /*
Ŀ
ջʵһУɶеPushPop еԪΪint͡
*/
//ջ1ԪأҪԪصʱջ1Ԫسջջ2ջ2ջԪأظ˹
//ջ2Ԫأֳָ
#include <stack>
using namespace std;
class Solution
{
public:
void push(int node) {
stack1.push(node);
}
int pop() {
while (!stack1.empty()) {
stack2.push(stack1.top());
stack1.pop();
}
int pop = stack2.top();
stack2.pop();
while... | ALGO | 0.999554 | 4.335124 |
a5679544-3e3f-422e-8220-5ea1710898ba | sadaru-hansaka/Dart-Flutter | Flutter/local_storage/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.998901 | 6.776823 |
444e3883-2ee9-42b4-9bad-2f9793cb8efb | Shakila72/IT-2 | LAB Inherritance programs/operator overloading.cpp | #include<iostream>
using namespace std;
class test
{
private:
int a,b,c;
public:
void getdata(int x, int y, int z);
void operator ();
void show();
};
void test :: getdata( int x, int y, int z)
{
a=x;
b=y;
c=z;
}
void test:: operator ()
{
a=-a;
b=-b;
c=-c;
}
void... | ALGO | 0.919847 | 3.998477 |
43119b3a-91dd-4639-945f-b38575c304a1 | NazirNayal8/KU-Algorithms-Program | Fall 2019/Week4/Contest Solutions/C - Bachgold Problem.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int n , num ;
cin >> n ;
if (n%2==0){
num = n/2 ;
cout << num << endl ;
for (int i=0 ; i< num ; ++i)
cout << 2 << " " ;
}else{
num = (n-3)/2 ;
cout << num+1 << endl ;
for (int i... | ALGO | 0.99968 | 3.184374 |
97a23f52-551b-41dd-a8e4-1299db5f6aa8 | ishandutta2007/codeforces | joeywheeler/normal/781/A.cpp | #include <bits/stdc++.h>
#define FO(i,a,b) for (int i = (a); i < (b); i++)
#define sz(v) int(v.size())
using namespace std;
vector<int> u[200005];
int c[200005];
set<int> s[200005]; int us[200005];
int n;
int mx;
void sc(int i, int cl) {
mx = max(mx,cl);
c[i] = cl;
s[i].insert(cl);
for (int j : u[i]... | ALGO | 0.999867 | 4.291844 |
0e3038d3-e6df-4303-8067-57b620120017 | Nelsonmwaura/Algorithmic-Pseudocode | LeetCode Contests/LeetCode BiWeekly Contest #10/#1213 Intersection of 3 Sorted Array/HashMap.cpp | class Solution
{
public:
vector<int> arraysIntersection(vector<int>& arr1, vector<int>& arr2, vector<int>& arr3);
};
vector<int> Solution :: arraysIntersection(vector<int>& a, vector<int>& b, vector<int>& c)
{
map<int,int> count;
for(auto ele : a)
count[ele]++;
for(auto ele : b)
... | ALGO | 0.999932 | 5.319653 |
5d653235-2116-48e7-b79b-110f68d44e92 | LinkedInLearning/training-neural-networks-in-cpp-4404365 | src/02_04e/MLP.cpp | #include "MLP.h"
double frand(){
return (2.0*(double)rand() / RAND_MAX) - 1.0;
}
// Return a new Perceptron object with the specified number of inputs (+1 for the bias).
Perceptron::Perceptron(size_t inputs, double bias){
this->bias = bias;
weights.resize(inputs+1);
generate(weights.begin(),weights.end(),frand);
... | ALGO | 0.968053 | 4.230045 |
cceacff9-0654-4a6c-9135-45055ca2b812 | kjy-robin/JYOPT | src/jyopt/question/question_hs071.cpp | #include <assert.h>
#include <jyopt/common/macro.h>
#include <jyopt/question/question_hs071.h>
namespace JYOPT
{
bool_t QuestionHs::Get_Question_Info(uint32_t& n, uint32_t& m)
{
n = 4;
m = 2;
return true;
}
bool_t
QuestionHs::Get_Bound_Info(const uint32_t& n, EVector& xl, EVector& xu, const uint32_t& m, ... | ALGO | 0.995424 | 5.379635 |
e4970bb1-fd13-4f26-b7fa-20e551ed7a7d | Vicke413/Leetcode_Problems | 1253-sort-the-matrix-diagonally/1253-sort-the-matrix-diagonally.cpp | class Solution {
public:
vector<vector<int>> diagonalSort(vector<vector<int>>& mat)
{
int n=mat.size();
int m=mat[0].size();
unordered_map<int,priority_queue<int,vector<int>,greater<int>>> pq;
for(int i=0;i<n;i++)
{
for(int j=0;j<m;j++)
... | ALGO | 0.99997 | 6.081745 |
e01cd7bd-7211-42ff-9342-781a8141313c | aditya059/LeetCode-Solutions | 0443-string-compression/0443-string-compression.cpp | class Solution {
public:
int compress(vector<char>& chars) {
int count = 1;
int index = 0;
for(int i = 1; i <= chars.size(); i++) {
if(i < chars.size() && chars[i] == chars[i - 1]) {
count++;
}
else {
chars[index] = chars[i ... | ALGO | 0.999988 | 6.453363 |
85ac0eed-61eb-4342-b85c-9d9d28939305 | JinYeJin/algorithm-study | June~October, 2020/2020-06-26/16236_이상옥.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int N;
vector<vector<int>> foods;
int di[4] = {-1,1,0,0};
int dj[4] = {0,0,-1,1};
int size = 2;
int grow = 0;
int Call_Mom = 0;
bool check(vector<int> point){
return point[0] >= 0 and point[1] >=0 and point[0] < N and point[1] < N an... | ALGO | 0.999946 | 4.004133 |
48d63d89-aa5e-4536-be48-a64fe7fc8f13 | godute/AlgoStudy | BOJ_7576_토마토/tomato_complete.cpp | // 18/1/22
// 토마토
// 유형 : bfs, dfs
// https://www.acmicpc.net/problem/7576
#include <stdio.h>
#include <queue>
using namespace std;
int N,M;
int mat[1001][1001];
int zero_cnt = 0;
queue <pair <pair <int, int >, int > > que; //
int dr[4] = {1,0,-1,0};
int dc[4] = {0,1,0,-1};
int tot_zero;
int cnt = 0;
int clk = 0;
int... | ALGO | 0.99996 | 4.665716 |
b4a5e815-b306-4143-90f3-fb830fb8e055 | Shakti184/LEETCODE | Searching an element in a sorted array - GFG/searching-an-element-in-a-sorted-array.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution{
public:
// Function to find element in sorted array
// arr: input array
// N: size of array
// K: element to be searche
int searchInSorted(int arr[], int N, int K)
{
// ... | ALGO | 0.999936 | 5.486412 |
429682fb-82d2-463b-8b72-14f431fc6616 | ZhouWeikuan/zoj | zju.finished/2624.cpp | #include<iostream>
using namespace std;
enum {
SIZ = 60,
};
int num;
char lit[SIZ];
int mat[SIZ][SIZ];
void fun(){
int l,i,j,v;
for(l=0; l<num; l++){
for(i=0; i+l<num; i++){
mat[i][i+l] = l+1;
for(j=i+1;j<=i+l;j++){
v = lit[j] == lit[i];
if(ma... | ALGO | 0.999921 | 3.661955 |
c18d563c-9d3d-4c28-b4df-dbdc8454ad98 | LifeIsRightward/Baekjoon | Solved/Bronze/Bronze5_14681.cpp | #include <iostream>
using namespace std;
int main() {
int x, y = 0;
cin >> x >> y;
// 1 사분면
if (x > 0 && y > 0) {
cout << 1;
} else if (x > 0 && y < 0) {
// 4 사분면
cout << 4;
} else if (x < 0 && y > 0) {
// 2 사분면
cout << 2;
} else if (x < 0 && y < 0) {
// 3 사분면
cout << 3;
... | ALGO | 0.999975 | 4.231052 |
7bb0f2c5-433d-46ea-aba2-1fb49cf41e40 | ishaankalsi/All_algos_ds_needed | code/cryptography/atbash_cipher/atbash_cipher.cpp | #include <iostream>
#include <string>
#include <cctype>
using namespace std;
//Atbash Cipher modified for English
string atbash(string s);
int main() {
string s;
cout << "Enter message to encrypt/decrypt: ";
getline(cin, s);
cout << endl << atbash(s) << endl;
}
string atbash(string s) {
string newstr = "";
for... | ALGO | 0.995214 | 5.056132 |
0dd8d234-5d58-4b39-ac5c-bceb45da3611 | ertsiger/online-judge-problems | ACM-ICPC-Live-Archive/7272_promotions.cpp |
#include <iostream>
#include <set>
#include <vector>
#include <algorithm>
#include <map>
#define PB(a) push_back(a)
#define FOR(i,j) for(int i = 0 ; i < j; ++i)
using namespace std;
int DFS(vector<int> *em,int act, set<int> *visit){
int sum = 0;
FOR(i,em[act].size()){
if(!visit->count(em[act][i]... | ALGO | 0.99983 | 3.40883 |
ef4a5dbb-8b69-4be1-a160-e0b5d3b5557c | shumbul/DSA-Sheet | Day 27/79. Pascal's Triangle.cpp | class Solution {
vector<vector<int>> ans;
vector<int> temp={1};
public:
vector<vector<int>> generate(int numRows) {
ans.push_back(temp);
for (int i=2;i<=numRows;i++)
{
ans.push_back(helper(numRows));
}
return ans;
}
vector<int> helper(int numRows)
... | ALGO | 0.999968 | 6.209317 |
c3e96776-2207-4098-8566-188395f938d4 | RajaPutraHendrian/Pertemuan-6 | laprak2.cpp | #include<iostream>
using namespace std;
int main() {
/*int angka[5] = {10, 20, 30, 40, 50};
for(int i = 0; i < 5; i++) {
cout<<angka[i]<<endl;
}
cout<<"Total panjang array: "<<sizeof(angka)/sizeof(*angka);
int totalAngka;
cout<<"Masukkan jumlah angka "; cin>>totalAngka;
int angka[totalAngka];
for(int i... | TOOL | 0.865084 | 3.435265 |
9f653869-254e-4ea7-bcb2-eaaf50868f78 | Nihil8492/CIS17ACopy | Class/TruthTable/main.cpp | /*
* File: main.cpp
* Author: Dr. Mark E. Lehr
* Created on Sept 9th, 2020, 12:30PM
* Purpose: To tell the Truth
*/
//System Libraries Here
#include <iostream>
using namespace std;
//User Libraries Here
//Global Constants Only, No Global Variables
//Like PI, e, Gravity, or conversions
//Function Prototypes... | TEST | 0.877105 | 3.013774 |
055e1cd8-d756-4e77-b9d8-00ed7d431185 | tarunbhoomla/Leetcode-and-GFG-solutions | Bottom View of Binary Tree - GFG/bottom-view-of-binary-tree.cpp | // { Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
#define MAX_HEIGHT 100000
// Tree Node
struct Node
{
int data;
Node* left;
Node* right;
};
// Utility function to create a new Tree Node
Node* newNode(int val)
{
Node* temp = new Node;
temp->data = val;
temp->left = NULL;
... | ALGO | 0.999788 | 6.500385 |
e5b22b3d-cc97-43de-bd2a-5244fb2c40a9 | camil0palacios/Competitive-programming | solutions/codeforce/Codeforces Round #757 (Div. 2)/a.cpp | #include <bits/stdc++.h>
#define endl '\n'
#define ll long long
#define fori(i,a,b) for(int i = a; i < b; i++)
#define forr(i,a,b) for(int i = a; i >= b; i--)
#define fore(i,a,b) for(int i = a; i <= b; i++)
#define ft first
#define sd second
#define all(v) v.begin(), v.end()
#define sz(v) (int) v.size()
#define mp make... | ALGO | 0.999792 | 3.355449 |
8a2769ec-9ee8-4a06-b52d-9c7032aeeca2 | algorithm006-class02/algorithm006-class02 | Week_05/G20200343030462/leetcode-213-462.cpp | class Solution {
public:
int rob(vector<int>& nums) {
if(nums.empty())
return 0;
if(1 == nums.size())
return nums[0];
if(2 == nums.size())
return max(nums[0],nums[1]);
int numberOfHouse = nums.size();
//状态数组
vector<vector<int>> dp(n... | ALGO | 0.999952 | 5.244268 |
09c27263-f8e4-4346-b385-1b82b97a9dea | Vipul35/Leetcode-Questions | Steps by Knight - GFG/steps-by-knight.cpp | // { Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
public:
//Function to find out minimum steps Knight needs to reach target position.
bool check(int n,int x,int y)
{
if(x>=1 && x<=n && y>=1 && y<=n)
{
return true;
... | ALGO | 0.999897 | 6.109415 |
f8fe0b6c-958c-4168-a866-0c556cf2b076 | thedsatyam/Top-Basic-C-Coding-Questions | Fibonnaci.cpp | #include<iostream>
using namespace std;
int main()
{
int n, first=0, second=1, ans=0;
cout<<"Enter the number: ";
cin>>n;
cout<<"Fibonnaci Series: ";
for (int i = 1; i <=n; ++i)
{
if (i==1)
{
cout<<first<<", ";
continue;
}
if (i==2)
... | ALGO | 0.99979 | 3.968924 |
df9152b5-e4d0-41c9-bfc5-8fb5f27c8df1 | aprameya-official/CPP | HOMEWORK/WEEK-2-DONE/day9/day9-q2.cpp | #include <iostream>
using namespace std;
int main() {
int row, col;
// Loop to print a pattern of uppercase letters in a triangular shape
for (row = 1; row <= 5; row++) {
char ch = 'A'; // Initialize 'ch' to 'A' for each row
for (col = 5; col >= 5 - row + 1; col--) {
// Output... | ALGO | 0.9628 | 5.386881 |
ab73c913-7565-4177-900e-428c55cabee1 | Mugdha-Hazra/180-Questions-Striver-SDE-sheet-in-CPP | 110-balanced-binary-tree/110-balanced-binary-tree.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999949 | 6.591882 |
3fa0157d-f4f2-4c8a-b97b-c723c4e93fd3 | UNstoppable-CP-Team/Notebook | DATA STRUCTURES/SparseTable.cpp | template <class T> struct Stable {
int n, log2;
vector <int> lg;
vector <vector <T>> st;
vector <T> a;
Stable(vector <T> &a) : a(a) {
//Stable (int n) : n(n) {
n = a.size();
lg.resize(n + 1, 0);
for (int i = 2; i <= n; ++i) lg[i] = lg[i >> 1] + 1;
log2 = lg[n];
st.assign(n, vector <T> (log2 + 1, 0));
... | ALGO | 0.999807 | 4.699503 |
5908492f-9601-4d89-9dd6-7599ffbcbe75 | zaynsidd/hw6 | boggle.cpp | #ifndef RECCHECK
#include <iostream>
#include <vector>
#include <string>
#include <set>
#include <random>
#include <iomanip>
#include <fstream>
#include <exception>
#endif
#include "boggle.h"
std::vector<std::vector<char> > genBoard(unsigned int n, int seed)
{
//random number generator
std::mt19937 r(seed);
//scr... | TOOL | 0.977343 | 5.985233 |
3ecc38dc-cfc7-43b6-924b-0fe8cb1ff04a | AnkitRajCode/MyCodes | ApniKasha/patters/floydstrangle.cpp | #include <iostream>
using namespace std;
int main(){
int n,count=1;
cin>>n;
for(int i=1; i<=n; i++){
for(int j=1; j<=i; j++){
cout<<count<<" ";
count++;
}
cout<<endl;
}
return 0;
} | ALGO | 0.999913 | 3.887793 |
e98cdcc9-e536-4790-b766-09522f43ad2a | refiel-l/caffe-libs | opencv/modules/videoio/src/cap_openni.cpp | #include "precomp.hpp"
#include "opencv2/core.hpp"
#include "opencv2/imgproc.hpp"
#ifdef HAVE_OPENNI
#if defined TBB_INTERFACE_VERSION && TBB_INTERFACE_VERSION < 5000
# undef HAVE_TBB
#endif
#include <queue>
#ifndef i386
# define i386 0
#endif
#ifndef __arm__
# define __arm__ 0
#endif
#ifndef _ARC
# define _ARC ... | TOOL | 0.965213 | 6.369846 |
ea275cf4-9cfc-496b-b12d-179dfe149521 | ishandutta2007/codeforces | eddy1021/normal/733/B.cpp | // eddy1021
#include <bits/stdc++.h>
using namespace std;
typedef double D;
typedef long double LD;
typedef long long ll;
typedef long long LL;
typedef pair<int,int> PII;
typedef pair<LL,LL> PLL;
typedef pair<LD,LD> Pt;
typedef tuple<int,int,int> tiii;
typedef tuple<LL,LL,LL> tlll;
#define mod9 1000000009ll
#define mod... | ALGO | 0.999971 | 4.689351 |
e152ec98-d039-46f6-aaaa-cd66296b4f3f | sarthak-gupta/DS | Exp19.cpp | #include<iostream>
#include<stdlib.h>
using namespace std;
int n,f=-1,r=-1;
void insertqueue(int a[],int item)
{
int i;
if((f==0&&r==n-1)||(f==r+1))
{
cout<<"Overflow";
char c;
cout<<"\nPress C to continue: ";
cin>>c;
return;
}
if(f==-1&&r==-1)
{
... | ALGO | 0.998797 | 3.349352 |
79b00ecb-9b0f-4fea-9170-85382ac5d63d | Nanored4498/Code-Forces | 1800/1854C.cpp | #include <iostream>
#include <vector>
using namespace std;
template <int MOD>
struct mint {
typedef long long ll;
static const int mod = MOD;
int x;
constexpr mint(): x(0) {}
constexpr mint(ll v) {
x = v % mod;
if(x < 0) x += mod;
}
friend constexpr mint pow(mint a, ll p) {
mint ans = 1;
for(; p; p >>... | ALGO | 0.999985 | 4.135393 |
13a33706-b77e-4491-85de-1a635fdb926e | kavin1002/Mavlink_Project | src/systemcmds/tests/test_search_min.cpp | /**
* @file test_search_min.cpp
* Tests arithmetic search algorithms.
*/
#include <unit_test.h>
#include <float.h>
#include <math.h>
#include <mathlib/math/SearchMin.hpp>
// linear function
float _linear_function(float x)
{
float slope = 2.0f;
return slope * x - 1.4f;
}
//linear function without slope
float _... | TEST | 0.931703 | 6.930774 |
2c4d605c-aa04-473c-be18-3d9d2b78f841 | ZiadTaha1/Taskes | selection01medium63.cpp | #include <iostream>
using namespace std;
int main()
{
int a,b;
cout << "enter the first number: ";
cin >> a ;
for ( int i = 0 ; i < 10 ; i++ )
{
cout << "enter another number: ";
cin >> b ;
if ( a < b)
a = b ;
}
cout << "the biggest number is " << a ;
return 0... | ALGO | 0.988003 | 3.182003 |
24d2026a-e093-4c9f-b51c-3fa1b3b08621 | soorajyadav/DSA | STL/sort_vector_pair.cpp | #include <bits/stdc++.h>
using namespace std;
bool usingsecond(const pair<int,int> &a, const pair<int,int> &b){
return (a.first < b.first);
}
int main() {
int n;
cin>>n;
vector<pair<int,int>> vec;
for(int i=0;i<n;i++){
int x,y;
cin>>x>>y;
vec.push_back(make_pair(x,y));
... | ALGO | 0.999793 | 4.341971 |
ba2438d5-319b-499d-96ca-76640195bcd5 | Pramath-N/Basics | Data Structures and Algo/Lvl2/BIT Magic/twoOddAppearence.cpp | #include<bits/stdc++.h>
int* twoOddAppearence(int arr[], int n){
//NOT THE OPTIMAL WHATEVER I CAN
std::map<int, int> mp;
// for(int i = 0; i < n; i++){
// mp[arr[i]]++;
// }
// int ind = 0;
// static int ans[2];
// for(auto it : mp){
// if(it.second == 1) {
// an... | ALGO | 0.999969 | 4.50337 |
7ef152a0-fd30-4924-8e3a-24a3ac3dd25a | HUZAFAAHMAD/PD--9 | task7.cpp | #include <iostream>
using namespace std;
main()
{
string element1;
cout << "Enter the first string :";
cin >> element1;
string element2;
cout << "Enter the second string :";
cin >> element2;
int no_of_letters = 0;
int total = -5;
for (int i =0 ; element1[i] != '\0' ; i++)
{
... | ALGO | 0.999134 | 3.406209 |
315bb617-f466-411c-8304-78ec6601a19e | ishandutta2007/codeforces | arterm/normal/148/A.cpp | #include <cstdlib>
#include <iostream>
#define long long long
using namespace std;
long p[10];
long gcd(long x, long y){
while (x!=0){
y%=x;
swap(x,y);
}
return y;
}
long lcm(long x, long y){
return x/gcd(x,y)*y;
}
long f(long n){
long u=(1<<4)-1... | ALGO | 0.999705 | 3.712158 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.