uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
d6491968-b7bb-4fc2-bc48-666a8458c41e | ishandutta2007/codeforces | sooke/normal/631/D.cpp | #include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <iostream>
#include <algorithm>
#define SQR(x) ((x) * (x))
#define ABS(x) ((x) < 0 ? -(x) : (x))
#define LOWBIT(x) ((x) & -(x))
#define MAX(x, y) ((x) > (y) ? (x) : (y))
#define MIN(x, y) ((x) < (y) ? (x) : (y))
#define SWAP(x, y) ((x) ^... | ALGO | 0.999928 | 3.504164 |
a21fe842-3f43-40ca-9a84-daa2cb3ca562 | raincross7/code-similarity | codes/train_code/problem072/problem072_196.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll MOD = pow(10, 9) + 7;
//const ll MOD = 998244353;
//const ll MOD = ;
ll mod(ll A, ll M) {return (A % M + M) % M;}
const ll INF = 1LL << 60;
template<class T> bool chmin(T& a, T b) {if (a > b) {a = b; return true;} return false;}
template<class... | ALGO | 0.999997 | 3.672239 |
932ab862-5440-4d80-b0a0-c70da7e7acbd | blasbarbagelata/modelo-y-simulacion | TP2/atomics/hybrid/crossdetect.cpp | #include "crossdetect.h"
void crossdetect::init(double t,...) {
//The 'parameters' variable contains the parameters transferred from the editor.
va_list parameters;
va_start(parameters,t);
//To get a parameter: %Name% = va_arg(parameters,%Type%)
//where:
// %Name% is the parameter name
// %Type% is the parame... | ALGO | 0.993354 | 4.301742 |
16ef711c-1f9a-442a-abb9-92e8b9dfc05e | Alex-Criwer/Algorithms | RM(S)Q/N_segment_tree.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <numeric>
template<class T>
class MIN {
public:
static const int neutralElement = std::numeric_limits<int>::max();
T operator()(const T &lhs, const T &rhs) {
return std::gcd(lhs, rhs);
}
};
template<class T, clas... | ALGO | 0.999906 | 5.251411 |
32a3aadd-f6e1-4070-9d22-e5d10ee1790c | openharmony-research/dteegen | test/distributed_face_recognition_tf/insecure/ncnn_retinanet.rv/ncnn/layer/x86/bias_x86_avx512.cpp | #include "bias_x86_avx512.h"
#if __SSE2__
#include <emmintrin.h>
#if __AVX__
#include <immintrin.h>
#endif // __AVX__
#endif // __SSE2__
namespace ncnn {
int Bias_x86_avx512::forward_inplace(Mat& bottom_top_blob, const Option& opt) const
{
int w = bottom_top_blob.w;
int h = bottom_top_blob.h;
int d = bot... | ALGO | 0.921052 | 6.183944 |
530d45de-1ee1-476e-949c-361d90009a0c | BioinformaticsToolsmith/LtrDetector | src/tr/PairContainer.cpp | #include "PairContainer.h"
#include <iostream>
#include "Candidate.h"
#include <tuple>
#include <iterator>
#include <list>
#include <math.h>
using namespace std;
namespace tr{
PairContainer::PairContainer(int minDistIn,int maxDistIn,int diffTolIn){
minDistance = minDistIn;
maxDistance = maxDistI... | ALGO | 0.993917 | 4.742661 |
eaabfb56-51a7-451f-b125-db8ec989ac38 | 07ritvik/DSA-practice | 142-linked-list-cycle-ii/142-linked-list-cycle-ii.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
ListNode *detectCycle(ListNode *head) {
if(head==NULL || head->next==NULL ) return NULL;
ListNode* slow=head;
... | ALGO | 0.999914 | 5.336655 |
4d457ebf-2c7d-4e5a-8a90-30752b60adde | longcule/BT-LTNC-INT2215-22 | BT10-LTNC/A4-BT10.cpp | #include <iostream>
using namespace std;
struct Point
{
int x,y;
void Print()
{
cout<<&x<<" "<<&y;
}
};
int main()
{
Point p;
cin>>p.x>>p.y;
p.Print();
system("pause");
return 0;
}
//v?i m?i bi?n in ra d?a ch? khc nhau
| TOOL | 0.89656 | 3.825421 |
6db7d0ff-fee7-4855-8f39-fcddf74a6d50 | aman1ahrwr/DSA | Union of two arrays.cpp | int doUnion(int a[], int n, int b[], int m) {
unordered_set<int> s;
for(int i=0; i<n; i++){
s.insert(a[i]);
}
for(int j=0; j<m; j++){
s.insert(b[j]);
}
return s.size();
}
| ALGO | 0.996688 | 4.578434 |
255f8db6-b095-4fd2-9fd9-7cd07f6573b3 | Ryexocious/problemsolving | ncpc2023/anagramagain.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vec;
typedef map<string,int> mp;
#define cy cout<<"YES"<<endl;
#define cn cout<<"NO"<<endl;
#define all(x) (x).begin(), (x).end()
#define fast ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define pb push_back
#define pob... | ALGO | 0.99976 | 4.11686 |
35a379a3-49a5-4ad6-955b-65bc0127c0ca | MalachiTimothyPhillips/olcf-crusher-slow-mpi-bw | src/elliptic/ellipticMultiGridSchwarz.cpp | #include <type_traits>
#include "elliptic.h"
#include <vector>
#include <algorithm>
#include <math.h>
#include <cctype>
#include <string>
#include <sstream>
#include <exception>
#include "platform.hpp"
struct ElementLengths
{
dfloat* length_left_x;
dfloat* length_left_y;
dfloat* length_left_z;
dfloat* length_m... | ALGO | 0.999074 | 4.176982 |
a3b0b290-fff4-4e1e-86db-631d509764d8 | harsh-haria/c-plus-plus | DS/test_LL_reversal_iterative.cpp | #include<iostream>
#include "linked_list_intro.cpp"
using namespace std;
int main(){
node* head = NULL;
for(int i=1;i<11;i++){
insertAtTale(head,i);
}
display(head);
node* temp = head;
node* newhead = reverse_without_rec(temp);
display(newhead);
temp = newhead;
node* headnew... | ALGO | 0.927561 | 4.535957 |
1aa7028a-19c9-4017-8a8d-a96febb26eb7 | ENAMINE1/CP-JOURNEY | QUESTIONS/ATC/DP/S - Digit Sum.cpp | // Date: 01-07-2024
// Start Time: 18:17:25
// End Time : 19:06:40
// Time Taken: 49 minutes
// Author: Shashwat Kumar
// QUESTION LINK: https://atcoder.jp/contests/dp/tasks/dp_s
// Rating: Medium
// Description: find the number of integers in a range divisble by x
// Solved: No
// Learning: DIGIT DP
/**************... | ALGO | 0.999969 | 6.494478 |
725ba465-2f74-4047-9eca-992cf32c213b | paulmcquad/cpp23 | 2-Functions/whilechessboard.cpp | //******************************************************************
// Chessboard program
// This program prints a chessboard pattern that is built up from
// basic strings of white and black characters.
//******************************************************************
#include <iostream>
#include <string>
#includ... | ALGO | 0.966918 | 5.796006 |
88235f7f-d7a5-4faf-9aa1-b711608e79e9 | ishandutta2007/codeforces | zdolny_kaczor/normal/1156/G.cpp | //nie, 3 cze 2018, 13:38:19 CEST
//Konrad Paluszek, University of Warsaw (former XIV LO Staszic)
# include <bits/stdc++.h>
using namespace std;
#define FOR(i, b, e) for (int i = (b); i <= (int)(e); ++i)
#define REP(i, n) for (int i = 0; i < (int)(n); ++i)
#define FORD(i, b, e) for (int i = (b); i >= (int)(e); --i)
#def... | ALGO | 0.999786 | 3.954165 |
27fb3a80-ce6b-4ec0-95c3-8c360571fdea | IanDeHaan/uva-solutions | problems/121/57.cpp | #include <iostream>
using namespace std;
int main() {
int t;
cin >> t;
for (int cs = 1; cs <= t; cs++) {
int mile = 0;
int juice = 0;
int n;
cin >> n;
for (int i = 0; i < n; i++) {
int x;
cin >> x;
mile += ((x/30)+1)*10;
... | ALGO | 0.999018 | 3.935067 |
c3619bbc-2276-44ec-897a-81479f12c489 | shwetaboora/DSACodes | Questions/Basic/ncr.cpp | #include <iostream>
using namespace std;
int factorial(int n)
{
int fact = 1;
for (int i = 1; i <= n; i++)
{
fact *= i;
}
return fact;
}
int ncr(int n, int r)
{
int c;
c = factorial(n) / ((factorial(n - r)) * factorial(r));
return c;
}
int main()
{
int n, r;
cin >> n >>... | ALGO | 0.999858 | 5.812876 |
af1785a4-e785-47f5-aa1e-cbbf3581a6fe | knud-ecae/test | libraries/Histogram/histogram.cpp | //
//
// FILE: Histogram.h
// AUTHOR: Rob Tillaart
// VERSION: 0.1.04
// PURPOSE: Histogram library for Arduino
// DATE: 2012-11-10
//
// Released to the public domain
//
// HISTORY:
// 0.1.0 - 2012-11-10 initial version
// 0.1.1 - 2012-11-10 added PMF() and CDF()
// 0.1.2 - 2012-12-23 changed float to double; s... | ALGO | 0.972525 | 5.272721 |
9a6ae5dc-4d01-4248-8804-cd97f9f35e0b | pentium3/2014-ICPC-Regional | 2014省赛模板/New folder/2013工管5班英语听力/2013210127李茜/双百/动态规划/LIS/poj2533.cpp | #include "iostream"
#include "fstream"
using namespace std;
double f[1001],a[1001];
int main()
{
#define fin cin
ifstream fin("in.txt");
int n;
cin>>n;
for(int i=1;i<=n;i++)
cin>>a[i];
f[1]=a[1];
int sum=1;
for(int i=2;i<=n;i++)
{
int left=1,right=sum;
while(lef... | ALGO | 0.999975 | 3.631603 |
49a665c1-0b92-4c43-9761-9e0d5209bffe | saalim24/cp | B_Balanced_Tunnel.cpp | #include <bits/stdc++.h>
using namespace std;
#define line '\n'
#define all(a) a.begin(), a.end()
#define get(_24) \
int _24; \
cin >> _24
#define gett(_08, _09) \
int _08, _09; \
cin >> _08 >> _09
#define gettt(_10, _11, _12) \
int _10, _11, _12; \
cin >> _10 >> _11 >> _12
using... | ALGO | 0.999744 | 3.388197 |
9cd777ed-01c3-4bc5-88ec-ee5f29aa918f | Ash0369/LeetCode | 2592.cpp | //Method-1 :
class Solution
{
public:
int maximizeGreatness(vector<int>& nums)
{
multiset<int>st(nums.begin(),nums.end());
sort(nums.begin(),nums.end());
int ans=0;
for(auto x:nums)
{
auto ind=st.upper_bound(x);
if(ind==st.end())
{
... | ALGO | 0.999959 | 5.637916 |
ec2436ac-c486-4f32-8545-9eed383e14c7 | KYENS/gem5_v20.1_ramulator | src/systemc/tests/systemc/misc/unit/data/datawidth_unsigned/promote/datawidth.cpp | /*****************************************************************************
datawidth.cpp --
Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
*****************************************************************************/
/**************************************************************************... | ALGO | 0.960585 | 5.331775 |
a9b58644-1ffe-41ed-aa1e-47e4decc5776 | xdlianrong/Maskchain | libsnark/libsnark-n1/gadgetlib2/constraint.cpp | /** @file
*****************************************************************************
Implementation of the Constraint class.
*****************************************************************************
* @author This file is part of libsnark, developed by SCIPR Lab
* and contributors (see AUTHO... | TOOL | 0.947526 | 6.446737 |
b5a41b55-f2aa-4ccf-b798-4c21a40e22f8 | raincross7/code-similarity | codes/train_code/problem158/problem158_183.cpp | #include <vector>
#include <stack>
#include <queue>
#include <list>
#include <bitset>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>
#include <numeric>
#include <iostream>
#include <iomanip>
#include <string>
#include <chrono>
#include <random>
#include <cmath>
#inc... | ALGO | 0.999191 | 3.564656 |
f9eaa8ad-8016-4a0e-8826-c3435a66e243 | Mohammed-Alzawawi/ThanaTraining | DreamoonandStairs2.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int n, m;
cin >> n >> m;
if(n < m)
return cout << -1, 0;
int solution = n / 2 + n % 2;
int numberofsplit = n / 2;
int targetNumber = solution + (m - solution % m) % m;
if(targetNumber - solution > numberofsplit){
cou... | ALGO | 0.999992 | 3.756936 |
447938a3-4acc-42dd-963e-5468da19bcc2 | mishtiaqparis/mrworker | 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.998841 | 6.783336 |
d8afb1c5-d5e9-48f5-b200-5357c7a6f4d9 | tayu0110/atcoder | abc/abc4c.cpp | #include<iostream>
#include<iomanip>
#include<string>
#include<vector>
#include<algorithm>
#include<utility>
#include<tuple>
#include<map>
#include<queue>
#include<deque>
#include<set>
#include<stack>
#include<numeric>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<cassert>
using namespa... | ALGO | 0.999971 | 3.294274 |
0cfe8383-21a1-4bd6-9a8d-d6dc67b13168 | 46ccac1474d000676430445ffc4b160a/CPP_OOP_QT | Pr6/Pr6/fraction.cpp | #include "fraction.h"
Fraction& Fraction::shorten()
{
int a = abs(ch), b = zn;
while (a && b)
if (a >= b) a %= b;
else b %= a;
int bcd = a | b;
ch /= bcd;
zn /= bcd;
return *this;
}
Fraction::Fraction() :
ch(0), zn(1)
{
}
Fraction::Fraction(const Fraction &x) :
ch(x... | TOOL | 0.890912 | 4.509631 |
f35effac-b199-46a8-aa8a-dd7c5b46a25a | f0cusPie/SP-IVT-20-2b | 11/11.4 - Queues/STL-implementation/stlQueue.cpp | #include <iostream>
#include <queue>
#define INPUT_MESSAGE "Enter item's count of new queue:"
#define NEW_INPUT_MESSAGE "Enter queue's index where you'll add new word:"
using namespace std;
int ReadNaturalNum()
{
int x;
do cin >> x; while (x <= 0);
return x;
}
queue<char*> NewQueue(int queueLength)
{
... | ALGO | 0.905185 | 4.231538 |
7942c12a-0c45-4f66-a9d9-323ad19c1882 | alexandraback/datacollection | solutions_1485488_0/C++/Leonid/main.cpp | #include <iostream>
using namespace std;
#include <iostream>
#include <sstream>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <cctype>
#include <cstdlib>
#include <cstdio>
#include <cassert>
#include <vector>
#include <map>
#include <string>
#include <deque>
#include <stack>
#include <queue>
#inclu... | ALGO | 0.999254 | 3.566759 |
9f77b1e2-bb6a-4796-84ad-19ddea91597c | Mahadsid/DSA | Lecture036 Recursion Day6/quickSort.cpp | #include<iostream>
using namespace std;
int partition( int arr[], int s, int e) {
int pivot = arr[s];
int cnt = 0;
for(int i = s+1; i<=e; i++) {
if(arr[i] <=pivot) {
cnt++;
}
}
//place pivot at right position
int pivotIndex = s + cnt;
swap(arr[pivotIndex], arr... | ALGO | 0.99997 | 4.929666 |
b706dc05-e843-4c00-aedb-c8502796ac03 | Tarela4ka/Programming | Olimpiads/InnopolisOpen/I/B.cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long int
#define fr(i, a, b) for (int i = (a); i <= (b); ++i)
#define rf(i, a, b) for (int i = (a); i >= (b); --i)
#define fe(x, y) for (auto& x : y)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define mk(a,b) make_pair(a,b)
using... | ALGO | 0.999944 | 4.042543 |
74e69c2d-51bd-4e35-a14b-9efd576104d0 | TosakaUCW/CompetitiveProgramming | 蓝桥杯/蓝桥杯模拟赛/B.cpp | #include <bits/stdc++.h>
using i64 = long long;
#define int i64
#define pb push_back
#define ep emplace
#define eb emplace_back
using std::cerr;
using std::max;
using std::min;
using std::swap;
using std::cin;
using std::cout;
using std::string;
using std::vector;
int read(int x = 0, int f = 0, char ch = getchar()) {
... | ALGO | 0.999204 | 4.612181 |
55230fb4-d728-44f8-8c7c-74248cf43a3b | tsai1247/LeetcodePractice | Algorithms/000643- Maximum Average Subarray I/Solution.cpp | #include<bits/stdc++.h>
#include "../../Assert.h"
using namespace std;
// Time complexity: O( n )
// Space complexity: O( 1 )
class Solution {
public:
double findMaxAverage(vector<int>& nums, int k) {
auto left = 0;
auto right = left + k;
auto sum = 0;
for(int i=left; i<right; i++)
... | ALGO | 0.999505 | 6.048562 |
054aede1-b759-45cc-bd46-c4019c335cdc | aroragarvit/c-Object_oriented | c++/14_multivevel_inheritance.cpp | // multilevel inheritance a---> b -----> c
#include<iostream>
using namespace std;
class student {
protected:
int roll_no;
public:
void set_roll_no(int);
void get_roll_no();
};
void student :: set_roll_no( int r ){
roll_no=r;
}
void student :: get_roll_no() {
cout<<"the roll number ... | TOOL | 0.876817 | 3.959627 |
874eb793-6f1e-453e-b663-68c22f279632 | chrstncrrnd/aoc-2024 | day_1/part_two.cpp | #include <fstream>
#include <iostream>
#include <unordered_map>
#define INPUT_FILE "./input.txt"
int main() {
std::unordered_map<int, int> mapA;
std::unordered_map<int, int> mapB;
std::ifstream inputfile(INPUT_FILE);
std::string line;
if (inputfile.is_open()){
while (std::getline(inputfile, line)){
... | ALGO | 0.998594 | 4.494273 |
bd61b38b-cb6c-4a47-b704-78ddbc0e0c33 | kireb1298/RepositorioLocal | C++/EstructuraCondicional/1-Par o impar.cpp | //Diga si un numero es par o impar
#include <iostream>
using namespace std;
int main()
{
int n; // n= numero
cout << "Ingrese el numero que desee evaluar: ";
cin >> n;
if (n % 2 == 0)
cout << "El numero es par";
else
cout << "el numero es impar";
return 0;
} | ALGO | 0.99691 | 3.254211 |
b4d99bd5-5343-4a12-8ebd-c5a5089455fb | chipsenter/Cplusplus | SwitchChallenge/main.cpp | #include <iostream>
using namespace std;
int main() {
int day_code {};
cout << "Enter a day code between 0-6 : ";
cin >> day_code;
switch (day_code) {
case 0:
cout << "Sunday";
break;
case 1:
cout << "Monday";
break;
cas... | TOOL | 0.959751 | 3.736451 |
94dff54d-5c87-4408-a490-4c73f4c8b9d8 | dimanaStoyanova7/LeetCode-Solutions | best-time-to-buy-and-sell-stock-with-cooldown.cpp | class Solution {
public int maxProfit(int[] prices) {
//dp problem where we track states
if (prices == null || prices.length == 0 || prices.length == 1) return 0;
int[] hold = new int[prices.length]; // max profit on i-th day by doing holding
// ... | ALGO | 0.999354 | 5.248788 |
eae01109-dd4b-4f0c-a89c-598b0a06d5d1 | stevenbai0724/DMOJ-Solutions | VM7WC/vmss7wc16c3p3.cpp | //https://dmoj.ca/problem/vmss7wc16c3p3
#include <bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
cin.tie(nullptr)->sync_with_stdio(false);
int n, m, b, que;
cin>>n>>m>>b>>que;
vector<vector<pair<int, int>>>adj(n+1);
priority_queue<pair<int, int>, vector<pair<int, int>>, gr... | ALGO | 0.999947 | 4.42997 |
91040d1f-0536-43bd-b70e-87ebeed3694a | abhimanyu0055/UCS712 | DAA/ass1/3.cpp | #include<iostream>
using namespace std;
int partition(int arr[],int left,int right)
{
int pivot= arr[right];
int i= left-1;
for(int j=left;j<right;j++)
{
if(arr[j]<pivot)
{
i++;
swap(arr[j],arr[i]);
}
}
i++;
swap(arr[i],arr[right]);
retu... | ALGO | 0.999942 | 4.983995 |
5b13f0a5-b149-4a3c-ae7d-8f4b20243013 | ArturRegadas/Competitive_Programming | OBI/2024/1°fase/relogio.cpp | #include <cstdio>
using namespace std;
int main(){
int h, m, s, i;
int nh, nm, ns;
scanf("%d%d%d%d", &h, &m, &s, &i);
ns = (s+i)%60;
i = (s+i)/60;
nm = (m+i)%60;
i = (m+i)/60;
nh = (h+i)%24;
printf("%d\n%d\n%d\n", nh, nm, ns);
return 0;
} | ALGO | 0.988573 | 3.043553 |
116a5396-f872-4c95-b395-41c682d318b4 | kshitijm45/LeetCode | longest-common-prefix/Accepted/12-5-2024, 11_19_32 PM/Solution.cpp | // https://leetcode.com/problems/longest-common-prefix
class Solution {
public:
string longestCommonPrefix(vector<string>& strs) {
string ans = "";
int i = 0, flag=0;
while(i < strs[0].size()) {
char c = strs[0][i];
for(int j=1; j<strs.size(); j++) {
... | ALGO | 0.999899 | 5.949305 |
536729cd-96b3-48f6-b5da-7098636ad6e5 | Enotissimo/C | while2^r.cpp | /*
Дано натуральное число N. Найти наименьшее натуральное число r, такое, что 2^r ≥N.
Входные данные:
Одно натуральное число N.
Выходные данные:
Число r.
*/
#include <stdio.h>
int main() {
int n, r = 1;
scanf("%d", &n);
while (pow(2, r) < n) {
r++;
}
printf("%d", r);
return 0;
} | ALGO | 0.999926 | 5.612872 |
b7c4c8a0-b356-4037-a0a5-0421df2d1fd9 | tasnimtushi/AAD-Algorithms | insertionSort.cpp |
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
int arr[n];
for(int i= 0;i<n;i++){
cin>>arr[i];
}
for(int i=1;i<n;i++){
int current = arr[i];
int j =i-1;
while(arr[j]>current && j>=0)
{
arr[j+1]=arr[j];
... | ALGO | 0.999996 | 4.059072 |
0a9e0467-ff93-4c07-88ec-e531dd2a332b | PranshuSrivastava/Data-Structures-And-Algorithms | 55-jump-game/55-jump-game.cpp | class Solution {
public:
bool canJump(vector<int>& nums) {
int a =0;
for(int i = 0;i<nums.size();++i)
{
if(a<i)
return 0;
if(i==nums.size()-1)
return 1;
a = max(a,i+nums[i]);
}
return 1;
}
}; | ALGO | 0.999972 | 5.847691 |
87bcbd8c-4021-4985-b9fe-fbb5aab3f55f | Zakonildo/FEI-Computer-Science-Road | 7th Semester/CC7261 - Sistemas Distribuídos/speedup-thread/speedup-thread.cpp | // Authors: Rafael Z. Palierini and Rubens de A. R. Mendes.
// Data: August 28th, 2021.
// Libraries
#include <iostream>
#include <fstream>
#include <string>
#include <thread>
#include <chrono>
// ============================================================
// IMPORTANTE
// =====================================... | ALGO | 0.997882 | 4.06978 |
4458c44c-7ee0-42b1-91b2-85f9edd271fe | parkjunhwan4104/OOP | week11/11_problem1.cpp | #include <iostream>
/*
template <typename T>
void swap(T& x, T& y) {
T tmp = x;
x = y;
y = tmp;
}
int main() {
int a = 1;
int b = 2;
float c = 3.3;
float d = 4.4;
swap(a, b);
swap(c, d);
std::cout << "a: " << a << ", b: " << b << std::endl;
std::cout << "c: " << c << ", d: " << d << std::endl;
return 0;
}
... | ALGO | 0.98683 | 4.7698 |
2565f814-c0d0-4776-b203-f01546f263df | IamAnkit19/Codes | C++ Programs/DSA/Leetcode/Problem1900-TheEarliestAndLatestRoundsWherePlayersCompete.cpp | // Problem No: 1900
// Date: 12/07/2025
// Day: Saturday
#include<iostream>
#include<vector>
#include<unordered_map>
#include<queue>
#include<algorithm>
#include<set>
using namespace std;
class Solution {
public:
int mn = INT64_MAX;
int mx = INT64_MIN;
void dfs(vector<int>& arr, int round, int firstPlayer... | ALGO | 0.999977 | 5.304116 |
9e1282e6-bfb5-4a0d-97c1-3bb227fb8073 | Mr-Bangladesh/Problem-Solving | Toph/Maximum Subtree Sum.cpp | /**In the name of Allah, the Most Merciful, the Most Merciful.**/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define INF 9223372036854775806
#define pb push_back
#define mp make_pair
#define MOD 1000000007
#define PI 2*acos(0.0)
#define EPS 1e-9
#include <ext/pb_... | ALGO | 0.999601 | 4.113613 |
0eb57e89-bb6c-40f8-af9c-07812bf109bf | agormley3424/Inverse-Kinematics | eigen/doc/examples/Tutorial_ArrayClass_interop.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace Eigen;
using namespace std;
int main()
{
MatrixXf m(2,2);
MatrixXf n(2,2);
MatrixXf result(2,2);
m << 1,2,
3,4;
n << 5,6,
7,8;
result = (m.array() + 4).matrix() * m;
cout << "-- Combination 1: --" << endl << result << endl << e... | ALGO | 0.999729 | 4.541065 |
c0210161-aeab-4c09-9dd0-580164144b78 | icoretic44/OLP | segtree_itez1.cpp | #include<bits/stdc++.h>
using namespace std;
const int N = 1e5+15;
const int INF = 1e9;
int ST[4*N];
int a[N];
void build(int id,int l,int r)
{
if(l==r)
{
ST[id] = a[l];
return ;
}
int mid = (l+r)/2;
build(id*2,l,mid);
build(id*2+1,mid+1,r);
ST[id] = max(ST[id*2],ST[id*2+1]);... | ALGO | 0.999988 | 4.755686 |
a96b181a-996c-4b3e-b4f2-45901ad11a7f | abo3abd-y/Data-Structures | Chapter 7 Stack/7.2LinkedListStack.cpp | #include <iostream>
using namespace std;
// here we are representing stack as linked lists which might be easier depending on your preferences
struct Node {
int data;
Node *next;
};
Node *top = nullptr;
bool isEmpty (Node *topNode) {
if(!topNode) {return true;}
return false;
}
bool isFull () {
... | ALGO | 0.99512 | 4.578237 |
2a77c1e1-516a-461e-b708-fa03e64e684c | svdprima/Grasshopper | main.cpp | #include <chrono>
#include <iostream>
#include <string>
#include "encryptor.hpp"
class Timer
{
public:
void Start()
{
t1 = std::chrono::high_resolution_clock::now();
}
void Finish()
{
t2 = std::chrono::high_resolution_clock::now();
}
uint64_t GetMilliseconds()
{
... | TOOL | 0.897289 | 5.355759 |
f964b7ca-f8b2-404b-8828-1962157091e5 | Wsh7Ash/LEETCODE | cpp/c501-1000/692.cpp | class Solution {
public:
vector<string> topKFrequent(vector<string>& words, int k) {
unordered_map<string, int> fm;
for(const string& word : words){
fm[word]++;
}
vector<pair<string, int>> fv(fm.begin(), fm.end());
sort(fv.begin(), ... | ALGO | 0.999963 | 6.562273 |
1a005881-7f32-418c-a6e3-0a22aa0a81ab | Furcev/root_assignments | ex11/ex11.cpp | #include <fstream>
#include <TMath.h>
#include <TCanvas.h>
#include <iostream>
#include <TH1D.h>
#include <TMinuit.h>
#include <TF1.h>
#include <TFile.h>
double chiSquare;
double signalCounts[100];
double noiseCounts[100];
double noiseErrors[100];
double signalErrors[100];
double xValues[100];
void ReadHistogramFr... | ALGO | 0.986765 | 6.046171 |
7cecee38-68fc-48df-8f9c-35efe192cbd8 | jiiink/Algorithms | PA06/pa06_mcoloring.cpp | #include <bits/stdc++.h>
using namespace std;
#define vvb vector<vector<bool>>
int n = 0;
int m = 0;
int search_count = 0;
vector<vector<int>> solutions;
vector<int> vcolor;
vvb graph;
void input() {
cin >> n >> m;
for (int i=0; i<n; i++) {
vector<bool> row;
bool unit;
vcolor.push_ba... | ALGO | 0.999925 | 5.276801 |
93fa08a3-93bb-41ce-8471-6ec12e9914e0 | aportelli/LatAnalyze | utils/sample-plot-corr.cpp | #include <LatAnalyze/Core/OptParser.hpp>
#include <LatAnalyze/Io/Io.hpp>
#include <LatAnalyze/Core/Math.hpp>
#include <LatAnalyze/Core/Plot.hpp>
using namespace std;
using namespace Latan;
using namespace Math;
int main(int argc, char *argv[])
{
OptParser opt;
bool parsed;
string ou... | TOOL | 0.851747 | 5.565691 |
ded541a9-5c4c-4e2a-b03f-ea6949419b12 | Mohammad-Ashikul-Islam/Competitive_Programming | Codeforces/A. Spell Check.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
string s="Timur";
sort(s.begin(),s.end());
ll t;
cin >> t;
while(t--){
ll n;
cin >> n;
string p;
cin >> p;
sort(p.begin(),p.end());
if(s==p) cout << "YES\n";
else ... | ALGO | 0.99995 | 4.64297 |
d32536eb-b051-4b25-91eb-030fd177126b | stupend-geek7/ALL_DSA_Codes | Arrays/ThreeSum.cpp | #include<bits/stdc++.h>
using namespace std;
int32_t main()
{
int n;
cin>>n;
int target;
cin>>target;
int a[n];
for(int i=0;i<n;i++)
{
cin>>a[i];
}
bool found =false;
sort(a,a+n);
for(int i=0;i<n;i++)
{
int lo=i+1;int high=n-1;
while(lo<high)
... | ALGO | 0.999929 | 4.792277 |
5e956d79-cffe-4530-a7c6-c0e7f3a8236f | team-vigir/vigir_footstep_planning_basics | vigir_footstep_planning_lib/src/modeling/footstep.cpp | // SVN $HeadURL: https://alufr-ros-pkg.googlecode.com/svn/trunk/humanoid_navigation/footstep_planner/src/Dstar.cpp $
// SVN $Id: Dstar.cpp 1168 2011-03-30 03:18:02Z <EMAIL> $
#include <vigir_footstep_planning_lib/modeling/footstep.h>
namespace vigir_footstep_planning
{
Footstep::Footstep(double x, double y, double th... | ALGO | 0.998523 | 6.134816 |
2e770758-905d-4c0e-918b-bce02a618d9b | welandx/rand | add.cpp | #include <fstream>
#include <iostream>
#include <random>
using namespace std;
int main() {
random_device seed;
mt19937 gen(seed());
uniform_real_distribution<> dis1(-1, 1 / 4);
uniform_real_distribution<> dis2(0, 1);
uniform_real_distribution<> dis3(1, 1 / 2);
string file_name = "add.txt";
ofstream ofs(fi... | ALGO | 0.976124 | 3.352524 |
ded87e4f-d9a0-4980-8f40-4ed96e14d254 | mdmasidulhasan27/Toph-Problems-Solution | Divisors.cpp | #include <stdio.h>
#include<math.h>
main ()
{
int a, i;
scanf("%d",&a);
for(i=1; i<=a/2; i++){
if(a%i==0)
printf("%d\n",i);
}
printf("%d\n",a);
return 0;
}
| ALGO | 0.999755 | 3.056349 |
798e29e8-266f-4706-90d3-3c4a4f42f48d | anonymouss/my-leetcode-cpp | target_to_the_offer/31-validate-stack-seq.cpp | #include <iostream>
#include <vector>
#include <stack>
class Solution {
public:
bool validateStackSequences(std::vector<int> &pushed, std::vector<int> &popped) {
std::stack<int> stack;
auto i = 0;
for (auto &e : pushed) {
stack.push(e);
while (!stack.empty() && stack... | ALGO | 0.997793 | 6.601928 |
2e628a2f-02dd-454d-9ebe-5efb949195de | KwiatkowskiML/CUDA_KMEANS | KmeansCalculator.cpp | #include "KmeansCalculator.h"
#include "CpuKmeans.h"
cudaError_t KmeansCalculator::calculateElapsedTime(cudaEvent_t start, cudaEvent_t stop, float* milliseconds, const char* message)
{
cudaError_t cudaStatus;
cudaStatus = cudaEventRecord(stop, 0);
if (cudaStatus != cudaSuccess)
return cudaStatus;
... | ALGO | 0.910503 | 5.825788 |
df3cec88-5d25-4f70-a31b-5c887682ac41 | edrosten/tag | test/sim.cpp | #include <iostream>
#include <vector>
#include <tag/absorient.h>
using namespace std;
using namespace TooN;
using namespace tag;
typedef vector<Vector<3> > Points;
double inline rand_u(){
return (double)rand()/RAND_MAX;
}
double inline rand_u(double from, double to){
return from + (to - from)*rand_u();
}
... | TEST | 0.962562 | 5.29798 |
55782ad6-534f-4e36-a630-c8358faf1979 | MuizZer07/Online-Problems | UVA/11727/11727.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int t;
cin >> t;
for(int i=1; i<=t; i++){
int a[3];
for(int j=0; j<3; j++)
cin >> a[j];
sort(a, a+3);
cout << "Case " << i << ": "<< a[1]<< endl;
}
return 0;
}
| ALGO | 0.999524 | 3.884072 |
b0cf21dc-b6c0-4332-809b-a9611612dfad | Toysoft/enigma2_0924 | lib/dvb/sec.cpp | #include <lib/dvb/dvb.h>
#include <lib/dvb/sec.h>
#include <lib/dvb/rotor_calc.h>
#include <lib/dvb/dvbtime.h>
#include <set>
#include <lib/base/eerror.h>
#define SEC_DEBUG
#ifdef SEC_DEBUG
#define eSecDebug(arg...) eDebug(arg)
#else
#define eSecDebug(arg...)
#endif
DEFINE_REF(eDVBSatelliteEquipmentControl);
eDVB... | TOOL | 0.941742 | 5.85897 |
8802900f-c604-4db6-aaed-16e01f1b4dc2 | sds108/dugit | src/include/include.cpp | #include "include.h"
char* get_shell () {
return getenv("SHELL"); // envariables do not have to be freed
}
std::string* get_ppid () {
/*
To prevent race conditions
between different terminal
windows using dugit, the
terminal window ppid can
be used to decide who owns
the .lock file.
*/
... | TOOL | 0.948699 | 3.934863 |
bdbb8f19-e5e0-4725-a6c8-b6e459bc9188 | wotsushi/competitive-programming | abc/016/b.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vi;
#define REP(i, n) for (ll i = 0; i < (n); ++i)
#define OUT(x) cout << (x) << endl;
#define OUTA(a, n) \
REP(i, n) { cout << (a[i]) << (i == n - 1 ? "\n" : " "); }
#define ALL(a) (a).begin(), (a).end()
#define SORT(a) sort(ALL... | ALGO | 0.99999 | 4.470365 |
1247dcec-dd6d-408a-b395-451ecc0607d3 | rehohoho/Vitis-Tutorials | Hardware_Acceleration/Design_Tutorials/02-bloom/reference_files/run_split_buffer.cpp | #include <vector>
#include <cstdio>
#include <ctime>
#include "xcl2.hpp"
#include "sizes.h"
#include "common.h"
using namespace std;
using namespace std::chrono;
string kernel_name = "runOnfpga";
const char* kernel_name_charptr = kernel_name.c_str();
unsigned int bloom_filter_size = 1L<<bloom_size;
unsigned int prof... | ALGO | 0.99603 | 5.808038 |
ee78a86d-4f69-453d-89e1-38361c501ead | icicinskas/chess | src/movegen.cpp | #include <cassert>
#include "movegen.h"
#include "position.h"
namespace Stockfish {
namespace {
template<GenType Type, Direction D>
ExtMove* make_promotions(ExtMove* moveList, Square to) {
if (Type == CAPTURES || Type == EVASIONS || Type == NON_EVASIONS)
*moveList++ = make<PROMOTION>(to - D, to, QU... | ALGO | 0.918725 | 6.856052 |
112658cf-9944-4913-84b5-91e758a5f584 | pratyush2905/cfprog | C_Grouping_Increases.cpp | #include <bits/stdc++.h>
#define int long long
#define fr(a, b) for (int i = a; i < b; i++)
#define rep(i, a, b) for (int i = a; i < b; i++)
#define all(x) (x).begin(), (x).end()
#define mod 1000000007
using namespace std;
void solve()
{
int n;
cin>>n;
int v[n];
rep(i,0,n)
{
cin>>v[i];
}... | ALGO | 0.999872 | 5.24169 |
c391d941-dc57-48f3-a5bb-d31c4d3f95e5 | mgoffan/AirHockey-Box2D | AirHockey/libs/Box2D/Dynamics/Joints/b2LineJoint.cpp | #include <Box2D/Dynamics/Joints/b2LineJoint.h>
#include <Box2D/Dynamics/b2Body.h>
#include <Box2D/Dynamics/b2TimeStep.h>
// Linear constraint (point-to-line)
// d = p2 - p1 = x2 + r2 - x1 - r1
// C = dot(perp, d)
// Cdot = dot(d, cross(w1, perp)) + dot(perp, v2 + cross(w2, r2) - v1 - cross(w1, r1))
// = -dot(perp... | ALGO | 0.998761 | 5.338198 |
e813bdd1-a865-4d7b-8d71-0302840286f2 | xLLLxLLLx/xLLLx | cf/1156/D.cpp | #include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<queue>
#include<vector>
#include<cmath>
#define fr(i,x,y) for(int i=x;i<=y;++i)
#define rf(i,x,y) for(int i=x;i>=y;--i)
#define ll long long
using namespace std;
const int N=2e5+10;
struct data{
int nt,to,w;
}a[2][N<<1];
ll ans=0;
int ... | ALGO | 0.999973 | 3.935417 |
7367b71e-0473-4b8b-a894-1b8225bfc171 | jz769491062/Leetcode_Self | Code/Array/MonoStack/503. 下一个更大元素 II.cpp | class Solution {
public:
vector<int> nextGreaterElements(vector<int>& nums) {
stack<int> stk;
int n = nums.size();
vector<int> result(n);
// 解决循环数组问题技巧;把数组长度翻倍,然后求模获得循环后的长度
for(int i = n * 2 - 1; i >= 0; i--) {
while (!stk.empty() && nums[i % n] >= stk.top()) {
... | ALGO | 0.999984 | 5.696769 |
677fc40b-6c54-45a0-be7f-c189d427f84a | Dhruv385/LeetType | Majority Element - GFG/majority-element.cpp | //{ Driver Code Starts
//Initial template for C++
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function template for C++
class Solution{
public:
// Function to find majority element in the array
// a: input array
// size: size of input array
int majorityElement(int a[]... | ALGO | 0.999853 | 5.565081 |
9424fc63-f077-459c-b36d-cf276811a960 | Accelerator043/SC | StatComp21037/src/Rcpp.cpp | #include <Rcpp.h>
using namespace Rcpp;
//' @title A Gibbs sampler using Rcpp
//' @description A Gibbs sampler using Rcpp
//' @param N the number of samples
//' @param thin the number of between-sample random numbers
//' @param n a parameter of the binomial distribution
//' @param a a parameter of the beta df
//' @par... | ALGO | 0.984362 | 5.828995 |
371925cc-cdbf-4147-9860-01e1c9292d73 | minttea25/AlgorithmPractice | Algorithm Sample Codes/ManzarMyers.cpp | #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
vector<int> buildSuffixArray(const string &s) {
int n = s.size();
vector<int> suffixArray(n), rank(n), tmpRank(n);
// 초기 접미사 정렬: 한 글자만 보고 사전순 정렬
for (int i = 0; i < n; i++) {
suffixArray[i] = i;
... | ALGO | 0.999808 | 6.297791 |
029136cd-75fc-475d-ba65-fbd79cf681a1 | RKMVCC-BSc-Comp-Sci-2020-21/Programming-C-Cpp-Sem1 | March/Volume of a sphear.cpp | #include<iostream>
using namespace std;
int main ()
{
int red1;
float vol;
cout<<"Calculate the volume of sphear : \n";
cout<<"............................\n";
cout<<"Enter the radious of the sphear : \n";
cin>>vol;
vol=(4*3.14*red1*red1*red1)/3;
cout<<"The volume of the sphear is : "<<vol<<endl;
cout<<endl;
return ... | ALGO | 0.918893 | 3.176082 |
3ec0a0d3-8686-46e3-99cd-546d18c6777f | Radon-Rodion/DLL-with-API-changing-string-in-process-memory | MemoryChangingLib/MemChanger.cpp | #include "pch.h" // use stdafx.h in Visual Studio 2017 and earlier
#include <utility>
#include <limits.h>
#include "MemChanger.h"
int fMatchCheck(char* mainstr, int mainstrLen, char* checkstr, int checkstrLen) {
/*
.
""
.
*/
BOOL fmcret = TRUE;
int x, y;
for (x = 0; x < mains... | TOOL | 0.890122 | 3.561805 |
b75d98ba-4d3b-4f0e-819a-45874cc19bb8 | WeiHe999/dmoj_cpp_level_2 | level-2/A Subarray Problem.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
cin.tie(0); cout.tie(0); cin.sync_with_stdio(0);
int n, a, max_ind = 0, min_ind = INT_MAX, len = 0, s = 0;
cin >> n;
unordered_map <int, int> index;
for (int x = 0; x < n; x++)
{
cin >> a;
index[a] = x + 1;
}
for... | ALGO | 0.999867 | 4.089647 |
374b4598-257d-4acf-ac65-1245c0d1059a | istakhar1/competitive_Coding | codeforce/849/b.cpp | #include<bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// using namespace __gnu_pbds;
using namespace std;
#define ff first
#define ss second
#define int long long
#define pb push_back
#define mp make_pair
#define pii pair<int,in... | ALGO | 0.999963 | 4.751445 |
706148a3-19e3-44b7-9490-751a47c89fcb | OpenDigitalTwin-Dev/FENGSim | toolkit/Geometry/gmsh_4_14_0/contrib/Netgen/libsrc/meshing/secondorder.cpp | #include <mystdlib.h>
#include "meshing.hpp"
namespace netgen
{
void Refinement :: MakeSecondOrder (Mesh & mesh) const
{
const_cast<Refinement&> (*this).MakeSecondOrder(mesh);
}
void Refinement :: MakeSecondOrder (Mesh & mesh)
{
int nseg, nse, ne;
mesh.ComputeNVertices();
mesh.SetNP(mesh.G... | ALGO | 0.950949 | 5.481021 |
da7e4160-bf76-4dd1-9c7c-58ab5a6c8d7c | drt24/openbsd-import | src/gnu/llvm/lib/CodeGen/GlobalMerge.cpp | #include "llvm/ADT/BitVector.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/Triple.h"
#include "llvm/ADT/Twine.h"
#include "llvm/CodeGen/Passes.h"
#include "llvm/IR/BasicBlock.h"
#in... | TOOL | 0.988178 | 7.775792 |
2ddc3fe4-7010-4096-b20a-730735c824d5 | Abdul-Samad-1020/DSA | StackUsingLinkedList.cpp | #include <iostream>
using namespace std;
class Node {
public:
int data;
Node* next;
Node(int value) {
data = value;
next = NULL;
}
};
class Stack {
private:
Node* top; // Pointer to the top of the stack
public:
Stack() {
top = NULL; // Initialize stack as empty
}
... | ALGO | 0.955255 | 6.619191 |
7a0ea552-4b82-4df7-b221-4aa4c5a8767e | Subhajit098/Gfg-potd | non-overlapping-intervals.cpp | #include <bits/stdc++.h>
using namespace std;
int minRemoval(vector<vector<int>> &intervals)
{
// code here
int n = intervals.size();
sort(intervals.begin(), intervals.end());
int count = 0, first = intervals[0][0], second = intervals[0][1];
for (int i = 1; i < n; i++)
{
vector<int> in... | ALGO | 0.999848 | 5.103821 |
210f62c9-9ebb-447c-9948-d4c0d8a47a92 | frelwx/homework | luogu/popularization/template/3371_spfa.cpp | #include<bits/stdc++.h>
using namespace std;
const int maxn = 1e4 + 10, maxm = 5e5 + 10;
int n, m , s, cnt = 0, head[maxn], dis[maxn], inf;
bool vis[maxn];
struct edge{
int w;
int to;
int next;
}e[maxm];
void add(int from, int to, int weight){
e[++cnt].w = weight;
e[cnt].to = to;
e[cnt].next = h... | ALGO | 0.999945 | 3.614274 |
460e294f-639b-4c64-8307-a57c31352f15 | cicuvc/LLVM-LA32R | llvm/tools/dsymutil/MachODebugMapParser.cpp | #include "BinaryHolder.h"
#include "DebugMap.h"
#include "MachOUtils.h"
#include "RelocationMap.h"
#include "llvm/ADT/DenseSet.h"
#include "llvm/ADT/SmallSet.h"
#include "llvm/Object/MachO.h"
#include "llvm/Support/Chrono.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/WithColor.h"
#include "llvm/Support/raw_o... | TOOL | 0.963113 | 6.438625 |
2f8df8f2-8da1-4664-9bd7-25358669b42b | Chenxi-Nie/phy-SCNAClonal | dependencies/eigen/build_dir/doc/snippets/compile_PartialPivLU_solve.cpp | static bool eigen_did_assert = false;
#define eigen_assert(X) if(!eigen_did_assert && !(X)){ std::cout << "### Assertion raised in " << __FILE__ << ":" << __LINE__ << ":\n" #X << "\n### The following would happen without assertions:\n"; eigen_did_assert = true;}
#include <iostream>
#include <Eigen/Eigen>
#ifndef M_PI... | ALGO | 0.99758 | 3.802906 |
87028639-433f-48cd-87c4-7f5c10c1de70 | sahiljaswal786/DSA | DP/gridUniquePaths.cpp |
#include <bits/stdc++.h>
using namespace std;
int uniquePaths( int m , int n , vector<vector<int>>& dp){
if ( m == 0 && n == 0) return 1;
if (m < 0 || n < 0) return 0;
if (dp[m][n] !=-1) return dp[m][n];
int left = uniquePaths( m , n-1, dp);
int right = uniquePaths( m -1 , n, dp);
return d... | ALGO | 0.999974 | 5.43327 |
d4ccaa20-9109-4c66-acbc-e4095745d179 | Alessandro727/CHARM | application/shoal-base/libshoal/shoal/src/shl_cost.cpp | #include <stdlib.h>
#include <stdio.h>
extern "C" {
#include "le.h"
};
// For twitter:
// N = 41652230, M = 1468365182
#define N 41652230
#define E 1468365182
/**
* \brief Based on http://stackoverflow.com/questions/1156572/evaluating-mathematical-expressions-using-lua
*/
double evaluate_cost(char* cost_wr, char*... | ALGO | 0.94583 | 3.716169 |
e98c0b6a-bcb2-4c05-b99c-69f5f6a910aa | H-Shen/MyCodeCollection | Leetcode/2101/2101.cpp | constexpr int MAXN = 105;
vector<vector<int>> adj;
bitset<MAXN> vis;
void dfs(int u) {
for (const auto &v : adj[u]) {
if (!vis[v]) {
vis[v] = true;
dfs(v);
}
}
}
class Solution {
public:
int maximumDetonation(vector<vector<int>>& bombs) {
decltype(adj)().sw... | ALGO | 0.999858 | 6.037056 |
82bdb14d-5027-4da9-9f0b-4c311bcde87a | giolaq/CarND-Path-Planning-Project | src/Eigen-3.3/bench/sparse_transpose.cpp |
//g++ -O3 -g0 -DNDEBUG sparse_transpose.cpp -I.. -I/home/gael/Coding/LinearAlgebra/mtl4/ -DDENSITY=0.005 -DSIZE=10000 && ./a.out
// -DNOGMM -DNOMTL
// -DCSPARSE -I /home/gael/Coding/LinearAlgebra/CSparse/Include/ /home/gael/Coding/LinearAlgebra/CSparse/Lib/libcsparse.a
#ifndef SIZE
#define SIZE 10000
#endif
#ifndef... | ALGO | 0.982701 | 5.110691 |
601a403d-d081-41b6-af0e-a65b6d84ac59 | jatin0670/Cpp | string/if_str_rotated_by_2_places.cpp | #include<iostream>
using namespace std;
void rotateclock(string &s){
for(int i=0; i<2; i++){
char c = s[s.size()-1];
int index = s.size()-2;
while(index>=0){
s[index+1] = s[index];
index--;
}
s[0] = c;
}
}
void rotateanti(string &s){
for(int i=0; i<2; i++){
char c = s[0];
... | ALGO | 0.999996 | 4.631999 |
697d30e7-7f37-4a55-88a2-8d5cb11a4908 | PSCoder10462/dsa | codeforces/#756 Div3/A.cpp | /******************************************************/
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define vi vector<ll>
#define vvi vector<vi>
#define pii pair<ll, ll>
#define pb push_back
#define mp make_p... | ALGO | 0.999651 | 4.745452 |
32db399d-753f-45e6-9912-8944a279df06 | showmic96/Online-Judge-Solution | SPOJ/NDIV/13605183_AC_100ms_16384kB.cpp | // In the name of Allah the Most Merciful.
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MAX = 1e5+9;
bool isPrime[MAX+9];
vector<int>primes;
void sieve()
{
for(int i=0;i<=MAX;i++)isPrime[i] = true;
for(int i=2;i<=MAX;i++){
if(isPrime[i]){
for(int j=2*i;... | ALGO | 0.999943 | 4.683983 |
57fd37c6-0116-4b45-af13-cb981b4134b6 | Rohitrode264/Leetcode | committed_files/091. Decode Ways.cpp | // My solution.
class Solution {
public:
int numDecodings(string s) {
/** dp[i] =
* value Example
* 0 00, 30, 80 - invalid ending
* dp[i-2] 10, 20 - valid ending with 0
* dp[i-2] ... | ALGO | 0.999894 | 6.474452 |
bd9773f6-beef-4a5f-a65a-47a1f5099e05 | Sajjad617/Data-Structure- | 05 Binary Tree/19.5 Practice/Univalued 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.999866 | 6.485593 |
fdbbbd69-b215-4b25-b0ce-ef0d8db9f479 | kartikj360/Algorithm-code | radix_sort.cpp | #include <iostream>
#include <stdio.h>
#include <vector>
using namespace std;
void radix_sort(int arr[], int size);
void count(int arr[], int size, int div);
int counter = 0;
int main()
{
int size;
cout << "Enter the size of the array : ";
cin >> size;
int arr[size];
cout << "Enter the elements o... | ALGO | 0.999741 | 4.57471 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.