uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
19341848-3ead-44a3-bb9b-0d87d170d986 | EricWenyi/MedicalImageProessing | Test_GDCMWeightedKmeansFilter/TestKmeans4.cpp |
#include <iostream>
#include <vector>
#include <cmath>
#define NumberOfVector 16
#define R 1
using namespace std;
typedef struct //Struct
{
double x; //1
double y; //2
}Point;
void main()
{
vector<Point> vecPoint; //е
vector<Point> vecCenter; //ĵ
vector<vector<Point> > vecCluster; //12
int i = 0... | ALGO | 0.999167 | 3.559943 |
f0952295-bd73-4d4b-ab65-24672bc80b87 | ishandutta2007/codeforces | kimden/normal/230/A.cpp | #include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
ll x[1002], y[1002];
bool comp(int i, int j){
if(x[i] == x[j]){
return y[i] > y[j];
}
return x[i] < x[j];
}
int main() {
ios_base::sync_with_... | ALGO | 0.999991 | 3.858397 |
dffda404-aef4-40ec-87a0-d384618d1b05 | ashmew2/kolibriosSVN | contrib/sdk/sources/Mesa/mesa-10.6.0/src/glsl/loop_unroll.cpp | #include "glsl_types.h"
#include "loop_analysis.h"
#include "ir_hierarchical_visitor.h"
#include "main/mtypes.h"
namespace {
class loop_unroll_visitor : public ir_hierarchical_visitor {
public:
loop_unroll_visitor(loop_state *state,
const struct gl_shader_compiler_options *options)
{
... | ALGO | 0.928635 | 8.004619 |
e3193328-acb2-460b-9814-cd367a46f72d | neeraj0786/Programming | DP/max_size_square.cpp | int Solution::solve(vector<vector<int> > &A) {
auto SZ(A);
int ans=0;
for(int i=1;i<A.size();i++)
{
for(int j=1;j<A[0].size();j++)
{
if(A[i][j]) SZ[i][j]=min({SZ[i-1][j-1],SZ[i-1][j],SZ[i][j-1]})+1;
else SZ[i][j]=0;
ans=max(ans,SZ[i][j]);
}
}
retur... | ALGO | 0.999847 | 5.322194 |
b0dfd9f4-9b86-4207-b69c-1bc8af6dca3d | wjcsharp/hf-2011 | Hook/Tools/WinAPIOverride32/src/Tools/Process/APIOverride/HookCom/InterfaceInfo.cpp | //-----------------------------------------------------------------------------
// Object: manages COM interface info from IDispatch parsing
//-----------------------------------------------------------------------------
#include "interfaceinfo.h"
CInterfaceInfo::CInterfaceInfo()
{
this->CommonConstructor();
}
CIn... | TOOL | 0.854382 | 5.405639 |
8a33eee9-6302-4443-9c16-f44145f9f4c0 | sarvex/leetcode-javascript | solution/1200-1299/1224.Maximum Equal Frequency/Solution.cpp | class Solution {
public:
int maxEqualFreq(vector<int>& nums) {
unordered_map<int, int> cnt;
unordered_map<int, int> ccnt;
int ans = 0, mx = 0;
for (int i = 1; i <= nums.size(); ++i) {
int v = nums[i - 1];
if (cnt[v]) --ccnt[cnt[v]];
++cnt[v];
... | ALGO | 0.999989 | 5.46634 |
b921a256-c7e2-4066-9af2-f9a8df35fb26 | farabimahmud/gem5-garnet | src/systemc/tests/systemc/misc/synth/blast/blast3/blast3.cpp | /*****************************************************************************
blast3.cpp --
Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
*****************************************************************************/
/*****************************************************************************... | TOOL | 0.973663 | 4.177979 |
6a041e45-d35f-4db6-869b-c86fcb7cbf86 | npnkhoi/Competitive-programming | GYM/102056/L.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int n, m, cnt_black, cnt_white, visa_black, visa_white, a[N], visa[N];
int main() {
ios_base::sync_with_stdio(0); cin.tie(0);
cin >> n >> m;
for (int i = 1; i <= n; ++ i) {
cin >> a[i];
if (a[i]) cnt_black ++;
else cnt_white ++;
}
for (... | ALGO | 0.999911 | 4.277021 |
67979eba-ce28-4a81-aac4-22f803ea0c64 | engrsakib/School-of-outs-books-solution | Volume - 3 (300 - 375)/328 - Simply Area.cpp | #include <iostream>
#include <iomanip> // For setprecision
#include <cmath> // For ceil function
using namespace std;
int main()
{
double H;
// Read input until EOF
while (cin >> H)
{
// Calculate width
double W = 4 * H;
// Calculate rectangle area
double rectangleA... | ALGO | 0.999371 | 5.580147 |
68778e7f-a6eb-453e-afe1-a2356eabd732 | ishandutta2007/codeforces | ftiasch/normal/687/E.cpp | #include <cstdio>
#include <cstring>
#include <climits>
#include <vector>
const int N = 5000;
int n, n2, a[N], b[N], dfn[N], low[N], scc[N], sink[N], result[N];
std::vector<int> graph[N];
void dfs(int u)
{
static int count = 0;
static std::vector<int> stack;
if (!~dfn[u]) {
stack.push_back(u);
... | ALGO | 0.999824 | 4.046285 |
54e895c3-687d-4999-8dc1-60098fd28023 | niranjana-sundararajan/algorithms-and-datastructures | cpp/containers/7. queue.cpp | // Use for
// First-In First-Out operations
// Ex: Simple online ordering system (first come first served)
// Ex: Semaphore queue handling
// Ex: CPU scheduling (FCFS)
// Notes
// Often implemented as a std::deque
std::queue<int> q;
//---------------------------------
// General Operations
//------------------------... | TOOL | 0.933658 | 5.438706 |
9720fdf7-47e7-41d7-a720-3b3c05ae7521 | B3njym1n/leetcode | leetcode1590/leetcode1590-2.cpp | #include <iostream>
#include <vector>
#include <unordered_map>
using namespace std;
class Solution
{
public:
int minSubarray(vector<int>& nums, int p)
{
int len = nums.size();
int x = 0;
for (int i = 0; i < len; i++)
{
int num = nums[i];
x = (x + num) % p;
}
if (x==0)
{
return... | ALGO | 0.999935 | 5.184142 |
339f02e7-0e9f-4627-b9ef-d56d32db1b88 | aehris-hashami/Encryption-Decryption-and-Sorting-Algorithms | Code in C++/shift_cipher.cpp | #include <iostream>
#include <vector>
#include <string>
using namespace std;
// utility functions
vector<int> convert_letters_to_num(string);
// encryption and decryption functions
string encrypt(string,int);
string decrypt(string,int);
int main(){
cout << "Enter messege: "; string txt; getline(cin,txt);
co... | ALGO | 0.997842 | 5.366204 |
5077f245-885f-47ed-b883-45e734f97bcf | harshgau/SdeSheetChallenge | Striver SDE Sheet/day9/Minimum Number of Platforms.cpp | int calculateMinPatforms(int at[], int dt[], int n) {
sort(at,at+n);
sort(dt,dt+n);
int count=1,i=1,j=0;
int ans=1;
while(i<n&&j<n)
{
if(dt[j]<at[i])
{
j++;
count--;
}
else
{
i++;
count++;
}
a... | ALGO | 0.999783 | 4.96238 |
f68ff3de-ecb9-4520-8ece-74be3b5eab10 | yqw1212/fuzztruction-llvm17.0.6 | libcxx/test/std/algorithms/alg.sorting/alg.set.operations/set.union/set_union.pass.cpp | // <algorithm>
// template<InputIterator InIter1, InputIterator InIter2, typename OutIter>
// requires OutputIterator<OutIter, InIter1::reference>
// && OutputIterator<OutIter, InIter2::reference>
// && HasLess<InIter2::value_type, InIter1::value_type>
// && HasLess<InIter1::value_type, InIte... | TEST | 0.947911 | 6.843928 |
68ba4340-facc-4c7f-9bd7-e72c61569070 | ihsonnet/DIU-ACM-PC-Green-Division | DIU-PC Weekly Contest-03/B.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int t,a,b,c;
cin>>t;
for(int i=0;i<t;i++)
{
cin>>a>>b>>c;
if(a>b && a<c || a<b && a>c)
{
cout<<"Case "<<i+1<<": "<<a<<endl;
}
if(a<b && b<c || a>b && b>c)
{
cout<<"Case "<<i+... | ALGO | 0.99989 | 3.657731 |
e7bf7e6d-2a66-44fc-acff-e090ddd85dcb | primerX/PAT | Basic/B1038.统计通成绩学生.cpp | #include<cstdio>
#include<cstring>
int hashTable[110]; //¼ÿֵĴ
int main()
{
int n, score, k;
scanf("%d", &n);
for(int i=0; i<n; i++){
scanf("%d", &score); //
hashTable[score]++; // scoreֵĴ 1
}
scanf("%d", &k);
for(int i=0; i<k; i++){
scanf("%d", &score);
printf("%d", hashTable[score]); //ѯֵĴ
if(i <... | ALGO | 0.999384 | 3.434813 |
b99a1e3f-1c7c-4503-a02b-e948848f0fb0 | derand/cpp_tasks | task02/task0208.cpp | #include <iostream>
#include <stdlib.h>
#include <cmath>
using namespace std;
int main(int argc, const char *argv[])
{
float a, b, c, x_start, x_end, x_d;
cout << "Enter a:";
cin >> a;
cout << "Enter b:";
cin >> b;
cout << "Enter c:";
cin >> c;
cout << "Enter x_start:";
cin >> x_st... | ALGO | 0.999505 | 3.50017 |
b4c4c4f8-b7d5-41c1-8cce-e0f7609d2191 | nabhendu571s/Codeforces-Solutions | day_3.cpp | #include<bits/stdc++.h>
using namespace std;
void display(long long n){
long long rem=n%2020;
long long div=n/2020;
if(rem<=div){
cout<<"YES"<<endl;
}else{
cout<<"NO"<<endl;
}
}
signed main(){
int t;
cin>>t;
while(t--){
long long n;
cin>>n;
display(n);
}
ret... | ALGO | 0.998613 | 4.059542 |
d19fe937-af69-4172-b790-37f03642464b | Chaaany/SSafy_15_BESTTEAM | 20230322/백준/오석호_G3_20440_니가_싫어_싫어_너무_싫어_싫어_오지_마_내게_찝쩍대지마-1.cpp | #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
// 20440 니가 싫어 싫어 너무 싫어 싫어 오지 마 내게 찝쩍대지마-1
// 누적합
int n, e, x;
vector<int> v; // 입력값
vector<pair<int, int>> v2; // 범위
// 정답용 변수
int ans = 0;
int ansS... | ALGO | 0.999968 | 4.82374 |
5daa3c42-3780-4640-b821-a498ce4a2157 | anwar-opu/problem-solving-using-C_and_C_plus_plus | 1296A.cpp | #include<bits/stdc++.h>
#define ll long long int
#define FastIO ios_base::sync_with_stdio(false), cin.tie(0)
using namespace std;
int main(){
FastIO;
ll t;
cin>>t;
while(t--) {
vector<ll> v;
ll n, sum = 0,even=0,odd=0;
cin >> n;
for (int i = 0; i < n; i++) {
i... | ALGO | 0.999665 | 4.541205 |
2bb93570-dce8-494a-969d-0df56052a32f | Priyankar96/face_recognize | opencv-master/opencv-master/modules/dnn/src/ocl4dnn/src/ocl4dnn_softmax.cpp | #include "../../precomp.hpp"
#include <vector>
#include "../include/common.hpp"
#include "../include/ocl4dnn.hpp"
#include "opencl_kernels_dnn.hpp"
namespace cv { namespace dnn { namespace ocl4dnn {
template<typename Dtype>
OCL4DNNSoftmax<Dtype>::OCL4DNNSoftmax(OCL4DNNSoftmaxConfig config)
{
softmax_axis_ = config... | ALGO | 0.993236 | 6.746386 |
6927048f-6230-4a61-9187-12736e9f699f | edge555/Online-Judge-Solves | SPOJ/IITKWPCI - Find Lexicographically Smallest Permutation.cpp | #include <bits/stdc++.h>
using namespace std;
#define FAST ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define pf printf
#define sc scanf
#define sf(n) scanf("%d",&n)
#define sff(n1,n2) scanf("%d %d",&n1,&n2)
#define sfff(n1,n2,n3) scanf("%d %d %d",&n1,&n2,&n3)
#define sl(n) scanf("%lld",&n)
#define... | ALGO | 0.999974 | 4.359454 |
0e1c313d-8542-490b-ae47-2128663e079f | rajendraxettri/CPP_Programming | Binary_search/new_search_By_chatGpt.cpp | #include <iostream>
#include <vector>
// Function to perform binary search
int binarySearch(const std::vector<int>& arr, int target) {
int left = 0; // Initialize the left boundary of the search range
int right = arr.size() - 1; // Initialize the right boundary of the search range
while (left... | ALGO | 0.999962 | 7.225637 |
5aa03817-0a23-41f7-8687-5fc500bbee2e | fciapsa/Competitive-Programming | Kattis/PhoneList.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
int main() {
std::ios::sync_with_stdio(false);
int tc, n;
bool pre;
cin >> tc;
while (tc--) {
cin >> n;
vector<string> v(n);
for (int i = 0; i < n; ++i) cin >> v[i];
sort(v.begin(), v.end());
... | ALGO | 0.999984 | 4.76685 |
d4969000-3279-4365-8375-e3e62c691565 | ishandutta2007/codeforces | boook/normal/965/E.cpp | /*input
3
telegram
digital
resistance
*/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
#define REP(i,j,k) for(int i = j ; i < k ; ++i)
#define RREP(i,j,k) for(int i = j ; i >=k ; --i)
#define A first
#define B second
#define mp make_pai... | ALGO | 0.99988 | 3.835018 |
30acbd2d-99e3-4454-a0d7-c500ef8b7693 | saffy-embedded-22-study/Study | 이용은/백준/week04_평범한 배낭.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int N, K;
int W[100];
int V[100];
int dp[100][100000];// : , :
/*
dp ʱⰪ ݵ 0 ʱȭ ؾ
ǥ 0 ù ° Ƿ,
ش Կ ִ ġ 0
ǥ 0 ʴ ̹Ƿ ִ ġ 0
*/
void input();
int findMaxV(int, int);
int main() {
input();
cout << findMaxV(0, K);
return 0;
}
void input() ... | ALGO | 0.999996 | 4.423063 |
477d200d-d02d-4a1e-bff4-4a7af79ff801 | anub2301/contests_codeforces | codeforces g2/contests/1861B.cpp | #include<iostream>
#include<bits/stdc++.h>
using namespace std;
int main(){
int t;
cin>>t;
while(t--){
string s1;
string s2;
cin>>s1;
cin>>s2;
if(s1==s2){
cout<<"YES"<<endl;
}
else{
while(s1!=s2){
for(int i=l;i... | ALGO | 0.99997 | 3.394836 |
fa8a0ab0-69f1-478c-89d0-d9ca4c671923 | rising-stark/CP_Practice | AtCoder/ABC186/C.cpp | #include<bits/stdc++.h>
#define ll long long int
#define pb push_back
#define vi vector<int>
#define vll vector<ll>
#define vvi vector<vector<int> >
#define vvll vector<vector<ll> >
#define pii pair<int, int>
#define pll pair<ll, ll>
#define pis pair<int, string>
#define psi pair<string, int>
#define ALL(x) x.begin(), ... | ALGO | 0.999404 | 3.875927 |
03dcb435-258b-49d4-b0a1-6d23427329d9 | matubu/42containers | containers_test/srcs/multiset/more.cpp | #include "common.hpp"
#define T1 int
struct ft_more {
bool operator()(const T1 &first, const T1 &second) const {
return (first > second);
}
};
typedef TESTED_NAMESPACE::multiset<T1, ft_more> ft_st;
typedef TESTED_NAMESPACE::multiset<T1, ft_more>::iterator ft_st_it;
int main(void)
{
ft_st st;
st.insert(42);
... | TEST | 0.874035 | 4.566597 |
ec35a852-1d63-4ef2-b097-cdf245d0eafa | alyssa-gibson/CSC306-Lab1 | Lab_1.cpp | /*
* File: Lab_1.cpp
* Author: Alyssa Gibson
*
* Created on January 8, 2019, 8:49 PM
*/
#include <cstdlib>
#include <iostream>
using namespace std;
/*
*
*/
void speed_calc (int& hour1, int& min1, int& hour2, int& min2) {
// @params: time of arrival at each toll booth, 24hr format
// returns: none
... | ALGO | 0.978258 | 4.540535 |
d0f7e6ba-5542-4bbe-ae68-828009c90d24 | rosscleary/Competitive-Programming | DMOJ/DMOPC/DMOPC '18 Contest 1 P0 - Sorting.cpp | #include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <map>
#include <list>
#include <algorithm>
#include <cmath>
#include <string.h>
#include <iomanip>
#include <climits>
#define ll long long
using namespace std;
int main () {
int top, middle, bottom;
scanf("%d%d%d",&top,&middle,&bot... | ALGO | 0.997989 | 3.149064 |
f277e3c9-555c-45d6-a7d1-2fdfdeebc858 | shechty2/mileStone2 | HelpfulFunctionsForMatrix.cpp | //
// Created by yuval on 2/2/20.
//
#include "HelpfulFunctionsForMatrix.h"
vector<State*> HelpfulFunctionsForMatrix::getAllPossibleStates(State* state, unordered_map<string, State*>* vertex_map, int limit) {
int cur_j = state->getJ();
int cur_i = state->getI();
vector<State*> legalStates;
if(cur_i +... | ALGO | 0.999873 | 3.907653 |
7e5ea97b-ff1e-4a58-a364-7d6c2c1698c4 | DaAlG/code_studying | jaeyeong/개인/c++/브루트포스/[백준]2573_빙산.cpp | using namespace std;
#include <iostream>
#include <vector>
#include <cstring>
#include <queue>
#include <tuple>
#define MAX 300
int n, m;
int board[MAX][MAX], sea[MAX][MAX];
bool visit[MAX][MAX];
int dx[4] = { 0,0,1,-1 };
int dy[4] = { 1,-1,0,0 };
bool inRange(int x, int y) {
return 0 <= x && x < n && 0 <= y && y < ... | ALGO | 0.999866 | 4.051522 |
6a542ac7-dab9-4d46-86e7-5f3a7a5ac7c2 | Siriapps/HackerrankC_plus_plus | stringstream/main.cpp | //https://www.hackerrank.com/challenges/c-tutorial-stringstream/problem
#include <sstream>
#include <vector>
#include <iostream>
using namespace std;
vector<int> parseInts(string str) {
stringstream ss(str);
char ch;
vector<int> result;
int temp;
while(ss>>temp){
result.push_back(temp);
... | ALGO | 0.978717 | 4.930631 |
e2ef653b-bc00-4fd1-b117-5d759823d9d2 | Jayvashishtha123/Competitive_programming | E_Sponsor_of_Your_Problems.cpp | /**********************************let's begin**********************************/
#include "bits/stdc++.h"
using namespace std;
#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define int long long
// #define LOCAL
#define endl "\n"
#define vi vector<int>
#define vvi vector<vi>
#define pii pair<int, i... | ALGO | 0.999858 | 4.881873 |
dadc9806-90a0-4f61-8c9f-74b996f0fc26 | akashpatilx7/Code-chef | Practice Problems/FLOW004self.cpp | // If Give an integer N . Write a program to obtain the sum of the first and last digits of this number.
// What is typedef long long?
// Using the command typedef it is possible to give a shorter name to a datatype. For example, the name long long is long, so we can define a shorter name ll: typedef long long ll; Aft... | ALGO | 0.999689 | 5.917959 |
3f840f1a-256e-4b66-967a-db5e7beeb5db | sky8c9/Prac | AtCoder/ABC/354/D.cpp | #include <iostream>
#include <vector>
using namespace std;
using ll = long long;
const ll SHIFT = 1e9;
void task() {
ll a, b, c, d;
cin >> a >> b >> c >> d;
--c; --d;
a += SHIFT; b += SHIFT; c += SHIFT; d += SHIFT;
vector<ll> sO {1, 2, 1, 0};
vector<ll> sE {2, 1, 0, 1};
ll rowO, rowE;
... | ALGO | 0.999824 | 4.41408 |
ebd64ab3-5501-4b1b-8c0d-40a7ffc810e0 | 5onyy/HCMUT_new | DSA/Lab_week1/8.cpp | int findMax(int* arr, int length)
{
if (length==1) return arr[0];
return max(arr[length-1],findMax(arr,length-1));
} | ALGO | 0.999557 | 4.397834 |
edda5a13-39cb-473a-b557-936831911c5b | robooocode/hacktoberfest-2022 | CPP/Merge_Overlapping_Intervals.cpp | // C++ program to merge overlapping Intervals in
// O(n Log n) time and O(1) extra space.
#include <bits/stdc++.h>
using namespace std;
// An Interval
struct Interval {
int s, e;
};
// Function used in sort
bool mycomp(Interval a, Interval b) { return a.s < b.s; }
void mergeIntervals(Interval arr[], int n)
{
// So... | ALGO | 0.999987 | 6.30549 |
2297096a-c759-41f9-8131-44f201be13d3 | freitagfelipe/neps-academy | cpp/0310.cpp | #include <bits/stdc++.h>
using namespace std;
struct Rectangle {
int x1;
int y1;
int x2;
int y2;
int width() {
return abs(x1 - x2);
}
int height() {
return abs(y1 - y2);
}
friend istream &operator>>(istream &is, Rectangle &r) {
is >> r.x1 >> r.y1 >> r.x2 ... | ALGO | 0.999833 | 3.749779 |
acdba671-a0a6-48f2-bdcb-b2d01bf9ef40 | ivangalbans/TeamReference | Number_Theory/Tree_Stern-Brocot.cpp | /*
Stern-Brocot Tree for enumerating rationals
Enumerating all irreducible rationals ascending order,
Whose sum of N and D is atmost B
*/
void sternBrocot(Int B, Int pl = 0, Int ql = 1, Int pr = 1, Int qr = 0) {
Int pm = pl + pr, qm = ql + qr;
if (pm + qm > B)
return;
sternBrocot(B, pl, ql, pm, qm); // [pl / ... | ALGO | 0.999723 | 4.037642 |
afa272dc-7c83-4e36-8fb1-35cafe3bc5f7 | zkx349113864/c-_primer_5th | chapter_three/test3-18.cpp | #include <iostream>
#include <string>
#include <vector>
using std::cin;
using std::cout; using std::endl;
using std::string;
using std::vector;
int main()
{
vector<int> ivec;
ivec.push_back(42);
for (auto i : ivec) {
cout << i << endl;
}
system("pause");
return 0;
vector<int> ivec2 =... | TOOL | 0.867103 | 3.141562 |
16e65fac-c9d3-4cfa-8576-88cd0c5d049d | LiquidPlayer/LiquidCore | deps/boost_1_66_0/libs/geometry/test/algorithms/detail/partition.cpp | #include <geometry_test_common.hpp>
#include <algorithms/test_overlay.hpp>
#include <boost/geometry/geometry.hpp>
#include <boost/geometry/geometries/multi_point.hpp>
#include <boost/geometry/geometries/point_xy.hpp>
#include <boost/geometry/geometries/register/point.hpp>
#include <boost/geometry/algorithms/detail/p... | TEST | 0.915596 | 7.687862 |
9c7805e6-c314-4dd1-b2a7-b1fc387eac8b | ankitksh81/leetcode-challenges | January 2022/day3.cpp | /*
Find the town judge
https://leetcode.com/problems/find-the-town-judge/
*/
// Solution:
class Solution {
public:
int findJudge(int n, vector<vector<int>>& trust) {
if(trust.size() < n-1) {
return -1;
}
vector<int> count(n+1);
for(auto rel: trust) {
... | ALGO | 0.999925 | 5.416949 |
ebc46a01-0c10-4dbc-82b5-d77701301cc4 | bioexcel/bioexcel-exascale-co-design-benchmarks | GROMACS/nonbonded_benchmark/gromacs_source_code/src/gromacs/linearalgebra/gmx_lapack/sorgl2.cpp | #include "../gmx_blas.h"
#include "../gmx_lapack.h"
void
F77_FUNC(sorgl2,SORGL2)(int *m,
int *n,
int *k,
float *a,
int *lda,
float *tau,
float *work,
... | ALGO | 0.989911 | 3.172093 |
5bb8d7fb-7ed8-4a2f-a529-a8059c253148 | amirreza-salehpor/Developer-GT06-Car-GPS-Tracker | Code/Drivers/CMSIS/NN/Examples/ARM/arm_nn_examples/gru/arm_nnexamples_gru.cpp | /**
* @ingroup groupExamples
*/
/**
* @defgroup GRUExample Gated Recurrent Unit Example
*
* \par Description:
* \par
* Demonstrates a gated recurrent unit (GRU) example with the use of fully-connected,
* Tanh/Sigmoid activation functions.
*
* \par Model definition:
* \par
* GRU is a type of recurrent neura... | ALGO | 0.911935 | 7.471897 |
ad9fff8c-ed38-419e-ba98-eb254372d38c | Yuk1n0/Homework | TourismManagement/Graph.cpp | #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include "Graph.h"
using namespace std;
#define F_PATH1 "Vex.txt"
#define F_PATH2 "Edge.txt"
void CGraph::init()
{
for (int i = 0; i < 20; i++)
{
for (int j = 0; j < 20; j++)
{
m_aAdjMatrix[i][j] = 0;
... | ALGO | 0.999121 | 3.388794 |
a9c860c5-cef4-485a-ab57-886eb09fb955 | yubinbai/leetcode | src/graph_valid_tree/main.cpp | #include <cstdlib>
#include <iostream>
#include <map>
#include <sstream>
#include <string>
#include <vector>
using namespace std;
class Solution {
public:
bool validTree(int n, vector<pair<int, int>>& edges) {
vector<vector<int>> adj(n);
for (auto e : edges) {
adj[e.first].push_back(e.second);
a... | ALGO | 0.999493 | 5.981344 |
524b9896-7cb8-413d-89b1-2ebb3f243751 | DPChanny/ps | Baekjoon/1547.cpp | #include<iostream>
using namespace std;
int m, bx, by, b(1);
int main(void) {
cin >> m;
for(int _m(0); _m < m; _m++) {
cin >> bx >> by;
if(bx == b) b = by;
else if(by == b) b = bx;
}
cout << b;
} | ALGO | 0.999877 | 3.359005 |
dea0c890-8433-4792-a0fb-d124e172591f | crystax/android-vendor-boost-1-62-0 | libs/parameter/test/literate/predicate-requirements0.cpp |
#include <boost/parameter.hpp>
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/depth_first_search.hpp>
BOOST_PARAMETER_NAME((_graph, graphs) graph)
BOOST_PARAMETER_NAME((_visitor, graphs) visitor)
BOOST_PARAMETER_NAME((_root_vertex, graphs) root_vertex)
BOOST_PARAMETER_NAME((_index_map, graphs) index_... | ALGO | 0.999432 | 6.615582 |
ac609cfd-74ec-4496-8b4a-2483023559cb | rajibdpi/leetcodes | algorithms/cpp/oneEditDistance/oneEditDistance.cpp | // Source : https://oj.leetcode.com/problems/one-edit-distance/
// Author : Hao Chen
// Date : 2014-12-03
/*
* Given two strings S and T, determine if they are both one edit distance apart.
*/
#include <stdlib.h>
#include <string.h>
#include <iostream>
#include <string>
using namespace std;
/*
* Notes:
*
... | ALGO | 0.999152 | 5.423456 |
50eebd32-1368-48d7-8b63-a2dfb1880b5e | Parkminhee/Algorithm | PROGRAMMERS/Level 1/실패율.cpp | #include <string>
#include <vector>
#include <algorithm>
using namespace std;
bool Cmp(pair<double, int> a, pair<double, int> b) {
if(a.first >= b.first) {
if(a.first == b.first) {
if(a.second < b.second) return true;
else return false;
}
return true;
}
... | ALGO | 0.999903 | 4.717552 |
ece57b23-674d-45d9-9685-adbd0c55c575 | DeepFlame-JR/Algorithm_Solving | C++/hard/bj1629.cpp | #include<bits/stdc++.h>
using namespace std;
/*
20억이기 때문에 for문을 돌리면 시간초과
아래 내용을 활용 (log2 N)
2^14 = 2^7 * 2^7
2^7 = 2^3 * 2^3 * 2
2^3 = 2^1 * 2^1 * 2
*/
typedef long long ll;
ll a, b, c;
ll go(ll a, ll b){
if(b == 1) return a%c;
ll ret = go(a, b/2);
ret = (ret*ret)%c;
if(b%2==1) ret=(ret*a)%c;
... | ALGO | 0.999991 | 4.247145 |
dfedb1e3-a091-4e3b-ba3b-98a372e47e28 | akshat-o5/Data-Structures-and-Algorithms | Revision/Arrays/LinearSearch.cpp | #include <iostream>
#include <climits>
using namespace std;
// // for 1D Array
// bool search(int arr[], int n, int target){
// for (int i = 0; i < n; i++)
// {
// if ((arr[i]==target))
// {
// return true;
// }
// }
// return false;
// }
// int main... | ALGO | 0.999432 | 4.700466 |
30c2f231-147c-4a3b-aab5-8b56db259e17 | onenewarm/codetree-TILs | 240504/피보나치 수/fibonacci-number.cpp | #include <iostream>
using namespace std;
int dp[46];
int n;
int main() {
// 여기에 코드를 작성해주세요.
cin >> n;
dp[1] = 1;
dp[2] = 1;
for(int iCnt = 3; iCnt <= n ; ++iCnt)
{
dp[iCnt] = dp[iCnt - 2] + dp[iCnt - 1];
}
cout << dp[n];
return 0;
} | ALGO | 0.999992 | 4.629964 |
073bde22-52e6-4131-8dea-e6c54ae143bc | bamboohiko/problemSolve | poj/p3414.cpp | #include<iostream>
#include<cstdio>
#include<map>
#include<set>
#include<vector>
#include<stack>
#include<queue>
#include<string>
#include<cstring>
#include<sstream>
#include<algorithm>
#include<cmath>
#define INF 0x3f3f3f3f
#define eps 1e-8
#define pi acos(-1.0)
using namespace std;
struct point {
int x,y,f,act;
}... | ALGO | 0.999938 | 3.859132 |
ae4d2db5-04be-43cf-abb9-ab1cfb376c5f | kohyatoh/contests | pku/2397/2397.cpp | #include <stdio.h>
#include <algorithm>
using namespace std;
#define rep(i, n) for(int i=0; i<(int)(n); i++)
int T, m, h[1100], dp[1100][2000];
int INF = 1<<20;
void rec_pr(int i, int ch) {
if(i<0) return ;
if(dp[i+1][ch]==dp[i][ch+h[i]]) { rec_pr(i-1, ch+h[i]); putchar('D'); }
else { rec_pr(i-1, ch-h[i])... | ALGO | 0.999948 | 3.903087 |
b5230b8c-5330-4b1c-bc02-588b587d46fc | kmjp/procon | atcoder/abc101-150/abc117/b.cpp | #include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;
#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZER... | ALGO | 0.999996 | 3.780983 |
80765168-f3bb-4f8d-809e-eb4088619949 | ishandutta2007/codeforces | lul____sepled1305/normal/1345/B.cpp | #include<bits/stdc++.h>
using namespace std;
int tri_num[100005];
int pyra_num[100005];
int solve(int nn)
{
double pp = (double) nn;
pp = sqrt(1+24*pp);
pp--;
pp/=6;
return (int) floor(pp);
}
int main()
{
int t,i,j,k,n,ans;
cin>>t;
while(t--)
{
cin>>n;
ans = 0;
... | ALGO | 0.999867 | 4.077515 |
068bf715-051d-4f8c-8654-fd918d384ae1 | IvanTicona/Competitive-Programming | aCodeDaily/1000/A_String_Task.cpp | /*
Author: Ivan Ticona
*/
#include<bits/stdc++.h>
using namespace std;
#define INF 1000000000
#define MOD 1000000007
#define FOR(i, a, b) for(int i = a; i <= b; i++)
#define all(x) x.begin(), x.end()
#define sort(x) sort(all(x))
#define sz(x) (int)x.size()
#define pb push_back
typedef long long ll;
typedef pair<int,... | ALGO | 0.999595 | 3.697019 |
6db32d21-d68c-421b-94e0-94e2f3db9572 | nguyentan2212/DirectXGame | DirectXGame/Physic/CollisionManager.cpp | #include "CollisionManager.h"
#include "../Core/ObjectPool.h"
CollisionManager::CollisionManager()
{
}
CollisionEvent CollisionManager::CalcAABB(GameObject* objA, GameObject* objB, float deltaTime)
{
VECTOR2D vA = objA->velocity;
VECTOR2D vB = objB->velocity;
// both objs are moving => objA move & objB s... | ALGO | 0.9979 | 6.205952 |
1814c7d8-c78b-4028-9798-2816e29fa58c | DyogoBendo/cp | subject/graph/moocast.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
void setIO(string s) {
freopen((s + ".in").c_str(), "r", stdin);
freopen((s + ".out").c_str(), "w", stdout);
}
vector<vector<int>> graph;
vector<int> visited;
int dfs(int current){
if(visited[current]) return 0;
visited[current] = 1;
... | ALGO | 0.999837 | 3.872117 |
fd1153b3-7173-458e-8d08-0415af58be9d | Aniket1398/LeetCode-Solutions | 148-sort-list/148-sort-list.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
ListNode* sortList(Li... | ALGO | 0.999997 | 5.663256 |
66838b36-c0cb-42e2-8604-f142137695d9 | sorohere/DSA | Arrays/MaximumGap/MaximumGap.cpp | #include <bits/stdc++.h>
using namespace std;
// 164. Maximum Gap
// Given an integer array nums, return the maximum difference between two successive elements in its sorted form.
// If the array contains less than two elements, return 0.
// You must write an algorithm that runs in linear time and uses linear extra ... | ALGO | 0.999626 | 5.84734 |
652c1f76-921b-4d4b-b0c5-effbe2e4357e | vanitas-23/Daily_progress | 1298-reverse-substrings-between-each-pair-of-parentheses/reverse-substrings-between-each-pair-of-parentheses.cpp | class Solution {
public:
string reverseParentheses(string s) {
stack<char>st;
for(char c:s)
{
if(st.empty())
st.push(c);
else
{
if(c!=')')
{
st.push(c);
continue;
... | ALGO | 0.999951 | 5.890653 |
5cfb4153-0d30-4b3f-99c9-17ceb46ed0e1 | HimanshuJo/CPP-Basic-to-Advance-Important-Concepts-With-Implementations | C++/Leetcode Problems/LeetcodeWeekly/G2/292/Solution2265.cpp | // 2265. Count Nodes Equal to Average of Subtree
/*
Given the root of a binary tree, return the number of nodes
where the value of the node is equal to the average of the values in its subtree.
Note:
The average of n elements is the sum of the n elements divided by n and rounded down to the nearest integer.
A subtre... | ALGO | 0.999946 | 6.983482 |
d43db6c5-9cef-4445-9caf-b9900e2ab644 | woodzong/w2d_lib | libw3d/w3d_comm.cpp | #include "w3d_comm.h"
void W_Mat_Mul_VECTOR4D_4X4(W_VECTOR4D_PTR va,
W_MATRIX4X4_PTR mb,
W_VECTOR4D_PTR vprod)
{
// this function multiplies a VECTOR4D against a
// 4x4 matrix - ma*mb and stores the result in mprod
// the function makes no assumptions
for (int col = 0; col < 4; col++)
{
// compute dot pro... | TOOL | 0.976415 | 4.739314 |
bee86140-9354-4e5d-89d4-4cc000752939 | k-tanotra/LeetCode | problems/climbing_stairs/solution.cpp | class Solution {
public:
int climbStairs(int n) {
// vector<int> dp(n,0);
// dp[0] = 1;
// dp[1] = 2;
if(n==1)
return 1;
if(n==2)
return 2;
int a = 1;
int b = 2;
int c;
for(int i=2;i<n;i++){
c = b + a;
... | ALGO | 0.99995 | 5.878598 |
7e12ade2-3b28-4e83-8da9-829a3138a2de | ishandutta2007/codeforces | davidberard/normal/1287/C.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pii;
const int N = 110;
const int INF = 0x3f3f3f3f;
int dp[N][N][2];
int a[N];
int n;
int main() {
ios_base::sync_with_stdio(0), cin.tie(0);
cin >> n;
int ro = (n+1)/2;
for (int i=1; i<=n; ++i) {
cin >> ... | ALGO | 0.999991 | 4.087798 |
f6dc224c-b541-460b-80c9-b0de5dc42526 | MorningXu/dnn_yolo_tracker | src/third_part/eigen3/doc/examples/Tutorial_BlockOperations_print_block.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace std;
int main()
{
Eigen::MatrixXf m(4,4);
m << 1, 2, 3, 4,
5, 6, 7, 8,
9,10,11,12,
13,14,15,16;
cout << "Block in the middle" << endl;
cout << m.block<2,2>(1,1) << endl << endl;
for (int i = 1; i <= 3; ++i)
{
cout << "B... | ALGO | 0.982558 | 3.6853 |
2bfa0622-6afd-4f18-968b-2d23e47cf887 | Dsxv/competitveProgramming | codeForces/global/7/b.cpp | #include <bits/stdc++.h>
using namespace std ;
#define int long long
int32_t main(){
int n ;
cin >> n;
int x ;
cin >> x ;
cout << x << " ";
for(int i = 0 ; i < n - 1; i++){
int y ;
cin >> y ;
cout << y + x << " " ;
x = max(x,y+x) ;
}
return 0 ;
}
| ALGO | 0.999839 | 3.313361 |
f9bbbb19-8981-4d2d-ba5e-3de93818f548 | SSSuperDan/MlcDec | Core/CoreCube.cpp | //
// Created by ldd on 2023/3/29.
//
#include "CoreCube.h"
CoreCube::CoreCube(MultilayerGraph &mg_) : mg(mg_), ln(mg.GetLayerNumber()), n(mg.GetN()) {
uint max_deg, deg;
layer_idt = new bool[ln];
selected_layer = new uint[ln];
sups = new uint *[ln];
for (uint i = 0; i < ln; i++) {
sups... | ALGO | 0.999696 | 4.61348 |
0df3d44a-4074-4200-af46-9d9d321521f1 | enuguru/CPP-Programming | STL/stlbook/algo/search2.cpp | #include "algostuff.hpp"
using namespace std;
// checks whether an element is even or odd
bool checkEven (int elem, bool even)
{
if (even) {
return elem % 2 == 0;
}
else {
return elem % 2 == 1;
}
}
int main()
{
vector<int> coll;
INSERT_ELEMENTS(coll,1,9);
PRINT_ELEMENTS(co... | ALGO | 0.99629 | 5.30848 |
23c37c65-d265-4bca-830f-4c5bbe039c15 | JANGYUNKYUNG/cpp.5 | 실습문제 5-9/실습문제 5-9/소스.cpp | #include <iostream>
using namespace std;
class Accumulator {
int value;
public:
Accumulator(int value) : value(value) {}
Accumulator& add(int n) {
value += n;
return *this;
}
int get() {
return value;
}
};
int main() {
Accumulator acc(10);
acc.add(5).add(6).a... | TOOL | 0.875177 | 4.982587 |
4eb0521e-f4aa-44b7-8acf-6a76f632470f | ycj1905/OpenCV-ROI-Test | cam_video.cpp | #include <opencv2/core/core.hpp>
#include <opencv2/core/utility.hpp>
#include <opencv2/imgcodecs.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/imgproc.hpp>
#include <iostream>
using namespace std;
using namespace cv;
char key;
/// Global variables
Mat src, dst;
Mat map_x, map_y;
/// Function Headers
void upd... | TOOL | 0.861747 | 5.192492 |
9157cd5e-a629-4f12-b0a3-f00246b83b3e | shuxiangguo/sxg_leetcode | 387.字符串中的第一个唯一字符.cpp | /*
* @lc app=leetcode.cn id=387 lang=cpp
*
* [387] 字符串中的第一个唯一字符
*
* https://leetcode-cn.com/problems/first-unique-character-in-a-string/description/
*
* algorithms
* Easy (41.26%)
* Likes: 154
* Dislikes: 0
* Total Accepted: 48.2K
* Total Submissions: 116.5K
* Testcase Example: '"leetcode"'
*
* 给定... | ALGO | 0.998366 | 5.62014 |
d99f83e4-11e3-433c-b6b1-372adca20bb2 | colinhli/MachineLearning_scratch | third_party/eigen-323c052e1731/unsupported/bench/bench_svd.cpp | // Bench to compare the efficiency of SVD algorithms
#include <iostream>
#include <bench/BenchTimer.h>
#include <unsupported/Eigen/SVD>
using namespace Eigen;
using namespace std;
// number of computations of each algorithm before the print of the time
#ifndef REPEAT
#define REPEAT 10
#endif
// number of tests of t... | TEST | 0.991016 | 6.268869 |
b287a108-3d6d-4291-8791-acf9bc7bdcbf | ROCm/libhipcxx | libcxx/test/std/algorithms/alg.sorting/alg.binary.search/upper.bound/upper_bound.pass.cpp | // <algorithm>
// template<ForwardIterator Iter, class T>
// constexpr Iter // constexpr after c++17
// upper_bound(Iter first, Iter last, const T& value);
#include <algorithm>
#include <vector>
#include <cassert>
#include <cstddef>
#include "test_macros.h"
#include "test_iterators.h"
#if TEST_STD_VER > 17
T... | TEST | 0.993109 | 7.253215 |
273d91f9-05d4-4ff1-aed4-78b0d995de65 | Zlin0509/Zlin_ACM | _HDU/25 Summer/7/1006.cpp | //
// Created by Zlin on 2025/8/8.
//
#include "bits/stdc++.h"
#define endl '\n'
using namespace std;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
typedef double db;
typedef long long ll;
typedef vector<int> vi;
typedef vector<long long> vll;
typedef pair<int, int> pii;
typedef pair<ll, ll>... | ALGO | 0.998919 | 5.205641 |
7ddcd7d3-dd3e-4529-8a05-467b9018ac56 | adityamathur98/Cpp_with_Dsa | practice_question/find_Missed_Number.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
// Write a C++ program to find the missing number in an array of size N-1 containing numbers from 1 to N
int n = 5;
int arr[] = {1, 2, 4, 5};
int expectation = n * (n + 1) / 2;
int actualSum = 0;
for (auto it : arr)
{
actua... | ALGO | 0.999809 | 4.238903 |
681dd277-2e31-4ec7-a76f-f1b10d939413 | shubhamsaket49/Coding-Contest | Contests/Codeforces/272 Div2/1.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n,m;
cin>>n>>m;
if(m>n)
cout<<"-1"<<endl;
else
{
int p=m*m;
cout<<((n+2*m-1)/(2/p))<<endl;
}
}
| ALGO | 0.999958 | 3.275069 |
fbc361d2-2edf-47db-9bd3-fe746fdc6a7f | mukk050204/polygeist | libcxx/test/std/numerics/numeric.ops/exclusive.scan/exclusive_scan.pass.cpp | // <numeric>
// UNSUPPORTED: c++03, c++11, c++14
// UNSUPPORTED: clang-8
// UNSUPPORTED: gcc-9
// Became constexpr in C++20
// template<class InputIterator, class OutputIterator, class T>
// OutputIterator exclusive_scan(InputIterator first, InputIterator last,
// OutputIterator r... | TEST | 0.95834 | 6.731629 |
8c2b112c-bede-4363-b78f-61d366008918 | manikanta2901/ubuntu | .history/SRM/elab/DAA/SearchingTechniques/FindCLosest3_20210129151403.cpp | #include<bits/stdc++.h>
using namespace std;
void findClosest(int A[], int B[], int C[], int p, int q, int r)
{
int diff = 1000; // Initialize min diff
// Initialize result
int res_i =0, res_j = 0, res_k = 0;
// Traverse arrays
int i=0,j=0,k=0;
while (i < p && j < q && k < ... | ALGO | 0.999993 | 3.727728 |
9f52e5c2-4faa-4e6b-822b-1c3eebb0d41c | braveheart12/Blocknet | src/blocknetdx-tx.cpp | #include "base58.h"
#include "clientversion.h"
#include "coins.h"
#include "core_io.h"
#include "keystore.h"
#include "primitives/block.h" // for MAX_BLOCK_SIZE
#include "primitives/transaction.h"
#include "script/script.h"
#include "script/sign.h"
#include "ui_interface.h" // for _(...)
#include "univalue/univalue.h"
... | TOOL | 0.881043 | 3.2768 |
1a365225-a68c-469b-bd17-968dad749ea4 | AlexSNIC/cpp-exercises-and-courses | Base/pointers & references/pointers.cpp | #include <iostream>
#include <string>
#include <vector>
using namespace std;
void double_value(int* value_ptr);
int* create_array(size_t size, int defaultValue = 0);
int* dangling_ptr_maker();
int main(){
int* int_ptr {nullptr}; // initializing a pointer
int int_var {10};
int_ptr = &int_var; // assigning a v... | TOOL | 0.956256 | 4.133722 |
f540e107-9702-47d3-89c2-0a146c078794 | rodamber/msc-thesis | code/setwise/z3/src/ackermannization/lackr.cpp | #include "ackermannization/lackr.h"
#include "ackermannization/ackermannization_params.hpp"
#include "tactic/tactic.h"
#include "ackermannization/lackr_model_constructor.h"
#include "ackermannization/ackr_info.h"
#include "ast/for_each_expr.h"
#include "ast/ast_util.h"
#include "model/model_smt2_pp.h"
lackr::lackr(ast... | ALGO | 0.999538 | 5.945279 |
2b36bc08-78f5-4a6f-b000-9c8a2d110110 | joydip10/some-fun-cpp | finding_number_with_odd_repeatations.cpp | #include<bits/stdc++.h>
using namespace std;
int odd_repeated_num(int* arr,int s)
{
int res=arr[0];
for(int i=1;i<s;i++)
{
res=arr[i]^res;
}
return res;
}
int main()
{
int arr[5]={1,1,4,4,5};
cout<<"Odd repeated number:"<<odd_repeated_num(arr,5)<<endl;
}
| ALGO | 0.999912 | 4.285583 |
ba4eb27a-ebe3-4c43-a939-b5467bc0ff91 | ildlt/2001 | Statements_task4.cpp | #include <iostream>
#include <cstdlib>
using namespace std;
int main() {
for (int i=1; i<=10; i++) {
cout << "9 * " << i << " = " << 9*i << endl;
}
return 0;
} | ALGO | 0.992465 | 3.639024 |
892d2b70-9cb0-4512-8019-8dc282ce6ac4 | jash13desai/leetcode | 2616. Minimize the Maximum Difference of Pairs.cpp | class Solution {
private:
bool fxn(vector<int>&v, int&m, int&k){
int cnt = 0;
for(int i=1; i<size(v); i++){
if(v[i]-v[i-1] <= m) cnt++, i++;
else continue;
} return (cnt>=k);
}
public:
int minimizeMax(vector<int>&v, int k) {
if(k==0) return 0;
... | ALGO | 0.999996 | 5.213226 |
1c4c830f-cc76-4b76-b702-3ce0c6518055 | wzcwzc05/luogu | P1990.cpp | #include <bits/stdc++.h>
using namespace std;
int n, dp[1000010];
int main()
{
cin >> n;
dp[1] = 1, dp[2] = 2, dp[3] = 5;
for (int i = 4; i <= n; ++i)
dp[i] = (dp[i - 1] * 2 + dp[i - 3]) % 10000;
cout << dp[n] << "\n";
return 0;
} | ALGO | 0.999992 | 4.070284 |
3c1b1af9-5e41-44ae-a08d-3f286cf25699 | sarvex/leetcode-ruby | lcp/LCP 05. 发 LeetCoin/Solution.cpp | const int MOD = 1e9 + 7;
class Node {
public:
Node* left;
Node* right;
int l;
int r;
int mid;
int v;
int add;
Node(int l, int r) {
this->l = l;
this->r = r;
this->mid = (l + r) >> 1;
this->left = this->right = nullptr;
v = add = 0;
}
};
clas... | ALGO | 0.999994 | 5.741853 |
141b7f7d-19bd-43d0-9d30-64d3549e314b | ordinarv/ACM | OJ/2018寒假训练/永远不会被删的文件/总/寒假/1.21/shi.cpp | #include<stdio.h>
#include<string.h>
int main(void)
{
int count=0,a,b;
scanf("%d",&a);
while(a)
{
printf("%d\n",a%10);
a/=10;
count++;
}
printf("%d",count);
return 0;
}
| ALGO | 0.999633 | 3.050083 |
b6fc0abc-6701-427a-8924-ab110bc726f9 | jimmy19991222/Notes-on-Cpp-Algorithm-Course | 第一章/第一课/1. 浮点数二分.cpp | # include <iostream>
using namespace std;
int main()
{
double x;
cin >> x;
double l = 0,r =x;
while(r - l >= 1e-6) // for (int i = 0;i<100;i++)
{
double mid = (l + r)/2;
if (mid * mid >= x) r = mid;
else l = mid;
}
printf("%lf\n",l);
return 0;
} | ALGO | 0.999994 | 3.616703 |
c1c4b374-2f1e-40a8-a96b-7cc1053bfa75 | tf2classic-android/tf2classic-source-engine | utils/height2normal/height2normal.cpp | static bool g_NoPause = false;
static bool g_Quiet = false;
static void Pause( void )
{
if( !g_NoPause )
{
printf( "Hit a key to continue\n" );
getch();
}
}
static bool ImageRGBA8888HasAlpha( unsigned char *pImage, int numTexels )
{
int i;
for( i = 0; i < numTexels; i++ )
{
if( pImage[i*4+3] != 255 )
{
... | TOOL | 0.862837 | 4.254106 |
2ff2e27a-3159-43d7-b178-77d424534876 | htbkoo/cplusplus | src/onlinePlatform/leetcode/leetcoding_challenge/2023/apr2023/week5/remove_max_number_of_edges_to_keep_graph_fully_traversable.cpp | #include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <limits>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <iterator>
#include <sstream>
#include <iostream> // includes cin to read from stdin and cout to write to stdout
#include <cstring> // for memset
using names... | ALGO | 0.999709 | 5.892785 |
b22529c6-b98f-410c-8fe3-bd2523b0510d | Felix-xilef/Estrutura-de-Dados | Aulas/Aula03-05/fila2.cpp | #include <stdio.h>
#include <stdlib.h>
#include "fila.h"
#include <time.h>
#define N 5
Fila *soma(Fila *p, Fila *q) {
Fila *auxP = fila_cria(), *auxQ = fila_cria(), *soma = fila_cria();
float numP, numQ;
while ((!fila_vazia(p)) || (!fila_vazia(q))) {
if (!fila_vazia(p)) {
numP = fila_r... | ALGO | 0.997173 | 4.124359 |
939ee79e-e6c0-43de-a49c-879761a5b75c | autumn192837465/LeetCode | 10. Regular Expression Matching.cpp | /*
Given an input string (s) and a pattern (p), implement regular expression matching with support for '.' and '*'.
'.' Matches any single character.
'*' Matches zero or more of the preceding element.
The matching should cover the entire input string (not partial).
Note:
s could be empty and contains only lowe... | ALGO | 0.999495 | 6.394506 |
ce78365c-3c64-479f-86e7-3d328f90be8e | DivyaSharma0894/CPP_Code | college_placement/loops/maxi.cpp | #include<iostream>
using namespace std;
int main(){
int n;
cin>>n;
int m;
int maxi=0;
for(int i=0;i<n;i++){
cin>>m;
maxi=max(maxi,m);
}
cout<<maxi;
} | ALGO | 0.999791 | 3.484674 |
9ccdc86d-560c-40b9-ab8f-f6cccbc82afc | InnovaTech-21/Quiz_Attempt2 | 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.