uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
7ececfae-c39d-47c7-aed1-a5facbb35050 | jerichoji/LIO-SLAM | src/grid_map/grid_map_cv/src/GridMapCvProcessing.cpp | /*
* GridMapCvProcessing.cpp
*
* Created on: Apr 15, 2016
* Author: Péter Fankhauser, Magnus Gärtner
* Institute: ETH Zurich, ANYbotics
*/
#include "grid_map_cv/GridMapCvProcessing.hpp"
#include "grid_map_cv/GridMapCvConverter.hpp"
#include <Eigen/Geometry>
#include <opencv2/core/eigen.hpp>
namespace gr... | ALGO | 0.952606 | 7.284019 |
02500791-2fd3-49ec-804f-1e2aeb10ccbd | seemecnc/Firmware-Playground | Marlin-Mini-Rambo-Miregli-JohnnyR-Goodish/Marlin/vector_3.cpp | #include <math.h>
#include "Marlin.h"
#ifdef ENABLE_AUTO_BED_LEVELING
#include "vector_3.h"
vector_3::vector_3() : x(0), y(0), z(0) { }
vector_3::vector_3(float x_, float y_, float z_) : x(x_), y(y_), z(z_) { }
vector_3 vector_3::cross(vector_3 left, vector_3 right)
{
return vector_3(left.y * right.z - left.z * ri... | TOOL | 0.908571 | 5.626042 |
c4e09eb7-8084-43f2-82b7-358413020a2d | dzo/frameworks_base | media/libstagefright/codecs/amrnb/common/src/q_plsf_5.cpp | /*
Pathname: ./audio/gsm-amr/c/src/q_plsf_5.c
Funtions:
------------------------------------------------------------------------------
REVISION HISTORY
Description: Placed code in the PV standard template format.
Updated to accept new parameter, Flag *pOverflow.
Description:
Eliminated unused inc... | ALGO | 0.999875 | 3.731525 |
28e360a9-c3ac-486d-bfc2-f5d17f0f2b28 | OlenaSekreta/BasicsOfProgramming | СРЗавд1.cpp | #include <iostream>
#include <string>
using namespace std;
int main()
{
char str[20] = "hhw22";
int len = strlen(str);
if (len < 2) return 0;
int tail = 1;
for (int i = 1; i < len; ++i) {
int j;
for (j = 0; j < tail; ++j) {
if (str[i] == str[j]) {
if (... | ALGO | 0.999483 | 3.128406 |
8267391e-0ad8-4430-8d4a-80aa4a37909b | sidharth2189/CPP | Concurrency/Mutex_&_Lock/deadlock_situation.cpp | /*
Mutex is a solution to the problem discussed in the file deadlock.cpp
It is implemented as below.
*/
#include <iostream>
#include <thread>
#include <vector>
#include <future>
#include <mutex>
#include<algorithm>
std::mutex mtx;
double result;
void printResult(int denom)
{
std::cout << "for denom = " <<... | ALGO | 0.992981 | 6.48941 |
1c0f89ca-2378-46fc-bc72-f5c639e7639b | kundan816/DSA1 | RomanToInteger.cpp |
#include<bits/stdc++.h>
using namespace std;
class Solution {
public:
int romanToInt(string s) {
unordered_map<char , int> mp1{
{'I',1},
{'V',5},
{'X',10},
{'L',50},
{'C',100},
{'D',500},
{'M',1000},
};
in... | ALGO | 0.999792 | 5.919595 |
bd68e530-b71f-41e9-a457-1998adc66524 | mohsin0176/HandNotes-onCPlusCPlus | inhertance/14.cpp | #include<math.h>
#include<cstdlib.h>
#include<limits.h>
#include<iomanip.h>
#include<fstream.h>
#include<process.h>
#define PI 3.1416
using namespace std;
class Circle
{
private:
float radius;
public:
void readRadius()
{
cin>>radius;
}
void showRadius()
{
cout<<radius;
}
float area()
{
float ar;
ar=PI... | ALGO | 0.943705 | 3.541827 |
c6bfdb44-64b7-4faa-b192-b36799430a93 | ishanroy16/ProblemSolveing | Week-02/day1/B_Minor_Change.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
string s,t;
cin>>s>>t;
// vector<pair<string,int>>v;
int cnt=0;
for(int i=0;i<s.length();i++)
{
if(s[i]!=t[i])
{
cnt++;
}
}
cout<<cnt<<"\n";
return 0;
} | ALGO | 0.999947 | 3.474993 |
4feec152-3ab5-4ea3-b2f7-fb3cfe9de491 | ehsan/mozilla-history | other-licenses/7zstub/src/7zip/Compress/RangeCoder/RangeCoderBit.cpp | // Compress/RangeCoder/RangeCoderBit.cpp
#include "StdAfx.h"
#include "RangeCoderBit.h"
namespace NCompress {
namespace NRangeCoder {
UInt32 CPriceTables::ProbPrices[kBitModelTotal >> kNumMoveReducingBits];
static CPriceTables g_PriceTables;
CPriceTables::CPriceTables() { Init(); }
void CPriceTables::Init()
{
c... | ALGO | 0.987132 | 5.476203 |
0caee0e5-1dff-4ae8-b09d-a3639350cfaa | tayu0110/atcoder | abc/abc174f.cpp | #include<iostream>
#include<iomanip>
#include<string>
#include<vector>
#include<algorithm>
#include<utility>
#include<tuple>
#include<map>
#include<queue>
#include<deque>
#include<set>
#include<stack>
#include<numeric>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<cassert>
using namespa... | ALGO | 0.99998 | 3.990159 |
9979b355-5587-4612-b1e1-724c4a9ce211 | Sriram-99/LeetCode | Check for Balanced Tree - GFG/check-for-balanced-tree.cpp | //{ Driver Code Starts
//Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
// Tree Node
struct Node {
int data;
Node* left;
Node* right;
};
// Utility function to create a new Tree Node
Node* newNode(int val) {
Node* temp = new Node;
temp->data = val;
temp->left = NULL;
... | ALGO | 0.999853 | 6.827652 |
3514e77b-894d-4ee6-b943-6832849e66ca | mikedotcpp/CocosWolf3D | cocos2d/cocos/2d/CCAutoPolygon.cpp | #include "2d/CCAutoPolygon.h"
#include "poly2tri/poly2tri.h"
#include "base/CCDirector.h"
#include "renderer/CCTextureCache.h"
#include "clipper/clipper.hpp"
#include <algorithm>
#include <math.h>
USING_NS_CC;
static unsigned short quadIndices[]={0,1,2, 3,2,1};
const static float PRECISION = 10.0f;
PolygonInfo::Poly... | ALGO | 0.994875 | 4.106756 |
c63ccb4f-edaa-471c-83d0-698e5f1192cb | voe09/CPPPlayGround | Round1/DFS/FriendCircles.cpp | /*
There are N students in a class. Some of them are friends, while some are not.
Their friendship is transitive in nature. For example, if A is a direct friend
of B, and B is a direct friend of C, then A is an indirect friend of C.
And we defined a friend circle is a group of students who are direct or indirect
frie... | ALGO | 0.999997 | 6.339673 |
046c8b2f-0d3c-4045-a671-51f6a675606c | palilo815/ps | baekjoon/3000/3476.cpp | #include <bits/stdc++.h>
#define pb pop_back()
#define eb emplace_back
using namespace std;
using tup = tuple<int, string, string, string>;
string str, tmp;
vector<tup> vt;
bool contradiction;
void S() {
if (contradiction) return;
str.pb;
stringstream ss(str);
int neg = 0;
string subj; ss >> sub... | ALGO | 0.995646 | 4.575774 |
35fa74c2-e4c1-4528-ba25-8d2f29bb96c1 | manojborugadda/datastructures-algorithms-practice | raising_bacteira.cpp | // You are a lover of bacteria. You want to raise some bacteria in a box.
// Initially, the box is empty. Each morning, you can put any number of bacteria into the box. And each night, every bacterium in the box will split into two bacteria. You hope to see exactly x
// bacteria in the box at some moment.
// What is... | ALGO | 0.999907 | 5.50661 |
e360698a-4a64-4eae-90e1-3b6457cec3a5 | Mohammad-Ashikul-Islam/Competitive_Programming | Codeforces/A. Maximum in Table.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
long long n,i,j;
cin >> n;
long long ara[n][n];
for(i=0; i<n; i++){
ara[i][0]=1;
ara[0][i]=1;
}
for(i=1; i<n; i++){
for(j=1; j<n; j++){
ara[i][j]=ara[i-1][j]+ara[i][j-1];
}
}
long long m... | ALGO | 0.999969 | 3.17395 |
2ee3fc01-3850-492f-b6e7-2c9505cf9bae | chiraag/gazelle_mpc | src/lib/gc/gazelle_circuits.cpp | /*
* gazelle_circuits.cpp
*
* Created on: Nov 30, 2017
* Author: chiraag
*/
#include "gazelle_circuits.h"
namespace lbcrypto {
void A2BCircuit(GarbledCircuit *gc, BuildContext *context,
const uv64& s_p, const uv64& s_c_x, const uv64& s_s_x, uv64& s_x) {
ui64 n = s_c_x.size();
uv64 s_x_0, s... | ALGO | 0.973416 | 3.539943 |
8cde0b0d-6797-4056-8c39-452ce9b6f219 | eugene-bogorodsk/S_Prata_Prime_C-_exercise | Chapter_8/listing_8_12_twotemps/src/twotemps.cpp | #include <iostream>
template<typename T> //
void Swap(T&a,T& b);
template<typename T> //
void Swap(T*a,T* b,int n);
void Show(int a[]);
const int Lim=8;
int main() {
using namespace std;
int i=10,j=20;
cout<<"i,j="<<i<<", "<<j<<".\n";
Swap(i,j);
cout<<"Now i,j = "<<i<<", "<<j<<",\n";
int d1[Lim]= {0,7,0,4,1,... | ALGO | 0.996213 | 4.349688 |
c4d7e2b8-49d3-4e70-a755-352590c46e43 | samyak1512/coding | C++ Code/hola.cpp | #include <bits/stdc++.h>
using namespace std;
int arraySum(int arr[], int n)
{
int initial_sum = 0;
return accumulate(arr, arr+n, initial_sum);
}
bool arraynonzero(int arr[], int n,int z, int count)
{
for (int i = z; i < n; i++)
{
if(arr[i] = 0)
{
count++;
}
}
if(coun... | ALGO | 0.999589 | 4.401882 |
fdef3955-c344-4362-ae20-3145984bfccf | EdzG/CS125programs | EasterBreakHw/EasterBreakHw.cpp | //Eder Guerrero
//27 March 2021
//Program that reads a set of points and transforms them.
#include "Functions.h"
using namespace std;
int main()
{
// creates an pointer to pointer.
int** arr = 0;
//variables needed.
int rows, col, transX, transY;
double angle;
cout << "Enter the number of points for the objec... | ALGO | 0.953155 | 5.679693 |
e635f198-ff42-4dd4-916a-603904ce87c2 | devanshmishra25/DSA_Personal | Striver Sheet/Arrays/Array 2/count_inversion_array.cpp | //For this question we have to learn merge sort first
//below is the code for merge sort
#include <bits/stdc++.h>
using namespace std;
void merge(vector<int> &arr, int low, int mid, int high) {
vector<int> temp; // temporary array
int left = low; // starting index of left half of arr
int right = mid ... | ALGO | 0.99983 | 4.707227 |
58110525-aeed-4d2d-b55c-f7bc1cd430a9 | Miaomz/caffe-opencl | src/caffe/solvers/sgd_solver.cpp | #include <string>
#include <vector>
#include "caffe/sgd_solvers.hpp"
#include "caffe/util/hdf5.hpp"
#include "caffe/util/io.hpp"
#include "caffe/util/upgrade_proto.hpp"
namespace caffe {
// Return the current learning rate. The currently implemented learning rate
// policies are as follows:
// - fixed: always ret... | ALGO | 0.981214 | 7.764318 |
3ba670bc-dff8-4371-8119-231ed806271f | krisnadwia/QC-Parts-Check | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998859 | 6.785645 |
4b71a511-bc66-4f0b-af3e-292e7d2c1a9c | imitskovets/5sem_baza | labs/sem2.cpp | //
// Created by van_mit on 05.11.15.
//
#include <iostream>
#include <math.h>
double fgrob(double x){
double result = 0;
if ((x <= 3) && (x >= -3)){
result = 1;
}
return result;
}
double fkolokol(double x){
double result = 0;
if ((x <= 3) && (x >= -3)){
result = ((double)exp(-... | ALGO | 0.999589 | 4.137794 |
25d00d02-9fc0-4c14-a440-5018b7ae7e63 | Suryansh555/CPP | TelephoneCompany.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int calls ;
int sms ;
printf("Please Enter Number of Calls \n");
scanf("%d",&calls);
printf("Please Enter Number of SMS \n");
scanf("%d",&sms);
float ChargeCalls ;
if(calls < 50){
ChargeCalls = 50 * calls ;
}
... | ALGO | 0.965999 | 4.003917 |
c2fd631b-c3db-44e7-9110-3c27ef6cd118 | lsl036/SSpMV | LeSpMV/src/spmv_csr5.cpp | /**
* @file spmv_csr5.cpp
* @author your name (<EMAIL>)
* @brief Using weifeng Liu code
* Implement on AVX521, must required.
* @version 0.1
* @date 2023-12-24
*
* @copyright Copyright (c) 2023
*
*/
#include"../include/LeSpMV.h"
#include"../include/thread.h"
#include"immintrin.h"
/*
https:... | ALGO | 0.999447 | 3.66946 |
75a29a69-51db-467d-955b-33cb3064adc6 | ParticulateFlow/LIGGGHTS-PFM | src/USER-MISC/pair_edip.cpp | /* ----------------------------------------------------------------------
Contributing author: Luca Ferraro (CASPUR)
email: <EMAIL>
Environment Dependent Interatomic Potential
References:
1) J. F. Justo, M. Z. Bazant, E. Kaxiras, V. V. Bulatov, S. Yip
Phys. Rev. B 58, 2539 (1998)
---------------... | ALGO | 0.996508 | 5.465243 |
fa4e5c2b-25e9-460f-8dfb-8d191cfa17cb | Abishekkarthik1625/C-programming | Multiplication of two floating points.cpp | #include<stdio.h>
int main(){
float a,b,multif;
scanf("%f\n%f",&a,&b);
multif=a*b;
printf("Float and integer product of two numbers %f and %f are %f and %d",a,b,multif,int(multif));
}
| ALGO | 0.996601 | 3.203208 |
a9193f45-6a95-4124-82d4-abf4ea82b9f8 | arash-ha/Cpp | Map Sum Pairs.cpp | /*
Map Sum Pairs
Implement the MapSum class:
MapSum() Initializes the MapSum object.
void insert(String key, int val) Inserts the key-val pair into the map. If the key already existed, the original key-value pair will be overridden to the new one.
int sum(string prefix) Returns the sum of all the pairs' value whose ke... | ALGO | 0.999165 | 7.026984 |
f743488c-db87-4642-9429-2a0d0ae63caf | IAmWaseem/AVL-Tree | AVLTree.cpp | #include "AVLTree.h"
template <class T>
AVLTree<T>::AVLTree() {
Root = (AVLTreeNode<T>*)0;
}
template <class T>
AVLTree<T>::~AVLTree() {
ClearTree(Root);
}
template <class T>
void AVLTree<T>::ClearTree(AVLTreeNode<T>* Node) {
if (Node) {
ClearTree(Node->LeftChild);
ClearTree(Node->RightChild);
delete Node;
... | ALGO | 0.997799 | 5.035273 |
0ec6a15a-c2dd-4be5-bb1d-bc5d58217847 | lballabio/QuantLib | ql/time/calendars/brazil.cpp | /* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
#include <ql/time/calendars/brazil.hpp>
#include <ql/errors.hpp>
namespace QuantLib {
Brazil::Brazil(Brazil::Market market) {
// all calendar instances on the same market share the same
// implementation instance
... | TOOL | 0.990788 | 6.315492 |
bed0e589-3565-423f-b2a8-71ad75e6fe51 | SH4MDEL/boj-algorithm | Algorithm/Algorithm/9019 - DSLR.cpp | #include <iostream>
#include <unordered_set>
#include <tuple>
#include <queue>
#define fastip std::cin.tie(nullptr)
#define sws std::ios::sync_with_stdio(false)
#define inf 987654321
#define endl "\n"
using namespace std;
int t, s, e;
bool visited[10101];
string bfs()
{
queue<tuple<int, string>> q;
q.push({ s, "" ... | ALGO | 0.999987 | 5.812947 |
fa3662a5-056d-4325-90b7-722373cd3917 | SurajWarrier/cses-problem-set | src/sum-of-four-values.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
const int mxn=1000;
int n;
ll x;
ll a[mxn];
int main() {
cin>>n>>x;
for(int i=0;i<n;i++) {
cin>>a[i];
}
unordered_map<ll,array<int,2>> mp;
for(int i=0;i<n;i++) {
for(int j=i+1;j<n;j++) {
mp[a[i]+a[j]]={i+1,j+1};
}
}
for(auto it=mp.begin()... | ALGO | 0.999906 | 3.74026 |
3e5ab0b6-a74e-4e1d-abf8-985c5a4c0c76 | saurabhAT28/Data-Structure | sortCount2.cpp | /*
Count Sort
Valid for negative numbers also
*/
#include<iostream>
using namespace std;
int maxElement(int n,int a[]){
int max=a[0];
for(int i=1;i<n;i++){
if(a[i]>max)
max=a[i];
}
return max;
}
int minElement(int n,int a[]){
int min=a[0];
for(int i=1;i<n;i++){
if... | ALGO | 0.999991 | 4.206944 |
0615ea47-3a00-47b7-9dd0-acaee20bcd96 | lucamps/INF450-Trab2 | Parte 3/mediaDados.cpp | /*
Programa para calcular média dos dados da parte 3 com base nos arquivos de texto gerados
Obs: Para um bom funcionamento valores com . tem que ser removidos */
#include <iostream>
#include <fstream>
#include <cstring>
using namespace std;
double media(double v[], int tam){
double soma = 0.0;
for(int i=0;i<... | TOOL | 0.9002 | 3.658992 |
b3a2ae90-e31e-47dd-945a-59c882f7c5ca | yeonggwangchoi/C_Double_Plus_STL | 예제6-24.cpp | #include <iostream>
#include <vector>
using namespace std;
int main()
{
vector<int> v;
v.push_back(10);
v.push_back(20);
v.push_back(30);
v.push_back(40);
v.push_back(50);
vector<int>::iterator iter;
vector<int>::iterator iter2;
for (iter = v.begin(); iter != v.end(); ++iter)
cout << *iter << " ";
cout <<... | TOOL | 0.938592 | 3.462841 |
3449f659-a6d6-4560-9d02-60f83c263f6b | namratabose32/StriversSheetChallenge | Day 1/06. Stock Buy and sell/Solution.cpp | // solution 1: with extra space
class Solution {
public:
int maxProfit(vector<int>& prices) {
int n=prices.size();
vector<int> left(n),right(n);
left[0]=prices[0];
right[n-1]=prices[n-1];
for(int i=1;i<n;i++){
left[i]=min(left[i-1],prices[i]);
right[n... | ALGO | 0.999983 | 6.135647 |
6a47d379-a2b7-4977-aec1-c477110adf27 | 1103105303/C- | 10_Fraction/Source.cpp | #include<iostream>
#include<iomanip>
#include<string>
using namespace std;
struct fraction {
private:
int num; //l
int den; //
public:
fraction(int input1, int input2)
{
num = input1;
den = input2;
}
fraction(int mixedF, int input1, int input2)
{
if (mixedF < 0) //aƭt
{
num = mixedF * input2 ... | TOOL | 0.951338 | 3.538568 |
ac54adf6-c3c4-41ad-9f78-ff95deb7e41b | shixv/test | cpp/15cpp/3.cpp | #include <iostream>
#include <random>
#include <vector>
#include <algorithm>
using namespace std;
int main(void)
{
mt19937 eng(static_cast<unsigned long>(time(nullptr)));
uniform_int_distribution<int> dist(1,99);
auto gen=std::bind(dist,eng);
vector<int> vec(10);
generate(vec.begin(),vec.end(),gen);
for(auto& i:v... | ALGO | 0.971095 | 3.469275 |
da8fb6bd-f65f-4f9f-8f14-b58a137836c6 | Rashedul2001/PROGRAMS | DSA_CPA/C++ DSA_Course/binaryTreeIntroduction.cpp | #include<iostream>
using namespace std;
struct Node{
int data;
struct Node* left;
struct Node* right;
Node(int val){
data = val;
left = nullptr;
right= nullptr;
}
};
int main(){
struct Node* root = new Node(1);
root->left= new Node(2);
root->right=new Node... | ALGO | 0.999024 | 3.449229 |
9d0ac736-fe4d-4e27-9cd6-17c8a7cbe5ae | codedeman/demo_flutter | 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 |
d2613020-fc04-417d-92f9-b8efbd4be72e | chano062400/Algorithm | 프로그래머스/3/42579. 베스트앨범/베스트앨범.cpp | #include <bits/stdc++.h>
using namespace std;
bool cmp(pair<int,int> p1, pair<int,int> p2)
{
if(p1.first == p2.first) return p1.second < p2.second;
return p1.first > p2.first;
}
vector<int> solution(vector<string> genres, vector<int> plays) {
vector<int> answer;
map<string, int> genreplayed;
map<i... | ALGO | 0.999793 | 5.044951 |
43a292a6-50cc-4ee8-9026-103ada91b198 | zephyr0p/Study | Scanline.cpp | #include <iostream.h>
#include <dos.h>
#include <graphics.h>
void drawPolygon(int *x, int *y, int number_of_edges) {
int i=0, j=0, k=0, lines_on_screen=480;
int *x_int = new int[number_of_edges];
float *slope = new float[number_of_edges];
x[number_of_edges] = x[0];
y[number_of_edges] = y[0];
for(i=0; i<number_... | ALGO | 0.999046 | 4.183844 |
09531332-943f-443f-a6b8-65ab695b565f | RocaIgnacio1/Programacion-Competitiva | cses/grafos/HighScore/sol.cpp | #include <bits/stdc++.h>
using namespace std;
#define forn(i, n) for(int i = 0; i < n; i++)
#define DBG(x) cerr << #x << ": " << x << endl;
typedef long long ll;
const ll MAXN = 9999999999LL;
/* Solucion:
* Bellman-Ford
* Problema: cuando hay un ciclo positivo, pero no incluye el caminode desde 1 a n
* */
vector... | ALGO | 0.999906 | 4.280243 |
5d759777-4c54-499d-9771-dc360f589928 | tiyamti/university | basics of programming/exercise/main8.cpp | /* Write a program that receives two numbers n and m, and prints their greatest common divisor (GCD) and least common multiple (LCM).
Input: First, n and then m are given to you.
1 ≤ n, m ≤ 500
Output: First, print the GCD, followed by the LCM, separated by a space.
Example:
Sample Input 1:
8 20
Sample Output 1:
4 40
S... | ALGO | 0.999993 | 4.63415 |
19918fc9-109d-4560-90ba-4bc4a73e8d36 | Vedant285/LeetCode | 518-coin-change-ii/coin-change-ii.cpp | class Solution {
public:
int change(int amount, vector<int>& arr) {
int n = arr.size();
//long long mod = 2e9 + 7;
vector<double>prev(amount+1, 0), curr(amount + 1, 0);
for (int i = 0; i <= amount; i++) {
if(i % arr[0] == 0) prev[i] = 1;
}
for (... | ALGO | 0.999917 | 5.13292 |
fab40d3e-40c5-4a9f-9cd4-7a9a2711150b | Poncirus/leetcode | 517.super-washing-machines/517.super-washing-machines.cpp | /*
* @lc app=leetcode id=517 lang=cpp
*
* [517] Super Washing Machines
*
* https://leetcode.com/problems/super-washing-machines/description/
*
* algorithms
* Hard (37.85%)
* Likes: 321
* Dislikes: 146
* Total Accepted: 16.6K
* Total Submissions: 43.5K
* Testcase Example: '[1,0,5]'
*
* You have n s... | ALGO | 0.999813 | 5.972959 |
bb42de92-bd10-4c14-838c-3c86db4b3ff6 | kripken/bullet | src/BulletCollision/Gimpact/btGImpactQuantizedBvh.cpp | /*! \file gim_box_set.h
\author Francisco Leon Najera
*/
#include "btGImpactQuantizedBvh.h"
#include "LinearMath/btQuickprof.h"
#ifdef TRI_COLLISION_PROFILING
btClock g_q_tree_clock;
float g_q_accum_tree_collision_time = 0;
int g_q_count_traversing = 0;
void bt_begin_gim02_q_tree_time()
{
g_q_tree_clock.reset();
}... | ALGO | 0.999107 | 7.06359 |
2c671b4c-53bc-4db7-a996-ecadef0297d6 | JRgit03/Algorithm | voj/ZZJC-2023-2/F - The Hermit.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int t; cin>>t;
for(int T=1;T<=t;T++){
int n; scanf("%d",&n);
int ans = 0;
for(int i=0;i<n;i++){
int r; scanf("%d",&r);
ans ^= max(0,r-2);
}
printf("Case %d: %d\n",T,ans);
}
return 0... | ALGO | 0.999907 | 4.115845 |
98528f5d-6330-485b-9966-5487c8c06781 | EdgarReynaldo/Merlin | src/Line2.cpp |
#include <cstdio>
#include "Line2.hpp"
#include <cassert>
Line2 LineFromPointAngle(const Vec2& p1 , double theta) {
const double dx = cos(theta);
const double dy = sin(theta);
return Line2(dy,-dx,dx*p1.y - dy*p1.x);
}
Line2 LineFromTwoPoints(const Vec2& p1 , const Vec2& p2) {
const double dx = p2.x - ... | ALGO | 0.986327 | 4.808 |
625b0959-59c5-467a-9e52-5ac40c93a594 | Yehia-Nour/LeetCode | 0035-search-insert-position/0035-search-insert-position.cpp | class Solution {
public:
int searchInsert(vector<int>& nums, int target) {
int l = 0;
int h = nums.size() - 1;
int m;
while(l <= h)
{
m = (l + h) / 2;
if(nums[m] == target) return m;
if(nums[m] < target) l = m + 1;
else h = m ... | ALGO | 0.99997 | 6.276859 |
d1c7ec2a-8897-43b6-b8b1-d40b83e4ceaf | emilymryan/LAMMPS-SPH-Source-Code | src/USER-OMP/pair_meam_spline_omp.cpp | /* ----------------------------------------------------------------------
Contributing author: Axel Kohlmeyer (Temple U)
------------------------------------------------------------------------- */
#include "pair_meam_spline_omp.h"
#include "atom.h"
#include "comm.h"
#include "error.h"
#include "memory.h"
#include... | ALGO | 0.99979 | 6.957687 |
b054c343-af35-476b-969c-ef514bd8df8a | ghostbsd/ghostbsd-src | contrib/kyua/cli/cmd_about.cpp | #include "cli/cmd_about.hpp"
#include <cstdlib>
#include <fstream>
#include <utility>
#include <vector>
#include "cli/common.ipp"
#include "utils/cmdline/exceptions.hpp"
#include "utils/cmdline/parser.ipp"
#include "utils/cmdline/ui.hpp"
#include "utils/defs.hpp"
#include "utils/env.hpp"
#include "utils/format/macros... | TOOL | 0.858195 | 7.711735 |
62997203-34d5-435a-b222-66f6a83c8e10 | MostafaMohamed2001/C-Data-Structure | .history/hello_20240703155600.cpp | #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main() {
vector<int> numsOne{10, 20, 30, 40};
vector<int> numsTwo = {100, 200, 300, 400};
vector<int> numsThree(4, 50);
for (int i = 0; i < numsOne.size(); i++){
cout<<num
}
} | ALGO | 0.976275 | 3.504824 |
8632df74-c4be-4d1c-98e0-d8c21e3ab1cc | samuelpersil/codeforces | MKnezsConstructiveForcesTask.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int n; cin >> n;
int test;
while(n--){
cin >> test;
if(test == 3){
cout << "NO\n";
continue;
}
cout << "YES\n";
if(test % 2 == 0){
for(int i = 0; i < test; i++){
... | ALGO | 0.999105 | 3.534948 |
d1a6d164-7345-4c16-9caf-c72b0b9b9124 | MuhammedKhan99/My-C-PLUS-PLUS-Programs | TMA3Question2.cpp | /*
Author : M
Student Number :
Subject : Comp 306
Assignment 3 Question 2
*/
/*
DOCUMENTATION
Program Purpose:
Same as TMA3Q1 but using inline function for the time calculation.
Compile (assuming Cygwin is running): g++ -o TMA3Q2 TMA3Q2.cpp
Execution (assuming Cygwin is running): ./TMA3Q2.exe
Classes: Lo... | ALGO | 0.987945 | 5.85566 |
3b48174a-08b0-409c-a66a-9efabfc91731 | istrator666/Programmers | 프로그래머스/1/42889. 실패율/실패율.cpp | #include <string>
#include <vector>
#include <algorithm>
using namespace std;
vector<int> solution(int N, vector<int> stages) {
vector<int> answer;
vector<int> freq(N + 2, 0);
for (auto stage : stages)
{
if (stage <= N +1)
{
freq[stage]++;
}
}
int ... | ALGO | 0.999729 | 4.705596 |
002ef5b0-c115-4980-8d70-04230ab1c32a | Tonz24/restir-embree | template/src/pg/pg1_embree/TriangleCDF.cpp | #include "stdafx.h"
#include "TriangleCDF.h"
#include "Utils.h"
std::mt19937 TriangleCDF::generator{ 123 };
TriangleCDF::TriangleCDF(const std::vector<Triangle*>& tris): tris(tris) {
int size = static_cast<int>(tris.size()) > 0 ? tris.size(): 10;
unifDistInt = std::uniform_int_distribution<int>(0, size - 1);
/... | ALGO | 0.97225 | 6.477169 |
d75773f2-4d3e-4197-91c6-ec01d6870d47 | kapilyadav17/DSA_C- | insertionsort.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cout<<"enter the size of array : ";cin>>n;
int arr[n];
for(int i=0 ; i<n ; i++){
cout<<"Enter the "<<i+1<<" Element : ";cin>>arr[i];
}
cout<<"Array was created successfully : "<<endl;
for(int i=1 ; i<n ; i++){ // in insertion sort , we as... | ALGO | 0.999781 | 4.412529 |
e9355031-98b6-4d1c-89cb-42bde5729449 | makankosappoh/Leetcode-soln | 0035-search-insert-position/0035-search-insert-position.cpp | class Solution {
public:
int searchInsert(vector<int>& nums, int target) {
//simple binary search program but instead element we returning index for target
int left = 0;
int right = nums.size() - 1;
while(left <= right){
//avoid int mid = (left + right)/2 cause its can ... | ALGO | 0.999915 | 6.182647 |
2092789b-3b20-4007-b026-cb5035729765 | leonwind/duckdb-adaptive-compression | src/optimizer/topn_optimizer.cpp | #include "duckdb/optimizer/topn_optimizer.hpp"
#include "duckdb/planner/operator/logical_order.hpp"
#include "duckdb/planner/operator/logical_limit.hpp"
#include "duckdb/planner/operator/logical_top_n.hpp"
#include "duckdb/common/limits.hpp"
namespace duckdb {
unique_ptr<LogicalOperator> TopN::Optimize(unique_ptr<Log... | ALGO | 0.955836 | 7.466409 |
b83e297e-583f-4ef6-b43d-d8e7ae418858 | ivarty/mipt_algo | rmq_rsq_algo/Segment_tree/segment_tree.cpp | #include <sys/types.h>
#include <iostream>
#include <utility>
#include <vector>
#include <algorithm>
#include <cmath>
class SegmentTree {
public:
SegmentTree() = default;
explicit SegmentTree(const std::vector<int>& a) {
int size = static_cast<int>(a.size());
auto tsize = 1 << (static_cast<int>(std::log2... | ALGO | 0.99993 | 5.386811 |
1f566d0a-d304-42d6-b4e7-6a00864f8598 | schillij95/ThaumatoAnakalyptor | ThaumatoAnakalyptor/sheet_generation/hdbscan/HdbscanStar/outlierScore.cpp | #include "outlierScore.hpp"
#include <tuple>
outlierScore::outlierScore() {
;
}
outlierScore::outlierScore(double score, double coreDistance, int id) {
outlierScore::score = score;
outlierScore::coreDistance = coreDistance;
outlierScore::id = id;
}
bool outlierScore::operator<(const outlierScore& other) const {... | ALGO | 0.882368 | 4.999831 |
1b2bcc92-a272-4ca0-a02e-f985cae36337 | Donaldhan/Cprimer-Demo | cplus/14/calc.cpp | // This file illustrates use of function, which is a C++ 11 library facility
#include <iostream>
using std::cout; using std::endl; using std::ostream;
#include <map>
using std::map;
#include <utility>
using std::make_pair;
#include <string>
using std::string;
#include <functional>
using std::bind; using std::funct... | TOOL | 0.867148 | 6.907224 |
299b309d-3c41-48bc-bbe6-998a8c51153b | Ashyraf/pay2gether | 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.998762 | 6.786404 |
7096f873-d2bc-4e45-af89-1bd8e0cc15a7 | SDG98/Capstone-Graphics | PizzaBox/Graphics/Effects/ShadowBox.cpp | #include "ShadowBox.h"
#include "Graphics/Camera.h"
#include "Graphics/RenderEngine.h"
#include "Math/Math.h"
using namespace PizzaBox;
ShadowBox::ShadowBox(float shadowDistance_) : offset(10.0f), shadowDistance(shadowDistance_), up(0.0f, 1.0f, 0.0f), forward(0.0f, 0.0f, -1.0f), lightViewMatrix(Matrix4::Identity()){... | TOOL | 0.884555 | 6.074151 |
f3d89166-2feb-4955-826e-3f1888e46f68 | hrushikesht/CompetitiveProgramming | old/agon/depend.cpp | #include <bits/stdc++.h>
#include <unordered_map>
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define i64 long long int
#define DEBUG(x) cout << '>' << #x << ':' << x << endl;
#define REP(i,n) for(i64 i=0;i<(n);i++)
#define FOR(i,a,b) for(i64 i=(a);i<=(b);i++)
#define FORD(i,a,b) for(i6... | ALGO | 0.999946 | 3.980407 |
283b99c2-1048-4653-94d0-64b1550bd889 | Coralise/GabuleFlutter | gabule_flutter/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.998639 | 6.785645 |
220c0071-016d-45fd-9fb2-0161b7ec4ac0 | nishant19/InterviewPrep | Array/insertionSort.cpp | void insertionSort(vector<int> &A){
int size = A.size();
for(int i=1;i<size;i++){
int value = A[i];
int hole = i;
while(hole>0 && A[hole-1]>value){
A[hole] = A[hole-1];
hole = hole-1;
}
A[hole] = value;
}
return;
} | ALGO | 0.9999 | 4.637461 |
e25887eb-f0a2-4d63-b34b-7e374c4f2c77 | sinian666/codes_41_10 | cpp_副本7/chapter_stack_and_queue/queue.cpp | /**
* File: queue.cpp
* Created Time: 2022-11-28
* Author: qualifier1024 (<EMAIL>)
*/
#include "../utils/common.hpp"
/* Driver Code */
int main() {
/* 初始化队列 */
queue<int> queue;
/* 元素入队 */
queue.push(1);
queue.push(3);
queue.push(2);
queue.push(5);
queue.push(4);
cout << "队列 q... | TOOL | 0.922918 | 5.1045 |
1c6fb943-94db-4d1c-87e3-e8d31cec0b70 | thomas1111111/PHY480_demastri_turnin | session_09_10/gsl_spline_test_class.cpp | // file: gsl_spline_test_class.cpp
//
// Test program for the gsl spline routines using the Spline class
//
// Programmer: Dick Furnstahl <EMAIL>
//
// Revision history:
// 02/10/09 -- created from gsl_cubic_spline_test.cpp
//
// Notes:
// * uses the GSL interpolation functions (see online documentation)... | TEST | 0.976157 | 6.772748 |
e17463b7-8d27-4568-9e3a-44f392d7d054 | mohit2308jain/Data-Structures | Trees/Longest Consecutive Sequence.cpp | Given a Binary Tree find the length of the longest path which comprises of nodes with consecutive values in increasing order.
Every node is considered as a path of length 1.
Input:
2
2
1 2 L 1 3 R
5
10 20 L 10 30 R 20 40 L 20 60 R 30 90 L
Output:
2
-1
Explanation:
Test case 1:
1
/ \
... | ALGO | 0.999947 | 3.941224 |
3b0483d5-ef47-4843-97d2-e171f582f572 | Sovol3d/Sovol-OrcaSlicer | OrcaSlicer/src/libigl/igl/mosek/mosek_quadprog.cpp | igl::mosek::MosekData::MosekData()
{
// These are the default settings that worked well for BBW. Your miles may
// very well be kilometers.
// >1e0 NONSOLUTION
// 1e-1 artifacts in deformation
// 1e-3 artifacts in isolines
// 1e-4 seems safe
// 1e-8 MOSEK DEFAULT SOLUTION
douparam[MSK_DPAR_INTPNT_TOL_R... | ALGO | 0.925816 | 7.032225 |
c827d702-332d-48e2-ac10-1fc489c7aae0 | yccgabriel/DropDice | Tutorial/include/bullet/Bullet3Dynamics/b3CpuRigidBodyPipeline.cpp | #include "b3CpuRigidBodyPipeline.h"
#include "Bullet3Dynamics/shared/b3IntegrateTransforms.h"
#include "Bullet3Collision/NarrowPhaseCollision/shared/b3RigidBodyData.h"
#include "Bullet3Collision/BroadPhaseCollision/b3DynamicBvhBroadphase.h"
#include "Bullet3Collision/NarrowPhaseCollision/b3Config.h"
#include "Bullet3C... | ALGO | 0.997276 | 5.981487 |
8740aa04-78b8-44dd-b1f1-5ce55107bde9 | Rakesh-Visave/DSA-Practice_Problem | String/shuffle-string.cpp | // LEETCODE -- 1528. Shuffle String
#include<iostream>
#include<vector>
using namespace std;
string restoreString(string s, vector<int>& indices) {
string ans = s;
for(int i = 0; i< s.size(); i++)
{
ans[indices[i]] = s[i];
}
return ans;
}
int mai... | ALGO | 0.99985 | 5.748718 |
394cf264-b8cd-455b-a8f8-3a0c0048298c | MarjiaIslam/DSA_ii | GreedyProblems/ProblemsFromLightOJ/SumOfFactorials.cpp | #include<bits/stdc++.h>
using namespace std;
vector<long long> computeFactorial()
{
vector<long long> factorials(21, 1);
for (int i = 1; i <= 20; i++)
{
factorials[i] = factorials[i - 1] * i;
}
return factorials;
}
void solveTestCase(int caseNumber, int n, vector<long long>& factorials)
{
... | ALGO | 0.999506 | 4.219856 |
c995caa6-917e-4c17-8d17-272b0ad7af48 | ss99x2002/codetree-TILs | 240216/계단 오르기/climbing-stairs.cpp | #include <iostream>
using namespace std;
long long arr[1001];
int main() {
int n;
cin >> n;
arr[0] = 0;
arr[1] = 0;
arr[2] = 1;
arr[3] = 1;
arr[4] = 1;
for (int i = 5; i <= n; i++) {
arr[i] = (arr[i - 2] + arr[i - 3])%10007;
}
cout << arr[n];
return 0;
} | ALGO | 0.999977 | 4.495397 |
3e5f899c-3593-426e-802c-db34751e0bbb | nsjinie/solved | class_4/S3_15650_dfs/s3_15650_dfs.cpp | // 문제 : 15650 N과 M(2)
// https://www.acmicpc.net/problem/15650
// 풀이 결과 : [2] (1 : 직접 풀이, 2 : 풀이 방향 참조, 3 : 풀이 방향/구현 모두 참조)
//
// 시간 복잡도 : O()
// 알고리즘 : dfs (백트래킹), 조합
// 풀이 방향 :
// 1.
#include <iostream>
using namespace std;
int arr[9];
bool check[9];
int N, M;
void dfs(int num, int cnt)
{
if (cn... | ALGO | 0.999946 | 5.533142 |
960bc093-b332-4d4d-8bdf-42989f33ce92 | sundaram26/dsa | 02Recursion/06quickSort/01quickSort.cpp | #include <iostream>
using namespace std;
int partition(int* arr, int s, int e){
int pivot = arr[s];
int count = 0;
for(int i=s+1 ; i<=e; i++){
if(arr[i]<=pivot){
count++;
}
}
//place pivot at right place
int pivotIndex = s + count;
swap(arr[pivotIndex], arr[s]);
... | ALGO | 0.999982 | 5.29122 |
7f3c531c-d171-47cd-8f18-d4d19f53258d | brobat6/competitive | Lazy/Codechef/ALMR2022/peter_and_his_test.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
int32_t main() {
ios::sync_with_stdio(false);
cin.tie(0);
int t;
cin >> t;
while(t--) {
int n;
cin >> n;
int ans = 2*(n/52);
n %= 52;
if(n == 0) ans += 0;
else if(n <= 26) ans += 1;
... | ALGO | 0.999922 | 4.430017 |
1a769611-6a7f-4f43-b53d-396f60b80230 | liuweiky/GPLT | L1-011/main.cpp | #include <cstdio>
#include <algorithm>
#define MAX_N 10240
using namespace std;
char str[MAX_N];
bool mp[256];
int main()
{
fill_n(mp, 256, true);
int len = 0;
char ch;
while((ch = getchar()) != '\n')
str[len++] = ch;
while((ch = getchar()) != '\n')
mp[ch] = false;
for (int i... | ALGO | 0.971007 | 3.379022 |
0859c521-2791-4bbd-a586-7874710270d8 | snjumaheshwari/C-Cpp | CSE-331/Level_Order_Traversal_Tree_in_new_line.cpp | #include<bits/stdc++.h>
using namespace std;
struct node{
int data;
node *left;
node *right;
};
node* createNode(int data){
node *n=new node();
n->data=data;
n->left=NULL;
n->right=NULL;
return n;
}
void levelOrder(node *root){
queue<node*> q;
q.push(root);
q.push(NULL);
while(!q.empty()){
node *ptr=... | ALGO | 0.999979 | 4.417345 |
923a859f-4447-4428-9ed5-1d90aa81f2e8 | raincross7/code-similarity | codes/train_code/problem435/problem435_207.cpp | #include<bits/stdc++.h>
#define pb push_back
#define fi first
#define se second
using namespace std;
vector<int> v;
int main()
{
int n;
int t;
cin>>n;
for(int i = 0; i<n; i++)
{
cin>>t;
v.pb(t);
}
bool hav1 = false;
for(auto &i : v)
{
if(i==1)
hav1 = true;
}
if(!hav1)
{
cout<<-1<<endl;
... | ALGO | 0.999904 | 3.534651 |
3d1e750c-3be9-42ba-8f7e-575babcb6aaa | GabovYegor/C-plus-plus | boost-examples/stringalgorithms_11/main.cpp | #include <boost/algorithm/string.hpp>
#include <string>
#include <vector>
#include <iostream>
using namespace boost::algorithm;
int main()
{
std::string s = "Boost C++ Libraries";
std::vector<std::string> v;
split(v, s, is_space());
std::cout << v.size() << '\n';
} | TOOL | 0.98285 | 5.717275 |
3a65f8fc-7a36-4473-8f78-821e390216b0 | xcfem/xc_meshing_tmp | tpetra/core/example/Lesson07-Kokkos-Fill/01_init.cpp | #include <Tpetra_Core.hpp>
int main (int argc, char* argv[]) {
Tpetra::ScopeGuard tpetraScope (&argc, &argv);
//
// TODO define the problem and discretization, implement the
// discretization, put the discretization into Tpetra data
// structures, solve the linear system, and correct the solution for
// th... | ALGO | 0.990889 | 5.238346 |
68f43fa7-e441-4faa-a140-b6f836409345 | jiho5993/solving_algorithm | BOJ/16397.cpp | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
int N, T, G;
bool visit[100001];
int bfs() {
queue<pair<int, int> > qp;
qp.push({N, 0});
visit[N] = 1;
while(!qp.empty()) {
int tmp = qp.front().first;
int cnt = qp.front().se... | ALGO | 0.998737 | 5.1334 |
766f249d-b3b6-4d42-93ab-49358a352042 | Rohit6062/vish | crypto/el_gamal.cpp | void cryptoAlgo::el_gamal(){
cout<<"enter value of p\n";
cin>>p;
p = conv<ZZ>(p);
ZZ_p::init(p);
cout<<"enter generator: "<<endl;
cin>>g;
ZZ x,y;
unsigned char m;
ZZ_p C1,C2;
cout << "enter secret key(x): "<<endl;
cin>>x;
cout<< "enter message: "<<endl;
cin>>m;
co... | ALGO | 0.999637 | 3.157871 |
c00b0103-4ce6-46ab-a18e-0992d880ee78 | sirAdarsh/CP-files | PRACTICE/53-C.cpp | /*----- || Hare Krishna || -----*/
/* "WHY DO WE FALL, BRUCE?" */
#include<bits/stdc++.h>
#define ll long long
#define endl '\n'
#define elif else if
#define PI 3.1415926535897932384
#define MOD 1000000007
using namespace std;
string s;
int t;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
... | ALGO | 0.999939 | 3.932025 |
8ee8c8d3-d2dd-4879-98c4-5a79a79e1698 | jeff19sab/Bachelor-Thesis | bullet3-master/bullet3-master/examples/Benchmarks/BenchmarkDemo.cpp | // Collision Radius
#define COLLISION_RADIUS 0.0f
#include "BenchmarkDemo.h"
///btBulletDynamicsCommon.h is the main Bullet include file, contains most common include files.
#include "btBulletDynamicsCommon.h"
#include <stdio.h> //printf debugging
#include "TaruData.h"
#include "HaltonData.h"
#include "landscapeData... | TEST | 0.923364 | 5.363214 |
a4d520bd-0edc-49e0-9728-de0d6c94748e | lx-1005/ACM | cf/contest/1722/1722A.cpp | /**
* author: JiuR
* created: 2024-06-28 14.23.09
**/
#include <bits/stdc++.h>
using namespace std;
template<class T1, class T2> istream &operator>>(istream &cin, pair<T1, T2> &a) { return cin>>a.first>>a.second; }
template<class T1> istream &operator>>(istream &cin, vector<T1> &a) { for (auto &x:a) cin>>x... | ALGO | 0.99995 | 6.181862 |
2482ca2a-8d34-417e-a834-90eebecc5f35 | Darshan1915/todo | DSA C++/STL/VECTORS/V11.cpp | #include <iostream>
#include <vector>
using namespace std;
void printvec( vector<int> v){
for (int i=0; i<v.size();i++){
cout<<v[i];
}
cout<<endl;
}
int main(){
vector <int> v;
v.push_back(1);
v.push_back(2);
v.push_back(3);
v.push_back(4);
printvec(v);
v.pop_back()... | ALGO | 0.970028 | 4.116741 |
a9bf0fe0-2ba1-400e-8233-0a52f57127e5 | skomposzczet/advent-of-code | 2021/day13/part1/paper.cpp | #include "paper.hpp"
void Paper::get_line(std::string line)
{
if (line.empty())
return;
if (line.at(0) == 'f')
{
if (f==-1)
{
f = std::stoi(line.substr(line.find_first_of('=')+1, line.size()-line.find_first_of('=')-1));
w = line.at(line.find_first_of('=')-1... | ALGO | 0.984788 | 4.138159 |
c8ab0115-a366-452b-a8c1-6cd8b12d3bca | TuringKi/llvm-project-12-wasi | llvm/lib/Analysis/DivergenceAnalysis.cpp | #include "llvm/Analysis/DivergenceAnalysis.h"
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/Analysis/Passes.h"
#include "llvm/Analysis/PostDominators.h"
#include "llvm/Analysis/TargetTransformInfo.h"
#include "llvm/IR/Dominators.h"
#include "llvm/IR/InstIterator.h"
#include "llvm/IR/Instructions.h"
#include "llvm/... | ALGO | 0.954951 | 7.853137 |
2b9be3e2-2416-432d-a0ff-33ee7c6712c9 | TSRCHARAN/Strivers-SDE-Sheet-Challenge | TREES/BST_from_preorder.cpp | #include <bits/stdc++.h>
/*************************************************************
Following is the Binary Tree node structure
template <typename T>
class TreeNode{
public:
T data;
TreeNode<T> *left;
TreeNode<T> *right;
TreeNode(T data) {
this->data =... | ALGO | 0.99996 | 4.962294 |
acef9153-6387-40a1-9cb9-7cf5e8edb59e | maragmodh/GFGCODE | Basic/Sorted matrix/sorted-matrix.cpp | //{ Driver Code Starts
// Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// User function Template for C++
class Solution {
public:
vector<vector<int>> sortedMatrix(int N, vector<vector<int>> Mat) {
// code here
vector<int>v;
for(int i=0;i<N... | ALGO | 0.999759 | 6.129382 |
3785ec0f-c82f-437a-ae90-e9466c326b70 | anbailin/BladeMaster | Dev/Projects/Libraries/Graphics/Src/DXUTDevice11.cpp | #include "GraphicsPrivate.h"
//--------------------------------------------------------------------------------------
// Forward declarations
//--------------------------------------------------------------------------------------
extern void DXUTGetCallbackD3D11DeviceAcceptable( LPDXUTCALLBACKISD3D11DEVICEACCEPTABLE*... | TOOL | 0.908922 | 5.936596 |
4fe31281-c77b-4d6d-9645-b6e396402e5e | sandysihotang/CPP | pandaoj/legendary_dance.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
for(int i=1 ; i<=n ; i++){
int a,b,a1,b1;
int dp[2001];
for(int j=0 ; j<2001 ; j++)dp[j]=1;
cin>>a>>b;
vector<int>has1,has2;
for(int j=0 ; j<a ; j++){
cin>>a1;has1.push_back(a... | ALGO | 0.999903 | 3.744806 |
24a03667-7597-43af-bf5d-d06165424a97 | jun6292/Algorithm | 프로그래머스/lv1/12935. 제일 작은 수 제거하기/제일 작은 수 제거하기.cpp | #include <string>
#include <vector>
#include <algorithm>
using namespace std;
vector<int> solution(vector<int> arr) {
vector<int>::iterator min_idx = min_element(arr.begin(), arr.end());
arr.erase(min_idx);
vector<int> answer = arr;
if (answer.size() == 0)
answer.push_back(-1);
return answ... | ALGO | 0.999921 | 5.278363 |
cfb4e89b-1497-4662-b630-c20005183d39 | ticticboooom/Direct3d12-Engine | D3dEngine/TerrainCollisionHelper.cpp | #include "stdafx.h"
#include "TerrainCollisionHelper.h"
#include "Structures.h"
#include "TerrainGenerationHelper.h"
#include <concurrent_vector.h>
std::shared_ptr<concurrency::concurrent_vector<std::shared_ptr<std::vector<std::vector<float>>>>> TerrainCollisionHelper::m_terrainHeights = std::make_shared<concurrency::c... | ALGO | 0.981734 | 3.405121 |
7edfaf7d-f82b-4b1b-b887-f7b04e595907 | wildDoubt/code-problems | SolvedAc/Class 3/boj2667.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
#include <string>
#include <functional>
#include <set>
#include <queue>
using namespace std;
using p = pair<int, int>;
using ll = long long;
const int MAX = 10e+6;
const int INF = 0x66554433;
inline void Quick_IO(){
ios_base :: sync_with_... | ALGO | 0.999978 | 4.903638 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.