uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
9680b581-66f2-4fcf-a6d8-45b9b4876ac9 | icprog/STM32_Main | src/user/regime/run/regime_run_pickup.cpp | #include "regime_run_pickup.h"
RegimeRunPickup::RegimeRunPickup()
{
}
RegimeRunPickup::~RegimeRunPickup()
{
}
void RegimeRunPickup::getOtherSetpoint()
{
// Уставки режима
action_ = parameters.get(CCS_RGM_RUN_PICKUP_MODE); // Активность режима
// Текущие параметры режима
state_ = parameters.get(... | TOOL | 0.908951 | 4.890353 |
4e03acc2-1b0d-4705-a43f-051d8781ed9a | V01DZ3R0/RSPS3001-barcode | main.cpp | #include <iostream>
#include <string>
#include <iomanip>
#include <sstream>
#include <bitset>
#include <openssl/sha.h>
#include "base26.cpp"
#include "rsa.cpp"
// checksum and VersionNumber always set to 0
// Activation Code
// This is conditional, and if not used should be excluded from the header, rather than being... | ALGO | 0.957167 | 5.960443 |
b744d02e-7d83-4462-91cd-985d2ccef140 | sinedanat/teach_yourself_cpp_in_one_hour_a_day_rao_2017 | ch25/ex/ex02.cpp | // Demonstrate how you would toggle
// (that is, switch) the bits in a bitset.
#include <iostream>
#include <bitset>
int main()
{
std::bitset<4> bNum(0b0010);
std::cout << "bNum before toggle bits: " << bNum << std::endl;
bNum.flip();
std::cout << "bNum after toggle bits: " << bNum << std::endl;
... | ALGO | 0.879598 | 6.876163 |
eb2c692c-fe25-47a7-91dd-35f0f91fca06 | wmrmrx/MAC0214 | Codeforces/Gym/NERC_2023_2/f.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define all(v) v.begin(), v.end()
void dbg_out() { cerr << endl; }
template <typename H, typename... T>
void dbg_out(H h, T... t) { cerr << ' ' << h; dbg_out(t...); }
#define dbg(...) { cerr << #__VA_ARGS__ << ':'; dbg_out(__VA_ARGS__); }
vector<pai... | ALGO | 0.999452 | 4.015717 |
5922a8e8-d41d-471d-9d38-50d8e733af9f | Jonathan523/SHU-CS-DS-2024W | chapter3/6/src/LinkList.cpp | // LinkList.cpp
#include "LinkList.hpp"
LinkList::LinkList() : head(new Node(0)) {};
LinkList::~LinkList()
{
while (head != 0) {
Node* p = head;
head = head->next;
delete p;
}
}
void LinkList::append(int value) // 插入节点到链表尾部
{
Node* newNode = new Node(value);
Node* tail = hea... | ALGO | 0.978639 | 4.265993 |
aae5b67f-d073-40bf-9591-7ea0196c441e | chinmaykulkarni19/300DaysOfCode | Day__170/Geek and knots.cpp | class Solution{
public:
const int mod=1000000007;
long long dp[1001][1001];
int comb(int n,int k)
{
if(k==0 || k==n)
return 1;
if(dp[n][k]!=0)
return dp[n][k];
else
return dp[n][k]=(comb(n-1,k)%mod + comb(n-1,k-1)%mod)%mod;
}
int knots(int M, int N... | ALGO | 0.99999 | 4.959061 |
16439f7c-f1b6-4e43-bbd1-d02a279a9e34 | willkill07/AdventOfCode2021 | tests/Day12.cpp | #include <catch2/catch_all.hpp>
#include "AdventTest.hpp"
#include "AdventDay.hpp"
#include "Day12.hpp"
using namespace day12;
namespace {
std::array<char const*,3> input = {
R"MULTILINE(start-A
start-b
A-c
A-b
b-d
A-end
b-end)MULTILINE",
R"MULTILINE(dc-end
HN-start
start-kj
dc-start
dc-HN
LN-dc
HN-end
kj-sa
kj-H... | ALGO | 0.982072 | 5.666107 |
644369cb-24ec-47b4-8b34-78957ad20761 | RamazanFIT/PP1_LABS_QUIZ_FINAL | 03_lab/B.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin >> n;
int arr[n];
for(int i=0; i<n; i++) cin>>arr[i];
cout << count_if(arr, arr+n, [](int i){return i > 0;});
}
| ALGO | 0.999937 | 3.850819 |
2cb28134-a84f-400d-90ac-713da0c96011 | SuhasLingam/Leetcode | 222.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.999603 | 6.524294 |
d2e9e25d-8e59-4e45-99b7-9c8427c8df7f | Krystian1222/GPU_computing | OpenCLMatrixMultiplication/matrixMultiplicationOpenCL.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <CL/cl.h>
#include <iostream>
#include <fstream>
#include <chrono>
using namespace std;
static const int DEVICE_NAME_LEN = 128;
static char dev_name[DEVICE_NAME_LEN];
////////////////////////////////////////////////////////////////////////
float *createRandomMatrix(int rows, ... | ALGO | 0.996928 | 4.659299 |
b6fd3a7d-763e-4cbd-9cf0-c1ededd476e5 | AnastasySh/lab_351 | semester`1/lab6_dynamic/matr.cpp | #include "pch.h"
#include <iostream>
#include "matr.h"
using std::cin;
using std::cout;
using std::endl;
matrix::matrix()
{
};
matrix::~matrix()
{
};
void matrix::input()
{setlocale(LC_ALL, "Russian");
int strok1, stolb1;
cout << " " << endl;
cin >> strok1;
cout << " o" << endl;
cin >> stolb1;
strok = strok1;
... | ALGO | 0.947549 | 3.463676 |
682e063a-8f8e-4e70-abaa-28c939af15e9 | abcivashritt/codechef | Chef and Pal.cpp | #include <iostream>
using namespace std;
int main() {
int T;
cin>>T;
while(T--) {
int n;
cin>>n;
if(n%2)
cout<<-1<<"\n";
else
cout<<(string(n/2, '1') + string(n/2, '0'))<<"\n";
}
return 0;
}
| ALGO | 0.999587 | 4.952833 |
8fc161ab-305e-4c47-abcd-c8b41d822159 | puynph/Programming2-Structures | 04/container/main.cpp | #include <cstdlib>
#include <iostream>
#include <vector>
// Prints the elements in the parameter vector ints.
void print_integers(const std::vector< int >& ints)
{
for(auto elem : ints) {
std::cout << elem << " ";
}
std::cout << std::endl;
}
// Reads as many integers as the parameter count indicat... | TEST | 0.967533 | 5.12219 |
a02dd048-4a69-46a8-96f8-70a03e2d7972 | GrootTheDeveloper/OLP-ICPC | 800+BAI_CODE_HAY/Code/sobatlap.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
int a[1000006];
bool mark[10];
int lim, val[10000007];
void Try(int i, int s)
{
if (i > n) return;
for (int x = 0; x <= 9; x++)
{
if (!mark[x])
{
mark[x] = true;
val[++lim] = s * 10 + x;
}
... | ALGO | 0.997765 | 4.660079 |
5d72898c-e631-456f-9465-3e82a64262ea | ishandutta2007/codeforces | tinsane/normal/611/C.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <iomanip>
#include <queue>
#include <vector>
#include <map>
#include <cmath>
#include <string>
#include <cstring>
#include <stack>
#include <set>
#include <algorithm>
#include <bitset>
#pragma comment(linker, "/STACK:167... | ALGO | 0.999705 | 4.050885 |
d0552958-f7e3-46f3-80cd-13c328323ee7 | Tatutaage1212/teamgame02 | SourceCode/judge.cpp | #include "all.h"
extern OBJ2D player;
extern OBJ2D enemy[ENEMY_MAX];
extern int combo;
//蔻
bool hitCheckCircle(VECTOR2 pos1, float r1, VECTOR2 pos2, float r2) {
float dx = pos2.x - pos1.x;
float dy = pos2.y - pos1.y;
float r = r1 + r2;
if (dx * dx + dy * dy <= r * r)
return true;
return ... | ALGO | 0.996777 | 3.502496 |
61d1c3a4-3ab2-43c8-b142-d381ca1203cb | oflucas/Leetcode-Cpp | p382.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
/** @param head The linked list's head.
Note that the head is guaranteed to be not null, so it contains at least one node. *... | ALGO | 0.999683 | 5.24185 |
6dcd71e6-745a-4cb5-b6ca-f5ca6716fa03 | rupamghosh2006/DSA-C-- | setMatrixzero.cpp | #include<iostream>
#include<vector>
using namespace std;
void setZeroes(vector<vector<int>>& matrix) {
int n = matrix.size();
int m = matrix[0].size();
int col0 = 1;
for(int i = 0; i < n; i++){
for(int j = 0; j < m; j++){
if(matrix[i][j] == 0){
//mark the i-th row a... | ALGO | 0.999059 | 5.508233 |
ed342959-b342-476f-a437-d5b1fdffc14e | ishandutta2007/codeforces | krk/normal/1715/E.cpp | #include <bits/stdc++.h>
using namespace std;
// Dynamic convex hull implementation found online. I can't find the source of this code anymore.
typedef long long ll;
typedef pair <int, int> ii;
typedef pair <ll, int> lli;
const ll is_query = -(1LL<<62);
struct Line {
ll m, b;
mutable function<const Line*()> su... | ALGO | 0.999988 | 3.686381 |
eca05f8f-5c7d-455c-9590-1e273aa2ffba | Moondoll5/HPCAssignment | try.cpp | #include <stdio.h>
#include <algorithm>
#include <string>
#include <iostream>
#include <fstream>
#include <vector>
#include <sstream>
#include <string.h>
#include <cstdlib>
#include "dcdplugin.c"
#include <cmath>
#include <time.h>
#include <bits/stdc++.h>
#include <omp.h>
#include <stdlib.h>
#include <queue>
using nam... | ALGO | 0.99842 | 3.062743 |
c3ab5927-ee6d-4030-a74b-1f7e54cc5335 | baibaixue/Games101_Graphics | Assignment5/Assignment5/Code/Renderer.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <fstream>
#include "Vector.hpp"
#include "Renderer.hpp"
#include "Scene.hpp"
#include <optional>
// Ƕת
inline float deg2rad(const float °)
{ return deg * M_PI/180.0; }
// Compute reflection direction
// ⷽ
Vector3f reflect(const Vector3f &I, const Vector3f &N)
{
retu... | ALGO | 0.978075 | 5.625232 |
df46d71d-1a67-43fc-8dcf-91ec02965ea6 | archiducatus/Project2 | Project2/Math.cpp | #include <iostream>
class point {
public:
int x, y;
point(int pos_x, int pos_y) {
x = pos_x;
y = pos_y;
}
};
class geometry {
private:
int num_points;
point* point_array[100];
public:
geometry() {
num_points = 0;
}
void add_point(const point& p) {
point_array[num_points++] = new point(p.x, p.y);
}... | ALGO | 0.999014 | 5.074806 |
df68efd4-4775-49bc-a899-652a989e541b | alexandraback/datacollection | solutions_5636311922769920_1/C++/CPCPC/D.cpp | #include <cstdio>
typedef long long ll;
int main() {
int T, k, c, s;
scanf("%d", &T);
for (int C = 1; C <= T; C++) {
scanf("%d%d%d", &k, &c, &s);
printf("Case #%d:", C);
ll p = 0, t = 1;
int m = (c > 1)? (k+1)/2: k;
for (int i = 1; i < c; i++) t *= k;
if (c == 1) t = 0;
if (s >= m) {
for (int x = 0... | ALGO | 0.999313 | 3.634426 |
139af30e-7b33-4e5f-8344-579fe0b68968 | Anik-36/coding_in_laptop | phitron/C++/Basic Data Structure/Week 05-Binary Tree/Module 19-Problem Solving Using Binary Tree/code360_reverse_level_order_traversal.cpp | /************************************************************
* https://www.naukri.com/code360/problems/reverse-level-order-traversal_764339?leftPanelTabValue=PROBLEM
Following is the TreeNode class structure:
template <typename T>
class TreeNode {
public:
T val;
TreeNode<T> *left;
... | ALGO | 0.999994 | 5.774719 |
defe80ad-5a20-4030-93f8-a7619dea1d5f | Zimse12345/Code | AtCoder_Contest/ABC384/C.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <math.h>
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define bendl(x) x.begin(), x.end()
#define siz(x) ((int)(x).size())
//#define int long long
usin... | ALGO | 0.999553 | 4.482404 |
26c6d5a1-a2a2-4158-90fd-0b1034db7d6f | surendiran04/Data-structures-and-Algorithms | Array/2DArray.cpp | #include <iostream>
#include <stdlib.h>
using namespace std;
int main()
{
int A[3][4] = {{1, 2, 3, 4}, {2, 4, 6, 8}, {1, 3, 5, 7}};//it is fully in stack
int *B[3]; //both B and C pointers are in Stack
int **C;
int i, j;
B[0] = (int *)malloc(4 * sizeof(int)); //these memories are created in heap
... | ALGO | 0.971246 | 3.133593 |
6722b310-1453-4be5-adc0-d6b721e8d7cd | zishahed/Kattis-Easy-problems | isyavowel.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
void solve()
{
string s;
cin >> s;
ll sum = 0, sumy = 0;
for (int i = 0; i < s.size(); i++)
{
if (s[i] == 'a' || s[i] == 'e' || s[i] == 'i' || s[i] == 'o' || s[i] == 'u')
sum++;
if (s[... | ALGO | 0.992649 | 4.61298 |
70a6970d-5e59-4f9e-91e2-2c02469bc406 | YashiSri1/GFG_Practice | Difficulty: Easy/Count Digits/count-digits.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
// Function to count the number of digits in n that evenly divide n
int evenlyDivides(int n) {
// code here
int count = 0;
int num = n;
while(num != 0)
{
... | ALGO | 0.999445 | 6.399825 |
9f92053b-3f43-4491-b242-438d4d12cf38 | zensen6/BOJ_350_solved-completed_code- | 1890_acm.cpp | #include<iostream>
#include<queue>
using namespace std;
int arr[101][101];
long long path[101][101] = {0};
void dp(int N){ //(1,1)->(N,N)
path[1][1] = 1;
for(int i=2;i<=N;i++){ // (x,1)
for(int j=1;j<i;j++){
if(i==j+arr[j][1]) path[i][1]+=path[j][1];
}
}
for(int i=2;i<=N;i++){ //... | ALGO | 0.999971 | 3.493855 |
0f2c5fe6-54a7-48e4-9166-65fb10438438 | tin10401/CodeForces | CodeForces/150A_Win_or_Freeze.cpp | //████████╗██╗███╗░░██╗██╗░░░░░███████╗
//╚══██╔══╝██║████╗░██║██║░░░░░██╔════╝
//░░░██║░░░██║██╔██╗██║██║░░░░░█████╗░░
//░░░██║░░░██║██║╚████║██║░░░░░██╔══╝░░
//░░░██║░░░██║██║░╚███║███████╗███████╗
//░░░╚═╝░░░╚═╝╚═╝░░╚══╝╚══════╝╚══════╝
// __________________
// | ________________ |
// || ____ ||
// ||... | ALGO | 0.99994 | 5.118196 |
77607027-fb1a-419a-a670-b36a33cc3c69 | mdsojibmiah/Phitron_Course | Problem1409A.cpp | /* Author: CodeWithError
Email: <EMAIL>
Date : 03 / 23 / 2025
Time : 09:15
Problem Link: https://codeforces.com/problemset/problem/1409/A
*/
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define nl '\n'
#define YES cout << 'YES\n'
#define Yes cout << 'Yes\n'
#define NO cout << 'NO\n... | ALGO | 0.999327 | 4.945214 |
f14eef9e-f8fb-497d-ad52-2f641397be92 | tpgus2603/Boj | Graph/5639.cpp | #include<iostream>
using namespace std;
int lc[1000001];
int rc[1000001];
void postorder(int root)
{
if(lc[root]!=0)postorder(lc[root]);
if(rc[root]!=0)postorder(rc[root]);
cout<<root<<'\n';
}
int main()
{
ios::sync_with_stdio(0);cin.tie(0);
int root;
cin>>root;
int t;
int prev=root;
while(1)
{
... | ALGO | 0.999997 | 4.296982 |
63606e4d-6c9b-4d11-8144-6906c4dd3a49 | acc-cosc-1337-summer-2023/course-giovanny-garcia | src/homework/05_functions/func.cpp | //add include statements
#include "func.h"
using std::cout;
//add function code here
int get_vector_max_value(vector<int> vect)
{
vector<int> x = vect;
int maxVal = 0;
int vectorSize = x.size();
for (int i = 0; i < vectorSize; i++) //loop for the amount of elements in the vector
{
if (x[i... | ALGO | 0.992768 | 4.562564 |
b6c2d350-5ee6-4629-8863-db779ee128f7 | joyoshish/CodeGita | 1_ARRAYS/ALL ARRAY CPP FILES/Array12_Negative elements to one side of the array.cpp | #include<iostream>
using namespace std;
void swap(int *xp, int *yp)
{
int temp = *xp;
*xp = *yp;
*yp = temp;
}
int main()
{
int length,k ;
cout<<"Program to sort negative elements to one side of the array\n\n";
cout<<"\n Enter the total size of the array : ";
cin>>length;
int a[length];
cout<<"\n Input... | ALGO | 0.999913 | 3.639889 |
59112f13-2c3c-4ea1-b535-562c2abefc95 | sinian666/codes_86_2 | cpp_副本19/chapter_heap/my_heap.cpp | /**
* File: my_heap.cpp
* Created Time: 2023-02-04
* Author: LoneRanger (<EMAIL>), what-is-me (<EMAIL>)
*/
#include "../utils/common.hpp"
/* 大顶堆 */
class MaxHeap {
private:
// 使用动态数组,这样无需考虑扩容问题
vector<int> maxHeap;
/* 获取左子节点索引 */
int left(int i) {
return 2 * i + 1;
}
/* 获取右子节点索... | ALGO | 0.999603 | 5.474622 |
cf332407-4e6f-4f31-9b50-88aa028c4dc5 | nguyenquan2003/thuc-hanh-nhap-mon-LT | KT lan 1/779_Nguyen Ngoc Quan_KTL1.cpp | #include<stdio.h>
#include<conio.h>
#include<math.h>
int main()
{
int n;
printf("chon1 hay 2: "); scanf("%d", &n);
switch (n) {
case 1: {
int a, b, c, d;
printf("Nhap A(xa,ya): "); scanf("%d %d", &a, &b);
printf("Nhap B(xb,yb): "); scanf("%d %d", &c, &d);
float Tinh = sqrt(pow(c - a, 2) + pow(d - b, 2));
... | ALGO | 0.983965 | 3.148985 |
0cd172e6-ef20-49cb-aa44-44b350a34966 | ishandutta2007/codeforces | timmyfeng/normal/1300/D.cpp | #include <bits/stdc++.h>
using namespace std;
pair<int, int> operator+(pair<int, int> a, pair<int, int> b) {
return {a.first + b.first, a.second + b.second};
}
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
int n;
cin >> n;
vector<pair<int, int>> pts(n);
for (auto& i : pts) {
... | ALGO | 0.999984 | 4.768343 |
060eda41-75f8-472b-ba04-cc71283f50d6 | wyk9787/ACM-ICPC | open_katties/take_two_stones/main.cpp | #include <iostream>
using namespace std;
int main(int argc, const char * argv[]) {
int n = 0 ;
cin >> n;
if(n % 2 == 1)
cout << "Alice" << endl;
else
cout << "Bob" << endl;
return 0;
}
| ALGO | 0.999908 | 3.734246 |
44888325-c7fa-46e6-abf6-bf96599a4978 | k402xxxcenxxx/MelonSeller | MelonSeller/MelonSeller.cpp | #include "pch.h"
#include <iostream>
#include <thread>
using namespace std;
void BuyMelon(Customer* customer, Seller* seller) {
// Check the name to avoid the same customer buying all the melons from the vendor
if (seller->last_customer != customer->GetName() && seller->GetCount() > 0) {
// held the key and lo... | TOOL | 0.88149 | 5.019187 |
4bae8bef-4fe3-40d3-b463-b24adac70cbe | carolestrella/epl-tp2 | EPL/main/eval.cpp | #include "eval.h"
int Eval::visit (Lit* l){
return l->number;
}
int Eval::visit (Add* a){
return a->left->accept(this) + a->right->accept(this);
}
int Eval::visit (Neg* n){
return n->number->accept(this) * -1;
} | ALGO | 0.995931 | 3.628207 |
74010e29-cc24-4bf5-9f85-a14e3f109d58 | goldYoungHwan/AlgorithmJobs | hideAndFind.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <utility>
using namespace std;
int visit[100001] = { 0 };
void findSister(int x, int y) {
queue<pair<int, int>> queFind;
int time = 0;
queFind.push({ x, time });
while (!queFind.empty()) {
int soobeanLocation = queFind.front().first;
time = qu... | ALGO | 0.999858 | 3.502676 |
f965aa77-4a0b-451c-af42-7159873fde4c | pss-aditya/Logic-Building | program414.cpp | #include<iostream>
using namespace std;
template<class T>
struct node
{
T data;
struct node *next;
};
template<class T>
class SinglyLL
{
public:
struct node<T>* head;
int iCount;
SinglyLL();
void InsertFirst(T no);
void InsertLast(T no);
void InsertAtPos(T ... | ALGO | 0.998715 | 4.145953 |
a14aa6e7-7653-450d-8d32-6f8e2be4d7c6 | IvanDzanija/competitive_programming | AdventOfCode/2023/Day04.cpp | //
// Day04.cpp
// 2023
//
// Created by Ivan Dzanija on 08.01.2024..
//
#include <iostream>
#include <fstream>
#include <string>
#include <map>
#include <cmath>
void day4(void){
std::ifstream inputFile("input.txt");
std::string currentLine;
std::map <int,int> gameCount;
int result = 0;
int secondPartResul... | ALGO | 0.998385 | 4.338432 |
5869ac97-2e12-498f-b566-6fa57034044b | alexandraback/datacollection | solutions_5709773144064000_1/C++/vinamilk/main.cpp | #include <iostream>
#include <fstream>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <ctime>
#include <algorithm>
#include <queue>
#include <set>
#include <vector>
#include <map>
#include <sstream>
#define pb push_back
#define mp make_pair
#define ll long long
#define ull unsigned long long
using na... | ALGO | 0.999183 | 3.389029 |
c703b9f6-862e-434d-baae-a65fedd6a543 | Sayantan-world/CP_Practice | BinSearch/MaxGrps/maxGrp.cpp | /*
* AUTHOR : Sayanatan Pal
* DATE : 1.01.2020
* Time Complexity --> O(log(maxGrp) * n)
* Queston: Given a group of animals in various boxes, calculate max number of packets u can make with K distinct animals in each packet.
* Ex: A box has some animals(elements in list denote the number of animals in i th box) = ... | ALGO | 0.999955 | 4.434316 |
fb8f790e-3701-4904-add7-6edc7ce5bbb3 | prerit2001/Competitive-Programming | Striver/007. SetMatrixZero.cpp | /*https://leetcode.com/problems/set-matrix-zeroes/*/
---------------------------------------------------------------------------
/*
M1 : Brute force Aditional Memory
O(n^2) time and O(n) space
*/
---------------------------------------------------------------------------
/*
M2 : if(a[i][j] == 0) then a[i][0] = 0, ... | ALGO | 0.998946 | 6.265157 |
54c04063-96e5-4237-a766-8942b07aa19e | Drigger91/DSA_practice | Daily/alienDictionary.cpp | // Intuition
// The intuition is to create a custom mapping of characters and then sort the array according to it.
// Approach
// We all know the normal mapping of characters i.e (a == 0, b == 1 and so on) the idea of this question is to create a custom mapping and then sort the array according to it using a comparato... | ALGO | 0.999986 | 6.094635 |
ce42f60e-bd9c-4793-b2fe-d084455cd22e | Sunny-Saurya/Cpp_Programming | ArrayCpp/array_questions/mergeTwoSortedArray.cpp | // merge two sorted array
#include <iostream>
using namespace std;
int merge(int arr1[], int n, int arr2[], int m, int arr3[])
{
int i = 0;
int j = 0;
int k = 0;
while (i < n && j < m)
{
if (arr1[i] < arr2[j])
{
arr3[k] = arr1[i];
k++;
i++;
... | ALGO | 0.999927 | 4.82069 |
8f37ee62-31b1-46d6-9899-6a909dd360a1 | riyagupta2011/Striver_SDE_Sheet | day21/ques5.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.999997 | 5.90749 |
d4ffad01-82f5-40d2-9727-bd9af8a113fb | corlissg/darknet_GC | src/yolo_console_dll.cpp | #include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <queue>
#include <fstream>
#include <thread>
#include <future>
#include <atomic>
#include <mutex> // std::mutex, std::unique_lock
#include <cmath>
// It makes sense only for video-Camera (not for video-File)
// To use - uncomme... | TOOL | 0.870374 | 5.623297 |
9673c601-2a07-4276-b843-5cced62b91ff | saiket-das/DSA | C++/variable/float-print.cpp | #include<iostream>
#include<iomanip>
using namespace std;
int main () {
// How to print floating value in C++
float a;
cin >> a; // Input
cout << "a = " << fixed << setprecision(2) << a << endl; // Output
return 0;
} | TOOL | 0.962092 | 4.045185 |
14bb6583-a2e1-41d9-8944-a44a28c6f927 | Luka-D03/Projects | 2. letnik/C++/naloga2_1.cpp | #include <iostream>
using namespace std;
int main()
{
unsigned int N, X;
float tab[100], vsota=0, rez;
cout << "Vnesi skupno stevilo podatkov: ";
cin >> N;
while (N > 100 || N <= 0)
{
cout << "Stevilo je izven obsega" << endl;
cout << "Ponovno vnesi stevilo: ";
cin >> ... | ALGO | 0.98681 | 3.390067 |
2e5c60da-654e-4257-a57e-0e312a9ecc2d | chunghoang123/session06 | session06-2.cpp | #include<stdio.h>
int main(){
int num1,num2,num3,num4,num5;
int a=0, b=0;
printf("moi nhap so nguyen");
scanf("%d",&num1);
printf("moi nhap so nguyen");
scanf("%d",&num2);
printf("moi nhap so nguyen");
scanf("%d",&num3);
printf("moi nhap so nguyen");
scanf("%d",&num4);
printf("moi nhap so nguyen");
scanf("... | ALGO | 0.999466 | 3.170149 |
11a916d9-f85a-4b19-a0e2-16375a90d51c | filouz/rnbb | bitcoin/core/src/src/minisketch/src/bench.cpp | #include "../include/minisketch.h"
#include <string.h>
#include <memory>
#include <vector>
#include <chrono>
#include <random>
#include <set>
#include <algorithm>
int main(int argc, char** argv) {
if (argc < 1 || argc > 4) {
printf("Usage: %s [syndromes=150] [errors=syndromes] [iters=10]\n", argv[0]);
... | ALGO | 0.880902 | 5.771023 |
c8356128-99bd-448c-912d-a491ea022c7d | yychentw/leetcode-solutions | 394. Decode String/solution.cpp | #include <cctype>
#include <stack>
#include <string>
using namespace std;
class Solution {
public:
string decodeString(string s) {
stack<string> st;
string temp = "";
for (char si: s) {
if (isdigit(si)) {
if (temp.empty() || !isdigit(temp[0])) {
... | ALGO | 0.999743 | 6.428052 |
721fcd87-be54-4834-a12c-a99c7d92d185 | evlad/phdworks | razlad/distrib/as66.cpp | /*-Algorithm AS 66
* The Normal Integral, by I. D. Hill, 1973.
* Applied Statistics 22(3):424-427.
*
* Translation to C by James Darrell McCauley, <EMAIL>.
*
* Calculates the upper or lower tail area of the standardized normal
* curve corresponding to any given argument.
*
* x - the argument value
* upper: 1... | ALGO | 0.99983 | 5.697546 |
826b8cb1-8274-4977-8795-09365ed1d4ac | GargSamarth/DSA_Assignments | KR_SIR/pstv_to_ngtv.cpp | #include <iostream>
using namespace std;
struct coordinates{
int i;
int j;
};
struct queue{
int size;
int f;
int r;
coordinates elements[50];
};
void enqueue(queue &q, coordinates c){
if((q.r+1)%q.size == q.f)
cout<< "Queue is full"<<endl;
else{
if(q.f == -1){
... | ALGO | 0.999981 | 4.056519 |
42e2e009-ace4-4c45-8be0-febb3cecfa67 | Rajendrasinghjeena/DAA | Lab Work/Week 11/W11Q3.cpp |
#include <bits/stdc++.h>
using namespace std;
bool findPartiion(int arr[], int n)
{
int sum = 0;
int i, j;
for (i = 0; i < n; i++)
sum += arr[i];
if (sum % 2 != 0)
return false;
bool part[sum / 2 + 1];
for (i = 0; i <= sum / 2; i++) {
part[i] = 0;
}
for (i ... | ALGO | 0.999826 | 4.564523 |
2890e2f4-7ce4-4b10-904a-4cdb2068b69a | Dxdchd/VSC | 25192.cpp | #include <iostream>
#include <set>
#include <algorithm>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
string first;
string input;
int f;
int cnt = 0;
set<string> v;
cin >> f;
cin >> first;
for (int i = 1; i < f; i++)
... | ALGO | 0.998121 | 3.705793 |
7f7cdea9-6561-4a53-b57c-e6bc628723c7 | joelfelipe94/Framework-UFOG | CPP/colorconstancy.cpp | #include "colorconstancy.h"
#include "colorlines.h"
ColorConstancy::ColorConstancy()
{
method =2;
}
ColorConstancy::ColorConstancy(int input)
{
method = input;
}
void ColorConstancy::setDCP(Mat dcp)
{
dcpPrior = dcp;
}
void ColorConstancy::setTrans(Mat transmission)
{
trans = transmission;
}
Vec3f C... | ALGO | 0.978529 | 4.002863 |
0a88d35e-9718-4db0-836a-b4f77cdffbd4 | arclab-hku/DEIO | thirdparty/gtsam/gtsam/3rdparty/Eigen/bench/perf_monitoring/gemvt.cpp | #include "gemv_common.h"
EIGEN_DONT_INLINE
void gemv(const Mat &A, Vec &B, const Vec &C)
{
B.noalias() += A.transpose() * C;
}
int main(int argc, char **argv)
{
return main_gemv(argc, argv, gemv);
}
| ALGO | 0.994766 | 4.434121 |
a8adcd37-bf82-4399-b01d-ffc2a7e9f324 | shoutong/CS-2024 | A3.cpp | //
// CS2024 -- Assignment 3
//
// rs2352 (Ruochen Song), hy483 (Hongshu Ye) 9/8/2016
//
// Exercise 6.38, Deitel & Deitel's "C++ How to Program"
//
//
// For this assignment we are asked to solve the Tower of Hanoi problem using recursion.
//
// a) Move n – 1 disks from peg 1 to peg 2, using peg 3 as a temporary hold... | ALGO | 0.999889 | 6.293289 |
937361da-2ad6-4f8c-9ff9-189083b6d66d | jinshuoliu/STL_algorithms | other_algo/simple/13-reverse.cpp | // 分派函数
template <class BidirectionalIterator>
inline void reverse(BidirectionalIterator first, BidirectionalIterator last) {
// 全部交给底层的函数
__reverse(first, last, iterator_category(first));
}
#include <iterator>
using namespace std;
// bidirectional iterator版
template <class BidirectionalIterator>
void __reverse(B... | ALGO | 0.98789 | 4.376718 |
419bd18f-5cae-4c89-8cdf-1014efa18c4e | Rhinos2/DroidBullet | app/src/main/framework/bullet/btSoftRigidCollisionAlgorithm.cpp | #include "btSoftRigidCollisionAlgorithm.h"
#include "btCollisionDispatcher.h"
#include "btSphereShape.h"
#include "btBoxShape.h"
#include "btCollisionObject.h"
#include "btSoftBody.h"
#include "btSoftBodySolvers.h"
///TODO: include all the shapes that the softbody can collide with
///alternatively, implement special c... | ALGO | 0.997923 | 4.886282 |
92ad0f5d-9726-4de5-9a34-3666104e0dc0 | ishandutta2007/codeforces | marckess/normal/1393/A.cpp | #include <bits/stdc++.h>
#define endl '\n'
#define fi first
#define se second
#define MOD(n,k) ( ( ((n) % (k)) + (k) ) % (k))
#define forn(i,n) for (int i = 0; i < n; i++)
#define forr(i,a,b) for (int i = a; i <= b; i++)
#define all(v) v.begin(), v.end()
#define pb(x) push_back(x)
using namespace std;
typedef long l... | ALGO | 0.999829 | 4.647429 |
3d81b1cf-46c6-436d-b86d-e46e9ac40a63 | jacobeverist/opaque | src/modules/bulletprobe/bullet-2.81/src/BulletCollision/CollisionShapes/btMultiSphereShape.cpp | #include "btMultiSphereShape.h"
#include "BulletCollision/CollisionShapes/btCollisionMargin.h"
#include "LinearMath/btQuaternion.h"
#include "LinearMath/btSerializer.h"
btMultiSphereShape::btMultiSphereShape (const btVector3* positions,const btScalar* radi,int numSpheres)
:btConvexInternalAabbCachingShape ()
{
m_shap... | ALGO | 0.937036 | 6.882026 |
d8858382-2603-482d-9c01-d648ecca9b2a | PhoengZ/AlgorithmDesign | rope.cpp | #include <iostream>
#include <vector>
#include <climits>
using namespace std;
int f(vector<int>&table, int n, int a, int b, int c){
if (n < 0)return INT_MIN;
if (table[n] != 0)return table[n];
if (n == 0)return 0;
int first_1 = f(table,n-a,a,b,c);
int second_1 = f(table,n-b,a,b,c);
int third_1... | ALGO | 0.999918 | 3.681488 |
214f6bbb-940b-4463-858a-00585c68ad17 | ishandutta2007/codeforces | tourist/normal/1671/C.cpp | /**
* author: tourist
* created: 22.04.2022 18:37:41
**/
#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#include "algo/debug.h"
#else
#define debug(...) 42
#endif
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int tt;
cin >> tt;
while (tt--) {
int n, x;
cin >> n >... | ALGO | 0.999927 | 4.696417 |
e41e71e9-6f61-493f-802b-e917123642dc | TAE-SEOP/Algorithm | 테스트/level1(문제2).cpp | #include <string>
#include <vector>
using namespace std;
vector<int>::iterator ptra;
vector<bool>::iterator ptrb;
int solution(vector<int> absolutes, vector<bool> signs) {
int answer = 0;
ptrb = signs.begin();
for(ptra = absolutes.begin(); ptra != absolutes.end(); ptra++){
if(*ptrb == true) answe... | ALGO | 0.99998 | 4.770679 |
2a97d705-b93e-41a9-8c4f-5f3184d81fe8 | Harshan-Nayak/Algomaster | DFS/200-number-of-islands/number-of-islands.cpp | class Solution {
public:
vector<int>dx={-1,0,1,0};
vector<int>dy={0,1,0,-1};
void dfs(int row,int col,vector<vector<char>>& grid, vector<vector<bool>>&vis,int n,int m){
vis[row][col]=true;
for(int i=0;i<dx.size();i++){
int nr = row+dx[i];
int nc = col+dy[i];
if (nr >= 0 && nr < n && ... | ALGO | 0.999978 | 6.66789 |
0e097d46-44b8-4618-a94c-23ea4d324341 | dsj-kaiyue/C_practice | P1160_list.cpp | #include <bits/stdc++.h>
using namespace std;
int main (void){
int n,k,p,m,x;
list<int> L;
cin>>n;
L.push_back(1);
for (int i=2;i<=n;i++)
{
cin>>k>>p;
list<int>::iterator it=find(L.begin(),L.end(),k);
if(p==0)
{
L.insert(it,i);
}else
{
... | ALGO | 0.999932 | 3.327991 |
9b578264-f5da-4a91-9ae8-709fc8836e29 | xiewf2019/px4-1.13.2 | PX4-Autopilot-1.13.2/src/modules/ekf2/EKF/sensor_range_finder.cpp | /**
* @file sensor_range_finder.cpp
*
* @author Mathieu Bresciani <<EMAIL>>
*
*/
#include "sensor_range_finder.hpp"
namespace estimator
{
namespace sensor
{
void SensorRangeFinder::runChecks(const uint64_t current_time_us, const Dcmf &R_to_earth)
{
updateSensorToEarthRotation(R_to_earth);
updateValidity(curre... | TOOL | 0.911321 | 6.883646 |
4d9d07af-76d9-4934-8467-b942ba86ddd0 | champmaniac/LeetCode | 971-flip-binary-tree-to-match-preorder-traversal/971-flip-binary-tree-to-match-preorder-traversal.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.999992 | 5.71122 |
84fa6abb-d413-4196-a86b-b6c5a5116536 | hcchung1/ICP | ICP Course [Huang]/w01/112550189_hw_01.cpp | #define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<stdlib.h>
int main() {
float height;
float manlow, manup, womanlow, womanup;
scanf("%f", &height);
manup = (height - 80) * 0.7 * 1.1;
manlow = (height - 80) * 0.7 * 0.9;
womanup = (height - 70) * 0.6 * 1.1;
womanlow = (height - 70) * 0.6 * 0.9;
pri... | ALGO | 0.994989 | 3.608562 |
470c50b1-20dc-4571-9079-505c5a16dccb | maciejkubus/flutter_daily_money | 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.998733 | 6.76775 |
f9a7e012-5114-439b-96de-9ffd99b510f1 | nirala96/open_source_start | C++/sum.cpp | #include<iostream>
using namespace std;
int main()
{
int a,b,c;
float sum;
cout <<"Enter The Value Of A,B and C\n";
cin >>a;
cin >>b;
cin >>c;
sum=a+b+c;
cout <<"Sum is " <<sum;
return 0;
}
| TOOL | 0.992755 | 3.146551 |
982af357-2065-4b8a-b1a6-8ea98d698668 | GAlekseyV/White-belt | Week_2/vector/average_temperature/main.cpp | #include <iostream>
#include <vector>
using namespace std;
int main() {
int n;
cin >> n;
vector<int> temperatures(n);
int sum = 0;
for (int& temperature : temperatures) {
cin >> temperature;
sum += temperature;
}
int average = sum / n;
vector<int> result_indices;
for (int i = 0; i < n; ++i)... | ALGO | 0.999793 | 4.480452 |
82148efc-1481-4bee-93a0-7bff78f41811 | kniroj-neupane/NumericalMethod | pro/Programs 1/bisectionMethod.cpp | //implementation of bisection
#include <stdio.h>
#include <math.h>
#define f(x) x*x*x-4*x-9
int main()
{
int count;
float x0,x1,f1,f2,ep,er,root,m,fm;
printf("enter two guesses\n");
scanf("%f %f",&x0,&x1);
printf("enter the tolerance\n");
scanf("%f",&ep);
count=1;
begin:
f1=f(x0);
f2=f(x1);
if(f1*f2>0)
... | ALGO | 0.999974 | 4.388764 |
863c468d-b183-42eb-aed3-532e73073f6d | vertoker/cpp-studyfield | library/4-grokking-algorithms/ch06/1-dfs.cpp | #include "../common/graph.hpp"
// DFS - Depth First Search
bool dfsRecursive(const Graph& graph, Graph::Node currentNode, Graph::Node targetNode, std::unordered_set<Graph::Node>& visited, std::vector<Graph::Node>& result)
{
visited.insert(currentNode);
result.emplace_back(currentNode);
if (currentNode == ... | ALGO | 0.999928 | 5.90089 |
3a55cafd-2b62-4392-92ae-54066d1d8e5a | okaryo/CompetitiveProgramming | AtCoder/ARC/001~010/003/B.cpp | #include <bits/stdc++.h>
typedef long long LL;
using namespace std;
int main() {
int n; cin >> n;
vector<string> s(n);
for (int i = 0; i < n; i ++) cin >> s[i];
pair<string, int> p[n];
for (int i = 0; i < n; i ++) {
string t = "";
for (int j = s[i].size() - 1; j >= 0; j --) t += s[i][j];
p[i].fi... | ALGO | 0.999996 | 4.252556 |
bb7866fe-4e85-49f6-9273-3574efdcd503 | arafathosense/Codeforces-Problems-Solution | 1247A Forgetting Things.cpp | //! Bismillahi-Rahamanirahim.
/** ========================================**
** @Author: Md. Abu Farhad ( RUET, CSE'15)
** @Category:
/** ========================================**/
#include<bits/stdc++.h>
#include<stdio.h>
using namespace std;
#define ll long long
#define scl(n) scanf("... | ALGO | 0.999783 | 3.665749 |
9a6541da-d9f4-454b-a6aa-ff46757ad4cd | DAD609/OOP_C | Lab2/RBPO.LAB2.Variant5.Task4.a.cpp | #include <iostream>
module RBPO.LAB2.Variant5.Task4:a;
namespace RBPO {
namespace Lab2 {
namespace Task4 {
double a(int i) {
return (pow(-1, i) * ((i + 1) / (pow(3, i) + (pow(2, i)))));
}
}
}
} | ALGO | 0.999467 | 4.23963 |
a000bcf0-a193-4f20-9aab-7885f97b1010 | muschellij2/FSL6.0.0 | extras/include/boost/libs/graph/test/closeness_centrality.cpp | #include <iostream>
#include <vector>
#include <boost/graph/undirected_graph.hpp>
#include <boost/graph/directed_graph.hpp>
#include <boost/graph/floyd_warshall_shortest.hpp>
#include <boost/graph/closeness_centrality.hpp>
#include <boost/graph/exterior_property.hpp>
#include <boost/graph/property_maps/constant_proper... | ALGO | 0.999112 | 5.639775 |
68c05fb3-d576-4d19-b81d-2263b288e084 | Howie-Ye/DAGS | thirdparty/lietorch/eigen/bench/sparse_product.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.994911 | 4.164869 |
ba458580-e0c3-49cc-82e3-cb2e48178acc | VanTu1208/Advance-C-Cpp-Algorithm-T11 | Lesson18. TEMPLATE/Advance/Expression/main.cpp | #include <iostream>
using namespace std;
// Tạo template Expression cho phép cộng hai số
template <typename T1, typename T2>
class AddExpression {
const T1& lhs; // Biểu thức bên trái
const T2& rhs; // Biểu thức bên phải
public:
// Khởi tạo biểu thức cộng
AddExpression(const T1& l, const T2& r) : lhs... | TOOL | 0.998159 | 5.611012 |
f9e84360-a1c6-479b-8b8b-870d96e10af6 | pranay-dutta/DS_Algo | Array/Easy/Longest Strictly Increasing or Strictly Decreasing Subarray.cpp | // Approach 1: Optimal
// TC: O(n)
// SC: O(1)
class Solution {
public:
int longestMonotonicSubarray(vector<int>& nums) {
int cSI = 1; // current strictly increasing
int cSD = 1; // current strictly decreasing
int maxSI = 1, maxSD = 1;
int n = nums.size();
for (int i = 0; i < n - 1; i++) {
... | ALGO | 0.999653 | 6.336805 |
c5a622ce-07c0-42e4-803f-c44cc0b01f78 | dzcoin/DzCoinMiningAlgorithm | src/merkleblock.cpp | #include "merkleblock.h"
#include "hash.h"
#include "consensus/consensus.h"
#include "utilstrencodings.h"
using namespace std;
cmerkleblock::cmerkleblock(const cblock& block, cbloomfilter& filter)
{
header = block.getblockheader();
vector<bool> vmatch;
vector<uint256> vhashes;
vmatch.reserve(block.... | ALGO | 0.998538 | 5.814033 |
2f84f289-ba74-4731-98ef-6dddb000faeb | NguyenBui256/PTIT | DSA/DSA01008 - XÂU NHỊ PHÂN CÓ K BIT 1.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define FOR(i,a,b) for(int i = a; i < b; i++)
#define FORD(i,a,b) for(int i = a; i > b; i--)
#define fi first
#define se second
int n, k, final = 0;
int a[1005];
void init()
{
FOR(i,1,n+1) a[i] = 0;
}
void sinh()
{
int i = n;
while(a[i] ... | ALGO | 0.999914 | 3.746926 |
e3468926-adbd-42ca-a219-ad6e2c9c740f | lazywzx/proLang | CPP/CH05/Sub4/prac14.cpp | #include <iostream>
#include <string>
#include <vector>
using std::cin;
using std::cout;
using std::cerr;
using std::endl;
using std::vector;
using std::string;
// ִĵʣûǶ
int main() {
int maxCnt = 1, currentCnt = 1;
string maxWord = "", currentWord = "";
vector<string> svec = {};
cout << "һ鵥" << endl... | ALGO | 0.999919 | 4.087189 |
89bca760-3f41-4e17-925a-c4d8205ee831 | prisect/gravitron | main.cpp | #include <SDL2/SDL.h>
#include <SDL2/SDL_ttf.h>
#include <iostream>
#include <cmath>
#include <vector>
#include <string>
#define WINDOW_SIZE 1600
#define GRAVITY_CONSTANT 6.67430e-2
#define TIME_STEP 0.1
#define TRAIL_LENGTH 100
#define FPS_CAP 60
struct Planet {
double x, y;
double vx, vy;
double mass;
... | ALGO | 0.934538 | 6.474031 |
2f135078-748d-43dd-9d75-b01980936bf2 | kmjp/procon | atcoder/abc301-350/abc339/d.cpp | #include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define FORR2(x,y,arr) for(auto& [x,y]:arr)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define ... | ALGO | 0.999503 | 3.664644 |
8243ce45-d9f1-4d94-a950-c33751cf3009 | VineshRajkumar/dsal | codes/Experiment No-4/Exp4.cpp | #include<iostream>
#include<math.h>
using namespace std;
struct Bstnode
{
int data;
Bstnode *left = NULL;
Bstnode *right = NULL;
};
class Btree
{
int n;
int x;
int flag;
public:
Bstnode * root;
Btree()
{
root = NULL;
}
Bstnode *GetNewNode(int in_data)
{
Bstnode * ptr = new Bstnode();
pt... | ALGO | 0.999547 | 3.596169 |
493a8d9e-a9ec-4537-8aa6-bb3b9ce6210e | hycinth22/algorithm-notes-practices-solutions | 1入门模拟/B1037/B1037.cpp | // B1037.cpp
//
#include <cstdio>
using namespace std;
struct money {
int galleon, sickle, kunt;
public:
bool operator<(const money& rhs) const {
if (this->galleon != rhs.galleon) {
return this->galleon < rhs.galleon;
}
if (this->sickle != rhs.sickle) {
return this->sickle < rhs.sickle;
}
return thi... | ALGO | 0.980545 | 3.872917 |
58d107f8-356d-43b7-94fd-3e502f93e6ef | DangdangBase/BOJ-Code | Solved/Gold/1865.cpp | #include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18;
int T, N, M, W;
int s, e, t;
vector<pair<int, int>> graph[510];
long long dist[510];
bool visited[510];
int main()
{
cin.tie(0);
ios_base::sync_with_stdio(0);
cin >> T;
while(T--){
bool is_cycle = false;
memset... | ALGO | 0.999876 | 5.02802 |
152cd7da-3997-4490-9d88-977074de7b1f | xuan940109/2023aaia3 | week07/week07-1.cpp | //week07-1.cpp
//Leetcode 1275
class Solution {
public:
void myPrintBoard(int board[3][3]){
for(int i=0;i<3;i++){
for(int j=0;j<3;j++){
cout << board[i][j] << " ";
}
cout << "\n";
}
cout << "\n";
}
string tictactoe(vector<vector<int... | ALGO | 0.999866 | 5.94424 |
a9a8ebaa-362c-46e4-aad1-250c3510c90c | jorgehog/cppMD | main.cpp | #include <iostream>
#include <libconfig.h++>
#include <armadillo>
using namespace arma;
using namespace libconfig;
#ifdef USE_MPI
#include <mpi.h>
#endif
#include "cppMD.h"
int main(int argc, char* argv[])
{
srand(time(NULL));
wall_clock timer;
Config cfg;
std::string superPath;
if (argc > 1) ... | ALGO | 0.953031 | 4.775211 |
46874920-3189-45cf-8c14-8f2b37ad5455 | Higherorbit/Leetcode-and-gfg-solutions | 1026-maximum-difference-between-node-and-ancestor/1026-maximum-difference-between-node-and-ancestor.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.999969 | 6.1933 |
10d82c0e-0bd2-4cd8-8666-f6e602c8cd04 | bol-edu/2022-spring-nthu | Lab_B_Vitis_Tutorials/Bloom/src/reference_files/run_single_buffer.cpp | #include <vector>
#include <cstdio>
#include <ctime>
#include "xcl2.hpp"
#include "sizes.h"
#include "common.h"
using namespace std;
using namespace std::chrono;
string kernel_name = "runOnfpga";
const char* kernel_name_charptr = kernel_name.c_str();
unsigned int bloom_filter_size = 1L<<bloom_size;
unsigned int prof... | ALGO | 0.99131 | 5.764851 |
2d996d5f-1c41-4e0d-95a6-998ad47fc0bc | jochongs/codetree-TILs | 240305/문자 제거하기/del-char.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
// 여기에 코드를 작성해주세요.
ios_base :: sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
string inputStr = "";
cin >> inputStr;
while (true) {
int num = 0;
cin >> num;
if (num >= inputStr.length() - 1) {
... | ALGO | 0.999784 | 5.49622 |
b7683170-2f7e-430e-831d-a9db036b418b | templeblock/platform_frameworks_native | cmds/installd/utils.cpp | #include "installd.h"
#include <base/stringprintf.h>
#include <base/logging.h>
#define CACHE_NOISY(x) //x
using android::base::StringPrintf;
/**
* Check that given string is valid filename, and that it attempts no
* parent or child directory traversal.
*/
static bool is_valid_filename(const std::string& name) {
... | TOOL | 0.887901 | 6.392961 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.