uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
357d67f1-4153-43c0-9749-80fd8c5763f4 | CascoOnce/leetcode | 2678_SeniorCitizencs/calculo.cpp | // Problema: https://imgur.com/a/GQZ2zes
// Solución por calculo
// Entradas:
/*
Caso 1:
{"7868190130M7522","5303914400F9211","9273338290F4010"};
Caso 2:
{"1313579440F2036","2921522980M5644"};
*/
#include <iostream>
#include <vector>
using namespace std;
class Solution{
public:
int countS... | ALGO | 0.990709 | 5.941217 |
42a6e356-0214-4f1e-89ad-c87eb9342402 | cicuvc/LLVM-LA32R | libcxx/test/std/containers/sequences/vector.bool/append_range.pass.cpp | // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=2000000
// template<container-compatible-range<bool> R>
// constexpr void append_range(R&& rg); // C++23
#include <vector>
#include "../insert_range_sequence_containers.h"
#include "test_macros.h"... | TEST | 0.981382 | 6.811946 |
4ec7601d-8cc0-4b09-96f8-6995139d78aa | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_3578_1.cpp | #include <bits/stdc++.h>
using namespace std;
int dp[2][15][15];
int val[15];
int n;
int pos[20];
int ta[20];
int count(int l, int ind) {
if (ind == 6) return 1;
int ret = 0;
for (int i = 0; i <= min(l, n); i++) {
if (ta[i] == pos[i]) continue;
ta[i]++;
ret += (int)((long long)(pos[i] - ta[i] + 1) * c... | ALGO | 0.999888 | 4.232743 |
0739ae7b-ed78-44b8-8a14-7c4536f3c0d0 | Samoy/krahets-algorithm-88 | 024.字符串相加/main.cpp | #include <iostream>
#include <string>
using namespace std;
class Solution {
public:
string addStrings(string num1, string num2) {
// 确保num1是较长的数,如果num2更长则交换两者
if (num1.length() < num2.length()) {
swap(num1, num2);
}
// 在较短的数字前补零,使两个数字长度相同
int diff = num1.length(... | ALGO | 0.999592 | 6.123445 |
d11710e4-d53e-4614-a952-d995757671a9 | gabrielaconstante/magic-ball | 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 |
883a3f02-a20c-4316-9b9e-0408937ddae4 | Wallacoloo/ME498-CudaSynth | CudaSynth/JuceLibraryCode/modules/juce_graphics/geometry/juce_Path.cpp | // tests that some coordinates aren't NaNs
#define JUCE_CHECK_COORDS_ARE_VALID(x, y) \
jassert (x == x && y == y);
//==============================================================================
namespace PathHelpers
{
const float ellipseAngularIncrement = 0.05f;
static String nextToken (String::CharPoin... | TOOL | 0.939807 | 3.584853 |
076f88e2-76fa-4209-85b2-15361695cbcf | filipmazurek/spa-artifact | docker-share/gem5/src/systemc/tests/systemc/misc/v1.0/dash1/speed.cpp | /*****************************************************************************
speed.cpp -- Definition of the speedometer.
Original Author: Ali Dasdan, Synopsys, Inc.
*****************************************************************************/
/*************************************************************... | ALGO | 0.876196 | 5.949629 |
f993f035-a982-4f30-a4c3-56676e118e82 | MohnishK7/Competitive-Programming | CF_Ladder/timeline.cpp | #include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define A(X) (X).begin(), (X).end()
#define F0R(i, a, b) for (int i = a; i < b; i++)
#define S2 S
#define PII pair<int, int>
#define PB push_back
#define MP make_pair
#define SQ(a) (a)*(a)
typedef long long ll;
typedef vector<int> vi;
#def... | ALGO | 0.999948 | 4.700723 |
fad8b71a-20d0-48c2-b049-6e167705c72a | nishchyapratapsingh/leetcode-problems | 0013-roman-to-integer/0013-roman-to-integer.cpp | class Solution {
public:
int value(char c) {
switch(c) {
case 'M':
return 1000;
case 'D':
return 500;
case 'C':
return 100;
case 'L':
return 50;
case 'X':
return 10;
... | ALGO | 0.999829 | 6.204098 |
a5978acf-cb48-49fa-90f2-6efbf2fe265a | Lev0071/OOP_2800ICT | Week_10/PS10/PS10_trace.cpp | #include <iostream>
#include <memory>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <ctime>
using namespace std;
template <typename T>
class TreapNode
{
private:
T key;
int priority;
shared_ptr<TreapNode<T>> left;
shared_ptr<TreapNode<T>> right;
public:
TreapNode() : key(T(0)... | ALGO | 0.999938 | 5.468941 |
b3c1b37e-d310-44b3-9467-f0b19bfe3d10 | map-A/TIMU | NCTest/yuanfudao1.cpp | #include "bits/stdc++.h"
using namespace std;
typedef long long LL;
void solve() {
string boxes;
cin >> boxes;
stack<string> s;
for (int i = 0; i < boxes.size(); i++) {
if (s.empty()) {
string c(1, boxes[i]);
s.push(c);
} else if (boxes[i] == '[') {
... | ALGO | 0.996197 | 4.071276 |
266cc3f4-c764-4ddf-8a23-85b93011c07f | manassinghdewari/dsa | 06Sorting/07SelectionSort.cpp | // Selection Sort
// thetha(n^2)
// does less memory writes compared to QuickSort,MergeSort and Insertion Sort
// But cycle sort isd optimal in terms of memory writes.
// basic idea for the heap sort
// not stable
// In place
// efficient approach
#include<bits/stdc++.h>
using namespace std;
void selectionSort(int a... | ALGO | 0.999959 | 5.534677 |
83a741da-ef04-47b6-9520-f3af28f13ba6 | liangkang233/leetcode-cpp | 152.乘积最大子数组.cpp | /*
* @lc app=leetcode.cn id=152 lang=cpp
*
* [152] 乘积最大子数组
*/
#include <iostream>
#include <vector>
using namespace std;
// @lc code=start
// 和 53题一样的动态规划 此处维护两个值 一个最小值 一个最大值 (不一定正负数)
class Solution {
public:
int maxProduct(vector<int>& nums) {
int ans = nums[0], last_min = ans, last_max = ans;
... | ALGO | 0.999979 | 5.858748 |
406d188e-cba5-4a77-a94b-95c81d34cca5 | Ratnakar-7/Codeforces-practice-I | A_Magnets.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
ios::sync_with_stdio(false);
cin.tie(NULL);
long long int n, a = 0;
string s, checker;
cin >> n;
cin >> s;
a++;
checker = s;
while (cin >> s)
{
if (s != checker)
{
a++;
checke... | ALGO | 0.999771 | 3.474052 |
634a99b1-28f2-44f2-b990-90587af16779 | MinQyu/algorithm | BOJ/BOJ1330.cpp | #include "H.h"
#include <iostream>
using namespace std;
void BOJ1330()
{
int A, B;
cin>>A >>B;
if (A > B)
{
cout << ">";
}
else if (A < B)
{
cout << "<";
}
else
{
cout << "==";
}
}
| ALGO | 0.999987 | 4.14026 |
c98660ef-692d-413d-8428-6c38e26caff1 | raincross7/code-similarity | codes/train_code/problem147/problem147_202.cpp | #include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (n); i++)
int int_len(int n) {
int s=0;
while(n!=0) s++, n/=10;
return s;
}
int int_sum(int n) {
int m=0,s=0,a=n;
while(a!=0) s++, a/=10;
for(int i=s-1;i>=0;i--) m+=n/((int)pow(10,i))-(n/((int)pow(10,i+1)))*10;
return m;
}... | ALGO | 0.999815 | 4.026492 |
244f6dc7-f570-4357-a1af-30af6542834d | Dexter9532/Winning_car_2025_yrgo_grand_prix | src/main.cpp | #include <Servo.h>
#include <Arduino.h>
// === PIN-KONFIGURATION ===
#define L_EN 8
#define R_EN 7
#define L_PWM 5
#define R_PWM 6
#define SERVO_PIN 9
// === SENSOR-PINS ===
#define IR_LEFT A2
#define IR_MIDDLE A3
#define IR_RIGHT A0
// === OBJEKT ===
Servo steeringServo;
// === KONSTANTER ===
const in... | TOOL | 0.898429 | 5.477098 |
dc8d0623-6f32-4547-a058-cc514543e40c | aipowermeme/aipowermeme-node | src/util/settings.cpp | #include <util/settings.h>
#include <tinyformat.h>
#include <univalue.h>
namespace util {
namespace {
enum class Source {
FORCED,
COMMAND_LINE,
RW_SETTINGS,
CONFIG_FILE_NETWORK_SECTION,
CONFIG_FILE_DEFAULT_SECTION
};
//! Merge settings from multiple sources in precedence order:
//! Forced config > co... | TOOL | 0.994542 | 7.620586 |
fba4adec-3fc7-45fc-8325-60c9700f5a6b | JasonDavie93/grenade-battle-project | Grenade Battle Project/EasingFunction.cpp | #include "EasingFunction.h"
//Practical task - Easing function
sf::Vector2f EasingFunction::EaseOutQuad(sf::Vector2f begin, sf::Vector2f change, float duration, float time)
{
sf::Vector2f quadEaseOut = (-(change / (duration * duration)) * (time * time) + (2.0f * (change / duration) * time) + begin);
return qu... | ALGO | 0.996867 | 5.129521 |
b7a287a0-5048-4523-8c3b-41a5fd2966a7 | ad1tyx666/android_frameworks_av | media/codecs/amrnb/enc/src/lag_wind.cpp | /*
------------------------------------------------------------------------------
Pathname: ./audio/gsm-amr/c/src/lag_wind.c
Date: 01/31/2002
------------------------------------------------------------------------------
REVISION HISTORY
Description:
1. Eliminated unused include files.
... | ALGO | 0.998636 | 6.65848 |
b1a09cac-3356-429d-9f2c-fed42f4957a0 | vaibhavkpatel1/Algorithmic_Design_and_Techniques | signcollection.cpp | #include<bits/stdc++.h>
using namespace std;
void sortarr(long int *p,long int *q,int n){
long int mini;
int i,j,miniindex;
for(i=0;i<n;i++){
mini=p[i];
miniindex=i;
for(j=i;j<n;j++){
if(mini>p[j]) {mini=p[j];miniindex=j;}
}
swap(p[i],p[miniindex]);
swap(q[i],q[miniindex]);
}
}
in... | ALGO | 0.999985 | 3.023021 |
910d25f0-aebd-4650-a942-36672466bf63 | sarvex/leetcode-c3 | solution/1400-1499/1420.Build Array Where You Can Find The Maximum Exactly K Comparisons/Solution.cpp | class Solution {
public:
int numOfArrays(int n, int m, int k) {
if (k == 0) return 0;
int mod = 1e9 + 7;
using ll = long long;
vector<vector<vector<ll>>> dp(n + 1, vector<vector<ll>>(k + 1, vector<ll>(m + 1)));
for (int i = 1; i <= m; ++i) dp[1][1][i] = 1;
for (int i ... | ALGO | 0.999997 | 5.379606 |
d8fc2fc0-e296-46b7-84ac-6ad4c5cc1ff3 | Nishit33/C-AND-CPP | Assignment/Module 3/Looping Statements , conditional statement/task14.cpp | // 14.Accept 5 numbers from user and find those numbers factorials
#include <stdio.h>
int factorial(int n)
{
int result = 1;
for (int i = 1; i <= n; i++)
{
result *= i;
}
return result;
}
int main()
{
int numbers[5];
printf("Enter 5 numbers:\n");
for (int i = 0; i < 5; i++)
{
... | ALGO | 0.999458 | 4.738447 |
554485ba-62d0-4e6e-bb6f-120334a27164 | ysk24ok/leetcode-submissions | 0575/hashset.cpp | #include <gtest/gtest.h>
#include <cstdlib>
#include <unordered_set>
#include <vector>
using namespace std;
class Solution {
public:
int distributeCandies(vector<int>& candyType) {
unordered_set<int> unique_candy_type;
for (const int& candy_type : candyType) {
unique_candy_type.insert(candy_type);
... | ALGO | 0.998441 | 6.36028 |
07af07fc-ac82-4ccb-a549-bdde7306f207 | moto23/MyCodes | 1614-maximum-nesting-depth-of-the-parentheses/1614-maximum-nesting-depth-of-the-parentheses.cpp | class Solution {
public:
int maxDepth(string s) {
int n = s.size();
stack<char> st;
int ans = 0;
for(int i = 0; i < n; i++){
if(s[i] == '('){
st.push('(');
int sz = st.size();
ans = max(ans, sz);
} else if(s[i]... | ALGO | 0.999587 | 5.646646 |
67819c8e-37c0-48c8-8577-9f45352e4ba5 | ishita-5062/technicalresources26cohort | a1_q5.cpp | #include <iostream>
using namespace std;
int main(){
int num;
cin>>num;
int count=0;
while (num!=0){
count+=1;
num=num/10;}
cout<<count;
} | ALGO | 0.999346 | 3.514969 |
a2bda372-50cd-4156-87ad-941088e3f07b | chrisemm96/Practicas-C- | practicas C++/metodo burbuja.cpp | //Metodo Burbuja
#include <iostream>
#include <stdlib.h>
#include <conio.h>
#include <string.h>
using namespace std;
int main(){
int numeros [] ={4,1,2,3,5};
int i,j,aux;
for(i=0;i<5;i++){
for(j=0;j<5;j++){
if(numeros[j] > numeros[+1]){
aux = numeros[j];
numeros[j] = numeros[j+1];
numeros[j+1] = aux;
... | ALGO | 0.999843 | 4.026715 |
3e7a8ec4-042c-4d2f-830c-d81b680eb6f3 | AyushSama/Problem-Solving | Feb 1 , 2023/CombinationSum.cpp | #include<bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define int long long
void CombinationSum(int arr[], int n , int target , vector<int>& v , int idx , set<vector<int>>& st){
if(idx == n){
if(target==0){
sort(v.begin(),v.... | ALGO | 0.999867 | 4.595177 |
cb8ff79d-6ba2-4d72-84f1-0902bc2e0fe7 | goodstudyqaq/ACM | codeforces/2000-2099/2004/B.cpp | #include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#include "copypaste/debug.h"
#else
#define debug(...) 42
#endif
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
struct fast_ios {
fast_ios() {
cin.tie(nullptr);
ios::sync_with_stdio(false);
cout << fix... | ALGO | 0.999565 | 3.749516 |
3bd32930-afdc-4279-a8b8-78ba07f409f0 | HHS-Proclub/hhs-pro-club-website | solutions/PRA4/testies@gmail.com.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
#define pb push_back
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
using pi = pair<int, int>;
#define f first
#define s second
#define mp make_pair
void setIO(string name = "") {
ios_base::sync_with_stdio... | ALGO | 0.999906 | 4.748253 |
0dc2857e-c05c-4fad-8bd7-a281d2a8c35a | zhangweichen2006/SRDAN_Open | pcdet/ops/iou3d_nms/src/iou3d_cpu.cpp | #include <stdio.h>
#include <math.h>
#include <torch/serialize/tensor.h>
#include <torch/extension.h>
#include <vector>
#include <cuda.h>
#include <cuda_runtime_api.h>
#include "iou3d_cpu.h"
#define CHECK_CUDA(x) do { \
if (!x.type().is_cuda()) { \
fprintf(stderr, "%s must be CUDA tensor at %s:%d\n", #x, __FILE_... | ALGO | 0.998307 | 5.394082 |
341ea17d-d9d1-4e70-960b-29db2a8fd80f | Andrea-09/PED0319-AMRA-00366519 | PED0319/Laboratorio 05/CW-01.cpp | #include <iostream>
using namespace std;
struct node
{
int n;
node *next;
};
typedef node *st;
void initialize(st *s);
void push(st *s, int n);
int top(st *s);
int pop(st *s);
int main(void)
{
st s;
initialize(&s);
push(&s, 5);
push(&s, 7);
push(&s, 4);
push(&s, 1);
cout << to... | ALGO | 0.99976 | 4.068475 |
61d15880-232f-4763-9990-a4768673a816 | Kaneko773/Main_20231005 | Main_20231005/Main_20231005.cpp | // Main_20231005.cpp : このファイルには 'main' 関数が含まれています。プログラム実行の開始と終了がそこで行われます。
//
#include <iostream>
#include "janken.h"
#include "kazuate.h"
using namespace std;
enum MODE {
janken = 1,
kazuate = 2,
End = 3,
};
int main()
{
int mode = 0;
do{
printf("1:じゃんけん 2:数当て 3:終了\n\n > ");
cin ... | TOOL | 0.896125 | 4.565509 |
00bbdf5e-a7ee-4b7b-a750-be1a0140d6c2 | Sanjay-sundaresan/CSAT | module allotment.cpp | #include <bits/stdc++.h>
using namespace std;
string bookingTime()
{
string booking_time;
time_t now = time(0);
char* ltm = ctime(&now);
booking_time=ltm;
return booking_time;
}
struct hos
{
char hosname[30];
int size;
int fill;
}admin[10]={
{"ABC",700,0},
... | ALGO | 0.957705 | 3.819936 |
d200af55-9c17-408d-85b1-8022be62433d | AndrewApanovich/Bioinform | 2.2.cpp | #include <map>
#include <iostream>
#include <string>
using namespace std;
map<string, char> codonAccord = { { "AAA", 'K' },{ "AAC", 'N' },{ "AAG", 'K' },{ "AAU", 'N' },{ "ACA", 'T' },{ "ACC", 'T' },{ "ACG", 'T' },{ "ACU", 'T' },
{ "AGA", 'R' },{ "AGC", 'S' },{ "AGG", 'R' },{ "AGU", 'S' },{ "AUA", 'I' },{ "AUC", 'I' ... | ALGO | 0.999954 | 4.290617 |
cf243dc1-ddbc-4e31-9285-ff0538ff6a27 | Nilesh2000/ErrorFreeCodes | CodeForces/1038A - Equality.cpp | //Header Files
# include <bits/stdc++.h>
using namespace std;
int main(void) //Driver Function
{
int n, k;
string s;
cin >> n >> k >> s;
int Arr[k] = {0};
//k represents the first k characters of the alphabet.
//First we need to find the frequencies of the first k alphabets in the string. Let ... | ALGO | 0.999971 | 3.933113 |
63deb89a-bf60-4db0-a693-d1131a4eb5a9 | ShaoZyNwpu/opengauss_backpressure | src/common/backend/utils/adt/nlssort.cpp | #include "postgres.h"
#include "mb/pg_wchar.h"
#include "utils/builtins.h"
#include "knl/knl_session.h"
#include "../mb/nlssort/nlssort_pinyin_map1_simple.map"
#include "../mb/nlssort/nlssort_pinyin_map1_complex.map"
#include "../mb/nlssort/nlssort_pinyin_map3.map"
#include "../mb/nlssort/nlssort_pinyin_map5.map"
boo... | TOOL | 0.99782 | 5.423679 |
e0c8c1c9-c4eb-412b-97ab-69bd9c2cef86 | ayushgoyal04/Learning-Journey | Learning-DSA/Training placement classes/Contest on Sorting Techniques/G.cpp | #include <bits/stdc++.h>
using namespace std;
long long merge(vector<int>& arr, int l, int m, int r) {
long long inversions = 0;
int n1 = m - l + 1;
int n2 = r - m;
vector<int> L(n1), R(n2);
for (int i = 0; i < n1; i++)
L[i] = arr[l + i];
for (int j = 0; j < n2; j++)
R[j] = ar... | ALGO | 0.999843 | 5.326584 |
8e4bc48e-6123-46f3-a2b9-446d5aa6e573 | elibensasson/SCI-POC | PoCPCP/PCP/src/reductions/BREXtoACSP/Routing/BenesNetwork.cpp | /**
* @file BenesNetwork.cpp
* @brief This file implements algorithms needed for BenesNetwork construction
*
* # Claim #
* For any any given permutation \f$ \pi: \{0,1,\dots,2^k -1\} \to \{0,1,\dots,2^k -1\} \f$,
* there exists a Benes network of degree \f$ k \f$ that routs the data packets \f$ \{0,1... | ALGO | 0.999738 | 5.165035 |
0095769d-e494-4e83-94f8-ab550db58087 | bharatsunny/OPEN-CV | samples/gpu/pyrlk_optical_flow.cpp | #include <iostream>
#include <vector>
#include <opencv2/core.hpp>
#include <opencv2/core/utility.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/video.hpp>
#include <opencv2/cudaoptflow.hpp>
#include <opencv2/cudaimgproc.hpp>
#include <opencv2/cudaarithm.hpp>
using namespace std;
... | ALGO | 0.902595 | 6.156531 |
701d5b90-6293-4dc9-ac31-cf7f795d040a | IqbalMahbub/First-project | LINKLIST.cpp | #include<bits/stdc++.h>
using namespace std;
struct node{
int info;
struct node *next;
}*head;
//typedef struct node ;
void traversing()
{
struct node *currrent;
if(head=NULL)
{
cout<<"List is Empty"<<endl;
return;
}
currrent=head;
while(currrent !=NULL)
{
cout<<"DATA... | ALGO | 0.999017 | 3.101139 |
bba03dfc-5316-4de1-ba6c-c942d381cb45 | brotherchris/Candy_Claw | firmware/Marlin-2.1_machine/Marlin/src/gcode/motion/G5.cpp | #include "../../inc/MarlinConfig.h"
#if ENABLED(BEZIER_CURVE_SUPPORT)
#if AXIS_COLLISION('I') || AXIS_COLLISION('J')
#error "G5 parameter 'I' or 'J' collision with axis name."
#endif
#include "../../module/motion.h"
#include "../../module/planner_bezier.h"
/**
* Parameters interpreted according to:
* https://li... | ALGO | 0.920613 | 7.579149 |
945d1060-1dd4-4fea-beab-625b87d97fa9 | levi77/FDTD-CATS | FDTD_1D/Skew Code_cpp/FDTD_skewed.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <chrono>
//g++ -g -Wall -std=c++11 FDTD_skewed.cpp -o FDTD_skewed
//valgrind --tool=cachegrind --cachegrind-out-file=outfdtd_skewed ./FDTD_skewed
//TEST FDTD time skewing
int main() {
std::vector<float> E2 = { 0, 0, 0, 0, 10, 0, 0, 0, 0 };
... | ALGO | 0.993478 | 3.848564 |
ebd2f476-03da-4876-9665-87f03343e7d9 | arduinocc04/Algorithm | BOJ/C++/1032-명령프롬포트.cpp | #include <iostream>
int main()
{
char inputs[51][51], pattern[51], character;
int loopNum;
int j = 0;
std::cin >> loopNum;
for(int i = 0; i < loopNum; i++)
{
std::cin >> inputs[i];
}
for(j = 0; j < 50; j++)
{
character = inputs[0][j];
for(int k = 0; k < loopN... | ALGO | 0.99992 | 3.632431 |
0fdba167-a0fb-4f9e-a88b-7b9b2bc96a9c | MikaelVallenet/R-Type | libs/boost/libs/sort/benchmark/parallel/benchmark_objects.cpp | //----------------------------------------------------------------------------
/// @file benchmark_objects.cpp
/// @brief Benchmark of several sort methods with different objects
///
/// @author Copyright (c) 2016 Francisco José Tapia (<EMAIL> )\n
/// Distributed under the Boost Software License, Version 1.0.\n... | TEST | 0.960935 | 6.158231 |
d2cc9d80-0b7f-4fe8-a8a7-57b762fb3431 | CrBillman/LAMMPS | compute_reduce.cpp | #include <string.h>
#include <stdlib.h>
#include "compute_reduce.h"
#include "atom.h"
#include "update.h"
#include "domain.h"
#include "modify.h"
#include "fix.h"
#include "force.h"
#include "comm.h"
#include "group.h"
#include "input.h"
#include "variable.h"
#include "memory.h"
#include "error.h"
using namespace LAMM... | ALGO | 0.998957 | 5.680928 |
140f325d-f660-4820-bd1d-7e647801aae6 | Gohilvd04/Problem_Solving | 450DSA/Nth_fibonacci_number.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
/*
* This program calculates the Nth Fibonacci number.
* It reads an integer n from the input and prints the Nth Fibonacci number.
*/
int n;
cin >> n; // Read the input value n
// Handle edge cases where n is 0 or a negative num... | ALGO | 0.999989 | 6.928126 |
355e82d6-34ab-4efd-98d7-631476f9ad76 | jeromed56/provider_example | providerexample/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.998602 | 6.772262 |
805dd1f3-749e-4500-8ed9-c95856ffb16c | Zu-rin/AtCoder | AtCoder_Regular_Contest/ARC027/ARC027B.cpp | #include <iostream>
#include <vector>
#include <string>
#include <list>
#include <queue>
#include <algorithm>
#define rep(i, n) for(i = 0; i < (n); i++)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define MOD 1000000007
#define PI 3.14159265358979323846
#define INF 1 << 30
using namespace std;
... | ALGO | 0.999937 | 4.092312 |
3208bfee-db05-45e4-9199-707561053133 | CtrlShift-Esc/Programers | lv0/c++/배열 회전시키기.cpp | //https://school.programmers.co.kr/learn/courses/30/lessons/120844
#include <string>
#include <vector>
using namespace std;
vector<int> solution(vector<int> numbers, string direction) {
vector<int> answer(numbers);
if (direction[0] == 'r')
{
int n = *(answer.end()-1);
answer.pop_back();
... | ALGO | 0.999953 | 5.746772 |
1bb02297-2a31-4f1e-a84c-aa229bc9748b | i-rony18/leetcode | my-folder/problems/check_if_there_is_a_valid_partition_for_the_array/solution.cpp | class Solution {
public:
bool validPartition(vector<int>& nums) {
int n = nums.size();
int dis3=1;
int dis2=0;
int dis1=0;
if(nums[1] == nums[0]) dis1=1;
for(int i=2;i<n;i++){
int dis0=0;
if(nums[i] == nums[i-1] && dis2==1)
di... | ALGO | 0.999972 | 5.532651 |
fc0daa72-b39b-4b80-9af4-dd76708bc3f3 | avnyaswanth/leet-code | Topological sort - GFG/topological-sort.cpp | // { Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
public:
stack<int> stk;
bool vis[10000];
void dfs(int ver, vector<int> adj[])
{
vis[ver] = 1;
for(auto adjVer : adj[ver])
{
if(!vis[adjVer])
dfs(adjVer, adj);
}
... | ALGO | 0.999925 | 6.655064 |
583b57d4-b982-4f38-af6f-ef66fb6a2c1e | procojd/leetcode | 2255-count-prefixes-of-a-given-string/2255-count-prefixes-of-a-given-string.cpp | class Solution {
public:
int countPrefixes(vector<string>& words, string s) {
int count=0;
for(int i=0;i<words.size();i++)
{
if(s.find(words[i])==0)
count++;
}
return count;
}
}; | ALGO | 0.999857 | 5.625932 |
15600c5b-05a2-4d84-9f12-948f4f5d97f3 | saurabhraj042/placement-prep | leetcode/archives_am/657.robot-return-to-origin.cpp | // https://leetcode.com/problems/robot-return-to-origin/
class Solution {
public:
bool judgeCircle(string moves) {
vector<int> pos(2, 0);
for(char c : moves){
if(c == 'L'){
pos[1]++;
} else if(c == 'R'){
pos[1]--;
} else if... | ALGO | 0.999921 | 6.040796 |
f4841774-e19b-46d4-b521-3d60ae07f4e7 | delwar03/CF | E_Insert_or_Erase.cpp | #include <bits/stdc++.h>
// #pragma GCC optimize("Ofast")
// #pragma GCC optimize ("unroll-loops")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
template <typename T> using o_set ... | ALGO | 0.999987 | 4.839636 |
3ac0682f-844b-4223-bb14-1f92bfb4a0f5 | Maksasj/megaboost | libs/compute/example/sort_vector.cpp | #include <algorithm>
#include <iostream>
#include <vector>
#include <boost/compute/system.hpp>
#include <boost/compute/algorithm/copy.hpp>
#include <boost/compute/algorithm/sort.hpp>
#include <boost/compute/container/vector.hpp>
namespace compute = boost::compute;
int rand_int()
{
return rand() % 100;
}
// this... | ALGO | 0.999628 | 5.922979 |
e9afec84-5788-435e-a2bd-4983d8398d60 | airen3339/remill | lib/Arch/X86/Semantics/SHIFT.cpp | #pragma once
namespace {
template <typename D, typename S1, typename S2>
DEF_SEM(SHR, D dst, S1 src1, S2 src2) {
auto val = Read(src1);
auto shift = Read(src2);
auto long_mask = Literal<S1>(0x3F);
auto short_mask = Literal<S1>(0x1F);
auto op_size = BitSizeOf(src1);
auto shift_mask = Select(UCmpEq(op_size,... | ALGO | 0.950761 | 7.261261 |
bec1fe35-d371-45c9-9e46-9140ecb0fe72 | DeependraParmar/DSA | My Programs/03 Patterns (Conceptual View of Loops)/16_invertedStarTriangle.cpp | #include <iostream>
using namespace std;
int main(){
// * * * * *
// * * * *
// * * *
// * *
// *
int n;
cout << "Enter the value of n: ";
cin >> n;
for(int i=n; i >= 1; i--){
for(int j=1; j<=i; j++){
cout << "*" << " ";
}
cout << endl;
}
... | ALGO | 0.999729 | 4.0146 |
6edbcbda-95d5-4c30-9c5c-30bb47ae2772 | Aseenshaik786/oops-c- | armstrong.cpp | #include<iostream>
using namespace std;
int main()
{
int n,r,sum=0,temp;
cout<<"enter n value:";
cin>>n;
temp=n;
while(n>0)
{
r=n%10;
sum=sum+(r*r*r);
n=n/10;
}
if(temp==sum)
{
cout<<"Armstrong number";
}
else
{
cout<<"Not an armstrong number";
}
}
| ALGO | 0.999896 | 3.995979 |
609d9c9b-fe1a-400d-b5fc-d21801ac94d9 | VemundStenbekkThorkildsen/Assigment2 | cpp/maxoffdiag.cpp | #include <iostream>
#include <armadillo>
#include "time.h"
#include "jaco.h"
using namespace std;
using namespace arma;
//This function returns the maximum value of
double maxoffdiag ( mat& A, int& k, int& l, int n )
{
mat U = abs(trimatu(A,1)); //Creates U, the upper triangular matrix of A
double index = U.in... | ALGO | 0.99989 | 4.18562 |
b6f7b021-d338-4468-86e0-4665716b0182 | mkd/chess0 | src/search.cpp | // @file search.cpp
//
// This file contains the main search methods for finding the best next move.
//
// It is based on a simple alpha-beta pruning mechanism runnning on top of a
// mini-max, with plenty of optimizations.
#if defined(_WIN32) || defined(_WIN64)
#include <conio.h>
#else
#include <unistd.h>
#endif
#inc... | ALGO | 0.999476 | 5.798042 |
49d76c3b-3ea9-4c75-bc61-f5f0c36a3a22 | PRANAVJARANDE/CSES | Introductory Problems/Apple Division.CPP | #include <bits/stdc++.h>
using namespace std;
#define MOD (int)(1e9 + 7)
#define ll long long
#define vin vector<int> v1(n); for (int i = 0; i < n; i++) cin >> v1[i];
long long mod_pow(long long base, long long exponent, int mod) {
long long result = 1;
base = base % mod;
while (exponent > 0) {
... | ALGO | 0.99935 | 4.606208 |
d53b5944-08b2-44ff-80e2-b54a208f297d | ishandutta2007/codeforces | rnsiehemt/normal/590/A.cpp | #include <bits/stdc++.h>
#define sz(x) ((int)((x).size()))
template<typename T> bool domax(T &a, T b) { return (b > a ? (a = b, true) : false); }
template<typename T> bool domin(T &a, T b) { return (b < a ? (a = b, true) : false); }
typedef long long ll;
const int MaxN = 500005;
int N, a[MaxN], ans;
void go(int i, i... | ALGO | 0.999997 | 3.162127 |
88b5d8e4-15df-45b2-95d5-d21e960b2bd9 | vaibhavpandey2012000/compatative-Programming | recursion/num_to_string.cpp | #include<bits/stdc++.h>
using namespace std;
void fxn(int n)
{
switch(n)
{
case 1:
cout<<"one ";
break;
case 2:
cout<<"two ";
break;
case 3:
cout<<"three ";
break;
case 4:
cout<<"four ";
break;
case 5:
cout<<"five ";
break;
case 6:
cout<<"six ";
break;
case 7:
cout... | ALGO | 0.999792 | 4.585938 |
b806d6aa-a910-4151-865b-5a601d17134e | kerrache/linkpred | src/predictors/undirected/usoipredictor.cpp | #include <linkpred/predictors/undirected/usoipredictor.hpp>
#include "LinkPredConfig.hpp"
#include <limits>
#include "linkpred/core/ds/lmapqueue.hpp"
#ifdef LINKPRED_WITH_OPENMP
#include <omp.h>
#endif
#ifdef LINKPRED_WITH_MPI
#include <mpi.h>
#include "linkpred/utils/miscutils.hpp"
#endif
namespace LinkPred {
templa... | ALGO | 0.999745 | 6.38543 |
2efc9758-2a58-4a7f-9809-29f238bf6239 | raincross7/code-similarity | codes/train_code/problem417/problem417_338.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
template<typename H> bool chmin(H& v1, const H v2) { if (v1 > v2) { v1 = v2; return tr... | ALGO | 0.999864 | 3.967831 |
1c4b1eaa-c829-4b10-893a-161c65fc33c1 | Himanshu2693/os-process-scheduler-simulator | src/utils.cpp | #include<bits/stdc++.h>
#include "scheduler.h"
#include <fstream>
#include <sstream>
#include <iostream>
void readFromFile(string filename, vector<Process>& processes) {
ifstream fin(filename);
int id = 1, at, bt, pr;
while (fin >> at >> bt >> pr) {
processes.push_back({id++, at, bt, pr});
}
}
... | ALGO | 0.994396 | 3.646025 |
d9c4e267-1c19-4294-985f-a0ba6477d013 | luphuong/NHAP-MON-LAP-TRINH | BAI TAP 2/so nguyen to nho hon n/16.cpp | #include<stdio.h>
void nhap(int &n);
int kiemtra(int k);
void xuat(int kq);
void main()
{
int n;
nhap(n);
for(int i=1;i<n;)
{
int kq=kiemtra(i);
if(kq==1)
{
xuat(i);
i++;
}
else
i++;
}
}
void xuat(int kq)
{
printf("%d ",kq);
}
int kiemtra(int k)
{
int dem=0;
for(int i=1;i<=k;)
{
if(k%i==0)... | ALGO | 0.998848 | 3.513779 |
325830eb-ee8a-45c4-8c1f-8c4258a61e50 | ioannis-papag/EffectiveMDP | infinite_mdp_big.cpp | #include <iostream>
#include "MDPModel.h"
#include "ModelConf.h"
#include <vector>
#include "Complex.h"
#include <chrono>
#include "stdlib.h"
#include "stdio.h"
#include "string.h"
int parseLine(char* line){
// This assumes that a digit will be found and the line ends in " Kb".
int i = strlen(line);
const... | ALGO | 0.962064 | 3.875954 |
4a076329-6c98-4026-bb36-6462f4bef5fe | shivkaraman/DSA | 01_Pep coding/Level 1/01_Arrays/18_Transpose_Of_Mat.cpp |
#include <iostream>
using namespace std;
void print(int arr[][5],int n, int m){
for(int i=0;i<n;i++){
for(int j=0;j<m;j++)
cout<<arr[i][j]<<" ";
cout<<endl;
}
}
int main(){
int matrix[5][5]={1, 5, 7, 9,10,
6, 10,12,13,20,
9, 25,29,30... | ALGO | 0.999934 | 4.034712 |
256ac0e1-b9a8-4786-bb90-0f62840946d5 | truondin/simple-matrix-multiplication-calculator | matrix_multiplication/main.cpp | #include "Matrix.hpp"
#include <iostream>
#include <cstring>
#include <fstream>
/**
* Function for printing help if program gets '--help' argument.
*/
void print_help(){
std::cout << "This application multiplies 2 matrix:\n";
std::cout << " 1) Create matrix A.\n";
std::cout << "\t 1.1) Set number of row... | TOOL | 0.956929 | 4.192799 |
226b95ab-f8cd-4969-be93-b3b3571367ec | DSC-NITA/HacktoberFest2020 | DSA/Algorithms/Greedy-Algorithms/convex_hull.cpp | // A C++ program to find convex hull of a set of points. Refer
// https://www.geeksforgeeks.org/orientation-3-ordered-points/
// for explanation of orientation()
#include <iostream>
#include <stack>
#include <stdlib.h>
using namespace std;
struct Point
{
int x, y;
};
// A global point needed for sorting p... | ALGO | 0.999999 | 5.600536 |
fdedd4f7-4737-4d0f-8bf1-084dde18f40e | MzMahmud/problem-solving | Leetcode/0149 Max Points on a Line.cpp | struct Slope{
int x,y;
Slope() : x(0),y(0) {}
Slope(int _x,int _y) : x(_x),y(_y){
if(x < 0){
x = -x;
y = -y;
}
int g = __gcd(abs(x),abs(y));
if(g){
x /= g;
y /= g;
}
}
bool operator==(const Slope &other... | ALGO | 0.999978 | 5.521601 |
9cb323e4-ed01-4001-9db4-597f3070ea3a | raincross7/code-similarity | codes/train_code/problem002/problem002_34.cpp | #include<bits/stdc++.h>
using namespace std;
int maxtime(int x){
return (x+9)/10*10;
}
int remtime(int x){
return maxtime(x)-x;
}
int main(){
int a,b,c,d,e;
cin >> a >> b >> c >> d >> e;
int ans = maxtime(a)+maxtime(b)+maxtime(c)+maxtime(d)+maxtime(e);
ans -= max({remtime(a),remtime(b),remtime(c),remtime(d),r... | ALGO | 0.997847 | 3.041807 |
6c0239bc-af2e-455d-8696-b1d8c0383035 | cacunas/VAT | src/sharedTrackingClasses2D.cpp | #include "sharedTrackingClasses2D.h"
int bestAlternativesNode2D::numVariables = 0;
std::set<SpMobileObject2D, orderedByBestCoherenceOperator2D>::iterator *bestAlternativesNode2D::newObjectsListEnds = NULL;
int bestAlternativesNode2D::variablesSum = 0;
int *bestAlternativesNode2D::variablesNumFrames = NULL;
IdBlobPair... | ALGO | 0.997374 | 4.939481 |
01a063ac-26ee-47d1-9387-0f7a4e1a890a | donghyun-1/2025-Algorithm-Study | Baekjoon/wongi/Two_Pointer && Sliding Window/boj 2531 회전초밥(슬라이딩윈도우)/boj 2531 회전 초밥.cpp | #include <algorithm>
#include <deque>
#include <functional>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
int main()
{
ios::sync_with_stdio(false);
cin.tie(NULL);... | ALGO | 0.999936 | 3.707811 |
976b2ddf-9f92-4624-b9fa-c0826a0c4273 | costikacamo/simple3d-engine-sdl | main.cpp | #include <SDL2/SDL.h>
#include <cmath>
#include <iostream>
const int SCREEN_WIDTH = 640;
const int SCREEN_HEIGHT = 480;
const int MAP_WIDTH = 8;
const int MAP_HEIGHT = 8;
// Adjusted game constants for better responsiveness
const float ROTATION_SPEED = 180.0f; // 180 degrees per second
const float MOVE_SPEED = 2.5f;... | ALGO | 0.936287 | 7.570858 |
4db9900f-40eb-446c-91e7-f5551f2a6433 | QianhaoIan/cs225_potd | potd-q16/potd.cpp | #include "potd.h"
#include <iostream>
using namespace std;
void insertSorted(Node **head, Node *insert) {
// your code here!
//insert a new node into the front of the list
if (*head == NULL) *head = insert;
else if ((*head)->data_ > insert->data_){
Node* tmp;
tmp = *head;
*head = insert;
insert->next_ = ... | ALGO | 0.999857 | 4.638732 |
b3d03add-75b2-4feb-b43c-0c5907ee4640 | samg31/language | constant_folding.cpp | #include "constant_folding.hpp"
namespace dcipl
{
namespace el
{
prog*
pfold(prog* program)
{
return prog(program->locs, program->nargs, nfold(program -> body));
}
num_expr*
nfold(num_expr* num)
{
switch(num->kind)
{... | TOOL | 0.892198 | 6.553503 |
cdae4640-8264-43f8-8e31-7467a63b8fe9 | Githubiswhat/LeetCode | C++/src/Solution1001_1100/Solution1051.cpp | //
// Created by windows on 2023/3/2.
//
#include "Solution1051.h"
#include <functional>
#include <algorithm>
#include <iostream>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
using namespace std;
int heightChecker(vector<int>& heights) {
vector<int> res(heights);
sort(heig... | ALGO | 0.999793 | 5.600529 |
5a0dc33d-f239-40a4-b047-8956121964b6 | Kamranshowkat/codes | functions/3 bsort using fns.cpp | // bubble sort using fns
#include<stdio.h>
void bsort(int [],int);
int main()
{
int a[100];
int i,n;
printf("enter the size of an array ");
scanf("%d", &n);
printf("enter the elements of array \n");
for(i=0;i<n;i++)
{
scanf("%d ", &a[i]);
}
printf("before sorting \n");
for(i=0;i<=n;i++)
{
prin... | ALGO | 0.99996 | 4.430343 |
b5dcff97-a60f-4519-90e5-80338bc3b640 | JhonatanUscca/laboratorioCC2 | Laboratorio_O1/ejecicioN4.cpp | #include <iostream>
#include <ctime>
using namespace std;
int main(){
time_t t;
int h,m,b,d,c;
int f;
char a;
t=time(NULL);
struct tm *fecha;
fecha= localtime(&t);
cout<<fecha->tm_hour<<":"<<fecha->tm_min<<endl;
h=fecha->tm_hour;
m=fecha->tm_min;
a=':';
cout<<"minutos aum... | ALGO | 0.947849 | 3.618508 |
5ca8e4fb-1f1b-4a21-98f4-4b7c2feb7aa1 | nmtoan883/OOP_28TECH | SLIDE/C++/SapXepTimKiem/B27_SoNhoNhatLonHonAi.cpp | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
const int MOD = 1e9 + 7;
int main()
{
int n ; cin >> n;
int a[n] ; vector<int>v;
for(int i = 0; i < n; i++)
{
cin >> a[i];
v.push_back(a[i]);
}
sort(v.begin(), v.end());
for(int i = 0 ; i < n ;i++)
{
... | ALGO | 0.999994 | 3.860198 |
d9c16e1b-7b68-4a56-aea6-d931172eca47 | xuexcy/Algorithm | sort/heapSort.cpp | #include<iostream>
#include<vector>
#include<random>
#include<stdlib.h>
#include<time.h>
#include<algorithm>
using namespace std;
void heapAdjust(vector<int>& v, int pos, int maxIndex){
//do not consider the node which its index >= maxIndex
//minLeaf is the first leaf
int minLeaf = maxIndex / 2;
while(pos <... | ALGO | 0.999691 | 4.486541 |
2d6278e1-1637-4944-a18b-5d0c89866d60 | aaronvincent/gambit_aaron | contrib/MassSpectra/flexiblesusy/config/depgen.cpp | #include <algorithm>
#include <cstdlib>
#include <cstdio>
#include <fstream>
#include <functional>
#include <iostream>
#include <set>
#include <string>
#include <vector>
namespace depgen {
template<class InputIt, class OutputIt, class UnaryPredicate>
OutputIt copy_if(InputIt first, InputIt last, OutputIt d_first... | TOOL | 0.938707 | 4.795053 |
81deb499-8d0a-4473-a810-d5a6c493121a | farzeenshahid/Cpp-Basics | Fibonacci series/fib1.cpp | #include<iostream>
using namespace std;
class fib1{
int next,n,first=0,second=1;
public:
void fab(){
cout<<"enter number of terms in fibonacci series:"<<endl;
cin>>n;
cout<<"the fibonacci series is:"<<endl;
for(int i=0;i<n;i++){
cout<<first<<endl;//0,1,1
... | ALGO | 0.998642 | 3.643178 |
586ffbb1-2cd2-47c2-89d0-02c6bc07338f | asceznyk/loc | leetcode/1219.cpp | class Solution {
private:
vector<vector<int>> dirs = {{0,1}, {1,0}, {0,-1}, {-1,0}};
int dfs(
vector<vector<int>>& grid, vector<vector<bool>>& visited,
int i, int j
) {
if(
i < 0 || i > grid.size()-1 ||
j < 0 || j > grid[0].size()-1 ||
visited[i][j] || grid[i][j] == 0
) return 0;... | ALGO | 0.999647 | 6.632301 |
078f7143-2754-47fa-bc24-ac79e823d917 | igor-pavkov/honours-2024 | Code Examples/DiverseVul Filtered/Secure/6e42ccb9dbc13836cd52cda594f819d17af9afa2-62.cpp | static inline float *VMUL4S(float *dst, const float *v, unsigned idx,
unsigned sign, const float *scale)
{
unsigned nz = idx >> 12;
union av_intfloat32 s = { .f = *scale };
union av_intfloat32 t;
t.i = s.i ^ (sign & 1U<<31);
*dst++ = v[idx & 3] * t.f;
sign <<= nz... | ALGO | 0.903809 | 5.977196 |
ac08a06c-5322-4b9a-8370-40b5490ba760 | sarvex/leetcode-lisp | solution/0800-0899/0803.Bricks Falling When Hit/Solution.cpp | class Solution {
public:
vector<int> p;
vector<int> size;
vector<int> hitBricks(vector<vector<int>>& grid, vector<vector<int>>& hits) {
int m = grid.size(), n = grid[0].size();
p.resize(m * n + 1);
size.resize(m * n + 1);
for (int i = 0; i < p.size(); ++i) {
p[i]... | ALGO | 0.999931 | 6.043971 |
b8e29bef-55bb-451b-887e-e3a308e034b3 | memcpy0/Code-World | Mix_Works/Leetcode/Solutions/2731-2740/2739. 总行驶距离[数学] 简单.cpp | /*
** Problem: https://leetcode.cn/problems/total-distance-traveled
** Article: https://memcpy0.blog.csdn.net/article/details/138390563
** Author: memcpy0
*/
```python
class Solution:
def distanceTraveled(self, mainTank: int, additionalTank: int) -> int:
return (mainTank + min((mainTank - 1) // 4, additiona... | ALGO | 0.992109 | 5.38066 |
4033c3ab-e2b7-46ac-aac8-e8207bb3b58a | paly17/ImageStitching2 | opencv/sources/modules/legacy/src/kdtree.cpp | // 2008-05-13, Xavier Delacour <<EMAIL>>
#include "precomp.hpp"
#if !defined _MSC_VER || defined __ICL || _MSC_VER >= 1300
#include "_kdtree.hpp"
#include "_featuretree.h"
class CvKDTreeWrap : public CvFeatureTree {
template <class __scalartype, int __cvtype>
struct deref {
typedef __scalartype scalar_type;... | ALGO | 0.993354 | 6.543406 |
5f938804-321c-4809-a145-c4de48887363 | achechi15/Competitive-Programming | codewars/textoEnmarcado.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
vector<vector<vector<string>>> mensajes;
int n; cin >> n;
for (int i = 0; i < n; i++) {
vector<vector<string>> aux;
vector<string> aux2;
string aux3;
int nWords; cin >> nWords;
for (int j = 0; j < nWords; j+... | ALGO | 0.999554 | 3.454356 |
a11ec006-f00a-4c8c-9b81-7e73f41f944d | Yi-Xian-Chen/Athena-AGN-Star | src/multigrid/multigrid.cpp | // C headers
// C++ headers
#include <algorithm>
#include <cmath>
#include <cstring> // memset, memcpy
#include <iostream>
#include <sstream> // stringstream
#include <stdexcept> // runtime_error
#include <string> // c_str()
// Athena++ headers
#include "../athena.hpp"
#include "../athena_arrays.hpp"
#incl... | ALGO | 0.944367 | 3.95829 |
3bee5145-2e7d-4944-bd4c-ef3a2cde73af | Samsung/Vyond | chipyard-1.11.0/sims/firesim/platforms/f1/aws-fpga/Vitis/examples/xilinx_2021.2/cpp_kernels/bind_op_storage/src/vadd.cpp | #define BUFFER_SIZE 1024
#define DATA_SIZE 4096
// TRIPCOUNT identifier
const unsigned int c_len = DATA_SIZE / BUFFER_SIZE;
const unsigned int c_size = BUFFER_SIZE;
extern "C" {
void vadd(const unsigned int* in1, // Read-Only Vector 1
const unsigned int* in2, // Read-Only Vector 2
unsigned int* ou... | ALGO | 0.985975 | 5.464983 |
4c0c1b92-a446-4619-900f-3553c6f1316f | faraaz-inc/CD-Lab | Class Codes/7.Leaders_Blocks/leaders_Only.cpp | #include<iostream>
#include<vector>
#include<fstream>
#include<sstream>
#include<algorithm>
using namespace std;
int main() {
ifstream f("TAC.txt");
int currLine = 0;
int lines = 0;
string line;
while(getline(f, line)) {
lines++;
}
cout << "Total lines in the file: " << lines << en... | ALGO | 0.995806 | 3.138763 |
1a08c8a2-8d78-4d29-b8ab-b42ebbbd2c62 | omar-besbes/competitive-programming | solutions/France-IOI/Niveau 5/Tris efficaces/Tri postal.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int n;
cin >> n;
vector<int> cnt(2e5 + 1);
for (int i = 0; i < n; i++) {
int x;
cin >> x;
cnt[x + 1e5]++;
}
for (int i = 0; i < 2e5 + 1; i++)
while (cnt[... | ALGO | 0.999886 | 3.846546 |
68f1e0b7-1a22-41a8-a28f-89dd6950050b | KanishkRAJ29/Leetcode | 3490-find-the-maximum-length-of-valid-subsequence-i/3490-find-the-maximum-length-of-valid-subsequence-i.cpp | class Solution {
public:
int maximumLength(vector<int>& nums) {
int odd = 0, even = 0, odd_even = 0, even_odd = 0;
for (int num : nums) {
if (num % 2) {
odd++;
odd_even = even_odd + 1;
} else {
even++;
even_odd =... | ALGO | 0.999844 | 5.68726 |
5a5d1b27-8cbc-4d51-9378-6957542736db | MrinalCom/GeeksforGeeksPOTD | Print adjacency list.cpp | vector<vector<int>> ans(V);
for(int i = 0; i < edges.size(); i++){
int a=edges[i].first;
int b=edges[i].second;
ans[a].push_back(b);
ans[b].push_back(a);
}
return ans;
| ALGO | 0.999537 | 5.468581 |
690bb98f-57d2-4f7d-b228-73e7817538c7 | SuveenKumar/Competitive-Programming | codeforces/742/A.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define endl ("\n")
#define pi (3.141592653589)
#define mod 1000000007
#define INF 1000000009
#define float double
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define so sizeof
#define pii pa... | ALGO | 0.999958 | 4.642391 |
06c1dd24-e4eb-4ec0-97e5-1fd83dfdbe2b | protectors/ACM | UVA/UVA11172-Relational_Operator.cpp | #include <iostream>
using namespace std;
int main(){
int t,a,b,s,kase=0;
cin>>t;
while(t--){
cin>>a>>b;
if(a>b) cout<<">"<<endl;
else if(a<b) cout<<"<"<<endl;
else cout<<"="<<endl;
}
return 0;
}
| ALGO | 0.9999 | 3.675786 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.