uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
4f215c61-e2a3-4cdd-a24b-d5b29107a5dd | bechirzarrouki/java_ML | src/opencv/sources/modules/imgcodecs/src/loadsave.cpp | //
// Loading and saving images.
//
#include "precomp.hpp"
#include "grfmts.hpp"
#include "utils.hpp"
#include "exif.hpp"
#undef min
#undef max
#include <iostream>
#include <fstream>
#include <cerrno>
#include <opencv2/core/utils/logger.hpp>
#include <opencv2/core/utils/configuration.private.hpp>
#include <opencv2/im... | TOOL | 0.969918 | 6.613557 |
e8beef70-33cc-4f11-b0f7-d230deface7f | ShawnHu0815/LeetCode | src/YotaQ3.cpp | //
// Created by Shawn Hu on 2025/7/26.
//
#include "../include/ILeetCodeQuestion.h"
#include <iostream>
using namespace std;
class YotaQ3 : public ILeetCodeQuestion {
public:
void run() override {
cout << "开始运行模板:" << std::endl;
freopen("input.txt", "r", stdin);
solution();
}
private... | ALGO | 0.999888 | 4.317621 |
da8e4b69-a592-417b-a82e-c4c85c3b3644 | AmineAroua/Competitive-programming-solutions | CodeForces/GNU C++17/486C | Palindrome Transformation/179099102.cpp | #include <bits/stdc++.h>
using namespace std;
#define vi vector<int>
#define vl vector<long long>
#define vii vector<pair<int,int>>
#define vll vector<pair<long long,long long>>
#define pb push_back
#define ll long long
#define ld long double
#define nl '\n'
#define boost ios::sync_with_stdio(false)
#define mp make_pai... | ALGO | 0.999935 | 4.030579 |
8e21401c-87a9-4976-825d-c3a893da5ada | Harsh-vardhan-sahu/DSA_Concepts-Questions | linked list/circular_LL.cpp | #include <iostream>
using namespace std;
class Node {
public:
int data;
Node* next;
Node(int val) {
data = val;
next = NULL;
}
};
class List {
Node* head;
Node* tail;
public:
List() {
head = tail = NULL;
}
void push_back(int val) {
Node* newNode = ... | ALGO | 0.999806 | 5.653332 |
f72cdc4b-27b0-43b2-b02c-2fb3136deb3e | RyanPioneer/Codeforces | Codeforces Round 799 (Div. 4)/G. 2^Sort.cpp | /**
* Source: is.gd/xTuFC7
* Date: 2024/4/6
* Time:
* Space:
* Skill:
* Constraints:
*
*/
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <unordered_set>
#include <queue>
#include <numeric>
#include <tuple>
#include <stack>
#include <bitset>
#include <functiona... | ALGO | 0.999658 | 4.922693 |
526618e8-3d67-4c37-93ed-fcf8dbd13ba5 | spin-spin-ryo/contest-practice | solved/ABC338/tempCodeRunnerFile.cpp | #include <iostream>
#include <vector>
#include <tuple>
#include <string>
#include <algorithm>
#include <stack>
#include <utility>
#include <queue>
#include <map>
#include <iomanip>
#include <cmath>
#include <set>
#include <list>
#include <deque>
#include <limits>
#include <atcoder/scc>
using namespace std;
using ll = ... | ALGO | 0.999868 | 5.308093 |
ea0365e0-732e-4a8c-b17d-565353078b26 | wcysai/CodeTemplates | Graph/Flow and cut algorithms/MinCostFlow(SPFA).cpp | #include<bits/stdc++.h>
#define MAXV 500005
#define MAXE 1000005
#define INF 1000000000000000000LL
using namespace std;
typedef long long ll;
typedef pair<ll,int> P;
struct edge{int to,cap; ll cost; int rev;};
int n,m,V,s[MAXV],e[MAXV];
ll w[MAXV];
ll h[MAXV],dist[MAXV];
int prevv[MAXV],preve[MAXV];
vector<edge> G[MAXV... | ALGO | 0.999954 | 3.884824 |
5bb5e643-fd14-45d9-93a9-fecd4c8b7dec | becky4141/1071-c-programming | w08/p2_407410082.cpp | #include<stdio.h>
#include<ctype.h>
#define MAX 100
int prime(int n){
if(n==1) return 0;
for(int i=2;i<=n-1;i++){
if(n%i==0){
return 0;
}
}return 1;
}
int findPrime(int data[],int N1,int N2){
int num=0;
for(int n=N1;n<=N2;n++){
if(prime(n)){
data[num... | ALGO | 0.999703 | 3.41061 |
efc3acba-0883-476e-ab21-735213d70055 | yashp23/ATCD | ATCD/005_P10_operator precedence.CPP | #include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <conio.h>
#define MAX 100
// Precedence table
char precedenceTable[5][5] = {
{'>', '>', '<', '<', '>'}, // +
{'>', '>', '<', '<', '>'}, // -
{'>', '>', '>', '>', '>'}, // *
{'<', '<', '<', '<', '='}, // /
{'>', '>', '>', '>', '>'}... | ALGO | 0.999689 | 6.494969 |
9248faa2-cdca-44fe-961f-66b21cd30212 | ManasviKansal13/DSA | recurssion/1.cpp | #include<bits/stdc++.h>
using namespace std;
int rec(int n){
if(n<1) return 0;
else {
cout<<n;
return rec(n-1);
}
}
int main(){
int a;
cin>>a;
cout<<rec(a);
return 0;
} | ALGO | 0.999847 | 3.757818 |
ab4d8ce2-099e-453d-a5c6-6460eed00d26 | lunadev55/Problems | URI/Beginner/1134.cpp |
// g++ -std=c++11 file.cpp (compile c++11)
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <sstream>
#include <limits.h> // INT_MIN AND INT_MAX
#include <bitset>
#include <cmath>
#define ll long long
using namespace std;
int main() {
int code, alc = 0, gas = 0, die = 0;
... | ALGO | 0.998053 | 4.528158 |
ecd437cb-5270-4cd7-a7e9-cd955547de4c | Yunuskngl/My_Codes | C++/hafta3 soru çözümleri/soru1.cpp | #include <iostream>
using namespace std;
void tersCevir(char *c, int first, int last) {
if (first < last) {
char temp = c[first];
c[first] = c[last];
c[last] = temp;
tersCevir(c, first + 1, last - 1);
}
}
int main() {
const int max_length = 100;
cout << "Bir cumle gir... | ALGO | 0.999782 | 5.6068 |
27758d5a-921a-4635-9500-d7d2b936f625 | FatalTsai/2021Cpp_STL_sytax_survey | apsc325/d034.例題P-3-10.全彩彩帶(需離散化或字典)(@@)3.cpp |
// not AC, problem seen from reginColorType
#include<bits/stdc++.h>
using namespace std;
const int maxN = 200086;
int colors[maxN];
int uniq_color[maxN];
int reginColorType(int len,int n){
int bucket[maxN] = {0};
int ans =-1;
int reiginType=0;
for(int i=0;i<len;i++){
if(bucket[colors[i]] == 0... | ALGO | 0.999898 | 3.640397 |
79ff7f47-d262-408e-bb71-36164ab57821 | batanvlog2503/Code-PTIT-DSA | DSA07015.cpp | #include<bits/stdc++.h>
using namespace std;
int pre(char c){
if(c =='^'){
return 4;
}else if(c == '*' || c == '/'){
return 3;
}else if(c == '+' || c == '-'){
return 2;
}
return 1;
}
vector<string> convert(string s){
vector<string> result;
for(int i =0 ;i < s.length();i++){
if(isdigit(s[i])){
string ... | ALGO | 0.999923 | 4.522973 |
00c695c7-5dc7-40d1-bf3a-2af3c874c0b9 | thanwin84/Searching-and-Sorting | BinarySearch/first_last_occurance.cpp | class Solution {
public:
vector<int> searchRange(vector<int>& nums, int target) {
int first = get_index(nums, target, true);
int second = get_index(nums, target, false);
vector<int> result;
result.push_back(first);
result.push_back(second);
return result;
}
i... | ALGO | 0.999966 | 6.420853 |
a0737df7-d755-4a00-bd9b-8eeb858f6fba | yusifaliyevpro/Competitive-Programming | LeetCode/Easy/3289. The Two Sneaky Numbers of Digitville.cpp | // 3289. The Two Sneaky Numbers of Digitville
// https://leetcode.com/problems/the-two-sneaky-numbers-of-digitville/
#include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
vector<int> getSneakyNumbers(vector<int>& nums) {
}
}; | ALGO | 0.999428 | 4.875426 |
5b8b2009-5a95-48bb-91b1-574415d3e73e | advayaggarwal/Data-Structures-Algorithms | Leetcode/2288.cpp | //Time complexity - O(n), n is the size of sentence
//Space complexity - O(n)
class Solution {
public:
string discountPrices(string sentence, int discount)
{
stringstream ss(sentence);
string s;
vector<string>v;
while (ss >> s) v.push_back(s);
string res;
for (in... | ALGO | 0.995538 | 5.016835 |
75a394d8-26af-4483-8faf-779b8d2a44a5 | itsmeshivam3118/DSA | NOTES dsa/Linked List/check if LL is palindrome.cpp | //https://practice.geeksforgeeks.org/problems/check-if-linked-list-is-pallindrome/1
//https://www.geeksforgeeks.org/function-to-check-if-a-singly-linked-list-is-palindrome/
//https://www.youtube.com/watch?v=aD7mBVnKFEU&list=PLDzeHZWIZsTryvtXdMr6rPh4IDexB5NIA&index=55&ab_channel=CodeHelp-byBabbar
/*struct Node {
in... | ALGO | 0.999729 | 5.5285 |
d849fff3-86a1-40b1-89c2-47cdbed2e661 | thevkp/DSA | Recursion/isSorted.cpp | #include <iostream>
using namespace std;
bool isSorted(int *arr, int n){
if(n == 0 || n == 1)
return true;
if(arr[0] > arr[1])
return false;
else{
bool sorted = isSorted(arr + 1, n - 1);
return sorted;
}
}
int main(){
system("cls");
int size;
cin >> s... | ALGO | 0.999841 | 4.26107 |
535ac0d1-bf92-4f61-ac5e-9f1de98b17c8 | HasanYousef/OOP-course-projects | LodeRunnerProject/src/SmartEnemy.cpp | #pragma once
#include "SmartEnemy.h"
//-----------------------------------------------
SmartEnemy::SmartEnemy() : Enemy() {}
//-----------------------------------------------
SmartEnemy::SmartEnemy(ObjectType t,
const sf::Vector2f& p)
: Enemy(t, p) {}
void SmartEnemy::move(const Map& map, const sf::Vector2f& playe... | TOOL | 0.949469 | 4.279068 |
6f550e6f-578b-47b5-ba70-169c9d5a2760 | 9759176595/GFGPracticeProblems | Non Repeating Numbers.cpp | // { Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
public:
vector<int> singleNumber(vector<int> nums)
{
// Code here.
vector<int>ans;
int n=nums.size();
int xor1=nums[0];
for(int i=1;i<n;i++){
xor1=xo... | ALGO | 0.999985 | 4.935537 |
4fe29fa5-2264-4393-acdd-2828d9be2a0c | AbdurRahimRatulAliKhan/LeetCode-Solutions | C++/minimum-rounds-to-complete-all-tasks.cpp | // Time: O(n)
// Space: O(n)
// math, freq table
class Solution {
public:
int minimumRounds(vector<int>& tasks) {
unordered_map<int, int> cnt;
for (const auto& x : tasks) {
++cnt[x];
}
int result = 0;
for (const auto& [_, v] : cnt) {
if (v == 1) {
... | ALGO | 0.999926 | 5.99981 |
5a181f79-d31f-4624-be23-22b70ab95cb1 | Akhil2844/DATA-STRUCTRUCTORS-ALGORITHMS | 093__GRAPHS DAY 06/topological_sort.cpp | #include <bits/stdc++.h>
using namespace std;
void topsort(int node, stack<int> &s, vector<int> &visited, unordered_map<int, list<int>> &adjList)
{
visited[node] = 1;
for (auto neighbour : adjList[node])
{
if (!visited[neighbour])
{
topsort(neighbour, s, visited, adjList);
... | ALGO | 0.999997 | 6.665335 |
5aa78a89-ff6f-42c1-8639-a8afeee5b894 | dublinbranch/clampedNormalDistribution | clamped.cpp | #include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <random>
#include <string>
class ClampedNormal {
public:
ClampedNormal(double min, double max, double mean, double stddev) {
d = std::normal_distribution<>{mean, stddev};
this->min = min;
this->max = max;
}
do... | ALGO | 0.999537 | 4.652772 |
e4794e39-7828-4b19-9921-96176d2b9f18 | Rudra-Pakhare/socket-programming | client-phase2.cpp | #include <string>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <iostream>
#include <fstream>
#include <cstring>
#include <vector>
#include <dirent.h>
#include <algorithm>
#include <bits/stdc++.h>
#include <thread>
#include <arpa/inet.h>
#include <mutex>
//#include <unistd.h>
std:: mut... | WEB | 0.918081 | 3.183574 |
1b6b5bf5-6e0d-47ce-98a0-3463c6651d23 | ishandutta2007/codeforces | fishcathu/normal/939/F.cpp | #include<bits/stdc++.h>
#define ls i<<1
#define rs i<<1|1
#define fi first
#define se second
#define pb push_back
#define mp make_pair
using namespace std;
typedef long long ll;
typedef vector<int> vct;
typedef pair<int,int> pii;
const int N=1E5+10;
const int inf=0x7f7f7f7f;
ll read()
{
ll a=0;
char b=1,c;
... | ALGO | 0.999881 | 3.619337 |
ca5c9204-59d6-45b4-bf3b-6a4d451c64ff | debugster/UVa | uva-11000.cpp | #include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ULL;
/// number of male bees after N years = number of male bees in (N-1)th year + number of male bees in (N-2)th year + 1
ULL maleBee[51];
ULL femaleBee[51]; /// number of female bees after N years is the (N-1)th Fibonacci number
ULL totalBee[... | ALGO | 0.999835 | 3.957765 |
8d6489c5-5c7e-45fc-9d11-1c83fb30bb5e | 61--/windage | windageFeatures/src/Algorithms/SIFTDetector.cpp | /* ========================================================================
* PROJECT: windage Library
* ========================================================================
* This work is based on the original windage Library developed by
* Woonhyuk Baek (<EMAIL> / <EMAIL>)
* Woontack Woo (<EMAIL>)
* U... | TOOL | 0.863324 | 5.685121 |
090c2b15-f8b9-4b0a-90f6-30782487fe5b | mnink275/SFML-KRPG | core/src/Raycasting/Trace.cpp | #include <Raycasting/Trace.hpp>
#include <cmath>
#include <functional>
#include <stdexcept>
#include <fmt/format.h>
#include <Utils/Assert.hpp>
namespace ink {
namespace {
using TraceType = Trace::TraceType;
using Trace = Trace;
constexpr auto trace_type_initer = [](const sf::VertexArray& line) {
ASSERT(line.g... | ALGO | 0.976032 | 6.986145 |
0ea656b0-9741-4e16-b5be-57a5e98aa479 | Saurav-Navdhare/Dynamic-Programming | CSES/11MC.cpp | #include<iostream>
#include<bits/stdc++.h>
using namespace std;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n, maxSum=0;
cin >> n;
vector<int> coins(n);
for(int i=0; i<n; i++){
cin >> coins[i];
maxSum+=coins[i];
}
/*
// bruteforce: Time Co... | ALGO | 0.999949 | 3.744104 |
956f43d8-3d2e-4912-bed4-864d39e1d54f | OI-wiki/Standard_Code_Library | Graph/cutBridge.cpp | /**
* @Author SCaffrey(<EMAIL>)
* @Copyright SATA
* @Example http://hihocoder.com/problemset/problem/1183
*/
#include <bits/stdc++.h> // NOLINT
#include <cmath> // NOLINT
#include <cstdio> // NOLINT
#include <cstring> // NOLINT
#include <set> // NOLINT
#include <utility> /... | ALGO | 0.999862 | 4.238502 |
2188a5d1-0bac-42d0-b5eb-c42439e979a9 | khaledmorshed/All-programming-sites | Data Structure from w3 Resource/1ReverseWithIterative.cpp |
#include<iostream>
using namespace std;
void insertion();
void print();
struct Node{
int data;
Node* next;
};
Node* ReverseWithIterative(Node* head);
void ReversePrint(Node* head);
Node* head = NULL;
Node* Beftemp;
Node* insertion(Node* head,int value){
Node* temp = new Node();
temp->data = va... | ALGO | 0.999889 | 4.624023 |
4b735c29-b914-45be-803f-6f52b41c78c5 | Mohamedsaied8/EmbeddedLinuxDiploma | ModernCpp/labs/Containers/unordered_map.cpp | #include <iostream>
#include <unordered_map>
#include <string>
int main() {
// Create an unordered_map with string keys and int values
std::unordered_map<std::string, int> myMap;
// Insert elements into the hash table
myMap["apple"] = 1;
myMap["banana"] = 2;
myMap["cherry"] = 3;
// A... | TOOL | 0.917789 | 6.677659 |
9d23d681-48b5-499e-8c1e-c8e109c0153d | IrinaMBejan/Personal-work-contests | Algorithmics/Problems from various contests/oak.cpp | #include <stdio.h>
#include <algorithm>
using namespace std;
long long A,B,X,Y,D,temp,Ans,minK,maxK,T;
int N;
inline long long euclid(long long A,long long B,long long &X,long long &Y )
{
if (B == 0)
{
X = 1;
Y = 0;
return A;
}
long long X0, Y0, D;
D = euclid( B, A % B, X... | ALGO | 0.999776 | 3.589251 |
83577773-4338-4a78-a91b-9f127d37094e | harshitspakhariya/CP.begin-- | price.cpp | #include<iostream>
#include<bits/stdc++.h>
using namespace std;
int main()
{
long long int t,i,j,k;
cin>>t;
for(k=0;k<t;k++)
{
int n,max=1;
cin>>n;
int c=0;
for(i=n;i>0;i=i/10)
c++;
for(i=1;i<c;i++)
{
max=max*10;
}
cout<... | ALGO | 0.999665 | 3.464614 |
32db2fbe-5d2f-44d6-b27a-2c5dff9b6ba7 | Jack1eNgBaro/JustCp | CodeForces/C++17 (GCC 7-32)/1774A | Add Plus Minus Sign/185638652.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
// freopen("input.txt", "r", stdin);
// freopen("output.txt", "w", stdout);
std::ios::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
int tc; cin >> tc;
while(tc--)
{
int n; cin >> n;
char c; cin >> c;
int ok = (c == '1');
for(int i=1;i<n;i++){... | ALGO | 0.99981 | 3.646964 |
1d6047f2-6ac1-4ab0-8348-79adb2f6d4fa | shacojx/SourceCodeGameTLBB | Game/boost/libs/algorithm/string/example/find_example.cpp | // Boost string_algo library example file ---------------------------------//
// See http://www.boost.org for updates, documentation, and revision history.
#include <string>
#include <iostream>
#include <algorithm>
#include <functional>
#include <boost/algorithm/string/case_conv.hpp>
#include <boost/algorithm/stri... | TOOL | 0.995921 | 4.969246 |
ab6c2d54-37eb-4c9b-ad29-c5f1bc227025 | Martell0x1/DSA-Templates | C++/Dijkstra-SPOJ-AdaAndTrip.cpp | struct node{
ll val,cost;
};
struct cmp{
bool operator()(node& a , node&b){
return a.cost > b.cost;
}
};
vector<vector<node>> adj;
vector<ll>dist;
void dijkstra(int s){
priority_queue<node,vector<node>,cmp> pq;
pq.push({s,0});
dist[s]=0;
while(!pq.empty()){
auto [ch,co] = pq.top();
... | ALGO | 0.999978 | 4.42204 |
10991d97-0c9b-434b-9077-a3e3c9e4751f | ustcyyw/algorithm | luogu/dp/queue/ CF1941E.cpp | /**
* @Time : 2024/4/2-4:03 PM
* @Author : yyw@ustc
* @E-mail : <EMAIL>
* @Github : https://github.com/ustcyyw
* @desc :
*/
/*
* 对于每一行 用队列优化dp来计算
* k行的计算 滑动窗口
*/
#include<bits/stdc++.h>
typedef long long ll;
using namespace std;
const int N = 2e5 + 5;
ll T, n, m, k, d, grid[101][N], val[101];
ll cal(ll* ... | ALGO | 0.999947 | 5.461565 |
fdb624c4-ee96-4b70-b4a8-e57dd9f901e6 | perman0519/Problem_Solving | 0x0D_simulation/12100.cpp | #include <iostream>
#include <vector>
#include <queue>
using namespace std;
void slide_left(vector<vector<int> > &table) {
queue<int> q;
for (auto &v : table) {
for (int i = 0; i < v.size(); i++) {
if (v[i] != 0)
q.push(v[i]);
}
int now = 0;
if (!q.empty()) {
now = q.front(); q.pop();
}
int i =... | ALGO | 0.999977 | 4.32385 |
d57b0ebb-06d5-4771-ab97-df6c79328d02 | No-Idle/teambook | algos/modint.cpp | template<int32_t MOD>
struct ModInt {
int32_t value;
ModInt() : value(0) {}
ModInt(long long v) : value(v % MOD) { if (value < 0) value += MOD; }
ModInt(int32_t v): value(v % MOD) { if (value < 0) value += MOD; }
ModInt operator+=(ModInt m) {
value += m.value;
if (value >= MOD) v... | ALGO | 0.999379 | 4.56689 |
84657b5a-3aa1-4e80-be95-0b578a4efbda | ishandutta2007/codeforces | jcvb/normal/1567/F.cpp | #include<stdio.h>
#include<cstring>
#include<cstdlib>
#include<cmath>
#include<iostream>
#include<algorithm>
#include<vector>
#include<map>
#include<set>
#include<queue>
#include<bitset>
#include<utility>
#include<functional>
#include<iomanip>
#include<sstream>
#include<ctime>
#include<cassert>
using namespace std;
#de... | ALGO | 0.999963 | 3.232299 |
5484d1e6-9f82-4371-b273-be88c74be0bb | Eduardofig/Competitive-Programming-Solutions | cf-ladder/ladder-1/57.cpp | #include <bits/stdc++.h>
using namespace std;
using ui = unsigned int;
using l = long;
using ul = unsigned long;
using ll = long long;
using ull = unsigned long long;
const int MXN = 2e5 + 3;
const int INF = 0x3f3f3f3f;
const int MOD = 1e7 + 9;
int n, m;
//int k;
//int a[MXN];
//int b[MXN];
//string s;
void so... | ALGO | 0.999931 | 5.367219 |
1160503d-292d-4fe9-8549-232f8cfea62c | PedroAngeli/Competitive-Programming | Solutions/UVA/1266.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define endl '\n'
#define f first
#define s second
#define ub upper_bound
#define lb lower_bound
#define pb push_back
#define all(c) (c).begin(), (c).end()
#define ... | ALGO | 0.999762 | 3.667989 |
fd45a31a-80f7-40fe-a16f-8639bd4b4672 | kmelnikovmh/TestSys-Cpp | acm26/Task C. Персистентная очередь [0.2 s].cpp |
// Created 29.04.2025 by Melnikov Kirill
#include <vector>
#include <deque>
#include "optimization.h"
struct Operation {
int type;
int value;
};
int n;
std::vector<std::vector<int>> graph_list;
std::vector<Operation> operations;
std::deque<int> queue;
std::vector<int> result;
void... | ALGO | 0.999964 | 4.802339 |
1eeb4bee-c476-41dd-b096-b40c6c66b5f3 | ChoonHean/Kattis | src/putovanje.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef vector<double> vd;
typedef... | ALGO | 0.999939 | 3.784321 |
d4827d1f-e8c0-4002-bcf3-8132445a4b6f | Fhoerth/tda | cpplab/backtracking/clase_26_03_2025/cd.cpp | #include <cassert>
#include <iostream>
class Solution
{
public:
int cd(const std::vector<int> &p, int t) { return backtrack(p, t, 0); }
private:
int backtrack(const std::vector<int> &p, int t, int i)
{
if (t < 0)
return std::numeric_limits<int>::min();
if (i == p.size())
... | ALGO | 0.999549 | 5.736519 |
7e2f1b60-da2a-49ac-9cea-8b7a9dfcbcf8 | kaikerochaalves/ClassicalModels | meu_venv/lib/python3.12/site-packages/sklearn/utils/src/MurmurHash3.cpp | // Note - The x86 and x64 versions do _not_ produce the same results, as the
// algorithms are optimized for their respective platforms. You can still
// compile and run any of them on any platform, but your performance with the
// non-native version will be less than optimal.
#include "MurmurHash3.h"
//-------------... | ALGO | 0.998721 | 7.198757 |
43023381-cba6-45ac-94e2-197bd69fc8c0 | FabioNevesRezende/cpp-design-patterns-examples | structural/composite.cpp | #include <iostream>
#include <vector>
using namespace std;
class Product
{
public:
virtual double price() const = 0;
virtual ~Product() = default;
};
class Book : public Product
{
public:
Book(const string& title, double price) : m_Title(title), m_Price(price) {}
double price() const override
{
... | TOOL | 0.920688 | 6.273356 |
cd464b6a-e93f-4f8b-8a71-ce91cee0eebc | maspypy/library | test/2_library_checker/data_structure/dynamic_point_rectangle_affine_rectangle_sum.test.cpp | #define PROBLEM "https://judge.yosupo.jp/problem/dynamic_point_set_rectangle_affine_rectangle_sum"
#include "my_template.hpp"
#include "other/io.hpp"
#include "ds/kdtree/kdtree_acted_monoid.hpp"
#include "mod/modint.hpp"
#include "alg/monoid/affine.hpp"
#include "alg/monoid/add_pair.hpp"
using mint = modint998;
struc... | ALGO | 0.998345 | 5.544313 |
a25f9b61-99cf-4457-99f4-a3339e456401 | primiano/pdfium-merge | xfa/src/fxbarcode/qrcode/BC_QRCoderMaskUtil.cpp | #include "xfa/src/fxbarcode/barcode.h"
#include "xfa/src/fxbarcode/common/BC_CommonByteMatrix.h"
#include "BC_QRCoderErrorCorrectionLevel.h"
#include "BC_QRCoder.h"
#include "BC_QRCoderMaskUtil.h"
CBC_QRCoderMaskUtil::CBC_QRCoderMaskUtil() {}
CBC_QRCoderMaskUtil::~CBC_QRCoderMaskUtil() {}
int32_t CBC_QRCoderMaskUtil::A... | ALGO | 0.991569 | 4.570773 |
3ebbba8c-b748-48ed-b815-c4f2d11c4eb0 | yeewang/llvm-project | llvm/lib/Analysis/AliasSetTracker.cpp | #include "llvm/Analysis/AliasSetTracker.h"
#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/Analysis/GuardUtils.h"
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/Analysis/MemoryLocation.h"
#include "llvm/Analysis/MemorySSA.h"
#include "llvm/Config/llvm-config.h"
#include "llvm/IR/Constants.h"
#include "llvm/... | TOOL | 0.867016 | 7.695856 |
13a6479d-f535-4f0e-99a9-de674f40c1f5 | vneiger/pml | ntl-extras/mat_lzz_pX_extra/src/mat_lzz_pX_middle_product.cpp | #include "lzz_p_extra.h"
#include "thresholds_matrix_multiply.h"
#include "thresholds_matrix_middle_product.h"
#include "lzz_pX_middle_product.h"
#include "mat_lzz_pX_multiply.h"
PML_START_IMPL
/*------------------------------------------------------------*/
/* returns trunc( trunc(a, dA+1)*c div x^dA, dB+1 ) ... | ALGO | 0.999964 | 4.067071 |
46361600-c668-4d0d-9bb6-203d79d6e41a | Frontasttttttt/ITStep-HomeWork | C++/Цикли 2/4.cpp | #include <iostream>
using namespace std;
int main() {
int A;
cout << "Enter number >>> ";
cin >> A;
for (int B = 1; B <= A; B++) {
if (A % (B * B) == 0 && A % (B * B * B) != 0) {
cout << B << " ";
}
}
cout << endl;
} | ALGO | 0.999804 | 3.964299 |
6ce54027-65bb-4c44-a436-da7bebc97dae | jiahengcen/Android12Framework | frameworks/av/media/libeffects/lvm/lib/SpectrumAnalyzer/src/LVPSA_QPD_Init.cpp | #include "LVPSA_QPD.h"
/************************************************************************************/
/* */
/* FUNCTION: LVPSA_QPD_Init */
/* ... | TOOL | 0.955931 | 5.494559 |
e14d62fc-3919-4901-9fb6-469cc92fd566 | slitvinov/lammps-sph-multiphase | src/USER-REAXC/reaxc_nonbonded.cpp | #include "pair_reax_c.h"
#include "reaxc_types.h"
#include "reaxc_nonbonded.h"
#include "reaxc_bond_orders.h"
#include "reaxc_list.h"
#include "reaxc_vector.h"
void vdW_Coulomb_Energy( reax_system *system, control_params *control,
simulation_data *data, storage *workspace,
... | ALGO | 0.999836 | 5.575598 |
5dfb4d05-76f2-48c9-ba36-564c99db95cc | addytrunks/DATA_STRUCTURES | LINKED LIST/LIST_ARRAY.cpp | // Array implementation of List ADT
#include <stdio.h>
#include <stdlib.h>
#define SIZE 5
class List
{
int arr[SIZE];
int curr;
public:
List()
{
curr = -1;
}
int insbeg(int);
int insend(int);
int insposition(int, int);
int search(int);
int delend();
int delbegin();... | ALGO | 0.998561 | 4.298742 |
0beddce6-6f11-423d-b777-6b8262608526 | sarvex/leetcode-jai | solution/1400-1499/1448.Count Good Nodes in Binary Tree/Solution.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.999897 | 6.477651 |
cb96dc98-f7f2-4f5e-82c8-ec91f8d6af21 | nvnamsss/leetcode | Count Complete Subarrays in an Array/main.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution
{
public:
int countCompleteSubarrays(vector<int> &nums)
{
int l = 0;
int r = 0;
unordered_map<int, int> mp;
unordered_map<int, int> m;
for (int i = 0; i < nums.size(); ++i) {
m[nums[i]]++;
}... | ALGO | 0.999969 | 5.96801 |
9b8ddd50-75ce-4d00-af7f-52cb4656f8c5 | AbhisekhNayek/Placement-Series-DSA | HEAPS/KthSmallestElement.cpp | #include <bits/stdc++.h>
using namespace std ;
class Solution {
public:
void kth_Largest_And_Smallest_By_AscendingOrder(vector<int>&arr, int k) {
sort(arr.begin(), arr.end()) ;
int n = arr.size() ;
cout << "kth Largest element " << arr[n - k] << ", " <<
"kth Smallest element " <<... | ALGO | 0.999918 | 4.351255 |
38a5669b-3dc8-40c4-9ddf-e382acbd993f | AhmedElmougy/Dijkstra | vertex.cpp | #include <iostream>
#include <vector>
#include "vertex.h"
using namespace std;
//=================================================//
//Class constructors
//=================================================//
//default void constructor
Vertex::Vertex(): VertexName(0), ConnectedVertexName(0), Conne... | ALGO | 0.959746 | 3.416393 |
61edf1f0-45f6-4134-907d-f10d5b447acc | Kowsihan-sk/HackerRank-Solutions | Algorithm/Implementation/Easy/Counting-Valleys.cpp | #include <bits/stdc++.h>
using namespace std;
// Complete the countingValleys function below.
int countingValleys(int n, string s)
{
int count = 0;
int sea_level = 0, flag = 0;
for (int i = 0; i < s.length(); i++)
{
if (s[i] == 'U')
{
sea_level--;
flag = 1;
... | ALGO | 0.999992 | 5.635789 |
564da8a1-a15b-4fa2-a52c-80f2f19af430 | Anushka-ece/Codecorner | bipartite.cpp | #include<iostream>
#include<vector>
using namespace std;
vector<vector<int>>adj;//we have declared adjacency matrix globally
vector<bool>visited;//this vector is to check that node has been visited or not
vector<int>color;//this one isto check the coloring order on the basis of which we are going to detremine that the ... | ALGO | 0.999959 | 5.548223 |
680711b5-1088-43cc-b04f-f3729ca41182 | ishandutta2007/codeforces | nigus/normal/825/B.cpp | #include <bits/stdc++.h>
using namespace std;
using namespace std::chrono;
#define rep(i,a,b) for(int i = a;i<(b);++i)
#define trav(a,v) for(auto& a : v)
#define all(x) x.begin(), x.end()
#define sz(x) (int)(x).size()
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef vector<int> vi;
ll... | ALGO | 0.999782 | 4.38911 |
561d321b-dfbb-49ec-82ce-e5ba11b8a63a | martinnff/physarum-simulation | eigen-3.4.0/doc/snippets/EigenSolver_EigenSolver_MatrixType.cpp | MatrixXd A = MatrixXd::Random(6,6);
cout << "Here is a random 6x6 matrix, A:" << endl << A << endl << endl;
EigenSolver<MatrixXd> es(A);
cout << "The eigenvalues of A are:" << endl << es.eigenvalues() << endl;
cout << "The matrix of eigenvectors, V, is:" << endl << es.eigenvectors() << endl << endl;
complex<double> l... | ALGO | 0.999156 | 3.093769 |
93ae0a6e-a7d0-4de0-8e96-22b12f52dfad | ishandutta2007/codeforces | djq_cpp/normal/1603/A.cpp | #include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (int)(n); i ++)
#define rep1(i, n) for(int i = 1; i <= (int)(n); i ++)
#define MP make_pair
using namespace std;
typedef long long LL;
typedef pair<int, int> PII;
const int MOD = 998244353;
int n, a[300005];
LL gcd(LL x, LL y)
{
return y == 0 ? x : gcd(y,... | ALGO | 0.999369 | 4.550065 |
12bada92-174f-4ebd-aee1-05ef6a26a343 | pross1312/Gomoku | source/ThreatDetector.cpp | #include "ThreatDetector.h"
#include <raylib.h>
#include <cassert>
const ThreatDetector::Cache cache;
ThreatDetector::Cache::Cache() {
FILE *file = fopen(".cache", "rb");
if (file != NULL) {
const size_t count = fread(table, sizeof(*table), CACHE_SIZE, file);
TraceLog(LOG_INFO, "Read %zu bytes... | ALGO | 0.983718 | 5.576451 |
3775a1ce-e86d-41b1-8e37-1d6b14d0bc2e | lorq8189/kalman | eigen-3.4.0/bench/benchmark-blocking-sizes.cpp | #include <iostream>
#include <cstdint>
#include <cstdlib>
#include <vector>
#include <fstream>
#include <memory>
#include <cstdio>
bool eigen_use_specific_block_size;
int eigen_block_size_k, eigen_block_size_m, eigen_block_size_n;
#define EIGEN_TEST_SPECIFIC_BLOCKING_SIZES eigen_use_specific_block_size
#define EIGEN_T... | TOOL | 0.88123 | 5.95051 |
743c09ef-434e-4bff-ad00-560b3229b077 | ccritne/SfmlPlotCpp | SfmlPlotCpp/Plot/lib/Evaluate.cpp | #include "../include/Evaluate.hpp"
std::vector<std::string> functions{ "sin", "cos", "tan", "cotan", "arcsin", "arccos", "arctan", "arccotan", "sqrt", "log_2", "ln", "log_3", "log_4", "log_5", "log_6", "log_7", "log_8", "log_9", "log", "abs" };
bool isFunction(std::string op){
if (std::find(functions.begin(), fu... | ALGO | 0.998606 | 4.668164 |
140fc250-7894-421d-be6f-ebfbddb662a9 | sagsango/cp | code/leetcode/wc281/d.cpp | class Solution {
public:
long long countPairs(vector<int>& nums, int k) {
int bit = 0;
map<int,int> given;
for (int i=2; i<=k; ++i){
while( k % i == 0){
given[i] += 1;
k /= i;
bit += 1;
}
}
... | ALGO | 0.999928 | 5.042449 |
ef3ab961-4a8e-40e8-afef-e6ca11f28ee6 | ElinaKaram/MyString2 | MyString2/Source.cpp | #include <iostream>
using namespace std;
class MyString
{
char* str;
int length;
public:
MyString()
{
length = 80;
str = new char[length + 1];
}
MyString(int size)
{
length = size;
str = new char[length + 1];
}
MyString(const char* input)
... | TOOL | 0.957546 | 3.883203 |
18118ef5-4894-4ec2-b842-d0e542423a99 | AlvaroBarroso/tiny_manna | remake/tp1/tiny_manna.cpp | /*
Jueguito:
1) Sea h[i] el numero de granitos en el sitio i, 0<i<N-1.
2) Si h[i]>1 el sitio i esta "activo".
3) Al tiempo t, un sitio "activo" se "descarga" completamente tirando cada uno de sus granitos aleatoriamente y con igual probabilidad a la izquierda o a la derecha (el numero total de granitos entonces se c... | ALGO | 0.999902 | 4.88094 |
d06124ca-9373-4d96-976e-06c4a05a222c | MayankD409/HumanDetectionandTracking | libs/tracking/src.cpp | /**
* @file src.cpp
* @author Lowell Lobo
* @author Mayank Deshpande
* @author Kautilya Chappidi
* @brief Class Decleration for the TrackingClass
* @version 0.1
* @date 2023-10-23
*
* @copyright Copyright (c) 2023
*
*/
#include "tracking.hpp"
/**
* @brief Default constructor.
*/
TrackingClass::TrackingCla... | ALGO | 0.967103 | 6.172158 |
4612335a-d2a7-4774-a33c-faba4a934f4c | mma10/6Companies30days | Adobe/Q13.cpp | // { Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function Template for C++
class Solution {
public:
int getLIS(vector<int> &a){
int n = a.size();
int len = 0;
vector<int> tail(n,-1);
for(int num : a){
int l =... | ALGO | 0.99998 | 5.374799 |
79312c2a-baaa-4199-bbf8-12bb2741b1a1 | dhirajbennadi/PosixThreads | posixConditionVariable.cpp | #include <iostream>
#include <pthread.h>
#include <unistd.h>
using namespace std;
#define MAX_COUNT 12
#define COUNT_TRIGGER 10
#define NUM_THREADS 3
//Global Variable to keep track of the count
int count = 0;
pthread_mutex_t mtx;
pthread_cond_t count_conditionVar;
//Struct to store Thread details
struct threadInf... | TOOL | 0.948129 | 5.13126 |
24ad37d5-d490-4194-9f96-796cd8663f82 | ANKAN257/DSA-problems | stack_&_queue/stack_using_single_queue.cpp | #include <bits/stdc++.h>
using namespace std;
class StackUsingQueue {
queue<int> q1, q2;
public:
void push(int val) {
// q2.push(val);// it uses double queuu
int n=q1.size();
q1.push(val);
for(int i=0;i<n;i++){
q1.push(q1.front());
q1.pop();
}
... | ALGO | 0.999345 | 5.289083 |
0e2f6c5f-008d-4475-9c6a-6c0c1fe0aad2 | gabrielaramirezgarcia/Estructura | Parcial2/listas/listas2/main.cpp | #include <cstdlib>
#include <iostream>
#include "funciones.h"
using namespace std;
int main () {
list lista;
int dato;
iniciar(lista);
while(dato != -1){
cout<<".- ";
cin>>dato;
if(dato != -1)
insertarAlfinal(lista, dato);
}
imprimir(lista);
}
| TOOL | 0.932989 | 3.93547 |
107feb1b-1d7b-41d7-aadd-6e202b538145 | yzz951029/leetcodePractice | 19.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
ListNode* removeNthFromEnd(ListNode* head, int n) {
ListNode *current = head;
int size = 0;
while (current)
{
size++;
current = ... | ALGO | 0.999973 | 5.757033 |
c733bcaa-375f-4483-8b21-1fad109928e0 | Muller-Castro/Minesweeper | thirdparty/Encryptions/Encryptions/CAST256.cpp | #include "CAST256.h"
uint32_t CAST256::F1(const uint32_t Data, const uint32_t Kmi, const uint8_t Kri){
uint32_t temp = ROL((Kmi + Data) & mod32, Kri, 32);
uint8_t Ia = temp >> 24, Ib = (temp >> 16) & 255, Ic = (temp >> 8) & 255, Id = temp & 255;
return ((CAST_S1[Ia] ^ CAST_S2[Ib]) - CAST_S3[Ic] + CAST_S4[I... | ALGO | 0.999121 | 6.743987 |
a8e29347-a938-4b45-aacd-f2d77d46e823 | gaoyb7/ACM-templates | computationalGeometry/minimumEnclosingCircle.cpp | circle mincir(point *p, int n) {
random_shuffle(p, p + n);
point c = p[0];
double r = 0;
for (int i = 1; i < n; ++i) {
if (dcmp(abs(p[i] - c) - r) <= 0) continue;
c = p[i]; r = 0;
for (int j = 0; j < i; ++j) {
if (dcmp(abs(p[j] - c) - r) <= 0) continue;
c = (p[i] + p[j]) * 0.5; r = abs(p[i] - p[j]) * 0... | ALGO | 0.999865 | 5.058605 |
6ec6ea3e-c1f5-46bc-8c92-e244e965f752 | davehorton/pcap_ripper | deps/boost_1_65_1/libs/mpi/example/random_gather.cpp | // An example using Boost.MPI's gather()
#include <boost/mpi.hpp>
#include <iostream>
#include <cstdlib>
namespace mpi = boost::mpi;
int main(int argc, char* argv[])
{
mpi::environment env(argc, argv);
mpi::communicator world;
std::srand(time(0) + world.rank());
int my_number = std::rand();
if (world.rank(... | ALGO | 0.988343 | 4.981463 |
5d859050-5374-4f25-90e0-993eebcf1978 | catinello/openbsd-release | gnu/llvm/clang/tools/driver/cc1gen_reproducer_main.cpp | #include "clang/Basic/Diagnostic.h"
#include "clang/Basic/LLVM.h"
#include "clang/Driver/Compilation.h"
#include "clang/Driver/Driver.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/Host.h"
#include "llvm/Support/TargetSelect.h"
#include "llv... | TOOL | 0.909808 | 7.524997 |
258cc9e3-5548-463e-8cd6-2cdb3801132c | yeewang/llvm-project | libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/make.heap/make_heap_comp.pass.cpp | // <algorithm>
// template<RandomAccessIterator Iter, StrictWeakOrder<auto, Iter::value_type> Compare>
// requires ShuffleIterator<Iter> && CopyConstructible<Compare>
// void
// make_heap(Iter first, Iter last, Compare comp);
#include <algorithm>
#include <functional>
#include <memory>
#include <random>
#includ... | TEST | 0.986465 | 5.853155 |
20e3999a-a5c1-4bc2-bdb9-ca7d9e7880d4 | mitsociety/kalender_hgt | 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 |
230d9cd4-21aa-4a74-a194-dadfda086527 | uve-project/uve | dev/qscintilla/qscintilla_uve/lexers/LexAU3.cpp | #include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <stdarg.h>
#include <assert.h>
#include <ctype.h>
#include "ILexer.h"
#include "Scintilla.h"
#include "SciLexer.h"
#include "WordList.h"
#include "LexAccessor.h"
#include "Accessor.h"
#include "StyleContext.h"
#include "CharacterSet.h"
#include "Lexe... | TOOL | 0.859989 | 5.003083 |
b7cf9ae4-d987-46ef-93ea-9b3017dda681 | aosp-hybris/platform_frameworks_av | media/libstagefright/codecs/amrwb/src/band_pass_6k_7k.cpp | /*
------------------------------------------------------------------------------
Filename: band_pass_6k_7k.cpp
Date: 05/08/2004
------------------------------------------------------------------------------
REVISION HISTORY
Description:
---------------------------------------------------------------------... | ALGO | 0.999868 | 5.550101 |
58062c65-892d-4b5e-8512-0a05c3f65e66 | Dishant402955/DSA | Practice-Questions/Leetcode/2163.Minimum-Difference-in-Sums-After-Removal-of-Elements.cpp | class Solution {
public:
#define ll long long
long long minimumDifference(vector<int>& nums) {
int n = nums.size()/3;
vector<ll>prefix(nums.size(),-1),suffix(nums.size(),-1);
priority_queue<ll>pq;
ll sum = 0;
for(int i=0;i<nums.size();i++){
sum += nums[i];
... | ALGO | 0.999841 | 5.345176 |
a225f189-429c-4eab-acd3-fb4a7bba6b51 | matriiix67/interview | jzOffer/v2.0/09.cpp | //
// Created by Bourne on 2018/3/14.
//
// 动态规划,解决fibonacci的普通递归低效率问题
#include <vector>
#include <iostream>
using namespace std;
class Solution {
public:
long long Fibonacci(unsigned int n) {
int result[2] = {0, 1};
if(n < 2)
return result[n];
long long fibNMinusOne = 1;
... | ALGO | 0.999524 | 5.36566 |
39427588-1305-4a8f-9736-555833492d4b | jdoerfert/cudaomp | libcxx/test/std/algorithms/alg.modifying.operations/alg.replace/replace_if.pass.cpp | // <algorithm>
// template<ForwardIterator Iter, Predicate<auto, Iter::value_type> Pred, class T>
// requires OutputIterator<Iter, Iter::reference>
// && OutputIterator<Iter, const T&>
// && CopyConstructible<Pred>
// constexpr void // constexpr after C++17
// replace_if(Iter first, Iter las... | TEST | 0.976669 | 6.961407 |
13f0a698-3c15-4794-9403-6d95b68e6e04 | yz523/Drexel | Computer-Programming-II/L6/quickSort.cpp | //----------------------------------------------------------------------------
//
//-------------------------------- Quick Sort --------------------------------
//
//----------------------------------------------------------------------------
//
// Name : QuickSort
//
// Sorts vector using QuickSort
//
// Author : ... | ALGO | 0.99976 | 5.290074 |
45fc5ede-375e-4f40-8445-9386dcfb1d46 | WLM-Git/leetcode150 | 209.cpp | //#include<iostream>
//#include<vector>
//using namespace std;
//
//int minSubArrayLen(int target, vector<int>& nums);
//
//int main()
//{
// vector<int> arr{ 1,1,1,1,1,1,1,1 };
// cout << minSubArrayLen(11, arr);
// return 0;
//}
//
//int minSubArrayLen(int target, vector<int>& nums)
//{
// int L = 0;
// int R = 0;
//... | ALGO | 0.999962 | 5.525854 |
ed5b8bdf-d12a-4bd2-bda3-7900ea0fb28f | VIKASNI-S/DATA-STRUCTURE | Lab-12/Adjacency_Matrix.cpp | #include <stdio.h>
#include <stdlib.h>
#define MAX_NODES 10 // Maximum number of nodes in the graph
// Function to initialize the adjacency matrix
void initializeMatrix(int matrix[MAX_NODES][MAX_NODES], int nodes) {
for (int i = 0; i < nodes; i++) {
for (int j = 0; j < nodes; j++) {
matrix[i]... | ALGO | 0.99958 | 6.8751 |
e1f676de-eb74-4e90-84a0-c03a39845039 | sarvex/leetcode-machine | solution/1600-1699/1606.Find Servers That Handled Most Number of Requests/Solution.cpp | class Solution {
public:
vector<int> busiestServers(int k, vector<int>& arrival, vector<int>& load) {
set<int> free;
for (int i = 0; i < k; ++i) free.insert(i);
priority_queue<pair<int, int>, vector<pair<int, int>>, greater<>> busy;
vector<int> cnt(k);
for (int i = 0; i < arr... | ALGO | 0.999986 | 5.599161 |
bbebe032-7f3c-4443-ac34-c05980c6d489 | AI1379/OILearning | Practices/Training/Competition/SummerVacation/20190724/source/jn02-38_192.168.100.38_褚健/love.cpp | #include<cstdio>
#include<iostream>
#include<queue>
#include<cmath>
#include<cstring>
typedef unsigned long long ULL;
using namespace std;
ULL l,r,ans;
int T,lenl,lenr,lent,first_zero_l,first_zero_r,time_zero_r;
int binl[100],binr[100];
int main()
{
freopen("love.in","r",stdin);
freopen("love.out","w",stdout);
sca... | ALGO | 0.999902 | 3.812011 |
ea9de47a-af13-410a-a6ab-edcae253ec92 | AmanjotSingh0908/DSA_Problems | CodeChef/Algozenith/Ravens Messenger.cpp | #include <iostream>
#include <vector>
using namespace std;
const int MOD = 1e9 + 7;
int main() {
long long M, N;
cin >> M >> N;
vector<long long> difficulties(N);
long long totalXor = 0;
// Read all difficulty values and calculate their XOR
for (int i = 0; i < N; ++i) {
cin >> diffic... | ALGO | 0.999999 | 5.616691 |
4141886c-914c-4178-9f61-551059d4187c | pasjans05/aghFibonacci | main.cpp | #include <iostream>
using namespace std;
bool spr(long long int a)
{
long long int n = 0;
long long int fib = 0;
long long int poprz = 0;
long long int ost = 0;
while (fib <= a)
{
if (n == 0) fib = 0;
else if (n == 1) fib = 1;
else if (n > 1) fib = poprz + ost;
long long int n2 = 0;
lon... | ALGO | 0.999827 | 5.095796 |
42ffbb80-e7bb-49bd-9e23-a659d889484e | jishu-yadav/6Companies30Days | q8.cpp | // { Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
int CountWays(string s){
if(s[0] == '0')
return 0;
int n = s.size();
long long int mod = 1e9 + 7;
vector<long long int>dp(n+1, 0);
dp[0] = dp[1] = 1;
for(int i = 1; i <... | ALGO | 0.999671 | 5.87923 |
b6ff7c09-bafd-4e74-842c-cb4c59b7456d | rsnemmen/Chombo | lib/src/BoxTools/BoxLayout.cpp | #ifdef CH_LANG_CC
#endif
#include <iostream>
#include <algorithm>
#include "BoxLayout.H"
#include "DataIterator.H"
#include "TimedDataIterator.H"
#include "LayoutIterator.H"
#include "SPMD.H"
#include "parstream.H"
#include "CH_Timer.H"
#include "LayoutData.H"
#include "NamespaceHeader.H"
using std::ostream;
///
vo... | TOOL | 0.899424 | 5.924688 |
41257241-68e1-497e-99b3-ef22cd166940 | priyendumori/APS_Assignment2 | Q4_2018201103.cpp | /*
Priyendu Mori
2018201103
Q4 - Unordered_map
*/
#include<bits/stdc++.h>
#define ll long long
#define BUCKETS 100
#define prime 31
using namespace std;
/*
class of Unordered map that accepts two generic data type T as key and U as value
class contains methods and variables of Unordered map
*/
te... | ALGO | 0.974651 | 3.993386 |
4bf07e9a-a401-4274-ab54-9c80ebb68f28 | Zachdav/Systems-Programming | 2. Labs/Lab 01/Program/lab01.cpp | //Zachary Davis 811-960-668 cs1730
//Basic includes to stream inputs and outputs to and from the user.
#include <iostream>
#include <cstdlib>
//The actual single unsigned integer variable storing the users numbers.
unsigned int userNumberStorage=0;
//The setValue() function takes the users data entry and organizes i... | ALGO | 0.959722 | 3.507687 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.