uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
5f571ec8-2c23-4534-a080-a8f6998cf217 | JunHossain/Competitive-Programming | Codechef/OR Permutation.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int t;
cin >> t;
while(t--){
int n;
cin >> n;
for(int i=1; i<=n; i++){
cout << i << " ";
}
cout << endl;
}
}
| ALGO | 0.999924 | 4.763056 |
ea513f22-4ad3-4171-9e8f-d7f10d99a529 | ashudevcplusplus/stl | Challenge_1_Solution/main.cpp | // Section 20
// Challenge 1 - Solution
// Identifying palindrome strings using a deque
#include <cctype>
#include <deque>
#include <iostream>
#include <string>
#include <vector>
#include <iomanip>
bool is_palindrome(const std::string& s)
{
std::deque<char> d;
// add all the string characters that are alpha t... | ALGO | 0.997351 | 6.770932 |
e7ed662c-c907-458a-a6c2-5a00119326c5 | leverimmy/Codes | 比赛/学校/2019-9-28测试/source/PC17_HB-马杰成/lemouse.cpp | #include<bits/stdc++.h>
#define inf 0x3f3f3f3f
using namespace std;
const int maxn=1000010;
const int maxm=8000010;
int a[1010][1010];
int sum[1010][1010];
int n,m;
const int dx[5]={0,-1,0,0,1};
const int dy[5]={0,0,-1,1,0};
struct node{
int to;
int next;
int w;
}e[maxm];
int head[maxn],cnt;
void add(int u,int v,int... | ALGO | 0.99996 | 3.516426 |
f7c44e3b-0259-456a-89d3-563b6456f62e | ishandutta2007/codeforces | .tx/normal/665/B.cpp | #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <deque>
#include <string>
#include <memory.h>
#include <bitset>
#define sci(a) scan... | ALGO | 0.999809 | 3.08649 |
c4fedf6e-1f23-4d4a-b26c-399efa003a6d | Disciple-G/LLVM-code | lib/CodeGen/ReachingDefAnalysis.cpp | #include "llvm/CodeGen/ReachingDefAnalysis.h"
#include "llvm/CodeGen/TargetRegisterInfo.h"
#include "llvm/CodeGen/TargetSubtargetInfo.h"
using namespace llvm;
#define DEBUG_TYPE "reaching-deps-analysis"
char ReachingDefAnalysis::ID = 0;
INITIALIZE_PASS(ReachingDefAnalysis, DEBUG_TYPE, "ReachingDefAnalysis", false,
... | ALGO | 0.995891 | 7.498032 |
399cd988-728e-4609-95e7-4dba7d39ae05 | MichaelLynnCSU/253labs | node/node.cpp | // node.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
using std::cout;
using std::endl;
struct node {
node *next = NULL;
int value;
};
int main()
{
node *root = new node;
root->value = 5;
root->next = NULL;
node *temp = root;
int i = 0;
while (i < 5... | ALGO | 0.881336 | 3.946857 |
8bab5e17-3458-4615-850e-90b7dba7af88 | viscap/koalla | src/AdaptiveThreshold.cpp | #include <stdlib.h>
#include "AdaptiveThreshold.h"
void adaptiveThreshold(unsigned char* input, unsigned char* output, int width, int height)
{
long sum = 0;
unsigned long* integralImage;
int i, j;
int count = 0;
int index;
int x1, y1, x2, y2;
int s = width / 8;
integralImage = (unsigned long*)malloc(width... | ALGO | 0.99934 | 4.972371 |
6bc44a93-7b23-4bb6-88ac-27bc4657c02c | brenimcode/CompetitiveProgramingSolving | Estrutura de dados/balanco.cpp | #include <bits/stdc++.h>
using namespace std;
#define DEBUG(x) cout << #x << " --->>> " << x << endl
#define int long long
int32_t main()
{
string str;
while (getline(cin, str))
{
bool ans = true;
stack<int> pilha;
int len = str.size();
for(int i = 0; i < len ;i++) {
... | ALGO | 0.999419 | 4.65552 |
c57d7238-5d47-4b23-94ff-3d46761de154 | archeos/micmac-archeos | src/uti_phgrm/CPP_CreateEpip.cpp | #include "StdAfx.h"
cCpleEpip * StdCpleEpip
(
std::string aDir,
std::string aNameOri,
std::string aNameIm1,
std::string aNameIm2
)
{
if (aNameIm1 > aNameIm2) ElSwap(aNameIm1,aNameIm2);
cInterfChantierNameManipulateur * anICNM = cInterf... | ALGO | 0.995031 | 4.744236 |
27cd3ab8-8e9a-4cc9-91b7-d54b521c510d | yubowen0525/tree_arithmetic | Huffman_Tree/main.cpp | //
// Created by ybw on 2020/4/2.
//
//#include "HuffmanTree.h"
//////////////////////////////////////////////////Huffman_Code
#include <queue>
#include <map>
#include <string>
#include <algorithm>
#include <iostream>
using namespace std;
priority_queue<int,vector<int>,greater<int>> q;
map<char,int> Huffman_Base;
st... | ALGO | 0.999863 | 4.213053 |
868c6213-9bf1-4fca-8313-72ff2069fc8f | bhavyawig/Competitive-Programming | Gymkhana Election IIIT-A codevhef.cpp |
#include<bits/stdc++.h>
using namespace std;
typedef long long int lli;
int main()
{
int test;
cin>>test;
for(lli e=0;e<test;e++)
{
lli n,m;
cin>>n>>m;
cout<<(m/2)+1<<endl;
}
return 0;
}
| ALGO | 0.999767 | 3.76735 |
69d95fd6-8bd2-4a41-bd60-3bb246426d82 | allocator64/prak | 03-2-Grades-2/main.cpp | #include <iostream>
#include <fstream>
#include <string>
#include <iterator>
#include <vector>
#include <map>
using namespace std;
int main(int argc, char **argv)
{
ifstream fin("02-2.in");
ofstream fout("02-2.out");
map<string, pair<int, int> > m;
string name;
int mark;
while (fin >> name >... | ALGO | 0.98573 | 4.481104 |
30572e39-192a-4b3f-89c0-52e53a8ddf84 | guojinc/code | acm/cf/973div2/20130.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define uint unsigned long long
#define pii pair<int, int>
#define umap unordered_map
#define uset unordered_set
#define all(a) a.begin(),a.end()
#define bg begin()
#define ed end()
#define mod 998244353
#define mod7 1e9 + 7
#define ios ios::sync_with_... | ALGO | 0.999778 | 5.412059 |
86902b99-797f-4a9a-b935-a2215b511fc6 | haru210/atcoder | ABC410/A.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long int;
using pint = pair<int,int>;
using pll = pair<long long, long long>;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i,n) for (int i = 1; i <= (int)(n); i++)
#define YesNo(bool) if(bool) cout << "Yes" << endl; else cout << "No" <<... | ALGO | 0.999871 | 3.942413 |
d3737117-d2d5-46b1-a0f5-b04d7fef7da5 | sounishnath003/CPP-for-beginner | LengthOfStringPTR/LengthOfStringPTR.cpp | #include<iostream>
using namespace std ;
class LengthOfStringPTR
{
private:
public:
int stringLen(char *p) {
int count = 0;
while (*p != '\0')
{
count++;
p ++ ;
}
return count;
}
};
int main(int argc, char const *argv[])
{
LengthOfStringPTR o... | ALGO | 0.991981 | 3.644754 |
2f516a85-a589-4fc5-b73e-987ce7085a95 | bremedios/libbpl_graphics | libbpl_graphics/src/collider/Collider.cpp | //
// Created by Bradley Remedios on 10/27/24.
//
#include <SDL2/SDL.h>
#include <bpl/graphics/collider/Collider.h>
namespace bpl::graphics::collider {
bool Collider::IsColliding(const SDL_Rect &rect1, const SDL_Rect &rect2) {
// If rect1 is right of rect 2, we are not colliding.
if ((rect1.x + r... | TOOL | 0.947805 | 6.552351 |
6c7dc4c2-3706-4f89-b17b-a4a15e668dd6 | Emilorv/Cpp-tasks | Exercise9/main.cpp | #include <algorithm>
#include <functional>
#include <iostream>
#include <vector>
std::ostream &operator<<(std::ostream &out, const std::vector<int> &table) {
for (auto &e : table)
out << e << " ";
return out;
}
template <typename Type>
void print(std::string text, Type value) {
std::cout << text << value <<... | ALGO | 0.998673 | 5.204676 |
7830e7ba-ded3-47a2-8f0a-836cad43b5e2 | suchijain30/45daycode | midelement.cpp | #include<iostream>
using namespace std ;
int main()
{
int t ;
cin>>t ;
while (t--)
{
int a , b , c ;
cin>>a>>b>>c;
if(b>a && a>c)
cout<<a<<endl;
else if (c>a && a>b)
cout<<a<<endl;
else if(a>b && b>c)
cout<<b<<endl;
else if(c>b && b... | ALGO | 0.99991 | 3.794144 |
bf1ca317-80a7-4f1c-87dc-c4c2871bdef5 | komalshinde-dev/OperatingSystems_Lab_SEM3 | Memory_Management/fifo_page_replacement.cpp | #include <iostream>
using namespace std;
int fifoPageReplacement(int pages[], int n, int capacity) {
int frame[capacity];
bool inMemory[100] = {false}; // Assumes pages range from 0 to 99
int pageFaults = 0;
int index = 0; // To keep track of the oldest page in FIFO
for (int i = 0; i < n; i++) {... | ALGO | 0.999898 | 6.720088 |
da727989-ccfc-4a15-abac-da10e72c4102 | Ceruleanacg/Crack-Interview | Legacy/104. Merge K Sorted Lists/main.cpp | #include <iostream>
#include <algorithm>
#include <vector>
class ListNode {
public:
int val;
ListNode *next;
ListNode(int val) {
this->val = val;
this->next = NULL;
}
};
bool compare(const ListNode *a, const ListNode *b) {
return a->val < b->val;
}
class Solution {
public:
... | ALGO | 0.999969 | 5.651692 |
011b68f4-6248-47b2-b5ef-68d0d5195d51 | vfolunin/archives-solutions | UVa Online Judge/13291.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <string>
using namespace std;
bool solve() {
int n;
if (!(cin >> n))
return 0;
vector<long long> width(3);
for (int i = 0; i < n; i++) {
long long w;
cin >> w;
width[i % 3]... | ALGO | 0.99982 | 3.531502 |
8722c2d1-ff0d-4e53-a4a3-40f9ea6fa108 | iloginov/programming-workout | leetcode/10-regular-expression-matching/solution.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <iterator>
#include <sstream>
#include "gmock/gmock.h"
using namespace std;
class Solution {
public:
//
// Assume that p is not empty;
//
string getPart(string p) {
if (p.length() > 1 && p[1] == '*') {
return p.s... | TEST | 0.983987 | 5.982729 |
3241a196-9376-4cca-8379-6bfe04d58010 | ishandutta2007/codeforces | galen_colin/normal/406/E.cpp | #include "bits/stdc++.h"
using namespace std;
/*
find my code templates at https://github.com/galencolin/cp-templates
also maybe subscribe please thanks
*/
#define send {ios_base::sync_with_stdio(false);}
#define help {cin.tie(NULL);}
#define f first
#define s second
#define getunique(v) {sort(v.begin(), v.end())... | ALGO | 0.999941 | 3.953069 |
6be1d160-ee6b-4a3f-90d1-1f3f743a8a90 | Lioneldu/- | Algorithm/HeapSort.cpp | #include <iostream>
#include <algorithm>
using namespace std;
// 堆排序:(最大堆,有序区)。从堆顶把根卸出来放在有序区之前,再恢复堆。
void max_heapify(int arr[], int start, int end) {
//建立父節點指標和子節點指標
int dad = start;
int son = dad * 2 + 1;
while (son <= end) { //若子節點指標在範圍內才做比較
if (son + 1 <= end && arr[son] < arr[son + 1]) //先比較兩個子節點大小,選擇最大的
... | ALGO | 0.999994 | 4.355733 |
a2940a34-29f1-463c-b951-2a1b7c671c52 | smadi0x86/Hallucina | obfuscator-llvm/libcxx/test/std/algorithms/alg.nonmodifying/alg.adjacent.find/adjacent_find.pass.cpp | // <algorithm>
// template<ForwardIterator Iter>
// requires EqualityComparable<Iter::value_type>
// constexpr Iter // constexpr after C++17
// adjacent_find(Iter first, Iter last);
#include <algorithm>
#include <cassert>
#include "test_macros.h"
#include "test_iterators.h"
#if TEST_STD_VER > 17
TEST_CONSTEX... | TEST | 0.978264 | 5.942791 |
7709a3b9-0660-4c60-8ad5-bd515bf69212 | Babal1111/learning_dsa | PepClass/array/2DarraySearch.cpp | #include<iostream>
using namespace std;
void arrSearchEfficient(int arr[][4],int m,int n,int target){
int i = 0, j = n - 1;
while (i < m && j >= 0) {
if (arr[i][j] == target) {
cout << "Element is present at index [" << i << "][" << j << "]";
return;
}
els... | ALGO | 0.999551 | 4.400064 |
a7e731db-5f39-4e21-9179-41366ce01a1c | array-tree/Codespace | luogu/P1000-2000/P1567 统计天数.cpp | #include<bits/stdc++.h>
using namespace std;
priority_queue<int> q;
int shu;
int main()
{
// freopen("P1567_2.in","r",stdin);
ios::sync_with_stdio(false);
cin>>shu;
int max_=-9999999,sheng=0;
for(int p=1;p<=shu;p++)
{
int w;
cin>>w;
if(w>max_)
{
max_=w;
sheng++;
// cout<<w<<"l"<<endl;
}... | ALGO | 0.99979 | 3.278958 |
45437db8-9676-4088-bc60-a46ea072c662 | amymayadi/LeetCode | C++/E169MajorityElement/E169MajorityElement_DivideConquer.cpp | //
// Created by MaYadi on 2018/4/11.
//
/**
* Divide and Conquer
* time:O(nlogn)
* space:O(logn)
*/
#include <iostream>
#include <vector>
#include <sstream>
#include <include/c++/algorithm>
using namespace std;
class Solution {
public:
int majorityElement(vector<int>& nums) {
return majorityElemen... | ALGO | 0.999971 | 5.816378 |
601bb7e7-fa31-4f41-bc97-f3f0241fcc6f | sarvex/leetcode-typescript | solution/2100-2199/2185.Counting Words With a Given Prefix/Solution.cpp | class Solution {
public:
int prefixCount(vector<string>& words, string pref) {
int ans = 0;
for (auto& w : words) ans += w.find(pref) == 0;
return ans;
}
}; | ALGO | 0.999901 | 6.099126 |
80ddb3b2-8a99-478d-9e6f-7b360a953931 | albexl/codeforces-gym-submissions | gym/102700/B.cpp | #include <bits/stdc++.h>
using namespace std;
#ifdef Adrian
#include "debug.h"
#else
#define debug(...) 9999
#endif
typedef long long ll;
typedef long double ld;
typedef complex<ll> point;
#define F first
#define S second
#define ii pair<ll,ll>
template<typename G1, typename G2 = G1, typename G3 = G1>
struct triple{... | ALGO | 0.999985 | 3.962214 |
754d9582-26fa-40d1-8980-d02295a90e09 | kuldeeprec/codeforces | bor.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int main()
{
int t;
cin >> t;
while (t--)
{
int k = 0, h, i = 0, j, l = 0;
int x, acount = 0, count = 0;
cin >> x;
h = x;
while (x > 0)
{
x = x / 10;
k++;
}
h = h % 10;
i = 4 * h - 4 + k;
while ... | ALGO | 0.9994 | 3.750452 |
c3ab5cc2-08ea-4a74-9326-e73cdec8ca21 | godcrampy/leetcode-solutions | 167-two-sum-2/cpp/main.cpp | class Solution {
public:
vector<int> twoSum(vector<int>& numbers, int target) {
int l = 0;
int r = numbers.size() - 1;
while (l < r) {
int sum = numbers[l] + numbers[r];
if (sum < target) {
++l;
} else if (sum > target) {
--r;
} else {
return {l + 1, r + 1... | ALGO | 0.999827 | 6.79493 |
95f0883e-1e41-4d62-b758-f1aa971bb128 | amankhullar/Operating-System-Concepts | test_dining_philosophers/main.cpp | #include<iostream>
#include<thread>
#include<mutex>
#include<condition_variable>
std::mutex m;
std::condition_variable cv;
int chopstick[5]={1,1,1,1,1};
void hungry(int p_id)
{
std::unique_lock<std::mutex> lk(m);
while(chopstick[p_id]==0||chopstick[(p_id+4)%5]==0)
cv.wait(lk);
std::cout<<"philoso... | ALGO | 0.999215 | 3.416744 |
7cf0ff0c-7047-4f58-88cb-55e6e421b123 | Saptarshidas131/Competitive-Coding | builds-linux/template-t.cpp | /*
author: 3lit3Coder
*/
#include <bits/stdc++.h>
using namespace std;
typedef short int si;
typedef unsigned short int us;
typedef unsigned int ui;
typedef long int li;
typedef unsigned long int ul;
typedef long long int ll;
typedef unsigned long long int ull;
typedef float fp;
typedef double db;
typedef long double ... | ALGO | 0.99841 | 3.950875 |
2ff08597-1516-4580-8aee-17984f3060a4 | anusha2009/leetCodeSubmissions | 4-median-of-two-sorted-arrays/median-of-two-sorted-arrays.cpp | class Solution {
public:
int p1 = 0, p2 = 0;
// Get the smaller value between nums1[p1] and nums2[p2] and move the
// pointer forward.
int getMin(vector<int>& nums1, vector<int>& nums2) {
if (p1 < nums1.size() && p2 < nums2.size()) {
return nums1[p1] < nums2[p2] ? nums1[p1++] : num... | ALGO | 0.999993 | 6.36141 |
6c911345-4882-425a-b939-66c290c200a1 | mynameisjohn/PyRenderer | Source/SpeculativeContacts.cpp | #include <glm/glm.hpp>
#include "SpeculativeContacts.h"
#include "RigidBody.h"
#include "Audible.h"
Contact::Contact(RigidBody_2D * a, RigidBody_2D * b, const vec2 p_a, const vec2 p_b, const vec2 nrm, const float d) :
pair{ a, b },
pos{ p_a, p_b },
normal(nrm),
dist(d),
curImpulse(0),
isColliding(false)
{
asse... | ALGO | 0.999301 | 6.060524 |
e19f59c5-a086-4ca4-85f3-811b0b49523c | shivvvank/Algorithms | Recursion/PrintNTo1Backtrack.cpp | #include<bits/stdc++.h>
using namespace std;
void PrintNTo1Backtrack(int i,int n)
{
if(i>n)
return;
PrintNTo1Backtrack(i+1,n);
cout<<i<<endl;
}
int main()
{
int n ;
cout<<"Enter n : ";
cin>>n;
PrintNTo1Backtrack(1,n);
return 0;
} | ALGO | 0.99964 | 4.034108 |
8644153f-e1ad-4da6-b0fb-9b8836550b66 | VivekAgrawal2005/ds | 11avltree.cpp | #include <iostream>
using namespace std;
struct Node
{
int key;
Node *left;
Node *right;
int height;
};
// Utility: Get height of node
int height(Node *n)
{
return n ? n->height : 0;
}
// Utility: Get max of two integers
int max(int a, int b)
{
return (a > b) ? a : b;
}
// Create a new node
... | ALGO | 0.999212 | 6.374763 |
ec0b545f-e37f-4c3d-a9c7-e80dd2a1649c | Bristisul123/Problems | week12/Day-2/a.cpp | #include <bits/stdc++.h>
#define int long long
#define all(x) x.begin(), x.end()
#define yes cout<<"YES"<<"\n"
#define no cout<<"NO"<<"\n"
#define nl "\n"
#define lower(x) transform(x.begin(), x.end(), x.begin(), ::tolower)
#define upper(x) transform(x.begin(), x.end(), x.begin(), ::toupper)
typedef unsigned long long ... | ALGO | 0.997509 | 3.939855 |
10f58412-eb1a-4eba-ae7e-340c28221932 | sevanescence/assignments | challenges/vowel_count/vowelcount.cpp | #include <iostream>
#include <string>
using namespace std;
class StringSequenceIterator {
private:
int seq_count;
char *sequences;
string input;
int current;
public:
StringSequenceIterator(string _input, char *_sequences) {
input = _input;
sequen... | ALGO | 0.99576 | 5.227396 |
00305f92-5028-4424-ae6a-6c54e1d8361c | domenicoamelino/daa_projects | MIRACL-master/source/curve/pairing/mnt.cpp | /*
* program to generate MNT Elliptic curves
*
* Compile as (for example)
* cl /O2 /GX mnt.cpp big.cpp miracl.lib
*
* See Miyaji, Nakabayashi & Takano "New explicit conditions of elliptic curve
* traces for FR-reduction", IEICE Trans. Fundementals., Vol. E84A, No. 5,May
* 2001
*
* Invoke as mnt N where k= 3... | ALGO | 0.99813 | 3.534577 |
654e1c23-4e19-4b1a-b2bf-e808eda447c6 | komour/DES | Des.cpp | #include <unordered_map>
#include <iostream>
#include <algorithm>
#include "Des.h"
Des::Des()
{
initialPerm = std::vector<int>({
58, 50, 42, 34, 26, 18, 10, 2, 60, 52, 44, 36, 28, 20, 12, 4, 62, 54, 46, 38, 30, 22, 14, 6, 64, 56, 48, 40, 32, 24, 16, 8, 57, 49, 41, 33, 2... | ALGO | 0.998996 | 5.350805 |
1145786d-9b89-4562-9641-13bd8b9746f9 | adilmp1/leetcode-submissions | implement-trie-prefix-tree.cpp | class node
{
public:
bool isWord;
vector<node *> child;
node()
{
this->isWord = false;
child = vector<node *>(26, nullptr);
}
};
class Trie
{
public:
node * root;
Trie()
{
root = new node();
}
void insert(string s)
{
node * p = root;
... | ALGO | 0.99978 | 5.312482 |
8ed44d73-8343-4c45-9420-22a54b73fe00 | misbahulhoque/UVA-Code | 11387(3Regular).cpp | #include<stdio.h>
int main()
{
long int n,edge,i,j;
while(1)
{
scanf("%ld",&n);
if(n==0)
break;
if(n<=2 || n%2==1)
printf("Impossible\n");
else
{
edge=n/2+n;
printf("%ld\n",edge);
for(i=1;i<n;i++)
printf("%ld %ld\n",i,i+1);
j=n;
for(i=2;i<=n/2;i++)
{
printf("%ld %ld\n",i,j... | ALGO | 0.999484 | 3.332505 |
967f709b-4e23-4cfe-99a3-c1cfef778185 | manikanta2901/ubuntu | .history/codingChallenges/cpp/Codechef/longChallenges/Year2021/January/BlackJack_20210108173822.cpp | #include<bits/stdc++.h>
#include<vector>
#include<iostream>
#include<cmath>
#include<algorithm>
#include<iterator>
#include<string>
#include<map>
#define vv vector
#define F first
#define S second
#define MP make_pair
#define EXECUTE_FASTER ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define printM... | ALGO | 0.999919 | 3.594281 |
a8d4f758-2c84-43da-af5d-be9ebbb8bf67 | rajeevranjancom/DataStructure_and_Algorithms | Day13/Queues.cpp | #include <iostream>
using namespace std;
int queue[100], n = 100, front = - 1, rear = - 1;
void Insert() {
int val;
if (rear == n - 1)
cout<<"Queue Overflow"<<endl;
else {
if (front == - 1)
front = 0;
cout<<"Insert the element in queue : "<<endl;
cin>>val;
rear++;
queue[r... | ALGO | 0.919089 | 3.737312 |
ddbc649f-db9d-44f9-a8df-be4ca2302d15 | ishandutta2007/codeforces | dmitrygrigorev/normal/1340/B.cpp | #include <bits/stdc++.h>
#define ll long long
#define db long double
#define x first
#define y second
#define mp make_pair
#define pb push_back
#define all(a) a.begin(), a.end()
using namespace std;
vector<string> kek = {"1110111", "0010010", "1011101", "1011011", "0111010", "1101011", "1101111", "1010010", "1111111"... | ALGO | 0.999974 | 3.76715 |
f3775909-efa2-4637-a113-319098554cbf | Kynn274/BaitapUPCODER | UCLN2.cpp | #include <iostream>
#include <cmath>
using namespace std;
long long ucln(long long a, long long b){
long long r;
while(b!=0){
r=a%b;
a=b;
b=r;
}
return a;
}
int main(){
long long a,b;
cin>>a>>b;
cout<<ucln(a,b);
}
| ALGO | 0.999889 | 4.564776 |
689d2f5e-8063-42e4-9423-2c77fac429b1 | GeekMa1/lab_workc- | OOP_Chapter4_codes/example4_04_Circle.cpp | #include "example4_04_Circle.h"
double Circle::Area()
{
//Radius *= 2;
//double a = GetRadius(); //ͨԱóԱ
return PI*Radius*Radius;
}
double Circle::Circumference()
{
return 2 * PI*Radius;
}
double Circle::GetRadius()const
{
//Radius *= 2; //ʽǿĵֵͨԱʡRadiusġ
//double a = Area(); //ڳԱڵͨԱ
return Radius;
} | TOOL | 0.872123 | 3.379417 |
924fee8e-d043-48c8-a8cd-19b4d02f94ad | exponentialcherub/VisualSSS | libigl-master/include/igl/biharmonic_coordinates.cpp | template <
typename DerivedV,
typename DerivedT,
typename SType,
typename DerivedW>
IGL_INLINE bool igl::biharmonic_coordinates(
const Eigen::PlainObjectBase<DerivedV> & V,
const Eigen::PlainObjectBase<DerivedT> & T,
const std::vector<std::vector<SType> > & S,
Eigen::PlainObjectBase<DerivedW> & W)
{
r... | ALGO | 0.998588 | 6.053813 |
8018adaf-f29c-4018-a285-cd8b90552087 | yanyuw/muxi | c/c22.cpp | #include<stdio.h>
int main()
{
int c1,c2,t;
int h = 0,m = 0,s = 0;
scanf("%d%d",&c1,&c2);
t = (int)(c2 - c1 + 50) / 100;
while(t >= 3600)
{
t -= 3600;
h++;
}
while(t >= 60)
{
t -= 60;
m++;
}
s = t;
printf("%02d:%02d:%02d",h,m,s);
return 0;
}
| ALGO | 0.999065 | 3.142587 |
5f5999dd-b169-467e-865a-b9e86d1881a6 | tangyao0792/ACM_Solutions | poj/poj2253_9809653.cpp | #include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<queue>
using namespace std;
const double EPS=1e-12;
const int MAXN=210;
const int INF=1<<28;
double g[MAXN][MAXN],d[MAXN],x[MAXN],y[MAXN];
int v[MAXN];
int n, m;
double dis(int i, int j)
{
return sqrt((x[i]-x[j])*(x[i]-x[j])+(y[i]-y[... | ALGO | 0.999652 | 3.829423 |
38757a11-cab9-41f7-b25c-4bab972c4bbd | EmanuelTh/Programas-C- | 2024/36.cpp | #include <stdio.h>
int main() {
int n_linhas;
scanf("%d", &n_linhas);
int linha_atual[n_linhas];
int i = 0;
linha_atual[0] = 1;
while (i < n_linhas) {
int j = 0;
while (j < n_linhas - i - 1) {
printf(" ");
j++;
}
j = 0;
... | ALGO | 0.999978 | 3.876036 |
9810b47b-d092-4c22-9ae3-02d4ac8056dd | Rajasree460/Computer_Network_all_codes | cn 6th sem/stopwaitarq.cpp | /*stop & wait ARQ*/
#include <stdio.h>
int main() {
int i, f, frames[50];
printf("Enter number of frames to transmit: ");
scanf("%d", &f);
printf("\nEnter %d frames: ", f);
for (i = 0; i < f; i++)
scanf("%d", &frames[i]);
printf("\nWith Stop-and-Wait ARQ, the frames will be sent and... | ALGO | 0.984221 | 5.324553 |
8ef5b3b1-386b-472e-b4bc-f6e8d87b57ca | Randool/Algorithm_Structure | 暴力/八数码.cpp | #include <set>
#include <cstdio>
#include <cstring>
using namespace std;
typedef int State[9];
const int maxstate = 1 << 5;
State st[maxstate], goal;
int dist[maxstate];
set<int> vis;
const int dx[] = {-1,1,0,0};
const int dy[] = {0,0,-1,1};
void init_lookup_table() {
vis.clear();
}
int try_to_insert(int s) {
int ... | ALGO | 0.999929 | 3.793267 |
774cce80-c0ca-4182-b922-030e13a8d7c0 | scyllacore/algorithm | C++ 풀이/acmicpc.net/1697(숨바꼭질).cpp | #include <iostream>
#include <queue>
using namespace std;
int n, k;
int visited[100001] = { 0 };
int BFS(int spot) {
queue<int> spotBFS;
visited[n] = 1;
spotBFS.push(spot);
int curSpot, nextSpot;
while (!spotBFS.empty()) {
curSpot = spotBFS.front();
spotBFS.pop();
if (curSpot == k) {
return visited... | ALGO | 0.999973 | 4.256149 |
80d9c15f-e50a-41ad-ba88-c5a1b92de4e2 | OS2World/APP-GRAPHICS-FRACTZ | FRACTZ.CPP | /*+---------------------------------------------------------------------------+*/
/* */
/* fractz */
/* a fractal generater ... | TOOL | 0.980106 | 5.019649 |
2368e971-1064-4e3f-abd1-b13ea163dd2a | raincross7/code-similarity | codes/train_code/problem212/problem212_407.cpp | #include <iostream>
using namespace std;
int dat[401];
int main() {
int n;
cin >> n;
for (int i = 1; i <= 200; i++) {
for (int j = 1; i * j <= 200; j++) {
dat[i * j]++;
}
}
int count = 0;
for (int i = 1; i <= n; i+=2)if (dat[i] == 8)count++;
cout << count << endl;
} | ALGO | 0.999428 | 3.767887 |
3f9e998d-ee95-4993-a744-d98c49545bfe | Abhi132004/100DaysOfCode | Difficulty: Medium/Kth Ancestor in a Tree/kth-ancestor-in-a-tree.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
struct Node
{
int data;
struct Node *left;
struct Node *right;
};
Node* newNode(int val)
{
Node* temp = new Node;
temp->data = val;
temp->left = NULL;
temp->right = NULL;
return temp;
}
Node* buildTree(string str)... | ALGO | 0.999649 | 6.134904 |
7e2310f4-9530-478d-8c7b-40ef93f0d150 | SyedaShafi/C_programming | CPP/make_them_equal.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int t;
cin>>t;
while(t--){
int n;
cin>>n;
int a[n], i;
for(i=0;i<n;i++) cin>>a[i];
int max = a[0];
int min = a[0];
for(i=0; i<n; i++){
if(max < a[i]) max=a[i];
if(min>a... | ALGO | 0.999783 | 4.151445 |
e140ece6-b5ee-4bb9-a8c8-7318336c72d8 | amyz7829/CS179_assignment_6 | Problem 2/ta_utilities.cpp | //--------------------------------------------------------------------------
// TA_Utilities.cpp
// Allow a shared computer to run smoothly when it is being used
// by students in a CUDA GPU programming course.
//
// TA_Utilities.cpp/hpp provide functions that programatically limit
// the execution time of the function... | TOOL | 0.969684 | 6.248431 |
7732fd40-f496-47ff-92f4-1d3034be0138 | bartvbl/Shapebench | lib/CGAL-5.6.1/examples/Optimal_bounding_box/rotated_aabb_tree_example.cpp | #include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Surface_mesh.h>
#include <CGAL/AABB_tree.h>
#include <CGAL/AABB_traits.h>
#include <CGAL/AABB_face_graph_triangle_primitive.h>
#include <CGAL/optimal_bounding_box.h>
#include <CGAL/Polygon_mesh_processing/IO/polygon_mesh_io.h>
#include <bo... | TOOL | 0.994206 | 7.123495 |
cf8d1499-acda-4360-9771-27998732583f | ShawnTSH1229/XEngine | ThirdParty/boost_1_78_0/libs/compute/perf/perf_bolt_exclusive_scan.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <bolt/cl/scan.h>
#include <bolt/cl/copy.h>
#include <bolt/cl/device_vector.h>
#include "perf.hpp"
int main(int argc, char *argv[])
{
perf_parse_args(argc, argv);
std::cout << "size: " << PERF_N << std::endl;
bolt::cl::control ctrl = bo... | ALGO | 0.923684 | 3.964213 |
6aabd2dd-4873-4563-8e77-d0d4f6196ec4 | 5xdev/btech_sem_3 | CPP_Practical_4th_Sem/12.Reverseit.cpp | /****************************************************
* AUTHOR: HONEY YADAV *
* PROGRAM(PROGRAM NO): REVERSEIT(12) *
* IN COORDINATION WITH: DR. SATINDER BAL GUPTA *
* INSTITUITION: IGU MEERPUR *
**************************************************... | ALGO | 0.99957 | 5.045622 |
5808a7ad-c1f4-45ce-8f3f-b3b1b2c0055f | FRalissia88/Vision_robot | opencv/sources/modules/stitching/src/stitcher.cpp | #include "precomp.hpp"
namespace cv {
#if __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1900/*MSVS 2015*/)
// Stitcher::ORIG_RESOL is initialized in stitching.hpp.
#else
const double Stitcher::ORIG_RESOL = -1.0;
#endif
Ptr<Stitcher> Stitcher::create(Mode mode)
{
Ptr<Stitcher> stitcher = makePtr<Sti... | TOOL | 0.855189 | 6.368211 |
395237e0-fd06-42c2-ac9a-782d42b7b330 | Max-Lecc/PX4-Firmware | src/modules/local_position_estimator/sensors/mocap.cpp | #include "../BlockLocalPositionEstimator.hpp"
#include <systemlib/mavlink_log.h>
#include <matrix/math.hpp>
extern orb_advert_t mavlink_log_pub;
// required number of samples for sensor
// to initialize
static const uint32_t REQ_MOCAP_INIT_COUNT = 20;
static const uint32_t MOCAP_TIMEOUT = 200000; // 0.2 s
void Blo... | ALGO | 0.939253 | 4.912281 |
1bb1ae09-4b1e-4837-9956-ec4c6ba49a5e | Rosivania/Estrutura-de-Dados-2 | lista_encadeada.cpp | #include <stdio.h>
#include <stdlib.h>
struct No{ //Lista declaration
int valor;
struct No *prox;
};
struct No *Lista;
// funo para inserir o preo em uma lista alocada dinamicamente.
int inserir(int preco) {
struct No *aux = (struct No *) malloc (sizeof (struct No));
aux->valor = preco;
aux->prox = Lista;
Lis... | ALGO | 0.99835 | 4.03045 |
f28b32a5-e39f-46d0-9fba-0172f1a58d22 | tenacious-39/-SdeSheetChallenge-StriversSdeSheetChallenge | day6/MergetwosortedArrayswithoutextraspace.cpp | class Solution {
public:
void merge(vector<int>& nums1, int m, vector<int>& nums2, int n) {
if(n!= 0 && m != 0){
for(int i = 0; i < m; i++){
if(nums1[i] > nums2[0]){
// cout << "i = " << i << "\n";
int tmp = nums1[i];
num... | ALGO | 0.999987 | 5.318947 |
33d4be17-0766-418c-a19d-e9823f9b9980 | Krish-Gupta-13/Udemy-GFG | Love Babbar/pattern/08_pattern.cpp | #include<iostream>
using namespace std;
int main(){
int n=4;
for(int i=1;i<=n;i++){
int value=i;
for(int j=1;j<=i;j++){
cout<<value<<" ";
value++;
}
cout<<endl;
}
return 0;
} | ALGO | 0.99989 | 3.806489 |
71a5658e-8420-4cc8-91fe-10743a5a033f | manh610/document-c- | h2n-bai4.cpp | #include <stdio.h>
#include <math.h>
int snt(int n)
{
if (n<2) return 0;
if (n==2) return 1;
for(int i=2;i<=sqrt(n);i++){
if (n%i==0) return 0;
}
return 1;
}
int main()
{
int n,dem=0;
scanf("%d",&n);
for (int i=2; ;i++){
if (snt(i)==1){
dem+=1;
if (dem==n){
printf("%d",i);
return 0;
}
... | ALGO | 0.999982 | 4.264107 |
a7e6c09b-2bdb-4e28-ba58-97ac5a68fecb | alibaba/nann | blaze-benchmark/thirdparty/boost_1_53_0/libs/dynamic_bitset/example/example1.cpp | // An example of setting and reading some bits. Note that operator[]
// goes from the least-significant bit at 0 to the most significant
// bit at size()-1. The operator<< for dynamic_bitset prints the
// bitset from most-significant to least-significant, since that is
// the format most people are used to reading.
//
... | TOOL | 0.856465 | 6.228894 |
02a36055-b8bd-4d17-bf60-aea0322a9fce | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_5452_7.cpp | #include <bits/stdc++.h>
using namespace std;
pair<int, int> p[100005 + 5];
int x[100005 + 5], y[100005 + 5];
double angle(int i, int j) {
double x1 = p[i].first;
double y1 = p[i].second;
double x2 = p[j].first;
double y2 = p[j].second;
double pi = 2 * acos(0);
double theta1 = atan2(y1, x1) * 180 / pi;
do... | ALGO | 0.999959 | 4.758964 |
94d450ca-96ed-4e02-a4f0-785ac0c586ff | muhmteminylmz/Cpp_Sort_Search_Algorithms | .Sıralama_Algoritmaları/shellsort.cpp | #include<iostream>
using namespace std;
void shellSort(int array[], int n)
{
for(int interval=n/2; interval>0; interval/=2)
{
for(int i=interval; i<n; i+=1)
{
int temp= array[i];
int j;
for(j=i-interval; j>=0 && array[j]>temp; j-=interval)
{
array[j]= array[j+interval];
}
array[j+interval]=... | ALGO | 0.999919 | 5.040597 |
a9df47d0-b448-406f-96c5-797f32b9490a | OpenMW/openmw | components/files/linuxpath.cpp | #include "linuxpath.hpp"
#include <cstring>
#include <fstream>
#include <pwd.h>
#include <unistd.h>
#include <components/misc/strings/lower.hpp>
namespace
{
std::filesystem::path getUserHome()
{
const char* dir = getenv("HOME");
if (dir == nullptr)
{
struct passwd* pwd = g... | TOOL | 0.935368 | 6.587182 |
30f578bd-592f-45c3-a9d1-24e50b3b9c51 | klvn930815/OJ | GetNext/GetNext.cpp | //
// Created by Qiezz on 18-2-4.
//
#include <iostream>
struct TreeLinkNode {
int val;
struct TreeLinkNode *left;
struct TreeLinkNode *right;
struct TreeLinkNode *next;
TreeLinkNode(int x) :val(x), left(NULL), right(NULL), next(NULL) {
}
};
class Solution {
public:
TreeLinkNode* GetNext... | ALGO | 0.999983 | 4.951571 |
386573b8-24c8-4838-8092-00a15a7a33eb | Yashh2385/cse330 | Sieve_Of_Eratoshenes.cpp | #include <iostream>
using namespace std;
void sieveOfEratosthenes(int n)
{
bool isPrime[n + 1];
// Initialize all elements to true
for (int i = 0; i <= n; i++)
{
isPrime[i] = true;
}
isPrime[0] = isPrime[1] = false;
for (int i = 2; i * i <= n; i++)
{
if (isPrime[i]... | ALGO | 0.999964 | 5.206558 |
2530450f-0845-46db-a702-349b38d179c3 | GladiousZhang/C_Progarmming_Assistance_in_Xidian | 水仙花数.cpp | #include <stdio.h>
void isNarc(int num){
int i,sum=0;
int judge=num;
for(int n=1;n<=3;n++){
i=num%10;
sum=sum+i*i*i;
num=num/10;
}
if(sum==judge){
printf("yes");
}else{
printf("no");
}
}//判断是否为水仙花数
int main(){
int num;
scanf("%d",&num);
isNarc(num);
return 0;
} | ALGO | 0.999913 | 4.100816 |
dab62edd-4617-41ae-b997-61d3828ca98b | electro1rage/OJProblemsCodes | Problem Storage/Greedy/Medium/CF_Div1_367C.cpp | #include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for((i)=0;(i)<(int)(n);++(i))
const int MN = 1010101;
const int MVAL = 1010101010;
int dp[MN];
int a[MN];
int main() {
int n, m, i;
scanf("%d %d", &n, &m);
for (i = 0; i < MN; ++i) dp[i] = MVAL;
dp[0] = 0, dp[1] = 1;
for (i = 2; ; ++i) {
dp[i] =... | ALGO | 0.999967 | 3.411298 |
93358bd4-2415-4a7b-ad96-228c81304c0d | ahmedIsti73/CP_templetes | segment_tree(updated_version).cpp | #include<bits/stdc++.h>
using namespace std;
#define optimize() \
ios_base ::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0);
#define ll long long
const int N=2e5+123;
ll arr[N];
struct ST{
ll t[N*3];
ST(){
memset(t,0,sizeof t);
}
inline void here(int node){
... | ALGO | 0.999732 | 3.781267 |
38a355f0-8490-4fe0-9cab-c7dcb51e2f35 | note8g2018/OpenGL16 | Dep/glm/test/perf/perf_matrix_transpose.cpp | #define GLM_FORCE_INLINE
#include <glm/matrix.hpp>
#include <glm/ext/matrix_float4x4.hpp>
#include <glm/ext/matrix_double4x4.hpp>
#include <glm/ext/matrix_relational.hpp>
#include <glm/ext/vector_float4.hpp>
#if GLM_CONFIG_SIMD == GLM_ENABLE
#include <glm/gtc/type_aligned.hpp>
#include <vector>
#include <chrono>
#inclu... | TEST | 0.86868 | 6.84421 |
0bf97e1b-e46a-4e82-98ac-05ea8b68129c | trahie/ospy | old/oSpy/Agent/ObsoleteCode/httpapi_util.cpp | #include "stdafx.h"
#include "httpapi_util.h"
#include "logging_old.h"
#include "util.h"
static const char *HTTP_VERB_STRINGS[] =
{
"Unparsed",
"Unknown",
"Invalid",
"OPTIONS",
"GET",
"HEAD",
"POST",
"PUT",
"DELETE",
"TRACE",
"CONNECT",
"TRACK",
"MOVE",
"COPY",
... | WEB | 0.918433 | 4.108567 |
ca6d90a4-733b-4555-bca2-ba42637189c9 | ShadowTemplate/algorithms-data-structures | Knapsack Problem/tester.cpp | #include "Knapsack.h"
int main()
{
Bag<int, int> bag;
vector<Item<int, int> > items;
bag.maxWeight = 30;
// procedure to acquire items via keyboard
// getItems(items);
Item<int, int> item1;
Item<int, int> item2;
Item<int, int> item3;
Item<int, int> item4;
Item<int, int> item5;
Item<int, int> item6;
ite... | ALGO | 0.994936 | 4.859598 |
ae165746-d65e-42fc-ba60-9f507e2cd268 | Piyush-io/Cpp | winnerofelection.cpp | //{ Driver Code Starts
#include <iostream>
#include <map>
#include <algorithm>
#include <cstdlib>
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
public:
// Function to return the name of candidate that received maximum votes.
vector<string> winner(string arr[], int n)
... | ALGO | 0.999867 | 5.889937 |
623712f2-8e65-4cdf-b0b7-22e13497614f | devparthgarg/STRIVER | Day 18 Binary Trees/05 Lowest Common Ancestor of a Binary Tree.cpp | //time: O(n)
//space: O(n)
TreeNode* lowestCommonAncestor(TreeNode* root, TreeNode* p, TreeNode* q)
{
if(root==NULL or root==p or root==q)
{
return root;
}
auto left=lowestCommonAncestor(root->left,p,q);
auto right=lowestCommonAncestor(root->right,p,q);
if(left==NULL)
{
... | ALGO | 0.999961 | 5.839694 |
7eec5d68-2397-411f-8fa2-09bd77734533 | itlezy/eMule-mods-archive | eMule-0.50a-neomuleneomule_reloaded-fa3debb/crypto51/safer.cpp | // safer.cpp - modified by by Wei Dai from Richard De Moliner's safer.c
#include "pch.h"
#include "safer.h"
#include "misc.h"
#include "argnames.h"
NAMESPACE_BEGIN(CryptoPP)
const byte SAFER::Base::exp_tab[256] =
{1, 45, 226, 147, 190, 69, 21, 174, 120, 3, 135, 164, 184, 56, 207, 63,
8, 103, 9, 148, 235, 38, 168,... | ALGO | 0.996919 | 6.981608 |
150c0ef1-ce36-4dbf-9a47-c45adf7a8721 | jianger-yu/leetcode | 搜索/100:相同的数.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution {
public:
bool key = true;
void dfs(TreeNode* p, TreeNode* q){
if(!key) return;
if(p == q && p == NULL) return;
if(p == NULL || q == NULL){
key = false;
return;
}
if(p->val != q->val){
... | ALGO | 0.999993 | 5.81162 |
3124f63d-4833-43eb-b385-c31df6d8d7cf | Royal520/leetcode | leetcode/editor/cn/codefun/排序去重.cpp | #include<bits/stdc++.h>
using namespace std;
void solve() {
int n;
cin >> n;
vector<int> nums(n);
for (int i = 0; i < n; ++i) {
cin >> nums[i];
}
set<int> q(nums.begin(), nums.end());
vector<int> res(q.begin(), q.end());
for (const auto &item: res) {
cout << item << end... | ALGO | 0.999836 | 4.701159 |
ff999c3c-2ae3-4528-8379-7b539c0c0a32 | ShoaibAkhtarHaral/DATA_STRUCTURE | arrayList_Stack-2.cpp | #include <iostream>
using namespace std;
class stack
{
int top;
int *arr;
int capacity;
public:
stack(int s)
{
capacity = s;
arr = new int[s];
top = -1;
}
bool isFull()
{
if (capacity == top + 1)
{
return true;
}
else... | ALGO | 0.999832 | 4.138353 |
4d88b111-e9cc-43ff-a645-a8f1b462ca64 | noko206/AtCoder | abc/51-100/99/c.cpp | #include <bits/stdc++.h>
using namespace std;
#define _overload3(_1,_2,_3,name,...) name
#define _REP(i,n) REPI(i,0,n)
#define REPI(i,a,b) for(int i=int(a);i<int(b);++i)
#define REP(...) _overload3(__VA_ARGS__,REPI,_REP,)(__VA_ARGS__)
#define ALL(a) (a).begin(),(a).end()
#define ALLR(a) (a).rbegin(),(a).rend()
typedef... | ALGO | 0.999921 | 4.21658 |
7c14710e-9b8e-41b2-8f94-3a7484d65258 | zeroDtree/A_D | algorithms/merge_sort.cpp | #include<cstdio>
#include<cstring>
#include<cstdlib>
#include<algorithm>
#include<iostream>
#include<map>
#include<queue>
#include<vector>
#include<set>
typedef long long ll;
typedef unsigned long long ull;
const int INF = 0x3f3f3f3f;
const long long INF_L = 0x3f3f3f3f3f3f3f3f;
using namespace std;
template<typename... | ALGO | 0.999764 | 3.263517 |
9a951b45-969f-4b07-9eda-b4ae8d2799a6 | Mahdi767/CodeForce-800-difficulty- | watermelon.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int x;
cin>>x;
if(x/2==1){
cout<<"No"<<endl;
}else
if(x%2==0){
cout<<"YES"<<endl;
}else{
cout<<"No"<<endl;
}
}
| ALGO | 0.999948 | 3.115201 |
1928b3fd-101e-479a-ab5a-ae3e9cafaeed | TimotheeGayet/webserv | srcs/config/GlobalConfig.cpp | // GlobalConfig.cpp
#include "../../includes/config/GlobalConfig.hpp"
// UTILS
// ************************************************************************************************ //
static bool is_whitespace(const char c) {
return (c == ' ' || c == '\t' || c == '\n' || c == '\r');
}
static std::string parseSect... | CONFIG | 0.960819 | 6.551247 |
13d73cff-d785-4b5d-b316-86d7b2e8efb5 | raincross7/code-similarity | codes/train_code/problem156/problem156_153.cpp | #include<iostream>
#include<cmath>
using namespace std;
int main(){
int a,b,c;
cin>>a>>b>>c;
printf("%lf\n",a*b*sin(c/180.0*M_PI)/2.0);
printf("%lf\n",a+b+sqrt(a*a+b*b-2.0*a*b*cos(c*M_PI/180.0)));
printf("%lf\n",b*sin(c*M_PI/180.0));
return 0;
} | ALGO | 0.999836 | 3.399244 |
5eb84cd0-d84d-4ff5-b99a-306ad70227a8 | Moinu7/Assiut-University-Training---Newcomers | Sheet 3/G_Palindrome_Array.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
long long n;
cin>>n;
long long arr[n];
for(int i=0;i<n;i++){
cin>>arr[i];
}
bool check =true;
for(int i=0,j=n-1;i<n && j>=0;i++,j--){
if(i==j){
break;
}else if(arr[i]!=arr[j]){
check=fals... | ALGO | 0.999995 | 3.660535 |
8080fa06-4d35-4130-a25f-8f88cf68ce18 | devmariane/exC | lista3/Compiler Explorer Code (13).cpp | #include <stdio.h>
#include <math.h>
float mGeometrica (float a, float b, float c){
float media;
media = pow(a * b * c, 1.0/3.0);
return media;
}
float mPonderada (float a, float b, float c){
float media;
media = (a + b * 2 + c * 3) / 6;
return media;
}
float mHarmonica (float a, float b, ... | ALGO | 0.998857 | 3.893482 |
b2c27859-f6c2-442d-a39b-8f60a357a763 | ishandutta2007/codeforces | pyqe/normal/766/D.cpp | #include <bits/stdc++.h>
using namespace std;
long long n,m,dsu[100069];
string as[100069];
bitset<100069> iv;
long long fd(long long x)
{
if(dsu[x]!=x)
{
fd(dsu[x]);
iv[x]=iv[x]^iv[dsu[x]];
dsu[x]=fd(dsu[x]);
}
return dsu[x];
}
int main()
{
long long t,rr,i,ky,k,l;
string s[2];
scanf("%lld%lld%lld",... | ALGO | 0.999987 | 3.812306 |
8e26e213-865f-435f-9672-84b802af325c | ishandutta2007/codeforces | davidberard/normal/276/E.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
struct BIT {
vector<int> t;
int n;
void add(int x, int v) {
for(; x<n; x+=x&-x) {
t[x] += v;
}
}
BIT(int sz) {
t = vector<int>(sz);
n = sz;
}
void add(int l, int r, int v) {
add(l, v);
add(r, -v);
}
int... | ALGO | 0.999694 | 4.935083 |
c6918a41-4678-4b04-82a8-83ce0f9351c3 | Leoyuseu/Code | Data structure/Hash Table/2 sum.cpp | // Given an array of integers, find two numbers such that they add up to a specific target number.
// The function twoSum should return indices of the two numbers such that they add up to the target, where index1 must be less than index2. Please note that your returned answers (both index1 and index2) are not zero-bas... | ALGO | 0.999902 | 5.652879 |
8b474daa-e7f5-422a-9fd1-76b0ed362a27 | gpritam/General | Algorithms/SpaceFillingCurve/src/SpaceFillingCurves.cpp | #include "SpaceFillingCurves.h"
//_______________________________________________________________________________
// Operator precedence
//
// 1. () 2. ~ 3. * / % 4. + - 5. << >> 6. & 7. ^ 8. |
//_______________________________________________________________________________
//________________________... | ALGO | 0.999719 | 3.21877 |
d5ca9030-ce08-4500-b190-eef5b687375a | ishandutta2007/codeforces | eddy1021/normal/911/E.cpp | // eddy1021
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
typedef double D;
typedef long double LD;
typedef long long LL;
typedef pair<int,int> PII;
typedef pair<LL,LL> PLL;
#define mod9 1000000009LL
#define mod7 1000000007LL
#define INF 1023456789LL
#define INF16 10000000000000000LL
#define... | ALGO | 0.99998 | 3.425162 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.