uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
0206bfbe-f888-42dc-be1d-edcf04480a3a | AprilQx/Advanced-Computing | benchmark/heat_diffusion_benchmark_mpi.cpp | /**
* @file heat_diffusion_benchmark_optimised.cpp
* @brief Benchmark for 2D Heat Diffusion Simulation with multiple runs
*/
#include "../src/mpi/optimized_heat_diffusion_mpi.h"
#include <iostream>
#include <chrono>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <numeric>
#include <cmath... | TEST | 0.976194 | 6.982218 |
c4580788-98b7-42b4-ae0f-ca66e6c3aee4 | tmwilliamlin168/CompetitiveProgramming | IOI/02-Bus.cpp | /*
- Iterate over O(n^2) pairs (H1, H2)
- d1[i] and d2[i] are distances to the hubs
- Answer for a pair is max(max d1 + second max d1, max d2 + second max d2, max d1 + max d2 + d1[H2])
- If a, b connect to H1 where d1[a] <= d1[b], then there exists an optimal solution in which all i such that d1[i] <= d1[a] are con... | ALGO | 0.999969 | 4.840941 |
5ca0babb-7415-4009-a72d-e13f60559ef6 | Kamwing1992/mesa | src/intel/compiler/brw_vec4_cmod_propagation.cpp | /** @file brw_vec4_cmod_propagation.cpp
*
* Really similar to brw_fs_cmod_propagation but adapted to vec4 needs. Check
* brw_fs_cmod_propagation for further details on the rationale behind this
* optimization.
*/
#include "brw_vec4.h"
#include "brw_cfg.h"
#include "brw_eu.h"
namespace brw {
static bool
writemas... | ALGO | 0.993559 | 7.314183 |
aba9ae5d-b6d0-49e2-9dd3-98059ffbc503 | gjc2/libsnark_knn | libsnark/depends/libff/depends/ate-pairing/src/zm.cpp | #include "zm.h"
#include <cstdio>
using namespace mie;
#ifdef MIE_USE_X64ASM
#define XBYAK_NO_OP_NAMES
#include "xbyak/xbyak.h"
using namespace Xbyak;
#endif
/**
out[] = x[] + y[]
@note the sizeof out >= n
@return size of x[] + y[]
*/
static inline bool in_addN(Unit *out, const Unit *x, const Unit *y, size_t n)
{... | ALGO | 0.994481 | 5.789005 |
a246e3ea-2ea0-4de8-8605-25b8ef12ee64 | anandj123/algorithms | data_structure/count_inversion_bit.cpp | #include <bits/stdc++.h>
using namespace std;
class BIT{
private:
vector<int> bit;
int N;
public:
BIT(int n) {
for(int i=0;i<n;++i){
bit.push_back(0);
}
N = n;
}
int get_sum(int idx) {
int sum = 0;
while(idx >0){
sum += bit[idx];
... | ALGO | 0.999963 | 5.269359 |
2d42ef79-c7da-4756-bcb7-291442550d06 | hostmaria/mariacoin | src/sapling/sapling_operation.cpp | #include "sapling/sapling_operation.h"
#include "coincontrol.h"
#include "net.h" // for g_connman
#include "policy/policy.h" // for GetDustThreshold
#include "sapling/key_io_sapling.h"
#include "utilmoneystr.h" // for FormatMoney
struct TxValues
{
CAmount transInTotal{0};
CAmount shieldedInTotal{0};
... | TOOL | 0.938508 | 6.873517 |
386c3524-4cee-4a86-b079-d8e2ed496690 | yitianhao/gpu_sched_new | gpu-sched-centralcontrol/minor/boost_1_61_0/libs/hana/benchmark/count_if/execute.fusion.vector.erb.cpp | <% if input_size > 10 %>
#define FUSION_MAX_VECTOR_SIZE <%= ((input_size + 9) / 10) * 10 %>
<% end %>
#include <boost/fusion/include/count_if.hpp>
#include <boost/fusion/include/make_vector.hpp>
#include "measure.hpp"
#include <cstdlib>
namespace fusion = boost::fusion;
namespace hana = boost::hana;
int main () ... | ALGO | 0.946521 | 5.514898 |
560f8647-ddef-4863-8e09-a6a630248d86 | OceanMiki/C | 梯形面积/梯形面积/梯形面积.cpp | #include<stdio.h>
int main()
{
int a,b,c,s;
scanf("%d %d %d",&a,&b,&c);
s=((a+b)*(2*c/a))/2;
if(c>=100)
printf("%d\n",s);
else
printf("208\n");
return 0;
} | ALGO | 0.997833 | 3.297731 |
0c2db124-a18d-4da8-b1c0-72d2238e0cca | austinhle/cos526 | a3/src/render.cpp | // Source file for photonmap renderer
// This implementation is a simple raycaster.
// Replace it with your own code.
////////////////////////////////////////////////////////////////////////
// Include files
////////////////////////////////////////////////////////////////////////
#include <iostream>
#include <algorith... | ALGO | 0.975497 | 6.23164 |
1ec14a5e-ab87-4b78-9f9b-18938a784e7c | thegamer1907/Code_Analysis | contest/1542571855.cpp | #include <iostream>
#include <cstdio>
#include<list>
#include<iomanip>
#include<cmath>
#include<queue>
#include <functional>
#include<stdio.h>
#include<assert.h>
#include<stack>
#include<sstream>
#include <cstdlib>
#include<map>
#include<algorithm>
#include<iostream>
#include<set>
#include<utility>
#in... | ALGO | 0.998629 | 3.380577 |
8785eee0-12c3-47bd-8aef-0102628823c8 | qiyang0221/leetcode | Remove Duplicates from Sorted List II.cpp | /*
/*question:
/*Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list.
/*For example,
/*Given 1->2->3->3->4->4->5, return 1->2->5.
/*Given 1->1->1->2->3, return 2->3.
/*
/*solution:
/*עsorted listԿԲõڶַ¼ǰڵĵַͺ
/*sorted listmapȽϺãܴڸ
*/
//code:
#i... | ALGO | 0.999986 | 4.718347 |
be8a84ab-5f2d-4727-a9a5-5e3f37f2aabc | muhammad-umar-9/2nd_semester-OOPs-Coding | Pointers/Pass by refernce/string first and last occurence.cpp | #include<iostream>
using namespace std;
first_and_last_occurence(string w, char x , int *first , int *last)
{
//for first occurence
for(int i=0; i<w.size(); i++)
{
if(w[i]==x) //as our first matches with our character
{
*first=i; //assigned this to our pointer bucket
break;
}
}
//for last occu... | ALGO | 0.999873 | 4.62627 |
d7385d3e-7fec-4592-82e0-4d0671d1562c | Mdominykas/ICPC-team-reference | code/data-structures/sparse_table.cpp | #include<bits/stdc++.h>
using namespace std;
const int max_N = 1000003;
const int logn = 22;
int lookup[max_N][logn];
int loga[max_N];
void buildsparsetable(int N, int a[])
{
for(int i = 0; i < N; i++)
lookup[i][0] = a[i];
for(int j = 1; j < logn; j++)
{
for(int i = 0; i + (1<<j) <= N; i++)
lookup[i... | ALGO | 0.999854 | 3.833157 |
9d9ca0ee-4371-44b8-8351-e04190561dcd | dataluscorp/browser | gfx/skia/skia/src/opts/SkOpts_hsw.cpp | #if defined(__AVX2__)
#include <immintrin.h>
#include <stdint.h>
namespace hsw {
void convolve_vertically(const int16_t* filter, int filterLen,
uint8_t* const* srcRows, int width,
uint8_t* out, bool hasAlpha) {
// It's simpler to work with the out... | ALGO | 0.983046 | 6.500248 |
5c121740-3740-45ac-8276-0cff01abc388 | ishandutta2007/codeforces | jo_ulej/normal/1329/C.cpp | #include <iostream>
#include <iomanip>
#include <random>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <cmath>
#include <numeric>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <sstream>
#include <bitset>
#include <cassert>
#include <fstream>
#include <queue>
#define le... | ALGO | 0.999942 | 3.662174 |
3b77feec-85fa-44ef-bc27-2bd1c9443668 | ishandutta2007/codeforces | isonan/normal/708/E.cpp | #include <cstdio>
const int P=1000000007;
inline int mul(const int &a,const int &b){return 1ll*a*b%P;}
inline int sub(int a,const int &b){a-=b;return (a<0)?a+P:a;}
inline int add(int a,const int &b){a+=b;return(a>=P)?a-P:a;}
int qsm(int a,int b){
int ans=1;
while(b){
if(b&1)ans=mul(ans,a);
a=mul(a,a);
b>>=1;
... | ALGO | 0.999953 | 3.691111 |
e27df530-29f3-4cff-9e0d-a017bf163439 | aufanam/Competitive-Programming | Sugarcane_Juice_Business.cpp | #include <bits/stdc++.h>
#define ll long long
#define ld long double
#define itn int
#define ckmin(a, b) a = min(a, b)
#define ckmax(a, b) a = max(a, b)
#define all(x) (x).begin(), (x).end()
#define allr(x) (x).rbegin(), (x).rend()
#define mp(a, b) make_pair(a, b)
using namespace std;
const int MOD=1e9+7;
const int mod... | ALGO | 0.999654 | 5.084032 |
c9c28ee0-5a1d-4199-ba2c-e6d5e182daf7 | SHRI-RAM007/DSA | Function/26.cpp | #include <iostream>
using namespace std ;
void printCounting(int n){
for(int i =0 ;i<=n ;i++){
cout << i << " ";
}
cout << endl;
}
int main(){
int n;
cout<< "enter the value of n"<< endl;
cin>>n;
printCounting(n);
return 0;
} | ALGO | 0.993403 | 3.766676 |
25984fb9-c439-41b8-9bfb-e5aefd7e5294 | Peesiravit/-ENGCE117-Computer-Programming-for-Computer-Engineer | Home work/HW5/hw05-9-mid-point.cpp | #include <stdio.h>
int main() {
float x1, y1, x2, y2;
float mid_x, mid_y;
// รับพิกัดของจุด A
printf("Input A Point :\n");
scanf("%f %f", &x1, &y1);
// รับพิกัดของจุด B
printf("Input B Point :\n");
scanf("%f %f", &x2, &y2);
// คำนวณจุดกึ่งกลาง
mid_x = (x1 + x2) / 2;
mid_y... | ALGO | 0.999351 | 5.780907 |
0139fc53-248e-4278-95b5-cf371eaf6383 | Bhanupriya-art/DSA-Coding-Practice | Arrays ADT/Finding_Max_And_Min_In_Single_Scan.cpp | #include <iostream>
using namespace std;
void MaxAndMin(int A[], int n){
int max = A[0];
int min = A[0];
for(int i = 1; i < n; i++){
if(A[i] < min){
min = A[i];
}else if(A[i] > max){
max = A[i];
}
}
cout << "Minimun Element in the array is: "<<min<<en... | ALGO | 0.991202 | 4.061611 |
25251085-85f4-4e9b-b700-04e30423901b | flknwr/boost | libs/graph/test/clustering_coefficient.cpp | #include <iostream>
#include <boost/graph/undirected_graph.hpp>
#include <boost/graph/directed_graph.hpp>
#include <boost/graph/exterior_property.hpp>
#include <boost/graph/clustering_coefficient.hpp>
using namespace std;
using namespace boost;
// number of vertices in the graph
static const unsigned N = 5;
templat... | TEST | 0.943929 | 6.857328 |
cc483f36-a5d1-48fa-a22e-08091c40d318 | seopchan/CodingTest | 프로그래머스/lv1/176963. 추억 점수/추억 점수.cpp | #include <string>
#include <vector>
#include <unordered_map>
#include <iostream>
using namespace std;
vector<int> solution(vector<string> name, vector<int> yearning, vector<vector<string>> photo) {
unordered_map<string, int> um;
for (int i=0; i<name.size(); i++) {
um.insert({name[i], yearning[i]}... | ALGO | 0.996482 | 4.719811 |
5b78fe0b-8de3-45b2-8c9f-e4eb90c2b364 | Tinnerson/CompetitiveProgramming | Codeforces/0768A.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ar array
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
int n;
cin>>n;
int a[n];
for(int i=0; i<n; i++){
cin>>a[i];
}
sort(a, a+n);
int c=0;
for(int i=1; i<n-1; i++){
if(a[0]<a[i] && a[n-1]>a[i]){
c++;
}
}
cout<<c<<... | ALGO | 0.999939 | 4.114005 |
fcd99c50-795f-4f16-a648-141ac1d5f680 | gsaidschicchi/AED | ejercicios_resueltos/Bloque 5 - Arreglos o Vectores/Ejercicio 6 - Determinar_numero_arreglo equivale a la suma de los demas.cpp | /*6. Escribe un programa que defina un vector de nmeros y calcule si existe
algn nmero en el vector cuyo valor equivale a la suma del resto de nmeros
del vector.*/
#include<iostream>
#include<conio.h>
using namespace std;
int main(){
int numeros[5] = {1,2,3,4,10}; //Definimos un arreglo
int suma=0,mayor=0;
fo... | ALGO | 0.999034 | 3.744147 |
7e4b0417-1639-4636-b13c-8f940aeef44d | skylark-integration/skylark-98js | programs/calculator/mcalculator/engine/CalcManager/Ratpack/itransh.cpp | //-----------------------------------------------------------------------------
//
// FUNCTION: asinhrat
//
// ARGUMENTS: x PRAT representation of number to take the inverse
// hyperbolic sine of
// RETURN: asinh of x in PRAT form.
//
// EXPLANATION: This uses Taylor series
//
// n
// ___ ... | ALGO | 0.999102 | 4.351569 |
11c13804-dcf2-41b8-9f4d-9c25ee675cad | dongjaekim-hail/android_logging | 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 |
aad065a5-65a0-48ad-8527-34516dff1d56 | BigkoalaZhu/StBl | StructureGraphLib/Relink.cpp | #include <QStack>
#include "Relink.h"
#include "Scheduler.h"
#include "MinBall.h"
Relink::Relink(Scheduler *scheduler)
{
this->s = scheduler;
this->activeGraph = scheduler->activeGraph;
this->targetGraph = scheduler->targetGraph;
}
void Relink::execute()
{
// initial
constraints.clear();
foreach (Tas... | TOOL | 0.979659 | 4.47942 |
f8665604-4199-4df5-a2bd-3504784c062b | jjjasperd/Cpp-Primer-Exercise | Exercise6.47.cpp | #include <iostream>
#include <vector>
#define NDEBUG
using namespace std;
//using recursive to print the string v
void printv(vector<string>::iterator beg, vector<string>::iterator end){
#ifdef NDEBUG
cout<< "size of vector left:" << end-beg << endl;
#endif
if(beg != end){
cout << *beg << " ";
... | TOOL | 0.976606 | 4.49421 |
d73836b8-6c37-4996-96ef-aa06def8fc06 | cshanbo/leetcode | 375.guess_number_higher_or_lower_II.cpp | //coding:utf-8
/**********************************************
Program: 375 Guess number higher or lower II
Description:
Author: <EMAIL>
Date: 2016-08-25 13:49:19
Last modified: 2016-08-25 14:11:17
**********************************************/
#include <iostream>
#include <vector>
#include <algorithm>
#include <lim... | ALGO | 0.999871 | 4.63375 |
80d6ad20-a00e-4950-bde7-2bbd9f3269ee | PunnyOz2/POSN-Programming | Camp 2/3-5-2020/Picktwo.cpp | /*
TASK:
LANG: CPP
AUTHOR: Pun~
SCHOOL: CRU
*/
#include<bits/stdc++.h>
using namespace std;
int a[100100],l[100100],r[100100];
int main()
{
int q,sum=0,n,i,ans;
scanf("%d",&q);
while(q--){
scanf("%d",&n);
for(i=1;i<=n;i++){
scanf("%d",&a[i]);
}
sum... | ALGO | 0.999747 | 4.234318 |
731c552e-500b-49aa-ab66-e65a8df44cb5 | lammps-qmdff/lammps-qmdff | lammps-modified/src/fix_balance.cpp | #include <string.h>
#include <stdlib.h>
#include "fix_balance.h"
#include "balance.h"
#include "update.h"
#include "atom.h"
#include "comm.h"
#include "domain.h"
#include "neighbor.h"
#include "irregular.h"
#include "force.h"
#include "kspace.h"
#include "modify.h"
#include "fix_store.h"
#include "rcb.h"
#include "time... | ALGO | 0.990447 | 4.589404 |
7c121a35-bd96-4710-88ba-c6fb3f06a94d | OmarGamal10/leetcode-solutions | 77-Combinations.cpp | class Solution {
public:
void generateCombs(vector<vector<int>>&ans,vector<int>&curComb,int i,int n,int k){
if(curComb.size()==k){
ans.push_back(curComb);
return;
}
if(i>n){
return;
}
curComb.push_back(i);
generateCombs(an... | ALGO | 0.999971 | 6.126284 |
83cd9bb9-7f1f-4a61-b761-7163eed5bafe | Yawn-Sean/Daily_CF_Problems | daily_problems/2024/10/1004/personal_submission/cf922c_lyxxys.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int limi = 1e9;
void solve(){
long long n, k;
cin >> n >> k;
if (k > 1e7){
cout << "No\n";
return;
}
unordered_map <int,int> mps;
bool jg = 1;
for (int i = 1; i <= k; ++ i){
if (mps[n/i * i]){... | ALGO | 0.999952 | 4.367947 |
087b5725-6537-4667-a3b3-43172e6536d9 | ishandutta2007/codeforces | nikolapesic2802/normal/1401/A.cpp |
// Problem : A. Distance and Axis
// Contest : Codeforces - Codeforces Round #665 (Div. 2)
// URL : https://codeforces.com/contest/1401/problem/A
// Memory Limit : 256 MB
// Time Limit : 1000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container... | ALGO | 0.999931 | 4.017363 |
8ed38038-0460-44a1-91bc-12c5218f64bc | TheodorAraps/NTUA-Progamming-Techniques | Programs/lexicon/lexicon.cpp | #include <iostream>
#include <string>
using namespace std;
class lexicon {
public:
lexicon()
{
root = nullptr;
}
~lexicon();
void insert(const string &s)
{
}
int lookup(const string &s) const;
int depth(const string &s) const;
void replace(const string &s1, const string &s2);
friend ostream & operator <<... | TOOL | 0.916276 | 3.417092 |
42d3ee6b-a26a-43ef-a917-4acbd3e4462c | efdee1/fiixconn | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998733 | 6.76775 |
eb840629-e9f4-41a7-9d71-80bf56b06e6d | dev-marcos-2020/Reverse-Polish-Notation-Calculator-with-C-TCP | main.cpp | #include <iostream>
#include <stack>
#include <vector>
#include <cstring>
#include <cmath>
#define MX 10005
using namespace std;
char infix[MX], str[11];
stack <int> calc;
stack <char> operate;
vector <string> outputList;
bool isOperator(char ch) {
return (ch == '+' || ch == '-' || ch == '*' || ch == '/' || ch... | ALGO | 0.999967 | 4.37026 |
300dcf28-0260-4dd8-9708-6160f58191fb | anilpiparaiya/DSA-IN-C-plusplus | CSES-Solutions/Range Queries/Forest Queries II (1739)/rainboy.cpp | /*
https://cses.fi/problemset/task/1739
Forest Queries II
practice with Dukkha
*/
#include <stdio.h>
#define N 1000
int tt[N][N];
void update(int i, int j_, int n, int x) {
while (i < n) {
int j = j_;
while (j < n) {
tt[i][j] += x;
j |= j + 1;
}
... | ALGO | 0.999617 | 4.502029 |
76138c97-527b-4ebe-ab21-3fbfae2aaa3b | luqmanarifin/cp | TOKI Mirror Open Contest - BNPCHS Final 2018/h.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
int x[N], y[N];
vector<int> start[N];
int main() {
int t;
scanf("%d", &t);
for (int tt = 1; tt <= t; tt++) {
for (int i = 0; i < N; i++) start[i].clear();
int n;
scanf("%d", &n);
for (int i = 0; i < n; i++) {
scanf("%d... | ALGO | 0.999839 | 4.612817 |
f33a2674-9ec8-4536-b4ce-56487f7fe322 | xiyao696/zadania-informatyka-klasa-8 | zadania 1 temat algorytmy na liczbach naturalnych/cwiczenie 2.cpp | #include <iostream>
using namespace std;
int main(){
int a, b;
cout << "Wartosc a: ";
cin >> a; //podanie wartosci a
cout << "Wartosc b: ";
cin >> b; //podanie wartosci b
if (a % b == 0) //jezeli a jest podzielne przez b i nie rowna sie 0 to:
{
cout << "a jest podzielna przez b"; ... | ALGO | 0.99824 | 3.842224 |
49042c30-506b-43b1-b172-b79265036264 | sam5854/lc_submitter | C++/count-symmetric-integers.cpp | // Time: O(rlogr)
// Space: O(r)
// brute force, memoization
class Solution {
public:
int countSymmetricIntegers(int low, int high) {
const auto& check = [](int x) {
if (LOOKUP[x - 1] == -1) {
const auto& digits = to_string(x);
if (size(digits) % 2) {
... | ALGO | 0.999735 | 6.212062 |
a5e5913b-497c-4cb1-8331-ec98a7beefeb | raincross7/code-similarity | codes/train_code/problem138/problem138_48.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin >> n;
int arr[n];
int i;
int j;
int count = 0;
int check = 0;
for(i=0;i<n;i++)
{
cin >> arr[i];
}
for(i=n-1;i>=0;i--)
{
check = 0;
for(j=i-1;j>=0;j--)
{
if(arr... | ALGO | 0.999975 | 3.807242 |
7d378f7a-187f-4093-aefa-833393019073 | chetan0402/CodeForces | 1946/1946A.cpp | #include<iostream>
#include<algorithm>
using namespace std;
int arr[100000];
int n;
int med;
void solve(){
cin >> n;
med=(n + 1) / 2 - 1;
for(int i=0;i<n;i++){
int temp;
cin>>temp;
arr[i]=temp;
}
std::sort(arr,arr+n);
const int originalMed=arr[med];
int numberOfChan... | ALGO | 0.99966 | 4.954813 |
900e8d68-6972-4b18-9736-32ef5e5de086 | gyanprakash03/CPP-Repo | return_permutations.cpp | #include <string>
using namespace std;
// function to return all permutations possiblr from a given string
int returnPermutations(string input, string output[]){
if (input.length() == 0) {
output[0] = "";
return 1;
}
string smallOutput[10000];
int smallSize = returnPermutations(input.substr(1), small... | ALGO | 0.999851 | 4.740304 |
096db186-050c-47c8-b028-975ff23a1452 | ishandutta2007/codeforces | nebuchadnezzar/normal/993/D.cpp | #include "bits/stdc++.h"
#define ff first
#define ss second
#define szof(_x) ((int) (_x).size())
#define TASK_NAME ""
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int INF = 1e9 + 7;
const ll INFL = 1e18 + 123;
const double PI = atan2(0, -1);
mt19937 tw(960172);
ll rnd(ll x, ll y) { stat... | ALGO | 0.999951 | 3.353664 |
c840233c-0476-4829-a9c3-ef2cbd1d70bc | harshvarmora28/competitive_programming | crossmarket.cpp | // Author: Harsh Varmora
// Problem: Crossmarket
// Date: 21 August,2022
#include<bits/stdc++.h>
using namespace std;
#define gc getchar_unlocked
#define fo(i,n) for(int i=0;i<n;i++)
#define Fo(i,k,n) for(int i=k;k<n?i<n:i>n;k<n?i+=1:i-=1)
#define ll long long
#define si(x) scanf("%d",&x)
#define sl(x) scanf("%lld",&x... | ALGO | 0.99993 | 4.371762 |
2fb8d696-edea-4fa7-a727-cb166437aa6a | oliveras-waterloo/ERCL | cadical-dip/src/decompose.cpp | #include "internal.hpp"
namespace CaDiCaL {
void Internal::decompose_analyze_binary_chain (DFS *dfs, int from) {
if (!lrat)
return;
LOG ("binary chain starting at %d", from);
DFS &from_dfs = dfs[vlit (from)];
Clause *reason = from_dfs.parent;
/*
if (val (from) > 0) {
const unsigned uidx = vlit (fr... | ALGO | 0.999838 | 4.739787 |
9b57bb9e-60bd-49f7-9e94-1259bfe9da38 | hgtterry/OgreWin3D_Basic | Common_64/Bullet/Source/Bullet3Collision/BroadPhaseCollision/b3OverlappingPairCache.cpp | #include "b3OverlappingPairCache.h"
//#include "b3Dispatcher.h"
//#include "b3CollisionAlgorithm.h"
#include "Bullet3Geometry/b3AabbUtil.h"
#include <stdio.h>
int b3g_overlappingPairs = 0;
int b3g_removePairs =0;
int b3g_addedPairs =0;
int b3g_findPairs =0;
b3HashedOverlappingPairCache::b3HashedOverlappingPairCache... | TOOL | 0.9475 | 4.982692 |
be739c4a-6ced-4f06-bbb0-ee630e7fa883 | 1407050106/MyC-CodeAcc | 手写智能指针/writetpool.cpp | #include <thread>
#include <vector>
#include <queue>
#include <atomic>
#include <mutex>
#include <condition_variable>
#include <future>
#include <iostream>
#include <stdexcept>
#include <functional>
#include <unistd.h>
using namespace std;
#define MAX_NUMS 6
using task = function<void()>;
class pool{
private:
... | TOOL | 0.88423 | 3.738694 |
012df290-3ecd-4ee7-a9ae-7cc2093cfb50 | zyadhany/RoadToIcpc | Up_Solve/ICPC PSU/ECPC 24 WarmUp #3/E. Di-visible Confusion.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
#include <unordered_map>
#include <random>
#define ll int
#define ld long double
#define pl pair<ll, ll>
#define vi vector<ll>
#define vii vector<vi>
#define vc vector<char>
#define vcc vector<vc>
#define vp vector<pl>
#define mi map<ll,ll>
#define mc map<char,i... | ALGO | 0.999859 | 4.149277 |
d84d934d-cdc4-4e34-a16e-e868755c58ff | NanGongJin/Algorithm-Templates | Math/Number Theory/prime number/emirp.cpp | // 反素数
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll INF = 1e18;
// 求解约数个数为n的最小数
ll n, res = INF;
int prime[16] { 1, 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47 }; // prime[15]:第15个素数
// 法一:深度优先搜索
void dfs(int p, ll val, int num, int up) { // 该第p个素数,目前的值为val,约数个数为num,第p个素数最多up... | ALGO | 0.999876 | 4.484868 |
290691ea-5d19-4918-b85b-31bd4fd34e9d | yaswanth7842/CSA5194_CNS | HILL Cipher.cpp | #include<iostream>
#include<cstdlib>
#include<string>
using namespace std;
int main() {
unsigned int a[3][3] = {{6, 24, 1}, {13, 16, 10}, {20, 17, 15}};
unsigned int b[3][3] = {{8, 5, 10}, {21, 8, 21}, {21, 12, 8}};
int i, j, t = 0;
unsigned int c[20], d[20];
string msg;
system("cls");
... | ALGO | 0.999889 | 3.324889 |
206f1eb8-da28-4b77-8c6c-91e06d2571f0 | Melodiz/dailycode | HSE/ADS_contests/Trees/task_E.cpp | #include <iostream>
#include <vector>
#include <stack>
#include <algorithm>
#include <cstdint>
using namespace std;
struct TreapNode {
int key;
int priority;
int size;
TreapNode* left;
TreapNode* right;
TreapNode(int _key) : key(_key), priority(rand()), size(1), left(nullptr), right(nullptr... | ALGO | 0.999957 | 5.035529 |
9312fce9-2af7-40ba-912d-17853a79b535 | Vanshsaxena097/practice-cpp | pattern11.cpp | #include<iostream>
using namespace std;
int main(){
int n;
cin>>n;
for(int row=1; row<=n;row++){
for(int col=1;col<=row;col++){
cout<<"*";
}
for(int col=1; col<=n*2-2*row;col++){
cout<<" ";
}
for(int col=1;col<=row;col++){
cout<<"*"... | ALGO | 0.99991 | 3.789939 |
f5776477-6d86-4c5f-8f1f-f8fe591fe216 | kibongs/security_3team | Source/client/ALPR/libs/dependencies/tesseract/ccstruct/linlsq.cpp | #include <stdio.h>
#include <math.h>
#include "errcode.h"
#include "linlsq.h"
const ERRCODE EMPTY_LLSQ = "Can't delete from an empty LLSQ";
/**********************************************************************
* LLSQ::clear
*
* Function to initialize a LLSQ.
*****************... | ALGO | 0.989463 | 5.790992 |
c87ac1c5-6108-4c11-a664-32a72203ab5a | azdhafin/Data-Structure | code quiz.cpp | #include <stdio.h>
#include <stdlib.h>
//no 2
//no 3
struct Node
{
int data;
struct Node* next;
};
void sortedInsert(struct Node** head_ref, struct Node* new_node)
{
struct Node* current;
if (*head_ref == NULL || (*head_ref)->data >= new_node->data)
{
new_node->next = *head_ref;
*... | ALGO | 0.999984 | 4.693972 |
891426a8-8498-49eb-8543-8c6a5cea4168 | Zebulda/ani3d | vcl/shape/mesh/mesh_primitive/mesh_primitive.cpp | #include "mesh_primitive.hpp"
#include "vcl/math/math.hpp"
namespace vcl
{
std::vector<uint3> connectivity_grid(size_t Nu, size_t Nv, bool periodic_u, bool periodic_v)
{
std::vector<std::array<unsigned int,3> > triangle_index;
for(size_t ku=0; ku<Nu-1; ++ku) {
for( size_t kv=0; kv<Nv-1; ++kv) {
... | ALGO | 0.91011 | 4.119264 |
c06f4bcb-efd3-4c09-9511-eb55dfae7cb8 | inquaid/Solved-Problems | CODEFORCES/A_Dual_Trigger.cpp | #include <bits/stdc++.h>
using namespace std;
void solve();
int main()
{
int t;
cin >> t;
while (t--)
{
solve();
cout << endl;
}
}
void solve()
{
int n;
string s;
cin >> n >> s;
int cnt = count(s.begin(), s.end(), '1');
if (cnt == 2)
{
for (int i = ... | ALGO | 0.999989 | 4.835885 |
a0522e1d-c59b-4c5c-b1d6-a460f6c25ae0 | colinyoyo26/mlir-standalone-toy | mlir/lib/Dialect/SCF/Transforms/LoopSpecialization.cpp | #include "PassDetail.h"
#include "mlir/Dialect/Affine/IR/AffineOps.h"
#include "mlir/Dialect/SCF/Passes.h"
#include "mlir/Dialect/SCF/SCF.h"
#include "mlir/Dialect/StandardOps/IR/Ops.h"
#include "mlir/IR/AffineExpr.h"
#include "mlir/IR/BlockAndValueMapping.h"
using namespace mlir;
using scf::ForOp;
using scf::Parallel... | TOOL | 0.910934 | 7.458117 |
054d9ee3-1c0c-4f15-9879-9b8d64d49fee | Extrafly1/Lagrange-interpolation-cpp | ConsoleApplication3/ConsoleApplication3.cpp | #include <windows.h>
#include <iostream>
#include <cmath>
#include <conio.h>
#include <stdlib.h>
float f0(float x) {
return sin(x);
}
float f1(float x) {
return cos(x);
}
float f2(float x) {
return x * x;
}
float f3(float x) {
return x * x * x;
}
float f4(float x) {
if (x == 0) return 0;
return... | ALGO | 0.993613 | 3.882331 |
dfbf70c5-5c9b-4b88-9b08-f138c20203d5 | kennent/for_scsc_code_save2 | atcoder/ABC378/b.cpp | #include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using pii = pair<int, int>;
int n, r[101], q[101], Q;
int main() {
ios::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
cin >> n;
for (int i = 1; i <= n; i++) cin >> r[i] >> q[i];
cin >> Q;
while (Q--) {
int t,... | ALGO | 0.999861 | 3.68963 |
ba4b15bf-e24d-464c-826a-6847dc282c75 | mohsystem/llm-generated-code-c-cpp | tests/gemini/Task171/Task171_test.cpp | #include <iostream>
#include <vector>
using namespace std;
// الحل brute-force كما هو
class Solution {
public:
int reversePairs(vector<int>& nums) {
int n = nums.size();
if (n <= 1) return 0;
int count = 0;
for (int i = 0; i < n - 1; i++) {
for (int j = i + 1; j < n; j++... | ALGO | 0.999866 | 5.920509 |
131f55fe-5d22-4b1d-9144-e89d49157b2e | ishandutta2007/codeforces | internetperson10/normal/1626/A.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
while(t--) {
string s;
cin >> s;
sort(s.begin(), s.end());
cout << s << '\n';
}
} | ALGO | 0.999917 | 4.907907 |
0180233f-7b2a-4630-a0c2-235d5499f48c | MarkTheIronMan/oop | lab1/flipbyte/flipbyte.cpp | // flipbyte.cpp : Этот файл содержит функцию "main". Здесь начинается и заканчивается выполнение программы.
#include <iostream>
#include <optional>
#include <string>
using namespace std;
optional<uint8_t> ParseArg(int argc, char* argv[])
{
if (argc != 2)
{
cout << "Incorrect number of arguments" << endl;
retur... | TOOL | 0.936479 | 6.335932 |
340f7ede-0245-42b2-af7b-554a05f0cda1 | phuang1024/piano_video | src/pvkernel/addons/glare/glare.cpp | #include <algorithm>
#include <cmath>
#include <iostream>
#include "../../pvutils.hpp"
/**
* Render the glare on an image.
* @param img Image.
* @param width height: Image dimensions.
* @param intensity Glare intensity factor.
* @param radius Glare radius.
* @param notes Array of notes to add glare to (0 is lowe... | TOOL | 0.933993 | 6.357579 |
f9410607-0517-4eaf-9460-4d86873c7dd8 | NestZ/competitive-programming | AtCoder/WeLikeAGC.cpp | #include<bits/stdc++.h>
using namespace std;
#define endl '\n'
typedef long long int ll;
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c... | ALGO | 0.999956 | 4.561381 |
09a588ba-41c4-4541-b3ef-bb805fe046a1 | millaker/MiGPU-llvm-project | libcxx/test/std/algorithms/alg.modifying.operations/alg.remove/ranges_remove_copy_if.pass.cpp | // UNSUPPORTED: c++03, c++11, c++14, c++17
// <algorithm>
// template<input_iterator I, sentinel_for<I> S, weakly_incrementable O,
// class Proj = identity, indirect_unary_predicate<projected<I, Proj>> Pred>
// requires indirectly_copyable<I, O>
// constexpr remove_copy_if_result<I, O>
// remove_copy... | TEST | 0.941182 | 7.900578 |
66f4b1b0-72e5-4045-881f-12a576a5d826 | csbyun-data/CPP-Pro | chap05/sort/sort2_02.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
vector<int> coll;
vector<int>::iterator pos;
// insert elements from 1 to 6 in arbitrary order
coll.push_back(2);
coll.push_back(5);
coll.push_back(4);
coll.push_back(1);
coll.push_back(6);
... | ALGO | 0.998218 | 4.550261 |
875a7d71-70b0-4eb4-b1e2-93d3c733b491 | Sahilsharma500/CPP | prefixsum/Array-manipulation.cpp | /*
✅ Problem: Array Manipulation (HackerRank)
🔍 Intuition:
Naively updating ranges in the array leads to TLE for large inputs.
So, we use a **Prefix Sum Optimization** technique:
- For a query (a, b, k), instead of adding `k` to each index from a to b,
we:
- Add `k` at index `a`
... | ALGO | 0.999906 | 6.162564 |
b3b3c1cf-2465-45ac-afee-f29e4c1ca5a6 | harshulmalhotra/100DaysOfCode | Day1/fibonacci.cpp | #include<iostream>
using namespace std;
int main(int argc, char** argv){
int n ;
cout << "enter limit";
cin >> n;
int a = 0;
int b = 1;
int c = 0;
for(int i =0 ; i<n ; i++){
cout << a << " " ;
c = a+ b ;
a = b;
b = c;
}
}
| ALGO | 0.999858 | 3.170316 |
2c0edcc3-e785-436e-9ef0-f9e96df2c041 | ManthanNagose/DSA-Problems | 10-logical Problems/00-water_bottle.cpp | #include<iostream>
using namespace std;
class Solution
{
public:
int numWaterBottles(int numBottles, int numExchange)
{
int temp = numBottles;
// cout << "Number of Bottle at initial are : "<< numBottles << endl;
while ( numBottles >= numExchange)
{
... | ALGO | 0.999401 | 4.597348 |
ca84ba0f-96f0-417c-8bc8-ad90536bf7e7 | bharatr21/leetcode-problems | 3434-find-the-number-of-distinct-colors-among-the-balls/3434-find-the-number-of-distinct-colors-among-the-balls.cpp | class Solution {
public:
vector<int> queryResults(int limit, vector<vector<int>>& queries) {
vector<int> res;
unordered_map<int, int> freq, balls;
int n = queries.size();
for(int i = 0; i < n; i++) {
int x = queries[i][0], y = queries[i][1];
if(balls.count(x))... | ALGO | 0.999952 | 5.887061 |
342aadeb-1278-400d-8cd3-8379d69417fe | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_10759_5.cpp | #include <bits/stdc++.h>
using namespace ::std;
const int MASK = 1 << 15;
const int inf = 1e9;
const int N = 15 + 5;
int n;
int m;
int len;
int v[N];
int deg[N];
int d[N][N];
int memo[MASK];
bool vis[MASK];
int DP(int mask) {
if (mask == 0) return 0;
if (vis[mask]) return memo[mask];
int ans = inf;
int p1 = 31 ... | ALGO | 0.999927 | 4.019806 |
edbeee58-a8d6-4e55-8abe-e9f00b5666bf | guangzq/CLearn | cplusplus/test_method.cpp | //
// Created by qiguang.zhu on 2020/9/23.
//
#include <iostream>
#include <cstring>
using namespace std;
/**
* 反转字符串
* @param a 原字符串
* @param b 反转后的字符串
* @return
*/
int reverse(char a[], char b[]) {
int n = strlen(a);
int i = 0;
while (a[i] != '\0') {
b[n - i - 1] = a[i];
i++;
}
... | ALGO | 0.999832 | 4.31801 |
a231b4e6-8249-4b8f-a5ab-45a742d99185 | EstelleRD/NetworkCodeEstelleRD | src/simulation.cpp | #include "random.h"
#include "simulation.h"
#include "network.h"
#include <iostream>
Simulation::Simulation(Network *_net) : _network(_net), stepnum(10) {}
void Simulation::initialize(int argc, char **argv) {
TCLAP::CmdLine cmd("Network simulation");
TCLAP::ValueArg<int> argNode("n", "nodes", "Number of nodes... | ALGO | 0.998184 | 5.064651 |
b7d3cef8-8a36-49d7-b56c-35feae93ae4c | kartikgupta321/DataStructuresAlgorithms | DSA/sortings/insertion.cpp | #include<iostream>
#include<conio.h>
using namespace std;
int main(){
int arr[]={5,4,3,2,10};
int n=sizeof(arr)/sizeof(arr[1]);
for (int i = 1; i <= n; i++){
for (int j = i; j >0; j--){
if (arr[j]<arr[j-1]){
int temp=arr[j];
arr[j]=arr[j-1];
... | ALGO | 0.9998 | 3.512849 |
739a58fb-08f9-4b5a-8d82-3791c5e866e8 | Rauf-17/Data_Structure_-_Algorithms | Dijkstra's and Bellmond-Ford Algorithms/main.cpp | #include <bits/stdc++.h>
using namespace std;
#define INF 0x3f3f3f3f
void dijkstra(int graph[][5], int V, int src)
{
priority_queue<pair<int, int>, vector<pair<int, int>>, greater<pair<int, int>>> pq;
vector<int> dist(V, INF);
dist[src] = 0;
pq.push(make_pair(0, src));
while (!pq.empty())
{
... | ALGO | 0.999971 | 4.534266 |
b0aae53e-9917-4841-b18e-da3d8dd3e8af | orioljose/websm | 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 |
0712b342-1ec1-4f61-9d67-ab6e48c74aad | ishandutta2007/codeforces | l7-56/normal/1637/F.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double db;
const ll maxn = 2e5 + 10;
ll n,a[maxn];
struct Edge {
ll v,nxt;
}e[maxn << 1];
ll h[maxn],cnt_e;
void add(ll x, ll y) { e[++cnt_e] = {y, h[x]}; h[x] = cnt_e; }
ll ans = 0;
ll dfs(ll u, ll pre) {
ll mx = 0, smx = 0;
for (ll j = h... | ALGO | 0.999914 | 3.59908 |
a283f939-ef80-4094-add5-d4eb8e7ad395 | GuessEver/ACMICPCSolutions | UVALive/6467/6467.cpp | #include <cstdio>
#include <cstring>
const int N = 1000 + 10;
int n, m;
bool cap[N][N];
int in[N], out[N];
int ord[N];
bool caled[N];
int cal(int x)
{
if(!in[x]) return ord[x] = 1;
if(caled[x]) return ord[x];
caled[x] = 1;
int d = 0, cnt = 0;
for(int i = 1; i <= n; i++) if(cap[i][x])
{
int t = cal(i);
if(t... | ALGO | 0.99983 | 5.008178 |
6669b30b-b0ea-439c-a053-97ecf4b315b0 | MahendraSH/dsa-cpp | basics/basicRecursion/pro3.cpp | // 3. # Problem: Print from 1 to N using Recursion
#include <bits/stdc++.h>
using namespace std;
void printn(int n)
{
if (n > 0)
{
printn(n - 1);
cout << n << " ";
}
}
int main()
{
int n;
cin >> n;
printn(n);
cout << endl;
}
| ALGO | 0.999864 | 5.146694 |
ca3939d7-fb68-49e0-a4fc-c2f19f1eb11c | pdhyeong/Junglepdh | 프로그래머스/lv2/42626. 더 맵게/더 맵게.cpp | #include <string>
#include <vector>
#include <iostream>
#include <queue>
using namespace std;
int solution(vector<int> scoville, int K) {
int answer = 0;
priority_queue <int, vector<int>, greater<int> > pq;
for(int i = 0;i<scoville.size();i++){
pq.push(scoville[i]);
}
while(pq.top() < K && ... | ALGO | 0.999829 | 5.381719 |
20df3d2a-afa8-4b73-aa9a-42e2a02536df | rayzhou0511/RayTracing_0 | OpenMP_Video_Version/graph.cpp | # include "graph.h"
# include <omp.h>
# include <cmath>
# include <limits>
# include <opencv2/opencv.hpp>
vec3 normalizes(const vec3 &x) { return glm::normalize(x); }
vec3 camera_position = vec3(0., 0.35, -1.);
vec3 camera_target = vec3(0., 0., 0.);
/* class Object */
Object::Object(
vec3 position,
vec3 colo... | ALGO | 0.981032 | 6.620567 |
e98918f5-2719-45d2-aaa3-ba524d1ee00e | soyandyortiz/cppTikTok | 08-ordenamientos/75-MetodoBurbuja.cpp | // Método de Burbuja - Bubble Sort
#include <iostream>
using namespace std;
int main() {
int n;
cout << "Ingrese el tamano del arreglo: ";
cin >> n;
int arr[n];
cout << "Ingrese los elementos del arreglo:" << endl;
for (int i = 0; i < n; i++) {
cin >> arr[i];
}
// Algoritmo de... | ALGO | 0.99997 | 5.493647 |
dbba009a-dbd9-4035-906b-6bc36198f77c | Zrahay/LC_Solutions | 0125-valid-palindrome/0125-valid-palindrome.cpp | class Solution {
public:
bool isPalindrome(string s) {
// To make upper letters lower (This function just works correctly)
for(int i = 0; i < s.size(); i++){
if(((s[i] >= 65 && s[i] <= 90))){
s[i] = tolower(s[i]);
}
}
int i = ... | ALGO | 0.999687 | 6.154927 |
a90240f1-0681-4dd4-b9e8-0d83d707fca0 | shubham-ai/Extended-Kalman-Filter-Project | src/kalman_filter.cpp | #include "kalman_filter.h"
#include<iostream>
using Eigen::MatrixXd;
using Eigen::VectorXd;
using namespace std;
// Please note that the Eigen library does not initialize
// VectorXd or MatrixXd objects with zeros upon creation.
KalmanFilter::KalmanFilter() {}
KalmanFilter::~KalmanFilter() {}
void KalmanFilter::Ini... | ALGO | 0.97685 | 6.026981 |
2b923bd2-12dc-4156-844c-c7d69c0ed709 | james-harder/CS211 | Examples/pointers.cpp | #include <iostream> // No special library needed for pointers
#include <iomanip>
using namespace std;
int main()
{
double pi = 3.14159;
double *ptr;
ptr = π
// This first part of the code illustrates where variables live, and the values they hold
char prev = cout.fill('.');
cout << setw(... | TOOL | 0.992366 | 4.332428 |
f64e0c36-81b2-4121-b3c7-c3e6a15e48e9 | jamesbriant/ScientificComputingAndCpp | src/Coursework1/main/Q3b.cpp | #include <iostream>
#include <cmath>
#include "general.hpp"
#include "fem.hpp"
double f(double x);
double b(double x);
double c(double x);
int main()
{
//
double tol = 1e-10;
int maxIter = 1000;
// define the ODE problem over (0,1)
double x0 = 0.0;
double x1 = 1.0;
// Define the boundary... | ALGO | 0.999931 | 5.026086 |
bf6c9dc2-dfc0-44fb-9dad-981831d7faa2 | KwonSR/Programmers | C++/프로그래머스/0/120839. 가위 바위 보/가위 바위 보.cpp | #include <string>
#include <vector>
using namespace std;
string solution(string rsp) {
string answer = "";
for(auto s : rsp)
{
if( s == '2')
answer.push_back('0');
else if(s=='0')
answer.push_back('5');
else
answer.push_back('2');
}
... | ALGO | 0.999077 | 5.102246 |
21160073-f650-491c-8140-89c43204c835 | Dipesh-Budhiraja/practice | DP/rod_cut_problem.cpp | // Recursion
int solve(int n, int x, int y, int z) {
if (n < 0) {
return -1;
}
if (n == 0) {
return 0;
}
int xans = solve(n-x, x,y,z);
int yans = solve(n-y, x,y,z);
int zans = solve(n-z, x,y,z);
int ans = max(xans, max(yans, zans));
if (ans != -1) {
... | ALGO | 0.999935 | 4.251017 |
19a59b4d-7e24-477b-b37b-93b8fa7876b1 | brianlball/JModelica-src-2.14 | ThirdParty/CasADi/CasADi/casadi/solvers/qcqp_to_socp.cpp | #include "qcqp_to_socp.hpp"
#include "casadi/core/sx/sx_tools.hpp"
#include "casadi/core/function/sx_function.hpp"
using namespace std;
namespace casadi {
extern "C"
int CASADI_QCQPSOLVER_SOCP_EXPORT
casadi_register_qcqpsolver_socp(QcqpSolverInternal::Plugin* plugin) {
plugin->creator = QcqpToSocp::creator... | ALGO | 0.996407 | 6.140234 |
fb9737fe-575b-44fb-be11-20ee3825bab2 | burakaktan/leetcode | 199. Binary Tree Right Side View/right.cpp | // The comment below is given by LeetCode
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, Tr... | ALGO | 0.999991 | 6.353635 |
afbaf749-b626-4fd2-8ebb-a3fdd12cf89e | QPDFium/pdfium | third_party/agg23/agg_curves.cpp | #include "agg_curves.h"
#include "agg_math.h"
namespace pdfium
{
namespace agg
{
const float curve_collinearity_epsilon = 1e-30f;
enum curve_recursion_limit_e { curve_recursion_limit = 16 };
void curve4_div::init(float x1, float y1,
float x2, float y2,
float x3,... | ALGO | 0.99883 | 5.99585 |
d0265492-635a-4747-9eab-205f7b8138b2 | hzsunzixiang/programming | algrithm/skiplist/skiplist_insert.cpp | // C++ code for inserting element in skip list
#include <bits/stdc++.h>
using namespace std;
// Class to implement node
class Node
{
public:
int key;
// Array to hold pointers to node of different level
Node **forward;
Node(int, int);
};
Node::Node(int key, int level)
{
this->key = key;
// Allocate mem... | ALGO | 0.999966 | 4.285048 |
0593c68c-fd0e-411d-93e0-e3de000c8a75 | weiiiii0622/2022_I2P_2 | HW/Mid3 Practice/FindThePairs.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define INF INT_MAX
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
int w, m, e; cin >> w >> m >> e;
set<int> woman, man;
for(int i=0; i<w; i++){
int x; cin >> x;
woman.insert(x);
}
for(int i=0; i<m; i+... | ALGO | 0.999959 | 3.857454 |
8093263d-ed87-4911-939e-d041e14408d3 | Jhuighuy/TitSolver | source/tit/geom/partition/recursive_bisection.test.cpp | #include <array>
#include <ranges>
#include "tit/core/basic_types.hpp"
#include "tit/core/vec.hpp"
#include "tit/geom/partition/recursive_bisection.hpp"
#include "tit/testing/test.hpp"
namespace tit {
namespace {
using Vec2D = Vec<double, 2>;
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~... | ALGO | 0.996223 | 7.664541 |
d9f9ae24-6bdd-4152-9b03-2cba9ebf3574 | delwar03/CF | E_Segment_Sum.cpp | #include <bits/stdc++.h>
#define int long long
#define endl '\n'
using namespace std;
const int mod = 998244353;
const int N = 2e5 + 10;
const int INF = 1e18 + 10;
int dp[20][1040][2]; // (ind, mask, tight)
int ndp[20][1040][2]; // (ind, mask, tight)
int pwr[25];
void solve() {
int l, r, k; cin>>l>>r>>k;
stri... | ALGO | 0.99984 | 4.978867 |
6ba64f98-ae6c-4732-be40-5809435e1ce2 | lclpsoz/competitive-programming | CF/1560/E.cpp | #include "bits/stdc++.h"
#include "ext/pb_ds/tree_policy.hpp"
#include "ext/pb_ds/assoc_container.hpp"
using namespace std;
////////////// Prewritten code follows. Look down for solution. ////////////////
#define x first
#define y second
#define LEN(x) ((int)(x).size())
#define ALL(x) x.begin(), x.end()
using ll = long... | ALGO | 0.999924 | 3.88006 |
8a66348f-beb2-4a03-9f8f-566eeeab965e | fuzh97/leetcode | code/0257.二叉树的所有路径.cpp | /*
* @lc app=leetcode.cn id=257 lang=cpp
*
* [257] 二叉树的所有路径
*/
// @lc code=start
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr),... | ALGO | 0.999947 | 6.621754 |
f53b2022-3470-47fc-9494-e54b270e453c | snichols/boost_1_61_0 | libs/compute/example/time_copy.cpp | //[time_copy_example
#include <vector>
#include <cstdlib>
#include <iostream>
#include <boost/compute/event.hpp>
#include <boost/compute/system.hpp>
#include <boost/compute/algorithm/copy.hpp>
#include <boost/compute/async/future.hpp>
#include <boost/compute/container/vector.hpp>
namespace compute = boost::compute;
... | ALGO | 0.991838 | 4.994506 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.