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 |
|---|---|---|---|---|---|---|
a226676e-5f68-4666-903e-acfe6a41ab28 | Time1996/python | C-Practice/pta5-7six.cpp | //转录于https://www.cnblogs.com/claremore/p/4869523.html
#include <iostream>
#include <fstream>
#include <cstdio>
#include <queue>
#include <vector>
using namespace std;
const int maxn = 10005;
int vertices, edges;
vector<int> G[maxn]; //每个vector结构的元素表示:与数组下标代表的节点右边的节点
bool vis[maxn]; //是否访问过
int BFS(int v)
{
for(i... | ALGO | 0.99951 | 4.349557 |
7d1ab144-4e05-4ed3-a13f-b3c0f7c8930c | shelley33/cc150-new | c++/Chapter 2/Question2_6.cpp | #include <iostream>
#include "LinkedListClass/LinkedList.h"
#include "../Chapter 1/Question2_6.h"
// runs in O(n) time with O(1) space
Node* findCycleBegin(Node* head)
{
if (head == NULL)
{
return nullptr;
}
Node* slow = head;
Node* fast = head;
int diff = 0;
while (fast != NULL &... | ALGO | 0.999898 | 5.066018 |
8dba5335-defa-4212-b6c8-cd372e05af49 | thanhcong2k7/Code-DTTin-23-24 | adu/CP/Code/Codeforces-Contest/#701_Div2/c.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int t,x,y,cnt[101]={0};
cin >> t;
for (int z=1; z<=t; z++){
cin >> x >> y;
for (int i=1; i<=x; i++)
for (int j=1; j<=y; j++)
if(i/j == i%j) cnt[z]+=1;
}
for (int i=1; i<=t; i++)
cout << cnt[... | ALGO | 0.998988 | 4.05252 |
cca16d6d-f348-45e5-bdcc-8d52583cc18d | TrellixVulnTeam/Chess_GG8M | UnrealEngine/Engine/Plugins/Experimental/GeometryProcessing/Source/DynamicMesh/Private/Solvers/Internal/MeshDiffusionIntegrator.cpp | #include "MeshDiffusionIntegrator.h"
#include "MatrixSolver.h"
FMeshDiffusionIntegrator::FMeshDiffusionIntegrator(const FDynamicMesh3& DynamicMesh, const ELaplacianWeightScheme Scheme)
{
Id = 0;
bIsSymmetric = false;
MinDiagonalValue = 0;
VertexCount = DynamicMesh.VertexCount();
}
void FMeshDiffusionIntegrator:... | ALGO | 0.996524 | 5.660897 |
bdcb613f-3e8c-4eda-9faa-2135a5ddb5a5 | iamslash/learntocode | leetcode/HandofStraights/a.cpp | #include <cstdio>
#include <vector>
#include <map>
// 1 2 3
// 2 3 4
// 6 7 8
// 1 2 3 4 6 7 8
// 1 2 3 1 1 1 1
// // 256ms 6.49% 10.4MB 91.87%
// // O(HW) O(H)
// class Solution {
// public:
// bool isNStraightHand(std::vector<int>& H, int W) {
// int n = H.size();
// std::sort(H.begin(), H.end(... | ALGO | 0.999797 | 4.902761 |
1dfa46c2-ff9b-4364-bd9c-33d96bcb2367 | PranitChawla/ACM-ICPC-Regionals-Codes | monk_and_multiplicaion.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main()
{
ll n;
cin>>n;
ll a[n+1];
for (ll i=1;i<=n;i++)
cin>>a[i];
priority_queue <ll> q;
q.push(a[1]);
q.push(a[2]);
// q.push(a[3]);
cout<<-1<<endl<<-1<<endl;
for (ll i=3;i<=n;i++)
{
q.push(a[i]);
ll a1=q.top();
q.pop();
... | ALGO | 0.999878 | 3.018007 |
be7a9e91-6259-4007-a1af-4a71048a5cba | VANSHIKA1803/DSA | Lecture028 Reference Variable/DynamicArray.cpp | #include <iostream>
using namespace std;
int getSum(int *arr, int n)
{
int sum = 0;
for (int i = 0; i < n; i++)
{
sum = sum + arr[i];
}
return sum;
}
int main()
{
int n;
cin >> n;
int *arr = new int[n];
for (int i = 0; i < n; i++)
{
cin >> arr[i];
}
i... | ALGO | 0.999413 | 5.998538 |
43cc8f8e-0f5e-4e9f-abcf-7bdb80433df2 | Shawdox/Pymutate | code_translation/Datasets/TransCoder/transcoder_evaluation_gfg/cpp/FINDING_POWER_PRIME_NUMBER_P_N_1.cpp | #include <iostream>
#include <cstdlib>
#include <string>
#include <vector>
#include <fstream>
#include <iomanip>
#include <bits/stdc++.h>
using namespace std;
int f_gold ( int n, int p ) {
int ans = 0;
int temp = p;
while ( temp <= n ) {
ans += n / temp;
temp = temp * p;
}
return ans;
}
//TOFILL
int... | ALGO | 0.998584 | 4.955137 |
7eea9cc4-a395-45c8-8079-8a20c28ba378 | skynjupt/LeedCode | Algorithms/remove-duplicates-from-sorted-array-ii/main.cpp | /*
https://leetcode.com/problems/remove-duplicates-from-sorted-array-ii/
{
Follow up for "Remove Duplicates":
What if duplicates are allowed at most twice?
For example,
Given sorted array A = [1,1,1,2,2,3],
Your function should return length = 5, and A is now [1,1,2,2,3].
}
*/
#include <iostream>
using... | ALGO | 0.999431 | 6.166045 |
f5e13c81-f822-43a0-abcc-00a57f6a4555 | naznine/Data-Structure-Course-RUET- | Delete all same valued nodes from a single linked list.cpp | #include<bits/stdc++.h>
using namespace std;
struct node{
int data;
struct node *next;
};
node *h;
void create()
{
int x,n;
struct node *p,*q;
h=NULL;
q=NULL;
printf("How many nodes to create ");
scanf("%d",&n);
for(int i=0;i<n;i++)
{
p=new node;
printf("Enter t... | ALGO | 0.999942 | 3.935827 |
f45e93be-fbb5-4e3c-88f6-cd6dc45a119c | Ananya150204/Competitive-Programming | Sheet/temp.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
const int MOD = 1e9 + 7;
// Miller–Rabin bases for n < 2^64
static const ll MR_WITNESSES[] = {
2LL, 325LL, 9375LL, 28178LL, 450775LL, 9780504LL, 1795265022LL
};
static const int MR_CNT = sizeof(MR_WITNESSES)/sizeof(MR_WITNESSES[0]);
// Small prime... | ALGO | 0.998527 | 5.339389 |
755484ac-3229-408b-b6d2-ffc96ac878d0 | CoconutJJ/compiler-optimization | CSCD70/Assignment1-Introduction_to_LLVM/LocalOpts/lib/1-AlgebraicIdentity.cpp | #include "LocalOpts.h"
#include "llvm/IR/Analysis.h"
#include "llvm/IR/Constant.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/InstrTypes.h"
#include "llvm/IR/Instruction.h"
#include "llvm/IR/Value.h"
#include "llvm/Support/Casting.h"
#include <vector>
using namespace llvm;
bool AlgebraicIdentityPass::algebraicI... | TOOL | 0.983109 | 7.76285 |
3d4c08cf-eaff-4c2f-9089-186bb19004ea | Saumyajeet-Varma/DSA-cpp | LeetCode/2493. Divide Nodes Into the Maximum Number of Groups/Solution.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution
{
public:
int magnificentSets(int n, vector<vector<int>> &edges)
{
vector<vector<int>> adjList(n);
vector<int> nodeDist(n);
for (auto edge : edges)
{
adjList[edge[0] - 1].push_back(edge[1] - 1);
... | ALGO | 0.999804 | 5.121761 |
b78996b3-8035-466b-8796-204730514cc4 | shovon26/COMPETITIVE | Backtracking/all Permutation of a string.cpp | //Resourse : https://www.youtube.com/watch?v=GuTPwotSdYw
#include<bits/stdc++.h>
#define ll long long int
#define ld long double
#define ss second
#define ff first
#define Mem(x,val) memset(x,val,sizeof x)
#define pb push_back
#define all(v) v.begin(),v.end()
#define unik(v) v.erase(unique(v.begin(),v.end()),v.end())
... | ALGO | 0.999947 | 4.314462 |
267e574a-9669-48f6-a0fd-584ad688a933 | longhai-mine/filemaynha | nhamtan/mang2chieuextra/test.cpp | #include <bits/stdc++.h>
using namespace std;
main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
int n = 5;
for(int i = 1; i <= 2; i++)
{
cout << ((n - 3 + i) * (n - 2 + i) / 2) - (i * (i - 1) / 2) << " ";
}
return 0;
}
| ALGO | 0.999673 | 3.432674 |
5907933e-892b-4a09-84ce-4b489c4ee601 | USunOfBeach/legacy | src/server/collision/BoundingIntervalHierarchy.cpp | #include "BoundingIntervalHierarchy.h"
#ifdef _MSC_VER
#define isnan _isnan
#else
#define isnan std::isnan
#endif
void BIH::buildHierarchy(std::vector<uint32> &tempTree, buildData &dat, BuildStats &stats)
{
// create space for the first node
tempTree.push_back(uint32(3 << 30)); // dummy leaf
tempTree.... | ALGO | 0.984735 | 5.860588 |
96bb0701-a0e4-4644-bbd2-20608af4749f | prateeksahu/llvm-security | lib/Transforms/IPO/CalledValuePropagation.cpp | #include "llvm/Transforms/IPO/CalledValuePropagation.h"
#include "llvm/Analysis/SparsePropagation.h"
#include "llvm/Analysis/ValueLatticeUtils.h"
#include "llvm/IR/InstVisitor.h"
#include "llvm/IR/MDBuilder.h"
#include "llvm/Transforms/IPO.h"
using namespace llvm;
#define DEBUG_TYPE "called-value-propagation"
/// The... | TOOL | 0.990691 | 7.822292 |
bf3ada5b-ea0c-4a45-b15b-a2dfb73e1ef3 | RazorBach/Leetcode | solutions/001-two-sum/two-sum.cpp | // Given an array of integers, return indices of the two numbers such that they add up to a specific target.
//
// You may assume that each input would have exactly one solution, and you may not use the same element twice.
//
// Example:
//
//
// Given nums = [2, 7, 11, 15], target = 9,
//
// Because nums[0] + nums[1] ... | ALGO | 0.999375 | 6.669782 |
d424ecde-6be0-4242-a46a-b0fe1e992212 | esbanarango/Competitive-Programming | CodeForces/Round #603 (Div 2)/603A.cpp | /*
Esteban Arango Medina
*/
#include <algorithm>
#include <iostream>
#include <iterator>
#include <numeric>
#include <sstream>
#include <fstream>
#include <cassert>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <string>
#include <cstdio>
#include <vector>
#include <bitset>
#include <cmath>
#includ... | ALGO | 0.999863 | 4.148206 |
7e25cdbd-2890-402a-90e2-f5a7f913bdd5 | calm-lab/online-judge | 15988.cpp | #include <iostream>
using namespace std;
const long long MAX = 1000001LL;
long long mod = 1000000009LL;
long long d[MAX];
int main() {
int t;
cin >> t;
d[0] = 1;
for(int i = 1; i <= MAX; i++){
if(i - 1 >= 0){
d[i] += d[i-1];
d[i]%=mod;
}
if(i - 2 >= 0){
... | ALGO | 0.999954 | 4.024435 |
8550a81e-1324-4f49-a399-831dfa174a83 | ishandutta2007/codeforces | aoligei/normal/1475/E.cpp | //#include <bits/stdc++.h>
#include <iostream>
#include <iomanip>
#include <math.h>
#include <cmath>
#include <algorithm>
#include <climits>
#include <functional>
#include <cstring>
#include <string>
#include <cstdlib>
#include <ctime>
#include <cstdio>
#include <vector>
#include <stack>
#include <queue>
#include <dequ... | ALGO | 0.999954 | 3.448242 |
b8408a11-cf09-4fdf-91e2-98aed5026044 | Gongdolgun/Algorithm | 프로그래머스/2/12936. 줄 서는 방법/줄 서는 방법.cpp | #include <iostream>
#include <vector>
#include <string>
#include <map>
#include <unordered_map>
#include <algorithm>
#include <queue>
#include <cmath>
using namespace std;
long long factorial(int n) {
if (n == 1) return 1;
else return n * factorial(n - 1);
}
vector<int> solution(int n, long long k) {
vect... | ALGO | 0.999989 | 3.963042 |
bb574dfa-d405-453b-b2ff-afe9ce018871 | Masoudas/educational_material | CPPMaterial/SedgewickAlgorithm/Chapter_II/QuickSort_III/4_quick_sort_in_cpp.cpp | /**
* Quick sort is implemented in the algorithms class. It takes as parameter an iterator to the
* start and end point, which is quite interesting.
* The api of qsort is:
* qsort( void *ptr, size_t count, size_t size, int (*comp)(const void *, const void *) );
*
* where ptr is the pointer to first element, cound is ... | ALGO | 0.99958 | 5.442077 |
2d294fc4-3ae8-4be7-8e4c-62747d5b6c64 | sahilduhan/Placement_Prepration | takeUforward/graphs/adjListWeighted.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int n, e;
cin >> n >> e;
vector<pair<int, int>> adj[e + 1];
for (int i = 0; i < e; i++){
int u, v, wt;
cin >> u >> v >> wt;
adj[u].push_back({v, wt});
adj[v].push_back({u, wt});
}
return 0;
} | ALGO | 0.999965 | 3.895152 |
68eef80a-914d-427b-9283-353ce77f416e | TheAlgorithms/C-Plus-Plus | math/realtime_stats.cpp | /**
* \file
* \brief Compute statistics for data entered in rreal-time
*
* This algorithm is really beneficial to compute statistics on data read in
* realtime. For example, devices reading biometrics data. The algorithm is
* simple enough to be easily implemented in an embedded system.
* \author [Krishna Vedala... | ALGO | 0.994396 | 7.518618 |
82b4112f-061e-409d-bdc9-da527a432fc8 | ancabilloni/SDC-Path-Planning | src/Eigen-3.3/bench/perf_monitoring/gemm/gemm.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <Eigen/Core>
#include "../../BenchTimer.h"
using namespace Eigen;
#ifndef SCALAR
#error SCALAR must be defined
#endif
typedef SCALAR Scalar;
typedef Matrix<Scalar,Dynamic,Dynamic> Mat;
EIGEN_DONT_INLINE
void gemm(const Mat &A, const Mat &B, Mat &C)
{... | TEST | 0.963626 | 5.689105 |
1a6bc11d-18ee-4c83-b3dc-68b9f7553990 | iamslash/learntocode | leetcode/ValidPalindromeII/a.cpp | #include <cstdio>
#include <string>
using namespace std;
// 64ms 57.32% 24.3MB 23.46%
// brute force
// O(N) O(1)
class Solution {
private:
bool palindrome(string s, int l, int r) {
while (l < r) {
if (s[l] != s[r])
return false;
l++, r--;
}
return true;
}
public:
bool validPal... | ALGO | 0.999978 | 6.121037 |
91e63aa9-432c-499f-a0d2-102c735da949 | RogerHideki/Maratona | leetcode/exs-14xx/leetcode-ex-1438.cpp | int xlr8 = []() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
return 0;
}();
class Solution {
public:
int longestSubarray(vector<int> &nums, int limit) {
int left = 0, right = 0, n = nums.size(), ans = 0;
priority_queue<int, vector<int>> maxPQ;
priority_queue<int, vector<in... | ALGO | 0.999997 | 5.248127 |
922e2184-fe7c-4702-8429-fd6d5f444c0c | AgrawalKashish/c-and-dsa | parameterizedcons.cpp | #include<iostream>
using namespace std;
class complex{
int a,b;
public:
complex(int , int);
void printnum(){
cout<<"Your no is "<<a<<"+"<<b<<"i"<<endl;
}
};
complex :: complex(int x, int y){
a = x;
b = y;
}
int main(){
int m,n,l,o;
cin>>m>>n>>l>>o;
complex c(m,n)... | TOOL | 0.913252 | 3.420811 |
91e2b9c0-e168-4326-9c2f-3ae550d7a68d | thesaravanakumar/projecteuler | tempCodeRunnerFile.cpp | #include <bits/stdc++.h>
#define ll long long int
#define w(t) int t; cin>>t; while(t--)
#define F first
#define S second
#define pb push_back
#define mp make_pair
#define pii pair<int,int>
#define mii map<int,int>
#defin... | ALGO | 0.999341 | 3.624349 |
988aad03-1274-4f63-9392-daf76b2d5840 | franfill1/training.olinfo.it-solutions | src/ois_cabala.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll be = 0;
ll N, M;
void calc(int i = 0, ll val=0, int l=0)
{
be = max(be, val);
if (i != N)
{
for (int c = 3; c <= 9; c+= 3) if (l != c)
{
ll nval = (val*10 + c)%M;
calc(i+1, nval, c);
}
}
}
void solve()
{
cin >> N >> M;
be = 0;
c... | ALGO | 0.998609 | 4.446229 |
7158a24d-8530-48b8-9d2b-58504e82f140 | kubagalecki/L3STER | benchmarks/Diffusion3DBenchmark.cpp | #include "Diffusion3D.hpp"
int main(int argc, char* argv[])
{
L3sterScopeGuard scope_guard{argc, argv};
solveDiffusion3DProblem< CondensationPolicy::ElementBoundary, OperatorEvaluationStrategy::GlobalAssembly >();
} | ALGO | 0.996041 | 3.961983 |
73d54143-1a93-49f6-9264-06f2938dd5d4 | max1337xyz/C-Exercicios | EX024.cpp | #include <iostream>
using namespace std;
int main(){
/*
Faa um Programa que leia trs nmeros e mostre o maior e o menor deles.
*/
int x,y,z;
cout << "Digite um nmero: " << endl;
cin >> x;
cout << "Digite outro numero: " << endl;
cin >> y;
cout << "Digite o ultimo numero: " << e... | ALGO | 0.98261 | 3.478384 |
31a3c2f2-078d-46e3-b908-71c319350dc6 | SR-Akash/Problem-Solving | Codeforces/Amusing Joke.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
string s,ss,sss;
cin>>s>>ss>>sss;
int l=s.length();
int ll=ss.length();
int lll=sss.length();
string sum=s+ss;
sort(sum.begin(),sum.end());
sort(sss.begin(),sss.end());
if(sum==sss)
cout<<"YES"<<endl;
else
... | ALGO | 0.999753 | 3.447202 |
2101e0bb-f981-49ce-aed3-c915a2c809cb | anshul31901/DSA_practice | Stack and queue/2696. Minimum String Length After Removing Substrings.cpp | class Solution {
public:
int minLength(string s) {
stack<char>st;
for(int i = 0;i<s.size();i++){
if(!st.empty()){
if(s[i]=='B'&&st.top()=='A'){
st.pop();
}
else if(s[i]=='D'&&st.top()=='C'){
st.p... | ALGO | 0.999858 | 6.155914 |
744c8037-9baf-4825-a9fd-1a1aa833b83b | Ed-Ko/LeetCode | 350. Intersection_of_Two_Arrays_II/solution(improved).cpp | class Solution {
public:
vector<int> intersect(vector<int>& nums1, vector<int>& nums2) {
vector<int> ans;
int dict[1001];
memset(dict, 0, sizeof(dict));
for(int i = 0 ; i < nums1.size() ; i++)
dict[nums1[i]]++;
for(int i = 0 ; i... | ALGO | 0.999959 | 5.447505 |
3066d8ed-19dd-4253-a149-fc8c8149c4d4 | programmingatgithub/Core-DSA | pattern12.cpp | /* wap to print below pattern
A A A A A
B B B B B
C C C C C
D D D D D
E E E E E
*/
#include <iostream>
using namespace std;
int main(){
int n;
cout<<"enter the value of n"<<endl;
cin>>n;
int row = 1;
while(row<=n){
int col = 1;
while(col<=n){
char ch = 'A' + row... | ALGO | 0.999807 | 3.950726 |
666c0542-8dea-4224-a98f-752f9344b79a | TulioAbreu/uri-online-judge | code/2058.cpp | #include <stdio.h>
int main(int argc, char const *argv[])
{
int sides;
scanf("%d", &sides);
printf("%d\n", sides-2);
return 0;
}
| ALGO | 0.981508 | 3.219047 |
013e2d50-4efd-48c5-94ec-c34d89daf46f | joan12222/algorithme | luogu/luogu-P5733.cpp | #include<bits/stdc++.h>
using namespace std;
string s;
int main(){
cin>>s;
for(int i=0;i<s.size();i++){
if('a'<=s[i]&&s[i]<='z') s[i]+='A'-'a';
}
cout<<s;
return 0;
}
| ALGO | 0.998586 | 4.113329 |
31b7c25b-1f5d-44c2-b87f-89cf2c59c08d | anna-kushnir/Algorithms_Design | Lab1_1/lab1_1.cpp | #include <iostream>
#include <string>
#include <fstream>
#include <vector>
#include <ctime>
using namespace std;
constexpr auto NUM_OF_FILES = 4;
// Сортування збалансованим багатошляховим злиттям.
int multiwayMerge(string, string);
// Створення масиву (вектору) назв файлів.
vector<string> createFileNames(string, int... | ALGO | 0.99874 | 4.33088 |
a95832cf-59bc-42e7-aab7-aa53cc9dc564 | firiexp/contest_log | yukicoder/443.cpp | #include <iostream>
#include <algorithm>
#include <iomanip>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <numeric>
#include <bitset>
#include <cmath>
static const int MOD = 1000000007;
using ll = long long;
using u32 = uint32_t;
using namespace std;
template<class T> constexpr T INF = ::nu... | ALGO | 0.999882 | 4.683909 |
d944ec76-a2f1-4872-a68d-32a22d32c5d1 | MarcosFelipeBC/competitive-programming | Gym Codeforces/2019-2020 ACM-ICPC Brazil Subregional Programming Contest/M - Maratona Brasileira de Popcorn.cpp | //https://codeforces.com/gym/102346/problem/M
#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
int vet[N];
int main(){
int n, c, t;
scanf("%d %d %d", &n, &c, &t);
int mx = 0;
for (int i=0; i<n; i++){
scanf("%d", &vet[i]);
mx = max(mx, vet[i]);
}
int lo = mx, hi = 1000000000, ans;
while ... | ALGO | 0.999985 | 3.782808 |
bc43d9cb-4a93-44a3-b621-3df367b282ce | Lord-Lava/DSA-CPP-Apna-College | Programs/5 Arrays/2 sortingAlgorithms/bubbleSort.cpp | //time complexity O(n^2).
#include<iostream>
using namespace std;
void bubbleSort(int n, int arr[]){
int counter=1;
while(counter<n){
for(int i=0;i<n-counter;i++){
if(arr[i]>arr[i+1]){
int temp = arr[i];
arr[i]=arr[i+1];
arr[i+1]=temp;
}
}
... | ALGO | 0.999771 | 4.702446 |
4b3bfefd-1e5c-4770-9566-0acabf83a48c | rohitspatil30/CPP_Notes | TLE/questions/A_Domino_piling.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define mod 1000000007
void solve()
{
int m, n;
cin >> m >> n;
cout << (m * n) / 2 << endl;
}
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
// #ifndef ONLINE_JUDGE
// freopen("inpu... | ALGO | 0.999883 | 5.346725 |
ec743760-56f3-4ad5-94e5-2bbe86cec4ac | ajioka2310/AtCoder | ABC/bk/abc119/d/main.cpp | // abc119 D - Lazy Faith
// abc120 D - Decayed Bridges
// abc126 E - 1 or 2
#ifdef DEFINED_ONLY_IN_LOCAL
#include "/workspaces/AtCoder-cpp-env-main/cpp-dump/cpp-dump.hpp"
// <次のセクションの内容はここに追加する>
#define dump(...) cpp_dump(__VA_ARGS__)
namespace cp = cpp_dump;
CPP_DUMP_SET_OPTION_GLOBAL(max_line_width, 80);
CPP_DUMP_SET... | ALGO | 0.999915 | 4.09254 |
7374c107-ca37-4108-b9b4-23b33b7a47f8 | crettit2003/frameworks_av_aicp-q | media/libstagefright/codecs/amrnb/enc/src/l_extract.cpp | /*
Filename: /audio/gsm_amr/c/src/l_extract.c
Date: 09/07/2000
------------------------------------------------------------------------------
REVISION HISTORY
Description: Updated template. Changed function interface to pass in a
pointer to overflow flag into the function instead of using a
... | ALGO | 0.994131 | 7.030549 |
8ec819c2-9f32-4f15-bb45-88246cca0607 | Divyanshu9794/GFG_POTD | Difficulty: Easy/Compare two fractions/compare-two-fractions.cpp | //{ Driver Code Starts
#include <iostream>
#include <regex>
using namespace std;
// } Driver Code Ends
class Solution {
public:
bool isDigit(char a){
if(a >= '0' && a <= '9') return true;
return false;
}
string compareFrac(string str) {
string arr[5];
int k = 0;
... | ALGO | 0.988676 | 6.010094 |
1269dfbd-4c34-40df-b01c-6d5dadefeef5 | tongtzeho/OpenJudge | 1426.cpp | #include <iostream>
#include <string>
using namespace std;
char answer[206][103]={0};
bool mem[206][103];
bool succeed=0;
bool find_answer(const int r,const int digit,const int modnum)
{
if(r==0||succeed)
{
succeed=1;
return 1;
}
if(digit>99||mem[r][digit])return 0;
answer[modnum][digit]='1';
answer[modnum... | ALGO | 0.999694 | 3.560102 |
ca8dbb38-5dc4-4342-8fbb-dd209d3441d3 | abhisheksaini63/My-All-DSA-Practice | FiboRecur - Copy.cpp | // C++ program to find the Nth Fibonacci
// number using Fast Doubling Method
#include <bits/stdc++.h>
using namespace std;
int a, b, c, d;
#define MOD 1000000007
// Function calculate the N-th fibanacci
// number using fast doubling method
void FastDoubling(int n, int res[])
{
// Base Condition
if (n == 0) {
res... | ALGO | 0.999978 | 5.891294 |
16b85708-df67-4fc9-aa5b-88e4337a5abc | devararendy/tcp_proxy | sdk/boost_1_77_0/libs/interprocess/example/doc_move_containers.cpp | int main ()
{
using namespace boost::interprocess;
//Typedefs
typedef managed_shared_memory::segment_manager SegmentManager;
typedef allocator<char, SegmentManager> CharAllocator;
typedef basic_string<char, std::char_traits<char>
,CharAllocator> MySh... | TEST | 0.85715 | 4.882582 |
d7338d1d-ff44-4772-b820-b4d7734a7675 | cybermayer/SZE_Programozas-GKLB_INTM114- | vizsgafeladatok_22_23_2/vizsgafeladat_2.cpp | /*
Írjon egy programot, amely 2 db felhasználói függvényt használ.
Az egyik az int beker(int be_tb[], int *min, int *max),
amely 10 db előjeles egész számot kér be úgy, hogy azokat egy tömbbe tárolja le.
A tömb hosszát szimbolikus állandóval állítsa be.
A tárolás csak akkor jöjjön létre, ha az alábbi feltételek teljes... | ALGO | 0.990529 | 4.049882 |
1827858c-7bd2-4c08-8252-7764122c0844 | mifozski/Hieroglyph3-mirror | Source/Matrix4f.cpp | //----------------------------------------------------------------------------------------------------
#include "PCH.h"
#include "Matrix4f.h"
//----------------------------------------------------------------------------------------------------
using namespace Glyph3;
//-------------------------------------------------... | ALGO | 0.949272 | 5.764407 |
7be56a4d-5bcd-446e-92ae-b22b9564d117 | Anik114911/XPSC_Batch_04 | Week 7/Day 4/Q.cpp | #include<bits/stdc++.h>
#define fst ios_base::sync_with_stdio(false), cin.tie(NULL),cout.tie(NULL);
#define ll long long
#define endl '\n'
using namespace std;
int main(){
fst
int t;
cin >> t;
while(t--){
int zero=0,one=0;
string s,st;
cin >> s;
int n = s.length();
... | ALGO | 0.999969 | 4.319038 |
2aa6161f-72c7-498f-8adc-1eb579526e9d | lu1and10/Ewald-Splitting-with-Prolates | src/gromacs/linearalgebra/gmx_lapack/slasdq.cpp | #include <cctype>
#include "../gmx_blas.h"
#include "../gmx_lapack.h"
void F77_FUNC(slasdq, SLASDQ)(const char* uplo,
int* sqre,
int* n,
int* ncvt,
int* nru,
... | ALGO | 0.999238 | 5.484285 |
bdbd66ac-cb2c-4ef3-a017-e5e73fc7f872 | Kasha/SharedMemoryComplexPythonArray | eigen/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_reductions_norm.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace std;
using namespace Eigen;
int main()
{
VectorXf v(2);
MatrixXf m(2,2), n(2,2);
v << -1,
2;
m << 1,-2,
-3,4;
cout << "v.squaredNorm() = " << v.squaredNorm() << endl;
cout << "v.norm() = " << v.norm() << endl;
cout << "v.lpN... | ALGO | 0.997669 | 4.03798 |
f0061345-acbb-482e-84f5-2c4ac4a1700b | Fisher87/leetcode | cplus/palindromePartition.cpp | // Time Complexity: average: O(n^2), worst: O(n^2 * 2^n)
// Space Complexity: average: O(1), worst: O(2^n)
class Solution {
public:
vector<vector<string> > partition(string s) {
const int n = s.size();
bool p[n][n];
fill_n(&p[0][0], n * n, false);
for (int ... | ALGO | 0.999942 | 5.97929 |
83e676fd-1c2a-4c0c-be15-6a032d62c9bb | mainul3195/All | 1/F_Three_Paths_on_a_Tree.cpp | #include <bits/stdc++.h>
using namespace std;
int n;
vector<vector<int>> adj;
vector<int> cost, visited, parent;
int max_cost = 0, farthest_node;
void dfs(int u, int cst = 0)
{
visited[u] = 1;
cst += cost[u];
if (cst > max_cost)
{
max_cost = cst;
farthest_node = u;
}
for (auto v ... | ALGO | 0.999708 | 4.039409 |
65ae09cd-05ab-45af-9d74-46688a3f2ec6 | ishandutta2007/codeforces | sakurakoujiruna/normal/630/O.cpp | #include <iostream>
#include <cmath>
#include <iomanip>
using namespace std;
const double Eps = 1e-8;
const double Pi = 4 * atan(1);
int sgn(double a, double b = 0.0)
{
a -= b;
if(a > Eps)
return 1;
if(a < -Eps)
return -1;
return 0;
}
struct Point
{
double x, y;
Point() { }
Point(double x, double y) : x(x... | ALGO | 0.999225 | 3.319348 |
5ab80124-fc73-44b9-80ed-ac62aaae937e | phUR99/ps | leetcode/240.search-a-2-d-matrix-ii.cpp | /*
* @lc app=leetcode id=240 lang=cpp
*
* [240] Search a 2D Matrix II
*/
// @lc code=start
/*
우상단에서 시작하는 이유
좌상단의 경우에는 이동할 방향의 결정이 힘듦(가능한 방향 모두 증가밖에 없기 때문에)
우상단의 경우에는 명확하게 정해져있음
왼쪽으로 갈 경우 반드시 작아지며
아래로 갈 경우에는 반드시 커지는 특성이 있음
*/
class Solution
{
public:
bool searchMatrix(vector<vector<int>> &matrix, int target)
... | ALGO | 0.999969 | 6.702463 |
51652fa5-646d-4799-8dfa-ed30b62da475 | AbdallahAlShibli/muscat_car_wash-main | 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.99887 | 6.783439 |
6c5f0ccd-bb77-4dc1-a7a5-ccec7630c2df | itsmona14/Placement-prep | Week 5/Anagram.cpp | https://practice.geeksforgeeks.org/problems/anagram/0
class Solution
{
public:
//Function is to check whether two strings are anagram of each other or not.
bool isAnagram(string a, string b){
int a_count[26] = {0};
for(int i = 0 ; i < a.length();i++){
a_count[a[i] - 'a']++;
... | ALGO | 0.999978 | 5.538501 |
0a6e4769-62ec-42ab-b3c9-fddd4a0018a4 | ZulfahmiCP/Competitive-Programming-Recources | Hackerrank/Data Structure/Array/Left_Rotation.cpp | #include <iostream>
#include <functional>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>
#include <iomanip>
#include <cstring>
#include <numeric>
#include <vector>
#include <string>
#include <array>
#include <cmath>
#include <queue>
#include <stack>
#include <tuple>
#include <deque>
#include <se... | ALGO | 0.999873 | 3.014169 |
46e0a804-7cd1-4ed2-a44f-5cf041065afe | neppiness/TIL | problem-solving/boj/dynamic-programming/11726-07-04-2022.cpp | #include <stdio.h>
#include <math.h>
int factorial(int no) {
if (no == 1) {
return 1;
}
return factorial(no - 1) * no;
}
int main() {
int n;
int result = 1; // base case
scanf("%d", &n);
for (int noOf2 = 1; noOf2 <= n / 2; ++noOf2) {
int no = n - noOf2 * 2;
result... | ALGO | 0.999984 | 4.916387 |
aa6e5fb9-2407-4b33-9f8e-16bb2b500c70 | TheFenrisLycaon/DSA-C-- | cp/CodeForces/0700-0799/765D.cpp | #include<cstdio>
#include<vector>
int main(){
long n; scanf("%ld", &n);
std::vector<long> f(n + 1, 0), g(n + 1, 0), h(n + 1, 0), vis(n + 1, 0);
long m(0);
for(int p = 1; p <= n; p++){
scanf("%ld", &f[p]);
if(f[p] == p){h[++m] = p; g[p] = m; vis[p] = true;}
}
bool possible(tru... | ALGO | 0.999918 | 3.611546 |
855d8d02-9405-417d-8f17-295b41a02a53 | lclpsoz/competitive-programming | ARCHIVE/2020-07-09-0614/279C.cpp | #include "bits/stdc++.h"
using namespace std;
////////////// Prewritten code follows. Look down for solution. ////////////////
#define x first
#define y second
#define len(x) ((int)(x).size())
using pii = pair<int, int>;
using ll = long long;
using llu = long long unsigned;
using ld = long double;
const ld EPS = 1e-9... | ALGO | 0.999999 | 4.12582 |
6077bf12-b964-4bbd-82d4-99f9df89e282 | raincross7/code-similarity | codes/train_code/problem178/problem178_92.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int a,b,c; cin >> a >> b >> c;
cout << (c == clamp(c,a,b) ? "Yes" : "No") << endl;
} | ALGO | 0.999905 | 3.689461 |
d3bfe2cf-a7bb-4cfd-b33f-ecb74399c501 | rekhaputrgulshan/Cpp-ke-Code | Pattern30.cpp | /*
ABCDE
ABCD
ABC
AB
A
AB
ABC
ABCD
ABCDE
*/
#include<iostream>
using namespace std;
int main(){
int i, j;
char ch;
for(i=5;i>=1;i--){
ch='A';
for(j=i;j>=1;j--){
cout<<ch;
ch++;
}
cout<<endl;
}
for(i=2;i<=5;i++){
ch='A';
for(j=i;j>=1;j--){
cout<<ch;
ch++;
}
cout<<endl;
... | ALGO | 0.999045 | 3.173828 |
67512bc7-0467-43f1-a417-2c460aff28b6 | ishandutta2007/codeforces | irkstepanov/normal/69/A.cpp | #include <iostream>
#include <string>
using namespace std;
int main()
{
int X = 0, Y = 0, Z = 0;
int n;
cin >> n;
while (n--)
{
int x, y, z;
cin >> x >> y >> z;
X += x, Y += y, Z += z;
}
cout << ((!X && !Y && !Z) ? "YES" : "NO");
} | ALGO | 0.999053 | 3.877245 |
8e58019d-3242-4cac-bb45-7988db67ce89 | zhelemishsh/oop | lab02/task02_v03/task02_v03/StringFunctions.cpp | #include <iostream>
#include <string>
#include <optional>
#include "Structs.h"
using namespace std;
optional<Args> ParseArgs(int argc, char* argv[])
{
if (argc != 3)
{
cout << "Invalid arguments count\n";
return nullopt;
}
Args args;
args.search = argv[1];
args.replace = argv[2];
return args;
}
string F... | TOOL | 0.856668 | 4.876729 |
857617b0-7ca5-45ba-9bd1-d7be58bee634 | davidjacobo/Competencias | UVA/pro11635.cpp | #include <cstdio>
#include <queue>
#include <vector>
#define MAX_N 10002
#define MAX_H 103
#define INF 2000000000
using namespace std;
typedef pair<int,int> ii;
typedef vector<ii> vii;
int hotel[MAX_H], distances[MAX_N];
bool reachable[MAX_H][MAX_H];
vii graph[MAX_N];
void clear(int V,int H){
for(int i=0;i<V;i++)
... | ALGO | 0.999891 | 3.890445 |
fc47cbd0-5a46-4d36-9bff-839acadb03a3 | xidianlina/cppprimer | chapter_09_13.cpp | #include<iostream>
#include<vector>
#include<list>
int main()
{
using namespace std;
list<int> list1(7, 8);
vector<int> vec2(5, 2);
vector<double> vec1(list1.begin(), list1.end());
vector<double> vec3(vec2.begin(), vec2.end());
vector<double>::iterator it1 = vec1.begin();
vector<double>::iterator it2 =... | TOOL | 0.960723 | 3.876905 |
d54c7425-fd61-4874-bdb3-9ca48a6ae090 | raincross7/code-similarity | codes/train_code/problem439/problem439_427.cpp | #include<bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rrep(i, a, b) for (int i = (a); i < (b); ++i)
#define PI acos(-1)
#define pcnt __builtin_popcountll
#define rng(a) a.begin(), a.end()
#define rrng(a) a.rbegin(), a.rend()
#define sz(x) (int)(x).size()
#define v(T) vector<T>
#define vv(T) v... | ALGO | 0.999967 | 4.022923 |
28f40657-7b70-4eda-a76e-1dd2bc425892 | Xambey/something | 2014/ivb-3-14/Alexandr-Pankratov/lab5.cpp | #pragma warning(disable : 4996)
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <string>
#include <vector>
typedef std::vector<std::vector<double>> matrix;
double
calculate(matrix mtx)
{
double sa = 0;
int count = 0;
for(auto x = mtx.begin(); x < mtx.end(); x++) {
for(auto y = x->begin(); y < x... | ALGO | 0.966328 | 3.589769 |
ad9b28df-256c-44f6-93ff-a630d05a2508 | SevenCoder03/UTH_IT | Programming_Techniques/Chapter_3/Mang1Chieu/Bai2/2g/main.cpp | #include <iostream>
using namespace std;
void nhap_Mang(int a[], int &n)
{
do
{
cout<<"\nNhap so phan tu: ";
cin>>n;
if(n <= 0 || n > 1000)
{
cout<<"So phan tu khong hop le. Xin kiem tra lai !\n";
}
}while(n <= 0 || n > 1000);
for (int i=0; i<n; i++)... | ALGO | 0.997635 | 4.425863 |
eedb1e90-dc20-4638-b146-8b57937e576b | Evertume/PP1 | assignment_4/H.cpp | #include<iostream>
#include<cmath>
using namespace std;
int main(){
int a,b,c,d,e;
c=0;
d=0;
cin>>a>>b;
int ar[a];
int arr[a][b];
for(int i=0;i<a;i++){
for(int j=0;j<b;j++){
cin>>arr[i][j];
c=c+arr[i][j];
}
ar[i]=c;
c=0;
... | ALGO | 0.999705 | 3.04308 |
3b534fb6-fa00-43e2-896c-9c088856dbf7 | Schtekt/AoC_solutions | C++/src/2024/Day14/Day14.cpp | #include "Day14.h"
#include <iostream>
#include <regex>
#include <array>
#include <thread>
AoCSolution_2024_14::AoCSolution_2024_14():
AoCDaySolution({"2024", "14"})
{}
std::string AoCSolution_2024_14::PartOne()
{
long long int givenWidth{101};
long long int givenHeight{103};
long long int timeToElapse{10... | ALGO | 0.999713 | 5.891131 |
cf098095-5345-4809-8f3b-057e4cddd4a8 | MalikZuraiz/Social-Fit | 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.9988 | 6.76073 |
9d4d9388-d142-4f5c-84f9-b30e7c62f3ee | Chen-Rong-Zi/Lectures | term1/hw/program_design/canteen.cpp | #include <iostream>
#include <assert.h>
using namespace std;
struct Node{
int cost;
Node *next; // 下一个节点
};
void print_node(Node *head) {
if ( (head == NULL) ) return;
while ( head != NULL ){
printf(" %d", head->cost);
head = head->next;
}
printf("\n");
return;
}
Node *arr... | ALGO | 0.999975 | 4.695615 |
889d4f5b-f409-4ed3-9cef-10e6f254be01 | daniellecox/oneapi-samples | DirectProgramming/DPC++/Jupyter/oneapi-essentials-training/08_DPCPP_Reduction/lab/reduction_custom_operator.cpp | using namespace sycl;
static constexpr size_t N = 256; // global size
static constexpr size_t B = 64; // work-group size
template <typename T, typename I>
struct pair {
bool operator<(const pair& o) const {
return val <= o.val || (val == o.val && idx <= o.idx);
}
T val;
I idx;
};
int main() {
//# setup... | ALGO | 0.99981 | 4.608659 |
dcf0f65e-f9d2-4345-bc98-d58374ff09e4 | kfazz/mame_brother_wp | src/devices/sound/sidvoice.cpp | #include "sid.h"
#include "sidenvel.h"
#include "sidw6581.h"
#include "sidw8580.h"
#include "sound/mos6581.h"
static uint8_t triangleTable[4096];
static uint8_t sawtoothTable[4096];
static uint8_t squareTable[2*4096];
static const uint8_t* waveform30;
static const uint8_t* waveform50;
static const uint8_t* waveform60... | TOOL | 0.961437 | 3.906626 |
abcd4ad8-b963-433a-a97d-88cbe701c615 | saumyasarawagi/Drone_Firmware | src/lib/pid/pid.cpp | /**
* @file pid.c
*
* Implementation of generic PID controller.
*
* @author Laurens Mackay <<EMAIL>>
* @author Tobias Naegeli <<EMAIL>>
* @author Martin Rutschmann <<EMAIL>>
* @author Anton Babushkin <<EMAIL>>
* @author Julian Oes <<EMAIL>>
*/
#include "pid.h"
#include <math.h>
#include <px4_platform_common/... | ALGO | 0.998212 | 6.514546 |
8d9f6674-abef-4ff3-9da7-a45c80526625 | code-fans/books-source | 数据结构/第4章 树/4.3对称二叉树/tree.cpp | //Գƶ
#include<bits/stdc++.h>
using namespace std;
const int MAXN=1000001;
int lson[MAXN],rson[MAXN],m,node[MAXN],ans=1;
bool OK=1;//ǽṹǷԳ
inline int Read() //ٶ
{
int x=0,f=1;
char ch=getchar();
for(; ch<'0' || ch>'9'; ch=getchar()) //getcharscanfԼʮ
if(ch=='-')
f=-1;
for(; ch... | ALGO | 0.999782 | 3.552127 |
b50818f3-f34e-4894-968f-a4e35368e784 | Domain-Cmap/assignments-day-1-to-day-9-Tamanna2323 | Day 2-22BCS13649/Easy/3.cpp | #include<iostream>
#include<vector>
using namespace std;
int calculatepoints(vector<string>& operations){
vector<int> scores;
int total = 0;
for(string operation : operations){
if(operation == "C"){
total -= scores.back();
scores.pop_back();
}
else if(opera... | ALGO | 0.999548 | 6.723827 |
8b48d37e-d8c5-42a1-95a5-ceab1cb44f67 | haomingbai/coding_practice | vjudge_659661/l.cpp | #include <iostream>
#include <cstddef>
#include <cstdint>
#include <vector>
#include <algorithm>
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
constexpr ull g = 1;
int main()
{
size_t z;
cin >> z;
while (z--)
{
ull k, n; // g indicates golden
cin ... | ALGO | 0.999757 | 4.085099 |
91d12c73-cad7-42c6-ae5c-62e7057bdd4f | ttportela/PCI | IP-01/ex23.cpp | // IP-01 Ex. 23 5 - 1700
#include <iostream>
int ehPrimo(int n);
int main() {
int n;
printf("-- Programa Primo 5-1700 --\n");
int i;
for (i = 5; i <= 1700; i++) {
if ( !ehPrimo(i) ){
printf("%d - NAO eh primo!", i);
} else {
printf("%d - EH Primo!!!", i);
... | ALGO | 0.998701 | 3.797568 |
72896d5c-0b23-4971-b8b2-e58280e210de | amrutapatil-63/CodeLibrary | rabin-karp.cpp | #include <bits/stdc++.h>
using namespace std;
#define d 256
void search(char pat[], char txt[], int q)
{
int M = strlen(pat);
int N = strlen(txt);
int i, j;
int p = 0; // hash value for pattern
int t = 0; // hash value for txt
int h = 1;
for (i = 0; i < M - 1; i++)
h = (h * d) % q;
// Calculate the hash v... | ALGO | 0.999934 | 4.759123 |
03bb089c-9aeb-495d-86a6-8eb3fdeab89b | onglu1/Mycode | luogu/P3201 [HNOI2009]梦幻布丁.cpp | #include <bits/stdc++.h>
#define ll long long
#define Mid ((l+r)>>1)
#define ull unsigned long long
using namespace std;
const int N=5e6+1009;
int read(){
char c;int num,f=1;
while(c=getchar(),!isdigit(c))if(c=='-')f=-1;num=c-'0';
while(c=getchar(), isdigit(c))num=num*10+c-'0';
return f*num;
}
int n,m,ans,f[N],c[N]... | ALGO | 0.999948 | 4.188078 |
5541ee33-4094-41ee-a56d-f5a9516d7ab3 | afterthat97/acm-solutions | POJ/1004.cpp | #include <iostream>
#include <cstdio>
using namespace std;
int main() {
double avg = 0, t;
for (int i = 0; i < 12; i++) {
cin >> t;
avg += t;
}
printf("$%.2f\n", avg / 12);
}
| ALGO | 0.996106 | 3.714515 |
adf76719-d52f-447a-a4d5-f1bcddf8e22a | its-hafsa04/Leetcode-problems | 2962-count-subarrays-where-max-element-appears-at-least-k-times/2962-count-subarrays-where-max-element-appears-at-least-k-times.cpp | class Solution {
public:
long long countSubarrays(vector<int>& nums, int k) {
int cnt = 0, ans = 0;
int maxN = *max_element(nums.begin(), nums.end());
int left = 0, n = nums.size();
for (int right = 0; right < n; ++right) {
if (nums[right] == maxN)
cnt++;... | ALGO | 0.999949 | 5.939907 |
546169c0-3e16-4686-b7ca-2f7c15472251 | zengtaoxian/linphone | submodules/externals/opencore-amr/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/src/dec_alg_codebook.cpp | /*
------------------------------------------------------------------------------
Filename: dec_alg_codebook.cpp
------------------------------------------------------------------------------
INPUT AND OUTPUT DEFINITIONS
------------------------------------------------------------------------------
FUNCTION DESCR... | ALGO | 0.999844 | 4.334398 |
8459e48c-3bba-452f-89ca-4966135c1706 | Aman-singhGEU/DAA | DAA_LAB/Week 6/biparite.cpp | #include<bits/stdc++.h>
using namespace std;
isBip(vector<vector<int>> graph, int n ,int src)
{
vector<int> color(n,-1);
color[src]=1;
queue<int> q;
q.push(src);
while(!q.empty())
{
int u = q.front();
q.pop();
if(graph[u][u]==1)
return false;
fo... | ALGO | 0.999902 | 4.694073 |
58e6a7d2-1ad6-4c9b-8628-44f310b6f3fa | kkt219a/OnlineJudge | BOJ/1016 - solution2.cpp | //백준 - 1016 - 제곱ㄴㄴ수
#include<iostream>
#include<math.h>
long long a,b,c,i=2,d,e; //a,b는 입력값, c는 스타트지점, i는 1을 제외한 제곱수라해서 2의제곱수부터 시작위해, e는 i*i 대체용,d는 제곱ㅇㅇ수
bool f[1000002]; // 공간절약을 위해 무조건 범위는 1000000안에 들어오니까.
int main(){
std::cin>>a>>b;
for(;i<=sqrt(b);i++){ //b까지 안보고 b의 절반까지만 봐도된다.
e=i*i;
if(a%e!=0){ // 시작지점이 안나... | ALGO | 0.999832 | 4.300987 |
9c54cf2a-7cc0-4233-9383-698b197366e9 | Qianhongbo/LeetCode | problems/526.beautiful-arrangement.cpp | /*
* @lc app=leetcode id=526 lang=cpp
*
* [526] Beautiful Arrangement
*/
#include <vector>
// @lc code=start
class Solution {
public:
int count{0};
std::vector<int> track;
std::vector<bool> used;
int countArrangement(int n) {
used.resize(n + 1);
backtrack(n);
return count;
}
void backtr... | ALGO | 0.999886 | 7.074549 |
ec62718f-4fed-41b1-a701-ab9fd3a3d9da | ojasvatomar47/usefuels | Graphs/depths.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
const long long int MOD = 1e9 + 7;
void depths(ll node, ll parent, vector<ll> &depth, vector<vector<ll>> &adjList)
{
for (auto &adjNode : adjList[node])
{
if (adjNode != parent)
{
depth[adjNode] = depth[node] +... | ALGO | 0.999798 | 5.140406 |
a805f8cc-1dab-4b43-bb09-15d7d8e06d0c | galaxyLi/leetcode | LRUCache.cpp | class LRUCache{
public:
LRUCache(int capacity) {
max_size = capacity;
cnt = 0;
}
int get(int key) {
unordered_map<int, list<pair<int, int> >::iterator >::iterator it = cache_map.find(key);
if (it != cache_map.end()) {
int val = it-... | ALGO | 0.997938 | 5.52871 |
ef9e4057-d498-4d94-b22e-294d33189187 | JonathonMacleod/Distributed-Game-Architecture | libs/BOOST1.82.0/libs/graph/example/csr-example.cpp | // Authors: Douglas Gregor
// Andrew Lumsdaine
#include <boost/graph/compressed_sparse_row_graph.hpp>
#include <string>
#include <boost/graph/iteration_macros.hpp>
#include <iostream>
#include <fstream>
#include <boost/graph/graphviz.hpp>
using namespace boost;
class WebPage
{
public:
std::string url;... | ALGO | 0.994045 | 6.397638 |
3f4f6d8a-e856-4bc9-8b9e-0d84c0fbf960 | IvanRenison/ProgrammingProblems | ICPC contests/Latin American Regional 2016-2017/C.cpp | // https://matcomgrader.com/problem/9281/counting-self-rotating-subsets
#include "bits/stdc++.h"
#define fst first
#define snd second
#define pb push_back
#define fore(i, a, b) for (ll i = a, gmat = b; i < gmat; ++i)
#define ALL(x) x.begin(), x.end()
#define SZ(x) ((ll)x.size())
#define mset(a, v) memset((a), (v), size... | ALGO | 0.999825 | 4.069062 |
389000d8-1442-4378-bdb6-342fa2a60f29 | paulocoutinhox/JoystickCocos2D-X | cocos2d/cocos/base/ccUtils.cpp | #include "base/ccUtils.h"
#include <cmath>
#include <stdlib.h>
#include "md5/md5.h"
#include "base/CCDirector.h"
#include "base/CCAsyncTaskPool.h"
#include "base/CCEventDispatcher.h"
#include "base/base64.h"
#include "renderer/CCCustomCommand.h"
#include "renderer/CCRenderer.h"
#include "renderer/CCTextureCache.h"
#... | TOOL | 0.932795 | 6.180718 |
393f7cc6-801e-4707-a5b6-2f33c3975fb3 | TheFenrisLycaon/DSA-C-- | cp/CodeForces/0800-0899/800A.cpp | #include <cstdio>
#include <vector>
bool check(const std::vector<double> &rate, const std::vector<double> &saved, const double &provided, double time){
double req(0.0);
for(long p = 0; p < rate.size(); p++){
if(saved[p] > rate[p] * time){continue;}
req += (rate[p] - saved[p] / time);
}
... | ALGO | 0.999944 | 3.843692 |
fbbe39f6-343f-47d4-97fa-46d17d4f7eac | dixonliang/CarND-EKF | src/kalman_filter.cpp | #include "kalman_filter.h"
using Eigen::MatrixXd;
using Eigen::VectorXd;
/*
* Please note that the Eigen library does not initialize
* VectorXd or MatrixXd objects with zeros upon creation.
*/
KalmanFilter::KalmanFilter() {}
KalmanFilter::~KalmanFilter() {}
void KalmanFilter::Init(VectorXd &x_in, MatrixXd &... | ALGO | 0.992262 | 6.397793 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.