uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
364a17f1-0a1a-4324-b6fe-aa860f0e9b6c
Harikajeedigunta/cpp
simpleinterest.cpp
#include<iostream> using namespace std; int main() { float p; float t; float r; cin>>p>>t>>r; float SI; SI=(p*t*r)/100; cout<<SI; }
ALGO
0.998883
3.71621
b2aaa069-f4d8-4f85-99c1-a05b12201104
ppyppy/Transfer
CareerCup/cracking-the-coding-interview/9.3.cpp
#include <iostream> using namespace std; int search(int a[], int low, int high, int x){ while(low <= high){ int mid = low + (high - low)/2; if(a[mid] == x) return mid; if(a[mid] >= a[low]) { if(x<a[mid] && x>=a[low]) high = mid - 1; else ...
ALGO
0.999073
4.502151
fc42a8e1-6a49-44e1-a36d-0d2a37e0e0d9
KeweiQ/Computer-Graphics
a4/libigl/include/igl/on_boundary.cpp
// IGL includes #include "sort.h" #include "face_occurrences.h" // STL includes template <typename IntegerT> IGL_INLINE void igl::on_boundary( const std::vector<std::vector<IntegerT> > & T, std::vector<bool> & I, std::vector<std::vector<bool> > & C) { using namespace std; if(T.empty()) { I.clear(); ...
ALGO
0.987264
6.545199
d31e3385-df62-4594-9681-b5a294bafbd2
keisuke90/AtCoder
abc/abc348/c.cpp
#include <bits/stdc++.h> #define rep(i, start, end) for(int i = start; i < end; i++) using namespace std; int main(){ int n; cin >> n; map<int, int> mp; rep(i, 0, n) { int a, c; cin >> a >> c; if(mp[c]==0) mp[c] = 1000000009; mp[c] = min(mp[c], a); } int ans = 0...
ALGO
0.999841
3.948333
538ef9fe-e1ce-4e10-b5bc-eaad9cfc9b6d
InnoFang/algo-set
LeetCode/0539. Minimum Time Difference/solution.cpp
/** * 113 / 113 test cases passed. * Runtime: 12 ms * Memory Usage: 13 MB */ class Solution { public: int char2int(const char &c) { return c - '0'; } int hash(const string &timePoint) { return (char2int(timePoint[0]) * 10 + char2int(timePoint[1])) * 60 + (char2int(tim...
ALGO
0.999936
6.009534
d6c1a94a-8fb6-4c48-9c0a-046eb521d172
Himanshujena2003/DSA_Problems
0145-binary-tree-postorder-traversal/0145-binary-tree-postorder-traversal.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.999939
6.137497
a80d9fa3-8e71-482c-9d89-52fab432ba00
researchmm/tasn
tasn-mxnet/3rdparty/mkldnn/src/cpu/jit_avx512_core_x8s8s32x_1x1_conv_kernel.cpp
#include <float.h> #include "c_types_map.hpp" #include "nstl.hpp" #include "type_helpers.hpp" #include "mkldnn_thread.hpp" #include "utils.hpp" #include "cpu_memory.hpp" #include "jit_uni_1x1_conv_utils.hpp" #include "jit_avx512_core_x8s8s32x_1x1_conv_kernel.hpp" #define GET_OFF(field) offsetof(jit_1x1_conv_call_s, f...
ALGO
0.970039
5.619466
7ea725fb-f551-4723-98d0-aea770b66e95
Rebecca-Peng/OF-Homework5
src/agent.cpp
// // agent.cpp // Homework-05 // // Created by pfy on 2/28/17. // // #include "agent.hpp" //constructor agent::agent(){ velDir.set(0, ofRandom(.5, 2)); // init random speed velDir.rotate(ofRandom(360)); // init random direction mouse.set(0,0); count = 0; gravity = 0.6; } void agent...
ALGO
0.996042
4.626575
779f0be8-7fad-48a0-97fa-43c629acb9eb
uvansh/DSA_Questions
Hashing(Hash Table)/MaxlenSub.cpp
#include<iostream> #include<unordered_map> using namespace std; int maxLen(int arr[],int size){ int curr_sum = 0; int count = 0; unordered_map<int,int> m; for(int i = 0;i<size;i++){ curr_sum+=arr[i]; if(m.find(curr_sum-sum)!=m.end()){ count=max(count,i-m[curr_sum-sum]); ...
ALGO
0.999737
4.283793
941f38c9-2fe8-4069-ab8b-c1d41f2f44fc
ishandutta2007/codeforces
_twilight/normal/1270/A.cpp
#include <bits/stdc++.h> using namespace std; typedef bool boolean; template <typename T> boolean vmin(T& a, T b) { return (a > b) ? (a = b, true) : (false); } template <typename T> boolean vmax(T& a, T b) { return (a < b) ? (a = b, true) : (false); } template <typename T> T smax(T x) { return x; } template <typen...
ALGO
0.999896
3.856494
77bbad6d-c60f-4f97-baca-266b0d05869a
NDNLink/NDN-Chord
src/ndnSIM/ndn-cxx/src/security/v2/validator-config/filter.cpp
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ #include "filter.hpp" #include "data.hpp" #include "interest.hpp" #include "security/security-common.hpp" #include "util/regex.hpp" #include <boost/algorithm/string/predicate.hpp> namespace ndn { namespace security { namespace v2 { namespace validato...
TOOL
0.861662
6.988298
c429ce31-0f66-4f2a-98c0-fc436f391090
we-are-kicking-lhx/xinxinalgorithm
L1022. Sum of Root To Leaf Binary Numbers.cpp
#include<bits/stdc++.h> using namesapce std; struct TreeNode { int val; TreeNode *left; TreeNode *right; TreeNode(int x) : val(x), left(NULL), right(NULL) {} }; class Solution { public: int sumRootToLeaf(TreeNode* root) { return getSum(root,0); } int getSum(TreeNode* root,int s){ ...
ALGO
0.99998
5.711674
5a196ead-07df-435f-a527-4972cb1dfa35
OpenPodcar/OpenPodcar
catkin_ws/src/FLOBOT/bayestracking/src/bayes_tracking/models.cpp
#include "bayes_tracking/models.h" #include "bayes_tracking/BayesFilter/matSup.hpp" #include "bayes_tracking/angle.h" #include <boost/numeric/ublas/io.hpp> #include <float.h> using namespace Bayesian_filter; using namespace Models; //************************************************************************* // ...
ALGO
0.999037
5.619803
6f28ce2f-e240-4f10-9927-2ed102a3720a
sagar-prasad-01/learning-c-
for prime.cpp
#include <iostream> using namespace std; int main() { int n; cin>>n; int cnt=0; for(int i=1;i<=n;i++) { if(n%i==0) { cnt++; } } if(cnt==2) { cout<<"num is prime"; } else cout<<"num is not prime"; return 0; }
ALGO
0.999849
4.05224
cbcc1762-7447-4990-bca7-df3c723f730d
robert501128/leetcode
274_HIndex.cpp
class Solution { public: int hIndex(vector<int>& c) { int i, n=c.size(); int *b = new int [n+1](); for( i=0; i<n; i++) c[i] < n? b[c[i]]++ : b[n]++; int N_h = 0; for(i=n; i>=0; i--) { N_h += b[i]; if(N_h >= i) return...
ALGO
0.999801
5.810592
d31709fe-f480-41a1-96b1-c2e0f85b5359
zilong557347/tesseract-ocr
src/ccstruct/dppoint.cpp
#include "dppoint.h" #include "errcode.h" #include "tprintf.h" namespace tesseract { // Solve the dynamic programming problem for the given array of points, with // the given size and cost function. // Steps backwards are limited to being between min_step and max_step // inclusive. // The return value is the tail of ...
ALGO
0.999978
3.790567
b1c6a515-04bb-4433-9c7c-0dd01de795d2
ls171433/leetcode
src/3085.cpp
#include <string> #include <vector> using namespace std; class Solution { public: int minimumDeletions(string word, int k) { vector<int> word_count; word_count.resize(26, 0); for (char c : word) { ++word_count[c - 'a']; } int min_remove = INT_MAX; ...
ALGO
0.999804
5.939178
97e835ef-0781-4221-b284-71e4ebf9c7cc
twineapp/twineheadless
qt/src/corelib/tools/qlocale_tools.cpp
#include "qlocale_tools_p.h" #include "qlocale_p.h" #include "qstring.h" #include <ctype.h> #include <float.h> #include <limits.h> #include <math.h> #include <stdlib.h> #include <time.h> #ifdef Q_OS_WINCE # include "qfunctions_wince.h" // for _control87 #endif #if defined(Q_OS_LINUX) && !defined(__UCLIBC__) # ...
TOOL
0.930131
5.652908
12d8cd79-1100-4261-bfd6-54fbc43e1cdf
Kavin1421/Leetcode-Solution
2400-2499/2404.Most Frequent Even Element/Solution.cpp
class Solution { public: int mostFrequentEven(vector<int>& nums) { unordered_map<int, int> cnt; for (int x : nums) { if (x % 2 == 0) { ++cnt[x]; } } int ans = -1, mx = 0; for (auto& [x, v] : cnt) { if (mx < v || (mx == v && ...
ALGO
0.999934
6.011654
b72792de-919f-4a6f-bfe8-fffe0a828a6b
dima424658/darkengine
src/ai/aicbrstr.cpp
/////////////////////////////////////////////////////////////////////////////// // $Header: r:/t2repos/thief2/src/ai/aicbrstr.cpp,v 1.2 1999/03/29 08:47:22 JON Exp $ // // AI Combat - ranged StepRight // #include <aicbrstr.h> #include <appagg.h> #include <comtools.h> #include <playrobj.h> #include <objpos.h> #incl...
ALGO
0.997822
6.14895
ff211568-2fdc-47fa-a39b-ea441181f16b
vsharkovski/Competitive-Programming
Other/Li Chao Tree (DP Optimization).cpp
const int maxn = 2e5; struct LiChaoTree { typedef int ftype; typedef complex<ftype> point; #define x real #define y imag // Dot product ftype dot(point a, point b) { return (conj(a) * b).x(); } // Value of a function at some point ftype f(point a, ftype x) { return d...
ALGO
0.999653
4.003711
721118b1-24be-430d-9cf9-6d50ef27a1cc
ishandutta2007/codeforces
ftiasch/normal/1380/B.cpp
#line 1 "sol.cpp" #include <bits/stdc++.h> int main() { std::ios::sync_with_stdio(false); int T; std::cin >> T; while (T--) { std::string s; std::cin >> s; int count[]{0, 0, 0}; int n = s.size(); for (int i = 0; i < n; ++i) { if (s[i] == 'R') { count[0]++; } else if (s[i...
ALGO
0.999804
4.963431
4fc4e1ed-2207-4423-9317-a0f275ab6ddf
qbit-t/qbit
boost/libs/geometry/doc/src/examples/algorithms/comparable_distance.cpp
// Boost.Geometry (aka GGL, Generic Geometry Library) // QuickBook Example //[comparable_distance //` Shows how to efficiently get the closest point #include <iostream> #include <boost/geometry.hpp> #include <boost/geometry/geometries/point_xy.hpp> #include <boost/numeric/conversion/bounds.hpp> #include <boost/fore...
TEST
0.999073
6.366192
da10ba24-d476-4250-b39b-9e8c4b807c87
WooodHead/QSqlTableModel_example
tools/assistant/tools/assistant/helpenginewrapper.cpp
#include "tracer.h" #include "helpenginewrapper.h" #include "../shared/collectionconfiguration.h" #include <QtCore/QDateTime> #include <QtCore/QFileInfo> #include <QtCore/QFileSystemWatcher> #include <QtCore/QPair> #include <QtCore/QSharedPointer> #include <QtCore/QTimer> #include <QtHelp/QHelpContentModel> #include ...
TOOL
0.931345
5.558464
00d82bb8-9937-495e-8fb9-dfe54dd2f9a9
khayrulz/programming
lightoj/light1005.cpp
#include<bits/stdc++.h> using namespace std; long long solve(long long n, long long k) { if(k==1) return n * n; return ((n-1) * (n-1) ) + solve(n-1, k-1); } int main() { long long t, cas = 0, n, k; cin > (++cas <= t) { cin >> n >> k; cout << "Case " <<...
ALGO
0.99965
4.492825
8f56b8ae-0147-4e65-b353-41e470af2379
pydmy7/Calibrate
chessboard/src/cornersorthelper.cpp
#include "chessboard/cornersorthelper.hpp" #include "chessboard/cornersort.hpp" #include "chessboard/geometry.hpp" #include <numbers> #include <array> std::pair<int, int> getChessboardSizeByChessboardType(cornersort::ChessboardType chessboardtype) { if (chessboardtype == cornersort::ChessboardType::twomultwo) { ...
ALGO
0.998527
5.77595
09f2b0fc-f358-4fd1-9280-5685b009037f
amirali110/Stochastic-Calculator
stoch_calculator.cpp
#include "stoch_calculator.h" #include <QNetworkAccessManager> #include <QNetworkReply> #include <QNetworkRequest> #include <QEventLoop> #include <QObject> #include <QString> #include <QDateTime> #include <QJsonArray> #include <QJsonDocument> #include <QJsonObject> #include <QJsonValue> #include <QVariant> #include <io...
ALGO
0.965178
4.084076
70c63ee1-4342-4780-b164-ae4bf0f5a5c1
dangleptr/nebula-common
src/conf/Configuration.cpp
#include "base/Base.h" #include "conf/Configuration.h" namespace nebula { namespace conf { Configuration::Configuration() { content_ = std::make_unique<folly::dynamic>(folly::dynamic::object()); } Configuration::Configuration(folly::dynamic content) { CHECK(content.isObject()) << "The content is not a valid ...
CONFIG
0.894884
6.932354
b1b96f70-01ba-4200-a59c-2ebfe18f5e0b
KjetilIN/IDATG2102-AlgoMet-Notes
Permutation/Permutation.cpp
#include <iostream> using namespace std; const int N = 4; //Max void display(int arr[]){ for(int i = 0; i<N; i++){ cout << arr[i] << " "; } cout <<"\n"; } /** * Swap to integers given * * @param a refrence of int a * @param b refrence of int b */ void swap(int & a, int & b){ int tem...
ALGO
0.999748
4.802454
3ab6f40b-7193-446b-ad38-406d081df0d7
c159cc/primer-5th
ch10/ex10_21.cpp
#include <cassert> #include <cstring> #include <deque> #include <fstream> #include <iostream> #include <sstream> #include <vector> #include <forward_list> #include <list> #include <stack> #include <algorithm> #include <numeric> using namespace std; /** * > Write a lambda that capture a local int variable and decre...
ALGO
0.858275
4.520968
855c2a72-260a-46ae-80cc-c2e1853876ae
77Arafat383/Previous-contest-problem
D_Wooden_Toy_Festival.cpp
//**************BISMILLAHIR RAHMANIR RAHIM**************** //*******************Md Yeasin Arafat**************** #include<bits/stdc++.h> using namespace std; #define check cout<<'?'<<endl; #define ll long long #define Judge(x) x==0 ? cout<<"NO\n" : cout<<"YES\n"; #define judge(x) x==0 ? cout<<"No\n" : ...
ALGO
0.999857
4.476391
6afb5375-eb53-44c9-bdd0-a458511af254
xaprier/cpp-exercises
findLocationOfMaximumElement.cpp
#include <iostream> #include <stdlib.h> using namespace std; #pragma region prototypeMethods void locationsOfMaxElements( int **array, int m, int n ); int findMaxElement( int **array, int m, int n, int &max ); void findTotal( int **array, int m, int n, int &total, int max ); void print2DArray( int **array, int m,...
ALGO
0.972728
3.921023
a713ee44-c920-433e-a072-aaf3e44c4be3
ishandutta2007/codeforces
shik/normal/157/A.cpp
// by shik #include <cstdio> #include <cstring> #include <algorithm> #define N 33 #define SZ(x) ((int)(x).size()) #define FOR(it,c) for ( __typeof((c).begin()) it=(c).begin(); it!=(c).end(); it++ ) using namespace std; int main() { int n,t,r[N]={},c[N]={},ans=0; scanf("%d",&n); for ( int i=0; i<n; i++ ) for ( int j=...
ALGO
0.999856
3.289832
0e41ac86-15d4-40d0-84a8-15c0f7443977
NikhilK06/Leet
solutions/0917. Reverse Only Letters/0917.cpp
class Solution { public: string reverseOnlyLetters(string S) { for (int i = 0, j = S.length() - 1; i < j; ++i, --j) { while (i < j && !isalpha(S[i])) ++i; while (i < j && !isalpha(S[j])) --j; swap(S[i], S[j]); } return S; } };
ALGO
0.997082
6.706091
9eb3eda9-9a90-45b8-bc00-8e57b6177e2d
Rober11pg/Estructura
Parcial I/Recursividad/IndividualizarDigitos.cpp
/* Prog. que permite individualizar los digitos de cada número Autor: Roberto Jiménez */ #include <iostream> using namespace std; #include "Utilidades.h" int main() { // programa principal system("color f0"); int n; // cantidad de valores a procesar int dmt; // va a contener el digit mayor de todos los ...
ALGO
0.997216
4.331483
d5156e69-4d73-4be7-b013-8a97447d1fd9
ashadnadeem/TaskerPro
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.998693
6.797273
ddecb6e0-fed8-4559-90d4-6d7c5f9297fe
Prajwal-ak-0/binary-search
DSA/BinarySearch/1DBinarySearch/SearchInsertPosition.cpp
#include <iostream> #include <vector> using namespace std; /* Idea: Find the index where the target should be inserted in a sorted vector. Approach: 1. Use binary search. 2. Adjust pointers based on comparison with target. Time Complexity: O(log n) Space Complexity: O(1) */ int searchInsert(vector<int>& nums, int ...
ALGO
0.99999
7.213635
1c2374ee-84be-4a40-b8c4-3a1cc07a943d
tstren1223/oop
forbook/ch11/11-7-2ptrforfunasparameter.cpp
#include<iostream> using namespace std; double sum(double x,double y){ return (x+y); } double dif(double a,double b){ return (a-b); } void sub(double(*pf)(double,double),double p,double q){ double k; k=(*pf)(p,q); cout<<"Result = "<<k<<endl; } int main(){ int choice; double x,y; cout<<"Please enter 1 to add or ...
TOOL
0.993828
4.007277
d372415b-9f9a-4afe-a5a6-bc56a71d4a0e
Yawn-Sean/Daily_CF_Problems
daily_problems/2025/05/0509/personal_submission/cf877c_nhantran0.cpp
/* https://codeforces.com/problemset/problem/877/C C. Slava and tanks Solver: nhant 2025-05-10 04:25:59 https://codeforces.com/problemset/submission/877/318987489 */ #include <bits/stdc++.h> using namespace std; void solve() { int m; cin >> m; cout << ((m / 2) * 2 + (m + 1) / 2) << '\n'; auto pr_...
ALGO
0.999492
4.304303
c4eef39b-3438-438f-928a-72e9ae7dfc71
groovenauts/libgss_cocos2dx_sample
SampleApp/libs/Box2D/Dynamics/Contacts/b2EdgeAndPolygonContact.cpp
#include <Box2D/Dynamics/Contacts/b2EdgeAndPolygonContact.h> #include <Box2D/Common/b2BlockAllocator.h> #include <Box2D/Dynamics/b2Fixture.h> #include <new> using namespace std; b2Contact* b2EdgeAndPolygonContact::Create(b2Fixture* fixtureA, int32, b2Fixture* fixtureB, int32, b2BlockAllocator* allocator) { void* ...
ALGO
0.979806
6.845571
c834b426-5ccc-482d-ba79-019077ccc063
lepecoder/algorithms
sstream.cpp
#include <bits/stdc++.h> using namespace std; int main() { // string line; int num; vector<int> nums; while (getline(cin, line) && line.size() > 0) { nums.clear(); istringstream stream(line); while (stream >> num) { nums.emplace_back(num); } for (int &x : nums) { cou...
ALGO
0.99755
5.139367
0f93afa9-b51e-4559-9419-e6f089dcb737
petercheng00/plane_mapping
renderPlanes/renderPlanes/utilities.cpp
#include "utilities.h" bool isConvex( DrawElementsUInt* poly, Vec2Array* vertices, int concave ){ //int threshhold = 5000.0; //int threshhold = 0; bool positive = false; for (int i = 0; i < poly->size(); i++){ int j = (i+1) % poly->size(); int k = (i+2) % poly->size(); Vec2 e1 = vertices->at(poly->at(j)) - v...
ALGO
0.999338
5.891371
a200363a-a533-48c2-937c-6d240b5506dd
Iaufer/tsu-labs
Algorithms and data structures/Algorithms-and-data-structures/class_Dijkstra/class_Dijkstra.cpp
#include <iostream> #include <cmath> #include <ctime> using namespace std; class Route { int *r, n; public: Route(int num = 0); Route(const Route&); Route& operator = (const Route&); ~Route() { if(r) delete []r; r = NULL; } int Route_price(int...
ALGO
0.999661
3.810592
1ec2f73d-be3c-4ff7-bf3a-1e0f5dc89e25
sarvex/leetcode-pharo
solution/0900-0999/0986.Interval List Intersections/Solution.cpp
class Solution { public: vector<vector<int>> intervalIntersection(vector<vector<int>>& firstList, vector<vector<int>>& secondList) { vector<vector<int>> ans; int m = firstList.size(), n = secondList.size(); for (int i = 0, j = 0; i < m && j < n;) { int l = max(firstList[i][0], se...
ALGO
0.999994
5.927801
7a210870-79b8-4d26-aa84-1101b460cb92
andrewei1316/OJSubmit
DATASOURCE_POJSubmit/2796/2796_20140727-110134___WA.cpp
#include <iostream> #include <stdio.h> #define N 100010 #define M -1 using namespace std; int n, a[N], lef[N], righ[N]; long long sum[N]; void solute(){ int i, j, k; long long ans = 0, temp = 0; for(i = 1; i <= n; i++){ while(a[i] <= a[lef[i] - 1]) lef[i] = lef[lef[i] - 1]; wh...
ALGO
0.999946
3.577974
d498b713-4c83-4c9e-b5f8-ba6c3c768b65
rafiwho/CP_Templates_Maker
code/Code/Manacher.cpp
/** *Description: pal[1][i] = longest odd (half rounded down) palindrome around pos i and starts at i - pal[1][i] and ends at i + pal[1][i]\\ pal[0][i] = half length of longest even palindrome around pos i, i + 1 and starts at i - par[0][i] + 1 and ends at i + pal[0][i] */ int pal[2][N]; void manacher(string &s) { in...
ALGO
0.999959
4.883028
d24cfcfc-c6fe-497c-989c-d8ce8969652e
AdityaPawar162/cpp_learnings
Stl/std_partial_sort.cpp
#include <algorithm> #include <array> #include <iostream> // Rearranges elements such that the range [first, middle) contains the sorted middle − first smallest elements in the // range [first, last). int main() { std::vector<int> v{ 3, 1, 4, 1, 5, 9 }; std::partial_sort( std::begin( v ), std::begin( v ) + 3,...
ALGO
0.99985
5.826963
3a3fa033-960c-4be0-8024-ce79e68fd3e7
Akshaygupta0409/cp
aztraning/backtracking/01.cpp
#include<bits/stdc++.h> using namespace std; int n; // lccm framework // datastructure to store current_solution vector<int> current_solution; void printer(int level){ cout<<"level : "<<level<<", current_solution : ["; for(auto v:current_solution){ cout<<v<<", "; } cout<<"]"<<endl; } bool ch...
ALGO
0.999174
3.941885
97841456-d33a-421b-94c7-be587738dacc
Saurabhn16/CP-dsa
DSA/stack/reversString.cpp
#include <bits/stdc++.h> using namespace std; int main() { string str; cin >> str; string ans = " "; stack<char> s; for (int i = 0; i < str.size(); i++) { char ch = str[i]; s.push(ch); } for (int i = 0; i < str.size(); i++) { char ch = s.top(); ans.pus...
ALGO
0.999941
4.653048
3285d627-407e-4fc9-b557-fcf5e8b82a19
ShivamBhuskute/DSA
Array/med/kadanesalgo.cpp
#include <iostream> #include <climits> #include <vector> using namespace std; long long f(vector<int> &a, int n) { long long sum = 0, maxi = LONG_MIN; for (int i = 0; i < n; i++) { sum += a[i]; if (sum > maxi) { maxi = sum; } if (sum < 0) { ...
ALGO
0.999992
6.320106
1a88c31a-a9be-49d8-9fa5-33025e9d4cdb
NilFoundation/zkllvm-circifier
llvm/lib/CodeGen/GlobalMerge.cpp
#include "llvm/ADT/BitVector.h" #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/SetVector.h" #include "llvm/ADT/SmallPtrSet.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/Statistic.h" #include "llvm/ADT/StringRef.h" #include "llvm/ADT/Twine.h" #include "llvm/CodeGen/Passes.h" #include "llvm/IR/BasicBlock.h" ...
TOOL
0.995678
7.466364
346a416f-f68a-49cd-b4c4-caf367f973cc
nasreen-ahmed/cp
_5_domino_piling/main.cpp
#include <iostream> using namespace std; int main() { int M; int N; cin >> M; cin >> N; int dominos; int total_even_num; if (M*N % 2 == 0) total_even_num = M*N; else total_even_num = M*N - 1; dominos = total_even_num/2; cout << dominos; return 0; }
ALGO
0.999567
3.069373
82790071-3465-4193-8139-c68023702fdc
SnehaKBankolli/APS-2020
the_modest_lcs.cpp
#include <iostream> #include <bits/stdc++.h> #define N 1000 #define f for #define ll long long int using namespace std; ll lcs(string s1,string s2) { ll a[N][N]={0}; f(ll i=1;i<=s1.size();i++) { for(ll j=1;j<=s2.size();j++) { a[i][j]=max(a[i-1][j],a[i][j-1]); if(s1[i-1...
ALGO
0.999948
4.371372
e8cdb916-5123-4b3a-a540-165ede69cd16
zhaodongyang2016/zxing-cpp
core/src/qrcode/QRMatrixUtil.cpp
#include "QRMatrixUtil.h" #include "BitArray.h" #include "BitHacks.h" #include "QRDataMask.h" #include "QRErrorCorrectionLevel.h" #include "QRVersion.h" #include <stdexcept> #include <string> namespace ZXing::QRCode { // From Appendix D in JISX0510:2004 (p. 67) static const int VERSION_INFO_POLY = 0x1f25; // 1 111...
ALGO
0.993182
6.148775
42b70468-2b63-4bae-be60-3f9804453d34
cwang588/algorithms
Codeforces Global Round 11/A.cpp
#include<bits/stdc++.h> using namespace std; int a[55]; int main(){ int t; scanf("%d",&t); while(t--){ int n; scanf("%d",&n); for(int i=1;i<=n;++i)scanf("%d",&a[i]); sort(a+1,a+1+n); int now1=0,now2=0; for(int i=1;i<=n;++i){ if(a[i]>0)now1+=a[i]; else now2+=a[i]; } if(now1+now2==0){ printf("...
ALGO
0.999757
3.777139
035e46c0-cc97-4e2a-911f-0ff05c4f0fa7
UdaySharmaGitHub/DSA-CPP
GFG/School Problems/Delete_alternate_characters.cpp
/* Given a string S as input. Delete the characters at odd indices of the string. Your Task: You dont need to read input or print anything. Complete the function delAlternate() which takes S as input parameter and returns the final string after deletion of characters at odd indices. Expected Time Complexity: O(|S|) ...
ALGO
0.997223
6.09774
cf5915fd-47d9-4889-b6dd-060741b5ce18
forzenheart/ACM
ACM_4/f.cpp
#include <iostream> #include <cstdio> using namespace std; int a[1000000]; int b[1000000]; //打表思想 bool vis[1000000]; int main() { int n, m; while(cin>>n) { for(int i = 0; i < n; i++) scanf("%d", &a[i]); cin>>m; for(int i = 0; i < m; i++) scanf("%d", &b[i]); bool flag = true; int dvalue = 10000 +...
ALGO
0.999932
3.50292
69256feb-2906-4eb3-b437-194250c31ad4
V27r/DSE-Course-Related
Design-and-analysis-of-Algorithms/Week 9/hash.cpp
#include <iostream> #include <vector> using namespace std; const int tableSize = 100; // size of hash table // Open hash table class class OpenHashTable { private: vector<int> table[tableSize]; // hash table int hash(int key); // hash function public: void insert(int key); // insert key into hash table ...
ALGO
0.999698
6.132298
91f97578-580b-418b-9ca3-2841bd49973e
SenseLogic/MYST
BOOST/boost_1_76_0/libs/geometry/example/c05_custom_point_pointer_example.cpp
// Boost.Geometry (aka GGL, Generic Geometry Library) #include <iostream> #include <boost/foreach.hpp> #include <boost/geometry/algorithms/distance.hpp> #include <boost/geometry/algorithms/length.hpp> #include <boost/geometry/algorithms/make.hpp> #include <boost/geometry/algorithms/intersection.hpp> #include <boost/...
TOOL
0.997463
4.662137
92fdd81d-e29e-495d-bc1d-f4165f9e1925
LJZSR/basic-algorithm
2-5-4-3.cpp
#include <iostream> #include <algorithm> using namespace std; const int MAX_V = 1000; const int INF = 100000; int dist[MAX_V][MAX_V]; int V, E; void warshall_floyed() { for (int k = 0; k < V; ++k) { for (int i = 0; i < V; ++i) { for (int j = 0; j < V; ++j) { dist[i][j] = min(dist[i][j], dist[i]...
ALGO
0.999975
4.320827
1aedb115-b018-414a-8daa-817dc19ac1b7
TDarkx13/Recursamiento_Datos
Part2/Tables.cpp
#include<stdio.h> int main() { int i, j, product; for(i=1;i<=10;i++) { for(j=1;j<=10;j++) { product = i*j; printf("%d x %d = %d\t", i, j, product); } printf("\n"); } return(0); }
ALGO
0.948465
3.672653
b6a99370-2e89-41a0-bb2a-b7e528f469a0
Abdul-Rafy2005/Semester-2-material
OOP lab task/Lab task1&2/Lab task1&2 Question4.cpp
#include<iostream> using namespace std; int main(){ int days,pennies,total_earning; pennies = 1; total_earning = 1; cout << "enter days"; cin >> days; cout << "the person is earning " << pennies << "in a 1st day"<<endl; for (int i = 1;i<= days - 1; i++){ pennies *= 2; total_earnin...
ALGO
0.999567
3.635203
b604c85b-2687-40aa-bb06-87cadd23051a
raincross7/code-similarity
codes/train_code/problem382/problem382_135.cpp
#include <iostream> #include <string> #include <cstdlib> #include <cmath> #include <vector> #include <unordered_map> #include <map> #include <set> #include <algorithm> #include <queue> #include <stack> #include <functional> #include <bitset> #include <assert.h> #include <unordered_map> #include <fstream> #include <ctim...
ALGO
0.999783
5.112892
a6751e22-2ae8-49a1-8189-078fb3129f96
Rahul4301/CS201
labassigmnment5.cpp
// Rahul Suthar // am8633 #include <iostream> using namespace std; // 1. Largest/Smallest Array Values void largestSmallest(int arr[], int size) { int largest = arr[0]; int smallest = arr[0]; for (int i = 1; i < size; i++) { if (arr[i] > largest) { largest = arr[i]; } ...
ALGO
0.999166
4.703802
2e316021-d20a-4678-9cd9-d2fcfa9670b4
JhoZzel/CSES-Problem-Set-Solutions
02. Sorting and Searching/Reading_Books.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { cin.tie(0) -> sync_with_stdio(0); int n; cin >> n; vector<int> a(n); for (int &e : a) cin >> e; int mx = *max_element(a.begin(), a.end()); ll sa = 0; for (int x : a) sa += x; if (mx > sa - mx) ...
ALGO
0.999902
4.105002
6d3a6b22-8017-4b37-a4bb-88d2494814f2
arslan-ashraf/learning-cpp
linked_list.cpp
#include <iostream> using namespace std; struct Node { int data; Node *next; }; class LinkedList { private: Node *head_node = new Node(); Node *tail_node = new Node(); Node *connector_node = new Node(); // for O(1) insertion at the end of the list public: LinkedList()...
ALGO
0.999752
5.340649
c2c6b868-b3a3-4263-bb76-83d001f37c99
mhatrejeets/DSA-CPP
word_cp.cpp
#include<iostream> #include<string> using namespace std; int main(){ cout<<"Enter the word :"; string word; cin>>word; int w_len = word.length(); cout<<w_len; }
ALGO
0.972257
3.36125
37d57b11-3b6d-4665-b087-e8a8144d5c7d
MoOo2mini/SSUalgo
이민희/brute force/boj15657.cpp
#include <iostream> #include <algorithm> using namespace std; int n, m; int result[8]; bool visited[8]; int inputSeq[10]; void dfs(int cnt, int idx) { if (cnt == m) { for (int i = 0; i < m; i++) { cout << result[i] << ' '; } cout << endl; return; } for (int i = ...
ALGO
0.999998
3.730439
5cc17b6e-6a7a-4cb2-9e1f-d66c9febbb6d
shreyanshiitb/Hackerrank
Algorithms/Strings/beautiful-binary-string.cpp
#include <bits/stdc++.h> using namespace std; int main() { int n,cnt = 0; string str; cin >> n; cin >> str; for(int i = 0; i < n;){ if(str[i] == '0' && str[i+1] == '1' && str[i+2] == '0'){ cnt++; i+=3; } else i++; } cout << cnt << endl; return 0; }
ALGO
0.999968
3.873778
3e9f2537-066c-4c99-9289-f203afc48b02
sinha-sahil/ProblemSolving
PlatformQuestions/MansiAndSeries.cpp
#include<iostream> #include<vector> #include<cmath> using namespace std; bool primeTest(int n){ if(n==0 || n==1) return false; for(int i=2; i<n; i++) if(n%i==0) return false; return true; } void generatePrime(int n, vector<int> &vi){ while(vi.size()!=n){ for(int k= vi[vi.size()-1]) } } int main(){ vector<int...
ALGO
0.999803
4.527873
ebe5240e-2d68-46bf-8701-044115a55454
Rauwch/QT3D
calc.cpp
#include "calc.h" #include<math.h> #include <vector> #include <QTextStream> #include <QPoint> #include "Eigen/Dense" #include <QStandardPaths> #include <QScreen> #include <QGuiApplication> #include <limits> using namespace Eigen; Calc::Calc() { qDebug() << "Calculator is build"; } /*function solves the level met...
TOOL
0.977014
3.00067
9ace5e1a-e500-4068-a230-5d99848c3af6
SONGS4RI/42
codingtest_study/2week/boj11723.cpp
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(0); // c의 stdio와 cpp 의 iostream을 동기화시켜주는데 이때 cin.tie(0); // iostream 과 stdio의 버퍼를 둘다 사용하기 때문에 딜레이가 발생하기때문에 string s; // 이를 해제해주는것이다. int a[21] = {0,},m,b; // 알고리즘을 풀때는 싱글 쓰레드의 환경이기에 두 코드를 추가해주는 편이 좋다. cin >> m; while (m-...
ALGO
0.994745
5.492926
c128d93d-82b4-4571-86af-81a9c34d2b12
winhows5/Leetcode-Answers
0044. Wildcard Matching/ans1.cpp
/* Greedy Algorithm */ /* time cost: 17ms (100.00%) */ /* time complexity: O(n+m) */ static int x = [](){ std::ios::sync_with_stdio(false); cin.tie(NULL); return 0; }(); class Solution { public: bool isMatch(string s, string p) { int s_long = s.size(), p_long = p.size(); int i = 0 ,j...
ALGO
0.999893
4.286909
6a3edd4e-6a81-48ea-bbbc-e5adf830d25e
Arnab9Codes/Leetcode-solutions
valid_parenthesis.cpp
/* https://leetcode.com/problems/valid-parentheses/ */ class Solution { public: char match(char read){ if(read=='('){ return ')'; } else if(read=='{'){ return '}'; } else{ return ']'; } } bool isValid(string s) { ...
ALGO
0.99912
6.427665
027f6615-e8da-465d-ac85-97441ce55b46
komekome09/comp_prog
atcoder/arc059_a.cpp
#include <bits/stdc++.h> #define rep(i, n) for(ll i = 0; i < (n); ++i) using namespace std; using ll = long long; const double PI=acos(-1); int main(){ ll n; cin >> n; vector<ll> a(n); rep(i, n) cin >> a[i]; sort(a.begin(), a.end()); ll ans = 9999999; for(ll i = a[0]; i <= a[n-1]; ++i){ ...
ALGO
0.999742
3.894755
a78d89de-8d53-4625-9676-3b59c552717c
NikhilK06/Leet
solutions/0890. Find and Replace Pattern/0890.cpp
class Solution { public: vector<string> findAndReplacePattern(vector<string>& words, string pattern) { vector<string> ans; for (const string& word : words) if (isIsomorphic(word, pattern)) ans.push_back(word); return ans; } private: bool isIsomorphic(const string& w, const string& p...
ALGO
0.999849
6.614321
f9d6a228-293f-4e72-880e-70ef744c7ea2
RaminSanei/cpp08
ex01/Span.cpp
#include "Span.hpp" Span::Span() : _n(0), _vec(0) {} Span::Span(unsigned int n) : _n(n), _vec(0) {} Span::Span(Span const &src) { *this = src; } Span::~Span() {} Span &Span::operator=(Span const &src) { if (this != &src) { _n = src._n; _vec = src._vec; } return *this; } void Span::...
ALGO
0.98175
4.881444
dec488a4-f70d-4fc6-8e68-4e0bab0ef6b8
diohabara/competitive_programming
ac/abc216/D/main.cpp
#include <bits/stdc++.h> #include <atcoder/all> #include <boost/multiprecision/cpp_int.hpp> using namespace atcoder; using namespace boost::multiprecision; using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < (int)(n); i++) const ll MOD = 1e9 + 7; const int INF = INT_MAX; const ll LLINF = ...
ALGO
0.999974
5.021854
bc21ade4-47df-4df1-aa4d-4b0bd3de9865
Yash5588/leetcode
215-kth-largest-element-in-an-array/kth-largest-element-in-an-array.cpp
class Solution { public: int findKthLargest(vector<int>& nums, int k) { int n = nums.size(); priority_queue<int,vector<int>,greater<int>> que; for(int i = 0;i < k;i++) { que.push(nums[i]); } for(int i = k;i < n;i++) { que.push(nums[i]); que...
ALGO
0.99996
5.211105
eb1816d3-85a7-4211-af25-79d06b98b7c1
solfrak/Render
ext/eigen/unsupported/doc/examples/PolynomialUtils1.cpp
#include <unsupported/Eigen/Polynomials> #include <iostream> using namespace Eigen; using namespace std; int main() { Vector4d roots = Vector4d::Random(); cout << "Roots: " << roots.transpose() << endl; Eigen::Matrix<double,5,1> polynomial; roots_to_monicPolynomial( roots, polynomial ); cout << "Polynomial:...
ALGO
0.998202
4.015535
619e4e02-e0ae-4f87-b9bb-e6da6398e504
tosone/cplusplus
FeaturesC++11Learning/forrange.cpp
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main(int argc, char *argv[]) { vector<int> vi = {1, 2, 3, 4}; for (auto i : vi) cout << i << endl; }
ALGO
0.954381
3.785981
18ac8267-705b-4459-a270-85106a9a6857
slam-code/cpp
cpp-DesignPattern-设计模式/3/dm27_访问者模式.cpp
#include <iostream> using namespace std; #include "list" // Visitor ParkElement class ParkElement; class Visitor { public: virtual void visit(ParkElement *parkelement) = 0; }; class ParkElement { public: virtual void accept(Visitor *visit) = 0; }; class ParkA : public ParkElement { public: virtual void accep...
TOOL
0.857218
4.527683
dcfcbc99-71e9-419a-b822-45ca8e69e883
Hsiang0128/Data_Strucure
Homework 4/main/HW4_5.cpp
#include <iostream> template<typename T> class Stack { private: typedef struct Node { T Val; Node *next; Node *prev; }; Node *head; public: Stack() { head = nullptr; } void push(T val) { Node *newNode = new ...
ALGO
0.998977
3.991141
9d72ac15-b566-47df-ac6a-901b994d9f21
alexandraback/datacollection
solutions_5639104758808576_0/C++/Mister/a.cpp
#include <bits/stdc++.h> using namespace std; char shy[1005]; int main() { int T; scanf("%d", &T); for (int cn = 1; cn <= T; ++cn) { int S, csum = 0, ans = 0; scanf("%d%s", &S, shy); for (int i = 0; i <= S; ++i) { int num = shy[i] - '0'; if (num) ans = max(ans, i - csum); csum += num; } printf("Ca...
ALGO
0.998968
3.865253
fd00aab6-6440-4dfa-80ca-8799d9223309
go2scope/mmcorec
3rdParty/boost-versions/boost_1_77_0/libs/graph/example/topo-sort-file-dep.cpp
using namespace boost; namespace std { template < typename T > std::istream& operator>>(std::istream& in, std::pair< T, T >& p) { in >> p.first >> p.second; return in; } } typedef adjacency_list< listS, // Store out-edges of each vertex in a std::list vecS, // Store vertex set in a std::vector directe...
ALGO
0.99944
5.724215
559835e2-c1a2-449b-9ec2-c8e159a0fee9
Aniket404/C-DSA-practice-questions
butterfly_pattern.cpp
#include <iostream> using namespace std; int main(){ int n; cin>>n; for (int i=0; i<2*n; i++){ int cond= i<n?i:n+(n-i-1); // int space_count= i<n ? 2*(n-cond-1):i-cond-1; // 1st row space for input 4 is 6 therefore 2(4-0-1)=6 // cond basically resresents the curren...
ALGO
0.999961
3.380942
349d0e97-ec6b-4988-9bb1-11f4e360a50e
fate7902/study
Programmers/Lv.1/바탕화면 정리.cpp
#include <string> #include <vector> using namespace std; vector<int> solution(vector<string> wallpaper) { int minX = 51, maxX = -1, minY = 51, maxY = -1; int x = 0; for(const auto& s : wallpaper){ for(int i = 0; i < s.size(); ++i){ if(s[i] == '#'){ minX = minX < x ? min...
ALGO
0.986466
5.299057
05441212-4c9d-4993-bcf6-18cec65b58ef
TheSayantanDey/DataStructureAlgoinCplusplus
01_Linked_List/13_deleteNodeRecursive.cpp
#include<iostream> using namespace std; #include "node.cpp" Node * takeinput_better(){ int data; cin>>data; Node *head = nullptr; Node *tail = nullptr; while(data != -1){ Node *n = new Node(data); if(head == nullptr){ head = n; ...
ALGO
0.999932
4.007022
b0548514-4672-4cd2-8e83-2e9e456d6f32
nginnever/zogminer
src/rpcblockchain.cpp
#include "checkpoints.h" #include "consensus/validation.h" #include "main.h" #include "primitives/transaction.h" #include "rpcserver.h" #include "sync.h" #include "util.h" #include <stdint.h> #include "json/json_spirit_value.h" using namespace json_spirit; using namespace std; extern void TxToJSON(const CTransactio...
WEB
0.930457
5.794488
3c4beddb-92c2-4977-87b5-c2beabceb013
ishandutta2007/codeforces
illenium/normal/1215/C.cpp
#include<iostream> #include<cstdio> #include<cstring> #include<algorithm> #include<vector> #include<map> #include<queue> #include<cmath> #include<stack> #include<set> #define ll long long #define maxn 200005 #define re register #define inf 1e9 #define eps 1e-10 using namespace std; inline int read() { int x=0,w=1; ch...
ALGO
0.999951
3.078072
c5aa0b3f-34cf-4c3d-8556-e5421afbfb55
piyush1009/Competitive_programming
Spoj solutions/CANTON.cpp
#include <bits/stdc++.h> #define ll long long #define pb push_back #define pii pair<int,int> #define vi vector<int> #define vii vector<pii> #define mi map<int,int> #define mii map<pii,int> #define all(a) (a).begin(),(a).end() #define F first #d...
ALGO
0.999296
3.906622
4f1d5406-3732-4720-9c65-28aa68bbf064
ishandutta2007/codeforces
i_love_tanya_romanova/normal/88/B.cpp
/* From the coast of gold, across the seven seas I'm travelling on, far and wide But now it seems I'm just a stranger to myself And all the things I sometimes do It isn't me but someone else I close my eyes and think of home Another city goes by in the night Ain't it funny how it is You never miss it 'til it's gone aw...
ALGO
0.999814
3.86472
9aa3c596-660f-4be7-af70-f735a005f854
t-sakashita/rokko
3rd-party/eigen3/doc/examples/TutorialLinAlgComputeTwice.cpp
#include <iostream> #include <Eigen/Dense> using namespace std; using namespace Eigen; int main() { Matrix2f A, b; LLT<Matrix2f> llt; A << 2, -1, -1, 3; b << 1, 2, 3, 1; cout << "Here is the matrix A:\n" << A << endl; cout << "Here is the right hand side b:\n" << b << endl; cout << "Computing LLT...
ALGO
0.999956
3.136869
e085248f-9dd7-46c4-b1bf-483bba4c9525
kowalks/competitive-programming
uri/1002.cpp
#include<stdio.h> int main () { double r; scanf("%lf", &r); printf("A=%.4lf\n", 3.14159*r*r); }
ALGO
0.968892
3.519487
10c8fb33-5320-4c1e-83a8-11f303fbbde8
roeas/GAMES101-Premake
Frame/Source/ThirdParty/opencv/modules/core/src/conjugate_gradient.cpp
#include "precomp.hpp" #define dprintf(x) #define print_matrix(x) namespace cv { double MinProblemSolver::Function::getGradientEps() const { return 1e-3; } void MinProblemSolver::Function::getGradient(const double* x, double* grad) { double eps = getGradientEps(); int i, n = getDims(); ...
ALGO
0.999986
6.233156
02b5aa5f-d4b7-4b65-8e8a-96ea3112e4a6
jsyeh/2023aaib2
week10/week10-1.cpp
/// week10-1.cpp 禡Is禡 Recursion j Nh /// HeO forjg, ѥΡu禡Is禡vӼg #include <stdio.h> int func(int n) { if(n==1) return 1; ///פ, uƾkǪkvN=1 return n * func(n-1); /// 禡Is禡 } int main() { printf("пJN:"); int N; scanf("%d", &N); int ans = func(N); printf("%d", ans); }
ALGO
0.999994
4.240311
f105561a-ecd1-4fe4-89f5-397f5c9ac38c
shivendrakrjha/dynamic-programming-1
shortest-common-supersequence.cpp
/* https://practice.geeksforgeeks.org/problems/shortest-common-supersequence/0/ Given two strings str1 and str2, find the length of the smallest string which has both, str1 and str2 as its sub-sequences. Note: str1 and str2 can have both uppercase and lowercase letters. Input: The first line of input contains an inte...
ALGO
0.999921
6.255185
10475ecd-d84e-4058-91d6-4bfea1887d20
raphaelsalaja/leetcode
C++/1_TwoSum.cpp
#include <vector> #include <iostream> #include <string> #include <algorithm> #include <iterator> using namespace std; class Solution { public: vector<int> twoSum(vector<int> &nums, int target) { vector<int> ans = {}; for (int i = 0; i < nums.size(); i++) { int alt = target - ...
ALGO
0.999785
5.983004
82b29948-faa1-436f-b074-1243795c5368
usgs/pestpp
src/libs/Eigen/bench/benchmarkXcwise.cpp
// g++ -O3 -DNDEBUG benchmarkX.cpp -o benchmarkX && time ./benchmarkX #include <iostream> #include <Eigen/Core> using namespace std; using namespace Eigen; #ifndef VECTYPE #define VECTYPE VectorXLd #endif #ifndef VECSIZE #define VECSIZE 1000000 #endif #ifndef REPEAT #define REPEAT 1000 #endif int main(int argc, c...
ALGO
0.959516
3.923817
e4bb9bec-b87b-4efc-81b4-36ae00bf8c06
ishandutta2007/codeforces
ra16bit/normal/241/A.cpp
#include <cstdio> #include <algorithm> using namespace std; int cur,res,mx,n,k,i,d[1010],c[1010],s[1010]; int main() { scanf("%d%d",&n,&k); for (i=0; i<n; i++) scanf("%d",&d[i]); for (i=0; i<n; i++) scanf("%d",&c[i]); cur=mx=0; for (i=0; i<n; i++) { cur+=c[i]; res+=d[i]; mx=max(mx,c[i]); while...
ALGO
0.999911
3.035032