uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
57ecaa1e-8f39-4e2e-8b41-970f0657516b | DEmmaRL/CPP | B_Upscaling.cpp | #include <bits/stdc++.h>
#define ENDL '\n'
#define lli long long
#define pb push_back
#define ff first
#define ss second
#define fore(i,a,b) for(int i=a;i<b;i++)
#define all(s) begin(s), end(s)
#define sz(s) int(s.size())
#define IO ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
using namespace std;
using v... | ALGO | 0.999813 | 3.572893 |
c3d94c16-a3b0-447b-adfb-fe9866d626f0 | ishandutta2007/codeforces | snuke/normal/1110/G.cpp | #include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(),a.end()
#define maxs(x,y) (x = max(x,y))
#d... | ALGO | 0.999959 | 4.305942 |
e5c0b7cd-6f9f-48d8-9778-9ea89fc61e05 | lamhoangtung/Olympic-K12 | HAUI Contest/Contest 15-3/a.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int main(){
int n,a[100005],b[100005];
cin >> n;
for (int i=0;i<n;i++){
cin >> a[i];
b[i]=a[i];
}
sort(a,a+n);
int start = 0, end = 0;
for (int i=0;i<n;i++){
if (a[i]!=b[i]){
start=i;
break;
}
}
for (int i=n-1... | ALGO | 0.999903 | 3.57129 |
e186459f-8cee-4752-b3ec-73b171348f6d | Hardik-Gehlot/DSA | Hashing/ArrayPairSumDivisibilityProblem.cpp | // https://practice.geeksforgeeks.org/problems/array-pair-sum-divisibility-problem3257/1
// Problem:
// Given an array of integers and a number k, write a function that returns true if given array can be
// divided into pairs such that sum of every pair is divisible by k.
// Example 1 :
// Input : arr = [9, 5, 7, 3],... | ALGO | 0.999978 | 5.114806 |
3ca6df2b-8158-41f2-b6ed-0c4ac911990e | kamrulhasanrony/UVA-Online-Judge-Solutions | 674.cpp | /*
674 - Coin Change
*/
#include<bits/stdc++.h>
using namespace std;
int dp[6][7500];
int make;
int coin[]= {1,5,10,25,50};
int call(int i, int cnt)
{
if(i>=5)
{
if(cnt==0)
return 1;
else
return 0;
}
if(dp[i][cnt]!=-1)
return dp[i][cnt];
int ret1=0,r... | ALGO | 0.999015 | 4.121278 |
11df1063-50d0-4f2b-b21c-83cb41fd6a40 | rachnashetty27/repo759 | HW02/task2.cpp | //This task has been done with the help of chatgpt, claude.ai and google search.
#include <iostream>
#include <vector>
#include <cstdlib>
#include <ctime>
#include <chrono>
#include "convolution.h"
int main(int argc, char* argv[]) {
if (argc != 3) {
std::cerr << "Usage: " << argv[0] << " <n> <m>" << std::e... | ALGO | 0.969739 | 6.424356 |
36109935-bc91-4def-a5c0-7e997d804e36 | CodderPrince/1-1_Practice | STRUCTURED PROGRAMMING LANGUAGE 1-1/SEMESTER 2 SOLVE/50DP/PRACTICE/tempCodeRunnerFile.cpp | int m = s1.size(); // 1st string len
int n = s2.size(); // 2nd string len
// create 2d dp array
vector<vector<int>> dp(m + 1, vector<int>(n + 1, 0));
// fill up first row
for (int i = 0; i <= n; i++)
{
dp[0][i] = 0;
}
// fill up first col
for (int j = 0; j <= m; j++)
{
... | ALGO | 0.999972 | 6.010152 |
20c2b8e8-f6c9-49bd-9941-073a7b1f66a4 | QWERTYistoobasic/LeetCode | 785-is-graph-bipartite/785-is-graph-bipartite.cpp | class Solution {
private:
bool check(int i,vector<int> adj[],vector<int>&vis)
{
queue<int>q;
q.push(i);
vis[i]=0;
while(!q.empty())
{
int node=q.front();
q.pop();
for(auto it:adj[node])
{
if(vis[it]==-1)
... | ALGO | 0.999964 | 6.068888 |
5dfa0316-a57a-4aac-b865-fa70c8f25a40 | ambikagh/cplusplus | concordanceGenerator/WordQueue.cpp | // ---------------------------------------------------------------------------
// Author: Mukambika Hegde
// Date: 12/4/2015
// Course: 501 Assignment 6
// ---------------------------------------------------------------------------
#include "WordQueue.h"
//-----------------------------------------------------------... | ALGO | 0.937402 | 5.585738 |
7e903021-87ef-4a8a-8d58-555084cc740d | jailsonevora/leetcode-problem-set | G/128.longest-consecutive-sequence.cpp | /*
* @lc app=leetcode id=128 lang=cpp
*
* [128] Longest Consecutive Sequence
*/
// @lc code=start
#include<iostream>
#include<algorithm>
#include<vector>
#include<unordered_set>
#include<unordered_map>
#include<map>
using namespace std;
class Solution {
// find path compression
int _find(unordered_map<in... | ALGO | 0.999973 | 5.355168 |
c91c14bf-9de8-479a-bfee-ca60e68174b8 | yymin1022/Algorithm_Study | BOJ/27918.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
cin.tie(NULL);
cout.tie(NULL);
ios_base::sync_with_stdio(false);
int N;
cin >> N;
int D = 0;
int P = 0;
for(int i = 0; i < N; i++){
char c;
cin >> c;
if(c == 'D'){
D++;
}else{
... | ALGO | 0.999576 | 4.023181 |
68f2cc9b-5c0b-4b24-b2d3-c3558ba631bd | yuvraj0028/leetcode-submissions | 2059-unique-length-3-palindromic-subsequences/unique-length-3-palindromic-subsequences.cpp | class Solution {
public:
int countPalindromicSubsequence(string s) {
int n = s.size(), ans = 0;
vector<int> maxi(26, INT_MIN);
vector<int> mini(26, INT_MAX);
for(int i = 0;i<n; i++){
int index = s[i] - 'a';
maxi[index] = max(maxi[index], i);
mini[ind... | ALGO | 0.999678 | 6.270871 |
461206ef-9df9-4405-b8c7-7fb9f65080b9 | TwnKey/YCTT | YsChroniclesTools/ExeTranslateDLL/Utilities.cpp | #include "Utilities.h"
#include <iostream>
#include <unordered_set>
#include <unicode/ucnv.h>
#include <unicode/unistr.h>
int find_section_by_name(std::string name, std::vector<Section> sects) {
for (size_t idx_sect = 0; idx_sect < sects.size(); idx_sect++) {
if (sects[idx_sect].name == name) {
return idx_sect... | TOOL | 0.932884 | 3.849792 |
9da425fc-4a31-4afe-88e4-bbe96b541562 | FDU-VTS/LOL | src/fast_gicp/thirdparty/Eigen/bench/bench_reverse.cpp |
#include <iostream>
#include <Eigen/Core>
#include <bench/BenchUtil.h>
using namespace Eigen;
#ifndef REPEAT
#define REPEAT 100000
#endif
#ifndef TRIES
#define TRIES 20
#endif
typedef double Scalar;
template <typename MatrixType>
__attribute__ ((noinline)) void bench_reverse(const MatrixType& m)
{
int rows = m.r... | TEST | 0.92231 | 5.595998 |
4c94e40c-7fd2-4818-ae4b-a4d133a6b2e8 | ryanbai1412/cp-library | ds/tree.lca.test.cpp | #include "bits/extc++.h"
#include "template.hpp"
#include "ds/tree.hpp"
#define PROBLEM "https://judge.yosupo.jp/problem/lca"
void solve() {
int n, q;
cin >> n >> q;
vector<pair<int, int>> edges;
for (int i = 1; i < n; i++) {
int p;
cin >> p;
edges.emplace_back(p, i);
}
... | ALGO | 0.999791 | 5.198783 |
a659edad-f1cf-4e56-b267-fc611ccec68d | dshawul/Scorpio | src/attack.cpp | #include "scorpio.h"
CACHE_ALIGN static const uint8_t t_sqatt_pieces[] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0,
6, 0, 0, 0, 0, 0, 0, 10, 0, 0, 10, 0, 0, 0, 0, 0,
6, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 10, 0, 0, 0, 0,
6, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, ... | ALGO | 0.99941 | 5.362892 |
35eccf72-d5bd-4afa-9bb8-e91911dfed17 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_11673_6.cpp | #include <bits/stdc++.h>
using namespace std;
double c(int n, int r) {
if (n == r || r == 0) return 1;
double re = 1;
if (r > n / 2) r = n - r;
for (int i = 1, j = n; i <= r; i++, j--) {
re *= j;
re /= r;
}
return re;
}
int main(void) {
int n, m, h;
cin >> n >> m >> h;
vector<int> v(m);
int ... | ALGO | 0.999915 | 3.440184 |
951e5505-f435-414e-b4e6-fb2d81e7abd8 | DylanKobe1413/Project_Countries | Countries.cpp | #include "Countries.h"
//setters
void Countries::set_Top3(bool t)
{
Top3 = t;
}
void Countries::set_popCount(int i)
{
popCount = i;
}
void Countries::set_state(string s)
{
country = s;
}
void Countries::set_initials(string z)
{
initials = z;
}
//getters
string Countries::get_Top3()
{
string words;
if (Top3 =... | TOOL | 0.914766 | 4.299671 |
9cb96a72-484d-4230-b380-5f8fb3db837f | aminjonshermatov/competitive_programming | codeforces/div4/849/G1.cpp | // #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("fast-math")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using name... | ALGO | 0.999929 | 5.015345 |
dbacbfcd-c29e-4b2f-8444-c5d52c4f7b77 | Ahyoung-Kim/BOJ | 11655.cpp | #include<iostream>
#include<stack>
#include<vector>
#include<cstring>
#include<string>
using namespace std;
int main(void) {
string str;
getline(cin, str);
for (int i = 0; i < str.size(); i++) {
char c = str[i];
if (c >= 'A' && c <= 'Z') {
c += 13;
if (c > 90) {
char temp = c - 90;
c = 64;
... | ALGO | 0.999897 | 5.11834 |
b44351f4-be02-482e-aadb-ab1679ed28cc | zqy1018/my_leetcode | code/384.cpp | #include <bits/stdc++.h>
#define INF 2000000000
using namespace std;
typedef long long ll;
int read(){
int f = 1, x = 0;
char c = getchar();
while(c < '0' || c > '9'){if(c == '-') f = -f; c = getchar();}
while(c >= '0' && c <= '9')x = x * 10 + c - '0', c = getchar();
return f * x;
}
class Solution {
public:
v... | ALGO | 0.999516 | 4.102595 |
984fc46c-8a33-48ba-88d6-40f14e0890a0 | artak7/Bachelor-projects | Algos and DataStructures/2 семестр/2.4.cpp | #include <bits/stdc++.h>
using namespace std;
const int AIM = 2, N = 3;
//in common case its backtracking
//const int volume[N] = {10, 7, 4};
struct tripple
{
int bank10, bank7, bank4;
tripple() {}
tripple(int a, int b, int c)
{
bank10 = a;
bank7 = b;
bank4 = c;
}
/*bool operator<(tripple b)
{
retur... | ALGO | 0.998167 | 3.560249 |
25012480-e2c3-4cec-8add-ba9f6f850cc0 | skjha98/CP | 1523A.cpp | #include <iostream>
#include <string>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int t, n, m;
cin >> t;
while(t--){
cin >> n >> m;
string a;
string s(n,'0');
cin >> a;
for(int j=0; j<m; j++){
for(int i=0; i<n; i++){
if(a[i]=='0' && i!=0 && i!=n-1){
s[i]... | ALGO | 0.999978 | 4.387136 |
02ad556e-9c0e-4502-a517-a45b94907187 | Ahmed-Mohmed-Sakr/Problem-Solving | UVA/11456/35504658_AC_400ms_0kB.cpp | #include<bits/stdc++.h>
#define Sakr_ ios_base :: sync_with_stdio (false) ; cin.tie(0) ; cout.tie(0);
#define ll long long
#define pi 3.14159265
using namespace std;
/*
by:Ahmed Sakr (sakr_) with AZA ;
#ifndef ONLINE_JUDGE
freopen("c.in", "r", stdin);
#endif
__builtin_popcountll();
*/
bool isPrime(int x) {
if... | ALGO | 0.999838 | 4.632813 |
50fea054-9cb3-4659-9e3b-d43df0e057f0 | Jian-Zhe/Competitive-programing | cpp/cf/icpc3/C.cpp | #include <bits/stdc++.h>
#define _ cin.tie(0) -> sync_with_stdio(false);
using namespace std;
struct Edge {
int to;
int open;
};
int main() { _
int n, m, s, k;
cin >> n >> m >> s >> k;
s--, k--;
vector<vector<Edge>> adj(n);
int u, v, w;
for(int i = 0; i < m; ++i) {
cin >> u >... | ALGO | 0.999974 | 3.792338 |
b5e11f26-2c34-43fb-90e4-cc6b7249cc81 | chichchic/algorithmPrac | BaekJoon/2020/201204_1759.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int l, c;
bool isVowel(char c)
{
if (c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u')
return true;
return false;
}
void backTracking(vector<char> &keySet, int point, vector<char> &charSet, int consonant, int vowel)
{
i... | ALGO | 0.999981 | 3.262713 |
18594d03-89d6-4b66-8913-d913713151b3 | WiktorK02/Image_Converter | functions.cpp | #include "functions.h"
void jpg_pixel_read(cv::Mat& image, std::uint8_t* pixelPtr, cv::Scalar_<uint8_t> bgrPixel, int cn, std::string file_name) {
int itterator = 1;
int byteitterator = 0;
char valueofpixel;
std::string arr;
int min_rgb_value = 0;
int max_rgb_value = 0;
for (int i = 0; i < image.rows; i++) {... | TOOL | 0.893136 | 3.88807 |
5452ed2b-c5e2-460e-a47d-320abdeed8ce | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_6506_17.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(0);
int n, m;
string s;
cin >> n >> m >> s;
int block = 0;
for (int i = 0; i < n;) {
int j = i + 1;
while (j < n && s[j] == s[i]) j++;
block++;
i = j;
}
long long ans = (m - 1LL) * n * block;
for (int i = 0... | ALGO | 0.999927 | 3.673781 |
89edcded-14e4-4a8a-9c21-f60427e62795 | 21omkarsase/DSA | Strings/easy/patternSearch.cpp | // Your task is to implement the function strstr. The function takes two strings as arguments (s,x) and locates the occurrence of the string x in the string s. The function returns and integer denoting the first occurrence of the string x in s (0 based indexing).
// Note: You are not allowed to use inbuilt function.
... | ALGO | 0.999922 | 6.149245 |
9f8e22dc-57ed-424d-a8fb-38d00190c0c3 | buiquochuy2508/DSA_CODE_PTIT | DSA03016-SONHONHAT.cpp | #include <bits/stdc++.h>
using namespace std;
void solve (int s, int d){
if (s==0){
if (d==1) cout << 0 << endl;
else cout << -1 << endl;
return;
}
if (s>9*d){
cout << -1 << endl;
return;
}
int a[d];
s-=1;
for (int i=d-1; i>0; i--){
if (s>9){
a[i]=9;
s-=9;
}
else{
a[i]=s;
s=0;
}
}... | ALGO | 0.999004 | 5.425251 |
ef683e1c-8e69-45cf-983e-c1637d625c0f | manishsaini6421/leetcode-solutions | 1388-pizza-with-3n-slices/1388-pizza-with-3n-slices.cpp | class Solution {
public:
int solve(vector<int>& slices,int index,int endIndex,int count){
int n=slices.size();
if(index>endIndex || count==0)return 0;
int include=slices[index]+solve(slices,index+2,endIndex,count-1);
int exclude=solve(slices,index+1,endIndex,count);
... | ALGO | 0.999887 | 5.789994 |
ccd9fe73-2548-453a-9507-7974f1adb101 | Lqs66/PX4-1.15.2 | src/modules/ekf2/EKF/output_predictor.cpp | #include "output_predictor.h"
using matrix::AxisAnglef;
using matrix::Dcmf;
using matrix::Quatf;
using matrix::Vector2f;
using matrix::Vector3f;
void OutputPredictor::print_status()
{
printf("[output predictor] IMU dt: %.6f, EKF dt: %.6f\n",
(double)_dt_update_states_avg, (double)_dt_correct_states_avg);
c... | ALGO | 0.960985 | 6.710331 |
056d4a85-c85e-4ffe-a06a-e2b14001372d | aniketkumargiri/CPP | C++ Practise/print.cpp | #include <stdio.h>
void func(int n)
{
int sum = 0;
int product = 1;
for (int i = 0; i < n; i++)
{
for (int j = 0; j < n; j++)
{
printf("%d %d\n", i, j);
}
}
}
// time-complexity=O(n^2)
int main()
{
int n;
scanf("%d", &n);
func(n);
return 0;
} | ALGO | 0.997861 | 3.381275 |
3d742527-cfe4-4e1b-bf9c-ad55861f8766 | Priyanshuverma19/Data-structure | Link list/detection_cycle_ll.cpp | # include<iostream>
using namespace std;
class node {
public:
int data;
node*next ;
node(int val){
data = val;
next = NULL;
}
};
void insert(node*&head, int val){
node*n = new node( val);
if (head == NULL){
head = n;
return;
}
node*temp = head;
w... | ALGO | 0.999911 | 3.489476 |
749981b9-e8e7-46e0-9dce-8ac37c40c715 | JeromeGJH/LeetCode | 0540_1.cpp | class Solution {
public:
int singleNonDuplicate(vector<int>& nums) {
int n = nums.size();
int left = 0, right = n -1 , mid ;
int i = 0;
while(left < right){
mid = (left + right) / 2;
if(mid > 0 && mid < n-1){
if(nums[mid] != nums[mid-1] && nums... | ALGO | 0.999904 | 5.522482 |
21b4ecee-a611-4472-9fc2-9cf1d7d3f155 | TheMilanMiracle/taller_programacion_competitiva-2023-1-2 | version_B/tarea3/C.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int n, x, a_i;
cin >> n >> x;
vector<int> a(n), dp(n);
for(int i = 0; i < n; i++){
cin >> a_i;
a[i] = a_i;
}
dp[n-1] = 1;
int count = 1;
for(int i = n-2; i >= 0; i--){
if(a[i+1] - a[i] <= x){
... | ALGO | 0.999892 | 4.020426 |
a9087ca1-3812-4162-a82b-aa6ee02121e0 | DISASTER-RUMBLING/CODE | 算法/洛谷题单/洛谷 P1803 凌乱的yyy(线段覆盖).cpp | #define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<algorithm>
using namespace std;
struct node {
int beg, ed, times;
}arr[1000005];
int n;
bool Cmp(node p1, node p2) {
if (p1.ed == p2.ed) {
return p1.times < p2.times;
}
return p1.ed < p2.ed;
}
int main() {
scanf("%d", &n);
for (int i = 0; i < n; i... | ALGO | 0.999914 | 3.792898 |
b72dc093-6f8a-446f-beba-172166587455 | VuVietDuy/CodePTIT-CPP | CPP0241 - BIEN DOI DAY SO.cpp | #include<bits/stdc++.h>
using namespace std;
void testCase() {
int n;
cin >> n;
vector<int> a(n);
for (int i = 0; i < n; i++) {
cin >> a[i];
}
int l = 0, r = n - 1, c = 0;
while (l < r) {
if (a[l] == a[r]) {
l++;
r--;
} else if (a[l] < a[r]) {... | ALGO | 0.999645 | 4.818745 |
c4657698-b96f-4c41-8ab7-03a7d1a1ca7f | Antarikchya-Prathisthan-Nepal/PX4-Autopilot | src/modules/control_allocator/ActuatorEffectiveness/ActuatorEffectivenessMCTilt.cpp | #include "ActuatorEffectivenessMCTilt.hpp"
using namespace matrix;
ActuatorEffectivenessMCTilt::ActuatorEffectivenessMCTilt(ModuleParams *parent)
: ModuleParams(parent),
_mc_rotors(this, ActuatorEffectivenessRotors::AxisConfiguration::FixedUpwards, true),
_tilts(this)
{
}
bool
ActuatorEffectivenessMCTilt::get... | ALGO | 0.865581 | 6.508669 |
9d17641b-3efd-4a0f-bd77-b04624234957 | prasannabantu/Code-100-days | LC56. Merge Intervals.cpp | class Solution {
public:
static bool cmp(vector<int>&a,vector<int>&b)
{
if(a[0]<b[0]) return 1;
return 0;
}
vector<vector<int>> merge(vector<vector<int>>& intervals) {
int n=intervals.size();
sort(intervals.begin(),intervals.end());
vector<vector<int>>ans;
... | ALGO | 0.999999 | 6.033445 |
4574e3c5-e3c6-45a5-80e9-3556ee53d6d6 | Beisenbek/PP1_2020_FALL | w11/g2/2.cpp | #include <iostream>
#include <queue>
using namespace std;
int main() {
queue<int> q;
q.push(10);
q.push(1);
q.push(2);
q.push(3);
q.push(13);
q.push(12);
while(!q.empty()){
cout << q.front() << " ";
q.pop();
}
return 0;
}
| ALGO | 0.999648 | 4.113639 |
862dc4b6-4fe8-4272-ba1d-fc00650a9105 | YJ17/codetree-TILs | 240406/특정 숫자 맞추기/catching-specific-number.cpp | #include <iostream>
int main() {
// 여기에 코드를 작성해주세요.
int n;
while(1){
scanf("%d", &n);
if(n < 25){
printf("Higher\n");
}
else if(n > 25){
printf("Lower\n");
}
else if(n == 25){
printf("Good\n");
break;
... | ALGO | 0.999037 | 3.8928 |
04f1491f-7431-4e51-8f27-74e11ee5e2eb | codeguru-cmd/nuttela | swarma.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
long long int sx,sy;
cin>>sx>>sy;
vector<long long int> x(2),y(2);
for(int i=0;i<n;i++){
long long int a,b;
cin>>a>>b;
long long int r = a-sx;
long long int l = b-sy;
if(r>0) x[0]... | ALGO | 0.999916 | 4.309151 |
5018f02a-50c0-4f56-8bf9-7a4ab974051b | pintamono/tesseract | src/textord/colpartitiongrid.cpp | #ifdef HAVE_CONFIG_H
# include "config_auto.h"
#endif
#include "colpartitiongrid.h"
#include "colpartitionset.h"
#include "imagefind.h"
#include <algorithm>
#include <utility>
namespace tesseract {
// Max pad factor used to search the neighbourhood of a partition to smooth
// partition types.
const int kMaxPadFact... | ALGO | 0.978647 | 6.708097 |
e22917b3-288c-4e05-bb19-1ef68cd6a4fe | Khaled-Amin-Shawon/XPSC | Week 05/contest/Messi_vs_Ronaldo.cpp | /*
||-----------------------------------||
|| Khaled Amin Shawon ||
|| Big Khaled code ||
||-----------------------------------||
*/
#include <bits/stdc++.h>
#define ll long long
#define no cout << "NO" << endl;
#define yes cout << "YES" << endl;
#define fr(i, n) for (ll i = 0; i < n; i... | ALGO | 0.999787 | 4.246182 |
8a30071f-401f-40dd-809f-7e83e9c517c7 | Adithya-Hariharan/C-Programming | Lab_6_(13_Nov_2023)/W6_Qn16_delete.cpp | // Write a C program to print the string after deleting vowels in the string
#include<stdio.h>
#include<string.h>
int main()
{
int i,j,len;
char string[100];
printf("Enter string: ");
gets(string);
len = strlen(string);
for(i=0;i<len;i++)
{
if(string[i]=='a'||string[i]=='A'||string[i]=='e'||string[i]=='E'||st... | ALGO | 0.988568 | 3.149556 |
add96214-ac10-42f7-aa45-f7c6660b03e6 | a5tronomy/ue5-ffcotw | Engine/Source/Runtime/Engine/Private/WorldPartition/WorldPartitionRuntimeCellDataSpatialHash.cpp | #include "WorldPartition/WorldPartitionRuntimeCellDataSpatialHash.h"
#include "WorldPartition/WorldPartitionDebugHelper.h"
#include "Engine/Level.h"
#include UE_INLINE_GENERATED_CPP_BY_NAME(WorldPartitionRuntimeCellDataSpatialHash)
static float GRuntimeSpatialHashCellToSourceAngleContributionToCellImportance = 0.4f; ... | ALGO | 0.966973 | 7.073575 |
e5edb44c-a577-4b96-9de9-3febda1f8f0a | wwyf/somecode | cpp_primer/17/validatePhones.cpp | #include <iostream>
using std::cin; using std::cout; using std::endl;
#include <string>
using std::string;
#include <regex>
using std::regex; using std::sregex_iterator; using std::smatch;
using std::regex_error;
// the area code doesn't have a separator;
// the remaining separators must be equal
// OR the area code... | TOOL | 0.959297 | 5.737694 |
11b36b5a-1176-4226-a94c-fd46b414cb30 | lishixuan001/3D_Fluid_Simulation | ext/nanogui/ext/eigen/unsupported/test/BVH.cpp | #include "main.h"
#include <Eigen/StdVector>
#include <Eigen/Geometry>
#include <unsupported/Eigen/BVH>
namespace Eigen {
template<typename Scalar, int Dim> AlignedBox<Scalar, Dim> bounding_box(const Matrix<Scalar, Dim, 1> &v) { return AlignedBox<Scalar, Dim>(v); }
}
template<int Dim>
struct Ball
{
EIGEN_MAKE_ALIGN... | TEST | 0.994453 | 6.337957 |
72747636-4953-4f13-aff6-f1a1ff311e6b | ishandutta2007/codeforces | pranjal.ssh/normal/776/A.cpp | #include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define FOR(i,a,b) for (int i = (a); i <= (b); ++i)
#define NFOR(i,a,b) for(int i = (a); i >= (b); --i)
#define all(x) (x).begin(), (x).end()
#define sz(x) int(x.size())
typedef long long ll; typedef pair <int, int> ii; typedef vector <int>... | ALGO | 0.999861 | 3.704732 |
f88204f2-58cc-42bc-948c-a3340e9cb482 | ishandutta2007/codeforces | quailty/normal/762/B.cpp | #include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cmath>
#include<iostream>
#include<algorithm>
using namespace std;
typedef long long ll;
vector<int>val[2];
int main()
{
int a[3],m;
scanf("%d%d%d%d",&a[0],&a[1],&a[2],&m);
for(int i=1;i<=m;i++)
{
int p;
char ty[15];
s... | ALGO | 0.999786 | 3.172133 |
7f18134b-ca0d-4da1-a932-3b086e0ad45d | Anup0099/450DSA_Question | Leaders in an array - GFG/leaders-in-an-array.cpp | //{ Driver Code Starts
// C++ program to remove recurring digits from
// a given number
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution{
//Function to find the leaders in the array.
public:
vector<int> leaders(int a[], int n){
// Code here
vector<int> v;... | ALGO | 0.999965 | 6.012548 |
a59f9038-a1b1-42f1-bd3d-901734e4d5dd | youhyeoneee/Algorithm | CodeUp/C언어 기초 100제/05.산술연산/1039.cpp | #include <iostream>
using namespace std;
int main(){
long long int a, b, c;
cin >> a >> b;
c = a+b;
cout << c << '\n';
return 0;
}
| ALGO | 0.998435 | 3.790371 |
582baa48-8e40-468e-9002-74a722d5a25c | hiberabyss/LeetCode | cpp/128.longest-consecutive-sequence.cpp | /*
* @lc app=leetcode.cn id=128 lang=cpp
*
* [128] 最长连续序列
*
* https://leetcode.cn/problems/longest-consecutive-sequence/description/
*
* algorithms
* Medium (54.33%)
* Total Accepted: 431.8K
* Total Submissions: 795.8K
* Testcase Example: '[100,4,200,1,3,2]'
*
* 给定一个未排序的整数数组 nums ,找出数字连续的最长序列(不要求序列元素在原... | ALGO | 0.999949 | 5.489072 |
e4699a3b-12a3-45db-b2c8-5ff9378660e9 | xionggithub/leetcode | algorithms/cpp/064_minPathSum.cpp | #include <iostream>
#include <vector>
#include <cstring>
using namespace std;
int minPathSum(vector<vector<int> >& grid)
{
if(grid.size() == 0)
return 0;
int m = grid.size();
int n = grid[0].size();
int dp[m][n];
memset(dp, 0, sizeof(dp));
dp[0][0] = grid[0][0];
for (int i = 1; i < m; ++i)
{
dp[i][0] = dp... | ALGO | 0.999945 | 4.454155 |
68ce835b-d3a0-45c0-a7d3-049786b50f5b | adarshsingh1706/Cpp-files | OA.cpp | // ASDF -> BREE
// AV->BU
// VA->WZ
// ZE-> AD
// OZ->PY
// A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
#include <iostream>
using namespace std;
void helperfn(char ch, bool front, string &c) {
if (front) {
if (ch == 'A') {
c += 'B';
return;
} else if (ch == 'Z') {... | ALGO | 0.999932 | 4.563876 |
75173912-d4de-4d45-b5a9-0dd9fd454d30 | strategist614/ACM-Code | 刷题比赛/LUOGU/P1126机器人般重物.cpp | #include<bits/stdc++.h>
using namespace std;
const int N = 25000;
int dx[] = {-1,0,1,0};
int dy[] = {0,1,0,-1};
int maze[60][60];
int vis[N];
int n,m;
struct node
{
int x;
int y;
int mov;
int f;
};
int Hash(int x,int y,int z) {
return z*2700+x*51+y;
}
int solve(int x,int y)
{
if(maze[x][y] || maze[x+1][y] || maze... | ALGO | 0.999979 | 4.284217 |
54584b63-c1dd-4fef-8c87-f01119277093 | Halliburton-Landmark/xulrunner-24.0 | layout/xul/tree/nsTreeUtils.cpp | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
#include "nsReadableUtils.h"
#include "nsTreeUtils.h"
#include "nsChildIterator.h"
#include "nsCRT.h"
#include "nsIAtom.h"
#include "nsINameSpaceManager.h"
#include "nsGkAtoms.h"
#include "nsINodeInfo.h"
nsresult
nsTreeUtils::TokenizeProp... | TOOL | 0.914784 | 6.789315 |
fd1c12a5-bd9b-44aa-b8fb-9659e17efe5d | MaCroDmT/C-PLUS-PLUS | DSlabfinalbubblesort2.cpp | #include<iostream>
using namespace std;
int main ()
{
int i, j,temp,pass=0;
int a[5] = {2,5,3,1,8};
for(i = 0; i<5; i++) {
for(j = i+1; j<5; j++)
{
if(a[j] < a[i]) {
temp = a[i];
a[i] = a[j];
a[j] = temp;
}
}
pass++;
}
cout <<"Sorted Element \n";
for(i = 0; i<5; i+... | ALGO | 0.999853 | 3.342135 |
06fb8691-277e-4a61-8399-d5b71449673a | Pettecco/competitive-programming | promessa_de_campanha.cpp | #include <bits/stdc++.h>
using namespace std;
#define _ \
ios_base::sync_with_stdio(0); \
cin.tie(0);
#define endl '\n'
typedef long long ll;
const int INF = 0x3f3f3f3f;
const ll LINF = 0x3f3f3f3f... | ALGO | 0.999892 | 4.504965 |
33ba38bb-9aa5-4036-821a-e01d60c73062 | architkl/The-Box | codeforces/724C.cpp | /*
Author: architkl
Language: C++ 14
*/
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <unordered_map>
#include <queue>
#include <set>
#include <climits>
#include <string>
#include <math.h>
using namespace std;
#define pb push_back
#define mp make_pair
typedef pair <int, int> pii... | ALGO | 0.999816 | 3.002138 |
5f037485-728d-4088-8b0d-f77e0e6dd4f6 | aquamon/DataStructureAndAlgorithms | BINARY_TREES/BinarySearchTree/BSTIterator.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999987 | 6.546156 |
63ba6873-ea8d-46e2-8083-baeaed07fdd6 | OwenRoque/ADA | ALGORITMOS VORACES/DyD-2d array.cpp | #include <iostream>
#include <vector>
using namespace std;
// Función de búsqueda utilizando Divide y Vencerás
bool buscarElemento(vector<vector<int>>& matriz, int x, int inicioFila, int finFila, int inicioColumna, int finColumna) {
// Verificar los límites de la matriz
if (inicioFila > finFila || inicioColum... | ALGO | 0.999937 | 5.863371 |
b74998b0-1ddc-4fac-8b57-76482f146ecc | Taejin1221/Re-PS | Baekjoon/Baekjoon01835.cpp | // Baekjoon01835.cpp
#include <iostream>
#include <queue>
using namespace std;
int main(void) {
int n;
cin >> n;
queue<int> q;
for (int i = 0; i < n; i++)
q.push(i);
int ans[1'000];
for (int i = 1; i <= n; i++) {
for (int j = 0; j < i; j++) {
q.push(q.front());
... | ALGO | 0.999979 | 4.162701 |
1e86248f-d4db-4ab6-a802-1085a0093b4c | nasreen-ahmed/cp | _2_way_too_long_words/main.cpp | #include <iostream>
#include <vector>
using namespace std;
int main()
{
int n;
std::cin >> n;
vector<string> data {};
// For loop for taking in the inputs in vector
for (int i = 0; i < n; i++)
{
string input_word;
std::cin >> input_word;
data.push_back(input_word);
... | ALGO | 0.999383 | 5.524148 |
487e5f93-bb37-4bc3-bd28-7862f3044a7c | ThoseBygones/ACM_Code | HDU/HDU 1595.cpp | /*
********************************************************************************
* Author: ThoseBygones
* Version: V1.0
* Date: 2020-11-02
* Subject: ACM-ICPC
* Language: C/C++14
* OJ: HDU
* Algorithm: ö + ·
********************************************************************************
* Algo-Des... | ALGO | 0.999902 | 4.162978 |
65efb8b9-e383-4407-9300-bb086f726815 | komaljot/Practice-GFG | Medium/Maximum of all subarrays of size k/maximum-of-all-subarrays-of-size-k.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:
//Function to find maximum of each subarray of size k.
vector <int> max_of_subarrays(int *arr, int n, int k)
{
// your ... | ALGO | 0.999962 | 5.85469 |
5010b3d0-1259-44cf-9dd3-d1f08ad59688 | Palakmalik1594/Learning-to-code-DSA | 3321-type-of-triangle/3321-type-of-triangle.cpp | class Solution {
public:
bool isvalid(int a,int b,int c){
if(a<=0 || b<=0 || c<=0){
return false;
}
return (a+b>c && b+c>a && c+a>b);
}
string triangleType(vector<int>& nums) {
int a=nums[0];
int b=nums[1];
int c=nums[2];
string s="";
if(isvalid(a,b,c) && ... | ALGO | 0.999968 | 5.729262 |
e509650e-7778-4abc-9e03-a752a6b17121 | Hamzakhan593/Git-GitHub-learning | binarySearch1.cpp | #include <iostream>
#include <vector>
using namespace std;
int binarySearch(vector<int>& vec, int x){
//{1,2,3,4,5,6,7,8,9,10}
int left = 0;
int right = vec.size() - 1;
while(left <= right){
int mid = left + (right - left) / 2;
if(x==vec[mid]){
return mid;
}
... | ALGO | 0.999843 | 5.127169 |
5f1f490b-0337-43a2-95e7-8e8eda1bd6ab | fangding678/OnlineJudge | C++ Primer/VisualStudio2012/11/wcEx.cpp | #include "Version_test.h"
#include <map>
using std::map;
#include <string>
using std::string;
#include <cstddef>
using std::size_t;
#include <iostream>
using std::cin; using std::cout; using std::endl;
int main()
{
// count number of times each word occurs in the input
map<string, size_t> word_count; // e... | ALGO | 0.950182 | 5.199622 |
f74877f8-5152-4dd5-83fc-530f462b6681 | sherinsaji126/StriverA2Z | Arrays/Reaarange_By_Sign.cpp | #include<iostream>
#include<vector>
using namespace std;
class Solution{
public:
vector<int> rearrangeArray(vector<int>&nums){
int n = nums.size();
vector<int>ans(n ,0);
int posIndex = 0, negIndex = 1;
for(int i= 0; i<n; i++) {
if (nums[i] < 0){
ans[negIndex]= nums[i];
negIndex += 2;
}
else {
ans[posIndex] = nums [i];... | ALGO | 0.999988 | 5.159765 |
9938df54-e8a5-496f-a4e4-28778b019af9 | tcxxmqz/wheelchair_before | eigen/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_reductions_norm.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace std;
using namespace Eigen;
int main()
{
VectorXf v(2);
MatrixXf m(2,2), n(2,2);
v << -1,
2;
m << 1,-2,
-3,4;
cout << "v.squaredNorm() = " << v.squaredNorm() << endl;
cout << "v.norm() = " << v.norm() << endl;
cout << "v.lpN... | ALGO | 0.997669 | 4.03798 |
2798acf8-6534-4ad1-bae4-dd164e0bae20 | Sampurankishoresrivastava/DSA | ACupboards.cpp | #include <iostream>
using namespace std;
int main()
{
int n, countOne=0, countTwo=0, countThree=0, countFour=0;
cin>>n;
int a[n][2];
for(int i=0;i<n;i++){
for(int j=0;j<2;j++){
cin>>a[i][j];
}
}
for(int i=0;i<n;i++){
for(int j=0;j<1;j++){
if(a[i]... | ALGO | 0.999965 | 3.869638 |
266d4ab5-21a7-4bf0-8b75-0a3236e1caaa | sayan112/Leetcode_Sayan | Searching an element in a sorted array - GFG/searching-an-element-in-a-sorted-array.cpp | // { Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution{
public:
// Function to find element in sorted array
// arr: input array
// N: size of array
// K: element to be searche
int searchInSorted(int arr[], int N, int K)
{
int star... | ALGO | 0.999948 | 5.441808 |
d913ebf5-87e3-489c-a05d-64cb17d0134e | Tolaniht01/Competitve_Programming | codechef/Jan_lunch_time_2019_A/RKS.cpp | #include <bits/stdc++.h>
using namespace std;
#define lld long long int
#define ll long long
#define mod1 1000000007
int t,p=1;
int n,k;
int a,b;
vector <int> row;
vector <int> column;
int maxi=1e7;
int main()
{
cin>>t;
while(p<=t)
{
p++;
cin>>n>>k;
for(int i=1;i<=n;i++)
{... | ALGO | 0.999927 | 3.557403 |
e56ce6d7-28a6-44af-b60e-117f922a7677 | mice777/Insanity3D | Source/I3D2/Math_3d.cpp | #include <memory.h>
#include <I3D\i3d_math.h>
#define USE_ASM //use inline assembly
//#define USE_D3DX
#ifdef USE_D3DX
#include <D3dx9math.h>
#pragma comment(lib, "D3dx9")
#endif
#include <insanity\assert.h>
//----------------------------
//----------------------------
static const float I3D_identi... | ALGO | 0.989913 | 6.479487 |
4efe5dc3-1d95-4069-9992-4977031a2188 | antoine-chan-lock/PolarInterpolants | CommonLibraries/libigl/include/igl/path_to_edges.cpp | #include "path_to_edges.h"
template <typename DerivedI, typename DerivedE>
IGL_INLINE void igl::path_to_edges(
const Eigen::MatrixBase<DerivedI> & I,
Eigen::PlainObjectBase<DerivedE> & E,
bool make_loop)
{
// Check that I is 1 dimensional
assert(I.size() == I.rows() || I.size() == I.cols());
if(make_loop)... | ALGO | 0.962686 | 5.142617 |
09a25105-af25-4be0-bd4f-d82b3b2b2340 | songron/leetcode | c++/maximum-product-subarray.cpp | class Solution {
public:
int maxProduct(int A[], int n) {
/* https://oj.leetcode.com/problems/maximum-product-subarray/
Different from "Maximum sum subarray".
Bookkeeping the maximum abs(value) of positive/negative values endswith the current element.
*/
if ... | ALGO | 0.999967 | 5.766075 |
961512a8-dbb4-4d53-b5b1-5fb0fb912aa8 | CodeTest-StudyGroup/Code-Test-Study | KongBin/23주차/멀티탭 스케줄링/main.cpp | #include <bits/stdc++.h>
using namespace std;
int N,M;
int check[101];
int main() {
ios_base :: sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
cin>>N>>M;
vector<int> multitap;
vector<int> task;
int visited[101];
fill(visited,visited+101,0);
int cnt=0;
int s_idx=0;
for(int i=0 ; i<M ; i++)
... | ALGO | 0.999969 | 3.686852 |
7aa0196a-0cae-4734-ba9c-5ad4c9d1dffc | WiseCow/algorithm | BOJ/자기복제수.cpp |
#include <iostream>
using namespace std;
int main()
{
int nCount=1;
for (int itr = 0; itr<nCount; itr++)
{
cout << "#testcase" << (itr + 1) << endl;
for (int i = 1; i < 10000; i++)
{
int a;
for (int j = 10000; j>0; j /= 10){
if (i / j>0){
a = j * 10;
break;
}
}
if ((i*i)%a =... | ALGO | 0.972492 | 3.358044 |
0c64c591-a1f8-44b9-9005-7a9cb26a23d9 | jgresula/jagpdf | code/src/core/jstd/zlib_stream.cpp | #include "precompiled.h"
#include <interfaces/stdtypes.h>
#include <core/jstd/zlib_stream.h>
#include <core/errlib/errlib.h>
#include <core/generic/minmax.h>
#include <core/generic/null_deleter.h>
#include <core/generic/assert.h>
#include <algorithm>
namespace jag {
namespace jstd {
/**
* @brief initializes zlib out... | TOOL | 0.862256 | 7.266634 |
f1f1a4ca-8216-4332-8d14-2282799fb46e | PritomPaul99/CodesFromVScode | C++_programming/Contest_and_Problems/ICPC's/Past/ICPC_Prily_Mock/qwe.cpp | #include <bits/stdc++.h>
using namespace std;
void solve(int j)
{
long long k;
cin>>k;
long long a[1000];
for(int i=0;i<k;i++)
{
cin>>a[i];
}
sort(a,a+k);
cout <<"Case "<<j<< ": " <<a[0]*a[k-1]<< endl;
}
int main()
{
int n,i=1;
cin>>n;
while(n--)
{
solve(i++);
}
return 0;
} | ALGO | 0.992893 | 3.288658 |
afab484c-b39e-42c9-b659-7197f03866f7 | Murad501/Phitron | Semester 3/Weeks/Level-2/Week-15/Day-1/F_3_SUM.cpp | #include <bits/stdc++.h>
using namespace std;
#define nl '\n'
#define all(x) x.begin(), x.end()
#define ll long long int
#define yes cout << "YES" << '\n'
#define no cout << "NO" << '\n'
#define cyes cout << "Yes" << '\n'
#define cno cout << "No" << '\n'
#define minus cout << -1 << '\n'
#define zero cout << 0 << '\n'
... | ALGO | 0.999678 | 5.288991 |
96f9623c-c08d-4742-af1a-374c454b2d6b | aceyan/UE4.18.3_release | Engine/Source/ThirdParty/PhysX/PhysX_3.4/Source/GeomUtils/src/sweep/GuSweepSphereSphere.cpp | #include "GuSweepSphereSphere.h"
#include "PsUtilities.h"
using namespace physx;
using namespace Gu;
// Adapted from Gamasutra (Gomez article)
// Return true if r1 and r2 are real
static PX_FORCE_INLINE bool quadraticFormula(const PxReal a, const PxReal b, const PxReal c, PxReal& r1, PxReal& r2)
{
const PxReal q = b... | ALGO | 0.999596 | 6.498003 |
2cf4344c-4da3-4bd4-8d9c-7b28875af6a4 | jiemojiemo/fast_convolution | src/native_convolution.cpp | //
// Created by user on 6/11/22.
//
#include "fast_convolution/native_convolution.h"
namespace {
float getFlip(const std::vector<float> &h,
int i) {
return *(h.rbegin() + i);
}
}// namespace
std::vector<float> nativeConvolution(
const std::vector<float> &x,
const st... | ALGO | 0.980953 | 5.745432 |
89228837-e9bd-49bd-8c53-69927ff27bda | ngobason/SDLGame | BaiTap/Tuan6/bai8.cpp | #include <iostream>
#include <string>
#include <cmath>
using namespace std;
void dec_to_bin(int n){
if(n < 2) cout << n%2;
else{
dec_to_bin(n/2);
cout << n%2;
}
}
int bin_to_dec(string s){
int n = 0;
for(int i = s.length()-1; i >= 0; i--){
int x = s[i] - '0';
n += ... | ALGO | 0.999579 | 4.442763 |
c7ae78d3-a4ba-4ed3-998a-f39e40a48370 | intel/xFasterTransformer | src/layers/alibi_embedding.cpp | AlibiEmbedding::AlibiEmbedding(const int headNum, const int seqLen) {
maxLen = seqLen;
maxHeadNums = headNum;
alibiGetRelativePos(maxLen);
alibiGetSlope(maxHeadNums);
}
void AlibiEmbedding::alibiGetBias(const int headIdx, const int seqLen, float *biasMatrx) {
REQUIRES(headIdx < maxHeadNums, "Alibi ... | ALGO | 0.94862 | 4.206077 |
c67e5f5c-10b2-44b4-99c4-343626f03065 | JHRosskamp/hand-mocap | ThirdParty/includes/unsupported/test/NumericalDiff.cpp | #include <stdio.h>
#include "main.h"
#include <unsupported/Eigen/NumericalDiff>
// Generic functor
template<typename _Scalar, int NX=Dynamic, int NY=Dynamic>
struct Functor
{
typedef _Scalar Scalar;
enum {
InputsAtCompileTime = NX,
ValuesAtCompileTime = NY
};
typedef Matrix<Scalar,InputsAtCompileT... | TEST | 0.988505 | 6.21049 |
f39ea676-952b-4364-9762-0baf75606f3f | ChoMk/algorithm | 세그먼트트리/1395스위치.cpp | #include<cstdio>
#include<algorithm>
using namespace std;
int n, q;
int a, b, c;
int bottomStartIDX = 1;
int tree[400001];
int lazy[400001];
void propaggate(int pos, int left, int right) {
if (lazy[pos] != 0) {
if (pos < bottomStartIDX) {
lazy[pos * 2] += lazy[pos];
lazy[pos * 2] %= 2;
lazy[pos * 2 + 1] +... | ALGO | 0.9999 | 4.027915 |
1af2e1b4-3854-4c8a-b9e5-8e896fa6582a | ajimenezh/Programing-Contests | Codeforces/SchoolRegionalContestSaratov2011ProblemD.cpp | #include <iostream>
#include <sstream>
#include <vector>
#include <string.h>
#include <algorithm>
#include <utility>
#include <set>
#include <map>
#include <deque>
#include <queue>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cstdio>
#include <stdio.h>
using namespace std;
#define fo(i,n) for(int i=... | ALGO | 0.999772 | 3.861655 |
ad717277-6e7b-4c17-acbe-2bffb826664f | i4Ds/IRE | IREMedia/libraries/OpenCV/modules/legacy/src/blobtrackinglist.cpp | #include "precomp.hpp"
#define PIX_HIST_BIN_NUM_1 3 //number of bins for classification (not used now)
#define PIX_HIST_BIN_NUM_2 5 //number of bins for statistic collection
#define PIX_HIST_ALPHA 0.01f //alpha-coefficient for running avarage procedure
#define PIX_HIST_DELTA 2 //maximal difference betw... | ALGO | 0.993979 | 4.86528 |
9f719702-6798-4c18-872e-90bb7f7a4542 | wickedlord/DSA_Problems | Heaps/build_min_heap.cpp | #include <bits/stdc++.h>
using namespace std;
void heapify(vector<int>& arr, int n, int i) {
int smallest = i;
int leftchild = 2*i+1;
int rightchild = 2*i+2;
if (leftchild < n && arr[smallest] > arr[leftchild]) {
smallest = leftchild;
}
if (rightchild < n && arr[smallest] > arr[right... | ALGO | 0.999923 | 4.878099 |
70b76e9d-860b-43cf-b3b6-25c40fee2e08 | ishandutta2007/codeforces | antoine/normal/899/D.cpp | #include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <cmath>
#include <stack>
#include <iomanip>
#include <functional>
#include <array>
#include <stack>
using namespace std;
typedef long long ll;
ll g(ll k) {
return k... | ALGO | 0.99976 | 4.350091 |
69dc5d3f-892b-42a3-9f71-c2bf2b515945 | bhushanap/openvins | ov_init/src/ceres/Factor_GenericPrior.cpp | #include "Factor_GenericPrior.h"
#include "utils/quat_ops.h"
using namespace ov_init;
Factor_GenericPrior::Factor_GenericPrior(const Eigen::MatrixXd &x_lin_, const std::vector<std::string> &x_type_,
const Eigen::MatrixXd &prior_Info, const Eigen::MatrixXd &prior_grad)
: x... | ALGO | 0.979573 | 6.201903 |
4c2a67b9-d909-4b31-a2b7-b969c97fd19a | dobrimbozhilov/levcoin-code-change-candidate | src/CryptoNoteCore/Checkpoints.cpp | #include <cstdlib>
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <cstring>
#include <string>
#include <string.h>
#include <sstream>
#include <vector>
#include <iterator>
#include <boost/regex.hpp>
#include "Checkpoints.h"
#include "Common/StringTools.h"
#include "Common/DnsTools.h"
using namespa... | TOOL | 0.868128 | 5.4376 |
3b8d27d5-080f-4fe1-b625-6a36822f2cf1 | dralves/sp1-sp2-galois | lonestar/experimental/ordered/billiards/BilliardsFromLog.cpp | #include "Billiards.h"
#include <boost/algorithm/string.hpp>
#include <map>
#include <fstream>
#include <string>
#include <vector>
#include <deque>
#include <sstream>
#include <cstdio>
struct Config {
// config keys, in the same order as the file
FP length;
FP width;
unsigned num_balls;
FP ball_mass;
FP... | TOOL | 0.863032 | 5.887967 |
72bc4f4c-578e-40d4-aaa7-4149ce38f92e | WadekarPrashant/DSA | My_code/29_Jan/pattern4.cpp | // *
// * *
// * * *
// * * * *
// * * * * *
#include<iostream>
using namespace std;
int main()
{ int n,m;
cout<<"Enter the no. of rows : "<<endl;
cin>>n;
for(int row = 0;row<n ;row++)
{
for(int col = 0; col<row+1;col++)
{
cout<<"* ";
}
... | ALGO | 0.997436 | 3.494147 |
0d581b33-9210-4ace-aeb4-55b32655b5e5 | tfcCode/practice | practice25/8.cpp |
//https://www.nowcoder.com/practice/4bc284dc9d0144628a722eb5d1191ef3?tpId=98&tqId=32903&tPage=4&rp=4&ru=/ta/2019test&qru=/ta/2019test/question-ranking
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main()
{
int n;
while (cin >> n) {
int *dp = new int[n + 1]();
int dp_min;
fo... | ALGO | 0.999947 | 3.533887 |
d328eadf-23ea-4b85-820a-f62960542843 | gilouzi/ProgComp | Lista2/uri-2532.cpp | // #include <bits/stdc++.h>
#include <iostream>
#include <vector>
#include <math.h>
using namespace std;
int MIN(int i, int j){
return i<j ? i : j;
}
int main() {
int n; //numero feiticos disp
int p; //hp do monstro
while(scanf("%d %d", &n, &p) != EOF){
int d[n+1]; //dano causado pelo feitico... | ALGO | 0.999951 | 3.687811 |
f467f54a-b0ed-4ee0-b206-a70d5a5bbbba | ishandutta2007/codeforces | bohun/normal/846/C.cpp | #include <bits/stdc++.h>
#define ll long long
using namespace std;
int n;
int t[5005];
ll pref[5005];
ll dp[5005][4];
int opt[5005][4];
ll daj(int l,int r)
{
if(l>r)
return 0;
return pref[r]-pref[l-1];
}
int main()
{
cin>>n;
for(int i=1;n>=i;i++)
{
cin>>t[i];
pref[i]=pref[i-1]+t[i];
}
for(int i=1;n+1>=i;... | ALGO | 0.999993 | 3.153817 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.