uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
50bb658f-ac64-458f-a20a-54326d47decc | Detasariaslina09/petruk-tugas-2 | NO 5.cpp | #include <iostream>
#include <cstring> //DETA SARI ASLINA(2217051117)
using namespace std;
char* balik(char* str) {
int len = strlen(str);
char* reversed= new char[len+1];
for (int i = 0; i < len; i++) {
reversed[i] = str[len-i-1];
}
reversed[len] = '\0';
return reversed;
}
int main... | ALGO | 0.998913 | 4.519217 |
212bd0d3-dff1-463f-8eec-6f5529674daa | monsurriaz/XPSC-Weekly-Contest | Week-1/Day-2/I_Multiple_Gift.cpp | #include <bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
ll x, y;
cin >> x >> y;
int count = 0;
while (x <= y)
{
if (x <= y)
{
count++;
}
x = 1LL * x * 2;
}
cout << count << '\n';
return 0;
} | ALGO | 0.999814 | 3.956679 |
c40f82b6-3d2f-4e61-80d0-5f50194aeb12 | ffpacheco/Uni | AED/Class 08/stickerCollection.cpp | #include <iostream>
#include <set>
using namespace std;
int main() {
int c, b;
cin >> c;
set<int> collection;
set<int> newCards;
for (int i = 0; i < c; i++) {
int card;
cin >> card;
collection.insert(card);
}
cin >> b;
for (int i = 0; i < b; i++) {
int ... | ALGO | 0.999753 | 3.412854 |
1e757193-ef15-4839-b00a-ccd39222b356 | franciscormelo/adaptive_social_layers | scripts/graphopt/multi.cpp | #include"class.cpp"
#include "mex.h"
#include<cstdio>
void mexFunction (int nlhs, mxArray *out[],
int nrhs, const mxArray *in[]) {
// Check to see if we have the correct number of input and output
// arguments.
if (nrhs != 6)
mexErrMsgTxt("Incorrect number of input arguments.\n Correct form is (cost, neigbo... | ALGO | 0.99918 | 4.074996 |
ac9ebf2f-f1a3-448e-9bad-4918c2ec9885 | jeetsavsani1173/LeetCode-Solution | 0207-course-schedule/0207-course-schedule.cpp | class Solution {
public:
vector<int> graph[2005];
vector<int> bfs(vector<vector<int>>& prerequisites,int n)
{
vector<int> indeg(n,0);
for(auto it:prerequisites)
{
indeg[it[0]]++;
}
vector<int> ans;
queue<int> q;
for(int i=0;i<n;i++)
... | ALGO | 0.999926 | 6.185348 |
213a4a64-69ce-49ce-980a-08c31421a84c | disillusion028/MyLeetCode | LintCode/212_space-replacement/space-replacement.cpp | /*
@Copyright:LintCode
@Author: disillusion028
@Problem: http://www.lintcode.com/problem/space-replacement
@Language: C++
@Datetime: 16-11-21 07:38
*/
class Solution {
public:
/**
* @param string: An array of Char
* @param length: The true length of the string
* @return: The true length of new st... | ALGO | 0.99695 | 3.506501 |
4cc2ce83-7a77-4bfc-981c-6ac708ff058b | WeileiZeng/itpp-full-Docker-Image | version1/sample/hello-openmp.cpp | #include <stdio.h>
#include <iostream>
#include <omp.h>
#include <ctime> //for timer
#include <chrono> //for wall time, using c++11
void myFunc(int t=1){
std::cout<<"start t = "<<t<<std::endl;
for ( int j = 0; j<10000*(t+3); j++){
for ( int k = 0; k <10000; k++){
int a = 1;
a++;
a--;
}
... | TOOL | 0.956776 | 4.085918 |
10c5ade8-6e99-41f1-8835-a3d62785604a | mhjmbs/competitive-programming | solutions/AtCoder/AtCoder Beginner Contests/AtCoder Beginner Contest 289/C - Coverage.cpp | #include "bits/stdc++.h"
#define fastio ios::sync_with_stdio(0), cin.tie(nullptr)
using namespace std;
using ll = long long;
using pii = pair<int,int>;
vector<vector<int>> S;
int goal, ans = 0;
int n, m;
void backtracking(int curr, int taken) {
if(curr == m) {
if(taken == goal) {
ans++;
... | ALGO | 0.999955 | 4.429588 |
6d84cd85-ae94-417f-9f5a-5287712f7748 | wahida05/DSA-Practice | Lecture_05/convertbit.cpp | #include<iostream>
#include<math.h>
using namespace std;
int main(){
int n;
cout<< "Enter the value of n" << endl;
cin >> n;
int ans = 0 ;
int i = 0;
while(n != 0){
int bit = n & 1;
ans = (bit * pow(10 , i)) + ans;
n = n >> 1;
i++;
}
cout << "Answer is " <... | ALGO | 0.999906 | 4.583584 |
369f8151-154a-480c-ae4a-8bc5a5549f83 | Karandhankar/DSA | 128-longest-consecutive-sequence/longest-consecutive-sequence.cpp | class Solution {
public:
int longestConsecutive(vector<int>& nums) {
if(nums.size() == 0)
return 0;
sort(nums.begin(), nums.end());
int n = nums.size();
int lastSmaller = INT_MIN;
int count = 0;
int longest = 1;
for(int i=0; i<n; i++)
{
... | ALGO | 0.999977 | 5.728898 |
785585cf-5b40-4027-895e-d7dbf512fdae | divaymohan/Easy-Graphs-Implementation | detectAndRemoveLoop/code.cpp | void removeLoop(Node* head)
{
Node *sp=head,*fp=head;
while(sp && fp && fp->next)
{
sp=sp->next;
fp=fp->next->next;
if(sp==fp)
break;
}
//loop detected
//calculate the number of node into the loop
if(sp==fp)
{
int k = 1;
while(sp-... | ALGO | 0.999893 | 4.067127 |
bdf48c3e-f0d4-46b0-a484-2f6d9080acd9 | Noymul-Islam/problems | my t-shirt suits me3.cpp | #include<cstdio>
#include<iostream>
#include<cstring>
#include<cmath>
#include<vector>
#include<queue>
#include<algorithm>
#include<map>
using namespace std;
int bp[35][35];
bool bpm(int u);
int max_bpm();
int n,m;
int shirt[6];
int volunteer[40];
int num=0;
int match[50][6],seen[50];
map<string,int>mp;
int main()
{... | ALGO | 0.999917 | 3.821262 |
36109ac9-b9ee-460b-8ee9-42261cc0f4ee | tapixhx/CPP | Codeforces/two-rabbits.cpp | //#include <bits/stdc++.h>
//
//#define ll long long int
//#define mod 1000000007
//#define pi 3.141592653589793238
//#define lcm(a,b) (a/(__gcd(a,b)))*b
//#define FASTIO ios_base::sync_with_stdio(false);cin.tie(NULL);cout<<fixed;cout.precision(10);
//
//using names... | ALGO | 0.998298 | 3.997077 |
d36c2a03-0ebe-4271-84a5-e8981872de14 | arealdeadone/Codes | 430B.cpp | #include <bits/stdc++.h>
#define mp make_pair
#define pb push_back
#define FIO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
using namespace std;
typedef long long ll;
typedef unsigned long long llu;
typedef pair<int,int> ii;
typedef vector<int,int> vii;
typedef vector< vector<int> > vvi;
int main()
{
FIO
... | ALGO | 0.999832 | 3.874294 |
015bd233-c72a-4c6f-bd08-724bc54f230c | IStallcup/school | cs161/labs/lab7/posintr.cpp | #include <iostream>
#include <cstdlib>
#include <string>
using namespace std;
bool is_positive_int_recursive(string str_input, int i)
{
if (i == 0)
return true;
--i;
if(str_input.at(i) < '0' || str_input.at(i) > '9')
return false;
return is_positive_int_recursive(str_input, i);
}
int main()
{
cout << "Ent... | ALGO | 0.985431 | 3.98178 |
6317aa9b-c3bc-4c24-97dc-db5830689cba | abdull-ah-med/PF | Week6/Pf_lab_6/task9.cpp | #include <iostream>
#include <cmath>
using namespace std;
float calculateplayhours(string leap, int p, int h);
main()
{
while (true)
{
string leap;
int p, h;
float total_times_played;
cout << "Enter Year(normal or leap): ";
cin >> leap;
cout << "Enter the number o... | ALGO | 0.998394 | 3.71891 |
65767f11-0b43-4bde-bf34-4dda67f03aee | zimpha/acm-icpc | ZOJ/ZOJ Monthly, December 2013/ZOJ3742.cpp | #include <cmath>
#include <vector>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <algorithm>
using namespace std;
typedef long long LL;
typedef pair<int, int> PII;
const int MAXN = 50000 + 10;
const int MAXM = 50000 + 10;
struct Edge {
int u, v, w;
void read() {
scanf("%d%d%d", &u, &v, &w);
}... | ALGO | 0.999571 | 4.152197 |
0cc099a5-fa56-484d-b66e-03744d422585 | denis-gubar/Leetcode | Monotonic Stack/0769. Max Chunks To Make Sorted.cpp | class Solution {
public:
int maxChunksToSorted( vector<int>& arr ) {
vector<int> A( arr ), B( arr ), C( arr );
sort( B.begin(), B.end() );
int Max = A[0];
for (int i = 0; i < A.size(); ++i)
{
if (Max < A[i])
Max = A[i];
C[i] = Max;
... | ALGO | 0.999989 | 5.432147 |
0a9fffe0-852d-414b-9b5a-c7ded0a2b168 | Krishantchauhan/LeetCode | 240. Search a 2D Matrix II.cpp | class Solution
{
public:
bool searchMatrix(vector<vector<int>> &matrix, int target)
{
int r = matrix.size();
int c = matrix[0].size();
int low = 0, high = c - 1;
while (low < r && high >= 0)
{
if (matrix[low][high] == target)
{
ma... | ALGO | 0.999946 | 6.088242 |
ca158921-7c89-4066-8421-6c0306c59d53 | harshitgupta2610/Leetcode | 100-same-tree/same-tree.cpp | class Solution {
public:
bool isSameTree(TreeNode* p, TreeNode* q) {
if(p==NULL && q== NULL){
return true;
}
if(p==NULL || q== NULL){
return false;
}
if(p->val != q->val){
return false;
}
return isSameTree(p->left,q->left) ... | ALGO | 0.999949 | 6.323173 |
9361ab27-6f6e-46bd-b936-ec90a24ef3f6 | theysani/coc-x64 | src/3rd party/NVTT/src/nvtt/Compressor.cpp | #include <nvtt/nvtt.h>
#include <nvcore/Memory.h>
#include <nvcore/Ptr.h>
#include <nvimage/DirectDrawSurface.h>
#include <nvimage/ColorBlock.h>
#include <nvimage/BlockDXT.h>
#include <nvimage/Image.h>
#include <nvimage/FloatImage.h>
#include <nvimage/Filter.h>
#include <nvimage/Quantize.h>
#include <nvimage/NormalMa... | TOOL | 0.902229 | 3.852823 |
6fc52ef1-cca6-4110-897f-3034b4288e7a | bagrorg/Bi-criteria-Search-Algorithms | Service/AlgorithmState.cpp | #include "AlgorithmState.hpp"
#include <fstream>
void writeHistory(const AlgorithmStateHistory& history, const Options& opts) {
std::ofstream of(opts.historyFile, std::ios::out);
int epoch = 0;
for (const auto& state: history) {
of << "e " << epoch++ << "\n";
for (const auto& node: state.a... | ALGO | 0.998172 | 5.62652 |
3225cf8d-281c-422e-a837-e2074be69eb2 | AryanRaj315/CompetitiveProgrammingSolutions | B-ilya-and-queries/main.cpp | #include <iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<cmath>
#include<cstring>
#include<map>
using namespace std;
#define loop(i, start, end) for(int i = start; i <= end; i++)
#define ll long long int
#define arrayInput(arr, n) loop(i, 0, n-1){ cin >> arr[i];}
#define arrayDisplay(arr, n) ... | ALGO | 0.999685 | 4.243086 |
44558701-0191-4f1b-b94c-2188f879d301 | Fayeza-42/Webserv_42 | srcs/parsing/RequestParser.cpp | #include "RequestParser.hpp"
#include "utils.hpp"
#include <sstream>
#include <cstdlib>
#include <set>
#include <algorithm>
#include <filesystem>
RequestParser::RequestParser(const std::string &request) : _request(request), badRequest(false), _isUpload()
{
// print_log(BLUE, "RequestParser Constructor");
try
{
pa... | WEB | 0.937041 | 5.824327 |
457450dc-554e-409f-b630-8d696023f4f1 | 2016b11106/LearnProgramming | Algorithm/Recursive/Hanoi.cpp | /**
* 汉诺塔
* author 叶晨韬
* date 2019/4/26
**/
#include <iostream>
int i = 1;
//n->盘子数量 from->起始柱 to->终点柱 depend->中转柱
void _hanoi(int n, char from, char to, char depend)
{
if (n == 0)
return;
_hanoi(n - 1, from, depend, to);
std::cout << "第" << i++ << "次:" << from << " -> " << to << std::endl;
... | ALGO | 0.999821 | 5.146154 |
b94f2323-2768-4a97-ac14-88e8119cb046 | wjy1122/leetcode | Day-03_两数之和 II - 输入有序数组/3.cpp | #include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
vector<int> twoSum(vector<int>& numbers, int target) {
int left = 0, right = numbers.size() - 1;
while (true) {
int s = numbers[left] + numbers[right];
if (s == target) return { left + 1, rig... | ALGO | 0.999888 | 5.953192 |
f53dbd14-8aa1-4ef0-be26-f58bd4a6d38c | ishandutta2007/codeforces | abc864197532/normal/1630/C.cpp | #include <bits/stdc++.h>
using namespace std;
#define lli long long int
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define pii pair <int, int>
#define X first
#define Y second
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
void abc() {cout << endl;}
template <typename T, t... | ALGO | 0.999989 | 4.561584 |
8fda856c-08d2-41bc-a706-cb89cd438286 | ishandutta2007/codeforces | arsijo/normal/706/B.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int ui;
typedef long double ld;
typedef pair<int, int> ii;
typedef pair<ii, ii> iii;
ll MOD = 1e9 + 7;
const ld E = 1e-7;
#define null NULL
#define ms(x) memset(x, 0, sizeof(x))
#ifndef LOCAL
#define end... | ALGO | 0.999991 | 4.075805 |
f191c713-f8b6-4f55-a787-616191593cae | Shamsyyy/AlgoritmsITMO | 2 лаба/algos2_1.cpp | #include<bits/stdc++.h>
using namespace std;
void qsort(long long *b,int left,int right) {
long long middle;
middle = b[rand() % (right - left + 1) + left];
int i=left;
int j=right;
while(i<j) {
while(b[i]<middle) {
i++;
}
while(b[j]>middle){
j--;
}
... | ALGO | 0.999689 | 3.137937 |
3ff6555e-a28a-4a04-b263-5e816bdb4698 | imulan/procon | aoj/vol0/0071.cpp | #include <cstdio>
#include <cstring>
#include <iostream>
#include <queue>
using namespace std;
typedef struct{
int x;
int y;
}point;
int main(){
int n;
scanf(" %d", &n);
for(int i=0; i<n; ++i){
char f[9][9];
int dx[4]={1,0,-1,0}, dy[4]={0,1,0,-1};
for(int j=1; j<=8; ++j)
for(int k=1; k<=8; ++k)
scanf(... | ALGO | 0.999016 | 3.743394 |
a6960c19-37a1-4e23-aa05-66dd7f7610da | ishandutta2007/codeforces | hank55663/normal/965/C.cpp | #include<bits/stdc++.h>
using namespace std;
#define LL long long
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define x first
#define y second
int main(){
LL n,k,m,d;
scanf("%lld %lld %lld %lld",&n,&k,&m,&d);
//n/x*k<=d
LL ans=0;
for(int i = 1;i<=d;i++){
if(k*(i-1)+1>n)
break;
LL x=mi... | ALGO | 0.999881 | 3.405504 |
99ecbdea-2db4-4d3b-8783-289c65e75ecf | hjiang13/LLMs-in-IR | POJ-104/34/735.cpp | #include <iostream>
using namespace std;
/*
????????
??????
?????2010?12?
???????????????
**/
void f(int n);
int main ()
{
int n;
cin >> n;
f(n); //????f
return 0;
}
void f(int n)
{
int m;
if(n == 1) //?????n?1
cout << "End";
else
{
if(n % 2 == 0)
{
m = n / 2;
cout << n << "/" << 2 << "=" << m << endl; //??n???,??"n/... | ALGO | 0.999691 | 3.571513 |
f5a48a8c-8e3d-47ca-9554-b8270b87636f | hrithikD9/Phitron | PhitronCPP/prob12.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define HeHe return 0
#define YES cout << "YES\n"
#define NO cout << "NO\n"
#define nl '\n'
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n , q;
cin >> n >> q;
vect... | ALGO | 0.999968 | 4.757135 |
755413ec-790f-4d7c-aab0-fb6c6e953627 | Rajasree460/DSA_all_codes | college work 3rd sem/stack push pop display nw.cpp | #include<stdio.h>
#include<stdlib.h>
#include<process.h>
#define MAX 10
int top=-1,stack[MAX];
void push();
void pop();
void display();
int main()
{
int ch;
while(1)
{
printf("press 1 for push\n");
printf("press 2 for pop\n");
printf("press 3 for display\n");
printf("press 4 for exit\n");
printf("enter you... | ALGO | 0.955805 | 3.442781 |
ef92001e-a834-4d0a-a6bc-8996f777dfc8 | zchmielewska/c_plus_plus | lafore/chapter_05/ex06.cpp | #include <iostream>
using namespace std;
struct time {
int hours;
int minutes;
int seconds;
};
long time_to_secs(time t) {
return t.hours*3600 + t.minutes*60 + t.seconds;
}
time secs_to_time(long totalsecs) {
time t;
t.hours = static_cast<int>(totalsecs/3600);
totalsecs -= t.hours * 3600... | ALGO | 0.929808 | 4.093709 |
e6df5d3e-38c1-4432-b05b-aa8ef71aec90 | abhi061201/GFG-LEETCODE-CODINGNINJA-SOLUTION | 2130-maximum-twin-sum-of-a-linked-list/2130-maximum-twin-sum-of-a-linked-list.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:
int pairSum(ListNode*... | ALGO | 0.999986 | 5.537084 |
71a28939-bb92-4a7c-8278-8571aa4c6d0e | kirollosatef/problem-solving | others/not-completed-yet/MO_SAD/sheetA/Multiply_Large_Numbers_L50.cpp | #include <bits/stdc++.h>
using namespace std;
string multiple(string num1, string num2)
{
int lin1 = num1.size();
int lin2 = num2.size();
if (lin1 == 0 || lin2 == 0)
return 0;
vector<int> result(lin1 + lin2, 0); //? in reverse order
int i1 = 0, i2 = 0; //? to find positions
//* go from r... | ALGO | 0.999976 | 4.801455 |
9a6ef8b8-b4b3-4d6e-bf51-3dba7628c5e1 | suhrig/arriba | source/annotate_tags.cpp | #include <iostream>
#include <string>
#include <unordered_map>
#include "common.hpp"
#include "filter_blacklisted_ranges.hpp"
#include "read_compressed_file.hpp"
#include "annotate_tags.hpp"
using namespace std;
void load_tags(const string& tags_file_path, const contigs_t& contigs, const unordered_map<string,gene_t>&... | DATA | 0.855115 | 5.304166 |
2dca0356-00cf-479c-8525-2a384a883b31 | raincross7/code-similarity | codes/train_code/problem438/problem438_47.cpp |
#pragma GCC optimize("Ofast,unroll-loops,no-stack-protector,fast-math")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize (2)
#pragma G++ optimize (2)
#include <bits/stdc++.h>
#include <algorith... | ALGO | 0.999931 | 3.417973 |
0dc2e255-268c-4318-b124-c896512500dd | kmjp/procon | leetcode/biweekly/001-040/040/1668.cpp | typedef signed long long ll;
#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) me... | ALGO | 0.999815 | 4.030123 |
46f5612e-678f-4181-84b9-42ca21f40c41 | ancorp134/cp-problems | C_MAX-MEX_Cut.cpp | // Author : Ankit Tyagi
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL)
#define fri(i,a,b) for(int i=a;i<b;i++)
#define frd(i,a,b) for(int i=a;i>=b;i--)
#define pb push_back
#define vi vector<int>
#define vl vector<ll>
#define pp pop_back
#... | ALGO | 0.99995 | 4.871206 |
054eda17-054a-46a4-9fcf-6263354fde74 | Ahnuf-Karim-Chowdhury/Algorithms | 12.LCS/01.cpp | #include <bits/stdc++.h>
using namespace std;
void lcsAlgo(char *S1, char *S2, int m, int n) {
int LCS_table[m + 1][n + 1];
// Building the matrix in bottom-up way
for (int i = 0; i <= m; i++) {
for (int j = 0; j <= n; j++) {
if (i == 0 || j == 0)
LCS_table[i][j] = 0;
else if (S1[i - 1] ... | ALGO | 0.999987 | 4.804989 |
3949b68c-c24e-44da-ac39-d3552f37e4f2 | Precipitating/LeetCode | Remove K Digits/Source.cpp | #include <iostream>
#include <string>
using namespace std;
class Solution
{
public:
string removeKdigits(string num, int k)
{
// use string type as stack, no need to include a stack
for (char c : num)
{
// pop back of result if current num < back of result.
// ... | ALGO | 0.999874 | 6.563811 |
c9438471-8a72-4ab6-b6a5-6162bed3178a | ShammiAnand/cp-problemset | CF-1327A.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
long long t;
cin >> t;
while(t--){
long long n, k;
cin >> n >> k;
cout << (n % 2 == k % 2 && n >= k * k ? "YES\n" : "NO\n");
}
return 0;
} | ALGO | 0.999859 | 4.742968 |
419c90f5-bda0-4a10-8e66-c20168aa015c | DenizIsikli/Codeforces | Problemsets/__CompleteUpsolves/CodeforcesRound1035Div2/AddorXOR2119A.cpp | #include <iostream>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <string>
#include <queue>
#include <stack>
#include <cmath>
#include <unordered_map>
#include <unordered_set>
#include <numeric>
#include <functional>
#define int long long
#define endl '\n'
using namespace std;
void so... | ALGO | 0.999443 | 3.89234 |
9a8b9658-1377-4a3f-9706-2dcd96c44891 | Johniel/contests | codeforces/e146/A/main.cpp | // github.com/Johniel/contests
// codeforces/e146/A/main.cpp
#include <bits/stdc++.h>
#define each(i, c) for (auto& i : c)
#define unless(cond) if (!(cond))
// #define endl "\n"
using namespace std;
template<typename P, typename Q> ostream& operator << (ostream& os, pair<P, Q> p) { os << "(" << p.first << "," << p.... | ALGO | 0.999914 | 4.786344 |
8e20bc37-d373-4957-a1cc-4de2b4b62aa2 | Hiyabye/Baekjoon | 16xxx/16304.cpp | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
void solve(void) {
int n, x; cin >> n >> x;
vector<int> v(n);
for (int i=0; i<n; i++) cin >> v[i];
sort(v.begin(), v.end());
int ans = 1;
for (int i=1; i<n; i++) {
if (v[i-1] + v[i] > x) break;
ans++;
}
cout << ans... | ALGO | 0.99999 | 4.479866 |
a1f92776-add3-4a00-8612-630c2254648f | ishandutta2007/codeforces | eecs/normal/1578/E.cpp | #include <bits/stdc++.h>
using namespace std;
const int maxn = 100010, P = 1000000007;
int n, a[maxn], b[maxn], c[maxn];
long long sum[maxn], d[maxn];
int main() {
scanf("%d", &n);
// n = 100000;
// mt19937 rnd(time(0));
for (int i = 1; i <= n; i++) {
scanf("%d", &a[i]);
// a[i] = rnd(... | ALGO | 0.999805 | 4.255838 |
80f5092c-d952-4e27-ba4f-7ec6644c7b59 | Sanjeev12357/SanjeevDSA | graphs/code1.cpp | #include <iostream>
#include<unordered_map>
#include<list>
#include<vector>
#include<stack>
#include<limits.h>
using namespace std;
class Graph {
public:
//unordered_map<int,list<pair<int,int> > > adjList;
unordered_map<int,list<int> > adjList;
void addEdge(int u, int v,bool direction) {
//direction -> 0 -> undo... | ALGO | 0.999938 | 5.193384 |
9624fa74-0b1d-4bdf-8d2e-caba2b27f995 | debrup416/Competitive-Programming | CSES/Introductory-Problems/Number_Spiral.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define test long long int T; cin>>T; while(T--)
#define fc(a,b) if(abs(a-b) < le-9)
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
test{
ll x,y;
cin>>x>>y;
ll edge,start,mid,end;
edge=max(x,y);
... | ALGO | 0.999879 | 4.202183 |
edb36dc8-7595-4137-b270-e86a3fab78b1 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_1589_0.cpp | #include <bits/stdc++.h>
using namespace std;
int32_t main() {
long long int t;
cin >> t;
while (t--) {
long long int x, y, n, m = 0;
cin >> x >> y >> n;
m = n % x;
if (m == y)
cout << n << "\n";
else if (m > y)
cout << (n - (m - y)) << "\n";
else {
n -= m;
cout << ... | ALGO | 0.999887 | 3.605199 |
ca3c78cd-b21d-424f-952d-d17a44f0da39 | marinadabova/LeetCode | 9. Palindrome Number/9_solution.cpp | class Solution {
public:
bool isPalindrome(int x) {
if(x<0){
return false;
}
long long reversed;
long long temp = x;
while(temp){
reversed=reversed*10+temp%10;
temp/=10;
}
if(x==reversed){
return true;
}... | ALGO | 0.9999 | 5.962939 |
cf3217cd-27ea-4dea-b49a-1b9fb0f3f846 | Saleh7127/CPP-solution-by-Fellow_junior | GYM cf/gym cf 100687D.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define test int tt; cin>>tt; for(int cs=1;cs<=tt;cs++)
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
ll n,m,i,j,k,l,x;
cin>>n>>m>>k;
if((n+m)>3*k) cout<<-1<<endl;
else
{
ll lo=0,hi=m,ans... | ALGO | 0.999954 | 3.526696 |
5806be53-b49b-426a-989f-84550c386f6a | pch6828/PS_Algorithm | LeetCode/ALGORITHM/increasing_order_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.999996 | 6.440818 |
d7da9d68-fdf0-4676-8df6-fdd4a2afca7e | zwei-chen/slam_in_autonomous_driving_homework | thirdparty/g2o/g2o/apps/g2o_cli/g2o.cpp | #include <signal.h>
#include <iostream>
#include <iomanip>
#include <string>
#include <fstream>
#include <sstream>
#include <algorithm>
#include <cassert>
#include "dl_wrapper.h"
#include "output_helper.h"
#include "g2o_common.h"
#include "g2o/config.h"
#include "g2o/core/estimate_propagator.h"
#include "g2o/core/spa... | ALGO | 0.951656 | 6.410944 |
fd1b8617-a83e-4728-aeab-cc4f60a6a0b5 | ishandutta2007/codeforces | dario2994/normal/1726/D.cpp | #define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
#define SZ(x) ((int)((x).size()))
#define all(x) (x).begin(), (x).end()
// Returns the time elapsed in nanoseconds from 1 January 1970, at 00:00:00.
LL get_time() {
return chrono::duration_... | ALGO | 0.999761 | 4.945142 |
502ce072-ac5e-4ede-bdfe-9476c9d8e180 | jaecheol7406/Algorithm-Study | 02-10 월 17141_게리맨더링/주성.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <algorithm>
int n;
int map[11];
int visit[11];
int connect[11][11];
int a[11];
int b[11];
int min = 987654321;
int iscona(int cnta)
{
//printf("%d\n", cnta);
if (cnta == 0 || cnta == 6) return 0;
//printf("%d\n",cnta);
int flag = 0;
for (int i = 1; i <= c... | ALGO | 0.999874 | 3.190771 |
fceacc2e-57d7-4f2c-8f4a-be31168bec26 | amariurquhart/BridgeHW7 | au2261_hw7_q6.cpp | #include <iostream>
#include <vector>
using namespace std;
void main1();
void main2();
main(){
main1();
main2();
return 0;
}
void main1(){
int i = 0, commaChecker = 0;
string str, num, val;
cout << "Please enter a sequence of positive integers, each in a separate line.\nEnd your input b... | TOOL | 0.993375 | 3.931655 |
7cc721f5-1f63-427c-862b-6cd06d43c9ad | Richarani-tarase/leetcode | 0867-transpose-matrix/0867-transpose-matrix.cpp | class Solution {
public:
vector<vector<int>> transpose(vector<vector<int>>& matrix) {
int n=matrix.size();
int m=matrix[0].size();
vector<vector<int>>ans(m,vector<int>(n));
for(int i=0;i<matrix.size();i++)
{
for(int j=0;j<matrix[0].size();j++)
{
... | ALGO | 0.999988 | 6.334861 |
dbdc0bd9-f798-475b-ae22-33b4e021274a | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_7747_7.cpp | #include <bits/stdc++.h>
using namespace std;
long long ans = 0;
int nxt(int _i, int _n) { return _i == _n - 1 ? 0 : _i + 1; }
int prv(int _i, int _n) { return _i == 0 ? _n - 1 : _i - 1; }
struct Tree {
int n, n1, n3, id;
long long sum, maxD, maxx;
vector<vector<int> > gr;
vector<long long> down, up, d, maxUp, ... | ALGO | 0.999726 | 3.976188 |
a28d5050-4a16-4a29-a250-4d67ac1b1cfc | my-exercises/leetcode | 39-CombinationSum.cpp | class Solution {
public:
vector<vector<int>> combinationSum(vector<int>& candidates, int target) {
vector<int> history;
vector<vector<int>> result;
if (target <= 0) {
return result;
}
sort(candidates.begin(), candidates.end());
calculate(history, result, ... | ALGO | 0.999993 | 6.649012 |
4ae3bcfc-b269-4b2f-9773-d2151a78ba89 | PranavSitaraman/Competitive-Programming | USACO/Practice/USACO Fencing the Herd/USACO Fencing the Herd.cpp | #include "USACO Fencing the Herd.h"
using namespace std;
#define EPS 1e-9
typedef double num;
inline num nabs(num x)
{
return x < 0 ? -x : x;
}
bool num_lt(num X, num Y)
{
return X + max(num(1), nabs(Y)) * EPS < Y;
}
bool num_lteq(num X, num Y)
{
return X <= Y + max(num(1), nabs(Y)) * EPS;
}
bool num_eq(num... | ALGO | 0.999958 | 4.307013 |
d5e382d9-3ed8-4731-bf87-5910799aeca7 | agdestine/lidraughts-bot | engine/src/book.cpp |
// includes
#include <algorithm>
#include <cstdlib>
#include <fstream>
#include <iostream>
#include <string>
#include <vector>
#include "book.hpp"
#include "common.hpp"
#include "gen.hpp"
#include "hash.hpp"
#include "libmy.hpp"
#include "list.hpp"
#include "move.hpp"
#include "pos.hpp"
#include "score.hpp"
#include... | ALGO | 0.998483 | 6.231614 |
b1a76e32-a0df-469c-bcf8-02be185f4a42 | Exzorcist14/Yandex-Algorithm-Training | YandexAlgorithms#5.2/Task6(F).cpp | #include <bits/stdc++.h>
#define int long long
using namespace std;
int turnLeft(int n, const vector<int>& sectors, int a, int b, int k) {
int shiftA = (a - 1) / k;
int leftBorder = (shiftA % n);
int currMax = leftBorder;
int shiftB = (b - 1) / k;
int rightBorder = (shiftB % n);
if (shiftB... | ALGO | 0.999923 | 4.350043 |
75b147d7-7637-4621-8b1e-3c7fe7b186c2 | pushkarmishra/StandardAlgosAndDS | Binary_Search.cpp | #include <iostream>
using namespace std;
int binarysearch(int arr1[], int i, int j, int num) //For sorted arrays.
{
if (j - i < 2)
{
if (num == arr1[i])
return i+1;
else if (num == arr1[j])
return j+1;
else
return 0;
}
else
{
... | ALGO | 0.999858 | 4.91449 |
f4666178-b170-46d6-a942-6b913c2d3efa | Mecro-yair/02_ordenacion | 02_ordenacion/quickSort.cpp | #include <iostream>
#include <windows.h>
using namespace std;
void quickSort(int [],int );
void reduce(int [], int , int);
int main(){
SetConsoleOutputCP(CP_UTF8);
int tam;
cout << "Digite el tamaño del arreglo:"; cin >>tam;
int numeros[tam];
for (int i=0;i<tam;i++){
cout << "Digite el valor para "<<i+1<<": ... | ALGO | 0.999801 | 4.293653 |
c30adbc4-6d38-4945-93e5-1b229bca6649 | mhhm2005eg/CarND-Extended-Kalman-Filter-Project | src/ref/kalman_filter.cpp | #include "tools.h"
#include "kalman_filter.h"
#include <iostream>
#include <math.h>
using Eigen::MatrixXd;
using Eigen::VectorXd;
using std::cout;
using std::endl;
/*
* Please note that the Eigen library does not initialize
* VectorXd or MatrixXd objects with zeros upon creation.
*/
KalmanFilter::KalmanFilter... | ALGO | 0.968476 | 5.430175 |
fa2a973b-a819-4afb-a0b0-ca2296183ecd | EmilianoGonzalezG/Practicas-programaci-n | examen.cpp | //24041003 Emiliano Gonzalez Gallegos
//24040981 Carlos Ivan Chairez Valenzuela
#include <iostream>
#include <windows.h>
using namespace std;
int main()
{
SetConsoleOutputCP(CP_UTF8);
SetConsoleCP(CP_UTF8);
char c1[100],c2[100];
cout<<"Ingresa la primera palabra (max 100 caracteres): ";
cin.getline(... | ALGO | 0.997751 | 3.137964 |
cd8d6a3d-1d30-483e-89b9-8874e9ec95a3 | frankkn/I2P2 | Homework Online Judge/homework11/knuckle's name/0101.cpp | #include <iostream>
#include <string>
#include <cstring>
using namespace std;
int edges[2001][26];
int visited[2001];
int n;
void dfs(int i){
visited[i] = 1;
for(int j = 0; j < 26; ++j){
if(edges[i][j]){ // 確定當前的i跟字母有連
for(int k = 0; k < n; ++k){
if(!visited[k] && edges[k][j]){ // 確... | ALGO | 0.999842 | 4.219275 |
579a9292-5c68-49de-8f58-06c74de289f2 | Tencent/TencentKona-17 | src/hotspot/cpu/x86/macroAssembler_x86_adler.cpp | #include "precompiled.hpp"
#include "asm/assembler.hpp"
#include "asm/assembler.inline.hpp"
#include "runtime/stubRoutines.hpp"
#include "macroAssembler_x86.hpp"
#ifdef _LP64
void MacroAssembler::updateBytesAdler32(Register init_d, Register data, Register size, XMMRegister yshuf0, XMMRegister yshuf1, ExternalAddress a... | ALGO | 0.974137 | 6.684497 |
188e8ba3-7804-4ca8-becf-0469e30c2c8f | d3imos11/proga | laba14/laba14.cpp | // Задание 14: Создать текстовый файл с произвольным числом строк. Все строки переписать в обратном порядке.
#include <iostream>
#include <fstream>
#include <sstream>
#include <vector>
#include <algorithm>
using namespace std;
// Функция для реверса букв в каждом слове строки
string reverseWordsInString(const string&... | ALGO | 0.998311 | 5.01193 |
f1d17f61-3147-43f1-9c6a-7fa0493f80d3 | ishandutta2007/codeforces | rns3/normal/912/E.cpp | #include <bits/stdc++.h>
using namespace std;
const long long INF = 1ll << 60;
#define N 22
int p[N];
int n;
map <long long, long long> mp[N];
int E = 0, F = 0, G = 0;
long long b[77], c[7777], d[77777], e[777777], f[777777], g[2777777];
long long func(long long val, int m) {
if (m == 6) {
int id = lower_bound... | ALGO | 0.999982 | 3.597463 |
0b8c2a53-8025-4f7c-b00b-c7079e641884 | gyq18/AutonomousDrivingTrajectoryPlanning | Cpp/ConvertPathToTrajectory/PlanSpeedForDynamicScenarios/eigen-3.4.0/doc/examples/Tutorial_BlockOperations_colrow.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace std;
int main()
{
Eigen::MatrixXf m(3,3);
m << 1,2,3,
4,5,6,
7,8,9;
cout << "Here is the matrix m:" << endl << m << endl;
cout << "2nd Row: " << m.row(1) << endl;
m.col(2) += 3 * m.col(0);
cout << "After adding 3 times the first colu... | ALGO | 0.9821 | 3.576145 |
01f1f23c-4ebc-41fc-8add-824dc46c3e8d | ottenbreit-data-science/aplr | dependencies/eigen-3.4.0/bench/sparse_setter.cpp |
//g++ -O3 -g0 -DNDEBUG sparse_product.cpp -I.. -I/home/gael/Coding/LinearAlgebra/mtl4/ -DDENSITY=0.005 -DSIZE=10000 && ./a.out
//g++ -O3 -g0 -DNDEBUG sparse_product.cpp -I.. -I/home/gael/Coding/LinearAlgebra/mtl4/ -DDENSITY=0.05 -DSIZE=2000 && ./a.out
// -DNOGMM -DNOMTL -DCSPARSE
// -I /home/gael/Coding/LinearAlgebr... | ALGO | 0.990524 | 4.152793 |
88979d59-a945-48f6-8211-991bf23d8737 | NikkitheUser/DataStructuresCourse | week 2/hw2-1.cpp | //title: hw2_1.cpp
//Abstract: this program will ask a user choses between 3 operations
//1. deletes the max number 2. appends an empty zero 3. reverses the array
//ID: 1507
//Name: Nicole Safty
//Date: 09/03/2021
#include <iostream>
using namespace std;
int main() {
int num[10]={10,20,30,40,50,15,25,35,45,55};
int ch... | TOOL | 0.962746 | 3.890984 |
f58b2f6b-ceff-4444-aab0-0c7bf0c6493e | Ccode104/DSA-Practice | 1 week prep/Day1.cpp | #include <bits/stdc++.h>
using namespace std;
string ltrim(const string &);
string rtrim(const string &);
vector<string> split(const string &);
/*
* Complete the 'plusMinus' function below.
*
* The function accepts INTEGER_ARRAY arr as parameter.
*/
void plusMinus(vector<int> arr) {
float r1=0,r2=0;
vector<int... | ALGO | 0.998428 | 4.670587 |
96094724-4f4d-4d93-bbf5-ce9625afdabc | HT-hlf/huawei_old_slam_ws | fast_gicp/thirdparty/Eigen/test/visitor.cpp | #include "main.h"
template<typename MatrixType> void matrixVisitor(const MatrixType& p)
{
typedef typename MatrixType::Scalar Scalar;
Index rows = p.rows();
Index cols = p.cols();
// construct a random matrix where all coefficients are different
MatrixType m;
m = MatrixType::Random(rows, cols);
for(Ind... | TEST | 0.8842 | 6.871651 |
4cd30c84-cb5b-4804-8c3d-c94fa81303d6 | Danila51/contests_2020_1 | контесты/контест_11/d.cpp | #include<iostream>
#include<vector>
#include<map>
#include<set>
using namespace std;
int main() {
int n, m, a, b;
cin >> n >> m;
map<int, set<int>> graph;
for (int i = 0; i < n; ++i) {
set<int> tmp = {i};
graph[i] = tmp;
}
for (int i = 0; i < m; ++i) {
cin >> a >> b;
if (graph[a].find(b) != graph[a].end... | ALGO | 0.999925 | 3.767436 |
3fef45fa-ba68-4b93-a01c-a3c148e9d894 | KimYunsang-v/AlgoPSS | PS/DP/BOJ1914.cpp | #include <cassert>
#include <vector>
#include <iostream>
#include <algorithm>
#include <math.h>
#include <string>
using namespace std;
int n;
void hanoi(int size, int start, int middle, int end){
// : ̸ ű
if( size == 1 ){
printf("%d %d\n", start, end);
return;
}
hanoi(size-1, start, end, middle ); // ... | ALGO | 0.999912 | 3.962727 |
01cda43c-bd02-4ad0-a18d-4a3981af40db | francistec/uvm-logica-y-programacion-estructurada | actividad-3/c/ejercicio-3-estructuras-repetitivas.cpp | #include <stdio.h>
#include <windows.h>
// Función para verificar si un número es par o impar
void verificarParImpar(int numero) {
if (numero % 2 == 0) {
printf("%d es un número par.\n", numero);
} else {
printf("%d es un número impar.\n", numero);
}
}
int main() {
SetConsoleOutputCP(... | TOOL | 0.905576 | 4.795655 |
e0f7c802-b960-4394-9fdb-ce40e5f0d817 | Vinit-28/CodingPractice | Medium/Encode and Decode TinyURL.cpp |
// Question Link :: "https://leetcode.com/problems/encode-and-decode-tinyurl/"
// Solution //
class Solution {
public:
int count;
map<string, string> hashMap;
Solution(){
count = 1;
hashMap.clear();
}
// Encodes a URL to a shortened URL.
string encode(string longUrl... | ALGO | 0.983152 | 6.568406 |
43f41e59-eec1-4197-8a58-0dfbcfef472d | novaardiansyah/teknik-informatika-s1 | semester-04/praktikum-struktur-data/pertemuan-08/tugas-praktikum/lat8_2.cpp | #include <iostream>
#include <string>
using namespace std;
int main()
{
cout << "Nama \t: Nova Ardiansyah\n";
cout << "NIM \t: 211011401309\n";
cout << "=========================\n\n";
int Nilai[20];
int i, j, N, l;
int temp, U, lmaks;
cout << "Masukkan banyaknya bilangan : ";
cin >> N;
for (i = 0... | ALGO | 0.998971 | 4.108102 |
bc67a394-db10-4d22-9d20-a3e60bdc7918 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_9968_33.cpp | #include <bits/stdc++.h>
#pragma GCC optimize("O3", "unroll-loops")
using namespace std;
const long long inf = numeric_limits<long long>::max() / 2;
const long double eps = 1e-9;
const long double pi = acos(-1);
long long n;
set<long long> ss;
long long solve() {
if (n < 50) {
for (long long i = 0; i <= n; i++) {... | ALGO | 0.999942 | 4.848701 |
1341c1fd-5fd3-4ae8-bda3-1229e422e28b | jayeshdhakate73/DSA | 2108-minimize-the-difference-between-target-and-chosen-elements/minimize-the-difference-between-target-and-chosen-elements.cpp | #include <iostream>
#include <vector>
#include <climits>
#include <unordered_map>
using namespace std;
class Solution {
public:
vector<vector<int>> dp; // Memoization table
int Solve(vector<vector<int>>& mat, int target, int sum, int row) {
if (row == mat.size()) {
return abs(target - sum)... | ALGO | 0.999986 | 6.6137 |
8bc01685-a69d-4cc4-8eb2-90ac17937f5d | guswns8431/algorithm | boj/boj_5522.cpp | #include <iostream>
using namespace std;
int main()
{
int input[5];
int sum = 0;
for(int i = 0 ; i < 5 ; i++)
{
cin >> input[i];
sum += input[i];
}
cout << sum << endl;
return 0;
}
| ALGO | 0.998626 | 3.244479 |
d8e01e21-330d-48b1-a1b7-08a5782a8913 | sunputawan/POSNC-Archive | POSNC/2564/pre toi/self/beta/1038.cpp | #include <bits/stdc++.h>
using namespace std;
int n,k;
double dp[(1<<21)];
double a[21][21];
int main(){
cin>>n;
for(int i=0;i<n;i++){
for(int j=0;j<n;j++){
cin>>a[i][j];
a[i][j]/=100;
}
}
dp[0] = 1;
for(int i=0;i<(1<<n);i++){
int cnt = __builtin_popc... | ALGO | 0.999923 | 3.575429 |
ce0cf7e6-044b-4662-9564-6475365ae3cd | koba-e964/contest | codeforces/startcup-3.0-r1/b.cpp | #include <algorithm>
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <str... | ALGO | 0.999631 | 3.289252 |
eb2f6b7c-e30d-4811-977f-951a63cb2493 | TheRealMolen/adventofcode21 | aoc/day3.cpp | #include "pch.h"
#include "harness.h"
int day3(const stringlist& input)
{
int bitlength = (int)input[0].length();
vector<int> bitcounts(bitlength, 0);
for (auto& line : input)
{
for (int bit = 0; bit < bitlength; ++bit)
{
if (line[bit] == '1')
++bitcounts[bi... | ALGO | 0.994152 | 6.157744 |
5504dab8-9137-4eb7-af22-31eb644ec3b5 | gabriel-candeia/Competitive-Programming-Solutions | URI/1310.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int n;
vector<int> arr(100,0);
while(cin >> n){
int custo;
cin >> custo;
for(int i=0;i<n;i++) cin >> arr[i], arr[i]-=custo;
int answ = 0, best = 0;
for(int i=0;i<n;i++){
best = max({ar... | ALGO | 0.999572 | 3.660784 |
c4db6b00-46da-4a42-a9c6-9d39a580c1e0 | Betraktoed/cpp | lab3,5/main.cpp | #include <iostream>
#include <fstream>
#include "Matrix.h"
using namespace std;
int main(int argc, char** argv) {
std::fstream fileA, fileB;
CMatrix A, B;
fileA.open(argv[1]);
fileB.open(argv[2]);
A>>fileA;
B>>fileB;
if (A == B){
cout << "DIO DAA" << endl;
}
(A * B)<<(std::cout);
re... | ALGO | 0.920294 | 3.827242 |
a2d7a218-5fcd-49bc-892e-1a8c81bdc9d2 | davil2020/Competitive-Programming | geometry/1_basic_geometry/polygon_lattice_points.cpp | #include <bits/stdc++.h>
using namespace std;
#define _ ios_base::sync_with_stdio(false); cin.tie(0);
#define rep(i,a,b) for(int i = a; i <= b; i++)
#define f first
#define s second
#define pb push_back
#define MAXN 200010
typedef long long ll;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<vec... | ALGO | 0.99958 | 4.512755 |
9deeaa9b-29fe-40f5-9102-e1e6b776bbe4 | axtonio/Cpp | ProgramFiles/algorithms/QuickSort.cpp | #include <iostream>
void quicksort(int *arr, int left, int right) {
int pivot = arr[left], i = left, j = right + 1, p = left, z = right + 1;
if (right <= left) {
return;
}
while (true) {
while (arr[++i] < pivot) {
if (i == right) {
break;
}
}
while (arr[--j] > pivot) {
... | ALGO | 0.999995 | 5.120625 |
5632aa92-7587-4553-8c9d-442d2e638d48 | manikanta2901/ubuntu | .history/SRM/placementPractice/HackerRank/DataStructure/DetectCycle_20210310190237.cpp | #include<bits/stdc++.h>
using namespace std;
struct Node
{
int data;
struct Node *next;
};
void printList(struct Node *a){
cout << "List : ";
while(a != NULL){
cout << a->data << " ";
a = a->next;
}
cout << endl;
}
Node* GetInput(int size){
struct Node *temp,*head = NULL;
... | ALGO | 0.999556 | 3.20981 |
fd1c843b-44bd-480b-9ff1-c812deaeaca7 | 7cristovao/cpp | exercicios/capitulo05/05-01.cpp | #include <iostream>
#include <cmath>
using namespace std;
int main(int argc, char *argv[])
{
double a, b, m;
cout << "\na = "; cin >> a; cout << "\nb = "; cin >> b;
m = (a * 3 + b * 5)/8;
if (m>5)
cout << "\naprovado";
else
cout << "\nreprovado\n";
system("\n read -p 'Aperte qu... | ALGO | 0.990901 | 3.583868 |
dc36631f-51d2-45a6-9f26-574009872001 | sameercr7/MY-90-DAYS-DSA- | LEETCODE/STRINGS/integer to roman.cpp | // link-https://leetcode.com/problems/integer-to-roman/
// yourube link-https://www.youtube.com/watch?v=S3QoNsBghec&t=735s
// 2nd youtube link-https://www.youtube.com/watch?v=Rsq1ObYg6ak
Integer to Roman
class Solution {
public:
string intToRoman(int num) {
string ans = "";
while(num>=1000)
{
... | ALGO | 0.999803 | 6.683354 |
8c8bbb56-10d3-41e8-9752-73a947e9fafc | JatinGarg19/Leetcode-Coding-Problems | 0238-product-of-array-except-self/0238-product-of-array-except-self.cpp | class Solution {
public:
vector<int> productExceptSelf(vector<int>& nums) {
int n = nums.size();
vector<int> L(n, 1);
vector<int> R(n, 1);
vector<int> result(n, 1);
for(int i = 1; i < n; i++){
L[i] = L[i - 1] * nums[i - 1];
}
... | ALGO | 0.999974 | 6.721571 |
a0fce891-d653-4b66-a603-6c4ed61ac78c | Kourin1996/CompetitiveProgramming | YNUCPC/20170417/b.cpp | #include <iostream>
#include <cmath>
#include <algorithm>
#include <stdio.h>
using namespace std;
int N = 0;
double ans = 0.0;
int r[1000] = {0};
int sum = 0;
int main(void){
cin >> N;
for(int i=0; i<N; ++i){
cin >> r[i];
}
sort(r, r+N);
int cnt = 0;
for(int i=N-1; i>=0; --i){
... | ALGO | 0.999734 | 3.976642 |
2a71067c-45b9-47e0-8da6-a09e7c112cd8 | Littlehhh/OJ-practice | 算法入门经典练习/UVa140.cpp |
// UVa140 Bandwidth
// Rujia Liu
#include<cstdio>
#include<cstring>
#include<vector>
#include<algorithm>
using namespace std;
const int maxn = 10;
int id[256], letter[maxn];
int main() {
char input[1000];
while(scanf("%s", input) == 1 && input[0] != '#') {
// 计算结点个数并给字母编号
int n = 0;
for(char ch = 'A... | ALGO | 0.999917 | 3.648848 |
50641da9-34b2-4f99-8e73-01f7c1ad1562 | rasibn/competitive-programming | greetingcard/greetingcard.cpp | #include <iostream>
#include <unordered_set>
#include <utility>
#include <vector>
using namespace std;
struct PairHash {
template <typename T1, typename T2>
auto operator()(const pair<T1, T2> &p) const -> size_t {
return (hash<T1>{}(p.first) << 32) | hash<T2>{}(p.second);
}
};
int main() {
int n;
cin >>... | ALGO | 0.998738 | 4.458804 |
1129a8d9-243b-467c-9e10-468e9eb1e543 | eylulaykose/TravelApp | 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.