uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
f0a3b684-18db-4f18-8d95-57dfffdad715 | ARM-software/ComputeLibrary | src/core/NEON/kernels/convolution/winograd/weight_transforms_fp32.cpp | #include "winograd_implementations.hpp"
#include "weight_transform.hpp"
namespace arm_conv {
namespace winograd {
namespace weight_transform {
#if defined(__aarch64__)
#if defined(ARM_COMPUTE_ENABLE_SVE)
#endif // defined(ARM_COMPUTE_ENABLE_SVE)
#endif // defined(__aarch64__)
void arm_fp32_4x4_3x3(unsigned int, con... | ALGO | 0.888751 | 6.552769 |
2a9ba8ed-7ee0-4030-9811-affccd072d70 | ppetrov75/ya_courses | yellow_belt/eval_exp_shunting_yard.cpp | #include <iostream>
#include <memory>
#include <stack>
#include <vector>
using namespace std;
// структура классов у нас остаётся той же
struct Node { // базовый класс
virtual int Evaluate() const = 0;
};
struct Value : public Node { // класс для значения. Ранее был Digit
Value(char digit) : _value(digit - '... | ALGO | 0.997671 | 4.878888 |
0fda56cd-eea1-4471-99db-649c7cd09e0d | savecode99/demo_thamkhao | 013.cpp | #include <iostream>
#include <vector>
using namespace std;
void printSubset(vector<int>& subset) {
for (int i = 0; i < subset.size(); ++i) {
cout << subset[i];
}
cout << " ";
}
void findSubsets(int n, int k, int start, vector<int>& subset) {
if (subset.size() == k) {
printSubset(subse... | ALGO | 0.99991 | 5.191595 |
924c1103-a1de-4560-b34e-8edc9a20ca6d | utkarsh-27-sharma/DSA | LeetCode/19_remove_nth_node_from_end_of_list.cpp | class Solution {
public:
ListNode* removeNthFromEnd(ListNode* head, int n) {
ListNode * start = new ListNode();
start ->next = head;
ListNode* fast = start;
ListNode* slow = start;
for(int i=1;i<=n;++i)
fast = fast->next;
while(fast -> next!=NULL)
... | ALGO | 0.999961 | 6.485067 |
885d9e6f-38c1-413f-8ddd-5feb5b8d93da | IThawk/learnCode | javaBase/thread-demo/hotspot-87ee5ee27509/src/share/vm/code/compressedStream.cpp | #include "precompiled.hpp"
#include "code/compressedStream.hpp"
#include "utilities/ostream.hpp"
// 32-bit one-to-one sign encoding taken from Pack200
// converts leading sign bits into leading zeroes with trailing sign bit
inline juint CompressedStream::encode_sign(jint value) {
return (value << 1) ^ (value >> 31)... | TOOL | 0.899166 | 6.298832 |
f0c4340a-e789-45be-93cf-27f7cdd6d37a | pr1stvan/snow_simulation | src/array3d.cpp | #include "Array3d.h"
void Array3d::calculateAvg()
{
for (unsigned int i = 0; i < t.size(); i++)
{
if (t[i].count > 0)
{
t[i].vec.x /= t[i].count;
t[i].vec.y /= t[i].count;
t[i].vec.z /= t[i].count;
}
}
}
Array3d::Array3d(glm::vec3 position, floa... | ALGO | 0.997253 | 4.08913 |
4abc7484-e6a1-4059-8846-28a98a2dc0d4 | SaiTp/LeetCode-Codes | Minimum Swaps to Sort - GFG/minimum-swaps-to-sort.cpp | // { Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
public:
//Function to find the minimum number of swaps required to sort the array.
int minSwaps(vector<int>&nums)
{
// Code here
vector<pair<int,int>>v;
int n=nums.size();
for(i... | ALGO | 0.99995 | 5.941827 |
e87f9576-dbc6-439a-b440-d52e71cabd8b | iAmanKr47/DSA_Journey | CONTEST/GFG CC-176/PALINDROMIC SUBSTRINGS.CPP | class Solution {
public:
bool isPalindrome(vector<int>&freq,int &k){
int oddCnt=0;
for(auto i:freq){
if(i%2!=0)oddCnt++;
}
if(k%2!=0 && oddCnt==1)return true;
if(k%2==0 && oddCnt==0)return true;
return false;
}
int countPalindromicSubstri... | ALGO | 0.999981 | 5.959946 |
cdcd6827-82f2-4f70-8fb0-9c54f2eecc9e | raincross7/code-similarity | codes/train_code/problem130/problem130_22.cpp | #include<bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
vector<int> v(N);
vector<int> P(N), Q(N);
int count = 0;
int a, b;
for(int i = 0; i < N; i++) {
cin >> P[i];
}
for(int i = 0; i < N; i++) {
cin >> Q[i];
}
for(int i = 1; i <= N; i... | ALGO | 0.99992 | 3.577343 |
6ad30048-764c-4f90-be5d-30c41c6e4a54 | Wanderson-Patricio/CienciaDaComputacao-UFCA | Materiais/1º Semestre/Introdução a Programação/C/Programação com repetição/tabuada.cpp | #include <stdio.h>
#include <locale.h>
int main() {
setlocale(LC_ALL, "portuguese");
int x, i;
printf("Digite um nmero: \n")/
scanf("%d", &x);
for(i=1; i<=9; i++){
printf("%dx%d=%d \n", i, x, x*i);
}
return 0;
}
| ALGO | 0.99194 | 3.474129 |
b764b91c-47dc-48ed-9371-b71e1562aae2 | face4/AOJ | Volume29/2986.cpp | #include<iostream>
#include<algorithm>
#include<map>
using namespace std;
#define inRange(x,a,b) (a <= x && x < b)
typedef long long ll;
const ll mod = 1e9+7;
ll modpow(ll a, ll b, ll p = 1e9+7){
if(b == 0) return 1;
if(b % 2 == 0){
ll d = modpow(a, b/2, p);
return (d*d) % p;
}else{
... | ALGO | 0.99999 | 4.053429 |
5c0dde62-4513-412c-a94b-75731a3cacf6 | ishandutta2007/codeforces | ichyo/normal/132/A.cpp | #include <iostream>
#include <sstream>
#include <string>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
using namespace std;
#define FOR(i,k,n) for(int i=(k); i<(int)n; ++i)
#define REP(i,n... | ALGO | 0.999816 | 3.513422 |
40a0e192-0d79-4255-8b6c-7b4875527bac | Gorillza/c-plus-plus-development-white-belt | Week_2/03 Programming Assignment/Example.cpp | /*
Напишем две функции:
1. IsPalindrom, проверяющую, является ли строка палиндромом.
2. PalindromFilter, перебирающую все строки из данного вектора и проверяющую для каждой из них требуемые условия.
*/
// определяет, является ли строка s палиндромом
bool IsPalindrom(string s) {
// переберём все символы s[i] из п... | TOOL | 0.990367 | 5.580728 |
b681169f-e52f-4e1a-b118-d326a29a95bf | ishandutta2007/codeforces | ngfam/normal/711/A.cpp | #include <bits/stdc++.h>
#define prob "test"
typedef long long llint;
using namespace std;
void MAIN();
int main(){
#ifndef ONLINE_JUDGE
freopen(prob".inp","r",stdin);
// freopen(prob".out","w",stdout);
#endif
MAIN();
return 0;
}
const llint N = 1e3 + 1, mod = 1e9 + 7;
string a[N]; int n... | ALGO | 0.999826 | 3.499552 |
6b626410-bf3d-42dc-8b6a-fc87a4d4964c | amol1211/DSAWithC-CPP | 03.SolvingLeetcodeProblems/BinaryTree/NodesEqualToAverageOfSubtree/main.cpp | //2265. Count Nodes Equal to Average of Subtree
#include <iostream>
using namespace std;
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, TreeNode *l... | ALGO | 0.999972 | 7.021813 |
5924d02a-1b62-49ae-8c22-1315f3950156 | 565353780/total-curvature-estimation | libigl/include/igl/mapping_energy_with_jacobians.cpp | #include "mapping_energy_with_jacobians.h"
#include "polar_svd.h"
IGL_INLINE double igl::mapping_energy_with_jacobians(
const Eigen::MatrixXd &Ji,
const Eigen::VectorXd &areas,
igl::MappingEnergyType slim_energy,
double exp_factor){
double energy = 0;
if (Ji.cols() == 4)
{
Eigen::Matrix<double, 2... | ALGO | 0.998029 | 6.77739 |
a421503e-4227-4aea-939e-d6cec812d1ee | ksg0102/DBMS | spellstable.cpp | #include <iostream>
#include <string>
#include <string.h>
#include <fstream>
#include <vector>
#include <iomanip>
#include <cstdlib>
using namespace std;
#include "spellstable.h"
void Spellstable::donematch(string str[7], string t1) //function used for delete query, where there was one match
{
ofstream fout;
int ma... | TOOL | 0.854659 | 3.234591 |
c5ba1203-40bf-4372-bdef-2b7e07700506 | IDEA-Research/IYFC | iyfc/examples/group.cpp | #include "examples.h"
using namespace iyfc;
using namespace std;
/**
* @brief Example demonstrating the use of a DagGoup.
*/
void example_group() {
DagPtr group = initDagGroup("group");
// DAG 1: Count and Sum
DagPtr dag_cnt_sum = initDag("child_dag_cnt");
Expr lhs = setInputName(dag_cnt_sum, "lhs");
setO... | ALGO | 0.990945 | 3.857921 |
608914f9-1e60-43d4-9bc2-77c3240164a2 | ishandutta2007/codeforces | y0105w49/normal/812/E.cpp | // ayy
// ' lamo
#include <bits/stdc++.h>
#include <bits/extc++.h>
using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
typedef long double ld; //CARE
typedef complex<ld> pt;
#define fi first
#define se second
#define pb push_back
const ld eps=1e-8;
const int inf=1e9+99;
const ll linf=1e18+99;
const i... | ALGO | 0.999911 | 3.522189 |
cf2ccdd0-bb1f-498c-8f3c-c5d75b325d36 | Rissochek/LabsOOP | Lab3/main.cpp | #include <iostream>
#include <cstddef>
#include "lib/Figure.h"
int main(){
const int n = 2;
Figure** figures = new Figure*[n];
double area_sum = 0;
for (size_t i = 0; i < n; i++)
{
figures[i] = new Trapeze(4);
std::cin >> *figures[i];
area_sum += double(*figures[i]);
}
... | ALGO | 0.963007 | 3.402755 |
b4bbedb9-5198-4200-92b0-d20be458e2bb | taidangit/C-tranduythanh | CacToanTu/main.cpp | #include <iostream>
using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main(int argc, char** argv) {
int x=5;
int y=3;
int z=x-- - ++y +2;
//step 1: ++y==>y=4
//step 2: 5-4+2=3==>z=3
//step 3: x--==>x=4
cout<<"x="<<x<<endl;
cout<<"y="<<... | ALGO | 0.998191 | 3.541005 |
fc6dbc71-7e3c-48f5-8e6d-cc3fdabc96cc | HARRISAMIN432/codeforces | desorting.cpp | #include <iostream>
#include <vector>
#include <cmath>
using namespace std;
int main()
{
int t;
cin >> t;
while (t--)
{
int n;
cin >> n;
vector<int> nums(n);
for (int i = 0; i < n; i++)
cin >> nums[i];
bool sorted = true;
int minDifference = I... | ALGO | 0.999958 | 4.040875 |
18c8306f-9f8e-41f4-958f-5faf79cc330d | sastpg/Computer-Graphics | src/bazierface.cpp | #include "bazierface.h"
#include <cmath>
using namespace std;
#define step 50
float defControlPoints[] = {
3.0, 3.0,
3.0, 2.0,
3.0, 1.0,
3.0, 0.0,
0.0, 3.0,
1.0, 3.0,
2.0, 3.0,
3.0, 3.0,
0.0, 0.0,
1.0, 0.0,
2.0, 0.0,
3.0, 0.0,
};
bool BezierFace::getRadiance(float pos, float& y, float& r) {
if (pos < t... | ALGO | 0.992449 | 3.664939 |
3fd9d8ec-685f-4679-8730-1885b4de1d74 | NozdryakovaMarina/AISD_lab6 | graph_list.cpp | #pragma once
#include <iostream>
#include <stdexcept>
#include <vector>
#include <functional>
#include <unordered_map>
#include <stack>
using namespace std;
namespace graph {
template<typename Vertex, typename Distance = double>
class Graph {
public:
struct Edge {
Vertex _from;
Vertex _to;
Distanc... | ALGO | 0.998544 | 5.496183 |
c293edd0-2c3b-4614-96b5-c676cfac26d3 | nur483/computer-graphics | ext/openexr/IlmBase/Imath/ImathRandom.cpp | //-----------------------------------------------------------------------------
//
// Routines that generate pseudo-random numbers compatible
// with the standard erand48(), nrand48(), etc. functions.
//
//-----------------------------------------------------------------------------
#include "ImathRandom.h"
#include "... | ALGO | 0.984155 | 5.511621 |
1ebef37c-0161-4d5b-ba8f-7dc23c86b833 | sananth12/spoj-codechef-codeforces | codechef/SQ.cpp | #include<bits/stdc++.h>
#define FOR(i,j,k) for(int i=j;i<k;i++)
#define ll long long
using namespace std;
int main()
{
ll w=0,n;
cin>>n;
map < pair<int,int> , bool > M;
ll x,y;
vector < pair<int,int> > V;
FOR(i,0,n)
{
cin>>x>>y;
M[make_pair(x,y)]=true;
V.push_back(make_pai... | ALGO | 0.999993 | 3.877923 |
06ea85af-11cc-41f5-bebc-f30365682a32 | kamyu104/LeetCode-Solutions | C++/reformat-date.cpp | // Time: O(n)
// Space: O(1)
class Solution {
public:
string reformatDate(string date) {
static const unordered_map<string, int> lookup = {
{"Jan", 1}, {"Feb", 2}, {"Mar", 3}, {"Apr", 4},
{"May", 5}, {"Jun", 6}, {"Jul", 7}, {"Aug", 8},
{"Sep", 9}, {"Oct", 10}, {"Nov", 1... | ALGO | 0.997868 | 6.206908 |
a2611d2a-82a7-4e95-bf40-535a1ff20028 | VenkataGirishVelaga/Leetcode | 123-best-time-to-buy-and-sell-stock-iii/best-time-to-buy-and-sell-stock-iii.cpp | class Solution {
public:
int maxProfit(vector<int>& prices) {
int n = prices.size();
vector<vector<vector<int>>> dp(n + 1, vector<vector<int>> (2, vector<int>(3)));
for(int i = n - 1; i >= 0; i--){
for(int b = 0; b <= 1; b++){
for(int c = 1; c <= 2; c++){
... | ALGO | 0.999933 | 5.853341 |
b7608c66-2c0a-4758-b33a-ddbc45d09f06 | arrpt/codeforces | 1927B/1927B.cpp | #include <bits/stdc++.h>
#define ll long long
using namespace std;
void fun(){
int n;
cin >> n;
vector<int> nums;
for (int i = 0; i < n; i++){
int temp;
cin >> temp;
nums.push_back(temp);
}
string answer;
vector<int> arrnum;
vector<char> arrchar;
char start = ... | ALGO | 0.991367 | 3.626671 |
7da76572-2111-4fac-ae8f-84b1d63002b7 | tzupengwang/PECaveros | contest/ASC/ASC44/d.cpp | // eddy1021
#include <bits/stdc++.h>
using namespace std;
typedef double D;
typedef long double LD;
typedef long long ll;
typedef long long LL;
typedef pair<int,int> PII;
typedef pair<LL,LL> PLL;
typedef pair<LD,LD> Pt;
typedef tuple<int,int,int> tiii;
typedef tuple<LL,LL,LL> tlll;
#define mod9 1000000009ll
#define mod... | ALGO | 0.991129 | 3.795762 |
fc72726f-6e98-476d-9916-66e0a78e7125 | gusdldi300/Algorithm | BOJ/Recursion/G4-1891/main.cpp |
#include <cassert>
#include <iostream>
#include <string>
#include <cmath>
struct Position
{
long long x;
long long y;
};
void TransformFragmentNumberToPositionRecursive(Position& startPosition, Position& endPosition, const Position& movePosition, int fragmentNumberIndex, const int fragmentNumberDigits, const... | ALGO | 0.999907 | 4.868877 |
d08db61a-37f9-4d40-939e-da29e2ae5415 | ZtupidTS/thesnow | Code/CPP/Dolphin/Source/Core/Common/Src/Crypto/sha1.cpp | /*
* The SHA-1 standard was published by NIST in 1993.
*
* http://www.itl.nist.gov/fipspubs/fip180-1.htm
*/
/*
#include "polarssl/config.h"
#if defined(POLARSSL_SHA1_C)
#include "polarssl/sha1.h"
*/
#include "sha1.h"
#include <string.h>
#include <stdio.h>
/*
* 32-bit integer manipulation macros (big endian)
... | TOOL | 0.926135 | 6.0375 |
a002cbef-07ea-4f0f-83d7-1a4d7fbce871 | jcheng1103/USACO-practice | mixing/mixing/main.cpp | /*
ID: jerry.c1
TASK: milk
LANG: C++
*/
#include <iostream>
#include <fstream>
#include <algorithm>
using namespace std;
struct farmer{
int p, amt;
};
bool compare(farmer a, farmer b){
return a.p < b.p;
}
int main() {
ifstream fin("milk.in");
ofstream fout("milk.out");
int n, m;
fin >> n ... | ALGO | 0.99994 | 4.114571 |
f4b26208-b574-4de3-8145-ea27d0f6cc71 | Luccifer/GoodDay | src/boost_1_65_1/libs/geometry/doc/src/examples/algorithms/return_envelope.cpp | // Boost.Geometry (aka GGL, Generic Geometry Library)
// QuickBook Example
//[return_envelope
//` Shows how to return the envelope of a ring
#include <iostream>
#include <boost/geometry.hpp>
#include <boost/geometry/geometries/box.hpp>
#include <boost/geometry/geometries/point_xy.hpp>
#include <boost/geometry/geomet... | TOOL | 0.974471 | 6.602969 |
caf6b96d-4e9a-4256-a865-5641f1d8545d | jk-jung/problem-solving | codeforces/Educational Round 11x/R113_div2_A.cpp | #include <string.h>
#include <stdio.h>
#include <math.h>
#include <cassert>
#include <map>
#include <stack>
#include <queue>
#include <vector>
#include <numeric>
#include <iostream>
#include <algorithm>
using namespace std;
typedef long long ll;
typedef pair<int, int> pi;
typedef vector<int> vi;
#define mp make_p... | ALGO | 0.999682 | 3.882678 |
36c6ef4c-0c77-4d34-9d6e-ee75237a7f78 | ishandutta2007/codeforces | ksun48/normal/1033/D.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long LL;
LL r2(LL a){
LL s = 0;
LL e = 2e9;
while(s + 1 < e){
LL m = (s + e) / 2;
if(m * m == a) return m;
if(m * m > a){
e = m;
} else {
s = m;
}
}
if(s * s == a) return s;
if(e * e == a) return e;
return -1;
}
LL r3(LL a){
LL s = 0;
... | ALGO | 0.999933 | 4.47757 |
94327427-1657-4917-89d5-8bb349992644 | raincross7/code-similarity | codes/train_code/problem023/problem023_286.cpp | #include<iostream>
#include<vector>
#include<cmath>
using namespace std;
using ll = long long;
using ull = unsigned long long;
#define rep(i,n) for(ll i=0;i<n;++i)
#define ocut cout
#define ouct cout
#define itn int
struct Union{
vector<ll> par;
Union(ll a){
par=vector<ll>(a,-1);
}
ll find(ll a){
if(par[... | ALGO | 0.999983 | 4.248351 |
2fc9c75e-64b2-4e07-945e-6a24f53b78c8 | HarryXiong24/code-collection | Data Structure & Algorithm [Old]/Algorithm/Courses/TSP/TSP.cpp | #include "tspdynp.hpp"
#include <iostream> // for debug purposes
#include <limits> // for UINT_MAX
// Solve TSP exactly, using dynamic programming.
// The grading script will use this exact function signature, so do not change it!
// The graph is given as an adjacency matrix, HOWEVER, no edges have a cost of '0'.
//... | ALGO | 0.999961 | 6.066632 |
00a1249b-af32-49af-ade9-a61d9403956f | DylanCampo5/2nd_degree | 1st_semester/Sistemas_Operativo/C++/2_Servidor_Documentos/UNION.cpp | #include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <cstring>
#include <cerrno>
#include <fcntl.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <sys/socket.h>
#include <unistd.h>
#include <arpa/inet.h>
#include <expected>
// Clase para manejar el mapeo de archivos en memoria de ... | WEB | 0.85025 | 7.276558 |
38d65543-ccb5-42b3-a8fa-c7cba7a6e372 | ChukCharles/Coursera | 2. Yellow/Week5/refactoring.cpp | #include <iostream>
#include <string>
#include <vector>
#include <memory>
using namespace std;
class Person {
public:
Person( const string& s ) : Name_(s) {}
virtual string Profession() const = 0;
string Name() const { return Name_; }
virtual void Walk( const string& destination ) const {
cou... | TOOL | 0.864474 | 6.489079 |
4522c261-19f2-4afb-8b3d-d366fcc21ca0 | mnhat05/kho2 | bài Th2.cpp | #include <stdio.h>
void nhap(int a[], int n)
{
for (int i = 0; i < n; i++)
{
printf("Nhap vao phan tu a[%d]: ", i);
scanf("%d", &a[i]);
}
}
int max(int a[], int n)
{
int max = a[0];
for (int i = 1; i < n; i++)
if (max < a[i])
max = a[i];
return max;
}
in... | ALGO | 0.990408 | 3.498974 |
6380e718-3cf3-4edf-8566-37ae318f89fe | c7rishi/BAMBI | src/wnorm2_llik_grad.cpp | #include <Rcpp.h>
// [[Rcpp::depends(RcppArmadillo)]]
// #ifdef _OPENMP
// #include <omp.h>
// #endif
//
//
// #include "thread_num.h"
using namespace Rcpp;
// typedef std::vector<Rcpp::NumericMatrix> stdvec_mat;
// [[Rcpp::export]]
double ldwnorm2_num( Rcpp::NumericVector x, Rcpp::NumericVector par, Rcpp::Numeric... | ALGO | 0.999082 | 4.462811 |
ae038ac6-e4cf-48d8-bd79-7735068923b4 | RogerEC/CP-ICPC-Training | Online-Judges/Codeforces/Cpp/1353-A.cpp | #include<bits/stdc++.h>
using namespace std;
const int MAXN = 2e5+5;
#define mdc(a, b) (__gcd((a), (b)))
#define mmc(a, b) (((a)*(b))/__gcd((a), (b)))
#define pb push_back
#define mp make_pair
#define f first
#define s second
#define fastin ios_base::sync_with_stdio(0); cin.tie(0)
typedef long long int ll;
typedef un... | ALGO | 0.999573 | 3.698892 |
5471ed7e-9a8c-4d97-a39b-88403fc8886d | masonhorne/Kattis-Solutions | src/isithalloween.com.cpp | #include<iostream>
#include<string>
using namespace std;
////////////////////////////////////////////////////////////
// Problem: https://open.kattis.com/problems/isithalloween /
////////////////////////////////////////////////////////////
int main() {
// Read in month name
string s; cin >> s;
// Read in ... | ALGO | 0.999582 | 4.961217 |
311c4fb0-7c85-4870-9056-00991f35487e | jiusetian/EPlayer | lib_eplayer/src/main/cpp/soundtouch/source/SoundTouch/AAFilter.cpp | #include <memory.h>
#include <assert.h>
#include <math.h>
#include <stdlib.h>
#include "AAFilter.h"
#include "FIRFilter.h"
using namespace soundtouch;
#define PI 3.14159265358979323846
#define TWOPI (2 * PI)
// define this to save AA filter coefficients to a file
// #define _DEBUG_SAVE_AAFILTER_COEFFICIENTS... | TOOL | 0.957235 | 5.393981 |
33163112-e65f-4a41-8ac6-7b3301da687c | danishzayan/DSA | Lecture 10-/sort01.cpp | #include <iostream>
using namespace std;
void printArray(int arr[], int n) {
for(int i = 0; i < n; i++) {
cout << arr[i] << " ";
}
cout << endl;
}
void sortOne(int arr[], int n) {
int left = 0, right = n-1;
while(left < right) {
while(arr[left] == 0 && left < right) {
left++;
}
whil... | ALGO | 0.999958 | 4.86617 |
34431d6a-1c42-4012-a0eb-f0313c53b8fa | eigen-mirror/eigen | doc/snippets/Tridiagonalization_decomposeInPlace.cpp | MatrixXd X = MatrixXd::Random(5, 5);
MatrixXd A = X + X.transpose();
cout << "Here is a random symmetric 5x5 matrix:" << endl << A << endl << endl;
VectorXd diag(5);
VectorXd subdiag(4);
VectorXd hcoeffs(4); // Scratch space for householder reflector.
VectorXd workspace(5);
internal::tridiagonalization_inplace(A, dia... | ALGO | 0.999239 | 3.067086 |
51653bef-3fca-466e-879d-566bd92a85a6 | qianpeng0523/GameClient | Classes/cryptopp/md5.cpp | /* $Id: md5.c,v 1.6 2002/04/13 19:20:28 lpd Exp $ */
#include "md5.h"
#include <string.h>
#undef BYTE_ORDER /* 1 = big-endian, -1 = little-endian, 0 = unknown */
#ifdef ARCH_IS_BIG_ENDIAN
# define BYTE_ORDER (ARCH_IS_BIG_ENDIAN ? 1 : -1)
#else
# define BYTE_ORDER 0
#endif
#define T_MASK ((md5_word_t)~0)
#define T1... | ALGO | 0.997929 | 6.430163 |
bcf8264e-055b-4a05-8710-89ad9172dc23 | Alisahhh/HUST_Alogrithm | code/1636.cpp | #include<cstdio>
#include<vector>
#include<cstring>
using namespace std;
const int N = 1e5+7;
struct ee{
int v,nxt;
}e[N];
int cnt;
int head[N];
int vis[N];
int dp[2][105][105];
int n,m;
int p,q;
struct goods{
int x,y;
};
vector<goods>good;
void ins(int u,int v){
e[++cnt].v = v;
e[cnt].nxt = head[u];
... | ALGO | 0.99992 | 4.194677 |
2fa27b4e-e43c-4ca2-a848-ac9ca547e19c | ishandutta2007/codeforces | oipotato/normal/1515/B.cpp | #include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define data dataa
#define rep(i,n) for(int i=1;i<=n;i++)
typedef long long LL;
int main()
{
int T;
for(scanf("%d",&T);T--;)
{
int n;scanf("%d",&n);
bool flag=0;
if(n%2==0)
{
in... | ALGO | 0.999318 | 4.355134 |
215d4b65-d0f9-44ac-8437-98e76aa8907f | Arittra101/Practice_Problem | CodeForce/Ok Try and catch/Exciting Bets.cpp |
#include<bits/stdc++.h>
using namespace std;
typedef long long int lli;
//lli i,j;
#define pii pair<lli, lli>
#define vi vector<lli>
#define pb push_back
#define mp make_pair
#define yes cout << "YES" << "\n";
#define no cout << "NO" << "\n";
#define en "\n"
// reverse binary -> lli res = 0; while(n>0){ res <<= 1; ... | ALGO | 0.999858 | 3.922432 |
f2bfde73-e1b6-4bed-8283-4cb7c6803f1d | uzh-rpg/rpg_svo_pro_gps | svo_direct/src/matcher.cpp | #include <svo/direct/matcher.h>
#include <cstdlib>
#include <random>
#include <chrono>
#include <vikit/vision.h>
#include <vikit/math_utils.h>
#include <kindr/minimal/angle-axis.h>
#include <svo/direct/patch_warp.h>
#include <svo/direct/patch_score.h>
#include <svo/direct/patch_utils.h>
#include <svo/common/frame.h>... | ALGO | 0.998506 | 6.096708 |
32bdcc86-05a7-4439-8d81-941610f2ba92 | ishandutta2007/codeforces | galen_colin/normal/1353/A.cpp | #include <bits/stdc++.h>
#include <chrono>
using namespace std;
using namespace std::chrono;
// #pragma GCC target ("avx2")
// #pragma GCC optimization ("O3")
// #pragma GCC optimization ("unroll-loops")
// #pragma optimization_level 3
// #pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3")
... | ALGO | 0.999429 | 3.702136 |
6c3978d6-12ec-4f75-bac2-d4260f550fa1 | July-h5kf3/NKU-parallel-computing | lab03/code/advanced/threadshold/correctness.cpp | #include "PCFG.h"
#include <chrono>
#include <fstream>
#include "md5.h"
#include <iomanip>
using namespace std;
using namespace chrono;
// 编译指令如下:
// g++ correctness.cpp train.cpp guessing.cpp md5.cpp -o test.exe
// 通过这个函数,你可以验证你实现的SIMD哈希函数的正确性
int main()
{
bit32 state[4];
MD5Hash("<BASE64_DATA>", state);
... | ALGO | 0.964993 | 4.63062 |
e6d1b6ef-54a1-4618-a24b-c51ca6ebabf6 | anandMohanan/practice | substring.cpp | #include <algorithm>
#include <iostream>
#include <unordered_map>
using namespace std;
int main() {
string s = "au";
int longest =0;
// for(int i=0;i<s.length();i++){
// int currLength{};
//
// unordered_map<char, bool> umap;
// for(int j=i;j<s.length();j++){
// char current = s[j];
// ... | ALGO | 0.999366 | 4.259984 |
0718315e-14d8-4c87-a1c4-39619db76dec | ishandutta2007/codeforces | wzyyn/normal/842/E.cpp | #include<bits/stdc++.h>
#define ll long long
#define ull unsigned ll
#define uint unsigned
#define pii pair<int,int>
#define pll pair<ll,ll>
#define IT iterator
#define PB push_back
#define fi first
#define se second
#define For(i,j,k) for (int i=(int)(j);i<=(int)(k);i++)
#define Rep(i,j,k) for (int i=(int)(j);i>=(int)... | ALGO | 0.99982 | 3.710447 |
dfa27813-ae7e-4ceb-81d5-e23dd170425b | stuartcarnie/clang | test/SemaCXX/constexpr-turing.cpp | // RUN: %clang_cc1 -verify -std=c++11 %s
// A direct proof that constexpr is Turing-complete, once DR1454 is implemented.
const unsigned halt = (unsigned)-1;
enum Dir { L, R };
struct Action {
bool tape;
Dir dir;
unsigned next;
};
using State = Action[2];
// An infinite tape!
struct Tape {
constexpr Tape() ... | ALGO | 0.981012 | 7.82371 |
be70f2a4-3c49-416b-a3f4-8a7f34625413 | ShivamVerma19/LeetcodeSolvedProblem | 0031-next-permutation/0031-next-permutation.cpp | class Solution {
public:
void nextPermutation(vector<int>& nums) {
int n = nums.size() ;
int x = -1 ;
for(int i = n-2 ; i >= 0 ; i--){
if(nums[i] < nums[i+1]){
x = i ;
break ;
}
}
int y = -1 ;
if... | ALGO | 0.99999 | 5.477101 |
af359d44-c0a3-466b-bd72-43e2fe161645 | man02123/leetcode-solutions | Reverse words in a given string - GFG/reverse-words-in-a-given-string.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
public:
//Function to reverse words in a given string.
string reverseWords(string s)
{
int i=s.size() ;
int j=i;
string res;
while(i>=0 && j>=0)
{
... | ALGO | 0.999672 | 5.685588 |
32dbab65-47bf-412b-be1f-4c6fa85754a6 | cjlworld/OJ | Acwing/acw#2847.cpp | #include<set>
#include<map>
#include<queue>
#include<stack>
#include<ctime>
#include<cmath>
#include<bitset>
#include<vector>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
const int N=1e5+5;
struc... | ALGO | 0.999666 | 3.848452 |
941cfa0b-667c-4963-9d95-7fc460401bb0 | ishandutta2007/codeforces | dingdingsb/normal/1583/A.cpp | // Problem: A. Windblume Ode
// Contest: Codeforces - Codeforces Round #749 (Div. 1 + Div. 2, based on Technocup 2022 Elimination Round 1)
// URL: https://codeforces.com/contest/1586/problem/A
// Memory Limit: 256 MB
// Time Limit: 1000 ms
//
// Powered by CP Editor (https://cpeditor.org)
#include<bits/stdc++.h>
#def... | ALGO | 0.999661 | 3.885813 |
1c4987fc-8f4b-4945-aa69-f575fe5f60a2 | Tornerro/POO-Tema-1 | main.cpp | #include <iostream>
#include "Matrice_Complexa.h"
int main()
{
Matrice_Complexa M;
nr_complex a,b,c;
std::cin>>a>>b>>c;
M=Matrice_Complexa(a,3,2);
Matrice_Complexa N = Matrice_Complexa(b,2,3);
Matrice_Complexa Q = Matrice_Complexa(c,3,2);
std::cout<<M;
std::cout<<M+Q;
std::cout<<M*N... | ALGO | 0.984005 | 4.089627 |
a95b551c-1ed8-47ed-b52b-c71703aeeea4 | praeclarum/ColmapSharp | eigen-3.3.7/doc/examples/nullary_indexing.cpp | #include <Eigen/Core>
#include <iostream>
using namespace Eigen;
// [functor]
template<class ArgType, class RowIndexType, class ColIndexType>
class indexing_functor {
const ArgType &m_arg;
const RowIndexType &m_rowIndices;
const ColIndexType &m_colIndices;
public:
typedef Matrix<typename ArgType::Scalar,
... | ALGO | 0.987159 | 7.050192 |
9ea3ccd5-70fd-4e17-a8b2-361bbb971c73 | cabelo/opencertiface | biometrics/3rdparty/eigen-eigen-c58038c56923/unsupported/doc/examples/MatrixFunction.cpp | #include <unsupported/Eigen/MatrixFunctions>
#include <iostream>
using namespace Eigen;
std::complex<double> expfn(std::complex<double> x, int)
{
return std::exp(x);
}
int main()
{
const double pi = std::acos(-1.0);
MatrixXd A(3,3);
A << 0, -pi/4, 0,
pi/4, 0, 0,
0, 0, 0;
std::... | ALGO | 0.99946 | 4.353816 |
bbd36dcb-5dd6-4ea0-9905-7fcc0070a25b | vuong123s/BaiTapCpp | 2312802_PKVuong_Lab2PhanD/KhoangCach/program.cpp | //Khai bao thu vien
#include <iostream>
#include <math.h>
using namespace std;
//Khai bao nguyen mau
double TinhKhoangCach(double xa, double ya, double xb, double yb);
//Ham main
int main() {
double xa, ya, xb, yb, kc;
cout << "Nhap hoanh do A : ";
cin >> xa;
cout << "Nhap tung do A : ";
cin >> ya;
cout <<... | ALGO | 0.99682 | 3.797826 |
1ceac305-3bbf-4c6a-9dfd-84bffb28e1bf | squaresLab/BatFix | results/transcoder/python/syntax/MAXIMUM_AVERAGE_SUM_PARTITION_ARRAY.cpp | #include <iostream>
#include <cstdlib>
#include <string>
#include <vector>
#include <fstream>
#include <iomanip>
#include <vector>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <numeric>
#include <algorithm>
using namespace std;
double f_gold ( vector < int > & A, int K ) {
... | ALGO | 0.998745 | 5.534157 |
7f74e320-1c75-4ba0-abe2-3ccc81e850cb | tontide1/DSA | Data Structures/Queue/daoNguoc_Queue.cpp | #include <stdio.h>
#define MAX_SIZE 100
typedef struct QUEUE{
int arr[MAX_SIZE];
int front;
int rear;
}Q;
void createQueue(Q *queue){
queue->rear = -1;
queue->front = -1;
}
int isFull(Q *queue){
return (queue->front == MAX_SIZE - 1);
}
int isEmpty(Q *queue){
return (queue->front == -1 && qu... | ALGO | 0.999964 | 3.448848 |
81ab0246-7660-4de0-8dad-523bf063568a | adarsh1445/dsapractice | trees/arrayimplementation.cpp | #include<iostream>
using namespace std;
int a[10000];
int d;
int getparent(int a){
int t;
t = (a-1)/2;
return t;
}
void inserta(int data,int t){
if(t==0){
a[0]=data;
return;
}
int i = getparent(t);
if(a[(2*i)+1] =='\0')
... | ALGO | 0.999936 | 4.092201 |
a2e04eec-06e1-4134-b4c1-cff49454a709 | Seyamalam/Codeforces | 1300-1500/1214 c. bad sequence.cpp | //Bismillahir Rahmanir Rahim
#include<bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define pb push_back
#define fastread() (ios_base:: sync_with_stdio(false),cin.tie(NULL));
using namespace std;
int main()
{
fastread();
ll n,f = 0,l = 0;
strin... | ALGO | 0.999915 | 3.969864 |
ec85f488-5926-4f36-9615-099776742067 | ShaliniVerma21/Cpp-Programming-Batch-12thMarch2025 | Day-13/p21.cpp | //7. Employee Salary Using Polymorphism
#include <iostream>
using namespace std;
class Employee {
public:
virtual double calculateSalary() = 0; // abstraction
};
class FullTime : public Employee {
double salary;
public:
FullTime(double s) : salary(s) {}
double calculateSalary() override {
ret... | TOOL | 0.913617 | 5.576385 |
d9c0c291-9788-4df9-b797-a3458614c87b | ishandutta2007/codeforces | wiwiho/normal/1375/A.cpp | //#define NDEBUG
#include <bits/stdc++.h>
#include <bits/extc++.h>
#define StarBurstStream ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define iter(a) a.begin(), a.end()
#define riter(a) a.rbegin(), a.rend()
#define lsort(a) sort(iter(a))
#define gsort(a) sort(riter(a))
#define pb(a) push_back(a)
#defi... | ALGO | 0.999517 | 4.243042 |
2236fd3f-3d5b-426f-a0b8-d99307568a97 | samfubuki/striver-sde-solutions | Day 21/serializeanddeserializeabinarytree.cpp | #include <bits/stdc++.h>
using namespace std;
// Tree Node
struct Node {
int data;
Node *left;
Node *right;
Node(int val) {
data = val;
left = right = NULL;
}
};
// Function to Build Tree
Node *buildTree(string str) {
// Corner Case
if (str.length() == 0 || str[0] == 'N')... | ALGO | 0.999638 | 7.068211 |
e8326e7a-c462-4020-b51b-e4aee0ee34f0 | nomicos/acmp | src/OK/0272.cpp | #include <iostream>
using namespace std;
int main()
{
int min = 10000 + 1;
int max = -10000 - 1;
int t;
for(int i = 1; cin >> t; ++i)
{
if((i % 2) && (t < min))
min = t;
else if(!(i % 2) && (t > max))
max = t;
}
cout << max + min;
return 0;
}... | ALGO | 0.996559 | 3.676584 |
4e732e40-ccff-4a92-a86b-e96db7cdea8b | feal-ca/Class-Code | ExercisesCpp/~/Documents/Code/ExercisesCpp/~/Documents/Code/ExercisesCpp/~/Documents/Code/ExercisesCpp/~/Documents/Code/ExercisesCpp/~/Documents/Code/ExercisesCpp/~/Documents/Code/ExercisesCpp/~/Documents/Code/ExercisesCpp/~/Documents/Code/ExercisesCpp/~/Documents/Code/ExercisesCpp/~/Documents/Code/ExercisesCpp/~/Docum... | #include <iostream>
#include <cmath>
using namespace std;
void mas_un_minuto(int& h, int& m){
m += 1;
if (m==60) {
m = 0;
h += 1;
if (h == 24) {
h = 0;
}
}
}
int main(){
int h,m,t;
while(cin >> h >> m >> t){
//11 veces cada vuelta entera
int campanadas = 0;
campanadas = c... | ALGO | 0.999744 | 3.982297 |
3ea99ff0-9dda-4369-afd4-e7774ddfaf11 | ejt1/spidermonkey-cmake | esr52/modules/fdlibm/src/e_atan2.cpp | /* @(#)e_atan2.c 1.3 95/01/18 */
/* __ieee754_atan2(y,x)
* Method :
* 1. Reduce y to positive by atan2(y,x)=-atan2(-y,x).
* 2. Reduce x to positive by (if x and y are unexceptional):
* ARG (x+iy) = arctan(y/x) ... if x > 0,
* ARG (x+iy) = pi - arctan[y/(-x)] ... if x < 0,
*
* Special cases:
*
* ATA... | ALGO | 0.998401 | 6.955112 |
1a03911f-4e33-4c82-9f6d-9e2a00602a4f | hlrs-vis/covise | src/kernel/do/covise_gridmethods.cpp | #include "covise_gridmethods.h"
#define CELL_TYPES_ONLY
#include <do/coDoUnstructuredGrid.h>
#include <cmath>
#include <cfloat>
#include <cstring>
#include <time.h> // for time
#include <climits>
#include <cstdio>
#include <cstdlib>
#include <cassert>
#include "Triangulate.h"
using namespace covise;
// Input:
// arra... | ALGO | 0.999752 | 5.261479 |
5750134c-6da0-4115-9020-5a9986513fc2 | ChetanThorat18/LeetCode | Leetcode_Problems/1235-maximum-profit-in-job-scheduling/1235-maximum-profit-in-job-scheduling.cpp |
class Solution {
public:
int n;
int dp[50001];
// Comparator function to sort jobs based on their start times
static bool myComparator(vector<int>& v1, vector<int>& v2) {
// Compare jobs based on their start times
return v1[0] < v2[0];
}
int getNextJobIndex(vector<vector<int... | ALGO | 0.999988 | 6.313949 |
7b29285a-3497-4367-910a-3d5bda7bb6a3 | ramanqul/pp2018 | week6/ex6.cpp | #include<iostream>
using namespace std;
int main() {
string str = "Peter has 5 apples. Bob has 4 apples. John has 0 apples.";
int position = str.find("apples");
cout << position << endl;
return 0;
} | ALGO | 0.981723 | 4.41173 |
7ff86083-0a13-4fcd-9526-0be6e8304b60 | sjcbulldog/xeroarm | xeroarm/eigen-3.4.0/bench/benchmarkX.cpp | // g++ -fopenmp -I .. -O3 -DNDEBUG -finline-limit=1000 benchmarkX.cpp -o b && time ./b
#include <iostream>
#include <Eigen/Core>
using namespace std;
using namespace Eigen;
#ifndef MATTYPE
#define MATTYPE MatrixXLd
#endif
#ifndef MATSIZE
#define MATSIZE 400
#endif
#ifndef REPEAT
#define REPEAT 100
#endif
int mai... | ALGO | 0.936659 | 3.370773 |
fb241b2e-b7c8-47c9-95db-23c1c8bb4aef | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_10008_0.cpp | #include <bits/stdc++.h>
using namespace std;
int read() {
int x = 0, f = 1;
char c = getchar();
while (c < '0' || c > '9') {
if (c == '-') f = -1;
c = getchar();
}
while (c >= '0' && c <= '9') {
x = x * 10 + c - '0';
c = getchar();
}
return x * f;
}
int n, m, head[200005], cnt = 0, father... | ALGO | 0.999933 | 4.399164 |
058c462b-dcc7-418b-87ad-fb1dc1f92358 | gilbertoalexsantos/judgesolutions | Solved/UVA/@UVA 10258 - Contest Scoreboard/10258 - Contest Scoreboard.cpp | //Author: Gilberto A. dos Santos
//Website: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=1199
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <vector>
#include <sstream>
using namespace std;
struct d {
int pro... | ALGO | 0.997356 | 3.005821 |
34c6e391-6597-4478-a12a-f5116a524ff7 | zhuminjie/OpenSeesPy | SRC/element/UWelements/BeamContact3D.cpp | // Written: Kathryn A. Petek
// Created: 06/05
//
// Revisions
// 06/05 created
// 10/07 Peter Mackenzie-Helnwein: adding recorder features
// 11/10 F.Mckenna and C.McGann: changes for incorporation into main source code
// 02/11 C.McGann: added initial contact switch (default is inContact)
//
// Descriptio... | TOOL | 0.989004 | 4.383259 |
b8ad8927-f5f1-44ad-bc2b-8db9344f0053 | LineageOS/android_external_armnn | src/armnnTfParser/TfParser.cpp | #include "TfParser.hpp"
#include <armnn/TypesUtils.hpp>
#include <armnn/Descriptors.hpp>
#include <armnnUtils/Permute.hpp>
#include <armnnUtils/DataLayoutIndexed.hpp>
#include <armnnUtils/Transpose.hpp>
#include <armnn/utility/IgnoreUnused.hpp>
#include <armnn/utility/NumericCast.hpp>
#include <armnn/utility/Polymorp... | TOOL | 0.913925 | 4.312485 |
c087c295-e655-4fa4-af8e-1ea4b7e5b0bc | shuai/Algorithm | Algorithm/knapsack.cpp | //
// knapsack.cpp
// Algorithm
//
// Created by Shuai on 8/19/12.
//
//
//Exercises 16.2-2
//Give a dynamic-programming solution to the 0-1 knapsack problem that runs in O(n W) time,
//where n is number of items and W is the maximum weight of items that the thief can put in his knapsack.
#include <vector>
#includ... | ALGO | 0.999964 | 5.547031 |
2f128a1e-84f2-46fc-92af-869503e5c6ff | Manish-cloud/Object-Oriented-Programming-Concepts | SelectionSort.cpp | /*
* File: SelectionSort.cpp
* Author: Manish
*
* Created on 28 September, 2018, 9:18 AM
*/
#include <cstdlib>
#include <iostream>
#define SIZE 10
using namespace std;
template <class X>
//class number
//{
// private:X a[SIZE];
// int size;
//
// public:void get()
// {
// cout<<"\nEnter number of... | ALGO | 0.997486 | 4.429351 |
850a7e7b-ce13-489c-b0c6-a05aeeb26222 | primihub/primihub | src/primihub/kernel/pir-acc/SIGMA/src/util/polyarithsmallmod.cpp | #include "util/polyarithsmallmod.h"
#include "util/uintarith.h"
#include "util/uintcore.h"
#ifdef SIGMA_USE_INTEL_HEXL
#include "hexl/hexl.hpp"
#endif
using namespace std;
namespace sigma
{
namespace util
{
void modulo_poly_coeffs(ConstCoeffIter poly, std::size_t coeff_count, const Modulus &modulus, ... | ALGO | 0.995502 | 6.45671 |
f7a63b0e-6b7e-478f-8959-db87b05c1a83 | ericktq/CC2B | euler10.cpp | #include<iostream>
#include<vector>
long long int sum=0;
using namespace std;
void sumprimos()
{
for(int i=2;i<2000000;i++)
{
int n=1;
for(int j=2;j*j<=i;j++)
{
if(i%j==0)
{
n=0;
break;
}
}
if(n==1)
{
sum+=i;
}
}
cout<<sum;
}
int main()
{
sumprimos();
}
| ALGO | 0.999808 | 4.513999 |
67141f61-7e59-4b31-830e-c987db4ebeea | Code-OS/frameworks_av | media/libstagefright/codecs/amrwb/src/deemphasis_32.cpp | /*
------------------------------------------------------------------------------
Filename: deemphasis_32.cpp
Date: 05/08/2004
------------------------------------------------------------------------------
REVISION HISTORY
Description:
-----------------------------------------------------------------------... | ALGO | 0.999758 | 6.02347 |
93e5546e-361d-4f7f-8c15-849052d75ed7 | shu8Cream/atcoder-archive | atcoder.jp/abc184/abc184_a/Main.cpp | #include <bits/stdc++.h>
using namespace std;
#include <atcoder/all>
using namespace atcoder;
#define rep(i,n) for (int i=0; i<(n); i++)
using ll = long long;
using P = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vi>;
using Graph = vvi;
int main(){
int a,b,c,d;
cin >> a >> b >> c >> d;
cout << a*... | ALGO | 0.999513 | 4.142718 |
25e13036-14a0-4bd0-9883-26b0f90425f9 | PriyanshK09/Leetcode-Discord-Bot | solutions/maximum-sum-bst-in-binary-tree.cpp | // Time: O(n)
// Space: O(h)
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
// dfs solution with stack
class Solution {
public:
int maxSumBST(TreeNode* root) {
... | ALGO | 0.99999 | 7.209581 |
ec0f4b33-d72c-4c31-a902-3fb2e17a10da | soysnorre/Marlin-212-Prod-CR10S-SKR2-TMC2209 | Marlin/src/feature/bedlevel/abl/bbl.cpp | #include "../../../inc/MarlinConfig.h"
#if ENABLED(AUTO_BED_LEVELING_BILINEAR)
#include "../bedlevel.h"
#include "../../../module/motion.h"
#define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE)
#include "../../../core/debug_out.h"
#if ENABLED(EXTENSIBLE_UI)
#include "../../../lcd/extui/ui_api.h"
#endif
LevelingBili... | ALGO | 0.98375 | 6.170388 |
719baa24-a3e9-44ae-a2b4-35a8a7ba01ba | LuckyN510/CODE_PTIT | DSA/Sap_xep tim_kiem/DSA06031_PHAN TU LON NHAT TRONG DAY CON.cpp | #include<bits/stdc++.h>
using namespace std;
int solve(int a[], int l, int r){
int maxVal = -1e9;
for(int i = l; i <= r; i++){
maxVal = max(a[i], maxVal);
}
return maxVal;
}
int main(){
int t; cin >> t;
while(t--){
int n, k;
cin >> n >> k;
int a[n];
for... | ALGO | 0.999921 | 3.930451 |
80254fd3-1759-4946-878e-29a04dd70eb5 | eldeshue/PS | BOJ/unclassified/1485_solved.cpp | // ̿ 簢 Ǵ
#include <iostream>
#include <array>
using point = std::pair<long long, long long>;
std::array<point, 4> points;
long long dot(const point& v1, const point& v2)
{
return v1.first * v2.first + v1.second * v2.second;
}
bool is_square()
{
// vectorize
for (int i = 1; i < 4; ++i)
{
points[i].first -= poi... | ALGO | 0.999806 | 4.867367 |
932ef518-7b48-46e8-ba45-3568285e7c03 | Gemmon/WAT | PO/Lab_2.cpp | #include <iostream>
using namespace std;
class WezelListy{
public:
string imieStudenta;
string nazwiskoStudenta;
double sredniaOcenStudenta;
char plecStudenta;
WezelListy* wskNastepny;
WezelListy* wskPoprzedni;
WezelListy(string imStudenta, string nzStudenta, double srOcStudenta, char ... | TOOL | 0.943214 | 4.006391 |
45c84a97-e6bd-480d-8146-56cfa730c4b8 | Kirti123x/codeforces | B_Lunatic_Never_Content.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int t;
cin>>t;
for(int k = 0; k<t; k++){
int n;
cin >> n;
vector<int> v(n);
for (int i = 0; i < n; i++){
cin >> v[i];
}
int mod = 0;
for (int i = 0; i < n / 2; i++){
... | ALGO | 0.999943 | 3.75758 |
7ff4c669-8df0-4b66-af00-ff7fad4de157 | Ablution-han220/LeetCode | src/8.string-to-integer-atoi.cpp | /*
* @lc app=leetcode id=8 lang=cpp
*
* [8] String to Integer (atoi)
*/
// @lc code=start
// class Solution {
// public:
// int myAtoi(string s) {
// int res = 0;
// bool flag = true;
// bool op_flag = true;
// bool has_num = false;
// for(int i = 0; i < s.size();i++){
/... | ALGO | 0.999715 | 5.700081 |
abfaae29-4c9f-4dfd-b93c-e64b94a9c9a4 | cjl3230/SOUI2.backup | third-part/skia/src/pathops/SkPathOpsSimplify.cpp | #include "SkAddIntersections.h"
#include "SkOpEdgeBuilder.h"
#include "SkPathOpsCommon.h"
#include "SkPathWriter.h"
static bool bridgeWinding(SkTArray<SkOpContour*, true>& contourList, SkPathWriter* simple) {
bool firstContour = true;
bool unsortable = false;
bool topUnsortable = false;
bool firstPass ... | ALGO | 0.999004 | 6.382773 |
d6aa1927-ee67-4f3c-9907-7af80e6d2f19 | zegiha/algorithm | gold/17244/17244.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <tuple>
using namespace std;
using pii = pair<int, int>;
using tiii = tuple <int, int, int>;
const int dy[] = {0, 0, 1, -1}, dx[] = {1, -1, 0, 0};
int maxCol, maxRow, arr[50][50], ans;
pii s;
vector <pii> itemLocation;
void input() {
cin >> maxCol >>... | ALGO | 0.999888 | 3.913445 |
b5414bc4-8f1a-43f8-a505-5073f3755bdc | EmreeYsr/Personel--Takip-Otomasyonu | Personel Takipi/PersonelTakipi/packages/emgucv-master/Emgu.CV.Extern/rgbd/rgbd_c.cpp | #include "rgbd_c.h"
cv::rgbd::Odometry* cveOdometryCreate(
cv::String* odometryType,
cv::Algorithm** algorithm,
cv::Ptr<cv::rgbd::Odometry>** sharedPtr
)
{
#ifdef HAVE_OPENCV_RGBD
cv::Ptr<cv::rgbd::Odometry> odometry = cv::rgbd::Odometry::create(*odometryType);
*sharedPtr = new cv::Ptr<cv::rgbd::Odometry>(odometr... | TOOL | 0.942194 | 5.83296 |
97ba1568-1845-4499-b894-1c45ce181d84 | ishandutta2007/codeforces | princebelkovetz/normal/1411/E.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <string>
#include <cmath>
#include <set>
#include <stack>
#include <map>
#include <unordered_map>
#include <queue>
#include <iterator>
#include <sstream>
#include <cassert>
#include <locale>
#include <numeric>
#include <random>
#def... | ALGO | 0.999991 | 4.260649 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.