uuid stringlengths 36 36 | repo_name stringlengths 5 123 | relative_path stringlengths 5 4k | content stringlengths 33 2.85M | category stringclasses 6
values | algo_rel_score float64 0.85 1 | quality_score float64 3 8.76 |
|---|---|---|---|---|---|---|
9a48ae28-0f61-43f1-91f6-6d44bb1f061c | Nitish252000/LeetCode_Solution | CPP/Lambda Function/Largest Number.cpp | class Solution {
public:
string largestNumber(vector<int>& nums) {
vector<string>vec;
for(auto num:nums){
vec.push_back(to_string(num));
}
sort(vec.begin(),vec.end(),[](string &a,string &b){
return a+b>b+a;
});
if(vec[0]=="0")return "0";
... | ALGO | 0.999974 | 6.333737 |
c547c96d-fea5-44e0-9143-1309ccc5430f | Henok-Demissie/CSEC_CPD | Sereja and Dima.cpp | #include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
int cards[1000];
for (int i = 0; i < n; ++i) {
cin >> cards[i];
}
int sereja_points = 0, dima_points = 0;
int left = 0, right = n - 1;
bool turn_sereja = true; // Sereja starts first
while (left <= ri... | ALGO | 0.999994 | 4.668046 |
b18b9d71-e694-4518-8c5c-0d72650c8049 | arpitutkarsh/CPP | check_ll_pallindrome.cpp | #include<bits/stdc++.h>
using namespace std;
class Node{
public:
int data;
Node* next;
Node(int data){
this->data = data;
this->next = NULL;
}
};
void insertatTail(Node* &tail, int data){
Node* temp = new Node(data);
tail->next = temp;
tail = temp;
}
void print(Node* head... | ALGO | 0.999967 | 5.102601 |
cd9a8b7c-b043-48c8-b9b0-16f82a3359b5 | aaiss0927/Tutoring_DataStructure | 24실습/Week_13/Week_13_1.cpp | #include <iostream>
using namespace std;
bool graph[10001][10001];
int main() {
int T; cin >> T;
bool vertex[10001] = { false, };
while (T--) {
string cmd; cin >> cmd;
if (cmd == "insertVertex") {
int s; cin >> s;
if (vertex[s]) {
cout << "Exist\n... | ALGO | 0.998814 | 4.73382 |
548d10af-3fb4-4054-a39c-6a0acf351af0 | Jaemin0730/BOJ_2023_SS | 03_NumberTheory/6064.cpp | #include <bits/stdc++.h>
using namespace std;
#define u ios::sync_with_stdio(false); cin.tie(NULL);
#define fst first
#define snd second
#define pb push_back
#define mp make_pair
typedef long long ll;
typedef pair<int,int> pii;
int GCD(int a, int b) { // 최대공약수
if (a % b == 0) {
return b;
}
retu... | ALGO | 0.999554 | 3.518843 |
e6c6bfde-49ee-4bab-8db6-85ad3ee9b180 | moonbuck/EssentiaSwift | CommonSource/C++/algorithms/standard/peakdetection.cpp | #include "peakdetection.h"
#include "essentiamath.h"
#include "peak.h"
using namespace essentia;
using namespace standard;
using namespace util; // peak class
const char* PeakDetection::name = "PeakDetection";
const char* PeakDetection::category = "Standard";
const char* PeakDetection::description = DOC("This algorit... | ALGO | 0.999771 | 6.441398 |
c88a4def-154f-4ba2-aa8d-555c749f217a | artium59/algo_study | BOJ/02000~/2965.cpp | #include <bits/stdc++.h>
int main() {
int a, b, c;
scanf("%d %d %d", &a, &b, &c);
printf("%d", std::max(c-b, b-a) - 1);
return 0;
} | ALGO | 0.999904 | 4.005228 |
eba9104e-3834-4317-a292-5895494dd0df | Satzyakiz/CP | Linked List/Flatten_MultiLevel_Linked_List.cpp | // You are given a doubly linked list which in addition to the next and
// previous pointers, it could have a child pointer, which may or may not
// point to a separate doubly linked list. These child lists may have one or
// more children of their own, and so on, to produce a multilevel data structure,
// as shown in ... | ALGO | 0.999687 | 4.42586 |
0acccc3f-d9c0-4e47-b7ad-13581dd156ab | alisaocctoi/VVP | lab1/lab1.1.cpp | // lab1.1.cpp : Этот файл содержит функцию "main". Здесь начинается и заканчивается выполнение программы.
//
#include <iostream>
using namespace std;
int main()
{
int a;
int b;
cin >> a;
cin >> b;
int S;
int P;
S = a * b;
P = 2 * (a + b);
cout << S << endl;
cout << P;
}
// Запуск программы: CTRL+... | ALGO | 0.995447 | 4.457001 |
81609191-57c7-4329-a345-e30513e5d591 | busebd12/InterviewPreparation | LeetCode/C++/General/Medium/DetectSquares/solution.cpp | #include <map>
#include <numeric>
#include <utility>
using namespace std;
/*
Space complexity: O(u) [where u is the total number of unique points]
*/
class DetectSquares
{
private:
//Map each pair of x and y coordinates to how many times the point appears
map<pair<int, int>, int> points;
publ... | ALGO | 0.999362 | 6.095789 |
924bec95-65c8-4c7f-824c-953423eebb56 | LihengGong/computer_graphics | ray_tracing/src/shape.cpp | //
// Created by LihengGong on 10/3/18.
//
// Shape related data structure and method definition
#include <istream>
#include <string>
#include <sstream>
#include <vector>
#include <fstream>
#include <iostream>
#include <Eigen/Core>
#include <Eigen/Dense>
#include <algorithm>
#include "shape.h"
#include "utils.h"
usin... | ALGO | 0.984233 | 3.605403 |
8d13ad94-a379-4756-90d3-12a46b2c1f1f | ishandutta2007/codeforces | andr0901/normal/1200/E.cpp | #pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
#define forn(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
#define ll long long
#define ull unsigned long long
#define ld long double
#define pii pair <int, ... | ALGO | 0.999996 | 4.964353 |
f0d9ecdc-3edf-4193-9587-9023afe5b346 | chandranshh/LeetCodePR | 1121-partition-array-for-maximum-sum/partition-array-for-maximum-sum.cpp | class Solution {
public:
int maxSumAfterPartitioning(vector<int>& nums, int k) {
int n = nums.size();
vector<int> dp(n, -1);
return maxSumHelper(0, nums, k, dp);
}
int maxSumHelper(int startIndex, vector<int>& nums, int partitionSize,
vector<int>& dp) {
... | ALGO | 0.999936 | 6.215405 |
555f8cca-b00f-42f8-8a18-604a56751296 | CHI-YU-SUNG/Self-Balance-Bot-master | 將平衡放在LOOP測試/Self-Balance-Bot-master/libraries/KalmanFilter/Kalman.cpp | #include "Kalman.h"
Kalman::Kalman() {
/* We will set the variables like so, these can also be tuned by the user */
Q_angle = 0.001f;
Q_bias = 0.003f;
R_measure = 0.03f;
angle = 0.0f; // Reset the angle
bias = 0.0f; // Reset bias
P[0][0] = 0.0f; // Since we assume that the bias is 0 and w... | ALGO | 0.984231 | 6.254443 |
978d87db-b39f-4bc8-b426-707a217395bf | raincross7/code-similarity | codes/train_code/problem033/problem033_379.cpp | #include <bits/stdc++.h>
std::vector<int> a(1000);
int main() {
int i, n;
while(std::cin >> n, n != 0) {
for(i=0; i<n; ++i) {
std::cin >> a[i];
}
std::sort(a.begin(), a.begin()+n);
int min = INT_MAX;
for(i=0; i<n-1; ++i) {
min = std::min(... | ALGO | 0.99965 | 3.624712 |
21cc0570-d618-4930-b23c-cfd5fbbf6c6c | sidharthtripathi/striver_sde_sheet | 3. basic recursion/print_something_n_times.cpp | #include <iostream>
#include <cmath>
using namespace std;
void print_hello(int n ){
if(n==0) return;
print_hello(n-1);
cout<<"hello"<<endl;
}
int main(){
int n; cin>>n;
print_hello(n);
} | ALGO | 0.998832 | 3.28773 |
1484b30e-5fe1-48ba-8b22-76c7921c5d5c | mangos/mangos-svn | tags/0.7/src/shared/Util.cpp | #include "Util.h"
#include "Network/socket_include.h"
using namespace std;
vector<string> StrSplit(const string &src, const string &sep)
{
vector<string> r;
string s;
for (string::const_iterator i = src.begin(); i != src.end(); i++)
{
if (sep.find(*i) != string::npos)
{
if... | TOOL | 0.961734 | 5.467549 |
7bfa89f0-0962-43f1-9ad7-805859234772 | bozhidarv/dsa-practice | main.cpp | /*#include "iterators/iterators.cpp"*/
/*#include "sorts/sorts.cpp"*/
#include "practice8/practice8.cpp"
#include <iostream>
#include <ostream>
void inorderTraversal(TreeNode *root) {
if (root != nullptr) {
inorderTraversal(root->left);
std::cout << root->val << " ";
inorderTraversal(root->right);
}
}
... | ALGO | 0.999721 | 5.485931 |
159365de-98a1-4378-9203-11d60b8dc847 | tamofplease/atcoder_abc | abc099/b/main.cpp | #include <bits/stdc++.h>
using namespace std;
#include <atcoder/all>
using namespace atcoder;
typedef long long ll;
#define rep(i,n) for(int i=0;i<n;i++)
#define Rep(i,n) for(int i=1;i<=n;i++)
#define ALL(v) v.begin(), v.end()
const ll MOD = 1000000007;
int main(){
int a, b; cin >> a >> b;
int diff = b-a;
... | ALGO | 0.999813 | 3.828089 |
7157957d-ad37-4439-b56a-b85777279bb9 | hwsel/HybridTEE | darknet_SGX/Enclave/aes_TA.cpp | /*
This is an implementation of the AES algorithm, specifically ECB, CTR and CBC mode.
Block size can be chosen in aes.h - available choices are AES128, AES192, AES256.
The implementation is verified against the test vectors in:
National Institute of Standards and Technology Special Publication 800-38A 2001 ED
ECB... | ALGO | 0.993599 | 5.850539 |
460ad566-36af-47da-9c1e-832fab92334a | dev-michael-schmidt/n-queens | main.cpp | #include "globals.h"
#include "queens_base.h"
#include "greedy_local.h"
#include "depth_first.h"
#include "genetic.h"
#include <chrono>
int main(int argc, char* argv[]) {
//assert(argc == 3 && "supply SEED and N");
srand(atoi(argv[1]));
int N = atoi(argv[2]);
QueensBase* depth_first = new DepthFirstSearch(N);
... | ALGO | 0.999732 | 3.775044 |
0a42fa11-b7c7-40b8-a07b-76d645778129 | shivam1253/gfg-problem-of-the-day-solutions | Difficulty: Easy/Kth distance/kth-distance.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// User function template for C++
class Solution {
public:
bool checkDuplicatesWithinK(vector<int>& arr, int k) {
// your code
unordered_map<int,int> mp;
for(int i=0;i<arr.size();i++){
... | ALGO | 0.999259 | 5.936182 |
71654aab-c530-4535-aa7b-0b9e5e81cc1e | luizmgon/TPs-ROB305-Programmation-multitaches-OS-temps-reel | TD3/TD3a/td3a3.cpp | #include <pthread.h>
#include <iostream>
struct Data
{
volatile bool stop;
volatile double counter;
pthread_mutex_t mutex;
};
void *incrementer(void *v_data)
{
Data *p_data = (Data *)v_data;
while (not p_data->stop)
{
pthread_mutex_lock(&p_data->mutex);
p_data->counter += 1.0;
... | ALGO | 0.943055 | 5.194364 |
6ea46406-59e8-40a9-ac29-a7115d1a21f2 | tedba742/AOC18 | day1/day1part1.cpp | #include <string>
#include <iostream>
#include <fstream>
#include <sstream>
#include <unordered_set>
#include <vector>
bool hasDuplicate(const std::vector<int>& data) {
std::unordered_set<int> seen;
for (int num : data) {
if (seen.find(num) != seen.end()) {
return true;
}
... | ALGO | 0.99999 | 5.599616 |
4b441f25-3649-4852-b7c0-463368c60d05 | ishandutta2007/codeforces | duality/normal/1466/C.cpp | #define DEBUG 0
#include <bits/stdc++.h>
using namespace std;
#if DEBUG
// basic debugging macros
int __i__,__j__;
#define printLine(l) for(__i__=0;__i__<l;__i__++){cout<<"-";}cout<<endl
#define printLine2(l,c) for(__i__=0;__i__<l;__i__++){cout<<c;}cout<<endl
#define printVar(n) cout<<#n<<": "<<n<<endl
#define printA... | ALGO | 0.999985 | 3.92761 |
9bff0313-907f-463e-9e45-d4f518f7c418 | edisonhello/OnlineJudge | CodeForces/665b.cpp | #include <bits/stdc++.h>
using namespace std;
const int maxn = 100 + 10;
int p[maxn];
int main() {
ios_base::sync_with_stdio(false); cin.tie(0);
int n, m, k; cin >> n >> m >> k;
for (int i = 1; i <= k; ++i) cin >> p[i];
int ans = 0;
while (n--) {
for (int j = 0; j < m; ++j) {
i... | ALGO | 0.999932 | 3.23482 |
b4eab14b-885a-41da-9211-58bb2a7a2e4f | Longbeso/DSA | 1_sap_xep/merge.cpp | #include<iostream>
using namespace std;
// chia để trị
#define N 10
void merge(int arr[], int left, int mid, int right){ // hàm trộn 2 mảng
int n1 = mid - left + 1;
int n2 = right - mid;
int L[n1], R[n2];
for(int i = 0; i < n1; i++){ // copy vào mảng trái
L[i] = arr[left + i];
}
... | ALGO | 0.999964 | 4.125534 |
91473f88-e9d4-4bba-acb3-e6b402b8a428 | thanh-nguyen03/CPP-Code | DSA/CodePTIT/CodePTIT-DSA-Sophomore/DSA01004_SINH_TO_HOP.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double db;
const long long mod = 1e9 + 7;
#define faster() ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define pb push_back
#define all(x) x.begin(), x.end()
#define vi vector<int>
#define vll vector<ll>
#define tester() int t;... | ALGO | 0.999874 | 3.853165 |
101312eb-caea-4d00-bbb9-db16043e894f | Ritik2703/Apni-Pathshala- | queue/07. priority queue using stl.cpp |
/*
hare krishna hare krishna krishna krishna hare hare
hare rama hare rama rama rama hare
*/
#include<bits/stdc++.h>
using namespace std;
int n,op;
void maxheap()
{
do{
cout<<"choose the option\n";
cout<<"1. push in queue\n";
cout<<"2. pop from queue\n";
cout<<"3. top in queue\n";
cout<<"4. size o... | ALGO | 0.971895 | 3.42612 |
0b35dd9f-fd71-48d7-97b6-a77464eaadc8 | AlJalTtakKalSen/AlJalTtakKalSen | SooYeon/231127_week/Programmers_42889_실패율.cpp | #include <bits/stdc++.h>
using namespace std;
int total_people = 0;
bool compare(pair<int, double> a, pair<int, double> b) {
if(a.second == b.second) return a.first < b.first;
return a.second > b.second;
};
vector<int> solution(int N, vector<int> stages) {
vector<int> answer;
vector<pair<int, double>>... | ALGO | 0.999988 | 4.263763 |
f31f1e4b-c467-4799-9c1b-c028738b9880 | mohitpunyani/Leetcode-and-gfg | Sum of Middle Elements of two sorted arrays - GFG/sum-of-middle-elements-of-two-sorted-arrays.cpp | //{ Driver Code Starts
//Initial template for C++
#include <bits/stdc++.h>
#include <unordered_map>
using namespace std;
// } Driver Code Ends
//User function template for C++
class Solution {
public:
int findMidSum(int ar1[], int ar2[], int n)
{
// code here
// 1. appro... | ALGO | 0.999994 | 5.93262 |
153d850d-6206-4228-becf-45d25c3dd53e | iamsiamhossen/XPSC-SOLVE | Week 15/Day 6/B_Sum_of_Modes.cpp | // #include <bits/stdc++.h>
// #define int long long
// using namespace std;
// signed main() {
// // your code goes here
// int t; cin >> t;
// while (t--) {
// int n; cin >> n;
// string s; cin >> s;
// int curr = 0;
// map <int, int> v;
// v[0]++;
// int ans = n * (n + 1) / 2;
... | ALGO | 0.99998 | 5.989503 |
21b5d9a4-a616-4efe-b3ca-4fd8464f1aa2 | ishandutta2007/codeforces | rui_er/normal/1476/A.cpp | //By: Luogu@rui_er(122461)
#include <bits/stdc++.h>
#define loop while(true)
#define rep(x,y,z) for(ll x=y;x<=z;x++)
#define per(x,y,z) for(ll x=y;x>=z;x--)
#define fil(x,y) memset(x, y, sizeof(x))
#define mulT0 ll T; for(scanf("%lld", &T);T;T--)
#define mulT1 ll T, rnds; for(scanf("%lld", &T),rnds=1;rnds<=T;rnds++)
us... | ALGO | 0.999689 | 3.665421 |
71c115f2-1d77-4ec5-81cf-8b1247d743af | linhenry2004/CP_Solutions | CSES Solutions/Range Queries/List_Removals.cpp | #include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 1;
int bit[maxn], s[maxn];
void update(int p, int x) {
for (; p < maxn; p += p & -p) {
bit[p] += x;
}
}
int find (int x) {
int sum = 0, p = 0;
for (int i = 17; i >= 0; i--) {
if (p + (1 << i) < maxn && sum + bit[p + ... | ALGO | 0.999989 | 3.717791 |
40684fc3-7438-4dfb-9a54-20825c44e219 | mirzan7/dsa- | intersection.cpp | #include<iostream>
#include<vector>
using namespace std;
vector<int> intersection(vector<int> arr1,vector<int> arr2)
{
vector<int> arr3;
for(int i=0;i<arr1.size();i++)
{
for(int j=0;j<arr2.size();j++)
{
if(arr2[j]==arr1[i])
{
arr2[j]=-1;
... | ALGO | 0.999608 | 4.398009 |
d180a560-e337-44b7-8ce5-e6dfe234da79 | mobernabeu/ScientificComputingMATLAB | monodomain_solver_handout_session_three/luo_rudy_1991_time_deriv_mex_adaptor.cpp | #include "mex.h"
#include "luo_rudy_1991_c_implementation.h"
void mexFunction( int nlhs, mxArray *plhs[],
int nrhs, const mxArray*prhs[] )
{
double time;
double *previousSolution;
double stimulusCurrent;
mwSize m, n;
double *computedTimeDerivative;
// Check for proper number of... | ALGO | 0.999872 | 5.955927 |
b577d02b-feda-4d07-962f-f80c0a21f40e | masumbillah06/Mini_Codes | GCD_and_LCM.cpp | #include<bits/stdc++.h> // based on euclidean algorithm.
using namespace std;
int main()
{
int a, b;
while (cin >> a >> b)
{
int n1 = a, n2 = b;
if(a==0 && b==0) break;
if(a<b) swap(a,b);
int rem=1;
if(a%b==0){
cout << "GCD is: " << b << endl;
... | ALGO | 0.999711 | 4.235582 |
09c61683-71b0-463d-9c6d-7c8578b1c32f | Robin-Dillen/MB | src/CFG.cpp | //
// Created by niels on 12/10/2021.
//
#include "CFG.h"
#include "json/json.hpp"
#include <list>
#include <iostream>
#include <fstream>
#include <algorithm>
using json = nlohmann::json;
using namespace std;
//constructor
CFG::CFG(string jsonfile) {
ifstream input(jsonfile);
if (jsonfile.empty()) return;
... | ALGO | 0.947732 | 3.509439 |
9b36d2eb-8af2-4ff7-a644-4f6db6b84ba7 | ermine27/competitive-programming | src/atcoder/past-01-201912/past-01-d.cpp | #include <bits/stdc++.h>
using namespace std;
// clang-format off
#define _overload2(a,b,f,...) f
#define _overload3(a,b,c,f,...) f
#define _rep1(i,n) for(int i = 0; i < (int)(n); ++i)
#define _rep2(i,s,n) for(int i = (int)(s); i < (int)(n); ++i)
#define rep(...) _overload3(__VA_ARGS__, _rep2, _rep1)(__VA_ARGS__)
#def... | ALGO | 0.999497 | 4.387911 |
70d9b03c-e0fd-4b13-9521-18fa3a4f3376 | ishandutta2007/codeforces | jklepec/normal/555/B.cpp | #include <algorithm>
#include <iostream>
#include <vector>
#include <set>
#define x first
#define y second
using namespace std;
typedef long long ll;
typedef pair<ll, ll> point;
const int MaxN = 200100;
struct raz {
ll x, y;
int index;
raz (ll x, ll y, int index) : x(x), y(y), index(index) {};
inline... | ALGO | 0.999999 | 3.692385 |
d2df079c-f167-44b8-b693-26d2f9301c2a | SehajMander/dsa_with_cpp | While loop/reverseTrianglePattern_5.cpp | #include <iostream>
using namespace std;
int main()
{
int n;
cout<<"Enter the value of n(rows) : ";
cin>>n;
int i = 1;
while(i<=n){
int space = n - i;
while(space>0){
cout<<" ";
space = space-1;
}
int j = 1;
while(j<=i){... | ALGO | 0.999287 | 3.902552 |
e6d29fd9-f95b-437c-bd45-59b3cf5e4959 | Fanfik235/laboratory_work_01.09-31.10 | Лаб №9/№3_d.cpp | #include <iostream>
using namespace std;
int** create2DArray(int rows, int cols){
int **array = new int* [rows];
for (int i = 0; i < rows; i++)
{
array[i] = new int [cols];
}
return array;
}
void delete2DArray(int **matrix, int rows, int cols){
for (int i = 0; i < rows; i++)
{
... | ALGO | 0.992499 | 3.671675 |
4bcf4e71-ade4-4987-8a71-f947354d8c49 | KimmiGYH/LeetCode_Notes_Public | Solutions_0001-1000/0143_Reorder List_重排链表/cpp_2_使用快慢指针找中点_v1_自己写的.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* findMid(Lis... | ALGO | 0.999987 | 5.889679 |
ba44777d-58d1-48da-9421-0c386565bec4 | codexvn/lanqiao | ALGO-16/main.cpp | #include <iostream>
#include<vector>
#include <cstdlib>
#include<cmath>
using namespace std;
int main() {
int data=30000,base=-2;
cin>>data>>base;
int data_bak=data;
vector<int>bit;
while(data!=0){
int inset=data%base;
if(inset<0){
inset-=base;
data+=base;
}
bit.push_back(inset);
data/=base;
}
co... | ALGO | 0.99866 | 3.534478 |
6c476e3b-6f48-47db-8c28-54d2d425062e | priya0498/Leetcode | 876-middle-of-the-linked-list/876-middle-of-the-linked-list.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* middleNode(... | ALGO | 0.999867 | 5.708048 |
3eb59242-82ee-4a73-872e-56ddf7d794a1 | eudisd/huffman | co.cpp | // Implementation file for Co class (Compression)
#include "co.h"
namespace huffman
{
Co::Co(const char *i, const char *o) :
head(NULL), iname(i), oname(o),
fsize(0)
{
for(int j = 0; j < MAX ; j++){
NodePtr tmp = new Node; // Here I allocate 256 nodes from heap
table[j] = 0; // Initialize ... | ALGO | 0.998533 | 5.184394 |
78384fcb-a348-4902-bb48-7aa5693c62a8 | shuvokr/LightOj | Light OJ/loj try/1028.cpp | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <ctype.h>
#include <string>
#include <iostream>
#include <sstream>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <list>
#include <map>
using namespace std;
#define sf scanf
#define pf printf
void... | ALGO | 0.999367 | 4.081472 |
773823c5-2f90-4564-bb45-e6ccefa33c56 | upupming/algorithm | leetcode/contest-250/5814. Add Minimum Number of Rungs.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution {
public:
int addRungs(vector<int>& rungs, int dist) {
int ans = 0;
rungs.insert(rungs.begin(), 0);
for (int i = 0; i + 1 < rungs.size(); i++) {
ans += (rungs[i + 1] - rungs[i] - 1) / dist;
}
return a... | ALGO | 0.998597 | 3.710981 |
70bdcd59-c82f-40ba-afe6-140cc2fddf44 | 0point1Zishan/CP | Contests/LeetCode/Weekly Contest 443/3504. Longest Palindrome After Substring Concatenation II.cpp | class Solution {
private:
bool isPalin(string& s, int l, int r){
while(l < r){
if(s[l] != s[r]) return false;
l++;
r--;
}
return true;
}
void longestPalin(string& s, vector<int>& v){
int n = s.siz... | ALGO | 0.999996 | 6.475278 |
4bb4c6bf-6a6d-4385-89f6-c45485b59a72 | rootid/fft | 2-pointer/intersection-II.cpp | //Intersection of Two Arrays II
//Given two arrays, write a function to compute their intersection.
//Example:
//Given nums1 = [1, 2, 2, 1], nums2 = [2, 2], return [2, 2].
//Note:
// Each element in the result should appear as many times as it shows in both arrays.
// The result can be in any order.
//Follow up:
... | ALGO | 0.99978 | 5.755116 |
982051d1-d179-4fb6-99fc-2cdfafb1a194 | sarvex/leetcode-zig | lcof2/剑指 Offer II 106. 二分图/Solution.cpp | class Solution {
public:
vector<int> p;
bool isBipartite(vector<vector<int>>& graph) {
int n = graph.size();
p.resize(n);
for (int i = 0; i < n; ++i) p[i] = i;
for (int u = 0; u < n; ++u) {
auto& g = graph[u];
for (int v : g) {
if (find(u)... | ALGO | 0.999917 | 6.239939 |
3f7c4e0c-830c-4c74-8e98-02ca40082b8f | ltimaginea/Cpp-Primer | CppPrimer/Content/Ch11_AssociativeContainers/Ch11_set_00.cpp | #include <iostream>
#include <set>
#include <string>
#include <vector>
#include <utility>
using namespace std;
int main()
{
set<string> exclude = { "The","But","And","Or","An","A","the","but","and","or","an","a" };
auto it = exclude.begin();
cout << *it << endl;
//*it = "AAA"; // 错误!set关键字是 const 的
exclude.er... | ALGO | 0.995298 | 4.831349 |
d20e8c6a-94d6-416d-8564-3c4c092df00e | vil02/BFMachines | cpp/examples/memory_types_performance_comparison/memory_types_performance_comparison.cpp | //this file compares the performance of different unbounded bfm::memory_types
//the bf code used for the benchmark, factorial computation, is "dense" in the memory usage
#include "../../BFMachineLib/BFMachineLib.hpp"
#include <chrono>
#include <iostream>
#include <map>
#include <string_view>
#include <unordered_map>
... | TOOL | 0.888557 | 5.969104 |
62fdd4bd-fa23-44cb-9606-68727f640840 | LuvKobe/StudyCode-2023 | Code_02_18/bitset11.cpp | #define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
#include <vector>
using namespace std;
// Nλλͼ
template<size_t N>
class BitSet
{
public:
// 캯
BitSet()
{
// +1֤㹻ıλ˷8
_bits.resize(N / 8 + 1, 0);
}
// ָλxӳλdz1
void set(size_t x)
{
// xӳıλڵڼchar
size_t i = x / 8;
// xcharڼλ
size_t j = x % 8;
... | ALGO | 0.995027 | 4.922147 |
94efc466-8c94-4fb0-9a48-5a9a7fa72196 | Akshit1482/Practise | 276.cpp | class Solution{
public:
bool isSafe( int newx, int newy, vector<vector<bool>>& vis, vector<vector<int>>& m, int n)
{
if(( newx >= 0 && newx < n ) && ( newy >= 0 && newy < n ) && vis[newx][newy] != 1 &&
m[newx][newy] == 1 ){
return true;
}
else{
... | ALGO | 0.999963 | 5.721739 |
6cfe3ed2-a59a-47e2-9b91-c65d1302d8eb | oosquare/OI-Codes | Storage/HDU/3693-Math teacher's homework.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
constexpr int maxn = 50 + 10;
constexpr int mod = 1e9 + 3;
int n;
ll k, m[maxn], f[maxn][maxn][2], power[maxn];
bool get(int x, int p) {
return 1 & (x >> p);
}
ll DP(int id, int val, int len) {
val &= (~((1 << len) - 1));
if (id == n +... | ALGO | 0.999901 | 4.410787 |
8dffd881-8458-485b-83d1-f9ef609d328b | protectors/ACM | HDUOJ/HDU2016-数据的交换输出.cpp | #include <iostream>
#include <cstdio>
#include <algorithm>
using namespace std;
int main()
{
int minn,a[101],n,t,i,temp;
while(cin>>n&&n)
{
minn=999999;
for(i=0;i<n;i++)
{
cin>>a[i];
if(minn>a[i])
{
minn=a[i];
t=i;
... | ALGO | 0.999889 | 3.079156 |
a614b615-cd18-4e77-b50a-b243ec33a5fe | akihikoy/ay_test | opencv/cpp/calib_stereo_fs.cpp | // From OpenCV sample.
// g++ -g -Wall -O2 -o calib_stereo_fs.out calib_stereo_fs.cpp -I$HOME/.local/include -L$HOME/.local/lib -Wl,-rpath=$HOME/.local/lib -lopencv_core -lopencv_calib3d -lopencv_features2d -lopencv_imgproc -lopencv_imgcodecs -lopencv_highgui -I/usr/include/opencv4
// cd data/usbcam4g1_tltr1 && ../../c... | TOOL | 0.935398 | 6.064808 |
c06ae570-9315-4ff7-b189-9a306e1f8daa | DucPhamH/Thuat_toan_ung_dung | De_Thi/20221/B1.cpp | // input 6 3 9
// 3 2 4 3 2 1
// output 3
// #include <bits/stdc++.h>
// using namespace std;
// const int MAXN = 1000005;
// int n, k, m;
// int a[MAXN], res = 0;
// int main(){
// ios_base::sync_with_stdio(false);
// cin.tie(0); cout.tie(0);
// cin >> n >> k >> m;
// for(int i = 0; i < n; i++)... | ALGO | 0.999993 | 5.602505 |
57dd4653-ca2f-47b1-97de-485fca09f0dd | md5red/MD5reducedSISD | Main.cpp | #include "Main.h"
#include <iostream>
#include <csignal>
#include <boost/format.hpp>
#include <boost/program_options.hpp>
#include "MD5.h"
#include "Charset.h"
#include "Package.h"
#include "Stats.h"
#include "Plain.h"
#include "Bruter.h"
using namespace std;
void sigHandler(int sig)
{
// Stop.
CBruter::Abort();
}
... | TOOL | 0.919569 | 5.53921 |
8dee71eb-593a-46d6-a98f-4bed59bdd104 | ethz-asl/aslam_optimizer | aslam_backend_expressions/src/TransformationExpressionNode.cpp | #include <aslam/backend/TransformationExpressionNode.hpp>
#include <sm/kinematics/transformations.hpp>
#include <aslam/backend/EuclideanExpression.hpp>
#include <aslam/backend/EuclideanExpressionNode.hpp>
#include <aslam/backend/ExpressionNodeVisitor.hpp>
#include <aslam/backend/RotationExpression.hpp>
#include <aslam/... | TOOL | 0.858151 | 7.085218 |
70e8724d-bdd9-4616-af6f-79dab8169088 | Luckitas1986/FaceDetection | 3rdparty/openexr/IlmImf/ImfEnvmap.cpp | //-----------------------------------------------------------------------------
//
// Environment maps
//
//-----------------------------------------------------------------------------
#include <ImfEnvmap.h>
#include "ImathFun.h"
#include <algorithm>
#include <math.h>
using namespace std;
using namespace Imath;
nam... | ALGO | 0.941029 | 6.965724 |
d21b019d-e8d6-4928-9390-3b820b304948 | sarvex/leetcode-machine | solution/1400-1499/1443.Minimum Time to Collect All Apples in a Tree/Solution.cpp | class Solution {
public:
int minTime(int n, vector<vector<int>>& edges, vector<bool>& hasApple) {
vector<bool> vis(n);
vector<vector<int>> g(n);
for (auto& e : edges) {
int u = e[0], v = e[1];
g[u].push_back(v);
g[v].push_back(u);
}
return ... | ALGO | 0.999947 | 5.822071 |
94a0048e-1e72-4443-aa1b-4a0421f7d99c | tr1ten/DNA | F_Dividing_Game.cpp | #include <cstdio>
#include <bits/stdc++.h>
using namespace std;
#include "ext/pb_ds/assoc_container.hpp"
#include "ext/pb_ds/tree_policy.hpp"
using namespace __gnu_pbds;
template<class T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update> ;
template<typename T>
using order... | ALGO | 0.99971 | 4.822616 |
340e4d49-69d9-4e75-9302-60c87e77d8db | oheong/It-s_eong_time | 15651 N과 M(3)/15651 N과 M(3)/소스.cpp | #include <stdio.h>
int N, M;
int arr[8];
void dfs(int d) {
if (d == M) {
for (int i = 0; i < M; i++)printf("%d ", arr[i]);
printf("\n");
return;
}
for (int i = 0; i < N; i++) {
arr[d] = i + 1;
dfs(d + 1);
}
}
int main() {
scanf("%d %d", &N, &M);
dfs(0);
return 0;
} | ALGO | 0.9999 | 3.778105 |
68140002-0bcf-42c6-a52c-df905c3c7080 | ishandutta2007/codeforces | thenymphsofdelphi/normal/1328/A.cpp | #include<bits/stdc++.h>
using namespace std;
// Optimization
//#pragma GCC optimize("O3")
#define endl '\n'
// Shortcut
#define int long long
#define eb emplace_back
#define pb push_back
#define pob pop_back
#define mp make_pair
#define upb upper_bound
#define lwb lower_bound
#define fi first
#define se second
#def... | ALGO | 0.999889 | 4.202659 |
b2597044-9cec-4443-860d-93c91b9066e7 | R0LEX7/DSA- | Linked List/CircularLinkedList.cpp | #include<iostream>
#include<map>
using namespace std;
class Node{
public:
int data;
Node* next;
Node(int data){
this->data = data;
this->next = NULL;
}
};
void print(Node* tail){
// if list is empty
if(tail == NULL){
cout <<"Empty list" << endl;
}else ... | ALGO | 0.999913 | 4.644792 |
254d6b0c-0fcc-4c55-b6a0-8a4e1fafb98e | AinialJing/cPlusPlusPrimerPlus | chapter7/pointerOfFunction.cpp | //函数指针:1、首先是一个指针;2、该指针指向一个函数;
//函数指针的定义类型:returnType (*pointName)(param1,param2....)
//函数指针的*pointName一定要加"()"
//returnType *pointName(param1,param2); 如果不加"()",则该函数的含义:返回值为returnType的指针
//优先级:()的优先级大于*
#include <iostream>
using namespace std;
double calculate(double width,double height);
void displayCalculate(double,... | TOOL | 0.977793 | 3.363263 |
bd437ea8-ded6-42c6-9c59-d21b02290202 | KildMAN2/Project-A | include/other_stuff/utter_trash/PayloadTwoDemo.cpp | /* Author: Mark Moll (adapted for 4 drones) */
#include <ompl/control/planners/rrt/RRT.h>
#include <ompl/control/planners/kpiece/KPIECE1.h>
#include <omplapp/config.h>
#include <ompl/base/spaces/SE3StateSpace.h>
#include <iostream>
#include <fstream>
#include <filesystem>
#include "PayloadTwoDrones.h"
using namespac... | ALGO | 0.996772 | 6.054184 |
c10e5f08-768a-4813-8128-91e732804052 | metoo10987/OpenNT-4.5 | nt/private/windows/win4help/compiler/common/common.cpp | #include "stdafx.h"
#pragma hdrstop
#ifndef _COMMON_H
#include "..\common\common.h"
#endif
#ifndef _INC_CTYPE
#include <ctype.h>
#endif
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/***************************************************************************
FUNCTION: stristr
PURPOS... | TOOL | 0.894817 | 4.263925 |
0d3f79e9-f2df-4087-9327-c821001e7778 | liuxueyang/cpp | codeforces/problemset/1742d.cpp | // Date: Sun Aug 20 22:36:11 2023
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include ... | ALGO | 0.999761 | 4.236832 |
dd5e011d-2ac2-48ac-bc27-7f25e00dfdf6 | amlatyrngom/SQLIR | llvm/tools/llvm-exegesis/lib/SchedClassResolution.cpp | #include "SchedClassResolution.h"
#include "BenchmarkResult.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/MC/MCAsmInfo.h"
#include "llvm/Support/FormatVariadic.h"
#include <limits>
#include <unordered_set>
#include <vector>
namespace llvm {
namespace exegesis {
// Return the non-redundant list of WriteProcRes use... | TOOL | 0.877133 | 6.336849 |
c69efcf0-bea3-40b1-b649-a050a4352a69 | bayren37/beakJoonCodePlus | WEEK_11_STRING_PROCESSING/LSW/1100.cpp | // 하얀 칸
#include <string>
#include <iostream>
using namespace std;
int main(void) {
bool isWhite = true;
string tmp;
int count = 0;
for (int i = 0; i < 8; i++) {
cin >> tmp;
for (char ch : tmp) {
if (!isWhite) {
isWhite = true;
continue;
}
else if (isWhite) {
isWhite = false;
if (c... | ALGO | 0.997448 | 3.801013 |
2a4bb0d9-bd7a-4738-aecd-f686e53a9b43 | ajayyadavcstech/Leetcode-questions | 659-split-array-into-consecutive-subsequences/659-split-array-into-consecutive-subsequences.cpp | class Solution {
public:
bool isPossible(vector<int>& nums) {
unordered_map<int,int> mp;
for(auto x : nums) mp[x]++;
unordered_map<int,int> ending;
for(int i=0;i<nums.size();i++){
if(mp[nums[i]]==0) continue;
else if(ending[nums[i]-1]>0){
mp[nu... | ALGO | 0.999994 | 5.469559 |
d6618234-646e-4dd6-971c-206cb36e0ae4 | Marcux777/Programacao_Competitiva | AtCoder/AtCoder Beginner Contest 066/B.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define IOS \
ios_base::sync_with_stdio(false); \
cin.tie(0)
#define pb push_back
#define all(v) v.begin(), v.end()
#define f first
#define s second
#define Unique(v) \
sort(all(v)); \
v.erase(unique(all(v)),... | ALGO | 0.999508 | 4.450413 |
3ab53e7e-3db2-4899-89f6-f28a3634368b | emrahuzucar355/Uzucar- | libcudacxx/libcxx/test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan_op.pass.cpp | // <numeric>
// UNSUPPORTED: c++98, c++03, c++11, c++14
// template<class InputIterator, class OutputIterator, class T, class BinaryOperation>
// OutputIterator
// inclusive_scan(InputIterator first, InputIterator last,
// OutputIterator result,
// BinaryOperation binary_o... | TEST | 0.964179 | 7.289467 |
c94d8a36-00d0-4781-a88e-2bf14a123f58 | 43215-Anuj/data- | Bubble.cpp | //BUBBLE SORT
template <class T>
void bubbleSort(T a[], int n)
{
T t;
for(int i=0;i<n;i++)
{
for(int j=0;j<n-i-1;j++)
{
if(a[j]<a[j+1])
{
t=a[j];
a[j]=a[j+1];
a[j+1]=t;
}
}
}
}
| ALGO | 0.999077 | 4.274388 |
d548cc6c-0445-4287-8301-3d9dcb4f33d1 | tolribeiro/cplusplus-playground | c++/strings/ctci1-3.cpp | #include<iostream>
using namespace std;
// T: O(n) / S: O(1)
void urlify(string &str, int len) {
int countSpaces = 0;
for (int i = 0; i < len; ++i) {
if (str[i] == ' ') {
++countSpaces;
}
}
int backIndex = len + countSpaces * 2;
backIndex--;
for (int i = len - 1; i ... | TOOL | 0.998973 | 4.835308 |
9c7016af-621f-4811-8421-ed48c65b5f2e | raincross7/code-similarity | codes/train_code/problem385/problem385_484.cpp | #include <bits/stdc++.h>
typedef long long lint;
using namespace std;
#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
int main() {
int n; cin >> n;
vector<int> b(n);
rep(i,n-1) cin >> b[i];
b[n-1] = 0;
int ans = 0;
rep(i,max(n-2,1)) {
ans += min(b[i], b[i+1]);
}
ans +... | ALGO | 0.999922 | 3.393552 |
e7242f8d-94e1-4f09-af3c-13f434057529 | bitcoinanatomy/bitcoinanatomy | src/codebase/bitcoin-0.14.2 Github/src/script/sign.cpp | #include "script/sign.h"
#include "key.h"
#include "keystore.h"
#include "policy/policy.h"
#include "primitives/transaction.h"
#include "script/standard.h"
#include "uint256.h"
#include <boost/foreach.hpp>
using namespace std;
typedef std::vector<unsigned char> valtype;
TransactionSignatureCreator::TransactionSign... | ALGO | 0.936724 | 6.495155 |
03754cc7-b5a7-4631-b5dc-f2c4147d74c6 | DiogoCostaPT/FLUXOS_cpp | src/fluxos/solver_wetdomain.cpp | #include <iostream>
#include <armadillo>
#include <memory>
#include "GlobVar.h"
#include "solver_wetdomain.h"
void solver_wet(
GlobVar& ds,
unsigned int irow,
unsigned int icol){
unsigned int iw,ie, is,in,inn, NROWSl, NCOLSl,dx,dy;
double fe1,fe2,fe3,fn1,fn2,fn3,zw,zp,ze,zs,
zn,znn,hw,... | ALGO | 0.999559 | 4.135893 |
3d405c98-0c4f-4576-a97d-877d79d1414f | PixelExperience-Devices/device_xiaomi_laurel_sprout | gps/utils/LocHeap.cpp | #include <LocHeap.h>
class LocHeapNode {
friend class LocHeap;
// size of of the subtree, excluding self, 1 if no subtree
int mSize;
LocHeapNode* mLeft;
LocHeapNode* mRight;
LocRankable* mData;
public:
inline LocHeapNode(LocRankable& data) :
mSize(1), mLeft(NULL), mRight(NULL), mDa... | ALGO | 0.997679 | 6.439088 |
fcb4bedb-7027-47a9-9990-ba3bb0c76f6b | Javran/leetcode | src/SortList.cpp | #include <cstdlib>
#include <utility>
#ifdef NOT_OJ
struct ListNode {
int val;
ListNode *next;
ListNode(int x) : val(x), next(NULL) {}
};
#endif
class Solution {
public:
// "p = forward( p )" is almost the same as
// "p = p->next" except when "p == NULL"
// it returns "NULL" instead of crash... | ALGO | 0.999989 | 5.72308 |
cb885510-f176-4da7-8adf-3f18f0ce8c1d | nickwang333/Leetcode | LC 3097. Shortest Subarray With OR at Least K II.cpp | class Solution {
public:
int minimumSubarrayLength(vector<int>& nums, int k) {
int prev = 0, n = nums.size(), ret = INT_MAX, total = 0;
vector<int> digit(32, 0);
for(int i=0; i<n; i++){
total |= nums[i];
int tmp = nums[i], counter = 0;
if(nums[i] >= k){
... | ALGO | 0.999957 | 6.007852 |
9dd1b449-48d5-4ecb-bd12-d37ceec2a149 | trinhhe/SMGP | libigl/include/igl/linprog.cpp | //#define IGL_LINPROG_VERBOSE
IGL_INLINE bool igl::linprog(
const Eigen::VectorXd & c,
const Eigen::MatrixXd & _A,
const Eigen::VectorXd & b,
const int k,
Eigen::VectorXd & x)
{
// This is a very literal translation of
// http://www.mathworks.com/matlabcentral/fileexchange/2166-introduction-to-linear-alge... | ALGO | 0.999682 | 6.239298 |
04caa830-bc8a-435d-8d75-70f60830e9b7 | Ahad-Rajput/C--Classes-Inheritance-Practice | firend-fucntion-prac.cpp | #include <iostream>
#include <string>
using namespace std;
class Aslam;
class Ali{
private:
int money = 100;
friend void Ahmad(Ali , Aslam);
};
class Aslam{
private:
int money = 200;
friend void Ahmad(Ali , Aslam);
};
void Ahmad(Ali f1, Aslam f2){
cout << "Money = " << f1.money+f2.money << endl;
}
... | TOOL | 0.920329 | 3.941861 |
c4b903e4-64ff-4297-958c-afacd0175ad3 | mfeitoza/data-structure-2 | assignment-01/App.cpp | #include <stdio.h>
#include <iostream>
#include "LinkedList.h"
#define RESET "\033[0m"
#define RED "\033[31m"
#define BLUE "\033[34m"
#define GREEN "\033[32m"
class App {
protected:
int op = 0;
LinkedList<int> list;
void printMenu() {
std::cout << std::endl;
... | TOOL | 0.881441 | 5.064281 |
7280e1ca-3e94-4440-aa41-72ce757966e5 | nikamanth/Tactobot | applications-linux/tactobot_main/CTaskOpOri.cpp | #include "CTaskOpOri.hpp"
#include "STaskOpOri.hpp"
#include <stdio.h>
#include <iostream>
#include <stdexcept>
#include <sstream>
#include <scl/Singletons.hpp>
#include <sutil/CRegisteredDynamicTypes.hpp>
#ifdef DEBUG
#include <cassert>
#endif
#include <Eigen/Dense>
//Don't always use it. Read comments in the mo... | TOOL | 0.995632 | 6.750137 |
75d2bcb3-afe4-4b54-a57b-f97c46c0603d | egormkn/ifmo-kt | course2/algorithms/1_lca/G_carno.cpp | #include <cstdio>
#include <algorithm>
#include <vector>
using namespace std;
FILE *fin = fopen("carno.in", "r");
FILE *fout = fopen("carno.out", "w");
unsigned long find_set(unsigned long v, vector<unsigned long> &parent) {
if(v == parent[v]) {
return v;
}
return parent[v] = find_set(parent[v], ... | ALGO | 0.999995 | 4.173649 |
e8f9844b-f9c3-4207-a407-1d87060926cd | imanshu822/5-DSA_Questions_a_Day | 2563-count-the-number-of-fair-pairs/2563-count-the-number-of-fair-pairs.cpp | class Solution {
public:
long long countFairPairs(vector<int>& v, int lower, int upper) {
long long ans = 0;
sort(v.begin(), v.end());
for (int i = 0; i < v.size() - 1; i++) {
auto up = upper_bound(v.begin() + i + 1, v.end(), upper - v[i]);
auto low = lower_bound(v.b... | ALGO | 0.999988 | 5.883859 |
b37c1135-100c-445b-bb8c-067fe4b0334e | MinliLiao/DSN25-AE | src/systemc/tests/systemc/misc/cae_test/general/control/if_test/fsm/fsm.cpp | /*****************************************************************************
fsm.cpp --
Original Author: Rocco Jonack, Synopsys, Inc., 1999-10-25
*****************************************************************************/
/*****************************************************************************
M... | ALGO | 0.96817 | 4.025086 |
5c4d85eb-5c0a-4a3a-abab-778d820e1887 | anayo456/visualStudioProjects | Projects/chapter_5_c/commandline/commandline.cpp | //commandline.cpp.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <ctype.h>
#include <stdio.h>
#include<iostream>
#include<string>
#include <string.h>
using namespace std;
#define LIBFUNC 1
#define MAXVAL 100
int sp = 0; /* next free stack position */
double val[MAXVAL]; /... | TOOL | 0.953753 | 3.936029 |
ab6893ca-b59d-4450-887d-e75d7fae1949 | MukeshRao18/SQL- | 1302-delete-characters-to-make-fancy-string/1302-delete-characters-to-make-fancy-string.cpp | class Solution {
public:
string makeFancyString(string s) {
string result = "";
int count = 1;
result += s[0];
for (int i = 1; i < s.size(); i++) {
if (s[i] == s[i - 1]) {
count++;
} else {
count = 1;
... | ALGO | 0.999978 | 6.43824 |
f20eb35f-e078-4db5-b8c1-7bd5492f96a3 | drake01/arbitrarycode | c/check.cpp | #include <iostream>
#include <cstdio>
#include "x.c"
using namespace std;
//extern int a;
//int summy(int a, int b);
int main(){
int x;
// if(printf("%d",x=4))
//cout<<"hell";
// continue;
//b reak;
int t =5;
int b =10;
cout<<summy(t,b);
}
| ALGO | 0.991955 | 3.474481 |
34d7714f-6f99-471b-88a0-b6402c735c3b | ishandutta2007/codeforces | benq/normal/1236/C.cpp | #pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
#include <bits/stdc++.h>
using namespace std;
typedef double db;
typedef long long ll;
typedef long double ld;
typedef string str;
typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef pair<ld,ld> pd;
typedef complex<ld> cd;
typedef vector<int> vi;
type... | ALGO | 0.999923 | 3.109576 |
35de4ddf-e8ec-43c0-981d-6a0baff4bb56 | AlexandreOkita/eaki | 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.998859 | 6.785645 |
97f1420c-4e8c-44d7-b876-9fd61c835336 | George-Codr/llvm | libc/src/math/generic/fsub.cpp | #include "src/math/fsub.h"
#include "src/__support/FPUtil/generic/add_sub.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(float, fsub, (double x, double y)) {
return fputil::generic::sub<float>(x, y);
}
} // namespace LIBC_NAMESPACE_D... | TOOL | 0.934922 | 6.856188 |
a62732ae-8de7-47fb-ba8c-5a9eea778d00 | asdf77616385/ceph-12.2.1 | src/boost/libs/graph/example/influence_prestige.cpp | //[influence_prestige_example
#include <iostream>
#include <iomanip>
#include <boost/graph/directed_graph.hpp>
#include <boost/graph/exterior_property.hpp>
#include <boost/graph/degree_centrality.hpp>
#include "helper.hpp"
using namespace std;
using namespace boost;
// The Actor type stores the name of each vertex ... | ALGO | 0.992349 | 7.070374 |
2dbfae86-add4-46a8-aa91-d9bc845a0fa3 | EUNHAGYEONG/Cpp_Programming | ch4_prac8.cpp | /*
ǽ 7 غ.
ڷκ Է¹ް, ŭ Է¹ ϶.
迭 Ҵƾ Ѵ.
*/
/*
#include <iostream>
using namespace std;
class Circle {
int radius;
public:
void setRadius(int radius);
double getArea();
};
void Circle::setRadius(int radius) {
this->radius = radius;
}
double Circle::getArea() {
return 3.14 * radius * radius;
}
int main(... | ALGO | 0.99711 | 3.810509 |
d1bec809-7b14-4e46-a10d-6abba730d999 | Gowthamnaik1234/CSA0399-data-structure | program 15 data structure.cpp | #include <stdio.h>
#include<stdlib.h>
#define TABLE_SIZE 10
int h[TABLE_SIZE]={NULL};
void insert()
{
int key,index,i,flag=0,hkey;
printf("\nenter a value to insert into hash table\n");
scanf("%d",&key);
hkey=key%TABLE_SIZE;
for(i=0;i<TABLE_SIZE;i++)
{
index=(hkey+i)%TABLE_SIZE;
if(h[index] == N... | ALGO | 0.99948 | 3.319785 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.