uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
10bf4d96-e7dd-4e5b-9fc8-3d09de476297 | Nikitasobakabmx/LabkiRubishC-C- | LabaGleb/LabaFive/Vlad.cpp | // ConsoleApplication2.cpp : Defines the entry point for the console application.
//
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>
#define __MATRIX__
typedef struct {
//количество строк в массиве с данными
unsigned int m;
//количество столбцов в массиве с данными
unsigned int n;
//ссылка на ма... | ALGO | 0.968165 | 3.081182 |
c7031082-81f0-4d4a-8825-292b59b57f80 | CTranLam/DSA-28tech | CVC- day con co tong lon nhat.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll crossing_sum(int a[],int l,int m,int r){
ll sumr=0,max_sumr=0;// ktao max=0 de k nhan gia tri am
ll suml=0,max_suml=0;
// crossing sum la tong gia nen i phai chay tu m nguoc ve 2 ben de dam bao tinh lien tuc
for(int i=m ; i>=l ; i--){
suml+=a[... | ALGO | 0.999994 | 4.534138 |
062a9007-6219-424c-b069-e9fe525ead6f | st091150/ParallelProg | openMP_1/openMP_1.cpp | #include <iostream>
#include <omp.h>
#define ull unsigned long long
int main()
{
ull N = 1e6;
double x, sum, startPoint, endPoint, avgTime = 0;
unsigned sup = 5;
omp_set_num_threads(4);
std::cout.precision(10);
for (int i = 0; i < sup; ++i)
{
sum = 0;
startPoint = omp_get... | ALGO | 0.999853 | 4.6716 |
85e77641-a316-4cea-b6ef-9d152168d0a0 | Shivam256/leetcode | easy/moveZeros.cpp | // #include <bits/stdc++.h>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <queue>
#include <deque>
#include <bitset>
#include <iterator>
#include <list>
#include <stack>
#include <map>
#include <set>
#include <functional>
#include <numeric>
#include <utility>
#... | ALGO | 0.999843 | 4.221834 |
dfc23d78-139a-4f85-82f7-0976b9826ab6 | gp1313/eigen | bench/benchFFT.cpp | #include <iostream>
#include <bench/BenchUtil.h>
#include <complex>
#include <vector>
#include <Eigen/Core>
#include <unsupported/Eigen/FFT>
using namespace Eigen;
using namespace std;
template <typename T>
string nameof();
template <> string nameof<float>() {return "float";}
template <> string nameof<double>() {r... | TEST | 0.867182 | 6.398832 |
fc011031-1107-4d84-a01a-0448d56a7ae7 | Reveroftrillion/BOJ | BOJ/1966/Main.cpp | #include <iostream>
#include <deque>
#include <algorithm>
using namespace std;
int main()
{
int t;
cin >> t;
for (int i = 0; i < t; i++)
{
int a, b;
cin >> a >> b;
deque<int> printer;
deque<int> original; // 원래 위치 저장해두기.
for (int j = 0; j < a; j++)
{
... | ALGO | 0.999807 | 3.816147 |
938a2862-d9a6-4b6d-9837-d004340cc696 | saurabh8434/-CrackYourPlacement | linked list/remove_duplicate_form_sorted_list.cpp | #include<bits/stdc++.h>
using namespace std;
/**
* 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) {}
* };
*/
clas... | ALGO | 0.999961 | 5.331225 |
80e2ac67-7503-4d49-aae1-83000de2eef8 | Aakash7838/cpp-dsa | Array/SumOfArray.cpp | #include<iostream>
using namespace std;
int main() {
int x[] = {1,2,3,4,5};
int n = sizeof(x)/4;
int sum = 0;
for(int i = 0; i<n; i++){
sum += x[i];
}
cout<<sum;
} | ALGO | 0.998391 | 3.458975 |
df3fa924-cea1-4156-a070-e1ba4b58c1c6 | ketkat-maker/Some-Problems | MAX.cpp | #include<iostream>
using namespace std;
int main()
{
int n;
cin>>n;
long max=0;
long current;
for (long i = 0; i < n; i++)
{
cin>>current;
if (current>max)
{
max=current;
}
}
cout<<max;
// int x;
// cin>>x;
// int n[1000] ;
... | ALGO | 0.999764 | 3.707731 |
e7902881-03fe-41fa-b192-711382787094 | Shulvury/Graph-coloring-algorithms | SA/Graph.cpp | #include "Graph.h"
#include <fstream>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <iostream>
#include <random>
using namespace std;
Graph::Graph() {
matrix = NULL;
n = 0;
nbEdges = 0;
}
Graph::Graph(int m) {
matrix = NULL;
resize(m);
}
int* Graph::operator[](int index) {
if (index < 0 ... | ALGO | 0.910004 | 3.776568 |
298bf0e2-345e-4354-9bad-ab89a5964cfb | rsmnnit/Codes | chefd.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define sf(i) scanf("%lld",&i)
#define sfd(a,b) scanf("%lld%lld",&a,&b)
#define pf(a) printf("%lld\n",a)
#define f(i,a,b) for(i=a;i<b;i++)
int main()
{
ll m,n,q,l,r,a[100002],i,j,k;
set<ll>st[6];
set<ll>::iterator it,lo,up;
sf(n);
f(i,0,n){
sf(k);... | ALGO | 0.999957 | 3.12609 |
18d2c48d-1764-470a-9139-019a57636bfa | capnmav77/Core-Programming | Generic Prog/Unit-01/Anand Ms slides and Programs/programs unit 1/calculator.cpp | #include <iostream>
using namespace std;
template <class T>
class Calculator
{
private:
T num1, num2;
public:
Calculator(T n1, T n2) {
num1 = n1;
num2 = n2;
}
void displayResult() {
cout << "Numbers: " << num1 << " and " << num2 << "." << endl;
cout << num1 << "... | TOOL | 0.855664 | 6.562293 |
02a7e6d2-d6f2-43c3-8b63-8b6cf8152633 | albertvo18/P10_Model_Predictive_Control | src/Eigen-3.3/bench/product_threshold.cpp |
#include <iostream>
#include <Eigen/Core>
#include <bench/BenchTimer.h>
using namespace Eigen;
using namespace std;
#define END 9
template<int S> struct map_size { enum { ret = S }; };
template<> struct map_size<10> { enum { ret = 20 }; };
template<> struct map_size<11> { enum { ret = 50 }; };
template<> struct ... | TOOL | 0.951104 | 5.099652 |
58cd1547-e5a8-4454-85e0-e3fe6cc7a040 | victorliking/Dream | DP/House Robber2.cpp | /*
After robbing those houses on that street, the thief has found himself a
new place for his thievery so that he will not get too much attention.
This time, all houses at this place are arranged in a circle.
That means the first house is the neighbor of the last one. Meanwhile,
the security system for these houses... | ALGO | 0.999977 | 5.514327 |
45225572-6e1c-46e0-9966-8e6ab7e7694a | JKolios/RayTetra | RayTetra/RayTetraSegura.cpp | #include "../Common/NpVector.hpp"
#include "../Common/NpUtil.h"
#include "../Common/NpPluecker.hpp"
// Ray-Triangle intersection using Segura's algorithm
bool RayTetraSegura0(
const NpVector& orig, const NpVector& dir,
const NpVector vert[],
int& enterFace, int& leaveFace,
NpVector& enterPoint, NpVect... | ALGO | 0.999868 | 6.566472 |
0744db4e-8509-4fc7-bd77-4f2b7123077f | alexeydergunov/cses-solutions | solved/1634_Minimizing_Coins.cpp | #include <bits/stdc++.h>
using namespace std;
#define all(v) (v).begin(),(v).end()
#define sz(v) ((int)((v).size()))
typedef long long ll;
typedef long double ld;
typedef pair<int, int> ii;
const int INF = int(1e9);
int main() {
ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
cout.precision(... | ALGO | 0.999949 | 4.192385 |
2cbb9dd7-c31e-48f0-b8ea-cdab848ab4e2 | dimensionofficial/Dimension-E | contracts/libc++/upstream/test/std/algorithms/alg.sorting/alg.sort/partial.sort.copy/partial_sort_copy.pass.cpp | // <algorithm>
// template<InputIterator InIter, RandomAccessIterator RAIter>
// requires ShuffleIterator<RAIter>
// && OutputIterator<RAIter, InIter::reference>
// && HasLess<InIter::value_type, RAIter::value_type>
// && LessThanComparable<RAIter::value_type>
// RAIter
// partial_sort_co... | TEST | 0.999367 | 6.557145 |
c206825f-09d9-4699-86a8-cce55b68496b | Sirisha-t/MetaAssembler | src/unionFind.cpp | # include "unionFind.hpp"
void DisjointSet::deleteNode()
{
std::unordered_map<node*, int> book;
for(auto x : entry)
{
node* this_node = x.second;
book[this_node] = 0;
while(this_node->parent != this_node)
{
this_node = this_node->parent;
book[this_node] = 0;
}
}
for(auto x : bo... | ALGO | 0.996572 | 4.391058 |
dd047e4d-067c-4d74-8891-c6d42a21c4d5 | priyanshsingh/Cpp-learning | Fundamentals/arrays_operations.cpp | #include <iostream>
using namespace std;
int main()
{
int add[5];
int sum = 0;
cout << "Enter 5 numbers = ";
for (int i = 0; i < 5; i++)
{
cin >> add[i];
}
cout << endl;
cout << "Your number is ==> ";
for (int i = 0; i < 5; i++)
{
sum += add[i];
}
co... | ALGO | 0.995731 | 3.638317 |
32ee135e-f808-42b3-9dd1-4a6be87f8ddd | Abhishek-M-K/DSA-Notes | RotatedArray.cpp | //////////////////////////////////////__189__LEETCODE////////////////////////////////////
// Q. Rotate an Array by kth steps.
// MEDIUM
// class Solution {
// public:
// void rotate(vector<int>& nums, int k) {
// vector<int> temp(nums.size());
// for(int i=0;i<nums.size();i++){
// temp... | ALGO | 0.999968 | 6.10074 |
6471d5ff-982e-47e5-b65e-2a019232888c | Rayeesgithub/DSA_365_Challenges | Binary-Search/Allocate Minimum Pages.cpp | https://www.geeksforgeeks.org/problems/allocate-minimum-number-of-pages0937/1
// striver file
// broute force
int pagecount(int n,int arr[],int pages){
int pagesum=0; int student=1;
for(int i=0; i<n; i++){
if(pagesum+arr[i]<=pages){
pagesum+=arr[i];
}
... | ALGO | 0.999938 | 5.957922 |
0debcb9b-710a-4bf3-b704-f7c187e47e73 | statco19/BOJ-problems | 9935.cpp | #include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define ioa insert_or_assign
#define umap unordered_map
using namespace std;
typedef pair<int,int> pii;
typedef vector<int> vint;
const int INF = 0x3f3f3f3f; const int mINF = 0xc0c0c0c0;
const ll LINF = 0x3f3f3f3f3f3f3f3f; const ll mLINF = 0xc0c0c0c0c0... | ALGO | 0.99985 | 3.619724 |
7e738b15-e84e-4633-bad2-9918bd24ac8f | ishtian-revee/Different-Types-of-Sorting-Algorithms | Source Codes/Merge sort.cpp | #include<iostream>
#include<stdlib.h>
using namespace std;
void mergeSort( int *a , int n );
void merge( int *l , int *r , int *a , int nL , int nR );
int main()
{
int arr[10000] , n;
cout << endl << "Enter the size of the array : ";
cin >> n;
cout << endl << "Enter the elements of the array : ";
... | ALGO | 0.999983 | 4.242689 |
43368d44-c962-4701-a48b-f033d9743c00 | lega4e/olp | mai/ex/08.DP-2/C.Шанс на успех/main.cpp | #include <iostream>
#include <vector>
using namespace std;
// types
typedef long long llong;
// objects
int n;
int *rows, *cols;
vector<vector<llong>> memo;
// function
llong dp(int l, int r)
{
if(l == r)
return 0;
if(memo[l][r] >= 0)
return memo[l][r];
llong res = dp(l+1, r) + rows[l]*cols[r]*cols[l];
fo... | ALGO | 0.999758 | 3.855288 |
5c6bc52f-198e-40d3-8160-5bed2d602a6f | SuperDonutsGirl/ModulesCPP | CPP_08/ex01/Span.cpp | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* Span.cpp :+: :+: :+: ... | ALGO | 0.983639 | 4.773044 |
fb9963da-c1e2-4a04-a5bb-a505274f37e5 | gyubeomim/lockdpwn | cpp/1books/brain_STL/book_codes/03/ex03-04.cpp | #include <iostream>
#include <algorithm> // fo_each() ˰() ϱ
using namespace std;
/////// Ŭ̾Ʈ /////////
struct Functor1
{
void operator()(int n) // ̿Ͽ Ҹ
{
cout << n <<' ';
}
};
struct Functor2
{
void operator()(int n) // Ҹ Ͽ
{
cout << n*n <<" ";
}
};
struct Functor3
{
vo... | ALGO | 0.95031 | 4.103695 |
7106bcec-f0a2-4019-b0da-a91e2a8fad41 | firelab/behave | src/behave/crown.cpp | #include "crown.h"
#include <cmath>
#include "fuelModels.h"
#include "windSpeedUtility.h"
Crown::Crown(FuelModels& fuelModels)
: surfaceFuel_(fuelModels), crownFuel_(fuelModels)
{
fuelModels_ = &fuelModels;
initializeMembers();
}
Crown::~Crown()
{
}
Crown::Crown(const Crown& rhs)
: surfaceFuel_(*rh... | ALGO | 0.952384 | 6.876554 |
37a4b85f-f39c-45b8-8833-46db9860c816 | ved015/Codeforces-solution | perpendicularsegments.cpp | // #include<bits/stdc++.h>
#include<iostream>
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<string>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<long long> vll;
typedef vector<vector<ll> > vvll;
#def... | ALGO | 0.999681 | 3.638371 |
ed6354bc-6a0b-4d17-b5cf-3939bd245e91 | Khoury-srg/Viper | resources/z3/src/muz/spacer/spacer_pdr.cpp | #include "muz/spacer/spacer_pdr.h"
#include "muz/base/dl_context.h"
#include "muz/spacer/spacer_mbc.h"
namespace spacer {
model_node::model_node(model_node* parent, class pob *pob):
m_pob(pob), m_parent(parent), m_next(nullptr), m_prev(nullptr),
m_orig_level(m_pob->level()), m_depth(0),
m_closed(false) {
... | ALGO | 0.998935 | 5.7315 |
b510678d-09d1-4f43-9bb8-807f59acec87 | hemantsingh0557/My-Leetcode-Solutions | 0238-product-of-array-except-self/0238-product-of-array-except-self.cpp |
// class Solution {
// public:
// vector<int> productExceptSelf(vector<int>& nums) {
// }
// };
// //
// // // // // // // Solve Using Two Method ===>
// // // // // // // Solve Using Two Method ===>
// //
// //
// // /... | ALGO | 0.99996 | 6.511997 |
5a81dbb3-2f72-4db3-afad-3c7a6a66beb8 | yuxin4667/CPE_1star | 39_Fourth Point!!.cpp | #include <iostream>
#include <iomanip>
using namespace std;
int main()
{
double p1x, p2x, p3x, p4x, p1y, p2y, p3y, p4y;
while(cin >> p1x >> p1y >> p2x >> p2y >> p3x >> p3y>> p4x >> p4y)
{
double x, y;
if(p2x==p3x && p2y==p3y)
{
x=p1x+p4x-p3x;
y=p1y+p4y-p3y;
}
if(p2x==p4x && p2y==p4y)
{
x=p1x+p3x... | ALGO | 0.999708 | 3.385345 |
f5803d3a-86ca-4e77-b370-a9dede2e8863 | marciomdsj/JornadaIniciacao | SolucoesProblemas/ProblemasOBI/copa.cpp | #include<stdio.h>
int main(void){
int k, l;
scanf("%d %d", &k, &l);
if(k <= 8 && l >= 9 || l <= 8 && k >= 9){
printf("final");
}
else if(k <= 4 && l >= 5 || l <= 4 && k >= 5 || k <= 12 && l >= 13 || l <= 12 && k >= 13 ){
printf("semifinal");
}
else if(k <= 2 && l >= 3 || l <... | ALGO | 0.999912 | 3.514264 |
aafa4341-483a-41c1-bb64-a67988608300 | AarinGuleria/Cpp_codes | TakeuForward/Solve Problems On Arrays/Easy/Check_if_an_Array_is_Sorted.cpp | //Problem Statement: Given an array of size n, write a program to check if the given array is sorted in (ascending / Increasing / Non-decreasing) order or not. If the array is sorted then return True, Else return False.
// Brute Force Approach
// Algorithm / Intuition
// Approach: Brute Force
// The idea is pretty sim... | ALGO | 0.999991 | 5.966968 |
e7dfc182-2c79-48ec-8ac7-64c0a6720b53 | Whatisloovee/2-sem | Лабораторные_работы/АСД/Лабораторная работа 3/lab03/lab03/Source.cpp | #include <iostream>
#include <ctime>
using namespace std;
void fastSort(int* numbers, int left, int right);
int main() {
setlocale(0, "");
srand(time(0));
int n;
cout << " , : ";
cin >> n;
int* dinamich_array = new int[n];//
for (int i = 0; i < n; i++) {
dinamich_array[i... | ALGO | 0.999724 | 4.07379 |
5e2e4df3-33fe-40dc-a422-3bfce8f28afe | py3-coder/Hacktober_Repo_22 | CPP/DeleteAtEnd.cpp | #include <iostream>
using namespace std;
struct node {
int num;
struct node * next;
}*head;
void deleteEnd()//fuction to delete last node from the circular linked list
{
struct node *cur,*prev;
cur=head;
while(cur->next!=head)
{
prev=cur;
cur=cur->next;
}
prev->next=head;
free(cur);
}
... | ALGO | 0.999839 | 4.096011 |
475df86e-eb0f-4d5b-a4e6-d757aebc2bd0 | samgd/advent_of_code_2020 | day_5/solution.cpp | #include <algorithm>
#include <fstream>
#include <iostream>
#include <numeric>
#include <string>
#include <vector>
using std::ifstream;
using std::sort;
using std::string;
using std::vector;
int main()
{
ifstream data{"input.txt"};
string line;
vector<int> seat_ids;
// Seat IDs are binary numbers whe... | ALGO | 0.999517 | 5.769484 |
5f1caf89-2059-4a62-9898-49673e64abde | x-itg/Simple-Foc | Firmware/SimpleFoc/Core/SimpleFOC/common/base_classes/CurrentSense.cpp | #include "CurrentSense.h"
// get current magnitude
// - absolute - if no electrical_angle provided
// - signed - if angle provided
float CurrentSense::getDCCurrent(float motor_electrical_angle){
// read current phase currents
PhaseCurrent_s current = getPhaseCurrents();
// currnet sign - if motor... | TOOL | 0.939812 | 4.984929 |
760db20e-12b8-4bcd-92cc-54531027f8d2 | BatmanDevCode/Altis-Life-Resource-Hub-Framework | life_server/config.cpp | class DefaultEventhandlers;
class CfgPatches {
class life_server {
units[] = {"C_man_1"};
weapons[] = {};
requiredAddons[] = {"A3_Data_F","A3_Soft_F","A3_Soft_F_Offroad_01","A3_Characters_F"};
fileName = "life_server.pbo";
author = "Tonic";
};
};
class CfgFunctions {
... | TOOL | 0.859286 | 5.53053 |
eb6f0e1e-692b-4630-96a8-1d8c1938eba8 | taxijjang/algorithm | programmers - lv2 2.cpp | #include<iostream>
#include<string>
#include<set>
#include<vector>
using namespace std;
vector<int> solution(int n, vector<string> words) {
vector<int> answer;
set<string> ss;
int cnt = 0;
int lp = 0;
int size = words.size();
string f_s, s_s;
ss.insert(words[0]);
bool judge = false;
for (int i = 1; i < size; ... | ALGO | 0.999805 | 3.941169 |
db2dbc91-25db-4f83-a2aa-950daf294320 | rohit0809/Competitive-Programming | Dynamic Programming/Minimum steps to reach end.cpp | #include <bits/stdc++.h>
#define ll long long int
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define debug 0
using namespace std;
// O(n^2) DP Solution
int solve(int ar[], int n){
if(n==0 || ar[0]==0){
return INT_MAX;
}
int dp[n+1];
dp[0]=0;
for(int i=1;i<n;i++){
dp[... | ALGO | 0.99998 | 3.776455 |
f987f90a-1f0f-4a57-909c-cb7251e8cf8f | TRANMINHBIBO/DSA | ThuatToanSinhKeTiep/B19_XauNhiPhanDoiXung.cpp | #include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define fi first
#define se second
#define pb push_back
#define mpr make_pair
#define all(a) a.begin(),a.end()
#define ms(a,n) memset(a , n , sizeof(a))
#define FOR(i,a,b) for(int i = a ; i <= b ;i++)
#define RFOR(i,a,b) for(int i = b ; i >= a ; i--)
#def... | ALGO | 0.999993 | 4.368974 |
83770b14-8b18-4226-9881-88a281a23579 | qiaozishun4/CSP2024_BJ | BJ-Senior/answers/BJ-S01447/duel/duel.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=1e5+5;
int n;
int a[N],sum[N];
int main() {
freopen("duel.in","r",stdin);
freopen("duel.out","w",stdout);
ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
cin>>n;
for (int i=1; i<=n; i++) {
cin>>a[i];
sum[a[i]]++;
} int m=*max_... | ALGO | 0.999965 | 3.625669 |
579d6f83-d732-4dbf-86f8-102ef1b1517a | tempse/clusterReconstr_CBM-STS | langaufit.cpp | #include "langaufit.h"
TF1 *langaufit(TH1F *his, Double_t *fitrange, Double_t *startvalues, Double_t *parlimitslo, Double_t *parlimitshi, Double_t *fitparams, Double_t *fiterrors, Double_t *ChiSqr, Int_t *NDF)
{
// Once again, here are the Landau * Gaussian parameters:
// par[0]=Width (scale) parameter of Land... | ALGO | 0.953334 | 5.735532 |
3cc8365c-4629-4452-9b44-9f53ca981702 | cyber-titan/30daysofcode | 1/Geeks For Geeks Practice/Day 12/Insert in Middle of Linked List.cpp | Node* insertInMiddle(Node* head, int x)
{
// Code here
Node* n = new Node(x);
if(!head) return n;
Node* t = head;
int c = 0;
while(t){
c++; t = t->next;
}
t=head;
int half = c/2;
while(t){
c--;
if(half == c){
n->next = t->next;
t->next = n; break;
}
t = t->next;
}... | ALGO | 0.999895 | 5.343122 |
2078e40a-20d9-4820-a5e5-e69c9eb241ac | isaacteoh25/R_script | win-library/4.0/Rcpp/examples/ConvolveBenchmarks/convolve8_cpp.cpp | // -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*-
// this version is between the Rcpp_New_ptr and the Rcpp_New_std version
// test elapsed relative user.self sys.self
// 5 Rcpp_New_ptr(REPS, a, b) 0.214 1.000000 0.213 0.001
// 7 Rcpp_New_std_2(REPS, a, b) ... | ALGO | 0.980728 | 6.582818 |
33efe9c5-bd8d-4f76-966c-c939a6b54faa | itsmeankeet/SoftwareDesginArchitecture | dryPrincipleExample/withoutDryArea.cpp | #include <iostream>
using namespace std;
int main() {
// Calculate area of a rectangle
int length = 5, width = 10;
cout << "Area of rectangle: " << length * width << endl;
// Calculate area of a square
int side = 7;
cout << "Area of square: " << side * side << endl;
// Calculate area of a... | ALGO | 0.992 | 3.58007 |
d8a3988c-684d-42f7-b7c9-f36bb6c5100e | Jake1152/algorithm_study_since_16AUG21 | 2021-10-02/2616_이윤건_소형기관차.cpp | #include "bits/stdc++.h"
using namespace std;
int main()
{
ios_base::sync_with_stdio(0); cin.tie(0);
int N,K,arr[50000]={0},max_cus[4][50000]={0};
cin>>N;
for (int i = 0; i < N; i++) {
cin>>arr[i];
}
cin>>K;
int sum=0;
queue<int> Q;
for (int i = 0; i < N; i++) {
Q.... | ALGO | 0.999924 | 3.659094 |
eda1daa4-e897-4f98-bf3a-a1cf2c833c25 | charlottelg1/CPP | CPP08/ex01/Span.cpp | #include "Span.hpp"
// Constructors
Span::Span()
{
std::cout << "\e[0;33mDefault Constructor called of Span\e[0m" << std::endl;
}
Span::Span(unsigned int N)
{
std::cout << "\e[0;33mDefault Constructor called of Span\e[0m" << std::endl;
_N = N;
}
Span::Span(const Span ©)
{
(void) copy;
std::cout << "\e[0;33... | ALGO | 0.939227 | 4.484432 |
ca234fd4-9a29-4911-aed1-cfda09ee5413 | Sayak-Bhunia/imp_dsa_oncampus | Abundant-Excessive number.cpp | #include <iostream>
#include<bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int m = 0;
for(int i=1;i<=n/2;i++) {
if(n%i == 0) m += i;
}
if(m > n) cout << "YES" <<endl;
else cout << "NO" <<endl;
}
| ALGO | 0.999907 | 4.68002 |
d5e762bb-9dc8-47ce-a78c-5fdd92208d25 | ShrinidhiKaranth16/myLeetcode | detectCapital/detectCapital.cpp | #include<bits/stdc++.h>
using namespace std;
bool detectCapitalUse(string str) {
if(str[0]>=65 && str[0]<=90)
{
int j =1,k=1,c=1;
while(j<str.length()){
if(str[j]<65 || str[j] >90)
{
k++;
}
if(str[j]>=65 && str[... | ALGO | 0.999918 | 5.344438 |
c6ccc42b-33f3-49a3-9aed-e553ff1f621b | saikatcodec/CP | CodeChef/Valid_Minimum.cpp | #include <bits/stdc++.h>
using namespace std;
#define nl "\n"
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL), cout.tie(NULL);
int t;
cin >> t;
while (t--)
{
int a, b, c;
cin >> a >> b >> c;
if (a == b && b == c && a == c)
cout << "YES\n";
... | ALGO | 0.999992 | 4.744615 |
73904312-8b57-4861-aa2f-df5458cb85a2 | Superm4n97/competetive-programming | LightOJ/1325B.cpp | #include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
ll tc;
cin >> tc;
while(tc--){
ll n;
cin >> n;
vector < ll > v;
for (int i=0;i<n;i++){
ll a;
cin >> a;
v.push_bac... | ALGO | 0.999595 | 4.143688 |
9ec99d2d-af7d-468d-9e92-d4ece26386a6 | allangarciasilva/noise_monitor | frontend/noise_monitor/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.997468 | 6.76073 |
3389f990-f34b-4d16-9ea7-8c9511de3b5e | KarolinaStepien/JiMP2 | lab3/tinyurl/TinyUrl.cpp | //
// Created by Admin on 2017-03-21.
//
#include "TinyUrl.h"
namespace tinyurl{
void NextHash(std::array<char, 6> *state) {
int it[6];
for(int i=0;i<6;i++) {
it[i] = (*state)[i];
}
it[5]++;
for(int i=5;i>=0;i--) {
if(it[i]==91) {
it... | ALGO | 0.953653 | 4.50772 |
85d60ec0-585e-4884-92d2-3d2ba6a1fc0a | lawliet9712/Games101 | include/eigen3/doc/examples/tut_arithmetic_matrix_mul.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace Eigen;
int main()
{
Matrix2d mat;
mat << 1, 2,
3, 4;
Vector2d u(-1,1), v(2,0);
std::cout << "Here is mat*mat:\n" << mat*mat << std::endl;
std::cout << "Here is mat*u:\n" << mat*u << std::endl;
std::cout << "Here is u^T*mat:\n" << u.transpo... | ALGO | 0.999566 | 3.818773 |
0acece82-81b0-4f47-9361-d45ac88ebcaf | nikitaaa23/LeetCode-Solutions | 11-container-with-most-water/11-container-with-most-water.cpp | class Solution {
public:
int maxArea(vector<int>& height) {
int n = height.size();
int l =0, h = n-1;
int area = 0;
int maxA = 0;
while(l<h){
int lh = height[l];
int rh = height[h];
int high = min(lh, rh);
area... | ALGO | 0.999948 | 6.714056 |
1e38e9c2-a399-492e-8c4d-c3977f87ca34 | tanzir5/CompetitiveProgramming | LibraryFinal/RM/_MINE/Number Theory/FFT_short.cpp | //FFT_Short
#define SGT_MAX 262148 /// 2 * Smallest power of 2 greater than MAXN, 2^18 when MAXN = 10^5
typedef complex <double> complx; /// Replace double with long double if more precision is required
complx dp[SGT_MAX >> 1], P1[SGT_MAX], P2[SGT_MAX];
inline long long round_half_even(double x){
long long res = ... | ALGO | 0.999949 | 3.461388 |
04e80079-b0a7-431e-9a96-7aa3dfc38fcc | kyucho1009/BOJ | BOJ4179.cpp | #include <bits/stdc++.h>
using namespace std;
#define X first
#define Y second
string board[1000];
int dist1[1000][1000];
int dist2[1000][1000];
int row;
int col;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
int main(void)
{
ios::sync_with_stdio(0);
cin.tie(0);
queue <pair<int, int>> Q1;
queue <pair<int,... | ALGO | 0.999869 | 4.568814 |
06cd619d-11c5-46c9-8e6e-e483988766a5 | VanDien2006/DSA | ThucHanh/TH24_3_Lop.2/Bai01_3/Bai01_lan3.cpp | /*###Begin banned keyword - each of the following line if appear in code will raise error. regex supported
###End banned keyword*/
//###INSERT CODE HERE -
#include<iostream>
using namespace std;
struct NODE
{
int key;
NODE *pNext;
};
struct LIST
{
NODE *pHead, *pTail;
};
void CreateEmptyList(LIST &L)
{
... | ALGO | 0.99959 | 4.728016 |
4a8e3631-aee9-436a-b343-fe5f2a468d73 | srinithya-halaharvi/DSA-CYI | Arrays/(Medium)Container-with-most-water.cpp | //Recursive
class Solution {
public:
int V=0;
void setV(vector<int>& temp){
int v=(temp.size()-1)*(min(temp.front(),temp.back()));
if(v>V){
V=v;
}
}
void recur(vector<int>& height, vector<int>& temp, int index, int start){
if(index==height.size()){
... | ALGO | 0.999992 | 6.314291 |
ed1ccf1a-ee38-48d2-910a-eef1fed93baf | proxmox/ceph | ceph/src/boost/libs/regex/example/snippets/partial_regex_iterate.cpp | /*
* LOCATION: see http://www.boost.org for most recent version.
* FILE partial_regex_iterate.cpp
* VERSION see <boost/version.hpp>
* DESCRIPTION: Search example using partial matches.
*/
#include <boost/regex.hpp>
#include <iostream>
#include <fstream>
#include <sstream>
#include <st... | ALGO | 0.919978 | 6.695587 |
28bc297a-331a-4842-9725-91856a660d1c | mr-vicky/DSA | 10]. Linked List/15_Merging_Two_Linked_Lists.cpp | #include<iostream>
using namespace std;
struct Node{
int data;
Node* next;
};
Node* create(int A[], int n){
Node *temp, *last, *first;
first=new Node;
first->data=A[0];
first->next=NULL;
last=first;
for(int i=1; i<n; i++){
temp=new Node;
temp->data=A[i];
t... | ALGO | 0.999974 | 5.259004 |
d748c90c-0e28-424c-b35c-0835757518c4 | GrapixLeGrand/Lustrine | thirdparty/Bullet3/bullet3/test/Bullet2/Source/Tests/Test_maxdot.cpp | #include "LinearMath/btScalar.h"
#if defined(BT_USE_SSE_IN_API) || defined(BT_USE_NEON)
#include "Test_maxdot.h"
#include "vector.h"
#include "Utils.h"
#include "main.h"
#include <math.h>
#include <string.h>
#include <LinearMath/btVector3.h>
// reference code for testing purposes
static long maxdot_ref(const btSimdF... | TEST | 0.860144 | 6.718423 |
edb61f73-9a5f-4a4a-b1ad-9845fea0222e | jjadekwon/algorithm-cpp | programmers/P42576.cpp | #include <string>
#include <vector>
#include <unordered_map>
using namespace std;
string solution(vector<string> participant, vector<string> completion) {
string answer = "";
unordered_map<string, int> m;
for (string p : participant) {
++m[p];
}
for (string c : completion) {
... | ALGO | 0.999551 | 5.638335 |
1fdbb61a-9ff1-491b-9770-6bb9dac52d29 | JeanLucPons/Kangaroo | Thread.cpp | #include "Kangaroo.h"
#include "Timer.h"
#include <string.h>
#define _USE_MATH_DEFINES
#include <math.h>
#include <algorithm>
#ifndef WIN64
#include <pthread.h>
#endif
using namespace std;
// ----------------------------------------------------------------------------
#ifdef WIN64
THREAD_HANDLE Kangaroo::LaunchThre... | TOOL | 0.942098 | 4.370891 |
77499736-43a7-4c71-b4e1-1cefa75426ee | Rohitjangid2704/DS-ALGO-IMP- | DP/Unique Paths II.cpp | /*
MY YOUTUBE VIDEO ON THIS Qn : Recursion + Memo - https://www.youtube.com/watch?v=JC1fSPdJjMc
Bottom UP - soon
Company Tags : Amazon, Cisco, Paytm, OLA Cabs, Walmart, LinkedIn
Letcode Link : https://leetcode.com/problems/unique-paths-ii/
*/
... | ALGO | 0.999857 | 6.469316 |
20c7ec04-292d-4052-af6b-d3e9b86b5963 | DarkLegend360/Coding-Algorithms | 7DynamicProgramming/MinimumNumberOfCoinsForChange/minNoOfCoins.cpp | #include <bits/stdc++.h>
using namespace std;
//int main() {
// vector<int> denoms = {1, 5, 10};
// int n=7;
// vector<int> dp(n+1,INT_MAX);
// dp[0]=0;
// for(auto d:denoms) {
// for(int c=1;c<=n;c++) {
// if(c>=d)
// if(dp[c-d]==INT_MAX)
// ... | ALGO | 0.99997 | 4.025764 |
23e1b827-7c35-4bd5-8ac6-14f5d77c3ebc | is0484sh/BaekJoon | 구구단.cpp | #include <iostream>
using namespace std;
int main(void){
int a;
cin >> a;
for(int i = 1;i<10;i++){
cout << a << " * " << i << " = " << a*i << endl;
}
return 0;
}
| ALGO | 0.998721 | 3.496946 |
be414c48-0dcc-495d-bcb9-4114ff67e156 | ThiiboyThiiboy/SleepyProject | Sleepy/Library/PackageCache/com.unity.ide.visualstudio@2.0.22/Editor/COMIntegration/COMIntegration~/COMIntegration.cpp | #include <iostream>
#include <sstream>
#include <string>
#include <filesystem>
#include <windows.h>
#include <shlwapi.h>
#include <fcntl.h>
#include <io.h>
#include "BStrHolder.h"
#include "ComPtr.h"
#include "dte80a.tlh"
constexpr int RETRY_INTERVAL_MS = 150;
constexpr int TIMEOUT_MS = 10000;
// Often a DTE call m... | TOOL | 0.925733 | 6.933585 |
c047536b-bce9-479b-915b-bd8793832fc0 | hijasahamed/Auto-Mates-Admin | 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.998733 | 6.76775 |
c0b9c623-2e1a-4cfd-b5e1-a9774adb0854 | changsongzhu/leetcode | C++/seq_num/687_e.cpp | /**
687. Longest Univalue Path
Given a binary tree, find the length of the longest path where each node in the path has the same value. This path may or may not pass through the root.
Note: The length of path between two nodes is represented by the number of edges between them.
Example 1:
Input:
5
... | ALGO | 0.999926 | 6.345507 |
0e2e6cb2-710d-41d5-8622-873650bd3651 | Mygit2001/code-OOP-cpp | OOP-cpp/napchongtt2.cpp | #include<iostream>
using namespace std;
class ARRAY
{
private:
int *a;
int n;
public:
void nhap();
void xuat();
void operator++();
void operator--();
};
void ARRAY::nhap()
{
cout<<"\nNhap so phan tu :";
cin>>n;
a= new int[n];
for(int i=0;i<n... | ALGO | 0.999302 | 3.662574 |
725cec1e-0717-47a2-b977-0e061a814ecb | jebediah-kerman/Leaf_Model_Iterate_Latest | Leaf_Model_Iterate/Runs/03-02-2_GI2_production_based_on_GF_conc/0.2_0.0003_1._105/Sepal/ConvVertice-xy.cpp | //////////////////////////////////////////////////
//////////////////////////////////////////////////
// //
// Freefem++ script //
// //
// author: Mathilde Dumond //
// ... | ALGO | 0.96559 | 3.311349 |
b392a306-5441-4cf9-81db-dd80b04d3879 | welcome-to-the-sunny-side/libra | string/kmp.cpp | template <typename T>
vector<int> kmp_table(const T &s)
{
/*
tc: O(|s|)
mc: O(|s|)
info:
p[i] = longest suffix of substring s[0, 1, .. i] which is also a suffix
*/
int n = s.size();
vector<int> p(n, 0);
int k = 0;
for (int i = 1; i < n; i ++)
{
w... | ALGO | 0.999652 | 5.43698 |
f568601c-2f32-4627-99dd-1b4c1432975f | HarbourMasters/SpaghettiKart | src/engine/vehicles/Utils.cpp | #include <libultraship.h>
#include "Utils.h"
extern "C" {
#include "macros.h"
#include "defines.h"
#include "code_80005FD0.h"
}
uint32_t CalculateWaypointDistribution(size_t i, uint32_t numVehicles, size_t numWaypoints, uint32_t centerWaypoint) {
return (uint32_t)(((i * numWaypoints) / numVehicles) + centerWaypoi... | ALGO | 0.998361 | 4.01084 |
20a90999-0e8c-4267-a911-1aeef637e74c | Estellasy/go_for_work | leetcode/top100/tree/98.cpp | /*
98. 验证二叉搜索树
给你一个二叉树的根节点 root ,判断其是否是一个有效的二叉搜索树。
有效 二叉搜索树定义如下:
节点的左子树只包含 小于 当前节点的数。
节点的右子树只包含 大于 当前节点的数。
所有左子树和右子树自身必须也是二叉搜索树。
*/
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {... | ALGO | 0.999952 | 7.246445 |
5697bee4-1852-4db1-92d4-d723b236ece7 | thilio/Competitive-Programming | OJ/Codeforces/19E - Fairy.cpp | #include "bits/stdc++.h"
using namespace std;
#define pb push_back
#define mp make_pair
#define fst first
#define snd second
#define fr(i,n) for(int i=0;i<n;i++)
#define frr(i,n) for(int i=1;i<=n;i++)
#define ms(x,i) memset(x,i,sizeof(x))
#define dbg(x) cout << #x << " = " << x << endl
#define all(x) x.begin(),x.en... | ALGO | 0.999976 | 3.720642 |
f3215391-cdad-4a89-8082-a47792328e24 | ajie4jellyfish/2022graphics1 | week16/weekl16_interpolation/main.cpp | #include <GL/glut.h>
#include <stdio.h>
float angle[20], oldX=0;
int angleID=0;
FILE * fout =NULL,*fin=NULL;
void myWrite(){
if(fout==NULL)
fout=fopen("file.txt,","w+");
for(int i=0;i<20;i++){
printf(" %.1f ",angle[i]);
fprintf(fout," %.1f ",angle[i]);
}
printf("\n");
fprin... | TOOL | 0.951456 | 3.485737 |
d0b49ec2-9b3a-47e7-8b79-977eb9dc9440 | durgesh-4526/Leetcode-ques---1001-2080 | 1379.cpp | #include <bits/stdc++.h>
using namespace std;
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
};
class Solution {
public:
TreeNode* getTargetCopy(TreeNode* original, TreeNode* cloned, TreeNode* target) {
queue<TreeNode*> q;
q.push(cloned);
while (!q.empty())
... | ALGO | 0.999924 | 5.065609 |
648a5499-da42-4118-a10d-3c9f02c0c2d4 | sultancodess/leetcode- | C++/check-if-one-string-swap-can-make-strings-equal.cpp | // Time: O(n)
// Space: O(1)
class Solution {
public:
bool areAlmostEqual(string s1, string s2) {
vector<pair<int, int>> diff;
for (int i = 0; i < size(s1); ++i) {
if (s1[i] == s2[i]) {
continue;
}
if (size(diff) == 2) {
return fa... | ALGO | 0.999971 | 6.508924 |
a37bf384-79c5-41e1-a4c7-7e3aac1e166e | movhdi/100daysOfCodingChallenge | p16_enumeratingIPv4/main.cpp | #include <sstream>
#include <string>
#include <iostream>
#include <bitset>
#include <array>
#include <algorithm>
class IPv4{
public:
u_int32_t ipv4;
std::array<unsigned char, 4> data;
// first constructor
constexpr IPv4(): ipv4{0},data{{0}}
{
}
// second constructor
constexpr IPv4(uns... | ALGO | 0.972508 | 4.098472 |
87a5dd07-f0d3-4991-8913-3e74523168b7 | Tushar0508/DSA-PRACTICE | 892-shortest-subarray-with-sum-at-least-k/shortest-subarray-with-sum-at-least-k.cpp | typedef long long ll;
class Solution {
public:
int shortestSubarray(vector<int>& nums, int k) {
priority_queue<pair<ll , ll> , vector<pair<ll , ll>> , greater<pair<ll , ll>>> pq;
ll sumi = 0;
ll maxi = 1e18;
for(ll i = 0; i<nums.size() ; i++){
sumi += (ll)nums[i];
... | ALGO | 0.999968 | 5.612141 |
b5d29b50-bdc3-4099-b709-7aad10deb57a | sipho-mancam/common_module | Dependencies/libs/compute/perf/perf_bolt_count.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <bolt/cl/count.h>
#include <bolt/cl/copy.h>
#include <bolt/cl/device_vector.h>
#include "perf.hpp"
int rand_int()
{
return static_cast<int>((rand() / double(RAND_MAX)) * 25.0);
}
int main(int argc, char *argv[])
{
perf_parse_args(argc, argv... | TOOL | 0.920704 | 4.983783 |
033bbca5-9ea0-4070-8e24-f737051406d0 | lanbao2021/algorithm | 238. 除自身以外数组的乘积.cpp | #include <iostream>
#include <vector>
using namespace std;
class Solution
{
public:
vector<int> productExceptSelf(vector<int> &nums)
{
int n = nums.size(); // 数组长度
if (n == 0) // 空数组
return {};
vector<int> res(n, 1); // 结果数组
int left = 1, right = 1; ... | ALGO | 0.999968 | 4.98431 |
e0dd1123-0967-4006-b824-b19355bd1068 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_6200_5.cpp | #include <bits/stdc++.h>
using namespace std;
const double eps = 1e-9;
int a[100000 + 100];
int n;
bool bs(int num, int low, int high) {
int mid = (low + high) / 2;
while (low <= high) {
if (a[mid] < num)
low = mid + 1;
else if (a[mid] > num)
high = mid - 1;
else
return true;
mid =... | ALGO | 0.999568 | 4.07174 |
695432c7-4b6c-4e38-bb4d-3f69f10fa0fe | ishandutta2007/codeforces | climpet/normal/268/B.cpp | #include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <deque>
#include <complex>
#include <stack>
#include ... | ALGO | 0.999779 | 3.971377 |
45264775-0a4b-4592-9b3e-40671773ea97 | alexandraback/datacollection | solutions_2449486_1/C++/reachnomind/B.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int main() {
int T;
cin>>T;
for(int t=1; t<=T; t++) {
int n, m;
cin>>n>>m;
int g[n][m], f[n][m];
for(int i=0; i<n; i++) {
for(int j=0; j<m; j++) {
cin>>g[i][j];
f[i][j]... | ALGO | 0.99987 | 3.608442 |
4ad83bdc-c6d0-4218-9429-f15387469bf9 | dangvanhuy/iot_flutter | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.99887 | 6.783439 |
090d823d-2711-463a-919d-85a63cb72f1e | ebdemir/clang-3.9.0 | lib/TableGen/StringMatcher.cpp | #include "llvm/TableGen/StringMatcher.h"
#include "llvm/Support/raw_ostream.h"
#include <map>
using namespace llvm;
/// FindFirstNonCommonLetter - Find the first character in the keys of the
/// string pairs that is not shared across the whole set of strings. All
/// strings are assumed to have the same length.
stati... | TOOL | 0.896697 | 7.173703 |
ab971c55-8427-428d-98b6-eb4069685465 | vfolunin/archives-solutions | UVa Online Judge/13058.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <string>
using namespace std;
bool check(vector<int> a, int len, int from) {
int curLen = 0;
for (int i = 0; i < a.size(); i++) {
curLen += a[(from + i) % a.size()];
if (curLen > len)
r... | ALGO | 0.999919 | 3.859271 |
0e3e1d50-6c7a-4dc0-8f9d-d59abf8a883f | haozx1997/C | ACM/2016.8.1.ShanxiProvince/D - 众数问题.cpp | #include<iostream>
#include<algorithm>
#include<string.h>
#include<stdio.h>
#include<map>
#include<vector>
using namespace std;
int main()
{
int n;
while(~scanf("%d",&n))
{
vector <int > v;
v.clear();
int min = 1e5+5;
int max = -1e5+5;
int a;
for(int i = 0;i < n ;i++)
{
scanf("%d",&a);
if(a<min... | ALGO | 0.999889 | 3.706715 |
968a5deb-a2f1-4f54-9635-161f7d7b8727 | ishandutta2007/codeforces | kevin114514/normal/1614/D2.cpp | #include<bits/stdc++.h>
//#pragma GCC optimize("O2")
using namespace std;
#define ll long long
#define pb push_back
#define mp make_pair
#define ALL(x) (x).begin(),(x).end()
#define rALL(x) (x).rbegin(),(x).rend()
#define srt(x) sort(ALL(x))
#define rev(x) reverse(ALL(x))
#define rsrt(x) sort(rALL(x))
#define sz(x) (in... | ALGO | 0.999934 | 3.570905 |
857d52f7-0cd3-4af9-9055-84f9e63c1a59 | rohyunsang/Algorithm | Geometry/B[2166].cpp | #include <iostream>
#include <vector>
#include <cmath>
#include <cstdio>
using namespace std;
int main() {
int n;
cin >> n;
vector<pair<int, int>> v;
for (int i = 0; i < n; i++)
{
int x, y;
cin >> x >> y;
v.push_back({ x, y });
}
v.push_back(v[0]);
long long... | ALGO | 0.999326 | 4.405321 |
9afccf93-f2c8-4262-84f0-9f883de65636 | 98andwin/Kattis_solutions | Problems/Loo Rolls/loorolls.cpp | #include <iostream>
int main(){
long l, n;
std::cin >> l >> n;
int count = 1;
long roll = l;
while (true){
long remainder = roll % n;
if (remainder == 0){
break;
}
n = (n-remainder);
count += 1;
}
std::cout << count;
} | ALGO | 0.999723 | 3.513931 |
43aa835d-b664-4ea4-bc04-a3932003477b | bigblackflopp/jajko | kurs C++/jakis syf w c++/syf7_tablice/syf7_fibonacci.cpp | #include <iostream>
#include <iomanip>
using namespace std;
long double fib [100000]; int n;
int main()
{
cout << "ile liczb ciagu fibonacciego mam wyznaczyc \n";
cin >> n;
fib[0]=1;
fib[1]=1;
for (int i=2; i<n; i++)
{
fib[i]=fib[i-1]+fib[i-2];
}
cout << setprecision(10000);
... | ALGO | 0.999929 | 3.656665 |
525e2927-727a-4415-bb8e-277010b90a1a | VenkataAnilKumar/LeetCode | C++/most-visited-sector-in-a-circular-track.cpp | // Time: O(n)
// Space: O(1)
class Solution {
public:
vector<int> mostVisited(int n, vector<int>& rounds) {
vector<int> result;
if (rounds.front() <= rounds.back()) {
for (int i = rounds.front(); i <= rounds.back(); ++i) {
result.emplace_back(i);
}
}... | ALGO | 0.999954 | 6.511422 |
87240119-8997-4de4-a293-31305dcad983 | ishandutta2007/codeforces | marek.cygan/normal/277/E.cpp | #include <cstdio>
#include <iostream>
#include <algorithm>
#include <set>
#include <map>
#include <stack>
#include <list>
#include <queue>
#include <deque>
#include <cctype>
#include <string>
#include <vector>
#include <sstream>
#include <iterator>
#include <numeric>
#include <cmath>
using namespace std;
typedef vecto... | ALGO | 0.998049 | 3.617404 |
c31b9e69-bab9-436c-a146-40c552244b94 | Linguard/CSCI-135 | Project 2/transcriptase.cpp | /*
Name: Saqibul Chowdhury
CSCI 136
Lab Instructor: Anoop Aroor
Project 2A
This program reads a text file called dna.txt that contains one DNA strand per line
and outputs to the console (terminal) the corresponding mRNA strands
*/
#include <iostream>
#include <fstream> //including fstream to read file
#include <c... | TOOL | 0.942893 | 6.581782 |
64ac48d0-a6fa-48b7-a43b-4fae30b0ff47 | zoyafarooq/DSA-Project--059 | Task # 13(3).cpp | #include <iostream>
#include <queue>
using namespace std;
class TreeNode{
public:
int data;
TreeNode* left;
TreeNode* right;
TreeNode(int value){
data = value;
left = right = NULL;
}
};
void BFS_Tree(TreeNode* root){
if (root == NULL) return;
queue<TreeNode*> q;
q.push(root);
while(!q.emtpy()){... | ALGO | 0.999931 | 5.023835 |
f937bd1b-1418-455c-bcb9-5ce4b705dc0f | Mansipawar22/Data-Structure-and-Alogorithim | Data Structure & Algorithim/3. Searching/14. 2 Pointer(a+b=c).cpp | #include<bits/stdc++.h>
using namespace std;
int isPair(int arr[], int left, int right, int sum)
{
int count = 0;
while (left < right)
{
if (arr[left]+arr[right] == sum)
{
count++;
left++;
}
else if(arr[left]+arr[right] > sum)
{
r... | ALGO | 0.999689 | 5.433646 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.