uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
af31d3e6-4be3-4b69-8b0d-b3a867f0a08d | kumarsgoyal/geeksforgeeks | Linked List/Delete without head pointer.cpp | void deleteNode(Node *node)
{
// Your code here
Node *temp = node->next;
node->data = node->next->data;
node->next = node->next->next;
free(temp);
}
| ALGO | 0.997991 | 4.850523 |
203aa573-436e-45b7-b0f8-118a9c1388a6 | hijbullahx/MyCode | C++/CSC 284/Binary coliment.cpp | #include<iostream>
using namespace std;
class binary
{
public:
string s;
void input()
{
cout<<"Enter a Binary Number: "<<endl;
cin>>s;
cout<<"Your entered number is: "<<s<<endl;
}
void check()
{
for ( int i = 0 ; i< s.length(); i++)
{
if(s.at(i... | ALGO | 0.99379 | 5.211057 |
9a56bfbb-d61e-4f7f-9db1-75e66dacf326 | rohmish2/spoj_solutions | SPOJSOLUTIONS/CERC07K.cpp | // Problem: CERC07K
// Submission ID: 26086074
// Language: 4644
#include<bits/stdc++.h>
using namespace std;
int v[110][110][16];
struct bfs{
int r,c,bitt,dis;
bfs(int a,int b,int x,int y)
{ r=a;
c=b;
bitt=x;
dis=y;
}
};
//b=1st y=2nd r=3rd g=4th bit
int main()
{ int r,c;
scanf("%d%d",&r,&c);
while(r!=0)
... | ALGO | 0.999381 | 3.564136 |
ff9f122d-a483-4f01-8e31-0aa93effaad5 | ishandutta2007/codeforces | dragonslayerintraining/normal/1700/D.cpp | #include <cstdio>
#include <algorithm>
long long vs[200005];
int main(){
int N;
scanf("%d",&N);
for(int i=0;i<N;i++){
scanf("%lld",&vs[i]);
}
long long lb=0;
for(int i=1;i<N;i++){
vs[i]+=vs[i-1];
}
for(int i=0;i<N;i++){
lb=std::max(lb,(vs[i]+i)/(i+1));
}
int Q;
scanf("%d",&Q);
for(... | ALGO | 0.999563 | 3.656911 |
2c09cf7b-b9a4-494c-b7f6-e7ccce4c62f3 | UdaySharmaGitHub/DSA-CPP | GFG/Easy Problems/Print_all_nodes_that_don_t_have_sibling.cpp | /*
Print all nodes that don't have sibling
Given a Binary Tree of n nodes, find all the nodes that don't have any siblings. You need to return a list of integers containing all the nodes that don't have a sibling in sorted order (Increasing).
Two nodes are said to be siblings if they are present at the same level, and... | ALGO | 0.999956 | 5.210609 |
432728ba-fe36-47b7-921b-a0e7726df373 | rhazra-003/LeetCode_Practice | 917-reverse-only-letters/917-reverse-only-letters.cpp | class Solution {
public:
string reverseOnlyLetters(string s) {
vector<char> res;
map<int,char> m;
for(int i=0;i<s.size();i++)
{
if(!isalpha(s[i]))
{
m[i]=s[i];
}
else
{
res.push_bac... | ALGO | 0.999525 | 6.509265 |
ecb16de2-d534-4c4b-9955-e6ecb75e39a5 | bwolffleal/sorter | main.cpp | #include <iostream>
#include "Lista.h"
int main() {
Lista A;
int n, m;
int num = 1;
std::cout << "Digite o numero de variaveis: ";
std::cin >> n;
std::cout << "Digite o fator sorteador: ";
std::cin >> m;
while (num != n + 1)
{
A.Insere(num);
++num;
}
A.Imprim... | ALGO | 0.952219 | 3.018377 |
7c61e717-a1c4-49bd-923c-ce72621ee362 | Colloportus0/MLIRSmith11 | llvm/lib/MCA/Instruction.cpp | #include "llvm/MCA/Instruction.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
namespace llvm {
namespace mca {
void WriteState::writeStartEvent(unsigned IID, MCPhysReg RegID,
unsigned Cycles) {
CRD.IID = IID;
CRD.RegID = RegID;
CRD.Cycles = Cycles;
De... | TOOL | 0.862234 | 7.713428 |
fe676770-7a28-421e-9a00-ad39c9ebcddf | ishandutta2007/codeforces | szb/normal/827/C.cpp | #include<algorithm>
#include<memory.h>
#include<cstdio>
#include<cmath>
#include<cstring>
#define ll int
#define maxn 400010
#define For(i,x,y) for(ll i=x;i<=y;++i)
#define FOr(i,x,y) for(ll i=x;i>=y;--i)
using namespace std;
inline ll read(){ ll x=0,f=1;char ch=getchar(); while(ch<'0'||ch>'9'){if(ch=='-')f=-1... | ALGO | 0.999477 | 4.082783 |
aecb1c00-a4d1-4f54-89d3-84dcda943ab5 | Ashis1811/LeetCode | 0039-combination-sum/0039-combination-sum.cpp | class Solution {
public:
void helper(vector<int>& candidates, int target, int ind, vector<int>& curr, vector<vector<int>>& ans)
{
if(target == 0)
{
ans.push_back(curr);
return;
}
if(target < 0 || ind >= candidates.size())
{
return;
... | ALGO | 0.999965 | 6.630321 |
763f928f-3f64-4e1a-8434-6ca6dfe87aa6 | shagu/tainted-core | dep/g3dlite/source/MeshAlgWeld.cpp | #include "G3D/MeshAlg.h"
#include "G3D/Table.h"
#include "G3D/Set.h"
namespace G3D {
namespace _internal {
class Welder {
private:
// Intentionally illegal
Welder& operator=(const Welder& w);
public:
/** Indices of newVertexArray elements in <B>or near</B> a grid cell. */
typedef Array<int> List;
... | ALGO | 0.995474 | 6.909972 |
b8fabedc-9111-48d5-bf3d-d76741366c18 | oxygen-hunter/Flashboom | data/big-vul-100/add_attention_code/CodeLlama/top0-100/minCut-Solution.minCut/177901_Overflow.cpp | _asn1_ltostr (long v, char *str)
{
long d, r;
char temp[LTOSTR_MAX_SIZE];
int count, k, start;
if (v < 0)
{
str[0] = '-';
start = 1;
v = -v;
}
else
start = 0;
count = 0;
do
{
d = v / 10;
r = v - d * 10;
temp[start + count] = '0' + (char) r;
c... | ALGO | 0.999822 | 4.202549 |
726cd13e-e685-44db-b722-fb339a93953f | osu-crypto/BaRK-OPRF | thirdparty/linux/miracl/miracl_osmt/source/curve/pairing/gf2m4x.cpp | /*
* MIRACL C++ Implementation file gf2m4x.cpp
*
* AUTHOR : M. Scott
*
* PURPOSE : Implementation of class GF2m4x (Quartic extension over 2^m)
*
* WARNING: This class has been cobbled together for a specific use with
* the MIRACL library. It is not complete, and may not work in other
* application... | ALGO | 0.997881 | 4.865921 |
537b2a11-bea5-4ce3-a2bd-00483ce383c8 | atsss/cpp | quetions/1/2/main.cpp | #include <stdio.h>
#include <string.h>
#include <algorithm>
#include <iostream>
using namespace std;
bool arePermutation(string str1,string str2) {
// Get lengths of both strings
int n1 = str1.length();
int n2 = str2.length();
// If length of both strings is not same, then they
// cannot be anagram
if (n... | ALGO | 0.999905 | 5.303334 |
c81e40a0-a09a-422a-ac9d-95130a837273 | ishandutta2007/codeforces | dlalswp25/normal/1148/B.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll A[201010];
ll B[201010];
int N, M, K;
int ta, tb;
int main() {
scanf("%d%d%d%d%d", &N, &M, &ta, &tb, &K);
for(int i = 1; i <= N; i++) scanf("%lld", &A[i]);
for(int i = 1; i <= M; i++) scanf("%lld", &B[i]);
for(int i = 1; i <= N; i++) A[i] += ... | ALGO | 0.999959 | 3.500556 |
584ee07b-a68c-4ac1-a4c7-17ed66c794d3 | tanmayysain/Cpp | Linkedlists/DoublyLinkedList.cpp | #include<bits/stdc++.h>
using namespace std;
class node{
public:
int data;
node* prev;
node* next;
//constructor
node(int d ){
this-> data = d;
this-> prev = NULL;
this-> next = NULL;
}
~node(){
int val = this-> data;
if(next!=NULL){
delete next;
next = NULL;
... | ALGO | 0.999636 | 4.235188 |
b53168e0-7573-4588-a931-f6d51017e518 | meshwa27/Swapping | without+-.cpp | #include<iostream>
using namespace std;
int main(){
int x,y;
cout << "Enter the value x :";
cin >> x;
cout << "Enter the value y :";
cin >> y;
x=x^y;
y=x^y;
x=x^y;
cout << "x = " << x << endl;
cout << "y = " << y;
return 0;
} | ALGO | 0.999647 | 3.805261 |
7159916a-945b-45ed-a48a-b0612ab71a03 | ExpressRom-AOSP/frameworks_av | media/libstagefright/codecs/amrwb/src/qpisf_2s.cpp | /*
------------------------------------------------------------------------------
Filename: qpisf_2s.cpp
Date: 05/08/2007
------------------------------------------------------------------------------
REVISION HISTORY
Description:
----------------------------------------------------------------------------... | ALGO | 0.999195 | 6.976351 |
1181562e-ad71-4d53-87f5-ff7cafcaf309 | ishandutta2007/codeforces | romanandreev/normal/536/B.cpp | #include <algorithm>
#include <iostream>
#include <cstdlib>
#include <cstdarg>
#include <cassert>
#include <climits>
#include <cstring>
#include <complex>
#include <cstdio>
#include <vector>
#include <string>
#include <queue>
#include <cmath>
#include <ctime>
#include <set>
#include <map>
using namespace std;
typedef... | ALGO | 0.999996 | 3.958541 |
2ce4dd2f-5d4a-4d09-9421-32e186b31e59 | GuillermoGAndres/omegaUP | ligaOmegaUpCup/fase1/numerosNoFibonacci/numeros.cpp | #include <iostream>
#include <vector>
using namespace std;
int main(){
int n;
vector<int> numfib;
vector<int> numNoFib;
cin >> n;
int a = 1;
int b = 2;
int c = 0;
int bandera = false;
numfib.push_back(a);
numfib.push_back(b);
int i=1;
while(n > numfib.at(i)){
c = a + b;
a = b;
b = c... | ALGO | 0.999906 | 3.348528 |
7f687d07-a729-4c84-82a6-dff37e83277e | dostalma/MI-PAA | 01-brute-force-alg.cpp | #include <cstdio>
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <string.h>
#include <sstream>
#include <cmath>
#include <bits/stdc++.h>
using namespace std;
const int ROWS_COUNT = 50;
// items#
int g_N = 0;
// total maximum weight
int g_M = 0;
// array of weights
int ** g_Weights;
// array of p... | ALGO | 0.998424 | 3.626829 |
10dc3a5c-3f35-4177-b509-f0c7f41770d6 | Brundashree-A/CPP | pgm6.cpp | // Calculate Sum of the Elements of the Array
// normal method
#include<bits/stdc++.h>
#include<iostream>
using namespace std;
int sumofelements(vector<int> &arr, int n){
int sum=0;
for(int i=0;i<n;i++){
sum=sum+arr[i];
}
return sum;
}
int main(){
int n;
cout<<"enter the n value:";
c... | ALGO | 0.999875 | 5.985848 |
767862ac-6dbf-49db-b1b1-48cc2a4d0222 | langTuC0der/HNUE-OPP-C- | T2/min.cpp | #include<iostream>
using namespace std;
float min(float a, float b, float c);
int main(){
float a, b, c;
cin >> a >> b >> c;
if(a == b && b == c){
cout << "Khong co min";
}else{
cout << min(a, b, c);
}
return 0;
}
float min(float a, float b, float c){
float min = a;
if(min > b){
min = b;
}if(min > c){
... | ALGO | 0.999923 | 3.379747 |
78b0d69e-c886-47c5-8411-46956a291288 | ritikgarg655/CodeForce | zigzags.cpp | #include<bits/stdc++.h>
using namespace std;
// template
typedef long long ll;
typedef pair<ll,ll> pii;
typedef pair<ll,ll> pll;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<pii> vii;
#define pb push_back
#define mp make_pair
#define f first
#define s s... | ALGO | 0.99968 | 4.112762 |
ede4df70-2617-4f89-aff3-e0bde09a7269 | alexandraback/datacollection | solutions_2463486_0/C++/Acev/topcoder.cpp | #include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <c... | ALGO | 0.997751 | 4.386048 |
f7b51d3b-1bcd-469f-be9d-22ef745580b5 | XichL/Xich_Collect | ALG_Collect/ALG_Collect/Algorithm.cpp | #include "stdafx.h"
#include "Algorithm.h"
#include "ALG_Collect.h"
using namespace Algorithm;
void Algorithm::Algorithm_Math::setSPLineXData(array<double>^ SPLineXData)
{
this->SPLineXData = gcnew array<double>(SPLineXData->Length);
SPLineXData->CopyTo(this->SPLineXData, 0);
}
bool Algorithm::Algorithm_Math::cal... | ALGO | 0.999875 | 4.59189 |
1c4247f3-e343-45df-b7ab-64b250243b13 | gitanjali2003/DSA | Subset Sum Problem - GFG/subset-sum-problem.cpp | //{ Driver Code Starts
//Initial template for C++
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function template for C++
class Solution{
public:
bool solve(vector<int>arr,vector<vector<int>>&dp,int index,int sum,int tempSum)
{
if(tempSum == sum)
{
... | ALGO | 0.999678 | 6.090708 |
d11b5bd8-8516-469b-a358-e70f9c233c8e | smartfriendz/smartcore | firmware/mk8/Marlin/qr_solve.cpp | #include "qr_solve.h"
#ifdef AUTO_BED_LEVELING_GRID
#include <stdlib.h>
#include <math.h>
//# include "r8lib.h"
int i4_min ( int i1, int i2 )
/******************************************************************************/
{
int value;
if ( i1 < i2 )
{
value = i1;
}
else
{
value = i2;
}
r... | ALGO | 0.999941 | 4.77243 |
3d68350c-bca9-4ffb-a1ed-7d3d88f67d25 | auhulu/kyopro_educational_90 | 12.cpp | // 一部WA,REとれず...多分考え方はおk
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (long long i = 0; i < (long long)(n); i++)
const long long MOD = 1000000007;
const long long INF = 1LL << 60;
// けんちょん式 Union-Find
struct UnionFind {
vector<ll> par;
UnionFind(ll n) : par(n, -1) {}
... | ALGO | 0.999747 | 4.276013 |
3850d66b-1212-4732-9b71-04af95781088 | nachiket1010/Everyday-Coding | macros.cpp | #include <iostream>
using namespace std;
#define PI 3.14
int main(){
int r = 5;
//double PI = 3.14
double area = PI * r * r;
cout<<"Area is "<<area<<endl;
return 0;
} | ALGO | 0.99255 | 3.492562 |
398353a4-3733-41c7-8b7d-2f4836a12e6a | projectchrono/chrono | src/demos/fea/demo_FEA_abaqus_wheel.cpp | #include "chrono/physics/ChSystemSMC.h"
#include "chrono/physics/ChBodyEasy.h"
#include "chrono/physics/ChLoaderUV.h"
#include "chrono/physics/ChLoadContainer.h"
#include "chrono/core/ChRandom.h"
#include "chrono/fea/ChMesh.h"
#include "chrono/fea/ChMeshFileLoader.h"
#include "chrono/fea/ChContactSurfaceMesh.h"
#incl... | TOOL | 0.932325 | 4.980944 |
e661354c-adb4-4c59-92ea-f4e0866674dd | HardenedBSD/hbsdfw-ports-mirror | graphics/pfstmo/files/patch-src-mantiuk06-contrast_domain.cpp | --- src/mantiuk06/contrast_domain.cpp.orig 2008-03-12 09:20:28.000000000 +0000
+++ src/mantiuk06/contrast_domain.cpp 2008-03-12 09:27:16.000000000 +0000
@@ -58,6 +58,13 @@
#define LOOKUP_W_TO_R 107
+#if defined(__FreeBSD__)
+static inline float exp10f(float x) {
+ return powf(10.,x);
+}
+#endif
+
+
static void contr... | TOOL | 0.892976 | 6.019897 |
fcda7b84-a50e-42e9-a06d-2ad79c944d91 | KastyYasz/Fundamentos-da-Programacao-de-computadores | ex20.cpp | #include <iostream>
using namespace std;
int main() {
double A, D, E;
cout << "Digite o angulo (em graus): ";
cin >> A;
cout << "Digite a distancia da escada ate a parede (em metros): ";
cin >> D;
double cos_valores[] = {1.00, 0.87, 0.71, 0.50, 0.26};
int angulos[] = {0, 30, 45, 60, 7... | ALGO | 0.996183 | 4.712073 |
b4f8a597-99a1-4ddb-95f8-a1ba06ddc6cb | Elnur-Moldoshev8814/maxxx | timersss/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.998336 | 6.76073 |
9376e797-9422-4151-8cc8-bb876f868ac3 | ajay-paul/DSA | jump-game/jump-game.cpp | class Solution {
public:
bool canJump(vector<int>& nums) {
int end = nums.size() - 1;
int max_pos = 0;
for(int i = 0; i <= max_pos; i++)
{
max_pos = max(max_pos, nums[i] + i);
if(max_pos >= end)
return true;
}
... | ALGO | 0.99998 | 6.244951 |
e0ae8da8-85c7-41e8-b2b5-cca06544d8e4 | z3t0/godot | thirdparty/oidn/mkl-dnn/src/cpu/jit_sse42_1x1_convolution.cpp | #include "mkldnn_types.h"
#include "c_types_map.hpp"
#include "jit_sse42_1x1_convolution.hpp"
#include "utils.hpp"
#include "mkldnn_thread.hpp"
#include "type_helpers.hpp"
namespace mkldnn {
namespace impl {
namespace cpu {
#define data_blk_off(f, n, c, h, w) \
((ndims == 3) \
? (f).blk_off(n, c, w) \
: ... | ALGO | 0.991219 | 6.307676 |
c0c447ff-63aa-4b5e-acc2-aba54bda68fc | Sejalkathane/Leetcode_problems | Cpp Challange/Recursion/permutation.cpp | #include <bits/stdc++.h>
using namespace std;
void permute(int index, vector<int> &nums, vector<vector<int>> &ans)
{
int n = nums.size();
if (index == n)
{
ans.push_back(nums);
}
for (int i = index; i < n; i++)
{
swap(nums[index], nums[i]);
permute(index + 1, nums, ans)... | ALGO | 0.999983 | 5.394202 |
99e6b398-33b1-455e-98bd-3f496c4aea6e | DionysiosB/CodeAbbey | BullsAndCows.cpp | #include <iostream>
#include <set>
int main(){
std::string code; int t; std::cin >> code >> t;
std::set<char> digits;
for(int p = 0; p < code.size(); p++){digits.insert(code[p]);}
while(t--){
std::string s; std::cin >> s;
int countPos(0);
int countAny(0);
for(int p = 0;... | ALGO | 0.994946 | 4.122835 |
b8162730-723b-44cf-bd0b-135db3cb0bd0 | iamrakesh28/Competitve-Programming | contest/aug/box.cpp | #include <iostream>
using namespace std;
typedef long long ll;
const int inf = 1e6 + 6e5;
ll sum1(ll n) {
ll sum = n * (n + 1) / 2;
ll temp = n * (n + 1) * (2 * n + 1) / 6;
if (sum & 1) {
sum = sum / 2 + temp / 2;
sum++;
}
else {
sum = sum / 2 + temp / 2;
}
return sum;
}
ll sum2(ll n) {
... | ALGO | 0.999916 | 4.109914 |
4500282b-231e-4ec9-b42f-1762b4112d96 | ishandutta2007/codeforces | rfpermen/normal/1422/A.cpp | #include<bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC target("tune=native")
#pragma GCC optimize("unroll-loops")
using namespace std;
template<class A, class B>
ostream& operator<<(ostream& os, const pair<A, B> &p) {
os << '(' << p.first << ',' << p.second << ')';
return os;
}
template<class T>
ostream... | ALGO | 0.999904 | 4.271432 |
0f7f1fab-b79a-4fff-bd4b-8a8bf4ae8d61 | haileykim1/Algorithm-Problem | 190529/삼성2001_파리퇴치.cpp | #include<iostream>
#include<string>
#include<sstream>
using namespace std;
int main() {
string teststr;
int testcase;
getline(cin, teststr);
testcase = stoi(teststr);
for (int t = 1; t <= testcase; t++) {
int m,n;
string str;
getline(cin, str);
stringstream ss;
ss.str(str);
string temp;
... | ALGO | 0.999836 | 3.359693 |
1268db5b-5f40-4d09-a44a-f6cce7b3b787 | divysoni03/full_cpp | OOPS/oop_main_task/task1.cpp | // 1. Library Management System:
// Design a system for a library where you can add, remove, and search for books. Each book should have attributes like title, author, and ISBN.
#include<iostream>
#include<string>
#include<fstream>
using namespace std;
class FileHandler{
private:
string str;
public:... | TOOL | 0.96998 | 5.452542 |
91c2bbbe-9a9a-47b2-b207-047e3b65630e | sakshamA06/DSA | Step 4: Binary Search [1D, 2D Arrays, Search Space]/Lec 1: BS on 1D Arrays/6.firstAndLastPosition.cpp | #include<bits/stdc++.h>
using namespace std;
vector<int> optimal(vector<int> arr, int target){
int fo = -1, lo = -1; // first occurance and last occurance.
int low = 0, high = arr.size()-1;
while(low <= high){
int mid = low + (high-low)/2;
if(arr[mid] == target){
fo = mid;
... | ALGO | 0.999942 | 5.665763 |
c553e742-bce0-4e58-94e2-c95e0420c581 | sinedanat/teach_yourself_cpp_in_24_hours_cadenhead | ch03/ex/ex02.cpp | // Expand the Rectangle program so that it determines
// the area of a three-dimensional rectangle
// that has width, length, and height.
// To determine the area, use the multiplication
// operator * to multiply all three values.
#include <iostream>
int main()
{
// create a type definition
typedef unsigned s... | TOOL | 0.983776 | 3.683224 |
b83c82b5-994a-49db-9ce3-8c936dc68ff6 | ElConroXD/ElCodigo-v | P2.cpp | #include <bits/stdc++.h>
using namespace std;
main(){
int a;
cin>>a;
int n[a+1];
for(int i=0;i<=a;i++){
cin>>n[i];
}
for(int j=0;j<=a;j++){
cout<<n[j]<<" ";
}
cout<<"\n";
for(int k=a;k>=0;k--){
cout<<n[k]<<" ";
}
}
| ALGO | 0.99994 | 3.086946 |
66a3708d-b01f-4f77-866b-ab7ae51ba469 | ishandutta2007/codeforces | lxr_love_yxh/normal/NA/232.cpp | /*
Though leaves are many , the root is one.
Through all the lying days of my youth
I swayed my leaves and flowers in the sun.
Now I may wither into the truth.
- William Butler Yeats
*/
//#pragma GCC optimize("Ofast,no-stack-protector")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx")
//#pragma GC... | ALGO | 0.999623 | 3.64153 |
9c64b6a0-e237-45b4-b579-6962a55e9fec | kunal-1908/DSA | RECURSION/PreInPost.cpp | #include<iostream>
using namespace std;
void preinpost(int n){
if(n==0){
return;
}
cout<<"pre "<<n<<endl;
preinpost(n-1);
cout<<"in "<<n<<endl;
preinpost(n-1);
cout<<"post "<<n<<endl;
return;
}
int main(){
int n;
cout<<"enter the number:"<<endl;
cin>>n;
preinpost(... | ALGO | 0.99939 | 3.865428 |
df00471a-7bb7-4f42-8145-d80f56776ada | martinbudden/SuperSlicer | src/libigl/igl/infinite_cost_stopping_condition.cpp | IGL_INLINE void igl::infinite_cost_stopping_condition(
const std::function<void(
const int,
const Eigen::MatrixXd &,
const Eigen::MatrixXi &,
const Eigen::MatrixXi &,
const Eigen::VectorXi &,
const Eigen::MatrixXi &,
const Eigen::MatrixXi &,
double &,
Eigen::RowVectorXd &)> & cost_... | ALGO | 0.995532 | 4.643597 |
9e64c125-75fd-49cd-819a-3d133c876f10 | laitoanthang/Cplusplus | TH_KTLT/Week_04/Project3_Point/Project3/project3.cpp | #include <iostream>
#define _CRT_SECURE_NO_WARNINGS
using namespace std;
struct point
{
float x;
float y;
};
void Read_File(FILE*& f, int& m, point*& a)
{
fopen_s(&f, "in_points.txt", "rt");
if (f == nullptr)
{
cout << "cannot open this file!";
}
else {
fscanf_s(f, "%d", &m);
a = new point[m];
for (int... | ALGO | 0.999654 | 4.230061 |
4f0a861a-cca0-4ca4-88f2-091149e56fa6 | L04DB4L4NC3R/placement-prep | amazon_archives/arrays/transition.pt.cpp | // https://practice.geeksforgeeks.org/problems/find-transition-point-1587115620/1
int m;
int binary_search(int arr[], int left, int right) {
if (left > right)
return -1;
m = (left + right) / 2;
if (arr[m] == 1 && arr[m - 1] == 0) {
return m;
} else if (arr[m-1] > 0) {
return binary... | ALGO | 0.999894 | 5.082405 |
e692050a-c9a4-49b1-9b25-55d49902601e | ishandutta2007/codeforces | eric_hooo/normal/1096/A.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int T;
scanf("%d", &T);
while (T--){
int n, m;
scanf("%d%d", &n, &m);
printf("%d %d\n", n, n * 2);
}
return 0;
} | ALGO | 0.999314 | 4.75859 |
ac26cb88-44ca-437c-88a1-9bffb531b350 | JohnSmith192/AlgorithmExercise | MonotonicStack/main.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stack>
using namespace std;
int n;
stack<int> stk;
int main()
{
scanf("%d", &n);
for (int i = 0; i < n; i++)
{
int t;
scanf("%d", &t);
while (!stk.empty() && stk.top() >= t)
{
stk.pop();
}
if (stk.empty())
{
printf("%d ", -1);
}
els... | ALGO | 0.999894 | 3.808254 |
bb7800e4-8fe6-4b4a-a38d-f39880c2baa8 | Kunal-3004/rescue_aircraft | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998733 | 6.76775 |
f9f910bd-453e-4d14-9183-b4954f6a3b9f | ishandutta2007/codeforces | alpha_q/normal/604/D.cpp | #include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
long long BigMod (long long a, long long e) {
if (e == 0) return 1;
if (e == 1) return a % MOD;
long long half = BigMod((a * a) % MOD, e >> 1) % MOD;
if (!(e & 1)) return half;
return (a * half) % MOD;
}
int main() {
long long p, ... | ALGO | 0.999978 | 4.555886 |
650d78cc-408a-4615-8c79-f5830fcaf751 | bitue/XettaBytes_club_problems | contest_1_vjudge/problem__cow.cpp | #include<bits/stdc++.h>
using namespace std ;
int main (){
int t ;
cin>>t ;
while(t--){
int n , c ;
cin>>n>>c ;
int arr[n];
for(int i=0 ; i<n ; i++) cin>>arr[i];
sort(arr, arr+n);
int max_value = arr[n-1];
int curr[max_value]={0};
for(int i=0... | ALGO | 0.999493 | 3.45701 |
847b1a3d-8d98-4f5a-9859-4acdc2b9f1d0 | roshan07273/Leetcode-Questions-Solution | Climbing_stairs.cpp | class Solution {
public:
int climbStairs(int n) {
vector<int> dp(n+1,-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];
return 0;
}
};
| ALGO | 0.999995 | 6.012131 |
c7fc8682-ecef-4e84-80c6-f2f539603d8c | shahbazcse/DataStructures | Queue/implementQueueUsingLL.cpp | // Link: https://practice.geeksforgeeks.org/problems/implement-queue-using-linked-list/1
// Approach: [TC: O(1) / SC: O(1)]
void MyQueue:: push(int x)
{
if(!front && !rear){
QueueNode* temp = new QueueNode(x);
front = temp;
rear = temp;
}else{
QueueNode* temp = new QueueNode(x)... | ALGO | 0.999646 | 5.21364 |
66d8cc11-169b-4390-a7a0-a956974ecbfa | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_1226_22.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
cout << n / 2 << endl;
}
| ALGO | 0.996427 | 3.213768 |
50a5c943-563d-4b6c-9de8-2d05cb8fd607 | sbmtrntr/AtCoder | ABC/250~299/299/A_Treasure_Chest.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main(){
int N; cin >> N;
string S; cin >> S;
int cnt = 0;
for (int i = 0; i < N; i++) {
if (S[i] == '|') cnt++;
if (S[i] == '*') {
if (cnt == 1) {
cout << "in" << endl;
ret... | ALGO | 0.999909 | 3.889313 |
a9524d03-6d5a-4451-997b-3ef72d269f32 | Mr-AkashShinde/DSA_Practice | 2351-first-letter-to-appear-twice/2351-first-letter-to-appear-twice.cpp | class Solution {
public:
char repeatedCharacter(string s) {
for(int i=0; i<s.length(); i++){
for(int j=0; j<i; j++){
if(s[i]==s[j]){
return s[i];
}
}
}
return s[0];
}
}; | ALGO | 0.999939 | 5.482125 |
41c40fb8-b32a-4512-adc4-5b14b205be61 | artemburiak/PA2-zkousky | BST/reference.cpp | #include <string>
#include <cassert>
#include <iostream>
using namespace std;
class CTree {
protected:
class CNode {
public:
CNode(string key) : m_Key(key) {}
~CNode() {
delete m_L;
delete m_R;
}
string m_Key;
CNode* m_L = nullptr;
CNode*... | ALGO | 0.999184 | 5.787633 |
660477c5-344c-4f11-b9cf-67f88986ee4a | hajimeIppo-cmd/cp-codes | Baekjoon OJ/01000-01999/1734.cpp | #include <bits/stdc++.h>
using namespace std;
#define pii pair<int, int>
const int MAXV = 101010;
const int MAXD = 16;
int n, m;
vector<int> adj[MAXV], t[MAXV];
vector<vector<pii>> bcc;
set<int> aPoint;
set<pii> aEdge;
void input() {
cin >> n >> m;
for (int i = 0; i < m; i++) {
int u, v;
cin... | ALGO | 0.999811 | 4.96281 |
163538db-443b-4a28-bf75-62902758f2c5 | kaushalchugh/CodeHelp-DSA-Busted-Series | Lecture134 Buy and Sell Stock [Part 5]/Best Time to Buy and Sell Stock with Transaction Fee.cpp | class Solution {
public:
int solveSO(int fee, vector<int>& prices){
int n = prices.size();
vector<int>curr(2, 0);
vector<int>next(2, 0);
for(int index = n-1; index >= 0; index--){
for(int buy = 0; buy<= 1; buy++){
int profit = 0;
if(b... | ALGO | 0.999839 | 5.373374 |
d73c8de3-04f3-4b63-b3d9-17babf2ef8c4 | AntonYad/Leetcode-or-NK | lc1226/源.cpp | class DiningPhilosophers {
public:
DiningPhilosophers() {
}
void wantsToEat(int philosopher,
function<void()> pickLeftFork,
function<void()> pickRightFork,
function<void()> eat,
function<void()> putLeftFork,
function<void()> putRightFork) {
int l = philosophe... | ALGO | 0.964769 | 4.111052 |
db4c770b-1031-49ab-98cd-251705cbdb37 | AzureWoods/Algorithm-Problems | BestCoder/#84B.cpp | #include <iostream>
#include <cstring>
using namespace std;
int A[100005],dp[100005],D[100005];
int main()
{
int T;
cin>>T;
for(int x=0;x<T;x++)
{
int n;
cin>>n;
memset(A,0,sizeof(A));
memset(dp,0,sizeof(dp));
memset(D,0,sizeof(D));
for(int i=0;i<n;i++)
cin>>A[i];
dp[0]=1;
D[0]=1;
D[1]=A[0];
... | ALGO | 0.999869 | 3.594643 |
5d1589e8-e12a-472c-9030-3be18c9e2075 | ishandutta2007/codeforces | sohsoh/normal/1700/D.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pll;
#define all(x) (x).begin(),(x).end()
#define X first
#define Y second
#define sep ' '
#define endl '\n'
#define debug(x) cerr << #x << ": " << x << endl;
const ll MAXN = 1e6 + 10;
int n;
ll A[MAXN], ps[MAXN], ... | ALGO | 0.999952 | 4.20898 |
15cb4bcd-5dfd-4990-9b08-0d4c61e05933 | copskim/LeetCode | GitHubCPPS/75SortColors.cpp | class Solution {
public:
void sortColors(vector<int>& nums) {
int redcc = 0, whitecc = 0, bluecc = 0;
for (int c : nums) {
if (c == 0) redcc++;
else if (c == 1) whitecc++;
else if (c == 2) bluecc++;
}
int i = 0;
while (redcc-- > 0) nums[i++... | ALGO | 0.999717 | 5.878795 |
a4b6335e-3868-4025-a495-d48a862adb73 | c1529/dsa | Tree/二叉树基本操作.cpp | #include <iostream>
using namespace std;
typedef struct BiTNode
{
int data;
struct BiTNode *lchild, *rchild;
} BiTNode, *BiTree;
class Tree
{
private:
BiTNode *root;
public:
Tree()
{
root = nullptr;
}
// 在二叉树中插入节点
void insert(int value)
{
insertNode(root, value);
... | ALGO | 0.999917 | 5.202168 |
bca9a1cd-a434-4355-9a1b-42e825dfa283 | ib13/Coding-Practice | Coding Ninjas/A13/A13-10.cpp | //insertion sort iterative
#include <iostream>
using namespace std;
class node
{
public:
int data;
node *next;
node(int data)
{
this->data = data;
this->next = NULL;
}
};
pair<pair<node *, node *>, node *> swap_nodes(node *head, int i, int j)
{
int minval = min(i, j);
int ma... | ALGO | 0.999989 | 5.223975 |
cdd00d50-2bbb-4384-9534-98e94d1a130e | jeffersonscientific/cdfm_fdra2c | src/Fdra.cpp | #include <stdio.h>
#include <assert.h>
#include <string.h>
#include <math.h>
#include <unistd.h>
#include <limits>
#include "util/include/Exception.hpp"
#include "util/include/ValueSetter.hpp"
#include "util/include/KeyValueFile.hpp"
#include "StreamDataFile.hpp"
#include "OdeFn.hpp"
#include "Fdra_pri.hpp"
#include "M... | TOOL | 0.940008 | 4.85042 |
3d976670-7b3a-4d42-91ad-d81f34681c3c | amirbarda/ShellFEM | include/igl/point_in_poly.cpp | bool IGL_INLINE igl::point_in_poly( const std::vector<std::vector<unsigned int > >&poly,
const unsigned int xt,
const unsigned int yt)
{
int npoints= poly.size();
unsigned int xnew,ynew;
unsigned int xold,yold;
unsigned int x1,y1;
unsigned int x2,y2;
int i;
int inside=0;
if ... | ALGO | 0.999123 | 5.710876 |
6c7816f2-cce3-4974-93b4-17037e3dfea6 | Cccmm002/my_leetcode | 812-rotate-string/rotate-string.cpp | // We are given two strings, A and B.
//
// A shift on A consists of taking string A and moving the leftmost character to the rightmost position. For example, if A = 'abcde', then it will be 'bcdea' after one shift on A. Return True if and only if A can become B after some number of shifts on A.
//
//
// Example 1:
// ... | ALGO | 0.999864 | 6.200209 |
156a8cd1-6bb0-4c06-a8e6-058de8b51fa6 | Abdul-Rahimm/LeetCode_2024 | 11. November/7. Code Testcase Test Result Test Result 2275. Largest Combination With Bitwise AND Greater Than Zero.cpp | // بِسْمِ اللهِ الرَّحْمٰنِ الرَّحِيْمِ
#include <bits/stdc++.h>
using namespace std;
#define all(x) x.begin(), x.end()
typedef vector<int> vi;
typedef vector<vi> vii;
int largestCombination(vector<int> &nums)
{
int n = nums.size();
int ans = 0;
bool status = false;
for (int i = 0; status == false; i+... | ALGO | 0.999946 | 4.803697 |
3df33ac3-4c29-44a3-8042-a5c9c5a86aa7 | gyanranjan17/LeetCode-and-GfG | Find Maximum Equal sum of Three Stacks - GFG/find-maximum-equal-sum-of-three-stacks.cpp | //{ Driver Code Starts
//Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function Template for C++
class Solution{
public:
int maxEqualSum(int N1,int N2,int N3,vector<int> &S1,vector<int> &S2,vector<int> &S3){
int sum1=0,sum2=0,sum3=0;
for(int i... | ALGO | 0.999956 | 5.406893 |
fe953aca-15af-4b4f-97bc-106a1ec236dc | lucelujiaming/mySoxTest | RaytraceGroundUp/Chapter23.5_linux_module/GeometricObjects/TorusPart.cpp | #include "Maths.h" // for SolveQuartic
#include "TorusPart.h"
// ---------------------------------------------------------------- default constructor
TorusPart::TorusPart (void)
: GeometricObject(),
a(2.0),
b(0.5),
phi1(90.0 * PI / 180.0),
phi2(270.0 * PI / 180.0),
t... | ALGO | 0.988788 | 6.079643 |
203df81d-f948-4ebb-9692-638be8bb1dd5 | shin-701/competitive | src/ABS/ABC086C/a.cpp | # include <iostream>
using namespace std;
int main() {
int N;
int t[110000], x[110000], y[110000];
cin >> N;
t[0] = x[0] = y[0] = 0; // 初期状態
for (int i = 0; i < N; ++i) cin >> t[i+1] >> x[i+1] >> y[i+1]; // 1-index にしておく
bool can = true;
for (int i = 0; i < N; ++i) {
int dt = t[i... | ALGO | 0.99996 | 4.192236 |
c34ed0cf-4c97-42d3-9f36-49b671f28e06 | Daniel-Vinicius/neps | techniques/sum_of_prefix/constant_sum_of_prefix.cpp | #include <iostream>
using namespace std;
const int MAXN = 1000010;
// O(1)
int main()
{
int n, q;
int v[MAXN], psa[MAXN]; // psa[i] = v[0] + v[1] + ... + v[i] = psa[i - 1] + v[i]
cin >> n >> q;
for (int i = 0; i < n; i++)
cin >> v[i];
psa[0] = v[0]; // Caso base
for (int i = 1; i < n; i++)
psa... | ALGO | 0.999824 | 4.660592 |
bef11a2f-7cdb-4cb2-9fc1-9729c70fff88 | raincross7/code-similarity | codes/train_code/problem246/problem246_108.cpp | #include <bits/stdc++.h>
#define ll long long
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define rrep(i, n) for (int i = 1; i <= n; i++)
using P = pair <int, int>;
ll mod = 1000000007;
ll ans = 1<<29;
int main() {
int N,T;
cin >> N>>T;
vector<int> t(N);
rep(i,N) cin >> t[i];
... | ALGO | 0.999954 | 3.443087 |
97bf6956-d3d3-4548-8d3d-915425a76466 | Linestro/gem5_Y | src/systemc/tests/systemc/misc/user_guide/chpt3.2/fsmr.cpp | /*****************************************************************************
fsmr.cpp --
Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
*****************************************************************************/
/*****************************************************************************
... | ALGO | 0.998821 | 4.840075 |
383ec26a-7b76-4e6e-9b1c-e7076eefc020 | ishandutta2007/codeforces | sandytea/normal/317/B.cpp | //program 317-B
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<algorithm>
using namespace std;
int Get()
{
char c;
while(c=getchar(),(c<'0'||c>'9')&&(c!='-'));
bool Flag=(c=='-');
if(Flag)
c=getchar();
int X=0;
while(c>='0'&&c<='9')
{
X=X*10+c-48;
c=g... | ALGO | 0.999979 | 3.243784 |
506aafab-2d1f-4039-8cc9-975ec55e34ea | sevenalarm/Codeforces | A_Tir1403/455A.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++)
const int mxn = 1e5 + 10;
ll cnt[mxn], a[mxn], zoj, fard, a... | ALGO | 0.999884 | 3.500839 |
3fbf2f20-6e89-4213-a425-12d35161ebc9 | ryanaustinf/CPL-Notebook | code/Circle.cpp | #include <cmath>
/**
* Checks if p is in circle with center c and radius r.
* Returns 0 if inside, 1 if on border, and 2 if outside.
*/
int insideCircle(Point p, Point c, double r) {
double dx = p.x - c.x, dy = p.y - c.y;
double dist = hypot(dx,dy);
return dist < r - 1e-10 ? 0 : (dist < r + 1e-10 ? 1 : 2);
}
do... | ALGO | 0.999519 | 6.117952 |
da2fea69-ad3c-4f79-874e-c14ab285d1cc | Lodour/ACM-ICPC | codes/hdu/5725.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
#define set(a,b) memset(a,b,sizeof(a));
const int N = 1010;
char mp[N][N];
bool rg[N], cg[N];
int gx[N], gy[N];
int main() {
#ifdef MANGOGAO
freopen("data.in", "r", stdin);
#endif
int t;
scanf("%d", &t);
while (t--) {
int n, m;
scan... | ALGO | 0.990608 | 3.77161 |
29e234fc-a97c-49eb-97dd-f55d0a4279b1 | rafaelab/GRPropa | src/module/Boundary.cpp | #include "grpropa/module/Boundary.h"
#include "grpropa/Units.h"
#include <sstream>
namespace grpropa {
PeriodicBox::PeriodicBox() :
origin(Vector3d(0, 0, 0)), size(Vector3d(0, 0, 0)) {
}
PeriodicBox::PeriodicBox(Vector3d o, Vector3d s) :
origin(o), size(s) {
}
void PeriodicBox::process(Candidate *c... | ALGO | 0.97558 | 7.095039 |
654c269f-ac8b-41d2-83ef-7ed8fd4a890e | HarshKumarBhagat/Data-Structure-in-C | c++/Chapter2/greatestofthree.cpp | #include<iostream>
using namespace std;
int main(){
int a,b,c;
cout<<"enter a : ";
cin>>a;
cout<<"enter b : ";
cin>>b;
cout<<"enter c : ";
cin>>c;
if(a>b && a>c){
cout<<"a is greater";
}
else if(b>c && b>a){
cout<<"b is greater";
}
else{
cout<<"c... | ALGO | 0.999793 | 3.455313 |
0bcdf3d1-4341-4df3-96c0-3e120ab46df3 | JVZELLER/programming-contest | problems/C++/2484__abracadabra/2484_Abracadabra.cpp | /*
author: Otvio Augusto - OAMP
problem_name: Abracadabra
problem_number: 2484
category: Strings
difficulty_level: 5
link: https://www.urionlinejudge.com.br/judge/pt/problems/view/2484
*/
#include <iostream> // entrada e sada padro
#include <string> // uso de strings
using namespace std;
int main() {
int i... | ALGO | 0.999435 | 4.776212 |
c54b55ad-cd02-4681-a4a1-884540bc0205 | sarvex/leetcode-ocaml | solution/0700-0799/0774.Minimize Max Distance to Gas Station/Solution.cpp | class Solution {
public:
double minmaxGasDist(vector<int>& stations, int k) {
double left = 0, right = 1e8;
auto check = [&](double x) {
int s = 0;
for (int i = 0; i < stations.size() - 1; ++i) {
s += (int) ((stations[i + 1] - stations[i]) / x);
}
... | ALGO | 0.999979 | 5.58777 |
f857b388-b4b6-4367-b2c0-6ae842a396bd | mmmim24/Academic | Class Contests/Project150 Marathon#6/B.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int T;
scanf("%d",&T);
for(int i = 1;i <= T;i++)
{
int ans,n,q,l,r;
scanf("%d %d",&n,&q);
vector <int> arr(n+1);
sort(arr.begin(),arr.end());
for(int i = 0;i < n;i++)
scanf("%d",&arr[i]);
... | ALGO | 0.999252 | 3.841331 |
8a38cf24-4702-4217-a097-3b86c3e5c8e0 | jwseph/competitive-programming | cses/1073.cpp | #include <bits/stdc++.h>
using namespace std;
int N;
multiset<int> S;
int main() {
cin >> N;
while (N--) {
int a; cin >> a;
auto it = S.upper_bound(a);
if (it != S.end()) {
S.erase(it);
}
S.insert(a);
}
cout << S.size() << endl;
} | ALGO | 0.999529 | 4.377057 |
c9ebc969-f4b6-44b0-af2e-1d266e77edbc | ishaankalsi/All_algos_ds_needed | code/search/linear_search/linear_search.cpp | #include <stdio.h>
/*
* Part of Cosmos by OpenGenus Foundation
*/
/*
* Input: an integer array with size in index 0, the element to be searched
* Output: if found, returns the index of the element else -1
*/
int search(int arr[], int x)
{
int i=0, size= arr[0];
for (i=0; i<size; i++)
if (arr[i] == x)
return i... | ALGO | 0.999625 | 4.845249 |
30732c01-16e0-4f1c-9f46-88f9570e0ccd | DywangIT/PTIT-Programing | PTIT-C++/LIET_KE_SINH_VIEN_THEO_LOP.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define FASTER() ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
// Dywang //
class NhanVien{
public:
string id, name, clas, mail;
public:
friend istream& operator >> (istream& in, NhanVien& a){
sca... | ALGO | 0.998307 | 4.141359 |
0f3a7c7a-c7ec-4706-9cc9-4ddf9ebfab8d | abahad7921/dsa-practice | problems/subset_target_sum.cpp | /*
Given an array print all the subsequences whose sum will be equal to the given target
*/
#include <bits/stdc++.h>
using namespace std;
void countSubsequence(vector<int>& arr,int index,vector<int>&output,int target,int sum){
if(index == arr.size()){
if(sum == target){
for(auto i: output){
cout<<... | ALGO | 0.999751 | 5.227504 |
144463f0-c8c0-486f-8cc5-07fb0fea604e | wise-toddler/emptyqwerty | Codeforces/B_Spreadsheets.cpp | // https://codeforces.com/problemset/problem/1/B
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define double long double
#define endl '\n'
#define nl cout << endl;
#define IOS ios::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);
#define v vector
#define vi v<int>
#define vvi v<v<int>>
... | ALGO | 0.998896 | 3.62444 |
e5c07eaa-d1a5-40f7-9e0f-df1bc0221e10 | freegreg/morbidel-timus | misc/Online Contests/2011 September 18/f.cpp | /*
* ACM Timus Online Contest - 18 September 2011
* Problem F - GCD 2010
*/
#include <cstdio>
#include <vector>
#include <map>
#define MAXN 32000
int GCD, N, Ciur[MAXN];
std::vector<int> Large; // each n is a product of small primes and only one large prime (> 31000)
std::vector<int> P, Flag;
std::map<int, int>... | ALGO | 0.999943 | 3.857682 |
d0fb975d-d64c-4533-898d-65d3e1ca8837 | masterboy376/dsa_tutorial | real-problems/queryInSegmentTree.cpp | #include "bits/stdc++.h"
#include <iostream>
#include <vector>
using namespace std;
/*
query
segment trees - query(sum) and update in subarray
conventional: query(sum)-o(n), update-o(1)
prefix array: query(sum)-o(1), update-o(n)
segment trees: query(sum)-o(log(n)), update-o(log(n))
*/
const int N = 1e5 + 2, MOD = 1e9... | ALGO | 0.999812 | 4.935542 |
e4adb109-1138-43a2-b3e5-290807735bfc | JakeMate15/Segmentacion-de-calcificaciones-en-imagenes-de-mastografias | Utileria/SegmentacionCompleta/SegmentacionCompleta.cpp | #include<bits/stdc++.h>
using namespace std;
int n, m;
vector<vector<int>> img, resultado;
vector<vector<bool>> visitados;
bool valido(int, int, int, int);
void dfs(int, int, bool, int, int);
int main() {
cin >> n >> m;
img.resize(n, vector<int>(m));
resultado.resize(n, vector<int>(m));
visitados.re... | ALGO | 0.999683 | 3.519964 |
602ba393-8351-4fed-89f8-43ce715b156d | palilo815/ps | baekjoon/1000/1495.cpp | #include<bits/stdc++.h>
using namespace std;
#define loop(i,n) for(int i=0;i<n;++i)
bool DP[2][1001];
// DP[n][M] : n번 곡을 M의 볼륨으로 연주 가능한가?
int main()
{
cin.tie(NULL), cout.tie(NULL);
ios::sync_with_stdio(false);
int n, s, m, x;
cin >> n >> s >> m;
DP[0][s] = true;
loop(i, n) {
cin >> x... | ALGO | 0.999988 | 3.684881 |
9d1380b9-61c5-4a66-8d5b-be4dea69366f | luyencode/cpp-solutions | solutions/aVdsn9Y1.cpp | /*
Sưu tầm bởi @nguyenvanhieuvn
Thực hành nhiều bài tập hơn tại https://luyencode.net/
*/
#include<stdio.h>
#include<conio.h>
#include<ctype.h>
void UpcaseFile(FILE* inoutFile)
{
char ch;
long pos;
while(!feof(inoutFile))
{
ch = fgetc(inoutFile); // đọc ký tự hiện hành
i... | TOOL | 0.898932 | 3.663037 |
ff5bf9c0-c269-4181-8604-7a1ea126bd3e | ScytheAkira/Basic-Codes | My method of larger number.cpp | #include<iostream>
#include<cmath>
using namespace std;
int main()
{
int x,y;
cout<<"Enter the two numbers \n";
cin>>x;
cin>>y;
cout<<fmax(x,y)<<" is the larger number.";
return 0;
}
| ALGO | 0.998413 | 3.313592 |
8019946d-9286-4937-9181-d8ce427c9647 | ishandutta2007/codeforces | leaf1415/normal/1408/C.cpp | #include <iostream>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <cstdlib>
#include <cassert>
#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <string>
#include <algorithm>
#include <utility>
#define llint long ... | ALGO | 0.999424 | 3.455429 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.