uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
ee90fde4-4c6f-4593-b79c-fe78919f08f7
AsishPro/Coding
os/sjf2.cpp
#include <bits/stdc++.h> using namespace std; class process { public: int at, bt, ct, tt, wt,og; }; int main(){ int n; cout << "Number of processes: "; cin >> n; process p[n]; int added[n]={0}; for(int i = 0; i < n; i++) { cout << "Arrival time and burst time of p" << i << ": "; ...
ALGO
0.99987
4.289231
26cf501b-01e2-46ff-856e-095f9656b5e5
qiaozishun4/CSP2024_BJ
BJ-Junior/answers/BJ-J01908/explore/explore.cpp
#include <bits/stdc++.h> using namespace std; int dx[]={0,1,0,-1}; int dy[]={1,0,-1,0}; bool flag[1010][1010]; char c[1010][1010]; int n,m,k; bool in(int x,int y) { return x>=1 && x<=n && y>=1 && y<=m; } bool OK(int x, int y) { return c[x][y]=='.'; } int main() { freopen("explore.in","r",stdin); freo...
ALGO
0.999864
3.848601
c5c2d685-cf3f-4bce-a254-fc2707cb1655
S96EA/PATBasic
patbasic/test1059.cpp
// // Created by neild47 on 18-4-30. // #include <iostream> #include <vector> #include <map> #include <set> using namespace std; bool su[10001]; static void getSu() { for (int i = 0; i < 10001; i++) { su[i] = true; } for (int i = 2; i < 10001; i++) { if (su[i]) { int tmp = i...
ALGO
0.999769
4.464982
c8378928-de40-4582-a2ac-840eb2b4899b
inho9606/Leetcode
Longest_substring_without_repeated_characters.cpp
// https://leetcode.com/problems/longest-substring-without-repeating-characters/submissions/ // I. Record the index where each character located. // II. The starting pointer moves after the previous character's index if a repeated character is found. And initialize indices located before the new starting pointer. // II...
ALGO
0.999968
6.29301
78472454-ac56-4fcd-beae-109935eb933f
Bhhvshh/LeetCodeSolutions
3490-find-the-maximum-length-of-valid-subsequence-i/3490-find-the-maximum-length-of-valid-subsequence-i.cpp
class Solution { public: int maximumLength(vector<int>& nums) { int even = 0; int odd = 0; int starteven = 0, startodd = 0; int flag1 = 0 ,flag2 = 1; for(auto x:nums){ odd += (x%2); even += (x%2==0); if(x%2==flag1) {starteven++; flag1 = !fl...
ALGO
0.999923
5.476891
ce8310e5-6d9d-4f74-8c57-6ade8a890626
kritirikhi/DataStructuresAndAlgorithms
2048Problem.cpp
#include <iostream> using namespace std; char a[][10]={"zero","one","two","three","four","five","six","seven","eight","nine","ten"}; void print(int n){ if(n==0){ return; } print(n/10); cout<<a[n%10]<<" "; } int main() { int n; cin>>n; print(n); }
ALGO
0.999384
5.268872
acd36aae-5e8b-44fd-82f7-5943a37dd004
koughua/Homework_cs106b
WordLadder/lib/StanfordCPPLib/hashcode.cpp
/* * File: hashcode.cpp * ------------------ * This file implements the interface declared in hashcode.h. * * @version 2015/07/05 * - using global hashing functions rather than global variables */ #include "hashcode.h" static const int HASH_SEED = 5381; // Starting point for first cycle static c...
TOOL
0.965621
6.734595
8b9e22d3-aaef-4212-bbd2-83d89fe85f94
u-wyh/luogu-code
P2964.cpp
#include<bits/stdc++.h> using namespace std; const int MAXN = 2005; int n; int arr[MAXN]; int dp[MAXN][MAXN]; int main() { cin>>n; for(int i=1;i<=n;i++){ cin>>arr[i]; arr[i]+=arr[i-1]; } for(int i=n;i>=1;i--){ for(int j=1;j<=n-i+1;j++){ int k=arr[n]-arr[i-1]-dp[i+j]...
ALGO
0.999657
3.252374
86c004b4-523c-4fed-afbc-b08ee17d8e98
amitnileka/competitive-Programme
map.cpp
#include<iostream> #include<map> using namespace std; int main() { map<string,int> m; map<string,int>::iterator it; int q,i=0; int a; string x; int y; cin>>q; while(i<q) { cin>>a; switch(a) { case 1: cin>>x>>y; m[x]+=y; ...
ALGO
0.995394
3.57828
ad544434-a377-4da7-ba57-af3e42f0eebf
jasmineiris/jiDev
myCpp/league_DMA.cpp
// File: league_DMA.cpp // Author: Jasmine Farrell // Date Modified: Oct. 3rd, 2015 // Course: CS110B // Description: the program will ask the user to enter five team names, // and five win amounts. It will stor the data in memory, and // print it back out soted by wins. // Usage: The program records and displays leagu...
ALGO
0.999463
4.342605
9092f648-ece5-4f15-a2ea-c0eb29447aad
yinqy0808/Project1
移动非零元素.cpp
#include <iostream> using namespace std; int change(int *a,int *b) { int t; t = *a; *a = *b; *b = t; return *a; } int main() { int n; cin >> n; int arr[100]; for (int i = 0; i < n; i++) { cin >> arr[i]; } for (int i = 0; i < n; i++) {//ȽnΣð for (int j = 0; j < n - 1; j++) {//ұ߽λ if (arr[j] ==...
ALGO
0.999972
3.440147
cbbcea3d-222f-4075-a100-d4a56b04b18d
AustinBoyuJiang/Competitive-Programming
competitions/Codeforces/Contests/731/Alphabetical Strings.cpp
/*AuthorAustinJiang ĿAlphabetical Strings ʱ临ӶȣO(t*n) ԴCodeforces Round #731 (Div. 3) */ #include<bits/stdc++.h> #define ll long long #define pb push_back #define mp make_pair #define fir first #define sec second #define endl "\n" #define random(a,b) rand()%(b-a+1)+a #define PI pair<int,int> #define VI vector<int> #defi...
ALGO
0.999873
4.282776
1496702e-5021-441e-9abe-8de72efa22c8
danieltrt/SBFL
TransCoder_tokenized_test_set_functions/cpp/C_PROGRAM_FIND_SECOND_FREQUENT_CHARACTER.cpp
char getSecondMostFreq ( string str ) { int count [ NO_OF_CHARS ] = { 0 }, i; for ( i = 0; str [ i ]; i ++ ) ( count [ str [ i ] ] ) ++; int first = 0, second = 0; for ( i = 0; i < NO_OF_CHARS; i ++ ) { if ( count [ i ] > count [ first ] ) { second = first; fi...
ALGO
0.999767
4.564322
99d04da1-872d-45b7-8500-a5c96a7bd0e3
SrinidhiSreenath/ENPM808X-Midterm-InformedRRTStar
app/RRTStar.cpp
/** * @file RRTStar.cpp * @author Srinidhi Sreenath (SrinidhiSreenath) * @date 10/15/2018 * @version 1.0 * * @brief RRT STar Class definition for the planner * * @section DESCRIPTION * * Source file for class RRT Star. The class is used to implement the optimized * version of the Rapidly-explo...
ALGO
0.998714
5.564876
e6d217ca-e2ea-4a3e-8138-4962319f6fab
Kira188/Cpp
Other C++ programs/clss1.cpp
#include<iostream> using namespace std; class rec { public: int length; int breadth; int area(){ return length*breadth; } int perimeter(){ return 2*(length*breadth); } }; int main() { int are; rec a; a.length=10; a.breadth=10; are=a.area(); cout<<are; ...
TOOL
0.8763
3.46996
73d4ca08-1aa4-4622-a466-66b8e66e6fc0
lemonlite/CplusCourseWork
Course/Section11/Functions.cpp
//Math example using the cmath library functions //Random generation using csdlib library and ctime for time #include <iostream> #include <cstdlib> //required for rand() this is the C languuage standard library like c++ has STDL #include <ctime> //required for time() #include <cmath> //required void RandomNumberGenera...
TOOL
0.977295
3.672666
164070d0-46fc-4504-b982-609f527fadaf
113bommy/deepmind_codecontests_refine
cpp_source_filter_file/cpp_train_2469_21.cpp
#include <bits/stdc++.h> using namespace std; int main() { int n, i, t; cin >> n; int a[n]; for (i = 0; i < n; i++) { cin >> a[i]; } sort(a, a + n); t = n / 2; if (n == 1) cout << a[0]; else if (n == 2) cout << a[1]; else if (n == 3) cout << a[1]; else if (n % 2 == 0) cout << a...
ALGO
0.999901
4.013907
f6b5ea00-cb70-4922-83cd-8b53bf3244ee
ratulMahjabin/Competitive-Programming
codeforces/1064A/1064A.cpp
#include <bits/stdc++.h> using namespace std; int main() { int a, b, c; cin >> a >> b >> c; int mx = max({a, b, c}); int res = a + b + c - mx; if (res > mx) cout << 0 << endl; else { cout << abs(res - mx) + 1 << endl; } }
ALGO
0.999973
4.174196
c2b3798f-27ab-4752-a082-475ddac3f80c
Nani-anais/IntroToCpp
Functions/Program6.12.cpp
//This program uses a function that returns a value #include <iostream> using namespace std; //function prototype int sum(int, int); int main() { int value1 = 20, //the first value value2 = 40, //the second value total; //to hold the total //call the sum function, passig the content...
ALGO
0.99714
5.84332
36c79173-b4ad-4958-8616-030c140e6a11
ChettriBishal/CP
LeetCode/HashMap/Longest_harmonious_subsequence.cpp
class Solution { public: int findLHS(vector<int>& nums) { int n = nums.size(); unordered_map<int,int> cnt; for(int &x: nums){ cnt[x]++; } int res = 0; for(auto &p: cnt){ int tar = p.first + 1; if(cnt.find(tar) != cnt.end()){ ...
ALGO
0.999921
5.55327
be9ee03e-6ce0-492c-8ec0-9b58c1cd22fe
Daria2002/ctci
src/Chapter_17_Hard/ShortestSupersequence.cpp
#include <iostream> #include <vector> #include <unordered_map> class Range { public: Range() = default; Range(int s, int e) : start(s), end(e) {} int start, end; int len() const { return end - start + 1; } }; int find_next_instance(const std::vector<int>...
ALGO
0.999938
5.516716
6490bd5d-ae3e-4bfe-a51f-9519fcd408b8
nobita20002209/cpp_tutorial
patterns1/fourth_pattern.cpp
#include<iostream> using namespace std; int main(){ int n=4; for (int i = 1; i <= n; i++) { for (int j = 0; j <i; j++) { cout<<i<<" "; } cout<<endl; } return 0; }
ALGO
0.999745
3.770298
3c2710b7-4ffb-427e-b910-160009ebe0bc
CoderOJ/contests
tmp/CF700E/std.cpp
#include<set> #include<map> #include<cmath> #include<vector> #include<cstdio> #include<cstring> #include<cstdlib> #include<algorithm> #define pb push_back #define fi first #define se second #define mp make_pair using namespace std; typedef double db; typedef long long ll; typedef unsigned long long ull; typedef pair<i...
ALGO
0.999937
3.739
b24326bf-f5d3-491c-b28d-7b91292f6ced
ishandutta2007/codeforces
rivalq/normal/1064/E.cpp
// Jai Shree Ram #include<bits/stdc++.h> using namespace std; #define rep(i,a,n) for(int i=a;i<n;i++) #define ll long long #define int long long #define pb push_back #define all(v) v.begin(),v.end() #define endl "\n" #define x first #define y ...
ALGO
0.999602
3.02968
45e15d9e-31ce-4d85-88dc-cc2fc9a0370c
priyanshu1019/LeetCode-Solutions
264-ugly-number-ii/ugly-number-ii.cpp
class Solution { public: int nthUglyNumber(int n) { vector<int> t(n+1); t[1]=1; int i2=1; int i3=1; int i5=1; for(int i=2;i<=n;i++){ int i2Ugly=t[i2]*2; int i3Ugly=t[i3]*3; int i5Ugly=t[i5]*5; int mini=min({i2Ugly,i3Ugl...
ALGO
0.999997
6.039574
2b8c3d2b-3413-47b9-b04f-1648749906ea
Simewu/bitcoin-version-compare
bitcoin-0.21.1/src/policy/policy.cpp
// NOTE: This file is intended to be customised by the end user, and includes only local node policy logic #include <policy/policy.h> #include <consensus/validation.h> #include <coins.h> #include <span.h> CAmount GetDustThreshold(const CTxOut& txout, const CFeeRate& dustRelayFeeIn) { // "Dust" is defined in term...
TOOL
0.861563
7.732726
874ad75e-4e54-4ff0-a1db-3736f938bc29
Shivam12-ui558/DSA
215-kth-largest-element-in-an-array/kth-largest-element-in-an-array.cpp
class Solution { public: int findKthLargest(vector<int>& nums, int k) { priority_queue<int,vector<int>,greater<int>>minHeap; for(auto num :nums){ minHeap.push(num); if(minHeap.size()>k){ minHeap.pop(); } } return minHeap.top(); } };
ALGO
0.999942
5.219003
65625c31-72bd-4e06-96fe-69b095f46365
aravind-kumar/Coding
lru_cache/lru_cache.cpp
#include <iostream> #include <unordered_map> #include <list> #include <assert.h> #include <algorithm> template <typename key,typename val> class lru { private: typedef typename std::list<key>::iterator itemPos; typedef std::pair<val,itemPos> valuePos; typedef std::unordered_map<key,valuePos> cache...
TOOL
0.930986
4.990032
848ec2b0-abda-429e-bc38-caa98b694f6e
kmjp/procon
codeforce/421-440/432/d.cpp
#include <bits/stdc++.h> using namespace std; typedef signed long long ll; #undef _P #define _P(...) (void)printf(__VA_ARGS__) #define FOR(x,to) for(x=0;x<(to);x++) #define FORR(x,arr) for(auto& x:arr) #define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++) #define ALL(a) (a.begin()),(a.end()) #define ZER...
ALGO
0.99963
3.163396
bce0d711-a939-4b8d-b801-a06b44d648bd
Pranjalm-23/Handy-codes
cp-cb-cpp/bit-manipulation/12-inclusion-exclusion-principle.cpp
#include <iostream> // visit https://hack.codingblocks.com/app/practice/1/1264/problem using namespace std; # define ll long long int main(){ // input int t; cin>>t; ll primes[] = {2, 3, 5, 7, 11, 13, 17, 19}; //np while(t--) { ll n; cin>>n; ll subsets = (1<<8)-1; //2^np-1 ll ans = 0; for(ll i = 1; ...
ALGO
0.999503
3.92954
055cfc9e-19a3-44c9-a685-1c2b876cf942
axelu/leetcode
cpp/01500-01999/theearliestandlatestroundswhereplayerscompete.cpp
// 1900. The Earliest and Latest Rounds Where Players Compete // https://leetcode.com/problems/the-earliest-and-latest-rounds-where-players-compete/ class Solution { private: // debug void printBinary(long x, int c) { for(int i = c-1; i >= 0; --i) { if( x & (1UL << i) ) cout << 1; ...
ALGO
0.999939
5.162062
55537a7a-77da-46fb-87af-cc8909802e85
jCabala/leetcode
1586-longest-subarray-of-1s-after-deleting-one-element/longest-subarray-of-1s-after-deleting-one-element.cpp
class Solution { public: int longestSubarray(vector<int>& nums) { ios::sync_with_stdio(0); cin.tie(0); int res = longestOnes(nums, 1); if (res == 1) { return 0; } else { return res - 1; } } int longestOnes(vector<int>& nums, int k) { ios::sync_with_std...
ALGO
0.999933
5.560176
ce90bcba-8b99-45f8-b55c-c6a4390ebbee
113bommy/deepmind_codecontests_refine
cpp_source_filter_file/cpp_train_116_27.cpp
#include <bits/stdc++.h> using namespace std; const int MOD = 1e9 + 7; int main() { long long int n; cin >> n; string s; cin >> s; bool fl = 0; int idxl = 0, idxr = 0; for (int i = 1; i < n; i++) { if (s[i] < s[i - 1]) { fl = true; idxl = i - 1; idxr = i; break; } } if ...
ALGO
0.999967
3.713896
b0acbabf-9ec3-40b1-97b9-e11a11393e58
LucaDantas/Algorithms
icpc-notebook/stress-tests/geometry/HullDiameter.cpp
#include "../utilities/template.h" #include "../../content/geometry/ConvexHull.h" #include "../../content/geometry/HullDiameter.h" int main() { srand(2); rep(it,0,1000000) { int N = (rand() % 10) + 1; vector<Point<ll>> ps; rep(i,0,N) { ps.emplace_back(rand() % 11 - 5, rand() % 11 - 5); } ll r1 = 0; r...
ALGO
0.986992
4.68698
ad30d6c9-ee22-477c-851d-3ea1c24caa2c
Sesal82/topjohnwu
test/std/algorithms/alg.sorting/alg.set.operations/set.difference/set_difference.pass.cpp
// <algorithm> // template<InputIterator InIter1, InputIterator InIter2, typename OutIter> // requires OutputIterator<OutIter, InIter1::reference> // && OutputIterator<OutIter, InIter2::reference> // && HasLess<InIter2::value_type, InIter1::value_type> // && HasLess<InIter1::value_type, InIte...
TEST
0.938353
6.812714
82f28902-868e-4542-8872-f048a2fe03b2
suthakaranburaj/Daily_DSA
13_07_25/Chef Bakes Cake 2.cpp
#include <bits/stdc++.h> using namespace std; int main() { // your code goes here int T; cin>>T; while(T--){ int n; cin>>n; int ans=0; vector<int> A(n), B(n); for(int i=0;i<n;i++){ cin>>A[i]; } for(int i=0;i<n;i++){ cin>...
ALGO
0.999921
4.043728
e3e065e3-e6d1-4f16-9987-4e57968adad3
haris-mujeeb/Cpp-Basic
Object-oriented Programming C++ Simplified by Hari Mohan Pandey/exp_4.cpp
/* From Book: Oobject Oriented Programming C++ Simplified. Experiment-4 : Programs to create singly and doubly linked lists and perform insertion and deletion Operations. Using self referential classes, new and delete operators. */ // ---- Without using Classes ------ #include <iostream> struct node...
ALGO
0.947656
4.767789
a198bc6c-bab4-48e9-b2ab-54814b085688
user37829/task638734
FreeImage/Source/LibRawLite/internal/wf_filtering.cpp
#define P1 imgdata.idata #define S imgdata.sizes #define O imgdata.params #define C imgdata.color #define T imgdata.thumbnail #define IO libraw_internal_data.internal_output_params #define ID libraw_internal_data.internal_data int LibRaw::wf_remove_banding() { #define WF_IMGMODE_BAYER4PLANE 4 #define WF_IMGMODE_BAYER1...
TOOL
0.937282
3.415218
778a648c-693c-4776-82e4-d9e0e83708f7
lyukov/gpu_programming
MedianFilter.cpp
#include "MedianFilter.h" #include <cstring> #include <algorithm> inline void _processOneLine( int x, uint8* inputImage, uint8* outputImage, int height, int width, int channels, int radius, uint8* arr ) { for (int y = 0; y < height; ++y) { for (int ch = 0; ch < channels; ++c...
ALGO
0.999729
5.766656
181178f9-f6a1-493b-8580-c86328a15733
sinsoul/Load_Balancing
Load_Balancing/Load_balancing/Load_balancing.cpp
#include <winsock2.h> #include <iphlpapi.h> #include <stdio.h> #include <stdlib.h> #include <conio.h> #pragma comment(lib, "Ws2_32.lib") #pragma comment(lib, "IPHLPAPI.lib") #define MALLOC(x) HeapAlloc(GetProcessHeap(), 0, (x)) #define FREE(x) HeapFree(GetProcessHeap(), 0, (x)) typedef struct _router { char pGetway...
TOOL
0.881527
3.309824
0abe7b96-504a-40bd-9e36-f1136185a522
NullAwe/competitive-programming
usaco/contest/practice/2015-2016/gold/february/CircularBarnRevisited.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long ll dp(int ind, int doors, vector<int>& arr, vector<vector<vector<ll>>>& memo, int orig) { if (ind >= orig + arr.size()) return 0; if (doors == 0) return LLONG_MAX; if (memo[orig][ind % arr.size()][doors] < LLONG_MAX) return memo[orig][ind % arr....
ALGO
0.99986
3.990865
7aa0c510-c1c2-4b26-8eda-eebfba5cd873
Krishanu321/LeetCode_POTD
07.08.2024.cpp
class Solution { public: // Unordered maps to store words for numbers less than 10, 20, and 100 unordered_map<int, string> belowTen = {{0, ""}, {1, "One"}, {2, "Two"}, {3, "Three"}, {4, "Four"}, {5, "Five"}, {6, "Six"}, {7, "Seven"}, {8, "Eight"}, {9, "Nine"}}; unordered_map<int, string> belowTwenty = {{10,...
ALGO
0.9994
7.172421
877e1400-0b67-4598-9294-3a5e7e9293de
rayz1065/competitive-programming
oii/2017/pancake/main.cpp
#define novefatt 362881 #include <iostream> int ope[novefatt]; int p=0; int fact(int N){ if(N==1) return 1; return N*fact(N-1); } void prepara(int N){ int F=fact(N); for(int i=1; i<F; i++){ if(i%6==0){ int a=2, K=2; while(i%K==0){ a++; ...
ALGO
0.999793
3.456933
779abc1e-71db-443b-8540-b52dac8bd670
afsc-assessments/ebswp_2023
2023_runs/usehulsoniss/proj/m1.cpp
#ifdef DEBUG #ifndef __SUNPRO_C #include <cfenv> #include <cstdlib> #endif #endif #include <admodel.h> adstring xspname; adstring_array targsppname(1,20); adstring_array spp_file_name(1,20); adstring_array gearname(1,8); adstring_array spname(1,90); adstring_array areaname(1,8); adstring ...
DATA
0.969773
3.216758
d8fa8a4b-dd1c-4ae3-aa76-0011cbd3ffc4
parthawasthi25/Leetcode
62-unique-paths/unique-paths.cpp
class Solution { public: int uniquePaths(int m, int n){ int N = m + n - 2; int r = m - 1; long long ans = 1; for(int i = 1;i <= r;i++){ ans = ans * (N - r + i)/i; } return (int)ans; } };
ALGO
0.99998
6.250063
7c9041f8-e092-43e9-9ebd-ecd1ba3fd09b
sarvex/leetcode-tsh
lcof/面试题06. 从尾到头打印链表/Solution.cpp
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ class Solution { public: vector<int> reversePrint(ListNode* head) { if (!head) return {}; vector<int> ans = reversePrint(head->next); ...
ALGO
0.999586
5.439069
f36859dc-1860-40be-b6b7-e207eb959fbc
NativeFunction/Clang-SC-CL-Edited
lib/Tooling/JSONCompilationDatabase.cpp
#include "clang/Tooling/JSONCompilationDatabase.h" #include "clang/Basic/LLVM.h" #include "clang/Tooling/CompilationDatabase.h" #include "clang/Tooling/CompilationDatabasePluginRegistry.h" #include "clang/Tooling/Tooling.h" #include "llvm/ADT/Optional.h" #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/SmallString.h"...
TOOL
0.971994
7.915451
c5ec32ce-918b-4917-a4d5-b9023b38401f
huudung0607/Linked-List
Cài Đặt Hàng Đợi Bằng DSLK.cpp
#include <iostream> #include <algorithm> #include <vector> #include <set> #include <map> #include <cmath> #include <numeric> #include <climits> #include <iomanip> #include <string> #include <sstream> #include <queue> #include <stack> #include <unordered_map> using namespace std; struct Node { int data; Node* next; ...
ALGO
0.999588
4.893755
dedce344-d62a-4ff7-a903-c802d90e3f6f
iamsaquib2508/Competitive-Programminng
Codeforces/CF 1072 C.cpp
/* *************************** DONATE BLOOD, SAVE LIFE! ******************************** */ #include<bits/stdc++.h> #define ffr(i,a,b) for(i=a;i<b;i++) #define ffrr(i,a,b) for(i=a;i<=b;i++) #define ll long long int #define ld long double #define pb push_back #define pii pair<int,int> #defin...
ALGO
0.999647
3.134
eb5e0744-c49b-4c83-bbd3-29345d1d028f
siddiquesk/DSA-CPLUS-PLUS-
Maximum-subarray.cpp
/* // Brute Force algorithm approach #include <iostream> using namespace std; int main() { int arr[5] = {1, 2, 3, 4, 5}; int n = 5; for (int start = 0; start < n; start++) { for (int end = start; end < n; end++) { for (int i = start; i <= end; i++) { cout << arr[i]; } co...
ALGO
0.999984
5.440223
5306e920-c7ec-4fc8-ba1a-1b99a6fec8b1
Grubre/cpp-math-lib
examples/matrix.cpp
#include "matrix.hpp" #include "vec_mat_operations.hpp" #include "vector.hpp" #include <iostream> #include <numeric> int main() { cml::Matrix<2, 3, double> A = {0., 4., -2., -4., -3., 0.}; cml::Matrix<3, 2, double> B = {0., 1., 1., -1., 2., 3.}; std::cout << A << std::endl; std::cout << B << std::endl...
ALGO
0.979984
5.318116
633a1e93-536b-447a-af90-0a564d6c4494
roca12/gpccodes
Codigos estudiantes por lenguaje/C++/Edwin Villarraga/geometria/PointInsideTriangle.cpp
#include<bits/stdc++.h> #include<cstdlib> #define x first #define y second using namespace std; typedef pair<int,int> point; double area(point A,point B,point C){ return std::abs((A.x*(B.y-C.y)+B.x*(C.y-A.y)+C.x*(A.y-B.y))/2.0); } bool isInside(point act,point A,point B,point C){ //area triangle complete do...
ALGO
0.999884
4.219183
6f489181-fe46-4995-a514-854db5a1ee67
zakki/openhsp
hsp3ll/llvm/lib/CodeGen/SelectionDAG/ResourcePriorityQueue.cpp
#include "llvm/CodeGen/ResourcePriorityQueue.h" #include "llvm/CodeGen/MachineInstr.h" #include "llvm/CodeGen/SelectionDAGNodes.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/Debug.h" #include "llvm/Support/raw_ostream.h" #include "llvm/Target/TargetLowering.h" #include "llvm/Target/TargetMachine.h" u...
ALGO
0.990537
7.254005
ad5471d8-5eca-4c48-b706-eb3d9ae8a829
ishandutta2007/codeforces
allvik06/normal/1165/E.cpp
#include <bits/stdc++.h> using namespace std; #define int long long int mod = 998244353; signed main() { int n; cin >> n; vector <int> a(n), b(n); for (int i = 0; i < n; ++i) cin >> a[i]; for (int i = 0; i < n; ++i) cin >> b[i]; vector <int> c; for (int i = 0; i < n; ++i) { c.push_b...
ALGO
0.999979
4.716733
43a82c6a-9e3a-49fb-b873-2c9e4dda0b0e
robertpuccinelli/Marlin-Muxu
Marlin/src/module/planner_bezier.cpp
/** * planner_bezier.cpp * * Compute and buffer movement commands for bezier curves */ #include "../inc/MarlinConfig.h" #if ENABLED(BEZIER_CURVE_SUPPORT) #include "planner.h" #include "motion.h" #include "temperature.h" #include "../MarlinCore.h" #include "../gcode/queue.h" // See the meaning in the documentat...
ALGO
0.999572
7.914692
4d13106c-cff9-4f07-b551-20e6f9583f55
PuddingNote/Cpp-Study
Cpp/Cpp/6-44.cpp
// list merge() #include <iostream> #include <list> using namespace std; int main() { list<int> l1; list<int> l2; l1.push_back(10); l1.push_back(20); l1.push_back(30); l1.push_back(40); l1.push_back(50); l2.push_back(25); l2.push_back(35); l2.push_back(60); list<int>::iterator iter; cout << "l1 : "; fo...
TOOL
0.968907
3.983807
7e4dde6d-7f7b-4787-a869-a5b1a6a24f87
Juegos-ASADOS/El-Horno
ElHorno/dependencies/Bullet/Src/src/BulletInverseDynamics/details/MultiBodyTreeImpl.cpp
#include "MultiBodyTreeImpl.hpp" namespace btInverseDynamics { MultiBodyTree::MultiBodyImpl::MultiBodyImpl(int num_bodies_, int num_dofs_) : m_num_bodies(num_bodies_), m_num_dofs(num_dofs_) #if (defined BT_ID_HAVE_MAT3X) && (defined BT_ID_WITH_JACOBIANS) , m_m3x(3, m_num_dofs) #endif { #if (defined BT_ID_HAVE_M...
ALGO
0.996396
5.716256
ba01e990-37fe-45f9-8cf0-7a971d6207b6
Peacefull-beast/PeaceCode1
0785-is-graph-bipartite/0785-is-graph-bipartite.cpp
class Solution { public: bool answer(int start, int col, vector<vector<int>>& list, vector<int>& color, queue<int> &q) { q.push(start); color[start] = col; while(!q.empty()) { int front = q.front(); vector<int>neib = list[front]; q.pop(); ...
ALGO
0.999992
6.013205
647f1806-c469-4a0a-b7c8-0b9f977bff68
atiwari3bu/LeetCode
334.cpp
class Solution { public: /*https://leetcode.com/problems/increasing-triplet-subsequence/discuss/78993/Clean-and-short-with-comments-C%2B%2B */ bool increasingTriplet(vector<int>& nums) { int a = INT_MAX; int b = INT_MAX; for(auto& elem : nums){ if(a>=elem){ ...
ALGO
0.999823
5.880592
d3691f2d-7285-40c0-9c72-1ceeabcfc02f
valderyaya/Competitive-Programming
Luogu/P2052.cpp
//#pragma GCC optimize("Ofast,unroll-loops,no-stack-protector,fast-math") #include<bits/stdc++.h> //#include<bits/extc++.h> //using namespace __gnu_pbds; using namespace std; #define F first #define S second typedef long long ll; #define REP(i,n) for(register int i=0;i<(n);++i) #define REP1(i,a,b) for(register int i=(a...
ALGO
0.999911
3.672991
bcf49b7d-b301-4830-bfda-583792e03d5d
medreres/university
3_sem/Алгоритмы и сложность/Ходзинский(практик)/Lab6_Algo/main.cpp
#include <iostream> #define n 7 using namespace std; bool function_KMP(char A[n], char B[n]) //Основна функція, де проходить і порівняння символів, і побудова “таблиці часткового співпадіння”. { int PI[n]; PI[0] = 0; int j = 0, i = 1; while (i != n) //формируем масив образа PI { if (B[i] =...
ALGO
0.99994
4.158035
d2601d86-1c2c-413a-b15e-4d24f8881de3
viveshok/AccCppSolnMan
Chap6/is_palindrome.cpp
#include<string> #include<algorithm> bool is_palindrome(const std::string& s){ return std::equal(s.begin(), s.end(), s.rbegin()); }
ALGO
0.981426
3.738192
f9fb29dd-bbf9-4b64-bc12-478a1787cabc
bioexplore/PowerVoronoiMap-cpp
src/hulledge.cpp
#include "hulledge.h" using namespace voronoi; HullEdge::HullEdge( Vertex* start, Vertex* end,Face* iface): start_(start),end_(end),iFace_(iface),twin_(NULL),next_(NULL),prev_(NULL) {} bool HullEdge::isEqual( Vertex* start, Vertex* end) { bool equal=false; equal = start_->equals(start) && end_->equals(end...
ALGO
0.99783
4.318069
7f7599bc-6623-4954-8821-32cf557d312c
shreejitverma/SDE-Interview-Prep
Programming/C++/Sorting/Main.cpp
#include <iostream> using namespace std; int getMaxIndex(int arr[], int start, int end) { int max = start; for (int i = start; i <= end; i++) { if (arr[max] < arr[i]) { max = i; } } return max; } void insertion(int arr[], int n) { // int n = sizeof(arr) / si...
ALGO
0.999678
4.382113
8ebedd34-2225-41af-9c5e-20175f8253a2
nahidhasan98/problem_solving
others/Large_addition.cpp
#include<bits/stdc++.h> using namespace std; string sum(string x,string y) { int xx=x.size(); int yy=y.size(); int sz=max(xx,yy); if(xx>yy) { for(int i=0;i<(xx-yy);i++) y='0'+y; } else if(yy>xx) { for(int i=0;i<(yy-xx);i++) x='0'+x; } st...
ALGO
0.999892
4.74716
28fbe028-769e-4ff7-9b57-29cd3e6678c3
35-hasib/Competitive_Programming_Hasibur_Rahman
LeetCode/Easy/Valid Palindrome.cpp
class Solution { public: #define SpeedUpIO ios_base::sync_with_stdio(false); cin.tie(0); bool isPalindrome(string s) { SpeedUpIO string a; int n = s.size(); for(int i=0; i<n; i++){ if((s[i] >= 'a' && s[i]<='z') || (s[i] >= 'A' && s[i]<='Z') || (s[i]>='0' && s[i]<='9')){ ...
ALGO
0.999861
5.709371
a7818f67-8837-4d71-8dc0-1468cb5dd322
HyoBN/Algorithm_Study
C3/KOI/Week11/boj_02464.cpp
#include <iostream> #include <algorithm> using namespace std; int d[64]; unsigned long long x, y; void toDecimal() { for (int i = 0; i < 64; i++) { x *= 2; x += d[i]; } } int main() { cin >> x; y = x; for (int i = 0; i < 64; i++) { d[63 - i] = x % 2; x /= 2; } prev_permutation(d, d + 64); toDecimal(...
ALGO
0.999974
4.253056
de1283f5-79e5-4dc7-beac-bf87a10c64d2
Himanshi-techweb/GeekforGeeks
Difficulty: Easy/Level order traversal/level-order-traversal.cpp
/* A binary tree Node class Node { public: int data; Node* left; Node* right; // Constructor Node(int val) { data = val; left = nullptr; right = nullptr; } }; */ class Solution { public: vector<vector<int>> levelOrder(Node *root) { // Your code here ...
ALGO
0.99998
6.275002
1dcd50d0-8803-4c6a-ad20-c724e8e76ec2
ishandutta2007/codeforces
littlecube/normal/1453/B.cpp
#include <bits/stdc++.h> #define ll long long using namespace std; int main() { int t; cin >> t; while (t--) { ll n, r = 0, s = 0; vector<ll> v; cin >> n; for (int i = 0; i < n; i++) { int tmp; cin >> tmp; v.emplace_back(tmp); ...
ALGO
0.999889
4.632145
0c3679dc-d11f-41cf-9801-d0af384b8ea2
Jincheng-Gong/heston_stochastic_local_volatility_model
src/ImpliedVolatilitySurface.cpp
#include "ImpliedVolatilitySurface.h" #include<cmath> #include <algorithm> #include "ThomasSolver.h" using namespace std; // Initialization List !!! ImpliedVolatilitySurface::ImpliedVolatilitySurface(const vector<double> & maturities, const vector<double> & strikes, const vector< vector<double> > & implied_vols, const...
ALGO
0.998571
6.159703
d3cf234f-1381-4362-b97f-db9db3a7e013
MironAlikc/themoviedb
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
0a24852b-e54b-4928-b75f-9a1bbf2a6687
Taha-Adeel/CP
Starters 43/Waiting_Time.cpp
#include <bits/stdc++.h> using namespace std; #define FAST ios::sync_with_stdio(0); cin.tie(0) #define FOR(a,c) for (int a=0; a<c; ++a) template<class T> struct v: vector<T>{using vector<T>::vector; void sort_asc() {sort(this->begin(), this->end());} void sort_dsc() {sort(this->begin(), this->end(), greater<T>()...
ALGO
0.999618
4.04238
0ee52976-87b8-4fcc-bf79-fbe4bac17c6c
happyfn/Tr1k3
open_source/opencv-4.x/samples/cpp/select3dobj.cpp
/* * * select3obj.cpp With a calibration chessboard on a table, mark an object in a 3D box and * track that object in all subsequent frames as long as the camera can see * the chessboard. Also segments the object using the box projection. This * program is useful for co...
TOOL
0.994887
6.101028
c8c6a7ce-5899-4468-8a0a-1da429fcd2b9
PRANAVJARANDE/Leetcode-Solutions
medium/Jump Game VI.cpp
class Solution { public: int maxResult(vector<int>& nums, int k) { int n=nums.size(); vector<int>dp(n,INT_MIN); dp[n-1]=nums[n-1]; priority_queue<pair<int,int>> q1; q1.push({dp[n-1],n-1}); for(int in=n-2;in>=0;in--) { while(!q1.empty...
ALGO
0.999915
5.08661
64c13c6e-dcfc-4bfb-8a0d-608db2271981
wAuner/model_predictive_control
src/Eigen-3.3/unsupported/test/BVH.cpp
#include "main.h" #include <Eigen/StdVector> #include <Eigen/Geometry> #include <unsupported/Eigen/BVH> namespace Eigen { template<typename Scalar, int Dim> AlignedBox<Scalar, Dim> bounding_box(const Matrix<Scalar, Dim, 1> &v) { return AlignedBox<Scalar, Dim>(v); } } template<int Dim> struct Ball { EIGEN_MAKE_ALIGN...
TEST
0.989686
6.315364
02c13ebe-2f53-47a1-97b1-2b26fdb57e3b
AimenYaseen/SPD-CCI2023
homework_11/part_2/problem_6/4_kth_largest/k_largest.cpp
using namespace std; #include <vector> #include <ctime> #include <cstdlib> #include <iostream> class Solution { public: int randomPivot(int s, int r) { srand(time(0)); return s + rand() % (r - s + 1); } int randomPartition(vector<int>& nums, int s, int e) { int pivotIndex ...
ALGO
0.999931
4.979139
6d2b1243-c38d-4c49-860e-e32f4dbe4110
aanchal2320/LeetCode
478-generate-random-point-in-a-circle/478-generate-random-point-in-a-circle.cpp
class Solution { public: double xCenter; double yCenter; double radius; Solution(double rad, double x_center, double y_center) { radius = rad; xCenter = x_center; yCenter = y_center; } double random(){ return 1.0 * rand() / RAND_MAX; } vector<doub...
ALGO
0.986875
5.200777
51005574-f39b-44a9-b8a9-5489598450e0
systemis/althorigmcompettion
hsg-hcm-2018-candy.cpp
#include <iostream> #include <string> using namespace std; void bai1(){ int k, maxL = 1; int candys[] = {1, 2, 3, 3, 4, 6, 34, 5}; cout << "Nhap vao so K" << endl; cin >> k; int length = sizeof(candys) / sizeof(*candys); for (int i = 0; i < length; i++) { int total = candys[i], c = 0; for (int ...
ALGO
0.999418
3.561597
b0e64c50-c75c-4257-bf5c-f6301cee8229
asdadeeeee/OJ
leetcode/18/a.cpp
#include <algorithm> #include <iterator> #include <unordered_map> #include <vector> using namespace std; class Solution { public: vector<vector<int>> fourSum(vector<int> &nums, int target) { int n = nums.size(); vector<vector<int>> ans; sort(nums.begin(), nums.end()); int ptr1 = 0; int ptr2 = n - ...
ALGO
0.999989
5.733967
6f0111dc-0f37-4f1e-9e43-a2b640463fa2
PavelPoltavets/Task-2
Task-2.4/main.cpp
#include <iostream> using namespace std; int main() { unsigned short arr[5]; unsigned short maxi = 0; for (int i=1; i<=5;i++) { cout<<"Zvezdochek v "<< i<<"-om stolbike: "; cin>>arr[i-1]; if (arr[i-1]>maxi) maxi=arr[i-1]; } for (int i =0;i<maxi;i++) { ...
ALGO
0.999364
3.292262
84d9a801-9d51-452b-b268-f7a0c6ebb3cd
szymonnogiec/studies
PRiR/mpi/RSA.cpp
// // Created by simon on 06.03.17. // #include <iostream> #include "RSA.h" RSA::RSA(FileReader& fileReader) : publicKeyParams (std::make_pair(11, 899)), privateKeyParams (std::make_pair(611, 899)), fileReader_ (fileReader), charsMovem...
ALGO
0.997309
4.717011
47d4b63c-7d58-4560-9e5d-812342241d24
JMUWRobotics/volksbot
ros2_ws/src/sick_scan_xd/test/src/sick_scan_xd_api/toojpeg/toojpeg.cpp
// ////////////////////////////////////////////////////////// // toojpeg.cpp // written by Stephan Brumme, 2018-2019 // see https://create.stephan-brumme.com/toojpeg/ // #include "toojpeg.h" // - the "official" specifications: https://www.w3.org/Graphics/JPEG/itu-t81.pdf and https://www.w3.org/Graphics/JPEG/jfif3.pdf...
TOOL
0.859239
7.670935
8c469316-557c-4aab-a6bd-ad2806479ca2
lzyrapx/Competitive-Programming
HDUOJ/2027.cpp
#include<iostream> #include<cstdlib> #include<cstdio> #include<cmath> #include<cstring> #include<string> #include<cstdlib> #include<iomanip> #include<algorithm> typedef long long LL; using namespace std; int main() { int n,m,i,j; char text[1000]; scanf("%d",&n);getchar(); while(n--) { int num1=0,num2=0,num3=0,n...
ALGO
0.971026
3.190639
fe82bb61-38e1-4c51-98f7-24a5d9d73d6d
ishandutta2007/codeforces
sankear/normal/118/E.cpp
#include <iostream> #include <cstdio> #include <cstdlib> #include <cmath> #include <ctime> #include <algorithm> #include <string.h> #include <vector> #include <set> #include <map> #include <complex> using namespace std; typedef long long ll; typedef long double ld; typedef complex <double> tc; int k; bool used[10010...
ALGO
0.999998
3.666371
6ee38f2c-e445-4eb7-8a91-9792fa0ba266
0x1d107/stft
unsupported/bench/bench_svd.cpp
// Bench to compare the efficiency of SVD algorithms #include <iostream> #include <bench/BenchTimer.h> #include <unsupported/Eigen/SVD> using namespace Eigen; using namespace std; // number of computations of each algorithm before the print of the time #ifndef REPEAT #define REPEAT 10 #endif // number of tests of t...
TEST
0.995912
6.22153
b134473e-1d23-4a0d-8804-d64ca8905131
ArRuslan/os-lb3
lb2rsa.cpp
#include "lb2rsa.h" #include <cmath> #include <random> #include <fstream> #ifdef __MINGW32__ #include <windows.h> #endif uint32_t randrange(uint32_t min, uint32_t max) { std::random_device rd; std::mt19937_64 eng(rd()); std::uniform_int_distribution<uint32_t> distr; uint32_t range = max - min + 1; ...
TOOL
0.977672
5.597007
4d85be6f-c9e4-4d97-bd20-42cf34c071fc
yanjie1017/Kattis
checkmateinone.cpp
#include <iostream> #include <iomanip> #include <sstream> #include <cmath> #include <climits> #include <vector> #include <list> #include <queue> #include <stack> #include <unordered_set> #include <unordered_map> #include <set> #include <map> #include <algorithm> #include <utility> using namespace std; typedef long lon...
ALGO
0.999936
4.219797
11c38604-ac18-4348-a228-4f259b4bc25c
AkrinW/leetcode
9_PalindromeNumber.cpp
#include <vector> #include <iostream> #include <string> #include <stack> #include <unordered_map> #include <queue> #include <algorithm> #include <cstdint> class Solution { public: bool isPalindrome(int x) { if (x < 0 || x % 10 == 0) { return false; } int p = 0; while (x ...
ALGO
0.999328
6.328562
43041834-667b-41f3-8f7d-449397176b5d
Williamsalex3/8-PuzzleSolver
Solution.cpp
#include "Solution.h" #include <cassert> #include <stdexcept> Solution::Solution(Solveur& solveur, Jeu* jeu) : solveur(solveur), jeu(jeu), etatSolution(EtatSolution::ANIMATION), tempsAnimationMs((int)(TempsSolutionMs / solveur.solution.size() / 6 * 5)), tempsDelaiMs((int)(TempsSolutionMs / solveur.solution.size(...
ALGO
0.984143
4.226092
f5d25e74-0c59-4bbe-80f8-bda394a0e813
ishandutta2007/codeforces
ershov.stanislav/normal/776/F.cpp
#ifdef DEBUG #define _GLIBCXX_DEBUG #endif #include <bits/stdc++.h> using namespace std; #define mp make_pair #define pb push_back #define sz(s) ((int) ((s).size())) #ifdef DEBUG #define eprintf(...) fprintf(stderr, __VA_ARGS__), fflush(stderr) #else #define eprintf(...) ; #endif typedef long long ll; typedef long...
ALGO
0.99999
4.393646
515c8d2c-d916-4528-a159-006cd89c2b99
deniscostadsc/playground
solutions/google-code-jam/2014/qualification-round/magic-trick/magic-trick.cpp
#include <cstdint> #include <cstdio> int main() { std::int16_t cases, nrow, t, c, card, n = 0; std::int16_t first_row[4], second_row[4]; scanf("%d", &cases); while (++n <= cases) { scanf("%d", &nrow); for (std::int16_t i = 1; i <= 4; ++i) { for (std::int16_t j = 0; j <= 3;...
ALGO
0.997441
4.447969
65db6c07-7da4-469a-b1d1-0552f7798cac
russellmatt66/GPU-samples
MiscAlgorithms/BinarySearch/test/getNumIter.cpp
#include <cmath> #include <string> #include <iostream> // Compute the number of iterations associated with node i int getNumIter(int i){ // This is an easy problem int num_iter = 1; int k = 0; while (k < i){ k += pow(2, num_iter); num_iter++; } return num_iter; } int main(int a...
ALGO
0.998941
4.719781
ed73dd06-ff25-4a0d-b9b9-5e4c548ff1ae
Zapryanovx/FMI-SDA-2024-PREP
Week 07/Additional/SI Exams BST Tasks/kingdom.cpp
//https://www.hackerrank.com/contests/kontrolno-3/challenges #include <cmath> #include <cstdio> #include <vector> #include <iostream> #include <algorithm> using namespace std; struct Node { long long val = 0; vector<Node*> children; Node(long long val) : val(val) {} }; void dfs(Node* node, vector<int...
ALGO
0.999918
4.555549
5ac9875c-5eff-466e-8697-1b767711ed2d
DhruvPandey1509/Vscode-Program-Folders
C++ DataStructures/Dynamic Programming/FrogMinCost_1.cpp
#include <iostream> #include <vector> using namespace std; int minCost(int h[], int n) { if (n == 0 || n == 1) { return 0; } vector<int> dp(n, 0); dp[0] = 0; dp[1] = abs(h[1] - h[0]); for (int i = 2; i < n; i++) { int op1 = abs(h[i] - h[i - 1]) + dp[i - 1]; //jump gap ...
ALGO
0.999942
4.667821
1ad53fd4-1487-4bfc-82bc-fc9d711a9fa5
Tasmia22/Numerical-Mathematics
lab1/bisection method by tplerance.cpp
#include<bits/stdc++.h> using namespace std; double f(double x) { double y=x*log10(x)-1.2; return y; } int main() { int i=0; double a,b,r=0,fp,fq,fr,temp,diff; cout<<"Enter the initial value : \na ="; cin>>a; cout<<"f(a)="<<f(a)<<endl; cout<<"\nb ="; cin>>b; cout<<"f(b)="<<f(b...
ALGO
0.999959
3.680857
601c5cd7-78f2-4b87-ae9d-5b2dca12fc95
NipunRathore/GFGPracticeSolutions
Easy/Choice/choice.cpp
//{ Driver Code Starts #include <bits/stdc++.h> using namespace std; // } Driver Code Ends class Solution { public: vector<int> arrayForm(int a, int b, int c) { // code here vector<int> arr ; arr.push_back(a) ; arr.push_back(b) ; arr.push_back(c) ; ret...
ALGO
0.998774
5.918332
74b5b850-214d-4499-982a-6530e80c4cc3
gziren/InspireFace
cpp/inspireface/track_module/face_detect/face_detect_adapt.cpp
/** * @author Jingyu Yan * @date 2024-10-01 */ #include "face_detect_adapt.h" #include "cost_time.h" #include <inspirecv/time_spend.h> namespace inspire { FaceDetectAdapt::FaceDetectAdapt(int input_size, float nms_threshold, float cls_threshold) : AnyNetAdapter("FaceDetectAdapt"), m_nms_threshold_(nms_threshold),...
ALGO
0.863065
5.875361
5356802a-0b06-42b0-8402-f950dc5963bd
TonyAdamo/CS165
Week 2/prizes problem/prizesProb.cpp
#include<iostream> #include<cstdlib> #include<time.h> #include<algorithm> using namespace std; main () { int randOne, randTwo, randThree, randFour; do { //print out four random numbers srand((unsigned)time(NULL)); randOne = rand() % (25 + 1 - 0) + 0; randTwo = rand() % (25 + 1 - 0) + 0; randThree...
ALGO
0.990793
3.296581
fbef2b38-26dc-4901-a23f-e4e485e89821
g-ki/up-practicum-2016-17
week07/solutions/transpose.cpp
#include <iostream> using namespace std; void transpose(double matrix[][100], int m, int n) { int min = (m < n) ? m : n; for (int i = 0; i < m; i++) { for (int j = 0; j < n; j++) { if (i < min && j < min && i < j) { double temp = matrix[i][j]; matrix[i]...
ALGO
0.999979
4.444694
90d77e3c-8de1-4558-9a0e-c1adff319257
1shi-xiao/CV-Infer
third_parties/opencv-4.10.0/3rdparty/carotene/src/fill_minmaxloc.cpp
#include "common.hpp" namespace CAROTENE_NS { #ifdef CAROTENE_NEON namespace { template <typename T> void process(const T * src, size_t j0, size_t j1, size_t i, T minVal, size_t * minLocPtr, s32 & minLocCount, s32 minLocCapacity, T maxVal, size_t * maxLocPtr, s32 & maxLocCount, s32 maxLocC...
ALGO
0.998203
3.251872