uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
1b679027-32c8-4ec0-9848-992038bd9cc9
ishandutta2007/codeforces
peti1234/normal/1551/A.cpp
#include<bits/stdc++.h> using namespace std; int main() { int w, n; cin >> w; while (w--) { cin >> n; cout << n/3+(n%3==1) << " " << n/3+(n%3==2) << endl; } return 0; }
ALGO
0.999862
3.539173
28b7e844-e0f3-4d9d-877c-72d0801bb2d7
nxvtej/algorithms
5daily/2024-Oct-5-binarySearch/findrightinterval.cpp
class Solution { public: vector<int> findRightInterval(vector<vector<int>> &intervals) { /* ese to muskil sa hai vector<pair<int, int>> temp; for(int i=0;i<intervals.size();i++){ temp.push_back(make_pair(intervals[i][0], i)); } // sort auto cm...
ALGO
0.999993
5.718856
21a0b68c-7c9b-4288-9276-713b95af3b4b
Rscruz1980/exercicios_ADS_Uninter
grafos_busca_largura/Origem.cpp
#include <stdio.h> #include <stdlib.h> #define NUMERO_VERTICES 6 struct ListaDeVizinhos { int vertice; ListaDeVizinhos* prox; }; struct Grafo { int TotalVertices; struct ListaDeVizinhos** ListaAdj; // lista do tamanho do numero de vertices }; struct QUEUE // Fila dos vertices a serem visitados { ...
ALGO
0.999547
4.581413
d9ca7cc6-bbbc-46e4-86b8-ee8fa3f31c24
Ritikpcl/Comp-Prog
C_k_th_equality.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long int void solve(){ ll a, b, c, k; cin >> a >> b >> c >> k; ll sum = 0; ll x, y, z; vector<ll> v(10, 1); for (int i = 2; i <= 7; i++) { v[i] = v[i - 1] * 10; } bool ans = false; for (int i = v[a]; i < v[a ...
ALGO
0.999785
3.88558
6c56a599-d30b-43e3-9b28-f806f15526a4
honey0632/GFG-2024-Daily
06-11-2024.cpp
// Maximum Tip Calculator // https://www.geeksforgeeks.org/problems/maximum-tip-calculator2631/1 #include<bits/stdc++.h> using namespace std; class Solution { public: long long maxTip(int n, int x, int y, vector<int> &arr, vector<int> &brr) { vector<pair<int, pair<int, int>>> differences; for (in...
ALGO
0.999541
4.663336
fe2a3c05-4689-416e-86bd-858bde498000
weilin97462/EWN-Approximate-DB-Generator
src/buildDB/trial_calculation/trial_calculation.cpp
#include "trial_calculation.hpp" #include "../checkpoint/checkpoint.hpp" #include "../../config.hpp" #include "../dependency_manager/dependency_manager.hpp" #include "../dependency_manager/dependency_data.hpp" #include "../dependency_manager/count_size.hpp" #include "../with_MD/MD_bound/MD_bound.hpp" #include "../../ta...
ALGO
0.955056
5.489024
682ca84f-79e1-4853-bb94-ae7ce4dbb602
Rishab-Kumar09/AR-Tetris
AR-Tetris2/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.99826
6.76775
24a7c3e2-54a9-48ca-bed3-e1d82d1bbaa3
Medhansh223/Leetcode
1252-break-a-palindrome/break-a-palindrome.cpp
class Solution { public: string breakPalindrome(string palindrome) { int n = palindrome.size(); for(int i=0;i<n/2;i++) { if(palindrome[i] != 'a') { palindrome[i] = 'a'; return palindrome; } } if(n == 1) ...
ALGO
0.99884
4.310507
5ae46e12-b6ae-4d21-9fb2-8c33cabd01a5
mhoffesommer/Very-Sleepy
wxwindows/contrib/src/mmedia/g723_40.cpp
/* * g723_40.c * * Description: * * g723_40_encoder(), g723_40_decoder() * * These routines comprise an implementation of the CCITT G.723 40Kbps * ADPCM coding algorithm. Essentially, this implementation is identical to * the bit level description except for a few deviations which * take advantage of worksta...
ALGO
0.999295
3.969542
a0b09319-35cd-4dab-9c50-d3cc6036dee9
roniahamed/Phitron-School
First semester/Data Structure and c++/Week 3/Exam 2 lab Exam/Question no 8 H.cpp
#include<bits/stdc++.h> using namespace std; int main() { string sentence; cin>>sentence; int len = sentence.find('A'); int len2 = sentence.rfind('Z')+1; cout<<len2-len<<endl; return 0; }
ALGO
0.998536
3.19195
5f188b07-c253-4931-8e2c-cd18689736ef
huyluongme/LeetCode
longestSubstringWithoutRepeatingCharacters/longestSubstringWithoutRepeatingCharacters.cpp
#include <iostream> using namespace std; #define CHAR_RANGE 256 /* abcabcbb loop1: max_len = 0 start = 0 end = 0 c = 'a' last_index[c] = -1 update last_index[c] = 0 window_len = 0 - 0 + 1 = 1 -> update max_len = 1 loop2: max_len = 1 ...
ALGO
0.999849
5.901934
aa873f41-532f-4b0e-a8e3-bc1f5b7df6ea
Kesavant37/IPMP-weekly-tasks
w5d3q2_spiral_matrix_2d.cpp
class Solution { public: vector<int> spiralOrder(vector<vector<int>>& matrix) { int n=matrix[0].size(); int m=matrix.size(); int top=0,bottom=m-1,left=0,right=n-1; vector<int>ans; while(top<=bottom && left<=right){ for(int i=left;i<=right;i++){ ans...
ALGO
0.999999
6.235713
fd3238b6-1795-4352-97fc-421ca1b36b33
NgTrDung/1000BaiC
Bai 77.cpp
//Bi 77: Viet chuong trinh tinh tong cua day so sau: S(n) = 1 + 2 + 3 + + n #include<iostream> using namespace std; int main() { int n; cout<<"Nhap so nguyen duong n: "; cin>>n; int sum=1; for(int i=2;i<=n;i++) { sum+=i; } cout<<"S(n) = "<<sum<<endl; return 0; }
ALGO
0.998595
3.05858
daf49fbd-c081-4ca4-9d07-d2be37828627
nhannttdevvn/LapTrinhC
LapTrinhC++/minMax.cpp
#include <iostream> using namespace std; int main() { int min, max, first_num, second_num; cout << "first_num = "; cin >> first_num; cout << "second_num = "; cin >> second_num; if (first_num < second_num) { min = first_num; max = second_num; } else { min = second_num; max = first_num; ...
ALGO
0.996201
3.068804
68134f7a-6807-44fb-a1c4-053a2ce89f8f
AimotoRyosuke/atcoder
work/abc/B/331_B.cpp
#include <bits/stdc++.h> using namespace std; const int s_num = 6; const int m_num = 8; const int l_num = 12; int main() { int n, s, m, l; cin >> n >> s >> m >> l; int s_only; if (n % s_num) { s_only = n / s_num + 1; } else { s_only = n / s_num; } int m_only; if (n % ...
ALGO
0.999832
4.669594
e78f790b-a69c-4f2f-bf98-f49775362b42
alexandraback/datacollection
solutions_5744014401732608_0/C++/tsukasadiary/b.cpp
// tsukasa_diary's programing contest code template #include <bits/stdc++.h> using namespace std; #define TSUKASA_DIARY_S_TEMPLATE // define #define for_(i,a,b) for(int i=(a);i<(b);++i) #define for_rev(i,a,b) for(int i=(a);i>=(b);--i) #define allof(a) (a).begin(),(a).end() #define minit(a,b) memset(a,b,sizeof(a)) #defi...
ALGO
0.999941
4.780689
e5789fd8-1db9-4672-9bad-64678c2c2e53
finvalnnk14/TugasPertemuan2_FinaValentina_20240801396
windows/runner/utils.cpp
#include "utils.h" #include <flutter_windows.h> #include <io.h> #include <stdio.h> #include <windows.h> #include <iostream> void CreateAndAttachConsole() { if (::AllocConsole()) { FILE *unused; if (freopen_s(&unused, "CONOUT$", "w", stdout)) { _dup2(_fileno(stdout), 1); } if (freopen_s(&unuse...
TOOL
0.998733
6.76775
30c70a74-032d-4806-acfe-5884bbc6e8ca
tyzeng/algorithm-notebook
Leetcode/LC98验证二叉搜索树/递归+范围约束.cpp
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ class Solution { public: bool isValidBST(TreeNode* root, TreeNode* minNode, TreeNode* maxNode) { if(root == ...
ALGO
0.999966
6.918533
ecfcf30e-1860-4a37-a87f-7f0c3640987e
openeuler-mirror/openjfx8
modules/web/src/main/native/Source/ThirdParty/icu/source/i18n/collationsettings.cpp
#include "unicode/utypes.h" #if !UCONFIG_NO_COLLATION #include "unicode/ucol.h" #include "cmemory.h" #include "collation.h" #include "collationdata.h" #include "collationsettings.h" #include "sharedobject.h" #include "uassert.h" #include "umutex.h" #include "uvectr32.h" U_NAMESPACE_BEGIN CollationSettings::Collatio...
TOOL
0.875383
3.63362
25802d6b-7933-47cf-888b-32e6696aaa7f
harshitaggarwal-1999/coding_ninjas_codes
introduction to c++/lecture_7-functions/variables and scope/variable_and_scope.cpp
#include <iostream> using namespace std; int fact(int n) { //cout << a << endl; int ans = 1; for (int i = 1; i <=n ;i++) { ans = ans * i; } return ans; } int main() { int a; cin >> a; int output = fact(a); //cout << ans << endl; //cout << n << endl; cout << output << endl; }
ALGO
0.999964
4.226121
c151256d-a01f-4a9f-80e2-7eb0015cd146
AxonDragonScale/Algorithms
Arrays/2 elements with sum k in sorted array.cpp
// Given a sorted array and a number k, check if there are 2 elements with sum k. #include <algorithm> #include <climits> #include <cmath> #include <deque> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <unordered_map> #include <unordered_set> #include <vector> #define LN...
ALGO
0.999974
5.16166
4a673755-b2cb-4d85-b398-d7f1f7458982
GaloisInc/verse-ardupilot
libraries/AP_Common/tests/test_sorting.cpp
#include <AP_gtest.h> /* tests for AP_Common/sorting.cpp */ #include <AP_Common/AP_Common.h> #include <AP_Common/sorting.h> #include <stdlib.h> #if CONFIG_HAL_BOARD == HAL_BOARD_SITL || CONFIG_HAL_BOARD == HAL_BOARD_LINUX typedef int (*compare_fn_t)(const void*, const void*); static int comp16(const uint16_t *v...
TEST
0.888535
7.423488
618a4e92-2963-4a9c-ba21-c8252ec0d849
strang3-r/CompetitiveProgramming
stack.cpp
// stack.cpp #include <bits/stdc++.h> // #include <ext/pb_ds/assoc_container.hpp> // using namespace __gnu_pbds; using namespace std; #define ff first #define ss second #define ll long long int #define ld long double #define pb push_back #...
ALGO
0.999702
5.659469
017db929-e8f4-435e-af56-c43bf83cfdaa
FergalOK/aoc-2024
day_4/main.cpp
#include <iostream> #include <fstream> #include <sstream> #include <vector> #include <queue> #include <regex> #include <numeric> #include <cassert> int part_1(std::vector<std::string> lines); int part_2(std::vector<std::string> lines); int main(int argc, char** argv) { assert(argc == 2); std::ifstream file; ...
ALGO
0.991044
5.691283
07a9df78-bb65-4c52-a209-573b49d15ea2
Electronics03/Data_Structure
Lectures/CH5_StackQueueDeque/LinkedDeque.cpp
#include <iostream> #include <string> #include "DoubleList.h" #include "DataError.h" using namespace std; typedef string Elem; class LinkedDeque { public: LinkedDeque(); ~LinkedDeque(); int size(void) const; bool empty(void) const; const Elem &front(void) const; const Elem &back(void) const...
TOOL
0.937937
5.247149
cf7fdffb-ba3b-4a7b-b2e1-a0dea54b79b6
ProgrammerSakura/algorithm-notes
C_CODE/算法笔记/配套训练/2.5 数组/J.cpp
#include<stdio.h> #include<string.h> int main() { char str1[10],str2[10],str3[10]; gets(str1); gets(str2); gets(str3); int cmp1 = strcmp(str1, str2); if(cmp1 > 0) { int cmp2 = strcmp(str1, str3); if(cmp2 > 0) { puts(str1); } else { puts(str3); } } ...
ALGO
0.999917
3.804384
969fb556-b1d7-4bf9-bed2-9fc478ae8950
amcp203/PureC-
Purec++/dlib/test/mpc.cpp
#include <string> #include <sstream> #include <dlib/control.h> #include <dlib/optimization.h> #include "tester.h" namespace { using namespace test; using namespace std; using namespace dlib; logger dlog("test.mpc"); template < typename EXP1, typename EXP2, typename T,...
ALGO
0.981491
6.363253
dc6e674e-09d1-4e26-beaf-696e7ba1448d
Twarner491/project-files
Firmwares/Firmware-Marlin/Marlin/src/feature/bedlevel/abl/abl.cpp
#include "../../../inc/MarlinConfig.h" #if ENABLED(AUTO_BED_LEVELING_BILINEAR) #include "../bedlevel.h" #include "../../../module/motion.h" #define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE) #include "../../../core/debug_out.h" #if ENABLED(EXTENSIBLE_UI) #include "../../../lcd/extui/ui_api.h" #endif xy_pos_t bil...
ALGO
0.98714
6.329909
ff370b2f-05f9-4929-8607-496e211c5fa7
Normal-pcer/sync_code
P3239_[HNOI2015]_亚瑟王.cpp
/** * @link https://www.luogu.com.cn/problem/P3239 */ #include <cstdint> #include <cstring> #include <iomanip> #include <iostream> #include <random> #include <ranges> #include <vector> bool DEBUG_MODE = false; #define debug if (DEBUG_MODE) #define never if constexpr (false) template <typename T> inline auto chkMax(T ...
ALGO
0.999234
5.317906
488a568c-a0f1-4d5b-90bc-cc947ca87bff
Celsovicente/LinguagemC
Salario de um Funcionário.cpp
#include<stdio.h> #include <stdlib.h> int main(int argc, char argv[]) { float salario,novo_salario; printf("Digite o salario do funcionario:\n"); scanf("%f",&salario); novo_salario+=((salario*25)/100); printf("\n O Novo Salario e de:\n %f",novo_salario); getchar(); return 0; }
ALGO
0.946386
3.029001
bf6a8a3b-f719-4293-84b7-2e85773c12aa
trapexit/bfif
src/main.cpp
#define STB_IMAGE_IMPLEMENTATION #define STB_IMAGE_WRITE_IMPLEMENTATION #include "CLI11.hpp" #include "fmt.hpp" #include "stb_image.h" #include "stb_image_write.h" #include "version.hpp" #include <cerrno> #include <cstdint> #include <cstring> #include <vector> namespace fs = std::filesystem; namespace l { static ...
TOOL
0.966768
5.88617
5d6acee0-8a09-49d5-9474-57e5b94e92fe
hjiang13/LLMs-in-IR
POJ-104/58/877.cpp
#include <iostream> using namespace std; int function1(char zimu) { int panduan; panduan=zimu; if (((panduan>=65)&&(panduan<=90))||((panduan>=97)&&(panduan<=122))||(panduan==95)) return 1; //??????????? else return 0; } //????????????? char function2(char zimu) { int panduan; panduan=zimu; if (((panduan>=65)&&(panduan<...
ALGO
0.999816
3.735451
cbeaa758-f5e4-4c9d-8a13-9ca922605c72
Mijan/LFNS_optoFGFR
required_packages/eigen3.4/doc/examples/TutorialLinAlgInverseDeterminant.cpp
#include <iostream> #include <Eigen/Dense> using namespace std; using namespace Eigen; int main() { Matrix3f A; A << 1, 2, 1, 2, 1, 0, -1, 1, 2; cout << "Here is the matrix A:\n" << A << endl; cout << "The determinant of A is " << A.determinant() << endl; cout << "The inverse of A is:\n...
ALGO
0.999642
4.201038
b624f8a4-1b9e-4230-a102-a7ccd8e42140
kaito7926/Code-Cpp
tamgiacpascal.cpp
#include <iostream> using namespace std; void printPascal(int n) { int arr[n][n]; for (int i = 0; i < n; i++) { for (int j = 0; j <= i; j++) { if (j == 0 || j == i) arr[i][j] = 1; else arr[i][j] = arr[i - 1][j - 1] + arr[i - 1][j]; co...
ALGO
0.99998
4.645146
1adbe593-8f08-4651-ad65-e3b70ba1ce24
ishandutta2007/codeforces
darkkcyan/normal/740/A.cpp
#include <bits/stdc++.h> using namespace std; #define fn "main" #define long long long #define ve vector #define xx first #define yy second #define bb begin() #define ee end() #define rbb rbegin() #define ree rend() #define sz(v) ((int) v.size()) #define inf(type) (numeric_limits<type>::max()) #define vi ve<int> #def...
ALGO
0.999815
4.062943
2884fc2d-3a9e-4134-be83-9b41e650555d
nbombau/phyloloc
src/Phylopp/DataSource/ParserBak/tree.cpp
#include "tree.h" #include <ostream> #include <algorithm> #include <cassert> int Parser::Tree::add_node(const std::string& node_label, int node_left_child, int node_right_child, double left_length, double right_...
TOOL
0.872119
5.378391
175103bd-8bd8-4199-b325-9e7a6ce46c1d
FeliksBrant/Dynamic_ORB-SLAM
ORB_SLAM2/Thirdparty/g2o/g2o/core/marginal_covariance_cholesky.cpp
#include "marginal_covariance_cholesky.h" #include <algorithm> #include <cassert> using namespace std; namespace g2o { struct MatrixElem { int r, c; MatrixElem(int r_, int c_) : r(r_), c(c_) {} bool operator<(const MatrixElem& other) const { return c > other.c || (c == other.c && r > other.r); } }; Ma...
ALGO
0.999925
7.461662
e312e984-4a3d-445a-bd0e-9f6699ad3e4c
CiroInGiro/Bjarne_Stroustrup-PPP
Capitolo 20/Esercizio 09/main.cpp
/* Capitolo 20 esercizio 9 Definisci un programma che conta il numero di parole in un Document Provvedi a due versioni: una che definisce una parola come una sequenza di caratteri separati da spazi e una che definisce una parola come una sequenza consecutiva di caratteri alfabetici. Per esempio con la prima definizione...
ALGO
0.982145
6.087778
ddde79dc-ad97-4409-9976-6a867b79aad7
sagardeepesh2/CPP-Geeksforgeeks
C++ Programs/Intersection_point_in_y_shaped_LL.cpp
#include<iostream> #include<stdio.h> #include<bits/stdc++.h> using namespace std; /* Link list Node */ struct Node { int data; struct Node *next; Node(int x) { data = x; next = NULL; } }; int intersectPoint(struct Node* head1, struct Node* head2); Node* inputList(int size) { i...
ALGO
0.999941
4.92755
5f39f5f2-0e2c-4705-8f6a-d08e3e6887ce
mushfiqbh/codeforces-solution
The_Three_Topics.cpp
#include <iostream> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int a, b, c, x; cin >> a >> b >> c >> x; if(x==a || x==b || x==c){ cout << "Yes"; }else{ cout << "No"; } return 0; }
ALGO
0.999755
3.296132
a6201c2f-7d9c-4362-81d3-6d0ca8071658
blueboy/portaltwo
dep/tbb/src/perf/fibonacci_impl_tbb.cpp
#include <cstdio> #include <cstdlib> #include "tbb/task_scheduler_init.h" #include "tbb/task.h" #include "tbb/tick_count.h" extern long CutOff; long SerialFib( const long n ) { if( n<2 ) return n; else return SerialFib(n-1)+SerialFib(n-2); } struct FibContinuation: public tbb::task { lon...
ALGO
0.999702
4.686569
d455dc79-439b-4a8b-9429-fb8260ceb321
sainadth/codeforces
virtual/DIV2-990/C.cpp
#pragma GCC optimize("O3,unroll-loops") #pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt") #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; typedef tree<int, null_type, less_equal<int>, rb_tree_tag, tree_order_stat...
ALGO
0.9999
4.148426
401dde2a-5966-4aa5-a73d-5f120b15d11f
Arrias/competitiveProgSetup
src/lib/algorithms/matrices.cpp
// // Created by arrias on 26.12.2020. // class matrix { private: vector<vector<int>> data; public: int n{}, m{}; matrix() = default; matrix(int nn, int mm) { n = nn; m = mm; data.assign(n, vector<int>(m, 0)); } void init(int nn, int mm) { n = nn; m = ...
ALGO
0.99877
4.426891
9e2691cb-eaa5-4d27-8f58-c9d60c0abb31
Tanish-Mishra/DS-Algo
sort/sortarray.cpp
#include<iostream> #include<algorithm> using namespace std; int main(){ int n; cin>>n; int arr[n]; for(int i = 0; i<n;i++){ cin>> arr[i]; } sort(arr,arr+n); //output for(auto x: arr){ cout<< x << ","; } return 0; }
ALGO
0.999082
4.165114
c2829e43-ecba-46c8-81f9-b63054923500
amankumar849/Cpp-Codes
Chapter2/ProfitAndLoss.cpp
#include<iostream> using namespace std; int main(){ int cp; cout<<"Enter Cost Price : "; cin>>cp; int sp; cout<<" Enter Selling Price : "; cin>>sp; if(sp>cp){ cout<<"Profite"; } else if(cp>sp){ cout<<"Loss"; } else if(cp==sp){ cout<<"No profite No loss...
ALGO
0.997628
3.745371
023f485b-02a5-4f8d-b1da-a6565730dc9f
lovethiscode/boost
libs/contract/example/features/pure_virtual_public.cpp
#include <boost/contract.hpp> #include <vector> #include <cassert> //[pure_virtual_public_base_begin template<typename Iterator> class range { public: // Pure virtual function declaration (contract in definition below). virtual Iterator begin(boost::contract::virtual_* v = 0) = 0; //] // Could program cla...
TOOL
0.97086
5.225903
06375d7c-75ce-483f-b85d-16a0704b0bfc
AkankshRakesh/leetcode-solutions
2257. Count Unguarded Cells in the Grid.cpp
class Solution { public: int countUnguarded(int m, int n, vector<vector<int>>& guards, vector<vector<int>>& walls) { int res = m * n - (int)walls.size() - (int)guards.size(); int grid[m][n]; memset(grid, 0, sizeof(grid)); for (auto& wall : walls) grid[wall[0]][wall[1]] = ...
ALGO
0.999882
6.088934
02342b4c-ab3a-44e3-8355-7c162ecf495c
duongnghia222/CsesProblemsSol
SubarraySums1.cpp
#include<iostream> #include<vector> #include<string> #include<iomanip> #include<algorithm> #include<iterator> #include<stdlib.h> #include<math.h> #include<numeric> #include<set> #include<array> #include<map> #include<queue> #include<stack> using namespace std; #define ll long long int main(){ int n; cin>>n; ...
ALGO
0.99991
3.690614
16855455-5892-4e34-aac8-3bf6442af56f
crimson000000/OIcode
CF/CF1800E2.cpp
#define LOCAL #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> PII; inline ll read() { ll x = 0, f = 1; char ch = getchar(); while(ch < '0' || ch > '9') { if(ch == '-') f = -1; ch = getchar(); } while(ch >= '0' && ch <= '9') { ...
ALGO
0.999992
4.314283
5c94af74-440f-4526-a850-193ed9a20558
linhnvhdev/Doi_tuyen_quoc_gia
COJ/CapGhep/1683.cpp
#include<bits/stdc++.h> #define For(i,a,b) for(int i = a;i <= b;i++) #define Forr(i,a,b) for(int i = a;i >= b;i--) #define maxn 205 #define pii pair<int,int> #define INF 1e9 #define fi first #define se second using namespace std; int n,m,t = 0; vector<int> a[maxn]; int used[maxn],Assign[maxn]; bool visit[maxn]; bool ...
ALGO
0.999345
3.720926
12a20beb-5ee2-479d-ae8e-469382339a4b
113bommy/deepmind_codecontests_refine
cpp_gold_filter_file/cpp_train_463_18.cpp
#include <bits/stdc++.h> using namespace std; long long r, x, y, x_, y_, ans; int main() { scanf("%I64d%I64d%I64d%I64d%I64d", &r, &x, &y, &x_, &y_); x = abs(x - x_); y = abs(y - y_); r *= 2; ans = ceil(sqrt(x * x + y * y) / r); printf("%I64d", ans); }
ALGO
0.999839
3.184516
b92e1a44-260b-4944-8435-6366ec61b351
quanghm/UVA-online-judge
11734.cpp
/* * 11734.cpp * * Created on: May 17, 2015 * Author: quanghoang */ #include<iostream> #include<string> #include<regex> using namespace std; int main() { int c; string s1, s2; cin >> c; getline(cin,s1); for (int i = 1; i <= c; i++) { getline(cin, s1); getline(cin, s2); if (s1 == s2) { cout ...
ALGO
0.997362
3.506082
f770c817-ccab-44fe-8ff5-6f77f14c64ca
gt-retro-computing/llvm-I8080
llvm/tools/llvm-pdbutil/FormatUtil.cpp
#include "FormatUtil.h" #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/StringExtras.h" #include "llvm/BinaryFormat/COFF.h" #include "llvm/DebugInfo/CodeView/CodeView.h" #include "llvm/Support/FormatAdapters.h" #include "llvm/Support/FormatVariadic.h" using namespace llvm; using namespace llvm::codeview; using name...
TOOL
0.941668
7.578274
bf9f1099-1638-41ac-929e-4f909168f7db
mudittiwari/dsa-code
knapsack_solution.cpp
#include<bits/stdc++.h> using namespace std; int dp[5][9]; int dp2[5][9]; int knapsack(vector<int> arr,vector<int> price,int total,int n) { if(total==0 || n==0) { dp[n][total]=0; return 0; } else if(dp[n][total]!=-1) return dp[n][total]; else if(arr[n-1]<=total) { return dp[n][total]=max(price[n-1]+knap...
ALGO
0.999991
3.853705
20508491-71f3-48e2-a514-a7051611fa34
CherryGS/ACM
_cf/gym/100947/e.cpp
#include <iostream> #include <cstdio> #include <algorithm> #include <cmath> #include <cstring> using namespace std; #define ll long long #define ull unsigned long long #define cint const int& #define Pi acos(-1) const int mod = 1e9+7; const int inf_int = 0x7fffffff; const ll inf_ll = 0x7fffffffffffffff; const double ...
ALGO
0.999969
4.042022
cfc119ff-36d5-4788-8b5b-764ff4fd2575
hongjonghwa/algorithms
refs/algosrc/problems/quadtree/quadtree.cpp
#include<algorithm> #include<cassert> #include<iostream> #include<string> #include<vector> using namespace std; const int MAX_SIZE = 1024; char decompressed[MAX_SIZE][MAX_SIZE]; void decompress(string::iterator& it, int y, int x, int size) { char head = *it; ++it; if(head == 'b' || head == 'w') { for(int d...
ALGO
0.999811
4.218004
d6572491-1557-4762-bc45-7c844bba81de
akanksha0812/Data-Structures
Leetcode/problem_of_the_day/1614. Maximum Nesting Depth of the Parentheses.cpp
class Solution { public: int maxDepth(string s) { int l=0,r=0,count=0,max=0; for(int i=0;i<s.size();i++){ if(s[i]=='('){ count++; } else if(s[i]==')'){ if(count>max){ max=count; } ...
ALGO
0.999826
5.628843
b70bf3a6-087f-4cb8-81ca-edbe07e1fa63
Ikem/opencv-1.1.0
cvaux/src/cvcreatehandmask.cpp
#include "_cvaux.h" #define CV_MAX2( a, b ) ((a)>(b) ? (a) : (b)) #define CV_MIN2( a, b ) ((a)<(b) ? (a) : (b)) /****************************************************************************************\ create hand mask \****************************************************************************************/ s...
ALGO
0.912738
3.308369
c9d36ac9-c4f0-475a-91c6-f844f26fa920
aryankd123/Coding_Problem_Solutions
cp_code/B_Odd_Grasshopper.cpp
// Online C++ compiler to run C++ program online #include <iostream> #include <algorithm> //#include <bits/stdc++.h> #include <cstdint> using namespace std; int64_t ans(int64_t x,int64_t n){ int64_t a=n%4; int64_t start=n-a+1; int64_t sum=x; for(int64_t i=start;i<=n;i++){ if(sum%2==0) sum=sum-i; else sum=sum+i;...
ALGO
0.99991
4.762899
a7d875b0-702b-4ef7-9238-291a0ddcca1e
saikatcodec/CP
Codeforces/A_The_Ultimate_Square.cpp
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; using namespace std; #define nl "\n" #define ll long long #define setbits(x) __builtin_popcountll(x) #define zrobits(x) __builtin_ctzll(x) #define mod 1000000007 #define inf 1e18 #define p...
ALGO
0.999742
5.444134
ccd55cc9-f839-4dce-9c26-938b5e2d2522
keshish-kumar/CPP
0108-convert-sorted-array-to-binary-search-tree/0108-convert-sorted-array-to-binary-search-tree.cpp
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nullptr), right(nullptr) {} * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} * TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l...
ALGO
0.999995
6.773088
d51eb493-7c12-4140-a0d2-0571d338f4bb
UtkarshGupta17/questions
0543-diameter-of-binary-tree/0543-diameter-of-binary-tree.cpp
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nullptr), right(nullptr) {} * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} * TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l...
ALGO
0.999887
6.778905
0385faf6-73f5-4351-adee-13f590a9aaa9
mr-haseeb/Cpp
week 2/main-5.cpp
#include <iostream> using namespace std; int main() { string result = "even"; int val = 0; cout<<"Enter Integer value: "<<endl; cin>>val; int modulus_result; modulus_result = val % 2; cout<<endl<<modulus_result<<" "; if(val%2) { cout<<"The number is odd"<<endl; } ...
ALGO
0.995379
3.55239
e6a9a92c-b95c-41f3-bd68-7e540bb4b727
tiendong96/C-Practice
C++/conditions.cpp
#include <iostream> int main(){ int n; std::cout << "This is to test condition statements." << std::endl; std::cout << "Please enter a number: "; std::cin >> n; if(n > 5){ std::cout << "Your number is greater than 5" << std::endl; }else{ switch(n){ case 1: ...
ALGO
0.864692
3.513395
82398f8e-38a5-4a4c-a2e3-6166f63a6a59
ishandutta2007/codeforces
lmoliver/normal/484/A.cpp
#include<bits/stdc++.h> using namespace std; typedef long long LL; int pc(LL x){ int ans=0; for(;x;x&=x-1)ans++; return ans; } struct Cmp{ bool operator()(LL a,LL b){ return pc(a)!=pc(b)?pc(a)<pc(b):a>b; } }; const int N=100; LL l,r; bool vis[N][2][2]; LL dp[N][2][2]; LL f(int x,int lb,int rb){ bool &v=vis[x...
ALGO
0.999842
4.210862
bf17d7aa-4a37-423e-af42-e1a1a3056bd5
phhusson/platform_bootable_recovery
updater/blockimg.cpp
#include <ctype.h> #include <dirent.h> #include <errno.h> #include <fcntl.h> #include <inttypes.h> #include <linux/fs.h> #include <pthread.h> #include <stdarg.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/ioctl.h> #include <sys/stat.h> #include <sys/types.h> #include <sys/wait.h> #include ...
TOOL
0.872136
6.291476
1acb86df-ad5c-4079-a5ee-011a5cf1ba88
aashiqui2/C-Plus-Plus-Programming-Resources
9.ControlFlow/6TernaryOperator.cpp
#include <iostream> using namespace std; int main(){ int max{}; int a{35}; int b{200}; cout << endl; cout << "using regular if " << endl; /* if(a > b){ max = a; }else{ max = b; } */ max = (a > b)? a : b; // Ternary operator cout << "max : " << max...
ALGO
0.99203
3.907521
31a8638b-df73-4012-892a-a1063805452d
Haribala-09/hyprdots
User/History/-5cd0a4d3/3snb.cpp
#include <bits/stdc++.h> using namespace std; #define rev(ans) reverse(ans.begin(), ans.end()) #define mems(a, n) memset(a, n, sizeof(a)) #define pb push_back #define fst first #define scd second #define int long long using pii = pair<int, int>; using pci = pair<char, int>; void dbg_out() { cerr << endl; } template ...
ALGO
0.999674
4.503912
848660fb-3ba6-4fb5-b43a-2f503dca8a1b
kabouri-mouad/CodeForces-Problems-Solutions
A-Problems/isYourHorseshoeOnTheOtherHoof.cpp
#include <iostream> using namespace std; int main() { int tab[4], i, j, c, counter=0; for(i=0; i<4; i++){ cin >> tab[i]; } for(i=0; i<4; i++){ for(j=0; j<3; j++){ if(tab[j] > tab[j+1]){ c = tab[j]; tab[j] = tab[j+1]; tab[j+1]=c...
ALGO
0.99993
3.97334
ab15b9c8-9d90-4202-bb9b-1589c2fcf32a
DarkJyn/SPOJ_PTIT
P147PROG_ROUND7G - DiemCanBang.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; #define MOD 1000000007 #define endl "\n" int main(){ cin.tie(nullptr)->sync_with_stdio(false); #ifndef ONLINE_JUDGE freopen("TASK.inp","r",stdin); freopen("TASK.out","w",stdout); #endif vector<double> a, b; int n; wh...
ALGO
0.997666
4.057424
f2c13a02-d2ca-4d60-8019-c2e683c40954
masum184e/data_structure_and_algorithm
Graph/prims.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long int vector<vector<int>> primsMST(vector<vector<int>> edge_list, int vertices, int src){ vector<vector<pair<int, int>>> adj(vertices); for (auto edge : edge_list) { int from=edge[0], to=edge[1], weight=edge[2]; adj[from].push_bac...
ALGO
0.999883
4.772065
531e5024-00f3-4fe7-a583-3e134e086e27
jbhayven/oi_solutions
ontak2019/pai.cpp
#include <bits/stdc++.h> using namespace std; struct Tree { int l, r; Tree *left, *right; int bonus; pair<int, int> result; Tree (int l, int r) : l(l), r(r), left(nullptr), right(nullptr), bonus(0), result({0, r - l + 1}) {} void update(pair<int, int> &a, p...
ALGO
0.998499
4.066612
0403818b-c5d2-456b-af93-6dd766d98e0d
Divide-et-impera-11/AlgorithmWord
Algorithms/sort/bubble_sort.cpp
#include <iostream> using namespace std; //---------------------Bubble Sort Algorithm--------------------- // Analysis // Time Complexity O(n^2)comparisons, O(n^2) swaps // Worst Time Complexity O(n^2)comparisons, O(n^2) swaps // Avarage Time Complexity O(n^2)comparisons, O(n^2) swaps // Best Time Complexity О(n)compar...
ALGO
0.999128
4.738923
7a38884f-9655-4ed6-89ce-6ff0310c282f
IshanC05/LeetCode-Questions
0016-3sum-closest/0016-3sum-closest.cpp
class Solution { public: int threeSumClosest(vector<int>& nums, int target) { sort(nums.begin(), nums.end()); int n = nums.size(), closest = nums[0] + nums[1] + nums[2]; for(int i = 0; i < n - 2; i++){ int l = i + 1, r = n - 1; ...
ALGO
0.999995
6.359151
febb2857-f223-4247-9ae1-ff9e40ef06f4
hjiang13/LLMs-in-IR
POJ-104/90/234.cpp
#include <iostream> using namespace std; int num = 0; void f(int m,int n); int main() { int m, n, k,i; cin >> k; for(i = 1; i <= k; i++) { cin >> m >> n; if( m >= n) { f(m,n); cout << num << endl; num = 0; } else { f(m,m); cout << num << endl; num = 0; } } return 0; } void f(int m,int n) { int i; if(m == 0) num++; else...
ALGO
0.999947
3.048152
e9d303d1-701c-4601-b0b5-0b5406c8e613
ZhiyangLeeCN/fontkit-php
third_party/icu/source/test/intltest/colldata.cpp
#include "unicode/utypes.h" #if !UCONFIG_NO_COLLATION #include "unicode/unistr.h" #include "unicode/usearch.h" #include "cmemory.h" #include "unicode/coll.h" #include "unicode/tblcoll.h" #include "unicode/coleitr.h" #include "unicode/ucoleitr.h" #include "unicode/regex.h" // TODO: make conditional on regexp ...
TOOL
0.854205
7.112966
39eee267-2904-400d-9b5f-54a0038ba494
Mohammad-Sufyan-Azam/CN-Product-Companies-Interview-Prep
2 Arrays and Strings/Find Duplicate.cpp
/* You have been given an integer array/list(ARR) of size N which contains numbers from 0 to (N - 2). Each number is present at least once. That is, if N = 5, the array/list constitutes values ranging from 0 to 3, and among these, there is a single integer value that is present twice. You need to find and return tha...
ALGO
0.999828
5.528551
b0af85a1-6638-46ba-8a23-14cbae427914
Omurex/Jothly-Engine
eigen-3.4.0/doc/examples/Tutorial_BlockOperations_block_assignment.cpp
#include <Eigen/Dense> #include <iostream> using namespace std; using namespace Eigen; int main() { Array22f m; m << 1,2, 3,4; Array44f a = Array44f::Constant(0.6); cout << "Here is the array a:" << endl << a << endl << endl; a.block<2,2>(1,1) = m; cout << "Here is now a with m copied into its cent...
ALGO
0.965814
3.290376
9a40397b-a56f-4709-b05c-be7c6efbc832
MohamedEid415/my-projects
matrix.cpp
// *~*~*~*~*~*~*~*~*~*~*~*~*>> Libraries and Includes <<*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~ #include <iostream> using namespace std; int main(){ // *~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*>> Intput <<*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~* int matrix [5] [3]; for(int rows = 0; rows < 5; rows ++ ){ for(int colu = 0; colu < 3; c...
ALGO
0.994742
3.248844
34253f61-6fe1-4d44-ac57-147fc3209989
bshimanuki/queso
src/wordsearch.cpp
#include <cassert> #include <cctype> #include <climits> #include <cstring> #include <algorithm> #include <array> #include <fstream> #include <iostream> #include <sstream> #include <tuple> #include <type_traits> #include <vector> #include "cxxopts.hpp" using namespace std; constexpr char SEP[] = " "; constexpr int IN...
ALGO
0.993102
5.546557
bd02e7b2-e074-4bb1-8a15-7bd59e4a1f2f
ML4SE2022/group3
data/walkccc-1666132586/C++/2241 Design an ATM Machine.cpp
class ATM { public: ATM() : bank(5) {} void deposit(vector<int> banknotesCount) { for (int i = 0; i < 5; ++i) bank[i] += banknotesCount[i]; } vector<int> withdraw(int amount) { vector<int> withdrew(5); for (int i = 4; i >= 0; --i) { withdrew[i] = min(bank[i], static_cast<long long>(a...
ALGO
0.997205
5.121445
2cd40019-746c-44ae-ad42-929d7e65a013
0xAritra/STL
3-sequencedContainers/1-vectors/2_vectorFunctions2.cpp
// erase #include<iostream> #include<vector> using namespace std; int main() { vector<int> v{10, 12, 18, 9, 5}; v.erase(v.begin()); for(int x:v) cout << x << " "; cout << endl; v.erase(v.begin(), v.end()-2); for(int x:v) cout << x << " "; }
ALGO
0.997821
3.826794
09af566d-b743-449f-9580-ff6b23845e9a
srishkee/codepath_cybersecurity
MinScalarProd.cpp
#include <iostream> #include <string> #include <vector> #include <functional> #include <algorithm> #include <limits.h> #include <set> #include <cmath> #include <math.h> /* log */ using namespace std; int main(int argc, char const *argv[]) { long long int t = 0; cin >> t; for (long long int i = 0; i < t; ++i) ...
ALGO
0.999862
3.324796
dad1ec52-00f7-4697-b2c7-5c26e0cea401
IAlgorithmia/DSA_CP
Sem3/DSAwithC++/3-Factorial.cpp
#include <iostream> using namespace std; int factorial_recursive(int number){ if (number == 0){ return 1; } else{ return number * factorial_recursive(number - 1); } } int factorial_iterative(int number){ int answer = 1; for (int i = 1; i <= number; i++){ answer = answer...
ALGO
0.999647
5.818014
3b4dd1ee-3068-4b15-8caf-500037974d72
Sunidhi-Tiwari/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.999884
5.840394
6f6cc678-e7f8-4f98-9d26-1d1be1e935fe
sarthakgadekar/marvellous
C language/RECURSION/Assignment 39/program3.cpp
#include<iostream> using namespace std; int Small(char arr[]) { static int count=0; if(*arr!='\0') { if((*arr>='a')&&(*arr<='z')) { count++; } arr++; Small(arr); } return count; } int main() { char arr[20]; int iRet=0; cout<<"\nEnter string : "; cin.getline(arr,20); iRet=Small(arr); cout<...
ALGO
0.998807
3.560776
11281dc4-a956-4e91-820b-bb466a2d6b03
Rangel-Plachkov/FMI-codes
Data-Structures-Algorithm/Daa/podgotovka2/dfs-task.cpp
#include<vector> #include<list> #include<iostream> using namespace std; class Solution { public: bool dfs(vector<vector<int>>& adj_list, vector<bool>& visited, int current, int destination) { visited[current] = true; if (current == destination) return true; for (int neighbor : ...
ALGO
0.999957
5.590302
11add819-6f96-4da6-a7c5-3120baa689e9
Nakib-Arman/CSE318---ArtificialIntelligence
4.DecisionTree/.history/decision_tree_20250706144657.cpp
#include<bits/stdc++.h> using namespace std; class Node { int column_num; string label; unordered_map<string,Node*> children; Node* parent; public: Node(int column_num){ this->column_num = column_num; this->parent = NULL; this->label = ""; } Node(string label){...
ALGO
0.990224
5.093847
d0edb6e7-60af-4734-82b2-650651984ade
GnoudMal/Struct
28tech/bai10.cpp
#include <bits/stdc++.h> using namespace std; struct Peason { string Name, Birth; }; bool cmp(Peason a, Peason b) { string s = a.Birth, t = b.Birth; int n1 = (s[0] - '0') * 10 + s[1] - '0', t1 = (s[3] - '0') * 10 + s[4] - '0', na1 = stoi(s.substr(6)); int n2 = (t[0] - '0') * 10 + t[1] - '0', t2 = (t[3] - '0') * 1...
ALGO
0.999838
3.994704
5289f8ee-2eda-4b8e-840d-344cdb935ffe
wyrover/book-code
CPP_cookbok_source/6-8.cpp
#include <iostream> #include <string> #include <hash_set> int main() { hash_set<std::string> hsString; string s = "bravo"; hsString.insert(s); s = "alpha"; hsString.insert(s); s = "charlie"; hsString.insert(s); for (hash_set<string>::const_iterator p = hsString.begin(); p != h...
TOOL
0.85629
5.516054
71b17a78-fd9f-4810-bd86-09f0ccd4b0bb
ashokabairwaideology/Leet-code-problem
solution/0000-0099/0062.Unique Paths/Solution3.cpp
class Solution { public: int uniquePaths(int m, int n) { vector<int> f(n, 1); for (int i = 1; i < m; ++i) { for (int j = 1; j < n; ++j) { f[j] += f[j - 1]; } } return f[n - 1]; } };
ALGO
0.99994
6.748717
50c142c0-adfa-4083-a0e8-f318d9e337e8
chiseungii/baekjoon
15881.cpp
#include <iostream> using namespace std; int main() { int n; cin >> n; string s; cin >> s; int cnt = 0; for (int i = 0; i < s.length() - 3; i++) { if (s.substr(i, 4) == "pPAp") { cnt++; i += 3; } } cout << cnt << endl; }
ALGO
0.999484
3.639111
a59058fd-beb9-4d33-badf-a879f6c6b5b7
lattera/freebsd
contrib/llvm/lib/Analysis/ValueTracking.cpp
#include "llvm/Analysis/ValueTracking.h" #include "llvm/ADT/SmallPtrSet.h" #include "llvm/Analysis/InstructionSimplify.h" #include "llvm/IR/Constants.h" #include "llvm/IR/DataLayout.h" #include "llvm/IR/GlobalAlias.h" #include "llvm/IR/GlobalVariable.h" #include "llvm/IR/Instructions.h" #include "llvm/IR/IntrinsicInst....
ALGO
0.977679
7.666636
7db0aaf1-dc80-4a28-8032-4fa4c9280cec
qingguang/lammps-sph
src/min_cg.cpp
#include "lmptype.h" #include "mpi.h" #include "math.h" #include "string.h" #include "min_cg.h" #include "atom.h" #include "update.h" #include "output.h" #include "timer.h" using namespace LAMMPS_NS; // EPS_ENERGY = minimum normalization for energy tolerance #define EPS_ENERGY 1.0e-8 // same as in other min classes...
ALGO
0.999822
5.646855
45a5443b-7763-4f48-91f8-428a7d6b2e8e
Shivam-SharMa-dot/Dsa
Heap/tempCodeRunnerFile.cpp
// Step 1: Build max heap from the array // for (int i = (n - 2) / 2; i >= 0; i--) { // heapify(arr, n, i); // }
ALGO
0.999666
4.533376
bca0ac81-25c3-43f1-9983-71ab6e04b928
alessandro-bugatti/guida_territoriali
materiali/problemi territoriali/2007_lino/lino.cpp
#include <fstream> #include <iostream> using namespace std; struct resti{ int valore; int quanti; resti():valore(0),quanti(0){} }; resti monete[100]; resti temp[100]; int massimo; int N,R,possibilita=0; int calcolaSomma() { int somma = 0; for (int i=0;i<=massimo;i++) if (temp[i].quanti == -1) return -1; for (...
ALGO
0.994833
3.716518
87ae0a41-78b3-4d07-9770-ed72f0d257e0
Emma2805/DSA-WITH-CPP
2DArray/printRowWiseSum.cpp
#include<iostream> using namespace std; void Printsum(int arr[][3], int row, int col){ for(int row =0; row<3; row++){ int count = 0; for(int col=0; col<3; col++){ count = count + arr[row][col]; } cout<<count<< " "; } } int main(){ int arr[3][3]; for(int...
ALGO
0.999728
3.897649
2e6282b1-245a-464f-8213-0c0600a633fa
MonakaResearch/pytorch-a64fx
torch/csrc/autograd/functions/comm.cpp
#include <torch/csrc/autograd/functions/comm.h> #include <ATen/core/functional.h> #include <torch/csrc/autograd/function.h> #include <torch/csrc/autograd/functions/utils.h> #include <torch/csrc/autograd/variable.h> #include <torch/csrc/cuda/comm.h> #include <ATen/ATen.h> #include <ATen/cuda/CUDAContext.h> #include <...
TOOL
0.864936
6.730738
0621fa11-45a5-4fcc-9ca3-47898e8ab7be
nck404/tui-hoc-cpp
mang1/30.cpp
#include <iostream> #include <vector> #include <algorithm> int main() { int N, K; std::cin >> N >> K; std::vector<long long> A(N); for (int i = 0; i < N; i++) { std::cin >> A[i]; } std::sort(A.begin(), A.end()); long long sum1 = 0, sum2 = 0; for (int i = 0; i < K; i++) { ...
ALGO
0.999984
4.586648
749b9a3d-a533-42ab-8a62-4d5a600037dc
SnapPython/numerical-analysis-homework
Cpp/lagrange_interpolation/main.cpp
#include <iostream> #include <vector> #include <windows.h> using namespace std; // 计算拉格朗日基本多项式li(x)的值 double lagrange_basis(int i, double x, const vector<double>& x_data) { double result = 1.0; for (size_t j = 0; j < x_data.size(); ++j) { if (j!= i) { result *= (x - x_data[j]) / (x_data[i] ...
ALGO
0.999706
5.19678