uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
2b0129b6-beda-4b62-95b3-bb6d03fd295c
marinebox/AtCoder
ABC170/A/main.cpp
#include <bits/stdc++.h> #define rep(i, n) for(int i = 0; i < n; i++) #define vv(T) vector<vector<T>> using namespace std; using ll = long long; using vint = vector<int>; using vvint = vector<vector<int>>; using vll = vector<long long>; using vvll = vector<vector<long long>>; using vbool = vector<bool>; using vvbool = ...
ALGO
0.999287
3.302716
4ff504b2-861d-40b5-aa5f-d02ebdc2ed4b
Liuyi-Wang/LeetCode
src/1746_Maximum_Subarray_Sum_After_One_Operation.cpp
/** * Time: * O(n) * Space: * O(1) */ class Solution { public: int maxSumAfterOperation(vector<int>& nums) { vector<vector<int>> dp(2, vector<int>(2, 0)); dp[0][0] = nums[0]; dp[0][1] = nums[0]*nums[0]; int n = nums.size(); int result = dp[0][1]; for (int i =...
ALGO
0.999951
5.874734
d22aef29-3bfa-4fc7-8235-57ea502ec803
melfaron9246/C-Lab-6
Faron_Lab6/Faron_Lab6.cpp
#include <iostream> #include <string> #include <cmath> #include <fstream> #include <istream> #include <iomanip> #include <sstream> using namespace std; //declare constants const int NUMBER_OF_ROWS = 10; //declare variables double highestRating; double lowestRating; string lowestGenre; string highestGenre; //declare...
TOOL
0.951912
5.475196
16f75257-cd5e-4466-97dd-3859105bad3d
himanshudubey7/Programming
C_Mex_in_the_Grid.cpp
//author: Ghostyy :D # include<bits/stdc++.h> using namespace std; #define ll long long #define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0); ll mod = 1000000007; //-------------------------------------------------------------------------------------------------- //binary exponentiation int exp(int base,i...
ALGO
0.99969
3.511877
354c1cc5-b385-4102-9b10-69aa5567e272
havenwood/GraalVM
src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp
// needed by current_stack_region() workaround for Mavericks #if defined(__APPLE__) # include <errno.h> # include <sys/types.h> # include <sys/sysctl.h> # define DEFAULT_MAIN_THREAD_STACK_PAGES 2048 # define OS_X_10_9_0_KERNEL_MAJOR_VERSION 13 #endif #ifdef AMD64 #define SPELL_REG_SP "rsp" #define SPELL_REG_FP "rbp" #...
TOOL
0.876272
6.524682
00eea926-0e86-4ae8-b7dc-ebbea3fcb4ec
AymenChla/competitive-programming-training
Blocks2(segment tree)/main.cpp
#include <bits/stdc++.h> using namespace std; int const MAX = 1e6; typedef struct { int h; int pos; } Pos; Pos _max(Pos a, Pos b) { return (a.h>b.h ? a : b); } Pos tree[MAX]; Pos X[MAX]; void build(int node,int start, int end) { if(start == end) { Pos x = {0,start}; X[start] = x...
ALGO
0.999725
3.807027
81e79182-dc68-4a62-aaff-543dae228aba
JP493052373/JP-Project-Aula1
hello_flutter/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.998458
6.761023
57177a19-e0dd-49e5-93f3-11265dc45526
sirikata/sirikata
libmesh/src/Raytrace.cpp
#include <sirikata/mesh/Platform.hpp> #include <sirikata/mesh/Bounds.hpp> #include <sirikata/mesh/Raytrace.hpp> namespace Sirikata { namespace Mesh { namespace { Vector3f calculateBasicFaceNormal(const Vector3f& v1, const Vector3f& v2, const Vector3f& v3) { Vector3f normal = (v2 - v1).cross(v3 - v1); normal....
ALGO
0.999737
7.747693
e86b1140-2c35-4482-9652-b4a19d34f437
joonion/too-much-information
TailRecursion/TailRecursion.1.cpp
#include <iostream> using namespace std; typedef unsigned long long LargeInteger; /* Summation to n using the iteration */ LargeInteger sum_to(LargeInteger n) { LargeInteger s = 0; for (LargeInteger i = 1; i <= n; i++) s += i; return s; } int main() { int n; cin >> n; cout << sum_t...
ALGO
0.999921
4.981541
38275188-1f18-42ff-ab78-7c9de40743b4
NSR-Resources/android_device_xiaomi_sm8350-common
gps/utils/loc_misc_utils.cpp
#define LOG_NDEBUG 0 #define LOG_TAG "LocSvc_misc_utils" #include <stdio.h> #include <string.h> #include <inttypes.h> #include <dlfcn.h> #include <math.h> #include <log_util.h> #include <loc_misc_utils.h> #include <ctype.h> #include <fcntl.h> #include <inttypes.h> #ifndef MSEC_IN_ONE_SEC #define MSEC_IN_ONE_SEC 1000UL...
TOOL
0.961056
5.910943
6000313b-faf5-4f37-9ac8-f68e1db385ab
IMDCGP210-1819/portfolio-MichaelRDavis
Portfolio/Pathfinding/Source/GreedyBreadthFirstSearch.cpp
#include "GreedyBreadthFirstSerach.h" #include "NavigationGraph/GBFSNode.h" #include "NavigationGraph/NavNode.h" #include "NavigationGraph/NavLink.h" #include "NavigationGraph/NavPath.h" #include <algorithm> GreedyBreadthFirstSearch::GreedyBreadthFirstSearch() { } GreedyBreadthFirstSearch::~GreedyBreadthFirstSearch(...
ALGO
0.999798
4.295228
5d861256-9912-471c-bb4c-0cf8a4265d10
ishandutta2007/codeforces
icecuber/normal/1107/E.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; ll p[101]; ll dp[101][101][101]; ll dp2[101][101]; int main() { ios::sync_with_stdio(0); cin.tie(0); int n; string s; cin >> n >> s; for (int i = 1; i <= n; i++) cin >> p[i]; for (int a = n-1; a >= 0; a--) { for (int b = a+1; b <=...
ALGO
0.999914
3.589433
63eb305f-a92c-40a6-afe8-514d6b3441a1
ZivFerdinand/CompetitiveProgramming
C++ Code/Adding_Reversed_Numbers.cpp
#include <iostream> #include <algorithm> #include <cmath> #include <string> #include <cstring> #include <iomanip> #include <map> #include <sstream> #define ll long long using namespace std; int main(){ ios_base::sync_with_stdio(false); int n; cin >> n; while(n--){ ll a,b; cin >> a >> b; string s1=to_str...
ALGO
0.999698
4.834898
17bf6678-5510-4da2-8a6d-7b47d4fa650b
shishircsehstu/Cpp-Raw-Code
lexical_Analyzer.cpp
#include <cstdio> #include <cstdlib> #include <cctype> #include <cmath> #include <cstring> #include <climits> #include <iostream> #include <iomanip> #include <vector> #include <list> #include <stack> #include <queue> #include <map> #include <set> #include <string> #include <utility> #include <sstream> #include <algori...
ALGO
0.986092
3.235881
1094abcd-b6f8-49ab-b091-c523a2c0ed4f
sora-k/coding-problems
405-convert-a-number-to-hexadecimal-[easy]/solution.cpp
// started 3/13/17 11:00PM - 11:40PM // 3/14/17 9:00AM - 10:00AM class Solution { // reasonable solution, // the key was using unsinged int so that right shift is zero filled // also concatination always create new string, unless specified as string ...
ALGO
0.999318
5.832624
550496d8-2c6e-40af-a886-18b79083a976
Murad501/Phitron
Semester 3/Weeks/Level-1/Week 7/Day 3/NASA.cpp
#include <bits/stdc++.h> using namespace std; #define nl '\n' #define ll long long int const int maxN = (1LL << 15); vector<int> allPalindrome; #define MuRAD_BOOST() \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); bool isPalindrome(int x) { string s = to_string(x); int len = s.si...
ALGO
0.999987
4.532865
32f5cfe9-1568-4725-97b0-3a8f955bf8e7
ahmedmohsen087/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.998733
6.76775
335e21fd-f8ca-41fb-b67a-9090abc95dde
Subramanya-Adiga/wallchanger
src/change_lib/platform/windows_helper.cpp
#include "windows_helper.hpp" #include <bit> std::wstring win32::to_utf16(const std::string &data) { if (data.empty()) { return {}; } int size_needed = MultiByteToWideChar( CP_UTF8, 0, &data[0], static_cast<int>(data.size()), nullptr, 0); std::wstring to_str(static_cast<std::size_t>(size_needed), 0);...
TOOL
0.957228
5.640826
97733467-4d83-4c58-97ea-2d22a76b2aac
amirzb95/eyvaaay
aten/src/ATen/native/quantized/cpu/AdaptiveAveragePooling.cpp
#define TORCH_ASSERT_ONLY_METHOD_OPERATORS #include <ATen/core/Tensor.h> #include <ATen/Context.h> #include <ATen/Dispatch.h> #include <ATen/Parallel.h> #include <ATen/native/quantized/cpu/QuantizedOps.h> #ifndef AT_PER_OPERATOR_HEADERS #include <ATen/Functions.h> #include <ATen/NativeFunctions.h> #else #include <ATen...
TOOL
0.881763
6.583125
ad7170d4-4eb9-413a-91a9-a3997f07c985
tigran-edu/Large-Prime-Numbers
src/cfrac.cpp
#include "cfrac.hpp" #include "aliases.hpp" #include "base.hpp" #include "basic.hpp" #include "congruence.hpp" #include "gaussian.hpp" namespace lpn { namespace math = boost::multiprecision; ContinuedFractions::State::State(const long_int & n) : n(n), sqrt_n(math::sqrt(n)), a(0), b0(0), b1(sqrt_n), c0(1), c1(n -...
ALGO
0.999885
6.927724
6e7890d0-0b14-43f2-a310-f273a4d0c901
pratham27037/c-program
c++program/arrays/removeduplicate.cpp
#include<iostream> using namespace std; //practicaly returning unique elements in array int removeDuplicate(int arr[],int n){ int res=1; for(int i=1;i<n;i++){ if(arr[i] != arr[res-1]){ arr[res] = arr[i]; res++; } } return res; } int main(){ int n; cout<...
ALGO
0.99835
4.98444
049533e0-6398-4991-b49b-4213744bdc65
renatostanz/gemp
classes/09-Unordered_map_and_Unordered_set/examples/example2.cpp
#include <iostream> #include <unordered_set> using namespace std; int main() { unordered_set<int> matriculas; matriculas.insert(555555); matriculas.insert(666666); matriculas.insert(777777); matriculas.insert(888888); cout << matriculas.size() << endl; if (matriculas.find(555555) != matri...
ALGO
0.989682
4.864091
5bdf153f-491e-4f32-b6cd-37114231c542
tunak7up/c-program
CTDLGT/danh-sach-lien-ket/nhap/xoa-node-cuoi.cpp
#include <stdio.h> #include <ctype.h> #include <string.h> #include <stdlib.h> struct node{ int data; struct node *next; }; typedef struct node node; node* makenode(int x){ node *moi = (node*)malloc(sizeof(node)); moi->data = x; moi->next = NULL; return moi; } void duyet(node *head){ while(head != NULL){ pr...
ALGO
0.998121
3.20414
8a833f74-e779-4406-bba2-24c35c428f25
ndhuynh02/NMLT-LTNC
NMLT/Pointer/day con tang dan dai nhat.cpp
/* nhập mảng số nguyên n ptu (mảng động) tìm dãy con tăng dần thực sự lớn nhất của mảng vừa nhập nếu có 2 dãy cùng độ dài thì lấy dãy đầu tiên 8 1 2 3 4 0 2 3 4 output: 1 2 3 4 10 1 2 3 4 5 6 0 3 2 4 output: 1 2 3 4 5 6 */ #include <iostream> using namespace std; void nhap_mang(int *a, const int &n); void in_mang( i...
ALGO
0.999971
4.123974
25c4dc36-ea04-491b-8551-71603b770e82
Zaw28/Robotics
question5.cpp
#include <iostream> #include <cmath> class Triangle { public: float calculateArea(float base, float height) { return 0.5 * base * height; } void calculateArea(float base, float height, float &result) { result = 0.5 * base * height; } }; int main() { Triangle triangleObject; float ...
TOOL
0.966148
7.151886
955a2b83-a6cc-45e5-8c54-97aab73a3619
minhhpkp/linked-list-problems
cppfiles/cau2.cpp
void append(Node *a, Node *b) { b->next = a->next; a->next = b; } inline bool func_greater(int a, int b) { return a > b; } inline bool func_less(int a, int b) { return a < b; } Node* insert(Node* head, int value) { auto newNode = new Node{value, nullptr}; if (head == nullptr) { return ...
ALGO
0.999975
5.22823
8100d2af-97e8-44e9-8cd8-22dd2d2ce229
yashss1/Sublime_CP
cf_1811_a.cpp
//YashS #include <bits/stdc++.h> using namespace std; #define test int T;cin>>T;while(T--) #define int long long #define pb push_back #define all(x) (x).begin(),(x).end() #define rep(i,a,b) for(int i=a;i<b;i++) #define pVec(v) for(auto e:v)cout<<e<<"...
ALGO
0.999936
3.852786
eac41357-fae8-433d-a50d-bcbf94571abf
enter-ctrl9/pytorch11
aten/src/ATen/native/cpu/SortingKernel.cpp
#define TORCH_ASSERT_NO_OPERATORS #include <limits> #include <ATen/native/Sorting.h> #include <ATen/core/TensorBase.h> #include <ATen/Dispatch.h> #include <ATen/Dispatch_v2.h> #include <ATen/Parallel.h> #include <ATen/NumericUtils.h> #include <ATen/TensorIterator.h> #include <ATen/cpu/vec/functional.h> #include <ATen...
ALGO
0.9999
7.678546
2ffc07d9-db4c-4514-86e8-57a3c5dc9dab
Ayush-Balodi/CrackYourInternship
0079-word-search/0079-word-search.cpp
class Solution { private: bool helper( vector<vector<char>> &board, string word, int i , int j, int n, int m, int k ){ if( k >= word.size() ){return true;} if( i<0 || i>=n || j<0 || j>=m || board[i][j] != word[k] ){ return false;} if( word.size() == 1 && board[i][j] == word[0] ){ return true...
ALGO
0.999863
6.143194
6aa738c0-ad07-494d-8dc9-b580a542ea47
ishandutta2007/codeforces
vkgainz/normal/1174/D.cpp
#include <iostream> #include <vector> using namespace std; bool ex[(1<<18)]; int main() { int n,x; scanf("%d%d",&n,&x); ex[0]=1; vector<int> v({0}); for (int i=1;i<(1<<n);i++) { if (ex[i^x]) continue; v.push_back(i); ex[i]=1; } printf("%d\n",v.size()-1); ...
ALGO
0.99979
3.435328
4172bc8d-179a-4ec9-8aeb-41ff15801fea
rishabhkukreja30/DSA-questions
Trees/Top_View.cpp
// recursive approach void topView1(node *root, int level, int dist, map<int, pair<int, int> > &mp) { if(root == NULL) { return; } if(mp.find(dist) == mp.end() or level<mp[dist].second) { mp[dist] = {root->data, level}; } topView1(root->left, level+1, dist-1, mp); topView1(root->...
ALGO
0.999993
4.990328
d9d27d46-1f6a-42a4-8b89-ebdec2234cd2
kaloronahuang/KaloronaCodebase
Contests/Luogu2018Nov/rand_gen.cpp
// rand_gen.cpp #include <ctime> #include <cstdlib> #include <iostream> using namespace std; int main() { srand(time(NULL)); int n; cin >> n; cout << n << endl; for (int i = 0; i < n; i++) cout << rand() % 500 << " "; return 0; }
ALGO
0.966252
3.622874
79d9c8bd-fa99-46ae-8ca9-55f3727674a1
shuoxuanli/USACO
Gold/2016-2017/Dec/cow checklist.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long struct pt{ ll x, y; }; ll dis(ll x1, ll y1, ll x2, ll y2) { return (x2-x1)*(x2-x1) + (y2-y1)*(y2-y1); } ll h, g, dp[1001][1001][2]; pt a[1001], b[1001]; int main() { ifstream cin("checklist.in"); ofstream cout("checklist.out"); cin>>h>...
ALGO
0.999916
3.872097
9f1b9287-5500-4666-8b43-d945e0bf562d
Nitin1130/Data-Structures-ProblemsCplusplus
DivisibleSubarrays/main.cpp
#include <iostream> #include<cstring> using namespace std; #define ll long long ll a[1000005], pre[1000005]; int main() { int t; cin >> t; while(t--) { int n; cin >> n; memset(pre, 0 ,sizeof(pre)); pre[0] = 1; int sum = 0; for(int i = 0; i < n; i++) { ...
ALGO
0.999833
3.871994
0bd705b6-7ded-4e05-8ce4-a3678bbdeae9
HarshSaini3878/DS_practical
ds_55_searching_in_binary_search_tree.cpp
#include <iostream> using namespace std; // Define a structure for a tree node struct TreeNode { int data; TreeNode* left; TreeNode* right; TreeNode(int val) { data = val; left = nullptr; right = nullptr; } }; TreeNode* insert(TreeNode* root, int val) { if (root == nul...
ALGO
0.999997
6.853867
c8afa350-a13c-4153-b8c3-3a5e3ab9e0f4
Pundiraryan/LeetCode
1887-reduction-operations-to-make-the-array-elements-equal/1887-reduction-operations-to-make-the-array-elements-equal.cpp
class Solution { public: int reductionOperations(vector<int>& nums) { sort(nums.begin(),nums.end()); unordered_map<int,int>fre; int pos=0; for(auto &x:nums){ if(fre.find(x)==fre.end()){ fre[x]=pos++; } } int ans=0; for(a...
ALGO
0.999961
5.7145
4d7c5611-2c60-4001-8c54-a8dd71461fc6
nurulsafitri321/nurulsafitri2
10_Platform_Widget/pratikum/latihan/eksplorasi/eksplorasi/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.997181
6.76073
2fcd0162-10e1-4554-a892-74620d7d611f
socc-io/algostudy
baekjoon/smilu/2475.cpp
#include <cstdio> int main(void) { int sum = 0; for (int i = 0; i < 5; i++) { int temp; scanf("%d", &temp); sum += temp * temp; } printf("%d", sum % 10); return 0; }
ALGO
0.999683
3.796874
0c44cf26-4f65-4ce3-81a7-a62c6a71c529
eLRuLL/UVa-Solutions
UVa 10205 - Stack em Up/a.cpp
#include <stdio.h> #include <map> #include <iostream> #include <string> #include <vector> #include <stdlib.h> using namespace std; struct card{ string name; int value; string suit; card(string name,int value,string suit){ this->name = name; this->value = value; this->suit = suit; } card(){}; card& oper...
ALGO
0.999208
4.199411
db311962-2104-4130-b2dd-055e666bdbe1
ArunRathaur1/LeetcodeCodes
0238-product-of-array-except-self/0238-product-of-array-except-self.cpp
class Solution { public: vector<int> productExceptSelf(vector<int>& nums) { int n=nums.size(); vector<int>ans(n,0); long long tem=1; int count=0; int index=-1; for(int i=0;i<n;i++){ if(nums[i]==0){ count++; index=i; ...
ALGO
0.999965
5.768273
aea3bd05-5ed2-42a2-b388-7b703a9ff653
dwaknaa/Programmers
Programmers/연속된부분수열의합.cpp
#include <string> #include <vector> using namespace std; vector<int> solution(vector<int> sequence, int k) { vector<int> answer; int start = 0; int end = 0; int sum = sequence[start]; int minLength = sequence.size()+1; int answerStart = 0; int answerEnd = 0; while(start <= end...
ALGO
0.999915
5.648212
3f588a3b-09cc-4283-b197-05ea574ce883
unoof/code-ptit
DSA/CTDL_005 XÓA DỮ LIỆU TRONG DSLK ĐƠN.cpp
#include <bits/stdc++.h> using namespace std; void submit() { int n, k; cin >> n; vector<int> A(n); for (int i = 0; i < n; i++) { cin >> A[i]; } cin >> k; for (auto &&i : A) { if (i == k) { continue; } cout << i << " "; } ...
ALGO
0.999865
3.772928
67423479-229e-40d2-b8d8-7e6e3df10997
Shujaat65/Shujaat65
c++/division,modulus/homework3b.cpp
// here assume a year is 12 months but each month is 30 days only so a year has 360days,,, //print three numbers total years ,total months, remaining days???? #include<iostream> using namespace std; int main() { int days; cin>>days; int years =days/360; days = days%360; int months =days/30; day...
ALGO
0.982021
3.31709
c13f26fa-4a55-414c-a5dc-e5ea5e2f6b3b
MaciejKmieciak/PWr1
lista_1/z_1/277516_z1.cpp
#include <iostream> using namespace std; unsigned int f(unsigned int n) { if (n % 2 == 0) return n / 2; else return 3 * n + 1; } int main() { int n, licznik = 1; cin >> n; cout << n; while (n != 1) { n = f(n); cout << " " << n; ++licznik; } cout << ", " << l...
ALGO
0.999972
4.412519
adf2b75d-2298-4e49-b255-1e181f1c2a8a
abh253/codeforces
contests/div2#842/B_Quick_Sort.cpp
#include<bits/stdc++.h> #include<ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; template<class T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update> ; template<typename T> using ordered_multiset = tree<...
ALGO
0.99995
4.639124
2c5ec624-1217-4bbc-aa37-f2b6c8a2c205
Eiard/Algorithms_2023
40/23/x23.cpp
// // Created by 30671 on 2022/2/19. // #include "x23.h" // 找公共后缀 LNode *x40_23(LinkList &L1, LinkList &L2) { int L1_length, L2_length; LNode *p, *q; L1_length = Length_LNode(L1); L2_length = Length_LNode(L2); for (p = L1; L1_length > L2_length; L1_length--) { // 若m>n使p指向链表中的第m-n+1个结点 p ...
ALGO
0.999412
3.601774
0bc82087-531e-4b03-a4d5-6203d57024fe
VishnubpriyaA/Data-structures
Implementation of Singly, Doubly and Circular Linked Lists/remove duplicates from a sorted linked list.cpp
//C++ Program to remove duplicates from a sorted linked list. #include <iostream> using namespace std; class Node { public: int data; Node *next; }; void removeDuplicates(Node* head) { Node* current = head; if (current == NULL) return; while (current->next != NULL) { if (current->data == cur...
ALGO
0.999941
5.310746
efa2bbe8-201a-40e4-bc6f-20672b120ddd
oriongump/Codility
PermMissingElem.cpp
// you can use includes, for example: // #include <algorithm> #include <string> #include <vector> #include <stdio.h> #include <cmath> #include <map> #include <iostream> #include <sstream> #include <queue> #include <algorithm> #include <memory> #include <set> #include <climits> using namespace std; #define rep(i,m) fo...
ALGO
0.999847
4.270094
947f308d-0d7d-4676-91b2-3f79deb37af8
adriancarriger/experiments
udacity/self-driving-intro/5/3/not_optimized/sense.cpp
#include "headers/sense.h" using namespace std; vector< vector <float> > sense(char color, vector< vector <char> > grid, vector< vector <float> > beliefs, float p_hit, float p_miss) { vector< vector <float> > newGrid; vector<float> row, newRow; float prior, p; char cell; int i, j, height, width; height = g...
ALGO
0.93255
4.043355
833b7063-b8d6-42fb-a1f5-4d35b26ae7ad
PhQuangMinh/PTIT
Kì 4/Code PTIT DSA/DSA11011 - CÂY NHỊ PHÂN ĐỦ.cpp
#include<bits/stdc++.h> using namespace std; #define tree node* int u, v; char c; bool check; struct node{ int data; node* left; node* right; }; tree create(int x){ tree newNode = new node; newNode -> left = NULL; newNode -> right = NULL; newNode -> data = x; return newNode; } void build...
ALGO
0.999987
4.275793
aec3bb47-857f-4030-9f19-5c214de283c4
serbantasss/Competitive-Programming
CodeForces/1311A | Add Odd or Subtract Even/73213976.cpp
#include <bits/stdc++.h> using namespace std; int main() { // freopen("cabana.in","r",stdin); // freopen("cabana.out","w",stdout); int t; scanf("%d",&t); while(t--) { int a,b; scanf("%d%d",&a,&b); if(a==b) printf("0\n"); if(a<b) { if(...
ALGO
0.9999
3.483318
56b545ff-2180-484e-adcd-0eb619ec4e96
huaijin-chen/OpenCVMirror
opencv/samples/cpp/grabcut.cpp
#include "opencv2/highgui/highgui.hpp" #include "opencv2/imgproc/imgproc.hpp" #include <iostream> using namespace std; using namespace cv; void help() { cout << "\nThis program demonstrates GrabCut segmentation -- select an object in a region\n" "and then grabcut will attempt to segment it out.\n" "C...
ALGO
0.898108
5.25205
42ba5514-17ef-4f56-a4c5-e2f84394ede4
umamaheshdev01/Codeforces
Div-4/871/A.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; void solve() { string k; cin>>k; cout<<(k[0]!='c')+(k[1]!='o')+(k[2]!='d')+(k[3]!='e')+(k[4]!='f')+(k[5]!='o')+(k[6]!='r')+(k[7]!='c')+(k[8]!='e')+(k[9]!='s')<<endl; } int main() { ll n; cin>>n; while(n--) { sol...
ALGO
0.982905
3.160548
ebff7c02-abc3-4a97-ba01-2d7a051e9f2f
phoenixnn/Amodal3Det
caffe-fast-rcnn/src/caffe/util/im2col.cpp
#include <vector> #include "caffe/util/im2col.hpp" #include "caffe/util/math_functions.hpp" namespace caffe { // Function uses casting from int to unsigned to compare if value of // parameter a is greater or equal to zero and lower than value of // parameter b. The b parameter is of type signed and is always positiv...
TOOL
0.883861
7.823773
ed221ac7-b7e0-4f72-8afd-326df960a275
divyanshusharma3031/leetcode
Reverse both parts - GFG/reverse-both-parts.cpp
//{ Driver Code Starts //Initial Template for C++ #include <bits/stdc++.h> using namespace std; struct Node { int data; struct Node *next; Node(int x) { data = x; next = NULL; } }; void printList(Node *node) { while (node != NULL) { cout << node->data << " "; ...
ALGO
0.999735
5.565135
a75db68e-c668-4e2e-88fc-866c5ad354ce
mateor/pdroid
android-2.3.4_r1/tags/1.30/frameworks/base/media/libstagefright/codecs/amrnb/enc/src/cbsearch.cpp
/* ------------------------------------------------------------------------------ Pathname: ./audio/gsm-amr/c/src/cbsearch.c Functions: D_plsf_3 Date: 01/31/2002 ------------------------------------------------------------------------------ REVISION HISTORY Description: (1) Removed "count.h" and "basic_op...
ALGO
0.999973
6.045815
6921dfb2-607f-4100-aa64-066e1309a45c
MonitorIizard/sophomore
section1/data-structure/[05]hash_table/hashLab/closeH_double_FS1.cpp
#include <iostream> #include <sstream> #include <string> using namespace std; #define ARRAYSIZE 20 #define STUDENT_ID_SIZE 14 unsigned long secondHashFunction(char* key) { unsigned long hashValue = 0; while (*key != '\0') { hashValue += *key; key++; } if (hashValue == 0) { has...
ALGO
0.999485
6.161586
6e75bf99-ac23-46dc-8343-87fce1c7edcf
nevermlnd/ue4-test
Engine/Source/ThirdParty/CryptoPP/5.6.5/include/ida.cpp
// ida.cpp - written and placed in the public domain by Wei Dai #include "pch.h" #include "config.h" #include "ida.h" #include "algebra.h" #include "gf2_32.h" #include "polynomi.h" #include "polynomi.cpp" #include <functional> ANONYMOUS_NAMESPACE_BEGIN static const CryptoPP::GF2_32 field; NAMESPACE_END NAMESPACE_B...
ALGO
0.969996
5.837785
56f08a3e-6a5a-4bde-b387-1543146d8d99
shishenghuang/MinkowskiNet
MinkowskiNet/MinkowskiEngine/src/pruning.cpp
#include "pruning.hpp" #include "common.hpp" #ifndef CPU_ONLY #include "pruning.cuh" #endif namespace minkowski { template <typename Dtype> void PruningForwardCPU(at::Tensor in_feat, // CPU feat at::Tensor out_feat, // CPU out feat at::Tensor use_feat, // uint8 CPU data ...
DATA
0.869628
7.546999
6d6d270d-4f1d-4c21-96f4-bbcb02974481
sofa-framework/issofa-merge
applications/plugins/Registration/RegistrationContact.cpp
#include "RegistrationContact.inl" #include "RegistrationContactForceField.inl" #include <SofaMeshCollision/BarycentricContactMapper.inl> #include <SofaMeshCollision/IdentityContactMapper.inl> #include <SofaMeshCollision/RigidContactMapper.inl> #include <SofaMiscCollision/TetrahedronModel.h> #ifdef SOFA_HAVE_MINIFLOWV...
CONFIG
0.939804
6.521735
be59cb56-d0dc-4fb1-8843-c192eae50c9b
AkshatKaushal25/UAS-DTU-navigation-simulation
UAS-DTU-navigation-simulation/navigation2/nav2_smoother/src/savitzky_golay_smoother.cpp
#include <vector> #include <memory> #include "nav2_smoother/savitzky_golay_smoother.hpp" namespace nav2_smoother { using namespace smoother_utils; // NOLINT using namespace nav2_util::geometry_utils; // NOLINT using namespace std::chrono; // NOLINT using nav2_util::declare_parameter_if_not_declared; void Savitzky...
TOOL
0.985875
7.012129
68521c2c-3894-49fd-af1e-db38516fdadf
hassanmaj/first
windows/runner/utils.cpp
#include "utils.h" #include <flutter_windows.h> #include <io.h> #include <stdio.h> #include <windows.h> #include <iostream> void CreateAndAttachConsole() { if (::AllocConsole()) { FILE *unused; if (freopen_s(&unused, "CONOUT$", "w", stdout)) { _dup2(_fileno(stdout), 1); } if (freopen_s(&unuse...
TOOL
0.998733
6.76775
1e3f3257-0ea3-4664-9e4c-810604e5ec22
NMRanaHamid/Problem_Solving
Personal/A_Morning_Sandwich.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef pair<int,int> p32; typedef pair<ll,ll> p64; typedef pair<double,double> pdd; typedef vector<ll> v64; typedef vector<int> v32; typedef vector<vector<int> > vv32; typedef vector<vector<ll> > vv64; ll mod = 1e9+7; #define n...
ALGO
0.999798
3.687983
8f082b08-cbd1-44ff-a642-58b7d69625f7
tkhal/Data-Structs-BST
bst.cpp
// Tim Khal // CS163 - Program #4 // Nov. 18th, 2018 #include "list.h" // ___________________________________________________________________________________________________________________________________________ int tree::w_addBill(const company & info) { node* temp = copy(info); // The node that was being return...
ALGO
0.888196
3.524255
1bdce109-2d0d-44cc-8e9d-8d791b97d2d8
kerydan/Codility
src/C++/lesson5/L5_StacksAndQueues_Nesting.cpp
/* A string S consisting of N characters is called properly nested if: S is empty; S has the form "(U)" where U is a properly nested string; S has the form "VW" where V and W are properly nested strings. For example, string "(()(())())" is properly nested but string "())" isn't. Write a function: int solution(char *...
ALGO
0.999547
5.978084
889774a3-acff-4f58-9bf1-fc941b3281cc
pachecowillians/URI
1285.cpp
#include <iostream> #include <sstream> #include <cmath> #include <cstdio> #include <iomanip> #include <stack> //pilha #include <queue> //fila #include <functional> #include <tr1/functional> //hash #include <vector> #include <cstring> #include <string> #include <stdlib.h> #include <bits/stdc++.h> #include <unordered_map...
ALGO
0.999715
3.695176
ca0760fb-98b3-4843-98c1-eaa8ba7294fa
i-arihant/binarysearch.com
minimizeMaxDiff.cpp
#include<bits/stdc++.h> using namespace std; int minimizeMaxDiff_Height(int arr[],int n,int k) { if(n==1) return 0; sort(arr,arr+n); int ans=arr[n-1]-arr[0]; int small=arr[0]+k; int big=arr[n-1]-k; if(small > big) swap(small,big); for(int i=1;i<n;i++) { int sub=arr[i]-k; int add=arr[i]+k; if(sub>=sm...
ALGO
0.999857
4.547575
2f9088d7-8559-4dda-bcff-a89eaac8bb50
Mohit-106/DSA_Level_2
Graph/3_RottenOranges.cpp
// class Pair { // public: // int x; // int y; // int t; // Pair(int x , int y, int t){ // this->x=x; // this->y=y; // this->t=t; // } // }; // class Solution { // public: // void AddNeighbour(int i, int j, int t, queue<Pair*>&q, vector<vector...
ALGO
0.999902
6.153874
906dc417-a584-4ade-8fee-af1bbe66348e
ApoorvaSunkad/LinkedList_Questions_CPP
doublyLL.cpp
//Creating a doubly linked list: #include<bits/stdc++.h> using namespace std; class Node{ public: int data; Node* prev; Node* next; Node(int d){ this->data = d; this->prev = nullptr; this->next = nullptr; } }; //Gives the length of doubly LL int getLength(Node* head)...
ALGO
0.99886
4.983978
aa0c0bae-3ccd-45c8-981a-39f2a1eac82c
ssk4988/Coding
UCFPT/240920/k.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using pi = pair<int, int>; using pl = pair<ll, ll>; using pd = pair<ld, ld>; using vi = vector<int>; using vl = vector<ll>; using vd = vector<ld>; using vpi = vector<pi>; using vpl = vector<pl>; using vpd = vector<pd>; using vv...
ALGO
0.999986
5.209239
c214c72a-9104-4d9e-8307-87b592c97907
kunal-1908/DSA
LINKED_LIST/DetectLoop.cpp
#include<iostream> #include<map> using namespace std; class node { public: int data; node* next; node(int data) { this->data = data; this->next = nullptr; } ~node() { int val = this -> data; if(next != NULL) { delete next; next = NULL; ...
ALGO
0.99982
5.255369
ef2dbc97-82f8-4b1f-86b9-e67f734482fa
mjustboring/Codes
Graph Adj Matrix (DAA).cpp
#include <iostream> #include <climits> #include <iomanip> #include <vector> using namespace std; #define INF INT_MAX typedef vector<int> vi; typedef vector<vi> vvi; vvi adj; int V; void print() { for (auto &r : adj) { for (auto c : r) { if (c == INF) { cout << setw(4) <<...
ALGO
0.999811
4.577126
3739ccfd-cbd3-4cc5-a427-b0832f1ce5d9
dtnguyen22/OOP244SFF
WS7/SuperHero.cpp
#include <iostream> #include <cstring> #include "SuperHero.h" #include "Hero.h" using namespace std; namespace sict { SuperHero::SuperHero() { //auto call to base class constructor first, then derived this->m_def = 0; this->m_power = 0; } //same here //atk must be positive it means > 0 SuperHero::SuperHero...
TOOL
0.87728
4.413943
ac8860fd-fcf9-4fbf-8dd9-4cde40610815
4gote/pp1_labs
lab3_5.cpp
#include <iostream> using namespace std; int main() { int n; cin >> n; int arr[n]; for (int i = 0; i < n; i++) { cin >> arr[i]; } int aim; cin >> aim; for (int i = 0; i < n; i++) { if (arr[i] == aim) { cout << "Found at index " << i << endl; retu...
ALGO
0.999241
5.330641
d4dd64e7-ca42-4399-b968-3b9ee41f92f7
ckckck1373/LeetCode_cpp
Problem/April_30_Day_Chanllenge/April29_Binary_Tree_Maximum_Path_Sum.cpp
/* Date: 4/30 Binary tree */ /** * 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, TreeNo...
ALGO
0.999994
6.365691
fe716ae9-94b8-49bd-847f-838509d3e4ac
Ir0Nick/Coding-Ninjas
Time and Space Complexity Analysis/Find the Unique Element.cpp
#include <bits/stdc++.h> void merge(int arr[], int l, int m, int r) { int i, j, k; int n1 = m - l + 1; int n2 = r - m; /* create temp arrays */ int L[n1], R[n2]; /* Copy data to temp arrays L[] and R[] */ for (i = 0; i < n1; i++) L[i] = arr[l + i]; for (j = 0; j ...
ALGO
0.999923
4.805749
3efbd725-1c3b-4465-b630-94c46df2ea21
imdew1990/algotester
1503.cpp
#include <iostream> #include <string> using namespace std; int main() { int n, alarm; cin >> n >> alarm; int max = 0, min = 0; for (int i = 0; i < n; i++) { int temp, temp1; cin >> temp >> temp1; min += temp; max += temp1; } if (max >= alarm && min >= alarm) cout << "Certainly"; else if (max >= alarm && m...
ALGO
0.999517
3.727885
633e1120-e13f-4e4f-91f0-180bd1d5aff7
hojoJeong/Algorithm
2022/10.03/프로그래머스/이아름/삼각달팽이.cpp
#include <string> #include <vector> #include <iostream> using namespace std; int pac = 1; vector<vector<int>> board; int N; int dx[] = { 1,0,-1 }; int dy[] = { 0,1,-1 }; int draw(int x, int y, int cnt, int end) { int max_n = N - x - y-1; int xx = x, yy = y; if (max_n == 0) { board[x][y] = cnt++; return cnt; }...
ALGO
0.999564
3.750457
f85931b0-0e7a-4639-8223-74e565cd74eb
rahuldeshmukh43/MOOC
edX/IITB-CS_basics/Foundations_of_Data_Structures/Topic_4/Stack_linked_list.cpp
#include<iostream> #include "Stack_linked_list.h" using namespace std; //Node NODE::Node(char x):info(x),next(NULL),prev(NULL){} //Stack using array Stack::Stack():top(NULL){} bool Stack::IsEmpty(){ return (top==NULL); } bool Stack::Top(char &top_el){ if(top==NULL){return false;} top_el=top->info; return true; } b...
ALGO
0.93322
4.024945
8f8cac70-82e0-43af-b4b2-e6119a0b9a58
aizsfgk/leetcode-cn
editor/cn/[842]将数组拆分成斐波那契序列.cpp
//给定一个数字字符串 num,比如 "123456579",我们可以将它分成「斐波那契式」的序列 [123, 456, 579]。 // // 形式上,斐波那契式 序列是一个非负整数列表 f,且满足: // // // 0 <= f[i] < 2³¹ ,(也就是说,每个整数都符合 32 位 有符号整数类型) // f.length >= 3 // 对于所有的0 <= i < f.length - 2,都有 f[i] + f[i + 1] = f[i + 2] // // // 另外,请注意,将字符串拆分成小块时,每个块的数字一定不要以零开头,除非这个块是数字 0 本身。 // // 返回从 num 拆分出来的任意一...
ALGO
0.999985
6.566461
9f2cc15a-e814-4eeb-a834-e216e30e09b0
DivyanshuPandey1702/DSA_CP
CF_1324E.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> vi; typedef pair<int, int> pi; typedef set<int, greater<int>> si; #define ln "\n" #define F first #define S second #define PB push_back #define MP make_pair #define mod 1e9 + 7 #define f(a, c) for (int a = 0; a < c; a++) vector<v...
ALGO
0.999881
3.440319
3828af8a-db6e-4477-9f79-29e15b3b615b
seo-bo/ProblemSolving
Atcoder/ABC399/a.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main(void) { cin.tie(0)->sync_with_stdio(0); int n = 0, ans = 0; cin >> n; string a, b; cin >> a >> b; for (int i = 0; i < n; ++i) { if (a[i] != b[i]) { ans++; } } cout << ans; return 0; }
ALGO
0.999939
3.682
fb099ad7-4d82-4ac4-8921-c3613adfd930
ishandutta2007/codeforces
tzc___wk/normal/1016/C.cpp
#include <bits/stdc++.h> #define ll long long int #define inf 0x3f3f3f3f #define con 400000 using namespace std; int dis[3][2]={1,0,-1,0,0,1}; long long n; long long a[2][con],sum[con]; long long c[2][con]; ll val[2][con],xn[2][con]; bool vis[2][con]; bool is(int x,int y){ return x>=0&&x<2&&y>=0&&y<n; } void dfs(in...
ALGO
0.99999
3.11157
f652be66-d799-4ccd-80de-8de2434ddd3a
Eradax/cp-solutions
judge.progolymp/subsetsum/subsetsum4/subsetsum4.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define int ll const int inf = (int)1e18; typedef vector<int> vi; typedef vector<vi> vvi; typedef pair<int, int> p2; #define rep(i, high) for (int i = 0; i < high; i++) #define repp(i, low, high) for (int i = low; i < high; i++) #define repe(i, con...
ALGO
0.999972
4.941092
abc49fc1-b968-4903-b400-a99efe6c676e
mberaha/abc_partition
run_ts.cpp
#include "src/kernels.hpp" #include "src/distance.hpp" #include "src/abc_py_class.hpp" #include "src/time_series.hpp" #include <iostream> struct ts_param { double mu_mean; double mu_sd; double beta_mean; double beta_sd; double xi_rate; double omega_rate; double lambda_rate; }; std::vector<...
ALGO
0.985418
6.720567
f54eb353-c736-4285-bc49-abef228d9351
hardeek-sharma/Learncpp
quizAnswers/chapter8/lesson6/main.cpp
/* Question #1 Write a function called calculate() that takes two integers and a char representing one of the following mathematical operations: +, -, *, /, or % (remainder). Use a switch statement to perform the appropriate mathematical operation on the integers, and return the result. If an invalid operator is passe...
ALGO
0.995796
6.09703
6a16bb56-7aeb-45a1-b361-79764af54a49
hemanggs/Comptetitive-Programming
BLACK BOX/Anand Oza ( best for black box)/algo-lib-master/data_structures/union_find.cpp
#include <vector> #include <numeric> #include <iostream> struct union_find { struct node { int parent_or_size; node () : parent_or_size(-1) {} }; mutable std::vector<node> data; union_find(int SZ = 0) : data(SZ) {} // Returns the root of the component containing i int find(in...
ALGO
0.960105
4.411274
962b19a2-ee20-445b-a5f1-747f944c38a8
timprepscius/mailiverse
cpp/Lib/xcode-botan/Botan-1.10.3/src/constructs/srp6/srp6.cpp
#include <botan/srp6.h> #include <botan/dl_group.h> #include <botan/libstate.h> #include <botan/numthry.h> #include <memory> namespace Botan { namespace { BigInt hash_seq(const std::string& hash_id, size_t pad_to, const BigInt& in1, const BigInt& in2) { std::auto...
ALGO
0.960892
7.328193
d5bf752a-eeee-4f79-a529-4068819e64a7
DraSoGo/Competitive_Programming
Interactive/Problems/fibonacci/src/fibonacci.cpp
#include "fibonacci.h" #include <vector> using namespace std; int fibonacci(int n) { int dp[n]; dp[0] = 1; dp[1] = 1; for (int i = 2; i < n; i++) { dp[i] = dp[i-1]+dp[i-2]; } return dp[n-1] ; }
ALGO
0.999692
5.066987
75d56ba6-c11a-4923-8ea5-604601e1717b
mereuflaviu/PA-Proiectarea-Algoritmilor
MereuIoanFlaviu_Tema1/colorare.cpp
#include <iostream> #include <fstream> const int MOD = 1e9 + 7; // funcție pentru efectuarea ridicării la putere long long powMod(long long base, long long exp) { long long result = 1; base %= MOD; // baza se află în intervalul modulo while (exp > 0) { if (exp & 1) { // verific dacă exp este im...
ALGO
0.999665
5.143576
295d25ff-2fa1-485f-a183-62ff2ed13d28
MSHP-Community/BinToDec
main.cpp
#include <fstream> #include <string> using namespace std; int main() { ifstream f("input.txt"); ofstream d("output.txt"); string s; unsigned num = 0; while (!f.eof()) { f >> s; for (size_t i = 0; i < s.length(); i++) num = num * 2 + s[i] - 48; d << num << " "; ...
ALGO
0.998245
4.25105
c58a6081-8a29-455d-996f-adf77c825f1f
codehappy-net/libcodehappy
examples/randbmp.cpp
#define CODEHAPPY_NATIVE #include <libcodehappy.h> /* Increasing direction, columns not inverted. */ static void comet1(SBitmap* bmp) { const int x = bmp->width(); const int y = bmp->height(); bmp->put_pixel(0, 0, RandColor()); for (int e = 1; e < (x - 1) + y; ++e) { for (int row = 0; row < y; ++row) { RGBCol...
ALGO
0.995032
6.138931
8c03deab-6b3c-4f0c-9694-af72d9136630
nirvana369/UVA-problem-solved
487.cpp
/* Hoang Linh */ #include <cstdlib> #include <stdio.h> #include <string.h> #include <math.h> #include <map> #include <queue> #include <iostream> #define fi "487.inp" #define fo "487.out" /**/ using namespace std; /**/ struct toado{ int x,y; ...
ALGO
0.99972
3.65379
1bd4419b-aa27-4a17-898b-7b24c21a945d
pavellevap/code_antiplagiat
final_test/10/u34821_420_B_6444851.cpp
#include <iostream> #include <iomanip> #include <fstream> #include <map> #include <vector> #include <list> #include <set> #include <queue> #include <deque> #include <algorithm> #include <bitset> #include <cstring> #include <cstdio> #include <cstdlib> #include <cctype> #include <cmath> #include <climits> #include <ctime...
ALGO
0.999912
3.106792
47153f6c-e62b-45da-bccb-bcd6bfbbaa89
aceyan/UE4.18.3_release
Engine/Source/ThirdParty/PhysX/PhysX_3.4/Source/PhysXExtensions/src/ExtRevoluteJointSolverPrep.cpp
#include "ExtRevoluteJoint.h" #include "PsUtilities.h" #include "ExtConstraintHelper.h" #include "CmRenderOutput.h" #include "PsMathUtils.h" namespace physx { namespace Ext { PxU32 RevoluteJointSolverPrep(Px1DConstraint* constraints, PxVec3& body0WorldOffset, PxU32 /*maxConstraints*/, PxConstraintInvMassScale &...
TOOL
0.933424
6.963236
60d4f546-8db5-4384-8706-7c0387ccb0c1
SoufianeOuani/Labs.Cpp
Problem_Solving_Level_2/Problem#33.cpp
#include <iostream> #include <cstdlib> using namespace std; enum enCharacterType { SmallLetters = 1, CapitalLetter = 2, SpecialChar = 3, Digits = 4 }; int ReadPositiveNumbers(string Message) { //This function is to read positive numbers only. int Number = 0; do { cout << Message << endl; cin >> Number; } w...
TOOL
0.961129
4.239091
340dae7d-3baa-4904-911c-29bdadd95abd
Kari937/laba7
5/5.cpp
using namespace std; #include <iostream> #include <ctime> int main() { setlocale(LC_ALL, "Russian"); const int n = 5, m = 5; srand(time(NULL)); int a[n][m]; for (int i = 0; i < n; ++i) { for (int j = 0; j < m; ++j) { a[i][j] = rand() % 5; cout.width(3); cout << a[i][j] << " "; } cout << endl; }...
ALGO
0.999596
4.103566
bb0d2f13-8b56-4475-b9c6-296c382ea83b
Dojeto/Data-Structure-And-Algorithm
leetcode/ReverseString.cpp
class Solution { public: void reverseString(vector<char>& s) { int j = s.size() - 1; for(int i=0;i<s.size()/2;i++) { swap(s[j--],s[i]); } } };
ALGO
0.999462
5.986617
9813d2fa-8357-4167-bc71-95010d2d82ad
jigsaw5071/algorithms
dynammic_programming/boolean_parenthesization.cpp
/* -By Shubham Sharma : 25-06-2016 -reference:boolean parenthsization */ /* The time complexity of this algortihm is O(n*n*n) Space complexity : o(n*n) It uses same grounds as matrix chain multiplication */ #include<bits/stdc++.h> using namespace std; /* utiltiy function for matrix chain multiplication using simila...
ALGO
0.999949
4.778643
ad94272c-b9ed-4e83-94f5-f7f45d8c63e3
chuck8868/QuantLibQt
ql/models/marketmodels/models/abcdvol.cpp
/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ #include <ql/models/marketmodels/models/abcdvol.hpp> #include <ql/models/marketmodels/piecewiseconstantcorrelation.hpp> #include <ql/termstructures/volatility/abcd.hpp> #include <ql/math/matrixutilities/pseudosqrt.hpp> namespace QuantLib ...
ALGO
0.976337
7.304923