uuid stringlengths 36 36 | repo_name stringlengths 5 123 | relative_path stringlengths 5 4k | content stringlengths 33 2.85M | category stringclasses 6
values | algo_rel_score float64 0.85 1 | quality_score float64 3 8.76 |
|---|---|---|---|---|---|---|
9df7d635-b413-462e-be5a-7bd9a7d23987 | AirikMajee/DSA-C- | C++ BASIC/sumofalloddnos.cpp | #include <iostream>
using namespace std;
int main() {
int n, oddsum = 0;
for(int i = 1; i <=n ; i++) {
if (i%2!=0) {
oddsum += i;
}
}
cout << "Sum of odd numbers from 1 to " << n << " is: " << oddsum << endl;
return 0;
}
/* using while loop*/
/*
int main () {... | ALGO | 0.999886 | 4.460219 |
a28c4d6b-9b27-43d4-a492-b433fced1aab | voldermort/UVa-2 | 583/583.cpp | /* Name: Alex Velazquez
* Start Date: September 26, 2011 @ 09:36PM
* End Date: September 26, 2011 @ 03:54PM
* Purpose: To solve the UVa problem 583 - "Prime Factors"
*/
#include <iostream>
#include <cmath>
#include <vector>
using namespace std;
int main ()
{
int LIMIT = 50000;
vector<int>primes;
bool nu... | ALGO | 0.999787 | 3.978248 |
2900d2b5-42e0-443a-b9df-85bae772f062 | g310v/CompetitiveProgramming | Codeforces/486A.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vll = vector<long long>;
using vb = vector<bool>;
using vs = vector<string>;
#define pb push_back
#define rsz resize
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
using pi = pair<int,int>;
#define f first
#... | ALGO | 0.999734 | 4.094178 |
59f5be03-20c6-4559-bbb5-59eec105b9ea | kyanesdev/I-wanna-be | Collision.cpp | #include "Collision.hpp"
namespace Sonar
{
Collision::Collision( )
{
}
//Esta funcion comprueba la colision del personaje en un rango
bool Collision::CheckSpriteCollision( sf::Sprite sprite1 ){
sf::Rect<float> rect1 = sprite1.getGlobalBounds( );
sf::Rect<float> rect2(0,745,600,1);
sf::Rect<float> rect3(0... | TOOL | 0.943667 | 3.456847 |
4d5cbeb7-65dc-40fc-b5f5-8d4cb30ea9ed | takuma1229/atcoder | src/tessoku/a37.cpp | #include <bits/stdc++.h>
using namespace std;
long long N, M, B;
vector<long long> A(200009, 0);
vector<long long> C(200009, 0);
int main() {
cin >> N >> M >> B;
long long Asum = 0;
long long Csum = 0;
for (int i=0; i<N; i++) {
cin >> A[i];
Asum += A[i];
}
for (int i=0; i<M; i++) {
cin >> C[i]... | ALGO | 0.999926 | 3.673641 |
7f285c55-403e-4e5b-995c-ada83a3fa8e4 | NagaNishkala/voxl-mapper | server/mav_trajectory_generation/src/trajectory.cpp | #include "mav_trajectory_generation/trajectory.h"
#include <limits>
// fixes error due to std::iota (has been introduced in c++ standard lately
// and may cause compilation errors depending on compiler)
#if __cplusplus <= 199711L
#include <algorithm>
#else
#include <numeric>
#endif
namespace mav_trajectory_generatio... | ALGO | 0.984733 | 6.993661 |
f6f3783c-13dd-472a-a76d-de8c363565a5 | nahidkishore/CSE-Fundamental | C++ For DS/Module-1/switch_case.cpp | #include<iostream>
using namespace std;
int main()
{
int v;
cin>>v;
switch(v)
{
case 1:
cout<<"One"<<endl;
break;
case 2:
cout<<"Two"<<endl;
break;
case 3:
cout<<"Three"<<endl;
break;
case 4:
... | ALGO | 0.999437 | 3.427436 |
bd19e300-617b-47cf-9f39-34793e90be30 | valkirilov/FMI-2017-2018 | DIS/hm1.cpp | #include <iostream>
using namespace std;
long double rec(long double x, int index) {
if(index > 1) {
index--;
return rec((long double)(2*x*x - 13*x + 6) / (long double)(x - 8), index);
}
return (long double)x;
}
int main() {
long double a1;
long index1;
long index2;
long index3;
long index4;
long index5... | ALGO | 0.999886 | 3.974335 |
983ff166-6c09-404a-a638-4aed05a53eb8 | jakubdrobny/timus-oj | 1111.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
template<typename T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
#define pb push_back
#define mp make_pair
#d... | ALGO | 0.999955 | 3.592125 |
dfcc200b-6268-426b-aa91-d131ba29fc84 | lighttransport/embree-aarch64 | tutorials/subdivision_geometry/subdivision_geometry_device.cpp | #include "../common/tutorial/tutorial_device.h"
namespace embree {
/* configuration */
#define MIN_EDGE_LEVEL 2.0f
#define MAX_EDGE_LEVEL 64.0f
#define LEVEL_FACTOR 64.0f
#define EDGE_LEVEL 256.0f
/* scene data */
RTCScene g_scene = nullptr;
/* previous camera position */
Vec3fa old_p;
__aligned(16) float cube_ver... | ALGO | 0.963547 | 6.754056 |
604a022b-47ca-4324-98f6-ee8d6a91198a | jonbrown89/cpp-primer-final | cpp-primer-final/chapter05/Exercise5_14.cpp | //Exercise 5.14: Write a program to read strings from standard input looking for duplicated words. The program should
// find places in the input where one word is followed immediately by itself. Keep track of the largest number of times
// a single repetition occurs and which word is repeated. Print the maximum number... | ALGO | 0.991874 | 5.19031 |
5a1caa58-786c-409b-91bc-c7901e7a4235 | YoshikiTakashima/vert | benchmark/cpp_transcoder/SMALLEST_SUM_CONTIGUOUS_SUBARRAY/SMALLEST_SUM_CONTIGUOUS_SUBARRAY_towasm_mutated.cpp | #include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <limits.h>
#include <stdbool.h>
int min(int x, int y) { return (x < y)? x: y; }
int max(int x, int y) { return (x > y)? x: y; }
int cmpfunc (const void * a, const void * b) {return ( *(int*)a - *(int*)b );}... | ALGO | 0.999977 | 4.852547 |
cfb92b61-7a62-4dc3-97a1-c1896bafaa3d | vinayak500/DATA-STRUCTURE-AND-ALGORITHIM | arrays/reverse-array.cpp | #include<iostream>
#include<vector>
using namespace std;
vector<int> reverse(vector<int> v , int m){
int s = m+1;
int e = v.size()-1;
while(s<e){
int temp = v[s];
v[s] = v[e];
v[e] = temp;
s++;
e--;
}
return v;
}
void printVector(vector<int> v){
for(int i=0;i<=v.size()-1... | ALGO | 0.99983 | 4.677551 |
b1621a80-441b-49b2-a5bb-9fac3c336a46 | sarvex/leetcode-chez | solution/0500-0599/0558.Logical OR of Two Binary Grids Represented as Quad-Trees/Solution.cpp | /*
// Definition for a QuadTree node.
class Node {
public:
bool val;
bool isLeaf;
Node* topLeft;
Node* topRight;
Node* bottomLeft;
Node* bottomRight;
Node() {
val = false;
isLeaf = false;
topLeft = NULL;
topRight = NULL;
bottomLeft = NULL;
... | ALGO | 0.999979 | 6.398693 |
3b1f5df5-9021-4583-aa2a-f1cf8e0c5f2c | deekshi623/CSA0340-Data-structures-for-operting-system | 7. Array operations for Insert, Delete.cpp | #include <stdio.h>
#define MAX_SIZE 10
int insertElement(int arr[], int size, int element, int position) {
if (size >= MAX_SIZE) {
printf("Array is full. Cannot insert.\n");
return size;
}
if (position < 0 || position > size) {
printf("Invalid position. Cannot insert.\n");
r... | ALGO | 0.997511 | 5.729814 |
2b3e6c65-7345-4372-9f42-63de32935535 | aditya343117/LeetCode-Solutions | 1704-determine-if-string-halves-are-alike/1704-determine-if-string-halves-are-alike.cpp | class Solution {
public:
bool halvesAreAlike(string s) {
int n=s.size();
string first=s.substr(0, n/2);
string second=s.substr(n/2);
int count=0;
for(int i=0; i<first.size(); i++){
if(first[i]=='a'||first[i]=='A'||first[i]=='i'|... | ALGO | 0.996047 | 6.041885 |
497a630f-4561-4194-a28a-3a9edec4a944 | old-yan/CP-template | TEST/oj/ysp_851.cpp | #include "IO/FastIO.h"
#include "MATH/DynamicMontgomeryModInt64.h"
#include "MATH/PollardRho.h"
#include "MATH/PrimitiveRoot.h"
/*
[Primitive Root](https://judge.yosupo.jp/problem/primitive_root)(https://github.com/yosupo06/library-checker-problems/issues/851)
*/
int main() {
uint32_t t;
cin >> t;
while (... | ALGO | 0.99984 | 4.62752 |
fd4491b8-5b1c-40b0-baa7-07d1e294757c | blairfix/Hierarchy-Model | source_code/mod_counter_fact_fudge.cpp | #include "core/base_fit.h"
#include "core/base_pay_sim_fudge.h"
#include "core/boot_sigma.h"
#include "core/boot_span.h"
#include "core/fit_model.h"
#include "core/model.h"
#include "core/rpld.h"
#include "core/r_sim.h"
#include "utils/change_dir.h"
#include "utils/fit_power_law.h"
#include "utils/gini_fast.h"
#includ... | ALGO | 0.989442 | 6.020566 |
c6940ede-7940-4d82-b724-9d82823c1838 | KKamJi98/algorithm | swea/c++/2805_[23_05_21]/2805.cpp | #include <iostream>
#include <queue>
#include <algorithm>
#include <utility>
#include <string>
#include <functional>
#define X first
#define Y second
using namespace std;
int boardSize;
int board[51][51];
bool visit[51][51];
int dy[2] = { -1, 1 };
void input();
int bfs(int x, int y, int num) {
queue<pair<int, int>... | ALGO | 0.997344 | 3.757699 |
6334b741-faaa-4c61-96ff-905c6d9ee424 | BRAINOOOO/CompetitiveProgramming | CF/CF540-D2-D(2).Cpp | /*
use the geometric series
*/
#include <bits/stdc++.h>
#define sz(v) ((int)(v).size())
#define all(v) ((v).begin()),((v).end())
#define allr(v) ((v).rbegin()),((v).rend())
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define clr(v,d) memset( v, d ,size... | ALGO | 0.99985 | 3.284967 |
625e751e-6335-4cb3-877c-37b49c0ffb54 | yfZhong/visual_tracking | src/LineMatcher/findLines.cpp | /*
Authors: Yongfeng
*/
#include <visual_tracking/LineMatcher/findLines.h>
FindLines::FindLines()/*:filtered_data(H * W,0)*/{
debug_line_detector = 0;
m_Top = H-1;
fpsData = 30;
MeasConf = 0;
count=0;
num_change_min_ske = 100;
delta1 =0;
mean_b = 70;
min_skele_shift=0;
}
Find... | ALGO | 0.98654 | 3.08939 |
1b5088f6-7e6d-40ea-8c36-c4eb71db17b5 | Mahbub2001/Practice_C_Plus_Plus | week3/p_D.cpp | #include <bits/stdc++.h>
using namespace std;
#define endl "\n";
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int t;
cin >> t;
while (t--)
{
int n;
cin >> n;
vector<long long> v(n);
for (int i = 0; i < n; i++)
{
... | ALGO | 0.99995 | 4.732781 |
294b06cf-cdb9-4441-b0bd-6498097b92c7 | undertaj/CrackYourPlacement | Trees/Easy/Invert_Binary_Tree.cpp | #include <bits/stdc++.h>
using namespace std;
// 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, TreeNo... | ALGO | 0.999975 | 6.500761 |
e8d542b7-e5d9-4f63-988e-4926be79b827 | jsyeh/2023aaib2 | week17/all_5.cpp | //SOIT106_ADVANCE_005_C
#include <stdio.h>
int MYPOWER(int a, int b)
{
int ans = 1;
for(int i=0; i<b; i++){
ans = ans * a;
}
return ans;
}
int main(void)
{
int a,b;
scanf("%d%d",&a,&b);
printf("[%d]",MYPOWER(a,b));
return 0;
} | ALGO | 0.999963 | 3.698267 |
a3816585-b4dd-41b8-a637-b19bec5f19f7 | aditiangra/Leetcode-daily-practice | Sort an array of 0s, 1s and 2s - GFG/sort-an-array-of-0s-1s-and-2s.cpp | // { Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
public:
void sort012(int a[], int n)
{
// coode here
int lo=0;
int hi=n-1;
int mid=0;
while(mid<=hi)
{
switch(a[mid])
{
... | ALGO | 0.999778 | 6.183797 |
479be22b-e68c-4cef-82ca-7d0817447a70 | Tamimkhan7/CF | Random/B Fair Division.cpp | #include <bits/stdc++.h>
using namespace std;
#define ordered_set tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>
#define faster \
ios_base::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0);
#define mod 1000000007
typedef long long int ll;
... | ALGO | 0.99983 | 4.373206 |
ff5a656d-78b4-4509-80e2-a84571959915 | CMaybe/BOJ | 2529.cpp | #include <iostream>
#include<vector>
#include<algorithm>
#include<string>
using namespace std;
bool visit[10];
char syms[10];
int n;
vector<string> ans;
void dfs(string s,int cnt,int num){
if(cnt==n){
ans.push_back(s);
return;
}
for(int i = 0;i<=9;i++){
if(visit[i]) continue;
... | ALGO | 0.999966 | 3.710678 |
cd288b2b-dbb8-4c4e-837e-37ebd3875bc3 | FizzHerbert/GAMES202Homework | homework2/prt/ext/tbb/examples/parallel_for/tachyon/src/triangle.cpp | /*
* triangle.cpp - This file contains the functions for dealing with triangles.
*/
#include "machine.h"
#include "types.h"
#include "vector.h"
#include "macros.h"
#include "intersect.h"
#include "util.h"
#define TRIANGLE_PRIVATE
#include "triangle.h"
static object_methods tri_methods = {
(void (*)(void *, voi... | ALGO | 0.967951 | 7.743589 |
1bb9cb5a-d7ff-44b9-8dea-e5af4dd6e4e8 | MAMAlgorithmStudy/Programmers | Lv0/369 ๊ฒ์/์ํ.cpp | #include <string>
#include <vector>
using namespace std;
int solution(int order)
{
int answer = 0;
string str = to_string(order);
for (int i = 0; i < str.length(); i++)
{
switch (str[i])
{
case '3':
case '6':
case '9':
... | ALGO | 0.998094 | 5.219649 |
6c5f5ef3-3d48-4e5a-b57a-3f09eb97e831 | turalmehrali/Yandex_cpp-Stepik | 1.6 ะะตะนััะฒะธัะตะปัะฝัะต ัะธัะปะฐ/03. ะะฐะฝั ะดะปะธะฝั ััะพัะพะฝ ััะตัะณะพะปัะฝะธะบะฐ. ะััะธัะปะธัะต ะฟะปะพัะฐะดั ััะตัะณะพะปัะฝะธะบะฐ.cpp | #include <iostream>
#include<cmath>
using namespace std;
int main(){
double a, b, c, p;
cin >> a;
cin >> b;
cin >> c;
p = (a + b + c) / 2;
cout << sqrt(p * (p - a) * (p - b) * (p - c));
return 0;
}
| ALGO | 0.99988 | 3.714157 |
33885e99-7ecf-418e-b14e-ff06c29be8f9 | eclipse-oniro-mirrors/third_party_flutter | skia/third_party/externals/icu/source/common/punycode.cpp | /* This ICU code derived from: */
/*
* ICU modifications:
* - ICU data types and coding conventions
* - ICU string buffer handling with implicit source lengths
* and destination preflighting
* - UTF-16 handling
*/
#include "unicode/utypes.h"
#if !UCONFIG_NO_IDNA
#include "unicode/ustring.h"
#include "unicod... | TOOL | 0.905375 | 3.965116 |
f1a9b357-ccc3-4ca9-997f-56919295ed96 | thenamerahulkr/dsa | Recursion/subSets.cpp | #include<bits/stdc++.h>
using namespace std;
void printSubset(string ans,string Original){
if(Original.length()==0){
cout<<ans<<" ";
return;
}
char ch=Original[0];
printSubset(ans,Original.substr(1));
printSubset(ans+ch,Original.substr(1));
}
void subsetStore(string ans,string O... | ALGO | 0.999966 | 4.092929 |
604a5927-c6e4-4b8c-801c-0b749f0d10e5 | sanchit-sinha/CP | Contests/Google/CodeJam2022-Qualification-Round/Punched_Cards.cpp | #include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include "bits/stdc++.h"
using namespace __gnu_pbds;
using namespace std;
#define f first
#define s second
#define pb push_back
#define ll long long
#define ld ... | ALGO | 0.999827 | 4.713835 |
a8d91adb-5ed2-4f78-9f70-6a825a327735 | AbhishiktMohanty/OOP-LAB | OOP_Lab-5/Q3_Lab-5_OOP.cpp | // Q3. WAP to count the number of objects in a class.
// done
#include <iostream>
using namespace std;
class MyClass
{
private:
static int count;
public:
MyClass()
{
cout << "Calling To Do work" << endl;
count++;
}
static int objCount()
{
return count;
}
};
int MyCl... | TOOL | 0.887181 | 5.025421 |
069fe6c4-038e-4202-bc64-77f6b0f92343 | harudes/Unlimited-Bit-Works-VI | Competitiva/540A.cpp | #include <iostream>
using namespace std;
int combination(string act, string comb, int n){
int aux, aux2,temp,result=0;
for(unsigned int i=0;i<n;++i){
aux=act[i]-'0';
aux2=comb[i]-'0';
temp=abs(aux-aux2);
if(temp>5)
temp=10-temp;
result+=temp;
}
return result;
}
int main(int argc, char *argv[]) {
int... | ALGO | 0.999726 | 3.970392 |
0426552e-75c1-418a-9ebe-97a72dbdc62c | dahrs/OSTI | resources/faiss/c_api/IndexIVF_c.cpp | #include "Index_c.h"
#include "Clustering_c.h"
#include "IndexIVF_c.h"
#include "IndexIVF.h"
#include "macros_impl.h"
using faiss::IndexIVF;
using faiss::IndexIVFStats;
DEFINE_DESTRUCTOR(IndexIVF)
DEFINE_INDEX_DOWNCAST(IndexIVF)
/// number of possible key values
DEFINE_GETTER(IndexIVF, size_t, nlist)
/// number of p... | ALGO | 0.928565 | 5.837646 |
b2542620-f468-477e-aa2c-d85aca1c591e | Kronos0041/OOP_PS22-master | Lab2_zad3_var1/Lab2_zad3_var1/MapProcessor.cpp | #include "stdafx.h"
#include "Functions.h"
map <string, int> FindOfftenWord(string const &line)
{
size_t count = 0;
int asciiCodeSymbol;
string word;
map<string, int> dictionary;
do
{
asciiCodeSymbol = line[count];
if ((asciiCodeSymbol < 65 || asciiCodeSymbol > 122) || (asciiCodeSymbol > 90 && asciiCodeSymbo... | TOOL | 0.990204 | 3.701784 |
ec69836a-3d20-42dc-9d0f-1405e03ffdc1 | Shweta-Prasad/CG_LAB | solar_system.cpp | #include <GL/glut.h>
#include <cmath>
#define WINDOW_WIDTH 800
#define WINDOW_HEIGHT 600
struct Planet {
float distance; // Distance from the sun
float angle; // Current angle of rotation
float speed; // Angular speed of rotation
float radius; // Radius of the planet
float color[3]; // RGB... | ALGO | 0.998351 | 5.803614 |
88889a70-74e6-4219-9b26-2ffe90d8cfaf | babis-k/set10108 | labs/unit8b/simd-normal.cpp | #include <iostream>
#include <random>
#include <chrono>
#include <immintrin.h>
using namespace std;
using namespace std::chrono;
union v4
{
__m128 v; // SSE 4 x float vector
float a[4]; // scalar array of 4 floats
};
// Randomly generate vector values
void generate_data(v4 *data, size_t n)
{
// Creat... | DATA | 0.993548 | 4.106584 |
5190669b-7c5b-4e4d-bb8c-a3f242bfddbe | NXIST-backup/algorithm_trans | codeforces/613C.cpp | //่ดจๅ ๆฐๅ่งฃ
#include "iostream"
#include "vector"
#include "algorithm"
#include <algorithm>
using namespace std;
typedef long long ll;
ll x;
ll _lcm(ll a,ll b)
{
return a / __gcd(a, b) * b;
}
int main()
{
cin >> x;
ll ans;
for (ll i = 1; i * i <= x;i++)
{
if(x%i==0&&_lcm(i,x/i)==x)
... | ALGO | 0.999943 | 4.566202 |
bf6baacf-de05-446b-974d-8261adee7a77 | OhOverLord/loft-C | ะ ะตะฐะปะธะทะฐัะธั split.cpp | #include <iostream>
#include <cstring>
using namespace std;
int split(char *s,char words[][255]) {
if(s==NULL)
return -1;
int count = 0,len = strlen(s),i=0;
do {
while(i<len && isspace(s[i]))
++i;
int start = i;
while(i<len && !isspace(s[i]))
++i;
... | TOOL | 0.996143 | 3.487825 |
997bf5d5-3c46-42f4-abf4-bac6774fabbe | a1595341200/data_plot | implot_demos/common/Native.cpp | #include "Native.h"
#include <iostream>
#include <algorithm>
#ifdef _WIN32
#include <pdh.h>
#include <psapi.h>
#include <tchar.h>
#include <windows.h>
#else
#include <errno.h>
#include <pthread.h>
#include <sched.h>
#include <sys/stat.h>
#include <sys/syscall.h>
#include <time.h>
#include <unistd.h>
#endif
#include <... | TOOL | 0.892574 | 5.933075 |
0c2bae99-1122-4491-81f0-bbd94c7e77b9 | AndersonHJB/DevelopmentProject | meibairuanj/dlib/examples/quantum_computing_ex.cpp | /*
This is an example illustrating the use of the quantum computing
simulation classes from the dlib C++ Library.
This example assumes you are familiar with quantum computing and
Grover's search algorithm and Shor's 9 bit error correcting code
in particular. The example shows how to simulate bot... | ALGO | 0.998431 | 6.217657 |
77f48b4c-3a72-49db-b1da-3973c56fc7a4 | Arazm1/CPP | 7-Logical Operators/5-Bonus1.cpp | /*
Optional: Letโs try a challenging problem that will put all your brain cells to the test.
Write a leap_year.cpp program that:
Takes a year as input.
Checks to see if the year is a four-digit number.
Displays whether or not the year falls on a leap year.
There are 3 criteria that must be taken into account to ident... | ALGO | 0.99919 | 4.845489 |
4dcffa65-97da-4977-a0cc-2609b4281582 | OpenXRay/xray | SDK/MagicSoftware/FreeMagic/Source/Distance3D/MgcDist3DVecCir.cpp | #include "MgcDist3DVecCir.h"
using namespace Mgc;
static const Real gs_fTolerance = 1e-05f;
//----------------------------------------------------------------------------
Real Mgc::SqrDistance (const Vector3& rkPoint, const Circle3& rkCircle,
Vector3* pkClosest)
{
// signed distance from point to plane of cir... | TOOL | 0.996852 | 4.746421 |
4d38846e-1954-4e48-95c4-e41b6b07209c | ishandutta2007/codeforces | farhod_farmon/normal/1025/C.cpp | #include <bits/stdc++.h>
#define fi first
#define se second
#define fin(s) freopen( s, "r", stdin );
#define fout(s) freopen( s, "w", stdout );
const long long N = 200200;
const long long Q = 10100;
const long long mod = 998244353;
const long long MAGIC = 30;
using namespace std;
int n;
int a[N];
int s[N];
string t... | ALGO | 0.999819 | 4.296505 |
8ae88ab6-f66a-4e76-8914-c8104d837432 | AkashSinghMNNIT/LeetQuestion | 0211-design-add-and-search-words-data-structure/0211-design-add-and-search-words-data-structure.cpp | class Trie{
public:
vector<Trie*> t;
bool end = 0;
Trie()
{
t.resize(27);
// fill(t.begin(), t.end(), NULL);
for(int i = 0; i<27; ++i) t[i] = NULL;
}
};
class WordDictionary {
public:
Trie *root ;
unordered_map<char, int> mp;
WordDictionary() {
root =... | ALGO | 0.999558 | 5.83983 |
4d106601-67cb-43a5-8f1e-a8ed748cbdef | OrionJoshi/Data-Structure | Queue/queue implemantation using array1.cpp | #include<stdio.h>
#include<conio.h>
#define n 5
void main()
{
int queue[n],ch=1,front=0,rear=0,i,j=1,x=n;
//clrscr();
printf("Queue using Array");
printf("\n1.Insertion \n2.Deletion \n3.Display \n4.Exit");
while(ch)
{
printf("\nEnter the Choice:");
scanf("%d",&ch);
switch... | ALGO | 0.999012 | 3.29477 |
5523eb7d-c554-43a1-8425-e6b7f1b53659 | vfegger/RAUKF | src/model/src/aem.cpp | #include "../include/aem.hpp"
#include <fstream>
void AEM::SetMemory(int Lcs, int Lcm, int Lrs, int Lrm, Type type)
{
errorState.alloc(Lrs);
errorMeasure.alloc(Lrm);
covarState.alloc(Lrs * Lrs);
covarMeasure.alloc(Lrm * Lrm);
int Ns = GetSampleLength(Lrs);
samplesState.alloc(Ns * (2 * Lrs + Lc... | ALGO | 0.976037 | 5.855215 |
c83a4a92-e908-4c1f-973b-08fce3c8b334 | ishandutta2007/codeforces | wa1tz719/normal/487/D.cpp | #include<set>
#include<map>
#include<list>
#include<queue>
#include<stack>
#include<math.h>
#include<string>
#include<time.h>
#include<bitset>
#include<vector>
#include<memory>
#include<utility>
#include<stdio.h>
#include<sstream>
#include<fstream>
#include<iostream>
#include<stdlib.h>
#include<string.h>
#include<algor... | ALGO | 0.999907 | 3.42562 |
87bf6012-05be-4b5e-88e8-b6304c1cfcc0 | Djokovic0311/LeetCode | problems/edit_distance/solution.cpp | class Solution {
public:
int minDistance(string word1, string word2) {
// p[i][j] to be the minimum number of operations to convert word1[0..i) to word2[0..j)
int m = word1.length(), n = word2.length();
vector<vector<int>> dp(m+1, vector<int>(n+1,0));
for(int i = 1; i <= m; i++) {
... | ALGO | 0.999995 | 6.080071 |
0fb9e115-f727-479e-9d21-c8f20a531bbb | lsm5655/c-algorithm | 22.cpp | #include <stdio.h>
#include <vector>
using namespace std;
int main() {
freopen("input.txt", "rt", stdin);
int n, k, i, sum=0, max;
scanf("%d %d", &n, &k);
vector<int> a(n);
for(i=0;i<n;i++) {
scanf("%d", &a[i]);
}
for(i=0;i<k;i++) {
sum+=a[i];
}
max=sum;
for(i=k;... | ALGO | 0.999916 | 3.267675 |
8a37ff71-16d5-4060-99fe-cd6ee0524884 | hitenSharm/LeetCode | minimum-increment-to-make-array-unique/Time Limit Exceeded/7-11-2021, 11_13_30 AM/Solution.cpp | // https://leetcode.com/problems/minimum-increment-to-make-array-unique
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
static auto _ = []() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
return 0;
}();
class Solution {
public:
int minIncrementForUnique(vector<in... | ALGO | 0.999976 | 5.932549 |
2a7e0b83-2c57-440c-a62e-bb7c29625915 | Floral/Study | ๆฐๆฎ็ปๆไธ็ฎๆณ/็ฎๆณ็ฌ่ฎฐ/Ch4/4_4/p122.cpp | #include<cstdio>
#include<algorithm>
#define maxn 110
struct Interval
{
int x, y;
} I[maxn];
bool hashTable[maxn] = {false};
bool cmp(Interval a, Interval b) //ๅชๆcppๅฏไปฅ่ฟๆ ทๅ,c้่ฆๅๆstruct Interval
{
if (a.x!=b.x)
return a.x > b.x;
else
return a.y < b.y;
}
int main()
{
int n;
scanf(... | ALGO | 0.999861 | 4.119349 |
03867413-59ad-48ba-b21a-559d7b24d015 | tranvandat05032002/C-C-DoThi | chuoistring/gatho.cpp | #include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[]) {
int a, b, x, y;
scanf("%d%d", &a, &b);
x=(4*a-b)/2;
y=a-x;
if(2*x+4*y != b || x+y!=a || b%2!=0 || x<0 || y<0){
printf("-1");
}
else{
printf("%d %d", x, y);
}
return 0;
}
| ALGO | 0.99996 | 3.615875 |
b55b9877-f9b8-4a86-b05f-d07530ca8964 | ayushdama11/dsa-repo | 45_priorityQueue/pq2/heapifyAlgo.cpp | #include <iostream>
using namespace std;
void print(int arr[], int n) {
for(int i=0; i<n; i++) {
cout<<arr[i]<<" ";
}
cout<<endl;
}
void heapify(int i, int arr[], int n) {
while(true) {
int left = 2*i, right = 2*i+1;
if(left>=n) break;
if(right>=n) {
if(arr[i]... | ALGO | 0.99995 | 4.405122 |
9ca631d0-2072-4a3e-a230-72d87f7768ca | Eckry/Problems | codeforces/1744D/1744D.cpp | #include <bits/stdc++.h>
using namespace std;
#define optimize() \
cin.tie(0); \
cin.sync_with_stdio(0); \
ios_base::sync_with_stdio(0); \
cout.tie(0);
void solve()
{
int n;
cin >> n;
vector<long long> a(n);
for (auto &c : a)
cin >> c;
long long count = 0;
... | ALGO | 0.999746 | 4.786158 |
fc9f5c06-bd8d-4006-8671-471fd8a2b4af | raincross7/code-similarity | codes/train_code/problem063/problem063_404.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int cnt[1000006] = {0};
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int g = 0, p;
int n;
cin >> n;
while (n--)
{
cin >> p;
++cnt[p];
g = __gcd(g, p);
}
if (g != 1... | ALGO | 0.999718 | 3.928247 |
a373d87a-f0df-491e-81ce-e664dbc1db48 | AtelierNeon/an-boost-gsm | libs/contract/example/features/if_constexpr.cpp | #include <boost/contract.hpp>
#include <boost/type_traits/has_equal_to.hpp>
#include <utility>
#include <cassert>
//[if_constexpr
template<typename T>
void swap(T& x, T& y) {
constexpr bool b = boost::contract::is_old_value_copyable<T>::value &&
boost::has_equal_to<T>::value;
boost::contract::old_p... | TEST | 0.887088 | 6.30748 |
db750df1-8a05-46c3-bfc0-b50cf1438642 | Amritapandey22/Daily-codes | 138-copy-list-with-random-pointer/138-copy-list-with-random-pointer.cpp | class Solution {
public:
Node* copyRandomList(Node* head) {
if(!head) return NULL;
Node* temp = head;
while(temp){
Node* node = new Node(temp->val);
node->next = temp->next;
temp->next = node;
temp = node->next;
}
... | ALGO | 0.998947 | 5.065361 |
44ad992b-0898-435f-849a-34a26ceede7a | Jyotiraditya-baghel/ADS_Programs | lab5/2-3trees.cpp | #include <bits/stdc++.h>
using namespace std;
class TreeNode {
int *keys;
TreeNode **child;
int n;
bool leaf;
public:
TreeNode(bool leaf);
void traverse();
int findKey(int k);
void insertNonFull(int k);
void splitChild(int i, TreeNode *y);
void remove(int k);
void removeFromLeaf(int idx);
void rem... | ALGO | 0.999994 | 4.588976 |
ae2943ea-937f-4e5e-b511-848a951f95ce | dingliang1989/ThirdParty | Source/boost_1_88_0/libs/compute/perf/perf_discrete_distribution.cpp | #include <algorithm>
#include <iostream>
#include <vector>
#include <boost/compute/system.hpp>
#include <boost/compute/container/vector.hpp>
#include <boost/compute/random/default_random_engine.hpp>
#include <boost/compute/random/discrete_distribution.hpp>
#include "perf.hpp"
namespace compute = boost::compute;
int... | TOOL | 0.976765 | 3.96554 |
af1191e5-5975-4354-8359-1a3c7eeb75c1 | daishiwatabe/autoware_sai2 | ros/src/computing/perception/detection/vision_detector/libs/dpm_ttic/gpu/tracking.cpp | /////tracking.cpp calculate_time-variation information //////////////////////////////////////////////////////////
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <time.h>
#include <opencv/cv.h>
#include <opencv/highgui.h>
#include <opencv/cxcore.h>
//Header files
#include "MODEL_info.h" //Model-str... | ALGO | 0.995868 | 3.548566 |
5a5344f4-4f4a-4b74-8340-d7d114de604b | mako-tutor/llvm | libc/src/math/nvptx/fmaxf.cpp | #include "src/math/fmaxf.h"
#include "src/__support/CPP/bit.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
#include "src/__support/macros/optimization.h"
namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(float, fmaxf, (float x, float y)) {
return __builtin_fmaxf(x, y);
}
} // names... | ALGO | 0.862952 | 6.381597 |
dad1e770-23c6-4dc0-b5e8-8032e827bf3c | nishant19/InterviewPrep | Math/HammingDistancePairwise.cpp | // Hamming distance between two non-negative integers is defined as the number of positions at which the corresponding bits are different.
// For example,
// HammingDistance(2, 7) = 2, as only the first and the third bit differs in the binary representation of 2 (010) and 7 (111).
// Given an array of N non-negative... | ALGO | 0.999957 | 5.617614 |
0c39a2b6-1b90-4370-bb8b-4941690a309b | DreamTeamCoin3/dreamteam3 | src/core_read.cpp | #include "core_io.h"
#include "primitives/block.h"
#include "primitives/transaction.h"
#include "script/script.h"
#include "serialize.h"
#include "streams.h"
#include "univalue/univalue.h"
#include "util.h"
#include "utilstrencodings.h"
#include "version.h"
#include <boost/algorithm/string/classification.hpp>
#includ... | TOOL | 0.863792 | 7.165897 |
3dfacc1a-b21a-45b8-aeee-e040e9a73cf4 | thecybertraveller22/Data-Structures | Lab 1/22i-1552_TASK1_LAB1.cpp | #include<iostream>
using namespace std;
template <typename T>
T print(T a[9], T b[13])
{
cout<<endl;
cout<<"Array A is as follows ->"<<endl;
for(int i=0;i<9;i++)
{
cout<<a[i]<<" , ";
}
cout<<endl;
cout<<endl;
cout<<"Array B is as follows ->"<<endl;
for(int i=0;i<13;i++)
... | ALGO | 0.986097 | 3.432558 |
aa6b0e63-b0c3-4141-aefa-bae4c2b2c36f | SHIVAM1422000/Java_CP | cpp 4 cp/B_Shuffle.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main(){
int t;
cin >> t;
while(t--){
int n,x,c;
cin >> n >> x >> c;
int start=-1,end=-2;
while (c-->0)
{
int l,r;
cin >> l >> r;
if(star... | ALGO | 0.99987 | 3.683645 |
b563d71d-2a58-498a-80b1-690366c797cd | Kawser-nerd/CLCDSA | Source Codes/AtCoder/arc008/B/1586287.cpp | #include <iostream>
using namespace std;
int main() {
int N, M;
string name, kit;
cin >> N >> M >> name >> kit;
int cn['Z' + 1] = {0};
int ck['Z' + 1] = {0};
for (int i = 0; i < N; i++) cn[name[i]]++;
for (int i = 0; i < M; i++) ck[kit[i]]++;
int ans = 0;
for (int i = 'A'; i <... | ALGO | 0.999981 | 3.870482 |
7cb279e4-6b0b-4d2e-bba2-708b29165a50 | regitabish/competitive-programming | AC/drill/129.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int n; cin >> n;
vector<int> x(n);
vector<int> p(n);
vector<long long> sum(n+1);
for(int i=0;i<n;++i)cin>>x.at(i);
sum.at(0) = 0;
for(int i=0;i<n;++i){
cin>>p.at(i);
sum.at(i+1) = sum.at(i) + p.at(i);
}
int q;... | ALGO | 0.999987 | 3.938521 |
74ea13ee-aea5-4d64-8dc1-438576301786 | hjiang13/LLMs-in-IR | processed_data/DecompiledResuts_Human_x_164_O2/GPT4o_Human_x_164_O2_decompiled/test/CPP_9.cpp | #include <vector>
#include <stdexcept>
#include <cstring>
void rolling_max(std::vector<int>& result, const std::vector<int>& input) {
result.clear();
if (input.empty()) return;
int current_max = input[0];
result.push_back(current_max);
for (size_t i = 1; i < input.size(); ++i) {
curre... | ALGO | 0.999885 | 6.711132 |
4af1db51-6358-42dd-b79a-9a53d1110061 | Abhi7026/Leetcode-Solutions | 2225-find-players-with-zero-or-one-losses/2225-find-players-with-zero-or-one-losses.cpp | class Solution {
public:
vector<vector<int>> findWinners(vector<vector<int>>& matches) {
vector<vector<int>>v(2);
unordered_map<int,int>m;
for(int i=0;i<matches.size();i++)
{
if(m[matches[i][1]]>=0 ){
m[matches[i][1]]=-1;
}
... | ALGO | 0.999888 | 5.535296 |
70bb89b4-1273-484d-bc95-41891f389a79 | FloCoicoi/fc_thesis | my_navigation/my_dwb_critics/src/orient_to_goal.cpp | #include <my_dwb_critics/orient_to_goal.h>
#include <nav_2d_utils/parameters.h>
#include <nav_core2/exceptions.h>
#include <pluginlib/class_list_macros.h>
/**
* This critic serves as an attractor towards the goal's position and heading. It activates only when the robot is
* in an activation_radius from the goal.
* ... | ALGO | 0.999134 | 6.296036 |
bee3aa1c-4638-4d8e-860b-887edcd86e06 | morishita8256/AtCoder | ABC/061-080/ABC078/C - HSI.cpp | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define fi first
#define se second
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repp(i, a, b) for (int i = a; i <= (b); ++i)
#define repr(i, a, b) for (int i = a; i >= (b); --i)
typedef long long ll;
cons... | ALGO | 0.999639 | 3.139849 |
6bb0adc2-373a-41b9-a824-9176bed098c6 | HTDerekLiu/surface_multigrid_code | src/SSP_decimate.cpp | #include "SSP_decimate.h"
bool SSP_decimate(
const Eigen::MatrixXd & VO,
const Eigen::MatrixXi & FO,
const size_t & tarF,
const int & dec_type,
Eigen::MatrixXd & V,
Eigen::MatrixXi & F,
Eigen::VectorXi & IMF,
Eigen::VectorXi & IM,
std::vector<single_collapse_data> & decInfo,
std... | ALGO | 0.996792 | 4.204902 |
416770f3-acd6-4caa-951b-c0f87f0ea140 | AldoEZ/CPCFI | practicas/Contests/codeforcesGlobalRound28/A.cpp | #include <bits/stdc++.h>
using namespace std;
#define fastIO() ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define pb push_back
#define sz(a) int(a.size())
#define F first
#define S second
typedef long long ll;
typedef vector<int... | ALGO | 0.999894 | 3.974467 |
9771987b-4840-415d-a8eb-98efed391b73 | shilpiprd/courser_courses_backup | Coursera Courses/Data Course Specialization/Algorithmic Toolbox/week6_dynamic_programming2/1_maximum_amount_of_gold/knapsack.cpp | #include <iostream>
#include <vector>
using std::vector;
int optimal_weight(int W, const vector<int> &w) {
//write your code here
int current_weight = 0;
for (size_t i = 0; i < w.size(); ++i) {
if (current_weight + w[i] <= W) {
current_weight += w[i];
}
}
return current_weight;
}
int main() {... | ALGO | 0.999998 | 5.67807 |
0b54710e-6a2d-4184-b166-96de7004d4d3 | rsquaredacademy/rfm | revdep/library/rfm/new/Rcpp/examples/Attributes/Export.cpp |
#include <Rcpp.h>
using namespace Rcpp;
// [[Rcpp::export]]
int fibonacci(const int x) {
if (x == 0) return(0);
if (x == 1) return(1);
return (fibonacci(x - 1)) + fibonacci(x - 2);
}
// [[Rcpp::export("convolveCpp")]]
NumericVector convolve(NumericVector a, NumericVector b) {
int na = a.size()... | ALGO | 0.98652 | 5.877952 |
c1596e51-55f1-4342-bdd2-9aa157061e12 | SouravDe99/Exploration_Cpp | Week 2/STFOOD.cpp | #include <iostream>
using namespace std;
int main() {
int n, s, p, v, profit, maxProfit, t;
cin >> t;
for (int i = 1; i <= t; i++) {
cin >> n;
maxProfit = 0;
for (int j = 1; j <= n; j++) {
cin >> s;
cin >> p;
cin >> v;
profit = (p / (s + 1)) * v;
if (maxProfit < profit) ... | ALGO | 0.999265 | 3.764088 |
fa5000e7-df9b-4127-9c16-0e3101e3a3b9 | HarryGuo2012/ACMCode | CDOJ/1266.cpp | #include<iostream>
#include<cstring>
#include<string>
using namespace std;
int i=0,j=0,k=0;
char now='1';
bool sign=true;
int main(){
int n,m;
string s;
cin.sync_with_stdio(false);
cin>>n>>m>>s;
for(auto c:s){
switch(c){
case 'i':
if(now=='1')now='i';
else if(now=='i')now='1',sign^=1;
else if(n... | ALGO | 0.999972 | 3.339055 |
c3403344-d9e5-498e-a367-bae1ed5f57b4 | gauravk268/Competitive_Coding | GFG/Smallest subarray with sum greater than x .cpp | class Solution{
public:
int sb(int arr[], int n, int x)
{
if(*max_element(arr, arr+n) > x) return 1;
int start=0, end=0, len=n, sum=0;
while(end<n){
while(sum<=x && end<n) sum += arr[end++];
while(sum>x && start<n){
len... | ALGO | 0.999966 | 5.100346 |
151beffb-ccc8-4e1d-8aac-a5e9f4cd4043 | hyunwoo0318/Algorithm | Algorithm/1389.cpp | //#include<iostream>
//#include<cstring>
//
//using namespace std;
//
//#define maxNum 987654321
//
//int arr[101][101];
//
//int main()
//{
// int n, m, i1,i2,input;
// cin >> n >> m;
// for (int i = 1; i <= n; i++)
// {
// for (int j = 1; j <= n; j++)
// arr[i][j] = maxNum;
// }
//
//
// for (int i = 0; i < m; i++... | ALGO | 0.999979 | 3.72412 |
403a0f5a-0b65-4f23-9e19-43f01a811aba | lbv/pc-code | solved/c-e/coin-change/coin.cpp | #include <cstdio>
#define MAXMONEY 7489
// dp[i] has the number of ways to make i with the coins
int dp[MAXMONEY + 1];
int x;
const int coins[] = { 50, 25, 10, 5, 1 };
void run_dp()
{
dp[0] = 1;
int n = sizeof(coins) / sizeof(int);
for (int i = 0; i < n; ++i)
for (int j = coins[i], a = 0; j <=... | ALGO | 0.996295 | 4.018527 |
83a6e1a7-6785-4a4c-8bac-72a124e0af1b | denis-gubar/Leetcode | Array/0268. Missing Number.cpp | class Solution {
public:
int missingNumber( vector<int>& nums ) {
int result = nums.size();
for (int i = 0; i < nums.size(); ++i)
result += i - nums[i];
return result;
}
}; | ALGO | 0.999508 | 5.774305 |
e2601d92-cbeb-4f9a-9f92-a32ff5a3a28c | sarvex/leetcode-boo | solution/0000-0099/0082.Remove Duplicates from Sorted List II/Solution.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
ListNode* deleteDupli... | ALGO | 0.999987 | 5.910652 |
ac61cd22-b6f1-4b00-8146-9aebda1d051e | RashedCSEJnU/ProblemSolving | CodeForces/B_Karen_and_Coffee.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
const int N = 200010;
int ar[N], ans[N];
int32_t main()
{
ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
int n, k, q;
cin >> n >> k >> q;
for (int i = 0; i < n; i++)
{
int a, b;
cin >> a >> b;
... | ALGO | 0.999768 | 4.170754 |
b73fad7e-d84a-4741-a0c5-d7351fa04625 | morningB/baekjoon | ํ๋ก๊ทธ๋๋จธ์ค/0/181852.โ
๋ค์์โ
5๋ฑโ
์๋ก/๋ค์์โ
5๋ฑโ
์๋ก.cpp | #include <string>
#include <vector>
#include <algorithm>
using namespace std;
vector<int> solution(vector<int> num_list) {
vector<int> answer;
sort(num_list.begin(),num_list.end());
for(int i=5;i<num_list.size();i++)
answer.push_back(num_list[i]);
return answer;
} | ALGO | 0.999748 | 3.690765 |
3fb10d20-c4c1-41bd-a060-12be989d3796 | minhduc462001/languageC | THphantichthuasonguyento.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
long long t;
cin>>t;
int dem=0;
while(t%2==0){
dem++;
t/=2;
}
if(dem >0){
cout<<2<<" "<<dem<<endl;
}
for(int i = 3;i<=sqrt(t);i+=2){
dem = 0;
while(t%i==0){
dem++;
t/=i;
}
if(dem>0){
cout<<i<<" "<<dem<<endl;
}
}
if(t>2){
cout... | ALGO | 0.999486 | 4.200025 |
073c45c9-286e-4a8c-aef1-d91ceb79132c | dantrag/moleqcage | CGAL-4.7/demo/Polyhedron/Polyhedron_demo_mesh_segmentation_plugin.cpp | #include "Polyhedron_demo_plugin_helper.h"
#include "Polyhedron_demo_plugin_interface.h"
#include "ui_Mesh_segmentation_widget.h"
#include "Scene_polyhedron_item.h"
#include "Polyhedron_type.h"
#include "Scene.h"
#include "Color_map.h"
#include <CGAL/mesh_segmentation.h>
#include <QApplication>
#include <QMainWindow>... | TOOL | 0.868235 | 5.908637 |
66074f26-f125-4268-bcd7-5d3c14816004 | Code-Agon/CP-Programming | PracticedProblems/PermutationThat-arr[i]&arr[i+1]!=0.cpp | /**
A permutation p1,p2...pN of {1,2,...,N} is beautiful if pi&pi+1 is greater than 0 for every 1โคi<N .
You are given an integer N, and your task is toconstruct a beautiful permutation of length N or
determine that it's impossible
Sample Input:
3
4
3
5
Sample Output:
-1
1 3 2
2 3 1 5 4
**/
#include <iostream>
usin... | ALGO | 0.999957 | 4.373569 |
f56a79f6-4ee8-4bfb-8457-b341241065cf | Satyam020/assignment_cp | programming assignment 1/que23.cpp | #include <iostream>
using namespace std;
int main(){
int n, r ,sum=0,temp;
cout<<"enter the number";
cin>>n;
temp=n;
while(n>0){
r=n%10;
sum=(sum*r)+r;
n=n/10;
}
if(temp==sum){
cout<<"number is palidrome";
}
else{
cout<<"number is not palidrome";
}
return 0;
}
| ALGO | 0.999911 | 4.190593 |
991991ca-e707-4766-8a4d-155227595249 | MOHIT-IITP/cp-codeforces | contest-1016/A. Ideal Generator.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int t;
cin>>t;
while(t--){
int a;
cin>>a;
// code goes here
if(a % 2 == 0){
cout<<"NO"<<endl;
}else{
cout<<"YES"<<endl;
}
}
return 0;
}
| ALGO | 0.997511 | 5.000137 |
ab200ad6-3028-4689-af27-3466c9d942b6 | GustavoSorto/PortafoliosFinal | PortafolioDeProgramasUnidad1/suma.cpp | #include <iostream>
using namespace std;
int main(){
int n, sum =0;
while (n>=0){
cout << "Ingrese un numero a sumar ( -1 para salir): ";
cin >> n;
sum += n;
}
cout << "Suma = " << sum;
return 0;
}
| ALGO | 0.939318 | 3.278845 |
6f4fe6e1-2728-4260-9fa0-ae14271cf7e4 | VishnuNV-msil/bingo_app2 | 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 |
15dd2ce7-6e00-4303-83e8-3fa6ef125811 | raincross7/code-similarity | codes/train_code/problem076/problem076_35.cpp | #include<iostream>
#include<string>
using namespace std;
int main()
{
int count=0,N,M,*H,A,B;
bool *best;
cin>>N>>M;
H=new int[N];
best=new bool[N];
for(int i=0;i<N;i++)
{
cin>>H[i];
best[i]=true;
}
for(int i=0;i<M;i++)
{
cin>>A>>B;
A--;
B--;
if(H[A]>=H[B])
best[B]=... | ALGO | 0.99997 | 3.311026 |
118de3ef-c66c-4101-b5d8-0aa23da48af7 | Gauravlamba1109/LeetCodeQuestions | 98-validate-binary-search-tree/98-validate-binary-search-tree.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.999852 | 6.376801 |
6591cde0-8155-48a5-852d-91d871a7a8ae | RenderKit/embree | kernels/bvh/bvh_builder_subdiv.cpp | #include "bvh.h"
#if defined(EMBREE_GEOMETRY_SUBDIVISION)
#include "bvh_refit.h"
#include "bvh_builder.h"
#include "../builders/primrefgen.h"
#include "../builders/bvh_builder_sah.h"
#include "../builders/bvh_builder_msmblur.h"
#include "../../common/algorithms/parallel_for_for.h"
#include "../../common/algorithms/... | ALGO | 0.994957 | 6.756534 |
89b53a22-10a5-4199-9d56-aa9a51dba155 | devxhub/flutter_date_picker | example/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.998787 | 6.76775 |
3fb5ad43-812f-4576-8546-133de696f0b4 | mainul3195/All | 2/A. Magic Numbers.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
ios_base::sync_with_stdio(0); cin.tie(0);
string s;
cin >> s;
bool ok=1;
for(int i=0; i<s.size() ; i++)
{
if(s[i]=='1' && s[i+1] == '4' && s[i+2]=='4')
i+=2;
else if(s[i]=='1' && s[i+1] == '4')
i+=1;
else if(s[i]=='1')
continue;
else
{
... | ALGO | 0.999913 | 3.422613 |
3ea5def4-9b1e-4ca2-b3bc-d227b80401ca | PatriciaHaloiu/VF | tools/boost_1_80_0/libs/compute/perf/perf_uniform_int_distribution.cpp | #include <algorithm>
#include <iostream>
#include <vector>
#include <boost/compute/system.hpp>
#include <boost/compute/container/vector.hpp>
#include <boost/compute/random/default_random_engine.hpp>
#include <boost/compute/random/uniform_int_distribution.hpp>
#include "perf.hpp"
namespace compute = boost::compute;
... | TOOL | 0.894249 | 3.90948 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.