uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
6aa1ebaf-c685-48cb-a23e-d4364f8e59d7 | llvm/clangir | llvm/tools/llvm-debuginfod/llvm-debuginfod.cpp | #include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Debuginfod/Debuginfod.h"
#include "llvm/Debuginfod/HTTPClient.h"
#include "llvm/Option/ArgList.h"
#include "llvm/Option/Option.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/LLVMDriver.h"
#include "llvm/Support/ThreadPool... | TOOL | 0.961038 | 7.415118 |
84978314-8d0a-468e-8092-d53671fd381d | PayamEmami/OpenMS | src/openms/source/ANALYSIS/RNPXL/PScore.cpp | #include <OpenMS/KERNEL/StandardTypes.h>
#include <OpenMS/ANALYSIS/RNPXL/PScore.h>
#include <OpenMS/ANALYSIS/ID/AScore.h>
#include <vector>
#include <map>
using std::map;
using std::vector;
namespace OpenMS
{
vector<Size> PScore::calculateIntensityRankInMZWindow(const vector<double>& mz, const vector<double>& inte... | ALGO | 0.997954 | 5.102586 |
f8e78f6c-2a1a-497e-baa3-58ede9304525 | Falicitas/Code_Template | 数学/多项式除法.cpp | void PolyInv(int deg,vector<int> &f,vector<int> &g)
{
if(deg==1) {g[0] = qp(f[0],mod-2);return ;}
PolyInv((deg+1)>>1,f,g);
int lim = 1;
while(lim<(2*deg)) lim <<= 1;
vector<int> h(lim);
REP(i,0,deg-1) h[i] = f[i];
ntt(g,lim,1),ntt(h,lim,1);
REP(i,0,lim-1) g[i] = 1LL * (2LL + mod - 1LL * ... | ALGO | 0.999948 | 3.274394 |
08b2ee50-a4ce-4297-af29-8ff7b9fe8438 | nisroeld99/BOJ-PS | 2410/2410.cpp | /*
* 2410.cpp
*/
#include <iostream>
#include <queue>
#include <algorithm>
#include <cstring>
#include <vector>
using namespace std;
typedef pair<int,int>ii;
typedef pair<int,ii> iii ;
const int inf =987654321;
const int mod = 1000000000;
int d[1000001];
int main(){
int n ;
cin >> n;
d[0] =1 ;
for (int i =1 ; ... | ALGO | 0.999973 | 3.98147 |
ff7c1f42-fe84-4815-9c86-a937397205b7 | allexandre97/GROMACS-OSC | gromacs-osc/src/gromacs/fft/fft.cpp | #include "gmxpre.h"
#include "fft.h"
#include "config.h"
#include <cerrno>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include "gromacs/math/gmxcomplex.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/real.h"
/* This file contains common fft utility functions, but not
* the actual... | ALGO | 0.998358 | 6.905116 |
1ce95602-d1ae-4c49-a74b-67a53c298baf | a-farooq/ProblemsAndSolutions | DataStructuresAndAlgorithms/linkedList/rotate.cpp | /***********
Given a singly linked list of size N. The task is to rotate the linked list counter-clockwise by k nodes, where k is a given positive integer smaller than or equal to length of the linked list.
Input:
The first line of input contains the number of testcases T. For each test case, the first line of input c... | ALGO | 0.999543 | 5.618033 |
d5a198d6-41d2-4bf0-95f1-50d6c2d3b864 | siddharthagar229/Leetcode | 1557-minimum-number-of-vertices-to-reach-all-nodes/1557-minimum-number-of-vertices-to-reach-all-nodes.cpp | class Solution {
public:
vector<int> findSmallestSetOfVertices(int n, vector<vector<int>>& edges) {
vector<int> ans;
vector<int> indegree(n,0);
for(auto it:edges){
indegree[it[1]]++;
}
for(int i=0;i<n;i++){
if(indegree[i] == 0){
... | ALGO | 0.999952 | 6.128606 |
d8d63c32-5ece-4d94-9bcf-5e5870a5cba7 | tanmoypramanick420/DSA-251-roadmap | Arrays/Non-Decreasing Array.cpp | #include <bits/stdc++.h>
using namespace std;
bool isPossible(int *arr, int n)
{
int count = 0;
for (int i = 1; i < n; i++) {
if (arr[i] < arr[i - 1]) {
count++;
if (i == 1 || arr[i - 2] <= arr[i]) {
arr[i - 1] = arr[i];
}
else {
... | ALGO | 0.99988 | 4.442688 |
d138e24f-c674-4b44-ab96-976f872141b4 | SuuTTT/acm | templets/aizu/DPL/Combination/DPL_5_C_std.cpp | #include<bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;
#define NUM 1001
ll POW[NUM];
ll nCm[NUM][NUM];
ll memo[NUM];
int main(){
ll N,K;
scanf("%lld %lld",&N,&K);
if(N < K){
printf("0\... | ALGO | 0.999974 | 4.392569 |
c6c2143c-f386-4ea0-bf3e-083685a1705b | ishandutta2007/codeforces | heart_blue/normal/620/A.cpp | #include <cstdlib>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <iostream>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <fstream>
#include <numeric>
#include <iomanip>
#include <bi... | ALGO | 0.9997 | 3.7072 |
adfaa45a-a8cd-4723-9435-6a6c905b25ee | fzkxrs/spbetu_labs | Labs/3rd semester/Computational Mathematics/cm5/main.cpp | #include<cmath>
#include<iostream>
#include<cstdlib>
#include"METHODS.H"
double delta,c,d;
int main(){
int k;
float eps1,delta1;
double a,b,eps,x;
printf(" eps:");
scanf("%f",&eps1);
eps = eps1;
a = 0.1;
b = 1.5;
printf(" delta:");
scanf("%f",&delta1);
delta = delta1;
x =... | ALGO | 0.999845 | 3.527024 |
944284a2-2aa9-44bd-86a2-7d300268d691 | yuichi-morisaki/cpp-p3 | ch06-writing-a-program/ex05.cpp | /* English Grammar
*
* Sentence:
* Noun Verb
* Sentence Conjunction Sentence
* Conjunction:
* "and"
* "or"
* "but"
* Noun:
* "birds"
* "fish"
* "C++"
* Verb:
* "rules"
* "fly"
* "swim"
*/
/* Sentence:
* Noun Verb
* Sentence Conjun... | TOOL | 0.931952 | 6.156898 |
d487db0e-71d6-48ae-a54c-e182e9462539 | fazzone/apex-tracker | src/surf_test.cpp | #include <dlib/matrix.h>
#include <dlib/geometry.h>
#include <dlib/image_io.h>
#include <dlib/image_transforms.h>
#include <dlib/data_io.h>
#include <dlib/image_processing.h>
#include <dlib/gui_widgets.h>
#include <dlib/image_keypoint/draw_surf_points.h>
#include <dlib/cmd_line_parser.h>
#include <dlib/image_keypoint.h... | ALGO | 0.985622 | 3.803787 |
30d2b987-be23-41c6-9ff4-047ea78bfe49 | Thunderstormanujpradhan/CodingPractice | C C++/DSA/oops/oop37.cpp | // Define a class called Triangle, with two fields as base and height to calculate the area of a
// triangle. The class contains two methods such as getData() to initialize the fields of a triangle
// and areaTrin() to calculate the area of a triangle. Write a program to find out area of 10
// triangles.
#include<iostr... | TOOL | 0.965709 | 4.938269 |
cd9f3d76-fe32-49a3-bbec-628f7ec6be5d | abhinav52000/C_plus_plus_refresher | Compound_arithmetic.cpp | #include<iostream>
using namespace std;
int main()
{
int store=0,update;
char operation;
l:
cout<<"\n\nEnter the value to update ";
cin>>update;
m:
cout<<"\nThe operatoin to perform ";
cin>>operation;
switch (operation){
case '+':
store+=update;
cout<<"\nThe value after ... | ALGO | 0.9779 | 3.064909 |
5bc1c3de-da21-464e-ac49-344ff0765c3b | nora-salah/advanced_appointment_app | 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.998756 | 6.772262 |
d2271aac-a354-4d13-9def-cd722a8aa2e1 | mariosantos-05/Competitive-Programming | PC/estudos/ups_semanauni/L.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
vector<vector<pair<int, ll> > > grafo;
const int MAX = 2e5 + 10, MAX_LOG = 18;
int dp[MAX][MAX_LOG], nivel[MAX];
ll dist[MAX];
void dfs(int u, int parent, int level, ll w){
dist[u] = w;
dp[u][0] = parent;
nivel[u] = level;
for(int i... | ALGO | 0.999953 | 4.490735 |
7e80dffc-2781-47a2-b6ec-491c19e52565 | manchalaharikesh/CODES-POTDs | GeeksForGeeks/Implement Atoi.cpp | // DATE: 02-FEB-2024
// Question URL: https://www.geeksforgeeks.org/problems/implement-atoi/1
// Question: Implement Atoi
// Description: Given a string, s, the objective is to convert it into integer format without utilizing any built-in functions. If the conversion is not feasible, the function should return -1.
// ... | ALGO | 0.999796 | 5.682658 |
f5522cd8-1022-47c3-8b21-a2817cc1fe79 | Aadarsh04/DSA-Practice | Day-19/3LengthOfString.cpp | #include<iostream>
using namespace std;
int getLength(char ch[]){
int count = 0;
for(int i=0; ch[i] != '\0';i++){
count++;
}
return count;
}
int main(){
char name[20];
cout<<"Enter your name"<<endl;
cin>>name;
cout<<"Length is "<<getLength(name)<<endl;
return 0;
} | TOOL | 0.922071 | 3.415271 |
fe1bcf8c-079f-4cd6-9b3d-90646b9bd01b | H-Shen/MyCodeCollection | Leetcode/2043/2043.cpp | using ll = long long;
class Bank {
private:
vector<ll> balance;
int n;
public:
Bank(vector<long long>& balance) : balance(balance) {
n = (int)balance.size();
}
bool transfer(int account1, int account2, long long money) {
if (account1 >= 1 && account1 <= n && account2 >= 1 && ac... | ALGO | 0.994207 | 5.349711 |
b0ee0e24-0af1-489d-b962-5548933d1d6b | Nezz7/Competitive-programming | GYM/2017-2018 ACM-ICPC Pacific Northwest Regional Contest (Div. 1)/J.cpp | #include <bits/stdc++.h>
#define endl '\n'
#define LL long long
#define LD long double
#define pb push_back
#define sz(a) (int)a.size()
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define debug(x) cerr << #x << " is " << x << endl;
using namespace std;
int const MAXN = 30 + 9;
int n, m;
char a[... | ALGO | 0.99992 | 4.03462 |
3341cbc4-6999-4798-a0f2-9680a1d8d5da | raincross7/code-similarity | codes/train_code/problem425/problem425_110.cpp | #include <cstdio>
int main() {
int w, h;
while(true) {
scanf("%d %d", &h, &w);
if(w == 0 & h == 0) break;
for(int i = 1; i <= w*h; i++) {
printf("#");
if(i % w == 0) printf("\n");
}
printf("\n");
}
return 0;
} | ALGO | 0.999403 | 3.266333 |
80fa6608-eb61-47e2-a57e-bb93922bcf0c | Soham-Chaudhuri/My-CPP-practice | 1203A.cpp | #include<bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
typedef long double ld;
typedef long long int lli;
typedef pair<int, int> pii;
typedef vector<vector<lli>> vvlli;
typedef vector<lli> vlli;
typedef vector<ull> vull;
typedef pair<lli, lli> plli;
#define max3(a,b,c) max(max((a),(b)),(c))
#defin... | ALGO | 0.99971 | 4.103595 |
1b779ab3-334d-4b89-9b7d-6000c2b6b30c | gtslljzs/SKKU | 18-2/AIProject/connect6/utd.cpp | #include <iostream>
#include <vector>
#include <utility>
#include <cstdlib>
#include "AI_player.h"
#include "BK_AI_player.h"
#include "utd.h"
#ifndef __SETTING__
#define __SETTING__
#define BLACK 1
#define WHITE 2
#define EMPTY 0
#define BOARD_SIZE 19
#define WINDOW_SIZE 6
#define MAX_TURN 180
#endif
#ifndef __UTD_SE... | ALGO | 0.995078 | 3.89039 |
e05197c2-8e67-44c6-b1cb-f24c069748d7 | AhmedAshraf0/problem-solving-codeforces | B. Vlad and Candies.cpp | //
// Created by CST on 31-Mar-22.
//
#include<bits/stdc++.h>
using namespace std;
int main(){
int t;
cin>>t;
while(t--){
long long n , max = 0 , min;
cin>>n;
if(n == 1){
long long n2;
cin>>n2;
if(n2 > 1){
cout<<"NO"<<endl;
... | ALGO | 0.999658 | 3.95403 |
10e2b51c-ff4a-4bb2-bb03-0480d2e374fa | alexandraback/datacollection | solutions_5686275109552128_1/C++/DiegoCR/B.cpp | #include <bits/stdc++.h>
using namespace std;
const int TAM = 1111;
int arr[TAM];
int n;
bool can ( int val, int spec ) {
for ( int i = 0; i < n; i ++ ) {
if ( arr[i] > val ) {
spec -= (arr[i] - 1) / val;
if ( spec < 0 ) return false;
}
}
return true;
}
bool possible ( int mid ) {
for ( int i =... | ALGO | 0.99984 | 4.328979 |
b86880d8-dbdd-42ee-9f47-e01a19100a2b | devyaniChoubey/My-Solutions-DS-Algo | Strings/Reverse the String.cpp | https://www.interviewbit.com/problems/reverse-the-string/
string Solution::solve(string s) {
stringstream ss(s);
string temp;
vector<string>parts;
while(getline(ss, temp, ' ')){
if(!temp.empty())parts.push_back(temp);
}
string ans = "";
for(int i=parts.size() - 1;i >=... | ALGO | 0.999982 | 5.639246 |
9f1b7437-81e3-4742-b33b-b2ed513ef17f | aakriti1318/codeforces | 1316A - Grade Allocation.cpp | //https://codeforces.com/problemset/problem/1316/A
// 1316A - Grade Allocation
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main(){
int t; cin>>t;
ll n,m;
while(t--){
ll sum=0;
cin>>n>>m;
ll a[n];
for(int i=0;i<n;i++){
cin>>a[i];
... | ALGO | 0.999924 | 5.071223 |
c737e1e2-4942-42b8-be53-9cf696defc0c | tusharkumar19701/Leetcode | 169.cpp | //Given an array nums of size n, return the majority element.
//The majority element is the element that appears more than ⌊n / 2⌋ times. You may assume that the majority element always exists in the array.
class Solution {
public:
int majorityElement(vector<int>& nums) {
sort(nums.begin(),nums.end());
... | ALGO | 0.999956 | 5.967813 |
86b5f709-0b1f-4b88-a808-c050afb0b56e | BrahianIsaza07/ProgramacionII | Taller 2/Ejercicio 1.10.cpp | #include <stdio.h>
int main (){
int n, suma=0;
printf("Ingrese un numero " "\n");
scanf("%d",&n);
for(int i = 1;i <= n;i++ ){
suma += i;
}
printf("La suma de todos los numeros comprendidos entre 1 y %d es : %d\n", n , suma);
return 0;
}
| ALGO | 0.991196 | 3.250957 |
c7f36688-1e72-4a11-aad5-c924a9935356 | alexandraback/datacollection | solutions_6377668744314880_0/C++/iseriohn/c.cpp | #include <iostream>
#include <sstream>
#include <cstdio>
#include <cstring>
#include <string>
#include <cstdlib>
#include <cmath>
#include <cctype>
#include <ctime>
#include <algorithm>
#include <iomanip>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <cassert>
#include <bitset>
using namesp... | ALGO | 0.999966 | 4.168626 |
7c8f3e6a-1944-4f7f-a9c1-c40a4c7cc8c8 | tanvir248/May-21 | Codeforces_May-21/Beautiful matrix.cpp | #include<bits/stdc++.h>
using namespace std;
using ull = unsigned long long;
using lln = long long int;
using ls = string;
using ch = char;
using lld = long double;
using lf = float;
using ll= int;
using ld = double;
#define pb push_back
#define eb emplace_back
#define B begin()
#define E end()
#define sz size()
#defi... | ALGO | 0.99983 | 3.375243 |
b3a34b1d-8146-4bd6-838e-08ddf430a6cf | Zijo05/pmf | programiranje_2/laboratorijske_vjezbe/LV12 Klasa Lik/lik (1).cpp | #include <iostream>
#include <vector>
#include <cmath>
using namespace std;
class Tacka {
double x,y;
public:
Tacka(double x, double y):x(x),y(y) {}
void Translatiraj(double dx, double dy) {
x += dx;
y += dy;
}
double Udaljenost(Tacka a) {
return sqrt(pow(x - a.x,2) + pow(y - a.y,2));
}
friend ... | ALGO | 0.993153 | 4.361454 |
e429e226-9f96-4445-bff2-c0be1d883591 | lifan0710/Boymue | framework/thirdparty/skia/src/pathops/SkOpCoincidence.cpp | #include "SkOpCoincidence.h"
#include "SkOpSegment.h"
#include "SkPathOpsTSect.h"
bool SkOpCoincidence::extend(SkOpPtT* coinPtTStart, SkOpPtT* coinPtTEnd, SkOpPtT* oppPtTStart,
SkOpPtT* oppPtTEnd) {
// if there is an existing pair that overlaps the addition, extend it
SkCoincidentSpans* coinRec = fHead... | TOOL | 0.997112 | 5.568325 |
f44d119e-daff-45aa-b7c0-be280bda240c | chltkdgns1/Algorithm_first | 배열에서 이동.cpp | #include <cstdio>
#include <queue>
using namespace std;
#define INF 987654321
struct Point {
int y, x;
};
int n;
int map[101][101];
int visit[101][101] = { 0, };
int lo = INF, hi = 0;
queue<Point > que;
void init()
{
for (int i = 0; i <= n; i++) {
for (int j = 0; j <= n; j++) {
visit[i][j] = 1;
}
}
while ... | ALGO | 0.999786 | 3.422302 |
189d2fcb-15ea-43bd-b166-686c3bfd91c8 | tic40/atcoder | abc/abc315/c/main.cpp | #include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0;i<n;i++)
#define endl '\n'
using ll = long long;
template<class T> void chmax(T& a, T b) { a = max(a,b); }
int main() {
int n; cin >> n;
vector<ll> f(n),s(n);
REP(i,n) { cin >> f[i] >> s[i]; f[i]--; }
vector g(n,vector<ll>());
REP(i,n... | ALGO | 0.999948 | 3.818179 |
0993b22b-3bbf-4a17-807c-c38623dd93ed | PATR1c-k/DSA-leetcode | Array/string/stringop.cpp | #include <iostream>
using namespace std;
bool checkPalindrome(char name[], int n)
{
int s = 0;
int e = n - 1;
while (s <= e)
{
if (name[s] != name[e])
{
return false;
}
s++;
e--;
}
return true;
}
int getLength(char name[])
{
int i = 0;
... | ALGO | 0.999825 | 4.837114 |
937a2ff0-1a33-4f87-a443-f19b3a24f500 | ming2k/cpp-tutorial-primer | ch01/1_13.cpp | // Rewrite the following exercises using for loops.
/*
#include <iostream>
int main()
{
int sum = 0, val = 1;
while (val <= 10)
{
sum += val;
++val;
}
std::cout << "Sum of 1 to 10 inclusive is " << sum << std::endl;
return 0;
}
*/
#include <iostream>
int main()
{
int sum = ... | ALGO | 0.998224 | 4.883535 |
eb5f6c8d-8f3c-4e05-944b-f012b2c6e947 | Ryb7532/AtCoder | submissions/abc261/f.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define rep(i,n) for (int i=0; i<(n); i++)
#define rrep(i,n) for (int i=n-1; i>=0; i--)
#define print(a) cout << a << endl
#define fix(n) fixed << setprecision(n)
#define fill_c(c, n) setfill(c) << setw(n)
#define all(v) v.begin... | ALGO | 0.99998 | 4.015519 |
6f808ad2-acab-4cbd-8fc5-9e010b869856 | ishandutta2007/codeforces | fhlasek/normal/489/C.cpp | /* Written by Filip Hlasek 2014 */
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <string>
#include <algorithm>
#include <cmath>
#include <cstring>
#define FOR(i,a,b) for(int i=(a);i<=(b);i++)
#define FORD(i,a,b) for(int i=(a);i>=(b);i--)... | ALGO | 0.99993 | 3.826031 |
61befbad-299f-4849-8ea7-0ec28009ecd4 | nanopathi/frameworks_av_AOSP10_r33_CVE-2020-0160 | media/libstagefright/codecs/amrnb/common/src/log2_norm.cpp | /*
Pathname: ./audio/gsm-amr/c/src/log2_norm.c
------------------------------------------------------------------------------
REVISION HISTORY
Description: Created separate file for Log2_norm function.
Description: Synchronized file with UMTS version 3.2.0. Updated coding
template. Removed unneces... | ALGO | 0.998445 | 5.951026 |
48a93dfd-6b9b-4d5c-adde-85aecd08b5a6 | honood/leetcode | solutions/0328-odd-even-linked-list.cpp | // HoNooD <<EMAIL>>
// 2025.03:03 00:35
// 328. Odd Even Linked List
// https://leetcode.com/problems/odd-even-linked-list/?envType=study-plan-v2&envId=leetcode-75
auto __unsync_with_stdio = std::ios::sync_with_stdio(false);
auto __uncin_tie = std::cin.tie(nullptr);
// Definition for singly-linked list.
//
// struct... | ALGO | 0.99989 | 6.067692 |
ad1dba8e-55a2-4b66-b226-b41349ecf5d6 | MaicolGomez/ACM | spoj/12912.cpp | #include<cstdio>
#include<iostream>
#include<cstring>
#include<vector>
#include<cmath>
#include<algorithm>
#include<climits>
#include<set>
#include<deque>
#include<queue>
#include<map>
#include<climits>
#include<string>
#include<stack>
#include<sstream>
using namespace std;
#define pi (2.0*acos(0.0))
#define eps 1e-6
#... | ALGO | 0.999627 | 3.727363 |
7a93d382-f7cc-4593-80b2-c6e2196706a2 | join-the-flock/flock | dev/integration_tests/flutter_gallery/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.998659 | 6.772262 |
e43d52c7-0037-4944-890f-5a76b644ab93 | themattchan/hackerrank | ds/linkedlists/DoublyLinkedList.cpp | #include <stdio.h>
struct Node
{
int data;
Node *next;
Node *prev;
};
Node* SortedInsert(Node *head, int data)
{
Node *n = new Node();
n->data = data;
if (head == NULL)
return n;
// special case: new node is new head
if (head->data >= data) {
n->next = head;
head->prev = n;
return n;
}
// is ther... | ALGO | 0.999924 | 4.538677 |
33166072-e612-4053-9911-c95586eb6a62 | gianluca-moro/SeeingTemperature | HoloLens/MyBuild/Il2CppOutputProject/IL2CPP/libil2cpp/icalls/mscorlib/System.Globalization/CompareInfo.cpp | #include "il2cpp-config.h"
#include <memory>
#include "il2cpp-object-internals.h"
#include "il2cpp-class-internals.h"
#include "icalls/mscorlib/System.Globalization/CompareInfo.h"
#include "icalls/mscorlib/System.Globalization/CompareOptions.h"
#include "vm/String.h"
#include "vm/Exception.h"
#include "vm/Array.h"
#inc... | TOOL | 0.864838 | 5.873457 |
93b2e266-3107-4ab7-b728-f34bf77cf1cf | FahimAbrar0112/CP-Codes | Codes/trial/test1.cpp | #include<bits/stdc++.h>
using namespace std;
int main(int argc,char * argv[])
{
int n,m;
cin >> n >> m;
vector<long long> v ;
for(int i=0;i<n;i++)
{
long long tmp;
cin >> tmp;
v.push_back(tmp%m);
}
sort(v.begin(),v.end());
int q;
cin >> q ;
wh... | ALGO | 0.999983 | 3.737339 |
7a3ec9e0-5f68-4fac-9f1d-9016bc9ef26e | MACKHITH/C- | source/numeroMag0.cpp | // Programma che dati in input N stampa i numeri da 0 a N se N>=0
#include<iostream>
using namespace std;
int main(){
int n, x=0;
cin>>n;
if (n>=0)
{
while (x!=n+1)
{
cout<<x<<endl;
x++;
}
} else
{
cout<<"ERRORE";
}
return 0;
}... | ALGO | 0.983565 | 4.001861 |
913a2bf3-b85a-4926-a821-74fefba5a13c | PrathamAditya/DSAndAlgo | 28.deque/main.cpp | #include <iostream>
#include <list>
using namespace std;
class Deque
{
private:
list<int> l;
public:
bool empty()
{
return l.empty();
}
void pop_front()
{
if (empty())
{
l.pop_front();
}
}
void pop_back()
{
if (empty())
{
... | ALGO | 0.99567 | 4.933764 |
a1c52012-0d7b-4d05-9e2d-b611961ed00a | ltaamlee/PROGRAMMING-TECHNIQUES | Contest 3/Tim hang thu K.cpp | #include <bits/stdc++.h>
#define nmax 1000
using namespace std;
int main(){
ios_base::sync_with_stdio(NULL); cin.tie(NULL); cout.tie(NULL);
long long n, m, k; cin>>n>>m;
vector <vector<long long>> a(n,vector<long long>(m));
for (int i=0; i<n; ++i){
for (int j=0; j<m; ++j){
cin>>a[i][j];
}
}
cin>>k;
vector... | ALGO | 0.999986 | 3.597048 |
b3ebf326-7478-485b-a07b-e8e5e998ef41 | ValeriiKoniushenko/VaKon2D | dependencies/boost_1_80_0/libs/compute/perf/perf_next_permutation.cpp | #include <algorithm>
#include <iostream>
#include <numeric>
#include <vector>
#include <boost/compute/system.hpp>
#include <boost/compute/algorithm/next_permutation.hpp>
#include <boost/compute/algorithm/prev_permutation.hpp>
#include <boost/compute/container/vector.hpp>
#include "perf.hpp"
int rand_int()
{
retu... | ALGO | 0.997193 | 5.152215 |
166dcae2-06af-4572-b392-9bdac3ab74ae | huzaifaarshad12/PD-1stSemester | week4/task6.cpp | #include<iostream>
using namespace std;
void number(int hour, int min);
main(){
int hour;
int min;
cout<<"Enter the number of hours: ";
cin>>hour;
cout<<"Enter the number of minutes: ";
cin>>min;
number(hour,min);
}
void number(int hour, int min){
if(hour*60>min)
{
cout<<hour;
}
if(min>hour*60)
{
cout<<min;... | ALGO | 0.86011 | 3.52231 |
f29aa9f5-3b9d-4ae2-8d76-adac3c4080b5 | Anuj121299/learning-Cpp | switch/vowel.cpp | #include <iostream>
using namespace std;
int main ()
{
char a;
cout<<"Enter the alphabet : ";
cin>>a;
switch (a){
case 'a' : cout<<"Vowel";
break;
case 'A' : cout<<"Vowel";
break;
case 'e': cout<<"Vowel";
break;
case 'E' : cout<<"Vowel";
break;
case 'i': cout<<"Vowel";
break;
case 'I': cout<<"... | ALGO | 0.984987 | 3.171583 |
995f2fda-a244-4beb-a151-f12c9c51f794 | frandibar/acm-valladolid | libraries/c_geometric.cpp |
typedef struct {
double x, y
} point2d;
typedef struct {
// ax + by + c = 0
double a, b, c;
} line;
///////////////////////////////////////////////////////////////////////////
double signed_triangle_area(point2d a, point2d b, point2d c)
{
return ((a.x * b.y - a.y * b.x + a.y * c.x
- a.x * c.y + b.x * c.y - ... | ALGO | 0.999905 | 4.30613 |
f26aa6bd-f897-4345-801a-d67c4993a0d4 | aeden/aoc2021 | day5/src/p2.cpp | #include <iostream>
#include <fstream>
#include <string>
#include <sstream>
#include <vector>
#include <map>
#include "lib/io.h"
using namespace std;
const string SEGMENT_DELIMITER = " -> ";
const string COORDINATE_DELIMITER = ",";
class Coordinates {
public:
int x;
int y;
Coordinates() {
x = 0;... | ALGO | 0.997811 | 5.394145 |
f7fb9d35-57e9-436b-a1d9-04ca02448233 | ishandutta2007/codeforces | rivalq/normal/618/E.cpp | // Jai Shree Ram
#include<bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for(int i=a;i<n;i++)
#define ll long long
#define int long long
#define pb push_back
#define all(v) v.begin(),v.end()
#define endl "\n"
#define x first
#define y ... | ALGO | 0.999841 | 3.532614 |
3a62f0cc-d2e3-4990-8eea-80dad90c00f9 | Glebanister/van_kampen_diagramm | src/MergingAlgorithm.cpp | #include "MergingAlgorithm.hpp"
namespace van_kampen
{
MergingAlgorithm::MergingAlgorithm()
: result_(graph_) {}
void MergingAlgorithm::generate(const std::vector<std::vector<van_kampen::GroupElement>> &words)
{
std::vector<van_kampen::Diagramm> diagrams;
diagrams.reserve(words.size());
int left = li... | ALGO | 0.999711 | 6.152392 |
7108c868-f70e-41e6-a9c0-8a8ac2b56eb8 | flaviu2001/High-School-Small-Projects | ONI/ONI 2018/OJI/subsecvente_80p.cpp | #include <bits/stdc++.h>
using namespace std;
struct thing{
long long sz, nr;
bool operator<(const thing &obj)const{
if(sz < obj.sz)
return true;
if(sz > obj.sz)
return false;
if(nr < obj.nr)
return true;
if(nr > obj.nr)
return f... | ALGO | 0.999271 | 3.450016 |
36ac3986-f085-4d09-a4ed-bb306de4f393 | YuriRamos92/respostas-target | ex04.cpp | #include <iostream>
using namespace std;
int main()
{
cout << "ambos estariam na mesma distância de Ribeirão Preto pois vão se cruzar"
}
| ALGO | 0.998212 | 3.88771 |
9520ac7c-2030-47b9-9574-b809a2289985 | ishandutta2007/codeforces | saba2000/normal/1053/D.cpp | #include<bits/stdc++.h>
using namespace std;
long long mod = 1e9+7;
int p[200009];
int P[2000009];
int f[2000009];
int F[2000009];
vector<int> V[2000009];
long long sc = 0;
void fa(int x, int ty){
int s = 1;
int y = x;
while(x > 1){
int z = P[x];
int k = 0;
while(x % z ==... | ALGO | 0.999854 | 4.249149 |
e85b12b2-cc44-451d-a959-55428df20dc2 | doubleZ0108/DataStruct | Tree/PostOrder_non.cpp | /*
与前序和中序不同, 要把一个结点的左子树和右子树都访问完了, 才可以访问该结点
所以 一左到底之后弹出结点
如果是false要再次压栈, 并转到右子树重复一左到底的操作
如果是true则可以放心的访问这个结点
有一个bug是输出完全部结点之后还会继续输出, 所以在外层大循环中加了第三个条件=>当前的move的flag要为false
*/
void PostOrderTraversal(BinTree root)
{
map<ElementType, bool> BinTreeMap;
/*用映射先把所有结点是否可以输出初始化为false*/
for (int i = 'A'; i <... | ALGO | 0.99977 | 3.530631 |
7b422072-b2fd-450b-9f2f-53e5793cf33e | minaamfasihi/competitive-programming | CTCI/linked-lists/remove-dups-from-unsorted-list.cpp | struct Node {
int val;
Node* next;
Node(int v) : val(v), next(nullptr) {}
};
Node* removeDupsFromUnsortedList(Node* head) {
Node* prev = nullptr;
Node* curr = head;
map<int, int> m;
while (curr) {
if (m.count(curr->val) > 0) {
Node* temp = curr;
prev->next = curr->next;
delete temp;
temp = nullptr... | ALGO | 0.999875 | 5.20961 |
045c5b0c-b881-4428-829b-1721005fd770 | jaydip1235/DSA | DynamicProgramming/Medium/MinCostPath.cpp | // https://leetcode.com/problems/minimum-path-cost-in-a-grid/
#include<bits/stdc++.h>
class Solution
{
public:
int n, m;
int dp[51][51];
int solve(vector<vector<int>> &grid, vector<vector<int>> &moveCost, int row, int col)
{
if (row == n - 1)
return grid[row][col];
if (dp[row... | ALGO | 0.999945 | 5.882006 |
bbdca947-75f6-47cf-8754-29a355e52ff7 | lclpsoz/competitive-programming | neps-536/a/a.cpp | #include "bits/stdc++.h"
#include "ext/pb_ds/tree_policy.hpp"
#include "ext/pb_ds/assoc_container.hpp"
using namespace std;
////////////// Prewritten code follows. Look down for solution. ////////////////
#define x first
#define y second
#define LEN(x) ((int)(x).size())
#define ALL(x) x.begin(), x.end()
using ll = long... | ALGO | 0.99568 | 4.45568 |
c6f0c53c-736b-45d2-9634-3c8ca17587d5 | vbonnici/grafe-sim | analysis/data/p04001/s626354047.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
const int maxn=1e6+5;
multiset<ll> S[20];
char buff[20];
ll PW10[20]={1};
int main() {
for(int i=1;i<=10;i++) PW10[i]=PW10[i-1]*10;
cin>>(buff+1);int len=strlen(buff+1);
for(int i=1;i<=len;i++) buff[i]-='0';
S[0].i... | ALGO | 0.999836 | 4.216449 |
fb2872db-3ffb-46d2-99c1-e0598040bcae | abh253/codeforces | practice/dp (cses and cf)/Removing_Digits.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define mod 1000000007
#define FOR(i,x) for(ll i = 0; i < x; i++)
#define For(i,x,y) for(ll i = x; i <= y; i++)
#define rep(i,x,y) for(ll i = x; i >= y; i--)
#define errA(A) for(auto i:A) cout<<i<<" ";cout<<"\n";
#defin... | ALGO | 0.999933 | 3.957028 |
39230251-c930-45bf-b18c-410015b40d7e | Kay-Rick/Algorithm | 数学/有理数运算.cpp | /**
* @file 有理数运算.cpp
* @author Rick (<EMAIL>)
* @version 1.0
* @date 2020-07-13 22:36:18
* @brief 有理数的四则运算(注意辗转相除求最大公约数)
*
* @copyright Copyright (c) 2020 Rick, All Rights Reserved.
*
*/
/*
给定两个有理数,你的任务是实现基本算术,即计算它们的和,差,积和商。
输入格式
共一行,以 a1/b1 a2/b2 的形式给出两个有理数。
分子和分母都在 long int 范围内,如果存在负号,则... | ALGO | 0.999672 | 4.89691 |
8d9a746a-fc3f-4ed9-bb73-58571b246504 | Sumit2595/Leetcode-Problems | 0857-minimum-cost-to-hire-k-workers/0857-minimum-cost-to-hire-k-workers.cpp | class Solution {
public:
double mincostToHireWorkers(vector<int>& quality, vector<int>& wage, int k) {
vector<pair<double,int>>workers;
int n=quality.size();
for(int i=0;i<n;i++){
workers.push_back({(wage[i]*1.0)/quality[i],quality[i]});
}
sort(workers.begin(),wor... | ALGO | 0.999958 | 4.877653 |
5c7368e8-999a-4e12-8236-4e6b66946a8a | sampritipanda/IOI_Repository | Codeforces/Round_288/C.cpp | // Anya and Ghosts
#include <stdio.h>
#include <algorithm>
#include <queue>
using namespace std;
int main() {
int m, t, r; scanf("%d %d %d", &m, &t, &r);
int W[m];
for(int i = 0; i < m; i++) scanf("%d", &W[i]);
sort(W, W + m);
int end_time = W[m - 1];
int start_time = W[0] - r;
int next_ghost = 0;
... | ALGO | 0.999959 | 3.676454 |
e5dcf620-f2e5-4c0b-aafe-f40ffe4d5699 | nerraou/cpp-module-09 | ex01/RPN.cpp | #include "RPN.hpp"
RPN::RPN()
{
}
RPN::RPN(RPN const &other)
{
*this = other;
}
RPN &RPN::operator=(RPN const &other)
{
this->stack = other.stack;
return (*this);
}
void RPN::executeRPN(const std::string &expression)
{
const char *str = expression.c_str();
int i;
i = 0;
try
{
while (str[i] != '\0')
{
... | TOOL | 0.970609 | 4.246688 |
8b19f778-29b0-4db6-9e6b-6811a10403e8 | jeffriesd/competitive-programming | kattis/bard.cpp | // problem: https://open.kattis.com/problems/bard
#include<bits/stdc++.h>
#include<set>
using namespace std;
template <class A>
void unionTo(set<A> & xs, set<A> & ys) {
for (auto it = xs.begin(); it != xs.end(); it++) {
ys.insert(*it);
}
}
int main() {
int N;
int E;
int k;
cin >> N >> E;
vecto... | ALGO | 0.999877 | 3.740395 |
06bcf777-f374-49b1-98a1-cf59607be842 | PeizeSun/SparseR-CNN | detectron2/layers/csrc/box_iou_rotated/box_iou_rotated_cpu.cpp | namespace detectron2 {
template <typename T>
void box_iou_rotated_cpu_kernel(
const at::Tensor& boxes1,
const at::Tensor& boxes2,
at::Tensor& ious) {
auto num_boxes1 = boxes1.size(0);
auto num_boxes2 = boxes2.size(0);
for (int i = 0; i < num_boxes1; i++) {
for (int j = 0; j < num_boxes2; j++) {
... | ALGO | 0.991261 | 7.199579 |
280ccbce-9174-4a44-9f02-c3c808a17e71 | zdev128/CIS-5 | Hmwk/Assignment 4/Gaddis_9thEd_Chap5_Prob6_ProgrammingChallenges/main.cpp | /*
* File: main.cpp
* Author: Zachary Romero
* Created on October 16, 2018, 7:13 PM
* Purpose: HW 4
*/
#include <iostream>
using namespace std;
int main()
{
int speed, time;
int x1 = 1;
cout << "Enter your speed (mph/kph).\n";
cin >> speed;
cout << "Enter your hours traveled (h).\n";
... | ALGO | 0.972639 | 3.755908 |
3d60c2fc-88c7-4a96-ab95-a714517db30c | thegamer1907/Code_Analysis | contest/1542581718.cpp | #include <bits/stdc++.h>
#define endl '\n'
using namespace std;
set<int> s;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n, k;
cin >> n >> k;
for(int i = 0; i < n; i++) {
int p = 0;
for(int j = 0; j < k; j++) {
bool b;
cin >> ... | ALGO | 0.999963 | 5.10042 |
34bd0f6f-cfa2-41fa-a35b-04ea1742c10e | Pravi16/100DaysOfCode | Arrays/single_element_in_sorted_array.cpp | class Solution {
public:
int singleNonDuplicate(vector<int>& nums) {
int l=0,r=nums.size()-1;
while(l<r)
{
int m=l+(r-l)/2;
if((m%2==0 and nums[m]==nums[m+1]) or (m%2!=0 and nums[m]==nums[m-1])) l=m+1;
else r=m;
}
return nums[l];
}
}; | ALGO | 0.999777 | 5.776935 |
66587fb8-7337-44e6-87d2-854f43786f94 | ishandutta2007/codeforces | receed/normal/1290/B.cpp | #include <iostream>
#include <iomanip>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <cassert>
#include <string>
#include <set>
#include <map>
#include <random>
#include <bitset>
#include <string>
#include <unordered_set>
#include <unordered_map>
#include <deque>
... | ALGO | 0.999935 | 4.145941 |
9060b2e2-9851-4638-90bf-327e171f6d05 | balbinopb/CHALLENGE | paperwork.cpp |
//https://codewars.com/kata/55f9b48403f6b87a7c0000bd
#include <iostream>
using namespace std;
int paperwork(int n, int m){
if (n<1 || m<1){
return 0;
}
return n*m;
}
int main(){
cout<<paperwork(5,5)<<endl;
}
| ALGO | 0.999557 | 5.199978 |
82704b56-bf2a-4d10-af10-57da5c4825e9 | ADS-bot/Leetcode | 0916-decoded-string-at-index/0916-decoded-string-at-index.cpp | class Solution {
public:
string decodeAtIndex(string s, int k) {
long size = 0; // Length of decoded `s`
for (const char c : s)
if (isdigit(c))
size *= c - '0';
else
++size;
for (int i = s.length() - 1; i >= 0; --i) {
k %= size;
if (k == 0 && isalpha(s[i]))
... | ALGO | 0.98633 | 6.752042 |
eb5329f6-2b10-493e-824f-feb45f37a35d | Anish1081/CPP-Beginner-Practice | Provide change in US.cpp | #include <iostream>
using namespace std;
int main() {
const int dollar_value {100};
const int quarter_value {25};
const int dime_value {10};
const int nickel_value {5};
const int penny_value {1};
int change_in_cents;
std::cout << "Enter the change in cents = " << change_in_c... | ALGO | 0.94875 | 4.657863 |
fba938b9-6d8b-4316-b763-319402b2bae4 | ishandutta2007/codeforces | lucina/normal/1279/D.cpp | #include<bits/stdc++.h>
using namespace std;
int const nax = 1e6 + 10, mod = 998244353;
void plusle(int &a,int b){a+=b;if(a>=mod)a-=mod; return;}
void minun(int &a,int b){a-=b; if(a<0)a+=mod; return;}
int add(int a,int b) {a+=b;return a>=mod?a-mod:a;}
int sub(int a,int b) {a-=b;return a<0?a+mod:a;}
int mul(int a,int ... | ALGO | 0.999956 | 3.649576 |
0019cc71-6c7f-4901-af50-1215d7ae1d2c | asm123/codes | algorithms/Spoj/army.cpp | using namespace std;
#include <iostream>
#include <queue>
#include <stdio.h>
inline int read ()
{
char c;
int n = 0;
while ((c = getchar_unlocked ()) < 48);
n += (c - '0');
while ((c = getchar_unlocked ()) >= 48)
n = n * 10 + (c - '0');
return n;
}
int main (void)
{
int t = read ();
while (t--)
{
... | ALGO | 0.999582 | 3.881095 |
9fc909c0-4746-4757-93b6-9cc21ace7a4c | aniket887/Coding-In-CPP | recursion/1sumtillN.cpp | #include<iostream>
using namespace std;
int sum(int n){
if(n==1){
return 1;
}
return (n+sum(n-1));
}
int main(){
int n;
cin>>n;
cout<<"sum is:"<<sum(n)<<endl;
return 0;
}
| ALGO | 0.999947 | 3.876515 |
89965c3e-4fe7-4d8e-973d-01be73c72638 | SWEG-2014-EC-Batch/Code_Tamers | FoP-II/Class-Activities/Meron Kiflay/not worksheets/home works/modular programming/string methods (home work3)/stringmethods.cpp | #include <iostream>
#include <string>
#include "stringmethods.h"
using namespace std;
int main()
{
char str1[50];
//for the first function.
int s_l,s_vl,s_cl;
cout<<"enter your string: ";
gets(str1);
strLen(str1,s_l,s_vl,s_cl);
cout<<"the length of the string is: "<<s_l<<endl<<"it has "<<s_... | TOOL | 0.855438 | 3.799501 |
8689cf1f-cf2c-416f-975a-7ece5fe491ff | tecshogo/contest | ABC/167/B/answer.cpp | #define rep(i, n) for (int i = 0; i < (n); i++)
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
const int MOD = 1000000007;
// MAX int 2,147,483,647
// MAX O(n) 10^18
int main() {
ll A, B, C, K;
cin >> A >> B >> C >> K;
ll a, b, c;
if (K - A > 0) {
... | ALGO | 0.999974 | 3.90278 |
8ed07fe4-7209-4c04-a1f8-6c0c0f0a15b8 | raincross7/code-similarity | codes/train_code/problem396/problem396_433.cpp | #include<iostream>
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pi;
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define what_is(x) cerr << #x << " is " << x << endl;
#define MT make_tuple
#define eb emplace_back
#defin... | ALGO | 0.999867 | 3.625941 |
5904498c-d218-4c70-8222-71babc3ef3fc | Zaw28/Robotics | question1.cpp | #include <iostream>
using namespace std;
int sum(int a, int b)
{
return a + b;
}
int sum(int a, int b, int c)
{
return a + b + c;
}
int main()
{
int a = 4;
int b = 5;
int c = 6;
cout << " Sum of two numbers is :" << sum(a,b) << endl;
cout << " Sum of three numbers is :" << sum(a,b,c) << en... | ALGO | 0.991094 | 4.329897 |
464e6cfc-7af6-47ff-8aec-fd085a91fb73 | praveen-AIT/codeforces | greedy fox.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int t, i;
cin>>t;
while(t--)
{
int n, i, ans = INT_MIN, curr_sum;
cin>>n;
int a[n+10];
for(i=0; i<n; i++)
cin>>a[i];
for(i=0; i<n; i++)
{
curr_sum = a[i];
... | ALGO | 0.999894 | 4.041471 |
7883e3cd-cba2-4bd3-94c1-4b6e2b60f4fc | mazedul-ru-cse/flutter-todo-app | 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.998809 | 6.763549 |
62ca7d79-0970-40df-876c-7ba302721989 | hahakid/lidar_projection | fun_dense3D.cpp | /*************************************************************************/
/* Upsampling from dense 3D LIDAR */
/* */
/* C.Premebida: June/2014 */
/* http://webmail.isr.... | ALGO | 0.998131 | 5.302753 |
7a1447dd-d659-4211-b420-045f3a242e54 | genericSpecimen/problem-solving | dsa/heaps/703_kth-largest-element-in-a-stream.cpp | class KthLargest {
public:
priority_queue<int, vector<int>, greater<int>> min_pq;
int k;
KthLargest(int k, vector<int>& nums) {
this->k = k;
for (auto &num : nums) add(num);
}
int add(int val) {
if (min_pq.size() < k) {
min_pq.push(val);
} else if (va... | ALGO | 0.999941 | 6.173296 |
3aaaa29d-0eda-4b10-adb2-cbcd602cdd51 | ORNL-AMO/MEASUR-Tools-Suite | src/motorDriven/pumpFan/MoverEfficiency.cpp | #include "motorDriven/pumpFan/MoverEfficiency.h"
double MoverEfficiency::calculate() {
if (isPump) {
double const fluidPower = FluidPower(specificGravity, flowRate, head).calculate();
double const fluidPowerHp = fluidPower / 0.746; // convert to hp
return fluidPowerHp / moverShaftPower;
... | TOOL | 0.99188 | 4.962088 |
9f3f79db-2f6a-4a18-8dc3-73cd61aafbba | ANIKETRAJ28/DSA-and-CP | Dynamic Programming/leetcode/palindrome_and_more/palindrome-partitioning-iii.cpp | #include <bits/stdc++.h>
#define ll long long int
#define infp INT_MAX
#define infn INT_MIN
#define pp pair<int, int>
#define mod 1000000007
using namespace std;
template <typename T>
using vec = vector<T>;
// https://leetcode.com/problems/palindrome-partitioning-iii/
class Solution
{
public:
vector<vector<int>> d... | ALGO | 0.999989 | 5.450647 |
b9be7788-32aa-4d7a-8425-add77051aceb | ongsiru/AlgorithmStudy | 2023-11-21/2023-11-21.cpp | #include <string>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
// 크루스칼 -> 우선순위 큐 + union find, 간선 중심, 간선 가중치가 작은 것 부터 시작하는 경우, 모두 탐색
// 다익스트라 -> 우선순위 큐 + dist[점화식], 정점 중심, 출발점이 정해져 있는 경우, 정점 끝까지 탐색 안할 수 있음
vector<int> island(101);
bool cmp(vector<int> a, vector<int> b) {
retur... | ALGO | 0.999616 | 4.945558 |
8a8a446b-ae95-4f42-b32e-8acb7cf05d2c | maryskar/spbspu-labs-2023-tp-904-a | timofeev.maxim/T2/comparator.cpp | #include "comparator.h"
bool timofeev::Comparator::operator()(const DataStruct& lhs, const DataStruct& rhs)
{
if (lhs.key1 == rhs.key1)
{
if (std::abs(lhs.key2) == std::abs(rhs.key2))
{
return lhs.key3.length() < rhs.key3.length();
}
return std::abs(lhs.key2) < std::abs(rhs.key2);
}
retu... | ALGO | 0.94036 | 4.897901 |
8b9d77da-fba0-42a9-b452-88a3b14d5c12 | snkt-30/LeetCode_Que | 2448-minimum-cost-to-make-array-equal/2448-minimum-cost-to-make-array-equal.cpp | class Solution {
public:
long long cal(vector<int>& nums,vector<int>& cost,long long median)
{
long long ans=0;
for(int i=0;i<nums.size();i++)
{
ans+=abs(1ll*(nums[i]-media... | ALGO | 0.999995 | 5.616594 |
68c317f7-0adc-4e72-b964-fd32510b1fc5 | sashank6/Misc-Codes | competitiveprogramming/hackerrank/projecteuler/17.cpp | #include <iostream>
#include<vector>
#include<cmath>
#include<algorithm>
using namespace std;
vector<string> v;
vector<string> v1;
void init()
{
v.push_back("Zero");
v.push_back("One");
v.push_back("Two");
v.push_back("Three");
v.push_back("Four");
v.push_back("Five");
v.push_back("Six");
v.push_back("Seven");
... | ALGO | 0.999238 | 6.189978 |
dc60b697-025b-4769-a352-a12ddf4a0e92 | raincross7/code-similarity | codes/train_code/problem289/problem289_135.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <utility>
#define rep(i,n) for(int i = 0; i < n; ++i)
#define rep1(i,n) for(int i = 1; i <= n; ++i)
using namespace std;
template<class T>bool chmax(T &a, const T &b) { if(a < b){ a = b; return 1; } return 0; }
template<class T>bool c... | ALGO | 0.999847 | 3.4367 |
1d551a64-3290-4d4c-a13c-5fe7bceaa542 | YukiNasumi/csp | 07/cpp/3.cpp | #include<bits/stdc++.h>
using namespace std;
int P;
string current_dir;
vector<string>split(string& dir){
int start=0,end = 0;
vector<string>res;
if(!dir.length()) return res;
int l = dir.length();
if(dir[0]=='/') res.push_back("/");
for(int i =0;i<l;i++){
char c = dir[i];
if(c==... | ALGO | 0.997206 | 3.853128 |
e644b43b-d420-4378-b25c-7fc6e71df9fa | TChauhan04/Leetcode | remove_element.cpp | #include <vector>
#include <iostream>
int removeElement(std::vector<int>& nums, int val) {
int k = 0; // Pointer to place the next non-val element
for (int i = 0; i < nums.size(); ++i) {
if (nums[i] != val) {
nums[k] = nums[i];
k++;
}
}
return k;
}
int main() {
... | ALGO | 0.999879 | 6.15245 |
cdf2a2c0-58d7-452f-b74b-2b8cac477907 | alexcano98/cuda-exercises | practicaHeterogeneos/codigoCuda.cpp | #include "cuda_runtime.h"
#include "device_launch_parameters.h"
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/opencv.hpp>
#include <stdio.h>
using namespace cv;
float * createFilter(int width)
{
const float sigma = 2.f; ... | ALGO | 0.99563 | 4.624422 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.