uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
518913be-19b1-4dce-8adb-50c96afffcdc | PLATEAUUUU/test_precision | include/librosa/eigen3/doc/examples/TutorialLinAlgComputeTwice.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace std;
using namespace Eigen;
int main()
{
Matrix2f A, b;
LLT<Matrix2f> llt;
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;
cout << "Computing LLT... | ALGO | 0.999967 | 3.145425 |
203f71f3-485a-4c5d-a485-c4851c4891e5 | lpardosixtos/Codeforces-Round-472-Div-2 | C.cpp | #include <bits/stdc++.h>
using namespace std;
int main(void){
long long int n, u;
cin >> n >> u;
vector<long long int> A(n);
for(int i=0; i<n; i++){
cin >> A[i];
}
double maxi=0;
for(int i=0; i<n-2; i++){
double aux=A[i+1];
vector<long long int>::iterator up;
up=upper_bound(A.begin()+i, A.end(), u+A... | ALGO | 0.999848 | 4.004167 |
6283b0e8-0c22-44b5-8aed-b89798436c25 | devdrx/cp-submissions | Money_Sums.cpp | #include <bits/stdc++.h>
using namespace std;
const int MAX_N = 100;
const int MAX_SUM = 1e5;
bool dp[MAX_N + 1][MAX_SUM + 1];
int main() {
int n;
cin >> n;
vector<int> coins_values(n);
for (int i = 0; i < n; i++) { cin >> coins_values[i]; }
dp[0][0] = true;
for (int i = 1; i <= n; i++) {
for (int curren... | ALGO | 0.999909 | 4.165091 |
4f0ec721-559a-418d-9494-717499301433 | ishandutta2007/codeforces | aidos/normal/1250/L.cpp | t = int(input())
for _ in range(t):
n = int(input())
a = sorted(map(int, input().split()))
if n < 3 or a[n-2] < 2:
print(0)
else:
print(min(a[n-2]-1, n-2)) | ALGO | 0.99981 | 4.98896 |
df586d2d-4ce0-4472-9dee-80d1fa30b057 | yshgpta/Competitive-Coding | Codeforces/WEIRDSORT.cpp | //ysh_gpta
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ordered_set tree<ll, null_type,less<ll>, rb_tree_tag,tree_order_statistics_node_update>
using namespace std;
typedef long long ll;
#define vb vector<bool>
#define vi vecto... | ALGO | 0.999988 | 3.640189 |
939d5d95-947d-4b94-b317-508c25b764b8 | AneekG8/DSA | DATA STRUCTURES/HEAP/nRopes.cpp | //given n ropes find the minimum cost of connecting them into one where
//cost of connecting two ropes is equal to sum of their length
#include<bits/stdc++.h>
using namespace std;
//!start with the minimum length ropes and add them to total cost
int minCost(int arr[],int n)
{
int sum=0;
priority_queue<int,ve... | ALGO | 0.999783 | 4.542782 |
212e669b-8011-4a4b-9c92-49bada70cbbc | antopilo/Theatricus-archive | Dependencies/aquila/aquila/transform/OouraFft.cpp | /**
* @file OouraFft.cpp
*
* A wrapper for the FFT algorithm found in Ooura mathematical packages.
*
* This file is part of the Aquila DSP library.
* Aquila is free software, licensed under the MIT/X11 License. A copy of
* the license is provided with the library in the LICENSE file.
*
* @package Aquila
* @ve... | ALGO | 0.995609 | 6.357108 |
ab332ee5-1efd-4ecc-8520-96350214458a | AI-Cortex/Codewars_Solution | code c++/Find the next perfect square!.cpp | // my profile : https://www.codewars.com/users/AI-Cortex
// Codewars solution github repository : https://github.com/AI-Cortex/Codewars_Solution
//////////////////////////////////////////////////////////////////////
// name : Find the next perfect square!
// link : https://www.codewars.com/kata/56269eb78ad2e4ced1000013... | ALGO | 0.999829 | 5.331793 |
cb0c883a-121f-428d-ad5b-388964f77996 | nidhugg/nidhugg | src/PrefixHeuristic.cpp | #include "PrefixHeuristic.h"
#include "Timing.h"
#include <fstream>
#include <iostream>
#include <list>
#include <map>
#include <set>
#include <utility>
#include <llvm/Support/CommandLine.h>
static Timing::Context heuristic_context("heuristic");
static llvm::cl::opt<bool>
cl_no_heuristic("no-heuristic",llvm::cl::No... | ALGO | 0.999243 | 5.399113 |
cd61abdd-3786-4420-91ff-5bff3bc4e988 | SSUHYUNKIM/Algorithm | math/solution/Bronze/Bronze3/9063.cpp | #include <iostream>
using namespace std;
int N, x, y, minX = 10001, minY = 10001, maxX = -10001, maxY = -10001;
int main()
{
ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
cin >> N;
for(int i = 0 ; i < N; i++)
{
cin >> x >> y;
minX = min(x, minX);
minY = min(... | ALGO | 0.999731 | 4.681094 |
7a57224a-60ca-43a0-be63-ed73ca6d5f13 | ishandutta2007/codeforces | awakeanay/normal/827/A.cpp | #include <iostream>
#include <vector>
#include <stack>
#include <map>
#define int long long
#define MAX 2000000
signed main() {
std::ios::sync_with_stdio(false);
int n;
std::cin >> n;
int sz = 0;
std::map<int, std::vector<int> > query;
std::vector<std::string> list(n);
for(int i = 0; i < n; i++) {
std::cin... | ALGO | 0.999944 | 3.485687 |
cfe00e16-d66b-4b44-a04c-ca08477f3ec1 | triSYCL/sycl | libcxx/test/std/containers/sequences/vector.bool/insert_iter_iter_iter.pass.cpp | // <vector>
// vector<bool>
// template <class Iter>
// iterator insert(const_iterator position, Iter first, Iter last);
#include <vector>
#include <cassert>
#include <cstddef>
#include "test_macros.h"
#include "test_iterators.h"
#include "min_allocator.h"
TEST_CONSTEXPR_CXX20 bool tests()
{
{
std::ve... | TEST | 0.867108 | 5.260384 |
560c6fdb-bb7b-4624-abfb-18696ea44364 | wangqiang79/bat- | 面试算法_代码/PostOrder.cpp | // PostOrder.cpp : ̨Ӧóڵ㡣
//
#include "stdafx.h"
using namespace std;
bool CanPostOrder(const int* a, int size)
{
if(size <= 1)
return true;
int root = a[size-1];
int nLeft = 0;
while(nLeft < size-1)
{
if(a[nLeft] > root)
break;
nLeft++;
}
int nRight = size-2; //size-1Ǹ
while(nRight >= 0)
{
if(a[n... | ALGO | 0.999773 | 4.904488 |
2145e76d-8218-4320-b51c-55cb5f474380 | feelpp/feelpp | mor/examples/convection/jacobian.cpp | /* -*- mode: c++; coding: utf-8; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; show-trailing-whitespace: t -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4*/
#include "convection.hpp"
void ConvectionCrb ::updateJ( const vector_ptrtype& X, sparse_matrix_ptrtype& J)
{
LOG(INFO) << "[updateJacobian] start\n";
... | ALGO | 0.999626 | 5.430361 |
a082b82d-9d65-4b04-9bbb-5542c7f63679 | himanshudubey7/Programming | ques/A_1_Balanced_Shuffle_Easy.cpp | //author: Ghostyy :D
#include<bits/stdc++.h>
using namespace std;
const int N = 1e5+10;
bool contd(const tuple<int,int, char>&a , const tuple<int , int , char>&b){
if(get<0>(a)!= get<0>(b))
return (get<0>(a) < get<0>(b));
else
return (get<1>(a)>get<1>(b));
}
int main(){
ios_base::sync_with_stdio(0);
... | ALGO | 0.999524 | 3.31377 |
3d854597-5a41-4aa5-b987-f0a898113520 | ruandaniel/R-LC | 15. 3Sum.cpp | class Solution {
public:
vector<vector<int>> threeSum(vector<int>& nums) {
if (nums.size() < 3) return {};
vector<vector<int>> res;
sort(nums.begin(), nums.end());
for (int i = 0; i < nums.size() - 2 && nums[i] <= 0; i++){ //when nums[i] > 0, impossible
if (i != 0 && nums... | ALGO | 0.999927 | 5.919559 |
79bb4c8a-beea-47a4-ad6b-79d6c8c63e05 | Kennyarlexy/Competitive-Programming | PROBLEMS/UVA/UVA_11402/main2.cpp | #include <bits/stdc++.h>
#define ll long long
using namespace std;
int A[1025005*2];
struct segTree {
vector<int> st;
vector<char> flag;
int _size;
int l(int p) {return (p << 1);}
int r(int p) {return (p << 1) + 1;}
void build(int p, int L, int R) {
if (L == R) {
st[p] = ... | ALGO | 0.999151 | 4.459591 |
a54a951f-92f9-447e-ba73-855118456a82 | YuXinFan/mathematical-optimization | test/test_rb_gd_an.cpp | #include <iostream>
#include "AllFunctors.hpp"
#include "GradientDescent.hpp"
int main( int argc, char** argv ) {
RosenbrockFunctor rb;
GradientDescent<RosenbrockFunctor> optimizer(rb);
Eigen::Vector2d x_init;
x_init << 1.0, 3.0;
Eigen::Vector2d x_opt;
x_opt << 1.0, 1.0;
Eigen::Vector2d x = x_init;
... | ALGO | 0.979509 | 5.363546 |
7d7d1b86-5b24-47dc-abf9-138916049863 | Viswanath1680/LeetCode-problems | 1335-maximum-candies-allocated-to-k-children/1335-maximum-candies-allocated-to-k-children.cpp | // Same as Koko eating bananas question https://leetcode.com/problems/koko-eating-bananas/description/
class Solution {
public:
// dividing every pile into mid number of chunks
bool isSatisfying(vector<int>arr, long long k, long long mid){
long long piles = 0;
for( auto it : arr ) {
... | ALGO | 0.999978 | 5.988628 |
62acb19f-a6d2-4cd8-90aa-833a976250de | my0421kr/Problem_solving | BOJ/중급/다이나믹프로그래밍/2820_자동차공장.cpp | #include <iostream>
#include <vector>
using namespace std;
typedef struct _Node
{
int num, head, tail;
} Node;
int n, m, seglen = 1;
vector<vector<int>> tree;
vector<int> cost, ha, count, inverse;
vector<Node> segtree;
int CountChild(int index)
{
int len = tree[index].size();
for(int i=0; i<len; i++) {
... | ALGO | 0.999935 | 3.761711 |
5cba3e6a-7691-4311-82fa-32355f58e6c3 | fanfuqiang/iec_old | clang-3.2.src/lib/Analysis/ReachableCode.cpp | #include "llvm/ADT/BitVector.h"
#include "llvm/ADT/SmallVector.h"
#include "clang/AST/Expr.h"
#include "clang/AST/ExprCXX.h"
#include "clang/AST/ExprObjC.h"
#include "clang/AST/StmtCXX.h"
#include "clang/Analysis/Analyses/ReachableCode.h"
#include "clang/Analysis/CFG.h"
#include "clang/Analysis/AnalysisContext.h"
#incl... | TOOL | 0.943841 | 7.659662 |
fd5b5d64-4dbe-41d5-9e3d-7c58e815819e | pokerjest/TINA | rujia/习题/ch1/la2678.cpp | // LA2678 Subsequence O(n) version
// Rujia Liu
#include<cstdio>
#include<algorithm>
using namespace std;
const int maxn = 100000 + 10;
int A[maxn], B[maxn];
int main() {
int n, S;
while(scanf("%d%d", &n, &S) == 2 && n) {
for(int i = 1; i <= n; i++) scanf("%d", &A[i]);
B[0] = 0;
for(int i = 1; i <= n; ... | ALGO | 0.999973 | 3.234002 |
bb2f3e29-c5fd-4563-b19d-2b471d734e2a | ilaydaademoglucs/CS307-Operating-Systems | Airline Reservation System-HW1/IlaydaAdemoglu-hw1-airlinereservationsystem.cpp | #include <iostream>
#include <pthread.h>
#include <cstdlib> //int rand()
#include <stdlib.h>
using namespace std;
//Ilayda Ademoglu(23856) first cs307 homework about threads.
int mymatrix[2][50];
int turn = 0;
bool isfull = true;
void printmatrix(){ //This function is for printing matrixes
for(int i = 0; i < 2; i++... | ALGO | 0.993325 | 3.941736 |
0cacd8c1-2e81-4504-9291-81ac1ad92223 | Shell-Wataru/AtCoder | GCJ/kickstart2020B/A.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <deque>
#include <map>
#include <set>
using namespace std;
using ll = long long;
string solve(){
ll N;
cin >> N;
vector<ll> A(N);
for (size_t i = 0; i < N; i++)
{
cin >> A[i];
}
ll ans = 0;
for (size_t i = 1; i... | ALGO | 0.999352 | 5.118621 |
d49bcdb6-923e-4206-ab6e-9c522be3de4c | AnomalousMedical/CMake-OldFork | Tests/VSExternalInclude/Lib2/lib2.cpp |
#include "lib2.h"
#include "lib1.h"
int add1_and_mult2(int num)
{
int tmp = add1(num);
return tmp * 2;
}
| TOOL | 0.919199 | 4.233897 |
57f95103-7459-4c1e-875a-15d0fc3a1ef8 | ishandutta2007/codeforces | e869120/normal/1017/F.cpp | #include <iostream>
#include <algorithm>
using namespace std;
unsigned int N, A, B, C, D, sum; unsigned char prime[12500009]; bool pp[100009];
unsigned int pol(unsigned int x) {
return A * x * x * x + B * x * x + C * x + D;
}
int Get(int pos) {
return ((prime[pos >> 3] & (1 << (pos & 7))) >> (pos & 7));
}
void in... | ALGO | 0.998911 | 4.75912 |
87f9be10-832f-4dca-8547-09cf19b89b9f | yash3001/Competitve-Programming | CSES/book/21) Number Theory/print_prime_factorization.cpp | /* @author -> gamma30 */
#include <bits/stdc++.h>
using namespace std;
vector<int> prime_factorization(int n) {
vector<int> result;
for(int i=2; i*i<=n; i++){
while(n%i == 0){
result.push_back(i);
n /= i;
}
}
if(n > 1){
result.push_back(n);
}
ret... | ALGO | 0.999923 | 4.749236 |
c5117edd-671a-47b1-a365-a03a34fef979 | tomsiadev/algorithms | Codeforces/Codeforces-988F.cpp | /*
Problem: https://codeforces.com/problemset/problem/988/F
General idea:
Mark raining cells as wet. Process array from left to right and if cell 'i' is not wet,
then the cost(sum of carried weight) of getting there is distance[i] = distance[i-1].
Otherwise, we will need to bring umbrella with lower total ... | ALGO | 0.999885 | 4.588219 |
fb2f4a69-9118-464e-91d4-de5f247a174b | amitkishore007/litecoin-src | src/univalue/lib/univalue.cpp | #include <stdint.h>
#include <errno.h>
#include <iomanip>
#include <limits>
#include <sstream>
#include <stdexcept>
#include <stdlib.h>
#include <string.h>
#include "univalue.h"
namespace
{
static bool ParsePrechecks(const std::string& str)
{
if (str.empty()) // No empty string allowed
return false;
... | TOOL | 0.874481 | 6.62095 |
691b1754-7364-454a-baba-410490397099 | FajarAfrizal/Learn_Flutter | belajar/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.997992 | 6.785645 |
d19857ae-8f44-46f4-99fc-a916333cd301 | brunogouveia/intro-robotics | src/hand_shake/src/Knn.cpp | #include "Knn.h"
void Knn::pointsInBall(PointCloud<PointXYZ> & cloud, Eigen::Vector4f & center, float r, std::vector<int> & inds)
{
float r2 = r*r;
float tinyR = r/sqrt(3);
Eigen::Vector3f diff;
inds.clear(); //Make sure the vector is empty;
for (int i = 0; i < cloud.points.size(); i++)
{
diff(0) = fabs(cent... | ALGO | 0.998978 | 5.55794 |
c948e60a-c1af-4cbb-a6d7-caca7489663c | PranavMahara/DSA | sorting/mergesort.cpp | #include <iostream>
using namespace std;
void merge(int a[], int l, int mid, int h) // dont put [] and n in it
{
int i = l;
int j =mid+1;
int k=l;
int temp[50];
while (i <= mid && j <= h)
{
if (a[i] <= a[j])
{
temp[k] = a[i];
k++;
i++;
... | ALGO | 0.999871 | 4.523096 |
40a391f0-396a-4e00-a13c-eb907677a015 | shadowprince55/DSA | GFG/2023/December/13.cpp |
class Solution{
public:
// #define ll long long
ll countStrings(int n) {
// code here
ll int zer=1,one=1,sum=zer+one,i=2;
if(n==1)
return sum;
while(i<=n){
one = zer;
zer = sum;
sum = (zer+one)%1000000007;
i++;
}
return sum%1000000007;
}
};
| ALGO | 0.999966 | 5.566209 |
aefbf1fd-add3-4108-aeb3-cf20084ee84c | Tagore22/algorithmSolve | algorithmSolve/백준/4458.cpp | #include <iostream>
#include <string>
using namespace std;
int main()
{
int N;
cin >> N;
cin.ignore();
for (int iter = 0; iter < N; ++iter)
{
string str;
getline(cin, str);
str[0] = str[0] >= 'a' ? str[0] - 32 : str[0];
cout << str << '\n';
}
return 0;
} | ALGO | 0.980474 | 4.092363 |
5817aa6f-0624-4e1c-8580-2963d75c56a0 | DenisShahbazyan/AutoSwap | src/ProcessManager.cpp | #include "ProcessManager.h"
std::vector<DWORD> GetProcessIdsByProcessName(const std::wstring& processName) {
std::vector<DWORD> processIds;
HANDLE snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
if (snapshot != INVALID_HANDLE_VALUE) {
PROCESSENTRY32 processEntry = { sizeof(PROCESSENTRY32) };
if (Pr... | TOOL | 0.888802 | 4.474137 |
211e37d7-6ff7-44e1-9b55-164d4a459899 | zhangbaochong/Leetcode | Leetcode/Symmetric Tree.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
bool isSymmetric(TreeNode *root) {
if (!root) return true;
return helper(root->left, root->right);
}... | ALGO | 0.999955 | 6.406274 |
c606834d-4368-4325-84bc-688078e02451 | The-Darshan/Coding-in-Cpp | Array/String_Char_Array/permutation_in_str_LC.cpp | #include<iostream>
using namespace std;
bool checkEqual(int a[26] , int b[26]){
for(int i=0;i<26;i++){
if(a[i] != b[i]){
return 0;
}
}
return 1;
}
bool permutation(string s1 , string s2){
// character count array of s1.
int count[26] = {0};
for(int i=0;i<s1.lengt... | ALGO | 0.999978 | 4.092495 |
dace5781-cb4b-469f-a25c-32fabb187048 | ImYuxuanLi/CDPN-pytorch | detection/adet/layers/csrc/BezierAlign/BezierAlign_cpu.cpp | namespace {
// implementation taken from Caffe2
template <typename T>
struct PreCalc {
int pos1;
int pos2;
int pos3;
int pos4;
T w1;
T w2;
T w3;
T w4;
};
template <typename T>
T bezier_curve(
const T p0,
const T p1,
const T p2,
const T p3,
const T u) {
return (
(1. - u) * (... | DATA | 0.977232 | 7.106367 |
662c106c-d923-4081-8cf7-bd371e63db37 | DetectiveGot/Coding | Codeforce/1598D.cpp | #include<bits/stdc++.h>
#define ll long long
#define pii pair<int,int>
using namespace std;
const int N = 2e5+2;
int mp[N], mp2[N];
//fixed one
void solve(){
int n; cin >> n;
vector<pii> v(n);
for(pii&e:v) cin >> e.first >> e.second, mp[e.first]++, mp2[e.second]++;
ll c=(1LL*n*(n-1)*(n-2))/6;
for(pii&e:v) c-=(... | ALGO | 0.999904 | 4.892185 |
498bdcdd-f019-42c0-ba6c-1670f058fa44 | avadheshgithub/DSA_Learning | 11. Recursion/3. Recursion 3/2. Problems/7. SubSquence/prog.cpp | /*
## print all increasing Sub -Sequence of length K from first n natural numbers
arr = 1 2 3
1. subSquence - take it or leave it but in increasing order {123,125,378}
2. subset - dont repeate & order does't matter {1,2,3,12,13,23,123}
3. subArray - continious part of array ... | ALGO | 0.999466 | 4.52876 |
43aeb720-d147-4d24-8f67-519f07a1503f | erdongshuiyang/GPIR_planner_ws | src/gpir/gp_planner/thirdparty/gtsam-4.1rc/gtsam/linear/IterativeSolver.cpp | /**
* @file IterativeSolver.cpp
* @brief Some support classes for iterative solvers
* @date Sep 3, 2012
* @author Yong-Dian Jian
*/
#include <gtsam/linear/IterativeSolver.h>
#include <gtsam/linear/GaussianFactorGraph.h>
#include <gtsam/linear/VectorValues.h>
#include <boost/algorithm/string.hpp>
#include <io... | TOOL | 0.989481 | 7.823308 |
1cf2262b-4158-4d25-bde9-e9ac88c9964c | zawazawa84/question_flutter | 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.99887 | 6.783439 |
e4f76254-f666-4114-bd69-ad06262ed062 | N9199/Programacion-Competitiva | Taller de Programación/2019-2/Contest 2/B.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, int> par;
typedef vector<ll> vi;
typedef vector<par> vp;
typedef vector<vi> graph;
typedef vector<vp> wgraph;
#define rep(i, n) for (int i = 0; i < (int)n; ++i)
#define repx(i, a, b) for (size_t i = a;... | ALGO | 0.999881 | 4.40137 |
7e88b421-dc5f-40dc-9c33-0c6c0cb9a6bb | k-kmw/algorithm | C++/백준 문제집/기초1/다이나믹 프로그래밍/1912 연속합.cpp | #include <bits/stdc++.h>
using namespace std;
int a[100001];
int d[100001];
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
int n;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> a[i];
}
d[0] = a[0];
for (int i = 1; i < n; i++) {
d[i] = max(d[i - 1]+a[i], a[i]);
}
... | ALGO | 0.999921 | 4.641795 |
3980ed3a-1782-4d93-a196-e4180095e27b | Saharsh979/CP-Algorithms | Codeforces/B_AND_Sequences.cpp | #include <bits/stdc++.h>
using namespace std;
#include <algorithm>
#include <unordered_map>
#include <unordered_set>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
#define fbo find_by_order
#define ook order_of_key
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_upd... | ALGO | 0.999847 | 4.620335 |
125972b3-5839-47e3-98cb-cb1ebffd246d | Noor-Nasri/daily-leetcode | 238-product-of-array-except-self/product-of-array-except-self.cpp | class Solution {
public:
vector<int> productExceptSelf(vector<int>& nums) {
vector<int> solution;
// This one took too long because I was trying to do math ..
// The idea is super simple: ABC [D] EF = (ABD)x(EF)=
// build up (ABD) then go backward to get (EF)
int prod = 1;
... | ALGO | 0.999977 | 6.289469 |
9eaa5d97-1377-4418-9191-e3e9e10f8973 | Captniz/Uni_Code | CODE/CPP/Es_Laboratorio/241210_EserciziLab22.cpp | #include <iostream>
#include "../Snippets/Utilities.hpp"
#include "../Snippets/Strings.hpp"
#include "../Snippets/Arrays.hpp"
#include "../Snippets/Matrix.hpp"
using namespace std;
using namespace utl;
using namespace arr;
using namespace mat;
using namespace str;
bool Due(int *arr, int dim)
{
/*Scrivere un progr... | TEST | 0.96515 | 4.231073 |
69ecc44f-c4de-4747-896d-1aacda44301e | ishandutta2007/codeforces | leaf1415/normal/521/B.cpp | #include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <cstdlib>
#include <cassert>
#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <string>
#include <algorithm>
#include <utility>
... | ALGO | 0.999925 | 4.335392 |
beba6241-39b5-486f-a0fd-b8ca6ff46451 | aliammari1/Leetcode_problems | solutions/largest-perimeter-triangle/Time Limit Exceeded/10-17-2023, 2_28_36 AM/Solution.cpp | // https://leetcode.com/problems/largest-perimeter-triangle
class Solution {
public:
int largestPerimeter(vector<int>& nums) {
int m = 0;
if(nums.size() >= 3)
for(int i = 0;i < nums.size() - 2;i++)
for(int j = i + 1;j < nums.size() - 1;j++)
for(int k = j + 1;k < ... | ALGO | 0.999834 | 5.315175 |
ecbf1cae-b84f-420e-8bf2-4dc8c73e554c | Tushar-K24/CP-Contests | CodeForces/Good Bye 2021 2022 is NEAR/C_Representative_Edges.cpp | //Author: Tushar Khanduri
#include<iostream>
#include<vector>
#include<map>
#include<queue>
#include<set>
#include<stack>
#include<cmath>
#include<string>
#include<bitset>
#include<algorithm>
#define int long long
#define endl "\n"
#define pb push_back
#define vec vector
using namespace std;
//========================... | ALGO | 0.999593 | 4.248893 |
2c16f8d5-db9e-42e9-bc8b-24e3374016fa | Hasin-Ishrak/CodeFolio | vscode(c++)/3pallindrome.cpp | #include <bits/stdc++.h>
using namespace std;
#define fast ios_base::sync_with_stdio(0); cin.tie(nullptr);
#define prb cin.exceptions(ios::badbit | ios::failbit);
#define ll long long
#define el '\n'
#define pb push_back
#define pp pop_back
#define lb lower_bound
#define ub upper_bound
#define mp make_pair
#define F f... | ALGO | 0.999511 | 3.617482 |
8381e238-7f79-4b7e-867e-b19d05cd2ecc | Aditya30december2003/Leetcode-GFG | 0224-basic-calculator/0224-basic-calculator.cpp | class Solution {
public:
int calculate(string s) {
stack<int>stk;
int result=0;
int number=0;
int sign =1;
for(int i=0;i<s.size();i++){
//digit
if(isdigit(s[i])){
number=(number*10) +(s[i]-'0');
}
// + sign
else ... | ALGO | 0.999882 | 5.05432 |
29fd40c2-5baa-4629-9830-5be139b399e9 | linux-creatures/lsd_ekf_slam | thirdparty/thirdparty/eigen-3.2.1/doc/examples/TutorialLinAlgInverseDeterminant.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace std;
using namespace Eigen;
int main()
{
Matrix3f A;
A << 1, 2, 1,
2, 1, 0,
-1, 1, 2;
cout << "Here is the matrix A:\n" << A << endl;
cout << "The determinant of A is " << A.determinant() << endl;
cout << "The inverse of A is:\n... | ALGO | 0.999708 | 4.186114 |
b7d4863c-a378-481d-a6a7-bed76a11a48d | JakinChan200/Practice | LeetCode/Easy/217-ContainsDuplicate.cpp | //217
//Given an array, return true if any value appears at least twice
#include <bits/stdc++.h>
using namespace std;
bool containsDuplicate(vector<int> &nums){
sort(nums.begin(), nums.end());
for(int i = 0; i < nums.size()-1; i++){
if(nums[i] == nums[i+1]){
return true;
}
}
... | ALGO | 0.999445 | 4.801424 |
f4390a1c-1c43-4926-aec2-9e9acf0f7fa0 | Vishverwasma/SeedIT-CPP-Codes_and_Practise-Codes | SeedIT-CPP Codes/SeedIT-103.cpp | #include<iostream>
#include<sstream>
#include<bits/stdc++.h>
using namespace std;
void qw(){
string a,b;
cout<<"Input with space :";
getline(cin,a);
stringstream p(a);
while(p>>b){
cout<<b<<" ";
}
}
void qe(){
string c,d;
cout<<endl<<" To find Length Of Each Word/Element In A String : "<... | ALGO | 0.941386 | 3.279156 |
060dfc55-9bcd-47d6-8983-16bc74c6dff3 | AnshulChaturvedi/Anshul-Codes | 2022-convert-1d-array-into-2d-array/2022-convert-1d-array-into-2d-array.cpp | class Solution {
public:
vector<vector<int>> construct2DArray(vector<int>& org, int m, int n) {
int size = org.size();
if(size != m*n) return {};
vector<vector<int>> ans(m,vector<int> (n));
int idx=0;
for(int i=0;i<m;i++){
for(int j=0;j<n;j++){
an... | ALGO | 0.999127 | 6.398856 |
6fea53c5-f492-4375-98ae-ff63ac2e8b2d | Kyogre223/Data-stuctures-and-algo | Binary Tree/834. Sum of Distances in Tree.cpp | class Solution {
public:
vector<int>cnt;
vector<int>res;
int N;
vector<vector<int>>g;
void dfs1(int cur = 0, int p = -1) {
cnt[cur] = 1;
for (auto x : g[cur]) {
if (x != p) {
dfs1(x, cur);
cnt[cur] += cnt[x];
res[cur] += res... | ALGO | 0.999962 | 5.478692 |
d54e6247-e457-48b7-9e3b-51b0f17d6b9f | robertwyb/Computer-graphic-assignments | computer-graphics-kinematics/libigl/include/igl/ceil.cpp | template < typename DerivedX, typename DerivedY>
IGL_INLINE void igl::ceil(
const Eigen::PlainObjectBase<DerivedX>& X,
Eigen::PlainObjectBase<DerivedY>& Y)
{
using namespace std;
//Y = DerivedY::Zero(m,n);
//#pragma omp parallel for
//for(int i = 0;i<m;i++)
//{
// for(int j = 0;j<n;j++)
// {
// Y... | ALGO | 0.981696 | 5.363898 |
8ac53c12-cec3-4ef5-bec0-5e0393a5e5ee | Alzahra/Projet3DedaleContrib | PROJET/Box2D_v2.2.1/HelloWorld/HelloWorld.cpp | #include <Box2D/Box2D.h>
#include <cstdio>
using namespace std;
// This is a simple example of building and running a simulation
// using Box2D. Here we create a large ground box and a small dynamic
// box.
// There are no graphics for this example. Box2D is meant to be used
// with your rendering engine in your game... | ALGO | 0.965728 | 6.253542 |
6af3e438-0b10-4cad-aa3a-8bee0c961242 | asad-shuvo/ACM | Online Judge/Leetcode/1277. Count Square Submatrices with All Ones.cpp | class Solution {
public:
int countSquares(vector<vector<int>>& matrix) {
int x=matrix.size();
int y=matrix[0].size();
int table[x+5][y+5];
for(int i=0;i<=x+1;i++){
for(int j=0;j<=y+1;j++){
table[i][j]=0;
}
}
int cnt=0;
f... | ALGO | 0.999903 | 6.019152 |
e3a07238-4aa4-40d9-993d-f54f056a1910 | xSeditx/Creature-Engine | CreatureEngine/SDKs/PhysX-4.1/physx/source/geomutils/src/GuSweepSharedTests.cpp | #include "geometry/PxConvexMeshGeometry.h"
#include "geometry/PxSphereGeometry.h"
#include "GuSweepTests.h"
#include "GuHeightFieldUtil.h"
#include "CmScaling.h"
#include "GuConvexMesh.h"
#include "GuIntersectionRayPlane.h"
#include "GuVecBox.h"
#include "GuVecCapsule.h"
#include "GuVecConvexHull.h"
#include "GuSweepMT... | ALGO | 0.996664 | 6.521222 |
a406ec54-f7c8-4d6e-9b5e-6892eed9cbdd | keshavgupta1304/DSA-QUESTIONS | 1034-subarrays-with-k-different-integers/subarrays-with-k-different-integers.cpp | class Solution {
private:
int subarrayWithAtMostK(vector<int>& nums, int k)
{
int total=0;
int left=0;
unordered_map<int,int> mp;
for(int right=0;right<nums.size();right++)
{
mp[nums[right]]++;
while(left<=right && mp.size()>k)
{
... | ALGO | 0.999976 | 6.231039 |
934d0b84-d075-4cda-a666-b161366e0917 | dataAlgorithms/dataStructure | stack/largestRectangularAreaUnderHistogram.cpp | /*
Question:
Largest Rectangular Area in a Histogram
Algorithms:
1) Create an empty stack.
2) Start from first bar, and do following for every bar ‘hist[i]’
where ‘i’ varies from 0 to n-1.
……a) If stack is empty or hist[i] is higher than the bar at top of stack,
then push ‘i’ to stack.
……b) If this bar is smaller th... | ALGO | 0.999951 | 7.185603 |
a133103f-347e-4bb1-9cba-5cb72fb2eb3c | ShibhuRathore/Leetcode_dsa | 0976-minimum-area-rectangle/0976-minimum-area-rectangle.cpp | class Solution {
public:
int minAreaRect(vector<vector<int>>& points) {
unordered_map<int,unordered_set<int>>mp;
for(auto &p:points){
int x1=p[0];
int y1=p[1];
mp[x1].insert(y1);
}
int minarea=INT_MAX;
for(int i=0;i<points.size();i++){
... | ALGO | 0.999956 | 6.481194 |
7d3a1b13-95d6-433c-a704-241d10affda8 | Piyusss/Lc-2024 | 3291-find-if-array-can-be-sorted/find-if-array-can-be-sorted.cpp | class Solution {
public:
bool check(vector<int>& nums) {
for(int i=0;i<nums.size()-1;i++) {
if(nums[i] > nums[i+1]) return 0;
}
return 1;
}
bool canSortArray(vector<int>& nums) {
int n=nums.size(),move=0;
vector<int>count(n);
for(auto &it : nums... | ALGO | 0.999995 | 5.184413 |
5dfd52bd-5eff-43d1-8d45-a97b34fb6d58 | thomas-moulard/visp-deb | src/visual-feature/vpFeatureMomentGravityCenter.cpp | #include <visp/vpConfig.h>
#ifdef VISP_MOMENTS_COMBINE_MATRICES
#include <vector>
#include <limits>
#include <visp/vpMomentObject.h>
#include <visp/vpFeatureMomentGravityCenter.h>
#include <visp/vpFeatureMomentBasic.h>
#include <visp/vpFeatureMomentDatabase.h>
/*!
Computes interaction matrix for gravity center mo... | ALGO | 0.967498 | 6.419935 |
9fd4f33a-8120-4a75-a740-ecd4489714cd | THS3154/gameserver | PlayerUtil.cpp | #include "pch.h"
#include "PlayerUtil.h"
PlayerUtil::PlayerUtil()
{
}
PlayerUtil::~PlayerUtil()
{
}
void PlayerUtil::AddPlayerToGrid(uint64 playerID, float x, float y)
{
int gridX = x / GRID_SIZE;
int gridY = y / GRID_SIZE;
GridPlayers[{gridX, gridY}].push_back(playerID);
}
void PlayerUtil::RemovePlayerToGrid(ui... | ALGO | 0.943068 | 4.742952 |
2e239fbb-cede-4aeb-ac06-2713776c54b4 | matthewReff/Kattis-Problems | code/owlandfox.cpp | #define _USE_MATH_DEFINES
#include <iostream>
#include <cmath>
#include <iomanip>
#include <vector>
#include <string>
#include <algorithm>
#include <unordered_set>
#include <ctype.h>
#include <queue>
#include <ctime>
using namespace std;
typedef long long ll;
int main()
{
ll i, j, k, l;
ll cases;
ll testNum;
ll... | ALGO | 0.999971 | 4.340505 |
ceda9f05-8974-4dfc-ab45-def72c9dc3d7 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_2976_14.cpp | #include <bits/stdc++.h>
using namespace std;
double low, high = 1000000, mid;
int n, p, a[100001], b[100001];
bool ok(double x) {
double sum = 0, num;
for (int i = 0; i < n; i++) {
num = x * a[i] - b[i];
if (num >= 0) sum += num / p;
}
return sum <= x;
}
int main() {
cin >> n >> p;
for (int i = 0; ... | ALGO | 0.999806 | 3.613374 |
6375e0bc-09e8-4294-9043-6aab529c1afa | Shriya-Jaiswal/DSA_POTD_Questions_solving | 2_MaximumSumCombination_Heap_GFG.cpp | #include<iostream>
#include<vector>
#include<queue>
#include<algorithm>
using namespace std;
// ◀️ Using heap
vector<int> maxCombinations(int N, int K, vector<int> &A, vector<int> &B) {
priority_queue<pair<int,pair<int,int>>> pq;
sort(A.begin(), A.end());
sort(B.begin(), B.end());
for(int i=0; i < N... | ALGO | 0.999996 | 5.010035 |
0d2a94c2-61b3-4678-b94d-122497d22931 | usi-verification-and-security/solc | libsolutil/Keccak256.cpp | /** @file SHA3.cpp
* @author Gav Wood <<EMAIL>>
* @date 2014
*/
#include <libsolutil/Keccak256.h>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <cstring>
using namespace std;
namespace solidity::util
{
namespace
{
/******** The Keccak-f[1600] permutation ********/
/*** Constants. ***/
stati... | ALGO | 0.993792 | 7.507054 |
8bf54e40-215c-41e1-9cf7-8a3fa10503ad | fyzel527/UnrealEngine-4.24Toon | Engine/Source/ThirdParty/CryptoPP/5.6.2/include/skipjack.cpp | // skipjack.cpp - modified by Wei Dai from Paulo Barreto's skipjack32.c,
// which is public domain according to his web site.
#include "pch.h"
#ifndef CRYPTOPP_IMPORTS
#include "skipjack.h"
/*
* Optimized implementation of SKIPJACK algorithm
*
* originally written by Panu Rissanen <<EMAIL>> 1998.06.24
* optimi... | ALGO | 0.999745 | 6.921281 |
0a35ac7b-f97b-4409-bcd4-fa33cd48929e | Majid985/cpp | recursion/calculate_power_of_number.cpp | #include<iostream>
using namespace std;
int power(int n, int p){
if(!p){
return 1;
}
int res=power(n, p-1);
return n*res;
}
int main(){
int n, p;
cin>>n>>p;
cout<<power(n, p);
return 0;
} | ALGO | 0.999991 | 4.819914 |
3230ea2e-2a23-4903-bc66-a1c276ec03be | HEDEZ44/DSA-PRACTICE | LDC/Two City Scheduling and lamda function.cpp | class Solution
{
public:
int twoCitySchedCost(vector<vector<int>> &costs)
{
int ans = 0;
sort(costs.begin(), costs.end(), [](vector<int> &v1, vector<int> &v2)
{ return (v1[0] - v1[1] < v2[0] - v2[1]); });
int n = costs.size() / 2;
for (int i = 0; i < n; i++)
... | ALGO | 0.999977 | 5.880177 |
f7830fb1-8dbf-4141-9d0f-d8d28a18572c | maxdev-lab/codingtest | jinyoung/3주차/3주차_1927번/3주차_1927번/1927번_jinyoung.cpp | #define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#define SIZE 100000
int heap[SIZE] = { 0 };
int N, x;
int count = 0;
void push() // 0 ƴ ο Ƴ
{
for (int i = 0;i < count;i++)
{
if (heap[i] == 0)
{
heap[i] = x;
}
else if (heap[i] > x)
{
heap[i + 1] = heap[i];
heap[i] = x;
}
}
}
i... | ALGO | 0.99999 | 3.912803 |
8ce1b0d3-f3df-408c-b3a6-2686d2c3d726 | Abhinav-Vijay-Walunj/DSA-INTERVIEW | 1394-find-lucky-integer-in-an-array/1394-find-lucky-integer-in-an-array.cpp | class Solution {
public:
int findLucky(vector<int>& arr) {
map<int,int> mp;
int ans=-1;
for(int i=0;i<arr.size();i++)
{
mp[arr[i]]++;
}
for(auto i:mp)
{
if(i.first == i.second)
{
ans=i.first;
}
... | ALGO | 0.999909 | 5.268215 |
383e5f89-332f-4af8-ac6f-1a8c77c5d137 | carlcastanas/FAANG-Resources-1 | 20.2.cpp | #include <iostream>
#include <cstdlib>
using namespace std;
void Swap(int &a, int &b){// 有可能swap同一变量,不能用异或版本
int t = a;
a = b;
b = t;
}
void RandomShuffle(int a[], int n){
for(int i=0; i<n; ++i){
int j = rand() % (n-i) + i;// 产生i到n-1间的随机数
Swap(a[i], a[j]);
}
}
int main(){
srand(... | ALGO | 0.999124 | 3.77544 |
0ec826cd-edb6-4bda-9cd0-9a48f702cb9c | Starkc137/firstYearCode | CPP/elseif.cpp | #include <iostream>
#include <tuple>
using namespace std;
int main(){
int grade;
cin>> grade;
if (grade >= 75 and grade <= 100){
cout <<"First" << endl;
}
if (grade >= 70 and grade <= 74){
cout <<"Upper second" << endl;
}
if (grade >= 60 and grade <= 69){
cout <<"Lower second" << endl;
}
if (grad... | ALGO | 0.998378 | 3.669486 |
e75ebfa7-fa27-4f3c-bed2-1ff62b722d8d | HieuGM/DSA_PTIT | DSA05001.cpp | #include<bits/stdc++.h>
#define int long long
#define pb push_back
#define fi first
#define se second
#define pii pair<int, int>
#define FULL(a) a.begin(), a.end()
#define FOR(i, a, b) for(int i=a; i<=b; ++i)
#define TIME (1.0 * clock() / CLOCKS_PER_SEC)
#define HieuGM signed main
#pragma GCC optimize("Ofast,03,unroll-... | ALGO | 0.999926 | 4.884651 |
a960d898-2da9-4173-bdea-96bb8ccd9ba9 | rajatsharma01/HighwayPathPlanning | src/Eigen-3.3/bench/benchEigenSolver.cpp |
// g++ -DNDEBUG -O3 -I.. benchEigenSolver.cpp -o benchEigenSolver && ./benchEigenSolver
// options:
// -DBENCH_GMM
// -DBENCH_GSL -lgsl /usr/lib/libcblas.so.3
// -DEIGEN_DONT_VECTORIZE
// -msse2
// -DREPEAT=100
// -DTRIES=10
// -DSCALAR=double
#include <iostream>
#include <Eigen/Core>
#include <Eigen/QR>
#in... | TOOL | 0.98764 | 5.772194 |
ecf62edf-fce5-449a-af41-94e77ed8063c | jnprynsh/Learning-Cpp | if_else_statement_2.cpp | #include<iostream>
using namespace std;
int main()
{
int x;
cout<<"Enter some no. here: ";
cin>>x;
if(x<=3)
{
cout<<"This is the first quater.";
}
else if(x>3 && x<=6)
{
cout<<"This is the second quater.";
}
else if(x>6 && x<=9)
{
cout<<"This is the ... | ALGO | 0.977843 | 3.134504 |
70b022be-7436-4df8-8a09-ba820a166f8d | vmarcoo/cpp-exercises | Exercise9/main.cpp | #include <iostream>
using namespace std;
int main()
{
int valueWanted, tenBills, fiveBills, oneBills, newValue1, newValue2, newValue3;
cout << "Enter how much money you wish to withdraw: " << endl;
cin >> valueWanted;
tenBills = valueWanted / 10;
newValue1 = valueWanted % 10;
fiveBills = ne... | ALGO | 0.986629 | 4.101753 |
c299b8e9-6f02-4ec1-b3d0-54b5a6377f08 | Rajdip-Pal/LeetCode | 200. Number of Islands/solution-two.cpp | #include <vector>
using ::std::vector;
class Solution
{
public:
int numIslands(vector<vector<char>> &grid)
{
vector<vector<bool>> visited(grid.size(), vector<bool>(grid[0].size()));
int di[4] = {0, 1, 0, -1};
int dj[4] = {1, 0, -1, 0};
auto dfs = [&](auto &&self, int row, int... | ALGO | 0.999847 | 6.507672 |
39fb82c6-0751-4869-89cc-a7ca570e841d | artur-amorim/PomeronHVQCD | src/Kernel.cpp | #include <functional>
#include <thread>
#include <mutex>
#include "HolographicVQCD.h"
#include "Kernel.h"
#include "Reggeon.h"
#include "schrodinger/schrodinger.h"
#include "methods/vectorOperators.hpp"
#include "methods/interpolation/Spline_Interp.hpp"
void Kernel::copy(const Kernel &rhs)
{
//Copies Kernel data
... | TOOL | 0.997068 | 5.046338 |
a39eb128-533d-44a1-9cc4-1a2dba34a34c | lucasxia01/Competitive-Programming-Problems | Codeforces/CF 780/E.cpp | #include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <functional>
#include <stdlib.h>
#include <time.h>
#include <complex>
#include <iterator>
#include <regex>
#include <fstream>
#include <utility>
#include <vector>
#include <string>
#include <cstring>
#include <stack>... | ALGO | 0.999906 | 5.114764 |
377aa80d-413c-44d9-8542-e19c8733abc1 | refi64/chromium-tar | third_party/angle/src/common/system_utils_win32.cpp | #include "system_utils.h"
#include <windows.h>
#include <array>
namespace angle
{
bool UnsetEnvironmentVar(const char *variableName)
{
return (SetEnvironmentVariableA(variableName, nullptr) == TRUE);
}
bool SetEnvironmentVar(const char *variableName, const char *value)
{
return (SetEnvironmentVariableA(varia... | TOOL | 0.876782 | 6.614673 |
b24d5d58-ab42-4c5d-85d3-a98664d32976 | devaliraza1/C- | Program17_bill.cpp | #include<iostream>
using namespace std;
int main()
{
double perunitrate,units;
cout<<"Enter the per unit rate in rupees : ";
cin>>perunitrate;
cout<<"Enter the number of units consumed : ";
cin>>units;
cout<<"The total bill is "<<perunitrate*units;
return 0;
}
| TOOL | 0.908711 | 3.952695 |
232b166f-794d-4868-ac1d-3ac3cad2d3a0 | shashvatms/Leetcode-Questions | 0124-binary-tree-maximum-path-sum/0124-binary-tree-maximum-path-sum.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.999976 | 6.511823 |
a6f6f84d-c985-4399-a8a6-62f64cd2b503 | melwynlobo/AWS-IOT-MQTT | aws-iot-device-sdk-cpp-master/src/discovery/DiscoveryResponse.cpp | /**
* @file DiscoveryResponse.cpp
* @brief
*
*/
#include "util/logging/Logging.hpp"
#include "util/logging/LogMacros.hpp"
#include "util/logging/ConsoleLogSystem.hpp"
#include "discovery/DiscoveryResponse.hpp"
#define LOG_TAG_DISCOVERY_RESPONSE "[Discovery Response]"
namespace awsiotsdk {
const util::String aw... | TOOL | 0.895366 | 7.12127 |
331c03bf-afc9-4a1b-9709-0ae2174b5005 | raincross7/code-similarity | codes/train_code/problem189/problem189_341.cpp | #include<iostream>
#include<vector>
using namespace std;
int main(){
int n,m;
cin>>n>>m;
vector<bool>v(n);
vector<bool>vend(n);
for(int i=0;i<m;i++)
{
int f,s;
cin>>f>>s;
f--,s--;
if(f==0){
v[s]=true;
}
else
if(s==n-1){
... | ALGO | 0.999953 | 4.027641 |
d61a2e33-dccb-4206-9bd6-6e5111028e70 | elizabeth-suehr/LIGGGHTS_CFDRC | src/fix_wall_sph_general_gap.cpp | #include <cmath>
#include <stdlib.h>
#include <string.h>
#include "fix_wall_sph_general_gap.h"
#include "atom.h"
#include "atom_vec.h"
#include "domain.h"
#include "update.h"
#include "force.h"
#include "respa.h"
#include "memory.h"
#include "comm.h"
#include "error.h"
#include "fix_property_atom.h"
#include "fix_prope... | TOOL | 0.953586 | 6.224767 |
d7b2f632-a4fe-408d-a7d3-488f04a22831 | Gin101/CS101 | HDU/3507.cpp | #include <iostream>
#include <cstring>
using namespace std;
const int maxN = 5e5 + 11;
const int INF = 0x3f3f3f3f;
int n = 0;
int m = 0;
int dp[maxN] = {0};
int sum[maxN] = {0};
int tmp[maxN * 4] = {0};
int main()
{
int n = 0;
int m = 0;
while (cin >> n >> m) {
for (int i = 1; i <= n; i++) {
... | ALGO | 0.999955 | 3.667386 |
912d207e-3a6e-4185-ac12-795774d4cc0a | ishandutta2007/codeforces | ssamt/normal/1608/B.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int cl, ql;
int i, j, k, l;
int t, n, m, q;
int in;
scanf("%d", &t);
for(cl=0; cl<t; cl++) {
int a, b;
scanf("%d %d %d", &n, &a, &b);
if(a+b < n-1 && abs(a-b) <= 1) {
deque<int> p;
for(i=0; i<n; i++) {
p.push_back(i+1);
}
if(a > b)... | ALGO | 0.999807 | 3.563471 |
e4629c14-a805-4564-b91b-29473cbb456c | alirezaopmc/UT-PTCC | e2/05 Binary Representation/solution.cpp | #include <iostream>
using namespace std;
int main() {
long long n;
cin >> n;
string s;
for(int i = n; i > 0; i /= 2) {
s = "01"[i % 2] + s;
}
cout << s << endl;
} | ALGO | 0.999995 | 4.591097 |
b4d6121e-4a6d-4763-964d-4e14c3614132 | tlans21/MEMORIZE | BOJ Class 3/이진트리.cpp | #include <iostream>
using namespace std;
int number = 15;
// 하나의 노드 정보를 선언합니다.
typedef struct node *treePointer;
typedef struct node {
string data;
treePointer leftchild;
treePointer rightchild;
}node;
//전위 순회
void preorder(treePointer ptr){
if(ptr){
cout << ptr->data <<' ';
preorder... | ALGO | 0.999752 | 3.586113 |
a675cb3c-a2c9-463b-8d1f-afe5a28e0e7f | not-joosh/Code-Wars | 8kyu/Count-odd-numbers-below-n.cpp | /*
8 kyu
Count Odd Numbers below n
4259588% of 4,6202,284 of 37,663kodejuice
C++
Clang 8 C++17
VIM
EMACS
Instructions
Output
Given a number n, return the number of positive odd numbers below n, EASY!
Examples (Input -> Output)
... | ALGO | 0.999324 | 6.086258 |
5e970ec6-292b-404d-8b46-2aac94c86d16 | Next-Gen-UI/Hacktober | LoveBabbar/15_bit-manipulation/10_power_set.cpp | /*
link: https://practice.geeksforgeeks.org/problems/power-set4302/1
*/
// ----------------------------------------------------------------------------------------------------------------------- //
// TC: O(2^n)
vector<string> AllPossibleStrings(string s) {
vector<string> ans;
int len = s.size();
// h... | ALGO | 0.999592 | 5.786125 |
144830be-e247-439c-b5b9-6f6cd823c523 | IvanLimar/Study | semestr1/Task4/Task4.2/Task4.2/main.cpp | #include <fstream>
#include "quickSort.h"
#include "frequentNumber.h"
using namespace std;
int main()
{
// - .
ifstream file("test.txt", ios::in);
int size = 0;
file >> size;
int *numbers = new int[size] {0};
for (int i = 0; i < size; ++i)
{
file >> numbers[i];
}
file.close();
quickSort(numbers, 0, ... | ALGO | 0.999484 | 4.818059 |
9e54c456-ce73-4082-a391-69edb3fca996 | ChuanSWT/Codeforces_codes | C_Cards_Partition.cpp | #include<iostream>
#include<vector>
#include<string>
#include<map>
#include<unordered_map>
#include<cmath>
#include<algorithm>
#include<set>
#include<tuple>
#include<cmath>
#include<queue>
#include<iomanip>
using namespace std;
#define int long long
void compe... | ALGO | 0.999876 | 4.058097 |
beea97cc-58e6-4501-93b3-c5d79a790118 | AnkitMaskara907/CP_codes | vscode/Assembly_1.cpp | // #pragma GCC optimize("Ofast")
// #pragma GCC target("avx")
#include<bits/stdc++.h>
using namespace std;
#define ll long long
// #define int long long
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// using namespace __gnu_pbds;
// typedef tree<int, null_type, less_equal<int>, rb... | ALGO | 0.99961 | 4.913327 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.