uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
95364bda-3e35-423a-ab57-b8b52de6004e | Bearsharks/dev-note | PS/codeforces/278B.cpp | #include <iostream>
#include <string>
#include <sstream>
using namespace std;
int main() {
cin.tie(NULL);
ios::sync_with_stdio(false);
int n;
cin >> n;
stringstream ss;
for (int i = 0; i < n; i++) {
string tmp;
cin >> tmp;
ss << " " << tmp;
}
string str = ss.str(... | ALGO | 0.998803 | 3.739474 |
dba1089c-8a2d-4041-9f93-db908e3338c1 | andrmor/ANTS2 | src/modules/lrf_v2/lrfxy.cpp | #include "lrfxy.h"
#include "jsonparser.h"
#include "spline.h"
#ifdef TPS3M
#include "tpspline3m.h"
#else
#include "tpspline3.h"
#endif
#ifdef NEWFIT
#include "tps3fit.h"
#endif
#include <QJsonObject>
#include <math.h>
LRFxy::LRFxy(double x_min, double x_max, int n_intx, double y_min,
double y_max, int ... | ALGO | 0.984146 | 6.336342 |
193b257a-86d1-4430-9731-f33b323c6947 | eunjin115/Today_I_Learned | Coding_Test/baekjoon/수학/4153.cpp | #include <iostream>
#include <cmath>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
int a, b, c;
vector <int> square;
while (1)
{
cin >> a >> b >> c;
if (a == 0 && b == 0 && c == 0)
break;
square.push_back(a);
square.push_back(b);
square.push_back(c);
int max = *max_el... | ALGO | 0.999883 | 3.616475 |
159d6846-a4c0-4e21-87b6-010b87730b23 | Avi-141/Competitive_Programming | Hackerearth/Dec_circuits19/MikeandFraud.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define MAX 200002
#define pb push_back
vector<int> primes;
unordered_map<int, int> k_cnt, current_map, cnts[MAX];
void sieve()
{
int prime[MAX];
prime[0] = prime[1] = 1;
for(int i = 2; i < MAX; i++)
if(prime[i] == 0)
for(int j = i * 2; j... | ALGO | 0.999946 | 3.96629 |
02e30185-9a98-444f-873a-ef5cf134df2c | lovelybigduck/note | 代码练习/刷题/2016天梯赛模拟题 最长对称子串.cpp | //2016ģ ԳӴ
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <iostream>
using namespace std;
#define ll long long
#define inf 0x3f3f3f3f
#define mem(a,b) memset(a,b,sizeof(a))
#define closeio std::ios::sync_with_stdio(... | ALGO | 0.999949 | 3.095064 |
c5dbef62-c643-4256-886c-73566811db9f | Teemumokkonen/advanced-robotics | advanced-robotics/trajectory_planners/src/tag_follower.cpp |
#include <ros/ros.h>
#include <actionlib/client/simple_action_client.h>
#include <actionlib/client/terminal_state.h>
#include <command_msgs/planAction.h>
#include <std_msgs/Float64MultiArray.h>
#include <geometry_msgs/TransformStamped.h>
#include <geometry_msgs/Twist.h>
#include <urdf/model.h>
// from kdl packages
#i... | TOOL | 0.892353 | 4.081681 |
b8b0772a-421e-40da-9fab-db02f759031a | shu8Cream/atcoder-archive | atcoder.jp/abc159/abc159_d/Main.cpp | #include <bits/stdc++.h>
#define rep(i,n) for (int i=0; i<(n); i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main(){
int n;
cin >> n;
vector<int> a(n);
rep(i,n) cin >> a[i];
map<int,int> b;
rep(i,n) b[a[i]]++;
ll ans=0,all=0;
for (auto p : b) {
ll v = p.second;
a... | ALGO | 0.999834 | 3.514596 |
6171964b-815b-45a4-a7c8-6c2d8a50bbee | hiranoo/atcoder | contests/abc167/c.cpp | #include <bits/stdc++.h>
#include <atcoder/segtree>
#include <time.h>
#define rep(i, s, t) for(int i = (s); i <= (t); i++)
#define repd(i, s, t) for(int i = (s); i >= (t); i--)
#define all(v) v.begin(), v.end()
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
typedef pair<int, int> pii;
typede... | ALGO | 0.999981 | 4.8083 |
3b0b90f8-5df6-444c-8eda-a3c2456efb35 | omar-s-ta/solved-problems | CodeForces/Ladders/Div2 B/B. Little Elephant and Magic Square.cpp | #include <bits/stdc++.h>
using namespace std;
struct io {
template<class T>
static inline T next() {
T x; std::cin >> x;
return x;
}
template<class T>
static inline std::vector<T> next_array(const int n) {
std::vector<T> row(n);
for (int i = 0; i < n; ++i)
row[i] = io::next<T>();
r... | ALGO | 0.998882 | 3.928763 |
86c8cd98-a67f-48e8-90ac-c9c3b3404525 | sohag16030/Basic-Programming | Data-structure-Algorithm/Graph Rough/graph(sohel)/Graph/BFS_DFS/DFS.cpp | #include<bits/stdc++.h>
#define sf scanf
#define pf printf
#define ll long long
#define sz 10001
#define pi acos(-1.0)
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define all(x) x.begin(),x.e... | ALGO | 0.999916 | 3.832849 |
6d8fbcc7-85aa-491f-a8f6-6e539900f1f8 | eloraiby/ProximityQuery | include/glm/test/core/core_func_integer_find_lsb.cpp | ///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2015 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... | ALGO | 0.997563 | 5.186495 |
e93c9ee4-42df-414d-8674-3185ef81f9eb | FiRebourn088/Data-Structures | LinkedList/SingleLLDeletion.cpp | #include <iostream>
using namespace std;
class Node{
public:
int data;
Node *next;
};
void insert(Node* *head, int data){
Node *newNode = new Node();
newNode -> data = data;
newNode -> next = *head;
*head = newNode;
}
void deleteVal(Node* *head, int del){
Node *temp = new Node();
... | ALGO | 0.999561 | 4.738843 |
0d7a81e3-43d5-4325-a399-529944041ab5 | matteocarde/patty | benchmarks/planners/z3-4.6.0/src/smt/smt_model_generator.cpp | #include "util/ref_util.h"
#include "ast/for_each_expr.h"
#include "ast/ast_pp.h"
#include "ast/ast_smt2_pp.h"
#include "smt/smt_context.h"
#include "smt/smt_model_generator.h"
#include "smt/proto_model/proto_model.h"
namespace smt {
model_generator::model_generator(ast_manager & m):
m_manager(m),
... | TOOL | 0.97595 | 7.012301 |
ff3770b6-762d-495e-88e8-8dd753bb1484 | ASchneidman/HackCMU2018 | HackCMU2018/crawler/cpp_files/Code JamROUND A APAC 2017Problem B. Rain.cpp | <<<<<<< HEAD
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> ii;
typedef vector<ii> vii;
typedef vector<int> vi;
#define INF (1<<25)
typedef bool (*comp)(pair<ii,int> , pair<ii,int> );
vector<vi> grid;
vector<vi> visited;
int m,n;
int ans;
bool compare (pair<ii,int> a, pair<i... | ALGO | 0.999916 | 4.629349 |
b18d4cb7-1ef8-4981-8803-ccdfb09c2809 | NeuralNimbus/C-Programming | Programs/binary_search_tree.cpp | // Binary Search Tree
#include <iostream>
using namespace std;
typedef struct Node {
int data;
Node* left;
Node* right;
} Node;
Node* insertNode(Node* node, int data)
{
/*
Function to insert node in BST
PARAMETERS
root: The root node of BST
data: The value to insert
RETU... | ALGO | 0.999776 | 5.600117 |
348db64f-1302-457c-bdf9-a70cc426dbe3 | Daipuwei/PAT | 乙级/火星数字/火星数字.cpp | #include <iostream>
#include <string>
#include <stdio.h>
#include <cstring>
using namespace std;
string gewei[13] = {"tret","jan","feb","mar","apr","may","jun","jly","aug","sep","oct","nov","dec"};
string shiwei[13] ={" ","tam","hel","maa","huh","tou","kes","hei","elo","syy","lok","mer","jou"};
int Number(string str... | ALGO | 0.999646 | 3.857966 |
00902b95-fd96-463e-ac5d-51d0ce592f0e | ishandutta2007/codeforces | lycmd/normal/811/E.cpp | #include<bits/stdc++.h>
#define ls(x) ((x)<<1)
#define rs(x) ((x)<<1|1)
using namespace std;
int const N=12,M=400010;
int n,m,q,ord[N<<2];
array<int,N>a[M];
struct dsu{
int f[N];
void init(int n){
for(int i=1;i<=n;i++)f[i]=i;
}
int find(int x){
return x^f[x]?f[x]=find(f[x]):x;
}
int merge(int x,int y){
int ... | ALGO | 0.999772 | 3.779734 |
0b27da1e-7d71-423d-88d3-5d160af20147 | AshDr/Competition | template/SparseTable.cpp | template <typename T, bool isMin>
struct SparseTable {
int n, m;
vector<vector<T>> st;
vector<T> a;
SparseTable() {}
SparseTable(int n) : n(n), m(__lg(n)), st(m + 1, vector<T>(n + 1)) {}
SparseTable(const vector<T> &init) : SparseTable((int)init.size()) {
a.assign(all(init));
iota(all(st[0]), 0);
... | ALGO | 0.999942 | 5.682635 |
dd34da1e-7c5f-449d-b0b7-4a3ac5bf159a | SteveWolligandt/tatooine | misc/pathlines_for_thomas.cpp | #include <tatooine/boussinesq.h>
#include <tatooine/cavity.h>
#include <tatooine/random.h>
#include <tatooine/rbc.h>
using namespace tatooine;
template <typename V>
auto random_domain_position(const V& v, const boundingbox<double, 2>& domain, double t) {
random::uniform randx{domain.min(0), domain.max(0)};
ran... | ALGO | 0.989239 | 5.675397 |
245306f3-1e46-4c43-a23e-5fef362dc544 | compbiogroup/lambda-permutations | inversion-algorithms/src/sbsr.cpp | #include "../include/sbsr.h"
SbSR::SbSR():Problem(){}
SbSR::SbSR(vector<int> perm, int lambda):Problem(perm, lambda){}
int SbSR::sort(){
int distance = 0;
while(this->inv_pi > 0){
int best_i, best_j, best_score;
best_i = best_j = best_score = 0;
for(int i = 1; i <= n; i++){
int inv_variation = ... | ALGO | 0.999979 | 3.774072 |
841cb99d-8396-4fd9-a132-48736256353e | Florian-A/Piscine-CPP | cpp08/ex01/sources/Span.cpp | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* Span.cpp :+: :+: :+: ... | ALGO | 0.884744 | 5.053856 |
d59e4d59-7876-41b9-a399-b007df72b4c8 | quirrelHK/DSA | recursion/basic problems/prob3.cpp | // Print linearly from n to 1
#include<iostream>
using namespace std;
void fun(int i,int n){
if(i < 1)
return;
cout << i << endl;;
fun(i-1,n);
}
int main(){
int n;
cin >> n;
fun(n,n);
} | ALGO | 0.999733 | 4.308884 |
b2a6d305-282b-4c76-b444-6c77bad41eb8 | porterlin/CP-Practice | leetcode/binary-search/2563.cpp | class Solution {
public:
long long binary_search(span<int> nums, int target) {
int left = 0, right = nums.size() - 1;
int mid;
while (left <= right) {
mid = (right + left) / 2;
if (nums[mid] < target)
left = mid + 1;
else
ri... | ALGO | 0.999979 | 5.941113 |
55769dab-fa28-4542-b95b-32b72e26f122 | AhmedKhalafallah1999/Algorithms | MergeSort/MergeSort.cpp | // MergeSort.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
using namespace std;
void merge(int arr[], int left, int mid, int right) {
int i = left, j = mid + 1, k = left;
int temp[5];
while (i <= mid && j <= right) {
if (arr[i] < arr[j... | ALGO | 0.999959 | 5.247646 |
2eb632f0-3df1-4ee2-be97-d25debce3a4d | lshmouse/interviews | codejam/codejam-2013/1B/b.cpp | #include <stdio.h>
#include <string.h>
#include <math.h>
#include <vector>
#include <algorithm>
using namespace std;
int n, x, y;
double calc(int n, int k) {
double ret = 1.0;
for (int i = k + 1; i <= n; i++) {
ret*= i;
ret/= (i -k);
}
for (int i = 1; i <= n; i++) ret/= 2;
retur... | ALGO | 0.999419 | 3.83198 |
451ec725-2081-438d-aa1d-c4afb227c8f9 | RWTH-HPC/static-filter-rma-c3po24 | MUST/externals/GTI/modules/utility/BinomialTree.cpp | #include <cmath>
#include <cstddef>
#include <algorithm>
#ifndef PERMUT_RANK
#define PERMUT_RANK(rank, root, N) ((rank + N - root) % N)
#endif
namespace BinomialTree {
unsigned int treeDepth(size_t groupSize) {
return std::ceil(std::log2(groupSize));
}
unsigned int treeHeight(size_t groupSize) {
return std::... | ALGO | 0.999905 | 5.286268 |
33c5986b-0b42-40c2-b879-11dd42e72fd0 | ravisharma-16/All-_Codes3 | Tree/ConstructBinaryTreeInorderandPostorderTraversal.cpp | // leetcode no = 106
// problem: Construct Binary Tree from Inorder and Postorder Traversal
// https://leetcode.com/problems/construct-binary-tree-from-inorder-and-postorder-traversal/description/
#include<iostream>
#include<vector>
using namespace std;
class TreeNode
{
public:
int data;
TreeNode *left;
... | ALGO | 0.999939 | 6.194558 |
928782de-10ed-4421-b82c-5797f5ab9539 | huakunyang/SummerAsr | eigen-3.4.0/doc/examples/tut_arithmetic_redux_basic.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace std;
int main()
{
Eigen::Matrix2d mat;
mat << 1, 2,
3, 4;
cout << "Here is mat.sum(): " << mat.sum() << endl;
cout << "Here is mat.prod(): " << mat.prod() << endl;
cout << "Here is mat.mean(): " << mat.mean() ... | ALGO | 0.998908 | 3.872858 |
f7fbf59c-4358-4f3e-8291-c7563706f889 | phungminhanh/java-ex | DSA C++/DSA01020.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
iostream::sync_with_stdio(false);
int t;
cin >> t;
while (t--) {
string s;
cin >> s;
int n = s.length();
bool check = true;
for (auto i:s) {
if (i!='0') check = false;
}
if (check == true) {
for (int i = 0; i<n; i+... | ALGO | 0.999949 | 3.881727 |
86d6769a-4582-4c57-8888-4934ec939118 | menta78/LISFLOOD-FP-unibo | por_flow.cpp | /*
*****************************************************************************
POROSITY
---------------------
Simple porosity scaling algorithm used to represent floodplain structures and
topographic complexity. A number of different porosity approaches are incorporated
and each are outlined in the full documentatio... | ALGO | 0.999575 | 3.558836 |
af2ebef5-ebc0-41f8-a478-ff569f3023fe | jmkjohns/Euler_cpp | 014.cpp | #include <iostream>
#include <cstdint>
//functions
//variables
int limit = 1000000;
uint64_t *numbers;
int steps = 0;
int maxSteps = 0;
uint64_t biggest = 0;
int main( int argc, char *argv[] )
{
numbers = new uint64_t[limit];
for (int i = 0; i < limit; ++i)
{
numbers[i] = i;
}
for (int i = limit - 1; i >= 2;... | ALGO | 0.999956 | 5.217528 |
7ffe3a52-3cbe-4305-9d1c-f46fff263fcb | saurabhsoodpec/selfdriving | CarND-MPC-Project/src/Eigen-3.3/doc/examples/DenseBase_middleRows_int.cpp | #include <Eigen/Core>
#include <iostream>
using namespace Eigen;
using namespace std;
int main(void)
{
int const N = 5;
MatrixXi A(N,N);
A.setRandom();
cout << "A =\n" << A << '\n' << endl;
cout << "A(2..3,:) =\n" << A.middleRows(2,2) << endl;
return 0;
}
| ALGO | 0.867777 | 3.307581 |
d8b5a83d-4b30-4d92-baf0-04b7bed41073 | amanjha491/Leetcode_Solution | 2600-2699/2653.Sliding Subarray Beauty/Solution.cpp | class Solution {
public:
vector<int> getSubarrayBeauty(vector<int>& nums, int k, int x) {
int n = nums.size();
int cnt[101]{};
for (int i = 0; i < k; ++i) {
++cnt[nums[i] + 50];
}
vector<int> ans(n - k + 1);
auto f = [&](int x) {
int s = 0;
... | ALGO | 0.999988 | 5.382412 |
0d40f1fa-964c-47cf-8e1d-1212dd48bf96 | shreyashji/Dsa-essential | 1. Arrays/1.LinearSearch.cpp | #include<iostream>
using namespace std;
int linear_search(int arr[],int n,int key){
for(int i=0; i<n; i++){
//Check if current element matches with the key
if(arr[i] == key){
return i;
}
}
//out of the loop
return -1;
}
int main(){
int arr[] = {10,15,12,9,6,4,3,10,8};
int n = sizeof(arr)/sizeof(int... | ALGO | 0.999713 | 5.012826 |
990181c3-5604-4921-beda-08c9f8830a8c | ArhamKhanPathan/DSA | Tree/BST/BSTfromSortedArray.cpp | #include<bits/stdc++.h>
using namespace std;
template<typename T>
class BinaryTreeNode
{
public:
T data;
BinaryTreeNode* left;
BinaryTreeNode* right;
BinaryTreeNode(T data)
{
this->data = data;
}
~ BinaryTreeNode()
{
delete left;
delete right;
}
};
Bi... | ALGO | 0.999471 | 4.125729 |
dba420d5-05ad-42b5-943b-e95e1ed0445d | yingjieyao/programming2017aut | week6/homework/A.cpp | #include <stdio.h>
#include <time.h>
#include <assert.h>
#include <algorithm>
using namespace std;
int getint() {
int r = 0; char t = 0;
while (t < '0' || t > '9') {
if ((t = getchar()) == EOF) return EOF;
}
while (t >= '0' && t <= '9') {
r = r * 10 + t - '0';
t = getchar();
... | ALGO | 0.999943 | 3.678358 |
85cc9064-4781-4527-ae6b-b81440163a35 | tae796/algorithm | algorithm/swexpert/d3/12004.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
int n;
cin >> n;
int flag = 0;
for(int i=1; i<10; i++){
for(int j=1; j<10; j++){
if((i*j) == n) flag = 1;
}
}
if(flag == 1) cout << "Yes" << "\n";
else cout <... | ALGO | 0.999861 | 5.078945 |
f1976b57-45e4-420e-954c-c399c78e7fee | Harshul02/DAA2022_Harshul-Jain-2017331- | Practicals/Week 6/Q-3/Cycle.cpp | #include<iostream>
#include<vector>
#include<stack>
using namespace std;
bool dfs(int node,vector<int>&vis,vector<int>&dfvis,vector<vector<int>>&v)
{ vis[node]=1;
dfvis[node]=1;
for(int i=0;i<v[node].size();i++)
{
if(vis[i]!=1 && v[node][i]!=0)
{
if(dfs(i,vis,dfvis,v))
return true;
}
else if(v[node][i]!=0&&vis... | ALGO | 0.999987 | 4.136101 |
73f204e8-53dd-4e7e-9681-b288910db57c | shishirsthakur/cpp | Questions/TLE/L1/J. Multiples.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
ios::sync_with_stdio(0);
cin.tie(0);
long long int a, b;
cin >> a >> b;
if(a%b==0 || b%a==0){
cout << "Multiples";
}
else cout << "No Multiples";
} | ALGO | 0.999866 | 4.198559 |
7d72fdb8-10c1-45c4-903c-f8d4226d3fbc | geekygavesh/sortsearch | bubblesort/bubblesortcode.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int arr[] = {2,3,1,5,4,6};
int n = 6;
// for(int i=0;i<n;i++){
// cout<<arr[i]<<" ";
//}
// bubble sort
for(int i=0;i<n-1;i++){
// traverse
for(int j=0;j<n-1-i;j++){
if(arr[j]>arr[j+1]){
... | ALGO | 0.999809 | 4.020843 |
ef8bd2c8-f4b6-49ca-b4e0-cca413d7a59e | its-anmol/codingChallege | 1354-find-players-with-zero-or-one-losses/find-players-with-zero-or-one-losses.cpp | class Solution {
public:
vector<vector<int>> findWinners(vector<vector<int>>& matches) {
unordered_map<int,int>lost_map;
for(int i=0;i<matches.size();i++)
{
int lose=matches[i][1];
lost_map[lose]++;
}
vector<int>notLost;
vector<int>onceLost;
... | ALGO | 0.999853 | 5.50318 |
22e3f5ae-011a-4e61-8cfa-77f819a53fb7 | evga7/Algorithm-practice | Programmers/BOJ_7562.cpp | #include <iostream>
using namespace std;
#include <string.h>
#include <queue>
int arr[305][305];
int dx[8] = { -1,-2,-2,-1,1,2,2,1 };
int dy[8] = { -2,-1,1,2,2,1,-1,-2 };
int T;
int N;
int sx, sy, desx, desy;
void BFS()
{
queue <pair<pair<int, int>, int>> q;
arr[sx][sy] = 1;
q.push(make_pair(make_pair(sx, sy), 0));
... | ALGO | 0.999467 | 4.244424 |
a78d6a92-cbd0-41b9-8004-c7a16d71ca64 | OmkarBhostekar/leetcode | 73-set-matrix-zeroes/73-set-matrix-zeroes.cpp | class Solution {
public:
void setZeroes(vector<vector<int>>& m) {
unordered_set<int> x;
unordered_set<int> y;
for(int i=0; i<m.size();i++){
for(int j=0;j<m[i].size();j++){
if(m[i][j] == 0){
x.insert(i);
y.insert(j);
... | ALGO | 0.998588 | 5.877435 |
0b5c89f5-2682-4053-aa94-67368cec741c | rst-tu-dortmund/lerojd | pcdet/ops/pointnet2/pointnet2_stack/src/vector_pool.cpp | #include <torch/serialize/tensor.h>
#include <vector>
#include <THC/THC.h>
#include <cuda.h>
#include <cuda_runtime_api.h>
#include "vector_pool_gpu.h"
extern THCState *state;
#define CHECK_CUDA(x) do { \
if (!x.type().is_cuda()) { \
fprintf(stderr, "%s must be CUDA tensor at %s:%d\n", #x, __FILE__, __LINE__); ... | ALGO | 0.928706 | 6.073704 |
ef6a41a5-cac1-4fca-b649-506a4e387dcf | nohago/csc134 | M3LAB3/main.cpp | // CSC134
// M3LAB3
// Noha Goumaa
// 2/15/23
#include <iostream>
#include <cstdlib>
#include <ctime> // use of time
using namespace std;
// this program simlates a single game of crps.
int main() {
// variables
int die1, die2, roll; // roll is 2d6
int seed; // will use time(0) later
//char ... | ALGO | 0.976515 | 5.284718 |
6db7129d-7afb-4317-a288-57d32e507f65 | MSRCCS/Caffe | tools/compute_image_mean.cpp | #include <stdint.h>
#include <algorithm>
#include <string>
#include <utility>
#include <vector>
#include "boost/scoped_ptr.hpp"
#include "gflags/gflags.h"
#include "glog/logging.h"
#include "caffe/proto/caffe.pb.h"
#include "caffe/util/db.hpp"
#include "caffe/util/io.hpp"
using namespace caffe; // NOLINT(build/name... | DATA | 0.915345 | 6.438655 |
4e029aa2-140a-49ea-9a1f-dccda87a95f9 | sinian666/codes_102_4 | cpp_副本9/chapter_sorting/insertion_sort.cpp | /**
* File: insertion_sort.cpp
* Created Time: 2022-11-25
* Author: Krahets (<EMAIL>)
*/
#include "../utils/common.hpp"
/* 插入排序 */
void insertionSort(vector<int> &nums) {
// 外循环:base = nums[1], nums[2], ..., nums[n-1]
for (int i = 1; i < nums.size(); i++) {
int base = nums[i], j = i - 1;
/... | ALGO | 0.999944 | 6.157312 |
6d167e52-0223-4d7f-899d-7664d9ac1a6e | PedroAngeli/Competitive-Programming | Solutions/Codeforces/CF-C1/581.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define endl '\n'
#define f first
#define s second
#define ub upper_bound
#define lb lower_bound
#define pb push_back
#define all(c) (c).begin(), (c).end()
#define ... | ALGO | 0.99993 | 4.115927 |
4f1371f1-3d50-40b6-a292-004004d2c511 | MikamiTetsuro365/Atcoder | JOI/JOI2019-2020_2rd_yosen/C.cpp | #include "bits/stdc++.h"
using namespace std;
typedef long long int ll;
typedef pair<ll, ll > pi;
typedef pair<pair<ll, ll >, ll > pii;
vector<ll > vec;
vector<vector<ll > > vec2;
ll MOD = 1000000007;
ll INF = 1145141919454519;
using namespace std;
ll check(ll num){
string s = to_string(num);
ll sum = 0;... | ALGO | 0.99977 | 3.679937 |
2ba45f3b-af2f-4575-b335-99b3ad377f12 | alexandraback/datacollection | solutions_1483485_0/C++/Bigtime/main.cpp | #include <iostream>
#include <string>
#include <stdio.h>
using namespace std;
char c[27]="yhesocvxduiglbkrztnwjpfmaq";
int main()
{
freopen("A-small-attempt2.in","r",stdin);
freopen("out.out","w",stdout);
int t;
cin>>t;
string a;
getline(cin,a);
int n=0;
while(t--)
{
n++;
... | ALGO | 0.999117 | 3.737927 |
75105b0d-db13-4ef0-bd04-085cb5a509f1 | Aryan810/programming | learn/learn_cpp/DSA/22_stackDataType_with_linked_list.cpp | #include <iostream>
#include <string>
using namespace std;
template <class t>
class MyStack{
public:
class Node;
int size;
Node* top;
int elements_num;
public:
class Node{
public:
Node* next;
t value;
Node(t value, Node* n... | ALGO | 0.852745 | 4.203359 |
22c1957c-187d-41cd-a570-4789ab20b60a | garg-khushi/Leetcode | 0050-powx-n/0050-powx-n.cpp | class Solution {
public:
double myPow(double x, int n) {
return pow(x,n);
}
}; | ALGO | 0.999469 | 5.49101 |
c5397bbd-19c5-454f-b1df-be04212f16e5 | pranayghosh18/leetcode | 442-find-all-duplicates-in-an-array/find-all-duplicates-in-an-array.cpp | class Solution {
public:
vector<int> findDuplicates(vector<int>& nums) {
// testing...........
// cout<<nums.size()<<endl;
// for(int i : nums) cout << i <<endl;
// if(nums.size() > 5000 ) return {};
// done
for(int i=0; i<nums.size();){
if(nums[i]==nums[ nums[i... | ALGO | 0.99997 | 4.996571 |
414cb934-d926-4c82-b053-b196f7442d64 | parallel101/course | 10/00/05.cpp | #include "bate.h"
#define N (1024*1024)
struct Matrix {
struct MyHash {
std::size_t operator()(std::tuple<int, int> const &key) const {
auto const &[x, y] = key;
return (x * 2718281828) ^ (y * 3141592653);
}
};
std::unordered_map<std::tuple<int, int>, float, MyHash... | ALGO | 0.981946 | 4.19225 |
8aa5eb7e-193d-4239-8419-3ce62b5f9184 | TUE-EE-ES/HalideTCU | apps/mat_mul/mat_mul_generator.cpp | #include "Halide.h"
using namespace Halide;
namespace {
class MatMul : public Halide::Generator<MatMul> {
public:
GeneratorParam<int> matrix_size{"matrix_size", 1024};
Input<Buffer<float16_t>> input_a{"input_a", 2};
Input<Buffer<float16_t>> input_b{"input_b", 2};
Output<Buffer<float>> matrix_mul{"output", 2};... | ALGO | 0.898747 | 6.636044 |
e0800249-556f-4241-844c-c54f11fd063b | CodeHuTuTu/algorithm_1 | 05-Binary-Search-Tree/Course Code (C++)/10-The-Disadvantages-of-Binary-Search-Tree-and-More-Trees/main.cpp | #include <iostream>
#include <vector>
#include <string>
#include "BST.h"
#include "SequenceST.h"
#include "FileOps.h"
using namespace std;
// 实验二分搜索树的局限性
int main() {
// 我们使用文本量更小的共产主义宣言进行试验:)
string filename = "communist.txt";
vector<string> words;
if( FileOps::readFile(filename, words) ) {
... | TEST | 0.982126 | 4.697936 |
9bf2dc6d-20a8-4dc0-94d5-21771df14851 | vasudevgupta62218/Cplusplus | bubblesort.cpp | //Bubble Sort Algorithm
#include<iostream>
#include<vector>
using namespace std;
void bubblesort(vector<int>v){
for(int i=0;i<v.size()-1;i++){
for(int j=0;j<v.size()-i-1;j++){
if(v[j]>v[j+1]){
swap(v[j],v[j+1]);
... | ALGO | 0.999846 | 5.027808 |
bfbbb1ce-b888-48e3-8738-de6785385096 | crypticani/Data_Structures | c++ programs/sorting/mergeSort.cpp | #include <iostream>
using namespace std;
int co=0,d=0,cq=0,count=0;
void merging(int arr[], int p, int q, int r) {
co++;
int n1 = q - p + 1;
count+=2;
int n2 = r - q;
int LeftArray[n1], RightArray[n2];
count++;
for (int i = 0; i < n1; i++){
count++;
LeftArray[i] = arr[p + i];
count++;
co... | ALGO | 0.999976 | 4.776113 |
413909b0-e479-410f-b72e-876c159fc1aa | adityak54/cp | before-aug-24/C_Qingshan_Loves_Strings_2.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long int
#define pi pair<int,int>
#define sortall(n) sort(n.begin(), n.end())
#define rsortall(n) sort(n.begin(), n.end(), greater<int>());
// Input Functions
template<typename T>std::vector<T> input(int n) {std::vector<T> v(n);for (int i = 0; i < n; ++i)... | ALGO | 0.999507 | 4.519557 |
e3828ed5-6e00-4d9a-8e8b-2fcdfb2468b2 | sid-am-ahd935/Aliahns | C++/Important Miscellaneous Programs/quickSort.cpp | // Quick sort in C++
#include <iostream>
using namespace std;
// function to swap elements
void swap(int *a, int *b) {
int t = *a;
*a = *b;
*b = t;
}
// function to print the array
void printArray(int array[], int size) {
int i;
for (i = 0; i < size; i++)
cout << array[i] << " ";
cout << endl;
}
// ... | ALGO | 0.99999 | 5.780731 |
ece4c493-d49a-49ab-b201-f164577eb9fe | tph00300/Problem_Solving | Baekjoon/구현/10845.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int n;
cin >> n;
queue<int> q;
for(int i = 1; i <= n; i++)
{
string s;
int temp;
cin >> s;
if(s=="push"){
cin >> temp;
q.push(temp);
}else if(s=="pop")... | ALGO | 0.998419 | 4.200805 |
d02cc2a2-f9b0-4d41-81f6-32a42e94a705 | valentyn-arkho/laby | Laba 7 V2/main.cpp | #include <iostream>
#include <conio.h>
#include <cstdlib>
#include <time.h>
using namespace std;
int main()
{
system("chcp 1251 > nul");
int n,k=0,z=0;
do {
cout << " n (n<=500): ";
cin >> n;
} while (n<=0 || n>500);
int *A = new int [n];
srand(time(NULL));
cout << "A... | ALGO | 0.998653 | 3.153675 |
7536af80-83ea-4b4d-b199-22e0a6b9ad55 | parzuko/multilingual_leetcode | data_structures/arrays/000Misc/ArrayChallenges8.4/KickStartArithmaticArray.cpp | #include<bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
#define int long long
#define pb push_back
#define mp make_pair
#define pii pair<int,int>
#define vi vector<int>
#define mii map<int,int>... | ALGO | 0.998631 | 3.96249 |
4f2eddaa-7bb2-47e2-8667-2cd18c242d93 | sourabh59-coder/StriverA-Z_Sheet | Step 06 : Learn LinkedList [Single LL, Double LL, Medium, Hard Problems]/Lec 5: Hard/01. K reverse LL/Approach1.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
ListNode* kthNode(Lis... | ALGO | 0.999997 | 6.018372 |
abda4be3-bb1c-4dd1-bb65-9e8318dea103 | Gopal-nd/DSA-striver | pattrens/2.cpp | #include<bits/stdc++.h>
using namespace std;
/*
#
# #
# # #
# # # #
# # # # #
*/
int main(){
for(int i=0;i<5;i++){
for(int j=0;j<=i;j++){
cout <<"# ";
}
cout << endl;
}
return 0;
}
| ALGO | 0.999851 | 3.039601 |
0fe6aec0-cf09-4063-877e-afd61dc6c3c2 | Karanbyte07/C-DSA-Library | Lecture 006 Binary & Decimal Number System/totalBit.cpp | #include <iostream>
#include <math.h>
using namespace std;
/*
// Function to count the number of set bits in a number
int countSetBits(int n) {
int count = 0;
while (n) {
count += n & 1; // Increment count if the last bit is 1
n >>= 1; // Right shift n by 1 bit
}
return count;
}
... | ALGO | 0.999512 | 5.583543 |
4fba2973-9458-44b3-9fd3-528e3705cc50 | ezhou2008/algorithm-basic | cpp2/630-Knight-Shortest-Path-II.cpp | /*Knight Shortest Path II
Description
Given a knight in a chessboard n * m (a binary matrix with 0 as empty
and 1 as barrier). the knight initialze position is (0, 0) and he wants
to reach position (n - 1, m - 1), Knight can only be from left to right.
Find the shortest path to the destination position, return the len... | ALGO | 0.99993 | 5.693625 |
defc7c1b-8bd9-4aae-b5ce-2f7192e394af | LinkShake/cpp-exercises | sortingAlgorithms/main.cpp | #include <iostream>
#include <cstdlib>
#include <ctime>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
void randArr(long v[], unsigned long length) {
for (unsigned long i = 0; i < length; i++) v[i] = rand();
}
void swap(long v[], long i, long j) {
long tmp = v[... | ALGO | 0.999261 | 4.44691 |
88ae49e8-e709-4843-897b-e1dce219877f | Ddhruv-IOT/CPP-Revision | coding-ninjas-dsa-gp/arrays/flipBits.cpp | // You are given an array of integers ARR[] of size N consisting of zeros and ones. You have to select a subset and flip bits of that subset.
// You have to return the count of maximum one’s that you can obtain by flipping chosen sub-array at most once.
#include <iostream>
#include <climits>
#include <math.h>
using n... | ALGO | 0.999949 | 5.475564 |
b2fc608d-5aa4-4810-9306-94bfc7295b84 | 1tygoime/a | codefun/P162.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
long long a, b, c, t, count(0);
cin >> a >> b >> c >> t;
if (a == 0 && b == 0 && c == 0)
{
cout << 0;
return 0;
}
else
{
for (long long x = 0; x <= 101; x++)
{
for (long long y = 0; y <= 1... | ALGO | 0.999745 | 4.24591 |
273cb232-399b-487b-bf5b-595a76c6f476 | Amarjeet264/DSA-problems | 890-lemonade-change/lemonade-change.cpp | class Solution {
public:
bool lemonadeChange(vector<int>& bills) {
int count5=0;
int count10=0;
int N=bills.size();
for(int i=0;i<N;i++){
if(bills[i]==5){
count5++;
}
else if(bills[i]==10){
count10++;
... | ALGO | 0.999484 | 5.983206 |
83b0512f-892d-4a3a-b3be-a63e0ff8d4f9 | manikanta2901/ubuntu | .history/imp/cpp/Algorithm/BitManupulationBasics.cpp/basics_20210106185510.cpp | #include<bits/stdc++.h>
using namespace std;
// Get bit
int GetBit(int number,int position){
return (number & (1 << position)) != 0;
}
int SetBit(int number, int position){
return (number | (1 << position));
}
int main(){
int number,position;
cout << "Enter the number and position" << endl;
cin ... | ALGO | 0.998657 | 4.703742 |
9d7c7cb5-5966-49ab-8ad0-49b49424c9cb | anak1st/Contests | src/AtCoder/Beginner/2022/270/F.cpp | /**
* @author: XiaFan
* @date: 09-29 19:51
**/
#include <bits/stdc++.h>
using i64 = long long;
class DSU {
private:
std::vector<int> f, s;
public:
DSU(int n) : f(n), s(n, 1) {
std::iota(f.begin(), f.end(), 0);
}
int find(int x) {
if (f[x] != x) {
f[x] = find(f[x]);
... | ALGO | 0.999919 | 4.285217 |
9d0e88e2-9644-426b-94e8-070167924e50 | ishandutta2007/codeforces | autumnkite/normal/1726/E.cpp | #include <bits/stdc++.h>
template<unsigned P>
class modint {
static_assert(1 <= P, "P must be a positive integer");
using mint = modint<P>;
protected:
unsigned v;
public:
constexpr modint() : v() {}
template<typename T,
typename std::enable_if<std::is_integral<T>::value &&
... | ALGO | 0.999878 | 4.278209 |
8fd462d2-bf61-42ae-8316-09f20334f0fd | Andrew-Hany/DataStructure_algortihms | datastructure/Trees/binaryTree.cpp | #include<iostream>
using namespace std;
template<class X>
class Node{
private:
X data;
Node *left;
Node*right;
public:
Node<X>(X d){ data=d; left=NULL;right=NULL ;}
X getdata(){return data;}
Node<X>*getleft(){return left;}
Node<X>*getright(){return right;}
void setLeft( Node<X>*... | ALGO | 0.999855 | 4.548416 |
8e0e38ee-c6b6-40f5-829e-8c94bb903232 | wdndev/personal | leetcode/04_hot100/08_tree/226.翻转二叉树.cpp | /*
* @lc app=leetcode.cn id=226 lang=cpp
*
* [226] 翻转二叉树
*
* https://leetcode.cn/problems/invert-binary-tree/description/
*
* algorithms
* Easy (79.77%)
* Likes: 1710
* Dislikes: 0
* Total Accepted: 749K
* Total Submissions: 939K
* Testcase Example: '[4,2,7,1,3,6,9]'
*
* 给你一棵二叉树的根节点 root ,翻转这棵二叉树,... | ALGO | 0.999984 | 6.87636 |
e0945ce2-244f-4e79-910c-f78be566792f | Cnewbeee/code_one | C++/icpc/3.16/3.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin >> t;
while(t--){
string a;
int n;
cin >> n >> a;
int sum = 0, ans = 0;
for(int i = 0; i < n; i++){
if(a[i] == 'd' && sum == 0)sum ++;
if(a[i] == 'f' && sum == 1)sum ++;
... | ALGO | 0.997525 | 4.192807 |
234dde29-e60e-495a-b5df-50e9c245c108 | zhaoyiping0622/oceanbase-competition-2023 | src/sql/rewrite/ob_transform_simplify_winfunc.cpp | #define USING_LOG_PREFIX SQL_REWRITE
#include "sql/rewrite/ob_transform_simplify_winfunc.h"
#include "sql/rewrite/ob_transform_utils.h"
#include "sql/resolver/expr/ob_raw_expr_util.h"
using namespace oceanbase::sql;
int ObTransformSimplifyWinfunc::transform_one_stmt(common::ObIArray<ObParentDMLStmt> &parent_stmts,
... | TOOL | 0.991702 | 3.522873 |
d9e3b9d8-ca7e-4d24-8f7c-cbe2c1423300 | SLIIT-FacultyOfComputing/tutorial-02b-it21215988 | tute02.cpp | /*Exercise 2 - Selection
Convert the C program given below which calculates an employee's salary to a C++ program.
Input Type, Salary, otHours
Type = 1
OtRate = 1000
Type = 2
OtRate = 1500
Type = 3
OtRate = 1700
Please Note that the input command in C++ is std::cin. This is a representation of the Keyboard.*/
#incl... | ALGO | 0.866265 | 3.240644 |
423feb4c-2158-44fd-93bc-e0535c5fd5d2 | Tushar-K24/LeetCode | 2192-all-ancestors-of-a-node-in-a-directed-acyclic-graph/2192-all-ancestors-of-a-node-in-a-directed-acyclic-graph.cpp | class Solution {
public:
vector<vector<int>> getAncestors(int n, vector<vector<int>>& edges) {
vector<vector<int>> graph(n);
for(auto i:edges){
graph[i[1]].push_back(i[0]);
}
vector<vector<int>> ancestors(n);
queue<int> q;
for(int i=0;i<n;i++){
... | ALGO | 0.999992 | 6.25349 |
800f112e-e8bf-4a3b-8f19-a2fe3c594776 | jmj732/Codeup | 코드업/일반 문제/3의 배수 판별하기.cpp | #include <iostream>
#include <vector>
#include <algorithm>
int main() {
std::string str;
std::cin >> str;
int result = 0;
for (auto it = str.begin(); it != str.end(); it++) {
result += *it - '0';
}
if (result % 3 ) {
std::cout << 0;
}
else{
std::cout << 1;
}
... | ALGO | 0.999956 | 4.005347 |
b2fc50fb-b3ff-45ca-9c9f-1a9a21751997 | akhiltiwari-tr/graphene-modifications | libraries/chain/fork_database.cpp | #include <graphene/chain/fork_database.hpp>
#include <graphene/chain/exceptions.hpp>
#include <graphene/chain/protocol/fee_schedule.hpp>
#include <fc/smart_ref_impl.hpp>
namespace graphene { namespace chain {
fork_database::fork_database()
{
}
void fork_database::reset()
{
_head.reset();
_index.clear();
}
void ... | TOOL | 0.923723 | 6.568817 |
9aaaea54-0e3f-47af-aaa0-7b1049be5a55 | sarvex/leetcode-fish | solution/2000-2099/2028.Find Missing Observations/Solution.cpp | class Solution {
public:
vector<int> missingRolls(vector<int>& rolls, int mean, int n) {
int m = rolls.size();
int s = (n + m) * mean;
for (int& v : rolls) s -= v;
if (s > n * 6 || s < n) return {};
vector<int> ans(n, s / n);
for (int i = 0; i < s % n; ++i) ++ans[i];
... | ALGO | 0.999656 | 5.951312 |
37233bb2-0c21-454b-b6ba-7432b42be704 | ikeji/Ender3Firmware | Marlin/src/gcode/probe/G38.cpp | #include "../../inc/MarlinConfig.h"
#if ENABLED(G38_PROBE_TARGET)
#include "../gcode.h"
#include "../../module/endstops.h"
#include "../../module/motion.h"
#include "../../module/stepper.h"
#include "../../module/probe.h"
inline void G38_single_probe(const uint8_t move_value) {
endstops.enable(true);
G38_move =... | ALGO | 0.965583 | 7.697785 |
27ddde01-5956-490d-a3e1-e2ed460569b4 | jendakeller/meshtrack | src/eigen/doc/examples/TemplateKeyword_flexible.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace Eigen;
template <typename Derived1, typename Derived2>
void copyUpperTriangularPart(MatrixBase<Derived1>& dst, const MatrixBase<Derived2>& src)
{
/* Note the 'template' keywords in the following line! */
dst.template triangularView<Upper>() = src.template... | TOOL | 0.981887 | 5.804369 |
23ee38b3-d2d5-41df-9c15-6459b5bef6d5 | Oronda42/Webserv | srcs/main.cpp | #include <sys/socket.h> // For socket functions
#include <netinet/in.h> // For sockaddr_in
#include <cstdlib> // For exit() and EXIT_FAILURE
#include <iostream> // For cout
#include <fstream>
#include <sstream>
#include <unistd.h> // For read
#include <errno.h>
#include <vector>
#include <cstdio>
#include "Request.hpp"... | WEB | 0.927577 | 3.649983 |
a0f96c07-176d-4e7d-8acb-a425999b7aa4 | Timothy-Fang/Practise | Leetcode/26.删除有序数组中的重复项.cpp | /*
* @lc app=leetcode.cn id=26 lang=cpp
*
* [26] 删除有序数组中的重复项
*/
// @lc code=start
#include <iostream>
#include <vector>
#include <string>
using namespace std;
class Solution {
public:
int removeDuplicates(std::vector<int>& nums) {
int n = nums.size();
if (n == 0) {
return 0;
... | ALGO | 0.999355 | 5.883969 |
41c1b458-710d-44eb-9b26-6568839ccb94 | ishandutta2007/codeforces | loveye/normal/1737/A.cpp | #include<bits/stdc++.h>
using namespace std;
int read();
typedef long long ll;
#define fr(i,l,r) for(int i=(l);i<=(r);++i)
#define rf(i,l,r) for(int i=(l);i>=(r);--i)
#define fo(i,l,r) for(int i=(l);i<(r);++i)
#define foredge(i,u,v) for(int i=fir[u],v;v=to[i],i;i=nxt[i])
#define filein(file) freopen(file".in","r",stdi... | ALGO | 0.999929 | 3.242272 |
30a19388-fca7-4ed6-8d1d-3e6bfad71a39 | Bastler1971/Artillery-Sidewinder-X1 | Marlin Firmware/official_marlin/Marlin 2.1.1/Marlin-2.1.1/Marlin/src/lcd/menu/game/maze.cpp | #include "../../../inc/MarlinConfigPre.h"
#if ENABLED(MARLIN_MAZE)
#include "game.h"
int8_t move_dir, last_move_dir, // NESW0
prizex, prizey, prize_cnt, old_encoder;
fixed_t playerx, playery;
// Up to 50 lines, then you win!
typedef struct { int8_t x, y; } pos_t;
uint8_t head_ind;
pos_t maze_walls[50] = {
... | ALGO | 0.959384 | 5.047589 |
4bad5e5d-2b21-4562-8b1a-25c93920b79d | CGCL-codes/LoomIO | src/boost/libs/mpi/example/random_content.cpp | // An example using Boost.MPI's skeletons and content to optimize
// communication.
#include <boost/mpi.hpp>
#include <boost/serialization/list.hpp>
#include <algorithm>
#include <functional>
#include <numeric>
#include <iostream>
#include <stdlib.h>
namespace mpi = boost::mpi;
int main(int argc, char* argv[])
{
mpi... | ALGO | 0.983346 | 4.380491 |
84761e02-0909-47be-bfca-50c3d0443ddd | scalalang2/ps-old | boj/data_structure/14425.cpp | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using pi = pair<int, int>;
using pll = pair<ll, ll>;
const int INF = 1e9 + 5;
const ll llINF = 1e18;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
set<string> s;
int ... | ALGO | 0.999857 | 4.289884 |
9c3a3f0d-3a80-4ae4-8fe1-b251cfe16484 | HK51104/cpp | list.cpp | #include<iostream>
#include<list>
using namespace std;
int main(int argc, char const *argv[])
{
list <int> list1;
list1.push_back(5);
list1.push_back(7);
list1.push_back(9);
list1.push_back(11);
list<int>::iterator iter;
// it is kind of "pointer" which points(and thus iterates) "member o... | TOOL | 0.960954 | 3.374484 |
3b794638-b71b-470b-8d52-db00e43ff244 | ssirawiitch/Algorithm_Design | ex01e3/main.cpp | #include <iostream>
#include <vector>
using namespace std;
int bi_s(vector<int> &v,int start,int stop,int a){
int mid = (start+stop)/2;
if(start+1 == stop){
return (v[stop] <= a)? v[stop]:v[start];
}
if(v[mid] < a){
return bi_s(v,mid+1,stop,a);
}else{
return bi_s(v,start,m... | ALGO | 0.999992 | 4.178735 |
19ca2766-0a31-4af1-a060-4aa4b6c88802 | GoldAndRabbit/leetcode | code/240.SearchA2DMatrixII.cpp | /*
Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties:
Integers in each row are sorted in ascending from left to right.
Integers in each column are sorted in ascending from top to bottom.
For example,
Consider the following matrix:
[
[1, 4, 7, 11,... | ALGO | 0.999964 | 6.698941 |
cf351252-dc1a-4b2b-b7e5-6c23bff616ca | 3StarAnchovy/Algorithm | swea/c++/part4/gns.cpp | #include <iostream>
#include <string>
using namespace std;
int main()
{
int T;
cin >> T;
for (int i = 0; i < T; i ++)
{
string tc;
string input[10000];
string sNumArray[10] = {"ZRO", "ONE", "TWO", "THR", "FOR", "FIV", "SIX", "SVN", "EGT", "NIN"};
int iNumArray[10] = {0, };
int num;
cin >> tc >> num;
... | ALGO | 0.99813 | 4.243574 |
10282b92-395a-4861-b22b-ba1092782737 | mooori/ba | lib/spd_nogit/shortest_path_decomposition/src/MinorModel.cpp | #include <stdlib.h>
#include <iostream>
#include <iterator>
#include <utility>
#include <string>
#include <queue>
#include <stack>
#include "Common.h"
#include "../include/Blob.hpp"
#include "../include/Path.hpp"
#include "../include/Help.hpp"
#include "../include/MinorModel.hpp"
typedef std::pair<Blob*, Blob*> BlobP... | ALGO | 0.906368 | 4.879594 |
04053e3c-0825-484c-9fa7-08e014852631 | francescobusolin/faiss_pEE | tutorial/cpp/5-Multiple-GPUs.cpp | #include <cstdio>
#include <cstdlib>
#include <random>
#include <faiss/IndexFlat.h>
#include <faiss/gpu/GpuAutoTune.h>
#include <faiss/gpu/GpuCloner.h>
#include <faiss/gpu/GpuIndexFlat.h>
#include <faiss/gpu/StandardGpuResources.h>
#include <faiss/gpu/utils/DeviceUtils.h>
int main() {
int d = 64; // dimensio... | ALGO | 0.990258 | 5.165454 |
31308fa7-1566-4f41-b794-32ac14e7d622 | VC6378/Leetcode | 0907-koko-eating-bananas/0907-koko-eating-bananas.cpp | class Solution {
public:
long long solve(vector<int> &piles,int bananaperhr){
long long hrs=0;
for(int i=0;i<piles.size();i++){
hrs+=ceil(piles[i]/(double)bananaperhr);
}
return hrs;
}
int minEatingSpeed(vector<int>& piles, int h) {
sort(piles.begin(),pil... | ALGO | 0.999934 | 5.693238 |
d75cc97b-b39e-4f6a-9b29-afac781c31ef | adith2005-20/algorithm-snippets | Cpp/Jarvis-March.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
struct Point {
int x, y;
};
int orientation(Point a, Point b, Point c) {
int val = (b.y - a.y) * (c.x - b.x) - (b.x - a.x) * (c.y - b.y);
return val == 0 ? 0 : (val > 0 ? 1 : -1);
}
vector<Point> jarvisMarch(vector<Point> po... | ALGO | 0.999997 | 6.03197 |
3ecf46bd-770f-4cf7-8b0c-d5879dcf68fb | WillianYe/Multi-robot-dispatch-platform | server_ws/src/rmf/rmf_traffic/rmf_traffic/test/unit/blockade/test_blockade_conflicts.cpp | #include <src/rmf_traffic/blockade/conflicts.hpp>
#include "utils_blockade_simulation.hpp"
#include "utils_blockade_scenarios.hpp"
#include <array>
#include <iostream>
//==============================================================================
using Checkpoint = rmf_traffic::blockade::Writer::Checkpoint;
//===... | ALGO | 0.994051 | 6.634941 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.