uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
d5152fb5-ddf4-4269-9be4-a615f9de35b7 | sharmakavya7/Codeforces_solutions | C_Woodcutters.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>
#include <cstring>
#include <cstdlib>
#include <string>
#include <map>
#include <climits>
#include <iterator>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <utility>
#include <deque>
#include <queue>
#include <sta... | ALGO | 0.999969 | 4.632021 |
ed7a9473-5444-45a8-99e2-ee5a8529bf52 | nenowoDev/daily-leetcode | solved/200. Number of Islands/main.cpp | #include <vector>
#include <iostream>
using namespace std;
class Solution {
public:
void dfs(vector<vector<char>>& grid,int i,int j){
grid[i][j]='0';
if(i+1<grid.size()&&grid[i+1][j]=='1') dfs(grid,i+1,j);
if(j+1<grid[0].size()&&grid[i][j+1]=='1') dfs(grid,i,j+1);
if(i-1>=0&&... | ALGO | 0.99986 | 6.148264 |
3c2c50f8-02b3-4599-a8d0-3c64a0e4097f | QinghaoHu/programming | algo/d/p1313/a.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i, a, n) for (int i = a; i < n; i++)
#define per(i, a, n) for (int i = a; i >= n; i--)
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define fi first
#define se second
#define arr array
#define SZ(x) ((in... | ALGO | 0.999962 | 4.406703 |
4e6bb9a0-180b-4941-a2e0-31a7efbcdb29 | robustrobotics/eigen | lapack/lu.cpp | #include "common.h"
#include <Eigen/LU>
// computes an LU factorization of a general M-by-N matrix A using partial pivoting with row interchanges
EIGEN_LAPACK_FUNC(getrf,(int *m, int *n, RealScalar *pa, int *lda, int *ipiv, int *info))
{
*info = 0;
if(*m<0) *info = -1;
else if(*n<0) ... | ALGO | 0.999117 | 5.816733 |
a49f6d3e-2397-4d47-8d3f-842349023ed7 | j-a-i-a-n-a-n-d/Leetcode-Problems | 0050-powx-n/0050-powx-n.cpp | class Solution {
public:
double myPow(double x, int n)
{
double ans = 1.0;
long long nn = (n<0)?(-1 * long(n)):n;
while(nn>0)
{
if(nn%2==1){
ans = ans*x;
nn--;
}
else{
x=x*x; //binary exponentiat... | ALGO | 0.999741 | 5.997364 |
34e83364-0cf2-416c-a33d-8e6d18dd98e6 | ygeorgi/MPACK | mlapack/library/Rsytd2.cpp | #include <mblas.h>
#include <mlapack.h>
void Rsytd2(const char *uplo, INTEGER n, REAL * A, INTEGER lda, REAL * d, REAL * e, REAL * tau, INTEGER * info)
{
INTEGER upper;
INTEGER i;
REAL taui, alpha;
REAL Zero = 0.0, Half = 0.5, One = 1.0;
*info = 0;
upper = Mlsame(uplo, "U");
if (!upper && ... | ALGO | 0.999964 | 4.083785 |
a8140996-a0ed-43cd-921e-94d2f61bab93 | AmbiqAI/edgeimpulse-examples | fomo/apollo4/src/edge-impulse/edge-impulse-sdk-beer/dsp/image/processing.cpp | #include "edge-impulse-sdk/dsp/ei_utils.h"
#include "edge-impulse-sdk/porting/ei_classifier_porting.h"
#include "edge-impulse-sdk/dsp/returntypes.hpp"
#include "edge-impulse-sdk/dsp/image/processing.hpp"
namespace ei { namespace image { namespace processing {
/**
* @brief Convert YUV to RGB
*
* @param rgb_out Outp... | ALGO | 0.884311 | 6.839393 |
2b1a3a23-dabc-452e-af7b-ac35ee1ddd01 | syedalthafjan510/DSA | Selection Sort.cpp | #include <bits/stdc++.h>
using namespace std;
void selection_sort(vector<int>& v)
{
int i,j,n=v.size(),index;
for(i=n-1;i>0;i--)
{
index=i;
for(j=i-1;j>=0;j--)
{
if(v[j] >= v[index])
index=j;
}
cout<<index<<" ";
swap(v[i],v[index]);
... | ALGO | 0.999906 | 4.572074 |
84d6fa3d-ba2b-43fe-ad9d-a9064062344b | Prathmesh311/DSA | Tree/MaximumDepthofN-aryTree.cpp | /*
// Definition for a Node.
class Node {
public:
int val;
vector<Node*> children;
Node() {}
Node(int _val) {
val = _val;
}
Node(int _val, vector<Node*> _children) {
val = _val;
children = _children;
}
};
*/
class Solution {
public:
int traversal(Node* root){
... | ALGO | 0.999876 | 6.330237 |
9e036a8c-dfb0-46ca-93c7-3acb0956efd2 | Slygoross/DSA-Codes | 88. Merge Sorted Array.cpp | // My Approach;
class Solution {
public:
void merge(vector<int>& nums1, int m, vector<int>& nums2, int n) {
int right1 = nums1.size()-1;
int right2 = n - 1;
for(int i = right1; i > m - 1; i--){
nums1[i] = nums2[right2];
right2--;
}
sort(nums1.begin()... | ALGO | 0.999978 | 5.481601 |
68baeb28-5db1-471c-9e56-e72c04df78ef | next-step-for-interview-prep/Daily-leetcode-problem_with_detailed_solutions | 188-6th_July-Pass_the_pillow/code.cpp | class Solution
{
public:
int passThePillow(int n, int time)
{
int N = 2 * n - 2, x = time % N;
return 1 + ((x < n) ? x : N - x);
}
}; | ALGO | 0.999962 | 5.64473 |
65789e56-8f98-479c-bf76-e86ec355d37e | ProgramTraveler/leetcode | Leetcode_Question/1605.给定行和列的和求可行矩阵.cpp | /*
* @lc app=leetcode.cn id=1605 lang=cpp
*
* [1605] 给定行和列的和求可行矩阵
*/
// @lc code=start
class Solution {
public:
vector<vector<int>> restoreMatrix(vector<int>& rowSum, vector<int>& colSum) {
int m = rowSum.size(), n = colSum.size();
vector<vector<int>> res(m, vector<int>(n)); // m 行 n 列的数组
... | ALGO | 0.999985 | 6.522877 |
d3f109cb-b6bb-4d8f-8b2e-768c8193a312 | openkylin/llvm-toolchain-9 | llvm/lib/CodeGen/RenameIndependentSubregs.cpp | #include "LiveRangeUtils.h"
#include "PHIEliminationUtils.h"
#include "llvm/CodeGen/LiveInterval.h"
#include "llvm/CodeGen/LiveIntervals.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/Passes.h"
#include ... | TOOL | 0.953943 | 3.548628 |
efe2ec1b-470d-4db9-8199-a695c52af415 | rohittp0/-2-CS-Practicals | C++/Vowels in a String.cpp | #include <iostream>
using namespace std;
int main()
{
char *string = new char(), vowels[] = "AEIOUaeiou";
int count = 0;
cout << "Enter the String." << '\n';
cin >> string;
for (int i = 0; *(string + i) != '\0'; i++)
for (int j = 0; vowels[j] != '\0'; j++)
if (*(string + i) =... | ALGO | 0.995138 | 5.017707 |
909266e8-ff00-4dfb-97ad-41298bab38ac | TeamBitBean/BitBean-eComStation-Core | src/zerocoin/Params.cpp | /**
* @file Params.cpp
*
* @brief Parameter class for Zerocoin.
*
* @author Ian Miers, Christina Garman and Matthew Green
* @date June 2013
*
* @copyright Copyright 2013 Ian Miers, Christina Garman and Matthew Green
* @license This project is released under the MIT license.
**/
#include "Zeroco... | TOOL | 0.884522 | 6.621742 |
34bad030-0a4c-465a-b55f-33f5a545211b | GregorMuenker/lasso-python | example_packages/numpy-2.0.0rc1/numpy/_core/src/npysort/x86_simd_argsort.dispatch.cpp | #include "x86_simd_qsort.hpp"
#ifndef __CYGWIN__
#if defined(NPY_HAVE_AVX512_SKX)
#include "x86-simd-sort/src/avx512-64bit-argsort.hpp"
#elif defined(NPY_HAVE_AVX2)
#include "x86-simd-sort/src/avx2-32bit-half.hpp"
#include "x86-simd-sort/src/avx2-32bit-qsort.hpp"
#include "x86-simd-sort/src/avx2-64bit-qsort.hpp"
#incl... | ALGO | 0.999116 | 6.030866 |
9da6b90a-e29c-4cc4-b3f0-c1e4ff2edf98 | Ttoru140/Compiler_Design_Lab | 04.cpp | /*
Build a lexical analyzer implementing the following regular expressions:
Integer variable = (i-nI-N)(a-zA-Z0-9)* alphaneumeric
ShortInt Number = (1-9)|(1-9)(0-9)|(1-9)(0-9)(0-9)|(1-9)(0-9)(0-9)(0-9)
LongInt Number = (1-9)(0-9)(0-9)(0-9)(0-9)+
Invalid Input or Undefined = Otherwise
*/
#include<bits/stdc++.h>
usin... | ALGO | 0.984216 | 3.483488 |
7dc6a0d2-812f-492f-869e-a195f3fa005e | practicecodesby/practiceCodes | createSpiral.cpp | #include<iostream>
#include<vector>
using namespace std;
void spiralMaker(vector<vector<int> > &vec){
int left=0;
int right=vec[0].size()-1;
int top=0;
int bottom=vec.size()-1;
int direction=0;
int value=1;
while(top<=bottom&&left<=right){
if(direction==0){
for(int col... | ALGO | 0.999821 | 3.233998 |
582e538a-f1bd-4231-bb96-1c0ca467afe4 | MrLakshay/Coding-blocks | Pracitce/llpractice.cpp | #include <iostream>
using namespace std;
class node
{
public:
int data;
node *next;
node(int x)
{
data = x;
next = NULL;
}
};
void insert(int x, node *&head, node *&tail)
{
node *v = new node(x);
if (head == NULL)
{
head = v;
tail = head;
}
else
... | ALGO | 0.999997 | 5.079204 |
56889af8-4adf-416d-8357-9c02b22c06bb | piyush1146115/Competitive-Programming | Code forces/edu round 13 prob A.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
long long n, m, k, i, j;
cin >> n >> m;
if(m > n){
cout << m << endl;
}
else{
if(n % m == 0){
i = n + m;
}
else{
k = n - m;
j = k % m;
i = n + (m - j);
}
cout << i << endl;
}
}
| ALGO | 0.999988 | 3.205841 |
9008350a-9ccc-473a-912d-e94a430b111d | cunbidun/competitive_programming | archive/Codeforces - Educational Codeforces Round 100 (Rated for Div. 2)/D. Pairs/solution.cpp | #include <bits/stdc++.h>
#define sz(v) ((int)(v).size())
#define all(v) (v).begin(), (v).end()
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> ii;
const int N = 2e5 + 5;
int n, a[N], b[N];
int check(int m) {
for (int i = 1; i <= m; i++) {
if (b[i] > a[i + n - m]) {
... | ALGO | 0.999729 | 4.644489 |
fbe22542-b1f0-4109-b133-32aa19b221ac | AdityaManojDixit/leetcode-AtoZ | dp/Subsequences/tempCodeRunnerFile.cpp | #include <iostream>
#include<string>
using namespace std;
int search(const string& pat, const string& txt) {
int M = pat.size();
int N = txt.size();
int count = 0;
/* A loop to slide pat[] one by one */
for (int i = 0; i <= N - M; i++) {
int j;
/* For current index i, check for pa... | ALGO | 0.999601 | 3.894102 |
40befdbf-9faf-4bf5-a2ee-4ddd5d715168 | newyork167/Interview-Questions | HackerRank/Data Structures/Trees/PreOrder.cpp | /* you only have to complete the function given below.
Node is defined as
struct node
{
int data;
node* left;
node* right;
};
*/
void Preorder(node *root) {
if (root == NULL)
return;
fprintf(stdout, "%d ", root->data);
Preorder(root->left);
Preorder(root->right);
} | ALGO | 0.999548 | 4.636442 |
d11113f1-3b23-48ed-9467-d4e578155ef5 | Babi2311/Algoritmos_de_programacao | atv 2.cpp | #include <stdio.h>
int main (){
float salario;
printf("informe seu salario: ");
scanf("%f", &salario);
if(salario < 0){
printf("Erro....");
return 0;
}
if(salario < 1.500){
salario = salario * 0.95;
printf("Esse e seu salario liquido %.3f ", salario);
}
else if(salario >= 1.500, salario < 2.5... | TOOL | 0.986066 | 3.678638 |
5c66ace4-314d-46f4-83f4-23f49e3a737d | kimdhair/git_cpp_practice | cpp_practice/numberBaseballGame/numberBaseballGame/numberBaseballGame.cpp | #include <ctime>
#include <cstdlib>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
srand(time(NULL));
int strike = 0;
int ball = 0;
int flag = 0;
int cnt = 0;
vector<int> answer;
vector<int> check_num = { 1,2,3,4,5,6,7,8,9 };
/*while (answer.size() < 3)
{
int ... | ALGO | 0.999398 | 3.528478 |
8604b27c-d4ec-455b-a377-fb02b8ed47c6 | gsidhard/llvm-crash-analyzer | llvm-15.0.3/libc/src/math/aarch64/sqrt.cpp | #include "src/math/sqrt.h"
#include "src/__support/common.h"
namespace __llvm_libc {
LLVM_LIBC_FUNCTION(double, sqrt, (double x)) {
double y;
__asm__ __volatile__("fsqrt %d0, %d1\n\t" : "=w"(y) : "w"(x));
return y;
}
} // namespace __llvm_libc
| TOOL | 0.981391 | 5.576637 |
9731fb53-a479-4769-bf2b-a5f70d1b6a93 | radekp/qt | tests/auto/qtessellator/utils.cpp | #include "utils.h"
#include <assert.h>
#include <qglobal.h>
#include "qnum.h"
#define FloatToXFixed(i) (int)((i) * 65536)
#define IntToXFixed(i) ((i) << 16)
static double compute_x_at(XFixed y, XPointFixed p1, XPointFixed p2)
{
double d = XFixedToDouble(p2.x - p1.x);
return
XFixedToDouble(p1.x) + d*... | TOOL | 0.984558 | 5.547215 |
cc9d7faf-a725-4005-80ca-03b4a9864c3f | surajmaji10/bible-cp-ci-andrie | 003PrimalityTestingFast.cpp | #include<iostream>
using namespace std;
bool isPrime(int n){
// when n <= 1
if(n <= 1){
return false;
}
// when n >= 2
for(int div = 2; div*div <= n; div++){
if(n % div == 0){
return false;
}
}
return true;
}
int main(void){
for(int i = 0; i ... | ALGO | 0.998006 | 4.730285 |
e677c67d-aae8-4806-99ed-a04be38fcdda | alias09inc/atcoder | ABC/292/D.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin>>N;
long long ans = 0;
for(int i=1;i<N;i++){
//AB = X, CD = Y
int X = i,Y = N-i;
long long x = 0,y = 0;
for(int j=1;j*j<=X;j++){
//Aで割り切れる時、対応するBが存在する
if(X%j==0){
x++;
//A!=Bのとき、入れ替えが発生する... | ALGO | 0.999911 | 3.92345 |
1dcfdb30-97d5-47da-8475-7ca05eab98b3 | devangigithub/Question-Bank | 6 pdf/6-p25.cpp | #include<iostream>
using namespace std;
class shape{
public:
int width;
int height;
dispA(){
cout<<"Enter the value of widht: ";
cin>>width;
cout<<"Enter the value of height: ";
cin>>height;
}
};
class triangle : public shape{
public:
int area;
dispB(){
area = 0.5*width*height;
cout<... | TOOL | 0.953682 | 3.716613 |
a8005f3c-d003-44a8-b854-62cd45b17e80 | wdgWon/Algorithms_JS | 프로그래머스/정수 삼각형.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int solution(vector<vector<int>> triangle) {
for(int i = 1; i < triangle.size(); i++) {
for(int j = 0; j < triangle[i].size(); j++) {
int left = (j > 0) ? triangle[i-1][j-1] : 0;
int right = (j < triang... | ALGO | 0.999983 | 5.821381 |
657fe71e-9404-4a68-86f8-b1b37a242d7d | julilishukk/lab2_vipz | Students/Stud.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
#include <string.h>
#include <math.h>
#include "Functions.h"
//
struct students* pFirst;
struct students* p;
int main()
{
FILE *fp=freopen("Input.txt", "r",stdin);
// FILE* fp2 = freopen("Ouput.txt", "w", stdout);
... | TOOL | 0.991895 | 3.308605 |
6142b8b6-fdf5-45da-a3fa-fd32a59eb8c9 | jash459/DSA-BUSTED | Zero Array Transformation I.cpp | class Solution {
public:
bool isZeroArray(vector<int>& nums, vector<vector<int>>& queries) {
vector<int> diff(nums.size() + 1, 0);
for (const auto& q : queries) {
diff[q[0]]++;
if (q[1] + 1 < nums.size())
diff[q[1] + 1]--;
}
int cnt = 0;
... | ALGO | 0.999847 | 6.087508 |
d4daf73d-d4b9-442f-9b27-d19c836ee41c | mingan81/PersonBGRemoving | scripts/Old/scripts_headModelGeneration_dgil.cpp | // OpenCV
#include <opencv2/core/core.hpp>
#include <opencv2/contrib/contrib.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/objdetect/objdetect.hpp>
// General
#include <iostream>
#include <fstream>
#include <sstream>
#include <stdio.h>
#include <string>
#include <... | TOOL | 0.903647 | 4.541714 |
1ebde9da-aefe-4945-9fbb-ccb380eb50d8 | PaukIsUha/optimizing_formating_code | predictions/supersonic_predicted_submissions/Codenet/p02263/867187583/improved.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <algorithm>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <vector>
using namespace std;
class Stack {
public:
Stack(int n) : s_(n), top_(0){};
bool isEmpty() { return top_ == 0; }
bool isFull() { return top_ == s_.size(); }
void push(int x) {
if... | ALGO | 0.999892 | 4.086815 |
81d25bad-dbf1-4605-b34b-7bc3d4245e73 | KSH-code/Problem-Solving | 20555.cpp | #include <bits/stdc++.h>
void solve(){
int N; std::cin >> N;
std::vector<std::string> v(N);
for (auto &s : v) std::cin >> s;
while (1) {
int counts[4]; memset(counts, 0, sizeof counts);
for (char i = 'A'; i <= 'D'; i++) {
for (auto s : v) {
int temp[4]; memset(temp, 0, sizeof temp);
... | ALGO | 0.999958 | 4.838381 |
5a9befbb-2f94-4260-b666-7bfe5802ef7b | WarpEngineer/calculate | calculate.cpp | // Calculate 3.7 BETA
// Written by A. G. Madi
//////////////////////////////
// Calculates Stuff
#if defined(_WIN32)
#define _CRT_SECURE_NO_WARNINGS
#endif
#include<stdio.h>
#if defined(_WIN32)
#include<io.h>
#elif defined(__MACH__)
#include<dispatch/dispatch.h>
#else
#include<sys/io.h>
#endif
#include<stdlib.h>
#in... | TOOL | 0.946225 | 3.972089 |
ad1f392d-7851-430d-8649-0e67bf11710a | adiityachoudhary/localrepo | C++/Must_know_programs/05_recursion.cpp | #include <iostream>
using namespace std;
/*
factorial(5)=1x2x3x4x5
factorial(4)=1x2x3x4
factorial(3)=1x2x3
factorial(2)=1x2
factorial(1)=1
factorial(0)=1
factorial(n)=1x2x3x4x......(n-1) x n
factorial(n-1)=1x2x3x4x......(n-1)
therefore: factorial(n)= factorial(n-1) x n
*/
int factorial(int);
int factorial(int a) /... | ALGO | 0.9995 | 5.18511 |
c02d5801-3487-4c26-a64d-b3c4a1a48f45 | ya0201/mycpp-learning | codility/binarygap.cpp | #include <iostream>
#include <algorithm>
#include <string>
#include <fstream>
#include <vector>
#include <cstdio>
#include <cmath>
#include <queue>
#include <stack>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <string>
#include <set>
#include <map>
#include <thread>
#include <mutex>
#include <iomanip... | ALGO | 0.99913 | 4.512819 |
3e0330f1-e53c-4054-b7d2-9308e4dffdf6 | 1TinkyWinky2/UTBWayFinder | 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 |
2da83e92-7686-4944-af26-f0d5549a2e25 | ZZZZZZZZJ/LDB | algorithms_libs/LSD/spams-matlab-dat/prox/mex/mexProximalPathCoding.cpp | #include <mex.h>
#include <mexutils.h>
#include <fista.h>
using namespace FISTA;
template <typename T>
inline void callFunction(mxArray* plhs[], const mxArray*prhs[],
const int nlhs) {
if (!mexCheckType<T>(prhs[0]))
mexErrMsgTxt("type of argument 1 is not consistent");
if (mxIsSparse(prhs[0]))
... | ALGO | 0.999088 | 5.746729 |
949508d9-3846-4752-9ec1-7fed16eba30d | kimsung9k/mayadev | standalone c++/SGMTool1.01/SGMTool/SGMatrix.cpp | #include "SGMatrix.h"
#include <math.h>
#include "SGVector.h"
#define SQUARE( x ) pow( x, 2 )
#define SQ SQUARE
SGMatrix::SGMatrix() {
m_dptMtx[0] = 1.0f; m_dptMtx[1] = 0.0f; m_dptMtx[2] = 0.0f; m_dptMtx[3] = 0.0f;
m_dptMtx[4] = 0.0f; m_dptMtx[5] = 1.0f; m_dptMtx[6] = 0.0f; m_dptMtx[7] = 0.0f;
m_dptMtx[8] = 0.0... | ALGO | 0.904761 | 6.011011 |
95a39d84-e22b-4d7b-9a57-bc52ffb86a71 | ishandutta2007/codeforces | krijgertje/normal/765/E.cpp | #include <algorithm>
#include <iostream>
#include <sstream>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <cmath>
#include <list>
#include <cassert>
#include <ctime>
#include... | ALGO | 0.999715 | 3.954907 |
929b2291-6982-49a4-81c5-a44b8ff47859 | oxygen-hunter/Flashboom | data/big-vul-100/add_attention_code/Gemma/top0-100/sum-of-special-evenly-spaced-elements-in-array-Solution.solve/177774_DoS_Exec_Code_Overflow.cpp | void SplashOutputDev::drawImage(GfxState *state, Object *ref, Stream *str,
int width, int height,
GfxImageColorMap *colorMap,
int *maskColors, GBool inlineImg) {
double *ctm;
SplashCoord mat[6];
SplashOutImageData imgData;
SplashColorMode srcMode;
SplashImageSource src;
GfxGray gray;
GfxRGB rg... | TOOL | 0.993951 | 4.133219 |
0572700a-86f8-4f54-bb3e-f43bed7161d7 | Sahilbatra1211/c- | c++/C-Free/datastructures/BST/12_creating _bstfrom_inorderandpreorder.cpp | //creating binary tree from in order and preorder traversal
| ALGO | 0.997877 | 4.545812 |
c85866b6-63cc-4a09-8969-5720e4240a82 | fprtmjinho/algorithm | 6593.cpp | #include <iostream>
#include <queue>
#define PAIR pair<int,int>
#define PPAIR pair<int,PAIR>
using namespace std;
int dx[6]={0,0,0,0,1,-1};
int dy[6]={1,-1,0,0,0,0};
int dz[6]={0,0,1,-1,0,0};
int L,R,C;
int graph[32][32][32];
int visited[32][32][32];
bool flag = false;
queue<PPAIR> q;
void BFS(int sx,int sy, int sz... | ALGO | 0.999844 | 3.538573 |
7693ccce-154b-49e6-94f6-61799be3ebd4 | RohithBoppey/leetcode-sol | 0714-best-time-to-buy-and-sell-stock-with-transaction-fee/0714-best-time-to-buy-and-sell-stock-with-transaction-fee.cpp | class Solution {
public:
int dp[50001][2];
int max1(int a, int b, int c){
return max(a, max(b, c));
}
int solve(vector<int>& prices, int day, bool buy, int &n, int& fee){
// this function return max profit that can be obtained from day 0
if(day >= n){
// can... | ALGO | 0.999933 | 5.328072 |
b58210ac-e42d-4f39-b91b-645831877ff5 | Hamid165/Hamid_cpp | tugas_7/indeex.cpp | #include <iostream>
using namespace std;
int main()
{
int bilangan_129, ganjil_129[5];
int j = 0;
for (int i = 0; i < 5; i++)
{
cout << "Masukan bilangan " << (i + 1) << " : ";
cin >> bilangan_129;
if (bilangan_129 % 2 != 0)
{
ganjil_129[j] = bilangan_129;
... | ALGO | 0.999764 | 3.798871 |
1388ca38-06da-462c-8904-3f77f9fef554 | raghuvanshraj/Competitive-Programming-Archive | InterviewBit/assign_mice.cpp | #include <bits/stdc++.h>
using namespace std;
int mice(vector<int> &arr, vector<int> &holes) {
sort(arr.begin(), arr.end());
sort(holes.begin(), holes.end());
int maxDifference = 0;
int n = arr.size();
for (int i = 0; i < n; ++i) {
maxDifference = max(maxDifference, abs(arr[i] - holes[i]));
}
return maxDif... | ALGO | 0.999964 | 4.378185 |
d76e3711-9b4d-4298-b208-6af7293239ee | rayddteam/freebsd-pi | contrib/llvm/lib/CodeGen/OptimizePHIs.cpp | #define DEBUG_TYPE "phi-opt"
#include "llvm/CodeGen/Passes.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/Target/TargetInstrInfo.h"
#include "llvm/Function.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/Statis... | ALGO | 0.964034 | 7.67472 |
b448cceb-f316-41b4-94d8-402acada9cc6 | lwyeluo/ScriptChecker | third_party/swiftshader/third_party/LLVM/lib/CodeGen/CriticalAntiDepBreaker.cpp | #define DEBUG_TYPE "post-RA-sched"
#include "CriticalAntiDepBreaker.h"
#include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetInstrInfo.h"
#include "llvm/Target/TargetRegisterInfo.h"
#include "llvm/Support/Debug.h"
#inclu... | ALGO | 0.969303 | 6.62067 |
0425f78f-17ba-4726-adbc-7913e1f05450 | RahulDadhich26/Problem-of-the-day-GeeksforGeeks | FindtheCityWiththeSmallestNumberofNeighborsataThresholdDistance.cpp | #include<bits/stdc++.h>
#include<vector>
using namespace std;
int findTheCity(int n, vector<vector<int>>& edges, int distanceThreshold) {
vector<vector<int>> dis(n, vector<int>(n, 10001));
int res = 0, smallest = n;
for (auto& e : edges)
dis[e[0]][e[1]] = dis[e[1]][e[0]] = e[2];
for (int i = 0;... | ALGO | 0.999872 | 5.3469 |
5de7db1f-73e9-49aa-8b91-5dfd6ef0e13c | Khaled-Amin-Shawon/XPSC | Week 07/day3/Passing_Marks.cpp | #include <bits/stdc++.h>
#define endl '\n'
#define ll long long int
#define all(v) v.begin(), v.end()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int tst;
cin >> tst;
while (tst--)
... | ALGO | 0.999782 | 3.549101 |
073ddb49-4ac9-4ab7-aebe-b92605793491 | gongbosheng/the-road-of-self-study-examination | C++程序设计/code/05类的继承和派生/f.cpp | #include <iostream>
using namespace std;
class B;
class A
{
public:
int a;
void f(B b);
};
class B
{
public:
int b;
void f(A a);
};
void A::f(B b)
{
cout << b.b << endl;
}
void B::f(A a)
{
cout << a.a << endl;
}
int main()
{
A a;
B b;
a.a = 1;
b.b =... | ALGO | 0.911843 | 4.4891 |
3c4b741c-0234-4080-9f97-d8b23e875301 | wavyeon/Problem-Solving | Baekjoon/1509.cpp | // https://yabmoons.tistory.com/592
#include <iostream>
#include <cstring>
#include <algorithm>
#define endl '\n'
#define MAX 2501
using namespace std;
int length;
char str[MAX];
int dp[MAX]; // dp[i] = i번째 문자까지 팰린드롬 문자열로 분할 할 수 있는 최소 횟수
bool palindrome[MAX][MAX];
void init() {
cin.tie(0);
cout.tie(0);
i... | ALGO | 0.999986 | 5.636728 |
2ef47028-e0f2-455b-9528-fac7ab63d443 | Glassesbear/ProjectForCodingTest | Solved/Programers/LV3_네트워크.cpp | #include <string>
#include <vector>
using namespace std;
bool dfs(vector<vector<int>>& v, int i) {
if (!v[i][i]) {
return false;
}
v[i][i] = 0;
for (int j = 0; j < v[i].size(); j++) {
if (v[i][j])
dfs(v, j);
}
return true;
}
int solution(int n, vector<vector<int>... | ALGO | 0.999858 | 5.856607 |
6cbba8d6-cd9b-4ae2-bd07-f6a5c879ff05 | dhruvjain/Competitive_Coding | APAC/prob1.cpp | #include<bits/stdc++.h>
using namespace std;
#define sd(x) scanf("%d",&x);
#define LL long long
#define LD long double
#define PB push_back
#define MP make_pair
#define F first
#define S second
#define Fill(a, b) memset(a, b, sizeof(a))
#define INF 2000000009
typedef pair<int,int> PII;
typedef vector<int> VI;
#defi... | ALGO | 0.998892 | 3.414605 |
347e3c9e-619a-4484-bb9a-9044b19e8511 | smandy/randomcpp | copy_test.cpp | #include <algorithm>
#include <iostream>
#include <vector>
int main(int argc, char* argv[])
{
std::vector<std::string> my_strings{"foo", "bar", "baz", "goo"};
std::for_each(std::begin(my_strings), std::end(my_strings),
[](const auto& x) {
static char sep = '[';
... | TOOL | 0.941768 | 4.951866 |
52148774-2f3c-4206-8cd8-34a5363fed5b | immmdev/verbose-spoon | majority_element_II/majority_element_ii_optimal.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n; // Size of array
int nums[n];
for(int i = 0; i < n; i++) {
cin >> nums[i];
}
int mm=(n/3)+1;
int cnt1=0,cnt2=0;
int el1,el2;
for(int i=0; i<n; i++){
if(cnt1==0 && el2!=nums[i]){
... | ALGO | 0.999946 | 4.01604 |
07aa7a21-74c6-4f4a-bd79-ae0bb25f6a75 | jakubartur/Procyon | src/qt/transactionfilterproxy.cpp | #include "transactionfilterproxy.h"
#include "transactiontablemodel.h"
#include "transactionrecord.h"
#include "guiutil.h"
#include <cstdlib>
#include <QDateTime>
// Earliest date that can be represented (far in the past)
const QDateTime TransactionFilterProxy::MIN_DATE = QDateTime::fromTime_t(0);
// Last date that... | TOOL | 0.878618 | 6.731323 |
5c9200b2-1d4a-4b1e-b4eb-96d11ff4a11d | mahfuj10/Hackerrank | 30 Days of Code/Day 9: Recursion 3.cpp | int factorial(int n)
{
if (n == 0)
return 0;
if (n == 1)
return 1;
return n * factorial(n - 1);
} | ALGO | 0.999208 | 3.73044 |
f3f64791-c6d2-40ef-93f5-e6ba6e834ad3 | GQH123/Renatus-ACM-Codes | CometOJ_59/I.cpp | #include <bits/stdc++.h>
#define maxr 100000
#define rep(i, l, r) for (register int i = l; i <= r; i++)
#define per(i, r, l) for (register int i = r; i >= l; i--)
#define gc() ((p1 == p2 && (p2 = (p1 = buffer) + fread(buffer, 1, maxr, stdin), p1 == p2)) ? EOF : *p1++)
#define ll long long int
using namespace std;
cha... | ALGO | 0.999965 | 3.447078 |
3e4456bf-e153-49ff-9942-ce477b73b4db | rising-turtle/ros_study | octomap_app/src/rgbd2ot.cpp | #include "rgbd2ot.h"
#include "rgbd2feat.h"
#define MAX_XTION_RANGE 3
//data: idx = [t_odo], value=[x, y, z, qx, qy, qz, qw]
bool readPoseData(const char* path, std::map<double, vector<double> > & data)
{
ifstream inf(path);
if(!inf.is_open() ){
cout<<"failed to open file: "<<path<<endl;
return false;
}... | DATA | 0.878994 | 3.570008 |
2e4feebe-68eb-4405-9ee3-9cb4259a11a5 | SolveGuys/AlgorithmStudy | Problems_Archives/69week/Soyewon/BOJ1584.cpp | // BOJ 1584 - 게임
/*
죽음의 구역 - 들어갈 수 없음
위험한 구역 - 생명 -1씩 소모
안전한 구역
(0,0)에서 출발, 상하좌우 이동 가능
death + dangerous = death
dangerous + safe = dangerous
dangerous + dangerous = dangerous
death + safe = death
>> 데미지가 심한 구역 효과 적용
구역에 들어갈 때만 영향(이동 시에만)
=> 데미지에 따라 결과가 달라지므로 deque
*/
#include <iostream>
#include <queue>
using ... | ALGO | 0.999745 | 5.370241 |
97fba224-8638-4807-807f-e328b31925a9 | ShivangKPatel/DAA | 6/6_2/6_2.cpp | #include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
int hungarianAlgorithm(vector<vector<int>> &cost, vector<int> &assignment)
{
int n = cost.size();
int m = cost[0].size();
vector<int> u(n + 1), v(m + 1), p(m + 1), way(m + 1);
for (int i = 1; i <= n; ++i)
{
p[0] = i... | ALGO | 0.999935 | 4.903053 |
4273984e-c643-4c54-a879-fa51469dc1d4 | Ujjwal2017099/leet-code | 0989-add-to-array-form-of-integer/0989-add-to-array-form-of-integer.cpp | class Solution {
public:
vector<int> addToArrayForm(vector<int>& n, int k) {
vector<int> t;
while(k){
t.push_back(k%10);k/=10;
}
reverse(n.begin(),n.end());
int i=0;
for(i=0;i<min(t.size(),n.size());i++){
n[i] += t[i];
int x = n[i]/... | ALGO | 0.999951 | 6.469665 |
d2a6632d-e690-41e2-ae72-efd40ea8b194 | serbantasss/Competitive-Programming | OTHER/Scoala/Tema vacanta(04.01.2016)/joc20/main.cpp | #include <fstream>
using namespace std;
int v[1001];
int main()
{
ifstream cin ("joc20.in" );
ofstream cout("joc20.out");
int n,i,s,sGuta=0,sMocanu=0,x;
cin>>n;
for(int i=1;i<=n;++i)
cin>>v[i];
int st,dr;
dr=1;
st=n;
for(int i=1;i<=n;++i)
{
cin>>x;
s=0;
... | ALGO | 0.999991 | 3.201869 |
e5af763e-f876-4ce7-9dd9-339585833005 | 19sProgrammersStudy/Seohyun | Samsung/0906_wizardSharkTornado.cpp | // 20057번. 마법사 상어와 토네이도
// https://www.acmicpc.net/problem/20057
#include <iostream>
#include <cmath>
using namespace std;
#define DIR 4
#define MAX 499
int N, answer;
int map[MAX][MAX];
int dr[DIR] = {0, 1, 0, -1};
int dc[DIR] = {-1, 0, 1, 0};
struct tornado
{
int r, c;
int dir = 0;
};
tornado current;
boo... | ALGO | 0.999737 | 3.550639 |
5ee3d6fc-060a-4d09-a1ad-91f0159617c6 | DuongHaoNika/DSA_CodePTIT | DSA07017 - PHẦN TỬ BÊN PHẢI NHỎ HƠN.cpp | #include <bits/stdc++.h>
using namespace std;
#define mp make_pair
#define fi first
#define se second
#define pb push_back
#define sz size()
#define ll long long
#define FOR(i, a, b) for (int i = a; i <= b; ++i)
#define FORD(i, a, b) for (int i = a; i >= b; --i)
#define ALL(x) x.begin(), x.end()
#define NALL(x) x.begin... | ALGO | 0.999901 | 4.448192 |
b31cb8e5-3447-4f27-947f-efe0fcec0cfb | Pastifier/CPP09 | ex02/PmergeMe.cpp | #include "PmergeMe.hpp"
#include <string>
#include <sstream>
#include <cstdlib>
#include <exception>
#include <ctime>
#include <climits>
#include <algorithm>
#include <cassert>
namespace PmergeMe {
namespace {
IntVector _nsInternalV;
IntList _nsInternalL;
size_t _nsInternalCompCount = 0;
... | TEST | 0.997086 | 6.700618 |
b3c60249-f6ad-43e1-bca7-82ee08638786 | joaossousa12/feup-prog | Test1/Preparation/interval.cpp | #include "interval.h"
#include <iostream>
using namespace std;
bool is_greater(time_of_day a, time_of_day b){
if(a.h > b.h || (a.h == b.h && a.m > b.m)) return true;
return false;
}
bool is_greater_or_equal(time_of_day a, time_of_day b){
if(a.h > b.h || (a.h == b.h && a.m >= b.m)) return true;
return... | ALGO | 0.99878 | 4.377352 |
d35df123-b268-4714-9bec-7676154973d6 | RSL-NEU/person-reid-benchmark | MetricLearning/KISSME/toolbox/lib/LMNN/mtrees/poppush.cpp |
typedef class poppush {
public:
int curpointer;
int stacksize;
int *nodes;
double *mindists;
poppush();
int pop(int *node,double*dist);
int push(int node,double dist);
void init(unsigned int n);
void cleanup();
void clear();
} poppush_t;
poppush::poppush(){}; // dummy initialization
int poppush::pop(int * node, ... | ALGO | 0.999684 | 4.921358 |
db796e01-f56e-4666-a2a0-f3d004151b25 | lsgwr/algorithms | Part13算法竞赛宝典/第二部资源包/第二章 递归算法/棋子移动/src/标程/piece.cpp | //ƶ
#include <iostream>
#include <cstdlib>
using namespace std;
void move(int k)
{
if(k==4)
{
cout<<"4,5-->9,10\n";
cout<<"8,9-->4,5\n";
cout<<"2,3-->8,9\n";
cout<<"7,8-->2,3\n";
cout<<"1,2-->7,8\n";
}
else
{
cout<<k<<','<<k+1<<"-->"<<2*k+1<<','<<2*k+2<<endl;
cout<<2*k-1<... | ALGO | 0.999955 | 3.426533 |
f070da1e-883f-40b3-9f02-5cc72e5b2aa8 | jyi0226/baekjoon | Gold/16958.cpp | #include <iostream>
#include <cmath>
#include <vector>
using namespace std;
int INF=999999999;
int n,t,m,b,c;
bool a;
int dist[1010][1010]={};
vector<pair<bool,pair<int,int>>> v;
void Floyd_Warshall(){
for(int k = 1; k <= n; k++){
for(int i = 1; i <= n; i++){
for(int j = 1; j <= n; j++){
... | ALGO | 0.999961 | 4.577468 |
1180395b-35f1-428d-9466-87e269a403fd | olivo/side-channel-analyzer | Z3-str/z3/shell/dimacs_frontend.cpp | #include<iostream>
#include<time.h>
#include<signal.h>
#include"timeout.h"
#include"dimacs.h"
#include"sat_solver.h"
#include"front_end_params.h"
extern bool g_display_statistics;
static sat::solver * g_solver = 0;
static clock_t g_start_time;
static void display_statistics() {
clock_t end_time = c... | ALGO | 0.972109 | 5.275918 |
ae9429af-f1d5-441a-9d50-74d8e2d82319 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_6499_4.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 1111;
int mem[N][N];
int val[N];
int main() {
int n;
scanf("%d", &n);
for (int i = 0; i < n; i++)
for (int j = 0; j < n; j++) scanf("%d", mem[i] + j);
int ans = 0;
for (int j = 0; j < n; j++) ans += mem[j][j];
ans = ans % 2;
int q;
scanf("%... | ALGO | 0.999761 | 3.537885 |
ac73df63-33aa-4cb1-a927-3e284b3268c3 | idylle-cynique/atcoder_problems | AtCoder Beginners Contest/ABC088-B.cpp | /* ABC088 - B
カードに関する情報は二人のプレイヤーから完全に見えている状態なので、
(当然ながら)今場に残っているカードのうち数字が最も大きいものをとって行くのが最適
カードの数値情報をvectorに格納したうえで降順にソートし、
交互にAliceとBobにスコアを割振り、最後にその差を出力してやればよい
*/
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(void){
int N;
cin >> N;
vector<int> ca... | ALGO | 0.999971 | 4.264908 |
6ef45a80-1a8c-4328-848c-992fa992a968 | Wild-Donkey/Code | ybt/ybt1250-1299/ybt1251 仙岛求药.cpp | #include<iostream>
#include<cstdio>
#include<queue>
using namespace std;
struct node
{
int x;
int y;
node() {}
node(int x1, int y1) :x(x1), y(y1) {}
} s, t;
char ch;
bool flg;
int n, m, vis[1005][1005], u[4][2] = { {0,-1},{-1,0},{0,1},{1,0} }, ans[1005][1005];
void bfs(int x, int y)
{
vis[x][y] = 1;... | ALGO | 0.999893 | 3.350199 |
d3f18a75-1607-4dae-b985-1ebc490625ba | ishandutta2007/codeforces | lomienyeet/normal/61/E.cpp | // "proactive student!!!"
// - description of xenxation, 2022
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
//#define int long long
#define ost tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>
signed main(){
int n;
... | ALGO | 0.99986 | 3.809819 |
f5ae7208-e40b-4825-a588-715e159313ec | BrainLinks-BrainTools-Neurobots/neurobots_demonstrator | birrt/robot_motion_planning/validity_checker/src/feasibility_checker.cpp | #include <validity_checker/feasibility_checker.h>
#include <tf/transform_listener.h>
#include <moveit/move_group_interface/move_group.h>
namespace state_feasibility_checker{
FeasibilityChecker::FeasibilityChecker(string robot_desciption_param, string planning_group, string ns_prefix)
{
//Check the planning frame... | TOOL | 0.963818 | 6.236404 |
02b00a09-ba88-4017-8932-aa143429b244 | Danacus/llvm-project-ami-cfl | clang/test/ASTMerge/var-cpp/Inputs/var1.cpp |
template <typename T>
constexpr T my_pi = T(3.1415926535897932385L); // variable template
template <> constexpr char my_pi<char> = '3'; // variable template specialization
template <typename T>
struct Wrapper {
template <typename U> static constexpr U my_const = U(1);
// Variable template partial specializat... | TOOL | 0.953725 | 5.687288 |
a88b6d6c-27dc-41c2-bb84-a4ca48594b58 | loviezhang/mip_solver | deps/eigen-3.3.8/bench/bench_gemm.cpp |
// g++-4.4 bench_gemm.cpp -I .. -O2 -DNDEBUG -lrt -fopenmp && OMP_NUM_THREADS=2 ./a.out
// icpc bench_gemm.cpp -I .. -O3 -DNDEBUG -lrt -openmp && OMP_NUM_THREADS=2 ./a.out
// Compilation options:
//
// -DSCALAR=std::complex<double>
// -DSCALARA=double or -DSCALARB=double
// -DHAVE_BLAS
// -DDECOUPLED
//
#include... | TOOL | 0.96793 | 5.8448 |
800ed4eb-906d-4f9e-b976-0235e2b7c098 | bartvbl/Radial-Intersection-Count-Image-reproduction | src/clutterbox/lib/glm/test/gtx/gtx_simd_mat4.cpp | ///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentatio... | TEST | 0.984182 | 6.515547 |
44a543fd-1d42-4f22-945a-03e1925443b2 | vfolunin/archives-solutions | SPOJ/shamim9.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <string>
using namespace std;
int main() {
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
string s;
cin >> s;
cout << (s.back() - '0') * 9 % 10;
} | ALGO | 0.999544 | 4.341516 |
83d51965-3137-4059-9174-c762912a30b3 | aliansari2566/Singly-linkedlist | linkedlist.cpp | #include "linkedlist.h"
int linkedlist::count_occ(int key)
{
node* temp;
temp = head;
int counter = 0;
while (temp != NULL)
{
if (key == temp->data)
{
counter++;
}
temp = temp->next;
}
return count;
}
void linkedlist::Insertatbegin(int value)
{... | ALGO | 0.999362 | 3.093221 |
a0e6ac1f-2370-4524-80e9-f28d1063927b | beckmx/tensorflow-bird | libraries/Bird-classifier_inferencing/src/edge-impulse-sdk/tensorflow/lite/micro/kernels/reduce.cpp | #include "edge-impulse-sdk/tensorflow/lite/kernels/internal/reference/reduce.h"
#include "edge-impulse-sdk/tensorflow/lite/c/builtin_op_data.h"
#include "edge-impulse-sdk/tensorflow/lite/c/common.h"
#include "edge-impulse-sdk/tensorflow/lite/kernels/internal/quantization_util.h"
#include "edge-impulse-sdk/tensorflow/l... | ALGO | 0.997557 | 7.314221 |
b38459da-28dc-42c0-a2bf-fab8969b6d41 | llvm-pic/llvm-pic | libcxx/test/std/algorithms/alg.sorting/alg.min.max/max_element.pass.cpp | // <algorithm>
// template<ForwardIterator Iter>
// requires LessThanComparable<Iter::value_type>
// Iter
// max_element(Iter first, Iter last);
#include <algorithm>
#include <random>
#include <cassert>
#include "test_macros.h"
#include "test_iterators.h"
std::mt19937 randomness;
template <class Iter>
void
t... | TEST | 0.935875 | 6.164785 |
d61c1cc5-d200-4e63-bdf9-4837986d22af | Allen-Walker/notebook | cpp_basic/45_遍历算法_for_each.cpp | /*
for_each算法 遍历容器元素
@param beg 开始迭代器
@param end 结束迭代器
@param _callback 函数回调或者函数对象
@return 函数对象
*/
// for_each(iterator beg, iterator end, _callback);
// 基本正向遍历和逆向遍历
// for_each绑定参数输出
// for_each修改容器元素
// for_each返回值
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <vector>
#include <algorithm>
#i... | ALGO | 0.992667 | 4.592547 |
61870ff4-615a-474f-a0d6-4ba36988a55a | xuebingwu/kpLogo | src/container.cpp | #include <string>
#include <sstream>
#include <iostream>
#include <fstream>
#include <vector>
#include <set>
#include <map>
#include <iomanip>
#include <array> // std::array
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <algorithm>
#include "container.h"
// for position matrix
#include <bo... | ALGO | 0.926441 | 3.834367 |
0268579b-4430-4b05-bf60-444b766f3930 | daehan-86/daehan-86-baekjoon_algorithm_StepByStep | algorithm_beginner2/602 - graph1(challenge)/16940.cpp | #include<iostream>
#include<vector>
#include<queue>
#include<algorithm>
using namespace std;
bool visit[100001];
int arr[100001];
int main(void){
int n,a,b;
cin>>n;
vector<int>*v=new vector<int>[n+1];
v[1].push_back(1);
for(int i=1;i<n;i++){
scanf("%d %d",&a,&b);
v[a].push_back(b);
v[b].push_back(a);
}
for... | ALGO | 0.999956 | 3.629373 |
4fe7ebf5-c6b2-4d83-a951-61b2faa7e113 | ishandutta2007/codeforces | rxdoi/normal/387/E.cpp | #include<cstdio>
#include<cctype>
#include<algorithm>
#define For(i,x,y) for (int i=x;i<y;i++)
#define Rep(i,x,y) for (int i=x;i>y;i--)
using namespace std;
int IN()
{
int c,x;
while (!isdigit(c=getchar()));x=c-'0';
while (isdigit(c=getchar())) x=(x<<1)+(x<<3)+c-'0';return x;
}
const int N=1e6+19,oo=(1<<30)-1;
in... | ALGO | 0.99994 | 3.613523 |
1dbef5ab-3dbd-4cce-a676-4bb133ef2b26 | AmitrajitDas/DSA-CP | 257-binary-tree-paths/257-binary-tree-paths.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.99987 | 6.180901 |
58e4dc48-dce9-499e-b943-747adcfc766e | kdoda/AlgorithmicProblems | wildcardMatching.cpp | class Solution {
public:
bool** createMatrix(int row, int col)
{
bool **m = new bool*[row]; //m rows
for (int i = 0;i < row;++i)
m[i] = new bool[col];
return m;
}
//O(m*n) using Dynamic Programming
bool isMatch(const string & text, const string & pattern)
{
int m = text.length();
int n = pattern.l... | ALGO | 0.999781 | 5.129049 |
0f0d047c-3939-4f3b-9ce9-0b1fa42b76df | fe1w0/VulnInfoSearch | DataSet/MethodSet/NoVulnSet/C++/CWE-369/CVE-2021-29557/Compute.cpp | void Compute(OpKernelContext* ctx) {
const Tensor& a = ctx->input(0);
const Tensor& b = ctx->input(1);
OP_REQUIRES(ctx, TensorShapeUtils::IsMatrix(a.shape()),
errors::InvalidArgument("a is not a matrix"));
OP_REQUIRES(ctx, TensorShapeUtils::IsMatrix(b.shape()),
errors:... | ALGO | 0.994534 | 6.971965 |
1aa9c1c5-9b5c-49f4-a688-4805d5f8ff5c | ishandutta2007/codeforces | potassium/normal/417/C.cpp | #pragma GCC optimize ("Ofast")
//#pragma comment(linker, "/stack:200000000")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
//#include<ext/pb_ds/assoc_container.hpp>
//#include<ext/pb_ds/tree_policy.hpp>
#define INF 2147483647
#define LLINF LLONG_MAX
#define PI ... | ALGO | 0.999911 | 3.684872 |
f9b77a0b-3779-4022-a87e-b7d09040915d | ArushNo1/Competitive-Programming | CF/2050D.cpp | #pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> ii;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef vector<bool> vb;
#define endll '\n'
#define all(... | ALGO | 0.999991 | 4.528871 |
46215896-936a-4705-b3c4-0edbe9d8c87e | Felle33/Competitive-Programming | usaco/silver/customComparatorAndCoordinateCompression/boxers.cpp | #include <algorithm>
#include <iostream>
#include <cmath>
#include <vector>
#include <queue>
#include <cstring>
#include <unordered_map>
#include <map>
#include <set>
#include <iomanip>
#define all(x) (x).begin(), (x).end()
#define mp make_pair
#define pb push_back
#define rep(X,Y) for (int (X) = 0;(X) < (Y);++(X))
#d... | ALGO | 0.999895 | 4.091837 |
38432613-02d5-4897-9465-3f3a283b7b36 | yjbong/problem-solving | boj/1802/1802.cpp | #include <cstdio>
#include <cstring>
char s[3333];
bool foldable(char *s){
int len=strlen(s);
bool ok=true;
int i,j;
while(len>1){
for(i=0, j=len/2+1; i<len/2; i++,j++){
if(i==(len/2)/2 && s[i]==s[j]){
ok=false;
break;
}
else if... | ALGO | 0.999914 | 4.368833 |
705b5aca-ba86-45c3-9f89-c7277623178d | abhishekraut1/DSA_Problems | vertical_order_traversal_binary_tree.cpp | #include<bits/stdc++.h>
using namespace std;
// 10
// / \
// 20 30
// / \
// 40 50
struct Node{
Node *right;
Node *left;
int data;
Node(int key){
data = key;
right = left = NULL;
}
};
vector<int> verticalOrder(Node *root)
{
map<int,map<int... | ALGO | 0.999989 | 4.612556 |
8ac37e7b-b50e-4935-bf97-3292bfcf80f8 | ScrimBundy/CompetitiveCoding | Kattis/Family Visits/main2.cpp | #include <iostream>
#include <vector>
#include <algorithm>
const int IMPOSSIBLE = 9001;
using namespace std;
int main() {
int n, d;
cin >> n >> d;
int m[n], c[n], v[d];
for(int i = 0; i < n; i++) {
cin >> m[i] >> c[i];
}
for(int i = 0; i < d; i++) {
cin >> v[i];
}
// Running total of interval answers... | ALGO | 0.999975 | 4.583958 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.