uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
f7ce8ecf-2b50-4519-9975-86db8868d5ef
MelihEkinci/Optical-Flow-Horn-Schunck
eigen-3.4.0/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_visitors.cpp
#include <iostream> #include <Eigen/Dense> using namespace std; using namespace Eigen; int main() { Eigen::MatrixXf m(2,2); m << 1, 2, 3, 4; //get location of maximum MatrixXf::Index maxRow, maxCol; float max = m.maxCoeff(&maxRow, &maxCol); //get location of minimum MatrixXf::Index minRow, m...
ALGO
0.999613
4.010038
4bc66d5c-4a4d-45da-8469-5c0d72297672
Slashz07/Alpha-Intern-Mentorship-Worksheets
c++/9th worksheet/mixedPattern.cpp
// Print the following pattern // Input: n = 5 // Output: // 1 // A B // 1 2 3 // A B C D // 1 2 3 4 5 #include<iostream> using namespace std; int main(){ int len; cout << "enter the length of mixed pyramid :"; cin >> len; for (int i = 1; i <= len;i++){ char ch = 'A'; for (int j = 1; j <= i;j++){ ...
ALGO
0.997425
3.893714
57e735bf-cdcf-4662-8be1-86ce400961fd
nishgpt/competitive_programming
codeforces/636_div3/B.cpp
/* Author : Nishant Gupta 2.0 */ #include<bits/stdc++.h> #define LL long long int #define pb push_back #define mp make_pair #define MAX 100005 #define MOD 1000000007 using namespace std; int main() { int t, i; int n; cin>>t; while(t--) { cin>>n; if((n/2) & 1) { cout<<"NO"<<endl; continue; } ...
ALGO
0.999635
4.018621
e39d21e4-6079-4c75-9f8b-0405b4a5fdd6
MikolajMys/cppAlgorithmsTasks
Co Na Obiad/Implementacja.cpp
#include <iostream> #include <algorithm> using namespace std; int compare(int a, int b){ if(a > b) return 1; return 0; } void print(int* arr, int size){ // cout << "Unsorted: "; // for (int i = 0; i < size; ++i) { // cout << arr[i] << " "; // } // cout << '\n'; // sort(arr, arr + size,...
ALGO
0.999596
4.221364
aa360340-1e72-4c27-90a0-1182f4d78654
joydeb1729/codeforces
cf1593D1.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define sp " " #define nl '\n' #define psp cout << " " #define pnl cout << '\n' #define imax INT_MAX #define imin INT_MIN #define pb push_back #define ppb pop_back #define pf push_front #define yes cout << "...
ALGO
0.999874
4.31669
854bcae2-4ca1-4e8a-a48b-a022245cf94f
chenyufeng1991/STL_list
STL_list/main.cpp
#include <iostream> #include <list> using namespace std; /** * list是一个双向链表,不能进行随机访问 * */ void PrintList(list<int> pList); int main(int argc, const char * argv[]) { list<int> list1; // 创建一个空的list list<int> list2(list1); // 复制另一个同类型元素的list list<int> list3(10); // 创建n个元素的list,每个元素值由默认构造函数确定 list<in...
ALGO
0.970503
4.036651
0755afc6-bbca-473e-bc85-29af9e6d01e5
cornliu26/LeetCode_800_CPP
801+/1255. Maximum Score Words Formed by Letters/dfs.cpp
#include <iostream> #include <vector> using namespace std; class Solution { private: int ret{0}; int wSize; vector<int> wScore; vector<vector<int>> wCount; public: int maxScoreWords(vector<string> &words, vector<char> &letters, vector<int> &score) { vector<int> count(26); wScore = ...
ALGO
0.99961
5.670009
e799cf44-a1ac-4ea2-972c-3e8c41b99adf
syne77/morning-coding
leetcode/2medium/이경호/3376.cpp
class Solution { public: int findMinimumTime(vector<int>& strengths, int k) { int ans = 10000000; sort(strengths.begin(), strengths.end()); do { int t = 0; int x = 1; for (int strength : strengths) { t += strength / x; if (strength % x) { t++; } ...
ALGO
0.999972
5.59441
47cb8f53-9585-49c9-a935-0b82bee4777c
Apress/learn-cocos2d-game-dev-w-ios-5
CH04_code/DoodleDrop08_Final/libs/Box2d/Dynamics/b2WorldCallbacks.cpp
#include <Box2D/Dynamics/b2WorldCallbacks.h> #include <Box2D/Dynamics/b2Fixture.h> // Return true if contact calculations should be performed between these two shapes. // If you implement your own collision filter you may want to build from this implementation. bool b2ContactFilter::ShouldCollide(b2Fixture* fixtureA, ...
TOOL
0.935945
7.063659
90503b66-2a6c-478d-a42a-6312aad76bc2
StephanBischoff-Digle/adventofcode
2023/01/a/main.cpp
#include <algorithm> #include <cstdint> #include <fstream> #include <iostream> #include <span> #include <string> using u32 = uint32_t; int main(int argc, char *argv[]) { auto args = std::span(argv, size_t(argc)); // Read file if (argc == 1) { std::cout << "Requires input file\n"; return 0; } std::...
ALGO
0.929311
6.528808
874b8fbc-3d45-423b-ba61-0c7f23e9d64a
SMiles02/CompetitiveProgramming
Templates/Data Structures/Reachability Tree/reachability_tree.cpp
struct reachability_tree { int n, lg, t, timer; vector<int> dsu, tin, tout, time_of_creation; vector<bool> done; vector<vector<int>> e, up; reachability_tree(int n) : n(n), lg((int)log2(n * 2 + 1) + 2), t(n + 1), timer(0), dsu(n * 2 + 1), tin(n * 2 + 1), tout(n * 2 + 1), time_of_creation(n * 2 + 1),...
ALGO
0.999496
4.473615
7f01c194-d8ff-434c-9b53-693fd0ff3e7c
tranngocduy/react-native
third-party/folly-2016.09.26.00/folly/Benchmark.cpp
// @author Andrei Alexandrescu (<EMAIL>) #include <folly/Benchmark.h> #include <folly/Foreach.h> #include <folly/json.h> #include <folly/String.h> #include <algorithm> #include <boost/regex.hpp> #include <cmath> #include <iostream> #include <limits> #include <utility> #include <vector> #include <cstring> using names...
TOOL
0.883868
7.661056
1fe73082-b2bb-4796-b08a-caad9b6415ff
inferno-mack/Leetcode-Questions
1753-maximum-score-from-removing-stones/1753-maximum-score-from-removing-stones.cpp
class Solution { public: int maximumScore(int a, int b, int c) { vector<int> temp; temp.push_back(a); temp.push_back(b); temp.push_back(c); sort(temp.begin(), temp.end()); if((temp[0]+temp[1]<temp[2])){ return (temp[0]+temp[1]); } ...
ALGO
0.999967
5.608508
17f6db16-345f-400b-a87d-80febe1f1e6a
qwers451/mlita_coloc
src/HypotheticalSyllogism.cpp
#include "HypotheticalSyllogism.h" bool HypotheticalSyllogism::IsImplication(const std::shared_ptr<Node>& node) { return node && node->type == NodeType::OPERATOR && node->value == ">"; } bool HypotheticalSyllogism::Apply(const std::shared_ptr<Node>& implication1, const std::shared_ptr<Node>& implication2, std::sh...
ALGO
0.999092
5.524848
38589e43-0c36-45ff-a8f5-ec0c4afac6bf
kritikarag/DSA-Prep
Graph/last_day_to_cross.cpp
// https://leetcode.com/problems/last-day-where-you-can-still-cross/description/ int latestDayToCross(int row, int col, vector<vector<int>> &cells) { int low = 1, high = cells.size(), ans = 0; while (low <= high) { int mid = low + (high - low) / 2; if (solve(row, col, mid, cells)) ...
ALGO
0.999934
6.516386
8291865c-8a75-45a0-92ed-a31b6b68053d
babli555s/test-gfg
Difficulty: Easy/Kth largest element in BST/kth-largest-element-in-bst.cpp
//{ Driver Code Starts #include <bits/stdc++.h> using namespace std; // Tree Node struct Node { int data; Node* left; Node* right; Node(int val) { data = val; left = right = NULL; } }; // Function to Build Tree Node* buildTree(string str) { // Corner Case if (str.length() ...
ALGO
0.99975
6.334737
4dc6b845-835c-44c3-b962-b88530384912
ankitverma-123-code/CPP-Data-Structures-Algorithms-Launchpad-master
08. Recursion/3. Quick Thinking/stringToInt/string to integer recursion.cpp
#include<bits/stdc++.h> using namespace std; int stringToInt(char a[], int n){ // Base Case if(n<0) return 0; int digit = a[n]-'0'; return (stringToInt(a, n-1)*10)+digit; } int main(){ char a[]="1234"; int n = strlen(a); int ans = stringToInt(a, n-1); cout<<ans; }
ALGO
0.998142
3.627096
411fe661-2bfd-4254-b739-4fa814768d85
ishandutta2007/codeforces
kuribohg/normal/548/B.cpp
#include<iostream> #include<cstdio> #include<algorithm> #include<cstring> using namespace std; int n,m,Q,a[510][510],ans[510]; void getans(int x) { int cur=0; ans[x]=0; for(int i=1;i<=m;i++) { if(a[x][i]) cur++; else cur=0; ans[x]=max(ans[x],cur); } } int main() { scanf("...
ALGO
0.999915
4.371267
a1b9f390-a6ae-4cd6-a07b-ab49f893fb0f
UAB-DCC/sessio1-evalveny
Problemes/Tema_0/Ex17/exe01_2-17.cpp
/* Test set: 1 ### 2 ### 4 ### */ #include <iostream> using namespace std; const int N = 4; void inicialitzaMatriu(int taula[N][N], int X) { int i, j; for(i = 0; i < N; i++) { for(j = 0; j < N; j++) { taula[i][j] = i * j * X; } } } int main() { int taula[N][N]; int i, j, X; cin >> X; inicialitzaM...
ALGO
0.997327
3.931864
31d87cad-3c87-495c-a82c-920b20bdafb3
Kartavyashishangiya1409/DSA-WITH-CPP
Practice/Day-14/QnA-1/Q2.cpp
// Q.2 Largest Element in 2D Array // Develop a Program to find the largest element from a given 2D array #include <iostream> using namespace std; int main(){ int rowsize,colsize, MaxValue; cout << "Enter the number of rows --> "; cin >> rowsize; cout << "Enter the number of columns --> "; cin >...
ALGO
0.999005
4.587173
bfe19df7-9f66-404b-ae0e-c81bf3f851f1
Pizzars/prueba_pragma
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.998859
6.785645
d459c6b9-8a37-4d23-9238-0adce95739dd
prashanthgm/cppfiles
pointer2.cpp
#include<iostream> using namespace std; int main() { int number[5]={22,55,44,88,99}; cout<<*(number+3)<<endl; return 0; }
ALGO
0.997612
3.145384
2129ac38-495e-4fdf-bbd3-f026ad989642
showmic96/Online-Judge-Solution
Aizu/0009/7056260_AC_10ms_4060kB.cpp
#include<bits/stdc++.h> using namespace std; const int MAX = 1000000; bool prime[MAX+1]; void seive() { for(int i=1;i<MAX;i++)prime[i]=true; for(int i=2;i<=sqrt(MAX);i++){ for(int j=2;j*i<=MAX;j++){ if(prime[i]==true)prime[i*j]=false; } } prime[0]=false; prime[1]=fa...
ALGO
0.999625
3.883614
edce8b79-ee23-4e56-bdd3-242f840ac014
Charbel-11/Competitive-Programming
Contests/AtCoder/Beginner 203/E.cpp
#include <iostream> #include <unordered_set> #include <vector> #include <algorithm> using namespace std; typedef long long ll; int main() { ios::sync_with_stdio(0); cin.tie(0), cout.tie(0); int n, m; cin >> n >> m; vector<pair<int, int>> blackP(m); for (auto& p : blackP) { cin >> p.first >> p.se...
ALGO
0.999978
3.996813
b1000628-c56a-4958-8a8a-a9401f535ad0
fahadahmedocean/srbd
algo/dp/longest path/aa.cpp
//directed longest path uva 10000 #include <stdio.h> #define maxx 101 int main() { int n, src, Case = 0, x, y, i, j; while(scanf("%d", &n) == 1 && n) { scanf("%d", &src); int mat[maxx][maxx] ;//= { // 1, 0, 0, 0, // 1, 1, 1, 0, // 1, 0, 1, 0, // ...
ALGO
0.999561
3.500635
1e8e4714-9ef9-42be-aaca-921921b0c6d4
AlienShiva/Online-Judge-Solutions
CodeChef/MEDIAN.cpp
#include <iostream> #include <cstdio> #include <algorithm> #include <cstring> using namespace std; int n,min_cnt; int arr[40]; bool pending() { for(int i=0; i<n; i++) if(arr[i]!=1) return true; return false; } void change(int l, int r) { for(int i=l; i<=r; i++) arr[i]=1; } v...
ALGO
0.999963
4.025702
de97b38b-7ae0-4c7d-a4c9-0016b3a1bef6
heisenberg8055/DSA
0234-palindrome-linked-list/0234-palindrome-linked-list.cpp
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode() : val(0), next(nullptr) {} * ListNode(int x) : val(x), next(nullptr) {} * ListNode(int x, ListNode *next) : val(x), next(next) {} * }; */ class Solution { public: bool isPalindrome(Lis...
ALGO
0.999863
5.907872
b31b9f4b-6911-4759-94ad-d3502310df81
PavithranChelliahpillai/competitiveprogrammingsols
coci12c3p3.cpp
#include <bits/stdc++.h> using namespace std; int a[32], b[300005]; void fastscan(int &number) { bool negative = false; register int c; number = 0; c = getchar(); if (c=='-') { negative = true; c = getchar(); } for (; (c>47 && c<58); c=getchar()) number = number...
ALGO
0.999082
3.100375
13991061-635b-4275-96fb-d1d54b62ef32
voe09/CPPPlayGround
2024/sort/3011.cpp
// bubble sort class Solution { public: bool canSortArray(vector<int>& nums) { unordered_map<int, int> cnts; for (int num : nums) {cnts[num] = countBits(num);} int n = nums.size(); for (int i = 1; i < n; i++) { for (int j = i; j >= 1; j--) { if (nums[j] >...
ALGO
0.999987
5.556636
ebafdef8-9254-459b-8519-88096f8ca4ec
NerdSeat/Data-Structures-And-Algorithms
Algorithms/Recursion/sortedArray.cpp
#include<vector> #include<iostream> //check if array is sorted in ascending order bool isSorted(std::vector<int>& vec) { if(vec.size()==0||vec.size()==1) return true; if(vec[0]>vec[1]) return false; vec.erase(vec.begin()); return isSorted(vec); } int main() { std::vector<int> data ...
ALGO
0.999627
5.474304
757f1ba5-5ee7-42ff-819b-4f1e1c5ae570
ishandutta2007/codeforces
damians/normal/274/B.cpp
#include <string> #include <vector> #include <algorithm> #include <cmath> #include <set> #include <queue> #include <map> #include <cstdio> #include <iomanip> #include <sstream> #include <iostream> #include <cstring> #define REP(i,x,v)for(int i=x;i<=v;i++) #define REPD(i,x,v)for(int i=x;i>=v;i--) #define FOR(i,v)for(int...
ALGO
0.999931
3.563753
4c7b8f2d-44c5-4aa9-93aa-c4bf683c7680
itzRaghav14/competitive-programming
templates/algorithms/arrays/lis.cpp
// Untested. // lis[0] < lis[1] < lis[2] ... int getLIS(vector<int> &arr) { vector<int> lis; for (int i = 0; i < n; i++) { int idx = lower_bound(arr.begin(), arr.end(), arr[i]) - arr.begin(); if (idx == lis.size()) lis.push_back(arr[i]); else lis[idx] = arr[i]; } return lis.size(); }
ALGO
0.999847
5.943611
8759d3d0-f5d3-490f-abce-3357483bccd5
AnhDuy207/PositionYaw_PlanningEwok_LandingMarker
mav_trajectory_generation/mav_trajectory_generation/src/rpoly/rpoly_ak1.cpp
// rpoly_ak1.cpp - Program for calculating the roots of a polynomial of real // coefficients. // Written in Microsoft Visual Studio Express 2013 for Windows Desktop // 27 May 2014 // // The sub-routines listed below are translations of the FORTRAN routines // included in RPOLY.FOR, // posted off the NETLIB site as TOMS...
ALGO
0.999874
4.825198
0680d2d1-c82a-4907-8149-1115fb57c6bd
grazierShahid/Leetcode
0144-binary-tree-preorder-traversal/0144-binary-tree-preorder-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.999949
6.176742
65bcf306-7d86-403a-b2bb-507dc2e2f883
bendavid/firmware-mod-kit
src/others/squashfs-4.0-lzma/lzma/CPP/7zip/UI/Common/UpdatePair.cpp
// UpdatePair.cpp #include "StdAfx.h" #include <time.h> #include "Common/Defs.h" #include "Common/Wildcard.h" #include "Windows/Time.h" #include "UpdatePair.h" #include "SortUtils.h" using namespace NWindows; using namespace NTime; static int MyCompareTime(NFileTimeType::EEnum fileTimeType, const FILETIME &time1,...
TOOL
0.900679
6.342033
0feb93eb-a9e2-4f75-9bf6-886318f89a0c
harshdeep91/Leetcode
1006-clumsy-factorial/1006-clumsy-factorial.cpp
class Solution { public: int clumsy(int n) { if(n<=2) return n==2?2:1; int val=(n*(n-1))/(n-2)+n-3; n-=4; //apply 4 operations directly while(n>3) { val= val-((n*(n-1))/(n-2))+n-3; n-=4; } val-= (n==3?6:n==2?2:n==1?1:0); r...
ALGO
0.999986
5.185113
a5c108f5-dfaa-4e96-8900-fa0ddebe248f
rheiland/pcecmstudio
src_orig/BioFVM/BioFVM_utilities.cpp
#include "BioFVM.h" #include "BioFVM_utilities.h" namespace BioFVM{ /* std::string BioFVM_Version; std::string BioFVM_URL; */ std::chrono::steady_clock::time_point tic_time; std::chrono::steady_clock::time_point toc_time; std::chrono::steady_clock::time_point program_tic_time; std::chrono::steady_clock::time_poi...
ALGO
0.990689
3.760306
e5cff7bb-e9cf-431d-badc-dc9bb3b8410b
prince2520/Data-Structure-and-Algorithm
Graph Algorithms/floyd_warshall.cpp
#include <iostream> #include <vector> using namespace std; #define INT_MAX 10000 vector <vector <int>> floyd_warshall(vector<vector<int>> graph){ vector<vector<int>> dists(graph); int n = dists.size(); for(int k=0; k<n; k++){ for(int i=0; i<n; i++){ for(int j=0; j<n; j++){ if(dists[i][j] > dists[i][k...
ALGO
0.999752
3.753524
b00b0533-2f77-4582-ad08-ba7bec0c2ec1
Kamrul-Hasan-1971/LightOJ
1010 - Knights in Chessboard.cpp
#include<bits/stdc++.h> using namespace std; #define ll long long int #define pii pair<int,int> #define output freopen("output.txt","wt", stdout) int main() { int a,i,sm,b,c,d,baki,e,f; cin>>a; for(i=0;i<a;i++){ cin>>b>>c; if(b==1 || c==1) { sm=max(b,c); } e...
ALGO
0.999521
3.944946
307c255d-d2dd-477d-9fe6-c3367b6da3a0
LDlornd/OI-Memory
洛谷/P2000~P2999/P2200~P2299/P2280 [HNOI2003]激光炸弹/P2280 [HNOI2003]激光炸弹.cpp
#include<cstdio> #include<iostream> using namespace std; const int MAXN=5001; int n,R,x,y,w; int maxx=0,maxy=0,ans=0; int dp[MAXN][MAXN]; inline int getsum(int zsx,int zsy,int yxx,int yxy){ if(zsx==0&&zsy==0) return dp[yxx][yxy]; if(zsx==0&&zsy!=0) return dp[yxx][yxy]-dp[yxx][zsy-1]; if(zsx!=0&&zsy==0) return dp[yxx...
ALGO
0.998852
3.41979
75cf0d50-dd59-4ee9-9473-fd0f4ecb8286
alpaka-group/cupla
alpaka/thirdParty/catch2/tests/SelfTest/IntrospectiveTests/CmdLine.tests.cpp
#include <catch2/catch_config.hpp> #include <catch2/catch_approx.hpp> #include <catch2/catch_test_macros.hpp> #include <catch2/matchers/catch_matchers_string.hpp> #include <catch2/internal/catch_test_spec_parser.hpp> #include <catch2/catch_user_config.hpp> #include <catch2/catch_test_case_info.hpp> #include <catch2/int...
TEST
0.897162
7.76269
9193224b-0ac7-489d-863a-40bd5d96ecbf
geekquad/AlgoBook
cpp/backtracking/m_Coloring_problem.cpp
#include <bits/stdc++.h> using namespace std; //function to print the solution void print_solution(int color[], int v){ cout << "Solution exists."<<endl; for(int i=0; i<v; i++){ cout << color[i]<< " "; } } //function to check whether the next node is safe to color or not bool is_safe(int k, int **...
ALGO
0.999861
5.788237
59fab2e4-bb58-4da1-b3ed-4cc8f6d0c032
klishtshashank/Programming-Problems
67-add-binary/67-add-binary.cpp
class Solution { public: string addBinary(string a, string b) { string res; int i = a.length() - 1; int j = b.length() - 1; int carry = 0; while(i >= 0 || j >= 0){ int sum = carry; if(i >= 0) sum += a[i--] - '0'; if(j >= 0) sum += b[j--]...
ALGO
0.999988
6.503869
1e76b63e-cbea-4304-b170-74487676a66c
shwetanknaveen/OnlineCoding
Leetcode/Contests/Randoms/Weekly 180/Balance a Binary Search Tree.cpp
//Problem link - https://leetcode.com/problems/balance-a-binary-search-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(n...
ALGO
0.999961
6.458603
f35c975a-d2cb-43ae-a7d8-a4a4950ca9eb
Noodle3D/ZCookie
algorithm/USACO/USACO Section 1.2 Dual Palindromes.cpp
/* ID: cyberzh1 LANG: C++ TASK: dualpal */ #include<stdio.h> #include<string.h> bool judge(char s[]) { int i=0,j=strlen(s)-1; while(i<j) { if(s[i++]!=s[j--]) { return false; } } return true; } void Base(int x, int base, char res[]) { int len=0; while(x>0...
ALGO
0.999634
3.168385
ea26eac8-6213-444a-8e23-cd20c8b8342f
ishandutta2007/codeforces
eric_hooo/normal/1648/E.cpp
#include <bits/stdc++.h> #define fi first #define se second #define mp make_pair using namespace std; typedef pair <int, int> pii; typedef pair <int, pii> pip; int n, m; vector <pip> edge; vector <int> G[200010]; struct KKK { vector <int> G[400010]; int val[400010], N; int fa[200010], rt[200010]; int dfn[200010]...
ALGO
0.999997
4.708429
83c840c1-311f-4b6d-a319-c61d68ffce03
ei1333/library
test/verify/aoj-1508.test.cpp
// competitive-verifier: PROBLEM http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=1508 #include "../../template/template.hpp" #include "../../structure/bbst/randomized-binary-search-tree.hpp" int main() { int N, Q; cin >> N >> Q; vector< int > A(N); for(auto &a : A) cin >> a; auto f = [](int a, int...
ALGO
0.999853
5.289776
1ac26ed9-9cb2-4c75-b192-8d3bf77c0e8a
tor4z/Introduction-to-algorithms
II/8-counting-sort/main.cpp
#include <iostream> #define MAXKEY 100 using namespace std; void counting_sort(int *A, int *B, int *tmp, int n) { for (size_t i = 0; i < n; i++) { tmp[A[i]]++; } int sum = 0; for (size_t i = 0; i < MAXKEY; i++) { sum += tmp[i]; tmp[i] = sum; } for (size_t i = ...
ALGO
0.999942
4.569365
ce4cc1a5-b6b7-4af8-afe0-3a24ae81de85
SuhelPathan17/CPP-Programming-Applications
Problems_on_Recursion/Program375.cpp
#include<iostream> using namespace std; int SumR(int *str, int iSize) { static int iCnt = 0; static int iSum = 0; if(iCnt < iSize) { iSum = iSum + str[iCnt]; iCnt++; SumR(str,iSize); } return iSum; } int main() { int iRet = 0; int Brr[5] = {10,20,30,40,50}; ...
ALGO
0.997246
4.127385
28f1da8b-940d-43d7-80ad-0b5363e2edac
vbonnici/grafe-sim
analysis/data/p00000/s124300560.cpp
#include <stdio.h> int main(void){ for(int i=1;i<10;i++){ for(int j=1;j<10;j++){ printf("%dx%d=%d\n",i,j,i*j); } } }
ALGO
0.989383
3.742207
9a20b3bd-e080-4b84-9cc1-7412c7962160
EQMacEmu/Server
submodules/glm/test/gtx/gtx_simd_mat4.cpp
/////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// /// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) /// Permission is hereby granted, free of charge, to any person obtaining a copy /// of this software and associated documentatio...
TEST
0.981304
6.515547
a5d18090-edb7-45e0-988c-f6686db5e7b3
sarvex/leetcode-chicken
solution/0000-0099/0084.Largest Rectangle in Histogram/Solution.cpp
class Solution { public: int largestRectangleArea(vector<int>& heights) { int res = 0, n = heights.size(); stack<int> stk; vector<int> left(n, -1); vector<int> right(n, n); for (int i = 0; i < n; ++i) { while (!stk.empty() && heights[stk.top()] >= heights[i]) { ...
ALGO
0.999978
6.542861
1616182f-38d8-4325-ae6c-204235cf805b
Matixowski/tpprojekt4
PlanarQuadrotor/planar_quadrotor.cpp
#include <iostream> #include <random> #include "planar_quadrotor.h" PlanarQuadrotor::PlanarQuadrotor() { std::random_device r; std::default_random_engine generator(r()); std::normal_distribution<float> distribution(0.0, 1.0); auto gaussian = [&] (int) {return distribution(generator);}; z = Eigen:...
ALGO
0.968278
5.881807
47c1fedc-d52b-428a-91c8-aeae12c6a4db
IronicResearch/mesa-dev
src/intel/compiler/brw_fs_saturate_propagation.cpp
#include "brw_fs.h" #include "brw_fs_live_variables.h" #include "brw_cfg.h" using namespace brw; /** @file brw_fs_saturate_propagation.cpp * * Implements a pass that propagates the SAT modifier from a MOV.SAT into the * instruction that produced the source of the MOV.SAT, thereby allowing the * MOV's src and dst ...
ALGO
0.965833
6.10764
1baebef0-5fd0-4157-87e8-bce548843052
ishandutta2007/codeforces
abdude824/normal/1342/A.cpp
#include<bits/stdc++.h> #include<algorithm> using namespace std; #define fi(n) for(int i=0;i<n;i++) #define fr(n) for(int i=n-1;i>=0;i--) #define vi vector<int> #define vs vector<string> #define int long long int #define all(a) (a).begin(),(a).end() #define pb push_back #define setbits(x) __builtin_popcountll(x) #def...
ALGO
0.999891
3.757799
2830f915-4dd7-453f-9553-fae2d59e6b28
stinkymonkey128/cpp-ICT
LA40/Main.cpp
#include <iostream> #include <fstream> #include <stack> using namespace std; struct treeNode { int id, inv; treeNode* left, * right; treeNode(int, int, treeNode*, treeNode*); }; treeNode::treeNode(int tempId, int tempInv, treeNode* tempLeft, treeNode* tempRight) : id(tempId), inv(tempInv), left(tempLeft), righ...
ALGO
0.996402
4.235188
94f5e613-a63a-490d-af66-6f515d727819
Venkat2552004/CSES-Problem-Solutions
Introductory/Two Sets.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long #define ul unsigned long #define ull unsigned long long #define mod 1000000007 #define takeInput(arr, n) for(int i = 0; i < n; i++) cin >> arr[i]; void solve(ull n, ull sum){ ll target = sum / 2; int cnt = 0; vector<bool> vis(n + 1); l...
ALGO
0.999923
3.702911
1a6817fc-f281-4769-bcf7-f390dd358d61
elpapz/CPP_modules
cpp08/ex00/main.cpp
#include "easyfind.hpp" #include <vector> # include <cstdlib> # include <exception> # include <iterator> # include <algorithm> int main(void) { int num[] = {1, 2, 37, 42, 53, 6, 7, 8, 95}; std::vector<int> v(num, num + sizeof(num) / sizeof(*num)); for (int i = 0; i < 11; i++) { std::vector<int>...
ALGO
0.97184
4.019342
c72de95e-03d3-4647-bee9-9feddf8ebbbe
Jin-0-2/2023_winter_C
240201_이진트리/240201_이진트리/24_map.cpp
//13_Ʈ̳.cpp /* STL : vector : 迭( ÷) list : ߿ḮƮ */ // : Member // : list<> : STL // : Control #include <iostream> #include <map> using namespace std; #include <conio.h> class Member { private: string name; string phone; public: Member(string _name, string _phone) : name(_name), phone(_phone) { } pu...
TOOL
0.969267
3.696195
3073c666-baad-4e84-b015-f4588698017d
AKun322/MINIOB1.00
src/observer/storage/common/condition_filter.cpp
// // Created by Wangyunlai on 2021/5/7. // #include "condition_filter.h" #include "common/log/log.h" #include "sql/parser/value.h" #include "storage/record/record_manager.h" #include "storage/table/table.h" #include <math.h> #include <stddef.h> using namespace common; ConditionFilter::~ConditionFilter() {} Default...
TOOL
0.885233
4.995427
e230a22a-379c-4c8c-9e9e-90f877d6f3d3
Reaganak40/AdventOfCode2024
src/day14.cpp
#include "pch.h" #include "utils.hpp" // #define TILE_WIDTH 101 // #define TILE_HEIGHT 103 #define TILE_WIDTH 101 #define TILE_HEIGHT 103 #define LINE_THRESHOLD 7 #define MINIMUM_LINES_FOR_TREE 5 struct Robot { // [x, y] int pos[2]; int dir[2]; }; #define NOT_IN_QUADRANT -1 uint64_t SimulateRobots(con...
ALGO
0.999589
5.463302
f2f99e72-fea9-4040-908d-ebf18053003b
VatsalNilay/CP_CPP
Cp_Cpp/fast_expo.cpp
#include <iostream> #define ll long long #define mod 1000000007 #define endl "\n" using namespace std; ll pow(ll a, ll b, int m) { ll res = 1; while (b > 0) { if (b & 1) res *= a % m; a *= a % m; b >>= 1; } return res; } int main() { #ifndef ONLINE_JUDGE freopen("input1.txt", "r", stdin); freopen("o...
ALGO
0.999935
5.45253
cd2fde23-d07a-463a-ac13-6f7b778a9dd2
ie-ProCon/ant_book
chapter2-4/fence_repair/atton/answer.cpp
/* Programming Contest Challange Book P.49, 75 * Fence Repair (POJ 3253) */ #include<iostream> #include<queue> int main(int argc, char const* argv[]) { int n; std::priority_queue<int, std::vector<int>, std::greater<int> > woods; std::cin >> n; for (int i = 0; i < n; i++) { int tmp; ...
ALGO
0.999951
4.606866
ee0baae3-3118-46f4-91b7-3a136e76d32c
sarvex/leetcode-java
solution/0200-0299/0284.Peeking Iterator/Solution.cpp
/* * Below is the interface for Iterator, which is already defined for you. * **DO NOT** modify the interface for Iterator. * * class Iterator { * struct Data; * Data* data; * public: * Iterator(const vector<int>& nums); * Iterator(const Iterator& iter); * * // Returns the next element in the itera...
ALGO
0.999651
6.382888
2eef7043-c2e0-46f1-8fe6-f998615f8b66
JacquesGomes/CompetitiveProgramming
stringreverse_and_swap.cpp
#include <bits/stdc++.h> #include <algorithm> using namespace std; string gerarPalindromo(char k) { if(k == 'a'){ return "a"; } string prefixo = k + (gerarPalindromo(k-1)) + k; return prefixo; } int main (){ cout << gerarPalindromo('d') << endl; return 0; }
ALGO
0.999444
3.648402
f63e5ca5-74fd-4458-97c4-6a7d52ee05d2
MarcLagoin1/GPU_Choquet_VideoForeground
src/utils.cpp
// // Created by pierre-louis.delcroix on 6/12/23. // #include "utils.h" int extractNumber(const std::string &str) { size_t startPos = str.find_first_of("0123456789"); size_t endPos = str.find_last_of("0123456789"); if (startPos != std::string::npos && endPos != std::string::npos) { return std::st...
TOOL
0.931321
5.574705
33f869ba-a829-4d1f-b3ce-2647cd964f61
Vaa3D/v3d_external
v3d_main/jba/newmat11/tmt3.cpp
/// \ingroup newmat ///@{ /// \file tmt3.cpp /// Part of matrix library test program. //#define WANT_STREAM #include "include.h" #include "newmat.h" #include "tmt.h" #ifdef use_namespace using namespace NEWMAT; #endif /**************************** test program ******************************/ void trymat3() { ...
TEST
0.991516
5.354404
934b81d5-0101-440c-8f38-6e6bdd29579e
GaijinEntertainment/DagorEngine
prog/3rdPartyLibs/phys/joltPhysics/Jolt/Physics/Constraints/PulleyConstraint.cpp
#include <Jolt/Jolt.h> #include <Jolt/Physics/Constraints/PulleyConstraint.h> #include <Jolt/Physics/Body/Body.h> #include <Jolt/ObjectStream/TypeDeclarations.h> #include <Jolt/Core/StreamIn.h> #include <Jolt/Core/StreamOut.h> #ifdef JPH_DEBUG_RENDERER #include <Jolt/Renderer/DebugRenderer.h> #endif // JPH_DEBUG_REND...
TOOL
0.884284
7.513893
2839ce71-f96d-4fc8-a93c-8818a3843691
tipu72/Learning
Prateek Beginner Course Code/Arrays/linear_search.cpp
#include <bits/stdc++.h> using namespace std; const int Mod = 1e9 + 7; const int N = 1e6 + 2; int idx[N]; // prefixsum approch int subArraySum(int arr[], int n) { int psarr[100] = {0}; psarr[0] = arr[0]; for (int i = 1; i < n; i++) { psarr[i] = psarr[i - 1] + psarr[i]; } int msum = 0;...
ALGO
0.999036
5.489166
bda937ba-2319-4370-9e50-780951405bb9
neerajhariyale/TCS-NQT-Coding-Practice
BeginnerLevelQuestion/GreatestOfTwoNumbers.cpp
//Find the Greatest of the Two Numbers #include<iostream> using namespace std; int main(){ int number1 , number2; cout << "Enter the number1 and number2 :" << endl; cin >> number1 >> number2 ; if(number1 == number2){ cout << "Both number are equal." << endl; } else if(number1 > numb...
ALGO
0.999298
3.760741
938a11b0-e026-45d1-b420-baaf63751f25
Lakshita2002/LeetCode-Problems-Summers-2021
leetcode problems/572. Subtree of Another Tree.cpp
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nullptr), right(nullptr) {} * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} * TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l...
ALGO
0.999911
6.20353
fef6efdb-1f77-4dc8-bf49-d4c7632faba6
anmarchenko/acm
Timus/T1162.cpp
#include <iostream> #include <string> #include <vector> #include <cmath> #include <queue> #include <stack> #include <algorithm> #include <map> #include <set> using namespace std; struct edge{ int dest; double rate, com; }; vector <vector <edge> > A; vector <double> dist; int st, n, m; double val; bool bellman_ford...
ALGO
0.999913
3.6373
09bc3935-4d4c-4c8a-a704-a061eebc6632
ron2015schmitt/coildes
oldsrc/findpertsurface.cpp
/************************************************************************* * * File Name : findpertsurface.cpp * Platform : gnu C++ compiler * Author : Ron Schmitt * Date : * * * SYNOPSIS * * This takes the differnece between the necessary fourier flux coef's * a...
ALGO
0.996685
3.467681
a8e301a0-9d11-4395-99af-62eff021e26c
Ahmed-Araby/Algorithms_and_Data_Structures
custom/customSortFun.cpp
/** custom sort function could be function pointer == reference to the function using its name function object which is a class with operator "()" overloaded as the custom sort function. */ #include <iostream> #include <algorithm> #define pii pair<int, int> using namespace std; bool comp(pii a, pii b) { if(a.seco...
ALGO
0.999976
4.777313
e32a6d6f-347b-4724-aef3-5b43ed97e140
amarjeet-kumar-shah/DSA_code
21-30/023_03_printing_rowSum.cpp
//023_03 :- Printing row sum #include<iostream> using namespace std; void rowSum(int arr[][4],int i,int j){ for(int i = 0;i<3;i++){ int sum = 0; for(int j= 0;j<4;j++){ sum+= arr[i][j]; } cout<<"Sum of "<<i<<"th row is = "<<sum<<endl; } } int main(){ int arr[3][4]; //taki...
ALGO
0.999174
3.779891
5ad8b59e-e805-446d-9a26-b6c8e4f8bfa5
mostafaessayd/codeforces-solutions
1400/Mocha and Diana (Easy Version)/main.cpp
/** created by : cidi mohamed mostepha link : https://codeforces.com/contest/1559/problem/D1 rating : 1400 */ #include <bits/stdc++.h> using namespace std; using ll = long long; const ll N = 1e5; void answer() { int n , m1 , m2; cin >> n >> m1 >> m2; vector<int> MochasForest(n); vector<int> DianasFo...
ALGO
0.999853
4.639613
97653e1f-6183-4bdd-ae7a-a951bb1d215d
thebesttv/vul-llvm
libcxx/test/std/algorithms/alg.sorting/alg.sort/partial.sort/ranges_partial_sort.pass.cpp
// UNSUPPORTED: c++03, c++11, c++14, c++17 // <algorithm> // template<random_access_iterator I, sentinel_for<I> S, class Comp = ranges::less, // class Proj = identity> // requires sortable<I, Comp, Proj> // constexpr I // ranges::partial_sort(I first, I middle, S last, Comp comp = {}, Proj proj =...
TEST
0.996905
7.821988
e12d3f22-9c27-4b41-a788-982a9db7b6b5
MAHIN0093/problem-solving
A_Next_Round.cpp
#include <iostream> #include <vector> using namespace std; int main() { int a; int b; do { cin>>a>>b; } while ((a<1) or (b<1) or (a>50) or (b>50) or (b>a)); vector<int> numbers; int num; int count =0; for (int i = 0; i < a; i++) { cin>>num; numbers....
ALGO
0.999377
3.192667
e4cf7f49-6bc0-42ff-ae9c-0e934b81a11a
Bhavik0902/LeetCode-by-Bhavik
217-contains-duplicate/217-contains-duplicate.cpp
class Solution { public: bool containsDuplicate(vector<int>& nums) { sort(nums.begin(),nums.end()); bool ans=false; for(int i=1;i<nums.size();i++) { if(nums[i]==nums[i-1]) ans = true; } return ans; } };
ALGO
0.999965
5.581245
ec905081-d409-4d89-ad95-7f30061cff4d
Asif3359/Practice_problems
A_A_Gift_From_Orangutan.cpp
#include <bits/stdc++.h> using namespace std; int main() { int t; cin >> t; while (t--) { int n; cin >> n; vector<int> l(n); for (int i = 0; i < n; i++) { cin >> l[i]; } int max = *max_element(l.begin(), l.end()); int mini =...
ALGO
0.999959
4.075402
47b8ccea-07d6-431e-a571-389a13af2c6c
ishandutta2007/codeforces
leapfrog/normal/1363/C.cpp
// #include<bits/stdc++.h> using namespace std; template<typename T>inline void read(T &x) { x=0;char c=getchar(),f=0; for(;c<'0'||c>'9';c=getchar()) if(!(c^45)) f=1; for(;c>='0'&&c<='9';c=getchar()) x=(x<<1)+(x<<3)+(c^48); if(f) x=-x; } int T,n,X; int main() { for(read(T);T--;) { read(n),read(X);int deg=0;if(n...
ALGO
0.99942
3.716034
592c0e4a-1092-464d-9d6c-64d107979d42
smart-make/boost
libs/intrusive/example/doc_recursive.cpp
using namespace boost::intrusive; typedef list_base_hook<> BaseHook; //A recursive class class Recursive : public BaseHook { private: Recursive(const Recursive&); Recursive & operator=(const Recursive&); public: Recursive() : BaseHook(), children(){} list< Recursive, base_hook<BaseHook> > children;...
TOOL
0.934186
4.583359
9b9edf3b-d527-458a-a0b1-a2c0d3f3c08c
GlennOliva/Financial-Tracker-with-Chatbot-using-Chatgpt-API
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
47133ee5-20b5-432b-985d-e952467fc5a7
bindaldhara/DSA-Practice
2658-maximum-number-of-fish-in-a-grid/2658-maximum-number-of-fish-in-a-grid.cpp
class Solution { public: void dfs(vector<vector<int>>& mat ,int i,int j,int m,int n,int &c){ if(i>=m || j>=n || i<0 || j<0 || mat[i][j]==-1 || mat[i][j]==0) return ; c+=mat[i][j]; mat[i][j]=-1; dfs(mat,i+1,j,m,n,c); dfs(mat,i-1,j,m,n,c); dfs(mat,i,j+1,m,n,c); ...
ALGO
0.999984
5.803189
c3ee33f1-d530-4b35-817c-f407e1988976
anishjha025/SPOJ
PT07Z.cpp
#include <iostream> #include <cstdio> #include <cstdlib> #include <vector> #include <queue> using namespace std; vector<int> v[10005]; int dist[10005],visited[10005]; void bfs(int src) { visited[src]=1; queue<int> q; q.push(src); while(!q.empty()) { int u=q.front(); q.pop(); //cout<<"size="<<v[u].size()<<e...
ALGO
0.997926
4.059705
4b0f6712-b7b6-4c21-bf7b-005699f7649b
AlgoZenithNITC/LeetCode_POTD_Solutions_AlgoZenithNITCalicut
10-10-2023_Minimum_Number_of_operations_to_make_array_continuous.cpp
class Solution { public: int minOperations(vector<int>& nums){ int n = nums.size(), ans = n; set<int> s; for(int i : nums){ s.insert(i); } vector<int> unique_elements(s.begin(), s.end()); int size = unique_elements.size(); for(int start = 0; start ...
ALGO
0.999977
5.673809
d9c94d67-93d4-44ef-905b-af861a005512
Samsung/Vyond
chipyard-1.11.0/sims/firesim/platforms/f1/aws-fpga/SDAccel/examples/xilinx_2019.1/getting_started/cpu_to_fpga/03_burst_rw_c/src/host.cpp
/***** * Changes from Lab 2: To achieve pipeline II=1 on the reads from DDR to local buffers, a burst read/write happens from/to DDR to/from local memory. *****/ //OpenCL utility layer include #include "stdlib.h" #include "xcl2.hpp" #include <vector> #include <algorithm> //Max Array Size #define MAX_SIZE 64 //Array...
ALGO
0.995667
6.042938
69cfe025-424e-41b2-b7c1-8a847ec31d3d
turneja123/competitive-programming-library
Problem/Data Structures/Bit Inversions.cpp
//https://cses.fi/problemset/task/1188/ #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> using namespace std; using namespace __gnu_pbds; #define endl "\n" #define ll long long #define IOS ios_base::sync_with_stdio(false); cin.tie(nullptr); const int N = 5e5 + 5; const int INF = 1e6; int lazy[4 * N...
ALGO
0.999978
4.618455
86399dc4-5539-4b78-942f-353240661ea2
vuhuq25133/CodePTIT-DSA
CodePTIT - DSA/7. NGĂN XẾP/DSA07004 - ĐẾM SỐ DẤU NGOẶC ĐỔI CHIỀU.cpp
#include <bits/stdc++.h> using namespace std; #define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); #define test fast int T; cin >> T; cin.ignore(); while (T--) #define fu(i, a, b) for (int i = a; i <= b; i++) #define fd(i, b, a) for (int i = b; i >...
ALGO
0.999411
4.376767
a0d3f833-e983-4fec-b792-48bca4578949
ShawnBo77/CPP_Practice
11349_Symmetric_Matrix/main.cpp
#include <iostream> using namespace std; int main(){ int nc = 0, count = 0; cin >> nc; cin.ignore(); while(nc--){ count++; int N = 0, isSymmetric = 1, ec = 0; char temp; cin >> temp >> temp >> N; long long m[N][N] = {0}; for(int i = 0; i < N; i++){ for(int j = 0; j < N; j++){ cin >> m[i][j]; ...
ALGO
0.997428
4.554202
cb89b234-5928-41a0-b42f-b56cc21d18fc
apkharsh/recurrsion
removeConsequitiveElementsFromString.cpp
#include <bits/stdc++.h> using namespace std; string solve(string &s){ int n = s.length(); if(n<2) return s; if(s[n-1]==s[n-2]) { s.pop_back(); return solve(s); } else { char last = s[n-1]; s.pop_back(); // return solve(s.substr(0, n-1)) + last; retur...
ALGO
0.999856
3.492186
1c139dbc-3fe4-4d8f-87f1-825b36903c50
javagovindsharma/leetscode
solution/0600-0699/0654.Maximum Binary Tree/Solution3.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.999994
6.913941
49b256e4-b6d3-4ace-a64d-122963db5d57
Redleaf23477/ojcodes
codeforces/global11/B.cpp
// by redleaf23477 #include <bits/stdc++.h> // iostream macros #define endl '\n' #define var(x) "[" << #x << "=" << x << "]" // chrono macros #define chrono_now std::chrono::high_resolution_clock::now() #define chrono_duration(t1, t2) std::chrono::duration<double>(t2-t1).count() #define chrono_rand_seed chrono_now.tim...
ALGO
0.99998
3.789257
8b1b1686-ed44-49c4-97df-8fd8dea0b0bc
LeafOS-Devices/android_hardware_samsung_slsi-linaro_exynos
libvision/kernel/opencl/vx_meanstddev.cpp
/*! * \file * \brief The Mean and Standard Deviation Kernel * \author Erik Rainey <<EMAIL>> */ #include <VX/vx.h> #include <VX/vx_helper.h> #include <vxcl_kernel_module.h> static vx_status VX_CALLBACK vxMeanStdDevInputValidator(vx_node node, vx_uint32 index) { vx_status status = VX_ERROR_INVALID_PARAMETERS; ...
TOOL
0.958626
6.616352
1184f4d3-9e0c-4d8c-9a19-aaa6480d98e1
LukeZeller/icpc-practice
Pacific_Northwest_2014-9.2/Salary/salary_inequity.cpp
// lazy segment tree on flattened tree (add to subtree updates, max-min subtree queries) #include <iostream> #include <set> #include <algorithm> #include <vector> using namespace std; typedef long long ll; struct edge{int to;}; typedef vector<vector<edge>> graph; const int INF = 1231231234; struct node { int ...
ALGO
0.999548
4.309563
b1ae95b3-7dc6-4d25-b0c5-fb7bc21fadc7
ishandutta2007/codeforces-s
sexpert/normal/1107/E.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; ll memo[105][105][105], best[105], cost[105]; vector<int> seg = {0}; int n; ll dp(int i, int j, int off) { if(memo[i][j][off] != -1) return memo[i][j][off]; if(i == j) return memo[i][j][off] = best[seg[i] + off]; ll ans ...
ALGO
0.99993
3.762769
6e81f1b9-b5e0-4c61-878d-244ab1258f2c
KajalSalunkhe/themovieapp
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
dbb1123d-2711-4bf2-b262-92a9e58a6327
LineageExtended/android_frameworks_av
media/codecs/m4v_h263/dec/src/idct.cpp
/* ------------------------------------------------------------------------------ MODULE DESCRIPTION This file contains the functions that transform an 8r8 image block from dequantized DCT coefficients to spatial domain pirel values by calculating inverse discrete cosine transform (IDCT). ------------------------...
ALGO
0.999416
4.639013
a53a852b-f44b-4c28-bf25-73f602c9349d
Amonginin/AmongVDB
hnswlib_index.cpp
#include "hnswlib_index.h" #include "logger.h" #include <vector> #include <fstream> #include <iostream> /** * @brief 构造函数 * @param dim 向量维度 * @param maxElements 索引能容纳的最大向量数量 * @param metric 距离度量类型 * @param M 索引节点的最大近邻数,默认为16 * @param efConstruction 构建最大近邻时的最大候选邻居数,默认为200 * * 初始化HNSW索引,创建向量空间和索引结构。 * 目前仅支持L2距离...
ALGO
0.975472
6.12026
c0041d7e-892c-40c5-85d9-2d3049b743a8
ankikong/c-
src/hdu/3507.cpp
#include <bits/stdc++.h> #ifndef LOCAL #pragma GCC optimize(3) #endif using namespace std; typedef long long ll; const int maxn=5e5+10; int da[maxn]; int sum[maxn]; int dp[maxn]; int que[maxn]; int head, tot; int n, m; int _2(int a) { return a*a; } int cal(int i, int j) { return dp[j] + _2(sum[i] - sum[j]) + m;...
ALGO
0.999937
3.571248