uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
f890190a-d2ec-4d14-a5bd-a10c3b5c32fe | aniketbecoding/Dsa-sheet | movetolast.cpp | #include<iostream>
using namespace std;
// move the last element of linked list to first
class node{
public:
int data;
node* next; //next stores address of the next node so its a pointer data type
node(int val){ //constructor
data=val;
next=NULL;
}
};
void insertattail(node* &hea... | ALGO | 0.99964 | 3.697896 |
e70b94a0-81bc-499f-a9bc-de3c5eb2db64 | irembalikci/file_app_list_interface | 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 |
2a7f74a0-8696-4346-858d-bacc2ba93e84 | Simrankumari-tech/lecture-5 | 3_BubbleSorting.cpp | #include<iostream>
using namespace std;
int main(){
int a[] ={6,0,3,2};
int n= sizeof(a)/ sizeof(int);
for(int i= 0; i<n-1;i++){
for(int j=0; j<n-1-i ;j++){
if(a[j] > a[j+1]){
swap (a[j], a[j+1]);
}
}
}
for(int i= 0; i<n; i++){
cout << a[i] << " ";
}
return 0;
}
| ALGO | 0.999568 | 3.010027 |
0a2818f5-97df-4076-a62c-3a5e6d910ebf | sabernaserifar/RexPoN | src/USER-OMP/pair_lj_cut_omp.cpp | /* ----------------------------------------------------------------------
Contributing author: Axel Kohlmeyer (Temple U)
------------------------------------------------------------------------- */
#include <math.h>
#include "pair_lj_cut_omp.h"
#include "atom.h"
#include "comm.h"
#include "force.h"
#include "neighb... | ALGO | 0.999877 | 6.567935 |
b4a1474c-ef95-4c7d-ad09-5ad83cd5ee1b | h4ck3rm1k3/blink-git-problems | Source/WebCore/platform/graphics/filters/FECustomFilter.cpp | #include "config.h"
#if ENABLE(CSS_SHADERS) && USE(3D_GRAPHICS)
#include "FECustomFilter.h"
#include "CustomFilterRenderer.h"
#include "CustomFilterValidatedProgram.h"
#include "Extensions3D.h"
#include "GraphicsContext3D.h"
#include "RenderTreeAsText.h"
#include "TextStream.h"
#include <wtf/Uint8ClampedArray.h>
na... | TOOL | 0.918047 | 6.776913 |
c85770bc-1769-403b-9061-57478da0b3cd | IMSLGGYU/OpenCV-with-CUDA | opencv_contrib-4.10.0/modules/cudastereo/src/stereobm.cpp | #include "precomp.hpp"
using namespace cv;
using namespace cv::cuda;
#if !defined (HAVE_CUDA) || defined (CUDA_DISABLER)
Ptr<cuda::StereoBM> cv::cuda::createStereoBM(int, int) { throw_no_cuda(); return Ptr<cuda::StereoBM>(); }
#else /* !defined (HAVE_CUDA) */
namespace cv { namespace cuda { namespace device
{
... | ALGO | 0.978249 | 6.564969 |
b3b1c91f-6bab-4239-bcbb-7956d3c1e7de | BillyLjm/LeetCode-Problems | 0063-Unique_Paths_II.cpp | /*******************************************************************************
* 0063-Unique_Paths_II.cpp
* Billy.Ljm
* 12 August 2023
*
* =======
* Problem
* =======
* https://leetcode.com/problems/unique-paths-ii/
*
* You are given an m x n integer array grid. There is a robot initially located
* at the ... | ALGO | 0.999428 | 6.526457 |
e2fde096-d5da-4b8c-9847-801f4973bc2b | andyhero12/PhysicsHeavens | cugl/source/math/polygon/CUPathSmoother.cpp | using namespace cugl;
/* This makes sense as default for touch coordinates */
#define DEFAULT_EPSILON 1
#pragma mark Constructors
/**
* Creates a path smoother with no vertex data.
*/
PathSmoother::PathSmoother() :
_calculated(false),
_epsilon(DEFAULT_EPSILON) {
}
/**
* Creates a path smoother with the given vert... | ALGO | 0.91315 | 7.234439 |
f697f180-f366-4d7a-bd56-89609815e2c9 | KayvanMazaheri/acm | codeforces/263a.beautiful-matrix/263a.cpp | // K1
// :)
#include <iostream>
#include <fstream>
#include <algorithm>
#include <vector>
#include <queue>
#include <bitset>
#include <string>
#include <cmath>
#include <iomanip>
#include <set>
#include <map>
#define EPS 1e-8
#define PI 3.141592653589793
#define point pair <int , int>
#define X first
#define Y second... | ALGO | 0.998188 | 3.164893 |
0ad0c5d0-4f13-4957-8a6c-58e3c107ec28 | aaakshit/Leetcode-solutions | 0101-symmetric-tree/0101-symmetric-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.999992 | 6.341544 |
32b1f9be-018b-4330-a7a3-c020858468aa | shunjilin/UdacityPathPlanningProject | src/Eigen-3.3/bench/geometry.cpp |
#include <iostream>
#include <Eigen/Geometry>
#include <bench/BenchTimer.h>
using namespace std;
using namespace Eigen;
#ifndef SCALAR
#define SCALAR float
#endif
#ifndef SIZE
#define SIZE 8
#endif
typedef SCALAR Scalar;
typedef NumTraits<Scalar>::Real RealScalar;
typedef Matrix<RealScalar,Dynamic,Dynamic> A;
type... | ALGO | 0.941071 | 5.941502 |
9b1b4537-2b16-4b75-b657-1a5aa12abed0 | URSec/detrap-llvm | clang/test/CodeCompletion/function-templates.cpp | namespace std {
template<typename RandomAccessIterator>
void sort(RandomAccessIterator first, RandomAccessIterator last);
template<class X, class Y>
X* dyn_cast(Y *Val);
}
class Foo {
public:
template<typename T> T &getAs();
};
template <typename T, typename U, typename V>
V doSomething(T t, const U &u, V ... | TOOL | 0.91214 | 6.011407 |
51e69d00-16d6-430d-a89c-deb2a41fd057 | miiitomi/algorithm | codes/chapter3/code_3_4.cpp | #include <iostream>
#include <vector>
using namespace std;
const int INF = 20000000;
int main() {
int N, K;
cin >> N >> K;
vector<int> a(N), b(N);
for (int i = 0; i < N; i++) cin >> a[i];
for (int i = 0; i < N; i++) cin >> b[i];
int min_value = INF;
for (int i = 0; i < N; i++) {
fo... | ALGO | 0.999943 | 4.117393 |
0cd19597-c798-49e2-8cbe-d10915386750 | Eduard0803/TEP | uva/Ternary.cpp | #include <bits/stdc++.h>
// link: https://vjudge.net/problem/UVA-11185/origin
using namespace std;
void solution(long long int n)
{
long long int out=0, mod=0, pos=1;
while(n){
mod = n % 3;
n /= 3;
out += mod*pos;
pos *= 10;
}
cout << out << endl;
}
int main()
{
lo... | ALGO | 0.999916 | 3.944935 |
fbc666c4-254d-4192-baa1-0a6b27b344b6 | ishandutta2007/codeforces | vkgainz/normal/840/D.cpp | #include <bits/stdc++.h>
using namespace std;
vector<int> a;
struct query {
int l, r, k, idx;
};
vector<query> in;
vector<int> ret;
void ins(pair<int, int> x, vector<pair<int, int>> &y) {
int sz = 5;
int in = -1;
for (int i = 0; i < sz; i++)
if (y[i].first == x.first)
in = i;
... | ALGO | 0.999983 | 4.365707 |
a92b07f2-3b7c-4a32-bf25-585f224016cf | 10adnan75/Coursera | Data Structures and Algorithms Specialization/Algorithmic Toolbox/week3/4_maximum_advertisement_revenue.cpp | #include <algorithm>
#include <iostream>
#include <vector>
using std::vector;
long long max_dot_product(vector<int> a, vector<int> b) {
std::sort(begin(a), end(a));
std::sort(begin(b), end(b));
long long result = 0;
for (int i = 0; i < a.size(); i++) {
result += (long long) a[i] * b[i];
}
return res... | ALGO | 0.999954 | 4.653412 |
92b7db46-2d65-4c2c-90a2-8d111034e842 | aplqo/exercises | loj/3134-Transport.cpp | #ifdef APTEST
#include "debug_tools/program.h"
#endif
#include <algorithm>
#include <climits>
#include <iostream>
#include <iterator>
using namespace std;
const unsigned int maxn = 1e5;
class Vector {
public:
inline void push_back(const long long v) { *(ptr++) = v; }
inline void clear() { ptr = val; };
long lo... | ALGO | 0.999909 | 3.725225 |
e68fd07a-5572-48ae-bbcc-4dcc33720a25 | wridzer/Grad_HKU | godot-4.4-dev3/thirdparty/graphite/src/Position.cpp | #include "inc/Position.h"
#include <cmath>
using namespace graphite2;
bool Rect::hitTest(Rect &other)
{
if (bl.x > other.tr.x) return false;
if (tr.x < other.bl.x) return false;
if (bl.y > other.tr.y) return false;
if (tr.y < other.bl.y) return false;
return true;
}
Position Rect::overlap(Positio... | TOOL | 0.980607 | 5.634431 |
26eba034-b240-46da-9b52-380ccdaad108 | aleafall/DS-A | leetcode/lc0005.cpp | //
// Created by aleafall on 16-12-6.
//
#include<bits/stdc++.h>
using namespace std;
class Solution {
public:
string longestPalindrome(string s) {
if (s.size()<=2){
return s;
}
string ans;
for (int i = 1; i < s.size() - 1; ++i) {
int j=i-1,k=i+1;
... | ALGO | 0.999964 | 5.470652 |
ca3c0d53-8eef-48a9-ac23-65df48113721 | ImtiazAhmedAkash/Problem-Solving | codeforces/2002/A.cpp | /* In the Name of ALLAH, the most gracious, the most merciful */
// Distanced Coloring
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define nl '\n'
#define deb(x) cerr << #x << " = " << x << nl
const int inf = 1e9;
const ll INF = 1e18;
const int mod = 998244353;
const int N = 2e5 + 5;
void ... | ALGO | 0.999956 | 5.339965 |
981c6fa4-485d-4333-9ecf-ecc848f47fa7 | ishandutta2007/codeforces | stevenkplus/normal/1398/F.cpp | // =========== Template ========== //
#include <bits/stdc++.h>
using namespace std;
int fastio() { ios_base::sync_with_stdio(false); cout << fixed << setprecision(10); cin.tie(nullptr); return 0; }
int __fastio = fastio();
template<typename A, typename B> ostream& operator<<(ostream &os, const pair<A, B> &p);
template<... | ALGO | 0.999974 | 4.16659 |
5422f8ce-d502-44d7-871c-61de78b7f5c5 | sstuqtd/vocal | thridparty/boost/libs/random/performance/generate_table.cpp | #include <vector>
#include <utility>
#include <iostream>
#include <cstring>
#include <fstream>
#include <boost/regex.hpp>
#include <boost/tuple/tuple.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/foreach.hpp>
#include <boost/format.hpp>
#include <boost/multi_index_container.hpp>
#include <boost/multi_index/has... | TOOL | 0.873749 | 6.245142 |
60d05cfd-57c8-4d2d-b759-e570e0f2e1b1 | phong28zk/Dark_Susss_Algorithm | cpp/sctdl030.cpp | #include <bits/stdc++.h>
using namespace std;
#define FAST_IO \
ios_base::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0); \
cerr.tie(0)
typedef long long ll;
#define mp make_pair
#define gl getline
#define pb push_back
#define eb emplace_back
#define... | ALGO | 0.999987 | 5.365971 |
5cae2087-e2dd-4104-a4b0-2c60cd7f25e7 | DIEGOAVELINO/LINGUAGEM | 23.cpp |
#include<stdio.h>
#include<stdlib.h>
#include<locale.h>
main ()
{
setlocale(LC_ALL,"");
int numero,base,potencia=1,cont=0;
printf(" Digite um nmero inteiro: ");
scanf("%d",&numero);
printf("\n Digite uma base positiva: ");
scanf("%d",&base);
while (cont<base)
{
potencia=potencia*numero;
cont++;... | ALGO | 0.999042 | 3.318563 |
9ce723c1-bbbe-4428-8e3a-0f58384813b2 | iNiKe/boost | libs/multi_index/example/ip_allocator.cpp | #if !defined(NDEBUG)
#define BOOST_MULTI_INDEX_ENABLE_INVARIANT_CHECKING
#define BOOST_MULTI_INDEX_ENABLE_SAFE_MODE
#endif
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <algorithm>
#include <boost/interprocess/allocators/allocator.hpp>
#include <boost/interprocess/containers/s... | TOOL | 0.988061 | 5.831622 |
9609aa6a-3313-4403-9952-a98559b7834c | tuna2766/OS | hw1_3_14.cpp | #include <cstring>
#include <iostream>
#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
#include <sys/wait.h>
#include <unistd.h>
using std::cout;
using std::cin;
using std::endl;
int main(int argc, char const *argv[])
{
int n = 0;
pid_t pid;
cout << "Enter a positive integer : " << endl;
wh... | ALGO | 0.999194 | 3.850711 |
8130b752-4068-4faa-819d-b74e9f0ac316 | matthewpeterka/logisim_y-86 | lab_5/prob2.cpp | #include <iostream>
using namespace std;
int main() {
int j,k;
j = 10;
k = 20;
for (int i=0; i <5; i++) {
j = i*2;
k = j+1;
}
cout << "j: " << j << " k: " << k << endl;
}
| ALGO | 0.997113 | 3.24916 |
b37e981d-a0ef-443b-b7c8-3c029e9491f3 | divyanshu1906/LeetCode | counting/minimum-length-of-string-after-operations.cpp | class Solution {
public:
int minimumLength(string s) {
int n = s.size();
if(n<3) return n;
int ans=0;
unordered_map<char, int>mpp;
for(int i=0; i<n; i++){
char ch = s[i];
mpp[ch]++;
}
for(auto it : mpp){
int num = it.second;... | ALGO | 0.999977 | 6.043153 |
73d9a690-496a-41fb-ab51-713ce05d3a65 | robertobbaik/codingtest | 0429/sudoku.cpp | #include <iostream>
#include <vector>
using namespace std;
int N = 9;
vector<vector<int>> board(N, vector<int>(N, 0));
vector<pair<int, int>> blank;
bool isFinish = false;
bool isValid(pair<int, int> p, int num)
{
for (int i = 0; i < N; i++)
{
if (board[p.first][i] == num)
{
retur... | ALGO | 0.999662 | 5.281978 |
232e037d-d8bc-401d-82f5-4d468c993887 | RafoDias/02EDA | Exercícios/Listas/lista2/ex9.cpp | #include "GeradorLista.cpp"
#include <string>
using namespace std;
struct Node {
Node *nextNode = NULL;
int info;
};
Node* CriaListaPadrao()
{
Node *node, *lista;
lista = new Node;
node = lista->nextNode = new Node;
lista->info = 15;
node->info = 1;
return lista;
}
Node* InsereDecres... | ALGO | 0.997311 | 3.999525 |
ff372e0f-f052-44f9-adbf-2c8eb3cc2dd7 | arnav-snowleo/myLeetcodeRepo | 1047-remove-all-adjacent-duplicates-in-string/1047-remove-all-adjacent-duplicates-in-string.cpp | class Solution {
public:
string removeDuplicates(string s) {
if(s.length() == 1) return s;
if(s.length() == 2 && s[0]==s[1]) return "";
string ans;
stack<char> st;
for(int i=0;i<s.length();i++){
if(st.empty()){ ... | ALGO | 0.999988 | 6.426246 |
037dbb24-b24b-480b-963d-5b080980d038 | emonislive/codeforce-problems | c++/2001A.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
#define endl '\n'
void solve(int n) {
vector <int> v;
int c = 1, max = 0;
for (int i = 0; i < n; i++) {
int in;
cin >> in;
v.push_back(in);
}
sort(v.begin(), v.end());
for (int i = 0; i < n -... | ALGO | 0.999856 | 4.950448 |
3d43965f-f3e3-4b01-82df-e014173867f9 | mathgame/MathGame | Libs/Tools/Crc.cpp | #include <sys/types.h>
#include "Crc.h"
namespace CRC
{
static unsigned crc_table[256]=
{
0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3,
0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91,
0x1db71064, 0x6ab020f2, 0xf3b... | TOOL | 0.991514 | 5.070823 |
317297e0-8c7c-4f33-a221-dd47cd87509f | affinity96/2021PS-cpp | BaekJoon/210306/2805.cpp | #include <iostream>
#include <vector>
using namespace std;
int N, M;
vector<long long>tree;
bool possible(long long t){
long long namu = 0;
for(int n=0; n<N; n++){
if(tree[n] > t){
namu += (tree[n] - t);
}
}
if(namu >= M){
return true;
}else{
return fals... | ALGO | 0.999998 | 4.734599 |
50ec35f9-8d98-426b-9d9e-1c1ea78581fd | coleworld223/CP | Graphs/CSES_Graphs/MessageRoute.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
void solve () {
ll n, m;
cin >> n >> m;
vector <vector <ll>> a (n);
for (ll i = 0; i < m; i += 1) {
ll u, v;
cin >> u >> v;
u--; v--;
a[u].push_back(v);
a[v].push_back(u);
}
vector <l... | ALGO | 0.999988 | 4.884249 |
e732cac4-ec73-403e-9a23-090e8d440be6 | PriyanshuGupta1/Leetcode | 421-maximum-xor-of-two-numbers-in-an-array/421-maximum-xor-of-two-numbers-in-an-array.cpp | class TrieNode
{
public:
TrieNode *child[2];
TrieNode(){
this->child[0] = NULL;
this->child[1] = NULL;
}
};
class Solution
{
public:
TrieNode *newNode;
void insert(int x)
{
TrieNode *t = newNode;
bitset<32> bs(x);
for(int j=31; j>=0; j--)
... | ALGO | 0.999991 | 5.609168 |
fa0d88fa-2793-40e7-aa4c-9aaa28e8f39a | hunghayhat/C- | C_intro/week 12/Bai4.cpp | #include<stdio.h>
void khaibao_mang (int *p, int size){
int i;
for (i=0; i< size; i++,p++){
printf("Ptu thu %d: ",i+1);
scanf("%d",p);
}
}
void mang_con(int *p, int size){
int i, j = size, k=0;
for (k=0; k<size; k++){
printf("\n");
for (j=size; j>0; j--){
for (i=k; i<j; i++){
printf("%d ",*(p+i));
... | ALGO | 0.976026 | 3.141343 |
1ad152d9-b502-4e4a-92d6-cecd2da510df | CodeTrans-Research/RefuTra | result/translate/chatgpt/java2cpp/c++/SEARCH_INSERT_AND_DELETE_IN_A_SORTED_ARRAY.cpp | int f_gold(int arr[], int low, int high, int key) {
if (high < low) return -1;
int mid = (low + high) / 2;
if (key == arr[mid]) return mid;
if (key > arr[mid]) return f_gold(arr, (mid + 1), high, key);
return f_gold(arr, low, (mid - 1), key);
} | ALGO | 0.999928 | 4.990609 |
42c4b80f-3045-4ea1-b546-c0a093a6961c | owen-hwlee/leetcode-practice | 0932-monotonic-array/0932-monotonic-array.cpp | class Solution {
public:
bool isMonotonic(vector<int>& nums) {
const size_t size = nums.size();
if (size <= 2) {
// must be monotone
return true;
}
bool is_decr = true;
bool is_incr = true;
for (size_t i = 1; i < size; ++i) {
if ... | ALGO | 0.999961 | 6.37893 |
2dcac580-c764-451f-9a37-3ca4b1b082bc | sanjeev1779/codeforces | 252B.cpp | #include<iostream>
#include<vector>
#include<string.h>
#include<stdio.h>
#include<map>
#include<math.h>
#include<algorithm>
#define LL long long
#define P(N) printf("%d\n",N);
#define S(N) scanf("%d",&N);
#define SL(N) scanf("%lld",&N);
#define pb push_back
#define mp make_pair
using namespace std;
main()
{
// f... | ALGO | 0.999952 | 3.12341 |
36063e04-4b30-4e1f-8e34-b464e3b45336 | michaelyql/cp | cf/dp/2114c.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for (int i = a; i < b; i++)
#define LSOne(S) ((S) & -(S))
#define all(x) (x).begin(), (x).end()
#define debug
#ifdef debug
#define db(x) cout << #x " = " << x << endl;
#define bp(x) cout << #x << endl;
#else
#define db(x)
#define bp(x)
#endif
us... | ALGO | 0.999858 | 5.191112 |
f25842d2-2440-452a-bd24-44d137200390 | popopogg/MyMiniob | deps/common/metrics/histogram_snapshot.cpp | //
// Created by Longda on 2021/4/20.
//
#include "histogram_snapshot.h"
#include <math.h>
#include <stdio.h>
#include <stdexcept>
#include <algorithm>
#include <numeric>
#include <sstream>
namespace common {
HistogramSnapShot::HistogramSnapShot()
{}
HistogramSnapShot::HistogramSnapShot(const std::vector<double> ... | TOOL | 0.977602 | 6.478074 |
5445c572-3959-4a6d-bbec-13be1f617e4a | BRL-CAD/brlcad_externals | opencv/opencv/modules/core/src/lda.cpp | #include "precomp.hpp"
#include <iostream>
#include <map>
#include <set>
namespace cv
{
// Removes duplicate elements in a given vector.
template<typename _Tp>
inline std::vector<_Tp> remove_dups(const std::vector<_Tp>& src) {
typedef typename std::set<_Tp>::const_iterator constSetIterator;
typedef typename s... | ALGO | 0.999653 | 6.232382 |
bc20b7ac-d4b6-40c2-b675-ca4d8f6c721c | candiceyoung/leetcode_solutions | smallest_rectangle_enclosing_black_pixels.cpp | class Solution {
public:
int minArea(vector<vector<char>>& image, int x, int y) {
int row = image.size();
if (row == 0) return 0;
int col = image[0].size();
int left = col, right = -1, up = row, down = -1;
for (int i = 0; i < row; ++i) {
for (int j = 0; j < col; +... | ALGO | 0.999563 | 6.668297 |
52ced682-51e0-4746-9224-f71e970f7802 | ImmanuelBaskaran/HTsim_Starlink | sim/Starlink/eigen3/doc/snippets/MatrixBase_all.cpp | Vector3f boxMin(Vector3f::Zero()), boxMax(Vector3f::Ones());
Vector3f p0 = Vector3f::Random(), p1 = Vector3f::Random().cwiseAbs();
// let's check if p0 and p1 are inside the axis aligned box defined by the corners boxMin,boxMax:
cout << "Is (" << p0.transpose() << ") inside the box: "
<< ((boxMin.array()<p0.array(... | ALGO | 0.993896 | 3.51303 |
8a9a15a2-dce4-425e-a0a6-1182b5d6e8de | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_3715_3.cpp | #include <bits/stdc++.h>
using namespace std;
int a[35000];
int al;
int flag[15];
void dfs(int nn) {
if (nn >= 10) {
int num = 0;
for (int i = 0; i < nn; i++) {
num *= 10;
num += flag[i];
}
a[al++] = num;
return;
}
flag[nn] = 1;
dfs(nn + 1);
flag[nn] = 0;
dfs(nn + 1);
}
int m... | ALGO | 0.999684 | 4.11784 |
3e1a8bef-605c-48b4-8573-2ca79172aa79 | MrinmoyOpsAlpha/Leetcoding | 2207-maximize-number-of-subsequences-in-a-string/2207-maximize-number-of-subsequences-in-a-string.cpp | class Solution {
long long helper(string text, string pattern){
long long ans = 0;
unordered_map<char,long long> mp;
for(auto x:text){
if(x == pattern[1]){
ans = ans + mp[pattern[0]];
}
mp[x]++;
}
return ans;
}
public:
... | ALGO | 0.999992 | 6.129997 |
3b68f6e1-dd7e-4916-89c1-c1d3f819d0ed | xrayFan/xray_history | Editors/DXT/FS.cpp | #include "stdafx.h"
#pragma hdrstop
#include "fs_internal.h"
#pragma warning(disable:4995)
#include <io.h>
#include <direct.h>
#include <fcntl.h>
#include <sys\stat.h>
#pragma warning(default:4995)
#ifdef M_BORLAND
#define O_SEQUENTIAL 0
#endif
//////////////////////////////////////////////////////////////////////
... | TOOL | 0.884452 | 4.505687 |
5b000ad0-8b65-4afd-af58-6e4cedfff08a | primebipin/Leetcode_questions_solved | 1002-maximum-width-ramp/maximum-width-ramp.cpp | class Solution {
public:
int maxWidthRamp(vector<int>& nums) {
stack<int> st;
for(int i=0;i<nums.size();i++){
if(st.empty() || nums[st.top()]>nums[i]){
st.push(i);
}
}
int ans=0;
for(int i=nums.size()-1;i>ans;i--){
while(!s... | ALGO | 0.999987 | 6.118285 |
1e89a13e-9ebf-40b8-983d-ec8dc4bfae49 | m4oughi/100DaysofCode | pureCPP/0037. Day 37/Standard Template Library Basics/010. Sequence Containers - List/012. Implementing Queue Operations with stdlist/main.cpp | #include <iostream>
#include <list>
int main() {
std::list<int> queue;
queue.push_back(1);
queue.push_back(2);
queue.push_back(3);
while (!queue.empty()) {
std::cout << "Front element: " << queue.front() << "\n";
queue.pop_front();
}
return 0;
}
| ALGO | 0.983212 | 4.298712 |
db6f8805-7f1e-4f69-840c-65f2a7b5724a | WANDOKING/BOJ | C++/01145 적어도 대부분의 배수.cpp | #include <iostream>
#include <climits>
int main(void)
{
const int MAX = 5;
int nums[MAX];
for (int i = 0; i < MAX; i++)
{
scanf("%d", &nums[i]);
}
for (int i = 1; i < INT_MAX; i++)
{
int count = 0;
for (int j = 0; j < MAX; j++)
{
if (i %... | ALGO | 0.999906 | 4.065669 |
83ac0d79-86a8-477b-b1c8-abf9759dff29 | ishandutta2007/codeforces | smax/normal/1416/A.cpp | #include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#define DEBUG(...) debug(#__VA_ARGS__, __VA_ARGS__);
#else
#define DEBUG(...) 6;
#endif
template<typename T, typename S> ostream& operator << (ostream &os, const pair<T, S> &p) {return os << "(" << p.first << ", " << p.second << ")";}
template<typename C, typ... | ALGO | 0.999786 | 4.274349 |
55898f45-e555-4a4e-8d67-4c02c58b9a00 | nahid0335/Problem-solving | uva/12708.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
unsigned long long t,n;
cin>>t;
while(t--)
{
cin>>n;
cout<<(n>>1)<<endl;
}
re... | ALGO | 0.999808 | 4.522805 |
b7dc5058-6ee5-4b20-bb1f-e87120885616 | RisingOS-XTI/android_external_skia | src/effects/imagefilters/SkBlurImageFilter.cpp | #include <algorithm>
#include "include/core/SkBitmap.h"
#include "include/core/SkTileMode.h"
#include "include/effects/SkImageFilters.h"
#include "include/private/SkColorData.h"
#include "include/private/SkTFitsIn.h"
#include "include/private/SkTPin.h"
#include "include/private/SkVx.h"
#include "src/core/SkArenaAlloc.... | TOOL | 0.985888 | 7.602571 |
6775feb6-324d-4c7a-b84c-3fc26b7c7a80 | keenonhh/Thanos-Endgame | characters/Spiderman.cpp | /******************************************************************************
** Program name: Thanos_Endgame
** Author: Keenon Hunsaker
** Date: 1/24/22
** Description: This is the Spiderman class function definition file
that contains the function for spiderman to battle
thanos
********************... | ALGO | 0.965544 | 5.302026 |
f6bf564d-a7b6-4a6f-951b-73e900fcba11 | wangmu0701/ColPackDev | BipartiteGraphPartialColoring/BipartiteGraphPartialOrdering.cpp | #include "ColPackHeaders.h"
using namespace std;
namespace ColPack
{
//Private Function 2301
int BipartiteGraphPartialOrdering::CheckVertexOrdering(string s_VertexOrderingVariant)
{
if(m_s_VertexOrderingVariant.compare(s_VertexOrderingVariant) == 0)
{
return(_TRUE);
}
if(m_s_VertexOrderingVariant.compa... | ALGO | 0.999213 | 4.513577 |
eb7505eb-9b85-4a08-8951-1eb805b1728c | Darjeeling47/All-CEDT-code | chula prog/5-array/04_Array_24.cpp | #include <bits/stdc++.h>
using namespace std;
int a[100];
int n, n1;
int swp(int x){
int mid = x / 2;
if(x == 1){
return 0;
}
for(int i = 1; i <= mid; i++){
int tmp;
tmp = a[i];
a[i] = a[x - i + 1];
a[x - i + 1] = tmp;
}
for(int i = 1; i <= n; i++){
... | ALGO | 0.999993 | 4.031663 |
e1baf931-981d-4825-a36d-e8c9ca1b356b | pixelled/Rain-Sim | ext/nanogui/ext/eigen/doc/examples/Tutorial_ArrayClass_cwise_other.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace Eigen;
using namespace std;
int main()
{
ArrayXf a = ArrayXf::Random(5);
a *= 2;
cout << "a =" << endl
<< a << endl;
cout << "a.abs() =" << endl
<< a.abs() << endl;
cout << "a.abs().sqrt() =" << endl
<< a.abs().sqrt() << endl... | ALGO | 0.964964 | 3.146753 |
936048ee-e513-41e3-b87e-7c58b188a842 | DEEZZU/Traditional-Cpp-Programs | PRACTICE/PRACTICE/LinearSearch.cpp | #include <iostream>
using namespace std;
//************ ITERATIVE ***********************
int linearSearch(int arr[],int size,int element)
{
int i;
for(i=0;i<size;i++)
{
if(arr[i]==element)
return (i+1) ;
}
return -1;
}
//************RECURSIVE*************************
int line... | ALGO | 0.999829 | 5.027864 |
7ae92955-5446-4522-b1f8-bfe1a5124562 | B3TA-BLOCKER/Computing-and-Artificial-Intelligence | Practise Questions/Number_of_1_Bits.cpp | #include <iostream>
using namespace std;
int main(){
uint32_t x=000001011;
uint32_t y=111111111;
cout<<(x&y);
return 0;
} | ALGO | 0.999917 | 4.386612 |
83818943-826b-47f8-9429-1fdaa8ce82fb | aayushsenapati/GP_codes | unit_1_2/DefineConstant.cpp | #include <iostream>
using namespace std;
//defining constant
#define PI 3.14
//function to calculate area of circle
float circle(float radius)
{
return PI*radius*radius;
}
//function to calculate area of cylinder
float cylinder(float radius,float height)
{
return (2*PI*radius*height)+(2*PI*radius*radius);
}
... | ALGO | 0.987934 | 4.296903 |
0e33bb3d-03e0-4666-b37d-7f8d4266aac3 | EskemaGames/2DEnginePhysics | Engine2D/Box2D/Dynamics/Joints/b2RevoluteJoint.cpp | #include <Box2D/Dynamics/Joints/b2RevoluteJoint.h>
#include <Box2D/Dynamics/b2Body.h>
#include <Box2D/Dynamics/b2TimeStep.h>
// Point-to-point constraint
// C = p2 - p1
// Cdot = v2 - v1
// = v2 + cross(w2, r2) - v1 - cross(w1, r1)
// J = [-I -r1_skew I r2_skew ]
// Identity used:
// w k % (rx i + ry j) = w * (-r... | ALGO | 0.973852 | 7.655348 |
b4140295-9968-438b-a5e0-29de1ff2caa0 | sncheca/gyro | source/resonance_audio/third_party/eigen/bench/perf_monitoring/lazy_gemm.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <Eigen/Core>
#include "../../BenchTimer.h"
using namespace Eigen;
#ifndef SCALAR
#error SCALAR must be defined
#endif
typedef SCALAR Scalar;
template<typename MatA, typename MatB, typename MatC>
EIGEN_DONT_INLINE
void lazy_gemm(const MatA &A, const Ma... | TOOL | 0.963352 | 6.077229 |
80cd7dc4-fb6a-447b-9c1c-7558909fbb12 | weizhouUMICH/SAIGE | thirdParty/bgen/3rd_party/boost_1_55_0/libs/spirit/phoenix/example/users_manual/factorial.cpp | #include <vector>
#include <algorithm>
#include <iostream>
#include <boost/spirit/include/phoenix_core.hpp>
#include <boost/spirit/include/phoenix_function.hpp>
using namespace boost::phoenix;
using namespace boost::phoenix::arg_names;
using namespace std;
struct factorial_impl
{
template <typename Arg>
struc... | TOOL | 0.984489 | 5.611086 |
579f841f-cd26-48ca-a9a4-8ad25af9b8ff | DragAditya/ds | bubblesort.cpp | #include <iostream>
using namespace std;
class BubbleSort
{
int a[20],i,j,n,temp;
public:
void getdata();
void BSort();
void display();
};
void BubbleSort::getdata()
{
cout<<"Enter how many elements: ";
cin>>n;
cout<<"Enter elements: ";
for(i=1;i<=n;i++)
{
cin>>a[i];
}
}
... | ALGO | 0.999275 | 4.436444 |
f50a5755-106e-4e27-ae2a-74052db0036e | ishandutta2007/codeforces | toxel/normal/901/C.cpp | #include<bits/stdc++.h>
const int N = 800010;
struct edge{
int v, n;
};
edge e[N];
int head[N], tot = 1;
inline void add_edge(int u, int v){
e[++ tot] = {v, head[u]}, head[u]=tot;
e[++ tot] = {u, head[v]}, head[v]=tot;
}
class Tarjan{
private:
int st[N], top;
std::stack <int> stack... | ALGO | 0.999969 | 4.162613 |
704c4049-529a-431a-a816-d7da8ab27c85 | SonK4m3/Data-Structure-Algorithms-CodePTIT | Sắp xếp - Tìm kiếm/DSA06024_Sap_xep_chon.cpp | #include <stdio.h>
#include <stdlib.h>
void InMang(int arr[], int n)
{
int i;
for (i = 0; i < n; i++)
{
printf("%d ", arr[i]);
}
printf("\n");
}
void SapXepChon(int arr[], int n)
{
int t=1;
for (int i = 0; i < n - 1; i++)
{
int min = i;
for (int j = i + 1; j < ... | ALGO | 0.999923 | 4.221467 |
f3ab0492-ead0-48a9-ad8c-ee1301c1090f | 8057vivek/Leetcode | 0300-longest-increasing-subsequence/0300-longest-increasing-subsequence.cpp | class Solution {
public:
int recursion(int i,int prev, vector<int>& nums, vector<vector<int>>& dp){
if(i==nums.size()){
return 0;
}
if(dp[i][prev+1]!=-1){
return dp[i][prev+1];
}
int Nottake = recursion(i+1,prev,nums,dp);
int take=0;
if... | ALGO | 0.999996 | 5.931807 |
bca4c8b0-6fcc-4eb1-afd3-34da8a1513ac | sekul-hassan/Data-Structure | Greedy_Job_Selection.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define N '\n'
vector<pair<ll,ll>>m;
vector<ll>st,ed;
void make_pair(ll n)
{
ll i;
for(i=0;i<n;i++){
m.push_back({ed[i],st[i]});
}
}
void solve()
{
ll n,i,j,work = 0;
int s,e;
cin>>n;
for(i=0;i<n;i++){
cin>>s;... | ALGO | 0.999848 | 4.10847 |
1addafc8-564b-4d27-8be4-ab83196c29f0 | dlvguo/NoobOJCollection | LeetCode/Normal/1400-1499/1442.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution
{
public:
int countTriplets(vector<int> &arr)
{
int n = arr.size();
vector<int> s(n + 1);
for (int i = 0; i < n; ++i)
{
s[i + 1] = s[i] ^ arr[i];
}
int ans = 0;
for (int i = 0; i < n;... | ALGO | 0.999948 | 5.060105 |
c8922bcb-b7ea-4556-a16e-ebc460022c22 | ioz9/lewa_code_frameworks | base/media/libstagefright/codecs/aacdec/init_sbr_dec.cpp | /*----------------------------------------------------------------------------
; INCLUDES
----------------------------------------------------------------------------*/
#ifdef AAC_PLUS
#include "init_sbr_dec.h"
#include "aac_mem_funcs.h"
#include "extractframeinfo.h"
/*--------------------------------------... | TOOL | 0.963764 | 5.569074 |
62d17bca-ec95-4625-a7f5-e654372b04a3 | udaykiran1105/cpp-code-samples | quick_sort.cpp | /*
* quick_sort.cpp
*
* Created on: Jul 22, 2016
* Author: Uday Kiran
*/
#include <iostream>
using namespace std;
int partition(int *A, int start, int end){
int pivot = A[end]; //no pivot randomization here
int pIndex = start; //partition index
for(int i=start;i<end;i++){
if(A[i]<=pivot){
swap(A[i],A... | ALGO | 0.999858 | 5.169386 |
14db77b8-8549-4331-95a9-e5ebe2e72e1b | rt3310/algorithm | elice_challenge/2.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(NULL);
int n, m;
cin >> n >> m;
int arr[n];
for (int i = 0; i < n; i++) {
cin >> arr[i];
}
for (int i = 0; i < m; i++) {
int s, e, k;
... | ALGO | 0.999994 | 4.55208 |
f1a49922-5261-4a99-8ec4-8f63cd334a56 | One-Fist-Man/UVA-solutions | 572 - Oil Deposits.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define memeset(arr,a) memset(arr,a,sizeof arr);
#define inf 1000000000000000
char arr[105][105];
ll x[8]= {0,0,-1,1,1,-1,-1,1};
ll y[8]= {-1,1,0,0,-1,-1,1,1};
ll n,m;
ll visit[105][105];
ll ans=0;
void bfs(ll a,ll b)
{
if(arr[a][b]=='@'&&visit[a][b]... | ALGO | 0.999574 | 4.218275 |
acc1718b-e64c-4853-8c61-98c0d432bcb6 | euidong/BOJ | 11505/main.cpp | #include <iostream>
#include <vector>
using namespace std;
const long long DIVIDER = 1000000007;
vector<long long> make_seg_tree(const vector<int>& nums) {
int half = 1; while(half < nums.size()) half <<= 1;
vector<long long> seg_tree(half<<1, 1);
for (int i = 0; i < nums.size(); ++i)
seg_tree[i+... | ALGO | 0.99998 | 5.132812 |
2168313c-a2d9-4316-b6aa-30c2421ca55d | lychees/ACM-Training | Note/集训队作业/2014/作业1/试题泛做/dhh1995/MyCode/icpc2011/K/K.cpp | #include<cstdio>
#include<cmath>
#include<algorithm>
using namespace std;
#define rep(i,n) for (int i=0;i<n;++i)
int n,Case;
struct node{
double x,y; node(){}
node(double _x,double _y):x(_x),y(_y){}
node operator -(const node &A){return node(x-A.x,y-A.y);}
double operator ^(const node &A){return x*A.y-y*A.x;}
doub... | ALGO | 0.999681 | 3.710295 |
9b5f090c-57b7-42c2-b64a-bbe20d52f940 | ZakariaAK94/Programming_Advice_Learning | Problem_Solving3/Ex40_Create_JoinString_Overloading.cpp | #include <iostream>
#include<string>
#include<vector>
using namespace std;
string JoinString(vector<string> vString, string Delim)
{
string S1 = "";
for (string& Word : vString)
{
S1 = S1 + Word + Delim;
}
return S1.substr(0, S1.length() - Delim.length());
}
string JoinString(string arrSt... | ALGO | 0.995184 | 4.430283 |
1e7007cc-6991-4c27-9861-f707c378d908 | suzynotsusie/Computer | CPP/OnThiHSG/CAC DANG BAI TAP THI _1/XEPGACH.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
int main() {
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
ll n;
cin >> n;
ll a[n + 5];
ll total = 0;
for (int i = 0; i < n; i++) {
cin >> a[i];
total += a[i];
}
if (total % n != 0) {
cout << -1;
return 0;
} else {
ll avr = t... | ALGO | 0.999952 | 3.468012 |
ca03b875-754f-4cec-8aa1-c4367b08f4fd | virel-project/randomvirel | src/tests/runtime-distr.cpp |
#include <thread>
#include "utility.hpp"
#include "stopwatch.hpp"
#include "../dataset.hpp"
#include "../vm_compiled.hpp"
#include "../blake2/blake2.h"
struct Outlier {
Outlier(int idx, double rtime) : index(idx), runtime(rtime) {}
int index;
double runtime;
};
int main(int argc, char** argv) {
constexpr int dis... | TOOL | 0.879809 | 5.77409 |
386a8cb5-41c1-44ba-b639-8e4ce83d278b | Aashnan12/30_Days_Of_LeetCode | 1046-max-consecutive-ones-iii/1046-max-consecutive-ones-iii.cpp | class Solution {
public:
int longestOnes(vector<int>& nums, int k) {
int maxi = 0;
int l=0,r=0;
int n = nums.size();
int cnt = 0;
while(r<n){
if(nums[r] == 0){
cnt++;
}
while(cnt > k){
if(nums[l] == 0){
... | ALGO | 0.999967 | 6.236761 |
a7a8849f-46af-4ab8-ab27-12980c1b1e8e | cezainmajeed/Arsh-Goyal-30-day | Goldman-Sachs/13.Decode the string.cpp | class Solution{
public:
string decodedString(string s){
// code here
stack<int> st1;
stack<string> st2;
string ans;
int num=0;
for(int i=0;i<s.length();i++)
{
if(s[i]>='0' && s[i]<='9')
{
num*=10;
... | ALGO | 0.999207 | 6.335834 |
8aac5b51-a79c-4141-811d-4e831659bf1f | elvin-hwang/Tile-Island | ext/opencv/sources/modules/photo/src/align.cpp | #include "precomp.hpp"
#include "opencv2/photo.hpp"
#include "opencv2/imgproc.hpp"
#include "hdr_common.hpp"
namespace cv
{
class AlignMTBImpl CV_FINAL : public AlignMTB
{
public:
AlignMTBImpl(int _max_bits, int _exclude_range, bool _cut) :
name("AlignMTB"),
max_bits(_max_bits),
exclude_ra... | TOOL | 0.965279 | 5.323123 |
32fb99bb-0878-4537-bd24-8866cdabfb0d | chihirooooooooo/LeetCode | 0876-middle-of-the-linked-list/0876-middle-of-the-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) {}
* };
*/
class Solution {
public:
ListNode* middleNode(... | ALGO | 0.999899 | 5.738183 |
581e11db-7f7e-4108-a737-51b53aae0c43 | ranak8811/Codeforces | VanyaandLanterns.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <iomanip>
using namespace std;
int main() {
int n, l;
cin >> n >> l;
vector<int> lanterns(n);
for (int i = 0; i < n; i++) {
cin >> lanterns[i];
}
sort(lanterns.begin(), lanterns.end());
int max_distance = 0;
... | ALGO | 0.999872 | 3.88936 |
f9af2fc1-f852-4992-b5e8-d12648a642fa | Kartikay-Mehrotra/Leetcode | 0127-word-ladder/0127-word-ladder.cpp | class Solution {
public:
int ladderLength(string beginWord, string endWord, vector<string>& wordList) {
unordered_set<string> s(wordList.begin(),wordList.end());
queue<pair<string,int>> q;
q.push({beginWord,1});
s.erase(beginWord);
while(q.size())
{
string... | ALGO | 0.999993 | 5.72613 |
d24f036c-dd99-4359-a0ad-216454f26189 | Rajmeet/DSA | C++/Miscellaneous Questions/sieveofEratosthenes.cpp | #include <iostream>
#include <algorithm>
using namespace std;
void primeSieve(int n) {
int prime[100] = {0};
for(int i = 2; i<=n; i++) {
if(prime[i] == 0) {
for(int j = i*i; j <=n; j+=i) {
prime[j] = 1;
}
}
}
for(int i = 2; i<=n; i++) {
if... | ALGO | 0.999897 | 4.398493 |
fa36951f-059d-4de4-8f3e-00a5aeffcd9b | Shakil-Ahmmed8882/phitron | source/Basic_DSA/assignments/__2/reverse_it.cpp |
#include <bits/stdc++.h>
using namespace std;
class Student
{
public:
string name;
int cls;
string section;
int id;
};
int main()
{
int t;
cin >> t;
Student student[t];
for (int i = 0; i < t; i++)
{
cin >> student[i].name >> student[i].cls >> student[i].section >> stud... | ALGO | 0.99873 | 3.761026 |
f30fd97e-e073-45c1-ace1-74858e12601a | vaish0403/HPC_lab | PracticalNo5/Que1/ring_blocking.cpp | //2018BTECS00060
#include <mpi.h>
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char** argv) {
MPI_Init(NULL, NULL);
int world_rank;
MPI_Comm_rank(MPI_COMM_WORLD, &world_rank);
int world_size;
MPI_Comm_size(MPI_COMM_WORLD, &world_size);
char name[80];
int length;
MPI_Get_pro... | ALGO | 0.993203 | 3.85356 |
b9a3ed19-0b09-48d9-92a6-dad39713a1a3 | charbossly/i_am_rich | 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 |
05368990-036b-4220-bc2b-efaad8fe7dc2 | YoonDongGeun/algorithm_study | 인수경/0923/백준_2167_2차원배열의합.cpp | #include <iostream>
using namespace std;
int main(void)
{
int n, m, k;
scanf("%d %d", &n, &m);
int arr[n][m];
for (int i = 0; i < n; i++)
{
for (int j = 0; j < m; j++)
{
scanf("%d", &arr[i][j]);
}
}
scanf("%d", &k);
for (int i = 0; i < k; i++)
{
int a, b, x, y, sumV;
scan... | ALGO | 0.998652 | 3.546268 |
17e51913-246a-47a4-be3f-3f7012b8b7e5 | SONSAZANG/Algorithm | 프로그래머스/1/159994. 카드 뭉치/카드 뭉치.cpp | #include <bits/stdc++.h>
using namespace std;
string solution(vector<string> cards1, vector<string> cards2, vector<string> goal) {
bool isCan = true;
reverse(cards1.begin(), cards1.end());
reverse(cards2.begin(), cards2.end());
int i = 0;
while(i < goal.size()) {
if (goal[i] == cards1[... | ALGO | 0.999972 | 5.801704 |
9b126d1e-b61a-47a3-8748-3168bbdd8258 | gabrielcassolbach/programming_training | cses-problem-set/Common Divisors.cpp | #include <bits/stdc++.h>
using namespace std;
#define fastio ios_base::sync_with_stdio(0); cin.tie(0);
#define MAX 1123456
int input[MAX];
int main() {
fastio;
int n; cin >> n;
memset(input, 0, sizeof input);
for(int i = 0; i < n; i++){
int val; cin >> val;
input[val]++;
}
int ans = 1;
for(... | ALGO | 0.999952 | 3.588943 |
b77f30f9-6960-4595-aaf8-407b4ab8f474 | HaykDanghyan/Algorithms | Sorting Algorithms/quickSort.cpp | #include <iostream>
#include <vector>
template <typename T>
int partition(std::vector<T>& vec, int l, int r) {
auto pivot = vec[r];
int i = l - 1;
for (int j = l; j < r; ++j) {
if (vec[j] < pivot) {
++i;
std::swap(vec[i], vec[j]);
}
}
std::swap(vec[i + 1], ve... | ALGO | 0.999845 | 5.717457 |
74d812a4-4f9b-4b4f-a457-0e046487af5b | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_7620_1.cpp | #include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 5;
const int INF = 0x3f3f3f3f;
int a[maxn], d[maxn], vis[maxn];
int n;
bool val(int pos) { return pos >= 1 && pos <= n; }
int dfs(int pos) {
if (d[pos]) return d[pos];
vis[pos] = true;
int l = pos - a[pos], r = pos + a[pos];
d[pos] = -1;
if ... | ALGO | 0.999985 | 3.526127 |
9b1073d6-2ae9-4221-94e9-d7144d53d03b | HMRUHUL/CP | .history/lc/78. Subsets_20230915005516.cpp | #include<bits/stdc++.h>
using namespace std;
class Solution {
public:
vector<vector<int>> subsets(vector<int>& nums) {
}
};
int main(){
vector<int> nums;
nums.push_back(1);
nums.push_back(2);
nums.push_back(3);
nums.push_back(4);
nums.push_back(5);
nums.push_back(6);
nums.pu... | ALGO | 0.999783 | 5.286774 |
47811f5b-0c58-4c26-bbb8-ba54ee37244c | 6o9puH/Labs_PSTU | Sem_2/Labs/15_0menu/menu.cpp | #include <iostream>
using namespace std;
int* createArray(int n, int max, int min)
{
srand(time(0));
int* a = new int[n];
for (int i = 0; i < n; i++)
{
a[i] = rand() % max + min;
cout << a[i] << " ";
}
cout << endl << endl;
return a;
}
int* bucketSort(int* a, int bsize)
{
int max = a[0], del = 1;
co... | ALGO | 0.999784 | 3.677506 |
9f8dcd19-adae-4c4b-a0e0-ffe969a8fbe0 | minketmon/algorithm_cpp | SAMSUNG/SWEA10507_영어공부.cpp | #include <iostream>
#include <cstring>
using namespace std;
int n, chance, ans, study[200001];
int main() {
cin.tie(nullptr);
ios::sync_with_stdio(false);
//freopen("input.txt", "r", stdin);
int tc, t;
cin >> t;
for (tc = 1; tc <= t; tc++) {
ans = 0;
memset(study, 0, sizeof(stu... | ALGO | 0.998872 | 3.271261 |
9f7571d4-df38-4ad2-889d-84d297038c78 | fossabot/testing_library | subfolder/libs/serialization/src/extended_type_info.cpp | /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// extended_type_info.cpp: implementation for portable version of type_info
// See http://www.boost.org for updates, documentation, and revision history.
#if (defined _MSC_VER) && (_MSC_VER == 1200)
# pragma warning (disable : 4786) //... | TOOL | 0.891686 | 6.685061 |
3fac6753-fdc7-47c7-8df4-2021205b73c3 | VenioFerreira1973/Curso_Flutter | expenses_bkp/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.99842 | 6.76073 |
648a0739-b8cf-4e4c-ba87-2631e60ad18e | anima20/prac_c- | array_challenge_google1.cpp | #include<iostream>
using namespace std;
void g_array(int arr[] , int n)
{
int break_day=0;
int max_visit=INT_FAST16_MIN;
//int no_visitor=0;
for(int i=0 ; i<n ; i++)
{
cout<<"\n no o visitor" <<max_visit;
cout<<"\narr[i] = "<<arr[i];
if(max_visit < arr... | ALGO | 0.999905 | 4.006985 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.