uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
2444aa0f-2751-41bf-9542-1dbf34de736b | knknkn1162/ant_competitive_solution | 2.1.3/abc045_b.cpp | #include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstd... | ALGO | 0.999945 | 3.965897 |
e37a8e5e-b209-4c45-a7f2-21a4fba0f854 | SamanKhamesian/ACM-ICPC-Problems | Codeforces/501B - Misha and Changing Handles.cpp | #include <iostream>
#include <cstring>
using namespace std;
int main()
{
int numbers, k = 0;
char members[1000][2][21];
cin >> numbers;
for (int i = 0; i < numbers; i++, k++)
{
cin.get();
cin.get(members[k][0], 21, ' ');
cin.get();
cin.get(members[k][1], 21, '\n');
for (int j = 0; j < k; j++)
... | ALGO | 0.998826 | 3.302847 |
6f7061f3-48a3-44e4-852f-a5ce6d61c903 | liuduan/GERG-TABS | TABS2-Home-dir/Iridium/Convert_to_base64/hexdecimal_new.cpp | #include<iostream>
using namespace std;
int main()
{
char a[8];
char b[] = "0123456789ABCDEF"; //If change to 64 base, this line is having problem.
long m;
cin>>m;
long s = m;
int i = 0;
while(s/16 != 0)
{
a[i++] = b[s%16];
s = s/16;
}
... | ALGO | 0.99989 | 4.247417 |
45226cc8-331d-444d-9521-725669748ffc | AritraLeo/DSA-with-Cpp | Cpp/STL-Probs/Heap-Ques/Median-Running-Heap.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <stack>
#include <queue>
using namespace std;
#define vi vector<int>
priority_queue<int, vi, greater<int>> pqmin;
priority_queue<int, vi> pqmax;
void insert(int x)
{
// For size equal:
if (pqmin.size() == pqmax.size())
{
if (pqm... | ALGO | 0.999909 | 5.234863 |
722ec427-8e34-4f36-9a62-cbfc6a191454 | jackzenko/CodeExamples | TestCpp/TestCpp/main.cpp | #include <iostream>
#include <string>
#include <math.h>
#include <algorithm>
#include <mutex>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <stack>
#include <iterator>
#include <list>
#include <array>
#include <ctime>
#include <utility>
#incl... | ALGO | 0.998913 | 3.840796 |
2695fe9b-31dd-40a3-bf9f-f4c9c4494386 | Jason0803/Algorithm_ProblemSolving | Algorithm_cpp/swx_3456/main.cpp | #include <cstdio>
int t, a, b, c, ans;
int main() {
scanf("%d", &t);
for(int test_case = 1; test_case <= t; test_case++) {
scanf("%d %d %d", &a, &b, &c);
if(a == b && b == c) {
ans = a;
} else if(a == b) {
ans = c;
} else if(a == c) {
ans = b;
... | ALGO | 0.999927 | 4.245376 |
fe961cab-72c5-4598-8b63-1963f3002f49 | yefferson12355/repositorioPensamientoComputacional | ProblemasDeOmega/el_perrito_que_quiere_un_hueso/main.cpp | #include <iostream>
using namespace std;
int main(){
int L1,T1,L2,T2;
cin>>L1>>T1;
cin>>L2>>T2;
if(L1>L2&&T1>T2){
cout<<"Hueso 1";
}
else{
if(L2>L1&&T2>T1){
cout<<"Hueso 2";
}
else{
cout<<"Perrito confundido :(";
}
}
}
| ALGO | 0.999834 | 3.339988 |
6760dd97-3ec5-4dd5-ba1a-865b31e3498a | glaubitz/llvm-monorepo | llvm/lib/CodeGen/RegisterScavenging.cpp | #include "llvm/CodeGen/RegisterScavenging.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/BitVector.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/CodeGen/LiveRegUnits.h"
#include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeG... | TOOL | 0.884099 | 6.731394 |
5f0a0ab3-b7bf-4cf7-8cfd-73224cfdd627 | HznuGong/Cpp | 1.9_while_50_100.cpp | #include<iostream>
int main()
{
int sum = 0;
int i = 50;
while (i<=100)
{
sum += i;
++i;
}
std::cout << "Sum of 50 to 100 inclusive is " << sum << std::endl;
} | ALGO | 0.995881 | 3.814044 |
87a0da13-257b-4131-8408-edf530951755 | zhangting2020/CodingInterview | JianZhiOffer/14.二叉树中和为某一值得路径.cpp | /*************************************************************************
题目描述
输入一颗二叉树和一个整数,打印出二叉树中结点值的和为输入整数的所有路径。
路径定义为从树的根结点开始往下一直到叶结点所经过的结点形成一条路径。
解题思路:
先序遍历二叉树,找到每一条路径。这里每次将期望值减去当前结点,因此最终当前结点与
期望值相等的时候,并且该结点是叶节点,则是一条满足要求的路径。
1. 每次将当前访问的结点加入到路径trace中;若当前的结点的值等于期望值,并且为叶结点,把这一条路径加入path
2. 否则,当左子树不为空,继续寻找路径;当右子树不为空,... | ALGO | 0.999956 | 4.549989 |
45028a96-b24b-4f8d-b098-12bb70628e77 | choyon001/cpp | abs.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int m=-22;
cout<<"result is: "<<abs(m)<<endl;
cout<<"power is : "<<pow(5,2);
return 0;
} | ALGO | 0.980116 | 3.546879 |
9b98ec9c-151d-4855-8ba7-3e2e6bfb5c2c | raincross7/code-similarity | codes/train_code/problem136/problem136_4.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
string S,T;cin>>S>>T;
sort(S.begin(),S.end());
sort(T.begin(),T.end());
reverse(T.begin(),T.end());
cout<<(S<T?"Yes":"No")<<endl;
} | ALGO | 0.999989 | 3.949843 |
6487f3ff-15b5-4d2f-a094-f76c33742816 | sonnh173341/TTUDSS | Train1/SUMSEQ.cpp | #include <iostream>
#include <math.h>
using namespace std;
int addmod(int a, int b, int c){
a = a%c;
b = b%c;
int tmp = c-a;
if(b>tmp){
return b-tmp;
}else{
return a+b;
}
}
int main(){
int n;
int c = pow(10, 9)+7;
cin >> n;
int a[n];
for(int i=0; i<n; i++){
cin>>a[i];
}
int mod = 0... | ALGO | 0.999977 | 4.134703 |
5d156ff9-d1c1-46c8-955f-dcbaf86e2220 | shweMax/striver_nqtSheet | strings/freqofChar.cpp | #include<bits/stdc++.h>
using namespace std;
void countfreq(string s, int len){
unordered_map<char,int> freq;
for(int i=0; i<len; i++){
freq[s[i]]++;
}
for(auto it:freq){
cout<<it.first<<"-> "<<it.second<<" ";
}
}
int main(){
string s;
cout<<"Enter string: ";
cin>>s;
... | ALGO | 0.999522 | 4.500339 |
848624bb-ce9e-4abf-a5cf-581471b25257 | jposco/Practice | 프로그래머스/lv0/120841. 점의 위치 구하기/점의 위치 구하기.cpp | #include <string>
#include <vector>
using namespace std;
int solution(vector<int> dot) {
int answer = 0;
if(dot[0] >0 && dot[1]>0) return 1;
else if(dot[0] <0 && dot[1]>0) return 2;
else if(dot[0] <0 && dot[1]<0) return 3;
else return 4;
return answer;
} | ALGO | 0.999777 | 5.178574 |
136be50b-9c8c-4bd5-b210-e06e1e6ffc0f | aiidana/pp1 | lab2/ol2.cpp | #include <bits/stdc++.h>
using namespace std;
int main () {
int a, b;
cin >> a >> b ;
{
cout << (a^b) << endl;
}
return 0;
} | ALGO | 0.999926 | 3.340661 |
c24a5212-2179-431f-8ec2-44fcce92b271 | Srishti-Somya/Problems | 0073-set-matrix-zeroes/0073-set-matrix-zeroes.cpp | class Solution {
public:
void setZeroes(vector<vector<int>>& matrix) {
int n = matrix.size();
int m = matrix[0].size();
vector<int> rows(n, 1);
vector<int> columns(m ,1);
for( int i = 0 ; i < matrix.size() ; i++ )
{
for( int j = 0 ; j < matrix[0].size() ; ... | ALGO | 0.999262 | 5.993371 |
37432dbf-3e78-4157-8077-59648e7cf5ed | spinos/aphid | cudabvh/CudaLinearBvh.cpp | #include <CudaBase.h>
#include <BaseBuffer.h>
#include <CUDABuffer.h>
#include "BvhTriangleMesh.h"
#include "CudaLinearBvh.h"
#include <BvhBuilder.h>
#include <radixsort_implement.h>
#include "bvh_dbg.h"
BvhBuilder * CudaLinearBvh::Builder = 0;
CudaLinearBvh::CudaLinearBvh()
{
m_numPrimitives = 0;
m_numActiveInte... | ALGO | 0.991029 | 6.667905 |
048d318e-7be7-4c20-9abb-3594120c6371 | moondemon68/cp | Codeforces/PastContests/1184/1184E1.cpp | #include<bits/stdc++.h>
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
#define inf INT_MAX
#define MOD 1000000007
#define MEM(a,b) memset(a,(b),sizeof(a))
#define pqg priority_queue<long long, vector<long long>, greater<long long> >
#define pql priority_queue<long long>
#define ll long lon... | ALGO | 0.999961 | 4.36636 |
d8c8096b-f9f2-4cc3-b561-6a75eeb004d7 | wareHHOuse/diskpp | apps/utils/inertia_transform_plot.cpp | /*
* DISK++, a template library for DIscontinuous SKeletal methods.
*
* Matteo Cicuttin (C) 2023
* <EMAIL>
*
* Politecnico di Torino - DISMA
* Dipartimento di Matematica
*/
/* Make a postscript file with the drawings of the trasformation applied to
* each element during the evaluation of the monomial basis fu... | ALGO | 0.868915 | 5.328841 |
abd553ea-3fc4-4753-8fee-9639690d385b | ehds/mbraft | src/braft/ballot.cpp | // Authors: Zhangyi Chen(<EMAIL>)
#include "braft/ballot.h"
#include <algorithm>
#include <cassert>
#include <iterator>
#include "braft/configuration.h"
namespace braft {
void Ballot::init(const Configuration& conf,
std::optional<const Configuration> old_conf) {
_peers.clear();
_old_peers... | TOOL | 0.970285 | 6.200834 |
d91d1c76-8efb-4edb-9ee3-f47f033154bf | optjyy/PAC | bj/bj_1977.cpp | #include <iostream>
using namespace std;
int main(void) {
int M, N, num, sum = 0, min_val;
cin >> M >> N;
min_val = N;
int sqr_num;
for (int i = 1; i < N; i++) {
sqr_num = i * i;
if ((sqr_num >= M) && (sqr_num <= N)) {
sum += sqr_num;
if (min_val > sqr_num) {... | ALGO | 0.999964 | 4.586051 |
6326becf-1c2a-4242-953d-5c36ffa39023 | abhishek9212/CPP_and_DSA | DSA questions and topics/Arrays_and_Matrices/count_inversions.cpp | #include<iostream>
#include <bits/stdc++.h>
using namespace std;
void mergeAlgo(long long *arr, int low, int mid, int high, int &count){
long long b[high+1];
int k = low, i = low, j = mid+1;
while(i<=mid && j<=high){
if(arr[i]<=arr[j]) b[k++] = arr[i++];
else {
b[k++] = arr... | ALGO | 0.999933 | 4.966674 |
cc866da8-d850-4697-bb23-febfd5027acc | KaranGulve4342/DSA | Array/Maximum Sum between increasing elements.cpp | // LEETCODE 2016
/*
class Solution {
public:
int maximumDifference(vector<int>& nums) {
int mx = -1;
int n = nums.size();
for(int i = 0;i < n-1;i++){
for(int j = i+1;j < n;j++){
if(nums[i] < nums[j]){
mx = max(mx, nums[j] - nums[i]);
... | ALGO | 0.999955 | 5.46227 |
6b51005e-bc0a-4e45-8153-ad5ea2112f9c | vivektiwari777/Codeforces--Solution-DIV3-DIV2-Contest- | A_Gravity_Flip.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin >> n;
vector<int> v(n);
for (int i = 0; i < n; i++)
{
cin >> v[i];
}
sort(v.begin(), v.end());
for (auto i : v)
{
cout << i << " ";
}
return 0;
} | ALGO | 0.999757 | 4.338652 |
81b8f458-810d-4395-8ae7-bb4c02b1d712 | pplsk2524/Coding-Crew | Multiplication.cpp | //User function Template for C++
class Solution
{
public:
vector<int> getTable(int N)
{
// Write Your Code here
vector<int> v(0,N);
for(int i=1;i<=10;i++)
{
v.push_back(N*i);
}
return v;
}
};
| ALGO | 0.99878 | 4.656644 |
ae533cd2-33d0-46da-a976-c8c820ed8bbf | WangDavid2012/cpp | cpp/stl/dm07_map容器课堂练习.cpp | #define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<map>
#include<string>
using namespace std;
//mapʼ
void test01(){
//mapģ Ҫָkey value
map<int, string> mymap; //ĬϹ
map<int, string> mymap2(mymap); //
}
//map
void test02(){
map<int, int> mymap;
//һֲ뷽ʽ
mymap.insert(pair<int, int>(1, 5));
//ڶ
pai... | TOOL | 0.879994 | 3.62299 |
dd27ac7d-97a3-40d6-baab-380ac08be29c | MattClarkson/CMakeCatch2-Workshop1 | Code/3rdParty/Eigen-3.2.2.1/doc/examples/Tutorial_ArrayClass_interop_matrix.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace Eigen;
using namespace std;
int main()
{
MatrixXf m(2,2);
MatrixXf n(2,2);
MatrixXf result(2,2);
m << 1,2,
3,4;
n << 5,6,
7,8;
result = m * n;
cout << "-- Matrix m*n: --" << endl << result << endl << endl;
result = m.array() * ... | ALGO | 0.998536 | 4.306757 |
f441f3f7-1512-4ca7-b39b-10b89a5878f4 | optozorax/olymp | contests/leetcode/binary-tree-level-order-traversal.cpp | // https://leetcode.com/problems/binary-tree-level-order-traversal/
/**
* 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) {}... | ALGO | 0.999988 | 6.990767 |
482cc688-51b6-41e5-923b-0f7ba87291b9 | SamuelYergeau/GIF-1003 | Labo2/Exercices/Exercice4/facture.cpp | /*
* facture.cpp
*
* Created on: 2020-01-22
* Author: etudiant
*/
#include <iostream>
#include <string>
using namespace std;
int main(void){
int client = 1;
int kwh = 0;
int sommeclient = 0;
double sommefacture = 0;
while (client != 0){
cout << "entrer une valeur" << endl;
cin >> client >> kwh;
... | TOOL | 0.931046 | 3.756348 |
d7edbb82-7fd1-4ca1-8bbc-137464969715 | airen3339/llvm-project | libc/src/math/generic/totalorderf16.cpp | #include "src/math/totalorderf16.h"
#include "src/__support/FPUtil/BasicOperations.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(int, totalorderf16, (const float16 *x, const float16 *y)) {
return static_cast<int>(fputil::totalorder(*... | ALGO | 0.930903 | 6.680734 |
183603de-43d7-463a-a512-a564f417500f | varunjampani/video_prop_networks | lib/caffe/src/caffe/solvers/adadelta_solver.cpp | #include <vector>
#include "caffe/sgd_solvers.hpp"
namespace caffe {
template <typename Dtype>
void AdaDeltaSolver<Dtype>::AdaDeltaPreSolve() {
// Add the extra history entries for AdaDelta after those from
// SGDSolver::PreSolve
const vector<Blob<Dtype>*>& net_params = this->net_->learnable_params();
for (i... | ALGO | 0.933277 | 7.575578 |
602dd810-800d-4873-8074-0d644fbb6cfd | Dai0526/Algorithm | Algorithm/OnlineAssessment/LeetCode/Easy/136_SingleNumber.cpp | /*
https://leetcode.com/problems/single-number/
1. Use hash map
Time O(n)
Space O(n)
2. Bit manipulation - XOR
a xor 0 = a
a xor a = 0
So all pair will be 0, and the remain xor 0 will be the one
*/
#include <vector>
using namespace std;
class Solution {
public:
int singleNumber(vector<int>& nums) {
... | ALGO | 0.999932 | 5.79954 |
bdee91d3-ec15-442d-a3b3-3a84daee90d4 | yfz3357/CCC-senior-solutions | 2011 Senior/2011S3.cpp | // Created by Davidia on 2018-12-17.
//
#include <bits/stdc++.h>
using namespace std;
int highest_square(int power,int x){
if (power>=1){
int actual_x = x/((int)pow(5,power-1)); // 4/5 = 0...
if (actual_x == 0 || actual_x == 4){ // at the edge
return 0;
}
if (actual_x ... | ALGO | 0.999596 | 4.377032 |
c0bdb0ab-be78-42cf-808b-dc4d2de45548 | by-student-2017/lammps-14May16 | src/fix_wall_lj126.cpp | #include <math.h>
#include "fix_wall_lj126.h"
#include "atom.h"
#include "error.h"
using namespace LAMMPS_NS;
using namespace FixConst;
/* ---------------------------------------------------------------------- */
FixWallLJ126::FixWallLJ126(LAMMPS *lmp, int narg, char **arg) :
FixWall(lmp, narg, arg) {}
/* -------... | ALGO | 0.999319 | 5.395377 |
34446af4-d60b-4b67-add7-9f33799ce90e | IMbackK/autobiblatex | tokenize.cpp | #include "tokenize.h"
std::vector<std::string> tokenize(const std::string& str, const char delim, const char ignBracketStart, const char ignBracketEnd)
{
std::stringstream ss(str);
std::vector<std::string> tokens;
std::string token;
size_t bracketCounter = 0;
for(char ch : str)
{
if(ch == delim && bracketCoun... | ALGO | 0.899631 | 5.476745 |
066b89d3-8c5f-4054-a0c2-6ad8a7fd344d | vishavghotra/CPP | codeforces/735/D.cpp | #include <bits/stdc++.h>
using namespace std;
int sieve(int n)
{
for (int i = 2; i * i <= n; i++)
{
if (n % i == 0)
return 0;
}
return 1;
}
int main()
{
int n;
cin >> n;
sieve(n);
if (sieve(n))
cout << 1 << endl;
else if (n % 2 == 0 || sieve(n - 2))
... | ALGO | 0.999951 | 4.691889 |
2a52b36d-7835-4b3c-a87a-af4b84cd8533 | ishandutta2007/codeforces | rebelz/normal/1458/D.cpp | #include<bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
template <typename T> bool chkmax(T &x,T y){return x<y?x=y,true:false;}
template <typena... | ALGO | 0.999991 | 3.536323 |
6aa9d387-da40-409b-b89e-551538715f9d | arkokundu500/CP-Problems | 0231-power-of-two/0231-power-of-two.cpp | class Solution {
public:
bool isPowerOfTwo(int n) {
for(int i =0;i<31;i++){
int ans = pow(2,i);
if(ans == n)return true;
}
return false;
}
}; | ALGO | 0.997725 | 6.286307 |
53810222-6418-4814-9bba-7c824231c7b0 | nishgpt/competitive_programming | codechef/COG2018/COG1802.cpp | /*
Author : Nishant Gupta 2.0
*/
#include<bits/stdc++.h>
#define LL long long int
#define pb push_back
#define mp make_pair
#define MAX 1000007
#define MOD 1000000007
using namespace std;
LL pressure[MAX];
int main() {
int n, h, p, i;
scanf("%d", &n);
vector<pair<LL, LL> > v;
for(i=0;i<n;i+... | ALGO | 0.99994 | 3.590165 |
55e26a2d-ab19-4ad4-8130-29355e8818a7 | shoukailiang/algorithm | leetcode/剑指offer/剑指 Offer 10- I. 斐波那契数列(一遍过)/1.cpp | class Solution {
private:
int fn[101];
public:
int fib(int n) {
fn[0] = 0;
fn[1] = 1;
for(int i =2;i<=n;i++){
fn[i] = (fn[i-1]+fn[i-2])%1000000007;
}
return fn[n];
}
}; | ALGO | 0.999981 | 5.490896 |
1086e04e-edab-4b82-a257-c5ab23a3f95b | jainish1510/DSA-codehelp-course | Lecture-029/2_Jaggered_Array.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int row;
cout << "Enter the value of row : ";
cin >> row;
int **arr = new int *[row];
for(int i=0; i<row; i++) {
int col;
cout << "Enter col : ";
cin >> col;
arr[i] = new int[col+1];
for(int j=0;... | ALGO | 0.954043 | 3.618036 |
72d91a09-eb2f-44b9-8b9a-5945508ab03a | hmofrad/CodingPractice | skinnyleetcode/MyHashMap.cpp | /*
* https://leetcode.com/problems/design-hashmap/submissions/
* (c) Mohammad Hasanzadeh Mofrad, 2020
* (e) <EMAIL>
*/
class MyHashMap {
public:
const int n_buckets = 2069;
std::vector<std::vector<std::pair<int,int>>> map;
MyHashMap() {
map.resize(n_buckets);
}
void put(int key... | ALGO | 0.992012 | 6.140712 |
c7d7b838-7d6e-4a3d-ba8a-ad9c83df2b3c | tboschi/fccl | src/reject.cpp | /* given expected background, this code finds
* the minimum expected signal to reject the
* null hypothesis
* H_0 = "there is no signal, just background"
*/
#include <iostream>
#include <cstdlib>
#include <iomanip>
#include <getopt.h>
#include "fccl/region.h"
int main(int argc, char** argv) {
double CL = 0.90... | ALGO | 0.992629 | 6.976007 |
b47be854-e471-4668-8473-0e65193688b5 | trungduc81/DSA | Sort and Search/DSA06022 - SỐ NHỎ NHẤT VÀ NHỎ THỨ HAI.cpp | #include <bits/stdc++.h>
using namespace std;
void sapxep(int a[] , int n)
{
int MIN_1 = 1E7 + 2 , MIN_2 = 1e7 + 2 ;
for(int i = 0 ; i < n ; i++ )
{
if(a[i] < MIN_1)
{
MIN_2 = MIN_1 ;
MIN_1 = a[i] ;
}
else if(a[i] > MIN_1 && a[i] < MIN_2 )
{
MIN_2 = a[i] ;
}
}
if(MIN_2 == 1e7 + 2)
{
... | ALGO | 0.999844 | 3.87034 |
7dd69d70-a038-453e-b6ad-c5fe201bb9b8 | sadramanouch/leetcode | 0257-binary-tree-paths/0257-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.999941 | 6.242425 |
c79f6dec-ad53-4905-932c-129a45c7cf67 | PalmtreeBranch/moneyapp_speed_code | 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 |
7882aca2-32e3-4197-9220-2c1f97227bbb | venkataKoushik/recursion-cpp | prob8.cpp | #include<bits/stdc++.h>
using namespace std;
bool check(string s,int start,int end)
{
if(start>=end)return true;
if(s[start]!=s[end])return false;
start++;
end--;
return check(s,start,end);
}
int main()
{
string s="madan";
if(check(s,0,s.length()-1))
cout<<"Polindrome string";
... | ALGO | 0.999874 | 4.55134 |
51eabe12-0cb0-484f-a30a-6c49a197e1f9 | darpa776/PS | dongbinna_CT_실전/_38정확한순위.cpp | #include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#define INF 1e9
using namespace std;
int main() {
int n;
int m;
cin>> n >> m;
int arr[501][501];
for (int i = 0; i < 501; i++) {
fill_n(arr[i], 501, INF);
}
for (int i = 0; i < m; i++) {
int x, y;
cin >> x >> y;
arr[x][y] = 1... | ALGO | 0.999941 | 3.340421 |
a47931af-bf59-4267-b4cd-80b9ee3d2792 | OshanJayawardana/Autonomous-Mobile-Robot-Webots-Simulator | Box picking/New folder/webots_temp/controllers/my_controller_new/my_controller_new.cpp | #include <webots/Robot.hpp>
#include <webots/Motor.hpp>
#include <webots/Brake.hpp>
#include <webots/DistanceSensor.hpp>
#include <webots/PositionSensor.hpp>
#include <tuple>
#include <iostream>
#include <cstdlib>
#include <vector>
#include<string>
#include <webots/LED.hpp>
#include <string>
#include <cmath>
#include ... | ALGO | 0.996563 | 3.118859 |
d52b9129-3c72-476d-8625-979ffa4be0d0 | tyd2000/LanQiaoCup | BEGIN-3 圆的面积.cpp | #include <bits/stdc++.h>
using namespace std;
#define PI atan(1.0)*4
int main()
{
double r;
cin >> r;
double area = PI*r*r;
printf("%.7lf\n",area);
return 0;
} | ALGO | 0.997344 | 4.37989 |
b9fb2cc4-c304-446a-8755-20a92d07895d | ADI201998/MPC_Acado | src/acado_getting_started/getting_started.cpp | /**
* \file examples/code_generation/getting_started.cpp
* \author Hans Joachim Ferreau, Boris Houska
* \date 2011-2013
*/
#include <acado_code_generation.hpp>
int main( )
{
USING_NAMESPACE_ACADO
double rr = 0.5, ro = 0.5;
OnlineData xo_1;
OnlineData yo_1;
OnlineData xo_2;
OnlineData yo_2;
O... | ALGO | 0.999106 | 5.720025 |
740b2580-fc69-41d2-a10e-9ca6c4c2c758 | SharathN29/Leetcode | Leetcode - C++/string_firstUnique.cpp | #include <iostream>
#include <unordered_map>
using namespace std;
int firstUniqChar(string s) {
unordered_map<char, int> map;
for(auto &c : s)
map[c]++;
for(int i = 0; i < s.size(); i++)
if(map[s[i]] == 1)
return i;
return -1;
}
int main() {
string s = "leetcode";
int index = firstUniqChar(s);
cout ... | ALGO | 0.99945 | 5.08817 |
a838d9b7-a516-49b5-b845-dc801440b3ec | commonapi-someip/boost_1_71_0 | libs/log/src/setup/settings_parser.cpp | /*!
* \file settings_parser.cpp
* \author Andrey Semashev
* \date 20.07.2012
*
* \brief This header is the Boost.Log library implementation, see the library documentation
* at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html.
*/
#ifndef BOOST_LOG_WITHOUT_SETTINGS_PARSERS
#include... | TOOL | 0.902183 | 7.483113 |
b579d9ff-3f59-486c-9691-1b1ccb591126 | jaysc5/Algorithm_study | 프로그래머스/0/181881. 조건에 맞게 수열 변환하기 2/조건에 맞게 수열 변환하기 2.cpp | #include <string>
#include <vector>
using namespace std;
int solution(vector<int> arr) {
int answer = 0;
vector<int> check = arr;
while(1){
for (auto &a : arr){
if (a >= 50 & a%2 ==0) a = a/2;
else if (a < 50 & a%2 != 0) a = (a*2+1);
}
if (check==arr) return... | ALGO | 0.999796 | 5.072405 |
66cc97d8-fd34-4d0b-b20e-e1276ce83ad2 | artiam99/GeeksforGeeks | 1 Arrays/4 Range Query/11 Binary Index Tree Summation Query.cpp | #include <bits/stdc++.h>
using namespace std;
int Get_Sum(int *BIT , int r)
{
r++;
int sum = 0;
while(r > 0)
{
sum += BIT[r];
r -= (r & -r);
}
return sum;
}
void Update(int *BIT , int n , int i , int val)
{
i++;
while(i <= n)
{
BIT[i] += val;
i += (i & -i);
}
}
int* Construct(int a[] ... | ALGO | 0.999858 | 4.348814 |
e0769e54-1b94-406c-aaa8-a49a549066f5 | acg7878/PAT_code | CODE/41-50/47/my.cpp | #include <iostream>
#include <string>
#include <vector>
#include <set>
int main(){
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
int N,K;
std::cin >> N >> K;
std::vector<std::set<std::string>> course(K+1);
while (N--) {
std::string student;
int course_num;
std... | ALGO | 0.999838 | 4.153205 |
5705ded2-bf22-46e9-9b82-bad5053e46c2 | curaposterior/aisd | cwa_210322/buble.cpp | #include <iostream>
#include <random>
using namespace std;
struct node {
int val;
node* next;
};
void sort(node*&);
void addToEnd(node* &head, int);
void print(node*);
void add(node* &head, int new_val);
int main(void) {
node* head = nullptr;
random_device dev;
mt19937 rng(dev());
uniform_in... | ALGO | 0.999878 | 4.799068 |
aa2c4e20-b63c-4dd8-bf1b-fd0eb0d57053 | hozan66/College-Practical-Code | C++(OOP)/Mode test/main.cpp | #include <iostream>
using namespace std;
int main()
{
int num,x=0;
int a[10];
cout<<"Enter your number: ";
cin>>num;
for(int i=0;num!=0;i++)
{
a[x]=num%10;
x++;
num/=10;
}
int mx=a[0];
cout<<"Reverse of Number=";
for(int i=0;i<x;i++)
{
... | ALGO | 0.994871 | 3.545356 |
f6060e2a-feae-4673-b007-b6688ef3ac05 | ishandutta2007/codeforces | irkstepanov/normal/825/C.cpp |
#include <bits/stdc++.h>
#define all(a) (a).begin(), (a).end()
#define sz(a) (int)(a).size()
#define pb push_back
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef double ld;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
//ifstr... | ALGO | 0.999766 | 3.837032 |
3ea43540-17f1-4f10-ad7e-116e2b284626 | raincross7/code-similarity | codes/train_code/problem406/problem406_231.cpp | #include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define int long long
const int N = 1e5 + 5;
struct Gauss
{
static const int bits = 60;
int table[bits];
Gauss()
{
for(int i = 0; i < bits; i++)
table[i] = 0;
}
int size()
... | ALGO | 0.999995 | 4.430619 |
12cc55c1-2a88-4059-ae5d-b820eff604a6 | Ashutosh-Singh-10/LeetcodeQuestions | 1675-magnetic-force-between-two-balls/magnetic-force-between-two-balls.cpp |
int check(vector<int> &vec,int k,int m)
{
int x=vec[0];
for(auto &i:vec)
{
if(i-x>=k)
{
m--;
x=i;
}
}
return m<=1?1:0;
}
class Solution {
public:
int maxDistance(vector<int>& vec, int m) {
sort(vec.begin(),vec.end());
int high=vec... | ALGO | 0.999957 | 5.322772 |
9f8e393c-8b4f-4f99-a20d-8ff3f28a22d2 | mixati/Yandex-Traning-4.0-Algorithms | Warming-up/ex_D.cpp | #include <iostream>
#include <string>
#include <map>
using namespace std;
int main() {
string wordA, wordB;
map<char, int> mp;
cin >> wordA >> wordB;
if (wordA.length() != wordB.length()) {
cout << "NO" << endl;
return 0;
}
for (int i = 0; i < wordA.length(); i++)
mp[wo... | ALGO | 0.999997 | 4.635313 |
3f7c0ca4-20c0-4a07-9804-1351d884d969 | ishandutta2007/codeforces | galen_colin/normal/1400/C.cpp | #include <bits/stdc++.h>
using namespace std;
#define send {ios_base::sync_with_stdio(false);}
#define help {cin.tie(NULL); cout.tie(NULL);}
#define f first
#define s second
#define getunique(v) {sort(v.begin(), v.end()); v.erase(unique(v.begin(), v.end()), v.end());}
typedef long long ll;
typedef long double lld;
... | ALGO | 0.999696 | 3.916215 |
0f6748fc-b0df-48df-a2ba-36c1384c1566 | ishandutta2007/codeforces | scott_wu/normal/1086/D.cpp | #include <iostream>
#include <iomanip>
#include <algorithm>
#include <map>
#include <vector>
#include <string>
#include <set>
#include <cmath>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
using namespace __gnu_pbds;
using na... | ALGO | 0.999555 | 3.721907 |
bd8d693f-33c7-4823-94b7-71a79abf9453 | amartya895/LeetCode-questions | 0448-find-all-numbers-disappeared-in-an-array/0448-find-all-numbers-disappeared-in-an-array.cpp | class Solution {
public:
vector<int> findDisappearedNumbers(vector<int>& nums) {
int n = nums.size();
vector<int> check(n+1 , 0);
for(int i = 0 ; i < n ; i++)
{
check[nums[i]] += 1;
}
vector<int> ans;
for(int i = 1 ; i... | ALGO | 0.999426 | 5.167946 |
6d94eb77-63ae-4118-a933-98cffac8989a | GeorgeAnson/emule | emule-gifc/trunk/cryptopp/emsa2.cpp | // emsa2.cpp - written and placed in the public domain by Wei Dai
#include "pch.h"
#include "emsa2.h"
#ifndef CRYPTOPP_IMPORTS
NAMESPACE_BEGIN(CryptoPP)
void EMSA2Pad::ComputeMessageRepresentative(RandomNumberGenerator &rng,
const byte *recoverableMessage, size_t recoverableMessageLength,
HashTransformation &has... | ALGO | 0.97473 | 7.77748 |
c02af91e-6b24-4210-917e-0bc283a1dc50 | Jazzcharles/ACM-ICPC-Code | shuoj/1566/main.cpp | #include <iostream>
#include<queue>
#include<cstring>
#define MP(a,b) make_pair(a,b)
using namespace std;
typedef pair<int,int> PII;
int a[5][5],vis[5][5],dir[4][2]={-1,0,1,0,0,-1,0,1};
PII pre[5][5];
bool ok(int x,int y){
if(x>=0 && x<5 && y>=0 && y<5 && !a[x][y]) return 1 ;
return 0;
}
int bfs(){
queue<PII> q;
q... | ALGO | 0.999625 | 4.288342 |
f35851fc-d50e-48c9-9ece-2f6255d4d3ca | tin10401/CodeForces | CodeForces/E_William_The_Oblivious.cpp | //████████╗██╗███╗░░██╗██╗░░░░░███████╗
//╚══██╔══╝██║████╗░██║██║░░░░░██╔════╝
//░░░██║░░░██║██╔██╗██║██║░░░░░█████╗░░
//░░░██║░░░██║██║╚████║██║░░░░░██╔══╝░░
//░░░██║░░░██║██║░╚███║███████╗███████╗
//░░░╚═╝░░░╚═╝╚═╝░░╚══╝╚══════╝╚══════╝
// __________________
// | ________________ |
// || ____ ||
// ||... | ALGO | 0.999693 | 4.745956 |
4d550baa-ced5-4a1a-9d9d-ff52f1cae82b | thilio/Competitive-Programming | OJ/AtCoder/abc160E - Red and Green Apples.cpp | #include "bits/stdc++.h"
using namespace std;
#define pb push_back
#define mp make_pair
#define fst first
#define snd second
#define fr(i,n) for(int i=0;i<n;i++)
#define frr(i,n) for(int i=1;i<=n;i++)
#define ms(x,i) memset(x,i,sizeof(x))
#define dbg(x) cout << #x << " = " << x << endl
#define all(x) x.begin(),x.en... | ALGO | 0.99992 | 3.228682 |
9586e6a2-9543-4755-aa31-72a53f761a8b | PhillipNoir/Proyectos-ProgramacionEstructurada | mayorMenorEnArreglo.cpp | /*Programa que solicita al usuario 10 números y muestra el menor y el mayor*/
#include<iostream>
#include<array>
int main(){
std::array<int,10> nums;
for (int i = 0; i < 10; i++) //Este ciclo almacena cada número
{
std::cout<<"Ingresa un número: \n";
std::cin>>nums[i];
}
int menor=nu... | ALGO | 0.999065 | 3.438433 |
f9df2c3e-1afb-4ad0-b170-e5ac704710a3 | NayeemHasan807/learning-computer-graphics-fall-2020-2021 | Lab5/TwoBoxAnimation/main.cpp | #include<cstdio>
#include <GL/gl.h>
#include <GL/glut.h>
GLfloat position1 = 0.0f;
GLfloat position2 = 0.0f;
GLfloat speed = 0.1f;
void box1() //id box1
{
glBegin(GL_QUADS);
glColor3f(1.0f, 1.0f, 0.0f);
glVertex2f(-0.2f, -0.2f);
glVertex2f( 0.2f, -0.2f);
glVertex2f( 0.2f, 0.2f);
glVertex2f(-0... | ALGO | 0.940258 | 4.245237 |
ffaf130c-adde-4bb7-90e7-d1a4dc68eb9b | jmartinez159/leetcode | 0024: swapNodes.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* swapPairs(L... | ALGO | 0.999995 | 5.87416 |
dd9af19b-f8c9-461f-b912-e5dd85025f39 | raygadasbaezrodrigo/Tarea-22 | Tarea 22/Programa 4.cpp | #include<stdio.h>
#include<stdlib.h>
#include"info.h"
#define MAX 10
int main ()
{
appInfoData("Ejemplo de punteros y arreglos", "14/11/2017");
int cals [MAX] = {8,9,8,8,6,7,9,8,10,10};
int *ptrCals;
printf("Valor del primer elemento: %d\n", cals[0]);
printf("Direccion del primer elemento: %d\n", &cals[0]);
p... | ALGO | 0.995403 | 3.279428 |
0a24629a-03d9-4296-ba72-a455ba4f055f | ranahiten8/DSA | heaps/build_heap_usingArray.cpp | //build heap using array inplace and O(n) complexity
#include <bits/stdc++.h>
using namespace std;
void print(vector<int> v)
{
for (int x : v)
{
cout << x << " ";
}
cout << endl;
}
bool minheap = false;
bool cmp(int a, int b)
{
if (minheap)
{
return a < b;
}
return a >... | ALGO | 0.999961 | 4.997499 |
ffa3048e-3cfe-42b8-bea9-e8c4c9b4fcd6 | amankumar23429/Data-Structures-and-Algorithm | Greedy_algorithms/chopsticks_codechef.cpp | #include<iostream>
#include<vector>
#include<algorithm>
#define ll long long int
using namespace std;
int main(){
int n, diff;
cin>>n>>diff;
vector<int> v;
int no;
for(int i = 0; i<n; i++){
cin>>no;
v.push_back(no);
}
if(n>1){
int ans = 0;
sort(v.begin(), v.e... | ALGO | 0.999994 | 4.010453 |
33411b02-9d35-4d4a-bf98-2b0ead746304 | Boberito25/ButlerBot | armplanning_test/Eigen/doc/examples/DenseBase_middleCols_int.cpp | #include <Eigen/Core>
#include <iostream>
using namespace Eigen;
using namespace std;
int main(void)
{
int const N = 5;
MatrixXi A(N,N);
A.setRandom();
cout << "A =\n" << A << '\n' << endl;
cout << "A(1..3,:) =\n" << A.middleCols(1,3) << endl;
return 0;
}
| ALGO | 0.947709 | 3.133398 |
f976fbcc-59dc-4dda-bbbb-5eb718570a5a | MachineryZ/OJ_Vault | problems/Luogu_BABTWR.cpp | /*
# BABTWR - Tower of Babylon
## 题面翻译
题目:
有$n$种长方形方块,每种有无限个,第i种方块的三边边长是$x_{i}$,$y_{i}$,$h_{i}$(y是高,x是宽,z是长,但是这个不用管)。对于每一个方块,你可以任意选择一面作为底,这样高就随着确定了。
他们想要用堆方块的方式建尽可能高的塔。问题是,只有一个方块的底的两条边严格小于另一个方块的底的两条边,这个方块才能堆在另一个上面。这意味着,一个方块甚至不能堆在一个底的尺寸与它一样的方块的上面。要求计算出这个塔可以建出的最高的高度。
输入:
输入包含至少一组数据,每组数据的第一行是一个整数$n$($n$<=30... | ALGO | 0.999464 | 4.220521 |
57f8b8dd-2459-4777-abb6-d6c5fe8c14ac | hyunJIN7/PRACTICE_CODDINGTEST | BackJoon/C++/BOJ4963.cpp | #include <bits/stdc++.h>
using namespace std;
int h,w,ans;
int land[51][51];
int dfs(int y, int x){
if( y<0 || x<0 || y>=h || x>=w || !land[y][x] ) return 0;
land[y][x] = 0;
for(int i = -1; i <=1;i++){
for(int j = -1; j<=1;j++){
if(i || j) dfs(y+i,x+j);
}
}
return 1;
}
int main(){
ios::sync_with_stdio(... | ALGO | 0.999404 | 4.051497 |
b7c726a0-7215-47e3-9c76-37aa50c3a509 | Dmantk/Embedded | L11_exercises_oop_basic/exercises1/Source/main.cpp | /*
* File: exercises1
* Author: Duong Minh An
* Date: 22/06/2023
* Description: This's an example to calculate the distance of two points and the area formed by three points
*/
#include <iostream>
#include <ex1.h>
using namespace std;
int main() {
Point A(1, 0);
Point B(0, 3);
distanceArea example1(A, B);
floa... | TOOL | 0.940131 | 4.444741 |
8724b601-3f8d-49a1-a5e2-0f6a3bba3dc0 | Alomgir27/Codeforces_Edu_Course | SegmentTree_part_2/A - Assignment, Addition, and Sum.cpp | #include<bits/stdc++.h>
#define endl '\n'
#define print(x) cout << (#x) << " is " << x << endl;
using namespace std;
const int mxN = 2e5 + 10;
#define int long long
int N, Q;
pair<int, int> ok[4 * mxN];
int mark[4 * mxN];
void segment(int k)
{
if(mark[k]){
mark[k] = 0;
ok[2 * k].first = ok[2 * ... | ALGO | 0.999358 | 4.609954 |
26ea4ec9-dd92-440d-9fc3-0fd428d39471 | NotEsperix/Triton-CIS-121-Programming-Assignment-5 | Assignment 3.cpp | /******************************************
* Edgardo Richard Ventura *
* Week 5 *
* Assignment 3 *
* Frank Alvino *
* CIS 121-061 *
*******************************************/
#include <i... | TOOL | 0.968045 | 4.92444 |
46a937d3-0909-44f9-bc58-b02e6f70e010 | maverickreal/leetcode-solutions | 1687-delivering-boxes-from-storage-to-ports/1687-delivering-boxes-from-storage-to-ports.cpp | class Solution {
public:
int boxDelivering(vector<vector<int>>& boxes, int ports, int mxb, int mxw) {
int n=boxes.size();
vector<int>dp(n, INT_MAX);
int i=0, j=0, cw=0, cb=0;
for(; j<n; ++j){
cw+=boxes[j][1]; cb+=j==i || boxes[j][0]!=boxes[j-1][0];
while(i<j &... | ALGO | 0.999931 | 5.92437 |
dfb1f802-0833-434b-b43c-bef5a9b1f211 | Kwongrf/JianZhi | PrintMinNumber.cpp | class Solution {
public:
string PrintMinNumber(vector<int> numbers) {
sort(numbers.begin(), numbers.end(), compAsc);
string s = "";
for(int i = 0; i < numbers.size(); i++)
{
s += to_string(numbers[i]);
}
return s;
}
static bool compAsc... | ALGO | 0.999878 | 6.245734 |
4bb66f2f-3256-4701-bbb1-23c61f30da10 | dpeck12/LearningCPP | LeetCodeEasy/evenNumberDigits.cpp | #include <iostream>
#include <vector>
#include <numeric>
#include <algorithm>
#include <regex>
#include <iterator>
#include <unordered_set>
#include <cmath>
using namespace std;
// log base 10 of a number gives the number of digits - 1
// want an even number of digits
class Solution {
public:
int findNumbers(vect... | ALGO | 0.998061 | 5.446398 |
01c44ab0-d25b-484a-9329-892dcd0fe1a7 | zzu-yaaa/Algorithm_CPP | CLASS/JUNG_1078.cpp | // 정올 1078 저글링 방사능 오염
#include <iostream>
#include <queue>
using namespace std;
int map[101][101];
int vis[101][101];
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
int m, n, y, x; //열, 행
int ans = 0;
cin >> m >> n;
for (int i=0; i<101; i++) {
fill(map[i], map[i]+1, 0);
f... | ALGO | 0.999189 | 3.909575 |
24600a4e-3f18-4c1f-bf4a-c7070fab7346 | privateLLM001/Private-LLM-Inference | OpenCheetah/SCI/extern/eigen/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.882304 | 5.941502 |
a1252683-2de7-47ba-ab3f-1e6e6473b712 | datpham200503/controlling-a-robot-formation-to-collaboratively-move-an-object | src/snopt_cpp/src/sntoya.cpp | #include <ros/ros.h>
#include <stdio.h>
#include <string.h>
#include <iostream>
#include "snoptProblem.hpp"
using namespace std;
void toyusrfg(int *Status, int *n, double x[],
int *needF, int *neF, double F[],
int *needG, int *neG, double G[],
char *cu, int *lencu,
... | ALGO | 0.999516 | 7.015953 |
d5096842-8698-4fb2-90a9-37d5de9e84df | socc-io/algostudy | baekjoon/smilu/1966.cpp | #include <stdio.h>
int main(int argc, char** argv)
{
int arr[10000];
int docu_num;
int obj_idx;
int start, end;
int T;
scanf("%d", &T);
for(int case_idx=0; case_idx<T; ++case_idx) {
scanf("%d %d", &docu_num, &obj_idx);
start = 0;
end = docu_num;
for(int i=0;i<docu_num;++i) {
scanf("%d", &arr[i]);
}... | ALGO | 0.999931 | 3.786541 |
0ac0731c-76b0-4dae-862f-a222759a2858 | AlekseyKravchuk/cpp | belts_cpp/01_white_belt/05_week_FINAL/final_white_belt_from_scratch.cpp | #include <fstream>
#include <iomanip>
#include <iostream>
#include <map>
#include <set>
#include <sstream>
#include <stdexcept>
#include <string>
#include <tuple>
#include <vector>
using namespace std;
#define _GLIBCXX_DEBUG 1 // включить режим отладки
class Date {
public:
Date(int new_year, int new_month, i... | TOOL | 0.987485 | 5.842093 |
29a0baab-3d22-408e-83f8-16440c1343e9 | zitengzela/LegionCore-7.3.5 | src/server/game/Entities/Taxi/TaxiPathGraph.cpp | #include "TaxiPathGraph.h"
#include "ObjectMgr.h"
#include "Player.h"
#include "DB2Stores.h"
#include "Config.h"
#include "Util.h"
#include <boost/graph/dijkstra_shortest_paths.hpp>
//#include <boost/property_map/transform_value_property_map.hpp>
void TaxiPathGraph::Initialize()
{
if (GetVertexCount() > 0)
... | ALGO | 0.983419 | 4.681078 |
6c42e92c-3dee-4e17-8ed2-7784a9f88354 | jinho-jinho/app_for_traveler | 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 |
48f31b61-bb22-4dd0-aab8-21f5c8dc75a0 | akshaypandey28/LEETCODE-SOLUTION | 2366-maximum-bags-with-full-capacity-of-rocks/maximum-bags-with-full-capacity-of-rocks.cpp | class Solution {
public:
int maximumBags(vector<int>& capacity, vector<int>& rocks, int additionalRocks) {
int n=capacity.size();
vector<int> diff(n);
for(int i=0; i<n; i++) diff[i]=capacity[i]-rocks[i];
sort(diff.begin(),diff.end());
int count=0;
for(int i=0; i<n; ... | ALGO | 0.999781 | 5.799235 |
3a119f71-ffbb-49c1-9a54-dba4d235d07b | Johniel/contests | codeforces/541div2/A/main.cpp | #include <bits/stdc++.h>
#define each(i, c) for (auto& i : c)
#define unless(cond) if (!(cond))
using namespace std;
typedef long long int lli;
typedef unsigned long long ull;
typedef complex<double> point;
template<typename P, typename Q> ostream& operator << (ostream& os, pair<P, Q> p) { os << "(" << p.first << "... | ALGO | 0.981461 | 3.585308 |
00027b77-985f-40fb-9564-73713cfedb6f | CedricKuang/LeetCode | hard/780.reaching-points.cpp | /*
* @lc app=leetcode id=780 lang=cpp
*
* [780] Reaching Points
*/
// @lc code=start
class Solution {
public:
bool reachingPoints(int sx, int sy, int tx, int ty) {
if (tx < sx || ty < sy)
return false;
if (sx == tx)
{
return (ty - sy) % sx == 0;
}
... | ALGO | 0.999964 | 5.262208 |
64a23f96-7bda-4616-a0ed-67b44c17df66 | ishandutta2007/codeforces | uryuuu/normal/1591/A.cpp | #include<iostream>
#include<stdio.h>
#include<cstdio>
#include<vector>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<queue>
#include<string>
#include<stack>
#include<set>
#include<map>
#include<bitset>
#include<unordered_map>
#include<time.h>
#include<cstdlib>
#include <chrono>
#include <random>
typede... | ALGO | 0.999617 | 4.054338 |
5d5f6355-17a2-4052-bcb6-ce7858eeaa23 | ishandutta2007/codeforces | lichenkoh/normal/549/G.cpp | #include <bits/stdc++.h>
#include <assert.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define PB push_back
#define MP make_pair
#define MOD 1000000007LL
#define endl "\n"
#define fst first
#define snd second
const ll UNDEF = -1;
const ll INF=1e18;
template<typename T> inline bool chkmax(T &aa,... | ALGO | 0.999783 | 3.331009 |
0543d3aa-16b3-4322-85a6-1dfaf56f3a23 | Myitian/CommonSort | src/Main.cpp | #include <cstdio>
#include <cstdlib>
#include <climits>
#include <ctime>
#include <random>
extern "C" {
#include "Sort.h"
}
static void rand_fill(int* arr, int l, int r, int min = 0, int max = INT_MAX)
{
std::random_device seed;
std::mt19937 engine(seed());
std::uniform_int_distribution<int> dist(min, max);
while... | ALGO | 0.994275 | 4.153939 |
a023b019-ad0a-448f-ae69-e8634e753f38 | Ankityadav6386/100_days_coading | Maximum Subarray.cpp | class Solution {
public:
int maxSumArrayHelper(vector<int>&v, int start, int end){
if(start == end) return v[start];
int maxLeftBorderSum = INT_MIN, maxRightBorderSum = INT_MIN;
int mid = start + ((end - start)>>1);
int maxLeftSum = maxSumArrayHelper(v, start, mid);
int maxRightSum = maxSumArrayHel... | ALGO | 0.999974 | 6.164001 |
31796157-191b-4f7f-8a58-0f59977dbcd6 | Sakyraisu/Programming | Lab2/Lab2-№2/LAB-2-4.cpp | #include <cstdio>
#include <cmath>
int main() {
double x, y;
printf("Введите число x и y: ");
scanf("%lf %lf", &x, &y);
if (0 <= y && y <= fmin(1 - x * x, 1 + x)) {
printf("Да\n");
}
else {
printf("Нет\n");
}
return 0;
} | ALGO | 0.999567 | 3.835271 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.