uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
d06a4d8b-e8f3-4d37-8378-b4ff376c209a | nirvik-alpha/GeeksForGeeks-DSA | Detect cycle in a directed graph - GFG/detect-cycle-in-a-directed-graph.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
private:
bool dfs(int node , vector<int> adj[] , int path[] , int vis[])
{
vis[node] = 1;
path[node] = 1;
for(auto u : adj[node])
{
if(!vis[u])
{
if... | ALGO | 0.999917 | 6.47861 |
10627de1-537d-4c33-86dc-a35af033c297 | crispychris101/csce121 | labwork/LW_Stack_Calculator/starting_code/calculator.cpp | #include "functions.h"
#include <iostream>
#include <sstream>
#include <string>
using std::cin, std::cout, std::endl, std::string, std::istringstream;
int main() {
// prompt user input
cout << "Type RPN expression (end with '=')." << endl;
cout << "> ";
// rpn calculator
Stack stack;
string input;
// lo... | ALGO | 0.998043 | 4.515688 |
1abb6597-1ebd-4034-9211-eeb9ea174d7f | seong2950g/CodingTest | 프로그래머스/2/12936. 줄 서는 방법/줄 서는 방법.cpp | #include <string>
#include <vector>
#include <iostream>
using namespace std;
vector<int> solution(int n, long long k) {
vector<int> answer;
// 팩토리얼(!) 결과값 저장
vector<long long> factorial(n+1, 1);
for (int i=2; i<factorial.size(); i++) {
factorial[i] = i*factorial[i-1];
}
// nu... | ALGO | 0.999992 | 4.492575 |
c3e23668-4aff-439c-abab-20c7dc9fccb4 | KUMARANKIT3012/Leetcode | Count Primes.cpp | class Solution {
public:
int countPrimes(int n) {
vector<bool> isprime(n+1, true);
int count=0;
for(int i=2; i<n; i++){
if(isprime[i]){
count++;
for(int j=i*2; j<n; j=j+i){
isprime[j]=false;
}
}
... | ALGO | 0.999963 | 5.792802 |
bb445b5a-4505-40ab-ad77-4f4b06d4144d | sandialabs/lgrtk | otm_distance_util.cpp | #include <cassert>
#include <hpc_algorithm.hpp>
#include <hpc_dimensional.hpp>
#include <hpc_execution.hpp>
#include <hpc_functional.hpp>
#include <hpc_macros.hpp>
#include <hpc_range.hpp>
#include <hpc_transform_reduce.hpp>
#include <hpc_vector.hpp>
#include <lgr_state.hpp>
#include <limits>
#include <otm_distance.hpp... | ALGO | 0.99984 | 7.465662 |
600d337c-1dc2-4acc-ac42-2e42731f5d4d | anikdey095/Acm-contest-1-2024 | codeforces 339A Helpful Maths.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
string arr;
cin>>arr;
for(int i=0;i<arr.size();i++){
for(int j=i;j<arr.size();j++){
if(arr[j]>='0' && arr[j]<='9'){
if(arr[i]>arr[j]){
char temp=arr[i];
arr[i]=arr[j];
arr[j]=te... | ALGO | 0.999927 | 4.866207 |
a5d8031d-0d62-4da5-b885-3d44a83e029d | Dinesh9928/DSA-Practice | search_elementin_sorted_2d_array.cpp | # include<bits/stdc++.h>
using namespace std;
int main()
{
int n,m;
cin>>n>>m;
int arr[n][m];
for(int i=0; i<n; i++)
{
for(int j=0; j<m; j++)
cin>>arr[i][j];
}
int target;
cin>>target;
cout<<endl;
int r=0, c=m-1;
while(r<n && c>=0)
{
if(arr[r][c]<target... | ALGO | 0.999993 | 4.289598 |
06d98d7a-aa18-4e7d-8371-856e6ff379d0 | churchil15/Love-Babbar-DSA-JAVA | C++ STl/set.cpp | #include <iostream>
#include <set>
using namespace std;
int main() {
set<int> s;
s.insert(5);
s.insert(5);
s.insert(5);
s.insert(1);
s.insert(6);
s.insert(6);
s.insert(0);
s.insert(0);
s.insert(0);
for(auto i: s){
cout<<i<<endl;
}cout<<endl;
set<int>::iterator it = s.begin();
it++;
... | ALGO | 0.979322 | 3.539992 |
9d8f9d35-d90f-4efb-a485-024341f904ed | shrutigoel11/Data-Structures-and-Algorithms | Binary Trees/Questions/topView.cpp | #include <iostream>
#include <vector>
#include <map>
#include <queue>
using namespace std;
struct Node
{
int data;
struct Node* left;
struct Node* right;
Node(int x){
data = x;
left = right = NULL;
}
};
class Solution
{
public:
//Function to return a list of nodes... | ALGO | 0.999996 | 5.036619 |
c581badb-efbc-420a-a0b3-10029bd6f3e6 | shivajreddy/codeforces | 1891/B/main.cpp | // B. Deja Vu
// https://codeforces.com/problemset/problem/1891/B
#include <bits/stdc++.h>
using namespace std;
// shorter type names
typedef long long ll;
typedef vector<int> vi;
// Macros
#define PB push_back
#define loop(i, a, b) for (int i = a; i < b; i++)
void setupIO() {
ios::sync_with_stdio(false);
c... | ALGO | 0.999739 | 3.447223 |
a449e025-d0e6-449f-8e73-06ecac0ddf82 | rajeevcodes0/other-projects | DSA_C_plus_plus/DP/MinCost Path/MinCost Path(tabulation).cpp | //here we will discuss about the tabulation approach, for other ideas, see previous solutions
//The states used here are based on the recursive solution
//table[i][j] is equals to:
// i) min(table[i+1][j], table[i][j+1])+cellCosts[i][j]) if we are not on the last row and last coloumn, we should take the minimum
//and... | ALGO | 0.999874 | 4.634883 |
bc33a8d2-6925-42db-87eb-5de94613dbd2 | xiemingzhang/gulp-my | templates/server_my/cocos2d-x-3.17/cocos/math/CCAffineTransform.cpp | #include "math/CCAffineTransform.h"
#include <algorithm>
#include <math.h>
using namespace std;
NS_CC_BEGIN
AffineTransform __CCAffineTransformMake(float a, float b, float c, float d, float tx, float ty)
{
AffineTransform t;
t.a = a; t.b = b; t.c = c; t.d = d; t.tx = tx; t.ty = ty;
return t;
}
Vec2 __CCPoint... | TOOL | 0.895902 | 6.373181 |
81404d09-df44-4746-bf57-88faa269beb2 | maskmind/LeetCode-solution | 0078.子集/0078-子集.cpp | class Solution {
public:
vector<vector<int>> subsets(vector<int>& nums) {
if (nums.empty())
{
return vector<vector<int>>();
}
vector<vector<int>> res;
res.push_back({});
for (int num: nums)
{
vector<vector<int>> tmp=res;
for... | ALGO | 0.999752 | 6.197028 |
8740ea15-7f8c-407f-bde2-5d0ca7b5d8da | sarvex/leetcode-c-sharp | solution/2600-2699/2617.Minimum Number of Visited Cells in a Grid/Solution.cpp | class Solution {
public:
int minimumVisitedCells(vector<vector<int>>& grid) {
int m = grid.size(), n = grid[0].size();
vector<vector<int>> dist(m, vector<int>(n, -1));
using pii = pair<int, int>;
priority_queue<pii, vector<pii>, greater<pii>> row[m];
priority_queue<pii, vecto... | ALGO | 0.999994 | 6.272573 |
25e8e5cb-9540-487e-acf9-aa56b63fdf3d | ajaysbugatti/Page_replacement_algo_OS | LRU_Stack_os.cpp | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
int find( vector<int> k,int l)
{
int c=0;
for(int i=0;i<k.size();i++)
{
if (k[i]==l)
{
return i;
c++;
}
}
if(c==0)
return -1;
}
vector<int> createData(string file_name) {
char ch;
vector<int>pages;
fstream fin(file_name.c_str(), fstream:... | ALGO | 0.964423 | 4.228547 |
fb50cdf5-bff9-4135-bb1a-59c59797371d | KeyurSanghani777/leetcode | Weekly cintest/6302.cpp | // You are given two 0-indexed integer arrays nums1 and nums2 of equal length n and a positive integer k. You must choose a subsequence of indices from nums1 of length k.
// For chosen indices i0, i1, ..., ik - 1, your score is defined as:
// The sum of the selected elements from nums1 multiplied with the minimum of ... | ALGO | 0.999996 | 4.766346 |
0a536eb2-3f0e-4bd9-9826-7e883b1c16dd | oanoan16/Code-Cpp | CTDL_GT/DSA04003_DemDay.cpp | #include <bits/stdc++.h>
#define faster() ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define base 123456789
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int uint;
typedef vector <int> vi;
typedef vector <string> vs;
ll pwr(int a, ll n){
if (n==0) return 1;
... | ALGO | 0.999851 | 4.941196 |
98eff29e-2681-4bab-a6b3-d3e8648cf1e0 | hsinyilin19/2d-improved-Fast-Marching-Method | skfmm/distance_marcher.cpp | #include "distance_marcher.h"
#include "math.h"
double distanceMarcher::updatePointOrderOne(int i)
{
double a,b,c;
double tmp;
tmp = 0;
a=b=c=0;
int naddr=0;
if (dim_ == 2)
{
double *u_vec = new double[2];
for (int dim=0; dim<dim_; dim++)
{
double value = maxDouble;
for (int j=-1;... | ALGO | 0.999983 | 4.547492 |
dcd0e54f-ad21-42b5-b799-0a0ff9e7cf21 | DG492003/CrackYourPlacement | Day 44/range-sum-quey-mutable.cpp | class NumArray {
private:
// Segment Tree to store the sums of the segments of the array
vector<int> Tree;
// Original array used to construct the segment tree
vector<int> arr;
// Function to build the segment tree
void build(int node, int start, int end) {
// If start equals end, it's... | ALGO | 0.999983 | 7.044328 |
e67c2667-6724-4310-affa-d3279aec3f60 | LeonelHercules/flutter-ejercicio5 | 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 |
5e025f8c-9278-42a2-86f2-4eed2549ce51 | yongho9064/cpp | Chapter06 --분기 구문과 논리 연산자/Example/more_and.cpp | //
#include <iostream>
const char * qualify[4] = {
" ",
" ",
"ġ ߸",
"θ "
};
int main(){
using namespace std;
int age;
cout << "̸ ԷϽʽÿ: ";
cin >> age;
int index;
if(age > 17 && age < 35)
index = 0;
else if(age >= 35 && age < 50)
index = 1;
else if(ag... | TOOL | 0.858506 | 3.007208 |
6b2467c8-8bb0-4a5c-b016-dc7fc1218354 | WAduck/cutekibry-s-documents | C++/Online Judges/USACO Section 1.4 D - Combination Lock/combo.cpp | /*
ID: Tsukimaru Oshawott
LANG: C++
TASK: combo
*/
#include <cstdio>
using namespace std;
bool vis[101][101][101];
int main(){
freopen("combo.in", "r", stdin);
freopen("combo.out", "w", stdout);
int n;
int i, j, k;
int a, b, c;
int ans=0;
scanf("%d", &n);
scanf("%d %d %d", &a, &b, &c);
a=(a-3+n)%n;
b=(... | ALGO | 0.999915 | 4.19795 |
6bdd473a-a847-446c-b23e-b4c71ed5e874 | Adityagupta1625/450-DSA-Questions | Binary trees/29_lca_of_tree.cpp | // Given a Binary Tree with all unique values and two nodes value, n1 and n2. The task is to find the lowest common ancestor of the given two nodes. We may assume that either both n1 and n2 are present in the tree or none of them are present.
// Example 1:
// Input:
// n1 = 2 , n2 = 3
// 1
// / \
// ... | ALGO | 0.999994 | 6.21198 |
27881f2e-38ed-49b8-bcb7-65fe9662cf39 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_4296_2.cpp | #include <bits/stdc++.h>
using namespace std;
const int chtholly = 0;
const int N = 30;
bool v[N][N];
int n;
using pii = pair<int, int>;
void construct(int n, int tar, int par, int val) {
int j, k, l;
bool pass = false;
pii tar_1, tar_2;
cout << par << " ";
if (n == 1) {
return;
} else if (n <= N) {
... | ALGO | 0.999981 | 4.005837 |
d201b277-4f63-49d6-96a2-4b2793227074 | vittorione94/ICP-Implementation | extern/nanogui/ext/eigen/unsupported/doc/examples/MatrixPower_optimal.cpp | #include <unsupported/Eigen/MatrixFunctions>
#include <iostream>
using namespace Eigen;
int main()
{
Matrix4cd A = Matrix4cd::Random();
MatrixPower<Matrix4cd> Apow(A);
std::cout << "The matrix A is:\n" << A << "\n\n"
"A^3.1 is:\n" << Apow(3.1) << "\n\n"
"A^3.3 is:\n" << Apow(3.3) << "\n\n"
... | ALGO | 0.997975 | 3.396939 |
b33dbd26-b614-4166-9752-d6ffac14290f | MaheshSharan/LeetCode_Automation | solutions/1000-1099/1063.Number of Valid Subarrays/Solution2.cpp | class Solution {
public:
int validSubarrays(vector<int>& nums) {
int n = nums.size();
stack<int> stk;
int ans = 0;
for (int i = n - 1; ~i; --i) {
while (stk.size() && nums[stk.top()] >= nums[i]) {
stk.pop();
}
ans += (stk.size() ? s... | ALGO | 0.999966 | 6.493869 |
81aef2d0-0e46-4814-bbdb-395829454661 | Bieneath/CarND-MPC-Project | src/Eigen-3.3/lapack/lu.cpp | #include "common.h"
#include <Eigen/LU>
// computes an LU factorization of a general M-by-N matrix A using partial pivoting with row interchanges
EIGEN_LAPACK_FUNC(getrf,(int *m, int *n, RealScalar *pa, int *lda, int *ipiv, int *info))
{
*info = 0;
if(*m<0) *info = -1;
else if(*n<0) ... | ALGO | 0.998061 | 5.816968 |
66772f9e-19d4-4690-a51f-db5cfe7241ba | jorgehog/Deux-kMC | src/soskmc/sossolver.cpp | #include "sossolver.h"
#include "dissolutiondeposition.h"
#include "fluxboundaryreaction.h"
#include "Events/confiningsurface/confiningsurface.h"
#include "Events/diffusion/constantconcentration.h"
#include "../kmcsolver/boundary/boundary.h"
#include "localpotential.h"
SOSSolver::SOSSolver(const uint length,
... | ALGO | 0.999269 | 5.836556 |
4d645352-b0c6-4f97-96ca-68a94de4cef3 | VasiliyMatlab/LeetCode | Easy/345.Reverse_Vowels_of_a_String.cpp | class Solution {
public:
string reverseVowels(string s) {
int l = 0, r = s.size() - 1;
while (l < r) {
if (vowels.count(s[l]) && vowels.count(s[r])) {
swap(s[l++], s[r--]);
continue;
}
if (!vowels.count(s[l])) {
l++;... | ALGO | 0.999777 | 6.858312 |
06d5e30c-06ae-45fd-b267-d23f69543b1d | sahilkhan03/CF-Solutions | codeforces/86/B.cpp | #pragma GCC optimize("Ofast")
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef long double ld;
#define fast ios_base::sync_with_stdio(false); cin.tie(nullptr);
#define all(x) x.begin(), x.end()
#define F first
#define S second
#define pb push_back
#define pl pair<ll, ll>
#define vl vector<ll>... | ALGO | 0.999912 | 4.138228 |
bbf4e29c-7855-4020-a56f-b144d71f2f1c | raincross7/code-similarity | codes/train_code/problem412/problem412_489.cpp | #include <bits/stdc++.h>
#include <string>
using namespace std;
typedef long long ll;
ll mod=998244353;
int main(){
ll x,y;
cin>>x>>y;
if(x==y){
cout<<0;
}else if(y<x){
cout<<min({abs(y-x)+2,abs(y-(-x))+1});
}else{
cout<<min({abs(y-x),abs((-y)-x)+1});
}
} | ALGO | 0.999993 | 4.175395 |
ad40332f-9e1d-4f02-a420-9faac0a4ecd0 | Sallmahussien/LeetCode | 1838-Frequency-of-the-Most-Frequent-Element.cpp | class Solution {
public:
int maxFrequency(vector<int>& nums, int k) {
int res = 0;
long long total = 0;
int window_size = 0;
int left = 0;
sort(nums.begin(), nums.end());
for (int right = 0; right < nums.size(); right++) {
total += nums[right];
... | ALGO | 0.999984 | 6.258966 |
0bceabd3-6924-45a1-bc86-a11bb5fbb40d | Raindrips/CodeNote | cpp/leetcodeQs/994/main.cpp | #include <iostream>
#include <queue>
#include <tuple>
using namespace std;
/*
值 0 代表空单元格;
值 1 代表新鲜橘子;
值 2 代表腐烂的橘子。
*/
class Solution {
using tb= tuple<int,int,int>;
public:
int orangesRotting(vector<vector<int>>& grid) {
int dis=0; //腐烂次数
int cnt=0; //橘子数量
queue<tb>que;
for (size_... | ALGO | 0.999742 | 5.750221 |
de9b2b7d-b9bb-4d84-9526-3e9394e092eb | amankumar6/DSA450 | 01. Array/25_given-an-array-of-of-size-n-finds-all-the-elements-that-appear-more-than-nk-times.cpp | #include<bits/stdc++.h>
using namespace std;
void morethanNbyK(int arr[], int n, int k)
{
int x = n / k;
unordered_map<int, int> mp;
for(int i = 0; i < n; i++) mp[arr[i]]++;
for(int i = 0; i < mp.size(); i++) if(mp[i] > k) cout << i << "\n";
}
// Driver Code
int main()
{
int arr[] = { 1, 1, 2,... | ALGO | 0.999951 | 4.648058 |
1c774e04-3779-4040-bbcf-d72a6735b62e | sarvex/leetcode-giz | solution/0900-0999/0947.Most Stones Removed with Same Row or Column/Solution.cpp | class Solution {
public:
vector<int> p;
int removeStones(vector<vector<int>>& stones) {
int n = 10010;
p.resize(n << 1);
for (int i = 0; i < p.size(); ++i) p[i] = i;
for (auto& stone : stones) p[find(stone[0])] = find(stone[1] + n);
unordered_set<int> s;
for (aut... | ALGO | 0.999605 | 5.608943 |
371055fe-25c8-4b8d-8a50-8964fb4fa64a | eversongs/c-study | BoyerMoore/BoyerMoore/Test.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <string.h>
#include "BoyerMoore.h"
#define MAX_BUFFER 512
void main(int argc, char** argv) {
char* filePath;
FILE* fp;
char text[MAX_BUFFER];
char* pattern;
int patternSize = 0;
int line = 0;
if (argc < 3) {
printf("argv is incorrect\n");
retur... | ALGO | 0.99727 | 4.728789 |
1f5e7868-379b-44a6-ad81-a359f20c59e5 | Mohit-Jain-git/Patterns | Pattern33.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int i, j, n, k = 1;
cin >> n;
for (i = 1; i <= n; i++)
{
for (j = 1; j <= i; j++)
{
if (k % 2 != 0)
{
printf("%c ", 64 + k + 32);
k++;
}
else
{
printf("%c ", 64 + k);
k++;
}
... | ALGO | 0.999868 | 3.369111 |
696107a7-a41f-402d-b4ae-f0e5852438f8 | jrapudg/RTWholeBodyMPPI | legged_controllers/src/TargetTrajectoriesPublisher.cpp | //
// Created by qiayuan on 2022/7/24.
//
#include <ocs2_core/Types.h>
#include <ocs2_core/misc/LoadData.h>
#include <ocs2_robotic_tools/common/RotationTransforms.h>
#include "legged_controllers/TargetTrajectoriesPublisher.h"
using namespace legged;
namespace {
scalar_t TARGET_DISPLACEMENT_VELOCITY;
scalar_t TARGET... | ALGO | 0.868091 | 6.237943 |
0d4de675-0477-4d45-af5f-5fd096bdd0c0 | qiaozishun4/CSP2024_BJ | BJ-Senior/answers/BJ-S01190/duel/duel.cpp | #include<bits/stdc++.h>
#define ll long long
using namespace std;
ll n,a[100005],book[100005],ans,maxn=-1e9;
ll sum[100005],last;
int main(){
freopen("duel.in","r",stdin);
freopen("duel.out","w",stdout);
cin>>n;
for(ll i=1;i<=n;i++){
scanf("%lld",&a[i]);
maxn=max(maxn,a[i]);
}
if(maxn<=2){ //5~10
l... | ALGO | 0.99997 | 3.644863 |
3bf9c17d-e63a-4321-a93c-8c1b1e13fac1 | puri111/horizontal_bar | hori_zontal_bar/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.998541 | 6.76775 |
94e79265-41c0-41b6-bca1-e5c753deff63 | KrishnakantTiwari11/Leetcode_All_topics_problem | 731-my-calendar-ii/my-calendar-ii.cpp | class MyCalendarTwo {
private:
map<int, int> m;
public:
bool canAdd(int n){
int count = 0;
for (auto entry: m){
count+=entry.second;
if(count>n) return false;
}
return true;
}
bool book(int start, int end) {
m[start]++;
m[end]... | ALGO | 0.999969 | 5.970792 |
c0e8662e-b00a-4eba-b623-a370e0cf89b2 | aditya4436/Data--Structures-And-Algorithm-In-C-Plus-Plus | Data Structures And Algorithm/Array/Solved Problems On Array/Maximum Consecutive Ones.cpp | // Time Complexity:- O(n)
// Auxiliary Space Complexity:- O(1)
#include<bits/stdc++.h>
using namespace std;
int MaximumConsecutiveOnes(vector<int> &nums)
{
int n=nums.size();
int count=0, m=0;
for(int i=0; i<n; i++)
{
if(nums[i]==1)
{
count++;
}
else
{... | ALGO | 0.999979 | 5.570257 |
27660849-fb7c-48b0-b276-6c98abf730f9 | ktm0110/algorithm | Sort/Sort/sort.cpp | #include <iostream>
#include <cstdlib>
#include <ctime>
#include <climits>
using namespace std;
#define LENGTH 100
void InsertionSort(int* A) {
for (int j = 1; j < LENGTH; j++) {
int key = A[j];
int i = j - 1;
while (i >= 0 && A[i] > key) {
A[i + 1] = A[i];
i--;
}
A[i + 1] = key;
}
}
void BubbleSo... | ALGO | 0.999853 | 4.559473 |
89c6f936-ea0e-4d90-8407-3e928522c4c8 | sanchit-sinha/CP | Contests/IITK-Contests/Internship-Prep-Contests/CONTEST15_MY/E/sol.cpp | #include "bits/stdc++.h"
using namespace std;
#define f first
#define s second
#define pb push_back
#define ll long long
#define ld long double
#define lb lower_bound
#define ub upper_bound
#define m... | ALGO | 0.999943 | 4.66862 |
a8175147-ec87-4b39-95c3-4c3b11ba1f79 | chungers/lab616 | third_party/cpp/boost_1_43_0/libs/graph/example/simple_planarity_test.cpp | int main(int argc, char** argv)
{
// This program illustrates a simple use of boyer_myrvold_planar_embedding
// as a simple yes/no test for planarity.
using namespace boost;
typedef adjacency_list<vecS,
vecS,
undirectedS,
property<ver... | ALGO | 0.984207 | 6.267366 |
ca3b0de7-bc4b-4c01-8862-3e270f5d120b | rlima-rogerio/tether_arduino | src/filter.cpp | //############################################################################
//
// File: filter.cpp
// Version: 1.0 (dec/2020)
//
// Description: Low-pass filtering functions.
//
//===========================================================================
// Author: Rogerio Lima
// Place: Morgantonw/WV
//#... | ALGO | 0.996965 | 4.546081 |
fb68be75-7f43-4328-b412-b926ffcbe0ae | lamknh/Problem_Solving | BOJ/C++/9086.cpp | #include <iostream>
using namespace std;
int T;
int main(){
scanf("%d", &T);
for(int i = 0; i < T; i++){
string s;
cin >> s;
int last = s.size();
cout << s[0] << s[last-1] << "\n";
}
return 0;
} | ALGO | 0.999527 | 3.177718 |
8b65c62e-72f5-4f38-b548-cc62d0a3fdbf | Underground78/mpc-hc-test | src/thirdparty/SoundTouch/source/AAFilter.cpp | #include <memory.h>
#include <assert.h>
#include <math.h>
#include <stdlib.h>
#include "AAFilter.h"
#include "FIRFilter.h"
using namespace soundtouch;
#define PI M_PI // MPC-HC custom: define PI to M_PI from math.h
#define TWOPI (2 * PI)
// define this to save AA filter coefficients to a file
// #define _... | TOOL | 0.949188 | 5.331763 |
5cbbbc51-a5ba-46fb-a1c6-7b73854186d0 | vikrant911998/CPPBatch10Reg | 8Jan2020/demo2.cpp | //No return type and No Arguments.
#include<iostream>
using namespace std;
//function declaration.
void calculate();
int main(){
//calling
calculate();
return 0;
}
//function Definition
void calculate(){
int a,b,sum;
cout<<"Enter the Two Numbers"<<endl;
cin>>a>>b;
sum= a*a + b*b;
co... | TOOL | 0.981857 | 3.552121 |
f4da8bb5-af74-4759-8a31-20f21b54a0bd | Sensiunk/Manjesh_CPP_Udemy_Course | Section_8/Section8/AssignmentOperator/main.cpp | #include <iostream>
using namespace std;
int main()
{
int num1 {10};
int num2 {20};
//num1 = 100;
//num1 = num2;
num1 = num2 = 1000;
cout << "Num1 is " << num1 << endl;
cout << "Num2 is " << num2 << endl;
return 0;
} | TOOL | 0.86647 | 3.379402 |
d3e168c5-c3f4-43ac-8de0-c5007897a3d8 | Omar-Sharif/Competitive-Programming | ALGORITHM_CODE/DFS/T.cpp | #include<bits/stdc++.h>
#define pii pair<int,int>
using namespace std;
queue<pii>q;
char ara[505][505];
int value[505][505];
int fx[]={0,1,0,-1};
int fy[]={-1,0,1,0};
int m,n,r;
int dfs(int x,int y,int c)
{
//cout<<x<<' '<<y<<'M'<<endl;
ara[x][y]='#';
int z=c;
for(int k=0;k<4;k++){
int xx=x+f... | ALGO | 0.999559 | 3.192555 |
bfd17097-5d66-4430-8510-d0574b2a2479 | Erickperez8/katas | Kata10.cpp | int square_digits(int numero) {
int factor = 1;
int resultado = 0;
while (numero > 0) {
int digito = numero % 10;
resultado += factor * digito * digito;
factor *= (digito <= 3) ? 10 : 100;
numero /= 10;
}
return resultado;
}
| ALGO | 0.994181 | 4.46133 |
3b30a777-c14a-4e4c-9687-714d7daf207c | okuraofvegetable/AtCoder | atcoder.jp/abc066/abc066_b/Main.cpp | #include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> P;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
// #define int long long
#define pb push_back
#define mp make_pair
#define eps 1e-9
#define INF 1000000000 //1e9
#define LLINF 1000000000000000ll // 1e15
#define fi first
#defin... | ALGO | 0.999863 | 4.025572 |
608911ad-f442-4c7e-80d7-c137be11b781 | dasinlsb/Algorithm-Contest-Records | PersonalTraining/cerc/2014/A.cpp | /*
对于每条给出的路径只在lca处决定是否选取
f[x][i]表示x子树,第i个儿子未选的方案数
对于一条给出的路径(x,y),假设z=lca(x,y),这条路径的贡献就可以在f[z][S]中统计到,转移是z-x,z-y两条路径上的f和,可以O(n)暴力转移
*/
#include <bits/stdc++.h>
using namespace std;
const int maxn=1005;
const int maxdeg=10;
int n,m,fa[maxn],dep[maxn],to_root[maxn],used[maxn][1<<maxdeg];
int pos_in_sons[maxn],nextv[maxn][... | ALGO | 0.999921 | 4.545141 |
c7b46a01-04c0-43a6-ae34-175f5d389e4d | akugarg/SolvedCP_Prob | HackerEarth/BubbleSort2.cpp | #include <iostream>
#include <bits/stdc++.h>
#define ll long long
#define pb push_back
using namespace std;
//https://www.hackerearth.com/practice/algorithms/sorting/bubble-sort/practice-problems/algorithm/shubham-and-xor-8526868e/description/
ll fact(ll p)
{
ll a=(p*(p-1))/2;
return a;
}
int main()
{
ll n;... | ALGO | 0.999919 | 3.795637 |
e1db515c-998d-4514-9cfb-4a6dc2e0fa54 | Karthik-Saladi5/Codeforces | usaco/bovineShuffle.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vi;
typedef pair<ll,ll> pi;
#define pb push_back
#define F first
#define S second
#define SQ(a) (a)*(a)
#define REP(i,a,b) for(int i=a;i<=b;i++)
#define ALL(a) (a).begin(), (a).end()
const int mod = 1000000007;
#define yes cout<<"YES... | ALGO | 0.999966 | 3.335442 |
cb11fbc3-acce-4709-b500-c3c5060b0796 | Am1r8/CodinGame-solutions | THE DESCENT/Sol_1_C++.cpp | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
while (1) {
int m = 0;
int im = 0;
for (int i = 0; i < 8; i++) {
int mh;
cin >> mh; cin.ignore();
if (m < mh) {
m = mh;
im = i;
}
}
cout << im <<... | ALGO | 0.991384 | 3.513192 |
944f89ce-5c27-4365-81ae-f3cb51814ca1 | Liousvious/LeetCode | Dynamic_Problems/Classical_Problems/978. Longest Turbulent Subarray.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution {
public:
int maxTurbulenceSize(vector<int>& A) {
if (A.empty()) return 0;
vector<vector<int>> dp(A.size() + 1, vector<int>(2));
dp[1][1] = 1;
dp[1][0] = 1;
int maxLen = dp[1][1];
for (int i = 2; i <= ... | ALGO | 0.998982 | 5.714392 |
76b52e67-90b3-416b-9074-dcc4d6160a8a | 340StarObserver/Seven | oftenUsed/unionfindsets/UnionFindSets.cpp | #include "UnionFindSets.h"
#include <cstring>
using std::memset;
#include <iostream>
using std::cout;
using std::_Copy_impl;
namespace Seven
{
// non-default constructor
/*
the length of _parent[] is size+1,
because we use the _parent[0] as the virtual root,
that is,at the beginning,it is the parent of all nod... | ALGO | 0.977072 | 3.854366 |
22445613-9402-49e6-ab53-f50059e861f8 | raincross7/code-similarity | codes/train_code/problem488/problem488_144.cpp | #include<bits/stdc++.h>
using namespace std;
using ll=long long int;
#define rep(i,n) for(int i=0;i<(n);i++)
const ll ln=1000000007;
ll sum(ll l,ll r){
return (l+r)*(r-l+1)/2;
}
int main(){
ll n,k;
cin>>n>>k;
ll ans=0;
for(int i=k;i<=n+1;i++){
ll l=sum(0,i-1), r=sum(n-i+1,n);
ans+... | ALGO | 0.999895 | 3.719366 |
89335632-7b91-4e7d-a9de-761697feab14 | ParasWaghela07/DSA-SUPREME-2.0 | (WEEK 2) BASIC QUEST & PATTERNS/binary_to_decimal.cpp | #include<bits/stdc++.h>
using namespace std;
int getDecimal(int n){
int i=0;
int ans=0;
while(n>0){
int digit=n%10;
ans += digit * pow(2,i);
i++;
n=n/10;
}
return ans;
}
int main(){
int bnum=100000;
int dnum=getDecimal(bnum);
cout<<"Binary number :-"<... | ALGO | 0.99818 | 5.037397 |
f33e8ad3-4d3d-4125-a775-0a1850b8b3de | 5hawon/Competitive_Programming | C_Nezzar_and_Symmetric_Array.cpp | #include <bits/stdc++.h>
using namespace std;
// defines...
#define ll long long
#define tata return;
#define pb push_back
#define mp make_pair
#define in insert
#define run \
ios_base::sync_with_stdio(false); \
cin.tie(NULL);
#define YES cout << "YES" << endl;
#define NO cout << "NO"... | ALGO | 0.99895 | 3.933403 |
8ed2ab4f-2072-4399-bfff-c71b495d54d4 | u-wyh/Mycode | 线段树/线段树——括号问题.cpp | //P10513
// һ
#include<bits/stdc++.h>
using namespace std;
#define int long long
const int MAXN = 5e5+5;
struct node{
int l,r;
int lcnt,rcnt;//ͳźŵ
int ans,result;//ֱͳ () )(
//ͳresultΪ˷תʱ
int tag;//1 ʾзת
}tree[MAXN<<2];
char str[MAXN];
int n,m;
inline int read() {
int x = 0, f = 1;
char ... | ALGO | 0.999969 | 3.867128 |
7c2a69fd-0cee-434e-9088-f38931265da8 | ruandaniel/R-LC | 285. Inorder Successor in BST.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
TreeNode* inorderSuccessor(TreeNode* root, TreeNode* p) {
if (root == NULL) return NULL... | ALGO | 0.99998 | 5.662628 |
fff8652e-d487-4b4f-9390-8d5d74b3b823 | ayush931/C-Plus | Recursion/factorialRecursion.cpp | #include<iostream>
using namespace std;
int factorial (int n) {
// base case
if(n == 1) return 1;
return n * factorial(n - 1);
}
int main () {
int result = factorial(5);
cout << result << endl;
return 0;
}
// Space gets introduce due to call stack.
// syntax
/**
* methodName (N parameters... | ALGO | 0.999395 | 6.441135 |
2bfff9e9-9056-4a03-a2ec-3fe16a905d30 | RyuukiBoy/Cpp-Modules | cpp08/ex01/Span.cpp | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* Span.cpp :+: :+: :+: ... | ALGO | 0.962558 | 5.154303 |
87ca6b44-b0e9-40a7-9021-d58a6860c4fe | kamyu104/LeetCode-Solutions | C++/pyramid-transition-matrix.cpp | // Time: O((a^(b+1)-a)/(a-1)) = O(a^b) , a is the size of allowed,
// b is the length of bottom
// Space: O((a^(b+1)-a)/(a-1)) = O(a^b)
// dfs solution
class Solution {
public:
bool pyramidTransition(string bottom, vector<string>& allowed) {
vector<vector<vector<in... | ALGO | 0.999912 | 5.76918 |
691570de-072b-4454-99e3-b124ce57c67c | HimanshuKumar1000101/c-program | arry assanding order.cpp | #include<iostream>
using namespace std;
class ascending
{
public:
int arr[100];
int a, i, j, temp;
void getdata()
{
cout<<"Enter size of array: ";
cin>>a;
cout<<"Enter elements in array: ";
for(i=0; i<a; i++)
{
cin>>arr[i];
}
}
void ascending_order()
{ for... | ALGO | 0.999573 | 3.62762 |
da1768ea-a209-4d24-bfcf-8c12d3026cdf | MVARUNREDDY8203/LEETCODE_- | 2006-find-the-student-that-will-replace-the-chalk/2006-find-the-student-that-will-replace-the-chalk.cpp | class Solution {
public:
int chalkReplacer(vector<int>& chalk, int k) {
ios_base::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);
long long int sum = 0, n = chalk.size();
for (int i=0; i<n; i++) {
sum += chalk[i];
}
k = k % sum;
for (int i=0; i<... | ALGO | 0.999964 | 5.505124 |
ab9ad526-1a3b-40c7-8bf3-accc5355e73f | soumil1/DSA-Preparation | Leetcode/Sliding Window/Subarray_with_given_sum.cpp | // Question asked in Amazon Facebook Google Visa
// Find Subarray in the given sum (GeeksForGeeks POTD - dated 19 Aug, 2023)
// Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// Driver Code Ends
class Solution
{
public:
//Function to find a continuous sub-array which adds up to a given num... | ALGO | 0.999605 | 6.147603 |
701195ec-e300-4219-be7a-7946ed24f146 | sudhanshu2k/learnopencv | MultiObjectTracker/multiTracker.cpp | #include <opencv2/opencv.hpp>
#include <opencv2/tracking.hpp>
using namespace cv;
using namespace std;
vector<string> trackerTypes = {"BOOSTING", "MIL", "KCF", "TLD", "MEDIANFLOW", "GOTURN", "MOSSE", "CSRT"};
// create tracker by name
Ptr<Tracker> createTrackerByName(string trackerType)
{
Ptr<Tracker> tracker;
... | ALGO | 0.984631 | 5.907005 |
4ea14f97-bafc-4fc7-976a-d0cff2a6b464 | BangKartavya/DSA-Sheet-by-Love-Babbar | Stacks and Queues/LRU Cache/main.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// design the class in the most optimal way
struct DLLNode {
DLLNode* next = nullptr;
DLLNode* prev = nullptr;
int key = -1;
int value = -1;
};
class LRUCache {
private:
DLLNode* head;
DLLNode* tail;... | ALGO | 0.995739 | 6.047164 |
474525cd-9838-42c7-bc9b-b1a139a7c46a | ishandutta2007/codeforces | icecuber/normal/810/B.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ios::sync_with_stdio(0); cin.tie(0);
int n, k;
cin >> n >> k;
vector<ll> d;
ll ans = 0;
for (int i = 0; i < n; i++) {
int a, b;
cin >> a >> b;
ll x = min(a,b), y = min(a*2,b);
d.push_back(y-x);
ans += x;
... | ALGO | 0.999599 | 3.749662 |
5437acaf-6a68-4eae-b98b-31a37912c07f | Zimse12345/Code | Codeforces_Contest/CF1634/A.cpp | #include <cstdio>
#include <algorithm>
#include <cstring>
#include <vector>
#include <cmath>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <iostream>
#include <cstdlib>
#include <ctime>
#define ll long long
#define ull unsigned long long
using namespace std;
int read(){int qrx=0,qry=1;char... | ALGO | 0.99981 | 4.056734 |
f8212f82-ea29-4770-ac8e-600b904fb196 | Tejasjain19/LeetCode-Practice-Questions | 0852-peak-index-in-a-mountain-array/0852-peak-index-in-a-mountain-array.cpp | class Solution {
public:
int peakIndexInMountainArray(vector<int>& arr)
{
int peak = arr[0],idx=0;
for(int i=1; i<arr.size(); i++)
{
if(arr[i]>peak)
{
peak = arr[i];
idx=i;
}
}
... | ALGO | 0.999966 | 5.569691 |
17556d14-2cc3-4243-96b7-9e35cafd72ff | HinnoNguyen/-StudyFiles-IntroCoding | Wecode/Assignment1/2.05.cpp | #include <iostream>
using namespace std;
int main() {
int a, b;
cin >> a >> b;
if (a == b) cout << "1";
else cout << "0";
return 0;
}
| ALGO | 0.999914 | 4.041822 |
9ab7a2bf-802d-4845-8972-2fd1bc4191bf | mkraj-7838/leetcode | 0022-generate-parentheses/0022-generate-parentheses.cpp | class Solution {
public:
void solve(string s,int open, int close, vector<string>& ans){
if(open==0 && close==0){
ans.push_back(s);
return;
}
if(open==close || close == 0){
string s1=s;
s1.push_back('(');
solve(s1,open-1, close, ans)... | ALGO | 0.99964 | 6.165382 |
65c05b45-3d21-4ef2-b272-08eaccbd6cf2 | sahilsrivastava25/DSA | 2299-merge-nodes-in-between-zeros/2299-merge-nodes-in-between-zeros.cpp | class Solution {
public:
ListNode* mergeNodes(ListNode* head) {
head=head->next;
ListNode* start=head;
while(start){
ListNode* end= start;
int sum=0;
while(end->val!=0) sum+= end->val , end=end->next;
start->val=sum;
start->next=end->next;
start=sta... | ALGO | 0.999983 | 5.033963 |
43b10700-430a-4b6b-a6a0-62709da7e65e | teju85/programming | euler/solved/p24.cpp | //
// Challenge name: Problem 24
// Difficulty : easy
// Link : http://projecteuler.net/index.php?section=problems&id=24
// Compile : g++ -Wall -g -o p24 p24.cpp
// Run : ./p24
//
#include <stdio.h>
#define PERMUTE_NUM 1000000
int num_permutes = 0;
// circular rotate right among the elemen... | ALGO | 0.999727 | 6.019144 |
157782f2-cd38-4b3f-8d32-56b462da22e6 | Malfoy/BLONG | MappingSupervisor.cpp | //
// MappingSupervisor.cpp
// PBMOG
#include "MappingSupervisor.h"
#include "Utils.h"
#include <math.h>
void MappingSupervisor::MapAll(){
vector<thread> threads;
for(uint i(0); i<nbThreads; ++i) {
threads.push_back(thread(&MappingSupervisor::MapPart, this));
}
for(auto &t : threads){t.join();}
cout<<big... | ALGO | 0.927743 | 3.335149 |
6a76acb4-bad2-4a0e-b85b-06e033b248e2 | MishkatIT/codeforces-atcoder-submissions | codeforces/16/16B Burglar and Matches.cpp | /*
author : MishkatIT
created : Tuesday 2022-12-20-01.04.12
problem : B. Burglar and Matches
*/
#include<bits/stdc++.h>
#define fio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
using namespace std;
int main()
{
fio;
int n, m;
cin >> n >> m;
vector<pair<int, int>> v;
int a... | ALGO | 0.999885 | 4.453308 |
4c3cbb01-a9f3-4135-a71f-effb1eb46fd7 | chundao123/OS-Codes | OS_lab6/lab6_22330034/safe.cpp | #include "banker.h"
void State::setStudentID()
{
studentID="22330034";//replace it with your real student id
}
bool State::safe()
{
bool possible = true;
//write your code here
int count = 0;
vector<bool> finish(numOfProcess, false);
vector<int> current_available = available;
while (count != numOfProcess)
{
/... | ALGO | 0.988876 | 4.120602 |
f1c4b2f1-c6f7-4c36-bb74-fd38833965ff | madmax-inc/BattleSimulator | CommonFiles/LagrangeInterpolation.cpp | #include "LagrangeInterpolation.h"
LagrangeInterpolationFunction::LagrangeInterpolationFunction() : InterpolationFunction()
{
}
LagrangeInterpolationFunction::LagrangeInterpolationFunction(const QVector<QPair<double, double> > &inPoints) : InterpolationFunction(inPoints)
{
}
LagrangeInterpolationFunction::LagrangeIn... | ALGO | 0.98055 | 4.724075 |
8added5c-a6d6-45ec-9018-46c3bdb4d591 | plumed/plumed2 | src/multicolvar/AlphaBeta.cpp | #include "core/ActionShortcut.h"
#include "core/ActionWithValue.h"
#include "core/ActionRegister.h"
#include "core/PlumedMain.h"
#include "core/ActionSet.h"
#include <string>
#include <cmath>
//+PLUMEDOC MCOLVAR ALPHABETA
/*
Measures a distance including pbc between the instantaneous values of a set of torsional angle... | ALGO | 0.979527 | 5.87171 |
6ff06672-71cd-4fda-a94f-f63243ddadbe | arushi-midha/leetcode | First Missing Positive_41.cpp | /*
26-3-24
Given an unsorted integer array nums. Return the smallest positive integer that is not present in nums.
You must implement an algorithm that runs in O(n) time and uses O(1) auxiliary space.
Example 1:
Input: nums = [1,2,0]
Output: 3
Explanation: The numbers in the range [1,2] are all in the array.
Exampl... | ALGO | 0.999973 | 5.380561 |
9c03b6ab-c18c-4519-a9b6-1082c8af7c68 | scalalang2/ps-old | atcoder/abc300/d.cpp | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
ll N;
const int mxn = 1000001;
ll seive[mxn];
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
cin >> N;
for(int i = 2; i < mxn; i++) {
if(seive[i] == 0) {
for(int j = i + i;... | ALGO | 0.999863 | 4.172358 |
6a3af36a-f2f1-4369-b1ea-d77142d0bf16 | gourav-kandoria/Practice-Programs | cormen-graphs/22.4.2.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb push_back
ll mod = 1000000007;
#define loop(n) for(int64_t i=0; i<n; i++)
#define loop1(a,b) for(int64_t i=a; i<=b; i++)
template <typename T>
void print(T a, T b, string end="\n") {
for_each(a,b,[](auto & i){cout << i << " ";});
c... | ALGO | 0.999822 | 3.734523 |
af79bd27-51a1-4c49-8694-3a4a7860e871 | Andrzej-Swietek/Algorytmy | 6_przyciski.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
int liczniki, nacisniecia; // liczniki przyciski poza ostatnim ktory przypisuje najwieksza wartosc wszystkim
cin >> liczniki >>nacisniecia;
int *licznik;
licznik = new int[liczniki+1];
... | ALGO | 0.999963 | 3.998502 |
644f4629-a034-48b1-9184-947e04828ba6 | Akrobatik/ps | BaekJoon/13000/13549.cpp | // Title : 숨바꼭질3
// Link : https://www.acmicpc.net/problem/13549
// Time : 4 ms
// Memory: 2728 KB
#include <bits/stdc++.h>
using namespace std;
int x, y;
bool memo[200001];
struct Elem : public pair<int, int> {
Elem(int pos, int sec) : pair<int, int>(make_pair(pos, sec)) {}
constexpr auto operator<=>(const ... | ALGO | 0.999997 | 4.382544 |
c07358f7-c66f-4d71-88d0-cb577e862b6e | ssugam10/leetcode-solutions | 0199-binary-tree-right-side-view/0199-binary-tree-right-side-view.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.999928 | 6.068387 |
a1db90da-e551-48de-b54b-18311b6e8ddc | unobtanium-official/Unobtanium | src/qt/transactionfilterproxy.cpp | #include "transactionfilterproxy.h"
#include "transactiontablemodel.h"
#include "transactionrecord.h"
#include <cstdlib>
#include <QDateTime>
// Earliest date that can be represented (far in the past)
const QDateTime TransactionFilterProxy::MIN_DATE = QDateTime::fromTime_t(0);
// Last date that can be represented (... | TOOL | 0.896414 | 6.707548 |
c8c08854-9a24-43fe-a684-2997bff8fefa | johanna0626/SensorsCalibration-Copy | factory_calib/3rdparty/eigen3/failtest/fullpivqr_int.cpp | #include "../Eigen/QR"
#ifdef EIGEN_SHOULD_FAIL_TO_BUILD
#define SCALAR int
#else
#define SCALAR float
#endif
using namespace Eigen;
int main()
{
FullPivHouseholderQR<Matrix<SCALAR,Dynamic,Dynamic> > qr(Matrix<SCALAR,Dynamic,Dynamic>::Random(10,10));
}
| TEST | 0.864629 | 3.136786 |
08be7b90-f57d-45ef-ac41-9f55848edefc | ML-UCV/ML-CodeBert-DistinctSolutions | Raw Dataset/schi/seg_tree/train/7794e668-137c-11eb-a900-309c234925a0.cpp | #include <cstdio>
using namespace std;
const int NMAX = 30005;
int aint[NMAX*4];
int v[NMAX];
int sol[NMAX];
int n;
void build(int nod,int st,int dr)
{
if(st == dr)
{
aint[nod] = 1;
return;
}
int mij = (st+dr)/2;
build(2*nod,st,mij);
build(2*nod+1,mij+1,dr);
... | ALGO | 0.999995 | 3.774303 |
26f587e8-7365-4c51-b515-ae7c2aaa7f4d | prashant21b/Dynamic-Programming | houseRobber2.cpp |
#include<bits/stdc++.h>
using namespace std;
class Solution {
public:
//memoization
/*int solve1(vector<int> nums,int n,vector<int> &dp){
if(n==0){
return nums[0];
}
if(n<0){
return 0;
}
if(dp[n]!=-1) return dp[n];
//rob
int rob=nums[n]+solve1(nums,n-2,dp);
//notrob
int notrob=solve1(n... | ALGO | 0.999948 | 4.48196 |
06f6a1c2-4536-4cab-98fd-69dd9dc1508e | vishalgupta84/Programmes | coding/interviewbit/heap/distinct.cpp | #include<iostream>
#include<bits/stdc++.h>
using namespace std;
std::vector<int> solution(std::vector<int> A,int k){
map<int ,int> mp;
std::vector<int> result;
if(A.size()<k)
return result;
int c=0;
for (int i = 0; i < k; ++i)
{
/* code */
if(mp[A[i]]==0)
c++;
mp[A[i]]++;
}
result.push_back(c);
for ... | ALGO | 0.999933 | 4.019094 |
3faf938b-1747-4e52-9a66-9f054c879649 | YuSoeun/2021_Summer_PPS_Group6 | 유소은/4-9.cpp | #include <iostream>
using namespace std;
int main()
{
ios :: sync_with_stdio(0);
cin.tie(0);
int e, s, m; // (1 ≤ E ≤ 15, 1 ≤ S ≤ 28, 1 ≤ M ≤ 19)
int count = 1;
cin >> e >> s >> m;
while (e != 1 || s != 1 || m != 1) {
e--;
s--;
m--;
if (e < 1) e += 15;
... | ALGO | 0.999413 | 3.402373 |
350f04b6-75ea-45be-8ca1-dcae8ed7c3ab | ishandutta2007/codeforces | piyushsethia1999/normal/1167/B.cpp | #include <bits/stdc++.h>
#define pb emplace_back
#define mp make_pair
using namespace std;
int ask(int l, int r) {
cout << "? " << l + 1 << " " << r + 1 << endl;
int n; cin >> n;
return n;
}
void give(std::vector<int>& a) {
cout << "! ";
for (int i = 0; i < 6; ++i) cout << a[i] << " ";
cout << endl;
}
int32_t... | ALGO | 0.999942 | 3.108667 |
80d73dca-1def-4ec4-bc5c-5ce8dadf0be4 | Arihan10/N3XTD | PhysicsSystem.cpp | // PhysicsSystem.cpp
#include "stdafx.h"
#include "PhysicsSystem.h"
#include <algorithm>
#include <cmath>
#include <iostream>
OrientedBox::OrientedBox(const Vector3& pos, const Vector3& size, const Vector3& rotation) {
center = pos;
halfExtents = size;
// Create rotation matrices
const double DEG_TO_R... | ALGO | 0.997395 | 7.49543 |
b45462d7-7c7b-470f-a1a7-900de7501e29 | protik0939/codeforces_problemset | 1000 Ratings/A_Spit_Problem.cpp | /*
________________________________________________________________
Md. Sadat Alam Protik
protik0939
***********************
I Keep Craving Craving
You Don't Know it
But
it's True,
Cool Dude.
***********************
*/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.h... | ALGO | 0.999926 | 3.913775 |
c902ed8d-645a-4661-83fb-eb7e2cf8339b | rokuro3/aizuOnlineJudge | murgeSort.cpp | #include <bits/stdc++.h>
using namespace std;
int cnt;
void merge(vector<int> &A, int left, int mid, int right){
int n1 = mid - left;
int n2 = right - mid;
vector<int> L(n1+1);
vector<int> R(n2+1);
for(int i = 0;i < n1; i++)
L[i] = A[left + i];
for(int i = 0; i < n2; i++)
R[i] =... | ALGO | 0.99998 | 4.283878 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.