uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
565be9f4-fcc6-474f-8c60-8d3df2db73a0 | Aartimehr/codechef | class time.cpp | #include <iostream>
using namespace std;
int main() {
int n;
cin>>n;
while(n--)
{
int a;
cin>>a;
cout<<3*a<<endl;
}
return 0;
}
| ALGO | 0.998212 | 3.378772 |
8b3bc2eb-1543-4312-8e1a-a4b69a302332 | Rahul-Palahwat/LeetCode_Problems | 0673-number-of-longest-increasing-subsequence/0673-number-of-longest-increasing-subsequence.cpp | class Solution {
public:
int solve(int index , vector<int>& nums , int prevIndex){
if(index == nums.size()){
return 0;
}
if(prevIndex == -1){
return max(solve(index+1 , nums , prevIndex) , 1+solve(index+1 , nums , index));
}else{
int notTaken = sol... | ALGO | 0.999998 | 5.812152 |
3afe22d6-a4d8-4c60-8377-89861f2c9217 | park-sangeun/Data-Structure | HW1/List+Stack/Inorder_List.cpp | #include <iostream>
using namespace std;
#include "Inorder.h"
int main()
{
List l;
ListElementType i;
cout << "20211522 박상은" << endl;
cout << "Enter items to add to list, add 0 to stop: ";
cin >> i;
while (i != 0) {
l.insert(i);
cin >> i;
}
cout << "Here are the items in the list. \n";
ListElementType ele... | ALGO | 0.995242 | 3.861703 |
984216ae-a107-4c6c-8a63-bff32c11bcd3 | SCIInstitute/spire | spire/src/FileUtil.cpp | /// \author James Hughes
/// \date January 2013
/// \brief These functions exist primarily to locate shader files.
/// Inherits heavily from the SysTools library in IV3D's Tuvok.
/// There is currently no wstring implementation.
#include <vector>
#include <string>
#include <algorithm>
#include "Com... | TOOL | 0.872911 | 6.265665 |
df4cd6a2-6535-4871-b651-e9aacd68ad0d | Abhik-Chakraborty/DSA | check-if-string-is-palindrome/isPalindrome.cpp | #include<bits/stdc++.h>
using namespace std;
bool isPalindrome(const string& str){
int left = 0;
int right = str.size() - 1;
while(left < right){
if(str[left] != str[right]){
return false;
}
left++;
right--;
}
return true;
}
int main() {
string str;... | ALGO | 0.998838 | 5.356238 |
3a149839-df8a-49ec-b7da-a45728e0fae5 | raincross7/code-similarity | codes/train_code/problem325/problem325_67.cpp | #include <bits/stdc++.h>
#define rep(i, n) for (int i=0; i<(int)(n); i++)
#define all(v) v.begin(), v.end()
#define allR(v) v.rbegin(), v.rend()
#define PRINT(v) for (auto x : (v)) cout <<x <<" " ; cout <<endl;
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
typedef pair<int,int> Pi;
const... | ALGO | 0.999993 | 3.192014 |
974cb09b-22e1-48b3-83cf-d51efde816ed | Arvln/LeetCode | Greedy/277.Find-the-Celebrity/277.Find-the-Celebrity.cpp | class Solution {
public:
int findCelebrity(int n) {
int celebrity=0;
for (int i=1; i<n; i++)
if (knows(i, celebrity)==false) celebrity=i;
for (int i=0; i<n; i++)
if (i!=celebrity&&knows(celebrity, i)==true||knows(i, celebrity)==false) return -1;
retur... | ALGO | 0.999456 | 5.185651 |
bd9b7212-76fc-423a-a0bd-86237db3b382 | Kirofeed/handbook_algos | 3.1/task_1.cpp | #include <iostream>
using namespace std;
int main() {
int a;
int sum = 1;
cin >> a;
for (int i = 1; i <= a; i++) {
sum *= i;
}
cout << sum << endl;
} | ALGO | 0.999955 | 4.578077 |
866b39fa-1bdc-4dfd-b394-50a63100eaee | FernandoCaudillo10/programmingTeamChallenges | progteam/kattis2/differentdistances.cpp | #include <iostream>
#include <math.h>
using namespace std;
int main(){
double x1, y1, x2, y2, p;
while(true){
cin >> x1;
if(x1 == 0)
break;
cin >> y1 >> x2 >> y2 >> p;
cout.setf(ios::showpoint);
cout.setf(ios::fixed);
cout.precision(10);
cout << pow( pow( ((x1-x2 < 0) ? (x1-x2)*(-1): (x1-x2)... | ALGO | 0.998669 | 3.668518 |
de982f36-a011-4a1b-bafb-63cf3ad18288 | Nilesh-0203/Daily-Codes | Difficulty: Medium/Delete a node from BST/delete-a-node-from-bst.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
#define MAX_HEIGHT 100000
// Tree Node
struct Node {
int data;
Node* left;
Node* right;
Node(int val) {
data = val;
left = right = NULL;
}
};
struct Node* deleteNode(struct Node* root, int key);
// Function to B... | ALGO | 0.999705 | 6.22168 |
3b509f75-4ceb-475c-aaeb-adf921140d91 | raincross7/code-similarity | codes/train_code/problem399/problem399_222.cpp | #include <bits/stdc++.h>
using namespace std;
#define Rep(i,N) for(int i = 0;i < N;i++)
int main()
{
int p[] = {500,100,50,10,5,1};
int data;
while(cin >> data,data){
data = 1000 - data;
int cnt = 0;
Rep(i,6) {
while(p[i] <= data) {
data -= p[i];cnt++;
}
}
cout << cnt << endl;
... | ALGO | 0.99957 | 3.760584 |
b8c997bd-c042-49d5-b740-964f2ce85527 | SimHacker/MicropolisCore | MicropolisEngine/src/scan.cpp | /**
* @file scan.cpp
* @brief Implements various scanning and analysis algorithms for
* Micropolis.
*
* This file contains functions for scanning and analyzing different
* aspects of the city in the Micropolis game, including fire and
* police station coverage, population density, pollution, land value,
* crime... | ALGO | 0.991915 | 3.304402 |
849f6816-a40d-4e05-b472-a1ce5fce0afa | ShyamGupta1/DSA-using-CPP | Priority Queue Using 2D Arrays/03_Is_Full.cpp | #include <iostream>
using namespace std;
class PriorityQueue
{
private:
int capacity;
int highest_priority;
int **ptr;
int *front;
int *rear;
public:
PriorityQueue(int, int);
bool isFull(int);
};
bool PriorityQueue::isFull(int pno)
{
// Check for specific priority number
if (front... | ALGO | 0.999519 | 4.945171 |
3ff2a4ce-c4a2-485c-8538-74b0e74a2f32 | jo3-l/cp-practice | src/main/cpp/ccc/2014/j1.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cin.exceptions(cin.failbit);
int a, b, c;
cin >> a >> b >> c;
if (a + b + c != 180) cout << "Error\n";
else if (a == 60 && b == 60 && c == 60) cout << "Equilateral\n";
else if (a == b || a == c || b... | ALGO | 0.999871 | 4.833111 |
d8cd4925-6a2e-463b-8692-9dd5814c1e9c | Eledmunds15/ParSplice | core/Splicer.cpp | #include "Splicer.hpp"
ParSpliceSplicer::ParSpliceSplicer(boost::property_tree::ptree &config) : modifier(config){ };
ParSpliceSplicer::ParSpliceSplicer(MPI_Comm splicerComm_, AbstractDDS *minimaStore_, std::set<int> children_, boost::property_tree::ptree &config, MPI_Comm workerComm) : modifier(config){
//BOOST_L... | ALGO | 0.978178 | 5.032344 |
a403eaba-811c-4b3e-aa59-e6aef42fd8f9 | Sarang8/Leetcode_Problems | 108-convert-sorted-array-to-binary-search-tree/108-convert-sorted-array-to-binary-search-tree.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999997 | 6.714937 |
fa3cf9bb-6245-49c9-b44e-8bf6f4324964 | SovietPower/My-OI-ACM | 其它/Hash/BZOJ.4337.[BJOI2015]树的同构(树哈希).cpp | /*
936kb 20ms
$Description$
$n$ÿͬСš
$nÿĵ\leq 50$
$Solution$
һ
ԴķֱDFSԽתΪи
Ȼϣֱstringʾÿ
ÿÿԶԹϣֵַsortһСʾ¼
*/
#include <cstdio>
#include <cctype>
#include <string>
#include <algorithm>
#define gc() getchar()
typedef long long LL;
const int N=53;
std::string str[N],s[N];
struct Tree
{
int Min,Enum,H[N],nxt[N<<1],to[N<<1... | ALGO | 0.999883 | 4.039387 |
8097f54f-c13f-4b50-ac97-41264a2acfac | Darkclaw1704/DSA-BABBAR | Lectures/lecture 48/removeDuplicatesUnsortedLinkedList.cpp | #include <iostream>
using namespace std;
struct Node {
int val;
Node *next;
Node() : val(0), next(nullptr) {}
Node(int x) : val(x), next(nullptr) {}
Node(int x, Node *next) : val(x), next(next) {}
};
void deleteNextNode(Node* ¤tNode){
Node* nextNode = currentNode->next;
currentNode-... | ALGO | 0.99996 | 5.037226 |
f8b66b06-7e15-44b7-b7d6-b6a0c29b0eec | Asad422/Students-Control | 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.998859 | 6.785645 |
648393fd-c995-4ef8-9be6-079d6f05055f | koulritanshu/LP5 | HPC/parallel_sorting.cpp | #include <bits/stdc++.h>
#include <chrono>
using namespace std;
void checkSorted(vector<int>&v){
bool isSorted = true;
cout << "Printing the array: ";
cout << v[0] << ' ';
for(int i=1;i<v.size();i++){
cout << v[i] << ' ';
if(v[i]<v[i-1]){
isSorted = false;
}
}
... | ALGO | 0.999633 | 5.284125 |
c9a4af19-c308-4e6c-b770-ef48cbb5876b | biyotte/Code_of_gunwookim | BOJ_solve/13560.cpp | #include <bits/stdc++.h>
#define x first
#define y second
#define pb push_back
#define all(v) v.begin(),v.end()
#pragma gcc optimize("O3")
#pragma gcc optimize("Ofast")
#pragma gcc optimize("unroll-loops")
using namespace std;
const int INF = 1e9;
const int TMX = 1 << 18;
const long long llINF = 1e18;
const long long ... | ALGO | 0.999971 | 3.858126 |
c51cfc96-992a-437b-8a59-7fe71012a7dd | vfolunin/archives-solutions | LeetCode/937.cpp | class Solution {
static bool compare(const string &a, const string &b) {
if (isalpha(a.back()) && isdigit(b.back()))
return 1;
if (isalpha(a.back()) && isalpha(b.back())) {
string aContents = a.substr(a.find(' '));
string bContents = b.substr(b.find(' '));
... | ALGO | 0.998985 | 6.101968 |
9585f6c5-f9e0-42fb-9279-268a38583ab6 | SETURAJ/LeetCode-Solutions | next-permutation/Runtime Error/11-20-2021, 1_51_09 AM/Solution.cpp | // https://leetcode.com/problems/next-permutation
class Solution {
public:
void nextPermutation(vector<int>& nums) {
if(nums.size()==0||nums.size()==1)
{
}
else
{
int i=nums.size()-2;
while(i>=0 && nums[i]>=nums[i+1])
i--;... | ALGO | 0.999989 | 5.941954 |
f1b154be-fef7-40bd-a574-700de11c00fe | squaresLab/BatFix | results/transcoder/translations/java/SORT_ARRAY_CONVERTING_ELEMENTS_SQUARES_1.cpp | void sortSquares ( int arr [ ] ) {
int n = arr . size ( ) ;
int k ;
for ( k = 0 ;
k < n ;
k ++ ) {
if ( arr [ k ] >= 0 ) break ;
}
int i = k - 1 ;
int j = k ;
int ind = 0 ;
int temp [ n ] ;
while ( i >= 0 && j < n ) {
if ( arr [ i ] * arr [ i ] < arr [ j ] * arr [ j ] ) {
temp [ ind ... | ALGO | 0.999663 | 4.094378 |
354a42de-8d2f-4bfe-a190-2951b25ce7b9 | c19981127/study | lettcode/next_permutation.cpp | /*
Next permutation describtions:
Implement next permutation,which reaerranges numbers into the lexicographically next greater permutation of numbers,
if such arrangement is not possible,it must rearrange it as the lowest possible order(ie,sorted in ascending order).
the reolacement must be in-place , do noe allocate ... | ALGO | 0.999599 | 5.291833 |
a71afe05-d1a7-4724-b5bb-f2a1ef359635 | jungyoonoh/AlgorithmPractice | C++/BAEKJOON/Mathmatics/factorization.cpp | #include <iostream>
using namespace std;
int main(){
int N;
cin >> N;
while(N != 1){
for(int i = 2; i <= N; i++){
if(N % i == 0){
cout << i << '\n';
N /= i;
break;
}
}
}
return 0;
} | ALGO | 0.99999 | 4.666207 |
dab8b00f-78d5-41cf-9d58-c32ff33d3340 | yabadabu/viscoelastic_cpu | engine/geometry/camera.cpp | #include "platform.h"
#include "camera.h"
CCamera::CCamera()
: aspect_ratio(1.0f)
{
lookAt(VEC3(0, 0, 0), VEC3(0, 0, 1), VEC3(0, 1, 0));
setProjectionParams(deg2rad(65.0f), 1.0f, 100.0f);
setViewport(0, 0, 512, 512);
}
void CCamera::lookAt(const VEC3& src
, const VEC3& dst
, const VEC3& aux
) {
// Save ... | TOOL | 0.875533 | 6.450462 |
c3177ecb-fdd8-4161-be9e-7d0c2ba90d25 | TranAnhQuoc23521313/UIT_MATRIX | UIT_23520335_MaTrix/Bai064/Bai064.cpp | #include <iostream>
using namespace std;
int DemNguyenTo(int a[][500], int m, int n, int c);
void Nhap(int [][500],int m,int n);
int main()
{
int m, n;
int a[500][500];
Nhap(a,m,n);
int c;
cout << "Nhap vao cot C:";
cin >> c;
int count = DemNguyenTo(a, m, n, c);
cout << count << endl;... | ALGO | 0.999464 | 3.813516 |
19bc9429-7dcf-4a0a-884b-fd828900e886 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_3801_57.cpp | #include <bits/stdc++.h>
using namespace std;
long long fun(long long X, long long M) {
long long t1, t2, t3;
t1 = M * (M + 1) / 2;
t2 = M * (M + 1) * (2 * M + 1) / 6;
t3 = (M) * (M + 1) / 2;
long long t4, t5, t6;
t4 = (t2 - t3) / 2;
t5 = X + t4;
if (t5 % t1 == 0) {
long long a = t5 / t1;
if (a ... | ALGO | 0.9995 | 3.793315 |
bced7145-64a8-44a2-93b9-97241a814e94 | sarvex/leetcode-v | solution/1600-1699/1609.Even Odd Tree/Solution.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.99998 | 5.885512 |
31358ced-6cbc-4544-beeb-6c41598fc342 | Subbuleo23/finding-nemo | UnacademyCourse/RecursionBacktrackingINtroDPCPAug21/Lecture10/royandcoinbox1.cpp | // Problem Link - https://www.hackerearth.com/practice/algorithms/dynamic-programming/introduction-to-dynamic-programming-1/practice-problems/algorithm/roy-and-coin-boxes-1/
/* By Sanket Singh */
#include<bits/stdc++.h>
//#include<ext/pb_ds/assoc_container.hpp>
//#include<ext/pb_ds/tree_policy.hpp>
//#include <ext/pb_d... | ALGO | 0.999972 | 4.890362 |
8d19afd6-bf57-43cf-9060-a3c2da0cd593 | Changxi-Liu/llvm-8.0.0 | llvm/lib/CodeGen/MachineTraceMetrics.cpp | #include "llvm/CodeGen/MachineTraceMetrics.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/Optional.h"
#include "llvm/ADT/PostOrderIterator.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/SparseSet.h"
#include "llvm/CodeGen/MachineBasicBlock.... | TOOL | 0.992816 | 7.906433 |
2f0b23d8-65ae-4bda-aaa7-30b544ca418d | allenyllee/CUDA_Samples_for_Linux | NVIDIA_CUDA-9.0_Samples/7_CUDALibraries/cuSolverSp_LowlevelCholesky/cuSolverSp_LowlevelCholesky.cpp | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <assert.h>
#include "cusolverSp.h"
#include "cusolverSp_LOWLEVEL_PREVIEW.h"
#include <cuda_runtime.h>
#include "helper_cuda.h"
#include "helper_cusolver.h"
template <typename T_ELEM>
int loadMMSparseMatrix(
char *filename,
... | TOOL | 0.96002 | 5.336947 |
0ff04004-b901-42ce-8f69-b53cefa2973e | dragonArt3003/SDE | Daily Practice/d1Shubhanshu.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution{
public:
bool isInside(int r, int c, int maxR, int maxC){
if (0 <= r && r <= maxR)
if (0 <= c && c <= maxC)
return true;
return false;
}
void dfs(vector<vector<char>> &mat, vector<vector<bool>> &conve... | ALGO | 0.999932 | 5.414505 |
785465bf-ed4f-49a9-965c-daf907f8244c | IN-Kanchan/KANCHAN_CPP | array/Maximums.cpp | #include <iostream>
using namespace std;
int maximum(int arr[], int n)
{
int max = INT_MIN;
for (int i = 0; i < n; i++)
{
if (arr[i] > max)
{
max = arr[i];
}
}
return max;
}
int main()
{
int size;
cin >> size;
int arr[100];
for (int i = 0; i < size... | ALGO | 0.99914 | 4.691674 |
32abc1cd-cba4-4721-bfd7-baceeb593475 | mahajanmayur06/DSA | Linked List/singly_LL/reverseLL.cpp | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
class Node {
public :
int data;
Node* next;
Node() {
data = 0;
next = nullptr;
}
Node (int val) {
data = val;
next = nullptr;
}
};
Node* reverseLL(Node* head, Node* prev) {
if (head == NULL) {... | ALGO | 0.99982 | 5.29202 |
b5b913ea-c8cc-43e3-b713-da20f58d56b5 | BrunoKrinski/IMC_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 |
29b2d658-c2b5-45b1-9a74-371ff0c2d70c | rafaeltuelho/devspaces-c-plus-plus | graph/prim.cpp | // C++ program to implement Prim's Algorithm
#include <iostream>
#include <queue>
#include <vector>
using PII = std::pair<int, int>;
int prim(int x, const std::vector<std::vector<PII> > &graph) {
// priority queue to maintain edges with respect to weights
std::priority_queue<PII, std::vector<PII>, std::greate... | ALGO | 0.999989 | 5.569233 |
6e520ab2-1e9b-4194-ade7-a36c8c8b5ddd | ishandutta2007/codeforces | zhoushang2003/normal/731/E.cpp | #include<iostream>
using namespace std;
const int N=2e5+1;
int n,a[N],s[N],A;
int main()
{
cin>>n;
for(int i=1;i<=n;i++)
cin>>a[i];
for(int i=1;i<=n;i++)
s[i]=s[i-1]+a[i];
A=s[n];
for(int i=n-1;i>1;i--)
A=max(A,s[i]-A);
cout<<A;
return 0;
} | ALGO | 0.999769 | 3.330508 |
ee78168c-dd52-4585-95ed-cbce9e7effef | cameronliang/Athena | src/hydro/rsolvers/mhd/hlld.cpp | // C++ headers
#include <algorithm> // max(), min()
// Athena++ headers
#include "../../hydro.hpp"
#include "../../../athena.hpp"
#include "../../../athena_arrays.hpp"
#include "../../../eos/eos.hpp"
// container to store (density, momentum, total energy, tranverse magnetic field)
// minimizes changes required to ad... | ALGO | 0.999895 | 4.207716 |
cb2e390c-47d0-436b-99fd-63588dfdae76 | daovietanh190499/Grid-Neus | preprocess_custom_data/aruco_preprocess/calibration.cpp | #include <cnpy.h>
#include <cmath>
#include <cstring>
#include <string>
#include <iostream>
#include <fstream>
#include <opencv2/opencv.hpp>
#include <opencv2/aruco.hpp>
void Calibrate(std::string work_dir, int n_images, double raw_scale) {
std::vector<std::vector<cv::Point3f>> obj_points;
std::vector<int> board_i... | TOOL | 0.861187 | 5.441978 |
4041a796-47d0-46c0-b7cf-b1337ced479c | Codernob/problem-solving-codes | code/bubble sort simulation.cpp | #include <iostream>
using namespace std;
void printArray(int a[],int size) {
for(int i=0;i<size;i++) printf("%d ",a[i]);
cout<<endl;
}
int main() {
int a[5]={5,4,3,2,1};
int i,j;
for(i=0;i<5;i++) {
for(j=0;j<5-1;j++) {
if(a[j]>a[j+1]) swap(a[j],a[j+1]);
printArray(a,5);
}
cout<<endl;
}
return 0;
} | ALGO | 0.999921 | 3.709986 |
faecc609-ca23-4219-8298-82fd35d6de79 | ShivanshKumarJha/Coding-Dump | CodingNinjas/OOPS/Polynomial.cpp | #include<bits/stdc++.h>
#include "Polynomial.h"
using namespace std;
Polynomial(){
degCoeff=new int[6];
size=5;
}
Polynomial(int k){
this->degCoeff=new int[k+1];
this->size=k;
}
Polynomial(Polynomial const &p){
int *aNew=new int[p.size+1];
for(int i=0;i<=p.size;i++){
aNew[i]=p.degCoeff[i];
}
this->degCoeff... | ALGO | 0.992886 | 3.444788 |
7fa8ce32-4231-4481-9bc9-4a1b01a1ba4c | Ultron011/DSA | ARRAYS/HARD/SUBARRAY XOR EQUALS K/OPTIMAL APPROACH/countSubarrays.cpp | /*
Problem Statement: Count Subarrays with XOR Equal to K
You are given an array of integers arr of size n and an integer k. Your task is to find the number of subarrays (contiguous segments of the array) whose XOR is equal to k.
Input:
n = 5
k = 4
arr = [4, 2, 2, 6, 4]
... | ALGO | 0.999989 | 6.135849 |
986ca233-e23c-44f8-b562-fd4083ecd4e9 | IDA-TUBS/lwW2RP | thirdparty/boost_1_73_0/libs/graph/example/simple_planarity_test.cpp | int main(int argc, char** argv)
{
// This program illustrates a simple use of boyer_myrvold_planar_embedding
// as a simple yes/no test for planarity.
using namespace boost;
typedef adjacency_list< vecS, vecS, undirectedS,
property< vertex_index_t, int > >
graph;
graph K_4(4);
... | ALGO | 0.967812 | 6.225184 |
1c9f7636-dab1-437d-af06-0934276f1692 | youbingchenyoubing/datastruct | sort/main_mergesort.cpp | #include "mergesort.h"
int main()
{
int data[10]={49,38,65,97,76,13,27,49,59,4};
mergesort mSort(data,10);
mSort.printNum();
return 0;
}
| ALGO | 0.999782 | 4.72537 |
755734fd-e357-43f4-be8e-e5f037e5031d | rajgupta93/100-Days-of-Code | 329-longest-increasing-path-in-a-matrix/329-longest-increasing-path-in-a-matrix.cpp | class Solution {
public:
int dp[201][201];
int longest(vector<vector<int>>& matrix, int r,int c,int prev){
if(r<0 || c<0 || r>= matrix.size() || c>=matrix[0].size() || prev>=matrix[r][c]){
return 0;
}
if(dp[r][c]!=-1)
return dp[r][c];
int ... | ALGO | 0.99998 | 5.712366 |
9e8800be-67f1-43b9-b796-5488f647db77 | ThomasLECAMPION/CoursMASTER-LICENCE | programmation/HAI719I_TP1/tp.cpp | // -------------------------------------------
// Disclaimer: this code is dirty in the
// meaning that there is no attention paid to
// proper class attribute access, memory
// management or optimisation of any kind. It
// is designed for quick-and-dirty testing
// purpose.
// -----------------------------------------... | TOOL | 0.859596 | 3.680558 |
f1f5d10a-331f-4f89-a28a-225cb6e83ed3 | sagaradgotra/Data-Structures | quell.cpp | # include<iostream>
# include "queueusingll.h"
using namespace std;
int main(){
queueusingll s;
s.enqueue(10);
s.enqueue(20);
s.enqueue(30);
s.enqueue(40);
s.dequeue();
cout<<s.size()<<endl;
cout<<s.front()<<endl;
return 0;
}
| TOOL | 0.973485 | 3.181768 |
2f86bdd7-687b-4ee4-952a-69c016d29213 | FelixHommel/DSA-2024-25 | p8/main.cpp | #include <climits>
#include <iostream>
#include <queue>
#include <vector>
static constexpr auto intInfinity{ INT_MAX };
void solve()
{
int n; // Amount of tree houses
int m; // Amount of bridges
std::cin >> n >> m;
/** Create the Graph as adjanceny list */
std::vector<std::vector<std::pair<int, i... | ALGO | 0.99936 | 6.088173 |
636f35de-6752-45e6-912f-3808341555c7 | cryptolordproject/LiteProject | src/qt/rpcconsole.cpp | #if defined(HAVE_CONFIG_H)
#include "config/bitcoin-config.h"
#endif
#include "rpcconsole.h"
#include "ui_debugwindow.h"
#include "bantablemodel.h"
#include "clientmodel.h"
#include "guiutil.h"
#include "platformstyle.h"
#include "chainparams.h"
#include "netbase.h"
#include "rpc/server.h"
#include "rpc/client.h"
#in... | TOOL | 0.962441 | 5.344193 |
e4237152-52ec-4123-be67-6527d6d05302 | umang537/Competitive-Programming | Code Snippets/Sieve_Of_Eratosthenes.cpp | #include <bits/stdc++.h>
using namespace std;
void sieve(int n)
{
bool prime[n + 1];
memset(prime, true, sizeof(prime));
for (int i = 2; i*i <= n; i++)
{
if (prime[i] == true)
{
for (int j = i * i; j <= n; j = j + i)
{
prime[j] = false;
... | ALGO | 0.999458 | 4.630884 |
b38da44c-05b0-4dce-8fb8-347472f1329d | cjm571/Mu-Man | lib/boost_1_55_0/libs/geometry/doc/index/src/examples/rtree/value_shared_ptr.cpp | //[rtree_value_shared_ptr
#include <boost/geometry.hpp>
#include <boost/geometry/geometries/point.hpp>
#include <boost/geometry/geometries/box.hpp>
#include <boost/geometry/index/rtree.hpp>
#include <cmath>
#include <vector>
#include <iostream>
#include <boost/foreach.hpp>
#include <boost/shared_ptr.hpp>
namespace ... | ALGO | 0.999356 | 6.170153 |
4b58c889-eff0-4bae-a003-655414ad2710 | Rahat-Khan-Pathan/YCPC-by-Phitron-1st-Round-Beginner-Level-Contest-1-solve | G.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int a,b;
cin>>a>>b;
if(a>b) cout<<"Argentina";
else if(b>a) cout<<"Brazil";
else
{
A:
string x,y;
cin>>x>>y;
int ans1=0,ans2=0;
for(int i=0;i<5;i++)
{
if(x[i]=='1') ans1++;
... | ALGO | 0.999923 | 5.066332 |
2282834d-38b6-471b-96df-79a62f6ef292 | goropikari/CompetitiveProgramming | atcoder/abc413/b.cpp | // https://atcoder.jp/contests/abc413/tasks/abc413_b
// 2025年07月05日 21時01分11秒
#include <bits/stdc++.h>
using namespace std;
// #include <atcoder/all>
// using namespace atcoder;
// using mint = modint998244353;
// using mint = modint1000000007;
// using vmint = vector<mint>;
// modint::set_mod(10);
// using mint = modi... | ALGO | 0.999971 | 5.5744 |
facf3896-572c-420d-ab70-15f8505fbad1 | shivamzaz/Revamping | solution_c.cpp | //header file for code
#include "bits/stdc++.h"
using namespace std;
int main(){
//for size of memory buffer of char type
char a[10000];
int a1=5,b=5,c,u=5,p,i,f;
float c1;
cout<<"Enter your name : ";
//input the bufer
scanf("%[^\n]%*c", a);
//scanf("%s",&(*a[i1++]));
cout<<"Enter th... | ALGO | 0.952307 | 3.267441 |
88cb8956-2491-479d-807c-fe8993090c92 | mdrion12/cps-academy-batch-4 | binary search/F_Factory_Machines.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
ios::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int a, b;
cin >> a >> b;
int arr[a];
for (int i = 0; i < a; i++)
{
cin >> arr[i];
}
auto ok = [&](ll mid)
{
ll total = 0... | ALGO | 0.999951 | 4.221798 |
bfc3ba00-f663-4da8-aa72-6793e4fb68c9 | acc-cosc-1337-fall-2021/acc-cosc-1337-fall-2021-jenniferrider | src/examples/12_recursion/01_recursion/recursion.cpp | #include "recursion.h"
#include<iostream>
//Write code for recursive display function
//Write code for recursive factorial
| ALGO | 0.999349 | 4.628895 |
b35cf082-b370-44ab-bd68-9c121896ef2e | bluespeck/aoc | aoc_2017/aoc_2017_07.cpp | #include <cstdint>
#include "outf.h"
#include <ranges>
#include <unordered_map>
#include <cassert>
struct program_t
{
std::string name;
int32_t weight;
std::vector<std::string> sub_progs;
};
using input_t = std::vector<program_t>;
input_t read()
{
input_t input;
while (std::cin)
{
prog... | ALGO | 0.989254 | 4.809357 |
e376679e-b3ed-4a00-8d3e-90d86c4c5a42 | f4t4nt/competitive-programming | archive/Kattis/pubnite.cpp | #include <algorithm>
#include <cmath>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iostream>
#include <iomanip>
#include <iterator>
#include <list>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <s... | ALGO | 0.999608 | 3.93645 |
db4a2b2c-34ef-4a4c-bade-2acc01ff9773 | Rosh-Cherian/air_quality1 | 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 |
29e05e08-5024-42ac-a404-a42eef83bfae | NaraaDev/CPP | 2A.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
map<string, int> a, b;
string e[20000];
int d[2000],m=0,n,i;
cin>>n;
for(i=1; i<=n; i++)
{
cin>>e[i]>>d[i];
a[e[i]]=a[e[i]]+d[i];
}
for(i=1; i<=n; i++) {
m=max(m, a[e[i]]);}
for(i=1; a[e[i]]<m || (b[e[i]]=b[e[i... | ALGO | 0.999884 | 3.445699 |
fe9bfd02-37c3-4f79-8258-01347fe96a85 | Mirageinvo/Algorithms_C_CPP | Расстояние Левенштейна.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
int main() {
string s1, s2;
cin >> s1 >> s2;
vector<vector<size_t>> dp(s1.size() + 1, vector<size_t>(s2.s... | ALGO | 0.999966 | 4.340864 |
fc4580cf-ed6a-4bce-969f-aaebe908adb7 | Jeffrin2005/Graph-Theory- | Find Closest Node to Given Two Nodes(BFS).cpp | class Solution {
public:
void bfs(int startNode, vector<int> adj[], vector<int>& dis, vector<bool>& visited) {
queue<int> q;
q.push(startNode);
visited[startNode] = 1;
dis[startNode] = 0;
while (!q.empty()) {
int curr = q.front();
q.pop();
... | ALGO | 0.999997 | 5.740974 |
0536da0b-2a65-477c-b487-b1ec0be48b7d | erroreyes/bluelab-plugins | BL-Plugins/BL-Rebalance/Attic/Attic2/Rebalance.cpp | #include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <vector>
#include <deque>
#include <fstream>
#include <string>
using namespace std;
#include <FftProcessObj14.h>
#include <GUIHelper9.h>
#include <SecureRestarter.h>
#include <Utils.h>
#include <Debug.h>
#include <PPMFile.h>
#include <TrialMode6.h>... | ALGO | 0.895082 | 4.414492 |
cd5b5377-eb6d-46e1-acc9-d5cd56ed01e8 | viraajp-ops/DSA | 0sum.cpp | #include<bits/stdc++.h>
using namespace std;
bool subArrayExists(int arr[],int n){
map<int,int>mapping;
int sum=0;
for(int i=0;i<n;i++){
sum+=arr[i];
if (sum==0)
return true;
if (mapping[sum]!=0)
return true;
mapping[sum]++;
}
return false;
}
int main(... | ALGO | 0.999929 | 4.27801 |
a2ad73e2-8c97-4b77-b5ff-2dbeabc10373 | ivan0703/leetcode_dp | 647. Palindromic Substrings/main.cpp | #include <iostream>
#include <string>
using namespace std;
class Solution {
public:
int countSubstrings(string s) {
return 0;
}
};
int main()
{
return 0;
} | ALGO | 0.995331 | 4.370082 |
b9504427-743d-4872-b43f-5768e6677bf3 | sarvex/leetcode-lua | lcof2/剑指 Offer II 044. 二叉树每层的最大值/Solution.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.999971 | 6.474546 |
879c7e65-4d09-478a-9060-4fe5145bf0c0 | sidharthcodes/OS_LAB | Code/Experiment4.cpp | #include <bits/stdc++.h>
using namespace std;
int disk_size = 300;
void FCFS(int arr[], int head, int size){
cout<<"Queue: ";
for(int i=0; i<size; i++) cout<<arr[i]<<"-> ";
cout<<"\n";
int seek_count = 0;
int distance, cur_track;
cout<<"Seek Operations: ";
for (int i=0; i<size; i++){
... | ALGO | 0.99924 | 4.003583 |
06cf5d61-9e76-4e9b-8cd9-c50499d20057 | Sxincode/DAA-codes | DAA NEW CODES/20.cpp | /* Week 10 : Q->2*/
// Given a long list of tasks. Each task takes specific time to accomplish it and each task has a
// deadline associated with it. You have to design an algorithm and implement it using a program to
// find maximum number of tasks that can be completed without crossing their deadlines and also
// fi... | ALGO | 0.999993 | 3.790157 |
048bfccc-66a1-439a-b28c-845fac6c9f42 | ynan1/Project1 | Project1/x64/39 Exercises/39.4_1 Find an element and delete, etc.cpp | // Write a program that searches for a vector element using the std::find() algorithm function.
// If the element has been found, delete it. Print out the vector content. Vectors are non indexed.
#include <iostream>
#include <vector>
#include <algorithm>
int main()
{
std::vector<int> v = { 10, 5, 8, 4, 1, 2 };
int f... | ALGO | 0.998546 | 6.193449 |
ee11cf5e-c412-48bc-a296-4821d4399966 | mooleetzi/ICPC | contest/burnside_polya/D.cpp | /*
二元组(i,j)表示循环节个数,循环个数,组合数学里叫K不动置换类和等价类
不变置换:1*(1,12)
面心+90:3*(4,3)
面心-90:3*(4,3)
面心180:3*(2,6)
对棱180:6*[(2,5)+(1,2)]
体心120:4*(3,4)
体心240:4*(3,4)
*/
#include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#inclu... | ALGO | 0.999937 | 4.717626 |
31a901fe-7822-4b15-9c86-251b1d7b16e3 | prajjwal1999/C-CODES | dutch_algo.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin>>n;
int a[n];
for(int i=0;i<n;i++)
{
cin>>a[i];
}
int lo, hi, mid;
lo=0;
mid=0;
hi=n-1;
while(mid<=hi){
if(a[mid]==1){
mid++;
}
else if(a[mid]==2)
{
... | ALGO | 0.999985 | 3.567469 |
65ba7311-877e-4822-818f-626c990910c4 | remyvnkhiemtruong/codeforces-submissions | codeforces/711/B.cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long
#define endl "\n"
void INI_ERR(){
cout << -1;
exit(0);
}
signed main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
int n, x, y;
cin >> n;
int a[n][n], r[n], c[n];
int d1 = 0, d2 = 0, sumr = -1, sumc = -1;
int difr, difc, e... | ALGO | 0.999968 | 3.702244 |
129342e5-fab5-4ed6-b030-c0a6fbd12313 | MacTechIN/opencv | modules/imgcodecs/src/loadsave.cpp | //
// Loading and saving images.
//
#include "precomp.hpp"
#include "grfmts.hpp"
#include "utils.hpp"
#include "exif.hpp"
#undef min
#undef max
#include <iostream>
#include <fstream>
#include <cerrno>
#include <opencv2/core/utils/logger.hpp>
#include <opencv2/core/utils/configuration.private.hpp>
#include <opencv2/im... | TOOL | 0.967656 | 6.35694 |
0270df31-973d-4ce1-835e-750a5cc2e06a | Pulkith/Competitive | OI/Spain/25/final/a-d1.cpp | /**
* author: DespicableMonkey
* created: 08.06.2021 11:28:09
* Potatoes FTW!
**/
#include<bits/stdc++.h>
#if LOCAL
#include <DespicableMonkey/Execution_Time.h>
#include <DespicableMonkey/Debug.h>
#define debug_active 1
#endif
using namespace std;
#define pb push_back
#define f first
#define s secon... | ALGO | 0.99945 | 3.387929 |
a7a1edba-e701-4c79-a53a-7bc819c47388 | malony0/sudoku-solver | src/Solver.cpp | #include "Solver.h"
#include "Block.h"
#include "Column.h"
#include "Row.h"
#include "Cell.h"
#include <cassert>
#include <string>
#include <iostream>
namespace
{
const int MAX_X = 9;
const int MAX_Y = 9;
const std::string H_BAR = "+-----+-----+-----+";
}
Solver::Solver(std::vector<int> nums):
mCel... | ALGO | 0.997296 | 5.351286 |
d9acff3e-efeb-45d5-8b4c-11a1f0234431 | mdtahsinamin/leetcode-solutions | 1470-shuffle-the-array/1470-shuffle-the-array.cpp | class Solution {
public:
vector<int> shuffle(vector<int>& nums, int n) {
vector<int> ans;
for (int i = 0; i < n; i++) {
ans.push_back(nums[i]);
ans.push_back(nums[n + i]);
}
return ans;
}
}; | ALGO | 0.999974 | 6.503071 |
26c84ced-d5cc-4581-b803-a54fb9d7a4ab | Piyusha1210/DSA-Learning | 14 Dynamic Programming/8 DP on NumberBreak/3_UglyNumbers.cpp | #include <bits/stdc++.h>
using namespace std;
// https://leetcode.com/problems/ugly-number-ii/description/?envType=study-plan&id=dynamic-programming-i
class Solution
{
public:
int nthUglyNumber(int n)
{
int uglyNumbers[n];
uglyNumbers[0] = 1;
int i2 = 0, i3 = 0, i5 = 0;
int nex... | ALGO | 0.999952 | 5.7119 |
d51d56f7-b27d-474d-ae39-9db1e61d1f97 | DyhaCreator/programming_tasks | CodeForcesRound/922/c2.cpp | #include <iostream>
#define ll long long
#define ull unsigned long long
using namespace std;
int main() {
int t;
cin >> t;
for (int i = 0; i < t; i++) {
ll a, b, r;
cin >> a >> b >> r;
ll ans = abs(a - b);
ll cash = 1;
ll mycash = 0;
for (int i = 0; i < 63; i... | ALGO | 0.999669 | 3.2515 |
b44c1b21-8c7e-42cd-a762-2d0a90bcf097 | plumzero/memo-algo | 09_string/check_anagram.cpp |
// s14 字符串中的变位词
// 问题:
// 输入字符串 s1 和 s2,如何判断字符吕 s2 中是否包含字符串 s1 的某个变位词?
// 什么是变位词?
// "a"、"ac"、"acf"、"caf" 等都是 "dgcaf" 的变位词,但 "da"、"dga" 却不是。
// 也就是说,如果字符串 s2 中包含字符串 s1 的某个变位词,则字符串 s1 至少有一个变位词是字符串 s2 的子字符串。
// 本题中,假设两个字符串中只包含英文小写字母。
// 例如,字符串 s1 为 "ac", 字符串 s2 为 "dgcaf",由于字符串 s2 中包含字符
// 串 s1 的变位词 "ca",因此输出为 true。如... | ALGO | 0.99955 | 5.744656 |
d5e2f07f-1953-411e-a70d-2c39468078e0 | saifakib/LeetCodePractice | 2236-maximum-twin-sum-of-a-linked-list/2236-maximum-twin-sum-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) {}
* };
*/
// TC: 0(N)
// SC: 0(1)
class Solution {
private: ... | ALGO | 0.99999 | 5.860137 |
2b4e6f92-e48f-4639-89e3-37dbf7110c33 | cy0713/SMeta | boost/libs/exception/src/clone_current_exception_non_intrusive.cpp | //This MSVC-specific cpp file implements non-intrusive cloning of exception objects.
//Based on an exception_ptr implementation by Anthony Williams.
#ifdef BOOST_NO_EXCEPTIONS
#error This file requires exception handling to be enabled.
#endif
#include <boost/config.hpp>
#include <boost/exception/detail/clone_current_... | TOOL | 0.894913 | 6.449594 |
e59993b1-7e22-4e5c-9e6c-bf7e5b9c98ea | Marupio/mdn-research | library/Mdn2dIO.cpp | #include "Mdn2dIO.hpp"
#include <algorithm>
#include <cctype>
#include <cstring>
#include <limits>
#include <sstream>
#include "Coord.hpp"
#include "Logger.hpp"
#include "Mdn2dConfig.hpp"
#include "Tools.hpp"
namespace {
// Forward declaration so helpers can use toU32
static std::u32string toU32(const std::string& ... | TOOL | 0.970825 | 7.069422 |
59770a3d-6f66-4c3d-95d6-8a4324f248e4 | ishandutta2007/codeforces | cjy2003/normal/685/C.cpp | #include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
const long long inf=0x7fffffffffffffff;
int T,n;
long long x[100010],y[100010],z[100010],X,Y,Z;
bool check0(long long suml,long long sumr,long long al,long long ar,long long bl,long long br,long long cl,long long cr)
{
if(suml&1)++suml;if(sumr... | ALGO | 0.999926 | 3.85881 |
f542dfef-d841-4d5a-9661-e71dd41f4875 | devanathandna/CodeForces | wordcap.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
string s;
cin >> s;
char a = toupper(s[0]);
s[0] = a;
cout << s;
return 0;
} | ALGO | 0.99634 | 3.567413 |
5ec4484f-b869-4774-9ae4-455cb937b995 | luckyking5215/c-code-1 | 6.07.cpp | #include <iostream>
using namespace std;
int main(){
int x;
cout << "Enter the Starting number : " ;
cin >> x;
while(x>0){
cout << x << endl;
--x;
}
return 0;
}
| ALGO | 0.995668 | 3.298966 |
71d1529d-55f8-4198-bc4b-4d598e457066 | NahinIntesher/DSA | DSA 2 LAB/Lab 03_Divide And Conquer/minMax.cpp | #include<iostream>
#include<vector>
using namespace std;
pair<float, float> minMax(vector<float> A, int start, int end){
if(start == end){
return {A[start], A[end]};
}
int mid = (start + end) / 2;
pair<float, float> right = minMax(A, start, mid);
pair<float, float> left = minMax(A, mid+1, ... | ALGO | 0.999811 | 4.565158 |
43883a67-8c42-4b0a-a14d-df81e6bf2505 | PrakharUniyal/CompiArchives | 614/GG.cpp | #include <bits/stdc++.h>
using namespace std;
#define test(t) int t;cin>>t; while(t--)
#define num(n) long long n; cin>>n
#define str(s) string s; cin>>s
#define arr(a,n) vector<long long> a(n); for(long long i=0;i<n;i++) {cin>>a[i];}
#define aout(a,i) for(int i=0;i<a.size();i++){cout<<a[i]<<" ";}cout<<endl
#define loo... | ALGO | 0.999246 | 3.572135 |
6b934716-5ada-44c9-9941-177c2f7c6e5d | DevJSter/dsa | Interview_DS_Algo/Arrays/Monotonic Array.cpp | /*
MY YOUTUBE VIDEO ON THIS Qn : https://www.youtube.com/watch?v=LfYSyPP6YOA
Company Tags : META (3 Times)
Leetcode Link : https://leetcode.com/problems/monotonic-array/
*/
/*************************** C++ ***************************/
class Solution {
public:
bool isM... | ALGO | 0.999783 | 6.273055 |
2936b284-0daf-4ecf-bb17-aee07ce76dea | Shahnazi2002/Cpp-Examples | 09/trim.cpp | #include <iostream>
#include <string>
using namespace std;
string trim(string input_string, int max_length) {
string output_string;
if (input_string.length() <= max_length) {
output_string = input_string;
} else {
for (int c; c<max_length; c++) {
output_string = output_string +... | TOOL | 0.986468 | 5.706725 |
61198307-dd15-41cd-b70a-666a5545b3e5 | nmatlakhov/Intro-to-Algorithms | Sprint_1/Review_Sent/2022-11-15/Final_Task_2.cpp | /* https://contest.yandex.ru/contest/22450/run-report/74888032/ */
#include<iostream>
#include<string>
#include<vector>
using namespace std;
int PossiblePayoff(const vector<int>& matrix, int total_key) {
int payoff = 0;
int m_size = matrix.size();
for (int k = 0; k < m_size; k++) {
if ((matrix[k] <= total_key) &... | ALGO | 0.996816 | 4.273344 |
69af16d7-f920-4686-9538-1584532dfa04 | aboeuf/AdventOfCode | 2017/puzzle_2017_05.cpp | #include <2017/puzzle_2017_05.h>
#include <common.h>
namespace puzzle_2017_05 {
class Instructions {
public:
Instructions(const QString &input)
: m_intructions{common::toInt(input, '\n')} {}
QString solve(bool v2) const {
auto copy = m_intructions;
auto current = 0;
auto nb_steps = 0u;
whil... | ALGO | 0.999322 | 6.321906 |
c0d23495-0029-43e4-a000-6336ac37a025 | GauravKesh/Data_Structures_and_Algorithm | easy_questions/Power_Of_Four.cpp | //
// Created by Gaurav Kesh Roushan on 27/10/24.
//
#include <iostream>
using namespace std;
class Solution {
private:
static int isPower(int n){
if(n==1){
return 1;
}
if (n < 1 || n % 4 != 0) {
return 0;
}
return isPower(n/4);
}
public:
static bool isPowerOfFour(int n) {
if(n<=0){
return fa... | ALGO | 0.999206 | 5.480207 |
e548cb3c-a1b4-4929-ac05-7b3377c5b29b | alifrommars/Introduction-to-programming | Sem_03/Solutions/Task05.cpp | #include <iostream>
using namespace std;
int main()
{
int sum = 0;
int number;
do
{
cin >> number;
sum += number;
} while (number);
cout << sum;
}
| ALGO | 0.997338 | 3.77123 |
786a17a3-8254-4b93-b9c3-9c54eca30827 | GustavoPolicarpo/maratona | URI/MATHEMATICS/2135 - Retrieval.cpp | // Author: Gustavo Policarpo
// Name: Retrieval
// Level: 5
// Category: MATHEMATICS
// URL: https://www.beecrowd.com.br/judge/en/problems/view/2135
#include<bits/stdc++.h>
//LIFE IS NOT A PROBLEM TO BE SOLVED
using namespace std;
#define rep(i,a,b) for(int i = int(a); i < int(b) ; i++)
#define reo(i,a,b) for(in... | ALGO | 0.999728 | 4.078635 |
a7a93a28-6019-4e47-a8b6-625c88317090 | AhmedEsraf/my_codeforces_submissions | Running_contest/in _C++/A.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(NULL);
int r,b,rm,bm;
cin >> r >> b >> rm >> bm;
if (r*rm > b*bm) cout << r*rm << endl;
else cout << b*bm << endl;
return 0;
} | ALGO | 0.997367 | 3.623347 |
200fb956-123e-4748-bb7d-80523c0cddf3 | lineagech/GMT | include/freestanding/libcxx/test/std/utilities/function.objects/func.search/func.search.default/default.pred.pass.cpp | // <functional>
// UNSUPPORTED: c++98, c++03, c++11, c++14
// default searcher
// template<class _ForwardIterator, class _BinaryPredicate = equal_to<>>
// class default_searcher {
// public:
// default_searcher(_ForwardIterator __f, _ForwardIterator __l,
// _BinaryPredicate __p = _Bina... | TEST | 0.909153 | 6.626993 |
eaa0eabc-4844-4cbe-a237-4860627ef3cc | matumoto1234/cp-crawler | AtCoder/abc138/abc138_d/12240177.cpp | // detail: https://atcoder.jp/contests/abc138/submissions/12240177
#include<stdio.h>
#include<algorithm>
#include<iostream>
#include<vector>
using namespace std;
typedef struct{
int a,b;
}strKi;
typedef struct node{
int num;
node* oya;
node* ko;
}strKi2;
bool asc(const strKi& left,const strKi& right)... | ALGO | 0.999733 | 3.898658 |
58048580-f641-45a0-bc06-3008e0e2d147 | Altu-Bitu/Altu-Bitu-Chaerin | 9월 7일 - 맵과 셋/10757.cpp | //
// Created by 김채린 on 2021/09/13.
//
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main() {
string a, b, result;
cin >> a >> b;
reverse(a.begin(), a.end());
reverse(b.begin(), b.end());
if (a.length() < b.length()) {
swap(a, b);
}
int tm... | ALGO | 0.999993 | 5.379668 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.