uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
c5a4a897-a46d-48b8-8fb1-31002bde9082 | zwvista/PSL | Puzzles_Deep/Puzzles/Patchmania.cpp | #include "stdafx.h"
#include "astar_solver.h"
#include "bfs_move_gen.h"
#include "solve_puzzle.h"
/*
iOS Game: Patchmania
Patchmania is a fun and colorful puzzle game where you guide hungry bunnies through a farmer's vegetable garden to eat all the crops.
Objective: Guide the bunny from its burrow through... | ALGO | 0.999859 | 4.351307 |
ea5d8266-760c-4282-bd62-ba86375d05f7 | raincross7/code-similarity | codes/train_code/problem372/problem372_155.cpp | #include <bits/stdc++.h>
using ll = long long;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define ALL(x) x.begin(),x.end()
const ll LINF = 1e18;
using namespace std;
int main() {
cin.tie(0);
ios_base::sync_with_stdio(false);
ll n;
cin >> n;
ll sum = LINF;
for (ll i = 1; i*i <= n; ++i)... | ALGO | 0.999857 | 4.472178 |
eaea7eb9-8edd-4a9d-99c5-cbc36ed7d7e4 | M9k/Esempi_P2 | dlist.cpp | #include <iostream>
using std::cout;
template<class T>
class dlist
{
private:
class nodo
{
public:
T info;
nodo* prec;
nodo* succ;
nodo(T i, nodo* p=0, nodo* s=0): info(i), prec(p), succ(s) {}
//distruttore, assegnazione e costruttore di copia di default
... | ALGO | 0.993731 | 4.769822 |
52bfe48a-82b5-4e1f-8d7a-948140e65bba | ishandutta2007/codeforces | emptysoulist/normal/1288/A.cpp | #include<bits/stdc++.h>
using namespace std ;
#define rep( i, s, t ) for( register int i = s; i <= t; ++ i )
#define re register
#define int long long
int gi() {
char cc = getchar() ; int cn = 0, flus = 1 ;
while( cc < '0' || cc > '9' ) { if( cc == '-' ) flus = - flus ; cc = getchar() ; }
while( cc >= '0' && cc <= ... | ALGO | 0.999928 | 3.880279 |
a2803191-b88b-4327-94a5-59e11174ae3f | Ark-Aak/code_repo | AtCoder/ABC324F.cpp | #include <bits/stdc++.h>
#define rep(i, a, b) for(auto i = (a); i <= (b); i++)
#define _rep(i, a, b) for(auto i = (a); i >= (b); i--)
using namespace std;
typedef long long ll;
typedef pair <int, int> pii;
template <typename _Tp>
void read(_Tp& first) {
_Tp x = 0, f = 1; char c = getchar();
while (!isdigit(c)) {
... | ALGO | 0.999786 | 4.134838 |
a1b6901f-c7b6-4525-821c-f4a0b627d485 | aminjonshermatov/leetcode | algorithms/Subsets/Subsets.cpp | #include "bits/stdc++.h"
using namespace std;
class Solution {
public:
vector<vector<int>> subsets(vector<int>& nums) {
vector<vector<int>> res;
vector<int> subset;
dfs(nums, res, subset, 0);
return res;
}
void dfs(vector<int>& nums, vector<vector<int>>& res, vector<int>... | ALGO | 0.999959 | 6.263167 |
7346b62a-a949-4dc0-b4fd-db8befc2f7c1 | YuminQuant/Advanced-CPP-and-Modern-Designs | Final_Project_P4/Payoff.cpp | /*
* File: Payoff.cpp
* Author: Yumin Wu
* Date: 01/13/2025
*
* Description:
* This file implements the methods defined in the Payoff class hierarchy. It provides the concrete implementations
* for calculating the payoff of European options, Barrier options, and Asian options. Each class implements
* the payoff... | ALGO | 0.98905 | 7.127885 |
4bca51c8-2746-4bfe-b924-659eb8cf5d7e | tusharaherkar/LeetCode | Binary Search/27. Remove Element.cpp | class Solution {
public:
int removeElement(vector<int>& nums, int val) {
// Algo:
// 1. traverse the array from beginning
// 2. if the nums[i] == val then swap it with end and delete end
// 3. In such case dont update traversal var i as again we need to check the swapped element
... | ALGO | 0.999898 | 6.276226 |
a52d6e29-6555-462b-946f-e2d6ee8ecc29 | Swapnil67/dsa | Sliding-Window/02-medium/05-fruits-into-basket.cpp | /**
* * Leetcode - 904
* * Fruit Into Baskets
*
* * Example 1
* * Input : fruits = [1,2,1]
* * Output : 3
* * Explanation: We can pick from all 3 trees.
*
* * Example 2
* * Input : fruits = [0,1,2,2]
* * Output : 3
* * Explanation: We can pick from trees [1,2,2].
* * If we had started at the first tree... | ALGO | 0.999965 | 6.674211 |
9c5e3dde-00f0-4eee-aad0-5401b10f77ae | ishandutta2007/codeforces | wangzhifang/normal/1307/A.cpp | #include <cstdio>
#define cs const
#define il __inline__ __attribute__((always_inline))
using namespace std;
typedef cs int& ci;
typedef long long ll;
il void test(){
int n,d,ans=0;
scanf("%d%d",&n,&d);
for(int i=1,x; i<=n; ++i){
scanf("%d",&x);
if(x*(i-1)<=d)
ans+=x,d-=x*(i-1);
else{
ans+=d/(i-1);
d%... | ALGO | 0.999827 | 3.01471 |
fa62b405-234c-4e79-b819-a85cc9638e00 | lechenyu/Arbalest-Vec | llvm/tools/split-file/split-file.cpp | #include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/FileOutputBuffer.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/LineIterator.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/Pat... | TOOL | 0.870387 | 6.273174 |
0f1722f8-ab88-4555-8bb3-9b57e812eb00 | Shweta-rani05/code | singleelement.cpp | //program for finding single element in an sorted array
#include<iostream>
#include<vector>
using namespace std;
int singleElement(vector<int> arr){
int st=0,end=arr.size()-1;
if(arr.size()==1){
return arr[0];
}
while(st<=end){
int m=st+(end-st)/2;
if(m==st && st!=arr[1]){
... | ALGO | 0.999722 | 5.114917 |
8e34cd3a-cea1-4b49-bf66-1be6b97bb7b7 | LakshyaDuhoonISU/dsa | 22 feb cpp programs/queue_array.cpp | // queue menu driven program(array)
#include <iostream>
using namespace std;
int main()
{
int front = -1, rear = -1, choice, element, n;
cout << "Enter size of queue: ";
cin >> n;
int queue[n];
while (true)
{
cout << "\nQueue Operation:\n1.Enqueue\n2.Dequeue\n3.Peek\n4.Exit\n";
c... | ALGO | 0.971999 | 3.995272 |
ee600cf6-7788-4c0b-8ca0-207a10849814 | michaeljs1990/clog | third_party/boost/upstream/math/example/airy_zeros_example.cpp | #ifdef _MSC_VER
# pragma warning (disable : 4512) // assignment operator could not be generated.
# pragma warning (disable : 4996) // assignment operator could not be generated.
#endif
#include <iostream>
#include <limits>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <iterator>
// Weisstein, E... | ALGO | 0.998684 | 6.65003 |
66a09890-6de0-4e6c-a97a-409d058e9cad | boshishuoshuo/cppprimer | ch5/e5-21.cpp | #include <iostream>
#include <string>
#include <sstream>
using namespace std;
int main(int argc, char const *argv[])
{
string s = "ab cd ed ed Fc Fc bd";
istringstream iss(s);
string word, preWord = "";
int flag = 0;
while (iss >> word)
{
if (!isupper(word[0])) continue;
if (wo... | ALGO | 0.998874 | 4.579239 |
395490bd-f2ed-476d-be42-8385a628260a | csl-iisc/SUV-MICRO24 | llvm/lldb/test/API/tools/lldb-vscode/console/main.cpp |
int multiply(int x, int y) {
return x * y; // breakpoint 1
}
int main(int argc, char const *argv[]) {
int result = multiply(argc, 20);
return result < 0;
}
| TOOL | 0.867975 | 3.777698 |
a6899dc9-89e9-4700-8d23-3d86f33e66c9 | TanviKapurwan23/DataStructuresAlgorithms_GFG | Trees/printkDist.cpp | void printkDist(Node *root, int k){
if(root == NULL) return 0;
if(k == 0) {
cout<<(root->key)<<" ";
}else{
printkDist(root->left, k-1);
printkDist(root->right, k-1);
}
} | ALGO | 0.999906 | 3.39089 |
625dcd47-d27b-4a3d-ae31-277180d491ea | danilovict2/Competitive-Programming-Problems | Codeforces/SubsequenceHate/SubsequenceHate.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define pb push_back
#define pii pair<int, int>
#define vi vector<int>
#define vii vector<pair<int,int>>
#define mp make_pair
#define sz(a) a.size()
#define forn(i, n) for (int i = 0; i < n; ++i)
#define INF 0x3f3f3f3f
t... | ALGO | 0.999964 | 5.148916 |
a086c2a0-f3b8-4426-bc43-1ebad0aa7f12 | josiahser/DX-12-Engine | vcpkg/buildtrees/directxmath/src/dec2023-00bc4f4dee.clean/Stereo3D/Stereo3DMatrixHelper.cpp | #include "Stereo3DMatrixHelper.h"
using namespace DirectX;
namespace
{
inline bool StereoProjectionHelper
(
const STEREO_PARAMETERS& stereoParameters,
_Out_ float* fVirtualProjection,
_Out_ float* zNearWidth,
_Out_ float* zNearHeight,
float FovAngleY,
float Aspe... | TOOL | 0.998293 | 6.804098 |
ad95eff6-73b9-428d-8dfe-afc2d72ac301 | heavenMOJANG/ICPC | .history/Codeforces/CF1983/D_20240708144728.cpp | #pragma GCC optimize(1)
#pragma GCC optimize(2)
#pragma GCC optimize(3,"Ofast","inline")
#include<bits/stdc++.h>
#define int long long
#define lowbit(x) (x&(-x))
using namespace std;
constexpr int inf=0x7fffffff;
struct Node{
int num,val;
bool operator<(const Node&x)const{return val==x.val?num<x.num:val<x.val;}... | ALGO | 0.999986 | 4.08905 |
98147adc-5489-4561-a28a-5d31b6f34e39 | jungyuha/codingtest | c++/c1781.cpp | #include <bits/stdc++.h>
using namespace std;
int a,d,c,res;
vector<pair<int,int>> lst;
priority_queue<int,vector<int>,greater<int>> pq;
int main(){
cin >> a;
for(int i=0;i<a;i++){
cin >> d >> c ;
lst.push_back({d,c});
}
sort(lst.begin(),lst.end());
// (1)
for(int i=0;i<a;i++)... | ALGO | 0.999883 | 3.738238 |
99777892-7220-451b-8bf9-616b305a253e | C3sArmG/PrograI-20221-WX1A | Hoja01PunterosyFunciones/Hoja01Puntos y Funciones/Ejercicio29/Source.cpp | #include <iostream>
using namespace std;
void main() {
long long int num1, num2;
cout << "Inserte dos nmeros enteros";
cin >> num1;
cin >> num2;
if (num1 < num2) {
while (num1 <= num2) {
cout << num1 << "," << endl;
num1++;
}
}
else if (num1 > num2) {
while (num1 >= num2) {
cout << num1... | ALGO | 0.999359 | 3.360595 |
226796ee-b207-44ee-ab58-a46adf69a296 | lalitnegi56/tutorial | magnitude.cpp | #include<iostream>
using namespace std;
class complex
{
float r, i;
public:void get_data()
{
cout<<"enter real and imaginary parts";
cin>>r>>i;
}
void magnitude() const;
};
void complex::magnitude() const
{
float mag;
mag= sqrt(pow(r,2)+pow(i,2));
cout<<mag;
}
int main()
{
complex c1;
c1.get_data();
c1.m... | ALGO | 0.9143 | 4.607724 |
64e51571-1be7-4bde-a7ef-b5264db4f0bb | makio93/competitive-atcoder | abc296/abc296_f/0/main0-1.cpp | // 本番WA1
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using ll = long long;
#define rep(i, n) for (int i=0; i<(int)(n); ++(i))
#define rep3(i, m, n) for (int i=(m); (i)<(int)(n); ++(i))
#define repr(i, n) for (int i=(int)(n)-1; (i)>=0; --(i))
#define rep3r(i, m, n) fo... | ALGO | 0.999997 | 3.876619 |
94e5b32f-6057-48c2-9f9c-acd88a050398 | MKFirmware/MarlinKimbra | MK/src/planner/qr_solve.cpp | #include "../../base.h"
#if ENABLED(AUTO_BED_LEVELING_FEATURE) && ENABLED(AUTO_BED_LEVELING_GRID)
#include "qr_solve.h"
#include <stdlib.h>
#include <math.h>
//# include "r8lib.h"
int i4_min(int i1, int i2)
/******************************************************************************/
{
return (i1 < i2) ? i1 ... | TOOL | 0.999842 | 6.015717 |
dc6ca7da-84f3-409f-91ed-b2de8795c9cf | Cekiosk/Data_Structure_From_Entry_To_Master | thucpp_p225_vector.cpp | #include<iostream>
#include<vector>
using namespace std;
int main(){
unsigned n;
cout<<"please input the size of the vector:"<<endl;
cin>>n;
vector<int> intarr(n);//ʱȷijȣ(ʱȷ)
cout<<"please input "<<intarr.size()<<" intagers:"<<endl;//sizeȡС
for(int i=0;i<n;i++){
cin>>intarr[i];
}
cout<<"the array is:"<<end... | ALGO | 0.917451 | 3.367828 |
60d6fdf7-d60e-4e54-85c2-8529d9b1817b | V41BH4VR4JPUT/DSA-practice | LeetCode Questions/Q2551.cpp | // Leetcode Ques Daily Q2551
// Problem: Put Marbles in Bags
class Solution {
public:
long long putMarbles(vector<int>& weights, int k) {
if (k == 1) {
return 0;
}
vector<int> pair_sums;
for (size_t i = 0; i < weights.size() - 1; ++i) {
... | ALGO | 0.9999 | 5.518105 |
de903df4-ea7b-4fe6-ac86-71770f35e992 | PKUcoldkeyboard/LOG-Means | third-party/eigen-3.4.0/doc/examples/TemplateKeyword_flexible.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace Eigen;
template <typename Derived1, typename Derived2>
void copyUpperTriangularPart(MatrixBase<Derived1>& dst, const MatrixBase<Derived2>& src)
{
/* Note the 'template' keywords in the following line! */
dst.template triangularView<Upper>() = src.template... | TOOL | 0.977661 | 5.811227 |
d45df98f-cf9d-42dd-8b37-4226110d0fb9 | pranavkharche79/ALL_Modules | C++/tanmay_pranav/manipulators.cpp | #include <iostream>
#include <iomanip>
using namespace std;
main()
{
int number = 100;
cout << "Hex Value is =" << " " << hex << number << endl;
cout << "Octal Value is =" << " " << oct << number << endl;
cout << setw(40)<<"jhfisd";
return 0;
}
| TOOL | 0.922267 | 4.005092 |
381062f9-c2e2-4410-98f8-9f2db797bbb5 | Farid4hmed/-CrackYourInternship | Matrix/rotateImage.cpp | void rotate(vector<vector<int>>& matrix) {
int n = matrix.size();
int m = matrix[0].size();
for(int i=0; i<n; i++){
for(int j=i; j<m; j++){
swap(matrix[i][j], matrix[j][i]);
}
}
for(int i=0; i<n; i++){
int x = 0;
in... | ALGO | 0.999986 | 5.895218 |
fed4538f-6d59-4c57-96d6-b65b8126f8ec | aru01/graphs | S_zadacha.cpp | #include <iostream>
using namespace std;
int n, m, a[100][100], x=0, y=0, b=0;
int main() {
cin>>n>>m;
for(int i=1; i<=m; i++)
{
cin>>x>>y;
a[x][y]++;
a[y][x]++;
}
for(int i=1; i<=n; i++)
{
for(int j=1; j<=n; j++)
{
if((a[i][j]==0... | ALGO | 0.999986 | 4.560634 |
1ca5701c-4c0b-467b-8fcd-547769efcf88 | Serebriakov/advanced-animation-with-directx-source-code | BaseClasses/dllsetup.cpp | #include <streams.h>
//---------------------------------------------------------------------------
// defines
#define MAX_KEY_LEN 260
//---------------------------------------------------------------------------
// externally defined functions/variable
extern int g_cTemplates;
extern CFactoryTemplate g_Templates[]... | TOOL | 0.868333 | 4.628609 |
319fddd9-297f-42b0-b818-9b27a7e722a4 | NgYnZg/Classroom-Gamification-System | DataStructureAssignmentStudent/G16_TP068471_TP071864_TP068701_TP066218_TP071960_TopStudentTree.cpp | #include "G16_TP068471_TP071864_TP068701_TP066218_TP071960_TopStudentTree.h"
#include <iostream>
TopStudentTree::TopStudentTree() {
this->treeName = "";
}
TopStudentTree::TopStudentTree(string treeName) {
this->treeName = treeName;
}
TreeNode* TopStudentTree::getRoot() {
return root;
}
void TopStudentTr... | ALGO | 0.979182 | 3.142941 |
f4771c9e-5ca7-4de5-8194-9be546eed72d | jarenbraza/ICPC-2018 | ICPC/ViveLaDifference.cpp | #include <iostream>
#include <math.h>
using namespace std;
int main() {
int a, b, c, d, temp, steps;
while (cin >> a >> b >> c >> d && !(a == 0 && b == 0 && c == 0 && d == 0)) {
steps = 0;
while (a != b || b != c || c != d || d != a) {
temp = a;
a = abs(a - b);... | ALGO | 0.999859 | 3.76046 |
47cdc042-f665-46a7-8add-2125d04ae5b9 | CALLMELARE/My-LeetCode | C++/1.两数之和.cpp | /*
* @lc app=leetcode.cn id=1 lang=cpp
*
* [1] 两数之和
*/
// @lc code=start
class Solution
{
public:
vector<int> twoSum(vector<int> &nums, int target)
{
unordered_map<int, int> hash;
vector<int> result;
// loop each character and push in hash map
for (int i = 0; i < nums.size(... | ALGO | 0.999943 | 6.103755 |
98c7f073-7ad0-45c2-8b05-fea40c671a03 | aishaker129/Codeforces | Problem/B_Minimize_Inversions.cpp | /*
Alhamdulillah For Everything
Author --> Md. Akhlakul Islam
Date --> 09/02/2024
*/
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define optimize() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define endl '\n'
int main(){
optimize();
int t; cin>>t;
while(t... | ALGO | 0.999788 | 4.193022 |
f0e18dac-e4de-4c68-b393-a5eb7e05ebac | yunan4nlp/NNDisParser | eigen/bench/vdw_new.cpp | #include <iostream>
#include <Eigen/Core>
using namespace Eigen;
#ifndef SCALAR
#define SCALAR float
#endif
#ifndef SIZE
#define SIZE 10000
#endif
#ifndef REPEAT
#define REPEAT 10000
#endif
typedef Matrix<SCALAR, Eigen::Dynamic, 1> Vec;
using namespace std;
SCALAR E_VDW(const Vec &interactions1, const Vec &inter... | ALGO | 0.99978 | 3.519938 |
89496fda-afbc-4cac-9059-7583ad11e18e | WadekarPrashant/GeeksForGeeks-Questions | Difficulty: Easy/Left View of Binary Tree/left-view-of-binary-tree.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// Tree Node
struct Node
{
int data;
Node* left;
Node* right;
};
vector<int> leftView(struct Node *root);
// Utility function to create a new Tree Node
Node* newNode(int val)
{
Node* temp = new Node;
temp->data = val;
temp->... | ALGO | 0.999667 | 6.944573 |
6137dbfb-c8c3-4ee9-9fe2-f88bbbeb1266 | K0nnyaku/Code | Data/CSP-JS2021二轮提高组数据/SD-00467/palin/palin.cpp | #include<cstdio>
#include<iostream>
#include<cmath>
#include<algorithm>
#include<cstring>
#include<queue>
#include<stack>
using namespace std;
char ans[5000009],a[5000009],b[5000009],flag;
int t,n;
int head=1,tail;char q[5000009];
int main()
{
freopen("palin.in","r",stdin);
freopen("palin.out","w",stdout);
cin>... | ALGO | 0.997542 | 3.310188 |
7f922a9d-6546-4545-bbd9-9d79e0e89519 | FelixMatrixx/BT_04_23521215_23521704_23521494_23521821_23521208_23521327 | Bai063/Bai063.cpp | #include<iostream>
using namespace std;
void Nhap(float[][50], int&, int&);
int DemAm(float[][50], int, int, int);
int main()
{
float a[50][50];
int m, n;
Nhap(a, m, n);
int c;
cin >> c;
int dem = DemAm(a, m, n, c);
cout << dem;
return 0;
}
void Nhap(float a[][50], int& m, int& n)
{
cin >> m;
cin >> n;
for ... | ALGO | 0.999787 | 3.001399 |
de561836-1502-408b-86a9-fa5f062c0d32 | im-b-s-g/temp | minCostofDeletion.cpp | #include <bits/stdc++.h>
using namespace std;
vector<int> A = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15};
int printMinimumRemovals(string str, string X)
{
int N = str.size();
int M = X.size();
int dp[N][M] = {};
for (int j = 0; j < M; j++)
{
// If X[j] matches with str[0]
... | ALGO | 0.999922 | 5.200756 |
de37c5b8-1ee4-4205-8462-c4b0efc488fa | ishandutta2007/codeforces | liti/normal/455/A.cpp | /* In the name of Allah */
#include <bits/stdc++.h>
using namespace std;
const int maxN = 1000*100 + 10;
int a[maxN];
long long dp[maxN];
int main() {
int n;
cin >> n;
for(int i = 0 ; i < n ; i++ ) {
int num;
cin >> num;
a[num]++;
}
dp[1] = 1*a[1];
for(int i = 2 ; i < maxN ; i++ ) {
dp[i] = max(... | ALGO | 0.999842 | 3.690171 |
ab136098-47d5-428f-a88b-fd7cf32e2a14 | KimmiGYH/LeetCode_Notes_Public | Solutions_1001-2000/1743_Restore the Array From Adjacent Pairs_从相邻元素对还原数组/cpp_2_哈希表+图+BFS.cpp | class Solution {
public:
unordered_map<int, vector<int>> g;
vector<int> path;
queue<int> q;
set<int> vis;
vector<int> restoreArray(vector<vector<int>>& adjacentPairs) {
unordered_map<int, int> cnt;
for (auto& e : adjacentPairs) {
int a = e[0], b = e[1];
g... | ALGO | 0.999983 | 5.856802 |
b5b65cc4-a4d4-4279-b5f0-0eb94208408c | imadarsh21/Shopping_Application | 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.998693 | 6.797273 |
1ba6a052-e134-48bf-8c9c-43ab9382b6b5 | SubhamHaldar/aum_llvm | llvm-project-llvmorg-18.1.1/libcxx/test/std/algorithms/alg.sorting/alg.merge/inplace_merge.pass.cpp | // <algorithm>
// template<BidirectionalIterator Iter>
// requires ShuffleIterator<Iter>
// && LessThanComparable<Iter::value_type>
// void
// inplace_merge(Iter first, Iter middle, Iter last);
// XFAIL: LIBCXX-AIX-FIXME
#include <algorithm>
#include <cassert>
#include <random>
#include <vector>
#incl... | TEST | 0.996106 | 6.764181 |
bb6edc5d-aae6-46e3-b5d5-680aec84c8b1 | tizm317/CodingTest | Simulation/17140.cpp | //#include <iostream>
//#include <vector>
//#include <algorithm> // sort, swap
//using namespace std;
//
//// Ǯ
//// ¥ : 2023. 07. 31.
//// ȣ : #17140
//// ̸ : 迭
//// ˰ ùķ̼
//// ð: O()
//
//int r, c;
//int k;
//
//// 迭 ũ 3 ʱȭ
//int R = 3, C = 3;
//int arr[105][105];
//
//int freq[105];
//
//bool compare(int x... | ALGO | 0.999951 | 4.293979 |
b384fa24-7c8b-4f8d-b07d-d6854f6b2e89 | AbrarBb/DSA | Lab-Test/Dijkstra's.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <climits>
using namespace std;
void dijkstra(int nodeCount, vector<vector<pair<int, int>>> adj, int start)
{
vector<int> distances(nodeCount, INT_MAX);
priority_queue<pair<int, int>, vector<pair<int, int>>, greater<pair<int, int>>> pq;
dista... | ALGO | 0.999691 | 5.682596 |
b7a45671-3c47-4088-a55f-4fdf2d53a8d7 | leojerkovic/StrukturePodataka | Vjezba 7/Vjezba7Doma.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
struct direktorij;
typedef struct direktorij* pozicijad;
typedef struct direktorij {
char ime[15];
pozicijad next;
pozicijad below;
}direktorij;
struct stogdirektorij;
typedef struct stogdirektorij* pozicijasd;
typedef struc... | TOOL | 0.967695 | 3.662222 |
38ad0c90-fb24-41a1-aa22-6317a73b7192 | mint6421/kyopro | atcoder/Other/relay/relay_b.cpp |
#include<bits/stdc++.h>
using namespace std;
#define inf INT_MAX
#define INF LLONG_MAX
#define ll long long
#define ull unsigned long long
#define M (int)(1e9+7)
#define P pair<int,int>
#define FOR(i,m,n) for(int i=(int)m;i<(int)n;i++)
#define RFOR(i,m,n) for(int i=(int)m;i>=(int)n;i--)
#define rep(i,n) FOR(i,0,n)
#d... | ALGO | 0.999974 | 4.453541 |
5672bbe9-769d-4d64-ae6b-e09f328c99ca | mwang98/leetcode-practice | 2768-number-of-black-blocks/2768-number-of-black-blocks.cpp | class Solution {
public:
vector<long long> countBlackBlocks(int m, int n, vector<vector<int>>& coordinates) {
// Scan the matrix -> TLE
// Scan coordinates with black cell & update counter
vector<pair<int, int>> directions = {{-1, 0}, {0, -1}, {-1, -1}, {0, 0}};
unordered_ma... | ALGO | 0.999938 | 6.008309 |
35cb4b21-1bf6-4f96-ac28-055aa92952ee | Yashavanth-H/geekforgeek | GFG160/Arrays/SecondLargestElement.cpp | class Solution {
public:
int getSecondLargest(vector<int> &arr) {
// code here
int ans = -1;
int lrgst = arr[0];
for(int i=1; i<arr.size(); i++){
if(arr[i]>lrgst){
ans = lrgst;
lrgst = arr[i];
}
... | ALGO | 0.999941 | 4.812525 |
f6237399-521e-4f65-baf5-716cb25327bf | jabirsubaktagin16/problem-solving-accepted | CodeChef/Primality Test.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int T;
cin>>T;
while(T--){
long long n;
cin>>n;
int flag=0;
for(long long j=2;j*j<=n;++j)
{
if(n%j==0)
{
flag=1;
break;
}
}if (flag=... | ALGO | 0.999634 | 4.848284 |
bc28e7e5-f2e0-464b-844d-e75815537efe | OmarAbdulwahab/My-LeetCode-Solved-Problems | 0592-fraction-addition-and-subtraction/0592-fraction-addition-and-subtraction.cpp | class Solution {
public:
string fractionAddition(string expression) {
int num = 0;
int denom = 1;
// separate expression into signed numbers
vector<string> nums;
int i = 0;
if (expression[0] != '-') expression = '+' + expression;
while (i < expression.size())... | ALGO | 0.999912 | 6.157479 |
e1981c4c-0a42-4e61-a0ae-40a30cac83da | WonDoY/Dovelet | 2F/17_kangaroo.cpp | #include<cstdio>
int main(){
int a,b,c;
int x,y;
scanf("%d%d%d",&a,&b,&c);
x=b-a-1;
y=c-b-1;
if(x==0&&y==0){
printf("%d",0);
}else{
printf("%d",(x>y)?x:y);
}
return 0;
} | ALGO | 0.999875 | 3.152214 |
2a6560ad-845c-47d8-a497-e00417b456d0 | maistrenkod/mipt-cpp | checkers3.0/checkers3.0/Transformer.cpp | #include <iostream>
#include <array>
#include <map>
#include "Transformer.h"
namespace tf
{
std::array<std::array<gotg::VALUES_FOR_FIELD, turn::width_of_field>, turn::heigh_of_field> transformate_info(std::map<pos, Cell>& map_of_field)
{
std::array<std::array<gotg::VALUES_FOR_FIELD, turn::width_of_field>, turn::h... | ALGO | 0.986323 | 3.897511 |
162da853-71f0-4065-9388-39f48cf7d483 | nikhil-675/digital-coding | Strings/reverseWords.cpp | #include <iostream>
using namespace std;
void reverseWord(char s[], int start, int end) {
while (start < end) {
swap(s[start], s[end]);
start++;
end--;
}
}
void reverseEachWord(char s[], int n) {
int start = 0;
for (int i = 0; i <= n; i++) {
if (s[i] == ' ' || s[i] == '... | ALGO | 0.999979 | 5.858242 |
411df289-a361-4eff-af61-730e23de2c9c | LINKHA/Auto3D | Auto3D/ThirdParty/assimp/code/ImproveCacheLocality.cpp | /** @file Implementation of the post processing step to improve the cache locality of a mesh.
* <br>
* The algorithm is roughly basing on this paper:
* http://www.cs.princeton.edu/gfx/pubs/Sander_2007_%3ETR/tipsy.pdf
* .. although overdraw rduction isn't implemented yet ...
*/
// internal headers
#include "Impr... | ALGO | 0.9833 | 5.883259 |
84e7bd76-23a9-482d-8ca2-75b46729c677 | mayank-kabra2001/boost | libs/graph/example/write_graphviz.cpp | // A simple example of using write_graphviz to output a BGL adjacency_list
// graph in GraphViz Dot format.
// Author: Doug Gregor
#include <boost/graph/graphviz.hpp>
enum files_e { dax_h, yow_h, boz_h, zow_h, foo_cpp,
foo_o, bar_cpp, bar_o, libfoobar_a,
zig_cpp, zig_o, zag_cpp, zag_o,... | ALGO | 0.974465 | 6.492318 |
fcb84ec3-393b-411e-8aa1-5f403b19662d | Mulab11/cntt2016-hw1 | TC-SRM-586-div1-500/lx.cpp | #include <bits/stdc++.h>
#define rep(i, x, y) for (int i = (x), _ = (y); i <= _; ++i)
#define down(i, x, y) for (int i = (x), _ = (y); i >= _; --i)
#define x first
#define y second
#define mp make_pair
#define pb push_back
#define bin(x) (1<<(x))
#define LX_JUDGE
using namespace std;
typedef long long LL;
typedef pai... | ALGO | 0.999637 | 3.72666 |
28d738fc-66e2-4e40-8643-62eb2e9a964d | codew01f/snippets | graphs/2dgph.cpp |
grid mk2dgph(ll r, ll c){
grid edg(r*c, vi(0));
function<void(ll, ll)> conn = [&](ll a, ll b){
edg[a].push_back(b);
edg[b].push_back(a);
};
vector<char> prv(c), cur(c);
fir(c){
cin>>prv[i];
if(i and prv[i]-'#' and prv[i-1]-'#') conn(i, i-1);
}
fir(r-1){
fjr(c){
ll id=c*(i+1... | ALGO | 0.99989 | 3.88711 |
79e0fc66-432b-4dbe-ba9b-cda17efadf60 | PhamGiau2004/PhamGiau2004 | Bai_tap_buoi_1/Bai17.cpp | #include<iostream>
#include<algorithm>
using namespace std;
int Quick(int a[], int l, int r){
int q = a[l];
int i = l-1, j = r+1;
while(1){
do{
++i;
}while(a[i] < q);
do{
--j;
}while(a[j] > q);
if(i < j){
if(a[i] > a[j]){
... | ALGO | 0.999987 | 3.970454 |
83fc38ab-c2d5-4e7a-af60-f06d9dfe36d6 | raincross7/code-similarity | codes/train_code/problem226/problem226_139.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0, i##_len = (n); i < i##_len; i++)
#define reps(i, s, n) for(int i = (s), i##_len = (n); i < i##_len; i++)
#define rrep(i, n) for(int i = (n) - 1; i >= 0; i--)
#define rreps(i, e, n) for(int i = (n) - 1; i >= (e); i--)
#d... | ALGO | 0.999242 | 3.712945 |
2aa794f1-17e1-46bd-a0d6-348aa7e87c4c | yuancf1024/algorithm-go | 面试/Top/Three-thread-printABC.cpp | /**
* @file Three-thread-printABC.cpp
* @author your name (<EMAIL>)
* @brief
* @version 0.1
* @date 2022-09-10
*
* @copyright Copyright (c) 2022
*
* 写三个线程交替打印ABC
*/
#include <bits/stdc++.h>
using namespace std;
mutex mymutex;
condition_variable cv;
int flag = 0;
void printA() {
unique_lock<mutex... | ALGO | 0.863785 | 5.007881 |
85847d0e-6c41-466e-8be4-99a12ee4a732 | HoangKhac798013/beginning-cpp-programming-course | Section-10-Characters-and-Strings-Source-code/main.cpp | // Section 10
// Challenge -
// Substitution Cipher
/*
A simple and very old method of sending secret messages is the substitution cipher.
You might have used this cipher with your friends when you were a kid.
Basically, each letter of the alphabet gets replaced by another letter of the alphabet.
For example, every '... | ALGO | 0.991813 | 4.89558 |
a535ea64-5aa0-4f58-ab4c-af4f8b900bb5 | EunoiaOS/android_hardware_interfaces | keymaster/4.0/vts/functional/keymaster_hidl_hal_test.cpp | #define LOG_TAG "keymaster_hidl_hal_test"
#include <cutils/log.h>
#include <signal.h>
#include <functional>
#include <iostream>
#include <string>
#include <openssl/evp.h>
#include <openssl/mem.h>
#include <openssl/x509.h>
#include <android-base/properties.h>
#include <cutils/properties.h>
#include <keymasterV4_0/a... | TEST | 0.858131 | 6.538341 |
1ce02a08-efdc-422d-975a-32d35e033aac | jeoygin/gadget | files/rename/rename.cpp | #include <iostream>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <libgen.h>
using namespace std;
int makedirs(char * path, mode_t mode) {
struct stat st = {0};
if (stat(path, &st) == 0) {
if (S_ISDIR(st.st_mode) ==... | TOOL | 0.905185 | 4.862212 |
8db40923-9076-4222-b86a-a3f67c01b9b2 | hiraiwa0928/cpp-self-study | sec01/pra1-6-1.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(n) for(int i = 0; i < n; i++)
#define loop(s, n) for(int i = s; i < n; i++)
int main() {
int array[] = {4, 2, 1, 9, 5};
cout << "array[0] = " << array[0] << endl;
cout << "array[1] = " << array[1] << endl;
cout << "array[2] = " << array[2... | ALGO | 0.878372 | 3.384739 |
33b8f84c-f9a4-4aff-a347-ced71c2da076 | ishandutta2007/codeforces | ehnryx/normal/1505/E.cpp | #include <bits/stdc++.h>
using namespace std;
#define _USE_MATH_DEFINES
//#define FILENAME sadcactus
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_u... | ALGO | 0.999969 | 4.603981 |
31f69bb5-a5cb-4082-902f-e2b26e115ddc | AshvinBa/CPP_Programs-2 | Questions/GFG_Problem_of_the_day/Leaders_in_an_array.cpp | #include<iostream>
#include<bits/stdc++.h>
using namespace std;
vector<int> leader(int arr[],int n)
{
stack<int>s;
int max=arr[n-1];
for(int i=n-1;i>=0;i--)
{
if(max<=arr[i])
{
s.push(arr[i]);
max=arr[i];
}
}
vector<int>ans;
while(!s.empty())... | ALGO | 0.999996 | 4.354263 |
c6ca182c-33e4-47cf-9c89-73d87163dfd7 | ishandutta2007/codeforces | dreamoon_love_aa/normal/627/B.cpp | #include <bits/stdc++.h>
#define SZ(X) ((int)(X).size())
#define ALL(X) (X).begin(), (X).end()
#define REP(I, N) for (int I = 0; I < (N); ++I)
#define REPP(I, A, B) for (int I = (A); I < (B); ++I)
#define RI(X) scanf("%d", &(X))
#define RII(X, Y) scanf("%d%d", &(X), &(Y))
#define RIII(X, Y, Z) scanf("%d%d%d", &(X), &(Y... | ALGO | 0.999653 | 3.297888 |
78927e30-e011-4f0c-9a9b-b8b84e9078d1 | nguynninh/nesa | session6/bai6.cpp | #include <iostream>
using namespace std;
void chuyen_doi(int number) {
switch (number) {
case 0:
cout << "nought" << endl;
break;
case 1:
cout << "one" << endl;
break;
case 2:
cout << "two" << endl;
break;
case... | TOOL | 0.98747 | 4.250232 |
9604e38a-c902-4938-b005-f450816824af | harsh70568/Daily_Problems_Solution | 1323-maximum-69-number/1323-maximum-69-number.cpp | class Solution {
public:
int maximum69Number (int num) {
string s = to_string(num);
for(int i = 0; i < s.length(); i++)
{
if(s[i] == '6')
{
s[i] = '9';
break;
}
}
int n = stoi(s);
... | ALGO | 0.999386 | 6.560251 |
e94b91f3-20ba-4bdc-a951-575bf8c7d8a0 | developerYHLee/Algorithm | C++/Greedy/B13164.cpp | #include <iostream>
#include <algorithm>
using namespace std;
const int MAX_N = 300000;
int h[MAX_N], m[MAX_N - 1];
int main() { //ູ ġ
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int N, K;
cin >> N >> K;
for (int i = 0; i < N; i++) cin >> h[i];
for (int i = 1; i < N; i++) m[i - 1] = h[i] - h[i - 1];
so... | ALGO | 0.999823 | 3.539259 |
ebaa1255-43ea-47e5-b0aa-53a8b19f2190 | raincross7/code-similarity | codes/train_code/problem191/problem191_385.cpp | #include <stdio.h>
int GetCombination(int n, int x)
{
int count = 0;
for(int i = 1; i <= n - 2; i++){
for(int j = i + 1; j <= n - 1; j++){
for(int k = j + 1; k <= n; k++){
if(i + j + k == x){
count++;
}
}
}
}
return count;
}
int main(void)
{
int n, x;
while(true){
scanf("%d %d", &... | ALGO | 0.999898 | 4.848189 |
13161a29-51d4-4f38-a143-5d082afc8f14 | aryashahi/Leetcode | 299-bulls-and-cows/299-bulls-and-cows.cpp | // class Solution {
// public:
// string getHint(string secret, string guess) {
// int b=0;
// int c=0;
// int n=secret.size();
// unordered_map<char,int>mp1;
// unordered_map<char,int>mp2;
// for(size_t i=0;i<n;i++){
// if(secret[i]==guess[i])
//... | ALGO | 0.999971 | 6.146914 |
73d3ce39-00cf-4e57-b681-1810ac5a2d77 | Rishi01Prince/DSA_with_Rishi | Dynamic Programming/SomeOne Else Dp/Deepak Kumar/Day 13/9. Climbing Stairs.cpp | class Solution {
public:
int climbStairs(int n) {
int dp[n+1];
dp[0]=1;
dp[1]=1;
for(int i=2;i<=n;i++){
dp[i]=dp[i-1]+dp[i-2];
}
return dp[n];
}
};
| ALGO | 0.999954 | 5.952398 |
923e680f-a6f4-4469-aad3-4920391074b1 | moinulshaon/UVa-Problems | vol 101/10122/10122.cpp | #include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <vector>
#include <utility>
#include <set>
#include <map>
#include <iostream>
#include <queue>
using namespace std;
typedef long long LL;
#define PB push_back
#define FRO freopen("in.txt","r",stdin);
#define CLR(arr) memset( (arr),0... | ALGO | 0.999843 | 3.549881 |
0b5372b5-680c-469c-a343-0a6a9f2c3ccb | imoncoc/C-and-C-plus-plus | Codeforces/236_A. Boy or Girl.cpp | #include<iostream>
#include<string>
using namespace std;
int main(){
string st;
cin>>st;
string res = "";
int count = 0;
for(int i = 0; i < st.size(); i++){
int have = 0;
for(int j = i+1; j < st.size(); j++){
if(st[i] == st[j]) have++;
}
if(have == 0) co... | ALGO | 0.999338 | 3.861541 |
7b3b096b-ac6b-49f4-bdab-1cd2081363ef | GuessEver/ACMICPCSolutions | CodeForces/474/D/D.cpp | #include <cstdio>
const int mod = 1000000000 + 7;
int T, k, a, b;
int f[100000+10];
int main()
{
scanf("%d%d", &T, &k);
for(int i = 0; i < k; i++) f[i] = 1;
for(int i = k; i <= 100000; i++) f[i] = (f[i-1] + f[i-k]) % mod;
for(int i = 1; i <= 100000; i++) f[i] = (f[i] + f[i-1]) % mod;
while(T--)
{
scanf("%d%d... | ALGO | 0.999794 | 4.201325 |
571f4f79-bf3e-4c8a-a234-f0a26f327aa6 | GOKUL-S-2006/DSA-Main-Arc | Algorithms/Minimum Swaps to Sort by Digit Sum.cpp | class Solution {
public:
int findsum(int n){
int sum=0;
while(n>0){
sum+=n%10;
n=n/10;
}
return sum;
}
int minSwaps(vector<int>& nums) {
int n=nums.size();
vector<int>v=nums;
sort(v.begin(),v.end(),[&](int a,int b){
int sumA=findsum(a);
... | ALGO | 0.999998 | 6.067912 |
b4775443-e526-41dc-8d48-8d539e09900a | K-Kausa/OnlineJudge | C++_TEXQuotes_272.cpp | #include<iostream>
#include<string>;
using namespace std;
int main (){
string word;
int counter = 0;
while(getline(cin,word)){
for(int i = 0;i < word.size();i++){
if(word[i]==34&&counter==0){
counter++;
word.replace(i,1,"``");
}
if(... | TOOL | 0.997406 | 3.188814 |
b923bbcb-2b16-4fbb-9be9-2d051a25599e | nlesmerises/Super_Slicer | src/libigl/igl/boundary_facets.cpp | // IGL includes
#include "sort.h"
// STL includes
#include <map>
#include <iostream>
template <typename IntegerT, typename IntegerF>
IGL_INLINE void igl::boundary_facets(
const std::vector<std::vector<IntegerT> > & T,
std::vector<std::vector<IntegerF> > & F)
{
using namespace std;
if(T.size() == 0)
{
F... | ALGO | 0.979189 | 6.451618 |
54624c99-4370-480c-9daa-1a596e287aaf | avasharafi/geodesic | libigl/include/igl/screen_space_selection.cpp | #include "screen_space_selection.h"
#include <igl/AABB.h>
#include <igl/winding_number.h>
#include <igl/project.h>
#include <igl/unproject.h>
#include <igl/Hit.h>
#include <igl/parallel_for.h>
template <
typename DerivedV,
typename DerivedF,
typename DerivedM,
typename DerivedN,
typename DerivedO,
typenam... | ALGO | 0.996152 | 6.974721 |
795aa37a-e60a-4668-b29d-75877e90ba16 | toffanetto/URI_toffanetto | 1633.cpp | /* @toffanetto
* Gabriel Toffanetto França da Rocha
* Universidade Federal de Itajubá - Campus Itabira
* 1633 - SBC
*/
#include <iostream>
#include <queue>
#include <functional>
using namespace std;
typedef pair<long long, long long> pll;
int main(){
int n;
while(cin >> n){
uint64_t tempo=0;
... | ALGO | 0.999775 | 4.101065 |
16069041-cd35-4c46-a55b-6038bad99046 | Fisher87/leetcode | cplus/minimum-number-of-operations-to-make-array-xor-equal-to-k.cpp | // Time: O(n)
// Space: O(1)
// bit manipulation
class Solution {
public:
int minOperations(vector<int>& nums, int k) {
return __builtin_popcount(accumulate(cbegin(nums), cend(nums), k, [](int accu, int x) {
return accu ^ x;
}));
}
};
| ALGO | 0.999972 | 6.014431 |
24de10fa-ab09-4e5f-960a-bbac226c2678 | KyoWhale/Study-CodingTest | 백준/백트래킹/실3_15649_N과_M_1.cpp | // 17:10 ~ 17:28
#include <iostream>
using namespace std;
int N, M;
int used[9];
void dfs(int depth) {
if (depth == M) {
for (int i = 1; i <= M; i++) {
for (int j = 1; j <= N; j++) {
if (used[j] == i) {
cout << j << " ";
break;
... | ALGO | 0.999952 | 3.93986 |
439ce43e-aa21-4170-86f5-0248e3d962ef | nitgabriel/Linguagem-C | EntregaNormal/atv 4 ex 2 entrega.cpp | #include <stdio.h>
int main() {
int num, total_positivos = 0, total_negativos = 0;
do {
printf("Digite um numero inteiro (0 para sair): ");
scanf("%d", &num);
if (num > 0) {
total_positivos += num;
} else if (num < 0) {
total_negativos += num;
}... | ALGO | 0.985261 | 3.250846 |
323f76b5-880a-482e-9320-0c2f13f24075 | ustcyyw/algorithm | luogu/binary_search/CF2009E.cpp | /**
* @Time : 2025/1/4-4:47 PM
* @Author : yyw@ustc
* @E-mail : <EMAIL>
* @Github : https://github.com/ustcyyw
* @desc : CF2009E 1400 二分答案 数学
*/
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 2e5 + 5, mod = 998244353;
ll T, n, k;
ll cal(int m) {
return (k + k + m - 1) * m / ... | ALGO | 0.999981 | 4.528583 |
be37e4ae-7801-41fa-9881-fecfba32befb | adityaazad79/CP | Fun.cpp | #include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;
#define endl '\n'
const int N = 1e7 + 10;
const int M = 1e9 + 7;
int main()
{
ios::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int t;
cin >> t;
while (t--)
... | ALGO | 0.999785 | 4.636073 |
1c585b98-4945-4e97-9dff-bb128d33172c | Blackfury7/LeetCode | 322-coin-change/322-coin-change.cpp | class Solution {
public:
int dp[10000 + 1][12 + 1];
int memoization(vector<int>& wt, int w, int n)
{
if (n == 0 || w == 0)
return (w == 0) ? 0 : INT_MAX - 1;
if (dp[w][n] != -1)
return dp[w][n];
if (wt[n - 1] > w)
return dp[w... | ALGO | 0.999981 | 5.662167 |
a55a6966-876b-4ed1-a9a6-fb8ae201bb06 | Asevenx174/CP-source-code- | 02_OJ_solution/Cf contest/778 div2/b.cpp | #include<bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define pf printf
#define ff first
#define ss second
#define sef second.first
#define ses second.second
#define PI 3.14159265 /// tan inverse = atan(value)*(180/PI)
#define ms(a,b) memset(a, b, sizeof(a))
#define lp(i,a,b)... | ALGO | 0.999993 | 3.917194 |
2388e769-8ef7-455f-a684-fa8c56a33c9f | VROOM-Project/vroom | src/problems/cvrp/operators/intra_or_opt.cpp | #include "problems/cvrp/operators/intra_or_opt.h"
#include "utils/helpers.h"
namespace vroom::cvrp {
IntraOrOpt::IntraOrOpt(const Input& input,
const utils::SolutionState& sol_state,
RawRoute& s_raw_route,
Index s_vehicle,
Ind... | ALGO | 0.999905 | 7.718721 |
9487d143-1ca5-415e-97c0-3012a2be3f4b | libbyshoop/csinparallel | modules/DrugDesignInParallel/source/boostthreads/code/dd_boost.cpp | #include <iostream>
#include <queue>
#include <string>
#include <vector>
#include <algorithm>
#include <cstdlib>
#include <tbb/concurrent_vector.h>
#include <tbb/concurrent_queue.h>
#include <tbb/parallel_sort.h>
#include <boost/bind.hpp>
#include <boost/thread/thread.hpp>
#define DEFAULT_max_ligand 7
#define DEFAULT_... | ALGO | 0.999962 | 4.975691 |
cbd37b3c-cb60-400d-8392-069b3e802fc2 | mt-shihab26/courses | 05_synapse-beginner-regular-season-2_mahmud-sajjad-abeer/Class-03-Array-and-Strings/Long-Contest-Code/R_All_in_All.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long int llint;
typedef unsigned long long int ullint;
typedef short int sint;
typedef unsigned int uint;
#define endn '\n'
#define umap unordered_map
#define uset unordered_set
#define pb push_back
int main(void) {
ios_base::sync_with_stdio(false);
c... | ALGO | 0.999957 | 5.244278 |
a433b1d9-f910-47cb-ac3d-a6e90ab1cda2 | miiitomi/atcoder | mayocon/20231121/2.cpp | // https://atcoder.jp/contests/abc079/tasks/abc079_c
#include <bits/stdc++.h>
using namespace std;
int main() {
vector<int> v(4, 0);
for (int i = 0; i < 4; i++) {
char c;
cin >> c;
v[i] = (int)(c-'0');
}
for (int k = 0; k < (1 << 3); k++) {
int ans = v[0];
for (... | ALGO | 0.999896 | 3.936562 |
6075ce56-c3f2-4673-a117-396fe823c83f | Singhdhiru/DSA-with-c-plus | Graph/Bipartite_Graph/Bipartite-Graph_using_dfs.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution
{
private:
bool dfs(int node, int col, int color[], vector<int> adj[])
{
color[node] = col;
// traverse adjacent nodes
for (auto it : adj[node])
{
// if uncoloured
if (color[it] == -1)
... | ALGO | 0.999942 | 5.685349 |
067170e1-fc82-4427-a165-e810e6fdda46 | ishandutta2007/codeforces | romawhite/normal/320/C.cpp | #define _CRT_SECURE_NO_WARNINGS
#pragma comment(linker, "/stack:16777216")
#include <string>
#include <vector>
#include <map>
#include <list>
#include <iterator>
#include <set>
#include <queue>
#include <iostream>
#include <sstream>
#include <stack>
#include <deque>
#include <cmath>
#include <memory.h>
#include <cstdli... | ALGO | 0.99999 | 3.844596 |
c18b9ac4-bd82-4a8c-810f-b418fa654a05 | sevenalarm/Codeforces | ordi1403/1985A.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define rpt(a) for (int i=0; i<(a); i++)
#define range(a, b) for (int j=(a); j<(b); j++)
#define ft first
#define sd second
#define pb push_back
#define fori(a, b) for (int i=(a); i<(b); i++)
int main() {
ios_base::sync_with_stdio(0);
cin.tie(... | ALGO | 0.999878 | 4.39052 |
a6c5ec3d-bd97-407b-8d2b-6d56e5f6c8fc | e1810/kyopro | joi/prelim/2016/d.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
ll n, t, q;
scanf("%lld %lld %lld", &n, &t, &q);
vector<ll> dist(n+2);
dist[0] = -3e18;
dist[n+1] = 3e18;
vector<ll> vect(n+2);
vect[0] = 1;
vect[n+1] = 2;
vector<ll> talkin(0);
vector<ll> talkinin(n+2);
talkinin[0] = 0;
ll i... | ALGO | 0.999821 | 3.42294 |
594e5f32-8a5f-45f5-83fd-a39f9f9e65fe | ishhcode/DSA-sheet | Day-19/btFromInorderPreorder.cpp | //construct a binary tree from inorder and preorder traversal
struct node {
int data;
struct node * left, * right;
};
struct node * newNode(int data) {
struct node * node = (struct node * ) malloc(sizeof(struct node));
node -> data = data;
node -> left = NULL;
node -> right = NULL;
return (node);
}
node... | ALGO | 0.999416 | 6.336421 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.