uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
734de10c-b452-4cb2-9b7e-48d250d2ee45 | tjdlfgns1234/baekjoon | 11286번 절댓값 힙.cpp | #include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
using namespace std;
int main(void)
{
ios::sync_with_stdio(false);
cin.tie(NULL), cout.tie(NULL);
int t;
cin >> t;
priority_queue<int, vector<int>,greater<int>> pos;
priority_queue<int, vector<int>, less<int>>neg;
while (t--)
{
int... | ALGO | 0.999977 | 4.513714 |
ec804039-a911-47c0-acb2-9e1d6a76722a | Ankesh8/PW_C- | Stack/pushatBottom_Recursively.cpp | #include<iostream>
#include<stack>
using namespace std;
void displayrev(stack<int> &st){
if (st.size()==0) return;
int x = st.top();
cout<<x<<" ";
st.pop();
displayrev(st);
st.push(x);
}
void display(stack<int> &st){
if (st.size()==0) return;
int x = st.top();
st.pop();
display(st);
cout<<x<<" ";
... | ALGO | 0.999281 | 4.623896 |
58d8da81-5a8e-4bdf-a6fd-67b3446701f6 | Autoratch/submissions | HackerEarth/LittleMonkBalancedParanthesis.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 2e5;
int n,a[N],x[N],lst,ans;
stack<pair<int,int> > s;
int main()
{
ios_base::sync_with_stdio(0); cin.tie(0);
cin >> n;
for(int i = 0;i < n;i++) cin >> a[i];
for(int i = 0;i < n;i++)
{
if(a[i]>0) s.push({a[i],i});
... | ALGO | 0.999975 | 4.214439 |
1c0b318f-7605-44cb-9f33-04c1b236562a | iamjinalshah/CodeCollection | CodeForces/boy or girl.cpp | #include<iostream>
#include<string>
using namespace std;
int main()
{
int a,b,c;
cin>>a>>b;
c=a+b;
if(c=='0')continue;
cout<<c;
}
| ALGO | 0.997936 | 3.094579 |
7b727e48-b717-4f40-85db-e9598b050280 | rishitadubey/Leetcode-Questions | 102-binary-tree-level-order-traversal/binary-tree-level-order-traversal.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999957 | 6.178714 |
1ee590bd-a666-4216-b5cf-b986488c542b | 2001adarsh/Contests | Practice/Greedy/questions/indian_coin_change.cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long int
#define endl "\n"
#define inf 1000000000000000000LL
//Greedy algorithm, works well for the Indian Currency, in the coin change problem
int numberOfCoins(int *coins, int n, int money) {
int ans = 0;
while (money) {
int idx = uppe... | ALGO | 0.999407 | 4.627273 |
a9858762-e781-4526-b233-d2c1876417cf | ezraabrari/0059_Doublelinkedlist | 0059_Doublelinkedlist/0059_Doublelinkedlist.cpp | #include <iostream>
using namespace std;
struct Node {
int noMhs;
string name;
Node* next;
Node* prev;
};
Node* START = NULL;
void addNode() {
Node* newNode = new Node();
cout << "\nMasukkan NIM dari mahasiswa : : ";
cin >> newNode->noMhs;
cout << "\nMasukkan nama dari mahasiswa : ";
cin >> newNode->name;
... | ALGO | 0.998696 | 3.98711 |
69f6c030-eb53-4224-a354-111b8629dc86 | Chasfory/Tekspice | src/gates/Or.cpp | /*
** EPITECH PROJECT, 2022
** B-OOP-400-PAR-4-1-tekspice-laetitia.bousch
** File description:
** or
*/
#include "Or.hpp"
#include <iostream>
namespace nts {
Tristate or_gate(const Tristate &a, const Tristate &b)
{
if (a == Tristate::TRUE || b == Tristate::TRUE) {
return Tristate::TRUE;
... | ALGO | 0.95056 | 5.420242 |
201d1ad4-2522-4893-bbb1-0235f5267200 | Ourouk/Donkey-Kong-Clone | dkjr.cpp | #include <unistd.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#include <time.h>
#include <SDL/SDL.h>
#include "./presentation/presentation.h"
//Define the different object of the game
#define VIDE 0
#define DKJR 1
#define CROCO 2
#define CORBEAU 3
#d... | TOOL | 0.913856 | 3.641007 |
8c968613-e357-48d2-8a11-46602670d295 | brendanburkhart/3DVisualizations | 3DVisualizations/Slerp.cpp | #include "stdafx.h"
#include "Slerp.h"
#include <algorithm>
#include <cmath>
constexpr double epsilon = 0.00001;
Slerp::Slerp(Quaternion start, Quaternion end, double duration)
: start(start), end(end), duration(duration), progress(0.0) {
cosHalfTheta = start.Dot(end);
if (cosHalfTheta < 0.0) {
... | ALGO | 0.927098 | 6.192576 |
ad0cdaa6-533d-4feb-a2d7-c17bb29ac926 | Ghost465/DS-Algo-Questions | (Array - Medium) Jump Game I & II.cpp | /*
LeetCode
Jump Game I : https://leetcode.com/problems/jump-game/?envType=featured-list&envId=top-google-questions?envType=featured-list&envId=top-google-questions
Jump Game II : https://leetcode.com/problems/jump-game-ii/description/?envType=featured-list&envId=top-google-questions?envType=featured-list&envId=top-goo... | ALGO | 0.999934 | 6.367305 |
f8dbe891-dabb-41b9-809d-ef72816e4e3f | Nishant-Bhosale/Competitive-Programming-CPP | Easy Problems/StackProblems/BalancedBrackets.cpp | #include<iostream>
#include<stack>
using namespace std;
bool handleBrackets(stack<char> &st, char bracket){
if(st.size() == 0){
return false;
}else if(st.top() != bracket){
return false;
}else{
st.pop();
return true;
}
}
int main(){
string str;
stack<char> st;
getline(cin,... | ALGO | 0.999086 | 4.515789 |
2fcef8fd-40fd-438b-8cff-022fa5d49337 | abhavgoel/Leetcode-Solutions | Minimum Spanning Tree - GFG/minimum-spanning-tree.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class DSU
{
vector<int>rank,parent,size;
public:
DSU(int n)
{
rank.resize(n+1,0);//n+1 , so it works for both 0 based and 1 based indexing
size.resize(n+1,1);//every nide has size 1
parent... | ALGO | 0.999974 | 5.952569 |
782df856-3908-4db0-83b3-b0d9f738d79d | YihuaLiang/honors | fd/src/VAL/RepairAdvice.cpp | /*-----------------------------------------------------------------------------
VAL - The Automatic Plan Validator for PDDL+
$Date: 2009-02-05 10:50:22 $
$Revision: 1.2 $
Maria Fox, Richard Howey and Derek Long - PDDL+ and VAL
Stephen Cresswell - PDDL Parser
<EMAIL>
<EMAIL>
<EMAIL>
<EMAIL>
By re... | TOOL | 0.927427 | 6.21263 |
dfbde8c9-6061-45ec-a999-a2d200513004 | caoleiwuhan/LeetCode | String/MultiplyStrings/MultiplyStrings.cpp | //============================================================================
// Multiply Strings
//
// Given two numbers represented as strings, return multiplication of the
// numbers as a string.
//
// Note: The numbers can be arbitrarily large and are non-negative.
//===============================================... | ALGO | 0.99987 | 6.091581 |
bfec0d91-3ce9-4e18-9eb3-9411aee365d5 | vaibhavi-04/c-practice-codes-by-apana-college | removedublicate.cpp | #include<bits/stdc++.h>
using namespace std;
void removedublicate(string s){
if(s.length()==0){
return;
}
if(s[0]==s[1]){
removedublicate(s.substr(1));
}else {
cout<< s[0];
removedublicate(s.substr(1));
}
}
int main(){
string s;
cin >> s;
removedu... | ALGO | 0.999946 | 3.870741 |
2b61961c-4d78-459a-a1c6-bc674f23ebfc | Chun-Bae/Baekjoon | 16953_A → B.cpp | #include <iostream>
using namespace std;
int minOperations(int A, int B) {
int count = 0;
while (B > A) {
if (B % 2 != 0) {
if (B % 10 == 1)
B /= 10;
else
return -1;
} else
B /= 2;
count++;
}
if (A != B) {
... | ALGO | 0.999856 | 5.22703 |
b0f1a647-4578-44db-a8b5-55339a47613c | RaulCan0/flutter_prueba | 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 |
3aa7f688-f6b7-42bc-83e7-f1eb2a91ba89 | aryaman895/xtended_frameworks_av | media/libeffects/lvm/lib/Common/src/LVC_Core_MixHard_2St_D16C31_SAT.cpp | /**********************************************************************************
INCLUDE FILES
***********************************************************************************/
#include "LVC_Mixer_Private.h"
/**********************************************************************************
FUNCTION LVCor... | ALGO | 0.988974 | 5.019054 |
afefd269-b056-4bee-9a9c-2ee863d1724c | k0r0z1f101/Physics | 03_NBody/BdeB.cpp | #include "BdeB.h"
#include <vector>
#include <cmath>
#include <Common/Kernel.h>
#include <Common/Consts.h>
#include <Common/Func.h>
#include <Common/Helpers.h>
#include "imgui_internal.h"
using namespace SK;
Vec2 IntegrateVerlet(Vec2 const vCurrentPos,
Vec2 const vPreviousPos,
Scalar const fDt,
S... | ALGO | 0.944192 | 5.591022 |
abcaf3b3-03de-4293-816b-e9ad56e9b0b5 | ishandutta2007/codeforces | sexpert/normal/1041/D.cpp | #include<bits/stdc++.h>
using namespace std;
long long sums[200005];
vector<pair<int, int>> segments;
int n, h;
long long good(int start, int end)
{
long long len = segments[end].second - segments[start].first;
long long free;
if(start == 0) free = sums[end];
else free = sums[end] - sums[start - 1];
return h - l... | ALGO | 0.999842 | 4.055518 |
bbba0905-ae06-4dac-9dc3-d8cccc196051 | avniamitkumar/CODING-PLATFORM-PRACTICE | stack_designer.cpp | //{ Driver Code Starts
//Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
stack<int>_push(int arr[],int n);
void _pop(stack<int>s);
// } Driver Code Ends
//User function Template for C++
/* _push function to insert elements of array to
stack
*/
stack<int>_push(int arr[],int n)
{
//retur... | ALGO | 0.999577 | 6.362733 |
3eba6f11-89e9-43ad-92ca-d967485c69f4 | vusec/stickytags | llvm-project/llvm/lib/Transforms/Scalar/Sink.cpp | #include "llvm/Transforms/Scalar/Sink.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/IR/Dominators.h"
#include "llvm/InitializePasses.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Transforms/Scalar.... | ALGO | 0.993196 | 7.89149 |
7c75f644-d169-4cd1-9e96-f5ebc8db1c48 | AmanDhimanD/Leet-Code | Permutations.cpp | class Solution {
private:
void solve(vector<int>nums,vector<vector<int>>&ans,int index){
if(index >= nums.size()){
ans.push_back(nums);
return;
}
for(int i = index; i<nums.size();i++){
swap(nums[index],nums[i]);
... | ALGO | 0.999998 | 6.291238 |
82f28d67-1375-47fa-a790-3e38509c0197 | saifu9421/basic-doubly-linked-list | doubly-linked-list-tail-insert.cpp | #include<bits/stdc++.h>
using namespace std;
class Node{
public:
int val;
Node *next;
Node*prev;
Node(int val){
this->val = val;
this->next = NULL;
this->prev = NULL;
}
};
void i... | ALGO | 0.99963 | 3.972615 |
7f951e24-059c-45a9-9972-15e4ab2e4e51 | raw-h/C-Chef | Strings/TTENIS.cpp | /*
Chef likes to play table tennis. He found some statistics of matches which described who won the points in order. A game shall be won by the player first scoring 11 points except in the case when both players have 10 points each, then the game shall be won by the first player subsequently gaining a lead of 2 points.... | ALGO | 0.999947 | 4.277612 |
8ccc272a-a049-43d9-be04-d082aa3e9f1d | Exr0nProjects/learn_cpp | problems/contests/dev.xjoi/dev.xjoi-1333/2.cpp | // problem 3, 16 nov 2019
// carpet covering problem
#include <bits/stdc++.h>
#define cn const int
#define ca const auto &
using namespace std;
cn MAXSZ = 25; // todo;
int n;
double conv[MAXSZ][MAXSZ];
struct State
{
int src, cur;
double val;
queue<int> prev;
};
queue<State> q;
bool step()
{
State s... | ALGO | 0.999905 | 3.470076 |
9b567e18-8fab-4d46-94e0-07fb9487da42 | megh-bari/Striver-A2Z-DSA-Sheet | Step 03 - Solve Problems On Arrays/Hard/mege-overlapping-subintervals.cpp | #include <bits/stdc++.h>
using namespace std;
// brute
vector<vector<int>> mergeOverlappingIntervals(vector<vector<int>> &arr)
{
int n = arr.size();
sort(arr.begin(), arr.end());
vector<vector<int>> ans;
for (int i = 0; i < n; i++)
{
int start = arr[i][0];
int end = arr[i][1];
... | ALGO | 0.999999 | 5.755591 |
042d28f8-e0e7-49f0-bc19-38d9a29acd76 | ishandutta2007/codeforces | avinashkartik/normal/1015/E1.cpp | #pragma optimization_level 3
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx")
#include<bits/stdc++.h>
using namespace std;
#define fastio ios:: sync_with_stdio(0);cin.tie(0);cout.tie(0);cout<<fixed;cout<<setprecision... | ALGO | 0.999825 | 3.326221 |
c6fe56f5-2a34-4db0-931f-b67ec68b5bcf | sarvex/leetcode-c3 | solution/0800-0899/0832.Flipping an Image/Solution.cpp | class Solution {
public:
vector<vector<int>> flipAndInvertImage(vector<vector<int>>& image) {
for (auto& row : image) {
int i = 0, j = row.size() - 1;
for (; i < j; ++i, --j) {
if (row[i] == row[j]) {
row[i] ^= 1;
row[j] ^= 1;
... | ALGO | 0.999973 | 6.557921 |
868d56d8-20c6-4e49-9027-0d725b79c8bf | Arsalan134/Arduino | libraries/MySensors/hal/crypto/generic/drivers/AES/AES.cpp | #include "AES.h"
/* This version derived by Mark Tillotson 2012-01-23, tidied up, slimmed down
and tailored to 8-bit microcontroller abilities and Arduino datatypes.
The s-box and inverse s-box were retained as tables (0.5kB PROGMEM) but all
the other transformations are coded to save table space. Many effi... | ALGO | 0.999084 | 6.411358 |
e471e351-6fca-43e3-bcaf-73dab049033d | StevenMaMei/Competitive-Programming | Contest/Codeforces/Div2_604/A/main.cpp | #include <bits/stdc++.h>
#define ff first
#define ss second
#define mp make_pair
#define pb push_back
#define fore(i,low,n) for(int i=low;i<n;i++)
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
#ifdef LOCAL
freopen("input.txt", "r", stdin);
#else
#define... | ALGO | 0.999951 | 3.706951 |
466f2aad-3a12-42de-83ed-c94b9f4922fa | rua0707/gentle_3s | baekjoon/baekjoon_2662/baekjoon_2662_jaewoo.cpp | //02:08:25
#include <iostream>
#include <string.h>
#include <vector>
#include <algorithm>
#define max(a,b) (((a) > (b)) ? (a) : (b))
using namespace std;
int N, M;
int dp[21][301];
int path[21][301];
vector<vector<int>> investment;
int dfs(int company, int total_invest){
int &ret = dp[company][total_invest];
... | ALGO | 0.999997 | 3.348102 |
a4ca78dc-73d9-4521-97f3-4641f0a1b351 | Aman-Jot-Kaur/Leetcode-solved | third-maximum-number/third-maximum-number.cpp | class Solution {
public:
int thirdMax(vector<int>& nums) {
set<int> ans;
for(int n:nums){
ans.insert(n);
if(ans.size()>3){
ans.erase(ans.begin());
}
}
return ans.size()==3?*ans.begin():*ans.rbegin();
}
}; | ALGO | 0.999979 | 5.539375 |
23025d42-dbf4-4ba2-ab61-6455cf0f6fbb | JOY045/Problem-Solving | Bee Crowd/Beginner/Triangle Types.cpp | /*
Site Name : Bee Crowd
Problem ID: 1045
Problem Name:
Read 3 double numbers (A, B and C) representing the sides of a triangle and arrange them in decreasing order, so that the side A is the biggest of the three sides. Next, determine the type of triangle that they can make, based on the following cases always writi... | ALGO | 0.999847 | 5.730652 |
a57b6f89-1a7e-444e-95d6-97e70a44b875 | ugogon/gaussStylization | libigl/include/igl/hausdorff.cpp | template <
typename DerivedVA,
typename DerivedFA,
typename DerivedVB,
typename DerivedFB,
typename Scalar>
IGL_INLINE void igl::hausdorff(
const Eigen::MatrixBase<DerivedVA> & VA,
const Eigen::MatrixBase<DerivedFA> & FA,
const Eigen::MatrixBase<DerivedVB> & VB,
const Eigen::MatrixBase<DerivedFB> & FB... | ALGO | 0.999696 | 6.768682 |
6c86e6ea-d520-48b6-b233-c860d70d8e9a | ngthanhtrung23/CompetitiveProgramming | codeforces/499/A.cpp | #include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a),_b=(b); i<=_b; i++)
#define FORD(i,a,b) for(int i=(a),_b=(b); i>=_b; i--)
#define REP(i,a) for(int i=0,_a=(a); i<_a; i++)
#define EACH(it,a) for(__typeof(a.begin()) it = a.begin(); it != a.end(); ++it)
#define DEBUG(x) { cout << #x << " = "; cout << (x) << end... | ALGO | 0.999708 | 3.482414 |
7ca66690-9701-4414-8cfb-0b6208aebefb | CodeNewbie-pradip/interview_ds_algo | Arrays/Interval_Based_Qn/Divide Intervals into Minimum Number of Groups.cpp | /*
Leetcode Link : https://leetcode.com/problems/divide-intervals-into-minimum-number-of-groups/
Leetcode difficulty : Medium
Leetcode Related Topic : Array,Two Pinter, Greedy, Sorting, Heap(Priority Queue) Prefix Sum.
Medium Article Link :
*/
//------------------------------Solution - in - C++ ---... | ALGO | 0.999996 | 6.393307 |
35255cb4-f35b-4c6f-8229-6768a8531e2f | walkerL0u15/OnlineJudgeCode | LeetCode/Min_Cost_Climbing_Stairs.cpp | class Solution {
public:
int minCostClimbingStairs(vector<int>& cost) {
for(int i=2;i<cost.size();++i)
cost[i]=min(cost[i-1],cost[i-2])+cost[i];
return min(cost[cost.size()-1],cost[cost.size()-2]);
}
};
| ALGO | 0.99992 | 5.936008 |
43517651-9c2d-48d5-9523-9ac3e717c9d6 | banwang811/eBuy | zxing/cpp/core/src/zxing/oned/Code128Reader.cpp | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*-
#include <zxing/ZXing.h>
#include <zxing/oned/Code128Reader.h>
#include <zxing/oned/OneDResultPoint.h>
#include <zxing/common/Array.h>
#include <zxing/ReaderException.h>
#include <zxing/NotFoundException.h>
#include <zxing/FormatException.h>
#inc... | ALGO | 0.983089 | 5.387286 |
ddd94d0c-f646-42ff-83ee-e5e4c9347a93 | ARDhruvo/Data-Structures-Previous-Semester-Questions | Spring 23/S23_1b.cpp | #include <bits/stdc++.h>
using namespace std;
// Asked for algorithm so the code isn't important
int C[9] = {0,0};
int merge(int A[], int B[])
{
// int n = A.size(), m = B.size(); // This line is more important for the Algorithm and not the code
A[6] = INT_MAX;
int n = 0, m = 4 - 1; // Use i an j in Algo... | ALGO | 0.999945 | 3.929124 |
a79457d9-f03e-451a-9d7e-1853ad62de22 | simrankri1734/Coding | C++/template copy.cpp | #include<iostream>
using namespace std;
template<class T1, class T2 = int, class T3 = float>
class Addition
{
public :
T3 add(T1 a, T2 b, T1 c = 0)
{
return (a+b+c);
}
T3 sub(T1 a, T2 b)
{
return (a-b);
}
};
int main()
{
Addition <float>a;
Additi... | TOOL | 0.94139 | 4.591954 |
33b995d6-b1b2-48bc-8f2f-16a2559390a8 | Ritika-Das/Data_Structures_and_Algorithms.github.io | C++/shell_sort.cpp | #include<iostream>
using namespace std;
void Swap(int &a, int &b) {
int temp;
temp = a;
a = b;
b = temp;
}
void display(int *array, int size) {
for(int i = 0; i<size; i++)
cout << array[i] << " ";
cout << endl;
}
void shellSort(int *arr, int n) {
int gap, j, k;
for(gap = n/2; gap > 0; gap ... | ALGO | 0.999949 | 4.378527 |
01533a5b-4a0c-425c-ada3-925c9039bc5f | huiseon37/PS | BOJ/C++/1000-10000/4153.cpp | #include <iostream>
using namespace std;
int main(void){
int a=1, b=1, c=1;
while(true){
cin>>a>>b>>c;
if(a==0&&b==0&&c==0) break;
if(a>b){
if(a>c){
if((b*b)+(c*c) == a*a){
cout<<"right"<<endl;
}
else{
cout<<"wrong"<<endl;
}
}else{
if((a*a)+(b*b) == c*c){
cout<<... | ALGO | 0.999933 | 3.528997 |
b2c2f74a-125e-4cad-bf5b-3c5ba900aca5 | Alvov1/LeetCode | 146_LRU_Cache.cpp | #include <iostream>
#include <unordered_map>
class LRUCache final {
struct ListEntry final {
int key {}, value {};
ListEntry* nextEntry = nullptr;
ListEntry* previousEntry = nullptr;
explicit ListEntry(int key, int value) : key(key), value(value) {}
};
ListEntry* enter = nullptr;
std::unordered_map<int, Li... | ALGO | 0.997586 | 4.650847 |
345e1655-cb3d-48ee-b718-c12cee8edcb7 | noobie7/CodeBank | CodeChef/UWCOI21/D.cpp | /*
"An anomaly, I'm Muhammad Ali
Cause I know one day I'm gonna be the"
- Greatest, Eminem
*/
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
#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;
typ... | ALGO | 0.99992 | 4.293055 |
5dbe576e-6363-441c-be12-1df589393f96 | playbar/cryptodbnet | cryptopp/skipjack.cpp | // skipjack.cpp - modified by Wei Dai from Paulo Barreto's skipjack32.c,
// which is public domain according to his web site.
#include "pch.h"
#ifndef CRYPTOPP_IMPORTS
#include "skipjack.h"
/*
* Optimized implementation of SKIPJACK algorithm
*
* originally written by Panu Rissanen <<EMAIL>> 1998.06.24
* optimiz... | ALGO | 0.99959 | 7.001422 |
dd4498fd-a84b-45f2-a918-5d2ac184de1a | BangKartavya/Graph-Theory | Jump Game III/main.cpp | class Solution {
public:
bool canReach(vector<int>& arr, int start) {
unordered_set<int> idx;
int n = arr.size();
for(int i = 0; i < n; i++) {
if(arr[i] == 0) {
idx.insert(i);
}
}
if(idx.empty()... | ALGO | 0.999933 | 5.356923 |
eb4e3f45-6b6c-4726-9052-a5dca684380a | JohnVlBetter/LeetCode | 657.机器人能否返回原点.cpp | /*
* @lc app=leetcode.cn id=657 lang=cpp
*
* [657] 机器人能否返回原点
*/
// @lc code=start
class Solution {
public:
bool judgeCircle(string moves) {
int h=0,v=0;
for(const auto& c: moves){
if(c == 'R'){
++h;
}else if(c == 'L'){
--h;
}el... | ALGO | 0.99969 | 6.081343 |
03c51ea5-baa9-405a-a19b-929cc5b0adc4 | Shubham0920/Daily-Leetcode-question | Geeks And The String - GFG/geeks-and-the-string.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
string removePair(string s) {
// code here
stack<char> st;
for(int i=0;i<s.size();i++){
if(st.empty()){
st.push(s[i]);
}
e... | ALGO | 0.999296 | 5.97562 |
d123566e-5ba2-4a82-909f-ff205ba6a890 | yuvraj0007/Graph-Algorithm | bipartite.cpp | #include <bits/stdc++.h>
using namespace std;
int n, m;
int bipartite(vector<vector<int> > &adj) {
vector<int>dp(n,-1);
queue<int>q;
for(int i=0;i<n;i++){
if(adj[i].size()){
q.push(i); dp[i]=0; break;
}
}
while(!q.empty()){
int x=q.front();
q.pop();
for(int i:adj[x]){
if(i==x) ... | ALGO | 0.999918 | 5.087502 |
9fcfd834-48fc-494d-9a1f-01a72afcf634 | NimishSinghChouhan/LeetCode | 0367-valid-perfect-square/0367-valid-perfect-square.cpp | class Solution {
public:
bool isPerfectSquare(int num) {
long long x = num;
while(x * x > num){
x = (x + num/x) >> 1;
}
return x*x == num;
}
}; | ALGO | 0.999837 | 5.563283 |
e5a33570-d9c2-4286-9edb-88ee98ca6c5f | drt4243566/leetcode_learn | TOP100/合并K个升序链表.cpp | #include <iostream>
#include <vector>
#include <queue>
using namespace std;
class ListNode {
public:
int val;
ListNode* next;
ListNode(int x) { val = x; }
};
class Solution{
public:
bool cmp(ListNode* l1,ListNode* l2){
return l1->val>=l2->val;
}
ListNode* mergeKLists(vector<ListNode*>&... | ALGO | 0.999886 | 5.650083 |
20761312-59ed-43b6-b8f3-0abaf263d465 | BulletGG/fatality-source-code | internal_hvh/features/legit.cpp | #include "../include_cheat.h"
Vector legit::closest_hitbox_pos( const player_log_t& log, lag_record_t* record, float& bestdist )
{
mstudiobbox_t* bestbox = nullptr;
static constexpr std::array hitboxes =
{
HITBOX_LEFT_CALF,
HITBOX_RIGHT_CALF,
HITBOX_CHEST,
HITBOX_PELVIS,
HITBOX_HEAD
};
var( weapon_rec... | TOOL | 0.942278 | 4.071959 |
eebc2dca-7fad-449d-a829-17c2d8400e47 | AhmadShawkhah/24FAL-CIS-17A | Game.cpp | #include "Game.h"
#include <iostream>
#include <limits>
using namespace std;
// Constructor: Initializes the game by setting up players and shuffling the deck
Game::Game(Player* user, Player* dealer)
: user(user), dealer(dealer), currentBet(0) {
// Initialize and shuffle the deck
deck.initializeDeck();
... | TOOL | 0.978163 | 7.590971 |
771bb33a-3c01-4bf2-8a60-46dec1827ea2 | vaca22/chemcxx | chem.cpp | #include "chem.h"
using namespace std;
bool ChemItem::operator==(const ChemItem &b)
{
if (type == b.type && num == b.num)
{
return true;
}
else
{
return false;
}
}
ChemItem::ChemItem(int myType, int myNum)
{
type = myType;
num = myNum;
}
ChemEquation::ChemEquation(con... | TOOL | 0.975451 | 3.432282 |
268b1d8b-d298-4079-b11e-273b0151f168 | fifo36/Online-Live-Classes-Codes | set 1.cpp | #include<bits/stdc++.h>
using namespace std;
#define LL long long
#define pii pair<int, int>
int main(){
set<int> st;
for(int i = 1; i <= 10; i++) st.insert(i);
for(int i = 1; i <= 5; i++) st.insert(i);
///insert complexity : O(logn);
//for(auto it : st) cout<<it<<' ';
///int ara[10000000] = {... | ALGO | 0.996572 | 3.151025 |
749169b2-7e2c-4895-af83-4fa80d959703 | tyeasmino/XPSC_Batch_4 | Week 16/Day 02/A_Mike_and_Children.cpp | /* title: Week 16 - A_Mike_and_Children.cpp */
/* created: 2024-07-14 23:11:09 */
#include<bits/stdc++.h>
#define ll long long
using namespace std;
const int N = 2e5+5;
int main() {
ios::sync_with_stdio(false);
cin.tie(NULL);
ll n;
cin >> n;
ll a[n], freq[N]={0};
for(ll i=0; i<n; i++) cin... | ALGO | 0.999976 | 4.296095 |
f48f2613-a831-4312-b3f0-6ebbcf268e4d | 2oo3-g/neural-network-art | Solution/BinaryConversion_2.cpp | #include<bits/stdc++.h>
using namespace std;
#define NUMBER_OF_JOBS 20
#define ASH_COLOR 3
class BinaryConvertor {
private:
int binaryData[NUMBER_OF_JOBS][NUMBER_OF_JOBS];
int decimalData[NUMBER_OF_JOBS];
public:
BinaryConvertor() {
for (int i=0; i<NUMBER_OF_JOBS; i++) {
... | ALGO | 0.998382 | 5.244531 |
9c98412c-31d7-4f02-9745-1fc6a3a72bf6 | BeyondCC/LeetCode | LongestPalindromicSubstring.cpp | /*
* Source: https://oj.leetcode.com/problems/longest-palindromic-substring/
* Description: Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique longest palindromic substring.
*/
#include<iostream>
#include<cmath>
#include<st... | ALGO | 0.999181 | 4.043508 |
26472572-e43d-4d49-a66f-85bddc3c4976 | sarvex/leetcode-bash | solution/0800-0899/0884.Uncommon Words from Two Sentences/Solution.cpp | class Solution {
public:
vector<string> uncommonFromSentences(string s1, string s2) {
unordered_map<string, int> cnt;
auto add = [&](string& s) {
stringstream ss(s);
string w;
while (ss >> w) ++cnt[move(w)];
};
add(s1);
add(s2);
vec... | ALGO | 0.999777 | 5.642371 |
9f09ea9d-120e-4b60-9a28-9e7182bfbf0d | jbremer/virtualbox | src/VBox/Runtime/common/string/utf-16-case.cpp | /* $Id$ */
/** @file
* IPRT - UTF-16, Case Sensitivity.
*/
/*********************************************************************************************************************************
* Header Files ... | ALGO | 0.911939 | 5.922251 |
5697e8b1-0a95-41dd-8f3e-e3232513c5fc | Gauranshgoel123/Leetcode-problems | majority-element.cpp | class Solution {
public:
int majorityElement(vector<int>& nums) {
int count = 0;
int element = 0;
for (int i = 0; i < nums.size(); i++) {
if (count == 0) {
element = nums[i];
count = 1;
} else if (element == nums[i]) {
... | ALGO | 0.999924 | 6.062137 |
f209a293-5b44-4c0c-8657-382e46a2d335 | archallumin/ac | BOJ/10001 - 20000/17129.cpp | #include <iostream>
#include <queue>
using namespace std;
int a, b, x, y;
char island[3001][3001];
int food[3001][3001];
int vis[3001][3001];
int dist[3001][3001];
int xs[4] = {1, -1, 0, 0};
int ys[4] = {0, 0, 1, -1};
long long total = 10000000000; // 매우큰값 선언
int foodcount = 3;
queue<pair<int, int>> isle;
int main... | ALGO | 0.99993 | 5.185791 |
1230603c-e95d-487e-9f17-93b33085b3b4 | ishandutta2007/codeforces | skywalkert/normal/757/A.cpp | #include <stdio.h>
const int maxw = 257, maxs = 100001;
const char* pat = "Bulbasaur";
int cnt[maxw], need[maxw], ans = -1;
char tex[maxs];
int main()
{
for(int i = 0; pat[i]; ++i)
++need[pat[i]];
scanf("%s", tex);
for(int i = 0; tex[i]; ++i)
++cnt[tex[i]];
for(int i = 0; i < maxw; ++i)
{
if(!need[i])
c... | ALGO | 0.999844 | 3.514178 |
40e9e4e5-3c02-4389-b20a-6059e4c2bafa | subham-spec/DSA_LeetCode | Array Easy/KthLargestElement.cpp | #include <iostream>
#include <queue>
using namespace std;
int findKthLargest(vector<int> arr, int k){
int ans = -1;
// making a priority queue
priority_queue<int> pq;
for(int i=0; i<arr.size(); i++){
pq.push(arr[i]);
}
while(k>0){
ans = pq.top();
pq.pop();
k--;
... | ALGO | 0.999973 | 4.655664 |
00746166-b07e-47da-b10d-c286462fe17f | mr-luckey/Screen_Recorder | 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 |
661a8427-d53f-4ebf-a97f-2b99d55f90bb | mustafaarslanyazilim/theme_change_use | 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 |
083a0b54-0a0b-4b05-92be-05819c99f7c5 | ishandutta2007/codeforces | mohammedehab2002/normal/450/B.cpp | #include <iostream>
using namespace std;
int main()
{
long long n,mod=1000000007,f[3];
cin >> f[0] >> f[1] >> n;
f[2]=f[1]-f[0];
int sign=((n-1)/3)%2;
cout << (f[(n-1)%3]*(sign? -1:1)+2LL*mod)%mod;
} | ALGO | 0.999991 | 4.042097 |
5802299b-bfdb-40ff-ae4b-74cfe9845c72 | ishandutta2007/codeforces | xellos/normal/1672/G.cpp | // iostream is too mainstream
#include <cstdio>
// bitch please
#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <chrono>
#include <random>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include ... | ALGO | 0.999985 | 4.248421 |
5ac071e9-6b88-4e97-bb12-7d71fcea7b30 | AaturBordia/Mit-IT-codes | Sem4/DAA lab/Lab2/bfs.cpp | #include <iostream>
using namespace std;
int n;
void bfs(int v,int reach[],int a[][10]){
int q[100];
int front = -1;
int rear = -1;
reach[v] = 1;
q[++rear] = v;
cout << "\nbfs :\n";
while(rear!= front){
int w;
w = q[++front];
cout << w;
for(int u=1;u<=n;u++){
... | ALGO | 0.99968 | 4.247944 |
bec2464c-bc54-427d-8f7d-ce58a364d293 | dabaier/code | 可视化/数据处理相关文件/Dataset/train/25_BFS/BFS-2.cpp | void bfs(adjgraph *G,int v)
{
int w,i;
arcnode *p;
sqqueue *qu;
initq(qu);
int visited[maxv];
for(i=0;i<G->n;i++)
{
visited[i]=0;
}
cout<<v<<" ";
visited[v]=1;
enqueue(qu,v);
while(!queueempty(qu))
{
dequeue(qu,w);
p=G->adjlist[w].firstarc;
... | ALGO | 0.999102 | 4.008642 |
c9cb8803-1137-44c5-9bd4-b6c597007299 | acc-cosc-1337-spring-2020/acc-cosc-1337-spring-2020-Beezlebub007 | src/examples/03_module/05_value_and_reference_params/main.cpp | #include<iostream>
using std::cout;
int main()
{
int num = 5;
cout << "Value of num is: " << num << " Address is " << &num << "\n";
int &num_ref = num;
num_ref = 10;
cout << "Value of num is: " << num << " Address is " << #
return 0;
} | TOOL | 0.879698 | 4.390984 |
9f5167b8-61ff-4468-871a-0934f78b52d3 | Courage003/-CrackYourPlacement | Difficulty: Medium/Infix to Postfix/infix-to-postfix.cpp | //{ Driver Code Starts
// C++ implementation to convert infix expression to postfix
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
// Function to convert an infix expression to a postfix expression.
int priority(char c) {
if (c == '^')
return ... | ALGO | 0.999664 | 6.30794 |
9b70deec-a059-44e4-845f-f67a25c141aa | Yash59ops/Leetcode-Solution | Divide in Incremental Groups - GFG/divide-in-incremental-groups.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:
int solve(int num,int n,int k,vector<vector<vector<int>>>&dp){
//bc
if(k==0){
if(n==0)return 1;
return ... | ALGO | 0.999958 | 5.770328 |
fbd955ed-8fdf-4363-b63e-706825d7365d | AryanRaj315/CompetitiveProgrammingSolutions | LongestIncreasingSubsequence.cpp | #include<iostream>
#include<map>
#include<cmath>
#include<algorithm>
#include<vector>
using namespace std;
// n, k;
#define loop(i, start, end) for(int i = start; i <= end; i++)
#define ll long long int
#define pb push_back
// vector<ll> weight, value;
// ll n, w;
ll n;
vector<int> dp(n+1, 0);
vector<ll> vec;
ll recur... | ALGO | 0.999893 | 3.472465 |
1d299c20-4926-489c-a7bf-5c55c4a360d0 | ritplpro/todo_firebase_app | 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 |
014334ad-154b-4800-acbb-bcb03cad96ae | taptipalit/llvm12 | libcxx/test/std/algorithms/alg.modifying.operations/alg.replace/replace_copy_if.pass.cpp | // <algorithm>
// template<InputIterator InIter, typename OutIter,
// Predicate<auto, InIter::value_type> Pred, class T>
// requires OutputIterator<OutIter, InIter::reference>
// && OutputIterator<OutIter, const T&>
// && CopyConstructible<Pred>
// constexpr OutIter // constexpr after... | TEST | 0.97764 | 7.065917 |
2f3ad4c9-1d3f-4776-88b9-8b3856d0c2f5 | MSS-PRIYANKA/Leetcode_Solutions | 7.cpp | int reverse(int x) {
int ans = 0;
while(x!= 0){
int bit = x%10;
if ((ans > INT_MAX/10)||(ans < INT_MIN/10)){
return 0;
}
ans = (ans*10)+bit;
x = x/10;
}
return ans;
}
| ALGO | 0.999833 | 4.797079 |
2712343e-05bb-47a3-ae86-716e6c974dcc | ReygaDirga/SOCS | Searching/E.cpp | #include <stdio.h>
void swap (int *a, int *b) {
int temp = *a;
*a = *b;
*b = temp;
}
int partition(int array[], int low, int high) {
int i = low - 1;
for (int j = low; j < high; j++) {
if (array[j] <= array[high]) {
i++;
swap(&array[i], &array[j]);
}
}
... | ALGO | 0.999977 | 4.224296 |
40684803-eb1b-491b-9fcc-448e2633e5ac | SojebSikder/dsa-practice | leetcode/cpp/4. Median of Two Sorted Arrays.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution
{
public:
double findMedianSortedArrays(vector<int> &nums1, vector<int> &nums2)
{
vector<int> result;
for (int i = 0; i < nums1.size(); i++)
{
result.push_back(nums1[i]);
}
for (int i = 0; i < num... | ALGO | 0.999949 | 6.16182 |
c433325e-a874-486c-a81c-2e2ffb245358 | ishassan/ProblemSolving | UVa/11319 - Stupid Sequence_Gaussian.cpp | #include <bits/stdc++.h>
#include <ext/numeric>
#define rep(i,n) for(int i=0; i<n; i++)
#define repa(i,a,b,d) for(int i=a; i<=b; i+=d)
#define repd(i,a,b,d) for(int i=a; i>=b; i-=d)
#define repi(it,stl) for(auto it = (stl).begin(); (it)!=stl.end(); ++(it))
#define sz(a) ((int)(a).size())
#define mem(a,n) memset((a), (... | ALGO | 0.999121 | 3.444501 |
723caab8-00ea-4d4b-b178-8febeafe8f1a | ishandutta2007/codeforces | froggyzhang/normal/1479/A.cpp | #include<bits/stdc++.h>
using namespace std;
#define N 100010
typedef long long ll;
inline ll read(){
ll x=0,f=1;
char c=getchar();
while(c<'0'||c>'9'){
if(c=='-')f=-1;
c=getchar();
}
while(c>='0'&&c<='9'){
x=(x<<1)+(x<<3)+c-'0';
c=getchar();
}
return x*f;
}
int n,a[N];
int Query(int x){
if(a[x])return ... | ALGO | 0.999954 | 3.395141 |
5d78ba48-e4b6-4668-a495-477af158a653 | v21k93/my-first-core-edition | src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp | /* ScriptData
SDName: boss_the_lurker_below
SD%Complete: 80
SDComment: Coilfang Frenzy, find out how could we fishing in the strangepool
SDCategory: The Lurker Below
EndScriptData */
#include "ScriptPCH.h"
#include "serpent_shrine.h"
#include "Spell.h"
#define SPELL_SPOUT 37433
#define SPELL_SPOUT_ANIM 428... | TOOL | 0.95163 | 5.428527 |
17efb18f-c628-4e40-a237-2b5e6448e265 | kklein/AlgoLab17 | potw4/main.cpp | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
bool segment_compare (pair<int, int> p, pair<int, int> q) {
return (p.second < q.second or (p.second == q.second and p.first > q.first));
}
//bool less_or_equal (int a, int b) {
// return
//}
int main() {
int n_test_cases;
cin ... | ALGO | 0.999903 | 4.426353 |
b3c13288-a99a-413a-bb69-3d829515ab5e | Anubhav200311/-CrackYourInternship | Q_101.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.999948 | 6.697254 |
59d13620-e8f7-4a5b-8ada-bed09bd987b1 | H-Shen/MyCodeCollection | Luogu/P1100.cpp | #include <bits/extc++.h>
using namespace std;
using namespace __gnu_pbds;
using ll = long long;
constexpr int MAXN = 32;
int main() {
ll n;
scanf("%lld", &n);
bitset<MAXN> A(n);
string s = A.to_string();
bitset<MAXN> B(s.substr(16) + s.substr(0, 16));
printf("%llu\n", B.to_ullong());
re... | ALGO | 0.999791 | 4.310105 |
b4855364-bed2-46e9-a06b-6e6a92c43660 | JmvRukundo/CPP_studies | gcd.cpp | #include <iostream>
using namespace std;
int main(){
int num1,num2,gcd,i,temp;
cout<<"enter num1,num2"<<endl;
cin>>num1>>num2;
for(int i=1;i<=num1;i++)
if(num1%i==0&&num2%i==0)
gcd=i;
cout<<"gcd is"<<gcd<<endl;
return 0;
}
| ALGO | 0.997231 | 3.64328 |
75f99d10-1eb5-4fa7-83aa-48294ffaf1f8 | yancouto/competitive-programming | ojs/cc/cards777.cpp | #include <bits/stdc++.h>
using namespace std;
#define fst first
#define snd second
typedef long long ll;
typedef pair<int, int> pii;
#define pb push_back
#define for_tests(t, tt) int t; scanf("%d", &t); for(int tt = 1; tt <= t; tt++)
const ll modn = 1000000007;
inline ll mod(ll x) { return x % modn; }
int main() {
fo... | ALGO | 0.999448 | 3.842504 |
ad1e9d23-aa2e-487e-a33d-9b4d10d08192 | jzisa001/Consultoria_Caso_1 | Consultoria_Caso_1/renv/library/windows/R-4.4/x86_64-w64-mingw32/Rcpp/tinytest/cpp/Matrix.cpp | #include <Rcpp.h>
using namespace Rcpp ;
// [[Rcpp::export]]
double matrix_numeric( NumericMatrix m){
double trace = 0.0 ;
for( size_t i=0 ; i<4; i++){
trace += m(i,i) ;
}
return trace ;
}
// [[Rcpp::export]]
std::string matrix_character( CharacterMatrix m){
std::string trace ;
for( s... | TOOL | 0.953641 | 5.255382 |
e423eb7d-18df-438a-8ab4-8a628b9f86fa | rdkit/rdkit | Code/SimDivPickers/DistPicker.cpp | namespace RDPickers {
double getDistFromLTM(const double *distMat, unsigned int i, unsigned int j) {
CHECK_INVARIANT(distMat, "");
if (i == j) {
return 0.0;
} else if (i > j) {
return distMat[i * (i - 1) / 2 + j];
} else {
return distMat[j * (j - 1) / 2 + i];
}
}
} // namespace RDPickers
| ALGO | 0.999597 | 6.699949 |
4d55bff7-7b5b-4ece-9cd4-1038816733da | chaudhary19/Competitive-Algorithms-in-Cpp | BD_LeeAlgorithm.cpp | #include<bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define int long long
#define endl "\n"
// Lee Algorithm: shortest path in a maze
#define M 10
#define N 10
struct Node
{
int x, y, dist;
};
int row[] = { -1, 0, 0, 1 };
int col[] = { 0, -1, 1, 0 };
bool isV... | ALGO | 0.999608 | 5.381528 |
0d13372b-3f16-43b9-b676-388da3f999ca | DanaBenish/HuffmanCodeGenerator | HuffmanTree.cpp | #include "HuffmanTree.hpp"
#include <string>
// Compress the input string
std::string HuffmanTree::compress(const std::string inputStr) {
std::map<char, size_t> charMap;
std::map<char, size_t>::iterator i;
size_t count[256] = {0};
// Read characters
for (int i = 0; inputStr[i] != '\0'; i++) {
... | ALGO | 0.999834 | 5.91433 |
d2b80564-def0-4d73-9e3f-97899a21f756 | ishandutta2007/codeforces | autumnkite/normal/962/B.cpp | #include <cstdio>
#include <cstdlib>
#include <cctype>
#include <ctime>
#include <cmath>
#include <string>
#include <cstring>
#include <algorithm>
#include <set>
#include <bitset>
#include <map>
#include <queue>
#include <stack>
#include <vector>
#define LL long long
#define For(i,a,b) for(register int i=(int)(a),i_E=(... | ALGO | 0.999503 | 3.134288 |
614d9d6f-6fd5-4582-8c53-f271151c206b | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_1789_15.cpp | #include <bits/stdc++.h>
using namespace std;
int n, m, f[1010], x[1010];
vector<int> a[1010];
inline void dp(int i, int j) {
f[i] = 1;
for (auto k : a[i])
if (k != j) {
dp(k, i);
f[i] += f[k];
}
}
inline void dfs(int i, int j, int u, int v) {
printf("%d %d %d\n", i, j, u * v);
int l = 1;
... | ALGO | 0.999872 | 3.681443 |
26ae5cc0-f268-4e4e-a52a-b18be411ae0a | MijaTola/Codeforce | 1100C.cpp | #include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1);
double n,r;
int main() {
cin >> n >> r;
double a = 0.0;
double b = 1000;
double angle = 2 * pi / n;
for (int i = 0; i < 1000; ++i) {
double mid = (a + b) / 2;
double R = mid + r;
double chord = 2 * ... | ALGO | 0.99991 | 3.458691 |
472d6e5c-a2a3-4e32-a501-048bd6bed6a4 | salimmia/Workstation | Problem Solving/Code_Template/Notes and files/ACM-Library Druboo vai/String/Palindromic Tree.cpp | //Palindromic Tree
//Complexity : O(n) memory and O(n) time
#include<bits/stdc++.h>
using namespace std;
#define INF 1e9
#define MAX 300005
#define ff first
#define ss second
#define pii pair<int,int>
struct node{
int next[26];
int minPos; //Position in string where this node ff occurs
int occurrenc... | ALGO | 0.99997 | 3.909017 |
10fa042c-f44b-4c53-bce2-dc4ec45386a5 | kylepamintuan/CS_111 | Problem Sets/Problem Set 5/ps5question6.cpp | #include <iostream>
using namespace std;
int main()
{
int result;
for (int counter = 99; counter >= 3; counter--)
{
result = counter - 1;
cout << counter << " bottles of Pepsi on the wall, " << counter << " bottles of Pepsi." << endl;
cout << "Take one down, pass it around, " << r... | ALGO | 0.991873 | 5.059902 |
4515b65e-9c04-4477-a434-404e275d3356 | dqhungdl/ACM-ICPC-Notebook | Graph/DominatorTree.cpp | #include <bits/stdc++.h>
using namespace std;
const int MAX=1e5+5;
int n,m,cnt=0,Child[MAX],par[MAX],dsu[MAX],label[MAX];
int64_t res;
int sdom[MAX],dom[MAX];
int arr[MAX],rev[MAX];
vector<int> g[MAX],rg[MAX],tree[MAX],bucket[MAX];
int Find(int u,int x=0)
{
if(u==dsu[u])
return ((x>0)?-1:u);
int v=Fin... | ALGO | 0.999927 | 4.615976 |
b61a551d-cfbf-4973-affb-871a99913dfd | romilpunetha/Online-Judges | HackerEarth/Practice/DP/xsquareandtwoarrays.cpp | #include <bits/stdc++.h>
#define whats(x) cerr << #x << " is " << x << endl;
#define ff first
#define ss second
using namespace std;
typedef long long ll;
vector<ll> a(1e5 + 10, 0), b(1e5 + 10, 0);
int n, m;
int main() {
ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
cin >> n >> m;
for (int i = ... | ALGO | 0.999917 | 3.726642 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.