uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
9bdd76a9-d08c-4b72-8ffc-dcd449d9152f | angel-utn/fi-2025 | 20250409/resta2.cpp | ///Ejercicio:suma de dos nmeros
///Autor:DEK
///Fecha:09-04-2025
///Comentario: primer programa del curso de FI 2025
# include<iostream>
using namespace std;
int main(){
///instrucciones especficas de cada programa
int n1, n2, resta;
cout<<"INGRESAR NUMERO ";
cin>>n1;
cout<<"INGRESAR NUMERO ";
cin>>n2;
... | ALGO | 0.962871 | 3.306567 |
91a77085-2ba6-4676-8538-007b52c0192b | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_5259_10.cpp | #include <bits/stdc++.h>
using namespace std;
double PI = 3.1415926536;
int dX[] = {1, -1, 0, 0};
int dY[] = {0, 0, 1, -1};
int main() {
int n, idx, mx = 0, arr[100002];
scanf("%d", &n);
for (int i = 0; i < n; i++) {
scanf("%d", &idx);
arr[idx] = arr[idx - 1] + 1;
mx = max(arr[idx], mx);
}
cout <<... | ALGO | 0.999415 | 3.509289 |
b4fa071d-2f92-460d-b485-1989305a5d3e | gogoalswo/Unreal_Study | UnrealEngine-4.27/Engine/Source/ThirdParty/Intel/TBB/IntelTBB-2019u8/src/test/test_parallel_scan.cpp | #include "tbb/parallel_scan.h"
#include "tbb/blocked_range.h"
#include "harness_assert.h"
#include <vector>
typedef tbb::blocked_range<long> Range;
static volatile bool ScanIsRunning = false;
//! Sum of 0..i with wrap around on overflow.
inline int TriangularSum( int i ) {
return i&1 ? ((i>>1)+1)*i : (i>>1)*(i+1... | ALGO | 0.912211 | 5.813643 |
96095351-c3b1-4bda-921c-53db5d5c851c | PaukIsUha/optimizing_formating_code | predictions/full_output_predicted_submissions/Codenet/p00202/367278043/3.cpp | #include <algorithm>
#include <stdio.h>
using namespace std;
int n, x, a[30];
bool dp[1000001], prime[1000001];
int main() {
prime[0] = true;
for (int i = 3; i <= 1000000; i += 2)
prime[i] = true;
for (int i = 3; i <= 1000; i++) {
if (!prime[i])
continue;
for (int j = i; i * j <= 1000000; j += 2... | ALGO | 0.999911 | 3.906196 |
1c838609-badf-4ff3-a45c-b3e5570bb7dd | Amriteshwork/Coding_Questions | Array/problem_10/approach_4.cpp | #include <iostream>
#include <unordered_set>
using namespace std;
void FindK(int arr[], int arr_len, int k) {
unordered_set<int> elements;
for (int i = 0; i < arr_len; i++) {
int curr_element = arr[i];
if (elements.count(curr_element - k) > 0) {
cout << curr_element << ", " << curr... | ALGO | 0.999962 | 4.859342 |
40a6b8b2-64a3-4c25-8aa1-b8e9755fd15e | ViswesB/AlgorithmsWS | MinCostOfClimbingStairs.cpp | /*
746. Min Cost Climbing Stairs
Easy
You are given an integer array cost where cost[i] is the cost of ith step on a staircase. Once you pay the cost, you can either climb one or two steps.
You can either start from the step with index 0, or the step with index 1.
Return the minimum cost to reach the top of the floo... | ALGO | 0.999874 | 6.146359 |
a7e61184-bf0d-4659-920d-5263ccbc833d | blacknand/ShardKV | libs/consistent_hashing/consistent_hash.cpp | #include "consistent_hash.h"
// #include "../version_config.h"
void ConsistentHash::add_node(const std::string &node)
{
std::lock_guard<std::mutex> lock(mutex_);
for (int i = 0; i < vnode_count; i++) {
std::string virtual_node = node + "#" + std::to_string(i);
uint32_t hash = HashUtils::hash_... | ALGO | 0.967737 | 6.361834 |
e5bb9cfc-5893-4341-b810-53e8c32f0aff | yiyongc/BvhEditor | bvheditor/Wml/Source/Containment/WmlContScribeCir2.cpp | #include "WmlContScribeCir2.h"
#include "WmlLinearSystem.h"
using namespace Wml;
//----------------------------------------------------------------------------
template <class Real>
bool Wml::Circumscribe (const Vector2<Real>& rkV0, const Vector2<Real>& rkV1,
const Vector2<Real>& rkV2, Circle2<Real>& rkCircle)
{
... | ALGO | 0.999582 | 5.811321 |
00ca787e-04da-4a4c-8b96-719a02fa1505 | rahulyadav-20/cpp_practice | stringIntro.cpp | #include<iostream>
using namespace std;
bool palindrom(char name[], int len){
int s=0;
int e=len-1;
while(s<=e){
if(name[s]!=name[e]){
return false;
}else{
s++;
e--;
}
}
return true;
}
void reverse(char name[], int len){
int s=0;
... | ALGO | 0.990382 | 4.192631 |
8eba2f09-3a73-4460-bb1c-61b84ff7a72c | ychun816/CPP | CPP-09/ex02/PmergeMe.cpp | #include "PmergeMe.hpp"
// std::deque<int> deque;
// std::vector<int> vector;
// std::vector<std::string> strs; //Store input arguments as strings for validation
// CONSTRUCTORS ////////////////////////////////////////////
PmergeMe::PmergeMe(){}
PmergeMe::PmergeMe(PmergeMe const &src) { *this = src; }
PmergeMe& Pm... | ALGO | 0.999229 | 5.344074 |
705dfe17-c7fe-4179-937d-229d7c21f425 | fangding678/OnlineJudge | PAT/PAT (Basic Level) Practise (中文)/1011.cpp | #include<stdio.h>
typedef struct Num
{
long A;
long B;
long C;
}Num;
int main()
{
int i,T;
Num a[10];
while(~scanf("%d",&T))
{
for(i=0;i<T;i++)
scanf("%ld%ld%ld",&a[i].A,&a[i].B,&a[i].C);
for(i=0;i<T;i++)
{
if(a[i].A+a[i].B<=a[i].C)
printf("Case #%d: false\n",i+1);
else
printf("Case #%d: t... | ALGO | 0.996581 | 3.878402 |
81697697-2e7f-4850-95cb-42794df1941c | ishandutta2007/codeforces | aidos/normal/286/B.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
#include <set>
#include <map>
#include <queue>
#include <ctime>
#include <ext/rope>
#define pb push_back
#define ll long long
#define mp make_pair
#define f first
#define s second
#define ... | ALGO | 0.999981 | 3.16468 |
38ed160c-1b16-4af5-a882-52a688db59cd | HappyUnknown/TetrisHGE-2008 | _build/tutorials/tutorial02/GameSquare.cpp | #include "GameSquare.h"
GameSquare::GameSquare()
{
landed = false;
}
int GameSquare::get_clockwise_i(Position center)//Y
{
const int SIN90 = 1, COS90 = 0;
return (pos.j - center.j) * SIN90 + (pos.i - center.i) * COS90 + center.i;
}
int GameSquare::get_clockwise_j(Position center)//X
{
const int SIN90 = ... | TOOL | 0.929651 | 4.088787 |
ce8b28f0-703b-455d-a156-0d52c6235880 | gleefe1995/GCNv2 | Thirdparty/DBoW2/DBoW2/FORB.cpp | #include <vector>
#include <string>
#include <sstream>
#include <stdint-gcc.h>
#include "FORB.h"
using namespace std;
namespace DBoW2 {
// --------------------------------------------------------------------------
const int FORB::L=32;
void FORB::meanValue(const std::vector<FORB::pDescriptor> &descriptors,
FOR... | ALGO | 0.993937 | 6.539618 |
ecb37097-2447-4ef0-8b89-d8a903175616 | liuperic/Programming-Principles-and-Practice--Using-Cpp | ch_8/ch_8_drill_2.cpp | // Chapter 8 drill
// ch_8_drill_2.cpp
//
#include "../std_lib_facilities.h"
void swap_v(int a, int b)
{
int temp;
temp = a;
a = b;
b = temp;
std::cout << "after swap_v; a: " << a << ", b: " << b << endl;
}
void swap_r(int& a, int& b)
{
int temp;
temp = a;
a = b;
b = temp;
std... | TOOL | 0.985852 | 5.376526 |
62f7ba1e-febb-4965-b27f-8710e80aa322 | v0d0m3r/ppp2_cpp | part21/exercise21_8/main.cpp | //------------------------------------------------------------------------------
#include "../../bstroustrup_code/std_lib_facilities.h"
//------------------------------------------------------------------------------
template<typename A, typename B>
std::pair<B,A> flip_pair(const std::pair<A,B> &p)
{
return {p.s... | ALGO | 0.995686 | 6.09875 |
2c8a00e3-7027-4360-9801-4d0d9acf6085 | Tonn1Arm/Toi_Zero_2025 | A1/Toi_Zero_A1-036.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int n;
cin >> n;
n=n-n%10;
for(int i=0;i<=n/10;i++){
cout << n-i*10 << " ";
}
return 0;
}
| ALGO | 0.999591 | 3.767426 |
aa2d50da-da14-417a-a031-8dfbbed93dd3 | kalpana-kumarii/100-Days-Of-Code | day2/8.cpp | //https://practice.geeksforgeeks.org/problems/missing-number4257/1?page=2&difficulty[]=-1&category[]=Arrays&sortBy=submissions
//{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int missingNumber(int a[], int n);
int main()
{
int t;
cin>>t;
while(t--)
{
int i=0, n;
cin>>... | ALGO | 0.999539 | 5.055786 |
17c6c50f-9b30-4924-b177-375c27e0de56 | flaviatasellari/Programming-in-Cpp | Assignment 9/a9_p6.cpp | /*
CH-230-A
a9_p6.cpp
Flavia Tasellari
<EMAIL>
*/
#include <iostream>
using namespace std;
/* The function to find the first positive and even value in the array */
int myfirst (int array[], int size) {
int i;
for (i = 0; i < size; i++) {
if (array[i] > 0 && array[i] % 2 == 0) {
... | ALGO | 0.999616 | 4.801675 |
19c29ea8-435b-4b6a-bcb3-7fbcfe872e2e | joydip10/UVA | practise.cpp | #include<iostream>
#include<utility>
#include<map>
#include<vector>
using namespace std;
int main()
{
vector<<vector< map<string, int> >>>mapped;
string name="Basundhara";
int no = 5;
mapped[0][1][name]= no;
}
| TOOL | 0.888709 | 3.683664 |
b0d9aff2-6bb0-4fde-b5eb-e7f373d36240 | clearwater92/boj-ps-cpp | level1/301/2089.cpp | // 2089 silver 5
#include <iostream>
using namespace std;
void go(int n) {
if (n == 0) {
return;
}
if (n % 2 == 0) {
go(-(n / 2));
cout << "0";
}
else {
if (n > 0) {
go(-(n / 2));
}
else {
go((-n + 1) / 2);
}
cout << "1";
}
}
int main() {
int n;
cin >> n;
if (n == 0) {
cout << "0" << '... | ALGO | 0.999999 | 4.524208 |
93386d29-f87c-450d-91e4-fa4e5cbd3d5a | szw0407/OJ-codes | CCF_CSP/201903-1.cpp | #include<stdio.h>
#include<algorithm>
using namespace std;
int main(int argc, char* argv[]){
int n;;
scanf("%d", &n);
int a[100000];
double md;
int i;
for (i = 0;i < n;i++) {
scanf("%d", &a[i]);
}
sort(a, a + n);
if (n % 2 != 0)
printf("%d %d %d\n", a[n - 1], a[(int... | ALGO | 0.999758 | 3.140906 |
b4df6e0b-fd23-4f94-8019-db14db9ec6b8 | UM-ARM-Lab/mab_ms | deform_control/external_libs/osgBullet-2.0/osgbCollision/ComputeShapeVisitor.cpp | #include <osgbCollision/ComputeShapeVisitor.h>
#include <osg/ComputeBoundsVisitor>
#include <osg/Geode>
#include <osg/Notify>
#include <osgwTools/Transform.h>
#include <osgwTools/ShortEdgeOp.h>
#include <osgwTools/ReducerOp.h>
#include <osgwTools/GeometryModifier.h>
#include <osgbCollision/Utils.h>
#include <osgwTools/... | ALGO | 0.979784 | 7.594385 |
53730e90-001c-42c2-90af-0dd987aee2eb | maxwellau2/sc2001-algo-analysis | sorting/merge-sort/main.cpp | #include <iostream>
#include <vector>
using std::vector, std::cout, std::endl;
vector<int> mergesort(vector<int> unsorted);
int main(){
vector<int> unsorted = {1,2,3,0,-1,-2,-100};
// cout << unsorted[1];
vector<int> result = mergesort(unsorted);
for (int i=0; i<unsorted.size(); i++){
cout <<... | ALGO | 0.999898 | 5.042805 |
824c54c9-6176-4f24-a6ec-63cba5bb691d | ishandutta2007/codeforces | purplecrayon/normal/1425/E.cpp | #include <bits/stdc++.h>
using namespace std;
#define sz(v) int(v.size())
#define ar array
typedef long long ll;
const int N = 3e5+10, MOD = 1e9+7;
void solve() {
int n, k; cin >> n >> k;
vector<int> a(n); for (auto& x : a) cin >> x;
vector<int> d(n); for (auto& x : d) cin >> x;
auto two = [&]() {
... | ALGO | 0.99997 | 3.917757 |
ed0c979c-6f75-4782-b754-39143d8fd49b | Raghavs26/data_structures_and_algorithms | Trees/12. Boundary Traversal of Binary Tree.cpp | #include <bits/stdc++.h>
#include <iostream>
using namespace std;
template <typename T>
class TreeNode {
public:
T data;
TreeNode<T> *left;
TreeNode<T> *right;
TreeNode(T data) {
this->data = data;
left = NULL;
right = NULL;
}
~TreeNode() {
if (left) delete... | ALGO | 0.999983 | 5.342418 |
147b11df-3722-427d-8d2b-688188d7f916 | hit7sh/CodeForces | Round 691 div 2/A.cpp | // Author :: <Hitesh_Saini>
#include<bits/stdc++.h>
#define __speed() ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
#define dbg(x) cout << "--- " << #x << " = " << x << " ---\n";
#define findmax(v) *max_element(v.begin(), v.end())
#define _sum(a) accumulate(a.begin(), a.end(), 0)
#define tt int t;for(cin>... | ALGO | 0.99998 | 4.160796 |
d9f24b43-f977-4cac-80f3-5858cd78d470 | Luxary-Arxer/PhysicsII_Pinball | Physics II - Box2D - Tutorial/Box2D/Box2D/Dynamics/Contacts/b2EdgeAndCircleContact.cpp | #include <Box2D/Dynamics/Contacts/b2EdgeAndCircleContact.h>
#include <Box2D/Common/b2BlockAllocator.h>
#include <Box2D/Dynamics/b2Fixture.h>
#include <new>
b2Contact* b2EdgeAndCircleContact::Create(b2Fixture* fixtureA, int32, b2Fixture* fixtureB, int32, b2BlockAllocator* allocator)
{
void* mem = allocator->Allocate(... | TOOL | 0.934489 | 6.885304 |
2691b492-5c83-4e34-a40c-f82d513313b1 | SinnoLn/AlgorithmStudy | 프로그래머스/0/181891. 순서 바꾸기/순서 바꾸기.cpp | #include <string>
#include <vector>
using namespace std;
vector<int> solution(vector<int> num_list, int n) {
vector<int> answer;
for(int i=n; i<num_list.size(); i++){
answer.push_back(num_list[i]);
}
for(int i=0; i<n; i++){
answer.push_back(num_list[i]);
}
return answer;
} | ALGO | 0.999948 | 5.59505 |
44eff00e-af17-41f0-bb0f-d5a2d82440a4 | KausBoss/CP-SubGrouped | roughCodes/Spread Of Infection.cpp | /*
*/
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define vi vector<int>
#define pb push_back
#define fi first
#define si second
#define pii pair<int,int>
#define vii vector<pair<int,int>>
#define F(a,n) for(int i=0;i... | ALGO | 0.999977 | 4.566136 |
9049c981-af01-4032-8819-3a1e49b00aaa | Sallmahussien/LeetCode | 502-IPO.cpp | class Solution {
public:
int findMaximizedCapital(int k, int w, vector<int>& profits, vector<int>& capital) {
vector<pair<int, int>> projects;
for (int i = 0; i < profits.size(); i++) {
projects.push_back({capital[i], profits[i]});
}
sort(projects.begin(), projects.end())... | ALGO | 0.999994 | 5.612471 |
18690ed3-4ffa-47ad-8256-7e2bb2c7a5f4 | ishandutta2007/codeforces | rns3/normal/1070/I.cpp | #include <bits/stdc++.h>
using namespace std;
#define N 606
int x[N], y[N];
int n, m, k;
vector <int> v[N], u[N];
int e;
void init() {
for (int i = 1; i <= n; i ++) v[i].clear(), u[i].clear();
e = 0;
}
int type[N<<1];
void new_node(int x) {
type[++e] = x;
}
int prv[N];
bool vis[N];
bool bpm(int xx) {
int ... | ALGO | 0.999915 | 3.673636 |
9e55d86b-86c5-4a3b-8fa1-298bc44a22a0 | praveenaditya17/C-Programs | CONSTRST.CPP | #include<iostream.h>
#include<conio.h>
#include<string.h>
class string
{
char *ch,*ch1,*s;
public:
string(char *);
void reverse();
};
string::string(char *p)
{
*ch1strcpy(ch,p);
}
void string::reverse()
{
*s=*strrev(ch1);
cout<<"Reverse String="<<s;
}
void main()
{
char *st;
clrscr();
cout<<"Enter the strin... | ALGO | 0.977679 | 3.401962 |
223d2e40-ee79-40ce-8bfa-313cabf67b8d | Venkat10gitty/DAA | Lab4_DAA.cpp | // // Divide and conquer
#include <iostream>
#include <algorithm>
using namespace std;
int MinOfArray(int a[], int low, int high)
{
int i,min;
min = a[low];
for(i=low;i<=high;i++)
{
if(a[i]<min)
{
min = a[i];
}
}
return min;
}
int MaxOfArray(int a[], int low,... | ALGO | 0.999668 | 4.603331 |
9621924b-5eca-43c1-8bc4-f1918b8d73d4 | bit24/Competitive-Programming | Contests/Codeforces C++/1153F.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<ld> vd;
typedef vector<ll> vl;
#define pb push_back
const ll MOD = 998244353;
const int MAXN = 2005;
int N, K;
ll L;
ll dp[2 * MAXN][MAXN][2];
ll bexp(ll b, int e = MOD - 2) {
l... | ALGO | 0.999987 | 4.103739 |
dec96676-6ca0-460d-977b-e533c08b7e75 | Modding-Zaibatsu/ue4-tekkengame | Engine/Source/ThirdParty/VHACD/src/vhacdMesh.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <stdlib.h>
#include <stdio.h>
#include <iostream>
#include <fstream>
#include <string>
#include <iosfwd>
#include "btConvexHullComputer.h"
#include "vhacdMesh.h"
namespace VHACD
{
Mesh::Mesh()
{
m_diag = 1.0;
}
Mesh::~Mesh()
{
}
double Mesh:... | ALGO | 0.969469 | 5.484123 |
5e30c6e0-c853-4d32-82b1-71d85229efea | rresol/Practice | cycle.cpp | // A C++ Program to detect cycle in a graph
#include<iostream>
#include <list>
#include <limits.h>
using namespace std;
class Graph
{
int V; // No. of vertices
list<int> *adj; // Pointer to an array containing adjacency lists
bool isCyclicUtil(int v, bool visited[], bool *rs); // used by isCyclic()... | ALGO | 0.999787 | 5.489393 |
ce207d8a-72a0-49b0-9494-2f0d0ac9cb98 | RaviTesla1/Cpp-programs | RB/Assignment 6/print_n_odd_R.cpp | #include<iostream>
#include<conio.h>
using namespace std;
void print(int n);
void print(int n)
{
if(n > 0)
printf("%d ",2*n-1);
print(n-1);
}
int main()
{
int num;
cout<<"Enter a number:\n";
cin>>num;
print(num);
getch();
return 0;
}
| ALGO | 0.99777 | 3.53859 |
5050c498-b68f-4f1b-9002-e7b0563e1765 | hemere/my-program | kyopro/abc/abc298/b.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
vector<vector<int>> an(n,vector<int>(n)), bn(n,vector<int>(n));
for(int i=0; i<n; ++i) for(int j=0; j<n; ++j) cin >> an[i][j];
for(int i=0; i<n; ++i) for(int j=0; j<n; ++j) cin >> bn[i][j];
string ans = "No";
bool ok... | ALGO | 0.99998 | 3.62097 |
e2dc88a5-0789-4a14-8a45-627a10da691c | Hanamantray8151/Coding-Ninjas-Data-Structures-In-CPP | Recursion1b-Assignment/removex_recursion.cpp | /*
Given a string, compute recursively a new string where all 'x' chars have been removed.
Input format :
String S
Output format :
Modified String
Constraints :
1 <= |S| <= 10^3
where |S| represents the length of string S.
Sample Input 1 :
xaxb
Sample Output 1:
ab
Sample Input 2 :
abc
Sample Output 2:
abc
Samp... | ALGO | 0.999461 | 3.890067 |
db3a85a2-9fa8-40d4-a799-b55a1012ff5e | RawSalmon69/Data-Structures-and-Algorithms-y1t1 | d65_q2a_mitosis/main.cpp | #include "student.h"
#include <iostream>
#include <vector>
int main()
{
int n, t;
std::cin >> n >> t;
CP::stack<int> s;
for (int i = 0; i < n; ++i)
{
int tmp;
std::cin >> tmp;
s.push(tmp);
}
for (int i = 0; i < t; ++i)
{
int a, b;
std::cin >> a >>... | ALGO | 0.999979 | 4.472395 |
5d6980a1-180b-4a99-ae94-4dadb8899e91 | Drishti814/DSA | Bit Manipulation/Interview Problems/xorOfNumbersInGivenRange.cpp | #include<iostream>
#include<algorithm>
#include<climits>
#include<vector>
#include<map>
using namespace std;
//xor from 1 to n
//brute force - loop i from 1 to n and doing xor = xor ^ i
//TC O(n)
//SC O(1)
//optimal
//TC O(1)
//SC O(1)
int xorTillN(int n){
if(n%4==1) return 1;
if(n%4==2) return n+1;
if(n%... | ALGO | 0.999959 | 3.585925 |
ab48a322-5c00-40de-846d-37d8862ae5a6 | shaukat01/MyDailyProblemSolved | linearSearchbyusingFunction.cpp | #include <iostream>
using namespace std;
int search(int A[], int n, int key)
{
for (int i = 0; i < n; i++)
{
if (key == A[i])
return i;
// cout<<i<<endl;
}
return -1;
}
int main()
{
int A[] = {2, 4, 5, 7, 10, 9, 13};
int k;
cout << "enter an element to be seaerc... | ALGO | 0.999175 | 4.452155 |
d9ce7348-9e04-4008-93d6-68d2b56831ab | Lemon-gpu/LeetCode | 491.non-decreasing-subsequences.cpp | /*
* @lc app=leetcode.cn id=491 lang=cpp
*
* [491] Non-decreasing Subsequences
*/
#include "General.h"
// @lc code=start
class Solution
{
private:
vector<vector<int>> result;
void search(vector<int> &nums, vector<int> &tempResult, int left)
{
if (tempResult.size() > 1)
{
if... | ALGO | 0.99998 | 6.456783 |
98b0f81b-e4bc-4591-a6c8-1f2e24d8b287 | dwikasm/kijoy | DesEncrypt.cpp | // BLOCK CIPHER ENCRYPTION
// MODE COUNTER
#include<iostream>
#include<string>
#include<bitset>
#include<math.h>
#include<stdio.h>
#include<stdlib.h>
using namespace std;
// FUNGSI ASCII TO BINARY
string asciiToBinary(string input)
{
string output="", temp;
for(int i=0; i<input.size(); i++)
{
bits... | ALGO | 0.999463 | 3.787504 |
3752c0a2-a311-4011-bfd6-eadf3c6c2325 | iulianxpopa/AdventOfCode | 2018/Day6_p1.cpp | #include <bits/stdc++.h>
using namespace std;
ifstream in("input.txt");
//ofstream out("out.txt");
// abs(x1 - x2) + abs (y1 - y2);
int mdist(pair<int, int> A, pair<int, int> B){
return abs(A.first - B.first) + abs(A.second - B.second);
}
vector<pair<int, int>> points;
pair<int, int> mat[750][750];
int main(){
... | ALGO | 0.999759 | 3.869948 |
228b2374-1ff5-48be-b303-7ce0cb47b1b5 | ksood2004/gfg-solution | Difficulty: Hard/Burst Balloons/burst-balloons.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
int getMaxCoins(int left, int right, vector<int> &arr, int karan[][502]) {
if (left > right) return 0;
int maxCoins = 0;
if (karan[left][right] != -1) {
return karan[left][rig... | ALGO | 0.999746 | 5.562718 |
d6562e76-a940-447b-995d-63d7af59e884 | MooJi-Hur/cpp-data-structure | section-00/11-16-square-root/main.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n = 16;
int ret = (int)sqrt(n);
cout << ret << ' ';
return 0;
} | ALGO | 0.998749 | 4.110267 |
491468ef-bc07-48b2-92d4-a8b72c2c16d2 | AkashSingh3031/LeetCode__GeeksforGeeks-Solution | Farthest number - GFG/farthest-number.cpp | // { Driver Code Starts
//Initial Template for C++
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function Template for C++
class Solution{
public:
vector<int> farNumber(int N,vector<int> Arr){
//code here
int n = Arr.size();
vector<int> ans;
for(int... | ALGO | 0.999972 | 5.721131 |
13403922-1a65-4ef5-b488-14c1882e7f58 | TCGBench/TCGBench | data/partially_correct_code/example/example_problem/60-80_2.cpp | #include<iostream>
long long dp[25][25] = { 0 };
struct Horse
{
int x;
int y;
};
int B_x, B_y;
int C_x; int C_y;
Horse horse[9]; //最多9个点,我们先全存,到不了的点,也走不到
using namespace std;
int main()
{
cin >> B_x >> B_y >> C_x >> C_y;
horse[0].x = C_x, horse[0].y = C_y;
horse[1].x = C_x - 2, horse[1].y = C_y - 1;
horse[2].... | ALGO | 0.999898 | 3.786661 |
4a0cca6d-56b2-4047-a42d-9e4ebc4c24ab | nanwix/C-C-C- | exerc6.cpp | #include <stdio.h>
int main(){
int A[4][4], i, j, soma=0;
for(i=0;i<4;i++){
for(j=0;j<4;j++){
printf("Posio [%d] [%d] = ",i,j);
scanf("%d", &A[i][j]);
}
}for(i=0;i<4;i++){
for(j=0;j<4;j++){
printf("%d ", A[i][j]);
}
printf("\n");
}
printf("\n");
for(i=0;i=4;i++){
for(j=0;j<4;j++){
... | ALGO | 0.99637 | 3.510278 |
f6cd4082-ab24-401e-86d2-9a55fdc481c3 | dcseal/finess | apps/1d/advection/lib/ConSoln.cpp | #include <cmath>
#include <sstream>
#include <fstream>
#include <string>
#include <iostream>
#include <iomanip>
#include "dogdefs.h"
#include "IniParams.h"
#include "IniParams.h"
#include "dog_math.h"
#include "StateVars.h"
using namespace std;
void ConSoln( const StateVars& Qstate )
{
const dTensorBC2& q = Qs... | ALGO | 0.898638 | 3.960131 |
35a5674b-a675-4bdf-89d1-d5173a5759e2 | ajrusso/Geek4Geek | WaterThePlants/WaterThePlants.cpp | /*
Water The Plants
A gallery with plants is divided into n parts, numbered 0, 1, 2, 3, ..., n-1. There are provisions for attaching water sprinklers in every division. A sprinkler with range x at division i can water all divisions from i-x to i+x.
Given an array gallery[] consisting of n integers, where gallery[i] i... | ALGO | 0.999985 | 5.333004 |
268a66e3-52ef-4868-abdc-d057e1b3879a | vidja-abhay/Data_Structure_C- | Data_Structure/Practise/8_printFibonaci.cpp | #include <iostream>
using namespace std;
void printFibonacci(int n) {
int first = 0, second = 1, next;
cout << "Fibonacci series up to " << n << " is:" << endl;
// Print the first two numbers
if (n >= 1) cout << first << " ";
if (n >= 2) cout << second << " ";
// Generate and print the rest ... | ALGO | 0.999971 | 5.419368 |
a884673e-8ed2-4129-8824-e0da1dc28f9b | YanDao0313/OICodes | OpenJudge/011005.cpp | #include <bits/stdc++.h>
using namespace std;
struct stu {
int k;
int s;
} s[5050];
int l, cnt;
bool cmp(stu a, stu b) {
if (a.s > b.s)
return true;
else if (a.s == b.s) {
if (a.k < b.k)
return true;
else
return false;
} else
return false;
}
int n, m;
int main() {
cin >> n >> m;
m = m * 3 / 2 -... | ALGO | 0.999994 | 3.669818 |
36d8a587-5189-46d9-9731-6b9c16d98135 | fjoyshee/lab_col | .gitignore/quadrant.cpp | //given a coordinate (a,b),print whether it falls in the 4th quadrant
#include <iostream>
using namespace std;
int main()
{
double a,b;
cin>>a>>b;
if (a>0&&b<0){
cout<<"Yes";
}
}
| ALGO | 0.999909 | 3.053972 |
b11a9a17-b68a-4fac-9324-88bd903c0101 | ishandutta2007/codeforces | nikolapesic2802/normal/1238/F.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/rope>
#define ll long long
#define pb push_back
#define sz(x) (int)(x).size()
#define mp make_pair
#define f first
#define s second
#define all(x) x.begin(), x.end()
#define D(x) cerr << #x << " is " <<... | ALGO | 0.999678 | 4.054455 |
ef3f2347-6e57-475f-9429-12853e3ac278 | soolabettu/cp | code_forces/811_4/a.cpp | #include "bits/stdc++.h"
using namespace std;
using ll = long long;
using vs = vector<string>;
using vi = vector<int>;
using vl = vector<ll>;
using vb = vector<bool>;
using pi = pair<int, int>;
using pl = pair<ll, ll>;
using vpi = vector<pair<int, int>>;
using vpl = vector<pair<ll, ll>>;
using ld = double;
#define ... | ALGO | 0.999206 | 4.119509 |
005efb27-2bc7-4450-b971-baf060dfa369 | asilajdzic/Tehnike-Programiranja | T9/Z2/main.cpp | #include <iostream>
#include <cmath>
class Vektor3d
{
double koordinate[3];
public:
void Postavi(double x, double y, double z)
{
Vektor3d::koordinate[0]=x;
Vektor3d::koordinate[1]=y;
Vektor3d::koordinate[2]=z;
}
void Ocitaj(double &x, double &y, double &z) const
{
x=Vektor3d::koordinate[0];
y=Vektor3d::... | TOOL | 0.854371 | 4.059882 |
10bd70d7-ae21-415c-9509-90356822a92f | FLalor/1E3-TCD-Engineering | W4P2.cpp |
#include <iostream>
#include <string>
#include <iomanip>
#include <limits>
int main () {
// Read weather station name.
std::string name;
std::cin >> name;
// Read all data.
std::string input;
double min_value = std::numeric_limits<double>::max();
double max_value = -std::numeric_limits<double>::max();... | TOOL | 0.963572 | 6.364857 |
1caa736d-ca81-4057-b186-c51dd576fd6d | hardik756/temp-node-modexp | gfg.cpp/graph/cycledirectedgraph.cpp | #include<iostream>
#include<queue>
#include<vector>
#include<stack>
void addedge(std::vector<int>adj[],int u,int v){
adj[u].push_back(v);
}
bool cycledetect2(std::vector<int>adj[],int s,bool visited[],bool recst[]){
visited[s]=true;
recst[s]=true;
for(auto x:adj[s]){
if(visited[x]==false && cy... | ALGO | 0.999929 | 4.997088 |
afa8b174-dc90-432c-8f36-ccec2429223a | Prathamesh-chougale-17/geeksforgeeks_problem_solving | Medium/Modular Exponentiation for large numbers/modular-exponentiation-for-large-numbers.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
public:
long long int PowMod(long long int x,long long int n,long long int M)
{
// Code here
long long ans = 1, nn = n;
while(nn){
if(nn%2){
ans = ((ans%M) * (x%M))%... | ALGO | 0.999986 | 6.056353 |
8af85a01-7892-413e-9bba-db18f685bd20 | J-Nunes/Physis | Physics2_class2 - handout/Box2D/Box2D/Collision/b2CollideEdge.cpp | #include <Box2D/Collision/b2Collision.h>
#include <Box2D/Collision/Shapes/b2CircleShape.h>
#include <Box2D/Collision/Shapes/b2EdgeShape.h>
#include <Box2D/Collision/Shapes/b2PolygonShape.h>
// Compute contact points for edge versus circle.
// This accounts for edge connectivity.
void b2CollideEdgeAndCircle(b2Manifold*... | ALGO | 0.999635 | 7.537254 |
e9892a1a-3733-4049-897a-a4a16742648e | rahulvarma5297/TUF-Tree-Graph-DP | 1_Tree/1. Binary Trees/Part-3 Hard Problems/L33 Requirements to construct a Unique BT _ Theory/Unique-Binary-Tree-Requirements.cpp | //* https://practice.geeksforgeeks.org/problems/unique-binary-tree-requirements/1?utm_source=youtube&utm_medium=collab_striver_ytdescription&utm_campaign=unique-binary-tree-requirements
//* https://youtu.be/9GMECGQgWrQ
class Solution
{
public:
bool isPossible(int a,int b)
{
//code here
... | ALGO | 0.999168 | 5.05016 |
3a195fcf-0452-4f6f-9c28-fa827d27f18a | ishandutta2007/codeforces | ei133333/normal/1406/D.cpp | #include<bits/stdc++.h>
using namespace std;
using int64 = long long;
const int mod = 1e9 + 7;
// const int mod = 998244353;
const int64 infll = (1LL << 62) - 1;
const int inf = (1 << 30) - 1;
struct IoSetup {
IoSetup() {
cin.tie(nullptr);
ios::sync_with_stdio(false);
cout << fixed << setprecision(10)... | ALGO | 0.999946 | 5.186729 |
37e7eca2-5b6e-4f6b-98e7-c06a1e6a51a6 | theanxiuser/Data-Structures | tower_of_hanoi.cpp | // Solving Tower Of Hanoi problem
#include<iostream>
using std::cout;
using std::cin;
using std::endl;
static int count=1;
// TOH recursive solution definition
void TOH(int n, char source, char destination, char auxilary){
// If only one peg/disk in source, move it to destination
if(n == 1){
cout<<cou... | ALGO | 0.999983 | 5.892385 |
a4d26b9e-34be-4685-9342-c4cdb89775b2 | JustAG7/Competitive_Programming | Codeforces/Rounds/909/B.cpp | #include<bits/stdc++.h>
using namespace std;
#define fast ios_base::sync_with_stdio(false);cout.tie(NULL);cin.tie(NULL);
#define ll long long
#define pb push_back
#define pf push_front
#define db double
#define X first
#define Y second
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define... | ALGO | 0.999627 | 4.310395 |
afec1dc5-2106-4fdc-8641-ba66a46f1747 | Ramzi-Sah/Game-Engine-2 | dependencies/bullet3/test/collision/main.cpp | ///Original author: Erwin Coumans, October 2014
///Initial version of this low-level GJK/EPA/MPR convex-convex collision test
///You can provide your own support function in combination with the template functions
///See btComputeGjkEpaSphereSphereCollision below for an example
///Todo: the test needs proper coverage a... | TEST | 0.954984 | 6.805076 |
fd322572-3297-4715-ac49-36a889c59441 | JimmieKJ/unrealCode | UnrealEngineGitHub/Engine/Source/ThirdParty/PhysX/PhysX_3.4/Source/LowLevelParticles/src/PtCollisionSphere.cpp | #include "PtCollisionMethods.h"
#if PX_USE_PARTICLE_SYSTEM_API
using namespace physx;
using namespace Pt;
namespace
{
void collideWithSphereNonContinuous(ParticleCollData& collData, const PxVec3& pos, const PxReal& radius,
const PxReal& proxRadius)
{
if(collData.localFlags & Part... | ALGO | 0.972691 | 6.960886 |
cb2f00e1-15ab-4fb4-99bc-368cc0d4e36b | hetit15/TOPS-Data | SE_TOPS/ASSIGNMENT/logic_programs_c/string program/8.cpp | #include <stdio.h>
#include <ctype.h>
int main() {
char str[1000];
int vowels = 0, consonants = 0, i = 0;
printf("Enter a string: ");
scanf("%[^\n]", str);
while (str[i] != '\0') {
char ch = tolower(str[i]);
if (ch >= 'a' && ch <= 'z') {
if (ch ... | ALGO | 0.998302 | 5.370831 |
f6a8c261-4077-4b73-88fc-1627175ecca6 | toutounchi/Good-Fences- | drawingio.cpp | /**
* @file drawingio.cpp
* @description Implementation of methods used for file IO and drawing on PNG images
*
* @author CPSC 221: Basic Algorithms and Data Structures
*
* THIS FILE WILL NOT BE SUBMITTED
**/
#include <cmath>
#include <iostream>
#include <fstream>
#include "drawingio.h"
/**
* Draw... | TOOL | 0.951278 | 5.307528 |
c4c3d1b0-d22a-4ed1-abdf-421d20c9388e | Zia6/Acm | onlineJudge/UVA/dp/1395.cpp | #include <iostream>
#include <vector>
#include <cstring>
#include <algorithm>
using namespace std;
const int maxn = 105;
struct edge
{
int u, v, w;
bool operator<(const edge &e) const
{
return w < e.w;
}
};
int fa[maxn], vis[maxn];
int find(int x) { return fa[x] == x ? x : fa[x] = find(fa[x]); }... | ALGO | 0.999982 | 4.441626 |
c12f2615-7acf-4f6c-86e9-566a66f7ad89 | Dineshjat1106/cpp-full-course | heaps-36/kth-largest-element-4.cpp | #include<iostream>
#include<queue>
using namespace std;
int main(){
int arr[]={10,2,-4,5,18,24,1,-7,56};
int k=3;
int n=9;
priority_queue<int,vector<int>,greater<int>> pq;
for(int i=0;i<n;i++){
pq.push(arr[i]);
if(pq.size()>k) pq.pop();
}
cout<<pq.top();
} | ALGO | 0.999835 | 3.606679 |
326cd685-e8e7-4468-bce4-024daadfcfbf | garc97/expense_tracker_fiap-3SIR | 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.9988 | 6.76073 |
ce014cfe-52a4-4fa9-bf61-c22ab0ca51a3 | dhawalmahajan/CPP-DSA-Practice | Graphs/bellman-ford-shorest-distance.cpp | /*
Given an weighted graph with V vertices numbered from 0 to V-1 and E edges,
represented by a 2d array edges[][], where edges[i] = [u, v, w] represents a
direct edge from node u to v having w edge weight. You are also given a source
vertex src.
Your task is to compute the shortest distances from the source to all ot... | ALGO | 0.999996 | 6.141694 |
39dbfb55-e409-4ecd-9053-64228464716d | Chun-Bae/Baekjoon | 2309_일곱 난쟁이(2).cpp | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
vector<int> search(vector<int> d, int s) {
vector<int> ans;
for (int i = 0; i < 9; i++) {
for (int j = i + 1; j < 9; j++) {
if (d[i] + d[j] == s - 100) {
ans.push_back(d[i]);
ans... | ALGO | 0.999884 | 3.882083 |
4808c078-de47-4f2d-b904-4d79bbd1de29 | lovelybigduck/note | 代码练习/刷题/PTA 估值一亿的AI核心代码 .cpp | //PTA ֵһڵAIĴ
#include <bits/stdc++.h>
using namespace std;
int n;
bool ok(string a,int i,int p){
if(i-1>=0)
return !isalpha(a[i+p])&&!isdigit(a[i+p])&&!isalpha(a[i-1])&&!isdigit(a[i-1]);
else return !isalpha(a[i+p])&&!isdigit(a[i+p]);
}
int main(){
cin>>n;
getchar();
while(n--){
string a;
getline(cin,a);
... | ALGO | 0.999238 | 4.55993 |
0831afcc-781c-4c38-a1e6-dd4462cb76f4 | KazukiIhara/MAGI | Project/Engine/Includes/MAGIUitility/MAGIUtility.cpp | #include "MAGIUtility.h"
#include <cassert>
using namespace MAGIMath;
Vector3 MAGIUtility::CalculateVelue(const std::vector<KeyframeVector3>& keyframes, float time) {
assert(!keyframes.empty());
if (keyframes.size() == 1 || time <= keyframes[0].time) {
return keyframes[0].value;
}
for (size_t index = 0; inde... | ALGO | 0.998646 | 5.792763 |
5b94d0d2-e4ae-4fc3-841b-534969729b10 | Suman2708/Delhi-Metro2 | Graph_M$Vertex.cpp | #include <unordered_map>
#include <string>
class Vertex {
public:
std::unordered_map<std::string, int> nbrs; // Neighbors with their associated weights
// Constructor
Vertex() {}
};
| ALGO | 0.982722 | 5.015213 |
38937759-bc68-4539-9077-50ff5bdcea65 | gitHubwhl562916378/opencv4.3 | opencv_contrib-4.3.0/modules/face/src/bif.cpp | /*
This file contains implementation of the bio-inspired features (BIF) approach
for computing image descriptors, applicable for human age estimation. For more
details we refer to [1,2].
REFERENCES
[1] Guo, Guodong, et al. "Human age estimation using bio-inspired features."
Computer Vision and Pattern Recognit... | ALGO | 0.993803 | 6.450288 |
6b37d174-c0b6-4641-bb43-c65104b84906 | VictorL000/CompetitiveProgrammingSolutions | ccc18s3.cpp | #include <bits/stdc++.h>
using namespace std;
int N, M, sr, sc;
int board[1003][1003], vis[1003][1003], tob[103][103];
bool shouldQ(int r, int c, int s){
int atb = board[r][c];
int atv = vis[r][c];
if(atb == 9 || atb == 10)
return false;
if(atv <= s && atv != 0)
return false;
if(tob[r][c] <= s && tob[r][c] !... | ALGO | 0.99968 | 3.686743 |
ad429da8-e322-4b05-aae2-0e1eec56af2c | Srivastava/Hello-World | CodeForces/370Div2/A.cpp | #include <iostream>
#include <vector>
#include <cmath>
#include <stdio.h>
#include <algorithm>
#include <iterator>
#include <climits>
#include <numeric>
#include <queue>
typedef long long ll;
typedef unsigned long long ull;
const ll MOD = 1000000007;
typedef std::vector<ll> vll;
typedef std::vector<ull> vull;
typed... | ALGO | 0.999945 | 3.489211 |
f15bc6fc-6bb8-4beb-b01f-c3f56b19c188 | osom8979/external | opencv-4.1.0/modules/features2d/src/kaze/fed.cpp | /**
* @file fed.cpp
* @brief Functions for performing Fast Explicit Diffusion and building the
* nonlinear scale space
* @date Sep 15, 2013
* @author Pablo F. Alcantarilla, Jesus Nuevo
* @note This code is derived from FED/FJ library from Grewenig et al.,
* The FED/FJ library allows solving more advanced problem... | ALGO | 0.999832 | 5.226607 |
b003f5f3-b6a7-446d-a0f3-a451bf9b04de | rickycaron/2020.12.MediaProcessing_MazeGame | TASKB/taskb/pathfinder.cpp | #include "pathfinder.h"
Pathfinder::Pathfinder(int row, int column, std::vector<std::shared_ptr<Tile>> newtiles)
{
this->row=row;
this->column=column;
tiles=newtiles;
Point startponit=Point();
Point endponit=Point();
currentNode=std::make_shared<Node>();
successorNode=currentNode;
rootN... | ALGO | 0.999544 | 3.759451 |
6c73a407-ff3d-4a88-9dbb-49087aea2312 | sunilsy08/leetcode-submissions | 1014-k-closest-points-to-origin/1014-k-closest-points-to-origin.cpp | class comp{
public:
bool operator()(pair<int,int>p1, pair<int,int>p2){
long long dist1 = p1.first*p1.first + p1.second*p1.second;
long long dist2 = p2.first*p2.first + p2.second*p2.second;
return dist1 < dist2;
}
};
class Solution {
public:
vector<vector<int>> kClosest(vector<vector<... | ALGO | 1 | 5.793722 |
63de9bf9-9cb1-48ab-98ae-15f40d2366cb | nassermohamedit/competitive-programming | compositions/itholic-2022/problem_C/Solution_C.cpp | /*
problem: Agonistic Interaction
Author: Mohamed Nasser
*/
#include<iostream>
#include<bits/stdc++.h>
using namespace std;
long double Q(int x, int y, int z) {
long double res = 1.0*(x*y + x*z + y*z);
return res;
}
int a, b, c;
long double p, q, r;
vector<vector<vector<long double>>> proba(107,
vector... | ALGO | 0.999655 | 3.590024 |
d40dcaab-b99c-4a19-bdac-171680d4b2dd | pks2277/DSA | DSA_Problems/Arrays/RangeSumofSortedSubArray_1508.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int rangeSum(vector<int>& nums, int n, int left, int right) {
vector<int> subarraySums;
// Compute all subarray sums
for(int i = 0; i < n; i++) {
int currentSum = 0;
for(int j = i; j < n; j++) {
... | ALGO | 0.999991 | 6.236678 |
950b8b2a-4818-4b8c-9b68-85f87abb9013 | bisasamii/Spotty | old-archive/MASTER_CODE_FINAL/MyLeg.cpp | #include "MyLeg.h"
#include "globals.h"
#define square(x) x*x
MyLeg::MyLeg(bool left, bool front)
{
mFront = front;
mLeft = left;
}
void MyLeg::setName(const char * name)
{
mName = new char[strlen(name) + 1];
strcpy(mName, name);
mTibia.setName(mName,"Tibia");
mFemur.setName(mName,"Femur");
mCoax.set... | TOOL | 0.937553 | 3.443623 |
115d1135-5d01-4967-923e-1cdedc21f6c4 | a1846342933/px4framework | src/lib/pid/pid.cpp | /**
* @file pid.c
*
* Implementation of generic PID controller.
*
* @author Laurens Mackay <<EMAIL>>
* @author Tobias Naegeli <<EMAIL>>
* @author Martin Rutschmann <<EMAIL>>
* @author Anton Babushkin <<EMAIL>>
* @author Julian Oes <<EMAIL>>
*/
#include "pid.h"
#include <math.h>
#include <px4_platform_common/... | ALGO | 0.998212 | 6.514546 |
0f1852d7-047a-4817-935b-d397d42b6cc9 | bakashigure/my_leetcode_solutions | 1189. “气球” 的最大数量.cpp | //
// Created by bakashigure on 2/13/2022.
//
#if 0
#include <bits/stdc++.h>
#define ll long long
#define INF 0x3f3f3f3f
#define MOD 1e9+7
#define EXP 1e-8
#define debug(a) cout<<#a<<"- "<<a<<endl;
#define lowbit(x) (x&-x)
#define v2(m, n) vector<vector<int>>(m,vector<int>(n))
#define pii pair<int,int>
#define pll pa... | ALGO | 0.999611 | 4.465462 |
c0a4e1b8-d87e-437f-bc02-c0ba535f5af3 | VecoMr/competitive_programming | beecrowd/paradigms/How Many Calls?.cpp | #include <iostream>
#include <vector>
int main(void) {
long long a = 0;
long long b = 0;
std::cin >> a >> b;
long long ind = 1;
while (a || b) {
std::vector<long long> dp(a+1, 0);
for (long long i = 2; i < a+1; i++) {
dp[i] = (dp[i-1]+dp[i-2]+2)%b;
}
std:... | ALGO | 0.999828 | 4.111061 |
12c6ca07-c119-4702-a3f8-0377d85ae8a4 | TarekRakib89/flutterapp | flutterapp/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.998383 | 6.785645 |
ad7a2367-3661-416b-aad5-06b36a22cdea | Oein/PS | acmicpc/1___/16__/167_/1676/1676.cpp | #include<bits/stdc++.h>
using namespace std;
int n,cnt1=0,cnt2=0;
int main(){
scanf("%d",&n);
for(int i=1;i<=n;i++){
int x=i;
while(x%2==0)x/=2,cnt1++;
while(x%5==0)x/=5,cnt2++;
}
printf("%d",min(cnt1,cnt2));
} | ALGO | 0.999914 | 4.313842 |
1fcc61aa-8771-4bf2-b5ed-027c29529cfb | Alraaafi/MY_BASIC_DSA_Practice | lab practice/5 Araay oparation.cpp | #include<bits/stdc++.h>
using namespace std;
#define mx 5
int A[mx];
int len = 0;
void dis()
{
for(int i=0; i<len; i++)
cout<<A[i]<<" ";
cout<<endl;
}
void appned(int x)
{
if(len==mx)
{
cout<<"FULL"<<endl;
return;
}
A[len] = x;
len++;
}
int leng()
{
return le... | ALGO | 0.996706 | 3.589599 |
f35f951b-8391-4e3d-91ae-f077ab8f1e48 | ParasAnxi/LeetCode-CPP | Q0101-0200/142.Linked_List_Cycle_II.cpp | class Solution {
public:
ListNode *detectCycle(ListNode *head) {
ListNode *fast = head;
ListNode *slow = head;
while(fast != nullptr && fast->next != nullptr) {
fast = fast->next->next;
slow = slow->next;
if (fast == slow) {
slow = head;
... | ALGO | 0.99978 | 5.901001 |
75a3baa6-16d3-48fc-8d79-bf6d30f3563e | csienslab/icLibFuzzer | llvm/lib/Analysis/LegacyDivergenceAnalysis.cpp | #include "llvm/Analysis/LegacyDivergenceAnalysis.h"
#include "llvm/ADT/PostOrderIterator.h"
#include "llvm/Analysis/CFG.h"
#include "llvm/Analysis/DivergenceAnalysis.h"
#include "llvm/Analysis/Passes.h"
#include "llvm/Analysis/PostDominators.h"
#include "llvm/Analysis/TargetTransformInfo.h"
#include "llvm/IR/Dominators... | ALGO | 0.920629 | 7.924693 |
9b8b6a27-c7ac-4871-ba9d-7837cf40af91 | omrajhalwa/Cpp-CodeforcesQsoln | replacewithminimum.cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
int t;
cin>>t;
while(t--){
int n,k;
cin>>n>>k;
string s="";
cin>>s;
vector<int>hash(29,-1);
char ch='a',ph='1';
for(int i=0;i<n;i++){
if(ch>s[i]) continue;
if(k>=s[i]-ch){
k-=s[i]-ch;
if(ch<s[i]){
... | ALGO | 0.99997 | 3.813798 |
f14a8be4-d2a5-422d-9266-6a76c7e60bb3 | ishandutta2007/codeforces | mustang98/normal/1055/B.cpp | #include <bits/stdc++.h>
#define F first
#define S second
#define prev azaza
#define MP make_pair
#define PB push_back
using namespace std;
typedef long long ll;
typedef long double ld;
const int max_n = 200111, inf = 1000111222;
int n, q;
ll m[max_n];
ll l;
int ans = 0;
void proc(int ind, int d) {
if (m[ind] ... | ALGO | 0.999938 | 3.683499 |
42a71b7b-23db-478d-8705-db348a2bb14e | LowPolyCount/LowPolyCount-Raytracer | lib/boost_1_57_0/libs/geometry/example/c10_custom_cs_example.cpp | // Boost.Geometry (aka GGL, Generic Geometry Library)
#include <iostream>
#include <boost/geometry/geometry.hpp>
#ifdef OPTIONALLY_ELLIPSOIDAL // see below
#include <boost/geometry/extensions/gis/geographic/strategies/andoyer.hpp>
#endif
// 1: declare a coordinate system. For example for Mars
// Like for the Ea... | ALGO | 0.995407 | 7.840961 |
d70882b8-b461-41d6-a38d-74348df2b379 | shivansh2502/Competitive-Programming | Codeforces/Weeklycontest1/YetAnotherArrayPartitioningTask.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
ll n,m,k;
cin>>n>>m>>k;
ll a[n];
for(ll i=0;i<n;i++){
cin>>a[i];
}
ll total_max=-1;
ll extraelement=-1;
for(ll i=0;i<k;i++){
ll current_m... | ALGO | 0.999982 | 3.351421 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.