uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
7e5fa049-e6ef-47c1-a78b-568c4b31b360 | Mugdha-Hazra/CODING-BLOCKS-COMPETITIVE-CODING-COURSE | Unique number 3.cpp | #include<iostream>
using namespace std;
int main()
{
int cnt[64]={0},i;
int n,num;
cin>>n;
for(i=0;i<n;i++)
{
cin>>num;
int j=0;
while(num>0)
{
int lb=(num&1);
cnt[j]+=lb;
j++;
num=num>>1;
}
}
int p=1,ans=0;
for(i=0;i<64;i++)
{
cnt[i]%=3;
ans+=(cnt[i]*p);
p=p<<1;
}
cout<<ans<<"\n... | ALGO | 0.999993 | 3.893732 |
fb27cac9-00dd-49d1-a86a-cadd862cd1ee | rahul-goel/CompetitiveProgramming | CodeForces/EDU/Segment Tree/C - Assignment to Segment.cpp | /*
Created by Rahul Goel.
*/
#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;
template < typename T >
using ordered_set = tree<T, n... | ALGO | 0.999815 | 5.459184 |
00ec7a7d-aa2c-4217-9492-56ee89ff04c2 | manikanta2901/ubuntu | .history/random/trees/DragonDens_20200731124426.cpp | #include<bits/stdc++.h>
using namespace std;
const int N = 200005;
vector<int> Ltrav[N],Rtrav[N];
int par[2][N],st[2][N],ed[2][N];
int timer;
void dfsL(int v){
st[0][v] = timer;
timer++;
for(auto &c : Ltrav[v]){
dfsL(c);
}
ed[0][v] = timer - 1;
}
void dfsL(int v){
st[1][v] = timer;
... | ALGO | 0.999918 | 3.401314 |
c5e6f052-f725-411a-961d-d4ab085dacc5 | adityasrathore/DSA | Array/Kadane.cpp | #include <bits/stdc++.h>
using namespace std;
void Kadane(int *arr,int n){
int maxsum=0,sum=0;
for(int i=0;i<n;i++){
sum+=arr[i];
if(sum>maxsum)
maxsum=sum;
if(sum<0)
sum=0;
}
cout<<"Max Sum Subarray using Kadane: "<<maxsum<<endl;
}
int main(){
// int ... | ALGO | 0.999927 | 4.806736 |
bccfc37c-8a4c-424b-a355-89411e1b2fc4 | ivanovp/Marlin_robot_arm | Marlin/src/module/planner_bezier.cpp | /**
* planner_bezier.cpp
*
* Compute and buffer movement commands for bezier curves
*/
#include "../inc/MarlinConfig.h"
#if ENABLED(BEZIER_CURVE_SUPPORT)
#include "planner.h"
#include "motion.h"
#include "temperature.h"
#include "../MarlinCore.h"
#include "../gcode/queue.h"
// See the meaning in the documentat... | ALGO | 0.999659 | 7.909719 |
1fd21e70-257a-48a6-8d31-bca144b60401 | upadrastaharshavardhan/programing_quections-_c- | 1407 A. Ahahahahahahahaha.cpp | //Bismillahir Rahmanir Rahim
#include<bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define pb push_back
#define fastread() (ios_base:: sync_with_stdio(false),cin.tie(NULL));
using namespace std;
int main()
{
fastread();
int t,n,a;
cin>>t;
... | ALGO | 0.999979 | 3.262762 |
31c8afd2-526a-42ba-b814-014b51d1caab | julian1/shell | src/controller/grid_editor.cpp |
#include <controller/grid_editor.h> // Grid
#include <iostream>
#include <cmath> // pow, sqrt
#include <cstdlib> // NULL
#include <cassert>
#include <vector>
#include <set>
//#include <boost/unordered_map.hpp>
#include <boost/foreach.hpp>
#define foreach BOOST_FOREACH
namespace {
static double pow2(double x)
{
r... | ALGO | 0.996516 | 5.252082 |
971edc7a-420d-457e-881f-ed14bdd3117b | saswatds/ExploreAI | BDSearch.cpp | //
// Created by Saswat Das on 10/10/17.
//
#include <iostream>
#include <list>
#include <stack>
#include <queue>
using namespace std;
struct Node {
pair<int, int> state;
int rule; // This will store the rule to be applied
};
pair<int, int> target;
list<pair<int, int>> visited;
bool Visited(Node node) {
... | ALGO | 0.999778 | 5.020715 |
afe91fb7-71b3-4ca6-9b28-b73cd47bec52 | Aady7/C--- | tut38.cpp | #include <iostream>
#include <cstring>
using namespace std;
int main()
{
const char message1[]{"The sky is blue and bright"};
const char *message2{"The sky is blye and bright"}; // here the array decays into the pointer
cout << "strlen ignoring null spaces" << strlen(message1) << endl;
cout << "length ... | TOOL | 0.971513 | 4.029293 |
e428b8bb-1994-4794-bec0-cea6db82c2c5 | yexiaosu/VE281 | P4/main.cpp | //
// Created by wanglan on 2021/7/19.
//
#include <forward_list>
#include <vector>
#include <tuple>
#include <algorithm>
#include <queue>
#include <set>
#include <iostream>
using namespace std;
typedef vector<pair<size_t, size_t>> neighbor; // {index,weight}
typedef tuple<size_t, size_t, size_t> edge;
class Node ... | ALGO | 0.999802 | 4.54731 |
1d3c89e0-a5f8-40bc-9840-e6e742ee6cfd | ROCm-Developer-Tools/llvm-project | llvm/lib/Support/StringExtras.cpp | #include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/Support/raw_ostream.h"
#include <cctype>
using namespace llvm;
/// StrInStrNoCase - Portable version of strcasestr. Locates the first
/// occurrence of string 's1' in string 's2', ignoring case. Returns
/// the offset of s2 in s1 or... | TOOL | 0.94007 | 6.914877 |
8125eaa2-a275-43e6-93e9-ebd51e3a786e | alice2024B/code | sobrecarga/main.cpp | //problema 1: sobre carga de operadores, clase Empleado.
#include <iostream>
#include <string>
#include <map>
using namespace std;
//Definicin de la clase Empleado
class Empleado {
private:
int clave;
string nombre;
string domicilio;
float sueldo;
string jefeDirecto;
public:
// Constructor
... | TOOL | 0.884789 | 5.4904 |
1be12a12-a7c7-4b9f-bbbb-bc89b83d2fcf | lollipopnougat/-C- | 冒泡法.cpp.cpp | #include<iostream>
using namespace std;
int main()
{
int str[15];
int n,i,j;
int temp;
cin>>n;
for(i=0;i<n-1;i++)
cin>>str[i];
for(int i;i<n-1;i++)
{
for(j=0;j<n-j-1;j++)
if(str[j]>str[j+1]) {temp=str[j];str[j]=str[j+1];str[j+1]=temp;}
}
for(i=0;i<n;i++)
cout... | ALGO | 0.999988 | 3.393839 |
7722435f-4d3d-4c5b-8162-63184dda9d0d | YurongYou/rlTORCS | torcs-1.3.6/src/drivers/berniw2/spline.cpp | #include <math.h>
#include <stdlib.h>
#include "spline.h"
#ifdef DMALLOC
#include "dmalloc.h"
#endif
/* solving tridiagonal nxn matrix with Givens-Rotations in linear time O(n)
[ a1 b1 0 0 0 .......... ]
[ c1 a2 b2 0 0 ...........]
[ 0 c2 a3 b3 0 ...........]
[ ...........................]
[ ............. | ALGO | 0.999951 | 5.987635 |
771c53bc-924d-4553-a5c0-b6ff834b80e3 | CedricKuang/LeetCode | easy/1566.detect-pattern-of-length-m-repeated-k-or-more-times.cpp | /*
* @lc app=leetcode id=1566 lang=cpp
*
* [1566] Detect Pattern of Length M Repeated K or More Times
*/
// @lc code=start
class Solution {
public:
bool containsPattern(vector<int>& arr, int m, int k) {
int cnt=0;
for(int i=0;i+m < arr.size(); i++){
if(arr[i]!=arr[i+m])... | ALGO | 0.999613 | 6.187153 |
45298d5e-117f-4f3b-b88b-59c54dc697c1 | ishandutta2007/codeforces | kmjp/normal/1393/A.cpp | #include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;
#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZER... | ALGO | 0.999687 | 4.413014 |
dfbffb49-75b7-4f53-9a8d-9c0c47da60e0 | mwales/education_remove_me | AdventOfCode/2017/day5/p2.cpp | #include <iostream>
#include <vector>
#include <fstream>
#include <string>
#include <stdlib.h>
/*
Now, the jumps are even stranger: after each jump, if the offset was three or more, instead decrease it by 1. Otherwise, increase it by 1 as before.
Using this rule with the above example, the process now takes 10 steps,... | ALGO | 0.995463 | 3.935741 |
5040641c-76b0-4ac6-9d5f-cde2fec755b7 | Divyanshudhyani/leetcode- | 0042-trapping-rain-water/0042-trapping-rain-water.cpp | class Solution {
public:
int trap(vector<int>& height) {
int n = height.size();
if (n == 0) return 0;
int i = 0;
int j = n - 1;
int leftMax = 0;
int rightMax = 0;
int water_collection = 0;
while (i <= j) ... | ALGO | 0.999987 | 7.093334 |
69d8cab7-352b-4138-b7f1-d4bcec995457 | Jine99/.Algorithms | BaaarkingDog/0x1C/solutions/11404.cpp | // Authored by : BaaaaaaaaaaarkingDog
// Co-authored by : -
// http://boj.kr/610baea46f8d403fa58b632b29389ae1
#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
int d[105][105];
int n, m;
int main(void){
ios::sync_with_stdio(0);
cin.tie(0);
cin >> n >> m;
for(int i = 1; i <= n; i++)
... | ALGO | 0.999996 | 4.227165 |
67c44df3-7ad5-45aa-b13f-70ca00082d38 | jtj8412/problem-solving | Programmers/Level3/77486.cpp | //----------------------------------------------------------------------------------
// [ 다단계 칫솔 판매 ] https://programmers.co.kr/learn/courses/30/lessons/77486
//----------------------------------------------------------------------------------
#include <unordered_map>
#include <string>
#include <vector>
using namespac... | ALGO | 0.998922 | 4.704311 |
7ad468e5-a187-42a2-af40-39dcb4fa1f6c | roberteg16/Quark | libc/src/math/generic/ldexp.cpp | #include "src/math/ldexp.h"
#include "src/__support/common.h"
#include "utils/FPUtil/ManipulationFunctions.h"
namespace __llvm_libc {
LLVM_LIBC_FUNCTION(double, ldexp, (double x, int exp)) {
return fputil::ldexp(x, exp);
}
} // namespace __llvm_libc
| ALGO | 0.897895 | 5.422481 |
18be337a-5d96-4912-810c-3cf23616f1a4 | lumisbah92/programming-book | Algorithms/Order Statistic Set (PDBS).cpp | /**==============================================================*
* "Bismillahir Rahmanir Raheem" *
* Author : Misbah Uddin Tareq. *
* Semester : 5(C),CSE *
* University : Leading University,Sylhe... | ALGO | 0.999183 | 4.239889 |
9587bd1c-df70-469b-b803-3a402a8a3134 | AlexSlayer69/LeetCode-Solutions- | 0121-best-time-to-buy-and-sell-stock/0121-best-time-to-buy-and-sell-stock.cpp | class Solution {
public:
int maxProfit(vector<int>& prices) {
int n = prices.size();
int profit = 0;
int low = prices[0];
for(int i = 0;i < n;i++){
if(low > prices[i])
low = prices[i];
else
profit = max(profit,pr... | ALGO | 0.999643 | 6.084818 |
c800fbc2-c732-4344-96f1-1f0b71073cf8 | hitarth-gg/CP | CodeForces/archive/1823C - Strongly Composite.cpp | // clang-format off
#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace chrono;
using namespace __gnu_pbds;
/* ----------------------- int128 ----------------------- */
// typedef __int128 lll;
// istream &operator>>(istream &cin,... | ALGO | 0.999907 | 5.10437 |
4b9456c3-d6cd-4922-9878-5a9d80fe8c15 | Uzer447/Code | Codeforces/Commentary Boxes.cpp | #include <bits/stdc++.h>
#define forn(n) for (int i = 0; i < n; i++)
#define ll long long
using namespace std;
int main()
{
ll n, m, a, b;
cin >> n >> m >> a >> b;
ll build = (m - (n % m)) * a;
ll demolish = (n % m) * b;
cout << min(build, demolish) << endl;
return 0;
} | ALGO | 0.999663 | 3.313627 |
4ac28bf4-6997-4618-af32-7bd3c3b65fa4 | olirrrt/Games202-In-Unity | 202/Assignment2/prt/ext/tbb/examples/parallel_for/tachyon/src/parse.cpp | /*
* parse.cpp - an UltraLame (tm) parser for simple data files...
*/
// Try preventing lots of GCC warnings about ignored results of fscanf etc.
#if !__INTEL_COMPILER
#if __GNUC__<4 || __GNUC__==4 && __GNUC_MINOR__<5
// For older versions of GCC, disable use of __wur in GLIBC
#undef _FORTIFY_SOURCE
#define _FORTIF... | TOOL | 0.854651 | 4.485831 |
1379beda-6907-4c87-ab3a-75732a0f686d | abahad7921/dsa-practice | problems/first_non_repeating_char.cpp | #include <bits/stdc++.h>
using namespace std;
void firstNonRepeatingCharacter(string s)
{
if(s.length() == 0)
{
cout<<-1<<endl;
return;
}
unordered_map<char,int>um;
queue<char>q;
for(int i=0;i<s.length();i++)
{
um[s[i]]++;
if(q.size() == 0)
{
if(i == 0)
cout<<s[i]<<" ";
else
cout<<-1... | ALGO | 0.999892 | 4.238506 |
af7b0747-7286-4da7-8d13-0394d52cf684 | aminjonshermatov/competitive_programming | atcoder/dp_contest/Q.cpp | #include <bits/stdc++.h>
#ifdef LOCAL
#include "debug.h"
#else
#define dbg(...) 42
#endif
template <typename Node> struct BottomUpSegmentTree {
int n = 0;
std::vector<Node> nodes;
explicit BottomUpSegmentTree(int n_) { init(std::vector(n_, Node())); }
explicit BottomUpSegmentTree(int n_, Node node) { init(st... | ALGO | 0.99996 | 4.183002 |
f1c88650-0a00-476a-8dcc-a2d742585467 | aaromp/project-euler | euler_016.cpp | /*
* File: euler_18.cpp
* --------------------------
* Finds the sum of the digits of the number 2^LIMIT
*/
#include <iostream>
#include <string>
#include "console.h"
#include "vector.h"
using namespace std;
const int LIMIT = 1000;
void recSquareVector(Vector<int> &number, int index, int remainder) {
// rec... | ALGO | 0.999574 | 6.090013 |
feb0f201-cbf0-4795-9803-3b560873b143 | BadagalaAdarsh/LeetCode | 682-baseball-game/682-baseball-game.cpp | class Solution {
public:
int calPoints(vector<string>& ops) {
stack<int> st;
for(auto op: ops){
if(op != "C" && op != "D" && op != "+") {
st.push(stoi(op));
}
else if(op == "C"){
st.pop();
... | ALGO | 0.999897 | 6.189447 |
d38f6b9d-c520-4bd6-abd6-4686596ed078 | Gaurav-Tewatia/Leetcode | Implementing Dijkstra Algorithm - GFG/implementing-dijkstra-algorithm.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
public:
//Function to find the shortest distance of all the vertices
//from the source vertex S.
vector <int> dijkstra(int V, vector<vector<int>> adj[], int S)
{ //using priority queue
//as usin... | ALGO | 0.999967 | 5.119113 |
96b77ad3-8645-4810-bdcb-ecf5a903f2e1 | Joshua-ych/BamThriving-VISION | Prediction/pnpsolve.cpp | #include "pnpsolve.h"
void pnpsolve::setRobot_ArmorSize_3D(){
switch (type)
{
case SMALL:
SMALL_POINTS_3D.clear();
//以中心为原点,顺时针输入
SMALL_POINTS_3D.push_back(Point3f(-65, 37,0.0));
SMALL_POINTS_3D.push_back(Point3f(... | ALGO | 0.998225 | 3.552354 |
6b11c63b-cf2a-41f1-a74e-2804c775b40f | bullbots/Team1891Framework | Stronghold1891/libs/opencv/sources/apps/createsamples/utility.cpp | #include <cstring>
#include <ctime>
#include <sys/stat.h>
#include <sys/types.h>
#ifdef _WIN32
#include <direct.h>
#endif /* _WIN32 */
#include "utility.hpp"
#include "opencv2/core.hpp"
#include "opencv2/core/core_c.h"
#include "opencv2/imgcodecs/imgcodecs_c.h"
#include "opencv2/imgproc/imgproc_c.h"
#include "opencv2... | TOOL | 0.996677 | 4.720349 |
9503ed80-ab7a-477b-8bf6-eb587b35ebf2 | Noverish/Language-C | withcs.net/withcs 4293 변수를 활용한 역 폴란드 계산/withcs 4293 변수를 활용한 역 폴란드 계산/소스.cpp | #include <stdio.h>
#include <string.h>
#include <ctype.h>
double stack[200];
int end=0;
double atof(char*);
int change[256];
void push(double number) {
stack[end++] = number;
}
double pop(void) {
return stack[--end];
}
int processing(char sen[]) {
if(sen[1] == 0) {
switch (sen[0])
{
case '+' : {
push(p... | ALGO | 0.998306 | 3.345145 |
26887c2c-2bfd-47ef-9574-d09f2b4bf9af | zbomb/Hyperion-Engine | Hyperion Engine/Boost/libs/yap/example/autodiff_library/autodiff.cpp | #include <iostream>
#include <sstream>
#include <numeric>
#include <boost/foreach.hpp>
#include "autodiff.h"
#include "Stack.h"
#include "Tape.h"
#include "BinaryOPNode.h"
#include "UaryOPNode.h"
using namespace std;
namespace AutoDiff
{
#if FORWARD_ENABLED
unsigned int num_var = 0;
void hess_forward(Node* root, u... | ALGO | 0.999466 | 4.843259 |
cf88f31b-706e-45b2-bd5d-7a73bde3a2b6 | vntshh/Generalized-Tower-of-Hanoi | computer.cpp | #include <bits/stdc++.h>
#include <GL/glut.h>
#include <stdlib.h>
#include <math.h>
#include <stdio.h>
#include <unistd.h>
#include "calc_moves.cpp"
using namespace std;
#define RADDEG 57.29577951f
#define PI 3.14159265358979323
float XUP[3] = {1,0,0}, XUN[3] = {-1, 0, 0},
YUP[3] = {0,1,0}, YUN[3] = { 0,-1,... | ALGO | 0.967811 | 3.781025 |
7e6265b9-58ae-4875-84ad-c026bdd8c1e1 | Dudarev-V/Repos_education_0 | Stud/Stud.cpp | #include<iostream>
using namespace std;
int main()
{
setlocale(0, "");
int n, sum = 0, nnz = 0; //nnz - number of non-zero, sum - сумма вершин, n - количество вершин
bool f = 1;
cout << "Введите количество вершин:" << endl;
cout << endl;
cin >> n;
cout << endl;
int* arr = new int[n];
cout << "Введите степ... | ALGO | 0.999749 | 3.986433 |
bd103242-e3b1-43bd-b407-006f4eef7231 | Arif-462/data_stucture_cpp | online problem/palindromic password.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int t;
//cin>>t;
string a;
cin>>a;
int count=1;
for(int i=0, j=6; j>0, i<6; j--, i++)
{
if(a[i]!=a[j])
{
count=0;
break;
}
}
for(int i=0, j=0; j<6, i<6; j++, i++)
{
... | ALGO | 0.999974 | 3.518882 |
31903a9f-ef6b-44e9-aa14-4a03f7f5489b | InwooLeeme/Algorithm | Boj/7453.cpp | //////////////////////////////////////////////////////////////////////////////
/*
_____ ______ _
/ ___| | ___ \ (_)
\ `--. _ __ __ _ ___ ___ | |_/ / ___ _ __ __ _ _ _ _ _ __
... | ALGO | 0.999382 | 4.859204 |
2462f106-821a-495c-9408-7d053e369ba8 | waji785/LeetCode.daily | 617.Merge Two Binary Tree.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
TreeNode* mergeTrees(TreeNode* t1, TreeNode* t2) {
if(t1==NULL)
return t2;
... | ALGO | 0.999996 | 5.617613 |
03f3309a-5070-486d-a0d7-020eea49b3e6 | uknowsec/cpp_code | c++作业/2016-09-12/例1.15.cpp | #include<iostream>
#include<string>
using namespace std;
int main()
{
string string1,string2,string3,temp;
cout<<"please input three strings:";
cin>>string1>>string2>>string3;
if(string2>string3)
{temp=string2;string2=string3;string3=temp;}
if(string1<=string2)
cout<<string1<<" "<<string2<<" "<<string3<<endl;
... | ALGO | 0.999218 | 3.540056 |
bac2c010-bc1a-440a-a17e-3645c56e0c1f | EV2027/ENME202-lectures | 2b_while_loops.cpp | // ENME 202
// 2b_while_loops.cpp
// while() loops
#include <iostream>
#include <cmath>
using namespace std;
int main(void) {
int i = 0;
// A simple while loop to print an incrementing value 11 times
while (i <= 10) {
cout << "i = " << i << endl;
i = i+1;
}
// Note that C++ while loops are identical... | ALGO | 0.999698 | 3.857868 |
978a2f30-1ade-4186-bc2d-3be9a28c09e9 | Lucashien/Leetcode | Array & String/217. Contains Duplicate/217.cpp | class Solution {
public:
bool containsDuplicate(vector<int>& nums) {
unordered_set <int> seen;
for(int i : nums){
if(seen.count(i)){
return true;
}
else
seen.insert(i);
}
return false;
}
};
| ALGO | 0.999306 | 5.839497 |
f6a5d93f-1cc4-468a-ac5c-63ba5153cea1 | anvirt/Emu-QEMU | android/android-emugl/host/libs/libOpenglRender/vulkan/VkReconstruction.cpp | #include "android/base/containers/EntityManager.h"
#include "VkDecoder.h"
#include "IOStream.h"
#include <unordered_map>
#define DEBUG_RECONSTRUCTION 0
#if DEBUG_RECONSTRUCTION
#define DEBUG_RECON(fmt,...) fprintf(stderr, "%s:%d " fmt "\n", __func__, __LINE__, ##__VA_ARGS__);
#else
#define DEBUG_RECON(fmt,...)
... | TOOL | 0.87868 | 3.661452 |
e3635b68-2b8a-4bf9-8a4a-06c1cce53109 | jayster7101/LL_insertion | src/utils.cpp | #include "../include/utils.h"
#include "../include/sorters.h"
// #include <ctime>
// #include <cstdlib>
#include <chrono>
#include <iostream>
/**
* @brief Fills array and linked list with random numbers
*
* @param size size of array & linked list
* @param arr array to be filled
* @param list linked list to be fill... | TOOL | 0.9973 | 4.534003 |
cab39b9c-162b-4a43-b0a1-a98db1f5dd76 | HongSheng416/DVC | compressai/sadl_codec/range_coder.cpp | #include "range_coder.h"
#include <algorithm>
#include <bitset>
#include <cmath>
#include <iostream>
#include <numeric>
#include <string>
using namespace std;
void RangeCoder::encode(int value, const Cdf &cdf, std::ostream &out) {
value -= cdf.min_val;
if (value < 0 || value > (int)cdf.cproba.size() - 1) {
c... | ALGO | 0.999423 | 5.900128 |
47f2a99e-cb41-4a0e-b7cf-9e6fadc0041a | Sakii470/Activity_recognition_esp32 | Motion_recognition2_inferencing/src/edge-impulse-sdk/tensorflow/lite/micro/kernels/batch_matmul.cpp | #include "edge-impulse-sdk/tensorflow/lite/kernels/internal/reference/batch_matmul.h"
#include <algorithm>
#include <cstdint>
#include <limits>
#include "edge-impulse-sdk/tensorflow/lite/c/common.h"
#include "edge-impulse-sdk/tensorflow/lite/kernels/internal/quantization_util.h"
#include "edge-impulse-sdk/tensorflow/... | ALGO | 0.958668 | 5.339144 |
3daa196f-06df-4e54-961e-071126b44e60 | sahilrik/CrackYourInternship | arrays/Day_2/remove_duplicates_from_the_sorted_array.cpp |
// 1st approach - hash set - naive
class Solution
{
public:
int removeDuplicates(vector<int> &nums)
{
set<int> st;
int i = 0;
for (auto num : nums)
{
st.insert(num);
}
for (auto ele : st)
{
nums[i++] = ele;
}
retur... | ALGO | 0.999854 | 6.305357 |
2af7b158-7427-4206-a49c-0459fd65ec09 | shuding/algorithm-contests | Exam/HNOI2012/triangle.cpp | #include <algorithm>
#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include <set>
#define MAXN 10500
#define rep(i, n) for(int i = 1; i <= n; ++i)
using namespace std;
set<pair<int, int> > s;
struct tri{
int x, y;
long long d;
tri(){}
tri(int _x, int _y, long long _d):
x(_x), y(_y), ... | ALGO | 0.9995 | 3.585744 |
d5733e41-dc6f-4f9a-a75f-a2142d7c89d3 | Mohamed07/My_Loc_Repo | Algorithms/Maximum_amount_of_gold/knapsack.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using std::vector;
using std::max;
using std::sort;
// We need this function to define how to sort
// // the vector. We will pass this function into the
// // third parameter and it will tell it to sort descendingly.
bool wayToSort(int i, int j) { return i >... | ALGO | 0.99997 | 4.885072 |
fa408a63-ecfe-4d97-8415-a28291f2cf65 | loujilin/cppexe | AlgorightmAnalysis/D_Recursion/next_permutation_vector.cpp | //
// Created by 15167 on 2025/2/11.
//
#include<iostream>
#include<vector> //使用vector需要导入的头文件
#include<algorithm>//使用 next_permutation()和sort()需要导入的头文件
using namespace std;
int main(){
vector<int> v;//定义一个int型的vector
v.push_back(1);//在尾部插入数据1
v.push_back(2);
v.push_back(3);
v.push_back(4);
do... | ALGO | 0.999417 | 3.87596 |
6e450714-0fbe-4c5b-8bd4-840d2c2ebc36 | IslamAmr155/Problem-Solving | LeetCode/Easy/2864. Maximum Odd Binary Number.cpp | class Solution {
public:
string maximumOddBinaryNumber(string s) {
int z = 0, x = 0;
for (char c : s)
if (c == '1') x++;
else z++;
string ans = "";
for (int i = 0;i<x-1;i++) ans += '1';
for (int i = 0;i<z;i++) ans += '0';
return ans + '1';
... | ALGO | 0.999988 | 5.755921 |
652bf494-9a84-4fc4-9b2d-f0adf11eec03 | 22S-LGN-PS/programming-challenges | nick11967/Ch 2/9 Jolly Jumper/jolly_jumper.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
bool diff_check[3001];
int n, pre, cur;
int diff;
bool jolly;
while (cin >> n)
{
jolly = true;
for (int i = 0; i <= n; i++)
diff_check[i] = false;
cin >> pre;
for (int i = 2; i <= n; i++)
... | ALGO | 0.99978 | 3.771256 |
efad986e-e7a1-4bbe-9bc3-374b9edfd149 | bc970321/learn | python/3.pyp/2.jisuanke_cainiao/data/792/顺序表和链表的复习/单向循环链表变双向.cpp | #include <stdio.h>
#include <stdlib.h>
typedef struct LinkedNode{
int data;
struct LinkedNode *prior,*next;
}LinkedNode;
typedef struct LinkedList{
int length;
LinkedNode head;
}LinkedList;
LinkedList* init(){
LinkedList *p = (LinkedList *)malloc(sizeof(LinkedList));
p->length = 0;
p->head... | ALGO | 0.999983 | 3.691698 |
4bd3c98a-2f52-421e-901d-3a699d3a3359 | yogurt-shadow/z3 | src/api/api_polynomial.cpp | #include "api/z3.h"
#include "api/api_log_macros.h"
#include "api/api_context.h"
#include "api/api_polynomial.h"
#include "api/api_ast_vector.h"
#include "ast/expr2polynomial.h"
#include "util/cancel_eh.h"
#include "util/scoped_timer.h"
#include "ast/expr2var.h"
extern "C" {
Z3_ast_vector Z3_API Z3_polynomial_sub... | ALGO | 0.987661 | 6.104103 |
16bcbbcd-cbcc-47df-9a9d-9509251346a6 | bansalmukul-cse/LeetCode-Codes | 938. Range Sum of BST.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.999992 | 6.657067 |
4a91e0d2-1fdd-4c01-8bdf-91dae7f86854 | ishandutta2007/codeforces | leaf1415/normal/1516/E.cpp | #include <iostream>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <cstdlib>
#include <cassert>
#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <string>
#include <algorithm>
#include <utility>
#include <complex>
... | ALGO | 0.999967 | 3.170889 |
c866005e-19cc-4971-8098-1c62a37c84b9 | ishandutta2007/codeforces | zoli9/normal/830/B.cpp | #include <bits/stdc++.h>
using namespace std;
int n;
vector<int> szamok[100009];
int maximum=0;
long long m[1000009];
void modosit(int cs, int k, int v, int h, int val)
{
if(h<k || v<h) return;
if(k==v && k==h)
{
m[cs]+=val;
return;
}
m[cs]+=val;
modosit(2*cs, k, (k+v)/2, h, val... | ALGO | 0.999963 | 3.621711 |
98b5f260-ea34-49fa-918c-95d5388309a2 | AntennaeVY/CP | CodeForces/800/Park Lighting.cpp | #include<bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
while(t--) {
int n, m;
cin >> n >> m;
cout << (n*m-1)/2+1 << endl;
}
} | ALGO | 0.999689 | 4.743792 |
3bc4a9af-66bc-42cf-ae85-1b2e10d88b76 | shaun229/lightweight-reinspect | utils/stitch_rects.cpp | #include <vector>
#include <math.h>
#include <assert.h>
#include <stdlib.h>
#include <algorithm>
#include <iostream>
#include "./hungarian/hungarian.hpp"
#include "./stitch_rects.hpp"
using std::vector;
void filter_rects(const vector<vector<vector<Rect> > >& all_rects,
vector<Rect>* stitched_rects,... | ALGO | 0.995223 | 5.996391 |
5c8381e3-8d2e-4200-92ae-cb8ef7c0b9ac | qinjian623/plib | opencv/opencv.cpp | #include "stdio.h"
#include <opencv2/opencv.hpp>
#include <opencv2/features2d/features2d.hpp>
#include <utility>
#include <cmath>
using namespace cv;
using namespace std;
SimpleBlobDetector::Params params;
Ptr<FeatureDetector> blob_detector;
int canny_thread;
int pair_thread = 5;
class SymmetryDetector
{
public:
S... | ALGO | 0.998532 | 4.594819 |
7624e91d-12eb-4b30-8c42-8dcf42c7d895 | manikanta2901/ubuntu | .history/codingChallenges/cpp/Codechef/longChallenges/September/LinearEquations_20200912221037.cpp | #include<bits/stdc++.h>
using namespace std;
#define testcase() int t; cin >> t; while(t--)
int main(){
testcase(){
int size;
cin >> size;
vector<int> velocity,infected;
velocity.push_back(0);
for(int i = 1; i <= size; i++){
int a;
cin >> a;
... | ALGO | 0.999841 | 3.388841 |
793aa7ae-9d8c-451d-8d16-c80543073c62 | ayush8303/International-Institute-of-Information-Technology-Pune | 07 - Binary Search/Game of Greed.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long int
bool divideAmongK(int arr[], int n, int k, int min_partition)
{
int partitions = 0;
int current_sum = 0;
for (int i = 0; i < n; i++)
{
if (current_sum + arr[i] >= min_partition)
{
partitions++;
current_sum = 0;
}
... | ALGO | 0.999948 | 5.023794 |
22bca6c2-2188-4460-b8a7-6bc87fcfea28 | SLI0124/pokrocile-databazove-systemy | cpp/cSpRTreeNode.cpp | #include "cSpRTreeNode.h"
int cmp(const void* i1, const void* i2)
{
int ret = 0;
double d1 = ((cItem*)i1)->Dist;
double d2 = ((cItem*)i2)->Dist;
if (d1 < d2) {
ret = -1;
}
else if (d1 > d2) {
ret = 1;
}
return ret;
}
cSpRTreeNode::cSpRTreeNode()
{
mData = nullptr;
}
cSpRTreeNode::cSpRTreeNode(int d, bo... | ALGO | 0.999311 | 4.690765 |
492012bb-b390-4c9b-ab18-adca21e00c90 | sokolovea/cpp-sym-2023-2025 | 1_sem/12_exceptions_set_map/3_set/main.cpp | #include <iostream>
#include <set>
#include <algorithm>
using namespace std;
int main() {
set<int> numbers = {5, 3, 8, 1, 4};
numbers.insert(10); //
numbers.insert(2);
numbers.insert(2);
numbers.insert(2);
numbers.insert(2);
numbers.insert(2);
numbers.erase(3); //
if (numbers.... | TOOL | 0.951956 | 4.776029 |
45615e79-6be7-4bb6-8536-99390481333e | NOMOICO/NOMOICOCOIN | src/zerocoin/Params.cpp | /**
* @file Params.cpp
*
* @brief Parameter class for Zerocoin.
*
* @author Ian Miers, Christina Garman and Matthew Green
* @date June 2013
*
* @copyright Copyright 2013 Ian Miers, Christina Garman and Matthew Green
* @license This project is released under the MIT license.
**/
#include "Zeroco... | TOOL | 0.877626 | 6.609758 |
6595f7d9-8a32-42de-b6df-54f0293f535a | BonexGoo/Boss2D | Boss2D/addon/openalpr-2.3.0_for_boss/src/openalpr/edges/edgefinder.cpp | #include "edgefinder.h"
#include "textlinecollection.h"
#include BOSS_OPENALPR_U_support__timing_h //original-code:"support/timing.h"
using namespace std;
using namespace cv;
namespace alpr
{
EdgeFinder::EdgeFinder(PipelineData* pipeline_data) {
this->pipeline_data = pipeline_data;
// First re-crop the a... | ALGO | 0.996107 | 5.267162 |
cd15d2dc-b3f2-4e50-8192-aa4edf8e67b2 | PearMeow/leetcode | medium/386-lexicographical-numbers.cpp | /**
* @file 386-lexicographical-numbers.cpp
* @author Perry Huang
* @date 2025-06-07
* 386. Lexicographical Numbers
* Given an integer n, return all the numbers in the range [1, n] sorted in lexicographical order.
* You must write an algorithm that runs in O(n) time and uses O(1) extra space.
*/
#include <vecto... | ALGO | 0.99937 | 6.867766 |
98c7cd38-5539-45e8-b77b-4af908e8d84f | TKJ-Kasih-Ananda/X-TKJ-2023-2024 | Chriswell-Pangaribuan/chriswell_for3(1).cpp | #include <iostream>//perintah yang digunakan untuk memasukkan header file iostream ke dalam program yang sedang dikembangkan.
using namespace std;//untuk mendeklarasikan/ memberitahukan kepada compiler bahwa kita akan menggunakan semua fungsi/class/file yang terdapat dalam namespace std.
int main() {//jenis tipe data ... | ALGO | 0.989998 | 3.271923 |
457fef6c-7923-49b9-ab85-37ea73faa441 | algoamigoo/Leetcode | 2553-total-cost-to-hire-k-workers/total-cost-to-hire-k-workers.cpp | class Solution {
public:
long long totalCost(vector<int>& costs, int k, int candidates) {
int n = costs.size();
if (n <= 2 * candidates) {
vector<int> sorted = costs;
sort(sorted.begin(), sorted.end());
long long sum = 0;
for (int i = 0; i < k... | ALGO | 0.999945 | 6.054019 |
0330da23-7bb8-46d3-96b2-b5ff5afac0cc | kunal2812/CP | codeforces/1722/F.cpp | #pragma GCC target ("avx2")
#pragma GCC optimize ("O3")
#pragma GCC optimize ("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ll long long
#define pb push_back
#define pf push_front
#define... | ALGO | 0.999724 | 3.925916 |
f8375516-335f-4fd4-b24c-e84fa1637970 | Aman18111625/LeetCode-Solutions | Smallest Subset with Greater Sum - GFG/smallest-subset-with-greater-sum.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 minSubset(vector<int> &Arr,int N){
sort(Arr.begin(),Arr.end());
long long sum=0;
for(auto a: Arr){
... | ALGO | 0.999222 | 6.187503 |
bc2e2a33-c475-401c-aa8a-15b16a7518c5 | dmkz/competitive-programming | codeforces.com/Codeforces Ladder 1800-1899/0235A.cpp | /*
Problem: 235A. LCM Challenge
Solution: lcm, number theory, math, brute force
*/
#include <bits/stdc++.h>
typedef long long ll;
ll naive(int a, int b) {
ll max = 1;
for (ll i = a; i <= b; i++) {
for (ll j = a; j <= b; j++) {
const ll lcm = std::lcm(i,j);
for (ll k = a; ... | ALGO | 0.999546 | 4.935348 |
ec15f2ec-5c62-4771-8935-22eff8841f5d | raincross7/code-similarity | codes/train_code/problem368/problem368_241.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
long long A,B,K;
cin >> A >> B >> K;
if(A+B <= K){
cout << "0 0" << endl;
return 0;
}
else if(K<A){
cout << A-K << " " << B << endl;
return 0;
}
else{
cout << 0 << " " << B-(K-A) << endl;
return 0;
}
} | ALGO | 0.999983 | 4.177774 |
7b967842-6bae-4f09-8308-761e9ad104e3 | vkupendar/flutter-projects | provider_tutorials/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.998737 | 6.76073 |
59c1b78a-1af2-43f3-aac0-6c4519d48ae5 | pmSaurabhp/programs | Coursera/Algorithmic ToolBox/fibonacci.cpp | #include <iostream>
#include <cassert>
// The following code calls a naive algorithm for computing a Fibonacci number.
//
// What to do:
// 1. Compile the following code and run it on an input "40" to check that it is slow.
// You may also want to submit it to the grader to ensure that it gets the "time limit excee... | ALGO | 0.999949 | 6.588545 |
70a65da4-de18-4c69-900b-f679678f680d | aryarajnishu/DSA-practice | 13_heap_DSA/heapsortheapfyalgo.cpp | #include<bits/stdc++.h>
using namespace std;
void heapify(int arr[] , int n , int i){
int node = i;
int left = 2*i;
int right = 2*i+1;
if(left <= n && arr[node]<arr[left]){
node = left;
}
if(right <= n && arr[node]<arr[right]){
node = right;
}
if(node != i){
swa... | ALGO | 0.999962 | 4.177383 |
53984533-3fc0-4ba4-a9c5-248c120f8366 | JorgeIba/Competitive-Programming-Problems | CodeForces/Grupo - Cuarentena de Entrenamiento/Cuarententa 2/F.cpp | #include<bits/stdc++.h>
#define lli long long int
using namespace std;
vector< pair<lli,lli> > points;
const lli MOD = 998244353;
vector<lli> fact(100010);
vector<lli> inverso(100010);
lli modulo(lli num)
{
if(num >= 0)
{
return num%MOD;
}
else
{
return num % MOD + MOD;
... | ALGO | 0.999908 | 4.424008 |
1dae3499-b77d-4cc0-b5cb-76c6421dcd35 | Tejas-00/LeetHub-leetcode-track | 0735-asteroid-collision/0735-asteroid-collision.cpp | class Solution {
public:
vector<int> asteroidCollision(vector<int>& asteroids) {
stack<int> stack;
for (int i = 0; i < asteroids.size(); i++) {
bool placeInStack = true;
while (!stack.empty() && asteroids[i] < 0 && stack.top() > 0) {
if (abs(asteroids[i]) > st... | ALGO | 0.999986 | 6.057931 |
6a1ab148-e8da-46d1-b4a5-242895e9c491 | SHY-Corp/LeetCode-Solutions | C++/860. LemonadeChange.cpp | /*At a lemonade stand, each lemonade costs $5.
Customers are standing in a queue to buy from you, and order one at a time (in the order specified by bills).
Each customer will only buy one lemonade and pay with either a $5, $10, or $20 bill. You must provide the correct change to each customer, so that the net tran... | ALGO | 0.999441 | 5.879226 |
1e6949c6-6bba-4269-ba0e-b09412be9975 | ishandutta2007/codeforces | tmwilliamlin168/normal/1041/F.cpp | #include <bits/stdc++.h>
using namespace std;
const int mxN=1e5;
int n, m, y1, y2, a[mxN], b[mxN], ans=2;
unordered_map<int, int> mp;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cin >> n >> y1;
for(int i=0; i<n; ++i)
cin >> a[i];
cin >> m >> y2;
for(int i=0; i<m; ++i)
cin >> b[i];
for(int k=2;... | ALGO | 0.999845 | 3.544902 |
1763e94c-70f5-475d-b6e7-e05731685b3a | IslamSayedGalal/Codeforces | Codeforces/A - Word.cpp | #include <iostream>
#include <string>
using namespace std;
int main()
{
string st;
int up = 0, low = 0;
cin >> st;
for (int i = 0; i < st.length(); i++)
{
if (int(st[i]) >= 65 && int(st[i]) <= 90)
up++;
else
low++;
}
if (up > low)
{
for (in... | ALGO | 0.998145 | 5.460384 |
9d5c29c8-dffc-4207-b071-d6434fbc5237 | ishandutta2007/codeforces | errichto/normal/626/B.cpp | #include<bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i = (a); i <= (b); ++i)
#define FORD(i,a,b) for(int i = (a); i >= (b); --i)
#define RI(i,n) FOR(i,1,(n))
#define REP(i,n) FOR(i,0,(n)-1)
#define mini(a,b) a=min(a,b)
#define maxi(a,b) a=max(a,b)
#define mp make_pair
#define pb push_back
#define st ... | ALGO | 0.99983 | 3.585151 |
457f01f1-b96f-4a09-9bdf-4c3d47cff5dc | ArvidKristoffersson/Programmeringslosningar | Programmeringsolympiaden/träning/uddatal.cpp | #include <iostream>
#pragma GCC optimize("Ofast,inline")
#pragma GCC optimize ("unroll-loops")
using namespace std;
inline void scoobydoobydoo()
{
std::ios_base::sync_with_stdio(false);
std::ios_base::sync_with_stdio(false);
static_cast<std::basic_ios<char>&>(std::cin).tie(NULL);
static_cast<std::basic_ios<... | ALGO | 0.999991 | 3.517352 |
4912c7cb-32d8-4aa1-95ae-a32a7e18bb25 | anirudh-shroff/Exams | Looper/Q2.cpp | #include <iostream>
using namespace std;
int main(){
int n,count = 0;
cout<<"Enter a Number : "<<endl;
cin>>n;
while (n!=0)
{
n=n/10;
count++;
}
cout << count;
return 0;
} | ALGO | 0.998939 | 3.346699 |
5f1a33d7-fe6f-4fd4-b100-ffbb4057b61d | ishandutta2007/codeforces | t90tank/normal/1168/B.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int,int>;
using db = double;
using vi = vector<int>;
using vl = vector<ll>;
#define fir first
#define sec second
#define pb push_back
#define lowbit(x) ((x)&(-(x)))
const int maxn = 3000006;
char s[maxn];
ll ans;
int main()... | ALGO | 0.999894 | 3.591136 |
bb50e2e8-d380-48fd-99d2-7438da6b1f6c | wentingzz/Practices | LeetCode/670. Maximum Swap.cpp | class BetterSolution {
public:
int maximumSwap(int num) {
string str = to_string(num);
int n = str.size(), cur = n-1;
int best[2] = {n, n};
for(int i = n-2; i > -1; i--){
if(str[cur] > str[i]){
best[0] = i;
best[1] = cur;
}els... | ALGO | 0.999915 | 6.371625 |
998abe24-b52b-4332-bd86-586e5f2d49ea | dereksodo/allcode | 2019/2019down/luogu/P1378.cpp | #include <iostream>
#include <cstring>
#include <cstdlib>
#include <set>
#include <vector>
#include <map>
#include <cstdio>
#include <utility>
#include <algorithm>
#include <cmath>
#include <queue>
#include <stack>
#include <cassert>
#include <climits>
using namespace std;
typedef long long ll;
#define DEBUG
#ifdef DEB... | ALGO | 0.999944 | 3.517531 |
c11f0312-a1dc-4a61-be1b-907015822bd3 | ishandutta2007/codeforces | ngochai94/normal/638/C.cpp | #include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for (int i = (a); i <= (b); i++)
#define FORD(i,a,b) for (int i = (a); i >= (b); i--)
#define REP(i,a) FOR(i,0,(int)(a)-1)
#define reset(a,b) memset(a,b,sizeof(a))
#define BUG(x) cout << #x << " = " << x << endl
#define mod 1000003
#define pi acos(-1)
#de... | ALGO | 0.999949 | 4.142098 |
9339bfc2-17af-47e3-8dcd-d089f0724bc4 | GitHub-gr777/nn | androguard/classification/libsimilarity/sources/lzma/CPP/7zip/UI/Common/SortUtils.cpp | // SortUtils.cpp
#include "StdAfx.h"
#include "SortUtils.h"
#include "Common/Wildcard.h"
static int CompareStrings(const int *p1, const int *p2, void *param)
{
const UStringVector &strings = *(const UStringVector *)param;
return CompareFileNames(strings[*p1], strings[*p2]);
}
void SortFileNames(const UStringVec... | TOOL | 0.928808 | 6.468472 |
549cbcfe-3296-41fc-ab3b-99aaff6b6583 | ishandutta2007/codeforces | tiwairoao/normal/733/F.cpp | #include<cstdio>
#include<vector>
#include<iostream>
#include<algorithm>
using namespace std;
typedef long long ll;
const int MAXN = 200000;
const ll INF = (1ll << 62);
struct edge{
int u, v, id;
ll w, c; bool f;
}edges[MAXN + 5];
bool operator < (edge a, edge b) {
return a.w < b.w;
}
int n, m, mx; ll sum, S;
int fa... | ALGO | 0.999949 | 3.397861 |
e982fbba-6401-4cc1-b9fe-fc1bec0a807e | dlwogns/PS | ~2024/10026.cpp | #include <iostream>
#include <queue>
#include <vector>
#include <algorithm>
#include <string>
using namespace std;
int N, dx[4] = {1,0,-1,0}, dy[4] = {0,1,0,-1};
vector<vector<int> > vis1(101, vector<int>(101, 0));
vector<vector<int> > vis2(101, vector<int>(101, 0));
string s[101];
void bfs(int x, int y, vector<vector<... | ALGO | 0.999284 | 3.409892 |
8d606077-35bb-4423-b32e-cbdd72461a61 | ishandutta2007/codeforces | receed/normal/1319/E.cpp | #include <iostream>
#include <cstdio>
#include <iomanip>
#include <cstring>
#include <cmath>
#include <cassert>
#include <bitset>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#define rep(i, n) f... | ALGO | 0.999931 | 4.250708 |
7675a7e0-a565-44c3-8671-fb7ed94fe4a8 | Sadi-Hurayv/Competitive-Programming | Online Judge/GFG/Shortest path in Directed Acyclic Graph.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
// For Loop
#define fi(i, a, c) for (ll i = (a); i < (c); i++)
#define fd(i, a, c) for (ll i = (a); i > (c); i--)
#define fe(it, a) for (auto it : a)
// Pair
#define pi pair<int, int>
#define pll pair<ll, ll>
#define ... | ALGO | 0.999956 | 4.794587 |
db7979bd-6189-4550-b614-f06b8f2903fe | iazadur/Data-Structure | Practice_Day_01/Z_Binary_Search.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n, q;
cin >> n >> q;
int v[n];
for (int i = 0; i < n; i++)
{
cin >> v[i];
}
sort(v, v + n);
while (q--)
{
bool flag = false;
int x;
cin >> x;
int l = 0, r = n - 1;
while (l ... | ALGO | 0.999987 | 4.856373 |
5c86a940-7c09-432e-a824-a1ee5c52f65e | Termocoin/Termocoin | src/scrypt.cpp | #include "scrypt.h"
#include "util.h"
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <openssl/sha.h>
static inline uint32_t be32dec(const void *pp)
{
const uint8_t *p = (uint8_t const *)pp;
return ((uint32_t)(p[3]) + ((uint32_t)(p[2]) << 8) +
((uint32_t)(p[1]) << 16) + ((uint32_t)(p[0]) <<... | ALGO | 0.990828 | 5.077381 |
506d59a8-2a4b-43a2-8390-837ed0d2c769 | raincross7/code-similarity | codes/train_code/problem060/problem060_400.cpp | #pragma optimize("unroll-loops,no-stack-protector")
#include <bits/stdc++.h>
using namespace std;
// using namespace __gnu_pbds;
// #include <ext/pb_ds/assoc_container.hpp>
// typedef tree<int,null_type,less<int>,rb_tree_tag,
// tree_order_statistics_node_update> indexed_set;
#define f(i,a,b) for(ll i=a;i<b;i++)
#defin... | ALGO | 0.999389 | 4.136607 |
e38e6374-6a26-4734-93c4-8e7130bdc0f5 | Bhumiij/DAA | week4/p3.cpp | #include<bits/stdc++.h>
using namespace std;
int partition(vector<int>&arr,int low,int high){
int pivot=arr[high];
int i=low-1;
for(int j=low;j<high;j++){
if(arr[j]<=pivot){
i++;
swap(arr[i],arr[j]);
}
}
swap(arr[high],arr[i+1]);
return i+1;
}
int findKth(vector<int>&arr,int low,int high,int k... | ALGO | 0.999977 | 4.787672 |
db0ba193-28de-4d5a-af65-c23525386269 | Ayishamarva7998/Stack_icons | 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 |
26d5adc9-b680-45f3-80f1-79184ae2da41 | Riju3323/DSA_Topics | Big Numbers/big_factorial.cpp | #include <bits/stdc++.h>
using namespace std;
void bigfacmultiply(vector<long long> &a, long long n, long long &sz)
{long long c = 0;
for (long long i = 0; i < sz; i++)
{long long prod = (a[i] * n) + c;
a[i] = prod % 10;
c = prod / 10;}
while (c)
{a[sz] = c % 10;
c = c / 10;
sz++;}
}
void bignumberfactorial(long long... | ALGO | 0.999974 | 4.815689 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.