uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
3ba780bd-809d-49e7-ae4c-b707724f04de | pankajbhatt150/LeetCode-Question-DSA-14-days- | Minimum sum partition - GFG/minimum-sum-partition.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution{
public:
int minDifference(int arr[], int n) {
int sum=0;
for(int i=0;i<n;i++)sum+=arr[i];
vector<int>dp(sum/2+1,0);
vector<int>v(sum/2+1,0);
dp[0]=1;
int ans=sum;
for(int ... | ALGO | 0.999606 | 5.770588 |
21aa4f9a-1078-4e3b-aa7e-4b95be2b7409 | simone-tugnetti/C | C++/ProgettoOrdinamentoMatrici.cpp | #include <iostream>
using namespace std;
const int lvet=10;
int n,m,max[lvet],matrice[lvet][lvet],tmp,i,j;
void carica(){
cout<<"Ora la matrice verra' caricata in modo casuale!!!"<<endl;
for(i=0;i<n;i++){
for(j=0;j<m;j++){
matrice[i][j]=rand()%100+1;
}
}
}
void valmaxrigaeord(){
cout<<"Ora inizia la procedur... | ALGO | 0.998931 | 3.629696 |
ebfb5f9a-9648-40c1-935c-49fc102df7ff | ishandutta2007/codeforces | 77o/normal/142/B.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
// freopen("input.txt", "r", stdin);
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int n, m;
cin >> n >> m;
if (n > m) {
swap(n, m);
}
int ans = (n * m + 1) / 2;
if (n == 1) {
ans = max(ans, n * m);
}
if (n == 2)... | ALGO | 0.999869 | 3.904021 |
34c95ea5-a214-452c-819d-9f037b9ee54e | LilianFanilo/IMAC-E3-Prog-Algo-TDs | src/td05_ex05.cpp | #include <iostream>
#include <array>
#include <string>
char to_lower(char const c)
{
if(c >= 'A' && c <= 'Z')
{
return c - 'A' + 'a';
}
else
{
return c ;
}
}
bool is_alpha(char const c)
{
return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}
std::array<int, 26> count_... | TOOL | 0.95449 | 5.105634 |
7f2139f1-e699-452e-938e-f398b5e61858 | CrossProbe2024/CrossProbe | data/pytorch-2.4.0/torch/csrc/jit/codegen/fuser/cpu/fused_kernel.cpp | #include <torch/csrc/jit/codegen/fuser/cpu/fused_kernel.h>
#include <ATen/DynamicLibrary.h>
#include <ATen/code_template.h>
#include <c10/util/Exception.h>
#include <c10/util/Optional.h>
#include <torch/csrc/jit/codegen/fuser/compiler.h>
#include <torch/csrc/jit/codegen/fuser/cpu/temp_file.h>
#include <cstdlib>
#incl... | TOOL | 0.856133 | 6.090818 |
299da7dd-8066-41fe-85b0-6c427dcbf7f3 | hRJ06/DSA | GFG/Course Schedule.cpp | class Solution {
public:
vector<int> findOrder(int n, int m, vector<vector<int>>& prerequisites) {
vector<int> indegree(n, 0);
vector<vector<int>> adj(n);
for(auto &i : prerequisites) {
indegree[i[0]]++;
adj[i[1]].push_back(i[0]);
}
queue<int> q;
... | ALGO | 0.999998 | 6.28105 |
cee2f74b-6b71-40c0-b3fd-a5db435e0c62 | n0IQ/Competitive-Programming | codeforces/1779/C.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
void solve()
{
int n, m;
cin >> n >> m;
m--;
vector<ll> a(n), pref(n, 0);
for (auto &x : a) cin >> x;
for (int i = 0; i < n; i++) {
pref[i] = a[i];
if (i > 0) pref[i] += pref[i - 1];
}
ll ans = 0, curr = pref[m];
priority_queue<ll> max... | ALGO | 0.999925 | 4.518669 |
d23c8e6d-6343-4d96-be91-e7d6b1f91aee | pronajitdey/Cpp-Programming | Apna College/03. Conversions/dec_to_hex.cpp | #include <bits/stdc++.h>
using namespace std;
string DecimalToHexadecimal(int n);
int main() {
int dec;
cin >> dec;
cout << dec << " decimal = " << DecimalToHexadecimal(dec) << " hexadecimal\n";
return 0;
}
string DecimalToHexadecimal(int n) {
string ans = "";
int x = 1;
while (x <= n) {
x *= 16... | ALGO | 0.998103 | 5.799893 |
400e532d-8bcf-4110-a9cd-1c2462e37d22 | Fernando-Mauro/zig-zag-code | Nivel Basico/porquepodemosProgramar.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
float x;
cin >> x;
float resultado = ((x + pow(x,2)) / ((5 * x) + 3));
float y = (resultado + x) * (resultado / (resultado + (2 * x)));
cout << y;
return 0;
} | ALGO | 0.999688 | 3.335193 |
c533a6fa-9ded-4bc2-bc66-757ed90f7597 | R-Shailesh-varma/code-contributions | add-binary.cpp | class Solution {
public:
string addBinary(string a, string b) {
string c= "";
int carry = 0;
while(a.length()> 0 || b.length() > 0 || carry != 0){
int sum = carry;
if(a.length()>0){
sum += (a.back() - '0');
a.pop_back();
}if... | ALGO | 0.999948 | 6.428562 |
768846b1-85fa-45f3-996d-970fe7dc4ccd | E3SM-Project/E3SM | components/homme/utils/trilinos/block_precon_interface.cpp | // ---------- Includes ----------
#include <iostream>
#include "Epetra_CrsMatrix.h"
#include "block_precon_interface.hpp"
#include "Epetra_Map.h"
#include "Epetra_Operator.h"
#include "EpetraExt_RowMatrixOut.h"
#include "Epetra_Vector.h"
#include "Epetra_Import.h"
#include "Epetra_Comm.h"
//----------------------... | ALGO | 0.966979 | 5.869378 |
4b3fc8a6-b842-4af0-ac9b-0e8a65c4ea09 | grking8/project-euler | problem73/main.cpp | #include <iostream>
#include <cmath>
#include "integer_arithmetic.h"
/**
* Problem 73
*/
int main() {
int n = 12000;
int sum = 0;
for (int i = 2; i <= n; i++) {
int lowerBound = (int)ceil((float)i / (float)3);
int upperBound = (int)floor((float)i / (float)2);
for (int j = lowerBound; j <= upperBound; j++) {... | ALGO | 0.999704 | 4.770946 |
ae4540bb-fe5c-4355-af0b-91531b8da092 | CharlesSinchigalo/blog_app | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.9988 | 6.76073 |
edeac831-96fd-422e-b9d9-d9f4be56169c | cu-sanjay/Competitive-Programming | Unstop/Target Sum.cpp | #include <bits/stdc++.h>
using namespace std;
int findTargetSumWays(vector<int>& nums, int S) {
unordered_map<int,int> cur({{0,1}}), nxt, *p_cur=&cur, *p_nxt=&nxt;
for(int i = 0; i < nums.size(); i++) {
for(auto &p : *p_cur) {
(*p_nxt)[p.first+nums[i]] += p.second;
(*p_nxt)[p... | ALGO | 0.999974 | 5.714783 |
be0e7680-00cf-4ad5-9e71-89cc56a58d3e | OussamaGhribi/Problem-Solving | Leetcode/1123. Lowest Common Ancestor of Deepest Leaves.cpp | class Solution {
public:
TreeNode* lcaDeepestLeaves(TreeNode* root) {
return dfs(root).second;
}
// Helper function that returns a pair of (depth, lca node)
pair<int, TreeNode*> dfs(TreeNode* root) {
if (!root)
return {0, nullptr};
auto left = dfs(root->left);
... | ALGO | 0.999971 | 7.053265 |
d5e8c625-dd92-4fce-8e60-6a139747e37a | GulkoBogdan/24main | Source.cpp | #include <iostream>
#include <math.h>
using namespace std;
int main()
{
//1
double a1, b1;
cout << "input a, b: ";
cin >> a1 >> b1;
cout << "S: " << a1 * b1 / 2; cout<< endl;
cout << "G: " << sqrt(a1 * a1 + b1 * b1); cout << endl;
//2
double a2;
double b2;
double c2;
cout << "Input number" << endl;
cin >... | ALGO | 0.959286 | 3.001466 |
b02adf6b-6fa2-4839-a7b2-a05654fafe73 | opensource-hisense/SmartTV-SeriesVidaaU7_NT | oss/part1/cobalt/third_party/llvm-project/compiler-rt/lib/fuzzer/FuzzerSHA1.cpp | #include "FuzzerSHA1.h"
#include "FuzzerDefs.h"
/* This code is public-domain - it is based on libcrypt
* placed in the public domain by Wei Dai and other contributors.
*/
#include <iomanip>
#include <sstream>
#include <stdint.h>
#include <string.h>
namespace { // Added for LibFuzzer
#ifdef __BIG_ENDIAN__
# defi... | ALGO | 0.853829 | 7.45007 |
a8e78c4e-5632-441c-9bd6-38f5f6d5bb2e | Liaoyork/School_Server | 111-2/lab5/5-1/5-1_finish.cpp | #include <cmath>
#include <iostream>
#include <string>
using namespace std;
class CComplex {
private:
double real;
double imag;
string operators;
class Pol;
friend class Pol;
friend istream& operator>>(istream&, CComplex&);
friend ostream& operator<<(ostream&, CComplex&);
class Pol {
... | ALGO | 0.99926 | 4.145642 |
9f4fb2b6-9923-43f2-8ac5-473015a8e863 | HernanMzM/3erparcial | prog5.cpp | #include <iostream>
using namespace std;
int main()
{
char c;
cout<<"introduzca una letra\n";
cin>>c;
if (c=='a' || c=='e'||c=='i'||c=='o'||c=='u'){
cout<<c<<" es una vocal";
}
} | TOOL | 0.942513 | 3.109011 |
5cce8694-72cb-4c1f-94b0-c6671a9658d0 | miggule2/infinite-coding-hell | tttyoung/c++/cpp_hw1.cpp | #include <iostream>
#include <string>
using namespace std;
class cseMAP {
private:
int map[3][3];
int _initialPlace;
int _pathValue;
// Declare additional member variables if you need them
public:
cseMAP() { }
cseMAP(int initialPlace) {
_initialPlace = initialPlace;
}
void findPathValue(string path) {
... | ALGO | 0.998463 | 3.940372 |
2a24565b-fd70-4895-87e2-eec853875130 | yashjain072/Campus-Coding | power.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int num;
cin>>num;
if(num<0)
{
cout<<"Wrong";
return 0;
}
int len=0;
int temp=num;
while(temp!=0)
{
len++;
temp/=10;
}
long long int ans = num*num*num*num;
int lastdigits=0;int power... | ALGO | 0.999878 | 3.431539 |
1c82c74a-850e-4e0b-9a37-7f20393c254a | JoseMartinNogueira/TDDD56-Multicore-and-GPU-Programming | lab3/support.cpp | #include <cmath>
#include "support.h"
// Reads a file from png and retuns it as a skepu::Matrix. Uses a library called LodePNG.
// Also returns information about the image as an out variable in imageInformation.
skepu2::Matrix<unsigned char> ReadPngFileToMatrix(std::string filePath, LodePNGColorType colorType, ImageI... | TOOL | 0.955714 | 5.702364 |
de4ea847-9803-4f5f-9944-8da64148341c | ishandutta2007/codeforces | _runtimeterror_/normal/632/D.cpp | #include<bits/stdc++.h>
using namespace std ;
#define ll long long
#define pb push_back
#define mem0(a) memset(a,0,sizeof(a))
#define mem1(a) memset(a,-1,sizeof(a))
#define memf(a) memset(a,false,sizeof(a))
#define all(v) v.begin(),v.end()
#define sz(a) (ll)a.size()
#define F first
#define S second
#define INF 200000... | ALGO | 0.99995 | 3.534892 |
9d92941b-27af-458e-bed6-c64935507726 | zain-ijaz/c-code | inser at nth location.cpp | #include<iostream>
#include<conio.h>
using namespace std;
struct node
{
int info;
struct node *next;
};
int main()
{
int count=0;
struct node *head;
struct node *second;
struct node *third;
struct node *forth;
struct node *fifth;
head = new(struct node);
second = new(struct node)... | ALGO | 0.996614 | 3.155134 |
00d81d8f-e1be-45b2-97a7-ec4c8782e411 | TaifoorFarid/C-2nd_Semester | Arrays/2D Array/addition_subtraction_of_array_UNIVERSAL.cpp | #include<stdio.h>
#define SIZE 10
void answer_add(int a[][SIZE], int b[][SIZE], int r[][SIZE], int row, int col);
void answer_sub(int a[][SIZE], int b[][SIZE], int r[][SIZE], int row, int col);
void store(int a[][SIZE], int row, int col);
main()
{
int row, col;
int choice;
printf("What you want:");
printf("\n1. Add... | ALGO | 0.995701 | 3.519973 |
236bead0-3721-4f5d-8851-79adfe960f73 | btridenbaugh/2019---Wright-State-Data-Stuctures-Cpp-Files | Assignment3/BinarySearchTree.cpp | //CIS 3100 - Data Structures and Algorithms
//Meilin Liu
//Benjamin Ridenbaugh
//<EMAIL>
//07/21/19
//Project #3
#include <cstdlib>
#include <iostream>
#include <string>
#include <fstream>
#include "BinarySearchTree.h"
#include "BinaryTreeNode.h"
#include "Employee.h"
using namespace std;
BinarySearchTree::BinarySear... | ALGO | 0.989135 | 3.856594 |
0627e9ec-5b47-480f-b887-9f6d5aa5b559 | vfolunin/archives-solutions | UVa Online Judge/11420.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <string>
using namespace std;
bool solve() {
int n, m;
cin >> n >> m;
if (n < 0 && m < 0)
return 0;
if (m > n) {
cout << "0\n";
return 1;
}
vector<vector<vector<long long... | ALGO | 0.99998 | 4.161785 |
a413da3d-9e39-4058-a934-27d44fe40579 | Sandstorm-Walker/MaNGOSZero | dep/tbb/src/old/concurrent_queue_v2.cpp | #include "concurrent_queue_v2.h"
#include "tbb/cache_aligned_allocator.h"
#include "tbb/spin_mutex.h"
#include "tbb/atomic.h"
#include <cstring>
#include <stdio.h>
#if defined(_MSC_VER) && defined(_Wp64)
// Workaround for overzealous compiler warnings in /Wp64 mode
#pragma warning (disable: 4267)
#endif
#defi... | TOOL | 0.921678 | 6.635265 |
3b2fb466-f840-4336-9b3f-948bbd6b8912 | StokerBR/TAP2 | Listas/Treino 5/3_URI-1582_TeoremaPitagoras.cpp | #include <bits/stdc++.h>
using namespace std;
int mdc(int x, int y, int z) {
int resto = 1;
while (resto) {
resto = x % y;
x = y;
y = resto;
}
resto = 1;
while (resto) {
resto = x % z;
x = z;
z = resto;
}
return x;
}
int main() {
... | ALGO | 0.99962 | 4.625207 |
7e29f76e-a7d9-4dbf-82e2-07d45031ac98 | Yatharth007Pathak/Cpp-tutorials | jt.cpp | #include <iostream>
using namespace std;
int main() {
string s = "1234567";
int x = stoi(s);
cout << x;
cout << endl;
x = x + 1;
cout << x;
return 0;
}
// The stoi function is a standard library function that converts a string to an integer.
/*
Explanation
String to Integer Conversi... | TOOL | 0.972421 | 4.49809 |
a9031915-509e-487b-b42c-d278895eb454 | soybean33/BAEKJOON | 17144 미세먼지 안녕!.cpp | #include <iostream>
struct Coordinate { // 좌표
int y, x;
};
int R, C, T; // R: 방의 세로 크기, C: 방의 가로 크기, T: 시간
int room[51][51]; // room[i][j]: i행 j열의 정보
Coordinate airCleaner; // airCleaner: 공기 청정기의 위치 -> 아래쪽 좌표 저장
int ans; // ans: 남아있는 미세먼지의 양
// 방향 벡터
int dirY[] = { 0,1,0,-1 };
int dirX[] = { 1,0,-1,0 };
void sol()... | ALGO | 0.999546 | 4.49431 |
9e4839a4-a63a-4969-b6e8-faeaa2e77f84 | pazhanivel07/frameworks_av-10-r33_CVE-2020-0242 | media/libstagefright/codecs/amrwb/src/dec_gain2_amr_wb.cpp | /*
------------------------------------------------------------------------------
Filename: dec_gain2_amr_wb.cpp
Date: 05/08/2004
------------------------------------------------------------------------------
REVISION HISTORY
Description:
--------------------------------------------------------------------... | ALGO | 0.999274 | 4.735946 |
9f19d543-09da-4ddd-aa9e-7d0eb3f49ef1 | niangu/Qt-C- | union/intsllist.cpp | #include<iostream>
#include"intsllist.h"
IntSLList::~IntSLList(){
for(IntSLLNode *p; !isEmpty();)
{
p = head->next;
delete head;
head = p;
}
}
void IntSLList::addToHead(int el){
head = new IntSLLNode(el, head);
if(tail==0)
tail = head;
}
void IntSLList::addToTail(int... | ALGO | 0.981353 | 3.869724 |
210698d5-e758-470f-9d57-952703be4b52 | Dark-Basic-Software-Limited/GameGuruConverter | GameGuru Core/Dark Basic Public Shared/Dark Basic Pro SDK/Shared/Objects/ElipsoidCollision/Collision.cpp | //
// Collision Functions Implementation
//
// Includes
#include "collision.h"
#include "..\\CommonC.h"
// Global Collision Data
float *pool = NULL; // Triangle buffer holding vertices
CollisionTrace *trace; // Holds the collision information
// Functions
void Collision::Init ( void )
{
// prepare collision flags... | TOOL | 0.980609 | 4.52247 |
6182a8dd-2527-45bb-950f-db2fef660306 | Himanshu2126/Placement-Preparation-Module | 0039-combination-sum/0039-combination-sum.cpp | class Solution {
public:
void Comb(int ind,vector<int>&sum, vector<vector<int>>&ans,vector<int>& candidates, int target ,int n) {
if(ind==candidates.size() )
{
if(target==0){
ans.push_back(sum);
}
return;
}
if(candidates[ind]<=target)
... | ALGO | 0.999965 | 6.48827 |
b9666be7-861d-47b2-bc01-16a6c183ab72 | dabralhd/algo_design | cpp/dsa_in_cpp_mark-allen-weiss_3rd-ed/CodeUnix/KdTree.cpp | #include <iostream>
#include <vector>
using namespace std;
/**
* Quick illustration of a two-dimensional tree.
* No abstraction here.
*/
template <typename Comparable>
class KdTree
{
public:
KdTree( ) : root( NULL ) { }
void insert( const vector<Comparable> & x )
{
insert( x, root, 0 );
}... | ALGO | 0.999468 | 6.139889 |
f9442997-1538-4b3d-86f9-f7f93b2cc41f | ishandutta2007/codeforces | avinashkartik/normal/1702/A.cpp | #include<bits/stdc++.h>
using namespace std;
#define GODSPEED ios:: sync_with_stdio(0);cin.tie(0);cout.tie(0);cout<<fixed;cout<<setprecision(15);
#define f first
#define s second
#define newl cout<<"\n";
#define pb push_back
#define mset(a,x) memset(a,x... | ALGO | 0.999639 | 3.997268 |
16ed92c7-9f15-4eaa-9735-149f6ef2debe | RuiMitchellDaSilva/OldProjects | Gataringan/Main/NewGLUT/glm/test/gtx/gtx_simd_mat4.cpp | #define GLM_FORCE_RADIANS
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtc/quaternion.hpp>
#include <glm/gtc/random.hpp>
#include <glm/gtx/simd_vec4.hpp>
#include <glm/gtx/simd_mat4.hpp>
#include <iostream>
#include <cstdio>
#include <ctime>
#include <vector>
#if(GLM_ARCH != GLM_ARCH_PU... | TEST | 0.992145 | 6.313516 |
20cebdd2-44d9-4a1d-9eb3-53031649ffcd | Patil-Ojas/CPP-DSA-LoveBabbar | Recursion/43_permute.cpp | #include <bits/stdc++.h>
#include <vector>
#include <string.h>
using namespace std;
class Solution {
public:
void solve3000(vector<int> &nums, int index, vector<vector<int>> &ans)
{
if (index >= nums.size())
{
ans.push_back(nums);
return ;
}
for (int j=... | ALGO | 0.999997 | 5.666641 |
94d77899-1db3-4127-b308-cc3385795575 | raghavas201/CodeForces_Self-Practice | A_Let_s_Watch_Football.cpp | #include<iostream>
using namespace std;
int main(){
long long a,b,c;
cin>>a>>b>>c;
long long num=c*(a-b);
long long t=(num + b - 1)/b;
if(t<0) t=0;
cout<<t<<"\n";
return 0;
} | ALGO | 0.999875 | 3.516165 |
c04897b7-2da6-4f0c-a9dc-c0db7d200fda | blanterman/BigCppExercises | CH5 Functions/P51.cpp | // P51.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
#include <cassert>
using namespace std;
/*
Computes the value of an investment with compound interest.
@param initial_balance the initial value of the investment
@param p the interest rate in percent; must... | ALGO | 0.992562 | 5.032879 |
8cd6ae9d-4e95-4003-991a-1d90a3d1057e | okeashwin/General | Arrays/removeDups.cpp | #include<iostream>
#include<set>
#include<vector>
using namespace std;
void removeDups(vector<int>& nums)
{
set<int> nodes;
set<int>::iterator iter;
int unique = 0;
for(int i=0;i<nums.size();i++)
{
iter = nodes.find(nums[i]);
if(iter != nodes.end())
{
// Is a duplicate. Do nothing. Let i increment
}
... | ALGO | 0.999193 | 5.16432 |
556840c6-f88a-4896-bca0-eded02a4b3de | shoujiaxin/leetcode-solutions-cpp | [414] Third Maximum Number/solution1.cpp | /*
* @lc app=leetcode id=414 lang=cpp
*
* [414] Third Maximum Number
*
* https://leetcode.com/problems/third-maximum-number/description/
*
* algorithms
* Easy (30.15%)
* Likes: 564
* Dislikes: 1049
* Total Accepted: 129.6K
* Total Submissions: 429K
* Testcase Example: '[3,2,1]'
*
* Given a non-emp... | ALGO | 0.99966 | 6.259354 |
5a7aa30a-50ec-413b-9b34-b5297fb2726a | jack41402/C | zerojudge/b367/main.cpp | #include <iostream>
using namespace std;
int arr[11][11] , map[11][11] ;
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
int t , n , m ;
cin >> t ;
while (t--)
{
bool flag=true ;
cin >> n >> m ;
for (int i=0 ; i<n ; ++i)
{
for (int j=0 ;... | ALGO | 0.99996 | 4.127617 |
23822e18-a841-4387-9399-bf763d5e4a64 | ishandutta2007/codeforces | krijgertje/normal/1605/D.cpp | #include <algorithm>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <cmath>
#include <cstring>
#include <list>
#include <cassert>
#include <climits>
#inclu... | ALGO | 0.999958 | 4.215301 |
68e52ac9-d3d3-45ca-bf0c-d46dcc1e5243 | antonionicampos/MPC-Project | src/Eigen-3.3/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.981191 | 5.804369 |
47c20e34-1790-4b9f-bfd0-fc9e8e93431e | ishandutta2007/codeforces | black_horse2014/normal/792/F.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
using ll = long long;
struct Node;
typedef Node* PNode;
using db = long double;
const db eps = 1e-15;
const db inf = 1e100;
struct pt{
int x, y;
pt (int x = 0, in... | ALGO | 0.999989 | 3.942445 |
4efc938c-9e36-4571-99bf-4717f75576d9 | Dridr1/POO | Lista 1/l1q4.cpp | #include <iostream>
using namespace std;
int main()
{
int n, sum = 0;
cin >> n;
for (int i = 1; i <= n; i++)
{
sum += i * i;
}
cout << sum;
return 0;
} | ALGO | 0.996918 | 4.71147 |
8f2cf646-b754-4f6e-979a-47f66ba27ecc | felipefoschiera/programacaocompetitiva2019 | Contest4/varetas.cpp | #include <iostream>
using namespace std;
int main(){
int n;
while(cin >> n, n){
int res = 0, resto = 0;
int c, v;
for(int i = 0; i < n; i++){
cin >> c >> v;
int cheio = v / 4;
res += cheio;
v -= cheio*4;
resto += v/2;
}... | ALGO | 0.999588 | 3.603398 |
a08dc39d-ea83-406b-9ef1-76eece9f01b9 | oggyCS04/Computer-Graphics | src/Lab2/concentric_ellipse.cpp |
#include "con_mpe.h"
#include <stdio.h>
#include <graphics.h>
#include <math.h>
ConMpe::ConMpe(){
float h,k,a,b,p0,xn,yn;
float l[4],m[4];
char colorsname[4] = {
WHITE, RED, GREEN, BLUE
};
printf("\n\nConcentric Ellipes\n");
printf("- Compiled by Sagar Gupta\n\n");
printf("Enter the center of ... | ALGO | 0.996992 | 3.905727 |
491eccab-be6b-4970-8950-622c4fa3a1dd | viditrastogi11/DSA | practice/linkedlist.cpp | #include<iostream>
using namespace std;
typedef struct node{
int data;
struct node* next;
} node;
node* insertlinked(node *head,int val)
{
if(head==NULL)
{
head=new node();
head->data=val;
head->next=NULL;
return head;
}
node *head1=head;
while(head1->next!=NULL)
... | ALGO | 0.999979 | 3.76822 |
c63428fa-33b2-470c-a069-d64a56677b5b | Yawn-Sean/Daily_CF_Problems | daily_problems/2024/12/1206/personal_submission/cf250c_lengli.cpp | /*
lengli_QAQ
Hope there are no bugs!!!
*/
#include <bits/stdc++.h>
#define fastio std::ios::sync_with_stdio(0); std::cin.tie(0); std::cout.tie(0)
#define all(x) x.begin(),x.end()
#define pb push_back
#define i64 long long
void solve(){
int n,k;
std::cin>>n>>k;
std::vector<int> a(n+2);
for(int i=1;i<=n... | ALGO | 0.999962 | 4.207068 |
6e29b459-a2e8-4b90-aa0b-576aeaf60e7b | NathanOverschie/big_int | src/addition.cpp | #include "dint.h"
namespace bigint
{
template <class const_iterator, class iterator>
requires std::input_iterator<const_iterator> && std::forward_iterator<iterator>
bool bigint::additer(const const_iterator &big_begin, const const_iterator &big_end, const const_iterator &small_begin,
const const_iterator &small_... | ALGO | 0.995396 | 6.154707 |
a25150b7-355e-4a3e-9bed-389dbec4980c | mystic-01/LeetCode | 207-course-schedule/207-course-schedule.cpp | class Solution {
public:
bool dfsDetectCycle(int node, vector<vector<int>>& edges, vector<int>& visited, vector<int>& dfsVisited) {
visited[node] = 1, dfsVisited[node] = 1;
for (auto &i : edges[node]) {
if (!visited[i]) {
if (dfsDetectCycle(i, edges, visited, dfsVisited))... | ALGO | 0.999777 | 6.60134 |
d2ac6f17-cd36-4a66-849d-8289f7a03469 | aditya-mandothia/STRIVER-SHEET-DSA | 4th JULY 2022/longestsubarraywithsum0.cpp | #include <bits/stdc++.h>
using namespace std;
int LongestSubsetWithZeroSum(vector < int > arr) {
// Write your code here
unordered_map<int,int> map;
int maxi=0;
int sum =0;
for(int i=0;i<arr.size();i++)
{
sum+=arr[i];
if(sum==0)
{
maxi=i+1... | ALGO | 0.999852 | 5.393425 |
2aafb9e5-fb66-4368-9892-aa0571b50aef | wy-luke/LeetCode | 641.设计循环双端队列.cpp | /*
* @lc app=leetcode.cn id=641 lang=cpp
*
* [641] 设计循环双端队列
*/
// @lc code=start
struct DeListNode {
DeListNode *pre, *next;
int val;
DeListNode(int value) : val(value), pre(nullptr), next(nullptr) {}
DeListNode(int value, DeListNode *_pre, DeListNode *_next) : val(value), pre(_pre), next(_next) {}... | ALGO | 0.998468 | 5.886532 |
97130ee4-c704-4b55-a91c-9a9eaaaa20ce | ackoujens/personal-btt-skr-mini-e3-v2-custom | Marlin/src/feature/bedlevel/hilbert_curve.cpp | /*********************
* hilbert_curve.cpp *
*********************/
#include "../../inc/MarlinConfig.h"
#if ENABLED(UBL_HILBERT_CURVE)
#include "bedlevel.h"
#include "hilbert_curve.h"
constexpr int8_t to_fix(int8_t v) { return v * 2; }
constexpr int8_t to_int(int8_t v) { return v / 2; }
constexpr uint8_t lo... | ALGO | 0.999744 | 5.682351 |
021a99a8-bc66-429b-9c48-56332926fc15 | kuvshinovdr/TabsToSpaces | tabs_to_spaces.cpp | #include <stdexcept>
#include <string_view>
#include <regex>
#include <algorithm>
#include <ranges>
#include <fstream>
#include <cstdint>
#ifdef TABS_TO_SPACES_TEST_ENABLED
#include <iostream>
#endif//TABS_TO_SPACES_TEST_ENABLED
#ifdef _WIN32
#define WC(x) L##x
#else
#define WC(x) x
#endif
namespace TabsToSpaces
{
... | TOOL | 0.89806 | 7.547159 |
81e19b4d-036d-45d5-85eb-693d2d6933a0 | Mehedi26696/Data-Structures-and-Algorithm-With-CPP | 4.Pattern printing/2.cpp | // Solid square
/*
****
****
****
****
*/
#include <iostream>
using namespace std;
int main()
{
int r;
cin >> r;
for (int i = 1; i <= r; i++)
{
for (int j = 1; j <= r; j++)
{
cout << "*";
}
cout << endl;
}
return 0;
} | ALGO | 0.999626 | 4.354975 |
2861b5b7-4765-46d9-b18c-cea316d973fa | kuaisude/leetcode_new | 13.罗马数字转整数.cpp | /*
* @lc app=leetcode.cn id=13 lang=cpp
*
* [13] 罗马数字转整数
*/
// @lc code=start
class Solution {
public:
int romanToInt(string s) {
if( s.length() == 0)
{
return -1;
}
map<char,int> map_ro;
map_ro.insert(pair<char, int>('I', 1) );
map_ro.insert(pair<char, int>('V', 5) );
map_r... | ALGO | 0.999256 | 6.091859 |
c2c47643-6ac8-4858-90ff-f9bd68045d80 | WeiqiNs/SecureConjunctiveQuery | src/flexdb_mf.cpp | #include "flexdb_mf.hpp"
FlexDbMfPp FlexDbMf::pp_gen(const int degree, const int length, const bool pre){
// Create the pp instance.
FlexDbMfPp pp{};
// Update the degree according to input.
pp.d = degree;
// Update the input length according to input.
pp.l = length;
// Save the created pai... | ALGO | 0.924066 | 5.670711 |
dc6bfb36-ff8c-4eb4-af31-5c772ae4a7de | vishnuarjun512/CodingNinjas | Pattern Problems/char_pattern1.cpp | #include<iostream>
using namespace std;
int main(){
int n;
cin>>n;
int i=1;
while(i<=n)
{
int j=1;
while(j<=n)
{
char c= 'A'+j-1;
cout<<c;
j++;
}
cout<<endl;
i++;
}
} | ALGO | 0.999726 | 3.624226 |
a434e367-6e44-436d-8f37-281757bf0618 | maksympash-code/HomeWork_Cplusplus | HW_10/10.13б.cpp | #include "10.13б.h"
#include <iostream>
#include <string>
#include <vector>
using namespace std;
struct Date {
int day;
int month;
int year;
};
struct Employee {
string firstName;
string lastName;
char gender;
Date birthDate;
string position;
};
void input(Employee &employee) {
c... | TOOL | 0.920994 | 4.190621 |
f5619a1f-2691-4b66-80db-7af4a5a4e231 | Youtong0826/CSES | Range Queries/Range Xor Queries.cpp | #include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5+1;
int a[maxn];
// struct node {
// int l, r, val;
// } seg[maxn*2];
// void build(int l, int r, int idx) {
// seg[idx].l = l;
// seg[idx].r = r;
// if (l == r)
// seg[idx].val = a[l];
// else {
// int mid = (l+r... | ALGO | 0.999993 | 4.664393 |
05d286de-1658-4e0c-b22b-dca3b57d3bf3 | Ruan-xianzheng/rrt_exploration | src/path_planning-master/path_planning/src/rrt.cpp | #include <path_planning/rrt.h>
#include <math.h>
#include <cstddef>
#include <iostream>
using namespace rrt;
/**
* default constructor for RRT class
* initializes source to 0,0
* adds sorce to rrtTree
*/
RRT::RRT()
{
RRT::rrtNode newNode;
newNode.posX = 0;
newNode.posY = 0;
newNode.parentID = 0;
n... | ALGO | 0.999883 | 5.312586 |
38782b82-0c27-4af9-861a-921a66735884 | Vipinsinghhh/DSA | Patterns/inverted_traingle_pattern.cpp | // print inverted traingle pattern
// AAAAA
// BBBB
// CCC
// DD
// E
#include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cout<<"enter number:";
cin>>n;
char ch='A';
for(int i=0;i<n;i++){
for(int j=0;j<i;j++){
cout<<" ";
}
for(int j=0;j<n-... | ALGO | 0.999943 | 3.80083 |
c10edfce-1aaa-4e10-8b77-98a5ce89e14b | ahkang02/Monte-Carlo-Simulation-Parallel | MLMC/TaskFlow_Ver_2.cpp | #include<stdlib.h>
#include<iostream>
#include<cstdlib>
#include<cstdio>
#include<cmath>
#include<climits>
#include<list>
#include<algorithm>
#include<numeric>
#include<vector>
#include<iostream>
#include<random>
#include<chrono>
#include "BSM.hpp"
#include "Discretization_schemes.h"
#include "Payoffs.h"
#include "task... | ALGO | 0.999738 | 5.565442 |
f5186f83-336b-48f2-8afa-c0d6a380f51a | RajatChoudhary0449/Games | Game7.cpp | #include<iostream>
#include<iomanip>
#include<vector>
#include<queue>
#include<set>
#include<windows.h>
#include<conio.h>
#include<ctime>
using namespace std;
int row=8,col=8;
bool checkway();
bool gameover=false;
bool possibilityofmove(pair<int,int>,int);
void playwindow();
void instructionwindow();
void show();
void ... | ALGO | 0.982633 | 3.135277 |
76ac3687-fc05-4ece-860c-7aba414a4605 | KoulickS/Codeforces-Solutions | 633/A.cpp | /*Author- Koulick Sadhu*/
#include<bits/stdc++.h>
#include<string.h>
#define ll long long int
#define fio ios_base::sync_with_stdio(false); cin.tie(NULL);
#define MAX_LIMIT 100010
#define haha(x) x.begin(),x.end()
#define rs resize
#define remove_zero(str) str.erase(0, str.find_first_not_of('0'));
#define b begin
#defi... | ALGO | 0.999782 | 3.64534 |
c6e9ef8d-74e9-45e4-a26d-8fa3245d29e0 | adadesions/Olympiad2022 | TeachingSession/problem1.cpp | // Problem 1
// You are given a list of n-1 integers and these integers are in the range of 1 to n. There are no duplicates in the list. One of the integers is missing in the list. Write an efficient code to find the missing integer.
// input: {1, 2, 4, 5, 6, 7}, n = 7
// output: 3
// Hint:
// sum = 1, 2, 3, 4, 5, 6,... | ALGO | 0.99864 | 3.302895 |
08fe2747-11ae-4e68-b76e-ff833175ed25 | shuowangphd/hackerrank | alg/implementation/libraryFine.cpp | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int main(){
int d1;
int m1;
int y1;
cin >> d1 >> m1 >> y1;
int d2;
int m2;
int y2;
cin >> d2 >> m2 >> y2;
int fine=0;
if(y1>y2) fine=10000;
else if(y1==y2 && m1... | ALGO | 0.99933 | 3.844982 |
c1eb4e8a-5ad2-4402-bb19-67dfa2372f51 | kazuuuuuuuuuuuu/leetcode_solution | 1481.cpp | class Solution {
public:
int findLeastNumOfUniqueInts(vector<int>& arr, int k) {
// hash_map 用来计算频率
unordered_map<int, int> freq;
for(int num : arr)
{
freq[num] ++;
}
vector<int> ordered;
for(auto [key, val] : freq)
{
ordered.p... | ALGO | 0.999949 | 6.078056 |
a84511ed-6220-4454-ad1d-1db3321c4988 | setsal/coding | GPE/finish/10579 Hay Points.cpp | /*
Problem: 10579: Hay Points
subs: 647, ACs: 367, AcceptRate: 56.72, onsite: 15, access: 3224
Link: https://gpe3.acm-icpc.tw/showproblemtab.php?probid=10579&cid=5
*/
#include <bits/stdc++.h>
using namespace std;
int main()
{
int m, n;
cin >> m >> n;
map<string, int> myMap;
string word;
int value;
for (in... | ALGO | 0.995913 | 4.310885 |
650545fb-a0d0-47cd-9129-fa59167d1443 | qmind1995/bkmap | src/optim/progressive_sampler.cpp | //
// Created by tri on 26/09/2017.
//
#include "optim/progressive_sampler.h"
#include <numeric>
#include "util/misc.h"
#include "util/random.h"
namespace bkmap {
ProgressiveSampler::ProgressiveSampler(const size_t num_samples)
: num_samples_(num_samples),
total_num_samples_(0),
... | ALGO | 0.981375 | 7.823958 |
824dd70f-f1fa-404a-a31b-debfa57f67d4 | Nishant-k-sagar/pre-cp-journey | 178Q3 copy.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define fast ios::sync_with_stdio(false), cin.tie(0);
bool checker(deque<int> arr) {
while (arr.size() > 1) {
bool inc = true;
for (ll i = 0; i < arr.size() - 1; ++i) {
if (arr[i] >= arr[i + 1]) {
... | ALGO | 0.999978 | 4.506469 |
424c2ccc-944b-48d7-8162-85244015d03b | Hasanul-Bari/codeforces | codeforces/282/A.cpp | #include<iostream>
using namespace std;
int main()
{
int n,x=0;
cin>>n;
for(int i=0; i<n; i++)
{
string s,s1,s2,s3,s4;
s1="++X";
s2="X++";
s3="--X";
s4="X--";
cin>>s;
if(s==s1)
++x;
else if(s==s2)
x++;
else ... | ALGO | 0.999598 | 3.579723 |
254cb0a7-270c-422b-a757-e278e66161da | TheIslland/Code_learn | 7.代码练习/14.LeetCode/3.剑指offer/63_股票的最大利润.cpp | /************************************************************
File Name : 63_股票的最大利润.cpp
Author: TheIslland
Mail: <EMAIL>, <EMAIL>
Created Time: 2020-07-19 星期天 14:46:44
************************************************************/
class Solution {
public:
int maxProfit(vector<int>& prices) {
... | ALGO | 0.999809 | 5.892917 |
a7a5d439-97f4-414c-9e3c-ca1872e4a7e0 | NitoNetwork/Nito-core | src/test/fuzz/crypto_diff_fuzz_chacha20.cpp | #include <crypto/chacha20.h>
#include <test/fuzz/FuzzedDataProvider.h>
#include <test/fuzz/fuzz.h>
#include <test/fuzz/util.h>
#include <cstdint>
#include <vector>
/*
From https://cr.yp.to/chacha.html
chacha-merged.c version 20080118
D. J. Bernstein
Public domain.
*/
typedef unsigned int u32;
typedef unsigned char u... | TEST | 0.94596 | 5.820527 |
72e30859-b689-4d2a-ac34-afb368808a33 | gksgpwls0306/material-3-flutter | 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 |
8aa60093-3b49-43c8-b86a-e853b2b4a278 | 7oSkaaa/LeetCode_DailyChallenge_2023 | 08- August/05- Unique Binary Search Trees II/05- Unique Binary Search Trees II (Mina Magdy).cpp | // Author: Mina Magdy
class Solution {
public:
// Function to generate all possible unique binary search trees
// with values ranging from 'l' to 'r'
vector<TreeNode*> generateTrees(int r, int l = 1) {
// Base case: if 'l' is greater than or equal to 'r', there is only one possible tree
if ... | ALGO | 0.99999 | 6.695333 |
18ff77b6-39d9-4990-ad30-106caee60d3a | TheDev05/CARDIO | CodeForces/Rating 1200/A_Pizza_Separation.cpp | /*
Believe in your Karma & Keep chanting,
"Hare Rama Hare Rama, Rama Rama Hare Hare,
Hare Krishna Hare Krishna, Krishna Krishna Hare Hare !!"
Username: TheDev05, Happy Coding. <3
*/
#include <bits/stdc++.h>
using namespace std;
#define imax INT_MAX
#define imin INT_MIN
#define pi pair<ll, ll>
#define ps... | ALGO | 0.99988 | 4.268085 |
1dc30ad3-7415-41b2-a122-e6ad04451635 | simodf7/Algorithms_DataStructures | Dynamic Programming/Dicembre 2021/main2.cpp | #include <iostream>
#include <vector>
using namespace std;
// Il palindromo è una sequenza di caratteri che, letta al contrario, rimane invariata. Ad esempio, GAG
// e MADAM sono palindromi, ma ADAM no. Assumiamo che anche la stringa vuota sia un palindromo.
// Da qualsiasi stringa non palindromica, si può sempre otte... | ALGO | 0.999968 | 5.922792 |
8a71745b-8189-4afe-a734-5f2dfc2f3e88 | alam410/ProblemSet_Solution | Codeforce/266B(Queue at School).cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n,t;
cin>>n>>t;
string s;
cin>>s;
for(int j=0; j<t; j++)
{
for(int i=0; i<n-1; i++)
{
if((s[i]=='B') && (s[i+1]=='G') )
{
swap(s[i],s[i+1]);
i++;
}
... | ALGO | 0.999722 | 3.49071 |
eba8cd61-90d3-418e-8bf1-c099b31af648 | mcrl/hum | preprocessor/llvm-10.0.0.src/lib/Analysis/DemandedBits.cpp | #include "llvm/Analysis/DemandedBits.h"
#include "llvm/ADT/APInt.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/Analysis/AssumptionCache.h"
#include "llvm/Analysis/ValueTracking.h"
#include "llvm/IR/BasicBlock.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DataLayout.h"
#inclu... | ALGO | 0.979186 | 8.035672 |
ab88c189-9c1b-4a41-9f00-959322f5fa7d | BaomingRose/learning-Cpp | C++0716/C++0716/SeqList类模板.cpp | #if 1
#include<iostream>
using namespace std;
//ʵһͨõ˳ͶԴ
//typedef double DataType;
/*ģıΪΣ
1.ʵǰ--ֻģм
2.ʵ--ͻTʵɴ
*/
template<class T>
class SeqList
{
public:
SeqList(size_t capacity = 3)
: _array(new T[capacity])
, _size(0)
, _capacity(capacity)
{}
// & ֵ
~SeqList()
{
if (_array)
{
delete[] _array... | TOOL | 0.946055 | 3.496469 |
9e86525e-0f4a-410c-a382-06e6a542f5db | ksaveljev/codeforces-edu | segment-tree-part1/step4/B.cpp | #include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <stack>
#include <iomanip>
#include <cmath>
#include <cstring>
#include <numeric>
#include <cstdio>
#include <list>
#include <cassert>
using namespace std;
#define ll long long
#define p... | ALGO | 0.999871 | 3.62214 |
cd3f7c0b-996b-4f54-86a9-6a83d54a9862 | Vibhuti0206/Heaps | Merge k sorted linked lists.cpp | class Compare{
public:
bool operator()(ListNode *l1,ListNode *l2){
return l1->val > l2->val;
}
};
ListNode* Solution::mergeKLists(vector<ListNode*> &v) {
priority_queue<ListNode*,vector<ListNode*>,Compare> pq;
if(v.size()==0) return NULL;
for(int i=0;i<v.size();i++) pq.pu... | ALGO | 0.999951 | 5.656485 |
76241e64-25e6-463f-a759-7fdfcbd0b82e | danielfdz123/CSCI_335 | Project2/main.cpp | #include "myVector.hpp"
#include "myList.hpp"
#include "myHeap.hpp"
#include "myAVLtree.hpp"
#include <iostream>
#include <fstream>
#include <vector>
#include <sstream>
#include <string>
//Ignore this, I just wanted to output the base file as a whole
// int main ()
// {
// std::ifstream file("testinput.txt");
... | ALGO | 0.999237 | 4.817244 |
5c6546b4-6a3f-43b9-a168-1a0bad97b26d | MoSaichill/MAD-Midterm-checkpoint | minicheckpoint1/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.998834 | 6.785645 |
e2f07981-e146-49a2-9820-38d9ec1b1d3f | arpitg12/dsa_problem | minimum$bits_flip.cpp | class Solution {
public:
int minBitFlips(int start, int goal) {
long long cnt=0;
while(start>0 || goal>0){
if((start&1 ^ goal&1)==1){
cnt++;
}
start=start>>1;
goal=goal>>1;
}
return cnt;
}
};
| ALGO | 0.999992 | 5.638977 |
adda3145-feef-40a7-a96c-4c97deedd41d | bensafisara/ProgrammationParallel_tp1 | Exercice5/exercice5.cpp |
#include <iostream>
#include <pthread.h>
#include <stdio.h>
#include <chrono>
#include <stdlib.h>
#include <thread>
#include <mutex>
#include <condition_variable>
using namespace std;
std::condition_variable cv ;
std::mutex m;
int counter=0;
/*
- Bensafi Sarra
-Pour compiler : g++ -pthread exercice5.cpp -o exercice5... | TOOL | 0.871131 | 3.973488 |
95342f43-53d0-489b-b6f2-ae355e5552fc | muhammadhasan01/cp | Online Judge/Codeforces/Contests/DIV2/DIV2-454/E.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 25;
int n, m;
int dp[N];
int need;
vector<int> res;
bool can(int x) {
vector<int> v(n, 1);
for (int i = 0; i < x; i++) v[i] = 0;
do {
vector<int> temp(n);
for (int i = 0; i < n; i++) {
temp[i] = dp[i];
}
... | ALGO | 0.999981 | 4.256237 |
b1d07492-5c60-4acc-a7d2-7f2f808129b1 | Pohvalister/machine_learning-hw | Ml_Labs/distance.cpp | #include "iostream"
#include "algorithm"
#include "vector"
using namespace std;
bool y_first(pair<long,long> a, pair<long,long> b){
if (a.second == b.second)
return a.first < b.first;
return a.second < b.second;
}
bool x_first(pair<long, long> a, pair<long,long> b){
if (a.first == b. first)
return a.second < ... | ALGO | 0.999837 | 3.848107 |
5924a401-599a-4192-9ca1-b668404dff5d | Ash590034/leetcode | 1205-defanging-an-ip-address/1205-defanging-an-ip-address.cpp | class Solution {
public:
string defangIPaddr(string address) {
string ans="";
for(auto it:address){
if(it=='.'){
ans+="[.]";
}
else ans+=it;
}
return ans;
}
}; | ALGO | 0.995175 | 6.024152 |
9dbd4710-511b-41a2-818a-a7ee1b2b8075 | KrKush23/LeetCode | Problems/0038. Count and Say.cpp | #define pb push_back
class Solution {
public:
string countAndSay(int n) {
// BASE CASE
if(n==1)
return "1";
// Recursion
string s = countAndSay(n-1);
string res{};
int cnt{1};
// we have to count...and return what we are saying
... | ALGO | 0.999986 | 7.321065 |
61db344d-ed9e-4f0a-ad8d-cf09b44eed9a | TecHAyusH6476/DSA-Prep-HacktoberFest22 | Arrays/Sortthearray.cpp | // C++ program to sort an array
// with 0, 1 and 2 in a single pass
#include <bits/stdc++.h>
using namespace std;
// Function to sort the input array,
// the array is assumed
// to have values in {0, 1, 2}
void sort012(int a[], int arr_size)
{
int lo = 0;
int hi = arr_size - 1;
int mid = 0;
// Iterate till all th... | ALGO | 0.999827 | 5.280339 |
b0907723-d8c5-41ce-9a4a-061489dd266e | srinathdivate123/DSA | Binary_Search/S_3_Count_Occurences_In_Sorted_Array.cpp | // You are given a sorted array containing N integers and a number X, you have to find the occurrences of X in the given array.
// Answer is simply lastOccurence - firstOccurence + 1
#include <bits/stdc++.h>
using namespace std;
int firstOccurrence(vector<int> &arr, int n, int k)
{
int low = 0, high = n - 1;
... | ALGO | 0.99996 | 6.104352 |
7be1a55e-5a83-4114-9ffc-1c9026682cdd | LeeYellow/Two-way-Min-cut-Partitioning | src/main.cpp | #include <iostream>
#include <sstream>
#include <string>
#include <fstream>
#include <vector>
#include <set>
#include <unordered_map>
#include <utility>
#include <algorithm>
using namespace std;
#define A 0
#define B 1
#define NO 0
#define YES 1
#define UNLOCKED 0
#define LOCKED 1
struct CELL {
int id;
int gain;
in... | ALGO | 0.996636 | 3.41833 |
48033dc8-c7c3-4ed1-b947-845fa820d3c0 | 18-RAJAT/ONLINE-JUDGE | B_Expensive_Number.cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long
void sol()
{
string n;
cin>>n;
int cnt=count(n.begin(),n.end(),'0');
int sza=n.size();
for(int i=sza-1;~i;--i)
{
cnt-=n[i]=='0';
if(n[i]!='0')break;
}
cout<<sza-cnt-1<<endl;
}
signed main()
{
int t;
... | ALGO | 0.999764 | 5.250156 |
ab85c203-ae9f-4b5e-82c3-f1308c328523 | ahmadfathy97/codeforces | A-problems/A-Night-at-the-Museum.cpp | #include <iostream>
using namespace std;
int main()
{
string s;
int moves = 0;
cin>>s;
char xChar = 'a';
for(int i=0; i<s.size(); i++){
if(s[i] > xChar){
if(s[i] - xChar > 13){
moves += 26 - (s[i] - xChar);
} else{
moves += s[i] - xCh... | ALGO | 0.999792 | 3.373705 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.