uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
73239ee3-eefe-4d64-829b-4e90dd7146fb | lucasxia01/Competitive-Programming-Problems | Codeforces/CF 630/CF 630/A.cpp | #include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <functional>
#include <stdlib.h>
#include <time.h>
#include <complex>
#include <iterator>
#include <regex>
#include <fstream>
#include <utility>
#include <vector>
#include <string>
#include <cstring>
#include <stack>... | ALGO | 0.995556 | 3.527983 |
b5d3702c-2d71-4846-9600-3476bb162279 | Colloportus0/MLIRSmith11 | libcxx/test/std/algorithms/algorithms.results/min_max_result.pass.cpp | // UNSUPPORTED: c++03, c++11, c++14, c++17
// template <class I1, class I2>
// struct min_max_result;
#include <algorithm>
#include <cassert>
#include <type_traits>
#include "MoveOnly.h"
struct A {
explicit A(int);
};
// no implicit conversion
static_assert(!std::is_constructible_v<std::ranges::min_max_result<A>,... | TEST | 0.866235 | 7.150418 |
1ff797e1-aee3-4f90-96f8-220e182ae848 | nkc2002/DSA_Document | code_dsa/SapXepTimKiem/B35_XepTre.cpp | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
const int MOD = 1e9 + 7;
int main()
{
int n , s ; cin >> n >> s;
ll a[n] , ans = 0;
for(int i = 0 ; i < n;i++) cin >> a[i];
sort(a , a + n);
int i = 0 , j = n - 1;
while(i < j)
{
if(a[i] + a[j] <= s)
{
... | ALGO | 0.99995 | 3.407817 |
78df2ce1-181f-4d64-be30-c07be9fb4a5b | dylight1/Neoflex_Pract | flutter_application_13/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.998126 | 6.76775 |
bbb41a08-e85d-425b-a963-8515e7533b03 | kbg2206/STRIVER | DAY 7 LINKED LISTS AND ARRAY/3 SUM.cpp | class Solution {
public:
vector<vector<int>> threeSum(vector<int>& nums) {
sort(nums.begin(),nums.end());
vector<int> out;
set<vector<int>> s;
vector<vector<int>> ans;
int n=nums.size();
for(int i=0;i<n;++i)
{
if(i==0 || (i>0 && nums[i-1]!=nums[i])... | ALGO | 0.999958 | 5.645567 |
f4d82a58-ae69-47af-9a1d-5b493fa4b38f | ashur8736/random-password-generator | Documents/DSA/selectionsort.cpp | #include<iostream>
using namespace std;
void printarray(int arr[],int n)
{
for(int i=0;i<n;i++)
{
cout<<arr[i];
}
}
void selectionsort(int arr[],int n)
{
for(int i=0;i<n-1;i++)
{
int minindex=i;
for(int j=i+1;j<n;j++)
{
if(arr[j]<arr[minindex])
{
... | ALGO | 0.999985 | 4.404207 |
d1768978-b5d7-4ee0-8ca8-a49f539a8e03 | stellamyla/RobotSim | Planning/ConstrainedInterpolator.cpp | #include "ConstrainedInterpolator.h"
#include "Modeling/SplineInterpolate.h"
#include <math3d/primitives.h>
#include <errors.h>
#include <list>
#include <queue>
using namespace Math3D;
#define CONDITION_INITIAL_TANGENTS 0
#define CONDITION_MIDDLE_TANGENTS 0
#define OPTIMIZE_TANGENTS 0
const static int verbose = 0;
/... | ALGO | 0.999895 | 4.969974 |
0c667d05-4ad1-4349-99b8-49612435febc | nadipelliDeepthi/coding | arrays_hashing/kadane_algo.cpp | long long maxSubarraySum(vector<int> arr, int n)
{
// Write your code here.
long long maxsum=0,maxi=0;
for (int i = 0; i < arr.size(); i++) {
maxsum=maxsum+arr[i];
if(maxsum<0)
maxsum=0;
maxi=max(maxi,maxsum);
}
return maxi;
}
| ALGO | 0.999925 | 5.088618 |
9f7316ff-0ebe-4b08-bf62-05d0daed084f | IsabellyTemoteo/OldSchoolOktoplus | Contest 2023.1 - FACOM/Teoria Dos Números/natal.cpp | /**
* Henrique Junqueira
* Isabelly Temoteo
* Vinícius Lima
* CEFET, Leopoldina
*/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
void solve(ull p);
int main()
{
ull p;
while(cin>>p){
solve(p);
}
return 0;
}
void solve(ull p) {
u... | ALGO | 0.999721 | 3.747001 |
1b084811-109f-4222-a02a-41c5e17ecda5 | ishandutta2007/codeforces | rama_pang/normal/1364/A.cpp | #include <bits/stdc++.h>
using namespace std;
using lint = long long;
int main() {
ios::sync_with_stdio(0);
cin.tie(0), cout.tie(0);
int T;
cin >> T;
while (T--) {
int n, x;
cin >> n >> x;
vector<int> a(n);
int nt = 0;
for (auto &i : a) {
cin >> i;
if (i % x != 0) {
n... | ALGO | 0.999825 | 3.975934 |
da729bc9-4a0f-4a72-a0bc-71fa58528746 | Lleafll/meta | metacore/src/Enemies.cpp | #include "Enemies.h"
#include <gsl/gsl_assert>
#include <gsl/gsl_util>
namespace metacore {
namespace {
constexpr auto enemy_movement_speed = 50.0 / 1'000'000.0; // per microsecond
constexpr auto spawn_interval = std::chrono::microseconds{4'000'000};
constexpr auto spawn_edge = 300;
} // namespace
Enemies::Enemies... | TOOL | 0.945224 | 6.371231 |
d66a89f9-3610-44f9-90a3-3da512fc6dc4 | JonathonMacleod/Distributed-Game-Architecture | libs/BOOST1.82.0/libs/compute/perf/perf_bolt_sort.cpp | #include <algorithm>
#include <cstdlib>
#include <vector>
#include <bolt/cl/sort.h>
#include <bolt/cl/copy.h>
#include <bolt/cl/device_vector.h>
#include "perf.hpp"
int main(int argc, char *argv[])
{
perf_parse_args(argc, argv);
std::cout << "size: " << PERF_N << std::endl;
::cl::Device device = bolt::... | ALGO | 0.994105 | 5.062958 |
8837bf3f-d1ea-4434-b3cb-4e48efc79da7 | SebastianSroczyk/LearningCPP | Controlling Program Flow/ContinueAndBreak.cpp | /*
continue and break in loops
Author: Sebastian Sroczyk
Date: 12/07/2024
*/
#include <iostream>
/*
continue: No further statements in the body of the loop are executed,
and control immediately goes directly to the beginning of
the loop for the next iteration. (I.e. Skip i... | TOOL | 0.903078 | 3.802847 |
47f175c4-9d5c-4d82-a2b8-90e2220cbbd2 | ayaanlehashi11/LeetCode-Solutions | checkIfBinaryStringHasAtMostOneSegmentOfOnes/CheckIfBinaryStringHasAtMostOneSegmentOfOnes.cpp | // Source : https://leetcode.com/problems/check-if-binary-string-has-at-most-one-segment-of-ones/
// Author : Hao Chen
// Date : 2021-03-07
/*****************************************************************************************************
*
* Given a binary string s without leading zeros, return true if s con... | ALGO | 0.999752 | 6.507765 |
599d7c69-76ce-45e5-bc88-238a2cfc5c79 | youjin1207/SafeLabor | Code/Rcpp/rcpp_fun_null_bmi.cpp | #include <Rcpp.h>
#include <cmath>
//[[Rcpp::depends(RcppParallel)]]
#include <RcppParallel.h>
using namespace Rcpp;
using namespace RcppParallel;
//[[Rcpp::export]]
double sumC(NumericVector x) {
int n = x.size();
double total = 0;
for(int i = 0; i < n; ++i) {
total += x[i];
}
return total;
}
//[[Rcpp:... | ALGO | 0.99952 | 5.940067 |
81b0e5af-8d44-4da3-b1f3-0a76085c005b | DeathSquat/LeetCode_DSA | 191. Longest Harmonious Subsequence.cpp | class Solution {
public:
int findLHS(vector<int>& nums) {
unordered_map<int, int> freq;
int longest = 0;
// Count frequencies
for (int num : nums) {
freq[num]++;
}
// Check for neighbors
for (auto& [key, val] : freq) {
if (freq.count(... | ALGO | 0.999708 | 6.249411 |
bda6f808-84b8-4d5c-97c1-4f133e48bea7 | InnoFang/algo-set | LeetCode/2181. Merge Nodes in Between Zeros/solution.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
/**
* 39 / 39 test cases passed.
* Runtime: 544... | ALGO | 0.999977 | 5.707901 |
301b58d5-7f3c-4b7c-945b-336dcc6cae5f | rotarymars/atcoder_submissions | abc188/abc188_b/abc188_b.cpp | #include <iostream>
#include <vector>
#include <numeric>
#ifdef _DEBUG
#define DP(x) cout << #x << " = " << x << endl
#else
#define DP(x) ;
#endif
using namespace std;
signed main()
{
cin.tie(nullptr);
ios_base::sync_with_stdio(false);
int n;
cin>>n;
vector<int>a(n),b(n);
for(int&i:a)cin>>i;
... | ALGO | 0.999983 | 3.053772 |
d4255243-cfd3-4070-9e43-5919ba41be14 | ChrisRosales/Algoritmia | Examenes/E1/2022-2/C++/EX1_2022-2/EX1_2022-2/P2_2022_2.cpp | #include <iostream>
#define N 11
using namespace std;
typedef int Elemento;
typedef struct nodo
{
Elemento elem; // el dato que almacena el nodo
struct nodo *sig; // sig es la direccin del siguiente nodo
} Nodo;
typedef struct
{
Nodo *cabeza; // cabeza almacena la direccion del primer nodo de la lista... | ALGO | 0.999491 | 3.646235 |
8b6ec06d-0418-4c9c-ae84-f5e30fb3378a | Robertgovind/DSA_with_C_plus_plus | 05_binarySearch/07_search_in_rotatedArray.cpp | #include<iostream>
using namespace std;
int getPivot(int arr[],int size){
int start=0,end=size-1;
int mid=start+(end-start)/2;
while(start<end){
if(arr[mid]>=arr[0]){
start=mid+1;
}
else{
end=mid;
}
mid=start+(end-start)/2;
}
return mi... | ALGO | 0.999995 | 4.984746 |
09d748d6-8356-4863-abf0-4fa6e521e2af | Johannyjm/c-pro | AtCoder/asa/2020/asa0420/d.cpp | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep1(i, n) for (int i = 1; i < (n); ++i)
using namespace std;
typedef long long ll;
int main() {
cin.tie(nullptr);
ios::sync_with_stdio(false);
int h, w;
cin >> h >> w;
vector<string> s(h);
rep(i, h) cin >> s[i];... | ALGO | 0.999981 | 4.283903 |
bc017b97-d495-4977-82fa-2a28bff27f26 | genericSpecimen/problem-solving | dsa/linked-lists/21_merge-two-sorted-lists.cpp | #include <iostream>
#include <vector>
#include <limits>
#include "LinkedList.h"
/*
* Splicing approach - only fix pointers rather
* than creating a new list.
*/
ListNode* mergeTwoLists(ListNode *l1, ListNode *l2) {
/*
* Create a dummy node - helps with cleaning up the
* code from checking whether the ... | ALGO | 0.999882 | 5.716642 |
9f7ed3f6-2929-41b2-881f-c13afb50015d | AstralOS-AOSP/packages_apps_Snap | jni/feature_stab/db_vlvm/db_utilities_poly.cpp | /* $Id: db_utilities_poly.cpp,v 1.2 2010/09/03 12:00:10 bsouthall Exp $ */
#include "db_utilities_poly.h"
#include "db_utilities.h"
/*****************************************************************
* Lean and mean begins here *
****************************************************... | ALGO | 0.99954 | 5.252677 |
86762608-5af9-463f-9b05-aa44c218fd55 | AustinBoyuJiang/Competitive-Programming | Competitions/CALICO/Fall 2024/2.cpp | /*
* Author: Austin Jiang
* Date: 11/16/2024 4:12:12 PM
* Problem:
* Source:
* Description:
*/
/* Configuration */
#define MULTICASES
//#define LOCAL
//#define READLOCAL
//#define FILESCOMP
//#define SETMEM
#define FASTIO
//#define NDEBUG
#define OPTIMIZE
//#define INTTOLL
#ifdef OPTIMIZE
#pragma GCC optimize(2)... | ALGO | 0.999751 | 4.609381 |
ed727b66-b64a-4208-860a-d76974fc312e | DairovOlzhas/ACM | ADS/BST/h.cpp | #include<iostream>
#include<cmath>
using namespace std;
class Node{
public:
int val;
Node *left, *right;
Node(int val){
this->val = val;
left = NULL;
right = NULL;
}
};
class Tree{
public:
Node *root;
int sz;
Tree(){
root = NULL;
sz = 0;
}
Node *insert(Node *node, int x){
if(node == NULL) ... | ALGO | 0.999984 | 4.214448 |
354a15f8-6270-462c-b884-d983c7e7327a | thegamer1907/Code_Analysis | contest/1542587059.cpp | #define ONLINE_JUDGE
#include <bits/stdc++.h>
#define inf 0x3f3f3f3f
#define INF 0x3f3f3f3f3f3f3f3fLL
#define MOD 1000000007
#define pb push_back
#define sq(x) ((x)*(x))
#define x first
#define y second
#define eps 1e-8
#define bpt(x) (__builtin_popcount(x))
#define bptl(x) (__builtin_popcountll(x))
#define... | ALGO | 0.999718 | 3.311984 |
dfd73d35-a22a-4d00-9013-c56106546410 | fsy-juruo/noip-2021-js-answer | t2021/JS-0234/variance/variance.cpp | #include <bits/stdc++.h>
using namespace std;
const int N=16;
int n,st,mini=1e5,p,ans=1e9;
int a[N],b[N];
int GET(){
int s=0,ret=0;
for (int i=0;i<n;i++){
s+=a[i];
}
for (int i=0;i<n;i++){
ret+=(a[i]*a[i]*n-2*a[i]*s+s*s/n);
}
return ret;
}
int main(){
freopen("variance.in","r",stdin);
freopen("variance.o... | ALGO | 0.999921 | 3.573742 |
f59f97e6-135f-44aa-a9dd-75d399357a85 | Maximus5/ConEmu | src/ConEmu/HotkeyList.cpp | #define HIDE_USE_EXCEPTION_INFO
#include "Header.h"
#include "HotkeyList.h"
#include "ConEmuCtrl.h"
#include "Options.h"
#include "../ConEmuCD/GuiHooks.h"
// ReSharper disable twice CppParameterMayBeConst
ConEmuHotKey& ConEmuHotKeyList::Add(const int descrLangId, const ConEmuHotKeyType hkType, LPCWSTR name, HotkeyFKe... | TOOL | 0.862655 | 5.50695 |
bd308740-5e52-4090-bb40-0f3c60c94b49 | pranayd17/CP-Problem-Solutions | Closest Palindrome.cpp | #define ll long long
ll getNum(ll num){
string temp=to_string(num);
int s=0;
int e=temp.size()-1;
while(s<e){
temp[e--]=temp[s++];
}
return stoll(temp);
}
long long int closestPalindrome(long long int num){
// Code here
ll ans=getNum(num);
if(num<10){
... | ALGO | 0.999819 | 5.726745 |
9eac19c7-4115-4a01-b1fb-e0d78d43531e | yuri-qq/calculator | src/expression.cpp | #include <expression.hpp>
#include <gtkmm.h>
#include <util.hpp>
#include <vector>
using namespace util;
Operand::~Operand() {}
Number::Number(long double value) {
this->value = value;
}
Number::~Number() {}
long double Number::get() {
return this->value;
}
long double Number::calc(long double x) {
retur... | TOOL | 0.974757 | 6.383718 |
c69ae23a-26fd-4459-bbfe-c85d1b28931d | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_4928_36.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
long long i, n, a, b, x[2010];
cin >> n >> a >> b;
for (i = 0; i < n; i++) cin >> x[i];
sort(x, x + n);
cout << x[b] - x[b - 1] << endl;
return 0;
}
| ALGO | 0.999875 | 3.37064 |
e1eb84b3-af1b-4e43-afe2-ce9a3b842220 | yo00unis/Problems | 799A. Carrot Cakes.cpp |
/*
problem link ----> https://codeforces.com/contest/799/problem/A
*/
#include <iostream>
#include <cmath>
#include <algorithm>
using namespace std;
int main(){
short n,t,k,d;
cin>>n>>t>>k>>d;
int x = ceil(d / (t * 1.0));
n -= x * k;
if(n > 0){
if(d % t != 0)cout<<"YES";
else{... | ALGO | 0.999719 | 3.575482 |
832680ef-2ca2-404b-8d24-acb62776e1a4 | sd8917/C-_Program | LinkdList/Linkdlsit/ll Insertion/Linked_List.cpp | //Inserion,operation in Linked list.
#include<iostream>
using namespace std;
class node{
public:
int data;
node *next;
node(int d){
data = d;
next = NULL;
}
};
//Insert node at the head of the linked list;
node *insertAtHead(node *&head,int data){
node *n = new node(data);
n->n... | ALGO | 0.999933 | 4.899765 |
dcd6d8d6-d7b8-490b-b6ed-7d36f49802a6 | youssefali424/local_notification_test | 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.99887 | 6.783439 |
6db67d11-97b9-4614-a11e-235c36170dc8 | danielavalera/TAIS | Juez/Repaso/R.4/R.4/Source.cpp |
/*@ <answer>
*
* Nombre y Apellidos:
*
*@ </answer> */
#include <iostream>
#include <fstream>
#include <vector>
#include <queue>
//using namespace std;
//#include "..." // propios o los de las estructuras de datos de clase
/*@ <answer>
Escribe aqu un comentario general sobre la solucin, explicando cmo
se re... | ALGO | 0.999806 | 4.941398 |
0ed89a30-6e9d-49fd-9955-484f12574375 | MIRELLA-02/Listadeexerc-ciosC | EXERCÍCIO 10- LISTA C.cpp | #include <stdio.h>
int main (){
int num, i, res = 1;
printf("Digite um número:\n");
scanf("%d", &num);
for (i = 1; i <= num; i++) {
res = res * i;
}
printf("O fatorial deste número é: %d\n", res);
return 0;
}
// O usuário digitará um número, o qual o sistema irá ler... | ALGO | 0.999925 | 3.783007 |
90fa23d1-5b4d-4585-8662-66781e2eebef | codehag/compiler-compiler-dev | gfx/skia/skia/src/pathops/SkPathOpsQuad.cpp | #include "src/pathops/SkIntersections.h"
#include "src/pathops/SkLineParameters.h"
#include "src/pathops/SkPathOpsCubic.h"
#include "src/pathops/SkPathOpsCurve.h"
#include "src/pathops/SkPathOpsQuad.h"
#include "src/pathops/SkPathOpsRect.h"
// from blackpawn.com/texts/pointinpoly
static bool pointInTriangle(const SkDP... | ALGO | 0.998532 | 5.409724 |
5f70cdfd-b572-4d3d-b2b5-88736be69a4e | hcm1206/Algorithm_Study_Archive | solvedac_ranma/week42/7308.cpp | #include <iostream>
#include <string>
using namespace std;
int main() {
cin.tie(NULL);
ios_base::sync_with_stdio(false);
int t;
cin >> t;
for (int ti = 0; ti < t; ++ti) {
string str;
cin >> str;
string num = "";
int idx = 0;
int size = static_cast<int>(str.size());
bool iscon = true;
bool plus =... | ALGO | 0.999837 | 3.854525 |
cc11356d-ac40-46fb-940d-7b5db9030e98 | Ariful-Islam010/Codeforces-Solutions | 520B - Two Buttons.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, m, steps = 0;
cin >> n >> m;
while (m > n) {
if (m % 2 == 0) m /= 2;
else m += 1;
steps++;
}
cout << steps + (n - m) << endl;
return 0;
}
| ALGO | 0.999982 | 4.63382 |
13c11770-9aff-4725-acdb-988f576e929f | DionysiosB/CodeForces | 1788C-MatchingNumbers.cpp | #include <cstdio>
int main(){
long t; scanf("%ld", &t);
while(t--){
long n; scanf("%ld", &n);
if(n % 2 == 0){puts("No"); continue;}
puts("Yes");
for(long p = 1; p <= n; p += 2){printf("%ld %ld\n", p, 2 * n - p / 2);}
for(long p = 2; p < n; p += 2){printf("%ld %ld\n", p,... | ALGO | 0.999521 | 3.847161 |
8555345a-cc60-4ce9-8592-39e02c2b7b7f | Next-Gen-UI/Hacktober | Leetcode/0575. Distribute Candies/0575.cpp | class Solution {
public:
int distributeCandies(vector<int>& candies) {
bitset<200001> bitset;
for (const int candy : candies)
bitset.set(candy + 100000);
return min(candies.size() / 2, bitset.count());
}
};
| ALGO | 0.999484 | 6.287614 |
b7ff6212-9094-43cf-86a8-87f7e9c0df65 | raincross7/code-similarity | codes/train_code/problem254/problem254_218.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define INF 1999999999
#define MODA 1000000007
#define rep(i,n) for (long long i = 0; i < (n); ++i)
#define all(x) (x).begin(),(x).end()
ll N, K;
vector<ll> a;
ll ans = std::numeric_limits<ll>::max();
void recursive_comb(vector<ll> ind, int s, int ... | ALGO | 0.999899 | 3.680685 |
f9d97a25-2cfc-42ba-9c35-03fdf12e59de | NewElectoralCollege/proposal | lib/programming_examples/ham1.cpp | // Don't define main()
#define LIB
// C++ implementation above
#include "c++.cpp"
#include <algorithm>
typedef struct
{
Party *party;
double divisor;
} divisor;
inline bool compareDivisors(divisor *a, divisor *b)
{
return a->divisor > b->divisor;
}
int main()
{
makeList();
int seats, n;
std... | ALGO | 0.998696 | 5.342139 |
54f4e2b6-a484-4106-97b4-837aa7cafd1f | mrsaidkarim/CompetitiveProgramming | Codeforces/B_Make_Equal.cpp | #include <iostream>
#include <vector>
using namespace std;
int main()
{
int n;
vector<int> tab;
int s;
int m;
int rest;
int ans;
cin >> n;
for (int i = 0; i < n; i++)
{
s = 0;
rest = 0;
ans = 0;
cin >> m;
tab.resize(m);
for (int j = 0; j < m; j++)
{
cin >> tab[j];
s += tab[j];
}
for ... | ALGO | 0.999831 | 3.58356 |
69f247bb-adc3-4748-90b0-371eca1609dc | Ginakira/Code-Archive | Luogu/P1372又是毕业季1.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int main() {
long long n, k;
cin >> n >> k;
cout << n / k << endl;
return 0;
} | ALGO | 0.999564 | 3.48837 |
b8ac4dc6-4a0b-4a67-9758-f665e1029d21 | hardikkumar4472/Daily-problems | 2216-delete-the-middle-node-of-a-linked-list/2216-delete-the-middle-node-of-a-linked-list.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
ListNode* deleteMiddl... | ALGO | 0.999903 | 5.977241 |
2cb4a1e9-e96b-4d1d-90f9-4370f0a78bd5 | cono1/Anarchy-on-Space | src/Game/collisionManager.cpp | #include "collisionManager.h"
#include <raymath.h>
namespace game
{
bool checkBulletToAsteroidCollision(Bullet bullet, Asteroid asteroid)
{
if (asteroid.active && bullet.active)
{
return CheckCollisionCircleRec(asteroid.pos, asteroid.radius, bullet.r);
}
else
{
return false;
}
... | ALGO | 0.871225 | 5.951362 |
17a72a24-4a43-46de-9df5-1aebacc9dbcf | securesystemslab/forward-cfi | lib/CodeGen/MachineDominanceFrontier.cpp | #include "llvm/CodeGen/MachineDominanceFrontier.h"
#include "llvm/CodeGen/MachineDominators.h"
#include "llvm/Analysis/DominanceFrontierImpl.h"
#include "llvm/CodeGen/Passes.h"
using namespace llvm;
namespace llvm {
template class DominanceFrontierBase<MachineBasicBlock>;
template class ForwardDominanceFrontierBase<M... | ALGO | 0.993527 | 7.540615 |
2ac86140-ab23-4f9d-87ea-1e29774d33cc | dpadilla96/FUNDAMENTOS-DE-PROGRAMACION | C++/38. PROMEDIO RUTA.cpp |
#include<iostream>
using namespace std;
// TODOS LOS LUNES, MIERCOLES Y VIERNES, UNA PERSONA CORRE LA MISMA RUTA
// Y CRONOMETRA LOS TIEMPOS OBTENIDOS. DETERMINA EL TIEMPO PROMEDO EN QUE
// LA PERSONA TARDE EN RECORRER LA RUTA EN UNA SEMANA CUALQUIERA.
int main() {
float promedio;
float tl;
float tm;
float tv;
c... | ALGO | 0.996847 | 3.644245 |
aff33adc-bf3a-4f8a-8e0d-eb8abe19cc38 | AshrafulHaqueToni/Code-Library-ash_98 | data structure/Trie problem/spoj try to comp.cpp | #include<bits/stdc++.h>
using namespace std;
///https://www.spoj.com/problems/TRYCOMP/
#define mx 5000005
#define ll long long
int best[mx];
string ch,re[mx];
int Trie[mx][26];
map<string,int>mp;
int n,m,k,ii,st=1,cnt;
void Insert(string s)
{
int len=s.size();
int cur=1;
for(int i=0;i<len;i++)
{
... | ALGO | 0.999618 | 3.863036 |
35aa8257-d67d-4835-9d15-7fb03e89f8f6 | huanghuoguoguo/oceanbase | deps/oblib/src/lib/geo/ob_geo_box_clip_visitor.cpp | #define USING_LOG_PREFIX LIB
#include "ob_geo_box_clip_visitor.h"
#include "lib/geo/ob_geo_func_register.h"
namespace oceanbase
{
namespace common
{
ObBoxPosition ObGeoBoxClipVisitor::get_position(double x, double y)
{
ObBoxPosition position = ObBoxPosition::INVALID;
if (x > xmin_ && x < xmax_ && y > ymin_ && y < ... | ALGO | 0.982467 | 5.340157 |
ca0dd3f4-b516-44ce-a880-863eeef3e762 | Jayklean123/Task-1 | solution.cpp | #include <iostream>
using namespace std;
#define int long long
int totient(int n) {
int result = n;
for (int p = 2; p * p <= n; ++p) {
if (n % p == 0) {
while (n % p == 0)
n /= p;
result -= result / p;
}
}
if (n > 1)
result -= result / n;... | ALGO | 0.999965 | 4.753016 |
1bae5fe9-dd8d-4c38-8163-e23479937a6a | cpc/hipcl-clang | test/SemaCXX/constexpr-factorial.cpp | // RUN: %clang_cc1 -std=c++11 -fsyntax-only %s
constexpr unsigned oddfac(unsigned n) {
return n == 1 ? 1 : n * oddfac(n-2);
}
constexpr unsigned k = oddfac(123);
using A = int[k % 256];
using A = int[43];
| ALGO | 0.993686 | 6.436195 |
1b3e7e6e-dee8-4fe2-ae58-786a9592db6d | ryan-4u/DSA-cpp- | DSA foundation/Recursion/firstOccurance.cpp | #include<iostream>
#include<vector>
using namespace std ;
int firstOccur(vector <int> arr,int target , int i){
if( i == arr.size() ){
return -1 ;
}
if( arr[i] == target ){
return i ;
}
return firstOccur( arr , target , i+1 ) ;
}
int main(){
vector <int> v = { 1,2,3,4,3,5 };
... | ALGO | 0.999824 | 5.317904 |
6dbc3a7e-5407-48d4-bd29-4e2d24cb5ed3 | ishandutta2007/codeforces | ghastlcon/normal/1214/A.cpp | #include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#define INF 1000000007
using namespace std;
int main(void) // 1214A.cpp
{
int n;
int d;
int e;
int i;
int o;
scanf("%d", &n);
scanf("%d", &d);
scanf("%d", &e);
for(i = 0, o = INF; i * ... | ALGO | 0.999881 | 3.280606 |
cc479004-c64f-4ae6-bc8d-29bb3ae31293 | wrr606/OJ_Code | Zerojudge/Uva題庫/f434.cpp | #include<bits/stdc++.h>
using namespace std;
#define endl '\n'
int main(){
ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
string s;
while(cin>>s){
for(auto i:s){
cout<<char(int(i)-7);
}
cout<<endl;
}
} | ALGO | 0.999333 | 3.875261 |
e3282f5c-98ca-42c8-9e1e-380fbd84b1d7 | qtcyy/LeetCode-Record-3.17 | 图论算法/chapter4/3.1/模板/main.cpp | #include <climits>
#include <functional>
#include <iostream>
#include <queue>
#include <utility>
#include <vector>
using namespace std;
class Graph {
private:
vector<vector<pair<int, int>>> g;
public:
void dijkstra(int n, int s) {
priority_queue<pair<int, int>, vector<pair<int, int>>, greater<>> q;
vector... | ALGO | 0.999595 | 4.304852 |
cf81b099-7d31-4af4-97fe-afbd2a58b075 | abhishekgupta1906/D.S.A | BST/checkbst.cpp | #include <iostream>
#include <cstring>
#include <queue>
#include "constructorbst.h"
using namespace std;
BinaryTreeNode<int> *create(BinaryTreeNode<int> *root)
{
int rootdata;
cout << "Enter data:" << endl;
cin >> rootdata;
if (rootdata == -1)
{
return NULL;
}
root = new BinaryTreeNo... | ALGO | 0.999869 | 4.650539 |
b5a31624-42c3-4a91-ab50-6b6c328f0aaa | DroidAITech/vslam-evaluation | VINS/opencv/samples/cpp/tutorial_code/Histograms_Matching/MatchTemplate_Demo.cpp | /**
* @file MatchTemplate_Demo.cpp
* @brief Sample code to use the function MatchTemplate
* @author OpenCV team
*/
#include "opencv2/imgcodecs.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/imgproc.hpp"
#include <iostream>
using namespace std;
using namespace cv;
//! [declare]
/// Global Variables
bool us... | ALGO | 0.950936 | 7.253778 |
eff7006d-971b-45ba-b28b-a159dfc6ef31 | ishandutta2007/codeforces | toxel/normal/833/A.cpp | #include<bits/stdc++.h>
typedef long long ll;
const int N = 1000010;
int n;
int a, b;
int min[N], mu[N];
std::vector <int> prime;
ll sqrt(ll n){
ll left = 0, right = 1e6;
while (left < right){
ll mid = left + right + 1 >> 1;
if (mid * mid * mid <= n){
left = mid;
}
else{
right = mid - 1;
}
}
retu... | ALGO | 0.999979 | 4.49842 |
db035fae-50d6-4cf2-a1bf-a80f26ddb2c0 | pumfit/PracticeForCodingTest | CodingTestExProject/CodingTestExProject/백준/1920.cpp | /*
1920 ã
N A[1], A[2], , A[N] ־ , ȿ X ϴ ˾Ƴ α ۼϽÿ.
ù° ٿ ڿ N(1 N 100,000) ־. ٿ N A[1], A[2], , A[N] ־. ٿ M(1 M 100,000) ־. ٿ M ־µ, Aȿ ϴ ˾Ƴ ȴ. -231 ũų 231 ۴.
ó ߸а 100001 ˾Ҵٰ out of index ̴.
̺Ž algorithm ִ Լ ؼ Ǯ ִ ̺Ž ߿ϹǷ Ŀ ٽ ؼ Ǯ
*/
#include <iostream>
#include <algorithm>
using namespace... | ALGO | 0.999997 | 4.505665 |
76474db0-8494-4ec6-9276-ba91e883bfa9 | wortheumio/wortheum | libraries/fc/src/crypto/elliptic_openssl.cpp | #include <fc/crypto/elliptic.hpp>
#include <fc/crypto/base58.hpp>
#include <fc/crypto/openssl.hpp>
#include <fc/fwd_impl.hpp>
#include <fc/exception/exception.hpp>
#include <fc/log/logger.hpp>
#include <assert.h>
#include "_elliptic_impl_pub.hpp"
namespace fc { namespace ecc {
namespace detail
{
vo... | TOOL | 0.989265 | 6.957225 |
3d030730-01f5-433a-b19a-f182ff7fe4b4 | ishandutta2007/codeforces | aidos/normal/215/A.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
#include <set>
#include <map>
#include <queue>
#define pb push_back
#define ll long long
#define mp make_pair
#define ff first
#define sc second
#define pii pair<int,int>
#define pis pair<i... | ALGO | 0.999746 | 3.108165 |
36874c10-2ef6-4497-85aa-f08eae35aba7 | kagemiku/atcoder-contests | abc/051/a.cpp | #include <bits/stdc++.h>
#define FOR(i,a,b) for(int (i)=(a);(i)<(b);(i)++)
#define REP(i,n) FOR(i,0,n)
#define RER(i,n) FOR(i,0,(n+1))
#define pb push_back
#define mp(a,b) make_pair((a),(b))
#define mset(m,v) memset(m,v,sizeof(m))
using namespace std;
typedef vector<int> vi;
typedef pair<int, int>... | ALGO | 0.999336 | 3.339578 |
8f720013-2911-415f-9dd8-ab9eff77a9c1 | aarindey/Leetcode-Solution-By-aarindey | longest-subarray-of-1s-after-deleting-one-element/longest-subarray-of-1s-after-deleting-one-element.cpp | class Solution {
public:
int longestSubarray(vector<int>& nums) {
int i=0,j=0;
int zeroPos;
int n=nums.size();
int ans=0;
int c=0;
while(i<n&&j<n)
{
if(nums[j]==0)
{
c++;
if(c>1)
{
... | ALGO | 0.999904 | 5.949316 |
1c336aad-2275-4208-a8e2-7cb8f72524b9 | chopperdodo/leetcode | final/3sum.cpp | class Solution {
public:
vector<vector<int> > threeSum(vector<int> &num) {
vector<int> sorted = num;
sort(sorted.begin(), sorted.end());
vector<vector<int> > result;
int n = sorted.size(), i = 0;
while (i < n) {
int j = i + 1, k = n - 1;
while (j < k) ... | ALGO | 0.999853 | 5.595954 |
d3f8732d-d002-4c01-ab44-7717510d0f31 | NikkiKoole/inapperdeflap | love-0.10.1-ios-source/src/libraries/Box2D/Collision/b2DynamicTree.cpp | #include <Box2D/Collision/b2DynamicTree.h>
#include <string.h>
b2DynamicTree::b2DynamicTree()
{
m_root = b2_nullNode;
m_nodeCapacity = 16;
m_nodeCount = 0;
m_nodes = (b2TreeNode*)b2Alloc(m_nodeCapacity * sizeof(b2TreeNode));
memset(m_nodes, 0, m_nodeCapacity * sizeof(b2TreeNode));
// Build a linked list for th... | ALGO | 0.996279 | 7.786732 |
f403fbf0-5939-4997-9bdf-87ef53e50d17 | phong28zk/DayXH | IDGIAITHUA003.cpp | #include <bits/stdc++.h>
using namespace std;
#define FAST_IO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); cerr.tie(0)
typedef long long ll;
typedef unsigned long long ul;
typedef long double ld;
typedef map<int, int> mii;
typedef map<ll, ll> mll;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;
typedef ... | ALGO | 0.99987 | 4.594727 |
01a2729d-0e39-4a5d-b497-08d49ab5e14e | Shehanshha/Simple-Interest-Calculator | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.9988 | 6.76073 |
290353d1-2a9b-4de4-b3c1-241c854a78ca | yqtaowhu/programming | leetcode/palindromePartitioning/palindromePartitioning.II.cpp | // Date : 2016.09.25
// Author : yqtao
// https://github.com/yqtaowhu
//reference:
/**********************************************************************************
*
* Given a string s, partition s such that every substring of the partition is a palindrome.
*
* Return the minimum cuts needed for a palindrome pa... | ALGO | 0.999951 | 5.208577 |
a558c940-866f-4794-ace1-df861c648ccc | icecat2012/leetcode | problems/632. Smallest Range Covering Elements from K Lists/solve.cpp |
class Solution {
public:
vector<int> smallestRange(vector<vector<int>>& nums) {
vector<int>res={-100000,100000};
int k=nums.size();
int maxi=INT_MIN;
priority_queue<vector<int>,vector<vector<int>>,greater<vector<int>>>pq;
for(int i=0;i<k;i++){
int num=nums[i][0];... | ALGO | 0.99994 | 5.340593 |
c867f402-69dd-4fd0-8162-035d27ec35fc | nightshrine/nightshrine-atcoder-library | ac-library/test/example/maxflow_practice.cpp | #include <atcoder/maxflow>
#include <iostream>
using namespace std;
using namespace atcoder;
int main() {
int n, m;
cin >> n >> m;
vector<string> grid(n);
for (int i = 0; i < n; i++) {
cin >> grid[i];
}
/**
* generate (s -> even grid -> odd grid -> t) graph
* grid(i, j) cor... | ALGO | 0.999995 | 4.62765 |
19c3d8cd-d1d9-4525-b745-b77076183243 | qiaotian/CodeSprint | lintcode/digit_counts.cpp | /**
* @Author: Tian Qiao <qiaotian>
* @Date: 2016-06-17T13:23:17+08:00
* @Email: <EMAIL>
* @Last modified by: qiaotian
* @Last modified time: 2016-06-19T22:00:28+08:00
* @License: Free License
*/
/**
Count the number of k's between 0 and n. k can be 0 - 9.
Example
if n = 12, k = 1 in [0, 1, 2, 3, 4, 5, 6, 7, 8, 9... | ALGO | 0.999584 | 5.357111 |
069f3c34-2bc8-44d9-bf6e-9669c482539f | SidhartGautam25/leetcode | revision-theory/qstns/partition-labels.cpp | // solution 1
// store the end index of every character
// now whenever a charater comes,its end index should be in that partition also
// so end of that partition is updated with elemenets end index every time
class Solution {
public:
vector<int> partitionLabels(string s) {
map<char,int>mp;
vector... | ALGO | 0.999857 | 6.261608 |
99645cdc-2ace-4882-8562-a971429017ab | ishandutta2007/codeforces | rush_d_cat/normal/1082/B.cpp | #include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
using namespace std;
typedef long long LL;
const int N = 100000 + 10;
int n; char s[N];
int pre[N],nex[N];
int main(){
scanf("%d%s",&n,s+1);
for(int i=1;i<=n;i++){
if(s[i]=='S')pre[i]=i;
else pre[i]=pre[i-1];
}
... | ALGO | 0.999513 | 3.157581 |
c4c0ec1f-94c5-46ac-afc1-40c3b6508360 | yuejiangw/leetcode-1 | list/692.top-k-frequent-words.cpp | class Solution {
public:
vector<string> topKFrequent(vector<string>& words, int k) {
map<string, int> cnt;
for (const string& w : words) {
++cnt[w];
}
vector<vector<string>> bucket(words.size());
for (const auto& c : cnt) {
... | ALGO | 0.999979 | 6.520503 |
79944880-d059-446a-a526-fe1e3155f113 | ishandutta2007/codeforces | tempura0224/normal/1439/A1.cpp | #include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>
using namespace std;
#define REP(i,m,n) for... | ALGO | 0.999971 | 3.496133 |
dd5b41b6-000f-4169-9413-e4dcd0760aad | karimali03/Competitive-programming | solutions/archive/solve/tshreen_2025-07-27/a.cpp | #include <bits/stdc++.h>
using namespace std;
#define ln "\n"
#define ll long long
#define ld long double
#define ull unsigned long long
#define vec vector
#define vi vector<int>
#define vii vector<vector<int>>
#define viii vector<vector<vector<int>>>
#define f(i, a, b) for(int i = a; i < b; i++)
#define all(x) (x).be... | ALGO | 0.999975 | 3.947218 |
dd04eab9-703b-4e39-a520-2e855e692884 | yachShekhar/problem-solving | strikeORspare1.cpp | //https://www.codechef.com/problems/PINS
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define ROF(i,a,b) for(int i=a;i>b;i--)
#define mem(x,a) memset(x,a,sizeof(x));
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define tr(i,a) for( typeof(a.begin()) i=a.... | ALGO | 0.999597 | 4.053895 |
af6239c6-fcc9-4be7-9dcc-cb87eb1e5562 | YouRyuu/CPNPbiubiubiu | LeetCode/leetcode112.cpp | class Solution {
public:
bool hasPathSum(TreeNode* root, int targetSum) {
if(root==nullptr) return false;
if(root->left==nullptr && root->right==nullptr)
return targetSum == root->val;
return hasPathSum(root->left, targetSum-root->val) || hasPathSum(root->right, targetSum-root->... | ALGO | 0.999941 | 6.297233 |
5ce522a4-8c1c-455b-8750-640b71140a37 | nurF/Brute-Force-Game-Engine | thirdparty/boost-geometry/libs/geometry/test/algorithms/intersection_segment.cpp | #include <algorithm>
#include <ostream>
#include <sstream>
#include <string>
#include <vector>
#include <boost/config.hpp>
#include <geometry_test_common.hpp>
#include <boost/geometry/algorithms/correct.hpp>
#include <boost/geometry/algorithms/within.hpp>
#include <boost/geometry/algorithms/intersection_segment.hpp>
... | TEST | 0.925166 | 6.675236 |
01857137-dbd0-403e-bfdd-69abd835d3d5 | razu381/Where-It-All-Began-Chasing-CS-Fundamentals-2019-2024 | phitron/C++/intro to c++/dynamic memory.cpp | #include <bits/stdc++.h>
using namespace std;
int main(void){
int arr[] = {55,45,330,69,73,54};
sort(arr,&arr[7]);
for(int i = 1; i < 7; i++){
cout << arr[i] << " ";
}
}
| ALGO | 0.999399 | 3.238907 |
a75cd1cf-b0f2-4916-912b-344b7c8d85ad | mevensson/rosalind | src/main/src/main.cpp | #include "dna.hpp"
#include "options.hpp"
#include "revc.hpp"
#include "rna.hpp"
#include "subs.hpp"
#include <boost/iostreams/device/mapped_file.hpp>
#include <fstream>
#include <iostream>
#include <stdexcept>
using namespace boost::iostreams;
template<class SerFunc, class ParFunc, class Iterator>
static auto execu... | TOOL | 0.920556 | 7.258703 |
0e48617f-2348-4188-8075-85346cd2fc15 | allwinner-ics/platform_frameworks_base | media/libstagefright/codecs/m4v_h263/dec/src/find_min_max.cpp | /*
------------------------------------------------------------------------------
INPUT AND OUTPUT DEFINITIONS
Inputs:
input_ptr = pointer to the buffer containing values of type UChar
in a 2D block of data.
min_ptr = pointer to the minimum value of type Int to be found in a
square bloc... | ALGO | 0.999963 | 6.515752 |
eaf61304-ae41-4d5c-b208-22c2be384047 | JacobHell0/InstaRefine | 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 |
974de94d-4f88-45bc-9ad1-195d1887bef5 | kayman233/AlgorithmsDIHT | 2nd term/2-Shortest paths/B-Trade_arbitrage-Ford-Fukerson.cpp | /*
Необходимо написать торгового советника для поиска арбитража.
Арбитраж - это торговля по цепочке различных валют в надежде заработать на небольших различиях в коэффициентах.
Например, есть следующие курсы валют:
GBP/USD: 0.67
RUB/GBP: 78.66
USD/RUB: 0.02
Имея 1$ и совершив цикл USD->GBP->RUB->USD, получим 1... | ALGO | 0.999882 | 3.917024 |
18996d6e-ff6b-4413-9f01-c820eeba6815 | ishandutta2007/codeforces | komendart/normal/557/E.cpp | #include <bits/stdc++.h>
using namespace std;
const int maxn = 5000;
int n, k;
string s;
char good[maxn][maxn];
bool is_good(int i, int j) {
if (i > j) return true;
if (good[i][j] != -1) return good[i][j];
return good[i][j] = (s[i] == s[j] && is_good(i + 2, j - 2));
}
struct Trie {
int cnt;
Tr... | ALGO | 0.999972 | 3.625929 |
04907512-8d69-4727-838b-bb00091a627f | krishna-raj007/BodhiTree-Annotation | CS101_Autumn2020-21/Fibonacci/24_fibonacci.cpp | #include<simplecpp>
main_program{
long long n,k;
cin>>n>>k;
long long x=0,y=1,a,z,i=1;
while(i<=n)
{
z = x;
a = x % k;
if(a<=0 && a!=0){
a = a + k;
}
x = x + y;
y = z;
cout<<a<<endl;
i++;
}
}
| ALGO | 0.99999 | 3.081706 |
064e204f-0c63-4102-8bfe-b68460e96a63 | DhafaGusman/bagiin | 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 |
8713f49d-671e-4d85-b99b-b7d7788c000c | batakpout/cpp | dsalgo/arrays/sorting/counting_sort.cpp | /**
* works on data that is in the range e.g student marks [0 to 100],
* It can be a stable algorithm, try later from PEP?
* Counting sort can also work for negative numbers. You just have to rebase the current range of numbers.
e.g, if you have the range [-23, 54] we will rebase every number at number+min(R... | ALGO | 0.999844 | 5.461794 |
3b5ee407-5a1f-45f6-b300-2e517ca6cb6d | AbhJ/some-cp-files-3 | A_Simple_Math_2.cpp | //Coded by Abhijay Mitra (AbJ) on 2021 / 01 / 09 in 17 : 38 : 21
//title - A_Simple_Math_2.cpp
#include <iostream>
#include <stdlib.h>
#include <algorithm>
#include <cstdio>
#include <numeric>
#include <cstring>
#include <numeric>
#include <vector>
#include <iterator>
#include <map>
#include <set>
#include <climits>
#i... | ALGO | 0.999846 | 4.700113 |
234c893f-d8f8-4ad9-a900-dd7ed53ee1b7 | Rishi-T2408/Data-structures-and-Algorithm | Infix to postfix conversion.cpp | #include <iostream>
#include <string.h>
using namespace std;
struct Stack
{
int top;
int size;
char* S; //This will create an array which will work same as stack
}st;
void push(Stack* st, char x)
{
if ((st->top) == (st->size - 1))
cout << "Stack overflow" << endl;
else {
st->top++;
st->S[st->top] = x; //So ... | ALGO | 0.999733 | 4.58701 |
23678e04-f0e1-4f0b-b5fb-624d8cb57fb1 | 1LIXXy/week-homework | zuoye/week5.2.cpp | #include<iostream>
#include <string>
#include <cmath>
using namespace std;
class Comparison
{
public:
int Compare(int a, int b)
{
return (a > b) ? a : b;
}
int Compare(char a, char b)
{
return abs(a - b);
}
string Compare(string a, string b)
{
return (a.length() ... | ALGO | 0.99922 | 5.193463 |
3a56babf-6c3f-473f-9db6-477e64582c1d | Vishwa004/CSAo467-OS | Exp-16(First in First Out paging technique of memory management).cpp | #include <stdio.h>
#define FRAME_SIZE 3
#define PAGE_SIZE 10
int main()
{
int frames[FRAME_SIZE];
int pages[PAGE_SIZE] = {0, 1, 2, 3, 2, 4, 3, 4, 5, 4};
int i,j,pagefaults = 0,currentindex=0,pageexists=0;
printf("Page Reference String: ");
for(i=1;i<=PAGE_SIZE;i++)
{
printf("%d",pages[i]);... | ALGO | 0.99587 | 3.938926 |
161d46b1-e7ca-4b79-8790-eb6e83b51585 | ishandutta2007/codeforces | wucstdio/normal/1156/E.cpp | #include<cstdio>
#include<algorithm>
#include<cstring>
#define ll long long
using namespace std;
int n,a[200005],p[200005];
int maxx[26][200005],lg2[200005];
ll ans;
int ask(int l,int r)
{
int d=lg2[r-l+1];
return a[maxx[d][l]]>a[maxx[d][r-(1<<d)+1]]?maxx[d][l]:maxx[d][r-(1<<d)+1];
}
void solve(int l,int r)
{
if(r-l... | ALGO | 0.999956 | 3.529324 |
40ba1133-5a56-4b5c-92bc-3cdf7761559b | adityagaur0/DSA-Masterclass | 4.CB -Lectures codes/Lecture21Recursion/06StringToInt.cpp | #include <iostream>
using namespace std;
int f(string str,int n){
//base case
if(n==0){
return 0;
}
//recusrive case
string Substring = str.substr(0,n-1);
int intgerfromMyfriend= f(Substring,n-1);
return (intgerfromMyfriend)*10+(str[n-1]-'0');
}
int main(){
string str="1234";
... | ALGO | 0.999302 | 3.979563 |
692140f0-d275-469c-9935-584ba1507804 | rishabhtyagi2306/Competitive-Programming | Spoj/DP + Binary Search.cpp | //https://www.spoj.com/problems/ACTIV/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long
#define vii vector<int>
#define vll vector<ll>
#define mii map<int, int>
#define mll map<ll, ... | ALGO | 0.999919 | 3.740343 |
39c92848-cef9-46cd-a331-7e613914dab1 | Li-Li-Whu/Coarse2FineRoofPlane | include/igl/embree/unproject_in_mesh.cpp | template <typename Derivedobj>
IGL_INLINE int igl::embree::unproject_in_mesh(
const Eigen::Vector2f& pos,
const Eigen::Matrix4f& model,
const Eigen::Matrix4f& proj,
const Eigen::Vector4f& viewport,
const EmbreeIntersector & ei,
Eigen::PlainObjectBase<Derivedobj> & obj,
std::vector<igl::Hit > & hits)
{
u... | ALGO | 0.884831 | 6.235065 |
c6c92f33-f092-4a45-a38f-09fdf31351da | hjiang13/LLMs-in-IR | POJ-104/14/1057.cpp | #include <iostream>
using namespace std;
int n;
struct student
{
int num;
int chinese;
int math;
int total;
struct student *next;
}
;
struct student *creat(int n)
{
struct student *head;
struct student *p1,*p2;
int i;
if(n==0)
{
head=NULL;
return(head);
}
else
{
p1=(struct student*)malloc(LEN);
cin >> "%d %d %d",&p1->n... | ALGO | 0.999496 | 3.628407 |
bcf932e6-ff19-4f31-8d84-8a759217f203 | adityajamwal02/LeetcodeProblemSet1 | BackspaceStringCompare.cpp | /*
Given two strings s and t, return true if they are equal when both are typed into empty text editors. '#' means a backspace character.
Note that after backspacing an empty text, the text will continue empty.
Example 1:
Input: s = "ab#c", t = "ad#c"
Output: true
Explanation: Both s and t become "ac".
Example 2:
Inp... | ALGO | 0.999884 | 6.671177 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.