uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
3acb21c9-8232-42cd-9fbc-a75c51efb3a6 | shubhi1488/Coding | compare().cpp | //compare()
#include<iostream>
#include<cstring>
using namespace std;
int main(){
/*
string str1="hello";
string str2="welcome to gla university";
output:- both are unequal
*/
string str1="welcome to gla university";
string str2="welcome to gla university";
int i=str1.compare(str2);
if(i==0){
cout<<"both str... | ALGO | 0.998492 | 3.191265 |
2c746f53-47a9-44f9-a14a-c027d5de1021 | ArghyaB118/Guide2ICPC | Graph/minDistanceGroup.cpp | //
// minDistanceGroup.cpp
//
//
// Created by Arghya Bhattacharya on 10/11/22.
//
#include <stdio.h>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
vector<int> boundaries;
void recursiveCheck (int maxm, int minm, vector<vector<int>>& groups) {
int cutoff = 4, range = (maxm - minm... | ALGO | 0.999936 | 3.980744 |
cc0ce972-0977-4dce-a8d0-69587fc41dc8 | shahjalal-mahmud/CodeForces | Rank800/A_Pangram.cpp | #include <iostream>
#include <unordered_set>
#include <cctype>
using namespace std;
int main()
{
int n;
string s;
cin >> n >> s;
unordered_set<char> uniqueChar;
if (n < 26)
{
cout << "NO";
}
else
{
for (char ch : s)
{
ch = tolower(ch);
... | ALGO | 0.999986 | 4.620887 |
667f5db0-ce0c-4932-b549-50533bd86d1e | linhanyu/ACM | DP/cutRole.cpp | //
// Created by Henry on 16/7/14.
//
#include <algorithm>
using namespace std;
#define NUM 100
#define INF 0x7fffffff
int Button_up_Cut(int piece[],int s[],int n){
int r[NUM];
r[0] = 0;
for (int i = 1; i <= n; ++i) {
int q = -INF;
for (int j = 1; j <= i; ++j) {
if (piece[j] ... | ALGO | 0.999976 | 3.67862 |
429b001a-354c-4110-aec7-50c30ca19a31 | DarShOp21/DSA | DAY-37/4.sortString.cpp | #include<iostream>
#include<vector>
using namespace std;
string sortString(string str){
vector<int>alpha(26,0);
for(int i = 0 ; i < str.size() ; i++)
alpha[str[i] - 'a']++;
string ans;
for(int i = 0 ; i < 26 ; i++){
char c = 'a' + i;
while(alpha[i]){
ans+=c;
... | ALGO | 0.99997 | 5.874153 |
b073002e-df43-403e-9ad4-d7c598baf1e0 | spunkymj/LEETCODE | 0368-largest-divisible-subset/0368-largest-divisible-subset.cpp | class Solution {
public:
vector<int> largestDivisibleSubset(vector<int>& nums) {
sort(nums.begin(),nums.end());
int n=nums.size();
vector<int> dp(n,1),bt(n,1);
int maxi=0;
int maxidx=-1;
for(int idx=0 ; idx<n ; idx++){
bt[idx]=idx;
for(int prev... | ALGO | 0.999995 | 5.372517 |
c4bf4200-f59d-430b-bad9-38d78fa2b0b1 | wdrink/vllm | csrc/cpu/cache.cpp | #include <map>
#include <vector>
#include "cpu_types.hpp"
namespace {
template <typename scalar_t>
void copy_blocks_cpu_impl(std::vector<torch::Tensor> const& key_caches,
std::vector<torch::Tensor> const& value_caches,
const torch::Tensor& mapping_pairs,
... | TOOL | 0.850223 | 6.954552 |
b24abf01-bc3e-4ec3-b882-837486faa07e | Gurpal-saghi-9/CPP-50-Practice-Programs | 34. Two array equal or not/05_mismatch().cpp | #include <iostream>
#include <algorithm>
using namespace std;
int main() {
int n;
cout << "Enter the number of elements in the arrays: ";
cin >> n;
int arr1[n], arr2[n];
// Input elements for both arrays
cout << "Enter elements for the first array: ";
for (int i = 0; i < n; i++) {
... | ALGO | 0.999721 | 5.763959 |
b395c4a6-2ef2-498c-83b8-cfc213ca7f8f | philkr/pystk | src/graphics/mesh_tools.cpp | #include "utils/log.hpp"
#include "utils/vec3.hpp"
#include <irrlicht.h>
#include <IMesh.h>
#include <IMeshBuffer.h>
#include <SSkinMeshBuffer.h>
namespace MeshTools
{
void minMax3D(scene::IMesh* mesh, Vec3 *min, Vec3 *max)
{
Vec3 extend;
*min = Vec3( 999999.9f);
*max = Vec3(-999999.9f);
for(unsigned ... | TOOL | 0.974034 | 6.217105 |
7a3e763c-d947-439e-9e24-edf691e4f9c8 | DRAX-ABHISHEK/OAproject | c/c++/6.cpp | #include <iostream>
using namespace std;
int sum(int a,int b){
int c;
c=a+b;
return c;
}
int main(){
int co,lo;
cout<<"enter the number";
cin>>co;
cout<<"enter the number";
cin>>lo;
cout<<"sum of numbers equal to -- "<<sum(co,lo);
} | ALGO | 0.99369 | 3.528963 |
de79fb7d-f8b5-4f40-a25c-baa2357bfd31 | revyos-rocm/rocm-rocsolver | library/src/auxiliary/rocauxiliary_stedcx.cpp | #include "rocauxiliary_stedcx.hpp"
ROCSOLVER_BEGIN_NAMESPACE
/*
* ===========================================================================
* stedcx is not intended for inclusion in the public API. It
* exists to assist in debugging syevdx and to keep the code clean.
* ====================================... | ALGO | 0.971842 | 3.710615 |
6d346087-31af-4bad-951d-92678043cc77 | gurugithub/Carnd-Project10-Model-Predictive-Control | src/Eigen-3.3/bench/sparse_setter.cpp |
//g++ -O3 -g0 -DNDEBUG sparse_product.cpp -I.. -I/home/gael/Coding/LinearAlgebra/mtl4/ -DDENSITY=0.005 -DSIZE=10000 && ./a.out
//g++ -O3 -g0 -DNDEBUG sparse_product.cpp -I.. -I/home/gael/Coding/LinearAlgebra/mtl4/ -DDENSITY=0.05 -DSIZE=2000 && ./a.out
// -DNOGMM -DNOMTL -DCSPARSE
// -I /home/gael/Coding/LinearAlgebr... | ALGO | 0.937876 | 4.145121 |
fa7138a6-8a5c-4e4c-b5aa-774fdb67c1f5 | brianshih95/GPE-practice | 22181_Dollars/main.cpp | #include <bits/stdc++.h>
typedef long long ll;
using namespace std;
// ]ޭȬơAcoin100
vector<int> coin = {5, 10, 20, 50, 100, 200, 500, 1000, 2000, 5000, 10000};
vector<ll> table(30001); // table[i]NmoneyiɦXزզX
void create_table(){
table[0] = 1; // base
for(int i=0; i<coin.size(); i++)
for(int j=c... | ALGO | 0.988564 | 4.147532 |
d415b53a-f1f0-475f-9190-2a20aa410fbf | GaisaiYuno/OI-Record-exe-deleted | Grade 10-12/2018 autumn/NOIP/NOIP2018提高组Day1程序包/GD-Senior/answers/GD-0258/money/money.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <algorithm>
#include <cmath>
#include <queue>
#include <vector>
using namespace std;
int T,n;
int b[110000],bb[110000],a[110],aa[110],c[110];
bool check(int k,int kk)
{
int bjj=0;
if(k!=kk) bjj=1;
else
{
for(int i=1;i<=k;i... | ALGO | 0.999876 | 3.278991 |
7d7a9cda-c180-4bb1-87d0-9bdb352d353d | delassus/ROS-System-Integration | ros/src/waypoint_follower/lib/libwaypoint_follower.cpp | #include "libwaypoint_follower.h"
int WayPoints::getSize() const
{
if (current_waypoints_.waypoints.empty())
return 0;
else
return current_waypoints_.waypoints.size();
}
double WayPoints::getInterval() const
{
if (current_waypoints_.waypoints.empty())
return 0;
// interval between 2 waypoints
t... | ALGO | 0.992464 | 4.526954 |
984a5aec-c8de-4072-b6bc-52a5e36af11e | ishandutta2007/codeforces | timur_sitdikov/normal/341/A.cpp | #include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <vector>
#include <queue>
#include <stack>
#include <deque>
#include <map>
#include <set>
#include <string>
#include <algorithm>
#include <iostream>
#include <complex>
using namespace std;
#define pb push_back
#define mp make_pair
#de... | ALGO | 0.999924 | 3.140821 |
9bbf5fd6-1405-4e49-a411-04dc6d6675ea | xuzx1210/LeetCode | 429. N-ary Tree Level Order Traversal.cpp | class Solution
{
public:
vector<vector<int>> levelOrder(Node *root)
{
vector<vector<int>> result{};
queue<Node *> bfs({root});
while (!bfs.empty())
{
vector<int> level{};
const size_t size = bfs.size();
for (size_t i = 0; i < size; ++i)
... | ALGO | 0.999972 | 6.46476 |
910dace6-f8fb-4d2a-a87a-3869a0a23842 | JeorgeBusch/llm-for-cpu | src/systemc/tests/systemc/misc/communication/channel/hwsw/hwsw.cpp | /*****************************************************************************
hwsw.cpp --
Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
*****************************************************************************/
/*****************************************************************************
... | TOOL | 0.900851 | 5.60743 |
6c75a6f5-19c2-47c7-91fb-9d51b5a77244 | AnuragKrVerma/Cpp | question/count-digit.cpp | // count digit (gfg)
#include <iostream>
#include <process.h>
using namespace std;
int main()
{
system("cls");
system("color a");
int N;
cin >> N;
int temp = N, count = 0;
while (temp != 0)
{
// extract the last digit
int d = temp % 10;
temp /= 10;
// check... | ALGO | 0.999698 | 4.550528 |
5e70dffa-4cc1-4a94-94e8-5bdeadcc4048 | AnikaJha/Asymptotic-analysis-of-three-integer-multiplication-algorithms | src/number.cpp | #include "number.h"
#include <algorithm>
Number operator+(const std::string& str, const Number& num)
{
Number res;
res._number = str + num._number;
return res;
}
Number Number::operator+(const std::string& n2)
{
_number += n2;
return *this;;
}
Number Number::operator+(const Number& num2)
{
i... | ALGO | 0.958873 | 4.834105 |
228a4a1d-46d3-4591-8484-b22309454acd | 0xlilith/adventofcode_2021 | Day3-part1/soln.cpp | #include <iostream>
#include <fstream>
int main(void) {
std :: ifstream file("input.txt");
std :: string gamma = "", epsilon = "";
int num=0, o=0, z=0;
int bitsize=0;
std :: string arr[2000];
while (! file.eof()) {
file >> arr[num];
num++;
}
file.close();
while(bitsize < 12) {
for (int i=0; i<num-1; i++... | ALGO | 0.999737 | 4.284428 |
bb187750-246e-483e-a064-b954b2b38daa | Cube1998/CubeCalculator | Cubelator/Classes/CaculatorAlgo/ArithmeticX.cpp | #include "ArithmeticX.h"
ArithmeticX::ArithmeticX()
{
}
ArithmeticX::ArithmeticX(string exp,string vn)
{
this->Expression = exp;
this->VariableName = vn;
this->AssignedExpression = "";
}
ArithmeticX::ArithmeticX(const ArithmeticX & ax)
{
this->AssignedExpression = ax.AssignedExpression;
this->Expression = ax.Ex... | TOOL | 0.979909 | 3.548119 |
5b85368f-af4b-4bb4-a2c6-99b3cca90b03 | pharick/cpp | 1-year/30-2d-algs/c.cpp | #include <iostream>
using namespace std;
const short SZ = 100;
void readArr(int arr[SZ][SZ], short n, short m) {
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
cin >> arr[i][j];
}
}
}
int main() {
int arr[SZ][SZ];
short n, m;
cin >> n >> m;
readArr(arr, n, m);
int max = arr... | ALGO | 0.999907 | 4.180921 |
4c909f28-a510-4273-95e6-33bb91ce0d7f | sabujcse/Uva-Problem-Solutions | uva12751.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int a;
int n, k, x;
cin>>a;
for( int i =1; i<= a; i++)
{
cin>>n>>k>>x;
int sum = ((n*( n+1))/2);
int sum1 = (((x+k-1)*(x+k))/2);
int sum2 = (((x-1)*x)/2);
int re=(sum1-sum2);
int fr=(sum-re);
... | ALGO | 0.999648 | 3.340674 |
899961d4-6aaf-4462-b4aa-fa3868ee2b8f | wingsit/QP | eigen/doc/examples/tut_matrix_resize.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace Eigen;
int main()
{
MatrixXd m(2,5);
m.resize(4,3);
std::cout << "The matrix m is of size "
<< m.rows() << "x" << m.cols() << std::endl;
std::cout << "It has " << m.size() << " coefficients" << std::endl;
VectorXd v(2);
v.resize(5);
... | ALGO | 0.970448 | 3.882785 |
e81c0216-52f8-4f73-8d3f-ddd05f34a094 | mushfiqur47/HackerRankProjectEuler | Project Euler #68: Magic N-gon ring.cpp | #include <iostream>
#include <vector>
#include <string>
#include <set>
// sorted container of valid n-gon strings
std::set<std::string> result;
// size of the n-gon (3,4,5)
unsigned int size;
// sum of all three cells alongs a diagonal/edge
unsigned int tripletSum;
void fillLine(unsigned int pos, std::vector<unsigned... | ALGO | 0.999814 | 4.386206 |
a4065ff2-702a-4869-8622-81be66f3708e | neverac/2020summer | 个人赛4/H/26497905_3019244272_H.cpp | #include <bits/stdc++.h>
using namespace std;
string s, name, num;
map<string, int> mp;
int scnt;
int root[100], tr[1000000][10], val[1000000], fa[1000000], son[1000000], mark[1000000], tcnt;
void insert(int u, string nu){
for(int i = nu.length() - 1; ~i; i--){
int v = nu[i] - '0';
if(!tr[u][v]){
tr[u][v] = ++t... | ALGO | 0.99978 | 3.728937 |
f9f14ebf-a3f3-488f-8426-b3693b378cbe | ishandutta2007/codeforces | zylber/normal/111/A.cpp | #include <iostream>
#include <cmath>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <cstring>
using namespace std;
int main()
{
long long n, x, y, g;
cin >> n >> x >> y;
int can=1;
if(n>y) can=0; else
{
g=y-n+1;
if(g*g+n-1<x) can=0;
}
if(can)
{
... | ALGO | 0.999956 | 3.317419 |
bf3678a1-ba31-4541-bfc5-e11a427fe3c1 | TIHan/TEngine | lib/bullet-2.81-rev2613/src/BulletCollision/Gimpact/gim_contact.cpp | #include "gim_contact.h"
#define MAX_COINCIDENT 8
void gim_contact_array::merge_contacts(
const gim_contact_array & contacts, bool normal_contact_average)
{
clear();
if(contacts.size()==1)
{
push_back(contacts.back());
return;
}
gim_array<GIM_RSORT_TOKEN> keycontacts(contacts.size());
keycontacts.resize(... | ALGO | 0.990292 | 4.558418 |
ff1550c3-2b20-4406-94c2-31ca5106b5db | ihays/LeetCode | C++/SameTree.cpp |
//Ian Hays
//07-06-2020
//https://leetcode.com/problems/same-tree/
//SC: O(1) TC: O(N)
/**
* 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(null... | ALGO | 0.999979 | 6.772478 |
e1f1afa8-9cc6-42aa-864c-c454cf13148e | tinhcuop99/C_plus | CTDL_GT/DSLKD_them_vao_dau_cuoi.cpp | #include<iostream>
#include<conio.h>
using namespace std;
// Nhập danh sách liên kết đơn các số nguyên. Tìm MAX trong danh sách
//KHAI BÁO CẤU TRÚC DANH SÁCH LIÊN KẾT ĐƠN CÁC SỐ NGUYÊN
// Khai báo cấu trúc 1 node
struct node
{
int data; // Dữ liệu chứa trong 1 node
struct node *pNext; // Con trỏ dùng để lien k... | ALGO | 0.999731 | 3.8651 |
3e156d2a-518f-4c43-8d01-c9af378ab230 | pravir-kadian21/c-Binary-trees | sum of roots in bt.cpp | #include<iostream>
using namespace std;
class node{
public:
int data;
node *left;
node *right;
node(int d){
data=d;
left=NULL;
right=NULL;
}
};
node *buildtree(){
int data;
cin>>data;
if(data==-1){
return NULL;
}
node *root=new node(data);
... | ALGO | 0.999928 | 4.432588 |
45c0761d-4dfc-4ea1-a1e4-f162f587251f | kash1sh/practice_ques_cp | D_Destroyer_Takahashi.cpp |
#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define vll vector<ll>
#define vpll vector<pair<ll, ll>>
#define fo(i, k, n) for (ll i = k; i < n; i++)
#define fo1(i, k, n) for (ll i = k; i <= n; i++)
#define rr return
#define ff first
#define ss second
#define llmin LONG_MIN
#define llmax LONG_MAX
... | ALGO | 0.999971 | 4.859675 |
bb3bf03e-664a-4daf-8195-c4826a007295 | JustinYuu/PAT-Advanced | 1037.cpp | #include <iostream>
#include <cstdio>
#include <algorithm>
using namespace std;
int main()
{
int nc,np;
int total;
int coup[100010],prod[100010];
total=0;
cin>>nc;
for(int i=0;i<nc;i++)
cin>>coup[i];
cin>>np;
for(int i=0;i<np;i++)
cin>>prod[i];
sort(coup,coup+nc);... | ALGO | 0.999888 | 3.227174 |
c64fc450-f0de-442b-be45-3d587625ad7f | ombhamare4/My-CP-Practice | CodeChef Practice/EID.cpp | //EID
/*
Not Passed The Case? Try One more Time
*/
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define ll long long
#define str string
#define vll vector<long long int>
void solve(){
ll n;
cin>>n;
vll vc;
for(int i=0;i<n;i++){
int x;
... | ALGO | 0.999587 | 4.178804 |
4bf8e009-0aa4-44c6-8943-60853b65fefa | yujiaoki/competitive-programming | Atcoder/abc198/e2.cpp | #include <bits/stdc++.h>
#include<atcoder/all>
using namespace atcoder;
#define rep(i,n) for(int i=0;i<n;i++)
#define FOR(i,start,end) for(int i=start;i<=end;i++)
const int INF = 1001001001;
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define Sort(a) sort(a.begin(), a.end())
#define Rort(a) s... | ALGO | 0.999987 | 4.495825 |
318a0bcd-d887-4f6d-95c4-f91ac998c1db | ishandutta2007/codeforces | dlalswp25/normal/1610/B.cpp | #include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> pii;
int N;
int A[202020];
pii chk(int x) {
int l = 1, r = N;
while(l <= r) {
while(l <= N && A[l] == x) l++;
while(r >= 1 && A[r] == x) r--;
if(l > r) { return {-1, -1}; }
if(A[l] == A[r]) { l++; r--; continue; }
return {l, r};
}
ret... | ALGO | 0.999928 | 3.982144 |
dbd3956a-6eac-4c31-9cfb-b47dfe5755e6 | quanglm1998/competitive-programming | codeforces/1286/b.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 2010;
int n;
vector<int> adj[N];
int c[N], numChild[N];
int res[N];
void dfsInit(int u) {
numChild[u] = 1;
for (int v : adj[u]) {
dfsInit(v);
numChild[u] += numChild[v];
}
}
void dfsCalc(int u, vector<int> ls) {
if (c[u] >=... | ALGO | 0.999997 | 4.16078 |
90e57779-11f0-44b8-a3b5-fffc31f6ef79 | silasdani/C-Cplusplus | Struct/main.cpp | #include <iostream>
#include <math.h>
using namespace std;
double f(double x,double y,double x1,double y1){
return sqrt((x1-x)*(x1-x)-(y1-y)*(y1-y));
}
int main()
{
struct triunghi{
double a,b,c;
}T;
struct punct{
double x,y;
}A,B,C;
struct cerc{
double r,x,y;
}C1;
... | ALGO | 0.99925 | 3.650095 |
d9b8591c-5e66-4b09-883f-dd467649b5e7 | caohuy2705/DSA_Round_2 | 06039_sodautienbilap_binary.cpp | #include <iostream>
#include <algorithm>
// Hàm thực hiện tìm kiếm nhị phân
int binarySearch(int arr[], int left, int right, int target) {
while (left <= right) {
int mid = left + (right - left) / 2; // Tính chỉ số trung tâm
if (arr[mid] == target) {
return mid; // Trả về chỉ số nếu tì... | ALGO | 0.999996 | 6.68955 |
4ef61479-3bd2-4798-a270-019f7855e811 | sunruoshi/Luogu-Codes | [算法1-4] 递推与递归/P1259-黑白棋子的移动.cpp | #include <iostream>
#include <string>
using namespace std;
int n, p;
string res = "";
void move(int k) {
swap(res[k - 1], res[p]);
swap(res[k], res[p + 1]);
p = k - 1;
cout << res << endl;
}
void solve(int f) {
if (f == 4) {
move(4);
move(8);
move(2);
move(7);
... | ALGO | 0.999846 | 3.657715 |
00b43c2f-950a-40cc-9a3f-a87650d990b3 | AdvTrainEvalSrcDomain/adv-train-evaluation-source-code-domain | code-imitator/data/dataset_2017/dataset_2017_8/Witalia/8294486_5681755159789568_Witalia.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <cstdlib>
#include <iostream>
#include <set>
#include <algorithm>
#include <vector>
#include <string>
#include <memory.h>
#include <map>
#define _USE_MATH_DEFINES
#include <math.h>
#include <list>
#include <fstream>
#include <time.h>
#include <iomanip>
#includ... | ALGO | 0.999796 | 3.634831 |
770e7c04-e623-41e7-a7db-4e2068ee6bb5 | AkshatAggarwal14/Competitive-Programming | CodeForces/1250/a.cpp | #ifndef ONLINE_JUDGE
#include "Akshat.hpp"
#else
#include "bits/stdc++.h"
using namespace std;
#define dbg(...)
#define debug(...)
#endif
using ll = int64_t;
#define fo(i, n) for (ll i = 0; i < n; i++)
void Solution() {
ll n, m;
cin >> n >> m;
vector<ll> likes(m);
for (auto &x : likes) cin >> x;
v... | ALGO | 0.999998 | 3.690158 |
63b55fb8-6fcd-419d-b228-cc687a9b171c | MahurScripts/codeforcesSolution | A/8.cpp | /******************************************************************************
Online C++ Compiler.
Code, Compile, Run and Debug C++ program online.
Write your code in this editor and press "Run" button to compile and execute it.
******************************************... | ALGO | 0.999969 | 4.421127 |
a6b5b2e1-6533-45e9-b203-833a3e34ffed | IronX10/Codeforces | B_Square_or_Not.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin >> t;
while (t--)
{
int n;
cin >> n;
string str;
cin >> str;
int count = 0;
double sq = sqrt(n);
int sqr = static_cast<int>(sqrt(n));
int sqe = static_cast<double>(sqr);... | ALGO | 0.999658 | 4.511265 |
fc400f50-ff1e-49f9-9733-55de731ebff2 | interactivevislab/TrianglePlugin-UE5 | TrianglePlugin/Source/libigl-static/include/lexicographic_triangulation.cpp | #include "lexicographic_triangulation.h"
#include "sortrows.h"
#include <vector>
#include <list>
template<
typename DerivedP,
typename Orient2D,
typename DerivedF
>
IGL_INLINE void igl::lexicographic_triangulation(
const Eigen::MatrixBase<DerivedP>& P,
Orient2D orient2D,
Eigen::PlainObjectBase<Der... | ALGO | 0.999503 | 6.805851 |
cc5fe762-f843-411b-a47c-da31a26e8c03 | ishandutta2007/codeforces | andreasyan/normal/1622/E.cpp | #include <bits/stdc++.h>
using namespace std;
#define m_p make_pair
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())
#define fi first
#define se second
typedef long long ll;
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
mt19937 rnf(2106);
const int N = 12, M = 10004;
int n, m... | ALGO | 0.999976 | 3.605039 |
06cd14f8-8ee9-4ca2-a5ed-ae093475840c | Alloyed/KitsBlips | kitdsp/src/dsfOscillator.cpp | #include "kitdsp/osc/dsfOscillator.h"
#include "kitdsp/lookupTables/sineLut.h"
#include "kitdsp/math/util.h"
#include "kitdsp/osc/oscillatorUtil.h"
using namespace kitdsp;
#define sin_(x) sinf(x *kTwoPi)
#define cos_(x) cosf(x *kTwoPi)
//#define sin_(x) sin2pif_lut(x)
//#define cos_(x) sin2pif_lut((x) + 0.25f)
void... | ALGO | 0.997838 | 5.803425 |
c5c48050-2f52-47e0-8329-13b6c0194cf8 | Chickenbumps/winningCode | 2667.cpp | #include <iostream>
#include <queue>
#include <vector>
#include <algorithm>
using namespace std;
char map[25][25];
int visited[25][25];
int dx[4] = {1,-1,0,0};
int dy[4] = {0,0,1,-1};
queue<pair<int,int> > q;
vector<int> v;
int main(){
int n;
cin >> n;
for (int i = 0; i < n; i++)
{
for (int j = 0; j < ... | ALGO | 0.999793 | 3.719316 |
e3236414-a819-475b-a687-3f5157e19d4f | ishandutta2007/codeforces | andr1y/normal/1370/B.cpp | // -- telegram @rentixous --
// -- keep calm and slava ukraini --
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll N = 2e5+1488;
signed main(){
cin.tie(0);cout.tie(0);ios_base::sync_with_stdio(0);
ll q;
cin >> q;
while(q--){
ll n;
stack<ll> a0, a1;
ci... | ALGO | 0.999958 | 3.726649 |
61de55dc-975d-4ef6-bca1-3134e74ac3f2 | Rohit-Yadav-47/DSA-Questions | Implement two stacks in an array.cpp | void twoStacks :: push1(int x)
{
arr[++top1]=x;
}
void twoStacks ::push2(int x)
{
arr[--top2]=x;
}
//Function to remove an element from top of the stack1.
int twoStacks ::pop1()
{
if(top1==-1)return -1;
else return arr[top1--];
}
//Function to remove an element from top of the stack2.
int twoStacks :: pop2()
{... | ALGO | 0.991867 | 4.170005 |
a4675829-765b-48ee-ab66-92a9f90f5852 | Aman7210/LL-Stack-Queue.cpp | Minimum Bracket Reversal.cpp | /*
For a given expression in the form of a string, find the minimum number of brackets that can be reversed in order to make the expression balanced. The expression will only contain curly brackets.
If the expression can't be balanced, return -1.
Example:
Expression: {{{{
If we reverse the second and the fourth openin... | ALGO | 0.999846 | 5.858057 |
003fa673-feb8-498a-bd27-290a7c56c0b3 | HurayraIIT/competitive-programming | codeforces/random/A_Epic_Game.cpp | // Abu Hurayra (HurayraIIT)
// IIT, Jahangirnagar University
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <queue>
#include <deque>
#include <bitset>
#include <list>
#include <stack>
#include <map>
#include <set>
#include <math.h>
#include <stdio.h>
#include <string.h>
using nam... | ALGO | 0.99988 | 3.322634 |
acc9e140-3bcc-4036-be1b-352c7f0c0598 | agrwalh/Practiseprograms | smallest.cpp | // #include<iostream>
// using namespace std;
// int main(){
// int nums[]={5,15,20,25,-15};
// int size=5;
// int smallest=INT_MAX;
// int largest=INT_MIN;
// int smallestin=-1;
// int larin=-1;
// for(int i=0;i<size;i++){
// smallest=min(nums[i],smallest);
// smallestin=i... | ALGO | 0.999784 | 4.082912 |
ed364cbc-05c4-4b34-b575-7d991e8f21e1 | gabrielbarrera0305/modulo3 | igualdadesejercicio9.cpp | #include <iostream>
int main() {
int num1;
int num2;
std::cout << "ingrese el primer numero: ";
std::cin >> num1;
std::cout << "ingrese el segundo numero: ";
std::cin >> num2;
bool soniguales =num1==num2;
std::cout << soniguales << std::endl;
return 0;
}
| TOOL | 0.986266 | 3.215895 |
4a271d8d-07d5-4797-8001-1573b337226a | mohitkumaragrawal/cpp-algo | mashups/practise-1/b.cpp | #include <bits/stdc++.h>
using namespace std;
#define all(x) begin(x), end(x)
#define OUT(T) cout << "Case #" << T << ": "
using ll = long long;
using lld = long double;
using pll = pair<ll, ll>;
using pii = pair<int, int>;
ll wt[505][505], dist[505][505];
bool inserted[505];
const ll INF = 1e17;
ll n;
void insert_... | ALGO | 0.999991 | 3.905374 |
b4d22a7f-7ba9-473b-a70d-0b3994e5ad80 | jenirfs/Algoritmos-1 | Funções/positivo_negativo.cpp | #include <iostream>
using namespace std;
int sinal(int n)
{
if(n > 0)
{
cout << "Positivo" << endl;
}
else if (n < 0)
{
cout << "Negativo" << endl;
}
else if (n == 0)
{
cout << "Zero" << endl;
}
return n;
}
int main()
{
int x;
cin >> x;... | ALGO | 0.999752 | 3.877795 |
cd83a5fd-309b-421f-a19a-861de5d8534f | Harshit2047/LeetCode | 1766-minimum-number-of-removals-to-make-mountain-array/minimum-number-of-removals-to-make-mountain-array.cpp | class Solution {
public:
int minimumMountainRemovals(vector<int>& nums) {
vector<int>SLIS(nums.size(),0);
vector<int>ELIS(nums.size(),0);
for(int i=0;i<nums.size();i++){
for(int j=0;j<i;j++){
if(nums[i]>nums[j]){
SLIS[i]=max(SLIS[j],SLIS[i]);
... | ALGO | 0.999995 | 5.540174 |
05316e4c-02e8-4a7f-9835-3cd7419958fa | soikot-shahriaar/CPP-Programming | 01 Basics/09-user-input.cpp | #include <iostream>
using namespace std;
int main()
{
int x, y;
int sum;
cout << "Enter a number: ";
cin >> x;
cout << "Enter another number: ";
cin >> y;
sum = x + y;
cout << "Sum is: " << sum;
return 0;
} | TOOL | 0.933478 | 4.175055 |
d8af6244-417b-4046-ac89-fb41f045793c | bhutoriaumang/competitvecoding | snackdown1b.cpp | #include </Users/bits/stdc++.h>
using namespace std;
# define lli long long int
int main(){
int T;
cin>>T;
while(T-->0){
lli k;
cin>>k;
vector <lli> v;
for(int i=1;i<=k;i++)
v.push_back(i);
}
} | ALGO | 0.996689 | 3.61982 |
fcb22704-f113-41b8-a02f-f90f2e5ea2b8 | danielhufnagle/COMP_ENG-357-Final | testing/pseudocode/output.cpp | #include <iostream>
#include <vector>
#include <unordered_map>
#include <limits>
#include <cmath>
#include <algorithm>
const double MAX_CHANGE = 5.0;
const double GAMMA = 0.1;
const double LAMBDA = 0.7;
// Represents a pin in the netlist
struct Pin {
std::string name;
double arrival_time;
double required_... | ALGO | 0.999949 | 7.418259 |
f17fee8a-9b30-4a75-81d3-396530117428 | gajjarvatsall/DSA-VG | Two Pointers/15_3Sum.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution
{
public:
vector<vector<int>> threeSum(vector<int> &nums)
{
vector<vector<int>> ans;
sort(nums.begin(), nums.end());
for (int i = 0; i < nums.size(); i++)
{
if (i > 0 && nums[i] == nums[i - 1])
... | ALGO | 0.999931 | 5.484549 |
9c9bed51-8296-4799-8f4d-66a2532e1712 | Samir-Singh/Pepcoding_Solution | Level-1/Binary Tree/Print k levels down.cpp | #include<bits/stdc++.h>
using namespace std;
class node
{
public:
int data;
node *left = NULL;
node *right = NULL;
node(int data)
{
this->data = data;
}
};
node *constructTree(vector<int> arr)
{
node *root = new node(arr[0]);
pair<node*,int> p = {root, 1};
stack<pair<node*,i... | ALGO | 0.999988 | 3.806417 |
7b76d7b4-a443-428c-a23d-5710f489d76a | rokki3331/test | laba4_5.2/main.cpp | #include <iostream>
using namespace std;
using UP=bool (*) (int);
bool f(int a)
{
return a>0;
}
int find_positive1(int* arr, int size, UP p)
{
for(int i=0; i<size;++i)
{if(p(arr[i]))
return arr[i];
}
}
int find_positive2(int* arr, int size, UP p)
{
int i=find_positive1(arr,5,f);
for(;i<s... | ALGO | 0.999873 | 3.672948 |
1b388453-c3b1-4222-8ae9-0d638aa6698b | kevinzhang334455/Scout | boost_1_56_0/libs/algorithm/string/example/split_example.cpp | // Boost string_algo library example file ---------------------------------//
// See http://www.boost.org for updates, documentation, and revision history.
#include <string>
#include <vector>
#include <iostream>
#include <iterator>
#include <functional>
#include <boost/algorithm/string/classification.hpp>
#include... | TOOL | 0.990442 | 4.93924 |
502d5000-29a8-4671-9c97-8f10a7f5bf62 | gaziel/heekscnc | src/Simulate.cpp | // Simulate.cpp
#include "stdafx.h"
#ifdef WIN32
#include "interface/Box.h"
#include "interface/HeeksObj.h"
#include "interface/HeeksColor.h"
#include "Program.h"
#include "CTool.h"
#include "Tools.h"
#include <wx/stdpaths.h>
#include "Stocks.h"
#include <sstream>
static void GetWorldBox(CBox &box)
{
// gets the... | TOOL | 0.862384 | 5.167586 |
07f09b3e-a3e2-4856-8a9e-113b9274fa47 | Bikubisw/Coding | DATA STRUCTURES AND ALGORITHMS/Tries&huffmancoding/auto_complete.cpp | #include <iostream>
#include <string>
using namespace std;
#include <vector>
class TrieNode {
public :
char data;
TrieNode **children;
bool isTerminal;
TrieNode(char data) {
this -> data = data;
children = new TrieNode*[26];
for(int i = 0; i < 26; i++) {
children[i] = NULL;
}
isTerminal = false;
}
};... | ALGO | 0.999897 | 5.651543 |
4489ea51-23ae-4c52-96db-89a73ed52be5 | ishandutta2007/codeforces | pavel.savchenkov/normal/1056/C.cpp | #ifdef LOCAL
#define _GLIBCXX_DEBUG
#endif
#include <cstdio>
#include <iostream>
#include <cmath>
#include <utility>
#include <memory>
#include <memory.h>
#include <cstdlib>
#include <set>
#include <map>
#include <cassert>
#include <bitset>
#include <unordered_set>
#include <unordered_map>
#include <functional>
#i... | ALGO | 0.999988 | 4.007538 |
a68b9b78-375b-4163-a9ba-a8039352533d | WindWang2/rsregistration | source/downscale.cpp | #include <gdal_priv.h>
#include "param.h"
#include "downscale.h"
/////////////////////////////
//
#include <iostream>
using namespace std;
/////////////////////////////
const int EXE_FILEWRONG = 5;
const int EXE_OK = 1;
const int EXE_Failure = -5;
DownScale::DownScale(const char* pazSrcFile)
{
/**********************... | DATA | 0.905895 | 3.470097 |
ddd15aa9-3149-4d71-ac14-238b96ceff0a | jamespfu/CS32 | Homework/Homework 3/tree.cpp | //
// tree.cpp
// homework 3
//
// Created by James Fu on 5/3/22.
//
int numberOfTimesHas(const string a1[], int n1, const string a2[], int n2)
{
if (n2 <= 0) {
return 1;
}
if (n1 < n2 || n1 < 0) {
return 0;
}
int k = numberOfTimesHas(a1+1, n1-1, a2, n2);
if (a1[0] == a2[0]) ... | ALGO | 0.998122 | 3.782405 |
98a96f2c-ecca-45ea-9c04-b55eec3c457e | dpkk1/leetcode | 128-longest-consecutive-sequence/128-longest-consecutive-sequence.cpp | class Solution {
public:
int longestConsecutive(vector<int>& nums) {
map<int,int>m;
if(nums.size() == 0)
return 0;
for(auto i:nums)
m[i]++;
int curr=1, ans=1;
nums.clear();
for(auto i:m)
nums.push_back(i.first);
for(int i=0;... | ALGO | 0.999977 | 5.594033 |
516f666c-fd47-4f31-994c-813b27d88fb9 | ishandutta2007/codeforces | zlt1117/normal/1442/C.cpp | #pragma GCC optimize(4)
#include<bits/stdc++.h>
#define FOR(i,a,b) for(int i=a;i<=b;++i)
#define REP(u) for(int i=p[u];i!=-1;i=e[i].nxt)
#define PII pair<int,int>
#define int long long
#define ll long long
#define rd (rand()<<16^rand())
#define gc (_p1==_p2&&(_p2=(_p1=_buf)+fread(_buf,1,100000,stdin),_p1==_p2)?EOF:*_p1... | ALGO | 0.999923 | 4.088162 |
b98d4945-3c58-45ca-9a65-ef01a5212c69 | tsh1203/code | Problem/P2590.cpp | #include<iostream>
#include<algorithm>
using namespace std;
const int MAXN=1e5+10;
struct Edge{int next,target;}edge[MAXN<<1];
struct SegTree{int lazy,sum,max;}tree[MAXN<<2];
int n,q;
int cost[MAXN];
int cnt,head[MAXN];
int f[MAXN],dep[MAXN],sz[MAXN],son[MAXN],rk[MAXN],id[MAXN],top[MAXN];
inline void add(int u,int... | ALGO | 0.999958 | 4.238925 |
1758dcb0-da60-4122-97e3-479f514adba9 | jdoerfert/cudaomp | libcxx/test/std/algorithms/alg.nonmodifying/alg.count/count.pass.cpp | // <algorithm>
// template<InputIterator Iter, class T>
// requires HasEqualTo<Iter::value_type, T>
// constexpr Iter::difference_type // constexpr after C++17
// count(Iter first, Iter last, const T& value);
#include <algorithm>
#include <cassert>
#include "test_macros.h"
#include "test_iterators.h"
#if TE... | TEST | 0.950845 | 6.977204 |
7a75cd7f-1792-4c6d-ab03-d372720111df | wangzhangjun/cplusplus-study | c++-stl/stl-案例/main.cpp | #include <iostream>
#include <string>
#include <map>
#include <vector>
#include <algorithm>
#include <random>
#include <deque>
class Player {
public:
std::string name;
int score[3]; //3轮比赛的分数
};
void Create_Player(std::map<int,Player> &mPlist, std::vector<int> &v)
{
std::string str = "ABCDEFGHIJKLMNOPQRST... | ALGO | 0.990007 | 3.687543 |
6445a842-116e-41ec-b000-51a873a2ea1b | pavanbaloju/data-structures-and-algorithms | linkedlist/01.SinglyLL.cpp | #include <iostream>
using namespace std;
// Definition for singly-linked list node
struct ListNode
{
int val;
ListNode *next;
ListNode(int x) : val(x), next(nullptr) {}
};
// Singly Linked List class
class MyLinkedList
{
public:
MyLinkedList()
{
head = nullptr;
size = 0;
}
... | ALGO | 0.999105 | 5.678494 |
02681a96-9818-421e-b245-fd4a3c169a2f | blueskyxzy/hotspot | src/share/vm/gc_implementation/parallelScavenge/psAdaptiveSizePolicy.cpp | #include "precompiled.hpp"
#include "gc_implementation/parallelScavenge/psAdaptiveSizePolicy.hpp"
#include "gc_implementation/parallelScavenge/psGCAdaptivePolicyCounters.hpp"
#include "gc_implementation/parallelScavenge/psScavenge.hpp"
#include "gc_implementation/shared/gcPolicyCounters.hpp"
#include "gc_interface/gcCa... | TOOL | 0.859884 | 7.691892 |
d866cd5c-17f5-45e2-bca9-7476b5e46614 | kavya-k243/100-Days-of-Code | Day 66/Solution.cpp | #include<iostream>
using namespace std;
struct stackNode {
int data;
stackNode * next;
int size;
stackNode(int d) {
data = d;
next = NULL;
}
};
struct stack {
stackNode * top;
int size;
stack() {
top = NULL;
size = 0;
}
void stackPush(int x) {
stackNode * element = new stackNode... | ALGO | 0.995511 | 4.168796 |
7a2e2686-4d92-4116-86c3-59b0bdc08b3a | ingyu1008/codetree-TILs | 241104/노드의 공통 조상 4/common-ancestor-of-node-4.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
cin.tie(0)->sync_with_stdio();
int N;
cin >> N;
vector<vector<int>> E(N+1);
for(int i = 0; i < N-1; i++){
int a, b;
cin >> a >> b;
E[a].push_back(b);
E[b].push_back(a);
}
... | ALGO | 0.999959 | 5.231314 |
0ef4f9cc-f05b-4ea7-ab9f-c4a397244e14 | hoijo/ardupilot_Copter_3.4.6_Swift_edit | modules/PX4Firmware/src/platforms/ros/geo.cpp | /**
* @file geo.c
*
* Geo / math functions to perform geodesic calculations
*
* @author Thomas Gubler <<EMAIL>>
* @author Julian Oes <<EMAIL>>
* @author Lorenz Meier <<EMAIL>>
* @author Anton Babushkin <<EMAIL>>
*/
#include <geo/geo.h>
#include <px4.h>
#include <unistd.h>
#include <pthread.h>
#include <stdio.... | ALGO | 0.99816 | 3.213487 |
93b823fe-adec-433e-8ed2-54e23f3da794 | denstalker/stm32f030 | Drivers/CMSIS/NN/Examples/ARM/arm_nn_examples/gru/arm_nnexamples_gru.cpp | /**
* @ingroup groupExamples
*/
/**
* @defgroup GRUExample Gated Recurrent Unit Example
*
* \par Description:
* \par
* Demonstrates a gated recurrent unit (GRU) example with the use of fully-connected,
* Tanh/Sigmoid activation functions.
*
* \par Model definition:
* \par
* GRU is a type of recurrent neura... | ALGO | 0.907945 | 7.464193 |
f327419f-f8dd-4f76-b1f7-b304f63dc068 | danielmitre/CompetitiveProgramming | Codeforces/gym/101875/G.cpp | #include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 100;
pair<double, double> cars[MAXN];
#define vel second
#define pos first
int main() {
int N;
scanf(" %d", &N);
for(int i=0; i<N; i++ ) {
scanf("%lf %lf", &cars[i].pos, &cars[i].vel);
}
sort(cars, cars+N);
doubl... | ALGO | 0.999926 | 4.292327 |
05c6a1d7-e6c9-47be-bc22-6153d575f787 | sihyun98/2020Algorithm | 프로그래머스/Level3/단어 변환.cpp | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
int answer = 50;
bool isDiff(string a, string b) {
int diff = 0;
for (int i = 0; i < a.length(); i++) {
if (a[i] != b[i]) {
diff++;
}
}
if (diff == 1) {
return true;
}
else {
return false;
}
}
void ne... | ALGO | 0.999926 | 4.648814 |
2903d8f7-3044-4bbb-bec6-c996f03d93e6 | ThalesDaviSouza/Competitive-Programming | src/Matrix/Soma das Colunas/SomaDasColunas.cpp | #include <iostream>
using namespace std;
#define TAM_MATRIZ 3
int main(){
int matriz[TAM_MATRIZ][TAM_MATRIZ];
int soma[TAM_MATRIZ];
for(int i = 0; i < TAM_MATRIZ; i++){
soma[i] = 0;
for(int j = 0; j < TAM_MATRIZ; j++){
cin >> matriz[i][j];
soma[i] += mat... | ALGO | 0.999527 | 4.201613 |
d5541c68-dad3-4598-8ed4-a7da7e02245b | Balpreet1003/LeetCode | 1631-path-with-minimum-effort/1631-path-with-minimum-effort.cpp | class Solution {
int n,m;
int dx[4]={1,0,-1,0};
int dy[4]={0,-1,0,1};
public:
int minimumEffortPath(vector<vector<int>>& heights) {
n=heights.size();
m=heights[0].size();
vector<vector<int>>dis(n,vector<int>(m,INT_MAX));
priority_queue<pair<int,pair<int,int>>,vector<pair... | ALGO | 0.999986 | 6.05246 |
24d08fc5-ac34-47bd-913c-d74992666fbd | FranciscoThiesen/OldProblems | Spoj/cnd.cpp | #include <cstdio>
#include <cstring>
#include <iostream>
#include <cmath>
using namespace std;
int vec[10010];
int main()
{
int a = 1;
while(a != -1)
{
scanf("%d", &a);
if(a == -1)
return 0;
int total = 0;
int moves = 0;
for(int i = 0; i < a; i++)
{
scanf("%d", &vec[i]);
total += vec[i];
}
... | ALGO | 0.999647 | 3.220213 |
9d0c77ee-9849-49f7-bd65-6fd5d9c5bdbb | warycat/uva | 10404/10404.cpp | #include<iostream>
#include<cstdio>
using namespace std;
int n;
int m;
int a[10];
int s[10000001];
void print()
{
for(int i=0;i<=n;i++)printf("%3d",i);
cout<<endl;
for(int i=0;i<=n;i++)printf("%3d",s[i]);
cout<<endl;
cout<<endl;
}
int main()
{
while(cin>>n>>m){
for(int i=0;i<=n;i++)s[i]=0;
for(int i=0;i<m;... | ALGO | 0.99999 | 3.162858 |
350d5b57-c7e2-4647-94ee-abeddfcdc077 | DivyanshMittal-exe/competitive-programming | cf/contest/1659/d/d.cpp | // divyanshmittal-exe
// 02 07 2022
#pragma GCC optimize("Ofast,unroll-loops")
#include <bits/stdc++.h>
using namespace std;
mt19937 RNG(chrono::steady_clock::now().time_since_epoch().count());
#define SHUF(v) shuffle(all(v), RNG);
// ----------------------<DEBUG>---------------------------
void __print(int x) {ce... | ALGO | 0.999912 | 4.081139 |
d5c9708a-5e0d-41c2-badd-9b6960bd814d | SadmanRafith/Algorithms | Priority Queue/Priority Queue with Object.cpp | #include<bits/stdc++.h>
using namespace std;
struct Student{
int id;
string name;
double cgpa;
};
class cmp{
public:
bool operator()(Student &s1, Student &s2){
return s1.id>s2.id?1:0;
}
};
int main(){
priority_queue<Student,vector<Student>, cmp> pq;
Student s1 ={100,"Richard",3.5};
Stud... | ALGO | 0.98849 | 3.956622 |
2ecc13d6-8f2e-4cce-8fd3-9d0ef799fb82 | GabrielMunarriz/Practice-Code-Problems | Hackerrank/Data Structures/Trees/Trees - PreOrder Traversal/TPOT.cpp | #include <iostream>
#include <cstddef>
class Node {
public:
int data;
Node *left;
Node *right;
Node(int d) {
data = d;
left = NULL;
right = NULL;
}
};
class Solution {
public:
Node* insert(Node* root, int data) {
if(r... | ALGO | 0.999904 | 6.210927 |
fffbee55-c17f-4872-b26b-df144d3d3406 | keenan-burnett/yeti_radar_odometry | src/radar_utils.cpp | #include <math.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <dirent.h>
#include <fstream>
#include <iostream>
#include <string>
#include <opencv2/highgui.hpp>
#include <opencv2/imgproc.hpp>
#include "radar_utils.hpp"
static inline bool exists(const std::string& name) {
struct stat buffer;
return !(... | DATA | 0.946949 | 3.812219 |
2708e5e3-0d08-42eb-8e4a-a7e1bcd09c84 | DunderMifflinT3/TicTacToe-Project-T3 | TicTacToe Project T3/TicTacToe Project.cpp | #include <iostream>
#include <iostream>
#include <string>
#include <time.h>
#include <stdlib.h>
#include <stdio.h>
using namespace std;
char TTT_Board[9] = { ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' };
int playerAI();
void player_input(char[]);
void drawBoard(char[]);
void playAgain();
void callHelp();
void sho... | ALGO | 0.972735 | 3.735899 |
6a00596a-cf55-4e48-bbff-c43a5fb4f2ca | rshubham24/coding | course_era/algorithms on graphs/XzNMqFPJEemnrA4AsaAhFA_2402e552dd474bf98ffb685d96b6556e_graphs_1903311803/week3_paths1/2_bipartite/bipartite.cpp | #include <iostream>
#include <vector>
#include <queue>
using std::vector;
using std::queue;
int bipartite(vector<vector<int> > &adj) {
//write your code here
return -1;
}
int main() {
int n, m;
std::cin >> n >> m;
vector<vector<int> > adj(n, vector<int>());
for (int i = 0; i < m; i++) {
int x, y;
... | ALGO | 0.999975 | 4.983839 |
ab73faa2-d840-4696-9c9e-304741cdcd0d | andeplane/AtomifyVisionPro | LAMMPS/src/GPU/pair_lj_cut_coul_cut_gpu.cpp | /* ----------------------------------------------------------------------
Contributing author: Mike Brown (SNL)
------------------------------------------------------------------------- */
#include "pair_lj_cut_coul_cut_gpu.h"
#include "atom.h"
#include "domain.h"
#include "error.h"
#include "force.h"
#include "gp... | ALGO | 0.998287 | 6.335876 |
d9399d6c-9834-4912-971c-a9983960b729 | bipin712/discritlabwork | DS lab 1/Cartessin.cpp | #include<stdio.h>
int main()
{
int a[10],b[10],c[10],i,j,k,l;
printf("Enter the number of elements of set A: ");
scanf("%d",&k);
printf("Enter the elements of set A");
for(i=0;i<k;i++)
{
scanf("%d",&a[i]);
}
printf("Enter the number of elements of Set B: ");
scanf("%d",&l);
printf("Enter the elements of set... | ALGO | 0.989227 | 3.031603 |
7ae0bfc9-c1fb-4e2d-80bf-040ee9f9bba0 | EkanshGupta-02/LeetCode-Solution | 18-4sum/18-4sum.cpp | class Solution {
public:
vector<vector<int>> fourSum(vector<int>& nums, int target) {
sort(nums.begin(),nums.end());
int n=nums.size();
set<vector<int>>ans;
for(int i=0;i<n;i++){
for(int j=i+1;j<n;j++){
long long temp=target-nums[i]-nums[j];
... | ALGO | 0.999986 | 5.876345 |
852f5d4b-1c01-451a-8bf1-89afc1ad8460 | alechim/Cplusplus-Projects | C++_Textbook/Chapter_10/Exercises/q15/main.cpp | // Exercise 15: Refactored Example 10-A
// - Loops and prompts user to add additional cash until the amount added is enough
// - Dispenses change if user enters more money than the product requires
#include <iostream>
#include "juiceMachine.h"
using namespace std;
// Function Prototypes
void showSelection();
void sel... | TOOL | 0.921164 | 6.126992 |
0ccd2372-7855-4c55-b97d-76a76ef39b11 | Sanjanah8/Competitive-Coding | hackerrank/c++/datatype size.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution {
public:
int dataTypeSize(string str) {
if (str == "Character") {
return sizeof(char);
} else if (str == "Integer") {
return sizeof(int);
} else if (str == "Long") {
return sizeof(long);
... | ALGO | 0.984962 | 4.670897 |
a57c628c-adb1-41d5-a4ba-5c644b3137fd | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_4592_11.cpp | #include <bits/stdc++.h>
using namespace std;
bool isp(long long x) {
for (long long a = 2; a * a < x; a++) {
if (x % a == 0) {
return true;
}
}
return false;
}
int main() {
int t;
cin >> t;
for (int i = 0; i < t; i++) {
long long a, b;
cin >> a >> b;
if (a - b > 1) {
cout <<... | ALGO | 0.999761 | 4.806243 |
89290502-770d-4f30-910b-5ae8773e7da5 | huydoan2/cs390t | in-house/rkdt/metricTree/metrictree.cpp | #include "metrictree.h"
#include <mpi.h>
#include <omp.h>
#include <cmath>
#include <cstdlib>
#include <iomanip>
#include <stdio.h>
#include "repartition.h"
#include "CmdLine.h"
#include "generator.h"
#include "clustering.h"
#include "direct_knn.h"
#include "mpitree.h"
#include <ompUtils.h>
//#include "parUtils.h"
u... | ALGO | 0.999364 | 3.994698 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.