uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
475d33f7-3e58-41a3-b544-69eed5f67a24 | abhi0a11/code-playground | phase 2/linked list/del.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin >> n;
int errorScore[n];
for (int i = 0; i < n; i++)
{
int v;
cin >> v;
errorScore[i] = v;
}
int compP = 4;
int compQ = 1;
priority_queue<pair<int,int>> pq;
for (int i = 0; i < n; i++)... | ALGO | 0.999953 | 3.575624 |
974da570-7377-468e-a06b-2827a7512201 | GPUOpen-LibrariesAndSDKs/DirectXShaderCompiler | tools/clang/lib/Tooling/Tooling.cpp | #include "clang/Tooling/Tooling.h"
#include "clang/AST/ASTConsumer.h"
#include "clang/Driver/Compilation.h"
#include "clang/Driver/Driver.h"
#include "clang/Driver/Tool.h"
#include "clang/Frontend/ASTUnit.h"
#include "clang/Frontend/CompilerInstance.h"
#include "clang/Frontend/FrontendDiagnostic.h"
#include "clang/Fron... | TOOL | 0.941359 | 7.269732 |
5d20cbe0-9f2e-4ede-ab7b-a9d00a2ce847 | sarvex/leetcode-ksh | 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 |
98eb2951-c121-4f54-9384-351bac96e2a3 | aasthamuskan/cpp | c++/cpp class/sumofoppositiediagonal.cpp | #include <iostream>
#include <vector>
using namespace std;
int main() {
int SIZE = 3; // Matrix size
vector<vector<int>> A(SIZE, vector<int>(SIZE));
// Input elements in matrix from user
cout << "Enter elements in matrix of size " << SIZE << "x" << SIZE << ": \n";
for(auto& row : A) {
for... | ALGO | 0.999911 | 4.629577 |
024b6e7a-d258-49a2-b60d-af02aeb4d6e0 | harshit-jain52/CP_DSA | atcoder/dp-tasks/dp_g.cpp | #include <bits/stdc++.h>
using namespace std;
#define endl '\n'
typedef long long ll;
const int N = 1e5 + 10;
vector<int> g[N];
ll dp[N];
ll func(int vertex)
{
if (dp[vertex] != -1)
return dp[vertex];
ll ans = 0;
for (auto it : g[vertex])
{
ans = max(ans, 1 + func(it));
}
ret... | ALGO | 0.999626 | 4.192829 |
6a9318d6-4b8c-426c-a9cd-c41d32dbb286 | sohanur-rahman0/OnlineJudge-Solution | Data Structure/Linked list/LInked list OOP.cpp | #include <iostream>
using namespace std;
class Node
{
public:
int data;
Node *next;
};
class LinkedList
{
private:
Node *first;
public:
LinkedList()
{
first=NULL;
} LinkedList(int A[],int n);
~LinkedList();
void Display();
void Insert(int index,int x);
int Delete(int i... | ALGO | 0.999929 | 4.047881 |
19e2206c-46cb-460f-a4d3-450e767443e0 | SagarManiar9/Test | core/src/main/c/share/geohash.cpp | #include <jni.h>
#include "geohash_dispatch.h"
#include "bitmap_index_utils.h"
#include "simd.h"
#include <algorithm>
extern "C" {
DECLARE_DISPATCHER(simd_iota);
JNIEXPORT void JNICALL
Java_io_questdb_griffin_engine_functions_geohash_GeoHashNative_iota(
JNIEnv */*env*/,
jclass /*cl*/,
jlong a... | ALGO | 0.909037 | 7.329276 |
41932cb2-ef74-44a5-9de0-0b1276b97324 | Khushuu/data-structure-algorithm | Graph-Theory/if-path-exists.cpp | // Leetcode 1971 - Find if Path Exists in Graph
// given a graph - with nodes from 0 to n - 1
// source node and a destination node
// return true if there is a path from source to destination
// DFS and BFS both have same time and space complexity
// Time Complexity: O(N+E)
// We visit each node and edge at most onc... | ALGO | 0.999942 | 6.850739 |
586c7a5a-2009-4544-907d-a09aa659846c | Miguel235711/CompetitiveProgrammingAndMore | Codeforces/Codeforces Round #149 (Div. 2)/E/C++/main.cpp | #include<bits/stdc++.h>
#define mp make_pair
#define pb push_back
#define MAX(a, b) a = max(a, b)
#define MIN(a, b) a = min(a, b)
#define SQR(x) ((LL)(x) * (x))
#define RESET(a, b) memset(a, b, sizeof(a))
#define ALL(v) v.begin(), v.end()
#define SORT(v) sort(ALL(v))
#define PERMUTE next_permutation
#define fi ... | ALGO | 0.999447 | 4.126821 |
712c8775-f4b1-4202-8a6f-15ba23f09097 | qitcoin2021/qitcoin | src/util/bip39.cpp | #include <crypto/hmac_sha512.h>
#include <random.h>
#include <util/bip39.h>
namespace {
// golang.org/x/crypto/pbkdf2/pbkdf2.go:
//
// Key derives a key from the password, salt and iteration count, returning a
// []byte of length keylen that can be used as cryptographic key. The key is
// derived based on the method ... | ALGO | 0.988093 | 6.859489 |
8b27d578-6e37-4771-a198-28303bdbb6a1 | gangwar1234/CP | google_kickstart/C_G.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long lo;
typedef vector<lo> vl;
typedef vector<vl>vll;
#define all(v) (v).begin(), (v).end()
#define debug(x) cerr<<#x<<" = "<<x<<endl;
#define REPV(a, b, c) for (lo(a) = b; (a) < (c); (a)++)
#define REP(a,b) for(lo i =(a) ;i<(b);i++)
template <typename T>
i... | ALGO | 0.999987 | 4.13988 |
224b5e02-aa92-4cf2-ae24-400705002ea2 | Vaishnavi2701-mk/Introduction_to_CPP_CodingNinjas | Searching_And_Sorting/Code_Merge_Two_Sorted_Arrays.cpp | /* Code Merge Two Sorted Arrays
You have been given two sorted arrays/lists(ARR1 and ARR2) of size N and M respectively, merge them into a third array/list such that the third array is also sorted.
Input Format :
The first line contains an Integer 't' which denotes the number of test cases or queries to be run. Then th... | ALGO | 0.9999 | 4.311378 |
5e19a7fa-17c0-4e75-bb1a-81f3c25d9e20 | BigOrangeQWQ/acm-problems | CF1956/C.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <map>
#include <deque>
using namespace std;
#define x first
#define y second
#define endl '\n'
// #define int long long
using PII = pair<int, int>;
using LL = long long;
void solve() {
int n; cin... | ALGO | 0.999566 | 4.174496 |
fe16fbff-3136-4ef4-81db-a038bb2f3563 | piotrbar250/Cpp-Algorithmics-Set | Staszic/Suma cyfr 2/main.cpp | #include <iostream>
using namespace std;
const int M = 500*1000+15;
int tab[M];
long long dp[3][M];
int main()
{
int n;
cin>>n;
for(int i=1; i<=n; i++)
cin>>tab[i];
dp[1][1] = tab[1];
dp[2][1] = 9;
for(int i=2; i<=n; i++)
{
dp[1][i]=max(dp[1][i-1],dp[2][i-1])+tab[i];
... | ALGO | 0.999766 | 3.736152 |
1a965d1d-b56b-4fe5-af3f-486417b98d3b | 1334738575/SLAM_LYJ_src | matcher/PatchMatcher.cpp | #include "PatchMatcher.h"
#include "debugger/debugger.h"
#include "common/Diffuser.h"
NSP_SLAM_LYJ_BEGIN
PatchMatcher::PatchMatcher(Option _opt)
:MatcherAbr(TYPE::PATCH), m_opt(_opt)
{
}
PatchMatcher::~PatchMatcher()
{}
int PatchMatcher::match(const Frame& _frame1, const Frame& _frame2, std::vector<int>& _match2to1,... | ALGO | 0.99538 | 4.669121 |
f26f2a56-9978-499c-8cb9-ec12a6cd6872 | Vishi1811/leetcodeproblem | 0148-sort-list/0148-sort-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:
ListNode * findMiddle... | ALGO | 0.999989 | 5.669389 |
9a6239d2-9b1c-499e-bf18-373d5b690e02 | mh2rashi/Data-Structure-Algorithms | C++/Problems/LongestSubstringWithoutRepeatingCharacters.cpp | int lengthOfLongestSubstring(string s) {
int i = 0, j = 0;
int maxLength = 0;
unordered_map<char, int> frequency;
int s_size = s.size();
while (j < s_size) {
// Increment frequency of s[j]
frequency[s[j]]++;
// Check if s[j] is repeated
if (freq... | ALGO | 0.999399 | 6.389943 |
7bc1dc18-fea1-4dfa-9d23-cab9d8b14e64 | realsuncis/3DManeuver | 3DManeuver/Library/PackageCache/com.unity.ide.visualstudio@2.0.16/Editor/COMIntegration/COMIntegration~/COMIntegration.cpp | #include <iostream>
#include <sstream>
#include <string>
#include <filesystem>
#include <windows.h>
#include <shlwapi.h>
#include <fcntl.h>
#include <io.h>
#include "BStrHolder.h"
#include "ComPtr.h"
#include "dte80a.tlh"
constexpr int RETRY_INTERVAL_MS = 150;
constexpr int TIMEOUT_MS = 10000;
// Often a DTE call m... | TOOL | 0.974141 | 6.937841 |
4ddac888-fc90-4c26-abdd-8ff1191e8a3a | Vivek1322/Programs | SurpriseTest.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
map<int, int> m;
int n;
cout<<"Enter the maximum difficulty level->";
cin>>n;
for(int i=1; i<=31; i++)
{
int x;
cout<<"Enter the difficulty level of today's question->";
cin>>x;
m[x]++;
if(m.size... | ALGO | 0.983376 | 3.371066 |
6e6294e5-68d6-402d-9f67-3fb6bf1b9aba | FlaneTern/FT-TDMA | CTMCSimulator/Simulation.cpp | #include "PCH.h"
#include "Simulation.h"
#include "Database.h"
namespace CTMCS
{
static std::mt19937_64 s_Random = std::mt19937_64(std::chrono::high_resolution_clock::now().time_since_epoch().count());
IterationSRP::IterationSRP(const SimulationRunParameters& srp)
: Done(false), BigDeltaLevelCurrent(srp.BigDelt... | ALGO | 0.997925 | 3.382735 |
145f3bf7-0fe3-4ee6-809a-28cc934a7b77 | AdritaAlam/OperatingSystemLab | Variable partitioning/BestFit.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
freopen("BestFit.txt","r",stdin);
int n,m,proc,fs,req;
vector <pair<int,int >> p;
vector <pair<int,int> > blockNo;
vector<pair<int,int> > freeSpace;
cin>>n;
for (int i=0;i<n;i++){
cin>>fs;
freeSpace.push_back(make_p... | ALGO | 0.999969 | 3.942026 |
eba754a8-f935-4fd7-986e-ac66334e2047 | iamsaumya/Competitive-Coding | LeetCode/Dynamic Programming/62. Unique Paths.cpp | class Solution {
public:
int uniquePaths(int m, int n) {
int arr[m][n];
for(int i=0;i<n;i++)
arr[0][i] = 1;
for(int i=0;i<m;i++)
arr[i][0] = 1;
for(int i=1;i<m;i++)
for(int j=1;j<n;j++){
arr[i][j] = arr[i-... | ALGO | 0.999924 | 6.414276 |
c127d867-acc4-4da1-9f84-d3b6879ac62e | dl8sd11/online-judge | spoj/QTREE3.cpp | #include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
#define REP1(i,n) for(int i=1;i<=n;i++)
using namespace std;
#ifdef tmd
#define debug(...) do{\
fprintf(stderr,"%s - %d (%s) = ",__PRETTY_FUNCTION__,__LINE__,#__VA_ARGS__);\
_do(__VA_ARGS__);\
}while(0)
template<typename T>void _do(T &&_x){cerr<<_x... | ALGO | 0.999904 | 4.337873 |
c7adc5e1-9461-416b-a72a-637fa6f60c04 | 9967han/PS-Algorithm | BaekJoon/2669.cpp | #include<stdio.h>
#include<vector>
#include<algorithm>
using namespace std;
void input();
void printMap();
int rec[5][5];
int map[102][102];
int map2[102][102];
void addRec(int num, int x, int x2, int y, int y2);
int main() {
input();
for(int i=1; i<=4; i++) {
addRec(i, rec[i][1], rec[i][3], rec[i][2], rec[i][4]);... | ALGO | 0.999703 | 3.73058 |
fe1c922e-c777-415a-9cc1-4e679766bbf7 | Abhisek-Ray99/Ds-Algo-code | BinaryTree/Largest-subTree-sum-in-a-BinaryTree.cpp | // Largest subTree Sum in a BinaryTree
#include<iostream>
#include<queue>
using namespace std;
template<typename T>
class BTNode{
public:
int data;
BTNode *left;
BTNode *right;
BTNode(T data){
this->data = data;
left = NULL;
right = NULL;
... | ALGO | 0.999996 | 5.87119 |
d2737665-bf1c-42d3-bc73-63abc340d35f | Meowuu7/QuasiSim | DiffHand/core/externals/eigen/doc/snippets/SelfAdjointEigenSolver_SelfAdjointEigenSolver_MatrixType.cpp | MatrixXd X = MatrixXd::Random(5,5);
MatrixXd A = X + X.transpose();
cout << "Here is a random symmetric 5x5 matrix, A:" << endl << A << endl << endl;
SelfAdjointEigenSolver<MatrixXd> es(A);
cout << "The eigenvalues of A are:" << endl << es.eigenvalues() << endl;
cout << "The matrix of eigenvectors, V, is:" << endl << ... | ALGO | 0.999849 | 3.056724 |
5eac7160-6fb1-4a99-a9c0-5111681889b7 | makeusabrew/flingball-ios | Flingball/libs/Box2D/Dynamics/Joints/b2FrictionJoint.cpp | #include <Box2D/Dynamics/Joints/b2FrictionJoint.h>
#include <Box2D/Dynamics/b2Body.h>
#include <Box2D/Dynamics/b2TimeStep.h>
// Point-to-point constraint
// Cdot = v2 - v1
// = v2 + cross(w2, r2) - v1 - cross(w1, r1)
// J = [-I -r1_skew I r2_skew ]
// Identity used:
// w k % (rx i + ry j) = w * (-ry i + rx j)
//... | ALGO | 0.992265 | 7.412085 |
6d814041-b6d9-4eaf-8687-e75f5b7b8d94 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_7937_2.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
long long t;
cin >> t;
while (t--) {
long long n;
cin >> n;
vector<long long> v;
for (long long i = 0; i < n; i++) {
long long a;
cin >> a;
v.push_back(a);
}
long long start = 0;
long long end = v.size() - 1;
... | ALGO | 0.999817 | 4.052018 |
da20ca4c-32d3-458e-9035-494cd6ed6243 | ayush-1105/GfG | Medium/Number of occurrence/number-of-occurrence.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function template for C++
class Solution{
public:
/* if x is present in arr[] then returns the count
of occurrences of x, otherwise returns 0. */
int count(int arr[], int n, int x) {
// code here
int count ... | ALGO | 0.999894 | 5.934152 |
89236a19-db46-43b0-af2b-48e1453bca4d | Nanaanaaa/cppAlgorithmTemplate | math/Frac.cpp | template<class T>
struct Frac {
T num;
T den;
Frac(T num_, T den_) : num(num_), den(den_) {
if (den < 0) {
den = -den;
num = -num;
}
}
Frac() : Frac(0, 1) {}
Frac(T num_) : Frac(num_, 1) {}
explicit operator double() const {
return 1. * num / d... | ALGO | 0.998882 | 4.781658 |
0c616a9a-bb51-4f9d-a35a-ba8f3c1c0944 | nikpopesku/competitive_programming | codeforces/cpp/1900-1999/A/1950A.cpp | #include <iostream>
using namespace std;
void solve()
{
int a, b, c;
cin >> a >> b >> c;
if (a < b and b < c)
{
cout << "STAIR\n";
}
else if (a < b and b > c)
{
cout << "PEAK\n";
}
else
{
cout << "NONE\n";
}
}
int main()
{
int t;
cin >> t;
... | ALGO | 0.999872 | 4.147016 |
d2fd1fdc-13cb-4c7b-8933-a97bc7bafe93 | EazyReal/CompetitveProgramming | before2024/20200620-AGC-46/F.cpp | #include <bits/stdc++.h>
#define LOCAL
using namespace std;
#define X first
#define Y second
#define pb push_back
#define mp make_pair
#define all(a) a.begin(), a.end()
#define rep(i, st, n) for (int i = (st); i < (n); ++i)
#define repinv(i, st, n) for (int i = ((n)-1); i >= (st); --i)
#define MEM(a, b) memset(a, b, s... | ALGO | 0.997431 | 3.633586 |
0293cf2f-93cd-4661-9f5b-9c4f7959b3a6 | mateor/pdroid | android-2.3.4_r1/tags/1.23/frameworks/base/media/libstagefright/codecs/aacdec/ps_applied.cpp | /*
Filename: ps_applied.c
------------------------------------------------------------------------------
REVISION HISTORY
Who: Date: MM/DD/YYYY
Description:
------------------------------------------------------------------------------
INPUT AND OUTPUT DEFINITIONS
-----------... | ALGO | 0.996474 | 6.151505 |
82174981-7f6a-4a0c-843d-3cd6dc774c52 | KshitijShinde/competitive-programming-using-c- | expt 3 string subset/main.cpp | #include <iostream>
using namespace std;
void printsub(string str,string curr,int index){
if(index==str.length()){
cout<<curr<<" ";
return;
}
printsub(str, curr + str[index], index + 1);
printsub(str, curr, index + 1);
}
int main()
{
printsub("abc","",0);
return 0;
} | ALGO | 0.999637 | 4.50556 |
b087981b-881c-458a-89d5-62590cfce9f9 | ayanamizuta/cpro | atcoder/code_thanks_festival_2017/c.cpp | #include "bits/stdc++.h"
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define LL long long
int n,k;
LL a[100000],b[100000];
class cost {
public:
LL val;
int ind;
cost(){}
cost(LL v,int i){
val=v;
ind=i;
}
cost operator+(LL v){
cost ret(val,... | ALGO | 0.999917 | 3.132155 |
c780f606-245d-4902-bafa-7a5580e52427 | ignasp/ProgLangComp_onESP32 | C-Cpp/src/t_sha256.cpp | #include "t_sha256.h"
#include "a_util.h"
//--------------------------------------------------------------------------------------------------------------------------
// SHA256 - https://github.com/B-Con/crypto-algorithms/blob/master/sha256.c
//-----------------------------... | ALGO | 0.999712 | 6.673218 |
ce69336d-8039-48f6-bfb2-4c21af3c21c7 | md-shamim-ahmad/HackerRank-Online-Judge-Problems-Solutions | Practice/1 Week Preparation Kit/Counting Sort 1.cpp | vector<int> countingSort(vector<int> arr) {
vector<int> ans(100, 0);
for (auto it : arr)
ans[it]++;
return ans;
} | ALGO | 0.999791 | 5.6561 |
9d17551b-5e44-4406-a276-30bfd4c71557 | onpyeong/Algorithm | programmers/level3/42892.cpp | #include <string>
#include <vector>
#include <algorithm>
using namespace std;
struct Node {
int x, y;
int num;
Node* left;
Node* right;
};
int node_size;
vector<Node> tree;
vector<vector<int>> answer(2);
Node* snode;
bool compare(const Node &a, const Node &b) {
if(a.y == b.y)
return a.x ... | ALGO | 0.999983 | 4.631734 |
adbde87a-a800-4617-9bf4-b9ff3c34d65d | Amarjeet-Kumar1/dsa | array/max_consecutive_1s.cpp | #include<iostream>
using namespace std;
int maxConsecutive1s(bool arr[], int n){
int res = 0, temp = 0;
for(int i = 0; i<n;i++){
if(arr[i]==0)
temp = 0;
else {
temp++;
res = max(res, temp);
}
}
return res;
}
int main(){
bool a... | ALGO | 0.999912 | 5.369308 |
aa8d76a0-f7b0-4b63-af75-3ef99854fba3 | robotics-ETF/RPMPLv2 | src/planners/rbt/RGBTConnect.cpp | #include "RGBTConnect.h"
planning::rbt::RGBTConnect::RGBTConnect(const std::shared_ptr<base::StateSpace> ss_) : RBTConnect(ss_)
{
planner_type = planning::PlannerType::RGBTConnect;
}
planning::rbt::RGBTConnect::RGBTConnect(const std::shared_ptr<base::StateSpace> ss_, const std::shared_ptr<base::State> q_start_,
... | ALGO | 0.974048 | 4.166907 |
0746461e-ea0c-4bd5-b66b-b5140bcf2189 | EnjoyerGG/Algorithm-Journey | 基础算法/区间合并.cpp | // 给定n个区间 [li,ri],要求合并所有有交集的区间。
// 注意如果在端点处相交,也算有交集。
// 输出合并完成后的区间个数。
// 例如:[1,3]和[2,6]可以合并为一个区间[1,6]。
// 输入格式
// 第一行包含整数n。
// 接下来n行,每行包含两个整数l和r。
// 输出格式
// 共一行,包含一个整数,表示合并区间完成后的区间个数。
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
typedef pair<int, int> PII; // 用于存储区间
void merge(vect... | ALGO | 0.999864 | 5.500638 |
3bef38e1-354f-466c-ac5c-81d99069884f | LostKnowledge33/practice | 프로그래머스/unrated/178871. 달리기 경주/달리기 경주.cpp | #include <string>
#include <vector>
#include <unordered_map>
#include <algorithm>
using namespace std;
bool cmp(pair<string, int>& a, pair<string, int>& b)
{
return a.second < b.second;
}
vector<string> solution(vector<string> players, vector<string> callings)
{
unordered_map<string, int> player;
unordered_ma... | ALGO | 0.999986 | 5.530974 |
f4e4b649-c5d8-4aa1-bbb3-708be66b2b44 | foolnotion/aoc2020 | src/day05.cpp | #include <fmt/format.h>
#include "advent.hpp"
#include "util.hpp"
#include <functional>
#include <bitset>
int day05(int argc, char** argv)
{
if (argc < 2) {
fmt::print("Provide an input file.\n");
return 1;
}
std::ifstream in(argv[1]);
std::string line;
int maxID = 0;
std::ve... | ALGO | 0.970993 | 6.076112 |
1570a4b8-cb29-4f2b-a622-78d8a11637f5 | knst/Competitive-programming | cs/39/c.cpp | /*****************************************************************************
* codeforces: knst
* topcoder: knstqq
* projecteuler: knstqq
* **************************************************************************/
#include <algorithm>
#include <iostream>
#include <limits>
#include <map>
#include <set>
#i... | ALGO | 0.999801 | 4.137947 |
f4c03727-9cbd-43e2-9f30-3224e7fb5324 | iamsatyamsaurav/DSA-cpp-codes | pointersAndFunctions.cpp | #include<iostream>
using namespace std;
int findSum(int arr[],int size){
//cout<<"Size"<<sizeof(arr)<<endl;
//cout<<*arr<<endl;
// int sum=0;
// for(int i=0;i<size;i++){
// sum=sum+arr[i];
// }
// return sum;
// }
// void print(int *p){
// cout<<*p<<endl;
// }
// void update(int *p)... | ALGO | 0.962757 | 3.440493 |
6242bcfc-4a47-4d16-88b5-a312dd02cdc4 | ishandutta2007/codeforces | fanache99/normal/1408/C.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
#include <stack>
#include <cassert>
#include <map>
#include <numeric>
#include <cstring>
#include <set>
#include <ctime>
#include <queue>
#include <cmath>
#include <iomanip>
#include <iterator>
using namespace std;
clock_t timeStart, timeFi... | ALGO | 0.999904 | 3.420322 |
89988265-ba38-4ca7-ad06-f6f9826a319d | dl8sd11/online-judge | 0contest/YP_109/pB.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<int, ll> pil;
typedef pair<ll, int> pli;
typedef pair<double, double> pdd;
#define SQ(i) ((i)*(i))
#define MEM(a, b) memset(a, (b), sizeof(a))
#define SZ(i) static_cast<int>(i.size())
#... | ALGO | 0.999783 | 4.130215 |
311911a9-9d91-46bf-9624-720c582b8618 | raincross7/code-similarity | codes/train_code/problem121/problem121_493.cpp | #include <iostream>
#include <string>
#include <queue>
#include <vector>
#include <algorithm>
#include <math.h>
#include <map>
#include <iomanip>
#include <queue>
#include <numeric>
#define repl(i, l, r) for (ll i = l; i < r; i++)
#define rep(i, n) repl(i, 0, n)
using namespace std;
using ll = long long;
int main() {... | ALGO | 0.999786 | 3.489556 |
716be414-2f50-4a5b-83a6-27c07390a3a4 | dzuizz/codeforces | A_Buy_a_Shovel.cpp | #include <algorithm>
#include <iostream>
using namespace std;
typedef long long ll;
int gcd(int a, int b) {
if (b == 0) return a;
return gcd(b, a % b);
}
int main() {
int k, r; cin >> k >> r;
int ans = 10;
int cur = k;
for (int i = 0; i < 9; i++) {
if ((cur - r) % 10 == 0 || cur % 10 ... | ALGO | 0.999301 | 3.549463 |
ba6c0c35-01d0-4fcc-be39-29346666ffb8 | kiah2008/lyra_android | external_libs/eigen-3.4.0/unsupported/doc/examples/PolynomialUtils1.cpp | #include <unsupported/Eigen/Polynomials>
#include <iostream>
using namespace Eigen;
using namespace std;
int main()
{
Vector4d roots = Vector4d::Random();
cout << "Roots: " << roots.transpose() << endl;
Eigen::Matrix<double,5,1> polynomial;
roots_to_monicPolynomial( roots, polynomial );
cout << "Polynomial:... | ALGO | 0.997466 | 4.015535 |
c09d6d6c-ab90-4060-bf0c-affc5960ffac | valamaria89/FYS4411_Projects | Project2/Project_2/checkfunctions.cpp | #include "system.h"
#include "matrix.h"
#include "gradientdescent.h"
#include "checkfunctions.h"
#include <iostream>
#include <Eigen/Dense>
#include "mpi.h"
void check_convergence(double eng, int M, double omega, bool inter, int var) {
if (var>400){
if(inter){
if(M == 4){
if(fa... | ALGO | 0.971504 | 5.067765 |
4ce2524f-76cf-489e-b3b3-290a75024f0e | HerikDR/Lista-Sequencial | ListaDinamica.cpp | #include <iostream>
#include <cstdlib>
using namespace std;
struct listadinamica{
int* elementos;
int tamanho;
int capacidade;
};
void imprimir(const listadinamica& lista);
void iniciar(listadinamica& lista, int capacidadeinicial){
lista.elementos = (int*)malloc(capacidadeinicial * sizeof(int));
li... | ALGO | 0.984461 | 4.67115 |
5e117941-cc12-41e8-b4b2-e28eb290591d | Priyanshu6268/GFG_POTD | 2025/02 - FEB/26Feb25.cpp | class Solution {
public:
vector<int> maxOfMins(vector<int>& arr) {
int n = arr.size();
vector<int> result(n, 0);
vector<int> left(n, -1);
vector<int> right(n, n);
stack<int> s;
for (int i = 0; i < n; ++i) {
while (!s.empty() && arr[s.top()] >= arr[i]) {
... | ALGO | 0.999989 | 6.007339 |
d00f0d6a-2c94-4782-bfc6-7146894a9b56 | ishandutta2007/codeforces | kongweijia/normal/1299/D.cpp | #include<bits/stdc++.h>
#define rep(i,a,n) for(int i=a;i<=n;i++)
#define per(i,a,n) for(int i=n;i>=a;i--)
#define pb push_back
#define mp make_pair
#define FI first
#define SE second
#define maxn 100000
#define mod 1000000007
#define inf 0x3f3f3f3f
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
t... | ALGO | 0.999974 | 4.120667 |
01b1e17f-64bd-4a3b-ad7d-d6724dab74b5 | Anthonyw-cyber/Algo-geo-iles | point.cpp | #include "point.h"
#include <cmath>
// Fonction pour déterminer si un point est à gauche, à droite ou sur une droite orientée
int Point::aGauche(const Point &a, const Point &b) const
{
// Calcule le déterminant de la matrice formée par les points a, b et le point actuel (this)
double d = (b.x() - a.x()) * (thi... | ALGO | 0.998732 | 4.339356 |
b3772b24-d816-4d8b-9956-76ccb978f28e | wisec/DOMinator | toolkit/mozapps/readstrings/readstrings.cpp | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 et cindent: */
#include <limits.h>
#include <string.h>
#include <stdio.h>
#include "readstrings.h"
#include "errors.h"
// Defined bool stuff here to reduce external dependencies
typedef int PRBool;
#defin... | TOOL | 0.926654 | 6.450375 |
22cbaf2d-8ea5-425d-a42f-6bb8af7f3d53 | george-popoiu/infoarena_campion | infoarena_campion/subarbore.cpp | #include<stdio.h>
#include<algorithm>
#define inf "subarbore.in"
#define outf "subarbore.out"
#define NMax 41
#define MMax 421
using namespace std;
int N, M, cost;
int T[NMax], H[NMax];
struct muchie {
int a, b, c;
} L[MMax];
void read()
{
scanf("%d%d", &N, &M);
for(int i=1; i<=M; i++) {
scanf("%... | ALGO | 0.999963 | 4.144537 |
8f9dcf5f-4d52-4f17-b5e3-d179716cdaa5 | shivgupta198922/HACKEREARTH-MASTER | Basic Programming/Basics of Implementation/Fredo and Game.cpp | #include<iostream>
int main(){
std::ios_base::sync_with_stdio(false);
std::cin.tie(NULL);
int t;
std::cin>>t;
while(t--){
int a,n,i,pos=-1;
std::cin>>a>>n;
for(int j=1;j<=n;j++){
std::cin>>i;
if(a>0){
a=a+3*i-1;
if(!a and n^j)
pos=j;
}
}
if(pos==-1)
std::cout<<"Y... | ALGO | 0.999909 | 3.026931 |
d6ae311d-9366-4511-a805-1d087b32bcac | Karishma8985/flutter_ex | new_dependency_pubspec_yaml/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.998863 | 6.76073 |
8f81c4f7-4e2d-4842-bab8-5e1949ebdf2d | ishandutta2007/codeforces | cnnfls_csy/normal/966/A.cpp | #include <iostream>
#include <algorithm>
#include<cmath>
#include<cstring>
#include<cstdio>
#include<cstdlib>
#include<vector>
#include<iomanip>
#define sqr(x) (x)*(x)
using namespace std;
long long n,m,q,c1,c2,v,x,y,xx,yy,i,j,num[500005],num2[500005],ans;
int main()
{
scanf("%lld%lld%lld%lld%lld",&n,&m,&c1,&c2,&v);
... | ALGO | 0.999943 | 3.540522 |
55ada179-f4da-42cb-99f3-b46fd5e0a604 | ireshk7/C-Programming | 2d_array/sumofArrays.cpp | #include <iostream>
using namespace std;
int main(){
int arr[3][3];
cout<<"Enter the elements into the array ";
for(int i=0;i<3;i++){
for(int j=0;j<3;j++){
cin>>arr[i][j];
}
}
int sum=0;
for(int i=0;i<3;i++){
for(int j=0;j<3;j++){
sum+=arr[i][j];
... | ALGO | 0.999855 | 3.439535 |
8134531e-50fc-4b75-80b6-8ca7a91ae6a8 | siddhant-srinivas/dsa-lab | Lab7/q7.cpp | #include <iostream>
#include <queue>
using namespace std;
int main()
{
priority_queue<int> q;
int n, k, elem;
cin >> n >> k;
int satisfaction = 0;
for(int i = 0; i<n; i++)
{
cin >> elem;
q.push(elem);
}
for(int i = 0; i<k; i++)
{
elem = q.top();
satis... | ALGO | 0.999824 | 3.771653 |
2d75ae23-b0c7-464a-9d3f-98d9a6f07515 | Aviral-Dwivedi-0/Leetcode | 504-base-7/base-7.cpp | class Solution {
public:
string convertToBase7(int num) {
string ans="";
int sign=1;
if(num==0) return "0";
if(num<0){
sign=-1;
num=num*-1;
}
while(num>0){
int rem=num%7;
num=num/7;
ans=to_string(rem)+ans;
... | ALGO | 0.999843 | 5.679195 |
d1d099bc-9684-4004-978a-826a896ae626 | OrlowskiWojtek/DiffusionQuantumDots | src/DiffusionSolver/Core/src/solver_context.cpp | #include "Core/include/solver_context.hpp"
#include "DiffusionParams/include/params.hpp"
#include "TrialFunctions/include/jastrow_slater.hpp"
#include "include/UnitHandler.hpp"
#include <cmath>
boost::random::mt19937 SolverContext::s_seed_generator(time(0));
SolverContext::SolverContext()
: walkers_helper(std::ma... | ALGO | 0.999832 | 6.157268 |
6639cd59-2c2e-44bd-846f-0ec3192d0f3d | Wolfram-180/riverpod_course_app3 | 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 |
9c67fb9e-6592-4bc1-bd3a-109a1b001395 | MKJia/ROS-navigation-RRT | ros_nav/navigation/global_planner/src/astar.cpp | #include<global_planner/astar.h>
#include<costmap_2d/cost_values.h>
namespace global_planner {
AStarExpansion::AStarExpansion(PotentialCalculator* p_calc, int xs, int ys) :
Expander(p_calc, xs, ys) {
}
bool AStarExpansion::calculatePotentials(unsigned char* costs, double start_x, double start_y, double end_x... | ALGO | 0.999619 | 6.397042 |
2c311c2f-438f-46a3-bb08-58bd99034d01 | checkedc/checkedc-llvm-project | llvm/tools/llvm-exegesis/llvm-exegesis.cpp | #include "lib/Analysis.h"
#include "lib/BenchmarkResult.h"
#include "lib/BenchmarkRunner.h"
#include "lib/Clustering.h"
#include "lib/Error.h"
#include "lib/LlvmState.h"
#include "lib/PerfHelper.h"
#include "lib/SnippetFile.h"
#include "lib/SnippetRepetitor.h"
#include "lib/Target.h"
#include "lib/TargetSelect.h"
#incl... | TOOL | 0.904998 | 7.318198 |
db06c209-ec28-49c5-b1fb-ed5597c8b276 | JoydeepMallick/CODECHEF | 31.1.24 Starters 119 Division 3 (Rated)/anothergood.cpp | /*
_________________________
| Written by silent_Joy |
---------~u~---------
*/
#include"bits/stdc++.h"
#pragma GCC optimize("O3,unroll-loops")
// #pragma GCC target("bmi,bmi2,lzcnt,popcnt")
// #pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt") //intel pentium porcessors released post 2020 support avx2, un... | ALGO | 0.999772 | 4.194256 |
cd4eed40-19e4-45fe-ae0d-2b1d6f0e5be0 | piyushsir/DSA- | tough one/hamil.cpp | #include<bits/stdc++.h>
using namespace std;
int dfs(int st,vector<vector<int>> v,vector<int> vis,int count,queue<int> &s)
{
if(count==4)
{
return 1;
}
vis[st]=1;
count++;
for(int i=1;i<=4;i++)
{
if(v[st][i]==1 && vis[i]!=1)
{
s.push(i);
if(d... | ALGO | 0.999974 | 4.227424 |
a64cb0b7-c83b-47c2-bda6-9b12a39236b3 | chrismrosser/c-is-for-everyone | 4_loops/div.cpp | #include <iostream>
#include <cmath>
using namespace std;
int main()
{
const double rate = .03; // 3%
double funds = 20; // money going in
const double target = 1000; // goal
int months = 0;
while (funds < target)
{
funds += 20;
funds += funds * rate;
months++;
... | ALGO | 0.998941 | 4.520199 |
06d6a145-7c5e-407e-a0ec-d52657f3c0fc | Kawser-nerd/CLCDSA | Source Codes/AtCoder/agc020/A/3392596.cpp | #include <iostream>
#include <utility>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <list>
#include <stack>
#include <queue>
using namespace std;
int main(int argc,char ** argv) {
int n,a,b;
scanf("%d %d %d",&n,&a,&b);
if(!(abs(a-b)%2)){
printf("Alice");
} else... | ALGO | 0.999854 | 3.292842 |
972d854f-5a2c-4d27-ae8a-b427a1b71af2 | satyaswarup129/Data-Structure-And-Algorithms | Day-134/potd/lc-Maximum Number of Events That Can Be Attended.cpp | class Solution {
public:
int maxEvents(vector<vector<int>>& events) {
sort(events.begin(),events.end());
int i=0,n=events.size(),ans=0,mxday=0;
priority_queue<int,vector<int>,greater<int>> pq;
for(auto it:events) mxday=max(mxday,it[1]);
for(int day=1;day<=mxday;day+=1){
... | ALGO | 0.999955 | 6.017984 |
b6b9df9d-0f41-40f1-9b9b-bb1b23b1aa19 | limon2009/ACM-UVA-Online-Judge-solution | 10191.cpp | #include<stdio.h>
#include<string.h>
#define MAXN 1090
char fg[MAXN][MAXN];
void Mark(char aa[], char bb[]) {
int i, st, end, m, h;
aa[2] = ' ';
sscanf(aa,"%d%d",&h,&m);
st = h*60 + m;
bb[2] = ' ';
sscanf(bb,"%d%d",&h,&m);
end = h*60 + m;
for(i = st; i<end; i++)
fg[i][i+1] = 1;
}
void Sep(char ss[]) {
ch... | ALGO | 0.986468 | 3.254413 |
63414e2e-d876-45a4-97ad-3bde2d748e51 | jj123t/code | luogu/2197.cpp | /*************************************************************************
> File Name: 2197.cpp
> Author:123emm
> Mail: <EMAIL>
> Created Time: Fri Aug 4 14:19:24 2023
************************************************************************/
#include<bits/stdc++.h>
using namespace std;
int main()
{
int tt; ... | ALGO | 0.999943 | 4.210058 |
dc0fdb3e-3a06-4729-a1d3-ae6d31228c7b | AliElemam77/flutter-project-iti | 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 |
a74804fc-f47f-4f15-9861-c31870e276ce | Tukekehaohaonuli/algorithm | LuoGu/P2157.cpp | #include"ģ.cpp"
#include<cstdio>
node ans;
int main(){
int n,m;
int q,w;
while(scanf("%d%d",&n,m)&&(n+m)){
int a,b;
for(int i=0;i<m;i++){
scanf("%d%d",&a,&b);
x.mat[a][b]=1;
}
int t;
int k;
scanf("%d",&t);
for(int i=0;i<t;i++){
scanf("%d%d%d",&q,&w,&k);
ans=matpow(ans,x,k);
printf("%d\n"... | ALGO | 0.999927 | 3.472909 |
407b70b5-1666-4f65-bf2c-9e21e89e48bb | francistec/gdal-react-native | deps/libproj/proj/src/apps/proj.cpp | /* <<<< Cartographic projection filter program >>>> */
#include "proj.h"
#include "proj_internal.h"
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include <math.h>
#include "emess.h"
#include "utils.h"
#if defined(MSDOS) || defined(OS2) || defined(WIN32) || defined(__WIN32__)
# include... | TOOL | 0.967657 | 6.352478 |
46a1338b-8d38-403f-85fb-c363b0d66c1a | KentoBaguetti/CSES-stuff | cpp/temp.cpp | #include <bits/stdc++.h>
using namespace std;
void mystery(vector<int> & A) {
int n = A.size() - 1;
for (int i = 1; i <= n; ++i) {
int j = i; // Initialize j.
while (j > 1) {
if (A[j/2] <= A[j]) // Integer division.
break; // E... | ALGO | 0.999833 | 4.59485 |
0d98317e-350a-4359-b8e7-6992472083a2 | xinyiqian97/DEM | lib/atc/PerPairQuantity.cpp | #include "PerPairQuantity.h"
#include "PerAtomQuantity.h"
#include "KernelFunction.h"
#include "FE_Mesh.h"
#include "Utility.h"
#include "Quadrature.h"
using ATC::HeartBeat;
using std::pair;
using std::map;
namespace ATC {
//==========================================================
PairMap::PairMap(LammpsInterface ... | ALGO | 0.915559 | 5.610569 |
0708a0e5-580e-46b0-8c2d-cc2267c48b08 | NickWroble/CSCI-2270-Data-Structures | Recitation/Recitation 4/NW_Rec_4/LinkedList.cpp | #include "LinkedList.h"
using namespace std;
// Add a new node to the list
void LinkedList::insert(Node* prev, int newKey){
//Check if head is Null i.e list is empty
if(head == NULL){
head = new Node;
head->key = newKey;
head->next = NULL;
}
// if list is not empty, look for prev and append our ... | ALGO | 0.998572 | 3.359727 |
1c2d743c-2824-4d91-a12c-5b6e7697dea5 | AbdoWael2003/Graduation-Project-QAgent2.0- | FlowChartGeneration/CPPSamples/Sample970/sample_code970.cpp | #include <vector>
#include <algorithm>
std::pair<int, int> maximum_segments(int n, int a, int b, int c) {
std::vector<int> dp(n + 10, -1);
dp[0] = 0;
for (int i = 0; i < n; ++i) {
if (dp[i] != -1) {
if (i + a <= n) {
dp[i + a] = std::max(dp[i] + 1, dp[i + a]);
... | ALGO | 0.999698 | 5.470926 |
8c2a4085-c091-4dca-a0c9-a915c1b315df | 0x1Shub/Data-Structures-And-Algorithms | Striver DSA Sheet/9-Stack and Queues/9.2-Prefix, Postfix, Infix conversion problem/04_Postfix_to_prefix.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution
{
public:
string postfixToPrefix(string s)
{
stack<string> st;
for (char ch : s)
{
if (isalpha(ch))
{
st.push(string(1, ch));
}
else
{
... | ALGO | 0.999903 | 5.159943 |
9ea331ff-ca2e-416a-bc63-686a21e098ea | sir-rasel/Online_Judge_Problem_Solve | leetcode/700_search_in_binary_search_tree.cpp | class Solution {
public:
TreeNode* searchBST(TreeNode* root, int val) {
if(root==NULL) return NULL;
if(val==root->val) return root;
else if(val>root->val)
root = searchBST(root->right, val);
else if(val<root->val)
root = searchBST(root->left, val);
ret... | ALGO | 0.999993 | 5.733085 |
c9c2ac52-9a95-4648-895c-e70c5f6471a7 | yzxo/leetcode | LeetCode8/LeetCode8/414. Third Maximum Number.cpp |
#include"common.h"
#include<set>
int thirdMax(vector<int>& A) {
set<int> s(A.begin(), A.end());
if (s.size() < 3)return *(--s.end());
return *(------s.end());
}
int thirdMax2(vector<int>& nums) {
set<int> top3;
for (const int& num : nums) {//??????
top3.insert(num);
if (top3.size() > 3) {
top3.erase(top3.b... | ALGO | 0.999698 | 4.763678 |
0c95afd8-45e6-4bbe-a4f5-f9ce3d3d6a46 | Shiven-saini/pithuu-installer | src/modules/locale/LocaleConfiguration.cpp | #include "LocaleConfiguration.h"
#include "LocaleNames.h"
#include "utils/Logger.h"
#include <QLocale>
#include <QRegularExpression>
#include <QVector>
LocaleConfiguration::LocaleConfiguration()
: explicit_lang( false )
, explicit_lc( false )
{
}
LocaleConfiguration::LocaleConfiguration( const QString& loca... | TOOL | 0.856977 | 7.066791 |
2dfc94f8-7b03-4dc1-a836-efe1644bde73 | tanishq6818/DSA | DSA TO DEVELOPMENT CONTEST/Q1.cpp | Given a sorted array of integers of size N and a number X. Find the leftmost index of X in the array arr[].
int leftIndex(int N, int arr[], int X) {
int low = 0;
int high = N - 1;
int leftIndex = -1;
while (low <= high) {
int mid = low + (high - low) / 2;
... | ALGO | 0.999998 | 5.11743 |
18efc0b6-8611-43bd-9e1f-f167988c77b4 | Rohitrky2021/JavaSourceCode | =C--P/Coding-blocks-CP-master/Connected_Components_Undirected_Graph/Connected_Components_Undirected_Graph.cpp | //A connected component of an undirected graph is a subgraph in which any two vertices are connected to each other by paths, and which is connected to no additional vertices in the supergraph.
#include<bits/stdc++.h>
using namespace std;
// Recursive Function to perform DFS on graph using adjacency list
void dfs(vec... | ALGO | 0.999909 | 5.928448 |
b5c809e4-495e-46e9-82a4-0d35a12d2b1f | Rito-492/Luogu | P1838.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
string s,x[2]={"xiaoa wins.","uim wins."};
int j,a[20];
cin>>s;
for(int i=0;i<s.length();i++){
j=s[i]-'0';
a[j]=i%2;
}
if(a[1]==a[4]&&a[4]==a[7]){
cout<<x[a[1]];
return 0;
}
if(a[2]==a[5]&&a[5]==a[8]){
cout<<x[a[2]];
return 0;
}
if(a[3]==a[6... | ALGO | 0.99996 | 3.696827 |
0d8949d1-5ff9-40dc-acbe-3f5437c671a1 | believe-that-23/codechef_p | lunch_nov_21/d.cpp | #include <bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#define endl "\n"
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define ll long long
#define lld long double
#define all(x) (x).begin(),(x).end()
#define vll vector<long long int>
using na... | ALGO | 0.999832 | 4.338849 |
1b3a8183-938e-47c1-9299-c470336d817e | abhirams2020/Leetcode-Tracker | 637-average-of-levels-in-binary-tree/637-average-of-levels-in-binary-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.999936 | 6.741002 |
c23ce4e8-b719-4233-9646-b742c5e63c34 | wabiverse/UnrealEngineOldArchived | Engine/Source/ThirdParty/openexr/openexr-3.1.5/Contrib/DtexToExr/PxDeepUtils.cpp | #include "PxDeepUtils.h"
namespace PxDeep {
//-*****************************************************************************
// Density/Viz/DZ calculations are always performed in double precision.
// We try to leave them alone as much as possible, but the logarithm can get
// weird for very very small numbers. The "... | ALGO | 0.897463 | 5.123234 |
65221cd8-aa99-479d-a7a0-a17d86ce7349 | SNNafi/algo-ds-construction | MergeSort/CPP/MergeSort.cpp | //
// Created by Shahriar Nasim Nafi on 2/7/22.
//
void merge(int *array, int left, int mid, int right) {
int leftArraySize = mid - left + 1;
int rightArraySize = right - mid;
int sortedIndex = left;
int leftArray[leftArraySize];
int rightArray[rightArraySize];
for (int i = 0; i < leftArra... | ALGO | 0.999568 | 5.598857 |
03039b5d-ecdc-4ff6-ae69-9d15f711272c | wut-cadcam-system-design-course/RD | src/haunch.cpp | #include "haunch.h"
bool GetFacePlaneNormal(const TopoDS_Face& face, gp_Dir& outNormal)
{
GeomAdaptor_Surface adaptor(BRep_Tool::Surface(face));
if (adaptor.GetType() == GeomAbs_Plane)
{
Handle(Geom_Surface) surf = BRep_Tool::Surface(face);
Handle(Geom_Plane) plane = Handle(Geom_Plane)::DownCast(surf);
... | ALGO | 0.992243 | 6.691937 |
2d0fe5a7-cbc4-472c-89d7-2e77012bec8d | DortCeL/solved-problems | Random_or_Academic_Codes/Numerical Methods/gaussSeidal.cpp | #include <bits/stdc++.h>
using namespace std;
double co_eff[100][100], res[100], total, temp, error, permit_error = 0.01, temp_error;
void take_input(int n)
{
for (int i = 1; i <= n; i++)
{
for (int j = 1; j <= n + 1; j++)
{
cin >> co_eff[i][j];
}
}
}
void seidel(int n... | ALGO | 0.999949 | 3.569041 |
eda2b447-3766-4fc1-a5a8-0db29b0995ec | aliya-khalil21/week5 | task04.cpp | # include <iostream>
using namespace std;
float A(float days,float workers,float hour);
main()
{
float neededhour;
float neededextrahour;
float extrahour;
float days;
float workers;
float hour;
cout <<"enter days";
cin >>days;
cout <<"enter workers";
cin >>workers;
cout <<"enter hour";
cin >>hour;
float workinghour;
f... | ALGO | 0.999191 | 3.125025 |
c298ccb7-b816-4abd-96ae-483fc723b956 | XUANTIE-RV/open_source_ISP | src/csc.cpp | #include "csc.h"
uint10 csc_clip(int13 a, int lower, int upper) {
uint10 result;
if (a < lower)
result = lower;
else if (a > upper)
result = upper;
else
result = a;
return result;
}
void csc(top_register top_reg, csc_register csc_reg, stream_u42 &src, stream_u30 &dst) {
... | ALGO | 0.989465 | 5.296258 |
2292f9a8-c4f3-448c-8c89-bb5c54805113 | LichKing255/dark-ice | src/server/game/Entities/Taxi/TaxiPathGraph.cpp | #include "TaxiPathGraph.h"
#include "ObjectMgr.h"
#include "Player.h"
#include "DB2Stores.h"
#include "Config.h"
#include "Util.h"
#include <boost/graph/dijkstra_shortest_paths.hpp>
#include <boost/property_map/transform_value_property_map.hpp>
TaxiPathGraph& TaxiPathGraph::Instance()
{
static TaxiPathGraph instan... | ALGO | 0.982452 | 4.680592 |
e622fda6-afa2-4894-a38d-9c17cc078438 | bacikiss/practice | leetcode_3.27/MyQueue.cpp | #include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<stack>
#include<unordered_set>
#include<unordered_map>
using namespace std;
class MyQueue {
public:
stack<int>stIn;
stack<int>stOut;
MyQueue() {
}
void push(int x) {
stIn.push(x);
}
int pop(... | ALGO | 0.999872 | 4.459633 |
03673e9a-e035-4b7f-9b60-1e06dba65928 | egiiputra/latihan_programming | TOKI/Course_Pemrograman Dasar/11 Pendalam String/C.cpp | #include <cstdio>
#include <cstring>
char buff[111];
int N;
int main() {
scanf("%s", buff);
scanf("%d", &N);
int len = strlen(buff);
for (int i = 0; i < len; i++) {
int ord = (buff[i] - 'a');
int encrypted = (ord + N) % 26;
buff[i] = encrypted + 'a';
}
printf("%s\... | ALGO | 0.99986 | 4.530008 |
58062005-6a30-4071-a65d-f80fe28be57d | ceoca-ovidiu/c-plus-plus | 26/exercise26.cpp | // Delete multiple elements from an array
#include <iostream>
using namespace std;
int main() {
int n;
cout << "Enter the length of the array: ";
cin >> n;
int a[n];
for (int i = 1; i <= n; i++) {
cout << "a[" << i << "]: ";
cin >> a[i];
}
int e;
cout << "Enter the n... | ALGO | 0.999316 | 4.768517 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.