uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
b0931ace-8abc-48d8-a3f5-a6f60ee61728
Polaris141/Data
Dev-C++/ExerciseBook/07.30/MGraph.cpp
/*================================= * ͼ(ڽӾ)洢ʾ * * 㷨: 7.17.27.47.57.6 ==================================*/ #include "MGraph.h" //**07 ͼ**// // ¼ݵԴļfpΪnullʱ˵Ҫӿ̨¼ static FILE* fp = NULL; /* * IncInfoָʾͼ/ı/ǷڸϢ * ֵΪ0ʾ޸Ϣ򣬱ʾڸϢ */ Boolean IncInfo = FALSE; /* * 㷨7.1 * * ͼ/ * *ע * * ̲Ĭϴӿ̨ȡݡ * Ϊ˷ԣÿжֶݣ * ...
ALGO
0.997466
3.890492
f0eead1d-0178-4624-9054-ee2b8a68347b
viniciusrcamargo/Exercises_College
ExerTesteLoopNumNegWhile.cpp
#include<iostream> using namespace std; main(){ setlocale(LC_ALL, "Portuguese"); int num, cont = 0, nega = 0; do{ cout<<"Informe um nmero "<<endl; cin>>num; if(num < 0){ nega++; } cont++; }while(cont < 5); cout<<"\n Quantidade de nmeros negativ...
ALGO
0.995917
3.158677
0715ec61-a2df-4e73-82e0-4d5707de3186
shahdev10/cppIntro
ch11-4.cpp
#include<iostream> #include<string> using namespace std; struct WeatherData { int rain; int highTemp; int lowTemp; double averageTemp; }; //add prototypes here void getData(WeatherData &); int totalRainfall(const WeatherData [], const int); void tempAnalysis(const WeatherData[], const int); const in...
TOOL
0.951667
4.680595
9b8ed1e0-c12b-4748-9b1f-26ad4c2bd15a
ishandutta2007/codeforces
andreasyan/normal/1695/D1.cpp
#include <bits/stdc++.h> using namespace std; #define m_p make_pair #define all(x) (x).begin(),(x).end() #define sz(x) ((int)(x).size()) #define fi first #define se second typedef long long ll; mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count()); mt19937 rnf(2106); const int N = 200005; int n; vector<i...
ALGO
0.999754
5.146389
f5ec8f5a-8315-46d6-a8ce-7b473228e150
ZeaoZhang/Leetcode
code/1464-test.cpp
#include"./includes/1464.hpp" int main() { vector<int> nums = {3, 5, 4, 2}; Solution obj; if(obj.maxProduct(nums) == 12) { return 1; } return 0; }
ALGO
0.999688
5.160437
a02506e6-0b28-49b1-9b0a-34a8b6b1b214
wuyukwi/LunarYueEngine
source/3rdparty/bgfx/bgfx/bgfx/3rdparty/glsl-optimizer/src/glsl/ir_expression_flattening.cpp
/** * \file ir_expression_flattening.cpp * * Takes the leaves of expression trees and makes them dereferences of * assignments of the leaves to temporaries, according to a predicate. * * This is used for breaking down matrix operations, where it's easier to * create a temporary and work on each of its vector com...
ALGO
0.971406
6.958138
7fd77961-b9e2-4623-9070-6de7dbaf5e93
HuynhDienThuc1/23521555_23520326_23521441_23521583_23521625_BT03
Bai076/Bai076.cpp
#include <iostream> #include <iomanip> using namespace std; void Nhap(float[], int&); void Xuat(float[], int); float ktGiaTri(int, float); void TimViTri(float[], int, float); int main() { float b[100]; int k; Nhap(b, k); cout << "\nXuat mang mot chieu: " << endl; Xuat(b, k); int x; cout << "\nNhap x: "; cin...
ALGO
0.998846
3.784799
56404873-561c-40d2-a49d-7b271361b7c8
naymur92/CompetitiveProgramming_or_DSA_CPP
codeforces/800_2030_A_A_Gift_From_Orangutan.cpp
/* https://codeforces.com/problemset/problem/2030/A */ #include <bits/stdc++.h> using namespace std; int main() { int t; cin >> t; while (t--) { int n; cin >> n; vector<int> a(n); for (int i = 0; i < n; ++i) cin >> a[i]; sort(a.begin(), a.end()); if (n == 1) cout << 0 << "\n"; else co...
ALGO
0.999884
4.381675
801afb3d-e0fa-4250-9a7f-a089efd4167a
bxdcpp/algorithm
226.翻转二叉树.cpp
/* * @lc app=leetcode.cn id=226 lang=cpp * * [226] 翻转二叉树 */ // @lc code=start /** * 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: TreeNode* in...
ALGO
0.999968
6.69436
fe04aceb-2689-4aeb-9371-5ba894602c9f
thebird-/ts-stream-server-client
boost_1_61_0/libs/hana/benchmark/at/compile.fusion.vector.erb.cpp
<% if input_size > 10 %> #define FUSION_MAX_VECTOR_SIZE <%= ((input_size + 9) / 10) * 10 %> <% end %> #include <boost/fusion/include/at.hpp> #include <boost/fusion/include/make_vector.hpp> namespace fusion = boost::fusion; template <int> struct x { }; int main() { auto vector = fusion::make_vector( <...
ALGO
0.850087
3.217993
6490f3a6-5f3d-44c2-b3df-ab4439873b25
shen7563/CodeTree
250414/두 번째를 첫 번째로/second-to-first.cpp
#include <iostream> #include <string> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); string s; cin >> s; char a = s[0]; char b = s[1]; for(int i = 0; i < s.length(); i++) { if(s[i] == b) { s[i] = a; } } co...
ALGO
0.999955
3.711937
03fe91fe-7ea0-47b9-8ea4-3234a922af6d
whogurdevil/Problems
codingninja/binarySrchUsingRecc.cpp
int srch(int arr[], int s, int e, int val){ if(s > e){ return -1; } int mid = s + (e-s)/2; if(arr[mid] == val){ return mid; } if(arr[mid] < val){ return srch(arr, mid + 1, e, val); } if(arr[mid] > val){ return srch(arr, s, mid - 1, val); } ...
ALGO
0.99997
5.253337
234ef6ef-d85c-41b4-9689-9cdfe1197b79
HITSZ-NRSL/DaLiTI
daliti/src/visual_odometry/visual_loop/ThirdParty/DBoW/BowVector.cpp
#include <iostream> #include <fstream> #include <vector> #include <algorithm> #include <cmath> #include "BowVector.h" namespace DBoW2 { // -------------------------------------------------------------------------- BowVector::BowVector(void) { } // -------------------------------------------------------------------...
TOOL
0.954801
5.316598
8c248b45-e49c-446d-ad47-f2d86810afeb
Lyubava0382/Previous-projects
3-course/Parallel-algorithms/lab3/lab3.cpp
#include <stdio.h> #include <mpi.h> #include <cstdlib> #include <ctime> #define MAX_LENGTH 1000 int main(int argc, char* argv[]) { srand(time(0)); double time_start, time; int size, rank, count = 0, index = 0, index_res = 0; double double_x; MPI_Status status; MPI_Init(&argc, &argv); MPI_Comm_size(MPI_COMM_WORL...
ALGO
0.996134
3.0146
524ba7a1-34a5-442a-9512-02ac67677b0e
fjsadewa/AlgoProgramming
REVIEW/ASG3/Prob a.cpp
#include <stdio.h> int main () { int Testcase; double N,P,Hasil; scanf ("%d",&Testcase); for (int i=0;i<Testcase;i++){ scanf("%lf %lf",&N,&P); Hasil = P /((100 -N)/100); printf ("$%.2lf\n",Hasil); } }
ALGO
0.998092
3.665313
bd161e89-bcaf-4f5e-bd77-bd8774d8ed31
ApinyaMungkaladech/week3_1
week4_1/week3_1.cpp
#include<stdio.h> int main() { int x, y, z, m, n; x = 1; printf("Enter number : "); scanf_s("%d", &n); m = 1; x = n; while (x >= 1) { y = x; while (y >= 1) { printf(" "); y = y - 1; } z = 1; while (z <= m) { printf("*"); z = z + 1; } y = x; while (y >= 1) { printf(" "); y = y - ...
ALGO
0.999949
3.429191
77d118be-f7bb-49f9-be75-a01c176df232
donbasta/leetcode-submissions
Easy/1534.cpp
class Solution { public: int countGoodTriplets(vector<int>& arr, int a, int b, int c) { int n = arr.size(); int ok = 0; for (int i = 0; i < n; i++) for (int j = i + 1; j < n; j++) for (int k = j + 1; k < n; k++) { ok += abs(arr[i] - arr[j]) <= a && abs(arr[j] - arr[k]) <= b && ab...
ALGO
0.999641
5.838654
b0e048a8-6d33-4daf-866c-bd6143e329b6
Fengdalu/acm-icpc
ECPC/16/c.cpp
#include <bits/stdc++.h> const int N = 200, M = 200, MAXT = 1e4+100; double x[MAXT], y[MAXT]; int linker[N]; bool used[N]; std::vector<int> g[N]; bool dfs(int u) { for(int i = 0; i < g[u].size(); i++) { int v = g[u][i]; if(!used[v]) { used[v] = true; if(linker[v] == -1 || dfs(linker[v])) { ...
ALGO
0.999819
4.664656
053cd0a8-79f5-4fa2-bef2-92e7df1ca0fc
RookieBarua/ComPro
Ultra-Fast Mathematician.cpp
#include<iostream> #include<cstring> using namespace std; int main(){ char a[101], b[101], c[101]; cin >> a >> b; for (int i=0; i<strlen(a); i++){ if (a[i] == b[i]) c[i] = '0'; else c[i] = '1'; } for (int i=0; i<strlen(a); i++){ cout << c[i]; } }
ALGO
0.999986
3.298393
a8f8da3f-e3f4-4caf-9fcc-25c1e6ee71b3
ArnavO3/100-Days-of-Coding-Challenge
Day 43.cpp
// Question link: https://leetcode.com/problems/delete-greatest-value-in-each-row/description/ //You are given an m x n matrix grid consisting of positive integers. Perform the following operation until grid becomes empty: //Delete the element with the greatest value from each row. If multiple such elements exist, del...
ALGO
0.999992
6.302388
f613d082-71ba-43cc-9eb2-041f5603afd1
snehah7/Cpp-for-Game-Developers
Module 3/C++GameDevelopmentCookbook_Code/Chapter9/Source/bullet3-2.83.7/src/BulletCollision/NarrowPhaseCollision/btPolyhedralContactClipping.cpp
///This file was written by Erwin Coumans ///Separating axis rest based on work from Pierre Terdiman, see ///And contact clipping based on work from Simon Hobbs #include "btPolyhedralContactClipping.h" #include "BulletCollision/CollisionShapes/btConvexPolyhedron.h" #include <float.h> //for FLT_MAX int gExpectedNbTes...
ALGO
0.995501
5.105403
78f17353-14dc-469a-9371-ab45fd23cdc2
nitronium102/Algorithm
스택큐덱/1021_회전하는 큐.cpp
// // Created by KangMinji on 2023-01-13. // #include <iostream> #include <deque> #include <vector> using namespace std; int findTargetIdx(int num, deque<int> &dq){ int idx = 0; for (int i = 0; i<dq.size(); i++){ if (num == dq[i]){ idx = i; break; } } return idx...
ALGO
0.999964
4.962151
b6ff265a-de75-4aa9-865b-c88e45e14239
dhrubadeydevil/C-language-practice-personal
codeforces/158A_NextRound.cpp
#include <bits/stdc++.h> using namespace std; int main(){ int n,k,arr[200],cnt=0; cin >> n >> k; for(int i=0;i<n;i++){ cin >> arr[i]; } for(int i=0;i<n;i++){ if(arr[i]>=arr[k-1]&&arr[i]>0) cnt++; } cout << cnt <<"\n"; return 0; }
ALGO
0.999967
3.75323
a3e4275a-8b4f-466e-8465-a72abfbe9be8
AMIRAMOHMED/balanced_meal
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.9988
6.76073
2dfa63d5-b381-459c-8fda-f788b7f6f356
kongweikang/LIDAR-BY-CSDN
examples/features/example_rift_estimation.cpp
#include <iostream> #include <pcl/io/pcd_io.h> #include <pcl/features/normal_3d.h> #include <pcl/features/rift.h> #include <pcl/features/intensity_gradient.h> int main (int, char** argv) { std::string filename = argv[1]; std::cout << "Reading " << filename << std::endl; pcl::PointCloud<pcl::PointXYZI>::Ptr clo...
ALGO
0.9559
5.793795
4808b5ce-0ddb-4a94-b41b-d1378ad91131
dinhtuantinh/C-plus-plus
Hoc C++/kiem tra NODE la.cpp
#include<bits/stdc++.h> using namespace std; struct node{ int val; node *left, *right; }; node *newNode(int v){ node *res = new node; res->val = v; res->left = res->right = NULL; return res; } bool checkUtil(node *t, int level, int &leafLevel) { if(t == NULL) return true; if(t->left == NULL && t->ri...
ALGO
0.999981
4.169663
c4edf56a-9f2a-4903-8b7e-2c272f832ce9
113bommy/deepmind_codecontests_refine
cpp_gold_filter_file/cpp_train_1996_11.cpp
#include <bits/stdc++.h> using namespace std; long long n, m, i, j, fac[200005], inv[200005], fi[200005], a[200005], pw[200005], ans, mod = 1e9 + 7, lstx, lsty, tmp; long long qp(long long x, long long y) { long long z = 1; while (y) { if (y & 1) { z = 1ll * z * x % mod; } x = 1ll * x * x % mo...
ALGO
0.999992
4.35256
9f1db380-9967-46c1-88bd-c1a53813bfe6
kantuni/Kattis
eulersnumber.cpp
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; long double e = 1, f = 1; for (int i = 1; i < n + 1; i++) { f *= i; e += 1.0 / f; } cout << fixed << setprecision(15); cout << e << endl; return 0; }
ALGO
0.999805
3.927899
27ab1045-754e-47c8-a055-4269c9c3aa74
yash3004/practice
DSA/dsa/bodmas1.cpp
#include <iostream> #include <stack> #include <unordered_map> using namespace std; class Solution { public: int priority(char op) { unordered_map<char, int> mymap = { {'-', 1}, {'+', 2}, {'*', 3}, {'/', 4} }; return mymap[op]; } int solve(char op, int num1, int num2) { ...
ALGO
0.999985
6.881148
ea8b068b-c330-419d-b4cf-24eeb362cc2e
junqueira200/DW_Decomp
2L_SDVRP/src/BinPackingCP.cpp
/* **************************************** * **************************************** * Data: 10/02/25 * Arquivo: BinPackingCP.cpp * Autor: Igor de Andrade Junqueira * Projeto: 2L-SDVRP * **************************************** * ****************************************/ #include "BinPackingCP.h" #in...
ALGO
0.999211
4.162387
f0c74ead-4dc6-4e1c-8738-56303750469f
ishandutta2007/codeforces
hibye1217/normal/1395/C.cpp
#include <bits/stdc++.h> #define Fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); #define pb push_back #define endl '\n' #define all(v) v.begin(),v.end() #define fr(p) get<0>(p) #define sc(p) get<1>(p) #define th(p) get<2>(p) #define fo(p) get<3>(p) #define fi(p) get<4>(p) #define dec(x) cout.precision(x); u...
ALGO
0.999986
4.182687
12f1e40b-435a-410d-9b62-9ca34374a531
harvard-acc/gem5-aladdin
src/systemc/tests/systemc/examples/aes/aes.cpp
#include <systemc.h> #define USE_TABLE 1 #if DEBUG void Dump_R(char *s, sc_uint<8> X[4][4]) { printf("%s R\n", s); for(int i = 0; i < 4; i++){ printf("|"); for(int j = 0; j < 4; j++){ printf("%02x|", (int)X[i][j]); } printf("\n"); } } void Dump_rk(char *s, sc_uint<8> X[11][4][4]) { printf("%s rk\n", s...
ALGO
0.999216
4.296526
b8d17b22-a02c-4252-9948-04018fa4a53b
21111019Harry/CPP-Problems
Problems on array/14.cpp
#include<iostream> #include<bits/stdc++.h> using namespace std; void reversearray(int brr[], int length); int main() { int n = 0; cout<< "Enter the size:-"; cin>> n; int arr[n]; for(int i = 0; i < n; i++) { cin>>arr[i]; } cout<<endl; reversearray(arr,n); return...
ALGO
0.999812
4.729925
f492aa55-b4d7-44df-bf5c-0fc86564881d
omkarpol09/note-it-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.998784
6.761023
ad3828ec-9c65-4984-a087-d53f0a1a2d65
MySuperSoul/pat-advanced
1017.cpp
#include <iostream> #include <set> #include <cstdio> #include <unordered_map> #include <unordered_set> #include <vector> #include <algorithm> #include <map> #include <stack> #include <cmath> #include <string> #include <cstring> #include <sstream> #include <queue> using namespace std; #define MAXN 61200 #define MINN 2...
ALGO
0.999364
4.213666
5a23ea1e-c978-4616-b182-7bc8899cb3cc
adityanjr/code-DS-ALGO
Olympiad Solutions/URI/2561.cpp
// Ivan Carvalho // Solution to https://www.urionlinejudge.com.br/judge/problems/view/2561 #include <cstdio> #include <cstdlib> #include <algorithm> using namespace std; int main(){ int x1,y1,x2,y2,x3,y3,x4,y4; while(scanf("%d %d %d %d",&x1,&y1,&x2,&y2) != EOF){ scanf("%d %d %d %d",&x3,&y3,&x4,&y4); int x5 = max(...
ALGO
0.993915
3.370579
0a112c47-f8f1-4b89-968e-3bb8d22fd3d3
sailfishos-mirror/llvm-project
libc/src/math/generic/fsubl.cpp
#include "src/math/fsubl.h" #include "src/__support/FPUtil/generic/add_sub.h" #include "src/__support/common.h" #include "src/__support/macros/config.h" namespace LIBC_NAMESPACE_DECL { LLVM_LIBC_FUNCTION(float, fsubl, (long double x, long double y)) { return fputil::generic::sub<float>(x, y); } } // namespace LIBC...
ALGO
0.930988
6.083954
b8fcf2c7-b340-4d54-9911-e83ba7525500
aqshanto/C
Phitron/Module13/sum_of_two_value_equal_x.cpp
#include<stdio.h> int main(){ int n; scanf("%d",&n); int arr[n]; for(int i=0;i<n;i++){ scanf("%d",&arr[i]); } int x; scanf("%d",&x); for(int i=0;i<n-1;i++){ for(int j=i+1;j<n;j++){ if(arr[i]+arr[j]==x){ printf("%d %d\n",i,j); } ...
ALGO
0.999826
3.931994
f7708958-f088-4d41-92ae-0a903985f40e
5S4D1/Codeforces
Assiut_University_Training/Sheet #2/sheet2_U.cpp
// sheet #2 // problem: U // title: Some Sums #include <bits/stdc++.h> using namespace std; int main() { int n, a, b, sum = 0; cin >> n >> a >> b; for (int i = 1; i <= n; i++) { int temp = i; int values = 0; while (temp > 0) { values += temp % 10; ...
ALGO
0.999046
3.919792
49f3c81c-1bb9-432e-a570-aad169a6498e
vishal-ayyappan/dsa_cpp
Leetcode/Difficulty/Medium/lc130.cpp
#include <bits/stdc++.h> using namespace std; /* Do multisource DFS with nodes x, and whenever you encounter 0, visited = true Also, avoid the edges (DFS) */ void getMultiDfs(vector<vector<char>>& board, vector<vector<bool>>& visited, int row, int col, vector<int> delRow, vector<int> delCol){ visited[row][co...
ALGO
0.999664
5.981798
31cb9d8a-fe0f-4674-99ff-58253ae98cc3
113bommy/deepmind_codecontests_refine
cpp_source_filter_file/cpp_train_9767_1.cpp
#include<bits/stdc++.h> using namespace std; int main(){ long long a,b,k; cin >> a >> b >> k; for(int i=1;i<=k;i++){ if(i%2==1){ b+=a/2; a/=2: } else{ a+=b/2; b/=2; } } cout << a << " " << b << endl; }
ALGO
0.999964
3.348902
ec0eec1a-9e00-4cc4-a3e4-fc691e0b4f27
caiopetruccirosa/mc721-2023s1
contest-2023-06-30/B.cpp
#include <bits/stdc++.h> #define _ ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); #define ll long long #define pii pair<int,int> #define plli pair<ll,int> using namespace std; int main() {_ int n, m; cin >> n >> m; vector<vector<plli>> adj(n+1, vector<plli>()); vector<ll> vw(n+1), dw(n+1); ...
ALGO
0.999991
4.344091
2bf2dc54-b41d-4c96-8552-6f0cb1a332c1
ZahariBakov/CPP
C++ Advanced/C++ Multidimensional Arrays - Exercise/04.SnakeMoves/04.SnakeMoves.cpp
#include <iostream> #include <vector> #include <string> std::vector<std::vector<char>> createMatrixFromInput() { int rows = 0; int cols = 0; std::cin >> rows >> cols; std::string word; std::cin >> word; std::vector<std::vector<char>> matrix(rows); int idx = 0; for (int i = 0; i < row...
ALGO
0.999783
6.019729
e93d53ed-9539-4c88-b33c-2fb1d93410a0
songhaikun/bustub-hksong
src/optimizer/merge_projection.cpp
#include "catalog/column.h" #include "catalog/schema.h" #include "execution/expressions/column_value_expression.h" #include "execution/plans/abstract_plan.h" #include "execution/plans/projection_plan.h" #include "optimizer/optimizer.h" #include <algorithm> #include <memory> namespace bustub { auto Optimizer::Optimize...
ALGO
0.945705
7.258725
29ead376-c2a7-4783-817c-17dabb46f189
ixomaxip/cpp
01-WhiteBelt/W2/tasks/1.functions/06.vec_reverse.cpp
#include <vector> #include <string> // #include "./06.test.vec_reverse.h" using namespace std; void Reverse(vector<int>& v) { for(size_t i = 0; i < v.size() / 2; ++i) { int tmp = v[i]; int r_idx = v.size() - 1 - i; v[i] = v[r_idx]; v[r_idx] = tmp; } }
ALGO
0.851858
4.891856
0b2f5ffb-ecb9-46d2-b0ed-de8a7541df80
suryakiran03/week4-cipherschools
lecture36.cpp
#include<iostream> using namespace std; int fib(int input){ if(input == 0 || input == 1){ //Base case, i.e the point where it stops return 1; } int final_answer = fib(input-1) + fib(input-2); return final_answer; } int main(){ int input; cout<<"Enter the numbers to find the fibonacci series: "; cin>>inpu...
ALGO
0.999681
4.261074
da785c69-9fa6-422a-b1e4-6d55b111c796
mmashimo/cMoon
src/AMoon.cpp
/// @file /// /// @brief AMoon class implementation. /// /// @copyright 2019-2020 M.Mashimo and licensors. All Right Reserved. /// /// This file is part of cMoon application. /// /// cMoon is free software: you can redistribute it and/or modify /// it under the terms of the GNU General Public License as published by //...
TOOL
0.935154
3.739112
21945ddd-ee5d-4d91-be89-e6a14c181d57
Shawon00s/CSE225-Lab-Data_Structure_And_Algorithm-NSU-IqN
10_Unsorted Lists (Linked List Based)/main.cpp
/* Tasks: Generate the driver file (main.cpp) where you perform the following tasks. Operation to Be Tested and Description of Action ▪ You are given two sequences of integers arranged in ascending order. Your task is to combine the sequences into one ascending sequence. You can safely assume t...
ALGO
0.999712
5.504577
2bfe0fc8-f9cd-49b1-99d5-2a6ddf37fae5
amitkys/cp
jan25/22jan/removeDuplicate.cpp
//{ Driver Code Starts // Initial template for C++ #include <bits/stdc++.h> using namespace std; // } Driver Code Ends // User function template for C++ class Solution { public: int removeDuplicates(vector<int> &arr) { int j = 1; int i = 0; while(j < arr.size()) { i...
ALGO
0.99914
6.693555
c5c1278d-d7ff-4a75-9c3e-9de1b4425eef
fleon-psi/eigen
doc/snippets/Cwise_array_power_array.cpp
Array<double, 1, 3> x(8, 25, 3), e(1. / 3., 0.5, 2.); cout << "[" << x << "]^[" << e << "] = " << x.pow(e) << endl; // using ArrayBase::pow cout << "[" << x << "]^[" << e << "] = " << pow(x, e) << endl; // using Eigen::pow
ALGO
0.982387
3.220999
b973bfee-b014-4155-aeec-a56a58d34ae6
Abhishekrauniyar2906/Leetcode_Solutions
71-simplify-path/simplify-path.cpp
class Solution { public: string simplifyPath(string path) { stack<string>st; int i = 0; while(i < path.size()){ int start = i; int end = i + 1; while(end < path.size() && path[end] != '/'){ ++end; } i = end; ...
ALGO
0.999938
5.914977
7f65a99b-6c97-47e9-ba42-a41c52b84311
Eeman1113/Leetcode
Problems/850.cpp
class Solution { public: int peakIndexInMountainArray(vector<int>& arr) { int l = 0; int r = arr.size() - 1; while (l < r) { const int m = (l + r) / 2; if (arr[m] >= arr[m + 1]) r = m; else l = m + 1; } return l; } };
ALGO
0.999774
6.263778
1c0e0969-bd1b-41c7-aa8c-35dd6af941cd
tbuchs/webSPDZ
Paper-Benchmarks/MPC-Engines/mpSPDZ/SRC_v0.3.7/Tools/Waksman.cpp
/* * Waksman.cpp * */ #include "Waksman.h" #include <algorithm> #include <assert.h> #include <math.h> template<class T> void append(vector<T>& x, const vector<T>& y) { x.insert(x.end(), y.begin(), y.end()); } vector<vector<bool> > Waksman::configure(const vector<int>& perm) { int n = perm.size(); ass...
ALGO
0.998359
4.542322
7347dcb5-a23e-4afc-a34c-fa4a165749a9
NephrenCake/Algorithm
AcWing/算法基础课/第二讲 数据结构/826. 单链表.cpp
#include <iostream> using namespace std; const int N = 100010; int e[N], ne[N], idx = 1; void insert(int k, int x) { e[idx] = x, ne[idx] = ne[k], ne[k] = idx++; } void del(int k) { ne[k] = ne[ne[k]]; } int main() { int n, x, k; string s; cin >> n; while (n-- && cin >> s) if (s == "H...
ALGO
0.999833
3.893891
422841d1-2507-47bb-8567-0a7dcf17a796
HARSHGit45/100-days-of-DSA
Multiples of 2 and 3.cpp
int FindSum(int *arr,int l) { int sum=0; for(int i=0;i<l;i++) { if(arr[i]%2==0 || arr[i]%3==0){ sum=sum+arr[i]; } } return sum; }
ALGO
0.999944
3.22774
2112cbc9-a2d2-405a-9e9f-5af4ec56e2f1
tamim36/Problem-Solving
Vjudge Online Judge/fox.cpp
#include <bits/stdc++.h> using namespace std; int c[10], d[10]; int main() { int a, b; cin >> a >> b; int t = a, y = b; while (t % 2 == 0) t /= 2, ++c[0]; while (t % 3 == 0) t /= 3, ++c[1]; while (t % 5 == 0) t /= 5, ++c[2]; while (y % 2 == 0) y /= 2, ++d[0]; whi...
ALGO
0.999974
4.007159
843fd5bb-e31e-45c1-b6c5-da9ee9b3bd21
VMihalov/lessons-cpp
2 семестр/tema12-10.cpp
#include <iostream> using namespace std; int f(int n) { if (n>100) return n-10; else return f( f(n+11) ); } int main() { cout << "f(106) " << f(106) << endl; cout << "f(99) " << f(99) << endl; cout << "f(85) " << f(85) << endl; return 0; }
ALGO
0.997735
3.701813
8b869405-67ac-4d46-8b97-c7491c2c1725
shiohiyoko/3DVC
3DVC2/eigen-3.4.0/test/sparseLM.cpp
#include "main.h" #include <Eigen/LevenbergMarquardt> using namespace std; using namespace Eigen; template <typename Scalar> struct sparseGaussianTest : SparseFunctor<Scalar, int> { typedef Matrix<Scalar,Dynamic,1> VectorType; typedef SparseFunctor<Scalar,int> Base; typedef typename Base::JacobianType JacobianT...
TEST
0.979231
6.154785
590fb739-1625-4dba-bbc1-c297cf9216b1
Stefanstud/leetcode-env
data/leetcode_solutions/solutions/2158. Amount of New Area Painted Each Day/2158-2.cpp
class Solution { public: vector<int> amountPainted(vector<vector<int>>& paint) { map<int, int> intervals; vector<int> result; for (const vector<int>& p : paint) { int eraseLen = 0; auto it = intervals.lower_bound(p[0]); if (it != begin(intervals) && prev(it)->second >= p[0]) --...
ALGO
0.999657
6.24001
085fe86e-64c7-4f73-b066-0f720054efdf
SanduSenarathne/Tip_Calculator
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.9988
6.76073
3d2ca50f-9a62-4288-9dec-199ce1210cb4
amang234/LeetCode-DSA
1255-maximum-score-words-formed-by-letters/1255-maximum-score-words-formed-by-letters.cpp
class Solution { public: int maxScoreWords(vector<string>& words, vector<char>& letters, vector<int>& score) { vector<int> count(26, 0); vector<int> lettersCount(26, 0); for(auto &c : letters){ count[c - 'a']++; } int ans = 0; backtracking(words, score, c...
ALGO
0.999962
6.104264
8a1f4303-d9b6-4d8d-9b6d-4710c5ee02d1
Mayank-Parasar/leetcode
printing_matrix_zigzag.cpp
// // Created by Mayank Parasar on 2020-03-15. // /* Zigzag (or diagonal) traversal of Matrix Given a 2D matrix, print all elements of the given matrix in diagonal order. For example, consider the following 5 X 4 input matrix. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ...
ALGO
0.999737
5.572434
a36a087b-a897-4b61-9839-dda1e96f1fd0
EfratNagar/MyProject
dlib/examples/train_shape_predictor_ex.cpp
/* This example program shows how to use dlib's implementation of the paper: One Millisecond Face Alignment with an Ensemble of Regression Trees by Vahid Kazemi and Josephine Sullivan, CVPR 2014 In particular, we will train a face landmarking model based on a small dataset and then ev...
ALGO
0.976744
6.758131
7077c7fb-3ed8-499f-bace-aef549050a84
yangbai90/MPILearn
Ex3/vector.cpp
#include <iostream> #include <vector> #include <chrono> #include <mpi.h> using namespace std; int main(int args,char *argv[]){ int size,rank; const int n=50000000; vector<double> vec; int istart,iend,rankn; vec.resize(n,0.0); auto starttime=chrono::high_resolution_clock::now(); MPI_Init(&args,&argv); MPI...
ALGO
0.999604
3.792988
d845d6f5-02df-42cd-a235-aee08da2a069
wilsonrochaee/TEEE-PROGRAMACAO-CPP-UFMA
Lista1/Questao2/vetorUnitario.cpp
#include <iostream> #include <cstdlib> #include <cmath> #include <locale.h> using namespace std; void recebeValores(float* vetor, int nComponentes); float somaQuadrados(float* vetor, int nComponentes); float calculaNorma(float soma); float* calculaVersor(float* vetor, float norma, int nComponentes); int main(int arg...
ALGO
0.976474
3.035289
ce59b07d-e880-4456-b61a-6348a33846d0
kallagoutham/My_Solutions
Leetcode/40. Combination Sum II.cpp
class Solution { private: vector<vector<int>> res; public: void solve(vector<int>& candidates, int target, int idx, vector<int>& combination) { if (target == 0) { res.push_back(combination); return; } if (idx == candidates.size() || target < candidates[idx]) { ...
ALGO
0.999994
6.509123
3d5d12d3-fb93-4bcb-af94-9521e49ac97b
siddharthaggarwal25/cp-_notes_ques
Company_Queries_II_2.cpp
#include <bits/stdc++.h> using namespace std; vector<vector<int>> adj; vector<int> parent; void dfs(int node, int par) { parent[node] = par; for (auto child : adj[node]) { dfs(child, node); } } int main() { int n, q; cin >> n >> q; adj.resize(n + 1); parent.resize(n + 1); for...
ALGO
0.999991
3.847472
97b215cd-2861-46bc-8a4f-d4a4ab0cd77a
rlewkowicz/opencvwithmodifiedsamples
samples/cpp/tutorial_code/core/how_to_use_OpenCV_parallel_for_/how_to_use_OpenCV_parallel_for_.cpp
#include <iostream> #include <opencv2/core.hpp> #include <opencv2/imgcodecs.hpp> using namespace std; using namespace cv; namespace { //! [mandelbrot-escape-time-algorithm] int mandelbrot(const complex<float> &z0, const int max) { complex<float> z = z0; for (int t = 0; t < max; t++) { if (z.real()...
ALGO
0.999001
6.366867
069a5767-1d4c-4216-aefa-12fe0abe8aaf
nodchip/icfpc2021
libs/boost_1_76_0/libs/contract/example/features/lambda.cpp
#include <boost/contract.hpp> #include <vector> #include <algorithm> #include <limits> int main() { std::vector<int> v; v.push_back(1); v.push_back(2); v.push_back(3); //[lambda int total = 0; std::for_each(v.cbegin(), v.cend(), // Contract for a lambda function. [&total] (...
TEST
0.879325
6.028696
1b3196ef-93eb-436e-85a1-ad29069072a5
nikolapesic2802/Programming-Practice
Prefixuffix/main.cpp
/* -The solution is uvTvu where u,v,T are some strings. -Use hashing to check if two substrings are equal with constant time and O(n) preprocessing. -If we can find the longest length of v for every size of u, that is enough to solve the task. (we can just go through every length of u, and if the prefix is ...
ALGO
0.999979
4.519856
24e4e818-7ca0-43dd-8f1e-dcb2d5d45772
sarvex/leetcode-bhai
solution/0000-0099/0016.3Sum Closest/Solution.cpp
class Solution { public: int threeSumClosest(vector<int>& nums, int target) { sort(nums.begin(), nums.end()); int ans = 1 << 30; int n = nums.size(); for (int i = 0; i < n; ++i) { int j = i + 1, k = n - 1; while (j < k) { int t = nums[i] + nums...
ALGO
0.999998
6.283242
1869645f-6772-4e52-ad22-a2b95cf7747b
devloper016/Programming
1984.cpp
class Solution { public: int minimumDifference(vector<int>& nums, int k) { int ans=INT_MAX; sort(nums.begin(),nums.end()); for(int i=0;i+k-1<nums.size();i++){ ans = min(ans,nums[i+k-1]-nums[i]); } return ans; } };
ALGO
0.999944
5.288282
be66d4d8-1dd9-41d6-bdf7-8e7b92f0f24b
MahdiFarahani1/alahwar
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.9988
6.76073
52005390-3fe1-45b9-a197-ae0806d83459
singhkumaryash/DSA_StriversA2Z
01_Basics/Patterns/numberPattern.cpp
// Problem statement : Ninja has been given a task to print the required // pattern and he asked for your help with the same. // You must print a matrix corresponding to the given number pattern. // Example: // Input: ‘N’ = 4 // Output: // 4444444 // 4333334 // 4322234 // 4321234 // 4322234 // 4333334 // 4444444 // So...
ALGO
0.999973
6.567641
48c5e3f9-46d1-4a8e-a650-9e03e43e152e
rishu9829raj8462/CSES_Solutions
apartments.cpp
#include<iostream> #include<bits/stdc++.h> using namespace std; int main() { int n, m, k; cin >> n >> m >> k; vector<int> a(n); for(int i=0; i<n; i++) { cin >> a[i]; } vector<int> b(m); for(int i=0; i<m; i++) { cin >> b[i]; } sort(a.begin(), a.end()); sort...
ALGO
0.999957
3.723878
55a4833c-afa8-4ce5-9ea4-31a9af771e35
saadali0987/OOP-c-for-university
l226608-assignment3.cpp
#include <iostream> #include <fstream> using namespace std; //main function: void StringConcatenate(char* &string1, char* string2); char** StringTokens(char* string); char** inverseStringTokens(char* string); char* ReverseSentence(char* string); int CompareString(char* string1, char* string2); void sortedStudentNames(...
TOOL
0.994302
4.45865
11c4d56c-b102-4f8a-b067-14fa6457a97c
Buttiyeeppp/Code
Luogu/P3387.cpp
#include<bits/stdc++.h> using namespace std; const int N=2e4+10; const int M=2e5+10; int n,m,dfn[N],low[N],tim,sta[N],top,choose[N]; int col[N],tot,a[N],ind[N],A[N],dis[N]; struct Edge { int u,v; }e[M]; vector<int> G[N],g[N]; void tarjan(int x) { dfn[x]=low[x]=++tim; sta[++top]=x; for(auto y:G[x]) { ...
ALGO
0.999942
4.187634
d1d7a655-d649-4394-b678-f300a459f0f3
ishandutta2007/codeforces
saketh/normal/1043/A.cpp
#include <bits/stdc++.h> using namespace std; #define TRACE(x) x #define WATCH(x) TRACE(cout << #x" = " << x << endl) #define WATCHR(a, b) TRACE(for (auto it=a; it!=b;) cout << *(it++) << " "; cout << endl) #define WATCHC(V) TRACE({cout << #V" = "; WATCHR(V.begin(), V.end());}) #define all(x) (x).begin(), (x).end() ...
ALGO
0.999997
4.261672
d893b3ef-5ada-429e-87df-8a3b542c77f9
Delta2904/Codeforces
208A - Dubstep.cpp
#include <bits/stdc++.h> #define ll long long using namespace std; void solve(string s) { vector<string> wub; size_t pos = 0; string found; while ((pos = s.find("WUB")) != string::npos) { if (pos > 0) { wub.push_back(s.substr(0, pos)); } s = s.substr(pos + 3); }...
ALGO
0.999925
4.119192
6df7934d-9f11-4d4d-9d2d-b0127bd811aa
mrjared16/gomoku-online-cpp
Caro_Server/GameServer.cpp
#include "pch.h" #include "GameServer.h" #include "PlayerServer.h" using namespace std; void GameServer::run() { this->init(); this->play(); } void GameServer::operator()() { this->run(); } GameServer::GameServer(CSocket *player1, CSocket *player2) { player[0] = new PlayerServer(player1, PLAYER_1_ID); // Playe...
WEB
0.943589
3.350376
df0fe3ca-ca53-4316-a958-ef5878e1b5a9
shitu13/DSA-Practice
Coding-Platforms/beecrowd_Solutions-main/1589_BobConduit_solution.cpp
#include<stdio.h> #include<stdlib.h> main() { int T,a,b; scanf("%d", &T); while(T--){ scanf("%d %d", &a,&b); printf("%d\n", a+b); } }
ALGO
0.999642
3.991129
970917be-fd38-4708-a60e-156e966742dc
Emka5885/ZadaniaMaturalne
Algorytmy maturalne/Sortowanie_przez_scalanie.cpp
/* #include <iostream> #include <vector> void merge(std::vector<int>& vec, int left, int mid, int right) { std::vector<int> temp(vec.size()); int i = left, j = mid + 1, k = left; while (i <= mid && j <= right) { if (vec[i] <= vec[j]) { temp[k++] = std::move(vec[i++]); ...
ALGO
0.999907
5.732498
f3e9c933-eff7-4a42-a2ae-8bd3d31025be
BIT-zhaoyang/competitive_programming
uva10166.cpp
#include <algorithm> #include <bitset> #include <cstring> #include <climits> #include <cmath> #include <functional> #include <iostream> #include <iomanip> #include <map> #include <queue> #include <stack> #include <string> #include <set> #include <sstream> #include <vector> #define UNVISITED -1 #define _ ios_base::sync...
ALGO
0.99946
4.18595
7de94149-b312-412d-9a1a-40bd97a5b49f
AryanTapre/DSA
06_Recursion/26_NumberOfDiceRolls_leetcode.cpp
// leetcode : 1155 #include<iostream> using namespace std; int numsRollsToTarget(int n, int k, int target) { if(target < 0) return 0; if(n == 0 && target == 0) return 1; if(n == 0 && target != 0) return 0; if(n != 0 && target == 0) return 0; int ans = 0; for(int i=1; i<=k; i++) { ans ...
ALGO
0.999962
4.792687
fc7d0f76-86a4-442b-870e-c8227f8bedd7
rociomelara7/LabosFunda
labo6.cpp/entero.cpp
#include <iostream> #include <stdlib.h> using namespace std; int main() { int a [100]; int i, n, x, numero; int v = 0; cout << "\n Digite cuantos elementos desea introducir: " << endl; cin >> n; cout << "\n Digite los elementos del arreglo: " << endl; for (i = 0; i < n; i++){ cin >> a[i]; } co...
ALGO
0.998149
3.463587
f5fd8712-383e-401a-bf63-8b44e51ffdc4
VladArtiukh/cpp1901
lesson11/mane.cpp
#include <funcs.h> .... .... .... int a = 5, b = 4, c; c = yourfunction(a, b);
TOOL
0.972407
3.956458
1cacfb9a-b233-4316-be57-2a8e743bf13a
songuijun/C-Programing
23학년 2학기/20230915/Project1/Project1/FileName.cpp
#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <math.h> #include <stdlib.h> void min_max(int* a1, int* b1, int* c1, int* min, int* max) { if (*a1 < *b1) { if (*a1 < *c1) { *min = *a1; if (*b1 > *c1) *max = *b1; else ...
ALGO
0.999713
3.597541
653d5de1-3bdc-4bb5-8209-3ee8694294df
ishandutta2007/codeforces
kobor/normal/1313/A.cpp
#pragma GCC optimize("O3") #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> ii; typedef vector<int> vi; const int INF=0x3f3f3f3f; #define FOR(i, b, e) for(int i = (b); i < (e); i++) #define TRAV(x, a) for(auto &x: (a)) #define SZ(x) ((int)(x).size()) #define PB push_back #def...
ALGO
0.999682
4.337899
d823dba7-aefb-4801-910b-e482ea9f10a5
smshaqib/Solved_by_shaqib
CF 320A.cpp
/// *** --- In the name of ALLAH ||| --- *** /// #include<bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> vi; typedef vector<ll> vl; typedef vector<vi> vvi; typedef vector<vl> vvl; typedef pair<int,int> pii; typedef pair<double, double> pdd; typedef pair<ll, ll...
ALGO
0.999956
3.671089
46ee39cb-769a-4ca1-8fc0-2a2661500271
DrunKenGorilla/CxImage
CxImage/ximahist.cpp
// xImaHist.cpp : histogram functions /* 28/01/2004 v1.00 - www.xdp.it * CxImage version 7.0.2 07/Feb/2011 */ #include "ximage.h" #if CXIMAGE_SUPPORT_DSP //////////////////////////////////////////////////////////////////////////////// int32_t CxImage::Histogram(int32_t* red, int32_t* green, int32_t* blue, int32_t*...
TOOL
0.959184
4.282407
e4995937-e404-43b9-87e3-d721de03c975
GVishnuPriya/cs3202
impl/solvers/next.cpp
#include <assert.h> #include "impl/condition.h" #include "impl/solvers/next.h" #include "simple/util/statement_visitor_generator.h" #include "simple/util/ast_utils.h" #include "simple/util/set_convert.h" namespace simple { namespace impl { using namespace simple; using namespace simple::util; class SolveNextVisitorT...
ALGO
0.98784
6.881931
8fa3a9d3-6c21-499d-9fea-f97d8fc82305
GBoGH/EXCPPEL
src/operations/Evaluate.cpp
/** * @author Jakub Feik <<EMAIL>> * @date 03.06.2023 */ #include <iostream> #include <memory> #include <stack> #include "Evaluate.hpp" using namespace std; std::unique_ptr<Value> Evaluate::eval( Cell & cell, Table & table, const std::string & RPN, const Objects & obj) { stack <unique_ptr<Va...
TOOL
0.906854
6.878014
99b0fe4a-eb57-4f34-904b-9788cf7ed3ac
Kakkang/pertemuan_lima
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.99887
6.783439
9384f165-1896-452d-8aca-a07d7f43783e
sh-sho1kat/CODEFORCES
Codeforces Round 915 (Div. 2)/B_Begginer_s_Zelda.cpp
///********************** بِسْمِ ٱللَّهِ ٱلرَّحْمَـٰنِ ٱلرَّحِيمِ **********************/// /** * author: Shefat Hossen Shoikat * date : 2023-12-16 20:58:07 **/ #include <bits/stdc++.h> using namespace std; #define fastio ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL) #define mod 1000000...
ALGO
0.99953
5.276332
764f95a8-1adf-47de-b8e3-286973142b42
doongeon/dataStructureAndAlgorithm
dataStructure/cuckoo_hashing.cpp
// ٱ ؽ // Ϻ ؽ ϳ. #include <iostream> #include <vector> class hash_map { std::vector<int> data1; std::vector<int> data2; int size; int hash1(int key) const { return key % size; } int hash2(int key) const { return (key/size) % size; } public: hash_map(int n) ...
ALGO
0.999614
5.191954
74dd1e8b-e817-47af-85c7-c31ae7f18287
CottageLord/DX11-3D-Game-Engine
DX11 3D Game Engine/GRAPHICS_HELP_MatrixTranslator.cpp
#include "GRAPHICS_HELP_MatrixTranslator.h" namespace dx = DirectX; DirectX::XMFLOAT3 ExtractEulerAngles(const DirectX::XMFLOAT4X4& mat) { dx::XMFLOAT3 euler; euler.x = asinf(-mat._32); // Pitch if (cosf(euler.x) > 0.0001) // Not at poles { euler.y = atan2f(mat._31, mat._33); ...
ALGO
0.953417
6.047978
970a9b0a-4f00-47b4-89de-d6101ac9abb2
wackersCTF/competitive_programming
Codeforces/NewRound.cpp
// https://codeforces.com/problemset/problem/158/A #include <iostream> using namespace std; int main() { int n, k; cin >> n >> k; int arr[50]; for (int i = 0; i < n; i++) { cin >> arr[i]; } int counter = 0; // this keeps track of how many participants move on /* since negative scor...
ALGO
0.999988
4.357654
f1c0cdab-1186-4db2-a97e-589ffa58ba35
stalin670/LEETCODE-SOLUTIONS
3282-reach-end-of-array-with-max-score/3282-reach-end-of-array-with-max-score.cpp
class Solution { public: #define ll long long long long findMaximumScore(vector<int>& nums) { ll n = nums.size(); ll ans = 0; ll lastInd = 0; for(ll i = 1; i < n; i++) { if(nums[i] > nums[lastInd]) { ans += (i - lastInd) * nums[lastInd]; ...
ALGO
0.999986
5.28648
9fc75497-8632-44a0-bde3-1c16a9e74e93
sarvex/leetcode-matlab
solution/0000-0099/0002.Add Two Numbers/Solution.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* addTwoNumbe...
ALGO
0.99997
6.48792
966be486-49c6-4eb1-ab37-2511f57fe638
Andrei-Chiorian/light_control_pio
src/expoFunc.cpp
#include <expoFunc.h> /** * @brief Exponential brightness function to simulate sunrises and sunsets * * @param[in] y0 The initial brightness of the LED. * @param[in] ymax The maximum brightness of the LED. * @param[in] duration The duration of the sunrise or sunset in seconds. * @param[in] ...
ALGO
0.972594
4.768646