uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
712dba5d-7085-4fde-800e-10ca3a479af8 | AndreaRoberti/dvrk_altair | cisst/cisstMesh/code/msh2AlgDirPDTreevonMisesPointCloud.cpp | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* ex: set filetype=cpp softtabstop=4 shiftwidth=4 tabstop=4 cindent expandtab: */
#include <cisstMesh/msh2AlgDirPDTreevonMisesPointCloud.h>
#include <limits>
double msh2AlgDirPDTreevonMisesPointCloud::FindClosestPointOnDatum(const vc... | ALGO | 0.999324 | 6.477426 |
b4e266de-7475-402e-a799-c9c254c4c0e8 | PriyankaBh26/system_modeling_and_control | src/state_estimators/unscented_kalman_filter.cpp | # include <iostream>
# include <vector>
# include <Eigen/Dense>
# include "state_estimators/unscented_kalman_filter.h"
using Eigen::MatrixXd;
using Eigen::VectorXd;
using Eigen::LLT;
UnscentedKalmanFilter::UnscentedKalmanFilter(VectorXd x0, MatrixXd P0, MatrixXd Q,
Matri... | ALGO | 0.999668 | 7.263913 |
7471ef4a-92f4-4a6a-b294-c57d84dc6d4c | kyw04004/ProblemSolving | BOJ/2118_두 개의 탑.cpp | #include<cstring>
#include<string>
#include<algorithm>
#include<iostream>
#include<stdio.h>
#include<vector>
#include<cmath>
#include<map>
using namespace std;
typedef long long ll;
int n,sum, arr[50001],ans, Max;
int main()
{
scanf("%d", &n);
for (int i = 1; i <= n; i++)
{
scanf("%d", &arr[i]);
sum += arr[i];
... | ALGO | 0.999957 | 3.526753 |
e8d18c49-0743-41db-9675-f6f0afd02aeb | hhhhc-da/Q-learning | Eigen/doc/examples/class_CwiseBinaryOp.cpp | #include <Eigen/Core>
#include <iostream>
using namespace Eigen;
using namespace std;
// define a custom template binary functor
template<typename Scalar> struct MakeComplexOp {
EIGEN_EMPTY_STRUCT_CTOR(MakeComplexOp)
typedef complex<Scalar> result_type;
complex<Scalar> operator()(const Scalar& a, const Scalar& b... | ALGO | 0.958212 | 6.700232 |
599ba56a-5cb6-49bb-8626-f281edfda0db | MarpleJane/KickStart | 2017_F/EatCake/eatCake.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int main()
{
int cakedp[10002];
cakedp[0] = 0;
for (int i = 1; i <= 10000; i ++)
{
cakedp[i] = cakedp[i - 1] + 1;
for (int j = 2; j * j <= i; j ++)
cakedp[i] = min(cakedp[i], cakedp[i - j * j] + 1);
}
int T, N;
ci... | ALGO | 0.999248 | 4.309267 |
daa2062f-b886-43c2-bb7d-449ea889bd2d | karthikcsit/My-LeetCode-Solutions | 0075-sort-colors/0075-sort-colors.cpp | class Solution {
public:
void sortColors(vector<int>& arr)
{
int low=0,mid=0,high=arr.size()-1;
while(mid<=high)
{
if(arr[mid]==0)
{
swap(arr[low],arr[mid]);
low++;
mid++;
}
else if(arr[mid]==... | ALGO | 0.999889 | 5.933358 |
47ee7ffc-4e86-4c7d-afcc-867e37d11324 | purseclab/M2MON | microkernel/SVF/lib/MSSA/SVFGOPT.cpp | /*
* @file: SVFGOPT.cpp
* @author: yesen
* @date: 31/03/2014
* @version: 1.0
*
* @section LICENSE
*
* @section DESCRIPTION
*
*/
#include "MSSA/SVFGOPT.h"
#include "Util/AnalysisUtil.h"
#include <llvm/Support/CommandLine.h>
using namespace llvm;
static cl::opt<bool> ContextInsensitive("ci-svfg", cl::init(fa... | ALGO | 0.947069 | 6.078759 |
25655c4c-1f21-46ad-94ec-acc868279b5d | pranavr93/Codechef | eleexams.cpp | /* Author : Pranav
BITS PILANI Hyderabad Campus */
// Cool Guys
#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <algorithm>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <cstring>
using namespace std;
#def... | ALGO | 0.997942 | 3.040262 |
7d77c0c2-9f5a-4e11-988d-4fe4e7fc0148 | joel2995/Striver-A-Z-DSA-Sheet-Cpp | 01. Basics/Pattern/pattern20.cpp | // Input:
// ‘N’ = 3
// Output:
// * *
// * * * *
// * * * * * *
// * * * *
// * *
#include <bits/stdc++.h>
using namespace std;
void symmetry(int n)
{
int row=(2*n)-1,sp=n+1,star=1;
for(int i=0;i<row;i++)
{
for(int j=0;j<star;j++) cout<<"* ";
for(int j=0;j<sp;j++... | ALGO | 0.999932 | 4.332756 |
256294d8-b456-41f5-beb1-aa87e744a443 | masoudbehzadinasab/Trilinos_12_11 | packages/fei/base/fei_FEDataFilter.cpp | /*--------------------------------------------------------------------*/
/* Under the terms of Contract DE-AC04-94AL85000, there is a */
/* of the U.S. Government. Export of this program may require */
/*--------------------------------------------------------------------*/
#include <fei_macros.hpp... | TOOL | 0.977774 | 5.351472 |
e82a9dd3-b458-464b-a7bb-b7933d50f560 | jpl917/GeometricSLAM | Thirdparty/g2o/g2o/examples/interactive_slam/g2o_interactive/graph_optimizer_sparse_online.cpp | #include "types_slam2d_online.h"
#include "types_slam3d_online.h"
#include "graph_optimizer_sparse_online.h"
#include "g2o/stuff/macros.h"
#include "g2o/core/block_solver.h"
#include "g2o/core/optimization_algorithm_factory.h"
#include "g2o/core/optimization_algorithm_gauss_newton.h"
#include "g2o/solvers/pcg/linear... | ALGO | 0.998943 | 6.130677 |
e3291aa3-e85e-43c3-824d-445203937a2c | kendlera/AdventOfCode | 2017/2017day7.cpp | #include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <set>
#include <map>
int balance_tree(std::string root, std::map<std::string, int> program_weights, std::map<std::string, std::vector<std::string> > supports);
void part_one() {
using namespace std;
string line;
string paren ... | ALGO | 0.997171 | 4.235214 |
0cb03959-6cc3-47df-87cc-6897ddced569 | Aonay/Fatec | Estrutura_Dados/Lista_Exercicios_4/conversaograus.cpp | #include <iostream>
using namespace std;
float calcCel(float f){
return (f-32)/1.8;
}
float calcFah(float c){
return (c/5*9)+32;
}
int main()
{
float celsius,fahrenheit;
int valor;
cout<< "Escolha 1 para converter para Celsius e 2 para Fahrenheit\n";
cin>>valor;
if(valor ==... | TOOL | 0.887122 | 5.060772 |
0c051985-3fbe-421a-97ea-e04a869b9188 | kmjp/procon | atcoder/agc001-040/agc039/b.cpp | #include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;
#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZER... | ALGO | 0.999935 | 4.194519 |
864ef167-64e2-4193-b7b9-bf9d26a8a9e3 | AdvTrainEvalSrcDomain/adv-train-evaluation-source-code-domain | code-imitator/data/dataset_2017/dataset_2017_8_formatted/watlac/8294486_5654117850546176_watlac.cpp | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define ft first
#define sd second
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
#ifdef LOCAL
#define eprint(x) cerr << #x << " = " << x << endl
#define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
#def... | ALGO | 0.996639 | 3.755272 |
1ba44c58-b860-4230-a128-0b2560829224 | yinheyi/my-caffe | src/caffe/solvers/adagrad_solver.cpp | #include <vector>
#include "caffe/sgd_solvers.hpp"
namespace caffe {
#ifndef CPU_ONLY
template <typename Dtype>
void adagrad_update_gpu(int N, Dtype* g, Dtype* h, Dtype delta,
Dtype local_rate);
#endif
template <typename Dtype>
void AdaGradSolver<Dtype>::ComputeUpdateValue(int param_id, Dtype rate) {
const ve... | ALGO | 0.998019 | 7.614933 |
30f864df-8ad5-43d7-af98-e284cfd62a0e | krebsalad/ProjectAbsoluteAccuracy | src/industrial_trajectory_filters/src/n_point_filter.cpp | //#include <arm_navigation_msgs/FilterJointTrajectoryWithConstraints.h>
#include <trajectory_msgs/JointTrajectory.h>
#include <industrial_trajectory_filters/n_point_filter.h>
using namespace industrial_trajectory_filters;
const int DEFAULT_N = 2;
template<typename T>
NPointFilter<T>::NPointFilter() :
FilterB... | TOOL | 0.864535 | 6.201286 |
8474b3c4-4343-46f0-8a9b-01b23993caf0 | Rishita1304/Leetcode | 2356-largest-combination-with-bitwise-and-greater-than-zero/largest-combination-with-bitwise-and-greater-than-zero.cpp | class Solution {
public:
int largestCombination(vector<int>& can) {
int n = can.size(), ans=0;
for(int i=0;i<32;i++){
int cnt=0;
for(auto c:can){
if(c & (1<<i)) cnt++;
}
ans = max(ans, cnt);
}
return ans;
}
}; | ALGO | 0.998631 | 5.986728 |
b819e8b9-8761-4221-98c3-1b2661fa22f5 | hirenrathod4/Store-Inventory | CIS22C-Final-Group3/CIS22C-Final-Group3/FileIO.cpp | #include "FileIO.h"
#include <fstream>
namespace FileIO
{
namespace
{
const std::string DELIM_ITEM = "item";
const std::string DELIM_UID = "UID";
const std::string DELIM_UPC = "UPC";
const std::string DELIM_NAME = "name";
const std::string DELIM_SIZE = "size";
const std::string DELIM_CATEGORY = "categor... | TOOL | 0.934716 | 5.644475 |
0edbb82e-1e92-4a3b-8022-6b65d15c8118 | SeptiLutfiana/2141720038-mobile-2023 | week13/src/stream_septi/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.997816 | 6.763549 |
043c79f5-b768-4bd0-8117-2902359ab373 | winhtut/DSA-By-WinHut-NCC- | InsertionSort.cpp | #include "stdio.h"
void insertionSort(int arr[],int arrSize){
int i; //For outer loop
int j; // for swapping data
int temp; // to stored data temporary
for(i=1; i<arrSize ; i++){ //outer loop
j=i;
while ( j > 0 && arr[j-1]> arr[j]){ // inner loop
temp = arr[j];
... | ALGO | 0.999954 | 4.169195 |
db2a29b7-1219-41e1-b2a5-d9ed71b602c0 | Jai4/UCSD---Specialization | src/Course 3/Week 4/DetectingAnomaliesinCurrencyExchangeRates.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pll;
typedef vector<pair<pll, ll>> vpll;
typedef priority_queue<pll, vector<pll>, greater<pll>> qpll;
typedef vector<ll> vll;
typedef list<pll> lpll;
typedef pair<pair<ll, ll>, ll> p;
typedef lpll::iterator uit;
#define sz size_t
#... | ALGO | 0.99979 | 4.295444 |
f5376bea-ec12-4b63-9cfb-2d0c255dc00e | girirajbidwai/-6companies30days | MICROSOFT/DAY3/shortest_unsorted_continuous_array.cpp | /LEETCODE 581.SHORTEST UNSORTED CONTINUOUS ARRAY
//NOT OPTIMAL SOLUTION DUE TO RUNTIME ERROR
class Solution {
public:
int findUnsortedSubarray(vector<int>& nums) {
stack<int> st;
vector<int> temp;
int start = 0;
int end = nums.size();
int end1 = nums.size()-1;
int e... | ALGO | 0.99993 | 6.140181 |
9aa6e314-20d7-4ed1-b159-3c741e71a8b1 | thtrang68/b7 | ooo.cpp | #include <stdio.h>
int main(){
int n, arr[100], max,min,sum = 0 ;
printf("nhap so luong phan tu: ");
scanf("%d",&n);
printf("nhap cac phan tu:\n");
for (int i = 0; i < n; i ++){
scanf("%d",&arr[i]);
sum += arr[i];
if (i == 0) {
max = min = arr[i];
}else {
if (arr[i] > max) max = arr[i];
if (arr... | ALGO | 0.98692 | 3.051155 |
8a28c48c-d5de-48f3-a847-db68e13d3389 | XxZhang2017/C-Algorithm | graph.cpp | /*
* graph.cpp
* for undirected graph;
* Created on: 201796
* Author: xinyi zhang
*/
#include<iostream>
#include"graph.h"
using namespace std;
graph::graph(int V){
this->V=V;
adj=new list<int>[V];
treeStruct=new list<int>[V];
}
void graph::addEdge(int v, int w){
adj[v].push_back(w);
/*bool flag=false;
do... | ALGO | 0.999476 | 4.854437 |
7d4867a5-382a-441f-9ccf-8bde00984ea7 | prglab/cryptagram | experimental/lib/src/cryptopp/rc2.cpp | // rc2.cpp - written and placed in the public domain by Wei Dai
#include "pch.h"
#include "rc2.h"
#include "misc.h"
#include "argnames.h"
NAMESPACE_BEGIN(CryptoPP)
void RC2::Base::UncheckedSetKey(const byte *key, unsigned int keyLen, const NameValuePairs ¶ms)
{
AssertValidKeyLength(keyLen);
int effectiveLen =... | ALGO | 0.925569 | 7.718327 |
510b4bc7-513e-41cd-baea-5fe36a2b372f | virtuosohy/C-Data-Structure | 实验三/树.cpp | #include <iostream>
#include <queue>
using namespace std;
// ڵṹ
template <typename T>
struct BiTNode {
T data;
BiTNode<T> *lchild;
BiTNode<T> *rchild;
BiTNode(T x) : data(x), lchild(NULL), rchild(NULL) {}
};
//
template <typename T>
class BiTree {
private:
BiTNode<T> *root;
public:
// ʼ
... | ALGO | 0.999747 | 4.330528 |
05c242a9-6695-4127-a882-baea441cb40a | pandayed/LeetCode | 387-first-unique-character-in-a-string/387-first-unique-character-in-a-string.cpp | class Solution {
public:
int firstUniqChar(string s) {
vector<int> freq(256, -1);
int n=s.size(), i, res=INT_MAX;
for(i=0; i<n; ++i){
if(freq[s[i]]==-1){
freq[s[i]]=i;
}
else{
freq[s[i]]=-2;
}
}
f... | ALGO | 0.999812 | 5.840797 |
a082b5e9-d4f9-4ff1-935f-13b50f416f2d | dayvidjuni/trabajos | I unidad/Homework1/DivisionDosNumeros.cpp | /*3. Escriba un código para resolver la división de dos números.*/
#include <iostream>
int main(){
float n1,n2,cociente;
inicio:
std::cout<<"ingrese el dividendo: \n";
std::cin>>n1;
std::cout<<"\n";
std::cout<<"ingrese el divisor: \n";
std::cin>>n2;
if (n2==0)
{
std:... | ALGO | 0.876908 | 3.291417 |
e0388bf7-9557-4bd5-b63e-37c96c220de7 | yuyingzz/GPU-Accelerated-Speech-Recognition | CTCBeamSearch.cpp | #include <algorithm>
#include <iostream>
#include "CTCBeamSearch.h"
using namespace std;
float* getRowData(float* data, int row, int length){
float* ret= new float[length];
memcpy(ret, data+row*length, length*sizeof(float));
return ret;
}
void printMap (map<string, float> dict){
for(map<string, flo... | ALGO | 0.998735 | 4.544756 |
e0fcfd7f-2a4d-408c-915b-a51c61eda35e | Sharik214/Sharik214 | Functions/program1.cpp | /*Refer to the CIRCAREA program in Chapter 2, “C++ Programming Basics.” Write a func- tion called circarea() that finds the area of a circle in a similar
way. It should take an argument of type float and return an argument of the same type. Write a main() func- tion that gets a radius value from the user,
calls circar... | ALGO | 0.995428 | 4.739424 |
5d946dcd-48c5-4c27-91c4-d655416ed84c | cvc5/cvc5 | test/api/cpp/issues/issue7000.cpp | #include <cvc5/cvc5.h>
#include <cassert>
using namespace cvc5;
int main(void)
{
TermManager tm;
Solver solver(tm);
Sort s1 = tm.getIntegerSort();
Sort s2 = tm.mkFunctionSort({s1}, s1);
Sort s3 = tm.getRealSort();
Term t4 = tm.mkPi();
Term t7 = tm.mkConst(s3, "_x5");
Term t37 = tm.mkConst(s2, "_x32")... | ALGO | 0.879327 | 6.816299 |
7447591a-01a0-440e-a72a-1693c208fc57 | itsactuallyashish/cppfiles | Collecting_Numbers_II.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
int main(){
int n;cin>>n;
int m;cin>>m;
vector<ll>number(n+1),pos(n+1);
for(int i=1;i<=n;i++){
ll x;cin>>x;
number[i]=x;
pos[number[i]]=i;
}
ll pass=1;
for(int i=1;i<n;i++){
if(pos[i]>pos[i+1])
pass++;
}
... | ALGO | 0.999963 | 4.105849 |
c6b36481-a292-4be3-ab74-01996063abe6 | kodi-pvr/pvr.wmc | src/utilities.cpp | #include "utilities.h"
#include <cstdarg>
#include <kodi/Filesystem.h>
#include <stdio.h>
#include <string>
#define FORMAT_BLOCK_SIZE 2048 // # of bytes to increment per try
namespace Utils
{
// format related string functions taken from:
// http://www.flipcode.com/archives/Safe_sprintf.shtml
bool Str2Bool(const s... | TOOL | 0.97628 | 5.762606 |
56621cc5-da24-463b-b323-e73dbeb4322e | scott-sihui-wang/LeetCode | 342_Power_of_Four.cpp | class Solution {
public:
bool isPowerOfFour(int n) {
if(n<=0)return false;
while(n>1){
if(n%4!=0){
return false;
}
n=n/4;
}
return true;
}
}; | ALGO | 0.999525 | 5.760556 |
6cb81743-2075-441a-9df9-9cbc83e56a2e | Saifu0/CP | Problems/candy3.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
int t;
cin >> t;
while(t--){
ll n,d;
cin >> n;
ll sum = 0;
for(int i=0;i<n;i++){
cin >> d;
sum = (sum%n + d%n)%n;
}
if(sum == 0) cout << "YES" << "\n";
else cout << "NO" << "\n";
}
} | ALGO | 0.998639 | 4.095554 |
fc41f5ea-9dc5-4701-9398-e14fe943b400 | HARIHARASUDHAN2002/Quranium_Core | gui-master/src/bitcoin-tx.cpp | #include <config/bitcoin-config.h> // IWYU pragma: keep
#include <chainparamsbase.h>
#include <clientversion.h>
#include <coins.h>
#include <common/args.h>
#include <common/system.h>
#include <compat/compat.h>
#include <consensus/amount.h>
#include <consensus/consensus.h>
#include <core_io.h>
#include <key_io.h>
#incl... | TOOL | 0.949309 | 6.187091 |
5c0bc85a-ddb9-438c-b2a9-ba417e94f317 | DenRen/BabichevAlgo | H8/H8.4-3-divisors/main_copy.cpp | #include "../numerus/numerus.hpp"
std::ostream&
solve (std::ostream& os,
unsigned n) {
auto primes = nrs::calc_primes <unsigned> (n);
std::vector <unsigned> nums (n + 1);
for (unsigned i = 2; i < primes.size (); ++i) {
auto p0 = primes[i];
for (auto p = p0; p < nums.size (); p += p0... | ALGO | 0.999066 | 4.842963 |
133e8d6a-e0c8-478f-9cb8-3a2eca2aeb13 | nilosoares/competitive-programming | CPP/String/is_palindrome.cpp | #include <iostream>
#include <string>
using namespace std;
bool isPalindrome(string s) {
int i = 0;
int j = s.length() - 1;
while (i < j) {
if (s[i] != s[j]) {
return false;
}
i++;
j--;
}
return true;
}
int main () {
string s;
cin >> s;
if (isPalindrome(s)) {
cout << s << " is a pali... | ALGO | 0.999558 | 5.357335 |
9e9dace1-02f9-4468-ae85-27af124b96b9 | yongming-qin/auto_car_experience_training | vtorcs-RL-color/src/modules/track/track4.cpp | #include <stdlib.h>
#include <math.h>
#include <stdio.h>
#include <tgf.h>
#include <robottools.h>
#include <track.h>
#include "trackinc.h"
static tdble xmin, xmax, ymin, ymax, zmin, zmax;
#define TSTX(x) do { \
if (xmin > (x)) xmin = (x); \
if (xmax < (x)) xmax = (x); \
} while (0)
#define TSTY(y... | TOOL | 0.892214 | 3.636571 |
2968d5af-fe4b-41b6-8929-99e5c144f7d5 | beomjunlim/codetree-TILs | 240925/Carry 피하기/escaping-carry.cpp | #include <iostream>
#include <vector>
#include <cstring>
using namespace std;
int n;
int answer = 0;
int arr[21];
// carry 발생 여부를 체크하는 함수
bool checkCarry(const vector<int>& selected) {
int carry[10] = {0}; // 각 자리별로 합을 저장하는 배열
// 선택된 숫자들에 대해 각 자리의 합을 구함
for (int num : selected) {
for (int i = 0;... | ALGO | 0.99992 | 5.770533 |
20c12136-fc7d-497a-9776-bf4e6e1f07aa | thebigcorporation/libeigen | doc/examples/Tutorial_ReductionsVisitorsBroadcasting_visitors.cpp | #include <iostream>
#include <Eigen/Dense>
int main() {
Eigen::MatrixXf m(2, 2);
m << 1, 2, 3, 4;
// get location of maximum
Eigen::Index maxRow, maxCol;
float max = m.maxCoeff(&maxRow, &maxCol);
// get location of minimum
Eigen::Index minRow, minCol;
float min = m.minCoeff(&minRow, &minCol);
std... | ALGO | 0.999787 | 4.113153 |
262d6c63-3026-4d75-a6a9-92b58c427588 | Jopie64/jstd | Sha1.cpp | #include "Sha1.h"
#include "JStd.h"
#include <stdio.h> // Needed for file access
#include <memory.h> // Needed for memset and memcpy
//#include <string.h> // Needed for strcat and strcpy
#include <windows.h>
namespace JStd
{
using namespace std;
CSha1Hash::CSha1Hash()
{
memset(&m_digest, 0, sizeof(m_digest));
}
i... | TOOL | 0.881229 | 6.107386 |
45347aa3-57d0-4fcd-9c59-128054d114be | patidartanay/Codeforces | 1300-1399/1543B.cpp | #include"bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef vector<int> vi;
#define pb push_back
#define REP(i,a,b) for (int i = a; i <= b; i++)
#define nl endl
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int t;
cin >> t;
while(t--) {
ll n, sum=0;
ci... | ALGO | 0.999467 | 3.570666 |
478f7579-7def-4f89-b486-5f00d43838e7 | captainko/points | cListPoints.cpp | #include "stdafx.h"
#include "cListPoints.h"
using namespace std;
cListPoints::cListPoints() {
arr = NULL;
n = 1;
}
int cListPoints::GetN() {
return n;
}
void cListPoints::PrintList() {
for (int i = 0; i < n; i++) {
arr[i].print();
}
}
void cListPoints::LoadPoints(char *loc) {
ifstream file(loc);
if (file.... | ALGO | 0.997832 | 3.633465 |
12d208a3-d23d-49b3-9a5d-c537369b365e | nguyendo24/introduction_cpp_tselikis | Chapter_08/8_10.cpp | #include <iostream> // 8.10
int main()
{
int i, *ptr1, *ptr2, arr[] = {10, 20, 30, 40, 50, 60, 70};
ptr1 = &arr[2];
ptr2 = &arr[4];
for(i = ptr2-ptr1; i < 5; i+=2)
std::cout << ptr1[i] << ' ';
return 0;
}
| ALGO | 0.993296 | 3.386314 |
679ac2b9-393b-494c-93e5-5b964e4ef8b4 | gimozzi/algorithm | easy/BOJ_5355.cpp | #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
using namespace std;
int main (void) {
int T;
cin >> T;
cin.ignore();
while(T--){
char str[10001];
// cin >> str;
//cin >> str;
cin.getline(str, 10000);
// getchar();
// scanf("%[^... | ALGO | 0.986272 | 3.33838 |
b4286f31-b33a-4983-b118-c9314b617211 | cocomodo/myAlgorithm | barkingDog Algorithm/17_two_pointer/2003_수들의_합_2(myVER_array_옳은_풀이).cpp | #include <bits/stdc++.h>
using namespace std;
int n, m;
int a[10'005];
int main(){
ios::sync_with_stdio(0);
cin.tie(0);
cin>>n>>m;
for(int i=0; i<n; i++) cin>>a[i];
int ans=0,st=0,en=0,tot=a[0];
//a[n]==0; 전역변수로 선언했기 때문에 초기화가 0으로 되어있어서 불필요한 코드.
while(1){
if(tot==m) ans++;
i... | ALGO | 0.999922 | 4.463385 |
7865ef96-bb29-4f18-aebf-016b6824de65 | sagpant/swiftshader | third_party/llvm-7.0/llvm/lib/CodeGen/CalcSpillWeights.cpp | #include "llvm/CodeGen/CalcSpillWeights.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/CodeGen/LiveInterval.h"
#include "llvm/CodeGen/LiveIntervals.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/CodeGen/MachineLoopInfo.h"
#include "llvm/CodeGen/MachineOperand.h"
... | ALGO | 0.994226 | 7.736032 |
2d9a8b16-8fd7-4957-ba37-6a097d27fc5b | tS1lva/Exercicios_C | parte 2/5.cpp | #include <iostream>
using namespace std;
int main(){
int n,i,soma_crescente=1;
cout<<"Digite n ";
cin>>n;
int vetor[n];
for (i=0 ; i<n ; i++){
cout<<"\n\tValor ["<<i+1<<"] = ";
cin>>vetor[i];
}
for(i=0 ; i<n ; i++){
if(i > 0){
if(vetor[i]>vetor[i-1]){
... | ALGO | 0.999702 | 4.545853 |
7f79ddac-0aa8-4e6d-be53-5a34bcaba7fa | ImagineHJ/Problem-Solving | BOJ/14916.cpp | #include <iostream>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL); cout.tie(NULL); //faster
int n, n5, n2;
cin>>n;
if(n%2==0) // 짝수
{
n5 = n/5;
if(n5%2==1){ // 5원 개수도 짝수여야 함
n5--;
}
n2 = (n-5*n5)/2;
... | ALGO | 0.999844 | 4.3399 |
31fd51da-6ac6-4f21-b8a3-dc8fc743b946 | Narvdeshwar/CPP-DSA | election.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin >> t;
while (t--)
{
int a, b, c;
cin >> a >> b >> c;
string ans;
if (a > 50)
{
ans = "A";
}
else if (b > 50)
{
ans = "B";
}
else ... | ALGO | 0.999672 | 4.861357 |
864f77a0-614f-4489-b73f-822db56b3301 | nskprasanth/practice | sorting/count_inversions.cpp | /**
* Given an array of integers, count the number of inversions found
* Two elements a[i] and a[j] form an inversion if a[i] > a[j] and i < j
*
* Prasanth Kalapatapu
* Nov 12, 2015
*/
#include <iostream>
using namespace std;
int merge (int a[], int b, int m, int e) {
int count = 0;
int i=b, k=0;
i... | ALGO | 0.99995 | 4.674965 |
79bed464-feab-4e2f-bb75-239111887c1e | almondjain/FAANG-preparation | arrays/18.cpp | #include<bits/stdc++.h>
using namespace std;
//18
// Given an array of integers nums and an integer target,
//return indices of the two numbers such that they add up to target.
// You may assume that each input would have exactly one solution,
// and you may not use the same element twice.
// You can return the answe... | ALGO | 0.999829 | 4.989149 |
0975a86d-be2f-46e3-a10f-41311d28fe25 | ByConity/ClickHouse-llvm-project | polly/lib/CodeGen/Utils.cpp | #include "polly/CodeGen/Utils.h"
#include "polly/CodeGen/IRBuilder.h"
#include "polly/ScopInfo.h"
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/Analysis/RegionInfo.h"
#include "llvm/Transforms/Utils/BasicBlockUtils.h"
using namespace llvm;
// Alternative to llvm::SplitCriticalEdge.
//
// Creates a new block whic... | ALGO | 0.995999 | 7.711997 |
d3dc94af-d861-4274-bc14-198dbaf79c42 | pllossi/OliInfo | OIS/ois_f1/f1.cpp | // NOTE: it is recommended to use this even if you don't understand the following code.
#include <fstream>
#include <iostream>
#include <vector>
using namespace std;
// input data
int N;
vector<int> H, V;
int main() {
// uncomment the following lines if you want to read/write from files
// ifstream cin("i... | ALGO | 0.99986 | 3.036467 |
81cf509d-072d-4176-84d0-056ba243ce0f | sonvule59/CUDA_and_OpenMP | weakLLM_cuda_examples/hpc_coder_CUDA_Translated_p00001_v1/s028599501_omp.cpp | #include<iostream>
using namespace std;
__global__ void sort(int *mh, int N){
int t;
for(int i=0; i<N; i++){
for(int j=i+1; j<N; j++){
if(mh[i] < mh[j]){
t = mh[i];
mh[i] = mh[j];
mh[j] = t;
}
}
}
}
int main(){
int N = 10;
int t;
int mh[N];
for(int i=0; i<10; i++){
cin >> t;
if(t>=0... | ALGO | 0.999907 | 3.984003 |
2a6a106c-7e81-449c-b155-4cb41f524d2d | DevAggarwal03/DSA | Dp/matrixChainMul.cpp | #include "../stdc++.h"
using namespace std;
int f(int s, int e, vector<int>& dimensions, vector<vector<int> >& dp){
if(s == e) return 0;
if(dp[s][e] != -1) return dp[s][e];
int k = s;
int ans = INT_MAX;
while(k<e){
int steps = ((dimensions[s-1] * dimensions[k] * dimensions[e]) + f(s, k, dim... | ALGO | 0.999953 | 3.866518 |
f45ac3c4-248b-413c-b472-63ae215adbda | Jnshiroya/jenish-shiroya | vector.cpp | #include<iostream>
using namespace std;
class vector{
int a,b,c;
friend vector sumofvector(vector v1,vector v2);
public:
void intialization(int d,int e,int f){
a=d;
b=e;
c=f;
}
void display(){
cout<<a<<"i+"<<b<<"j+"<<c<<"k"<<endl;
}
};
vector sumofvector(vec... | TOOL | 0.952007 | 3.609891 |
5a9f9be2-d781-4cd6-bd5c-c1deacf29038 | besoir/csc454 | projectFive/cpp/Main.cpp | #include "vendingmachine.h"
#include "stdio.h"
#include "stdlib.h"
#include "string.h"
#include "fstream"
using namespace std;
int main() {
cout << "Enter Mode: ";
char m;
cin >> m;
cout << "Enter Starting State of the Machine: ";
int q = 0;
int d = 0;
int n = 0;
string in = "";
ci... | TOOL | 0.864327 | 5.021383 |
c6ed335d-44b4-4f8c-81f4-211b7fb38c87 | AMarchionna/Metodos-TP2 | eigen/unsupported/doc/examples/MatrixSine.cpp | #include <unsupported/Eigen/MatrixFunctions>
#include <iostream>
using namespace Eigen;
int main()
{
MatrixXd A = MatrixXd::Random(3,3);
std::cout << "A = \n" << A << "\n\n";
MatrixXd sinA = A.sin();
std::cout << "sin(A) = \n" << sinA << "\n\n";
MatrixXd cosA = A.cos();
std::cout << "cos(A) = \n" << cos... | ALGO | 0.982784 | 5.878768 |
07ec7f6a-bf22-4b72-adfa-4a67d4d0ad00 | dslab-epfl/asap | lib/CodeGen/SpillPlacement.cpp | #include "SpillPlacement.h"
#include "llvm/ADT/BitVector.h"
#include "llvm/CodeGen/EdgeBundles.h"
#include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/CodeGen/MachineBlockFrequencyInfo.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineLoopInfo.h"
#include "llvm/CodeGen/Passes.h"
#include ... | ALGO | 0.998797 | 7.711436 |
344cdcb5-7e47-4399-bdc0-3797eff4786d | mulongfu/Coursera | 程序设计与算法/《C++程序设计》/week7/编程题#1.cpp | #include <iostream>
using namespace std;
template <class T>
class CArray2D{
T **array2d;
CArray2D(int a, int b){
array2d = new T *[a];
for(int i = 0; i < a; i++)
array2d[i] = new T[b];
}
T* operator[] (int i){
return array2d[i];
}
};
template <class T>
class CArray3D{
public:
T ***array3d;
CArray3... | ALGO | 0.977916 | 3.259935 |
3b854de3-3981-4a1c-9751-76b9605a13ea | VictorL000/CompetitiveProgrammingSolutions | coci09c3p4.cpp | #include "bits/stdc++.h"
#ifdef DEBUGM
#define _GLIBCXX_DEBUG
#endif
using namespace std;
//pls dont read im just testing partial solution :(
int N, M;
long long ans;
priority_queue<pair<int, long long>, vector<pair<int, long long>>, greater<pair<int, long long>> > pq;
int main(){
cin.tie(0);
cin.sync_with_stdio(0);
... | ALGO | 0.999297 | 3.717662 |
37e33259-3414-4d9f-a499-08d2c1c6fe46 | lht06/openGauss-server | contrib/pgcrypto/crypt-md5.cpp | #include "postgres.h"
#include "knl/knl_variable.h"
#include "px.h"
#include "px-crypt.h"
#define MD5_SIZE 16
static const char _crypt_a64[] = "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
static void _crypt_to64(char* s, unsigned long v, int n)
{
while (--n >= 0) {
*s++ = _crypt_a... | TOOL | 0.946325 | 5.043775 |
a4ef90d3-26fb-4656-a060-ecf78ff03616 | ManIVIctorious/TheNumerov | TheNumerov/solvers/Armadillo_FillPeriodicAMatrix4D.cpp |
#include <stdio.h>
#include <armadillo>
#include "settings.h"
#include "ArmadilloFillers.h"
arma::sp_mat FillPeriodicArmadillo_4D(settings* prefs, int* nq, double* v, double ekin_to_oue, double* stencil){
// Calculate the maximum number of non-zero entries in the A matrix
// Should be <n_points - (n_stencil/2)*2> ... | ALGO | 0.934643 | 3.460428 |
6d12be84-16b6-46a8-9d96-754d4e93cb81 | AdityaMalu/LeetCode | 0542-01-matrix/0542-01-matrix.cpp | class Solution
{
public:
vector<vector<int>> updateMatrix(vector<vector<int>> &grid)
{
int n = grid.size();
int m = grid[0].size();
vector<vector<int>> vis(n, vector<int>(m, 0));
vector<vector<int>> dist(n, vector<int>(m, 0));
queue<pair<pair<int,int>, int>> q;
for(int i = 0;i<... | ALGO | 0.999956 | 5.840162 |
ab45edc6-97e4-4349-9aa5-1a0bd55c889d | by-student-2017/lammps-14May16 | src/USER-OMP/pair_coul_long_omp.cpp | /* ----------------------------------------------------------------------
Contributing author: Axel Kohlmeyer (Temple U)
------------------------------------------------------------------------- */
#include <math.h>
#include "pair_coul_long_omp.h"
#include "atom.h"
#include "comm.h"
#include "force.h"
#include "nei... | ALGO | 0.999537 | 5.798595 |
efe5e7a2-d414-4696-866f-93be8b428a5b | tasnia-tabassum18/CPP_Basics | Basic Functions/Fuctions 1D array/Frequency.cpp |
#include <iostream>
using namespace std;
int array_input(int[],int);
int array_frequency(int[],int,int);
int main()
{
int x[10], n_x, n,b;
n_x = array_input(x,n);
b = 5;
cout<<"Number of frequency: "<< array_frequency(x, n_x,b);
return 0;
}
int array_input(int a[],int n){
int i;
cout<<"ho... | ALGO | 0.999648 | 4.138468 |
3d82b204-ef0a-40c5-b74b-b1b36ad53b1e | Yukariko/study | 11_dp/11727.cpp | #include <bits/stdc++.h>
#ifdef ONLINE_JUDGE
#define endl '\n'
#endif
using ll = long long;
using ld = long double;
using namespace std;
const int MOD = 10007;
int main()
{
ios_base::sync_with_stdio(false); cin.tie(nullptr);
int N;
cin >> N;
vector<int> d(N+1);
d[1] = 1;
d[2] = 3;
for (i... | ALGO | 0.99998 | 4.647591 |
71fb7967-42ab-464a-bc8b-3aba5c51f6c5 | dwikprsty/SportifyApp | 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.998809 | 6.763549 |
7efd4837-9cb7-4477-b5d8-60e58d174cc7 | shubham-githb/LeetCode-Accepted-Solutions | first-unique-character-in-a-string/first-unique-character-in-a-string.cpp | class Solution {
public:
int firstUniqChar(string s) {
int n = s.length();
map<char,int> hmap;
for(int i=0;i<n;i++)
hmap[s[i]]++;
for(int i=0;i<n;i++)
{
if(hmap[s[i]]==1) return i;
}
return -1;
}
}; | ALGO | 0.999883 | 5.835789 |
fad5b762-ba95-455f-9b9c-b521fe9a1991 | qnhat2004/Thuat-toan-ung-dung | baitaptuluyen/bai8.cpp | #include <bits/stdc++.h>
using namespace std;
const int MAXN = 100;
const int MAXK = 5000;
int n, k;
int dp[MAXN][MAXN][MAXK];
int gen(int cur, int last, int product) {
if (cur == 0) {
return product >= k;
}
if (dp[cur][last][product] != -1) return dp[cur][last][product];
dp[cur][last][product... | ALGO | 0.999966 | 4.462567 |
4fc76b19-56ed-4c1a-b687-c91ca4b31943 | asal97/DTE-3607-Advanced-Game-and-Simulator-Programming | clients/godot/thirdparty/bullet/BulletSoftBody/btDeformableBodySolver.cpp | #include <stdio.h>
#include <limits>
#include "btDeformableBodySolver.h"
#include "btSoftBodyInternals.h"
#include "LinearMath/btQuickprof.h"
static const int kMaxConjugateGradientIterations = 300;
btDeformableBodySolver::btDeformableBodySolver()
: m_numNodes(0), m_cg(kMaxConjugateGradientIterations), m_cr(kMaxConjuga... | ALGO | 0.999361 | 4.055934 |
66ed5bff-ea1f-481e-bfe9-17c8dc28f45b | ThettOo/greenhouse_forecast | fastapiserver/Lib/site-packages/pystan/stan/lib/stan_math/lib/boost_1.69.0/libs/flyweight/example/custom_factory.cpp | /* We include the default components of Boost.Flyweight except the factory,
* which will be provided by ourselves.
*/
#include <boost/flyweight/flyweight.hpp>
#include <boost/flyweight/factory_tag.hpp>
#include <boost/flyweight/static_holder.hpp>
#include <boost/flyweight/simple_locking.hpp>
#include <boost/flyweight... | TOOL | 0.856557 | 7.779959 |
eadad720-d459-444d-8690-9042bb661b0d | omkarChend1kar/scoreboard | 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.998809 | 6.763549 |
c33d119f-a9e0-4229-b588-3a5206f5a57d | Ayush8532/DSA_Preparation | Recursion/Palindrom.cpp | #include<bits/stdc++.h>
using namespace std;
bool palindrom(string &str,int i,int j)
{
if(i>j)
{
return true;
}
if(str[i]==str[j])
{
return palindrom(str,i+1,j-1);
}
else{
return false;
}
}
int main()
{
string str="ababbaba";
int i=0;
int j=str.lengt... | ALGO | 0.999931 | 4.286204 |
999a7333-cded-4f20-a9ec-a6ff1d1c4a9f | Mrtriste/Leetcode | Solutions/120.cpp | #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
int minimumTotal(vector<vector<int>>& triangle) {
int n = triangle.size();
if(n==1) return triangle[0][0];
// vector<int> dp(n, 0);
// for(int j=0;j<n;++j) dp[j] = triangle[n-1][j];
// vector<int> dp ... | ALGO | 0.999934 | 5.377718 |
7b2637f7-0aba-43ab-9507-63914d3ab556 | Elroborn/nowcoder-offer | c/反转链表/Solution.cpp | #include<iostream>
struct ListNode {
int val;
struct ListNode *next;
ListNode(int x) :
val(x), next(NULL) {
}
};
class Solution {
public:
ListNode* ReverseList(ListNode* pHead) {
ListNode *new_head = new ListNode(-1);
ListNode *p = NULL;
while(pHead!=NULL){
p = pHead;
pHead = pHead->next;
/... | ALGO | 0.99995 | 4.607124 |
820eace7-7f88-4bf2-960c-35fcbd77f30e | partho-das/CompetitiveProgrmming | CP_CODE/Codeforces/Codeforces Round 943 (Div. 3)/d.cpp | #include <bits/stdc++.h>
using namespace std;
//____________________________________________________________________________________________________________________________________
#define PI 2*acos(0.0)
#define pf printf
#define sc scanf
#define ff first
#define ss second
#define pb push_back
typedef long long... | ALGO | 0.999939 | 3.631992 |
7754d526-ffee-49a6-9354-c799ccb90110 | sonakshinathani/TestGit | 42.cpp | /*
Sonakshi Nathani
IIIT-HYD
information:
#tags:
date: Mon Aug 25 17:24:07 IST 2014
*/
#include<stdio.h>
#include<stdlib.h>
#include<string>
#include<iostream>
#include<string.h>
#include<math.h>
#include<limits.h>
#include<algorithm>
#include<vector>
#include<map>
#include<queue>
using namespace std;
#define FOR(a,b... | ALGO | 0.999836 | 3.951366 |
e222417d-e53d-4b34-9a4f-f05d0dc25c37 | longcong1611/Ky_thuat_lap_trinh_C- | KLLUYTHUA001.cpp | #include <bits/stdc++.h>
using namespace std;
#define MAX 100000
int multiply(int x, int res[], int res_size) {
int carry = 0;
for (int i = 0; i < res_size; i++) {
int prod = res[i] * x + carry;
res[i] = prod % 10;
carry = prod / 10;
}
while (carry) {
res[res_size] = carry % 10;
carry = carry ... | ALGO | 0.999985 | 4.611754 |
a1508a50-0620-4129-bef9-581dc607abf0 | cscannell-inacloud/VisualStudio-Docs | docs/vs-2015/snippets/cpp/VS_Snippets_Winforms/ListView.ColumnClick/CPP/listviewsort1.cpp | //<Snippet1>
#using <System.dll>
#using <System.Drawing.dll>
#using <System.Windows.Forms.dll>
using namespace System;
using namespace System::Windows::Forms;
using namespace System::Drawing;
using namespace System::Collections;
// Implements the manual sorting of items by columns.
ref class ListViewItemComparer: pub... | TOOL | 0.999587 | 5.642681 |
67c73169-e2f1-4148-b2a0-9dce378e6432 | Saumitra11/DSA | Competitive Questions/spiral-order-matrix.cpp | #include <bits/stdc++.h>
using namespace std;
vector<int> spiralOrder(vector<vector<int>>& matrix){
vector<int> ans;
int m = matrix.size();
int n = matrix[0].size();
int sr, sc = 0;
int er = m-1;
int ec = n-1;
int count = 0;
while(sr<=er || sc<=ec){
... | ALGO | 0.999961 | 3.972853 |
5b488e60-57fa-4058-981f-f64cfb6ae2ac | CaptainHarryChen/OIerCode | Virtual Judge/POJ1862_Stripies.cpp | #include<cstdio>
#include<cmath>
#include<queue>
using namespace std;
priority_queue<double>str;
#define MAXN 105
int N;
int main()
{
scanf("%d",&N);
for(int i=1;i<=N;i++)
{
double m;
scanf("%lf",&m);
str.push(m);
}
for(int i=1;i<N;i++)
{
double a,b,c;
a=str.top();str.pop();
b=str.top();str.pop();
c... | ALGO | 0.999406 | 3.512645 |
0aaca436-f010-4a80-a6e3-150974acb4dd | electimon/llvm | libc/src/string/memmove.cpp | #include "src/string/memmove.h"
#include "src/__support/macros/config.h"
#include "src/string/memory_utils/inline_memcpy.h"
#include "src/string/memory_utils/inline_memmove.h"
#include <stddef.h> // size_t
namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(void *, memmove,
(void *dst, const void *s... | TOOL | 0.924829 | 7.754128 |
0ae50c8c-8824-43a7-8da0-3e8e9a20b285 | eangele1/CSE-30 | finalBST.cpp | #include <iostream>
#include "BSTComplete.h"
#include "BSTOps.h"
using namespace std;
int main(int argc, const char * argv[]) {
Node* tree = NULL;
tree = insert(tree, 6);
tree = insert(tree, 2);
tree = insert(tree, 7);
tree = insert(tree, 6);
tree = insert(tree, 6);
tree = insert(tre... | ALGO | 0.989049 | 5.465758 |
b57f0a14-9810-4291-ad87-c6627fd93296 | QQ-BangxinXu/CodingInterviews | 032-从1到n整数中1出现的次数/01-bruteforce.cpp | #include <iostream>
using namespace std;
// Կ
#define __tmain main
#ifdef __tmain
#define debug cout
#else
#define debug 0 && cout
#endif // __tmain
class Solution
{
public:
/**
* [NumberOf1Between1AndN_Solution ͳ1n1ֵĴ]
* @Author gatieme
* @DateTime 2016-05-01T22:03:43+0800
* @param ... | ALGO | 0.999159 | 5.486438 |
697e0129-e617-4143-b319-9eb18f4a8e23 | yaroslav-shlapak/PJC | lab05/user-defined-types.cpp | #include <vector>
#include <string>
#include <algorithm>
#include <fmt/core.h>
#include <fmt/ranges.h>
struct Point {
int x, y;
};
//auto distanceTo(Point const candidate) {
// auto const xs = candidate.x - destination.x;
// auto const ys = candidate.y - destination.y;
// return xs * xs + ys * ys;
//};
aut... | ALGO | 0.99912 | 5.252095 |
5768ff25-ecb1-4178-af30-18ad330943fb | Auburngrads/SMRD | src/GENFUN_outfun_functg_funcg_func2.cpp | #include <base/base.hpp>
#include <utility/dlogc.hpp>
#include <utility/dexpc.hpp>
#include <utility/dcheck.hpp>
#include <spgeng/gcdf.hpp>
#include <genfun/gcdfm.hpp>
#include <sgpdfl/gpdf.hpp>
#include <sgquan/gquant.hpp>
#include <genfun/gmquan.hpp>
using namespace genx09;
//' Compute interesting functions of gamm... | ALGO | 0.998233 | 6.645995 |
4da8548c-66f4-4c3a-a7cf-f79771aa2c9e | yaqubov91/my_leet_solutions | 617_Merge_Two_Binary_Trees.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
TreeNode* mergeTrees(TreeNode* t1, TreeNode* t2) {
if(t1==NULL && t2==NULL)
... | ALGO | 0.999993 | 5.953598 |
57718710-0545-4cc6-a4de-f587ed3b3b1e | wenwenzju/visual_tracker_benchmark | tracker_benchmark_cpp_interface/pf_tracking_v8.1/acf_feature_extractor.cpp | #include "acf_feature_extractor.h"
#define SHRINK 1
#define START_THREAD_LOCK {boost::mutex::scoped_lock scop(boost::mutex());
#define END_THREAD_LOCK }
void AcfFeatureExtractor::feature_extract(cv::Mat& img)
{
CV_Assert(img.channels() == 3);
cv::Mat rgb_img;
img.copyTo(rgb_img);
{//convert bgr to rgb
std::ve... | ALGO | 0.970602 | 5.619853 |
59aa1ffb-f64c-4b26-811a-7f5935044fa9 | cxlove/ACM_ICPC | Online_judge/poj/poj_1085_4.cpp | #include<iostream>
#include<cstdio>
#include<map>
#include<cstring>
#include<cmath>
#include<vector>
#include<queue>
#include<algorithm>
#include<set>
#define inf (1ull<<63)-1
#define N 50005
#define maxn 100005
#define Min(a,b) ((a)<(b)?(a):(b))
#define Max(a,b) ((a)>(b)?(a):(b))... | ALGO | 0.99992 | 3.740365 |
bbc358a6-a49f-4903-bbd3-3c87451be814 | vivek6225/DSA | basic array/TsumRep.cpp | #include<bits/stdc++.h>
using namespace std;
int subset(int arr[],int index,int n,int sum)
{
if(sum==0)
return 1;
if(index==n||sum<0)
return 0;
return subset(arr,index+1,n,sum)+subset(arr,index,n,sum-arr[index]);
}
int main()
{
int arr[]={2,3,4};
int sum = 6;
cout<<subset(arr,0,3,sum)<<... | ALGO | 0.999915 | 4.748036 |
c6c3d093-bebf-401d-99b4-90007790522d | ishandutta2007/codeforces | golikovnik/normal/1117/E.cpp | #include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
#define szof(x) int32_t((x).size())
#define str(x) to_string(x)
using namespace std;
typedef long long ll;
typedef long double ld;
typedef unsigned int uint;
typedef unsigned long long ull;
const int MOD = 1e9 + 7;
const int MOD998 = 998244353;
const in... | ALGO | 0.999863 | 3.683358 |
28d17470-bcc5-4c5f-a44b-e53a4030a688 | Atahar-Nur-Refat/DSA-CPP-Practice | integerpassbyvalue.cpp | #include<iostream>
using namespace std;
void passbyvalue(int num){
cout<<"The value is "<<num<<endl;
num +=5;
cout<<"The value is "<<num<<endl;
num +=5;
cout<<"The value is "<<num<<endl;
num +=5;
cout<<"The value is "<<num<<endl;
num +=5;
}
int main(){
int x;
cin>>x;
passbyvalue(x);
cout<<"The original v... | ALGO | 0.997198 | 3.4579 |
7d00ea30-252a-4376-9861-158c595075b4 | MohamedAliShaltoot/Quotes | 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 |
d57e8aa0-181c-46b4-849e-15d9ba02f56f | dhnesh12/codechef-solutions | 03-CodeChef-Medium/349--Coin Partition.cpp | #include <bits/stdc++.h>
using namespace std;
const int md=(int)1e9+123;
inline void add(int &a,int b){
a+=b;
if(a>=md)
a-=md;
}
inline void sub(int &a,int b){
a-=b;
if(a<0)
a+=md;
}
int main(){
ios_base::sync_with_stdio(false);
cin.tie(0);
int tt;cin>>tt;
while(tt--){
int n;cin>>n;
vector<int> a(n);
... | ALGO | 0.999905 | 3.488392 |
40bad4c6-2b30-474b-bb58-be3d35a344aa | CLDP/UVa | 748.cpp | #include <iostream>
#include <cstdio>
#include <cctype>
#include <cstring>
#include <algorithm>
using namespace std;
const int maxlen = 310;
class HP {
public:
int len, dot, s[maxlen];
HP() {(*this) = 0;};
HP(int inte) {(*this) = inte;};
HP(const char *str) {(*this) = str;};
... | ALGO | 0.999912 | 3.235821 |
6af39eae-5ca7-4bd4-a064-d0ae4aae6f21 | paolavalcala/CSC_CIS_17a | Hmwk/ReviewHomework1/Gaddis_8thEd__Chp8_P7_BinaryStringSearch/main.cpp | /*
* File: main.cpp
* Author: Paola Alcala
*
* Created on September 4, 2024, 3:55 PM
* Purpose: Binary String Search Problem
*/
//System Libraries
#include <iostream> //Input-Output Library
#include <string>
using namespace std;
//User Libraries
//Global Constants - Math,Physics,Chemistry,Conversions
//F... | ALGO | 0.999842 | 6.19317 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.