uuid stringlengths 36 36 | repo_name stringlengths 5 123 | relative_path stringlengths 5 4k | content stringlengths 33 2.85M | category stringclasses 6
values | algo_rel_score float64 0.85 1 | quality_score float64 3 8.76 |
|---|---|---|---|---|---|---|
3c8e45b5-ecf6-4156-9542-9463ffc68e54 | sagarchapara/cp | cf-constructive/1511d.cpp | // g++ -o out <filename>.cpp
// .\out.exe
#define SAGAR
#include <bits/stdc++.h>
using namespace std;
template<typename A, typename B> ostream& operator<<(ostream &os, const pair<A, B> &p) { return os << p.first << " " << p.second ;}
template<typename T_container, typename T = ty... | ALGO | 0.999827 | 3.324284 |
ad621668-b6b4-4de8-8679-a2a651fee051 | H0308/Algorithm | BackTracking/isValidSudoku.cpp | //
// Created by 18483 on 2025/1/20.
//
#include <iostream>
#include <vector>
using namespace std;
// 36.Ч
/*
* ȽϼɣǷҪõһҪĿжϣԹ̶˷ΧӶȷǶforȽÿλü
*/
class Solution36
{
public:
bool _isValidSudoku(vector<vector<char>> &board, int row, int col, char val)
{
// жǷظ
for (int i = 0; i < 9; i++)
... | ALGO | 0.991368 | 5.809517 |
d0081fc4-c3aa-44d1-83eb-65cf87678bce | Vinniellf/Competitive-Programming | Training ICPC 2024/Contest 1/l.cpp | #include<bits/stdc++.h>
using namespace std;
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define rep(i,n) for (int i = 0; i < n; ++i)
#define REP(i,k,n) for (int i = k; i <n; ++i)
#define REPR(i,k,n) for (int i = k; i >= n; --i)
#define pb push_back
#define fill(x,v) memset(x,v,sizeof(x))
#define... | ALGO | 0.999982 | 4.298623 |
59a83c5b-0e07-454c-9639-c67cf19c8293 | minasd1/KNN-Clustering_time-series | lloyds_auxiliary.cpp | #include <vector>
#include <algorithm>
#include "vector_ops.h"
#include "knn_table_functions.h"
using namespace std;
//RETURNS THE MAXIMUM OF TWO FLOAT NUMBERS
double max_double(double& a, double& b)
{
return (a > b) ? a : b;
}
//RECEIVES A CURVE AND RETURNS THE SECOND NEAREST CENTROID'S INDEX IN THE TABLE OF CE... | ALGO | 0.999932 | 5.148893 |
541f2285-bb67-4e07-885f-a3a0aff56e50 | cheairih/td3-c- | ex3.cpp | #include <iostream>
#include <list>
#include <string>
#include <algorithm>
using namespace std;
struct Personne {
string nom;
string prenom;
int age;
};
// Fonction pour afficher les informations d'une personne
void afficherPersonne(const Personne& personne) {
cout << "Nom: " << personne.nom << ", Pr... | TOOL | 0.991891 | 5.464396 |
f33bc411-1867-4f81-b3d4-ede260d38f7c | uclaacm/icpc-competitive-programming-track | Fall Week 6 Graphs/c++/solutions/apple_tree.cpp | #include <iostream>
#include <vector>
using namespace std;
void dfs(int start, int prev, vector<int>* adj, vector<long long>& num_leaves) {
for (int other : adj[start]) {
if (other == prev) continue;
dfs(other, start, adj, num_leaves);
num_leaves[start] += num_leaves[other];
}
if ((... | ALGO | 0.999784 | 4.262489 |
7299e106-3437-4dfc-a368-3200bbc7840c | Gongsta/competitive-programming | codeforces/129educational/B.cpp | #include <bits/stdc++.h>
using namespace std;
int arr[200000];
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
int t;
cin >> t;
while (t--) {
int n, m;
cin >> n;
for (int i=0;i<n;i++) {
cin >> arr[i];
}
cin >> m;
int b;
int p = 0;... | ALGO | 0.999977 | 3.827344 |
77d00106-3125-4b5e-9fb8-5d0b542e5f61 | spacefarers/cp | problems/codeforces/ed-75/C.cpp | #include <iostream>
#include <vector>
using namespace std;
int main(){
int n;
cin>>n;
for (int i=0;i<n;i++){
string a;
cin>>a;
vector<int> even_nums, odd_nums;
for (auto &j:a){
if ((j-'0')%2) odd_nums.push_back(j-'0');
else even_nums.push_back(j-'0')... | ALGO | 0.999953 | 4.819639 |
2b19303c-a882-435e-8034-9be9f4b73967 | maryam97/ACM | UVa problems/10341 Solve It.cpp | // #define Q10341
#ifdef Q10341
#include <bits/stdc++.h>
using namespace std;
#define EPS 1e-9
int p,q,r,s,t,u;
double can(double x){
return ((p*(exp(-x))+q*sin(x)+r*cos(x)+s*tan(x)+t*pow(x,2.0)+u));
}
int main(){
ios::sync_with_stdio(0);
while(cin >> p >> q >> r >> s>> t >> u) {
double low = 0, high = ... | ALGO | 0.999721 | 3.506875 |
c407c4ae-1294-4480-b40b-99d9d6b54be3 | ImtiazAhmedAkash/Problem-Solving | codeforces/318/A.cpp | /* In the Name of ALLAH, the most gracious, the most merciful */
// Even Odds
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
/*
* In the rearrangement, all the odd numbers from 1 to n will be placed first,
* and then all the even numbers from 1 to n will be placed.
* So, for n values, ther... | ALGO | 0.999952 | 4.334355 |
7c4eb8f0-46f1-4a3f-8727-53d0188d3025 | fastlib/fCWT | src/main.cpp | #include "main.h"
using namespace std;
int main(int argc, char * argv[]) {
int n = 1000; //signal length
const int fs = 1000; //sampling frequency
float twopi = 2.0*3.1415;
//3000 frequencies spread logartihmically between 1 and 32 Hz
const float f0 = 0.1;
const float f1 = 20;
co... | ALGO | 0.991821 | 5.761695 |
32f65000-198d-4d3f-b807-3c03239c8b98 | dhruvdabhi101/LeetCode | 1523-count-odd-numbers-in-an-interval-range/1523-count-odd-numbers-in-an-interval-range.cpp | class Solution {
public:
int countOdds(int low, int high) {
int sub = high - low;
if((low%2==0) ^ (high%2==0)){
return (high - low)/2 + 1 ;
}else if((low%2==1) && (high%2==1)){
return (high - low)/2 + 1;
}else{
return (high - low)/2;
... | ALGO | 0.9999 | 5.363021 |
bb91739f-c193-406d-b4aa-83f868027ac1 | PealMazumder/Topicwise-Problems | Fenwick Tree/E. String Reversal.cpp | ///Problem Link: http://codeforces.com/contest/1430/problem/E
#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define sz(v) (int)v.size()
#define nl "\n"
using namespace std;
const int mx = 200005;
int tree[mx];
int read(int idx)
{
int sum = 0;
while(idx > 0)
{
sum += tree[idx];
idx -= idx & -i... | ALGO | 0.999948 | 3.705486 |
76c26856-3e59-4daa-b777-2246de367d7f | sensemilli/FlexGit | Engine/Source/ThirdParty/PhysX/PhysX-3.3/Source/GeomUtils/src/sweep/GuSweepBoxBox.cpp | #include "GuSweepBoxBox.h"
#include "GuBox.h"
#include "GuIntersectionBoxBox.h"
#include "GuIntersectionRayBox.h"
#include "GuIntersectionEdgeEdge.h"
#include "GuSweepSharedTests.h"
#include "CmMatrix34.h"
#include "GuSweepTriangleUtils.h"
using namespace physx;
using namespace Gu;
using namespace Cm;
namespace
{
// ... | ALGO | 0.999404 | 7.722177 |
d900ab45-35f4-46a6-87b4-fac9087cedfd | cutepig123/MyLeetcodeRepo | ConsoleApplication3.cpp | // ConsoleApplication2.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "string"
#include "iostream"
#include "sstream"
#include "assert.h"
#include "vector"
#include "map"
#include "deque"
#include "algorithm"
#include "memory"
using namespace std;
bool isVariable(const cha... | TOOL | 0.938531 | 3.918838 |
94dde3f3-be1d-439f-a558-b9cc8851d70f | pangxiaowen/leetcode_practice | day_1/977_sortedSquares.cpp | #include <algorithm>
#include <iostream>
#include <math.h>
#include <vector>
void sort(std::vector<int> &vec)
{
for (auto &it : vec)
{
it = it * it;
}
std::sort(vec.begin(), vec.end());
}
void sort_v2(std::vector<int> &vec)
{
int l = 0;
int r = vec.size() - 1;
std::vector<int> re... | ALGO | 0.999943 | 5.138652 |
a68b2ed0-006f-4615-b5ca-81fe0be6a7e6 | Mulab11/cntt2016-hw1 | TC-SRM-559-div1-250/HalfSummer11.cpp | #line 2 "HyperKnight.cpp"
#include<vector>
#include<list>
#include<map>
#include<set>
#include<deque>
#include<stack>
#include<bitset>
#include<algorithm>
#include<functional>
#include<numeric>
#include<utility>
#include<sstream>
#include<iostream>
#include<iomanip>
#include<cstdio>
#include<cmath>
#include<cstdlib>
#i... | ALGO | 0.999934 | 3.675904 |
0cfbff71-3f33-453d-931b-08cfdf47fa7b | Shivangi2430/Placement-Preparation-Module | 0015-3sum/0015-3sum.cpp | class Solution {
public:
vector<vector<int>> threeSum(vector<int>& nums) {
vector<vector<int>>ans;
sort(nums.begin(), nums.end());
int n = nums.size();
int i = 0;
for(int i = 0; i < n; i++)
{
if(i > 0 && nums[i] == nums[i - 1])
co... | ALGO | 0.99991 | 5.342664 |
b7e716bd-173e-4153-8bad-5050e8769403 | liujiapeng678/AlgorithmPracticing | 差分/7.3.cpp |
//൱ԭ飬ǰǰn
//ǰ l r һ c Խ l һc r+1 ȥһ c
//ע 1 ± ʼ
#include<iostream>
using namespace std;
const int N = 100010;
int n, m;
int a[N], b[N];
void insert(int l, int r, int c)//ʼ־ҵIJ־ͺ־l+cr+1cһģһ
{
b[l] += c;
b[r + 1] -= c;
}
int main()
{
scanf("%d%d", &n, &m);
for (int i = 1; i <= n; i++)scanf("%d", &a[i... | ALGO | 0.999964 | 3.761852 |
8aa0e068-1e1b-4374-897c-98e89590910d | amalendu02/Data-Structure | RECURSION/binary-search.cpp | #include<iostream>
using namespace std;
int binarySearch(int arr[], int start, int end, int target) {
//base case
if(start > end) {
return -1; //return not found
}
// processing
int mid = start + (end-start)/2;
if(arr[mid] == target) {
return mid;
}
// recursive call
... | ALGO | 0.999911 | 6.062027 |
7b40fa4f-a37c-4415-89ce-790986551341 | yossi77/opencv | modules/calib3d/src/posit.cpp | #include "precomp.hpp"
#include "calib3d_c_api.h"
/* POSIT structure */
struct CvPOSITObject
{
int N;
float* inv_matr;
float* obj_vecs;
float* img_vecs;
};
static void icvPseudoInverse3D( float *a, float *b, int n, int method );
static CvStatus icvCreatePOSITObject( CvPoint3D32f *points,
... | ALGO | 0.99526 | 4.877076 |
bb9d00c3-b3df-4dd5-8034-8f47c46759b5 | naixt1478/Brickjoon | Brickjoon_Src/2581.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int m, n, t = 0,f = 0, min = 0,j;
cin >> m >> n;
for (int i = m; i <= n; i++)
{
if (i >= 4 && i%2==0) continue;
else
{
for (j = 2; j < i; j++)
{
if (i % j == 0) break;
}
if (j != i) continue;
if (f == 0)
{
min = i,f = 1;
... | ALGO | 0.999933 | 4.287511 |
7a5b1797-86b0-4bce-a84f-5e19f84d629f | SiyangShao/codes | luogu/P3155.cpp | #include <bits/stdc++.h>
using namespace std;
int n, m;
vector<int> q[10010];
int c[5022];
int dp[10010][2];
void dfs(int u, int fa) {
if (u <= n)
return;
for (auto i : q[u]) {
if (i == fa) {
continue;
}
dfs(i, u);
dp[u][0] += min(dp[i][0] - 1, dp[i][1]);
dp[u][1] += min(dp[i][1] - 1, dp[i][0]);
}
}
i... | ALGO | 0.999924 | 3.832314 |
a0a5f757-160c-4e5c-912f-0953b6b0705b | haidev974/luyencode | dk08.cpp | /*Hailun*/
#include "iostream"
#include "iomanip"
using namespace std;
int main()
{
float a,b;
char cal;
cin >> a;
cin >> cal;
cin >> b;
if(cal == '+') cout << fixed << setprecision(2) << a + b << endl;
if(cal == '-') cout << fixed << setprecision(2) << a - b << endl;
if(cal == '*') ... | ALGO | 0.997581 | 3.553952 |
56e39780-ff66-44e7-a30e-ab83a27dce37 | pamitduggal/work-in-c-plus-plus | question3.cpp | #include <iostream>
using namespace std;
int main()
{
int x,y,p,s,total;
cout<<"Enter The Value of x \n";
cin>>x;
cout<<"Enter The Value of y \n";
cin>>y;
p=x*y;
s=x+y;
total=s+p*(s-x)*(p+y);
cout<<"\nTotal is = "<<total;
return 0;
}
| ALGO | 0.986307 | 3.364832 |
54e2ae30-271a-4a49-b769-46ece91aa19b | ishandutta2007/codeforces | yousef_salama/normal/1420/C1.cpp | #include <bits/stdc++.h>
using namespace std;
const int MAXN = 300005;
struct node{
long long mxeven, mneven, mxodd, mnodd;
node(){}
node(long long mxeven, long long mneven, long long mxodd, long long mnodd): mxeven(mxeven), mneven(mneven), mxodd(mxodd), mnodd(mnodd){}
node operator +(const node& b) const{
long... | ALGO | 0.99993 | 4.410256 |
696a9ce0-355b-42e5-8c7a-aea90ccc5d88 | grosserding/MyWorkingSpace | SlamUeben/src/vierzehn_kapiteln_des_SLAMs/kap_7/7.2.cpp | #include <iostream>
#include <opencv2/calib3d/calib3d.hpp>
#include <opencv2/core/core.hpp>
#include <opencv2/features2d/features2d.hpp>
#include <opencv2/highgui/highgui.hpp>
// feature extraction
int main(int argc, char** argv) {
if (argc != 3) {
std::cerr << "usage: neeed 2 images" << std::endl;
return 1;... | ALGO | 0.994559 | 5.597583 |
083c2584-35cd-415c-914b-b4f0ea7d623a | AbhinavShukla2020/Competitive-Programming | USACO/Silver/Ad Hoc/Not Solved/LoanRepyment.cpp | #include <iostream>
#include <vector>
#include <set>
#include <string>
#include <unordered_set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
#include <math.h>
using namespace std;
using pii = pair<int,int>;
using vi = vector<int>;
#define endl "\n"
#define int int64_t
#define pb push_back... | ALGO | 0.999802 | 3.833469 |
7cd15a8f-1150-4a97-80d8-fcf281e716ad | Pulkitbarala/gfg_self_paced_answers | Recursion/Tower Of Hanoi.cpp |
class Solution {
public:
long long toh(int N, int from, int to, int aux) {
if (N == 0) {
return 0;
}
long long moves = 0;
moves += toh(N - 1, from, aux, to);
cout << "move disk " << N << " from rod " << from << " to rod " << to << endl;
moves += ... | ALGO | 0.999914 | 5.443781 |
e468e881-6db5-498d-8d98-78d436109389 | Vaibhav0810/leethub | 0018-4sum/0018-4sum.cpp | class Solution {
public:
vector<vector<int>> fourSum(vector<int>& nums, int target) {
sort(nums.begin(), nums.end());
vector<vector<int>> ans;
set<vector<int>>st;
if(nums.size()<4) return {};
for (int i = 0; i < nums.size() - 2; i++) {
for (int j = i + 1; j < nums.size() - 1; j... | ALGO | 0.999946 | 6.06791 |
992676ca-7680-4949-863d-6be2d0c9021c | HardenedBSD/hardenedBSD-stable | contrib/llvm/lib/Transforms/Scalar/LoopInstSimplify.cpp | #include "llvm/Transforms/Scalar/LoopInstSimplify.h"
#include "llvm/ADT/PointerIntPair.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/AssumptionCache.h"
#include "llvm/Analysis/InstructionSimplify.h"
#include... | ALGO | 0.977939 | 3.108149 |
110c95cc-aae2-4ca7-ba87-a4a5629d5bc3 | THZoria/build | src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_fused_multiply_add.cpp | #include "common/common_types.h"
#include "shader_recompiler/exception.h"
#include "shader_recompiler/frontend/maxwell/translate/impl/common_encoding.h"
#include "shader_recompiler/frontend/maxwell/translate/impl/impl.h"
namespace Shader::Maxwell {
namespace {
void FFMA(TranslatorVisitor& v, u64 insn, const IR::F32& s... | TOOL | 0.952546 | 7.543355 |
7cfbad26-5963-4965-9de0-c924e8378f8f | amanmalali/Quantum-circuit-simulator | code/main.cpp | #include "gates.h"
#include "components.h"
#include "funcs.h"
void input()
{
int n,i,j;
cout<<"Enter The Number of Qubits"<<"\n";
cin>>n;
int k=pow(2,n);
init_output(k);
Q.resize(k,vector<int>(k,0));
for(i=0;i<k;i++)
{
for(j=0;j<k;j++)
{
if(i==j)
... | ALGO | 0.999308 | 3.286279 |
911bd29d-adf8-462e-9670-81905c946de3 | CESARO23/UvaSolutions | Uva11799.cpp | /*******************************************************
Name Problem:Horror Dash
Problem Category:adhoc
Problem Tester: Julio Cesar Mamani Villena.
Email: <EMAIL>
*******************************************************/
#include<bits/stdc++.h>
#define PI 2*acos(0.0)
#define MOD 1000000007
#define EPS 1e-9
#define all(... | ALGO | 0.998038 | 4.397144 |
2b9b2ff4-71c4-4e32-957e-b612fd740649 | tmuttaqueen/MyCodes | Online Judge Code/[Other] Online-Judge-Solutions-master_from github/Timus Online Judge/1339 - Babies.cpp | #include <cstdio>
#include <cstring>
using namespace std;
#define MAXN 250000
int outL[MAXN + 1],outR[MAXN + 1];
bool inL[MAXN + 1],inR[MAXN + 1];
int ans[MAXN + 1];
bool used[MAXN + 1];
int main(){
int K;
scanf("%d",&K);
for(int i = 1;i <= K;++i){
scanf("%d",&outL[i]);
inR[ ou... | ALGO | 0.999995 | 3.283014 |
eda0fad0-6cb2-4d75-a2de-d4301f7b7799 | Shahid-Fahad/Online-Judge-Solution | Codeforces+Others/B_Cosmic_Tables.cpp | ///Bismillahir Rahmanir Rahim
//ShzFahad
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define ll long long int
#define ld long double
#define pb push_back
#define ff first
#define ss second
#define case_(tc) cout <... | ALGO | 0.999781 | 4.616492 |
45ebd6cd-0a09-44fa-be3c-e2f5c9f3249b | idkwhttsay/cses.fi | introductory-problems/tower-of-hanoi.cpp | #include <bits/stdc++.h>
#define int long long
#define F first
#define S second
#define pii pair<int, int>
using namespace std;
const int N = 1e5+123;
const int INF = 1e18;
const int mod = 1e9+7;
const int dx[4] = {-1, 0, 0, 1};
const int dy[4] = {0, -1, 1, 0};
void moveDisk(int diskNumber, vector<vector<int> >& mo... | ALGO | 0.999957 | 4.808591 |
63a7e47e-91aa-44b5-ad59-ab94709e1a1c | xfgt/University-work | Lab-math-035/resheniq3-G1/01.GCD.cpp | #include <iostream>
bool hasPrimes(int* x, int sz){
for(int i = 0; i < sz; i ++){
if(x[i] % 2 == 0)
return true;
}
return false;
}
int getLowest(int* x, int sz){
int value = x[0];
int i = 0;
if(hasPrimes(x, sz)){
while(i < sz){
if(i % 2 == 0){
... | ALGO | 0.999884 | 4.765337 |
121fbc32-eb6f-4315-90bd-8e03a9cd701c | arpitbbhayani/hackerrank | even-odd-query.cpp | /*
* Author: Arpit Bhayani
* http://arpitbhayani.me
*/
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <climits>
#include <deque>
#include <iostream>
#include <list>
#include <limits>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <vector>
#define ll long long
#define MIN... | ALGO | 0.999918 | 4.21777 |
239210d1-de73-4912-bae8-53eade1a04ce | Nishat30/gfg160 | Difficulty: Medium/Equalize the Towers/equalize-the-towers.cpp | class Solution {
public:
int minCost(vector<int>& h, vector<int>& cost) {
// code here
int s=*min_element(begin(h),end(h));
int n=h.size();
int e=*max_element(begin(h),end(h));
long long ans=1e11;
auto pos=[&](int mid)->long long{
long long temp=0;
... | ALGO | 0.99995 | 4.756263 |
7a6649f9-973e-4c80-beec-e36b78d93e4c | codingksj/Baekjoon-Solution | 백준/01000~01999/01300~01399/01302.cpp | #include<iostream>
#include<sstream>
#include<bitset>
#include<set>
#include<unordered_map>
#include<map>
#include<vector>
#include<queue>
#include<deque>
#include<stack>
#include<tuple>
#include<algorithm>
#include<string>
#include<numeric>
#include<cmath>
#include<cctype>
#include<cstring>
#include<iomanip>
#include<... | ALGO | 0.999971 | 5.148786 |
a4b7f426-71f9-48a9-a8f2-1ec3f159692b | frankwang98/autoware.universe_comment | control/mpc_lateral_controller/src/qp_solver/qp_solver_osqp.cpp | #include "mpc_lateral_controller/qp_solver/qp_solver_osqp.hpp"
#include <string>
#include <vector>
namespace autoware::motion::control::mpc_lateral_controller
{
QPSolverOSQP::QPSolverOSQP(const rclcpp::Logger & logger) : logger_{logger}
{
}
bool QPSolverOSQP::solve(
const Eigen::MatrixXd & h_mat, const Eigen::Matri... | ALGO | 0.999049 | 6.336645 |
94cfe58c-3821-434c-96e9-143e5b4ac92f | mplatt8/godot-bitcoin-module | modules/noise/fastnoise_lite.cpp | /**************************************************************************/
/* fastnoise_lite.cpp */
/**************************************************************************/
/* This file is part of: */
/* ... | TOOL | 0.954658 | 7.048561 |
c32978b0-c596-4b64-ab3f-165b3006de36 | poohoh/regex_license_plate | vietnam_regex_v3.1/vietnam_regex_nested.cpp | #include <iostream>
#include "json.hpp"
#include "JSONSearch.h"
#include <chrono>
int main()
{
// 전체 카테고리의 결과를 저장할 리스트
std::vector<result_struct> result_list;
std::string file_path = "vietnam_regex_nested.json"; // JSON 파일 경로
std::string input_string = "50MK153482"; // 입력 문자열
try
{
... | DATA | 0.919095 | 5.45864 |
738dfcff-4e6c-4ebd-a358-18fe2e11a9ae | miamimagna/CSES.FI | 026. Sum of Two Values.cpp | #include <cstdio>
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <utility>
#include <set>
#include <queue>
#define int long long
using namespace std;
// preprocessing to make code easier
template <typename T>
using v = vector<T>;
#define maxheap(T) priority_queue<T>
#define minhea... | ALGO | 0.999882 | 4.327837 |
ba227b9a-a319-46a5-b978-e0d21495496e | Shriya-Jaiswal/DSA_POTD_Questions_solving | 202_Sequence_of_Sequence_GFG.cpp | #include<iostream>
using namespace std;
int help(int i, int j, int n, int m){
if(j==n) return 1;
if(i>m) return 0;
int pick= help(i*2, j+1, n, m);
int not_pick=help(i+1, j, n, m);
return pick+not_pick;
}
int numberSequence(int m, int n){
return help(1,0,n,m);
}
// ⏲️ Expected Time Comp... | ALGO | 0.999986 | 5.502267 |
00828500-acfa-4417-a505-db8107d28df4 | wentingzz/Practices | LeetCode/1765. Map of Highest Peak.cpp | class Solution {
public:
vector<vector<int>> highestPeak(vector<vector<int>>& isWater) {
int m = isWater.size(), n = isWater[0].size();
vector<vector<int>> res(m, vector<int>(n, -1));
queue<pair<int, int>> q;
for(int i = 0; i < m; i++){
for(int j = 0; j < n; j++) if(isWat... | ALGO | 0.999996 | 6.350861 |
8b47611d-703f-4d2e-b558-b007bc72ed19 | znspdlf15/individual_algorithm | 17143_fishing_king.cpp | #include <iostream>
#include <stdlib.h>
using namespace std;
typedef struct struct_shark{
int speed;
int dir;
int size;
}Shark;
int dx[5] = {0, 0, 0, 1, -1};
int dy[5] = {0, -1, 1, 0, 0};
int main(){
Shark *map[102][102] = {0, };
int R, C, M;
cin >> R >> C >> M;
for ( int m = 0; m < M; m++ ){
int... | ALGO | 0.999469 | 4.089616 |
36cdf592-1221-486b-89e5-f95578be6393 | THU-DSP-LAB/llvm-project | libcxx/test/std/algorithms/alg.sorting/alg.sort/is.sorted/is_sorted_until.pass.cpp | // <algorithm>
// template<ForwardIterator Iter>
// requires LessThanComparable<Iter::value_type>
// Iter
// is_sorted_until(Iter first, Iter last);
#include <algorithm>
#include <cassert>
#include "test_macros.h"
#include "test_iterators.h"
#if TEST_STD_VER > 17
TEST_CONSTEXPR bool test_constexpr() {
int... | TEST | 0.988779 | 7.5085 |
c215ec90-c91e-4d87-933e-6317c4d30d3d | ishandutta2007/codeforces | leopro/normal/1372/D.cpp | #include <bits/stdc++.h>
namespace {
using namespace std;
#define int long long
template<typename T>
inline bool whitespace(const vector<T> &) { return false; }
template<typename T>
inline bool whitespace(const T &) { return true; }
inline bool whitespace(const char) { return false; }
t... | ALGO | 0.999944 | 4.365326 |
bd9d87f3-a205-434a-87bc-3eba83fc9eaa | Lemon-XQ/PAT-Advanced | PAT-Advanced-1124.cpp | #include <iostream>
#include <algorithm>
#include <map>
using namespace std;
int main(){
int M,N,S;
cin>>M>>N>>S;
map<string,int> m;
int offset=0;
for(int i=1;i<=M;i++){
string str;
cin>>str;
if(i==S+offset){
if(m.count(str)==0){
m[str]=1;
offset+=N;
cout<<str<<endl;
}else{
offset++;/... | ALGO | 0.999408 | 3.019238 |
8f12c4d4-4f92-416b-9f0c-9f86364347fb | AngusFiedler/CSCI-2270 | Practicum/Practicum_One/Compressed/questionTwo.cpp | #include <iostream>
using namespace std;
struct Node{
int key;
Node * next;
};
void print(Node *head){
Node *temp = head;
Node *headEven = new Node;
Node *headOdd = new Node;
Node *evenTemp = NULL;
Node *oddTemp = NULL;
while(temp != NULL){
Node *newNode = new Node;
newNode->key = temp->key;
newNode->n... | ALGO | 0.99991 | 3.899698 |
c68e8df9-cc43-4ef2-9c96-474ef80b682a | Imraan002/Programs | fractional_knsk.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
struct block{
int value,weight;
};
bool comp(block a,block b)
{
double val1=((double)a.value/a.weight);
double val2=((double)b.value/b.weight);
return val1>val2;
}
double fnpsk(block arr[],int n,int wt)
{
sort(arr,arr+n,comp);
dou... | ALGO | 0.999982 | 4.461982 |
7667194e-75d6-4acf-91ef-e06fe571b806 | Nikvader/Alogorithms-and-data-structures | taskBlackBox/taskBlackBox/taskBlackBox.cpp | #include <iostream>
#include <set>
#include <fstream>
#include <vector>
//#include <string>
using namespace std;
void solveTask(int64_t n, int64_t m, vector<int64_t> add, vector<int64_t> get) {
int64_t i = 0;
multiset<int64_t> vois;
int64_t s = 0;
ofstream fout("output.txt");
for (i = 0; i < n; i++) {
for (... | ALGO | 0.999964 | 3.351773 |
a1e891ac-5730-482b-9b0b-e6932012d152 | gyurim/codingtest | 문자열/11656_접미사 배열.cpp | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
string str;
getline(cin, str);
vector <string> vector;
int length = str.length();
for (int i = 0; i < length; i++){
string copyStr = str.substr(i, length);
// substr... | ALGO | 0.999666 | 4.415351 |
c60cd64c-dfc4-4cf9-a9a9-5d3c90300129 | HugoZig/IF672_Algorithms_and_Data_Structures_ADTs | SubSet Sum/SubSet Sum/main.cpp | #include <iostream>
#include <algorithm>
#include <stack>
#define LIMIT 10
using namespace::std;
typedef struct ToStack{
int l;
int c;
int index[LIMIT];
int until;
} ToStack;
class SubSet{
private:
int target;
int length;
int numbers[LIMIT];
int min;
int max;
stack<ToStack> s... | ALGO | 0.999779 | 3.814453 |
70d4c304-5574-4d5e-8118-6a711c344f35 | raincross7/code-similarity | codes/train_code/problem406/problem406_254.cpp | #include <iostream>
#include <iomanip>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <vector>
#include <algorithm>
#include <numeric>
using namespace std;
#define eb emplace_back
#define pb push_ba... | ALGO | 0.999977 | 3.865573 |
67f527b5-3630-40a8-b9a3-1ce3ffb0743a | lkm543/Algorithm | Chapter04/04_04_Bubble_Sort.cpp | #include<iostream>
using namespace std;
void Bubble_Sort(int data[], int len){
// 重複 len - 1 輪
for(int i = 0; i < len - 1; i++){
// 每多做一輪就可以少做最後一筆資料
// 因為每一輪中剩下的最大值都會被移到最右邊
for(int j = 0; j < len - i - 1; j++){
// 如果左邊 data[j] 大於右邊 data[j+1] 就互換
if(data[j] > dat... | ALGO | 0.999953 | 4.161118 |
2d783c3f-a42e-4dd3-a13c-db48590b4e73 | DGtal-team/DGtal | examples/kernel/examplePointFunctorHolder.cpp | /**
* @file
* @ingroup Examples
* @author Roland Denis (\c <EMAIL> )
* CNRS, Institut Camille Jordan (UMR 5208), Université Lyon 1, France
*
* @date 2018/11/23
*
* @brief An example file for @ref DGtal::functors::PointFunctorHolder.
*
* This file is part of the DGtal library.
*/
////////////////////////////... | ALGO | 0.877987 | 7.06519 |
d3280c42-5bc9-4306-b962-5cef6c9701aa | tnsc4502/mnwvs077 | WvsGame/CalcDamage.cpp | #include "CalcDamage.h"
#include <algorithm>
#include "SkillEntry.h"
#include "SkillLevelData.h"
#include "SkillInfo.h"
#include "User.h"
#include "SecondaryStat.h"
#include "BasicStat.h"
#include "MobStat.h"
#include "Mob.h"
#include "ItemInfo.h"
#include "QWUser.h"
#include "MobTemplate.h"
#include "WarriorSkills.h"... | TOOL | 0.957406 | 4.120485 |
43010718-d65d-4307-ba15-a8ea55fa0eee | anujm08/SPOJ_Solved | mohib.cpp | #include <iostream>
using namespace std;
int main()
{
std::ios::sync_with_stdio(false);
int T,x,avg,n,ans;
cin>>T;
while(T>0)
{
cin>>x>>avg;
n=avg-x;
ans=n*(avg+1)-n*(n-1)/2;
cout<<ans<<endl;
T--;
}
return 0;
}
| ALGO | 0.998467 | 3.79933 |
87d9f4b1-e12d-4fbd-bae8-d19d4d425cb2 | ayushmaan02/DSA_CPP-Progress | STL/Deque.cpp | //Deque (Doublly Ended queue)
//Starting and ending mie insertion and deletion possible h
// Dyanamic h yhe
#include<iostream>
#include<deque>
using namespace std;
int main()
{
deque<int> d;
d.push_back(1); //Entering element at last
d.push_front(2); //Entering element at first
// for(int i:d)
/... | ALGO | 0.927042 | 3.761785 |
d9ded0dc-d104-41cd-9c1d-00db51368b56 | khan9t2zishan/Leetcode-Problems | Medium/3163- String Compression III.cpp | /*
Author : Zishan Khan
Problem : String Compression III
Difficulty : Medium
Problem Link : https://leetcode.com/problems/string-compression-iii/description/?envType=daily-question&envId=2024-11-04
*/
class Solution {
public:
string compressedString(string word) {
string comp = "";
int cnt = 1, n... | ALGO | 0.999978 | 6.127299 |
ddc57211-f51b-43db-9c2c-1f4df255de6d | Fardheen-N/Tech_Dose | Array/3-longest-substring-without-repeating-characters/longest-substring-without-repeating-characters.cpp | class Solution {
public:
int lengthOfLongestSubstring(string s) {
map<char,int> mp;
int res=0;
int left=0,right=0;
while(right<s.size())
{ char w=s[right];
mp[w]++;
while(mp[w]>1)
{ char l=s[left];
mp[l]--;
... | ALGO | 0.999932 | 5.721375 |
d0a473a2-971e-4316-b4e5-cd6c0c9011c1 | lightning830/cpp | 155/pairs.cpp | #include<iostream>
#include<algorithm>
#include<fstream>
using namespace std;
void printElems(const long* begin, const long* end)
{
for (const long* p = begin; p != end; ++p) {
std::cout << *p << std::ends;
}
std::cout << std::endl;
}
int main(){
ifstream ifs("sub1_01... | ALGO | 0.999844 | 4.106223 |
8ac32f0e-e9d1-4b5a-a22c-3a904539a53e | zhz121/oregon | src/scripts/Outland/TempestKeep/the_mechanar/boss_nethermancer_sepethrea.cpp | /* ScriptData
SDName: Boss_Nethermancer_Sepethrea
SD%Complete: 90
SDComment: Need adjustments to initial summons
SDCategory: Tempest Keep, The Mechanar
EndScriptData */
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "mechanar.h"
#define SAY_AGGRO -1554013
#define SAY_SUMMON ... | TOOL | 0.874828 | 6.777085 |
580e814b-03da-4747-8f3b-cd3d7b762bc0 | yangjoao/trabalhod | GITTEST-A/test.cpp | Criptografia em Java: Simétrica, Assimétrica e Hash
Aqui está um exemplo completo de como implementar criptografia simétrica, assimétrica e funções hash em Java:
1. Criptografia Simétrica (AES)
java
import javax.crypto.Cipher;
import javax.crypto.KeyGenerator;
import javax.crypto.SecretKey;
import javax.crypto.spec.Iv... | ALGO | 0.996469 | 7.383713 |
c1ae0fd9-fa20-4bed-9271-98ee0ff013d2 | Karthi347/Data-Structures | 15.linlked list implementation.cpp | #include <stdio.h>
#include <stdlib.h>
// Define the structure for a singly linked list node
struct Node {
int data;
struct Node* next;
};
// Function to create a new node
struct Node* createNode(int data) {
struct Node* newNode = (struct Node*)malloc(sizeof(struct Node));
if (newNode == NULL) {
... | ALGO | 0.915808 | 5.206842 |
2b7acba4-3465-4f90-aa1e-38f689c1e52f | TosakaUCW/CompetitiveProgramming | Codeforces/Gym/104369 2023 GDCPC/F - Traveling in Cells.cpp | #include <bits/stdc++.h>
// #define int long long
using pii = std::pair<int, int>;
using std::vector, std::cout, std::cin;
#define fi first
#define se second
#define ls (p << 1)
#define rs (p << 1 | 1)
#define mid (l + r >> 1)
int read(int x = 0, int f = 0, char ch = getchar())
{
while (ch < 48 or ch > 57) f = ch =... | ALGO | 0.999953 | 4.365406 |
3c306338-dadc-48ed-97eb-e6f309490ca2 | whjkm/project | oj/nyoj/800/main.cpp | #include <string.h>
#include <stdio.h>
#include <algorithm>
using namespace std;
int main()
{
int t,a[1000],i;
char s[1000];
while(scanf("%d",&t)!=EOF)
{
for(i=0;i<t;i++)
scanf("%d",&a[i]);
sort(a,a+t);
for(i=0;i<t;i++)
s[i]=a[i]%26+'A';
for(i=0;i<t;i++)
prin... | ALGO | 0.999898 | 3.501232 |
30c443bf-81dd-4da6-8244-10d04aa25290 | jiaoqiyuan/Tests | C++/leetcode/vscode-lc-plugin/766.托普利茨矩阵.cpp | /*
* @lc app=leetcode.cn id=766 lang=cpp
*
* [766] 托普利茨矩阵
*
* https://leetcode-cn.com/problems/toeplitz-matrix/description/
*
* algorithms
* Easy (67.01%)
* Likes: 152
* Dislikes: 0
* Total Accepted: 19.1K
* Total Submissions: 28.5K
* Testcase Example: '[[1,2,3,4],[5,1,2,3],[9,5,1,2]]'
*
* 如果矩阵上每一... | ALGO | 0.999773 | 6.429571 |
f528bb70-5ac6-43ac-96bd-fc5d82f0acf0 | cschreib/ice3 | src/matrix.cpp | #include "matrix.hpp"
#include <iostream>
const matrix matrix::IDENTITY = {
1.0f,0.0f,0.0f,0.0f,
0.0f,1.0f,0.0f,0.0f,
0.0f,0.0f,1.0f,0.0f,
0.0f,0.0f,0.0f,1.0f
};
matrix::matrix()
{
}
matrix::matrix(std::initializer_list<float> mList)
{
int i = 0;
for (const float* p = mList.begin(); p != mLis... | TOOL | 0.873348 | 6.779418 |
6e50c28f-8af3-4cbb-8668-7b7e5b70c724 | BhaveshPatil12/CPP-Basic-Programs | StringS53.cpp | #include<iostream>
#include<string.h>
#include<vector>
using namespace std;
void input_string(vector<char>& str)
{
char a;
while (1)
{
a = getchar();
if (a == '\n')
break;
str.push_back(a);
}
return;
}
void print_string(vector<char> strn)
{
for (std::vector<char... | ALGO | 0.998884 | 3.647168 |
86ba8d63-8316-4d4d-a48c-3781045e984f | ratulhasan001/XPSC | Week 3/A_And_Then_There_Were_K.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#ifdef ONLINE_JUDGE
#define debug(...) 42
#define debug_array(x,y) 42
#else
#include "deBUG.h"
#endif
int32_t main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int T;
cin >> T;
for(int testCase=1; testCase <= T; test... | ALGO | 0.999862 | 4.879335 |
401c4c86-8ba5-44a5-91ec-e7d1481ef398 | Yut176/AIZU-ONLINE-JUDGE | GRL/GRL_1A.cpp | #include<iostream>
#include<vector>
using namespace std;
int inf = 1000000000;
struct Node{
int to, from, cost;
};
int main(){
int n, m, r;
cin >> n >> m >> r;
vector<int> dist(n, inf);
vector<Node> node(m);
for(int i=0; i<m; i++){
int s, t, d;
cin >> s >> t >> d;
node[i].to = t; node[i].from ... | ALGO | 0.999802 | 4.399848 |
63a04ca8-beaf-450f-a38e-ef65a58bb186 | jefferis/neura | AxonDataProcessing/AxonPathTracking.cpp | #include "AxonPathTracking.h"
#include "axonprocessingcore.h"
using namespace std;
int secureGetData(ucharDataType &data, int x, int y)
{
if (x<0 || y<0 || x>=data.sizeX || y>=data.sizeY) return 0;
return GetBinaryDataAtPoint(data,x,y);
}
void secureSetData(ucharDataType &data, int x, int y, unsigned char d)... | ALGO | 0.900962 | 4.205483 |
deeec04d-a54f-4963-8bb1-c6b65e3d92b0 | subnr01/subs-practice | leet_code/trees/medium/countUnivalSubtrees.cpp | /*
Given a binary tree, count the number of uni-value subtrees.
A Uni-value subtree means all nodes of the subtree have the same value.
Example :
Input: root = [5,1,5,5,5,null,5]
5
/ \
1 5
/ \ \
5 5 5
Output: 4
*/
class Solution {
public:
... | ALGO | 0.999968 | 7.007255 |
0cfdddb8-c9ae-41e9-8533-afdb3f0e88a3 | MagiHotline/AdventOfCode | 2024/Day7/part2.cpp | #include <iostream>
#include <fstream>
#include <sstream>
#include <vector>
#include <string>
using namespace std;
bool calibrate(const vector<long long>&, size_t, long long, long long);
long long concatenate(long long, long long);
int main(int argc, char* argv[]) {
if(argc != 2) {
cout << "Usage : " << ... | ALGO | 0.994098 | 5.185072 |
5d63e208-1937-49b5-beaa-06290dc5dec4 | VersatileSoul/AccentureAssessmentCodes | standardDeviation.cpp | /* The function accepts an array arr of 'n' positive Integers as its arguments.
You are required to calculate the Standard deviation of n positive integers
in array 'arr'. and return.
Input :- 7
3 8 4 2 5 6 7
Output :- 2.00
*/
#include ... | ALGO | 0.999188 | 5.348185 |
7d6b2b7b-449b-4b54-be7d-a7b4a90616cb | agiacobbi/CPSC223 | DICTIONARYHASH/dictionary.cpp | /*
Alex Giacobbi and Nathan Flack
agiacobbi
25 September 2018
Description: This is the implementation file for abstract data type Dictionary. This file
contains function headers and bodies for the class Dictionary's methods as well as documentation
for each function. This data object is a Dictionary which stores Item... | TOOL | 0.946226 | 5.002797 |
e220afe3-3f13-4727-b65c-573729fdfa11 | Owmicron/CPStuff | Codeforces/AntiSudoku.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
#pragma comment(linker, "/stack:200000000")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=n... | ALGO | 0.999728 | 5.34897 |
7d1dd4a9-5da8-4702-b622-c97b2d3274c3 | Cryptonex7/compiler-design-lab | lab3/regex3.cpp | #include<iostream>
#include<string>
using namespace std;
int main(){
string exp;
cin>>exp;
int i=0;
if(exp[i] == 'a'){
while(i<exp.length()-1){
i++;
if(!(exp[i] =='a' || exp[i] =='b')){
break;
}
}
if(exp[i]=='b'){
if(i==exp.length()-1)
cout<<"\nBelongs to a(a+b)*b";
else
cout<<"\... | ALGO | 0.996865 | 3.579559 |
23240ebb-b1dc-4546-a3b5-78753652b9d8 | prabhat-04/LeetCode-Solution | 257-binary-tree-paths/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.999932 | 5.95888 |
614baa58-b802-490c-abdc-8b6c2ca08e72 | zeng-ziyin/PointNAT | openpoints/cpp/subsampling/cpp_utils/cloud/cloud.cpp | //
//
// 0==========================0
// | Local feature test |
// 0==========================0
//
// version 1.0 :
// >
//
//---------------------------------------------------
//
// Cloud source :
// Define usefull Functions/Methods
//
//----------------------------------------------------
//
// Hugu... | ALGO | 0.946875 | 5.202373 |
e1287afe-eaad-4651-8fd0-1f5b14b01084 | Stachu72/Cpp_Primer-Solutions | Chapter 1-Getting Started/ex 13/main_01.cpp | #include <iostream>
int main()
{
int sum = 0;
for(int i=50; i<=100; i++) {
sum += i;
}
std::cout << sum << std::endl;
return 0;
}
| ALGO | 0.996535 | 3.052907 |
cdde5b19-32e3-4cb5-9819-b3a47b15bcf8 | billtian/libgeos | source/index/quadtree/QuadTreeRoot.cpp | #include <geos/indexQuadtree.h>
#include <geos/util.h>
#ifndef DEBUG
#define DEBUG 0
#endif
namespace geos {
// the singleton root quad is centred at the origin.
Coordinate* QuadTreeRoot::origin=new Coordinate(0.0, 0.0);
QuadTreeRoot::QuadTreeRoot(){}
QuadTreeRoot::~QuadTreeRoot(){}
/**
* Insert an item into the q... | ALGO | 0.99611 | 6.7135 |
ee5fd193-f8ee-4e6e-95c3-5c00c83c7dcd | Himanshi-techweb/LEETCODE | 403-frog-jump/frog-jump.cpp | class Solution {
public:
vector<int> rc={-1,0,1};
int solve(int i,int k,vector<int> &arr,unordered_map<int,int> &st,unordered_map<int,unordered_map<int,int>> &check){
if(i>=arr.size()-1)return true;
if(check.find(i)!=check.end() && check[i].find(k)!=check[i].end())return check[i][k];
boo... | ALGO | 0.999959 | 5.410963 |
b0bef6f4-88b7-464c-a763-dba6c0a576af | ANKITKUMARBARIK/CPP_SERIES | 05_loops/taskOne.cpp | #include <iostream>
#include <string>
using namespace std;
int main()
{
int teaCups;
cout << "Enter the number of tea cups to serve : ";
cin >> teaCups;
int i = 0;
while (i < teaCups)
{
cout << "Serving a cup of tea" << endl;
cout << teaCups << " cups remaining" << endl;
... | TOOL | 0.956369 | 4.511294 |
e3de9b91-a6b8-47b0-bb84-a0b5ed3a6d0e | seoyamin/Algorithm-Study | seoyamin/Programmers/[Lv.2] 거리두기 확인하기.cpp | #include <string>
#include <vector>
#define SIZE 5
using namespace std;
// 거리두기 지켰는지 확인하는 메소드
bool check_ok(vector<pair<int, int>> &people, vector<vector<string>> &places, int room) {
bool result = true;
for(int i=0 ; i<people.size() - 1 ; i++) {
for(int j=i+1 ; j<people.size() ; j++) {
... | ALGO | 0.999545 | 4.720947 |
1bfac825-79fa-4185-8321-b62618519d98 | Zimse12345/Code | Luogu/P1595 信封问题.cpp | #include <cstdio>
#include <algorithm>
#include <cstring>
#include <vector>
#include <cmath>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <iostream>
#include <cstdlib>
#include <ctime>
#define int long long
#define ull unsigned long long
using namespace std;
int read(){int qrx=0,qry=1;cha... | ALGO | 0.999981 | 4.225759 |
2956f45e-ff4a-4c91-813c-6c57e15c0b64 | oxygen-hunter/Flashboom | data/big-vul-100/add_attention_code/Phi/top0-100/build-array-where-you-can-find-the-maximum-exactly-k-comparisons-Solution.numOfArrays/177891_DoS.cpp | static RSA_PSS_PARAMS *rsa_pss_decode(const X509_ALGOR *alg,
X509_ALGOR **pmaskHash)
{
const unsigned char *p;
int plen;
RSA_PSS_PARAMS *pss;
*pmaskHash = NULL;
if (!alg->parameter || alg->parameter->type != V_ASN1_SEQUENCE)
return NULL;
p = alg->p... | ALGO | 0.998367 | 3.196197 |
dc6db608-721d-4870-8da3-aa0b16ee3b7a | ishandutta2007/codeforces | igori/normal/1433/A.cpp | const int LG = 21;
const int N = 400030;
const long long MOD = 998244353;
const long long INF = 1e9;
const long long INFLL = 1e18;
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<vector<int> > vvi;
typede... | ALGO | 0.999876 | 5.825334 |
eecb723b-348d-4f3c-8b0f-4368e8822871 | Gondir33/EducationCppstuff | test_for_study/yandex2_3B.cpp | #include <iostream>
int main(void) {
std::string s;
std::cin >> s;
int r = s.size() - 1;
int l = 0;
int ans = 0;
while (l < r) {
if (s[l] != s[r])
++ans;
++l;
--r;
}
std::cout << ans;
} | ALGO | 0.999682 | 3.966303 |
ea21c796-1fe6-4d1d-baca-bdcfb8cd136b | KatyaProkhorchuk/Algorithm | contest_5/task_k.cpp | #include <algorithm>
#include <iomanip>
#include <iostream>
#include <vector>
void FindPalindrom(int64_t n, std::vector<int64_t> arr) {
const int64_t kTen = 1e9;
std::vector<std::vector<int64_t>> dp;
dp.resize(n, std::vector<int64_t>(n));
for (int64_t i = 0; i < n; ++i) {
dp[i][i] = 1;
if (i > 0) {
... | ALGO | 0.99991 | 5.557323 |
aed72e2d-7dba-44da-b32b-4f07d9fa2e2a | alexandraback/datacollection | solutions_5658282861527040_1/C++/wisterik/bl.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <sstream>
#include <iomanip>
#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
template<class T> ostream& operator<<(ostream& os, vector<T> v) {
for(T x : v) os << x << ", ";
return os;
}
int bit(int x, in... | ALGO | 0.999654 | 4.242146 |
c037b1e8-c1df-4729-bd2d-194e7f796a94 | fadliarfans/MyCpp | C++/c++ 3/2.pencarian dan pengurutan/7.median.cpp | #include<iostream>
#include<iomanip>
using namespace std;
int main()
{
int n,i,tmp;
float arr[i],tmp2;
cin>>n;
for(i=1;i<=n;i++)
{
cin>>arr[i];
}
cout<<setprecision(1)<<fixed;
if(n%2==1)
{
tmp=(n/2);
cout<<arr[tmp+1]<<endl;
}
if(n%2==0)
{
tmp=(n/2);
tmp2=(arr[tmp]+arr[tmp... | ALGO | 0.999578 | 3.49664 |
44c400e6-88ea-4d4f-921c-b5126fd85f4e | divysoni03/full_cpp | vector/Tasks/Task8.cpp | // given an array of integers 'a', move all the even intergers at the beginning and all odd numbers at,
// after even numbers, order of even and odd numbers not specific.
// input : {1,2,3,4,5}
// output : {2,4,1,3,5}
#include <iostream>
#include <vector>
using namespace std;
int main() {
vector<int> nums(5);
... | ALGO | 0.999212 | 4.606105 |
0c7b0aa1-5c15-4ccb-bc0e-8dde92734119 | naor12345/Algorithm-DataStructure | leetcode/64.MinimumPathSum.cpp | class Solution {
public:
int minPathSum(vector<vector<int>>& grid) {
int width = grid[0].size();
int height = grid.size();
vector<vector<int>> dp(grid.size(), vector<int>(grid[0].size(), 0));
dp[0][0] = grid[0][0];
for(int i = 1; i<width; i++)
{
d... | ALGO | 0.999976 | 6.087089 |
4c9c2cbd-ed2e-42a2-86f6-d3cec02199a5 | rajuahmed118124r/Algorithm | Dynamic Programming/Assignment/operation_memoization.cpp | #include <bits/stdc++.h>
using namespace std;
int minOperations(int n, vector<int>& memo) {
if (n == 1) return 0;
if (memo[n] != -1) return memo[n];
int ans = minOperations(n-1, memo) + 1;
if (n % 2 == 0) {
ans = min(ans, minOperations(n/2, memo) + 1);
}
if (n % 3 == 0) {
ans... | ALGO | 0.999973 | 5.275246 |
529e815d-77fb-41f4-9e02-5c13392e6899 | Mikayel5464/Picsart_Academy_Github | Homeworks/C++_homeworks/Homework3/task5_matrix.cpp | #include <iostream>
int main()
{
const int m = 3;
const int n = 2;
int matrix[m][n];
int max = 0;
std::cout << "Enter the elements of matrix: " << std::endl;
for (int i = 0; i < m; ++i)
{
for (int j = 0; j < n; ++j)
{
std::cin >> matrix[i][j];
}
}
max = matrix[0][0];
for (int i = 0; i < m; ++i)
... | ALGO | 0.998269 | 4.290133 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.