uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
d4c33a8c-6877-42a7-a862-2591170e3b86 | oxygen-hunter/Flashboom | data/big-vul-100/add_attention_code/Mixtral/top0-100/maximum-value-sum-by-placing-three-rooks-ii-Solution.maximumValueSum/177789_DoS_Exec_Code_Overflow.cpp | poppler_page_prepare_output_dev (PopplerPage *page,
double scale,
int rotation,
gboolean transparent,
OutputDevData *output_dev_data)
{
CairoOutputDev *output_dev;
cairo_surface_t *surface;
double width, height;
int cairo_width, cairo_height, cairo_rowstride, rotate;
unsigned char *cairo_d... | ALGO | 0.996461 | 4.154824 |
2abf9815-0ced-4982-977b-83f6cb18966d | gnbrganchan/AtCoder | 20190810_ABC/C-GreenBin.cpp | #include<iostream>
#include <algorithm>
#include <functional>
#include<vector>
#include<unordered_map>
using namespace std;
int main(){
int flg;
long i,j,n,ans=0,len;
string s[100000];
vector<string> lst;
vector<int> count;
unordered_map<string,int> mp;
cin >> n;
for(i=0;i<n;i++){
cin >> s[i];
sort(s[i].begin(... | ALGO | 0.999781 | 3.993164 |
0d5763a4-1db2-45be-b376-826ad46abeb6 | earl1k/llvm-z80 | lib/CodeGen/MachinePostDominators.cpp | #include "llvm/CodeGen/MachinePostDominators.h"
using namespace llvm;
char MachinePostDominatorTree::ID = 0;
//declare initializeMachinePostDominatorTreePass
INITIALIZE_PASS(MachinePostDominatorTree, "machinepostdomtree",
"MachinePostDominator Tree Construction", true, true)
MachinePostDominatorTree... | ALGO | 0.992927 | 6.832297 |
92a85f34-1039-4867-99b3-dc90b4b7912f | raincross7/code-similarity | codes/train_code/problem166/problem166_448.cpp | #include <bits/stdc++.h>
#define F first
#define S second
#define MP make_pair
#define pb push_back
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define LCM(a, b) (a) / __gcd((a), (b)) * (b)
#define CEIL(a, b) (a)/(b)+(((a)%(b))?1:0)
#define ln '\n'
using namespace std;
using LL = long long;... | ALGO | 0.999923 | 3.934411 |
72653a53-aac3-45aa-8e61-cfe9ead1f39a | ishandutta2007/codeforces | arsijo/normal/707/C.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int ui;
typedef long double ld;
typedef pair<int, int> ii;
typedef pair<ii, ii> iii;
ll MOD = 1e9 + 7;
const ld E = 1e-7;
#define null NULL
#define ms(x) memset(x, 0, sizeof(x))
#ifndef LOCAL
#define end... | ALGO | 0.999963 | 3.825708 |
846d2eeb-5d35-4044-96db-d761cfee75d9 | kicho/mangos | dep/src/g3dlite/filter.cpp | /**
@file filter.cpp
@author Morgan McGuire, http://graphics.cs.williams.edu
@created 2007-03-01
@edited 2007-03-01
Copyright 2000-2007, Morgan McGuire.
All rights reserved.
*/
#include "G3D/filter.h"
namespace G3D {
void gaussian1D(Array<float>& coeff, int N, float std) {
coeff.resize(N);
flo... | ALGO | 0.998097 | 4.072642 |
5505c589-3ce8-4dd1-9287-df5a65d5f02e | mtariqsiddiqui/TemplatesComparison_Cpp_D | function_template.cpp | #include <iostream>
template <typename T>
T DoubleIt(T value)
{
return 2 * value;
}
int main()
{
std::cout << DoubleIt<int>(3) << std::endl;
std::cout << DoubleIt<double>(3.75) << std::endl;
return 0;
} | TOOL | 0.926132 | 6.919307 |
97d77a7f-fcae-45b3-8253-e9d7dfd0e0ab | RendyRishandiP/UTS-DASAR-PEMROGRAMAN | BAB 7/pencarian array.cpp | #include <iostream>
using namespace std;
int main()
{
int A[10];
int nilai;
cout<<"Nama : Rendy Rishandi P "<< endl;
cout<<"NIM : A2.1900147"<< endl<< endl;
cout<<"nilai pada : "<< endl<< endl;
for(int C=0; C<10; C++){
cout<<" Indeks ["<< C << "] = ";
cin>>A[C];
}
cout<... | ALGO | 0.996002 | 3.829762 |
2a500f2c-1d9b-4d89-8e97-b3e49243c0bf | matekdev/lean-engine | src/math/math.cpp | #include "math.hpp"
#define GLM_ENABLE_EXPERIMENTAL
#include <glm/gtx/matrix_decompose.hpp>
bool DecomposeTransform(const glm::mat4 &transform, glm::vec3 &translation, glm::vec3 &rotation, glm::vec3 &scale)
{
// From glm::decompose in matrix_decompose.inl
using namespace glm;
using T = float;
mat4 L... | ALGO | 0.972267 | 6.836263 |
eb1eef78-ed72-4742-b1cf-80647d73dcf5 | teratipallysaitej/NCRWORK1 | datastructures/assignment/Project3/Project3/postfixeval.cpp | #include<string>
#include<ctype.h>
using namespace std;
int main() {
stack<int> st;
queue<int> st1;
st.push(0);
string s;
cin >> s;
int c1, c2;
int i = 0;
for (i = 0; s[i] != '\0'; i++) {
if (isdigit(s[i])) {
int a = (int)s[i];
st1.push(a - 48);
}
else {
if (s[i] == '@') {
int sum = 0;
... | ALGO | 0.999875 | 3.805806 |
f1340638-0a0d-4d08-9a0e-427df6e5fce4 | gem5/gem5 | src/systemc/tests/systemc/misc/v1.0/dash0/pulse.cpp | /*****************************************************************************
pulse.cpp -- Implementation of the pulse generator.
Original Author: Ali Dasdan, Synopsys, Inc.
*****************************************************************************/
/*****************************************************... | TOOL | 0.906389 | 6.229115 |
8944f90d-32d1-4cbe-a494-eac19367aa17 | ahmedbadawihosny/Programming-And-Problem-Solving | Problem Solving/CodeForces/ICPC Assiut University Training Sheet/Newcomers/C++/I-Sheet #6-Math/G-Summation of its divisors.cpp | #include <iostream>
#include <cmath>
#define Code_acceleration ios::sync_with_stdio(false); cin.tie(nullptr);
#define ll long long
using namespace std;
int main() {
Code_acceleration
ll n,sum=0;
cin>>n;
for(ll i=1 ;i*i<=n ;i++){
if(n%i==0){
sum+=i;
if((n/i) != i)
sum+=(n/i);
... | ALGO | 0.999896 | 4.510806 |
12cde1c5-382e-4933-aa3b-6225acd3bdb1 | ishandutta2007/codeforces | ilya_msu/normal/379/B.cpp | #define _CRT_SECURE_NO_WARNINGS
#pragma comment(linker, "/STACK:128000000")
#define _USE_MATH_DEFINES
#include<iostream>
#include<vector>
#include<string>
#include<stack>
#include<algorithm>
#include<cmath>
#include<set>
#include<queue>
#include<sstream>
#include<utility>
#include<map>
#include<ctime>
#include<cstdio>
... | ALGO | 0.999928 | 3.210682 |
0565f2eb-a721-493e-9966-16d0280656f0 | Ad2710/cse205-ds | assignments/23.08.2023/118.cpp | vector<vector<int>> generate(int numRows) {
vector<vector<int>> pascal_triangle(1);
pascal_triangle[0].push_back(1);
vector<int> temp;
for(int i = 1; i < numRows; i++)
{
//first part
//pascal_triangle[i].push_back(1);
temp.push_bac... | ALGO | 0.999863 | 5.861761 |
d07b41b6-72d9-4841-a58d-a15866e1f051 | souravsuvarna/Codeforce | 31-60/Playing with Dice.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int a,b,a_win=0,draw=0,b_win=0;
cin>>a>>b;
for(int i=1;i<=6;i++){
if(abs(a-i)<abs(b-i))
a_win++;
else if(abs(b-i)<abs(a-i))
b_win++;
else
draw++;
}
cout<<a_win<<" "<<draw<<" "<<b_win<<endl;
return 0;
}
| ALGO | 0.999889 | 4.172445 |
09205994-0075-4783-995b-0678ddeddc7c | xilustat/Bayesian_marginal | C++ codes/TOP/TOP_LADBLSS/BVCUtilities.cpp | #include<RcppArmadillo.h>
#include<Rmath.h>
// #include<stdio.h>
#include"BVCUtilities.h"
// [[Rcpp::depends(RcppArmadillo)]]
using namespace Rcpp;
using namespace arma;
using namespace R;
//' @export
// [[Rcpp::export()]]
double rtnorm(double mu, double sigma){
double lower = -mu/sigma, ret, a, z;
if(lower <0){ ... | ALGO | 0.999443 | 5.833469 |
bc3dddd1-7c7c-43a8-8deb-f8ed0e190f1c | tonmoy197/Road_to_1400_on_Codeforces | B_Subsequence_Update.cpp | #include <bits/stdc++.h>
#include <ios>
using namespace std;
typedef long long ll;
int main()
{
int tt; cin >> tt;
while( tt -- ){
int n, l, r; cin >> n >> l >> r;
vector<ll> a(n), left, right, mid;
l--;
r --;
ll ans = 0;
for(int i = 0; i < n; i ++ ) {
cin >> a[i];
if(i < l) l... | ALGO | 0.99991 | 4.365953 |
ce131968-89cc-4dac-9558-8a620ad6e803 | jsh-me/cctv-detection | face_detect/samples/cpp/tutorial_code/ImgTrans/houghlines.cpp | /**
* @file houghclines.cpp
* @brief This program demonstrates line finding with the Hough transform
*/
#include "opencv2/imgcodecs.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/imgproc.hpp"
using namespace cv;
using namespace std;
int main(int argc, char** argv)
{
// Declare the output variables
... | ALGO | 0.985662 | 5.746509 |
991301e5-4bc1-46b3-a296-461f73fb37f6 | SuuTTT/acm | luogu/图的遍历/Milk_Visits_S.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i,j,k) for(int i = (int)j;i <= (int)k;i ++)
#define debug(x) cerr<<#x<<":"<<x<<endl
const int maxn=(int)1e6+5;
/*
树节点01染色
询问路径上是否有0 or 1
ana1:树链剖分 可做任意颜色
ana2:dfs+主席树 可做任意颜色
ana3:lca 差分 根到某点的1 or 0 数目,然后可求任意两点间1,0数目
ana4:反面考虑输出0的情况:并查集维护连通块,只有当所查询两点是同一连通块且连通块颜... | ALGO | 0.999963 | 4.278585 |
55d825e0-fa9c-43dc-a1f3-5ba2289cbb25 | aksamota/codechef-practice | LongChallenge/JUNE20B/Chef_and_Price_Control.cpp | #include <bits/stdc++.h>
using namespace std;
#define FOREACH(i, c) for (__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define FOR(i, a, n) for (register int i = (a); i < (int)(n); ++i)
#define FORE(i, a, n) for (i = (a); i < (int)(n); ++i)
#define Size(n) ((int)(n).size())
#define all(n) (n).begin(), (n... | ALGO | 0.999763 | 3.946535 |
53d1e03e-565b-4b85-8557-c71688544cea | Acver14/forCodingTest | before 2022.04.27/BaekJoon/Graph/C++/6087.cpp | //2021.12.02
#include<iostream>
#include<queue>
#include<vector>
using namespace std;
struct pos{
int x, y, dir, val;
}typedef pos;
int w, h;
char a[101][101];
int change[101][101];
int dx[] = {-1, 0, 1, 0};
int dy[] = {0, -1, 0, 1};
vector<pos> v;
bool isPossible(pos p){
if(p.x < 0 || p. y < 0 || p.x >= h |... | ALGO | 0.999984 | 4.077303 |
769c53e6-aaa7-4960-bff0-94cfd01cdd0b | nfrik/hardyplus | eigen-eigen-36bf2ceaf8f5/unsupported/doc/examples/PolynomialSolver1.cpp | #include <unsupported/Eigen/Polynomials>
#include <vector>
#include <iostream>
using namespace Eigen;
using namespace std;
int main()
{
typedef Matrix<double,5,1> Vector5d;
Vector5d roots = Vector5d::Random();
cout << "Roots: " << roots.transpose() << endl;
Eigen::Matrix<double,6,1> polynomial;
roots_to_mo... | TEST | 0.999016 | 4.73387 |
d6e326e5-9424-4654-b0bf-4e7f4215aa60 | mgh3326/python-for-coding-test | 13/5.cpp | #include <bits/stdc++.h>
using namespace std;
int n;
// 연산을 수행하고자 하는 수 리스트
vector<int> arr;
// 더하기, 빼기, 곱하기, 나누기 연산자 개수
int add, sub, mul, divi;
// 최솟값과 최댓값 초기화
int minValue = 1e9;
int maxValue = -1e9;
// 깊이 우선 탐색 (DFS) 메서드
void dfs(int i, int now) {
// 모든 연산자를 다 사용한 경우, 최솟값과 최댓값 업데이트
if (i == n) {
... | ALGO | 0.999923 | 5.147883 |
6679ea35-a0d5-4a00-a9f7-48c111c63a1f | AppleBoiy/competitive-contest-355 | src/fib.cpp | //
// Created by Chaipat Jainan on 29/2/2024 AD.
//
#include "fib.h"
ll fib(ll n) {
if (n <= 1)
return n;
ll a = 0, b = 1, c;
for (ll i = 0; i < n - 1; i++) {
c = a + b;
a = b;
b = c;
}
return c;
}
int main() {
ll n;
cin >> n;
cout << fib(n) % 8 << en... | ALGO | 0.999731 | 4.783575 |
e71a509a-6fc1-43c2-a1e6-1e859d3010d2 | learning-process/ppc-2025-threads | tasks/omp/naumov_b_marc_on_bin_image/src/ops_omp.cpp | #include "omp/naumov_b_marc_on_bin_image/include/ops_omp.hpp"
#include <algorithm>
#include <cstddef>
#include <random>
#include <utility>
#include <vector>
std::vector<int> naumov_b_marc_on_bin_image_omp::GenerateRandomBinaryMatrix(int rows, int cols, double probability) {
const int total_elements = rows * cols;
... | ALGO | 0.99403 | 6.727763 |
049a02a4-e0b5-4cb8-b981-11bb34121229 | danielkiselev/LeetCode_Submissions | 344-reverse-string/344. Reverse String.cpp | class Solution {
public:
void reverseString(vector<char>& s) {
for(int i = 0; i<(s.size()/2); i++){
char t0 = s[i];
char t1 = s[(s.size()-1)-i];
s[i] = t1;
s[(s.size()-1)-i] = t0;
}
}
}; | ALGO | 0.999578 | 5.974037 |
b891d886-d799-45fe-ab5b-9e792783b81e | ishandutta2007/codeforces | popovicirobert/normal/888/G.cpp | #include <bits/stdc++.h>
#define ll long long
#define lsb(x) (x & (-x))
using namespace std;
const int MAXN = (int) 2e5;
struct Trie {
Trie *son[2];
Trie() {
son[0] = son[1] = NULL;
}
}*root = new Trie;
void add(Trie *nod, int val, int bit) {
if(bit >= 0) {
int r = ((val & (1 << bit)... | ALGO | 0.999891 | 4.266303 |
35b3c54e-e68c-433c-b86e-55449ba04feb | wwww11114/XCPC_templete | src/数据结构/线段树/动态开点线段树.cpp | #include <bits/stdc++.h>
using i64 = long long;
constexpr int MAXN = 2E5;
template<typename Info, typename T = i64>
struct SegmentTree {
struct Node {
Node *l = nullptr;
Node *r = nullptr;
Info info;
};
T L, R;
Node *root = nullptr;
SegmentTree() = default;
Segment... | ALGO | 0.999553 | 4.375109 |
2906bc6c-0fd1-4927-91ac-6423fba05663 | miamiasheep/RNA-Secondary-Prediction | nussinov/rna_tools/tools/rna_alignment/utils/R2R.cpp | #include "stdafx.h"
#include "R2R.h"
// just for debugging the no-CFSQP case:
//#define DISABLE_CFSQP
// just for debugging the DISTRIBUTION settings
//#define DISTRIBUTION
#ifndef MAX_SOLVER_ITERS
#define MAX_SOLVER_ITERS 100000
#endif
//#define RNA_FONT_FACE AdobeGraphics::Font::DejaVuSansCondensed
#ifdef DISTRIB... | TOOL | 0.922558 | 3.753628 |
665801a4-4325-459e-8c01-d86275799331 | Richard-m-j/LeetCode | 1304-LongestHappyString/1304-LongestHappyString.cpp | // Last updated: 7/24/2025, 8:27:38 AM
class Solution {
public:
string longestDiverseString(int a, int b, int c) {
priority_queue<pair<int, char>> pq;
if (a > 0)
pq.push({a, 'a'});
if (b > 0)
pq.push({b, 'b'});
if (c > 0)
pq.push({c, 'c'});
... | ALGO | 0.999979 | 5.794876 |
66c0fdc5-e75a-41f7-8024-fe00762c3de6 | PaukIsUha/optimizing_formating_code | predictions/submissions-aizu-cot-gpt4/Codenet/p00009/516464819/response_3.cpp | #include <algorithm>
#include <cmath>
#include <iostream>
#include <vector>
using namespace std;
void sieve(int n, vector<int> &primes) {
vector<bool> v(n + 1, true);
for (int i = 3, end = sqrt(n); i <= end; i += 2) {
if (!v[i])
continue;
for (int j = i * i, skip = i * 2; j <= n; j += skip)
v[j]... | ALGO | 0.99981 | 4.070024 |
b5852024-6cc3-4f1a-9775-0ebc095a35f9 | NAchiket06/CP-Programs | cpp/geneticAlgo8Queen.cpp | #include<bits/stdc++.h>
using namespace std;
int getFitness(int arr[8])
{
int fitness = 0, sum = 0;
for (int i = 0; i < 8; i++)
{
sum = 7 - i;
for (int j = i + 1; j < 8; j++)
{
int ari= arr[i];
int arj = arr[j];
int x = ari + j-i,y = ari - j + i;... | ALGO | 0.99983 | 3.886529 |
77af0d61-25d5-43fb-829d-39729745a8f3 | fahadmubeen1/cpp_learning | C++_Concepts/concepts.cpp | #include <iostream>
#include <vector>
using namespace std;
/*
TODO
const function, arguments
exceptions
const pointer, pointer to a constant different
:: operator
C++11
C++14
C++17
*/
#define namepsace_ // #concept
/* A namespace is a declarative region that provides a scope to the iden... | TOOL | 0.896107 | 4.742985 |
861318d5-a90e-4dbb-8a90-ecd6277309b2 | harishkhope/Codes | Platforms/LeetCode/Arrays/018.Valid_Anagram.cpp | class Solution {
public:
bool isAnagram(string s, string t) {
if(s.size()!=t.size()){
return 0;
}
unordered_map<char,int >mp;
for(int i=0;i<s.size();i++){
mp[s[i]]++;
mp[t[i]]--;
}
for (auto it:mp){
if(it.second!=0){
... | ALGO | 0.999987 | 6.081096 |
4b316dee-dd4f-45a7-ae83-092b546ac335 | RodneyBaker/opentoonz-code | toonz/sources/toonz/metnum.cpp |
/*------------------------ modulo metnum.cpp --------------------------
* SCOPO
* Implementazione di alcuni algoritmi relativi a metodi numerici.
*
* Autore: P. Foggia (1991)
*---------------------------------------------------------------------*/
#include <math.h>
#include <float.h>
#include <stdlib.h>
#incl... | ALGO | 0.999747 | 5.6111 |
144901a7-8e7b-4ea6-b77e-1570f124279e | Sunny-Ho/ITSA2 | Maximun_Consecutive_sum.cpp | //連續最大子集
#include <iostream>
#include <stack>
#include <queue>
#include <cstring>
using namespace std;
int main(){
int in,tmp = 0,max = 0;
while(cin >> in){
tmp = tmp + in;
if(max < tmp){
max = tmp;
}
if(tmp < 0){
tmp = 0;
}
}
cout << max;
return 0;
} | ALGO | 0.99993 | 3.609191 |
210a98cd-e471-416f-8a02-49702e8ff217 | ameerkhan123ak/VisualStudioCode | Cplusplus/Data Structures/Graphs/BFSDisconnected.cpp | #include<bits/stdc++.h>
using namespace std;
class Graph
{
public:
int V;
vector<vector<int>> adj;
Graph(int V)
{
this->V = V;
adj.resize(V);
}
void addEdge(int u,int v)
{
adj[u].push_back(v);
}
void printAdjList(int v)
{
for(int i=0;i<adj.siz... | ALGO | 0.9999 | 5.115196 |
ed64ee79-e9be-4171-9000-0bd02c254846 | MisakiFx/C | C-twice/3月19/UPC.cpp | #include <stdio.h>
#include <math.h>
int main()
{
int x = 0,y = 0;//
long long upc;
long long temp = 10000000000;
int sum1 = 0,sum2 = 0;
int odd[10] = {0};
int even[10] = {0};
int end = 0;
printf("ʮһλ֣");
scanf("%lld",&upc);
if((upc / temp) > 9 || upc < 0)
{
printf("");
return 1;
}
for(int i = 0; i < ... | ALGO | 0.999567 | 3.066578 |
4107b861-f990-4d25-8ef2-beb47a99d771 | znxuz/leetcode | cpp/sortArrayByParityII/solution.cpp | // https://leetcode.com/problems/sort-array-by-parity-ii/
#include "helper.h"
using namespace std;
using namespace util;
class Solution
{
public:
// time: O(n)
// space: O(1)
vector<int> sortArrayByParityII(vector<int>& nums)
{
size_t n = nums.size();
size_t even = 0;
size_t odd = 1;
while (ev... | ALGO | 0.99997 | 5.689549 |
9554a22e-832d-4f24-a6e4-93d912f70997 | mkohlhaas/Professional-CPP-Edition-6 | No-Modules/Examples/Ch20/03_ModifyingAlgorithms/05_copy_backward.cpp | #include <algorithm>
#include <iostream>
#include <print>
#include <vector>
using namespace std;
// Function template to populate a container of ints.
// A constraint enforces that the container supports push_back(int).
template <typename Container>
requires requires(Container &c, int i) { c.push_back(i); }
void ... | ALGO | 0.999302 | 5.097958 |
11652acd-3614-4626-9023-5f5843c958a6 | boatinw99/CompetitiveProgramming | Codeforces/592D.cpp | #include<bits/stdc++.h>
using namespace std ;
const int N = 2e5+9 ;
vector<int> g[N],gt[N];
int depth[N],num_edges = 0 ;
bool clr[N];
int clear_edge(int u,int v)
{
int isclr = clr[u] ;
for(auto it:gt[u])
{
if(it!=v)
{
isclr=max(isclr,clear_edge(it,u));
}
}
if(iscl... | ALGO | 0.999637 | 4.314204 |
207d3d1c-f953-4109-9b72-cb045de416eb | Sazid99246/problem-solving | uVa/12468.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int x, y;
while (true)
{
cin >> x >> y;
if (x < 0 || y < 0)
{
break;
}
cout << min((y - x + 100) % 100, (x - y + 100) % 100) << endl;
}
return 0;
}
| ALGO | 0.999654 | 4.191945 |
e19d7dd0-b446-4981-868a-03c3a1b2bf98 | vnodpangul/LeetCode | 741-cherry-pickup/741-cherry-pickup.cpp | class Solution {
public:
int DFS(vector<vector<int>>& grid, int n, vector<vector<vector<vector<int> >>> &visited, int r1, int c1, int r2, int c2)
{
if(r1>=n || c1>=n || r2>=n || c2>=n || grid[r1][c1]==-1 || grid[r2][c2]==-1)
{
return INT_MIN;
}
if(visited[r1][c1... | ALGO | 0.999974 | 6.087863 |
da94f5c7-1e23-4e0b-a58b-cf878041f0c7 | shres58tha/ioe_study_codes-C-_COA_CG_etc | CG/2/2_1_0DDA.CPP | #include<stdio.h>
#include<conio.h>
#include<graphics.h>
#define round ( x ) ( ( int ) ( ( x ) +.5 ) )
#define abs ( x ) ( ( x>0 ) ? ( x ) : ( ( x ) * ( -1 ) ) )
void lineDDA ( int x1, int y1, int x2, int y2 ) {
int d_x, d_y, step ;
float x_incr, y_incr ;
d_x = x2-x1 ;
d_y = y2-y1 ;
step = ( abs ( d_x ) > = abs (... | ALGO | 0.994201 | 3.215651 |
5350afd2-a73c-466f-8bbb-28bcb3a0081b | blitzhosts/mangos | dep/src/g3dlite/MeshAlgWeld.cpp | #include "G3D/MeshAlg.h"
#include "G3D/Table.h"
#include "G3D/Set.h"
namespace G3D {
namespace _internal {
class Welder {
private:
// Intentionally illegal
Welder& operator=(const Welder& w);
public:
/** Indices of newVertexArray elements in <B>or near</B> a grid cell. */
typedef Array<int> List;
... | ALGO | 0.996385 | 6.909972 |
e524c3e4-e03b-4722-92a8-0a5c783708f5 | ChetanThorat18/LeetCode | Leetcode_Problems/1143-longest-common-subsequence/1143-longest-common-subsequence.cpp | class Solution {
public:
int longestCommonSubsequence(string text1, string text2) {
// Approach: Bottom-up DP (Tabulation)
int n = text1.size();
int m = text2.size();
// Create a 2D DP array to store the lengths of LCS for subsequences of text1 and text2
// dp[i][j] represe... | ALGO | 0.999925 | 7.202594 |
719e0d24-88e0-4652-9591-dfc4bf832dd4 | jameswenxuanlu0317/Bitcoin-Trade-Analysis | Bitcoin-Trade-Analysis-main/FINAL/project/src/main.cpp | #include "../include/Node.h"
#include "../include/Graph.h"
void DFSCall(Graph& g1) {
int counter = 0;
int v = 24186; //total number of vertices
std::vector<bool> visited(v, false); //visited vector for DFS
int id;
std::cout << "Enter the ID of the user: ";
std::cin >> id;
while (id < ... | ALGO | 0.993184 | 3.80985 |
7005c215-c815-42e0-bc91-8d743a0d1f61 | anurag-singh2001/My-DS-practice | Stack/reverse.cpp | vector<int> v;
vector<int> Reverse(stack<int> St)
{
if (St.empty())
return v;
v.push_back(St.top());
St.pop();
return Reverse(St);
} | ALGO | 0.997906 | 3.60699 |
d66cfcba-0faf-4625-99b7-f4fc36d232b5 | saftoes/pdce | Scripts/gen_input_fp.cpp | #include <iostream>
#include <fstream>
#include "Math/gfp.h"
#include "Processor/Buffer.h"
#include "Tools/ezOptionParser.h"
#include "Math/Setup.h"
using namespace std;
int main(int argc, const char** argv) {
ez::ezOptionParser opt;
opt.add(
"128", // Default.
0, // Required?
1,... | TOOL | 0.850149 | 4.427985 |
2b2df861-f65a-46ba-844d-6302d0638f49 | Saurabh2244/DSA-Problem-Solving | Binary Search/Peak Index in Mountain Array.cpp | // Approach==> It is strictly increasing then reach Maxima and then strictly decreasing
So we can apply Binary Search Algorithm
class Solution
{
public:
int peakElement(int arr[], int n)
{
// Your code here
int start=0;
int end=n-1;
int mid=start+(end-start)/... | ALGO | 0.999975 | 5.42714 |
f7240467-6468-4131-b225-f58342328c6c | NFU-OpenDataStructure/NFU-DS-ReferenceSolution | 0717/src/sigma.cpp | #include <iostream>
using namespace std;
int sigma(int n) {
if (n < 0)
throw "must be grater then or equal 0";
else if (n == 0)
return 0;
return n + sigma(n - 1);
}
int main() {
int n;
while (cin >> n, n) {
cout << sigma(n) << "\n";
}
return 0;
} | ALGO | 0.99636 | 4.980109 |
a1b1a0a9-6d4b-40c6-b2e8-6d82a405c110 | kamilszymczak1/my_solutions | cf/contests/1706/b.cpp | #include <cstdio>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <string>
#include <cstring>
#include <bitset>
using namespace std;
void TestCase() {
int n; scanf("%d", &n);
vector<vector<int>>v(n);
for(int i = 0; i < n; i++) {
int x; scanf("%d", &x)... | ALGO | 0.999924 | 4.480138 |
b8dc71b8-0110-4841-96a0-27d06a12b97b | smaah/HackerRankCodes | new_year_game.cpp | /*
* main.cpp
*
* Created on: Apr 20, 2017
* Author: sayed
*/
#include <iostream>
#include <string>
#include <vector>
#include <cstdlib>
#include <sstream>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
int main() {
int N = 0; // number of trials
int N_Array = 0; // len... | ALGO | 0.999333 | 4.321047 |
e331c111-934f-413a-824f-6f61b23fd1f4 | SouvikChoudhury360/DSA | LinkedList/partition.cpp | #include<bits/stdc++.h>
using namespace std;
struct ListNode {
int val;
ListNode *next;
ListNode(int x) : val(x), next(NULL) {}
};
class Solution {
public:
ListNode* partition(ListNode* head, int x) {
ListNode* small = new ListNode(-1);
ListNode* large = new ListNode(-1);... | ALGO | 0.999973 | 5.343854 |
8c34f395-5687-4420-b4ca-f2392fc720f3 | derfang/codes | cpp/serie 1/3_bagher_khasteh.cpp | // in this code we take 5 lines of string from the user and print the number of the lines that
// have certain sub-strings
#include <iostream>
#include <string>
using namespace std;
int main()
{
string str[5];
for (int i = 0; i < 5; i++)
{
getline(cin, str[i]);
}
for (int i = 0; i < 5; i+... | ALGO | 0.861047 | 3.102696 |
0f20b698-ebe1-4399-a8c8-c5a7fb23755b | Meantint/Baekjoon | Silver II/BOJ_15663/BOJ_15663.cpp | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
int n, m;
vector<int> info, comb;
vector<vector<int>> answer;
void DFS(int idx, vector<int> curInfo)
{
curInfo.push_back(idx);
if (curInfo.size() == m) {
answer.push_back(curInfo);
return;
}
int cSize = c... | ALGO | 0.999995 | 4.031894 |
776904ef-3556-4871-84a2-09f934804395 | Instantsages/Irish-Tune-Composer-Recognition | myenv/lib/python3.12/site-packages/sklearn/svm/src/liblinear/tron.cpp | #include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdarg.h>
#include "tron.h"
#ifndef min
template <class T> static inline T min(T x,T y) { return (x<y)?x:y; }
#endif
#ifndef max
template <class T> static inline T max(T x,T y) { return (x>y)?x:y; }
#endif
static void default_print(const char *buf)
{... | ALGO | 0.999718 | 5.836969 |
1beedc52-d5ce-4545-80ce-14ac10b77885 | Planet-Moon/AdaptiveFilter_Cpp | adaptive_lms/AdaptiveLMS.cpp | #include "AdaptiveLMS.h"
const double PI = std::acos(-1);
using namespace std::complex_literals;
AdaptiveLMS::AdaptiveLMS(unsigned int n, double mu):
Fir(n), mu(mu)
{
e = 0.;
y = 0.;
}
Vec AdaptiveLMS::filter(Vec b, Vec signal)
{
const int signal_dim = signal.size();
Vec result(signal_dim);
#... | ALGO | 0.996212 | 6.326521 |
3a51b18b-621a-4022-b198-307311b76b44 | Arbazabbas/GFG_code | Difficulty: Easy/Split Linked List Alternatingly/split-linked-list-alternatingly.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
struct Node {
int data;
struct Node* next;
Node(int x) {
data = x;
next = NULL;
}
};
// } Driver Code Ends
/*
struct Node
{
int data;
struct Node* next;
Node(int x){
data = x;
next = NULL... | ALGO | 0.9988 | 5.729787 |
c9c3ae10-d94c-4674-a2dc-936edbaaf9fb | bilityniu/3D-UIR | submodules/diff-gaussian-rasterization/third_party/glm/test/core/core_func_integer_find_msb.cpp | #include <glm/glm.hpp>
#include <cstdio>
#include <cstdlib> // To define "exit", req'd by XLC.
#include <ctime>
#define LE 1 // 1 for little-endian, 0 for big-endian.
int pop(unsigned x) {
x = x - ((x >> 1) & 0x55555555);
x = (x & 0x33333333) + ((x >> 2) & 0x33333333);
x = (x + (x >> 4)) & 0x0... | ALGO | 0.998672 | 3.620292 |
0b92ec8a-ea37-44f9-9d91-46e8c7eac8e3 | ngthanhtrung23/CompetitiveProgramming | codeforces/100889/B.cpp | #include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define inf 1000000005
#define all(a) (a).begin(), (a).end()
#define ms(a,x) memset(a, x, sizeof(a))
#define mod 1000000007
#define sz(a) ((int)(a).size())
template<class T> int getbit(T s, int i)... | ALGO | 0.99936 | 3.672405 |
6617da5f-86df-4462-8120-38d7ac6fbc83 | aniketyd/leetcode_solution | 312-burst-balloons/burst-balloons.cpp | class Solution {
public:
vector<vector<int>>dp;
int fun(vector<int>&nums,int i,int j){
if(j-i==1)return 0;
if(dp[i][j]!=-1)return dp[i][j];
int mi=0;
for(int k=i+1;k<j;k++){
mi=max(mi,fun(nums,i,k)+fun(nums,k,j)+nums[i]*nums[k]*nums[j]);
}
retur... | ALGO | 0.999995 | 5.489103 |
705441a4-1a02-4542-a00e-a8abc747155f | itzuditsharma/GFG-Solved | Difficulty: Medium/Delete all occurrences of a given key in a doubly linked list/delete-all-occurrences-of-a-given-key-in-a-doubly-linked-list.cpp | //{ Driver Code Starts
// Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
struct Node {
int data;
struct Node* next;
struct Node* prev;
};
void push(struct Node** head_ref, int new_data) {
struct Node* new_node = (struct Node*)malloc(sizeof(struct Node));
new_node->data = n... | ALGO | 0.999949 | 5.953022 |
47c456ff-0fd0-4db5-854a-a73784ed5c8d | xavi-silva/feup-da2 | dataStructures/Heap.cpp | #include "Heap.h"
// Index calculations
#define parent(i) ((i) / 2)
#define leftChild(i) ((i) * 2)
Heap::Heap() {
elems.push_back(0);
// indices will be used starting in 1
// to facilitate parent/child calculations
}
Heap::Heap(std::vector<int> v): Heap() {
// Add the elements to the vector without r... | ALGO | 0.998076 | 5.215495 |
0796e357-76a5-48e9-9544-9c9d144918f7 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_10958_2.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int t;
cin >> t;
for (int p = 1; p <= t; p++) {
int x1, y1, z1, x2, y2, z2;
cin >> x1 >> y1 >> z1 >> x2 >> y2 >> z2;
int ans = 0;
int t = min(z1, y2);
ans = t * 2;
... | ALGO | 0.999745 | 4.314701 |
768367f1-7c79-4f4a-b75b-9c124b074f23 | MANISHDUTT224/LeetCode | 1917-maximum-average-pass-ratio/1917-maximum-average-pass-ratio.cpp | class Solution {
public:
double maxAverageRatio(vector<vector<int>>& classes, int extraStudents) {
auto gain=[](double pass,double total){
return (pass+1)/(total+1)-(pass/total);
};
priority_queue<pair<double,pair<int,int>>> maxheap;
double ans=0;
for(auto it:clas... | ALGO | 0.999858 | 5.313336 |
75e6f6c2-ca69-4941-9fa7-385f778592ea | Fearycxy/lintcode | 140_Fast_Power.cpp | class Solution {
public:
/**
* @param a: A 32bit integer
* @param b: A 32bit integer
* @param n: A 32bit integer
* @return: An integer
*/
int fastPower(int a, int b, int n) {
// write your code here
long long ans = 1, tmp = a;
while (n != 0) {
if (n &... | ALGO | 0.999941 | 6.045547 |
bb53dc47-8462-4e7d-932c-271c092090d0 | usaidhahamed1011/Leetcode-Problems | 0400-nth-digit/0400-nth-digit.cpp | class Solution {
public:
int findNthDigit(int n) {
long long digitsize = 1;
int start = 1;
int count = 9;
while (digitsize * count < n) {
n -= (digitsize * count);
++digitsize;
start *= 10;
count *= 10;
}
start += (n - 1... | ALGO | 0.999914 | 6.779794 |
ab72e3f6-6183-4e8c-91ce-416b986cd8ad | simonpcook/or1k-llvm-project | libcxx/test/std/algorithms/alg.nonmodifying/alg.find.end/find_end_pred.pass.cpp | // <algorithm>
// template<ForwardIterator Iter1, ForwardIterator Iter2,
// Predicate<auto, Iter1::value_type, Iter2::value_type> Pred>
// requires CopyConstructible<Pred>
// Iter1
// find_end(Iter1 first1, Iter1 last1, Iter2 first2, Iter2 last2, Pred pred);
#include <algorithm>
#include <cassert>
#in... | TEST | 0.995947 | 6.196625 |
9dc821f7-aaeb-40c4-8b7a-851ddc16b3dd | MehdiHALA/MatrixVectorMultiplication | ttmat_omp.cpp | #include <cstdio>
#include <cstdlib>
#include <cstddef>
#include <cstring>
#include <omp.h>
#include "ttmat.h"
void loadTTMat(
char *fileName,
TTMat *mat)
{
FILE *file = fopen(fileName, "rb");
if (!file) { printf("ERROR: Unable to open the file %s.\n", fileName); exit(1); }
fread(&(mat->d), sizeof(mat->d... | TOOL | 0.990475 | 4.558494 |
ebe1e446-46b5-42aa-bcf8-604494d2b3c7 | nguyenhoang4875/CompetitiveProgramming | codejam/2023_r1/A.cpp | #include<bits/stdc++.h>
using namespace std;
int tcs;
int n = 9;
string s1, s2;
vector<bool> cnt(10);
unordered_map<char, int> mci;
vector<int> t(10, 0);
int preSum = 0;
int hv[10];
bool used[10];
bool found = false;
int check(char c, int i) {
int num = 0;
if(cnt[1] && cnt[2] && cnt[3]) num++;
if(cnt[4... | ALGO | 0.9999 | 3.871568 |
9acc3756-5b6b-416a-a35c-1e983098c959 | iut-ibk/DynaMind-ToolBox | DynaMind-Gui/src/3dparty/alglib/src/mlptrain.cpp | #include <stdafx.h>
#include "mlptrain.h"
static const double mindecay = 0.001;
static void mlpkfoldcvgeneral(const multilayerperceptron& n,
const ap::real_2d_array& xy,
int npoints,
double decay,
int restarts,
int foldscount,
bool lmalgorithm,
double wstep,
int maxits,
in... | ALGO | 0.999741 | 5.614877 |
d1ce038d-9792-4f9d-8b29-ff059414940f | atharv-bhadange/LeetCode | Medium/5_longestPalindrome.cpp | class Solution
{
public:
string longestPalindrome(string s)
{
int n = s.size();
vector<vector<bool>> dp(n + 1, vector<bool>(n + 1, 0));
int start = 0;
int end = 0;
for (int len = 0; len < n; len++)
{
for (int i = 0; i + len < n; i++)
{
... | ALGO | 0.999894 | 5.964225 |
0bebd89b-de4a-49bb-b129-83c53599b9c6 | prithvijitbasak/LeetCode-Solutions | 2161. Partition Array According to Given Pivot.cpp | //Editorial: Just use 3 vectors to store the values. TC: O(n) SC: O(3n)
class Solution {
public:
vector<int> pivotArray(vector<int>& nums, int x) {
vector<int> s,m,e;
int n=nums.size();
for(int i=0;i<n;i++)
{
if(nums[i]<x)
s.push_back(nums[i]);
... | ALGO | 0.999984 | 5.735847 |
d1fc890f-edc5-4ef7-904a-a430fe41647d | KetZuca/Arreglos | Ejercicio4/arrg4.cpp | //Escriba un programa que imprime cuál es el elemento mayor y menor de cada una de las filas de una matriz bidimensional N*M.
#include <iostream>
using namespace std;
int main() {
int f, c;
cout << "Indique el numero de filas\n";
cin >> f;
cout << "Indique el numero de columnas\n";
cin >> c;
i... | ALGO | 0.999738 | 3.315115 |
d0c76d29-ee4f-4f27-a11e-07168c6cb3dc | Roma-LP/MP | lab_2/LP_LAB-02/LP_LAB-02.03/Combi.cpp | // Combi.cpp
//#include "stdafx.h"
#include "Combi.h"
#include <algorithm>
#define NINF ((short)0x8000)
namespace combi
{
permutation::permutation(short n)
{
this->n = n;
this->sset = new short[n];
this->dart = new bool[n];
this->reset();
};
void permutation::reset()
{
this->getfirst();
};
__in... | ALGO | 0.999283 | 3.533675 |
27c7baae-27ff-44a9-8964-b62fbb8f61ff | VijayNegi/LeetHub | 1608-special-array-with-x-elements-greater-than-or-equal-x/1608-special-array-with-x-elements-greater-than-or-equal-x.cpp | class Solution {
public:
int specialArray(vector<int>& nums) {
int N = nums.size();
vector<int> freq(N + 1, 0);
for (int i = 0; i < N; i++) {
freq[min(N, nums[i])]++;
}
int numGreaterThanOrEqual = 0;
for (int i = N; i >= 1; i--) {
... | ALGO | 0.999917 | 6.071955 |
95fcf0bb-f669-44da-97eb-a83c1d709ebb | iamsatyamsaurav/DSA-cpp-codes | shortestCommonSupersequence.cpp | #include <bits/stdc++.h>
string shortestSupersequence(string a, string b)
{
int n=a.size();
int m=b.size();
//lcs code
vector<vector<int>>dp(n+1,vector<int>(m+1,0));
for(int j=0;j<=m;j++){
dp[0][j]=0;
}
for(int i=0;i<=n;i++){
dp[i][0]=0;
}
for(int i=1;i<=n;i++){
for(int j=1;j<=m;j++){
//match
if(a... | ALGO | 0.999972 | 4.534794 |
93da9094-5c1d-4432-8350-2da130cc6996 | raincross7/code-similarity | codes/train_code/problem133/problem133_226.cpp | #include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[])
{
double x1, x2, y1, y2;
cin >> x1 >> y1 >> x2 >> y2;
cout << fixed << setprecision(10) << sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2)) << endl;
return 0;
} | ALGO | 0.999553 | 3.938767 |
53980a30-603f-4989-8180-173c21799dd5 | takefekat/Competitive-programming | AtCoder/abc267/E/main.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using vll = vector<ll>;
using vvll = vector<vll>;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
void solve(long long N, long long M, std::vector<long long> A, std::vector<long long> ... | ALGO | 0.99971 | 4.132761 |
e68c9b0a-f043-49e7-8712-69c9da47642a | bhavdxt10/ardupilot1 | libraries/AP_Motors/AP_MotorsHeli.cpp | #include <stdlib.h>
#include <AP_HAL/AP_HAL.h>
#include "AP_MotorsHeli.h"
#include <GCS_MAVLink/GCS.h>
#include <AP_Logger/AP_Logger.h>
extern const AP_HAL::HAL& hal;
const AP_Param::GroupInfo AP_MotorsHeli::var_info[] = {
// 1 was ROL_MAX which has been replaced by CYC_MAX
// 2 was PIT_MAX which has been r... | TOOL | 0.883813 | 4.449623 |
266dd8cf-f350-4cd3-a984-7ef564d8ea96 | Bowie-State-University/CS-Courses | COSC214_Data_Structure/projects/Ch6_recursive/Ch6_ProgExercise5.cpp | //Chapter 6: Programming Exercise 5
#include <iostream>
using namespace std;
int sumArray(const int list[], int first, int length);
int main()
{
int list[10]={1,2,3,4,5,6,7,8,9,10};
int listB[1] = {5};
cout << "Sum list = " << sumArray(list,0,10) << endl;
cout << "Sum listB = " << sumArray(listB,0,1) << endl... | ALGO | 0.994402 | 4.798419 |
f62fe946-d491-43db-902e-c62293694316 | anmolalgorist7110/Interview-Prep | 0005-longest-palindromic-substring/0005-longest-palindromic-substring.cpp | class Solution {
public:
string longestPalindrome(string str) {
int n = str.size() ;
bool table[n][n] ;
memset(table , 0 , sizeof(table)) ;
// all substr of len 1
// are palindrome
int maxlen = 1 ;
for(int i=0 ; i<n; i++){
table[i][i] = true ;
... | ALGO | 0.999951 | 5.894389 |
869729a6-afd3-4d1e-95b3-f5151e3686c5 | 23f2002007/leetcode | solution/0000-0099/0003.Longest Substring Without Repeating Characters/Solution.cpp | class Solution {
public:
int lengthOfLongestSubstring(string s) {
int cnt[128]{};
int ans = 0, n = s.size();
for (int l = 0, r = 0; r < n; ++r) {
++cnt[s[r]];
while (cnt[s[r]] > 1) {
--cnt[s[l++]];
}
ans = max(ans, r - l + 1);
... | ALGO | 0.999953 | 6.068232 |
16cbacc2-4317-4a23-b267-3d8ca0eb1b4c | itlezy/eMule-mods-archive | eMule-0.50a-neomuleneomule_reloaded-fa3debb/crypto51/rsa.cpp | // rsa.cpp - written and placed in the public domain by Wei Dai
#include "pch.h"
#include "rsa.h"
#include "asn.h"
#include "oids.h"
#include "modarith.h"
#include "nbtheory.h"
#include "sha.h"
#include "algparam.h"
#include "fips140.h"
#if !defined(NDEBUG) && !defined(CRYPTOPP_IS_DLL)
#include "pssr.h"
NAMESPACE_BEG... | ALGO | 0.96775 | 7.822006 |
463a2820-a3da-4bb6-9581-4b49ed35742e | tigerccx/CSC8503-CompleteVersion | CSC8503/GameTech/AIMoveAround.cpp | #include "AIMoveAround.h"
#include "AIMoveAround.h"
#include "../CSC8503Common/StateTransition.h"
#include "../CSC8503Common/StateMachine.h"
#include "../CSC8503Common/State.h"
#include "../../Common/Maths.h"
#include "../../Common/Vector2.h"
AIMoveAround::AIMoveAround()
{
pathPoints.emplace_back(Vector2(0, 0));
pa... | ALGO | 0.974856 | 4.041695 |
d9eb7b5b-1eaf-47c7-8184-5a37337e23cc | rajanraj2/Codechef_Starters | Starters160/B.cpp | // https://www.codechef.com/problems/EQUATEST
#include <bits/stdc++.h>
using namespace std;
int main() {
int testCases;
cin >> testCases;
while (testCases--) {
int n, m;
cin >> n >> m;
string s, t;
cin >> s >> t;
int sCount = count(s.begin(), s.en... | ALGO | 0.999968 | 7.008839 |
8c20563c-9d6d-48cc-b5bc-58590a3d8e65 | Anurag29Nitrr/Leetcode-Solutions-Anurag | 0075-sort-colors/0075-sort-colors.cpp | class Solution {
public:
void sortColors(vector<int>& nums) {
int count=0;
int count2=0;
int count3=0;
for(int i=0;i<nums.size();i++){
if(nums[i]==0){
count++;
}
if(nums[i]==1){
count2++;
}
if(nums[i]==2){
count3++;
... | ALGO | 0.999815 | 5.39816 |
f350c4d0-5a78-423d-9115-d7a01605db39 | Xiaoliang1992/optimization_tools | src/problem.cpp | #include "problem.h"
#include "Eigen/src/Core/Matrix.h"
#include <cmath>
#include <cstddef>
using namespace std;
namespace optimization_solver {
static const double eps_value = 1e-8;
// base problem
Eigen::VectorXd Problem::GetDiffGradient(const Eigen::VectorXd &x) {
int size = x.size();
Eigen::VectorXd g = Eigen... | ALGO | 0.999845 | 6.148901 |
69ae3f94-a1f3-4dfb-8d40-19c2a4fe136f | EthanKim8683/High-School-Competitive-Programming | USACO/Guide/Silver/Binary Search/magic.cpp | #include <iostream>
#include <cstdio>
using namespace std;
using I = int;
using B = bool;
using S = string;
using C = char;
using Lli = long long int;
const I N = 1e5;
const I MAX = 2e9;
Lli tot1 = 0;
Lli tot2 = 0;
I x1, y1;
I x2, y2;
I n;
S s;
B tes(I len) {
Lli x = x1 + tot1 * len;
Lli y = y1 + tot2 * len;
... | ALGO | 0.999869 | 3.964711 |
973f0aa4-5515-4765-b84a-1c137a84a436 | yoonjaehee/STL-algorithm | src/graph/bak11404_floyd.cpp | #include <iostream>
#include <queue>
#include <algorithm>
#include <climits>
using namespace std;
#define MAX INT_MAX
int n,m,a,b,c;
int arr[101][101];
queue<pair<int,int>> q;
void floyd(){
for(int i=1;i<=n;i++){
for(int t=1;t<=n;t++){
for(int j=1;j<=n;j++){
if(arr[t][i] != MAX &... | ALGO | 0.99999 | 4.239672 |
34465a49-888c-4436-959f-a5de3bb14423 | ishandutta2007/codeforces | anta.baka/normal/758/D.cpp | #include <bits/stdc++.h>
using namespace std;
const long long inf = 1000LL * 1000 * 1000 * 1000 * 1000 * 1000;
int n;
string s;
int len;
long long dp[60];
long long toint(int l, int r) {
long long ret = 0;
for(int i = l; i <= r; i++)
ret = ret * 10 + s[i] - '0';
return ret;
}
int main() {
c... | ALGO | 0.999907 | 4.430684 |
0b50f002-e615-4bcd-a72d-70d214953527 | rohit0033/gfg_potd | Wifi Range/sol.cpp | //{ Driver Code Starts
//Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function Template for C++
class Solution{
public:
bool wifiRange(int N, string s, int X){
// code here
int freq[N+1]={0};
for(int i=0 ;i<N;i++){
if(... | ALGO | 0.998793 | 5.328419 |
508b89c1-a4d0-453c-8a0c-a5bf7fc33522 | yuhi-dev/AtCoder | tessoku/answer/codes/cpp/chap04/answer_A19.cpp | #include <iostream>
#include <algorithm>
using namespace std;
long long N, W, w[109], v[109];
long long dp[109][100009];
int main() {
// 入力・配列の初期化
cin >> N >> W;
for (int i = 1; i <= N; i++) cin >> w[i] >> v[i];
for (int i = 0; i <= N; i++) {
for (int j = 0; j <= W; j++) dp[i][j] = -1'000'000'000'000'000LL;
}
... | ALGO | 0.99999 | 4.682968 |
050437e5-a6d2-4bd1-b5b9-a79091c84e23 | KausBoss/CP-SubGrouped | roughCodes/Stock Span.cpp | /*
*/
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define vi vector<int>
#define pb push_back
#define fi first
#define si second
#define pii pair<int,int>
#define vii vector<pair<int,int>>
#define F(a,n) for(int i=0;i... | ALGO | 0.999944 | 3.719807 |
9480fb4c-ff93-4ffb-88f6-61f9cdc19e4c | Kishore-Gunda/Model_Predictive_Control | src/Eigen-3.3/failtest/fullpivqr_int.cpp | #include "../Eigen/QR"
#ifdef EIGEN_SHOULD_FAIL_TO_BUILD
#define SCALAR int
#else
#define SCALAR float
#endif
using namespace Eigen;
int main()
{
FullPivHouseholderQR<Matrix<SCALAR,Dynamic,Dynamic> > qr(Matrix<SCALAR,Dynamic,Dynamic>::Random(10,10));
}
| TEST | 0.86529 | 3.138753 |
77b696a0-7b19-487a-8b02-adcbd6c5843a | dhruv-yadav-nitj/striver-a2z-dsa-cpp | Step 03 ~ Arrays/33-LARGEST-SUBARRAY-WITH-ZERO-SUM.CPP | #include <bits/stdc++.h>
using namespace std;
// VERY GOOD PROBLEM (this approach is very handy in many other problems too)
class Solution {
public:
int maxLen(vector<int> &A, int n) {
// Your code here
unordered_map<int,int> mp ; int sum =0 , ans = 0 ;
for(int i = 0; i < n; i++) {
... | ALGO | 0.999911 | 5.470486 |
bd6064fb-a1f6-42d0-9e70-c1de98f1c932 | AshrafulHaqueToni/Lightoj-solution | lightoj 1109.cpp | #include<bits/stdc++.h>
using namespace std;
vector<int>arr;
int a[1001];
int num_divi(int n)
{
int count=1;
for(int i=2;i<=n;i++)
{
int c=0;
while(n%i==0)
{
c++;
n/=i;
}
if(c!=0){count=count*(c+1);}
}
return count;
}
int main()
{
... | ALGO | 0.999702 | 4.466213 |
07c43f32-d62d-4689-afb8-19aac9bd868f | YCHEN-NYU/LeetCodeProgramming | __581__shortestUnsortedArray.cpp | /*
581. Shortest Unsorted Continuous Subarray
Given an integer array, you need to find one continuous subarray that if you only sort this subarray in ascending order, then the whole array will be sorted in ascending order, too.
You need to find the shortest such subarray and output its length.
Example 1:
Input: [2, 6... | ALGO | 0.999819 | 5.301015 |
d4024679-9a25-422d-b46c-1b00a39ea576 | smallpiglet/CalcMath1 | CalcMath/CalcMath.cpp | // CalcMath.cpp : Этот файл содержит функцию "main". Здесь начинается и заканчивается выполнение программы.
//
#include <iostream>
#include <cmath>
#include <cstring>
#include <omp.h>
using namespace std;
const int n = 2;
const int m = 4;
void PrintMethodResults(double* y, double deltaT, string methodName)
{
cout ... | ALGO | 0.999891 | 5.000032 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.