uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
c572d367-3395-4a8e-9e13-bd8c836184a1 | Nipuntank/GFG | Basic/Implement Queue using array/implement-queue-using-array.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
struct QueueNode
{
int data;
QueueNode *next;
};
class MyQueue {
private:
int arr[100005];
int front;
int rear;
public :
MyQueue(){front=0;rear=0;}
void push(int);
int pop();
};
int main()
{
int T;
cin>>T;
... | ALGO | 0.994435 | 5.562174 |
98459786-9f45-41a0-ab07-9054e71852e2 | ishandutta2007/codeforces | icecuber/normal/1284/E.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
struct point {
ll x, y;
};
point operator-(point a, point b) {
return {a.x-b.x, a.y-b.y};
}
ll operator*(point a, point b) {
return a.x*b.x+a.y*b.y;
}
ll operator%(point a, point b) {
return a.x*b.y-a.y*b.x;
}
bool operator<(point a, point b... | ALGO | 0.999809 | 4.291413 |
fa698947-9b44-4a95-bf1c-fc253058524b | Robertorocco/ros2-vision-based-control-iiwa | ros2_kdl_package/src/ros2_kdl_node_example.cpp | #include <kdl/chain.hpp>
#include <kdl/chainfksolver.hpp>
#include <kdl/chainfksolverpos_recursive.hpp>
#include <kdl/frames_io.hpp>
#include <stdio.h>
#include <iostream>
using namespace KDL;
int main( int argc, char** argv )
{
//Definition of a kinematic chain & add segments to the chain
KDL::Chain chain;
... | ALGO | 0.998073 | 5.588583 |
ef02e9be-e8c3-40a5-8f5a-a8a832f4b0b0 | ganeshkekkereni/DS | Inbuiltfunctions.cpp | /* Inbuilt sort and comparators
1) Sort
2) Comparator
3) Reverse
4) greater<int>() -> sort(arr, arr+n, greater<int>());
*/
#include <iostream>
#include <algorithm>
using namespace std;
bool compare(int a, int b){
return a<b;
}
int main()
{
int arr[] = {10, 8, 6, 5, 4, 3, 2, 11, 16, 8};
int n ... | ALGO | 0.998545 | 4.877005 |
849e6b85-86d9-4b92-9865-56ef91e7b840 | jayeshpatel8/Coding-Practise-using-Leetcode-Coding-Platform | problems/queries_on_number_of_points_inside_a_circle/solution.cpp | class Solution {
public:
vector<int> countPoints(vector<vector<int>>& points, vector<vector<int>>& queries) {
vector<int> ans;
for (auto q : queries){
int cnt=0;
auto r2 = pow(q[2],2);
for (auto p : points){
cnt += (pow(q[0] - p[0],2) + pow(q[1] ... | ALGO | 0.999575 | 5.407423 |
4de55ac5-7ba5-484e-b178-0a86a42bdf93 | AmirFaruk75/Codeforces2 | Frog Jumping.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
long long int t,n,i,j,a,b,c,d,e,f,g,h,k;
cin>>t;
for(i=0;i<t;i++)
{
cin>>a>>b>>k;
if(k%2==0)
{
c=k/2;
d=k/2;
}
else{
c=(k/2)+1;
d=k/2;
}
e=c*a... | ALGO | 0.999929 | 3.324229 |
31c6e3e0-d74b-4950-8bc1-0c5df80fc7a1 | Mayur-Shiwal/Data_Structures_and_Algorithms-CPP-Solutions | Medium/3 Divisors/3-divisors.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
public:
bool isPrime(int n){
if(n<2 || n%2==0 || n%3==0)
return false;
for(int i=5; i*i <= n; i+=6){
if(n%i==0 || n%(i+2)==0)
return false;
}
... | ALGO | 0.998728 | 5.062039 |
5dfc609d-f133-4e4b-9f5c-95e0acbc1523 | deepank1728/workspace | cpp/dynamic_prog/rod_cut.cpp | #include<iostream>
#include<cstdlib>
int max_price(int *a,int *b,int size)
{
if(size==0)
}
int main()
{
int a[]={ 1 , 2, 3, 4 , 5 , 6, 7, 8 },size=7,b[]={1 , 5 , 8 , 9 ,10 ,17 ,17 ,20};
int r=max_price(a,b,size);
cout<<r<<endl;
}
| ALGO | 0.994506 | 3.287688 |
cb221880-beea-4b5f-bcf9-fd55844740e5 | DyogoBendo/cp | competition/brasil/universities/unicamp/2023/bixe/c.cpp | #include <bits/stdc++.h>
#define ll long long
using namespace std;
ll x,y,z;
ll isPossible(){
if(x < 0 && y < 0) {
x *= -1;
y *= -1;
z *= -1;
}
if(x > 0 && y > 0){
if(x < y) {
return x;
}
if(z > y) {
return -1;
}
if(z ... | ALGO | 0.999994 | 4.375025 |
6b80b9a6-e294-4747-b7a1-eb9b883c7b00 | linux4life798/llvm-project-ci-test | libc/src/math/nvptx/fminf.cpp | #include "src/math/fminf.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(float, fminf, (float x, float y)) {
return __builtin_fminf(x, y);
}
} // namespace LIBC_NAMESPACE_DECL
| ALGO | 0.985577 | 5.781507 |
2e325696-8b11-4e1d-ad56-6f01846b143d | kmjp/procon | codeforce/edu/081-120/116/d.cpp | #include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;
#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 FORR2(x,y,arr) for(auto& [x,y]:arr)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define ... | ALGO | 0.999343 | 3.000961 |
c8bd8361-b203-45c1-bc98-9e54fd514db8 | jindalshivam09/cppcodes | ACM/COOK41/GERALD03.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef list<int> li;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<long long> vll;
typedef vector<bool> vb;
typedef pair<int,int> pii;
typedef vector<pair<int,int> > vpii;
typedef pair<double,double> pdd;
typedef vector<p... | ALGO | 0.999922 | 3.141477 |
48d5b797-adb5-417b-a676-14aeff5cb5b1 | ehnryx/acm | samara-2012-cf100030/c.cpp | #include <bits/stdc++.h>
using namespace std;
#define _USE_MATH_DEFINES
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef complex<ld> pt;
typedef vector<pt> pol;
const char nl = '\n';
const int INF = 0x3f3f3f3f;
const ll INFLL = 0x3f3f3f3f3f3f3f3f;
const ll MOD = 1e9+7;
const ld EPS = 1... | ALGO | 0.999997 | 5.62842 |
6df30b54-211e-443f-8c99-dcc20ba792f4 | haosdent/AProblemADay | leetcode_412.cpp | class Solution {
public:
int longestValidParentheses(string s) {
int max_len = 0, last = -1;
stack<int> lefts;
for (auto i = 0; i < s.size(); i++) {
if (s[i] == '(') {
lefts.push(s[i]);
} else {
if (lefts.empty()) {
last = i;
} else {
lefts.pop();
... | ALGO | 0.999352 | 6.214962 |
93a1992e-fbd4-4f72-9f06-d8a3c5368b43 | gafeol/competitive-programming | ojs/cf/682/D.cpp | #include <bits/stdc++.h>
using namespace std;
#define fst first
#define snd second
typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
#define pb push_back
#define for_tests(t, tt) int t; scanf("%d", &t); for(int tt = 1; tt <= t; tt++)
#ifndef ONLINE_JUDGE
#define debug(args...) fprintf(st... | ALGO | 0.999979 | 3.679777 |
9b803171-68cd-4a94-9378-e7edbac87e30 | dizzy2003/MuckyFoot-UrbanChaos | fallen/Source/bang.cpp | //
// Explosions!
//
#include "game.h"
#include <MFStdLib.h>
#include "bang.h"
//
// Parameters for each phwoar type.
//
#define BANG_CHILD_WHERE_INSIDE 0
#define BANG_CHILD_WHERE_EDGE 1
#define BANG_CHILD_WHERE_MIDDLE 2
#define BANG_MAX_CHILDREN 6
typedef struct
{
UBYTE initial_radius;
UBYTE initial_grow;
UBYT... | TOOL | 0.886173 | 3.514567 |
1b695a0a-57a7-45e5-a6f0-c800cb3aed54 | neamul-haq/Codeforces-Problems-Solutions | B_Informatics_in_MAC.cpp | /*
Problem_Link:
AUTHOR: Neyamul_Haq
CREATED: 14-03-2024 16:34:44
*/
#include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
template <typename T>
using ordered_set = tree<T, null_type, less_equal<T>, rb_tree_tag, tree_orde... | ALGO | 0.999703 | 4.070151 |
7994d260-b996-4e5f-8d91-d0c6d49ea347 | mc-cat-tty/llvm-17.0.6-compilers | libcxx/test/std/utilities/template.bitset/bitset.members/op_eq_eq.pass.cpp | // test:
// bool operator==(const bitset<N>& rhs) const; // constexpr since C++23
// bool operator!=(const bitset<N>& rhs) const; // constexpr since C++23
#include <bitset>
#include <cassert>
#include <cstddef>
#include <vector>
#include "../bitset_test_cases.h"
#include "test_macros.h"
template <std::size_t N>
TES... | TEST | 0.861099 | 7.598208 |
8834d36f-c4a3-43ef-9583-2fb35d2c79ac | daviddoria/VTKHoughPlanes | 3rdparty/ann_1.1.1_modified/src/kd_split.cpp | #include "kd_tree.h" // kd-tree definitions
#include "kd_util.h" // kd-tree utilities
#include "kd_split.h" // splitting functions
//----------------------------------------------------------------------
// Constants
//----------------------------------------------------------------------
const double ERR... | ALGO | 0.99992 | 4.237164 |
0c025b51-6093-4f64-be65-a427b26a9e58 | aritradev/My-practice-Problem | B_Fox_and_Cross.cpp | #include <bits/stdc++.h>
using namespace std;
#define cobra_69xp
#define optimize() \
ios_base::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0)
using ll = long long int;
using ull = unsigned long long int;
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.re... | ALGO | 0.999755 | 4.565785 |
3384f99a-4114-41f6-9918-84c7510ebc28 | RoshanJ1612/Development | 1385-find-the-distance-value-between-two-arrays/1385-find-the-distance-value-between-two-arrays.cpp | class Solution {
public:
int findTheDistanceValue(vector<int>& arr1, vector<int>& arr2, int d)
{
int c = 0;
for(int i = 0; i<arr1.size();i++)
{
for(int j = 0; j<arr2.size();j++)
{
int temp = arr1[i] - arr2[j];
if(temp < 0)
... | ALGO | 0.99988 | 5.609619 |
13da74fb-c054-4b16-a60a-1de7f294b7d5 | CursosIE/IE-0217-II-16-G6 | Proyecto_1/blastobject.cpp | #include "blastobject.h"
/**
* @brief Constructor vacio de clase blastobject.
*/
blastobject::blastobject() {
const char * base = "GGAATTGCAGGG"; //AGCCACGCACTA
this->size = 12; //buscar funcion para esto
this->rawscore = 0;
this->gapcounter = 0;
this->base = base;
this->T=13;
}
/**
* @brie... | ALGO | 0.875996 | 3.123782 |
5d79fc1d-ac54-4a8d-aba2-4d8e586b6da0 | 6a/git-gud-search | main.cpp | #include "./utility/io.h"
#include "./algorithms/binarysearch.h"
#include "./algorithms/linearsearch.h"
#include "./algorithms/jumpsearch.h"
#include "./algorithms/exponentialsearch.h"
int main()
{
utility::outputResult("Binary Search", bs::test(1));
utility::outputResult("Binary Search (Recursive)", bs::tes... | TEST | 0.929811 | 3.685797 |
04330655-f1e5-4ca1-9678-274ec69ff825 | yamini3701/Striver-SDE-Sheet | Recursion/4-CombinationSum2.cpp | class Solution {
public:
void solve(int ind, int target, vector<int>& arr, vector<vector<int>> & ans, vector<int> & ds){
if(target==0){
ans.push_back(ds);
return;
}
for(int i=ind ; i<arr.size() ; i++){
if(i>ind && arr[i]==arr[i-1])
con... | ALGO | 0.999992 | 6.16602 |
c9143a94-b0f5-4fcf-ad48-b3fe6cdf743f | ishandutta2007/codeforces | pashka/normal/1490/A.cpp | #include <bits/stdc++.h>
#define long long long int
using namespace std;
// @author: pashka
struct test {
void solve() {
int n;
cin >> n;
vector<int> a(n);
for (int i = 0; i < n; i++) cin >> a[i];
int res = 0;
for (int i = 0; i < n - 1; i++) {
int x = m... | ALGO | 0.99978 | 4.274777 |
001ff75f-8d74-4d60-8b24-a8fe402f063d | Genihoust/llvm-project-repacked2 | llvm/lib/Support/Program.cpp | #include "llvm/Support/Program.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Config/config.h"
#include <system_error>
using namespace llvm;
using namespace sys;
//===----------------------------------------------------------------------===//
//=== WARNING: Implementation here must contain only TRULY operating syst... | TOOL | 0.870608 | 7.065667 |
5182d3d5-fd60-4c61-b2a8-5897cf7269a6 | ak2943/Cpp_Programs | highsal.cpp | #include<iostream>
using namespace std;
class emp
{
public:
int eid;
string name;
string dept;
float salary;
emp()
{
cout<<"\n Enter Employee ID: ";
cin>>eid;
cout<<"\n Enter Employee NAME: ";
cin>>name;
cout<<"\n Enter Employee DEPARTMENT: ";
cin>>dept;
cout<<"\n Enter Employee SAL... | ALGO | 0.981978 | 3.559271 |
b1b79370-bdfa-40b1-8697-2c0c417ce7b9 | Mahamudul-Hasan-Rafi/Data-Structures-and-Algorithm | C++/Array/Stickler Thief.cpp | class Solution
{
public:
int calculateSum(int arr[], int index, vector<int> &dp)
{
if(index==0)
return arr[index];
if(index<0)
return 0;
if(dp[index]!=-1)
return dp[index];
int l=arr[index]+calculateSum(arr, index-2, dp);
... | ALGO | 0.999926 | 5.267576 |
a0b63230-c631-48d3-a668-71c8d34e6d53 | DanielTLouis/HackerRank | 30DaysOfCode/Prepare_Tutprials_30DaysOfCode_Day7Arrays.cpp | /*Problem*/
/**
Objective
Today, we will learn about the Array data structure. Check out the Tutorial tab for learning materials and an instructional video. https://www.hackerrank.com/challenges/30-arrays/tutorial
Task
Given an array, A, of N integers, print A's elements in reverse order as a... | ALGO | 0.999923 | 5.533574 |
4b8d502f-3a13-4815-9ad1-ed440cfbb34b | fdmxfarhan/CPP_Projects | test-25 nzelee mohadab/main.cpp | #include <iostream>
#include <graphics.h>
#include <math.h>
using namespace std;
main()
{
int x[200],y[200],n,len[200],a;
cout << "chandzelee mikhay??"<<endl;
cin >> n;
for(int i=0;i<n;i++){
cout<<endl<<"X ro bede:";
cin>>x[i];
cout<<endl<<"Y ro bede:";
cin>>y[i];
}
... | ALGO | 0.999444 | 3.381394 |
1bc9dbc5-ce53-4bc8-809b-73c9569cdc8a | zziri/study | ps/BOJ/5397 키로거.cpp |
/**
* @author Jihoon Jang
*/
#include <iostream>
#define SIZE 1000001
#define LEFT 10
#define RIGHT 20
using namespace std;
typedef char element;
typedef struct node
{
element data;
struct node *prev, *next;
node(void):data((element)NULL), prev(NULL), next(NULL){}
}node;
class dll
{
public:
node *head, *ta... | ALGO | 0.999864 | 3.982384 |
82077e7c-1e5d-48f5-b2a5-e34010cd003b | kyomin/algorithm | Programmers/programmers_120899.cpp | #include <string>
#include <vector>
using namespace std;
vector<int> solution(vector<int> array) {
vector<int> answer;
answer.resize(2);
int len = array.size();
int max = -1;
for (int i = 0; i < len; i++) {
int num = array[i];
if (num > max) {
max = num;
answer[0] = max;
answer[1] = i;
}
}
r... | ALGO | 0.999531 | 5.328142 |
7a83da44-fc2b-4a13-b5de-d5212e46c1d8 | leeguandong/sd_webui_powerpaint | mmcv/ops/csrc/parrots/three_nn.cpp | // Modified from
// https://github.com/sshaoshuai/Pointnet2.PyTorch/tree/master/pointnet2/src/interpolate.cpp
#include "pytorch_cpp_helper.hpp"
#include "pytorch_device_registry.hpp"
void three_nn_forward_impl(int b, int n, int m, const Tensor unknown,
const Tensor known, Tensor dist2, Tens... | DATA | 0.945632 | 6.372291 |
5c7f965c-a27d-415d-8fdf-4bd43c0d2b98 | Remonhasan/cp-code-library | Number Theory/Segment-Sieve.cpp | /* Author: Remon Hasan
Algorithm: Segment Sieve
*/
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define SIZE 32000
#define pb push_back
vector<int>primes;
void SieveBrain(){
bool isPrime[SIZE];
for(int i=0;i<SIZE;i++) isPrime[i]=true;
for(int i=3;i*i<=SIZE;i+=2){
if(isPrime[i]){
... | ALGO | 0.998886 | 3.755238 |
bbf5c985-cb5c-470f-a486-1a569535c93a | Jagdkotehok/HSE-CPP-course | tasks/palindrome/palindrome.cpp | #include "palindrome.h"
const int SPACE_CODE = static_cast<int>(' ');
bool IsPalindrome(const std::string& str) {
if (str.empty()) {
return true;
}
size_t left_index = 0;
size_t right_index = str.size() - 1;
while (left_index < right_index) {
int left_symbol = static_cast<int>(str[... | ALGO | 0.996713 | 5.316953 |
935427ed-f3de-440b-96cf-fe508b11cb96 | kunalrana9458/cpp_dsa_supreme | charArray_and_string/Class/findAndReplacePattern.cpp | #include<iostream>
#include<unordered_map>
#include<vector>
using namespace std;
void normalize(string& str){
char start='a';
unordered_map<char,char> mpp;
for(int i=0;i<str.length();i++){
char stringCharacter=str[i];
if(mpp.find(stringCharacter) == mpp.end()){
mpp[stringCharac... | ALGO | 0.999919 | 5.231763 |
2c000f9f-d0c0-4e4e-8b4a-c137bf7565a0 | yaofanghao/cpp | C++_Primer/ch05/ex5_14.cpp | #include <iostream>
#include <string>
using std::cout; using std::cin; using std::endl; using std::string; using std::pair;
int main()
{
pair<string, int> max_duplicated;
int count = 0;
for (string str, prestr; cin >> str; prestr = str)
{
if (str == prestr) ++count;
else count = 0;
... | ALGO | 0.999793 | 4.442058 |
0d211721-e4e9-422c-99ca-6dd379a21a16 | dariushm/BDsample_DM | code_numer/pdes/pde_iterate_asym.cpp | /*
calculate the solution to the Smoluchowski equation
that is, the probability distribution as it evolves in space
and time
same as pde_iterate.cpp but it does not use the symmetrized form
of the equation
oct 2010
maggie johnson
*/
#include <fstream>
#include <iostream>
#include <ctime>
#include <cmath>
using nam... | ALGO | 0.999997 | 4.355117 |
7cdf59b9-1510-4c3b-a812-7e6cc6b0d738 | cmiyachi/CygWinAlgorithms | DailyCodingProblem/lru.cpp | #include <bits/stdc++.h>
using namespace std;
class Node
{
public:
string key;
int value;
Node *prev;
Node *next;
Node(int value, string key)
{
this->value = value;
this->key = key;
this->next = NULL;
this->prev = NULL;
}
};
class LinkedList {
public:
Node *head;
Node *tail;
LinkedList() {... | ALGO | 0.999249 | 4.888088 |
0ebbc8bc-666e-4e83-9367-b92994870a8c | deoliaman00/LEETCODE-SOLUTIONS | 1658-minimum-operations-to-reduce-x-to-zero/1658-minimum-operations-to-reduce-x-to-zero.cpp | class Solution {
public:
int minOperations(vector<int>& nums, int x) {
int sum=0,i=0,j=0,ans=0,target=0;
for (int i:nums) target+=i;
target-=x;
if (target<0) return -1;
if (target==0) return nums.size();
while (j<nums.size()) {
sum+=nums[j];
wh... | ALGO | 0.999979 | 5.565231 |
546fc572-ab82-474f-8557-17e0e5e024a0 | devforgood/Coding | 2447/2447.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
void star(int x, int y, int num)
{
if ((x / num) % 3 == 1 && (y / num) % 3 == 1) {
printf(" ");
}
else {
if (num / 3 == 0) {
printf("*");
}
else {
star(x, y, num / 3);
}
}
}
int main(int... | ALGO | 0.999971 | 3.446808 |
042d95b0-4a9c-4b56-8c75-777144664120 | MVARUNREDDY8203/LEETCODE_- | 1566-check-if-a-word-occurs-as-a-prefix-of-any-word-in-a-sentence/check-if-a-word-occurs-as-a-prefix-of-any-word-in-a-sentence.cpp | class Solution {
public:
int isPrefixOfWord(string sentence, string sw) {
int n = sentence.size(), m = sw.size();
string curr = "";
int idx = 1;
for (int i=0; i<n; i++) {
if (curr.size() == sw.size()) {
if (curr == sw) return idx;
}
... | ALGO | 0.999797 | 5.657373 |
7c576c11-46a7-4898-a71c-9d81a4958334 | sakshamrathi21/Competitive_Programming | problems_solved/1915c.cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long
signed main () {
ios::sync_with_stdio(0);
cin.tie(0);
int t;
cin >> t;
while (t--) {
int n;
cin >> n;
int a[n];
for (int i = 0 ; i < n ; i ++) cin >> a[i];
int s = 0;
for (int i = 0 ; ... | ALGO | 0.999253 | 4.472756 |
872899d9-a7c5-4ee3-a825-e083fbbee610 | ishandutta2007/codeforces | shameimaru_aya/normal/1608/E.cpp | #include <bits/stdc++.h>
using namespace std;
int n , ans , bb , t[10] , id[10] , l , tot , lim;
struct item
{
int x , y , c;
} nx[110000] , ny[110000];
bool cmpx( item a , item b )
{
return a.x < b.x;
}
bool cmpy( item a , item b )
{
return a.y < b.y;
}
int scan( int c , int k )
{
tot = 0;
for( ; l <= n ; l++ )... | ALGO | 0.999882 | 3.966279 |
a4eda940-3e38-4e98-9a89-bce79dc0257a | olegshnitko/libboost | libs/mpl/example/fsm/player2.cpp | #include <vector>
#include <ctime>
#include <iostream>
#if defined(BOOST_DINKUMWARE_STDLIB) && BOOST_DINKUMWARE_STDLIB < 310
namespace std { using ::clock_t; }
#endif
namespace mpl = boost::mpl;
using namespace mpl::placeholders;
// A metafunction that returns the Event associated with a transition.
template <class ... | ALGO | 0.909102 | 7.725194 |
792428e1-cd2f-43c4-a0da-4b9227abbb92 | hfinkel/llvm-lfort | lib/Transforms/Scalar/SimplifyCFGPass.cpp | #define DEBUG_TYPE "simplifycfg"
#include "llvm/Transforms/Scalar.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/IR/Attributes.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/Intr... | TOOL | 0.924783 | 7.568244 |
c16a44f0-0732-4a86-80e3-06a72cd34e95 | shailpujan88/leetcode-daily-question | 0074-search-a-2d-matrix/0074-search-a-2d-matrix.cpp | class Solution {
public:
bool searchMatrix(vector<vector<int>>& matrix, int target) {
int n=matrix.size();
int m=matrix[0].size();
if (n == 0) return false;
for(int i=0;i<n;i++){
for(int j=0;j<m;j++){
if(matrix[i][j]==target){
return ... | ALGO | 0.999969 | 5.982039 |
66b2d968-2651-4894-8e92-2a3f7047d7c1 | AhmedEsraf/my_codeforces_submissions | in_C++/50A_domino_piling.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int row, col;
cin >> col >> row ;
int domino_num = 0, extra_space = 0;
if (col % 2 == 1)
{
extra_space = row;
}
while (col > 1)
{
col = col - 2;
domino_num++;
}
domino_num = domino_num * row;
... | ALGO | 0.999562 | 4.408904 |
09e84ef8-5fdf-4d04-ae73-2eb1c8d166b6 | parakh94/Codechef---Spoj | chef_&_polygons.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define sf scanf
#define pf printf
long long int binarySearch(long long int arr[],long long int l, long long int r, long long int x)
{
while (l <= r)
{
long long int m = l + (r-l)/2;
if (arr[m] == x) return m; // Check if x is present ... | ALGO | 0.999967 | 4.148875 |
6e9053ef-4383-4da2-aca8-3ba66d8c7e64 | sarvex/solution-cpp | 1448.count_good_nodes_in_binary_tree.cpp | #include <functional>
#include <limits>
struct TreeNode {
int val;
TreeNode* left;
TreeNode* right;
TreeNode() :
val(0), left(nullptr), right(nullptr) {}
explicit TreeNode(const int x) :
val(x), left(nullptr), right(nullptr) {}
TreeNode(const int x, TreeNode* left, TreeNode* right) :
val(x),... | ALGO | 0.999561 | 6.722325 |
c0e9e10c-e018-4241-84cd-d1b8266e9b31 | HEltim7/cpcode | CF/Round/807/C_Mark_and_His_Unfinished_Essay.cpp | #include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
#define endl '\n'
using LL=long long;
using PII=pair<LL,LL>;
const int N=2e5+10;
char arr[N];
// #define ONLINE_JUDGE
#ifndef ONLINE_JUDGE
#include<heltim7/debug>
#else
#define debug(...)
#endif
void solve() {
int n,c,q;
cin>>n>>... | ALGO | 0.999946 | 3.954807 |
d1de573a-ce5c-49b6-b98c-f73002d9cc44 | ishandutta2007/codeforces | ei133333/normal/808/C.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long int64;
// ???i????j??????? a_i > a_j(????????)
int main()
{
int N, W;
cin >> N >> W;
vector< pair< int, int > > vs;
for(int i = 0; i < N; i++) {
int a;
cin >> a;
vs.emplace_back(a, i);
}
sort(begin(vs), end(vs));
int ret = 0;... | ALGO | 0.999987 | 3.849905 |
2f61510b-bfbf-4bcd-b9ac-1954f1912f06 | DarkLordZero19/cppFuncProjects | Задачи на массивы.cpp | #include <iostream>
#include <cstdlib>
#include <ctime>
#include <vector>
#include <cmath>
using namespace std;
//Из массива удаляется элемент с позиции (допустим 5)
int main() {
const int MAX_SIZE = 10;
int arr[MAX_SIZE] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
int size = 10;
int position = 5;
cout ... | ALGO | 0.996653 | 3.842112 |
7724bd09-dcac-4981-b2f2-2609e732e865 | stn1229/contest-code | 第一屆排名賽/F.cpp | #include <iostream>
using namespace std;
int main( void )
{
int g , f , c , e , d , b , n , a ;
long long int Fib[ 100 ];
Fib[ 0 ] = 1;
Fib[ 1 ] = 2;
for( a = 2 ; a < 100 ; a ++)
{
Fib[ a ] = Fib[ a - 1 ] + Fib[ a - 2 ];
}
//cout << Fib[ 97 ] << endl;
long long int input;
cin >> n;
int ans[ 100... | ALGO | 0.999889 | 3.585924 |
cf622d1f-f8ee-4b5c-b5ba-00d49e051553 | Bishalkl/Data-structure-and-Algorithims | arrays/array.cpp | #include <iostream>
using namespace std;
int main() {
// largest value possible +infinity is INT_MAX
int nums[] = {26, 4, 67,3, 4, 80, 68, 100};
int size = sizeof(nums) / sizeof(int);
int smallest = INT16_MAX;
int largest = INT16_MIN;
for(int i = 0; i <= size-1; i++) {
smallest = min(nu... | ALGO | 0.999327 | 3.946465 |
e150d724-24ee-45df-8ef7-1b72cbe450a9 | revyos-rocm/rocm-llvm | libc/benchmarks/automemcpy/lib/RandomFunctionGenerator.cpp | #include "automemcpy/RandomFunctionGenerator.h"
#include <llvm/ADT/StringRef.h>
#include <llvm/Support/raw_ostream.h>
#include <optional>
#include <set>
namespace llvm {
namespace automemcpy {
// Exploration parameters
// ----------------------
// Here we define a set of values that will contraint the exploration a... | ALGO | 0.921059 | 7.32292 |
fa71a542-057f-4b64-b04a-b5d6579d0960 | bishalprasad321/SDE-Sheet | Day 02/rotate_matrix.cpp | #include<bits/stdc++.h>
using namespace std;
/*
Problem Desription:
------------------
You are given an n x n 2D matrix representing an image, rotate the image by 90 degrees (clockwise).
You have to rotate the image in-place, which means you have to modify the input 2D matrix directly. DO NOT allocate another 2D matr... | ALGO | 0.999982 | 6.587844 |
6757d1a5-9d23-47d7-9479-660537e57aeb | ToprakArslann/ascii-video | libs/opencv/sources/samples/cpp/tutorial_code/features2D/Homography/perspective_correction.cpp | #include <iostream>
#include <opencv2/core.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/calib3d.hpp>
#include <opencv2/highgui.hpp>
using namespace std;
using namespace cv;
namespace
{
enum Pattern { CHESSBOARD, CIRCLES_GRID, ASYMMETRIC_CIRCLES_GRID };
Scalar randomColor( RNG& rng )
{
int icolor = (unsign... | ALGO | 0.993302 | 6.124301 |
8671a5ea-2f6b-442e-b662-09fac4f7a3c1 | ishandutta2007/codeforces | rafi22/normal/1609/E.cpp | #include <bits/stdc++.h>
#define int long long
#define ll long long
#define ld long double
#define endl '\n'
#define st first
#define nd second
#define pb push_back
#define sz(x) (int)(x).size()
#define all(x) (x).begin(), (x).end()
using namespace std;
double PI=3.14159265359;
int inf=1000000000000000007;
int mod=100... | ALGO | 0.999848 | 4.640182 |
83c7c662-69c4-44d5-ac42-1a69d42321a5 | yuchulnote/Personal_Project | 3-1/AlphaPose/pytorch3d/pytorch3d/csrc/point_mesh/point_mesh_cpu.cpp | #include <torch/extension.h>
#include <array>
#include <limits>
#include "utils/geometry_utils.h"
#include "utils/vec3.h"
// - We start with implementations of simple operations on points, edges and
// faces. The hull of H points is a point if H=1, an edge if H=2, a face if H=3.
template <typename T>
vec3<T> ExtractP... | ALGO | 0.999134 | 6.862287 |
afa59859-1a5e-4951-b1be-73280e6c51a7 | nec-mpc/SPDZ-2 | Player-Online.cpp | #include "Processor/Machine.h"
#include "Math/Setup.h"
#include "Tools/ezOptionParser.h"
#include "Tools/Config.h"
#include <iostream>
#include <map>
#include <string>
#include <stdio.h>
using namespace std;
int main(int argc, const char** argv)
{
ez::ezOptionParser opt;
opt.syntax = "./Player-Online.x [OPTI... | TOOL | 0.877656 | 4.252514 |
49494f82-1399-43a9-a07e-e66c7dc8888b | abcivashritt/codechef | Dice Number.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
int t;
cin>>t;
while(t--) {
vector < int > a(3), b(3);
for(int i=0;i<3;i++)
cin>>a[i];
for(int i=0;i<3;i++)
cin>>b[i];
sort(a.rbegin(), a.rend());
sort(b.rbegin(), b.rend());
for(int i=0;i<3;i++) {
if(a... | ALGO | 0.999894 | 3.689816 |
3be3b335-d046-4acf-ae1e-dc055eb9d3ba | LooOnGit/CODE_Student | OPENCV/opencv-master/modules/dnn/src/layers/concat_layer.cpp | #include "../precomp.hpp"
#include "layers_common.hpp"
#include "../op_cuda.hpp"
#include "../op_halide.hpp"
#include "../op_inf_engine.hpp"
#include "../ie_ngraph.hpp"
#include "../op_vkcom.hpp"
#include "../op_webnn.hpp"
#include "../op_timvx.hpp"
#include "../op_cann.hpp"
#ifdef HAVE_OPENCL
#include "opencl_kernels... | ALGO | 0.865925 | 6.921255 |
33a5bc92-6e3f-4f41-a3b1-8c9a01f1972f | CristopherApu/Sesi-n-6 | actividad4.cpp | #include <stdio.h>
int main(){
int edad;
int destino;
int valor_final;
printf("Bienvenido, por favor ingrese su edad\n");
scanf("%d", &edad);
if(edad<15){
printf("A que destino desea ir?\n");
scanf("%d", &destino);
if(destino == 1){
valor_final = 2500;
printf("El valor de su boleto es de:%d\n", ... | TOOL | 0.867652 | 3.974101 |
c0a6fe6c-a8bf-448f-88d8-71d220cdf906 | 192125007/CSA04-OS | ex 22.cpp | #include <stdio.h>
#define MAX_BLOCKS 100
// Structure to represent a memory block
struct MemoryBlock {
int block_id;
int size;
int allocated;
};
// Function to allocate memory using best fit
void allocateMemory(struct MemoryBlock blocks[], int num_blocks, int process_id, int process_size) {
int best... | ALGO | 0.991311 | 5.787813 |
b59ffffd-f4e2-4d5e-91eb-983be27615f9 | bhavyawig/Competitive-Programming | Beautiful Year codeforces.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int y;
cin >> y;
while (true)
{
y += 1;
int a=y/1000;
int b= y/100%10;
int c= y/10%10;
int d=y%10;
if (a != b && a != c && a != d && b != c && b != d && c != d)
{
break;
... | ALGO | 0.998514 | 3.220689 |
981788b2-254a-4f3c-be4e-3d3c90d410e8 | deified-paper/llvm | libcxx/test/std/algorithms/alg.modifying.operations/alg.remove/remove.pass.cpp | // <algorithm>
// template<ForwardIterator Iter, class T>
// requires OutputIterator<Iter, RvalueOf<Iter::reference>::type>
// && HasEqualTo<Iter::value_type, T>
// constexpr Iter // constexpr after C++17
// remove(Iter first, Iter last, const T& value);
#include <algorithm>
#include <cassert>
#... | TEST | 0.904359 | 7.246379 |
806be701-40ff-4b21-a18a-35ca5e39223a | Biggergig/Advent-of-code-2020 | Day 17/p2.cpp | #include "../utility.cpp"
struct Coord{
int x, y, z, w;
Coord(int a, int b, int c, int d):x(a), y(b), z(c), w(d){}
Coord(){}
Coord(const Coord& inp):x(inp.x), y(inp.y), z(inp.z), w(inp.w){}
bool operator <(const Coord& c) const {
if(x<c.x){
return true;
}else if(x == c.x... | ALGO | 0.999626 | 4.656316 |
967c26ee-b81a-480c-ae1b-6e039b016063 | eemoreira/biblioteca-de-problemas | cf/typeDB2023/d.cpp | #include <bits/stdc++.h>
using namespace std;
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void... | ALGO | 0.999895 | 3.96632 |
b4ad5349-eb69-4e99-b0ef-1b3fe0823659 | aBBassam/CP-Solutions | CodeForces/GNU C++20 (64)/1709B | Also Try Minecraft/165363869.cpp | // Problem: B. Also Try Minecraft
// Contest: Codeforces - Educational Codeforces Round 132 (Rated for Div. 2)
// URL: https://codeforces.com/contest/1709/problem/B
// Memory Limit: 256 MB
// Time Limit: 2000 ms
//
// Powered by CP Editor (https://cpeditor.org)
#include <bits/stdc++.h>
#define ll long long
#define a... | ALGO | 0.999926 | 4.504018 |
ecfdc044-1da9-4191-900b-62b89741ba49 | hieplpvip/cses-solutions | cpp/1701.cpp | #include <bits/stdc++.h>
#define all(x) begin(x), end(x)
#define emb emplace_back
using namespace std;
using vi = vector<int>;
struct Ahu {
int n, cnt = 0;
vector<vi> g1, g2;
map<vi, int> mp;
int findCentroid(vector<vi> &g, int u, int p, vi& c) {
bool ok = true; int nChild = 1;
for (int v: g[u]) if (v ... | ALGO | 0.999886 | 5.297519 |
a8f5df3b-aa2b-4afe-97fb-bb79e14d7eec | zhqhqch/HomeDefense | cocos2d/cocos/base/ZipUtils.cpp | #include <zlib.h>
#include <assert.h>
#include <stdlib.h>
#include "base/ZipUtils.h"
#include "base/CCData.h"
#include "base/ccMacros.h"
#include "platform/CCFileUtils.h"
#include "unzip.h"
#include <map>
NS_CC_BEGIN
unsigned int ZipUtils::s_uEncryptedPvrKeyParts[4] = {0,0,0,0};
unsigned int ZipUtils::s_uEncryptionK... | TOOL | 0.893463 | 6.41228 |
2219f1e6-c7a0-4941-9ba5-b9f444495783 | nikarun/LeetCode-DSA-June | 724-find-pivot-index/find-pivot-index.cpp | class Solution {
public:
int pivotIndex(vector<int>& nums) {
int n=nums.size();
int rightSum=0;
for(int i=n-1;i>=0;--i){
rightSum+=nums[i];
}
int leftSum=0;
for(int i=0;i<n;++i){
leftSum+=nums[i];
if(leftSum==rightSum) return i;
... | ALGO | 0.999992 | 6.265902 |
3afb02a2-802c-4caa-827a-d8fdd51d9f7b | tomo1010blue/AtCoder | ABC/ABC194/D.cpp | #include <bits/stdc++.h>
#include <atcoder/all>
#define fi first
#define se second
#define repl(i, l, r) for (int i = l; i < r; ++i)
#define rep(i, r) repl(i, 0, r)
#define pb push_back
#define eb emplace_back
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
#define sz(x) ((int) (x).size())
... | ALGO | 0.999333 | 3.85373 |
9a6d1ade-2980-4659-b382-eb1b595df458 | MathIsLife/CoolestCodeLibrary | SPOJ - K-Query II.cpp | /*
|\ | `|` |``\ ```|` | | /```\ |``\
| \ | | |__/ | |___| | | |__/
| \ | | | \ | | | | | | \
_| \| _|_ | \ \__) | | \___/ | \
SPOJ - K-Query II (KQUERY2)
Category: Data Structures
Keys: Square Root Decomposition, Sort... | ALGO | 0.999754 | 4.498611 |
f4af4a06-c088-4b3b-aae7-94c4bc492044 | lifajun/algorithm | AlgorithmStudy/GraphTheory/Graham.cpp | #include <iostream>
#include <algorithm>
using namespace std;
struct Point
{
int x, y;
}p[50005], a[50005];
int n;
int crossMulti(Point p0, Point p1, Point p2)//
{
return (p1.x - p0.x) * (p2.y - p0.y) - (p2.x - p0.x) * (p1.y - p0.y);
}
int dist(Point p1, Point p2)
{
return (p2.x - p1.x) * (p2.x - p1.x) + (p2.y - ... | ALGO | 0.999917 | 4.447538 |
f7b6dae4-a63a-4a2e-a8da-deb8ce4a3609 | TrungKien0609/Learning-OOP-C- | PlaneTicket.cpp | #include <iostream>
class Date
{
protected:
int day, month, year;
public:
Date()
{
this->day = this->month = this->year = 0;
}
~Date()
{
this->day = this->month = this->year = 0;
}
void input()
{
std::cout << "Please enter the day of the flight:";
std... | ALGO | 0.953932 | 4.624091 |
196b06e4-21a7-4565-8655-f202e1fadd4a | ret2jazzy/Hackerrank-30-days-of-Code-Cpp | Solutions/Day-25.cpp | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
bool CheckPrime(int n){
if(n == 1){return false;}
int m;
m = sqrt(n);
bool isprime = true;
for(int i = 2; i <= m; ++i){
if(n % i == 0){
isprime = false;
... | ALGO | 0.999723 | 4.275558 |
bbca6b80-c908-4226-bfe7-807e8ebf372c | WitAqua/packages_modules_adb | daemon/auth.cpp | #define TRACE_TAG AUTH
#include "sysdeps.h"
#include <resolv.h>
#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <chrono>
#include <iomanip>
#include <map>
#include <memory>
#include <thread>
#include <adb/crypto/rsa_2048_key.h>
#include <adb/tls/adb_ca_list.h>
#include <adbd_auth.h>
#include <a... | TOOL | 0.863614 | 7.896305 |
7915da78-82ee-430e-8af0-9e67cc6fd0ba | alb-jauregui/quark | C++_Elemental/1-C++_Elemental/9-Estructura_repetitiva_while/WhileDosListasValores/archivo.cpp | // #include<iostream>
// using namespace std;
// int main()
// {
// int valor,x,suma1,suma2;
// x=1;
// suma1=0;
// suma2=0;
// cout <<"Primer lista";
// cout <<"\n";
// while (x <= 15)
// {
// cout <<"Ingrese valor:";
// cin >>valor;
// suma1=suma1 + valor;
// ... | ALGO | 0.989382 | 3.807535 |
e8fd4dc5-ddac-41d3-8ce4-3afe101de606 | Ahmad-AlDeeb/Problem-Solving | Codeforces/Almost Arithmetic Progression.cpp | #include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define ll long long
#define ld long double
#define F first
#define S second
#define vll vector<long long>
#define pb push_back
#define all(v) v.begin(), v.end()
////////////////////////////////... | ALGO | 0.999858 | 4.072575 |
16c67b04-f460-4fce-9b83-68bfd21068bf | hfhongzy/CodeForOI | luogu-4103.cpp | #include <bits/stdc++.h>
#define pb push_back
#define rep(i, j, k) for(int i = j; i <= k; ++ i)
#define per(i, j, k) for(int i = j; i >= k; -- i)
using namespace std;
typedef long long ll;
const int N = 1e6 + 20;
int n, q, st[N], top, dfn[N], seq[N], s, logn, f[N][21], d[N];
vector<int> G[N], T[N];
void dfs(int u, int ... | ALGO | 0.999848 | 3.951396 |
e0e55845-f54c-4502-a5f6-69f13f2405ef | zoloypzuo/Sandbox | src/openexr/src/ilmimf/ImfLut.cpp | //-----------------------------------------------------------------------------
//
// Lookup tables for efficient application
// of half --> half functions to pixel data,
// and some commonly applied functions.
//
//-----------------------------------------------------------------------------
#include <ImfLut.h>
#incl... | TOOL | 0.989827 | 6.518975 |
2aaeac87-7888-48a5-8ba7-30ef230669d2 | VedashreeD/Data-structures-and-algorithms | Programs/trapping_rain_water.cpp | #include<iostream>
#include<vector>
int trap(std::vector<int>& elevations)
{
int i = 0, j = elevations.size() - 1;
int left_max = elevations[0], right_max = elevations[j];
int res = 0;
while(i < j)
{
//if the left elevation is smaller than right wall,
//add the smaller el... | ALGO | 0.999827 | 6.20382 |
9576768b-064f-429f-b83e-f8bb39ca2565 | Prithvirajbilla/AlgorithmCoding | codechef/JAN17/RESERVOI.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
char A[1002][1002];
int N,M;
bool extreme(int i,int j)
{
return ((i == 1) && (j == 1) || (i == N) && (j == 1) || (i == N) && (j == M) || (i == 1) && (j == M));
}
bool side(int i, int j)
{
return (j == M) || (i == N) || (j == 1);
}
int main()
{
int T... | ALGO | 0.999957 | 4.529645 |
cd1d04bb-010e-40fd-ab8f-a6ea7ecaa78e | Nilay-Bala/Operating-System | prioritynonpreemtive.cpp | #include<iostream>
using namespace std;
int main()
{
int a[10],b[10],x[10],pr[10]={0};
int waiting[10],turnaround[10],completion[10];
int i,j,smallest,count=0,time,n;
double avg=0,tt=0,end;
cout<<"\nEnter the number of Processes: ";
cin>>n;
cout<<endl;
for(i=0;i<n;i++)
{
cout<... | ALGO | 0.99995 | 3.233511 |
87be56b9-22f0-44a1-943a-2545a570942f | kaffu0424/problem-solving | boj/boj_16930.cpp | #include <iostream>
#include <queue>
#include <vector>
#include <algorithm>
#define INF 987654321
using namespace std;
int dy[4]{ -1,0,1,0 };
int dx[4]{ 0,1,0,-1 };
int N, M, K;
int arr[1000][1000];
int visit[1000][1000];
int eY, eX;
void bfs(int y, int x)
{
queue<pair<int, int>> q;
visit[y][x] = 1;
q.push({ y,x ... | ALGO | 0.999882 | 4.861784 |
0e8f088d-517b-4c33-bd68-d1f56c9bca69 | anthony-chaudhary/sdc-p10-mpc-linux | src/Eigen-3.3/doc/examples/tut_arithmetic_matrix_mul.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace Eigen;
int main()
{
Matrix2d mat;
mat << 1, 2,
3, 4;
Vector2d u(-1,1), v(2,0);
std::cout << "Here is mat*mat:\n" << mat*mat << std::endl;
std::cout << "Here is mat*u:\n" << mat*u << std::endl;
std::cout << "Here is u^T*mat:\n" << u.transpo... | ALGO | 0.998531 | 3.818773 |
2591a074-6357-49bb-859f-78a085edc0e1 | ashokabairwaideology/Leet-code-problem | solution/0200-0299/0253.Meeting Rooms II/Solution.cpp | class Solution {
public:
int minMeetingRooms(vector<vector<int>>& intervals) {
int n = 1000010;
vector<int> delta(n);
for (auto e : intervals) {
++delta[e[0]];
--delta[e[1]];
}
for (int i = 0; i < n - 1; ++i) {
delta[i + 1] += delta[i];
... | ALGO | 0.99999 | 6.292043 |
a87e3160-8b01-4fa3-99c7-0a67a8817aa0 | Charbel-11/Competitive-Programming | Contests/Codeforces/629 Div3/F.cpp | #include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
#include <map>
using namespace std;
typedef long long ll;
int main() {
int n, k; cin >> n >> k;
vector<ll> a(n);
map<int, int> m; bool zero = false;
for (auto &x : a) { cin >> x; m[x]++; if (m[x] == k)zero = true; }
if... | ALGO | 0.999977 | 3.84359 |
3fcf0fc4-9300-42e5-b784-0318e46d696d | Trilokesh29/Interview_Questions | leetcode/remove_duplicates_from_sorted_array.cpp | /*
Given an integer array nums sorted in non-decreasing order, remove the
duplicates in-place such that each unique element appears only once. The
relative order of the elements should be kept the same.
*/
#include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
int removeDuplicates(vect... | ALGO | 0.999598 | 7.028702 |
4c8c328a-3b5b-479b-8153-80c4618b9d05 | srivastavayushi/Leetcoding | 1310-xor-queries-of-a-subarray/1310-xor-queries-of-a-subarray.cpp | class Solution {
public:
vector<int> xorQueries(vector<int>& arr, vector<vector<int>>& queries) {
vector<int>res;
for(int i=1;i<arr.size();i++){
arr[i] ^= arr[i-1];
}
for (auto &q: queries)
res.push_back(q[0] > 0 ? arr[q[0] - 1] ^ arr[q[1]] :... | ALGO | 0.999973 | 5.787051 |
eb9892cc-f710-4886-b912-41316f514c24 | StudyForCodeInterview/JeongHoo | 63_1389/63_1389/63_1389.cpp | // 63_1389.cpp : 이 파일에는 'main' 함수가 포함됩니다. 거기서 프로그램 실행이 시작되고 종료됩니다.
//
#include <iostream>
#include <vector>
#define MAX 1000000
using namespace std;
vector<vector<int>> D;
int main()
{
ios::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int N, M;
cin >> N >> M;
D = vector<vector... | ALGO | 0.999923 | 4.161628 |
fbd00df4-eace-4422-8176-6324a62546d7 | AdvTrainEvalSrcDomain/adv-train-evaluation-source-code-domain | code-imitator/data/dataset_2017/dataset_2017_8_formatted_macrosremoved/kjp4155/5304486_5697460110360576_kjp4155.cpp | #include <algorithm>
#include <assert.h>
#include <deque>
#include <functional>
#include <iostream>
#include <map>
#include <math.h>
#include <memory.h>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <unordered_map>
#include <vector... | ALGO | 0.998709 | 3.478268 |
25305057-45f0-45ea-bb49-f65d0eae7262 | SkatoriDev/Algorithm_OOP_DIHT | SEM_2/MODULE_4/A/source.cpp | /*Дано число N и последовательность из N целых чисел.
Найти вторую порядковую статистику на заданных диапазонах.
Для решения задачи используйте структуру данных Sparse Table.
Требуемое время обработки каждого диапазона O(1).
Время подготовки структуры данных .
Формат ввода
В первой строке заданы 2 числа: размер по... | ALGO | 0.999997 | 4.883443 |
9bdf89f6-7d0b-4c8c-82a6-9d7e468a04c6 | ydh1305/CodingExpert | Pro/SWEA/D5/DP_DFS/10204/10204.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int arr[100000];
int main(void) {
ios::sync_with_stdio(false);
cin.tie(0); cout.tie(0);
int T; cin >> T;
for(int t = 1; t <= T; t++) {
int N; cin >> N;
long long sol = 0;
for(int i = 0; i < N; i++) {
int ... | ALGO | 0.999652 | 4.061595 |
fd8543b0-a142-4020-9e9a-9d2fafeb1eb1 | Tekh-ops/old-c-cpp-code-i-wrote | pattern_cpp/pyramid.cpp | #include <iostream>
using namespace std;
int main(int argc, char const *argv[])
{
int n;
cin >> n;
//inverted pyramid pattern
for (int i = 1; i <= n; i++)
{
for (int j = 1; j <= n - i; j++)
{
cout << " ";
}
for (int j = 1; j <= i; j++)
{
... | ALGO | 0.999902 | 4.327506 |
28203e76-027a-46d0-b4e3-6b373c8a8634 | salkhokhar/v4-test2 | src/yolo_console_dll.cpp | #include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <queue>
#include <fstream>
#include <thread>
#include <future>
#include <atomic>
#include <mutex> // std::mutex, std::unique_lock
#include <cmath>
// It makes sense only for video-Camera (not for video-File)
// To use - uncomme... | TOOL | 0.87217 | 5.611351 |
1ed7f7a5-0438-4aa2-beec-9f24c46203b7 | Abhinavjha07/InterviewBit | Math/Excel_Column_Number.cpp | int Solution::titleToNumber(string A) {
if(A.length()==1)
return (int)(A[0]-'A')+1;
else
{
long long int n = A.length();
long long int ans = 0;
for(long long int i=0;i<n;i++)
{
ans = ans *26 +(int)(A[i]-'A')+1;
}
return an... | ALGO | 0.999973 | 5.372658 |
27a77e6b-a2bd-470c-acd0-8ccb2c83acd4 | g1257/PsimagLite | drivers/continuedFraction.cpp | #include "ContinuedFraction.h"
#include "Io/IoSimple.h"
#include "TridiagonalMatrix.h"
#include <cstdlib>
#include <fstream>
#include <iostream>
#include <string>
using namespace PsimagLite;
typedef double RealType;
typedef TridiagonalMatrix<RealType> TridiagonalMatrixType;
typedef ContinuedFraction<TridiagonalMatrixT... | ALGO | 0.950883 | 5.599981 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.