uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
fc841adb-cb64-47a5-9a24-15eebf862fbc | Pooh1223/Online-Judge | Sprout/#158.cpp | #include <iostream>
#include <cstring>
using namespace std;
int w[102],v[102],dp[101][100005];
int t,n,m,k;
int main(){
cin.tie(0);
cin >> t;
while(t--){
memset(w,0,sizeof(w));
memset(v,0,sizeof(v));
memset(dp,0,sizeof(dp));
cin >> n >> m >> k;
for(int i = 0;i < n;++i) cin >> w[i] >> v[i];
for(int i = 0;... | ALGO | 0.999981 | 3.487391 |
0acb7e34-ae64-44d6-a86d-c5536e4c2239 | shakib0017/Dsa-tree | countNonLeaf.cpp | #include<iostream>
#include<queue>
using namespace std;
class Node{
public:
int data;
Node *left,*right;
Node(int value){
data=value;
left=nullptr;
right=nullptr;
}
};
Node *createBinaryTree(){
int x;
cin>>x;
if (x==-1)
{
return nullptr;
}
Node... | ALGO | 0.999921 | 4.299024 |
2d80a532-a143-478e-9711-947541c2f522 | ImtiazAhmedAkash/Problem-Solving | atcoder/abc376/C.cpp | /* In the Name of ALLAH, the most gracious, the most merciful */
/* For today, you happen to be the defeated. But what will you become tomorrow? */
// Prepare Another Box
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define nl '\n'
#define deb(x) cerr << #x << " = " << x << nl
const int i... | ALGO | 0.999958 | 4.253155 |
1a5569d6-355a-402b-8200-780051d35898 | uqrmaie1/admixtools | src/cpp_fstats.cpp | // [[Rcpp::plugins(cpp11)]]
// [[Rcpp::depends(RcppArmadillo)]]
#include <RcppArmadillo.h>
using namespace Rcpp;
using namespace arma;
// [[Rcpp::export]]
List cpp_aftable_to_dstatnum_old(arma::mat& aftable, arma::vec& p1, arma::vec& p2, arma::vec& p3, arma::vec& p4) {
// aftable is npop x nsnp
// num is npopcomb... | ALGO | 0.995862 | 5.152999 |
eee99459-a86f-42b9-90b2-2419638e1bf9 | Dayof/integrate-c-python | test-boost/boost_1_60_0/libs/math/example/students_t_two_samples.cpp | #ifdef _MSC_VER
# pragma warning(disable: 4512) // assignment operator could not be generated.
# pragma warning(disable: 4510) // default constructor could not be generated.
# pragma warning(disable: 4610) // can never be instantiated - user defined constructor required.
#endif
#include <iostream>
using std::cout; ... | ALGO | 0.89149 | 7.085112 |
7075a76a-bef2-40db-b98f-fb87d1e0122d | Anli-Notes/Mining | src/crypto/randomx/superscalar.cpp | #include "crypto/randomx/configuration.h"
#include "crypto/randomx/program.hpp"
#include "crypto/randomx/blake2/endian.h"
#include "crypto/randomx/superscalar.hpp"
#include "crypto/randomx/intrin_portable.h"
#include "crypto/randomx/reciprocal.h"
namespace randomx {
static bool isMultiplication(SuperscalarInstructio... | TOOL | 0.866137 | 7.079521 |
57d38ac2-06ec-455b-b3fb-6d30fe285e7d | chanty25/Faultcoders-Repositorio | algoritmos greedy.cpp | #include <bits/stdc++.h>
using namespace std;
//Cambio de monedas
//Problema: Dado un sistema monetario y una cantidad,
//encontrar el mínimo número de monedas para formar esa cantidad.
//Enfoque greedy: Seleccionar siempre
//la moneda de mayor valor posible en cada paso.
int coinChange(vector<int>& coins, int amount)... | ALGO | 0.999826 | 4.753225 |
493edda9-6534-4405-8f3a-66ccc1565b74 | nebulasio/nvm | llvm/lib/Transforms/Scalar/Sink.cpp | #include "llvm/Transforms/Scalar/Sink.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/Analysis/ValueTracking.h"
#include "llvm/IR/CFG.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/Dominators.h"
#include "llvm/IR/IntrinsicInst.h"
#incl... | ALGO | 0.996195 | 7.973202 |
4a50a90f-dd2e-4f00-add1-dd5e4750b7df | Lastaapps/ctu-bi-ep2 | 04/gopher/gopher.cpp | #include <ctime>
#include <iostream>
#include <cassert>
#include <iterator>
#include <vector>
#include <queue>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <set>
using namespace std;
struct Coord {
int16_t x, y;
};
struct Edge {
uint16_t v;
double time;
Edge(uint16_t v, double tim... | ALGO | 0.999385 | 4.64621 |
da674605-d32e-47dc-aa02-c1019031c7fa | tanmesh/curly-doodle | algoExpert/Heap/Sort K-Sorted Array.cpp | #include <vector>
using namespace std;
class cmp {
public:
bool operator() (const int& a, const int& b) const {
return a > b;
}
};
vector<int> sortKSortedArray(vector<int> array, int k) {
typedef priority_queue<int, vector<int>, cmp> my_pq;
my_pq pq;
vector<int> result;
for (auto it : array) {
pq.push(it);... | ALGO | 0.999991 | 4.900476 |
e5ad4306-7fa2-4dff-a371-2a37338d45db | FlorisvaldoSantos/Programas-em-C-C- | Métodos de Ordenação/Trab_Bimestral/Clocktail_sort.cpp |
#include"includes.h"
void cocktail_sort(int list[10])
{
int length,bottom,top, swapped,i,aux;
length=10;
bottom = 0;
top = length - 1;
swapped = 0;
while(swapped == 0 && bottom < top)//Se no houver troca de posies ou o ponteiro que
{ //sobe ultrapassar ... | ALGO | 0.999917 | 4.461306 |
9240384d-d4a1-4fc8-aa66-8c5bf8fc71f8 | LucasDSL/code_saint | codcad_basic/todos_os_divisores.cpp | #include<iostream>
using namespace std;
int main(){
int n;
cin >> n;
for(int i = 1; i <= int(n/2);i++){
if (n % i == 0){
cout << i << ' ';
}
}
cout << n << endl;
} | ALGO | 0.99984 | 4.454386 |
3871acf1-8a02-4fec-b8b6-a5d8877650f4 | tribhu451/3-1D_ideal_hydro | src/mc_glau.cpp | #include<fstream>
#include<string>
#include<sstream>
#include "global.h"
#include "mc_glau.h"
#include "Fluid.h"
#include "eos.h"
#include "Nucleus.h"
#include "nPart_nColl.h"
using namespace std;
mc_glau::mc_glau()
{
set_the_parameters();
}
mc_glau::~mc_glau(){}
void mc_glau::Set_ic(Fluid* f, EoS* eos, d... | ALGO | 0.872772 | 3.063126 |
298ad150-ba1b-42bd-baec-5bd3a3df738b | Batishavo/Competitive-programing | 2021/December 2021/C. Minimum Extraction.cpp | #include<bits/stdc++.h>
using namespace std;
const int limit=1e6+10;
int arr[limit];
int main(){
int query;
scanf("%d",&query);
while(query--){
int n;
scanf("%d",&n);
for(int i=0 ;i<n;i++){
scanf("%d",&arr[i]);
}
sort(arr,arr+n);
int litle=arr[0],t... | ALGO | 0.999806 | 3.231934 |
5e8dbfb3-da71-40dc-a199-d51f47165b5e | ishandutta2007/codeforces | zhangzy/normal/883/K.cpp | #include<bits/stdc++.h>
using namespace std;
map<int,int>mp;
map<int,int>::iterator it;
int n,a[202000],b[202000],ans[202000];
struct L{
int st,en,id;
}l[202000];
long long tot=0;
void doit(L the){
int pos=the.id;
it=mp.lower_bound(pos);
int p1,p2=it->first;
it--; p1=it->first;
ans[pos]=the.en;
if (p1) ans[po... | ALGO | 0.999971 | 3.511013 |
b1e894e6-c63b-4502-9927-19bc720981b2 | yousef-mohsen/Competitive-Programming-Problems | Google Code Jam/Nesting Depth/Nesting Depth/main.cpp | //
// main.cpp
// Nesting Depth
//
// Created by Yousef on 24.03.21.
//
#include <iostream>
#include <vector>
#include <string>
typedef long long ll;
using namespace std;
int main(int argc, const char * argv[]) {
ios::sync_with_stdio(0); cin.tie(0);
ll t, o = 0, counter;
string s;
cin>>t;
... | ALGO | 0.999624 | 5.222854 |
0ed30c76-7727-400f-9f6b-e374f5977d4d | ahsamehx/Problem-Solving | Coding/Assignments/Algo assign3.cpp | #include <iostream>
#include <queue>
#include <vector>
#include <cstring>
using namespace std;
////////////////////////////////////////////////////////////////////////////////////////////////////////////
template<class Value>
struct Array {
int n, sz;
Value* arr;
void Initialize() {
n = 0; // Cu... | ALGO | 0.999652 | 5.922132 |
d6ea71da-def6-4ba1-a978-682b6d32b5ad | tony9402/solutions_for_baekjoon_problems | simulation/20058/main.cpp | // Authored by : tony9402
// Co-authored by : -
// Link : http://boj.kr/4e60b2336bfa4e3192b9aef4eb5a3f6b
#include<bits/stdc++.h>
using namespace std;
const int dy[] = {-1,1,0,0};
const int dx[] = {0,0,-1,1};
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
int K, Q; cin >> K >> Q;
int N = 1 ... | ALGO | 0.999385 | 3.908815 |
bcbd3f03-9ecc-4078-95d8-233232083a04 | ishandutta2007/codeforces | abeker/normal/650/B.cpp | #include <cstdio>
#include <algorithm>
using namespace std;
const int MAXN = 500005;
int N, A, B, T;
char s[MAXN];
int pref[MAXN];
void load() {
scanf("%d%d%d%d%s", &N, &A, &B, &T, s + 1);
}
bool check(int right, int left) {
return (pref[right] + pref[N] - pref[N - left]) * B + (left + right - 1 + min(left,... | ALGO | 0.999888 | 4.045825 |
9c36e8a9-2776-4f04-8a69-a84fde22f47b | sujalsrichandan2003/C | p1.cpp | #include <stdlib.h>
#include <stdio.h>
#include <string.h>
/**
* CodinGame planet is being attacked by slimy insectoid aliens.
* <---
* Hint:To protect the planet, you can implement the pseudo-code provided in the statement, below the player.
**/
int main()
{
// game loop
while (1) {
char enemy1[2... | ALGO | 0.999951 | 3.48471 |
9b42b487-1123-4d49-a776-e6b4a9176ca5 | stellaraccident/iree-forge | trees/llvm-project/flang/lib/Evaluate/fold-integer.cpp | #include "fold-implementation.h"
#include "fold-reduction.h"
#include "flang/Evaluate/check-expression.h"
namespace Fortran::evaluate {
// Class to retrieve the constant lower bound of an expression which is an
// array that devolves to a type of Constant<T>
class GetConstantArrayLboundHelper {
public:
GetConstantA... | TOOL | 0.95686 | 7.78269 |
ad105377-e84d-47eb-8161-b7d0ff58d550 | hicklin-james/CrackingTheCodingInterview | TreesAndGraphs/TreesAndGraphs4-1.cpp | #include <queue>
#include <utility>
#include <iostream>
#include <algorithm>
class Node {
public:
int value;
Node *leftChild;
Node *rightChild;
Node(int val) { value = val; leftChild = NULL; rightChild = NULL;}
};
class Tree {
public:
Node *head;
Tree() {};
void printTree(Node *node);
bool isTreeBalanced(Node... | ALGO | 0.999305 | 5.092305 |
8a713239-70f3-43df-b6d0-a4312745cb00 | gupta-manas6268/learning-C | TLE Eliminators/TLE eliminators Level-1/Chapter 1/01_02_01_pr.cpp | #include<iostream>
using namespace std;
int main(){
int a, b, c;
cin>>a>>b>>c;
if(a>=b && a>=c){
if(b>=c){
cout<<"\n"<<"\n"<<c<<"\n"<<b<<"\n"<<a<<"\n\n"<<a<<"\n"<<b<<"\n"<<c<<"\n";
}
else{
cout<<"\n"<<b<<"\n"<<c<<"\n"<<a<<"\n\n"<<a<<"\n"<<b<<"\n"<<c<<"\n";
... | ALGO | 0.999941 | 3.121965 |
52ccf4fc-e2d1-46eb-ab70-c5c7dca97338 | MohdAqib8267/6-Companies_30_days_Challenges | 0763-partition-labels/0763-partition-labels.cpp | class Solution {
public:
vector<int> partitionLabels(string s) {
unordered_map<char,int>mp;
for(int i=0;i<s.size();i++){
mp[s[i]]=i;
}
int j=0;
vector<int>ans;
int mx=INT_MIN;
for(int i=0;i<s.size();i++){
mx=max(mx,mp[s[i]]);
... | ALGO | 0.99986 | 6.237746 |
0b8090cd-4ee9-4a41-8899-ba766112d1eb | AMReX-Fluids/incflo | src/convection/incflo_compute_MAC_projected_velocities.cpp | #include <hydro_utils.H>
#include <hydro_bcs_K.H>
#include <incflo.H>
#include <AMReX_MultiFabUtil.H>
using namespace amrex;
void
incflo::compute_MAC_projected_velocities (
Vector<MultiFab const*> const& vel,
Vector<MultiFab const*> const& density,
... | ALGO | 0.999233 | 6.621684 |
733fa95c-81df-4b4a-b464-5b0c21d5e5ff | Tongyuang/EdgeTile | EdgeTileServer/libs/opencv/modules/features2d/src/blobdetector.cpp | #include "precomp.hpp"
#include <iterator>
#include <limits>
// Requires CMake flag: DEBUG_opencv_features2d=ON
//#define DEBUG_BLOB_DETECTOR
#ifdef DEBUG_BLOB_DETECTOR
#include "opencv2/highgui.hpp"
#endif
namespace cv
{
class CV_EXPORTS_W SimpleBlobDetectorImpl : public SimpleBlobDetector
{
public:
explicit Si... | TOOL | 0.94365 | 6.948392 |
f7a8c23d-7aa2-4529-87c7-ad445c8478f5 | Shadthrough/181-351_Bogachev | Boghchev_semestr1/Lab_16(Trees_and_templates)/Lab_16(Trees_and_templates).cpp | #include <iostream>
/*
int max(int * arr)
{
int res;
int temp = arr[0];
int len = sizeof(arr);
for (int i = 0; i <= len; i++)
{
if (arr[i] > temp)
{
temp = arr[i];
}
}
res = temp;
return res;
}
char max(char * arr)
{
char res;
char temp = arr[0];
int len = sizeof(arr);
for (int i = 0; i < len; i++)... | ALGO | 0.998417 | 3.994836 |
582064bb-1b79-4632-8d06-1896c5e791fb | Bindles/leetcode-auto | 0344-reverse-string/0344-reverse-string.cpp | class Solution {
public:
void reverseString(vector<char>& s) {
int last = s.size()-1;
for (int i=0; i<s.size()/2; i++) {
char temp = s[i];
s[i] = s[last];
s[last] = temp;
last--;
}
}
}; | ALGO | 0.999481 | 6.189773 |
1d575c75-72f6-4440-9417-de7feb2df47e | MechaMahmud71/dsa450 | unionAndIntersection.cpp | #include<bits/stdc++.h>
using namespace std;
int binarySearch(int arr[],int n,int x){
int left,right,mid;
left=0;
right=n-1;
sort(arr,arr+n);
while(left<=right){
mid=left+(right-left)/2;
if(arr[mid]==x){
return mid;
}
if(arr[mid]<x){
left=mi... | ALGO | 0.999884 | 3.793435 |
4b849b3f-6865-4ff5-a791-a5dcf8d23b35 | DavidChan0519/exercise | C++/container/list/list.cpp | #include<iostream>
#include <list>
#include <algorithm>
using namespace std;
int main()
{
list<char> lit;
//用法和向量一样,
//list是一个类模板,template,char是链表里对象的类型,lit是创建的一个对象;
//链表可以再头尾两端插入,是双向的;
lit.push_back('a');
lit.push_back('b');
lit.push_front('d');
lit.push_front('e');
lit.push_front('f');
lit.push_front('b'... | ALGO | 0.9943 | 3.613122 |
2861b609-3dc6-4593-9931-75cae0a54228 | theanarkh/read-nodejs-v14 | deps/icu-small/source/common/locdistance.cpp | // locdistance.cpp
// created: 2019may08 Markus W. Scherer
#include "unicode/utypes.h"
#include "unicode/bytestrie.h"
#include "unicode/localematcher.h"
#include "unicode/locid.h"
#include "unicode/uobject.h"
#include "unicode/ures.h"
#include "cstring.h"
#include "locdistance.h"
#include "loclikelysubtags.h"
#include... | TOOL | 0.998758 | 7.464659 |
6d14cfe1-41e4-4375-8ede-bc08c8864d79 | R3nch00/CodeForces | Love Triangle.cpp | // mes que un club //
#include <bits/stdc++.h>
#define f(n) for(int i=1;i<n;++i)
using namespace std;
class LoveTriangles {
private:
vector<int> likes;
public:
LoveTriangles(int n) : likes(n + 1) {}
void readPreferences(){
f(likes.size()){ cin >> likes[i]; }}
bool hasLoveTriangle() {
f(l... | ALGO | 0.999986 | 4.152166 |
32d09be2-e5a9-44af-adec-6c7b56d73719 | aliemressman/Cpp-Lessons | 19- Prime Number Finding Application/lesson19.cpp | #include <iostream>
#include <cmath>
using namespace std;
int main() {
// Sayinin asal olup olmadigini anlamamiz icin sayinin
// yarisina bolup o degere kadarki sayilarla bolup kontrol edebiliriz.
int number, result, stop;
int control = 1;
do {
cout << "\nBir deger giriniz:\n";
cin >> nu... | ALGO | 0.999219 | 3.781689 |
60142e5f-fa94-4395-bd79-c2a48358451f | luyencode/cpp-solutions | solutions/kw4hGnrt.cpp | /*
Sưu tầm bởi @nguyenvanhieuvn
Thực hành nhiều bài tập hơn tại https://luyencode.net/
*/
#include <iostream>
using namespace std;
void InterchangeSort(int* a, int x, int y)
{
for(int i = x; i < y - 1; i++)
{
for(int j = i + 1; j < y; j++)
{
if(a[i] > a[j])
swap... | ALGO | 0.999904 | 4.268361 |
f6600164-d8d8-4e8a-b3ee-852250d0b1d4 | intjarmansuri/Leetcode | Tree/0-Vector_to_Binary_Tree.cpp | #include<bits/stdc++.h>
using namespace std;
struct TreeNode {
int val;
TreeNode* left;
TreeNode* right;
TreeNode(int x) : val(x), left(NULL), right(NULL) {}
};
// Function to convert a vector of integer to a binary tree
TreeNode* vectorToTree(vector<int>& nodes) {
if(nodes.empty()) return NULL;
... | ALGO | 0.999956 | 6.246366 |
b7595825-71b7-437a-ad5f-a1058c8d41e8 | tinyhosmarcos/Album | main.cpp | #include <iostream>
#include<stdlib.h>
#include<time.h>
#include <ctime>
using namespace std;
template <typename T>
void swap(T *first, T *second) {
T temp;
temp = *first;
*first = *second;
*second = temp;
}
template <typename T>
bool comp_asc(T *first, T *second){
if(*first>*second)
return true;
return fals... | ALGO | 0.997766 | 3.854379 |
fa6349b1-4f83-4bee-b84e-46394b84450f | mayank-kumar111/Programs | OOPs Lab/Q48.cpp | // Write a program to implement class templent with multiple parameter.
#include <iostream>
using namespace std;
template <class T1, class T2>
class multiTemplate
{
T1 a;
T2 b;
public:
multiTemplate(T1 x, T2 y)
{
a = x;
b = y;
}
void display()
{
cout << "The value... | TOOL | 0.968939 | 5.814062 |
ee770421-8af4-4b7b-ae30-5fa52b5b6a0f | selfrender/Windows-Server-2003 | multimedia/danim/src/appel/values/image/gradimg.cpp | #include "headers.h"
#include "privinc/imagei.h"
#include "privinc/polygon.h"
#include "privinc/colori.h"
#include "privinc/vec2i.h"
#include "privinc/bbox2i.h"
#include "privinc/GradImg.h"
#include "backend/values.h"
#define USE_RADIAL_GRADIENT_RASTERIZER 0
class Point2Value;
class Color;
const Real SMALLNUM = 1.... | TOOL | 0.915409 | 6.718211 |
38995aa2-11ea-452c-89dc-651117b967e8 | diaaserag/URI-ONLINE-JUDGE- | 1961 - Jumping Frog.cpp | // main.cpp
// answer 1961 - Jumping Frog uri online judge
// solved by diaa serag
// Try hard before using other programmers' codes
#include<iostream>
#include<cmath>
using namespace std;
int main()
{
int x,y,a[1000],z=0;
cin>>x>>y;
for(int i=0;i<y;i++)
{
cin>>a[i];
}
for(int i=0;i<... | ALGO | 0.999916 | 3.262961 |
c456a00d-ca63-4cfe-9603-cd4faba7cc2c | weeebdev/contests | 898/E.cpp | // Bismillahir Rahmanir Rahim
// chrono::system_clock::now().time_since_epoch().count()
#include <algorithm>
#include <bits/stdc++.h>
#include <climits>
#include <iostream>
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second
#define all(x) (x).begin(), (x).end()
#define ... | ALGO | 0.999987 | 4.672921 |
3238fcc3-d36c-4ba7-ad94-024c151e3e12 | tamycova/30DaysHR | C++/Day09/Solution1.cpp | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int find_gcd(int a,int b){
if (a == b) return a;
else if (a == 1 || b == 1) return 1;
else return find_gcd(a > b ? a - b : a, b > a ? b - a : b);
}
int main() {
int a,b;
cin >> a >> b;
... | ALGO | 0.99996 | 4.600573 |
0ffbfc31-5792-4e84-98f3-595dc2d10003 | Safirasn21/BinarySearchTree_054 | BinarySearchTree/BinarySearchTree.cpp | #include <iostream>
#include <string>
using namespace std;
class Node {
public:
string info;
Node* leftchild;
Node* rightchild;
//constructor for the node of class
Node(string i, Node* l, Node* r) {
info = i;
leftchild = l;
rightchild = r;
}
};
class BinaryTree {
public:
Node* ROOT;
BinaryTree() {
R... | ALGO | 0.999879 | 5.636889 |
757217e4-ac1a-4f50-92ab-92cd6187f71c | wjmj/CodingInterviews | 30_KLeastNumbers.cpp | #include <iostream>
#include <vector>
#include <functional>
#include <set>
using namespace std;
vector<int> GetKLeastNums(vector<int> array, int k)
{
vector<int> result;
int len = array.size();
if (len == 0 || k <= 0)
return result;
multiset<int, greater<int> > s;
multiset<int, greater<in... | ALGO | 0.999954 | 5.015741 |
bfefc31c-9267-4077-8dbf-0a5d4c84455d | Charles-T-T/Algorithm-Practice | Array/2588-beautifulSubarrays/2588.cpp | #include <iostream>
#include <unordered_map>
#include <utility>
#include <vector>
using namespace std;
// FIXME: 超时超内存
class Solution_0 {
public:
long long beautifulSubarrays(vector<int>& nums) {
int count = (nums[0] == 0);
int n = nums.size();
vector<vector<int>> results(n, vector<int>(n,... | ALGO | 0.999984 | 5.832524 |
3eea7da2-552e-4eb1-b8d9-fe9e7b36e329 | mplatt8/godot-bitcoin-module | thirdparty/icu4c/common/uniset_closure.cpp | #include "unicode/brkiter.h"
#include "unicode/locid.h"
#include "unicode/parsepos.h"
#include "unicode/uniset.h"
#include "unicode/utf16.h"
#include "cmemory.h"
#include "ruleiter.h"
#include "ucase.h"
#include "uprops.h"
#include "util.h"
#include "uvector.h"
U_NAMESPACE_BEGIN
// TODO memory debugging provided insi... | TOOL | 0.871552 | 7.56267 |
4abee06b-b408-453c-bda5-a6cf90c56f76 | QI1002/library | opencv-2.4.13.6/modules/legacy/src/findface.cpp | ///////////////////////////////////////////////
//// Created by Khudyakov V.A. <EMAIL>
//////////////////////////////////////////////
#include "precomp.hpp"
#include "_facedetection.h"
CvSeq * cvFindFace(IplImage * Image,CvMemStorage* lpStorage)
{
FaceDetection FD;
FD.SetBoosting(false);
FD.FindFace(Image... | ALGO | 0.986373 | 3.826414 |
64203d1c-6ad1-404a-9efd-d04d3e321a1c | jemele/wes237c-project2 | fir/fir.cpp | /*
Filename: fir.cpp
Complex FIR or Match filter
firI1 and firI2 share coef_t c[N]
firQ1 and firQ2 share coef_t c[N]
INPUT:
I: signal for I sample
I: signal for Q sample
OUTPUT:
X: filtered output
Y: filtered output
*/
#include "fir.h"
typedef int coef_t;
typedef fix_num acc_t;
void firI1 (
f... | ALGO | 0.997256 | 4.451572 |
57594878-17bd-4dd2-a785-ca18520ccbbf | Kavin1421/Leetcode-Solution | 1600-1699/1629.Slowest Key/Solution.cpp | class Solution {
public:
char slowestKey(vector<int>& releaseTimes, string keysPressed) {
char ans = keysPressed[0];
int mx = releaseTimes[0];
for (int i = 1, n = releaseTimes.size(); i < n; ++i) {
int d = releaseTimes[i] - releaseTimes[i - 1];
if (d > mx || (d == mx ... | ALGO | 0.999851 | 6.266284 |
089ad157-a3e6-4ff2-8b9e-5a2dd5e33ec9 | Isha427/DSA | Tree/countNodes.cpp | #include <bits/stdc++.h>
using namespace std;
struct Node
{
int key;
Node *left;
Node *right;
Node(int k)
{
key = k;
left = NULL;
right = NULL;
}
};
int countNodes(Node *root)
{ int lh = 0, rh = 0;
Node *curr = root;
... | ALGO | 0.999515 | 5.050763 |
0220337d-2b6a-4ecb-926f-1128fb3fce9c | Git-Hub-Chris/PCSX2 | pcsx2/x86/ix86-32/iR5900Shift.cpp | #include "Common.h"
#include "R5900OpcodeTables.h"
#include "x86/iR5900.h"
using namespace x86Emitter;
namespace R5900::Dynarec::OpcodeImpl
{
/*********************************************************
* Shift arithmetic with constant shift *
* Format: OP rd, rt, sa ... | ALGO | 0.960844 | 6.655929 |
48be5363-fa05-400c-923d-dab273d1025a | santosH7321/CompetetiveProgrammingInCpp | stl/pairSum.cpp | #include<iostream>
#include<vector>
using namespace std;
int main(){
//Creation
vector<int> arr{10,20,40,60,70};
int sum = 80;
for(int i=0; i<arr.size(); i++){
int element = arr[i];
for(int j=i+1; j<arr.size(); j++){
if(element + arr[j] == sum){
cout<<"Pair... | ALGO | 0.999435 | 4.692912 |
c1ddc2e1-4009-4e1a-b76b-7b540f1bdf02 | qwertier24/AC | Codeforces/round_431_div2/B.cpp | #include <bits/stdc++.h>
using namespace std;
#define FOR(i, n) for(int i = 1; i <= n; i++)
#define REP(i, n) for(int i = 0; i < n; i++)
#define MP make_pair
#define FI first
#define SE second
#define VI vector<int>
#define CLR(x) memset(x, 0, sizeof(x))
#define SZ(x) (x.size())
#ifdef QWERTIER
#define err(x) cerr<<x<<... | ALGO | 0.999994 | 3.476961 |
04de82d4-6e7d-455d-8c92-86ea0cb715c1 | shaunno94/MCompTeamProject_2016 | Codebase/BulletPhysics/Extras/Serialize/BulletXmlWorldImporter/string_split.cpp | #include <assert.h>
//#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "string_split.h"
///todo: remove stl dependency
namespace bullet_utils
{
void split( btAlignedObjectArray<std::string>&pieces, const std::string& vector_str, const std::string& separator)
{
char** st... | TOOL | 0.850803 | 5.661646 |
a32ea192-7e64-47ff-ae94-1d1bcd3ca657 | healerwjf/gem5_x | src/systemc/tests/systemc/misc/user_guide/chpt11.5/mean.cpp | /*****************************************************************************
mean.cpp --
Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
*****************************************************************************/
/*****************************************************************************
... | ALGO | 0.999382 | 4.605412 |
452502eb-11cc-4285-ae52-82fc8eedf81d | Hoang17072004/DSA | LeetcodeProblem/SlidingWindow/balancedString.cpp | int balancedString(string s) {
int n=s.size();
int qtn=n/4;
map<char,int> m;
for (int i=0;i<n;i++) {
m[s[i]]++;
}
int i=0,res=n;
if (m['Q']==qtn&&m['W']==qtn&&m['R']==qtn&&m['E']==qtn) return 0;
for (int j=0;j<n;j++) {
m[s[j]]--;
... | ALGO | 0.999905 | 3.893746 |
7789bb32-4eea-4bf5-aa48-06365b13c3fb | Living-Hell/LeetCode | Graph/#310-Minimum Height Trees.cpp | //M1
//Using Topological Sort and BFS
//Faster than 80.33% (101ms)
class Solution {
public:
vector<int> findMinHeightTrees(int n, vector<vector<int>>& edges) {
if(n==1) return {0};
vector<int> indegree(n,0),res;
vector<vector<int>> adjList(n);
for(auto &e : edges){
int ... | ALGO | 0.999998 | 5.655704 |
c248cecd-42ca-42e6-9a72-470fc59941b5 | monhime/atcoder_charter | C++_old/beginner/083/A.cpp | #include<iostream>
#include<cstdio>
#include<cstdlib>
#include<algorithm>
#include<cstring>
#include<string>
#include<math.h>
#include<vector>
#include<queue>
#include<map>
#include<stack>
//#include <bits/stdc++.h>
#define INF (1<<30)
#define INFLL (1ll<<60)
using namespace std;
int main(){
int a,b,c,d;
cin>>a... | ALGO | 0.999967 | 3.042368 |
864cf9ff-24a1-4c94-8358-eba833f2d752 | Imagaverse/CitraEmu | externals/xbyak/sample/quantize.cpp | /*
@author herumi
JPEG quantize sample
This program generates a quantization routine by using fast division algorithm in run-time.
time(sec)
quality 1(high) 10 50 100(low)
VC2005 8.0 8.0 8.0 8.0
Xbyak 1.6 0.8 0.5 0.5
; generated code at q = 1
push esi
push edi
... | ALGO | 0.999314 | 4.379195 |
d75c0ba1-fac5-4599-86fa-b6542e3e0535 | Remas-Ulianytskiy/2304_Ulyanytskyi_006310 | 2304_Ulyanytskyi_006310.cpp | #include <iostream>
#include <vector>
#include <Windows.h>
using namespace std;
class Tree {
public:
virtual void draw() const = 0;
};
class Tree_one : public Tree {
public:
void draw() const override {
cout << " / \\" << endl;
cout << " // \\\\" << endl;
cout << "/// \\\\\\" << endl... | TOOL | 0.87294 | 5.753678 |
b19dce1c-1a49-4cb8-a9b5-99d9d92f0e9e | le-incroyable1-dev/dsa_archive | sar_phod_lo_apna_idhar/cf/round776div3_vc/weightOfTheSystemOfNestedSegments.cpp | #include<bits/stdc++.h>
using namespace std;
#define mod 1000000007
#define pb push_back
#define mp make_pair
#define fi first
#define sec second
typedef long long ll;
typedef long double ld;
#define pii pair<ll,ll>
#define vi vector< ll >
#define vvi vector< vi >
#define vpi vector< pii >
#define vvpi vector< vpi >
#... | ALGO | 0.99997 | 3.574321 |
a3b9a50f-6571-4418-9148-b1518b8532b0 | rushi-code/Logic_Building | program230.cpp | ///////////////////////////////////////////////////////////////////////
//
// Problem Statement : Decimal to hex convertor
//
//////////////////////////////////////////////////////////////////////
#include<iostream>
using namespace std;
void DisplayHexademical(int iNo)
{
int iDigit = 0;
char Arr[] = {'A... | ALGO | 0.983184 | 4.95277 |
5e5f4cb6-f655-4af6-b741-0a92360b03b9 | MrFrenik/gs_core | third_party/include/bullet/BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.cpp | #define CLEAR_MANIFOLD 1
#include "btSphereSphereCollisionAlgorithm.h"
#include "BulletCollision/CollisionDispatch/btCollisionDispatcher.h"
#include "BulletCollision/CollisionShapes/btSphereShape.h"
#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
#include "BulletCollision/CollisionDispatch/btCollision... | ALGO | 0.998487 | 6.638464 |
03730010-42f1-42c4-920b-7c567c670312 | Anshika-111105/Design-of-Algorithms-and-Analysis | week3_q3.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
bool hasDuplicates(vector<int>& arr) {
sort(arr.begin(), arr.end());
for (int i = 1; i < arr.size(); i++) {
if (arr[i] == arr[i - 1]) {
return true;
}
}
return false;
}
int main() {
int T;
... | ALGO | 0.999917 | 5.086894 |
f9175472-efb5-458b-baef-04e3b2b970c0 | andre-melicio/studies | faculdade/ads-eduvale/2-semestre/algoritimo-e-logica-de-programacao/05-11-2020/vetores_05.cpp | /*
5. Leia um vetor de 10 posies. Contar e escrever quantos valores
pares ele possui.
*/
#include<iostream>
#include <locale.h>
using namespace std;
int main(){
setlocale(LC_ALL, "Portuguese");
int i, cont;
int v[10],v2[10];
cont = 0;
for(i=0; i<10; i++){
cout<< "Digite o "<<i<<" valor:"<< endl;
cin>>v... | ALGO | 0.995992 | 3.947148 |
94a456bb-f2e2-4a12-be69-789ff4719b3c | XutaxKamay/css_enhanced | utils/xbox/vxconsole/local_cmds.cpp | localCommand_t g_localCommands[] =
{
// Command name, Flags Handler Help string
// console commands
{ "*cls", FN_CONSOLE, lc_cls, ": Clear the screen" },
{ "*connect", FN_CONSOLE, lc_autoConnect, ": Connect and listen until successful" },
{ "*disconnect", FN_CONSOLE,... | TOOL | 0.905117 | 4.068315 |
6837c4fe-56ac-4d0c-80e8-c01f493d3efc | manikanta2901/ubuntu | .history/codingChallenges/cpp/Codechef/DSA/LinearDataStructures/compilersAndParsers_20200728172316.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int t;
cin >> t;
while(t--){
string str;
cin >> str;
if(str[0] == '>'){
cout << 0 << endl;
continue;
}
int longest_index = 0,count = 0;
stack<char> tag;
bool flag;
for(int i = 0; i < str.size();i++){
if(str[i] == '<' ){
tag.push... | ALGO | 0.999404 | 3.055734 |
d679113b-6858-4271-ac4e-4d2574d3c2df | turakz/aoc | src/2021/cpp/day7/soln.cpp | #include <iostream>
#include <vector>
#include <string>
#include <fstream>
#include <limits>
// brute force
auto solvePuzzle(const std::string& inputFileName, const char delim) -> void
{
auto ifs = std::fstream{inputFileName};
auto minPos = std::int64_t{0};
auto maxPos = std::int64_t{0};
auto positions = std::... | ALGO | 0.996484 | 5.572778 |
a906183d-7af6-4ff2-8f5c-0e9cffb9edde | Biank23/Competitive-Programming | OI/OIA/2013/Certamen de Selección/Día 2/casas.cpp | #include <bits/stdc++.h>
using namespace std;
#define sz(x) int(x.size())
using ii = pair<int, int>;
const int INF = 1e9;
int main() {
freopen("casas.in", "r", stdin);
freopen("casas.out", "w", stdout);
ios::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
int x, y, n;
cin >> x >> y >> n;
... | ALGO | 0.999994 | 3.287622 |
27b2ae08-9ef7-423b-86a3-93976ade9318 | andy-zha/trunk | ml_engine/source/src/HttpParser.cpp | #include "HttpParser.h"
//构造函数
HttpParser::HttpParser()
{}
//析构函数
HttpParser::~HttpParser()
{}
/** 解析器初始化接口 **/
int32_t HttpParser::init()
{
//状态机初始化
if (RET::SUC != superMatchInit()) {
return RET::FAIL;
}
return RET::SUC;
}
/** 状态机初始化 **/
int32_t HttpParser::superMatchInit()
{
//读取规则路径
std::string cfgFile... | WEB | 0.881319 | 3.801443 |
adcc06e1-a0f9-4c8c-bd72-2bf785e787d0 | waiwai444/oj | uva/10270 - Bigger Square Please/10270.cpp | #include <stdio.h>
#include <string.h>
#define MAX_DEPTH 16
int n;
// the smallest number of dissection of each odd big square
const int depth[24] = { 6, 8, 9, 6, 11, 11, 6, 12, 13, 6, 13, 8, 6, 14, 15, 6, 8, 15, 6, 15, 16, 6, 16, 9 };
// precalculated sum-of-squares of each large prime number
const int sqsum_decom... | ALGO | 0.99965 | 3.711217 |
a075034e-5030-4843-9029-845dd5e9bfcc | soumikroychowdhury/DSA_Revise_2023_1_ReviseWithArsh_6Companies30Days-Challenge | matrix_cells_in_distance_order_1030.cpp | class Solution {
public:
vector<vector<int>> allCellsDistOrder(int rows, int cols, int rCenter, int cCenter) {
vector<vector<int>> ans(rows*cols,vector<int>(2));
vector<vector<bool>> vis(rows,vector<bool>(cols));
int i=0;
queue<pair<int,int>> q;
q.push({rCenter,cCenter});
... | ALGO | 0.999927 | 3.908042 |
35b26852-ab84-4d8c-b108-ab234b090a3b | ShiL-MShou/gam200-copy | CHASE_STATE.cpp | /******************************************************************************/
/******************************************************************************/
#include "stdafx.h"
#include "CHASE_STATE.h"
#include "PathFind.h"
#include "DebugDraw.h"
CHASE_STATE::CHASE_STATE()
: path_to_player{}, _playerPos{}, _un... | TOOL | 0.902195 | 3.349026 |
7fcb6c1e-f9eb-4a27-bde6-612e077446fa | mycamphortree/contracts | contracts/libc++/upstream/test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan_op.pass.cpp | // <numeric>
// UNSUPPORTED: c++98, c++03, c++11, c++14
// template<class InputIterator, class OutputIterator, class T, class BinaryOperation>
// OutputIterator
// inclusive_scan(InputIterator first, InputIterator last,
// OutputIterator result,
// BinaryOperation binary_... | TEST | 0.959988 | 7.344965 |
c32a5966-7c1a-45d4-83ee-1727066310f9 | ishandutta2007/codeforces | ljc00118/normal/1267/G.cpp | #pragma GCC optimize(2)
#pragma GCC optimize(3)
#include <bits/stdc++.h>
#define Fast_cin ios::sync_with_stdio(false), cin.tie(0);
#define rep(i, a, b) for(register int i = a; i <= b; i++)
#define per(i, a, b) for(register int i = a; i >= b; i--)
using namespace std;
typedef unsigned long long ull;
typedef pair <int, ... | ALGO | 0.999837 | 3.689828 |
30fdaffc-e2a1-4dcd-9fae-fb5923d133bc | ttnhathuy313/cp-career | Codeforces/Contest739/TaskC.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 5;
int n, A[N], lazy[4 * N];
struct obj {
int res, zic_l, zic_r, decl, incr, l_val, r_val, l, r, incl, decr;
} null, st[4 * N];
obj operator + (const obj a, const obj b) {
if (a.res == -1) return b;
if (b.res == -1) return a;
obj c;
c.res = max(... | ALGO | 0.999897 | 5.215602 |
ba36559f-d21e-4cc9-9f97-af7231fd4f7a | mohammadayaan2004/DSA_CPP | Day11/prog9_comparator.cpp | #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
bool comaparator(int a ,int b)
{
if(a>50 || b>50)
return a>b;
return a<b;
}
int main()
{
vector<int> v={100,0,12,46,26,8,1,50,54,70,69};
cout<<"Before Sorting :- "<<endl;
for(size_t i=0;i<v.size();i++)
{
co... | ALGO | 0.999744 | 3.497479 |
b3589304-4287-4a7a-aed1-b4c2a5a67c68 | hundrEDX/watchman | query/since.cpp | #include "watchman.h"
#include "make_unique.h"
enum since_what { SINCE_OCLOCK, SINCE_CCLOCK, SINCE_MTIME, SINCE_CTIME };
static struct {
enum since_what value;
const char* label;
} allowed_fields[] = {
{since_what::SINCE_OCLOCK, "oclock"},
{since_what::SINCE_CCLOCK, "cclock"},
{since_what::SINCE_MTIM... | TOOL | 0.933711 | 7.674419 |
2cd08148-f905-48fc-bddd-3fe5f53500c6 | cdegree/ACM | 日常/dp(1)/C.cpp | #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cctype>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <algorithm>
#include <iostream>
#include <string>
#include <set>
#define X first
#define Y second
using namespace std;
typedef long long LL ;
const int ... | ALGO | 0.999954 | 3.885737 |
e1ad1d01-4090-4225-a6ce-0b12fbf30144 | Piyush-io/Cpp | Medium/Smith Number/smith-number.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
int sumOfDigits(int num) {
int sum = 0;
while(num > 0) {
sum += (num % 10);
num /= 10;
}
return sum;
}
int s... | ALGO | 0.999931 | 6.520207 |
7c618eb6-a7ef-460b-ab3d-ebb7713af4d6 | Sungyuk1/CodeForces | May 2024/PlusOrMinus.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>
#include <unordered_set>
#include <unordered_map>
#include <set>
using namespace std;
int main(){
int t; cin>>t;
while(t--){
int a, b, c; cin>>a>>b>>c;
if(a+b == c){
cout<<"+"<<endl;
}else{
... | ALGO | 0.999921 | 4.917295 |
bac76148-b69a-4c7b-b7ec-58a7d5348323 | hexen2k/cppio | CPP1/CPP1/zadanie1.cpp | #include "zadanie1.h"
void zadanie1(void) {
int wysokosc_jacka, wysokosc_wymagana, wysokosc_guza;
cout << "Podaj wysokosc Jacka, wymagana wysokosc, oraz wartosc powiekszania sie guza: " << endl;
cin >> wysokosc_jacka;
cin >> wysokosc_wymagana;
cin >> wysokosc_guza;
if (wysokosc_wymagana > wys... | ALGO | 0.992024 | 3.651169 |
da148e84-3fad-4b89-8528-ecfa6e2481ae | nadvamir/advent-of-code-2024 | 16/reindeer_maze.cpp | #include <iostream>
#include <sstream>
#include <string>
#include <cassert>
#include <algorithm>
#include <ranges>
#include <queue>
#include <map>
#include <tuple>
int64_t solve(std::vector<std::string> input) {
auto directions = std::array<std::pair<int64_t, int64_t>, 4>{{{0, 1}, {1, 0}, {0, -1}, {-1, 0}}};
a... | ALGO | 0.999931 | 4.915737 |
282e3785-fcc6-4bd8-83a3-26d1de7f5606 | ks0727/AtCoder-Archive | ABC/101-150/132/c.cpp | #include <iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main(){
int n;
cin >> n;
vector<int> d(n);
for(int i=0;i<n;i++) cin >> d[i];
sort(d.begin(),d.end());
int a = d[n/2-1];
int b = d[n/2];
int ans = max(b-a,0);
cout << ans << endl;
return 0;
}
| ALGO | 0.99996 | 4.365521 |
4b6efc8a-9fad-42db-be84-6bd18fb3f2ca | jazzsterq/programs | CPP/Make_All_Equal.cpp | /**
* author : jazzsterq
*/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define be begin()
#define en end()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define pyes cout << "YES\n"
#define pno cout << "NO\n"
#define print(x) cout<<x<<endl
#define prints(x) cout<<... | ALGO | 0.999943 | 4.310518 |
5348cb94-f837-476a-b143-3e8cf2f97a2e | M0D4/Competitive-Programming-Problems-Solutions | CodeChef/C++17/NCOPRIMEN/59126247.cpp | #include "bits/stdc++.h"
#pragma GCC optimize("Ofast")
using namespace std;
#define endl "\n"
#define all(v) v.begin(), v.end()
#define debug(x) cout << #x << " is " << x << endl
#define pow(n, m) (int)powl(n, m)
#define clr(x, value) memset(x, value, sizeof(x))
using ll = long l... | ALGO | 0.999893 | 3.492936 |
4280cf1b-28ea-4d0b-b613-5885cb516b0d | KhoaNguyenAn/Algorithm | IOI07_NKMINERS/main.cpp | ///...................................*****.................................................///
/// Author : Ankhoa ///
/// Department of Computer Science ///
/// & Algorithm... | ALGO | 0.999753 | 3.272876 |
52621bd5-3777-4f90-a9a5-a12554566733 | arulandu/competitive-programming | archive/USACO/Contests/Silver/CountingHaybales.cpp | #include <bits/stdc++.h>
#include <iostream>
using namespace std;
#define ll long long
void handle_io(bool end, string filename=""){
if(end){
ios_base::sync_with_stdio(0);
cin.tie(0);
}
if(filename.length() > 0){
freopen((filename+".in").c_str(), "r", stdin);
freopen((filename+".out").c_str(), ... | ALGO | 0.99997 | 4.776185 |
a0c71b9f-da12-4e3e-ba3b-99fed05e09b1 | Debanikkkk/Coding | linkedlist.cpp | #include <iostream>
using namespace std;
struct node{
int data;
struct node *next;
};
int main(){
struct node *head;
struct node *one=NULL;
struct node *two=NULL;
struct node *three=NULL;
one=new node();
two=new node();
three=new node();
one->data=12;
two->data=3;
three... | ALGO | 0.997455 | 3.231641 |
3d8779c0-2a3b-45d1-aa3d-5a1512ac9367 | henriquenj/box2d-workshop | src/dynamics/b2_edge_polygon_contact.cpp | #include "b2_edge_polygon_contact.h"
#include "box2d/b2_block_allocator.h"
#include "box2d/b2_fixture.h"
#include <new>
b2Contact* b2EdgeAndPolygonContact::Create(b2Fixture* fixtureA, int32, b2Fixture* fixtureB, int32, b2BlockAllocator* allocator)
{
void* mem = allocator->Allocate(sizeof(b2EdgeAndPolygonContact));
... | ALGO | 0.982894 | 6.890633 |
50229c7c-1a17-487f-a229-f20791233019 | Rillmo/Baekjoon | p_9663/main.cpp | #include <iostream>
using namespace std;
int n;
int graph[16];
int counter = 0;
bool check(int lev) {
for (int i=0; i<lev; i++) {
if (graph[i] == graph[lev] || lev - i == abs(graph[lev] - graph[i]))
return false;
}
return true;
}
void back_tracking(int lev) {
if (lev == n)
counter++;
for (int i=0; i<n; i... | ALGO | 0.999831 | 4.323283 |
235e2e1a-c40c-4ccd-a73e-1ac3a91c2c47 | adwaitjog/mafia | src/intersim/rng_double.cpp | /* This program by D E Knuth is in the public domain and freely copyable
* AS LONG AS YOU MAKE ABSOLUTELY NO CHANGES!
* It is explained in Seminumerical Algorithms, 3rd edition, Section 3.6
* (or in the errata to the 2nd edition --- see
* http://www-cs-faculty.stanford.edu/~knuth/taocp.html
* in t... | ALGO | 0.999826 | 5.813815 |
00e2f333-7d1e-4f35-a6ff-1d802cdc05bf | MorettiGS/competitive-programming | C++/Grafos/dinic.cpp | // Description: Flow algorithm with complexity O(VE log U) where U = max |cap|.
// O(min(E^{1/2}, V^{2/3})E) if U = 1; O(sqrt(V)E)$ for bipartite matching.
// testado em https://www.spoj.com/problems/FASTFLOW/ 0.20s
const int N = 200003;
template<typename T> struct Dinic {
struct Edge {
int from, to;
... | ALGO | 0.996963 | 4.96589 |
e755bf7b-fec0-4b3e-b185-1ac97847a701 | Zhaoyibinn/LVI-SAM-Study | 相关环境/gtsam/examples/SimpleRotation.cpp | /**
* @file SimpleRotation.cpp
* @brief This is a super-simple example of optimizing a single rotation according to a single prior
* @date Jul 1, 2010
* @author Frank Dellaert
* @author Alex Cunningham
*/
/**
* This example will perform a relatively trivial optimization on
* a single variable with a sing... | ALGO | 0.999969 | 7.6803 |
27bdbfc5-9c87-4cb8-9fd6-12480958699d | rezanour/randomoldstuff | Backup/GDK/Branches/M1Exit/ContentStudioDX/DXUTDevice11.cpp | //--------------------------------------------------------------------------------------
// Forward declarations
//--------------------------------------------------------------------------------------
extern void DXUTGetCallbackD3D11DeviceAcceptable( LPDXUTCALLBACKISD3D11DEVICEACCEPTABLE* ppCallbackIsDeviceAcceptable,... | TOOL | 0.926291 | 6.510436 |
1b0ce0c7-e4d8-4892-940a-d780b8090f53 | LucasGabriel-CP/Competitive_Prog | Solutions/Beecrowd(URI)/1-Iniciante/1008.cpp | #include <iostream>
#include <iomanip>
using namespace std;
int main()
{
double F,H,S,multiplicacao;
cin >> F >> H >> S;
multiplicacao = H * S;
cout << "NUMBER = " << F << "\n";
cout << fixed << setprecision(2);
cout << "SALARY = U$ " << multiplicacao << "\n";
} | ALGO | 0.995605 | 3.159743 |
e55ffa96-e979-466a-9e5f-3563c835a0af | daeunchung/cplusplus | boj2441입출력.cpp | #include <iostream>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(nullptr); cout.tie(nullptr);
int N;
cin >> N;
for (int i = 0; i < N; i++)
{
for (int j = 0; j < i; j++) cout << " ";
for (int j = 0; j < N-i; j++) cout << "*";
cout << '\n';
}
return 0;
} | ALGO | 0.999946 | 3.935858 |
3b147ed2-5396-4e89-be30-b5c158d57e3e | asdf77616385/ceph-12.2.1 | src/boost/libs/geometry/doc/src/examples/strategies/buffer_join_round.cpp | // Boost.Geometry (aka GGL, Generic Geometry Library)
// QuickBook Example
//[buffer_join_round
//` Shows how the join_round strategy can be used as a JoinStrategy to create rounded corners
#include <boost/geometry.hpp>
#include <boost/geometry/geometries/point_xy.hpp>
#include <boost/geometry/geometries/geometries.h... | TOOL | 0.893075 | 6.856075 |
7df7d2b1-d048-4689-bd04-1e3b0103da75 | MeanOfRedStone/DataStructrue | chapter08_6.레벨 순회.cpp | /*
˰ 8.4 Ʈ ȸ ˰
level_order(root) :
1. initialize queue;
2. if(root == null) then return;
3. enqueue(queue, root);
4. while is_empty(queue) != True do
x <- dequeue(queue);
print x -> data;
if(x->left != NULL) then
enqueue(queue, x->left);
if(x->right != NULL) then
enqueue(queue, x->right)
*/
//... | ALGO | 0.999901 | 4.461705 |
f294eae9-f878-4bd6-91bf-295b7629067a | rahuldes23/mycpp | path2nodesBT/path2nodesBT.cpp | #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
typedef struct node
{
struct node *left, *right;
int val;
}NODE;
NODE* newNode(int val)
{
NODE*temp = new NODE;
temp->val = val;
temp->left = temp->right = NULL;
return temp;
}
/*
* Driver func returns LCA of t... | ALGO | 0.999918 | 4.615006 |
1e4dae0f-bf99-4c83-83fb-d2d084507f77 | greatzero728/zero.icpc | Contest/codeforces/Codeforces-Round-971--Div.-4-/(F).cpp | #include<bits/stdc++.h>
using namespace std;
using INT = long long;
const int NN = 404040;
int a[NN], n;
INT dp[NN];
INT calc(INT m) {
int k = m / n;
INT ans = k * dp[n];
if(m % n) {
k++;
ans += dp[m % n + k - 1] - dp[k - 1];
}
return ans;
}
int main() {
int t; scanf("%d", &t);
while(t--) {
int q; s... | ALGO | 0.999748 | 3.843242 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.