uuid stringlengths 36 36 | repo_name stringlengths 5 123 | relative_path stringlengths 5 4k | content stringlengths 33 2.85M | category stringclasses 6
values | algo_rel_score float64 0.85 1 | quality_score float64 3 8.76 |
|---|---|---|---|---|---|---|
6a9e9f08-b1f3-47d9-bff5-e753683241b7 | sradl1981/LIGGGHTS-PUBLIC-ParScale | src/MANYBODY/fix_qeq_comb.cpp | /* ----------------------------------------------------------------------
Contributing authors: Ray Shan (Sandia, <EMAIL>)
------------------------------------------------------------------------- */
#include "lmptype.h"
#include "mpi.h"
#include "math.h"
#include "stdlib.h"
#include "string.h"
#include "pair_comb... | ALGO | 0.988592 | 5.662591 |
1350c9f6-02e6-469f-95d4-3ccd9173ef29 | jinopapo/marathon | samurai_coding/players/players.cpp | #include "players.hpp"
#include <unistd.h>
#include <cstdlib>
#include <tuple>
bool logging = false;
CommentedIStream::CommentedIStream(istream &is):
is(&is) {
}
int CommentedIStream::get() {
if (is->eof()) exit(0);
return is->get();
}
void CommentedIStream::skipComments() {
char c = get();
while (isspace... | TOOL | 0.955875 | 4.050703 |
da01490d-0a2e-481f-862e-3f197afb7ef3 | thepluck/CP-Training | VnSpoj/CHESSCBG.cpp | #include <bits/stdc++.h>
using namespace std;
bool get_bit(int x, int i){
return (x >> i) & 1;
}
using ii = pair <int, int>;
bool used[70000];
queue <ii> q; char x;
int first, last, curr, step;
int main(){
for (int i = 0; i < 16; i++){
cin >> x; first = first * 2 + x - '0';
}
for (int i =... | ALGO | 0.999979 | 3.380138 |
d472eb69-18c2-43b7-84a8-4437903fb1bd | yS2h/Algorithm | Backjoon/Bronze/단어 공부.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
string s;
cin >> s;
int arr[26] = {0, };
for (char i : s) {
if (i > 96)
arr[i - 97]++;
else
arr[i - 65]++;
}
int M = -1;
int idx = 0;
... | ALGO | 0.999992 | 3.852957 |
71efc53c-973f-417f-a758-442450dbbcf5 | its-aky/Codeforces-Rounds | ROUND 901/B_Jellyfish_and_Game.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin >> t;
while (t--)
{
int n, m, k;
cin >> n >> m >> k;
vector<int> j, g;
for (int i = 0; i < n; i++)
{
int x;
cin >> x;
j.push_back(x);
}
for... | ALGO | 0.999971 | 4.152153 |
d795ead7-5785-4e9f-bf87-440e61a38a19 | Anushkakumari123/youtube | cpp/recursion.cpp/print.cpp | #include<iostream>
using namespace std;
void print(int arr[],int n){
cout<<"size of array is "<<n<<endl;
for(int i=0; i<n; i++){
cout<<arr[i]<<" ";
}
cout<<endl;
}
bool linearsearch(int arr[], int size, int k){
print (arr,size);
//base case
if(size==0){
return false... | ALGO | 0.999838 | 4.538471 |
03ea5906-f329-4949-9d5f-a42608ca5d34 | tic40/atcoder | daily_training/20250312_3/h/main.cpp | #include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0;i<n;i++)
#define endl '\n'
using P = pair<int,int>;
const int INF = 1e9; //numeric_limits<int>::max();
const vector<int> di = {-1,0,1,0};
const vector<int> dj = {0,1,0,-1};
template<class T> void chmin(T& a, T b) { a = min(a,b); }
int main() {
... | ALGO | 0.999846 | 3.916105 |
b7ae74ce-82c5-4626-b45f-ee4021db3ec9 | dachu21/online-judge | FACTORIZ.cpp | // pl.spoj.com: dachu21
#include <iostream>
#include <cmath>
using namespace std;
int MAX_VALUE = 8000000;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int number, numbersCount;
int * sieve = new int[MAX_VALUE+1];
int maxPrime = (int)sqrt(MAX_VALUE);
for (int i = 0; i <= MAX_VALUE; ... | ALGO | 0.999969 | 4.384279 |
e6acdd4c-5f0a-4bfa-8f73-d360f9db00e5 | yashmittal-git/LeetCoding | rotate-array(tle).cpp | //Time Limit Exceeded
// 189. Rotate Array
// Given an array, rotate the array to the right by k steps, where k is non-negative.
// Example 1:
// Input: [1,2,3,4,5,6,7] and k = 3
// Output: [5,6,7,1,2,3,4]
// Explanation:
// rotate 1 steps to the right: [7,1,2,3,4,5,6]
// rotate 2 steps to the right: [6,7,1,2,3,4,5]
... | ALGO | 0.999985 | 5.733307 |
a0ba9847-62d0-48b7-ab95-f72b812a9a5e | woozway/PAT | PAT (Advanced Level) Practice/1033 To Fill or Not to Fill (25).cpp | #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
const int inf = 99999999;
struct station {
double price, dis;
};
bool cmp(station &a, station &b) {
return a.dis < b.dis;
}
int main() {
double cmax, d, davg;
int n;
scanf("%lf%lf%lf%d", &cmax, &d, &davg, &n);
vector<station> sta(n+1)... | ALGO | 0.999887 | 3.94628 |
c32dd6f9-0620-43bf-ba34-b08d13e3677e | jianhe25/Tiny-ray-tracer | hw2-windows/hw2-windows/glm-0.9.2.7/test/gtx/gtx_simd_mat4.cpp | #include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtc/quaternion.hpp>
#include <glm/gtx/simd_vec4.hpp>
#include <glm/gtx/simd_mat4.hpp>
#include <glm/gtx/random.hpp>
#include <iostream>
#include <cstdio>
#include <ctime>
#include <vector>
std::vector<float> test_detA(std::vector<glm::mat4> c... | TEST | 0.993889 | 6.165887 |
081525d5-382f-4704-9837-f03357e605f9 | ashendge/algds_cpp-c | rev_print.cpp | #include <iostream>
#include <cmath>
using namespace std;
struct Node{
int value;
Node *next;
};
void add_node(Node **, int );
void print(Node *);
Node *rev_print(Node *);
int main(){
Node *head = NULL;
add_node(&head,30);
add_node(&head,15);
add_node(&head,9);
add_node(&head,6);
add_node(&head,3);
print... | ALGO | 0.998968 | 4.296337 |
3d6c24d8-e56c-44c3-ba79-64d6d2ac6939 | mihai-constantin/ACS | PA/Laborator/2018-2019/lab05 - Backtracking/demo-lab05/perms/perms_general.cpp | #include <iostream>
#include <vector>
#include <unordered_map>
/* deoarece numerele sunt sterse din domeniu odata ce sunt folosite, solutia
generata este garantata sa nu contina duplicate. Astfel, atunci cand domeniul
ajunge vid, solutia este intotdeauna corecta */
bool check(std::vector<int> solution) {
for (unsi... | ALGO | 0.999743 | 5.696021 |
f4b62f95-95a2-4295-91d5-e5b531c46b07 | mohit8750/C-DSA-Code-imp- | linked list/doublyLinkedlist.cpp | #include <iostream>
using namespace std;
struct node
{
int data;
node *prev;
node *next;
node(int d)
{
data = d;
prev = NULL;
next = NULL;
}
};
void printlist(node *head)
{
node *curr = head;
while (curr != NULL)
{
cout << curr->data << " ";
c... | ALGO | 0.999521 | 4.389866 |
c66d618a-11c5-40ce-a944-4891701e1e18 | ishandutta2007/codeforces | skydec/normal/245/A.cpp | #include<cstring>
#include<cstdlib>
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<map>
#include<vector>
#define rep(i,j,k) for(int i=j;i<=k;i++)
#define lowbit(x) ((x)&(-(x)))
using namespace std;
int a[3];int b[3];
int main()
{
int n;scanf("%d",&n);
rep(i,1,n)
{
int u,v,w;
scanf("%d%d%d",&u,&v,&... | ALGO | 0.999933 | 3.460846 |
1c70590f-ec79-49a7-896a-37feff9c13ce | eman-ramadan1/Function_sheet | wonderfull.cpp | /******************************************************************************
Welcome to GDB Online.
GDB online is an online compiler and debugger tool for C, C++, Python, Java, PHP, Ruby, Perl,
C#, OCaml, VB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog.
Code, Compile, Run a... | ALGO | 0.999928 | 6.056609 |
67394236-eec4-4d4d-878b-9d5d68d2e058 | Abdullah7919/DSA | arrays/majorityElement.cpp | #include <bits/stdc++.h>
using namespace std;
// Majority Element >N/3 times
int majority(int arr[], int n)
{
int count = 0;
int element = 0;
for (int i = 0; i < n; i++)
{
if (count == 0)
{
element = arr[i];
}
if (arr[i] == element)
{
cou... | ALGO | 0.999927 | 4.489254 |
a28c126d-5bf4-44a2-ba2b-d50cdf786fbf | nakatamaho/mplapack | mplapack/reference/Csytrs_aa_2stage.cpp | #include <mpblas.h>
#include <mplapack.h>
void Csytrs_aa_2stage(const char *uplo, INTEGER const n, INTEGER const nrhs, COMPLEX *a, INTEGER const lda, COMPLEX *tb, INTEGER const ltb, INTEGER *ipiv, INTEGER *ipiv2, COMPLEX *b, INTEGER const ldb, INTEGER &info) {
//
// -- LAPACK computational routine --
// ... | ALGO | 0.999847 | 3.903883 |
232c3e53-a6be-45a4-b188-07fe8cc66cb3 | vfolunin/archives-solutions | LeetCode/2402.cpp | class Solution {
public:
int mostBooked(int roomCount, vector<vector<int>> &meetings) {
set<int> available;
for (int i = 0; i < roomCount; i++)
available.insert(i);
set<pair<long long, int>> busy;
vector<int> meetingCount(roomCount);
sort(mee... | ALGO | 0.999915 | 5.78358 |
bc2e7e40-86a1-46e2-8093-a07fbc8d131b | elemental/Elemental | src/lapack_like/funcs/Inverse/Hermitian.cpp | #include <El.hpp>
namespace El {
template<typename Field>
void HermitianInverse
( UpperOrLower uplo, Matrix<Field>& A, const LDLPivotCtrl<Base<Field>>& ctrl )
{
EL_DEBUG_CSE
SymmetricInverse( uplo, A, true, ctrl );
}
template<typename Field>
void HermitianInverse
( UpperOrLower uplo, AbstractDistMatrix<Field... | ALGO | 0.987851 | 5.999393 |
18c95523-7256-4b96-86eb-ca1359d1bd71 | kharbashpriyanshu/cpp-all-codes | employeesalary.cpp | #include<iostream>
using namespace std;
class esalary{
char name[30];
int id;
float basicsalary;
float da, gross,ittax,netsalary;
public:
void detail(){
cout<<"enter emoloyee detail \n";
cout<<"name : ";
cin>>name;
cout<<"ID of employee : ";
cin>>id;
cout<<"basic salary of employee : ";
cin>>basicsalary;
}
void finals... | TOOL | 0.940038 | 3.872438 |
05a366a4-9bd8-4b91-a553-d92d8111045d | Krypto990/IOSFluteter | 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 |
35d950cd-172a-4d2f-b8c1-1007951db14a | dinhtuantinh/C-plus-plus | Hoc C++/matrix4.cpp | #include<bits/stdc++.h>
#define faster() cin.tie(0); ios_base::sync_with_stdio(false);
#define ll long long
using namespace std;
const int oo = 105;
//Dinh Tuan Tinh
/*
y tuong dung BFS va mang B[] de danh dau nhung vi tri da di qua
duyet toan bo vector v den khi nao ko con diem nao co the di
*/
int A[oo][oo], ... | ALGO | 0.999926 | 4.374548 |
036339ac-4311-45f6-989f-51197f4b367c | Winfidonarleyan/Old_1_Core | dep/acelite/ace/ACE_crc_ccitt.cpp | // $Id: ACE_crc_ccitt.cpp 91286 2010-08-05 09:04:31Z johnnyw $
#include "ace/ACE.h"
namespace
{
/*****************************************************************/
/* */
/* CRC LOOKUP TABLE */
/* =======... | TOOL | 0.99694 | 6.738245 |
eb43c06c-0f88-438d-ac4c-45d864d860a9 | ishandutta2007/codeforces | hehere/normal/1097/C.cpp | #include <cassert>
#include <cctype>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <bitset>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <utility>
#include <vector>
typedef long long LL;
typede... | ALGO | 0.999802 | 4.108188 |
15b2e8d0-aa62-48a3-9585-80833bd73fb0 | HarshYadav175/Leetcode-Questions | Leaders in an array - GFG/leaders-in-an-array.cpp | //{ Driver Code Starts
// C++ program to remove recurring digits from
// a given number
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution{
//Function to find the leaders in the array.
public:
vector<int> leaders(int a[], int n){
vector<int> ans;
... | ALGO | 0.999964 | 5.955708 |
8d5ded07-e0b5-4ff5-8270-8f9f93257309 | chihirooooooooo/LeetCode | 0507-Perfect-Number/0507-Perfect-Number.cpp | class Solution {
public:
bool checkPerfectNumber(int num) {
if(num == 1){
return false;
}
int temp = 1;
for(int i = 2; i < sqrt(num); i++){
if(num % i == 0){
temp += i;
int pair = num / i;
temp += pair;
... | ALGO | 0.999949 | 5.87584 |
24358e3b-2d30-49d6-8965-b9ac5b1f5f44 | achrafoo2018/Competitive_Programming_Contests | codeforces/aacpc15/k.cpp | #include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<bool> vb;
typedef vector<char> vchr;
typedef vector<string> vstr;
typedef vector<vi> vvi;
typedef vector<vchr> vvchr;
typedef vector<ll> vll;
typedef vector<pi... | ALGO | 0.999651 | 3.520652 |
3b1a14a5-1879-48f2-82cd-62e2c0cedded | JorgeArevaloEchevarria/Estructura-de-Datos | arboles/barreraPrimos.cpp | #include<iostream>
#include"bintree_eda.h"
struct tSol {
int multiplo7;
int profundidad;
};
bool esPrimo(int num) {
int divisor = 1, divisores = 0;
do {
if (num % divisor == 0) {
divisores++;
}
divisor++;
} while (divisor <= num);
if (divisores == 2)
return true;
else
return false;
}
template <c... | ALGO | 0.999674 | 4.309062 |
e81b1813-3371-4243-910a-eb89558e16b4 | theasteroid18/LeetCodeAlgorithmExercise | LeetCodeAlgorithmExercise/1309.DecryptStringfromAlphabettoIntegerMapping.cpp | //#include<iostream>
//#include<unordered_map>
//using namespace std;
//
//class Solution {
//public:
// // Ŀ꣺ĸӳ
// // ˼·ԽȡĸַƴȻs
// // õǰ±ַȻԻȡ+2±ַȡҸַ#
// // ʹǰַһַԹһתĸ
// // ĬõǰַõĸȻӵres
// string freqAlphabets(string s) {
// string res;
//
// for (int i = 0; i < s.size(); i++) {
// ... | ALGO | 0.999776 | 4.178999 |
0e8acc85-68a2-4816-8e91-aee533988637 | varenyamBakshi/cp-algorithms | trees/Trie.cpp | #include<bits/stdc++.h>
using namespace std;
const int vsize = 26;
struct Node{
bool isleaf;
int next[vsize];
Node(){
isleaf = false;
fill(begin(next), end(next), -1);
}
};
void insert(string s, vector<Node> &trie){
int curr = 0;
for(auto c: s){
int ch = c-'a';
... | ALGO | 0.999937 | 5.366924 |
27af478a-12f5-41ac-b0b7-3ca218cf1181 | ishandutta2007/codeforces | frodakcin/normal/1093/F.cpp | #include <iostream>
#include <cstdio>
using namespace std;
const int MAXN = 1e5 + 100;
const int MAXK = 100 + 10;
const int MOD = 998244353;
typedef long long ll;
#define tll(X) static_cast<ll>(X)
#define ti(X) static_cast<int>(X)
int sum(int a, int b) {return ti((tll(a) + tll(b))%MOD);}
int dif(int a, int b) {retu... | ALGO | 0.99997 | 3.631593 |
1e5ef492-bf13-4909-b45a-eb60e59f5b8c | hjwdzh/Manifold | 3rd/igl/bfs.cpp | #include "bfs.h"
#include "list_to_matrix.h"
#include <vector>
#include <queue>
template <
typename AType,
typename DerivedD,
typename DerivedP>
IGL_INLINE void igl::bfs(
const AType & A,
const size_t s,
Eigen::PlainObjectBase<DerivedD> & D,
Eigen::PlainObjectBase<DerivedP> & P)
{
std::vector<typename ... | ALGO | 0.999376 | 4.747497 |
55c0519f-567a-413f-bcb2-60e42aebc95b | rishabg30/Data-Structures-and-Algorithms | trees_problems/binary_trees_problems/check_if_trees_are_identical_or_not.cpp | #include <bits/stdc++.h>
using namespace std;
class TreeNode
{
public:
int val;
TreeNode *left;
TreeNode *right;
TreeNode(int val)
{
this->val = val;
left = right = NULL;
}
};
bool isIdentical(TreeNode *root1, TreeNode *root2)
{
// Base Conditions
if ((root1 != NULL && ro... | ALGO | 0.999919 | 4.832014 |
91e0dae6-f018-4168-8bee-983000e7ded9 | xssxx/algorithm | practice/hackerrank/vector_erase.cpp | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
int n;
cin >> n;
vector<int> v(n);
for (int i = 0; i < n; i++)
cin >> v[i];
int x;
cin >> x;
x--;
v.erase(v.begin() + x);
i... | ALGO | 0.999761 | 3.800411 |
be8e5201-c765-4b1d-8e6d-f2f35308c27d | MsgIsJmt/basic-cpp-2024 | day01/CProject/Project1/Project1/BetweenAdder.cpp | #include <iostream>
int main(void)
{
int val1, val2;
int result = 0;
std::cout << " Է: ";
std::cin>>val1 >>val2;
if (val1<val2)
{
for (int i = val1 + 1; i<val2; i++)
result += i;
}
else
{
for (int i = val2 + 1; i<val1; i++)
result += i;
}
std:: cout << " : " <<result<<std::endl;
return 0;
} | ALGO | 0.998283 | 3.388687 |
8c9af138-a4b8-4acd-add2-fb0ffde47409 | ishandutta2007/codeforces | akulyat/normal/1039/D.cpp | #include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
typedef long ll;
typedef long double ld;
typedef pair <ll, ll> pll;
ifstream in;
ofstream out;
const long long kk=1000;
const long long ml=kk*kk;
const long long mod=ml*kk+7;
const long long inf=ml*ml*ml+7;
const long long gs=500*kk;
... | ALGO | 0.999944 | 3.883114 |
563947ac-9b9d-41e7-8b30-99faf31c5630 | md143rbh7f/competitions | acm-icpc/mid-atlantic-usa/08/lock.cpp | #include <iostream>
using namespace std;
int main()
{
while(1)
{
int n, t1, t2, t3;
cin >> n >> t1 >> t2 >> t3;
if( !n ) break;
cout << 4 * n - 1 + ( ( t2 - t1 + n ) % n ) + ( ( t2 - t3 + n ) % n ) << endl;
}
return 0;
}
| ALGO | 0.999854 | 3.049602 |
add24329-f4c5-41d5-a1ba-39cdc8bf9e00 | SyedaShafi/C_programming | CPP/motivation.cpp | #include<bits/stdc++.h>
#include <algorithm>
using namespace std;
int main(){
int t;
cin>>t;
while(t--){
int n,x,s,r, mx=0;
cin>>n>>x;
for(int i =0; i<n; i++){
cin>>s>>r;
if (s <= x) {
mx = max(mx, r);
}
}
... | ALGO | 0.999541 | 3.943923 |
21814671-591b-48ff-9618-8c2951a07176 | orel1108/hackerrank | practice/mathematics/fundamentals/halloween_party/halloween_party.cpp | #include <cmath>
#include <iostream>
using namespace std;
int main()
{
int t;
unsigned long long n, h, r;
cin >> t;
while (t--)
{
cin >> n;
if (n == 0 || n == 1)
{
cout << 0 << endl;
}
else
{
h = n / 2;
if (n ... | ALGO | 0.999881 | 5.031844 |
cd5ca30e-4705-41a2-a821-f9e3e41716cf | abhay-sen/dsa | ARRAYS/arraysq3.cpp | //count the number of 0s and 1s
#include <bits/stdc++.h>
using namespace std;
int main() {
int arr[]={0,0,1,0,1,1,1,0,0};
int size=9;
int countOfZero=0;
for (int i = 0; i < size; i++)
{
if(arr[i]==0) countOfZero++;
}
cout<<"Number of zeros are "<<countOfZero<<" and number of ones are... | ALGO | 0.998797 | 3.463007 |
e2726565-71b3-43ad-b0b8-a5dc98a18c2c | SonLee369/Data-Structure-Algorithm | tongcuacacchusoSTN1_6.cpp | // Tìm tổng tất cả các chữ số có trong số tự nhiên k
#include <bits/stdc++.h>
using namespace std;
int Recursive(int k)
{
// Base case
if (k < 10)
return k;
return (k % 10) + Recursive(k / 10);
}
int main()
{
int k;
cout << "Nhap k: ";
cin >> k;
cout << Recursive(k) << endl;
... | ALGO | 0.99909 | 4.846953 |
952c9a3d-96c2-4d31-a377-3924dca56cdf | Kuznetsov-Artyom-Education/LinearProgramming | backpack.cpp | namespace lp {
void printResultFillBackpack(const std::pair<int, std::vector<int>>& p) {
std::cout << "max: " << p.first << '\n';
for (int i = 0; i < p.second.size(); ++i) {
std::cout << 'x' << i + 1 << ": " << p.second[i] << '\n';
}
}
std::pair<int, std::vector<int>> fillBackpack(const std::vector<int>& w... | ALGO | 0.999874 | 4.871091 |
74ef6be8-2797-412d-86ea-317212dc147a | Wenjun-Ji/DataStructures-NKU | OJ_Practice_DataStruct/5_矩阵_三元组表示的稀疏矩阵的乘法运算.cpp | #include<iostream>
using namespace std;
int main() {
int row1, col1, row2, col2, count1, count2;
cin >> row1 >> col1 >> count1;
int** arr1 = new int*[row1];
for (int i = 0; i < row1; i++) {
*(arr1 + i) = new int[col1];
}
for (int i = 0; i < row1; i++) {
for (int j = 0; j < col1; j++) {
arr1[i][j] = 0;
... | ALGO | 0.999504 | 3.091381 |
610e4937-5144-47ac-ba1c-9e1da23e7e46 | drubiom/c-code | 07_multi_russe/russe.cpp |
#include <stdio.h>
#include <stdlib.h>
int main(){
//Declaro las variables op1, op2, resultado
int op1, op2, resultado;
//Pedir op1 y op2 al usuario
printf("Introduce primer nº:");
scanf(" %i", &op1);
printf("Introduce segundo nº:");
scanf(" %i", &op2);
//Poner resultado=0
resultad... | ALGO | 0.999846 | 3.663996 |
57dccc60-2413-4836-928d-7b91935af22d | sdurand777/test_dpvslam | thirdparty/eigen-3.4.0/doc/examples/tut_arithmetic_scalar_mul_div.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace Eigen;
int main()
{
Matrix2d a;
a << 1, 2,
3, 4;
Vector3d v(1,2,3);
std::cout << "a * 2.5 =\n" << a * 2.5 << std::endl;
std::cout << "0.1 * v =\n" << 0.1 * v << std::endl;
std::cout << "Doing v *= 2;" << std::endl;
v *= 2;
std::cout << ... | ALGO | 0.991294 | 3.669638 |
d0478c4b-e841-4a0c-9d3a-4ac2245cdd14 | Vignesh1399/Programming-Contests | Codeforces Round #674 (Div. 3)/C.cpp | #include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define eb emplace_back
#define FAST ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define sz(a) signed(a.size())
using namespace std;
void solve(){
ll n;
cin >> n;
if(n == 1){
cout << 0 << "\n";
return ;
}
ll ans = 1e9;
for(ll i=0;i... | ALGO | 0.999923 | 4.593512 |
9f6b6f66-0eaf-489d-bc34-280a3d1b0b94 | brospresident/Squid-Game-Radu-Andrei | main.cpp | #include <iostream>
#include <vector>
// My includes
#include "./User/User.h"
#include "./User/Supervisor.h"
#include "./User/Competitor.h"
#include "./Generator/Generator.h"
#include "./UserManager/UserManager.h"
#include "./Teams/Team.h"
#include "./Teams/Circle.h"
#include "./Teams/Triangle.h"
#include "./Teams/Rec... | TOOL | 0.93876 | 3.559596 |
e90779a6-057d-44de-a387-4dedde1ca938 | Rygor20/Semestr_6 | SEC/SEC_L4/rsa.cpp | #include <iostream>
#include <cmath>
#include <vector>
#include <algorithm>
#include <random>
std::random_device rd;
std::mt19937 gen(rd());
uint64_t gcd_extended(uint64_t a, uint64_t b, uint64_t& x, uint64_t& y) {
if (a == 0) {
x = 0;
y = 1;
return b;
}
uint64_t x1, y1;
uint6... | ALGO | 0.99983 | 5.415532 |
c54afd65-f1c2-40d8-b85e-6ccfa5996bb9 | Sloan-YXT/CMPW-CLIENT | faceDetect.cpp | #include <opencv2/core/core.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/opencv.hpp>
#include <vector>
#include <cstdio>
using namespace std;
using namespace cv;
int main()
{
// 【1】加载分类器
CascadeClassifier cascade;
cascade.load("/home/pi/opencv/data/haarcascades/haarcascade_frontalface_a... | TOOL | 0.959773 | 3.910042 |
fb3fb2ae-a5a7-4d10-a978-6ffe3f0355e0 | Lelbaba/Competitive-Programming | Data Structures/segment-tree-lazy-class.cpp | #include <bits/stdc++.h>
using namespace std;
using LL = long long;
/*--------------------------------------------------
* There are six things you need to worry about
* The data type of the values on the nodes: DT
* The data type of the updates on the nodes: LT
Lazy data will be the same as an upda... | ALGO | 0.99958 | 5.127004 |
d5d97bf2-c251-47da-9c3f-1ecc02ac0050 | yomcong/Programmers | 17478-recursiveFunction.cpp | #include <iostream>
#include <stdio.h>
using namespace std;
void Binary_2(int n)
{
if (n < 0)
{
return;
}
for (int i = 0; i < (n * 4); i++)
{
cout << "_";
}
cout << "라고 답변하였지." << endl;;
Binary_2(n - 1);
}
void Binary(int n)
{
static int i = n;
if (n < 0)
{
return;
}
Binary(n - 1);
if (n == i)
{... | ALGO | 0.999812 | 3.490031 |
9227e90a-6d61-4c8b-aed4-8aa2643f67ae | Zeta611/project-euler | 073-counting-fractions-in-a-range.cpp | #include <iostream>
#include <numeric>
constexpr int MAX{12'000};
int main()
{
int cnt{0};
for (int d{5}; d <= MAX; ++d) {
const int lo{d / 3 + 1};
const int hi{(d + 1) / 2};
for (int n{lo}; n < hi; ++n) {
if (std::gcd(d, n) == 1) {
++cnt;
}
... | ALGO | 0.999625 | 5.116273 |
515e1cbf-ff48-41bb-8707-717f4d751afe | moonmehedi/Programming-Problems | 100 interview questions/14LongestCommonPrefix.cpp | #include <bits/stdc++.h>
using namespace std;
class solution
{
public:
string LongestCommonPrefix(vector<string> &strs)
{
string lcp = strs[0];
for (int i = 1; i < strs.size(); i++)
{
string s1 = strs[i];
for (int i = 0; i < min(lcp.length(), s1.length()); i++)
... | ALGO | 0.99931 | 4.912731 |
50e7c6f7-badf-4170-9649-b75fb3fe7e84 | kpilkk/Leetcode | container-with-most-water.cpp | // https://leetcode.com/problems/container-with-most-water/
// Brute Force : TLE
class Solution {
public:
int maxArea(vector<int>& height) {
int max_area = 0;
int n = height.size();
for(int i = 1; i < n; ++i){
for(int j = i + 1; j <= n; ++j){
int area = min(heigh... | ALGO | 0.999981 | 6.747564 |
ee2d491a-1c1e-45d3-9dc2-c1b7e4257de5 | skyqnaqna/algorithm_study | boj/GraphTheory/BOJ_3098.cpp | // 백준 3098 소셜네트워크
// 21.03.16
#include <iostream>
#include <algorithm>
#include <queue>
#include <vector>
#include <string>
#include <cmath>
#include <set>
#include <stack>
#include <tuple>
#define INF 1e9
#define endl "\n"
typedef long long ll;
typedef double dd;
typedef std::pair<int, int> pii;
typedef std::pair<ll... | ALGO | 0.999967 | 3.634127 |
ac7a119a-c72f-4a91-a999-c062e9ede65f | anik-ewu/Programming-Contest-Templates | String Algorithms/suffix array merge+quick short.cpp | ///Algorithm : Suffix Array
///Time: n*log(n)*log(n);
#include<bits/stdc++.h>
using namespace std;
void suffix_array_construction(string s){
s+="$";
int n=s.size();
vector< int > p(n), c(n);
{
//for k==0
vector< pair < int, int > > a(n);
for(int i=0; i<n; i++)a[i]={s[i], i};
sort(a.begin(), a.end());
... | ALGO | 0.999832 | 3.847494 |
be4347f0-80e9-428c-a695-098b73eeaada | SuperBigFive/Charming_XCPC | Codeforces/Edu/Edu137(div2)/D.cpp | #include <bits/stdc++.h>
#define ll long long
#define int ll
using namespace std;
const int maxn = 2e6 + 5;
int n, siz;
vector <int> pos0, diff;
vector <int> ans_ok (maxn);
string s, t, ans, test, tmp;
void init () {}
void check (int be, int len) {
test.clear ();
for (int i = be; i <= be + len - 1; ++i) {
test +... | ALGO | 0.999972 | 3.903747 |
19006aab-d433-4a8e-abde-129ac4c76a76 | BinSaif99/CodeForces-Problem-Solving | Contest_Codes/Div_2_contest/b.cpp | //#include <iostream>
//#include <vector>
//using namespace std;
//
//// Function to calculate the number of fibonacci-like sequences of length k with n as the k-th element
//int countFibonacciLikeSequences(int n, int k) {
// // For k = 3, there will always be one valid sequence [0, n, n]
// if (k == 3) {
// ... | ALGO | 0.999969 | 5.778301 |
3991500b-638e-49d4-8ac1-86f82d827f0d | Dudubraga/Competitive-Programming | backup_temp/contest3/455/455.cpp | #include <bits/stdc++.h>
using namespace std;
#define _ ios::sync_with_stdio(0);cin.tie(0);
#define endl '\n'
#define all(x) x.begin(), x.end()
#define pb push_back
#define mp make_pair
int main(){ _
int t; cin >> t;
while(t--){
string s; cin >> s;
cout << s << " " << s.size() << endl;
... | ALGO | 0.991113 | 3.415103 |
5f8e2522-b182-487e-ab90-de5931688be2 | NoraAl/DBSCAN | cluster.cpp | #include "cluster.hpp"
static Points points;
static int size;
static double epsilon = 2;
/****************************
*
*
* main
*
*
****************************/
bool lessThan(P i, P j) {
if (i.x < j.x)
return true;
if (i.x == j.x)
return i.y < j.y;
return false;
}
int main() {
... | ALGO | 0.99826 | 5.286514 |
fd80effc-f279-41ff-bd0f-003d75a53064 | SonarOpenCommunity/sonar-cxx | cxx-squid/src/test/resources/parser/examples/cont/stack1.cpp | #include <iostream>
#include <stack>
using namespace std;
int main()
{
stack<int> st;
// push three elements into the stack
st.push(1);
st.push(2);
st.push(3);
// pop and print two elements from the stack
cout << st.top() << ' ';
st.pop();
cout << st.top() << ' ';
st.pop();
... | ALGO | 0.983131 | 5.132743 |
dcc43a03-7199-4bca-a057-21cfd6802451 | EricWay1024/Algorithm-Learning | dp/3047/3047.cpp | //#include <bits/stdc++.h>
#include<algorithm>
#include<bitset>
#include<cmath>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<ctime>
#include<deque>
#include<iostream>
#include<map>
#include<queue>
#include<set>
#include<stack>
#include<string>
#include<utility>
#include<vector>
#include<numeric>
#inclu... | ALGO | 0.999977 | 3.597891 |
ca7d03eb-1864-46e1-9997-186e16f6f419 | Sc-lab-2016/lab4 | lib/symbolic/examples/hermite.cpp | // hermite.cpp
// Recursion formula H_{n+1}(x) = 2xH_n(x)-2nH_{n-1}(x)
#include <iostream>
#include "symbolicc++.h"
using namespace std;
class Hermite
{
private:
int maxTerm, currentStep;
Symbolic P, Q;
const Symbolic &x;
public:
Hermite(int,const Symbolic&);
int step();
void run();
Symbolic cu... | ALGO | 0.999991 | 5.898642 |
eccd8cd3-3b56-4b13-8577-bf445985d576 | HaoLe-cyber/Code-C-tasks | Thuchanh3/sapxepluachon.cpp | #include <stdio.h>
int main(){
int num;
printf ("Nhap so phan tu cua mang: ");
scanf ("%d", &num);
int arr[num];
printf ("Nhap cac phan tu trong mang:\n");
for (int i = 0; i < num; i++){
printf ("arr[%d] = ", i);
scanf ("%d", &arr[i]);
}
for (int i = 0; i < num-1; i++)
... | ALGO | 0.999564 | 3.239297 |
7582addc-ebe5-4934-ab28-08bae9fb860c | tsian077/c | 比賽/63/problem3.cpp | #include<iostream>
#include<iomanip>
#include<math.h>
using namespace std;
int main()
{
for(int i=0;;i++)
{
double wei=0,hei=0,year=0;
double ha=0,clo=0,pan=0;
cin>>hei>>wei>>year;
if(year>28)
{
pan=wei*0.4;
for(int i=0;i<floor(((year-28)/2));i++)
{
//cout<<"w";
pan+=0.25;
}
}
else
{
pan=wei... | ALGO | 0.99824 | 3.03768 |
fc6b0ce5-926b-480d-9dca-5611488c222e | syhsyh9696/Discrete_Mathematics | test.cpp | #include <iostream>
#include "Matrix.h"
#include <cmath>
#include <string>
using namespace std;
bool reflexivity(MATRIX<double>& temp, int row);
bool anti_reflexivity(MATRIX<double>& temp, int row);
bool symmetry(MATRIX<double>& temp,int row);
bool transitivity(MATRIX<double>& temp, int row);
MATRIX<double> reflexivi... | ALGO | 0.995955 | 3.809533 |
dc568a1a-8446-45d1-aa81-c921d57d7a58 | Mr-Phoebe/ACM-ICPC | 比赛源码/2014 Multi-University Training Contest 09/1009.cpp | #include <iostream>
#include <cstdio>
using namespace std;
const int minScore[5] = {85, 80, 75, 70, 60};
const int maxScore[5] = {100, 84, 79, 74, 69};
const double GPA4[5] = {4.0, 3.5, 3.0, 2.5, 2.0};
int totalScore, numOfCourses;
int scale[5];
int main()
{
int T;
// freopen("data.in", "r", stdin);
// freo... | ALGO | 0.999085 | 3.077251 |
53a0c46f-4ad1-4a14-ae9c-7539e93996f2 | geraldstanje/algorithms | data_structures/stack_with_min.cpp | #include <iostream>
#include <stack>
#include <ctime>
#include <stdio.h>
#include <stdlib.h>
using namespace std;
class Solution {
stack<int> s;
stack<int> m;
public:
int pop() {
if (s.empty()) { return -1; }
int val = s.top();
s.pop();
if (val == m.top()) {
m.pop();
}
return val;
}
int top() ... | ALGO | 0.999744 | 4.642773 |
771ae232-c263-42df-a3b3-071d5282fe02 | arun-iitg025/Competitive-Programming | Codeforces/A_Boy_or_Girl.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
string str;
cin>>str;
set<char> st;
for(auto &x:str){
st.insert(x);
}
if(st.size()%2 == 1){
cout << "IGNORE HIM!" << endl;
}
else{
cout << "CHAT WITH HER!" << endl;
}
return 0;
} | ALGO | 0.999574 | 4.020559 |
d3912727-2940-49fc-9d63-20fc49ccb33e | AhmedTheMagnificent/Leetcode-Problems | 83-remove-duplicates-from-sorted-list/remove-duplicates-from-sorted-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:
ListNode* deleteDupli... | ALGO | 0.999955 | 5.834025 |
c30992ce-a76a-42a0-949a-77ac8949b789 | danieltrt/SBFL | playground/java/TRIANGULAR_MATCHSTICK_NUMBER.cpp | #include <iostream>
#include <cstdlib>
#include <string>
#include <vector>
#include <fstream>
#include <iomanip>
#include <vector>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <numeric>
#include <algorithm>
using namespace std;
int f_gold ( int x ) {
return ( 3 * x * ( x + ... | ALGO | 0.977554 | 5.890078 |
f8711abd-7893-43a1-b9a1-fb25603e4b6a | Zashk0/University | lekciq-6/tester.cpp | #include <iostream>
#include <cmath>
int firstDigit(int n)
{
while (n >= 10)
{
n = n / 10;
}
return floor(n);
}
int main()
{
int n, counter=0,i=0;
std::cout << "Enter the number for n: ";
std::cin >> n;
if (n < 1)
{
std::cout << "try again!" << std::endl;
... | ALGO | 0.998552 | 3.670821 |
6b52313d-55f9-434c-8b0c-ced52d1d9c3c | Junlin-Yin/myLeetCode | mine/53-maximum_subarray.cpp | class Solution1 {
public:
int maxSubArray(vector<int>& nums) {
//双指针:若当前子串和为负,则比较该子串和与该处元素,确定是否更新子串起始位置
//若当前字串和为正,则直接与该处元素相加,子串终止位置右移,随即更新子串和
int maxS = -1e6, S = 0;
for(auto i: nums){
if(S < 0) S = max(S, i);
else S += i;
maxS = max(maxS, S);
... | ALGO | 0.999996 | 5.731147 |
59245a8e-bb2f-42fc-8eea-c1c3fa1b5c71 | Na-Tag/Atcoder | ARC/147/A/A.cpp | #include <iostream>
#include <vector>
#include <queue>
using namespace std;
/*
int max(vector<int>vec){
int max = 0;
int n = vec.size();
int no = 0;
for(int i = 0; i < n; i++){
if(vec(i) > max){
max = vec(i);
no = i;
}
}
vector<int> vec = {max,no};
}
int... | ALGO | 0.999985 | 4.189815 |
cfa1e646-7d1d-4e2a-95bb-c11f404e66e8 | Brankike/LabosFunda | 3/Circulo.cpp | #include "iostream"
#include "cmath"
using namespace std;
int main(void)
{
float r, area, pot, pi, perimetro;
cout << "Perimetro y Area de un Circulo" << endl;
cout << "Ingresa el Radio de el circulo:";
cin >> r;
pot = pow (r, 2);
pi = 3.14;
area = pi*pot;
perimetro = 2*pi*r;
cout <<... | ALGO | 0.926504 | 3.622987 |
b538916b-d744-46c3-b29d-b31dba4ac2d4 | TarunSaini063/Coding | DataStructure/codeforces/652_1.cpp | #include <bits/stdc++.h>
using namespace std;
#define ld double
#define ll long long
#define pb emplace_back
#define mk make_pair
#define mod 1000000007
#define ff first
#define ss second
#define FIO ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define all(x) x.begin(),x.end()
ll power(ll a, ll b) {... | ALGO | 0.99615 | 4.783963 |
fcb7c07c-acf5-4c77-8377-da5b06853d2e | quachconghoang/openvins-lite | ov_init/src/ceres/Factor_ImuCPIv1.cpp | #include "Factor_ImuCPIv1.h"
#include "utils/quat_ops.h"
using namespace ov_init;
Factor_ImuCPIv1::Factor_ImuCPIv1(double deltatime, Eigen::Vector3d &grav, Eigen::Vector3d &alpha, Eigen::Vector3d &beta,
Eigen::Vector4d &q_KtoK1, Eigen::Vector3d &ba_lin, Eigen::Vector3d &bg_lin, Eigen... | ALGO | 0.997495 | 6.081729 |
0d873766-af98-4789-ac81-4cdcfaf66bdb | ktimam/bulletFixedPoint | src/BulletSoftBody/btDeformableContactConstraint.cpp | #include "btDeformableContactConstraint.h"
/* ================ Deformable Node Anchor =================== */
btDeformableNodeAnchorConstraint::btDeformableNodeAnchorConstraint(const btSoftBody::DeformableNodeRigidAnchor& a, const btContactSolverInfo& infoGlobal)
: m_anchor(&a), btDeformableContactConstraint(a.m_ct... | ALGO | 0.992614 | 5.790202 |
8c8f2e42-8025-45db-948f-ddaf8f72c5cc | phuongthanhcute/TTUD | Codeforce/De thi giua ky/String_matching.cpp | #include <bits/stdc++.h>
using namespace std;
// Hàm tính bảng prefix function
vector<int> Check(const string& P) {
int m = P.length(); // Lấy độ dài của mẫu P
vector<int> pi(m); // Khởi tạo vector pi có kích thước bằng độ dài của mẫu P, để lưu trữ bảng prefix function
int k = 0; ... | ALGO | 0.999955 | 5.958923 |
ec0e43d8-4584-48c7-8a11-c9baba514927 | lokochaol/AtCoder | ABC283/d.cpp | // https://atcoder.jp/contests/abc283/tasks/abc283_d
// stackを使う方法と、再帰で書く方法があるらしい。
// /*
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < n; i++)
// 再帰を使った実装
int main(void) {
string S;
cin >> S;
size_t si = 0;
set<char> cs;
bool ok = true;
auto f = [&](auto ... | ALGO | 0.999907 | 5.09246 |
a3679e24-4332-4408-84ac-ecc64c43b9cc | Kapil-Bhandari-BCT/C-program | Product of matrix.cpp | //Program to find product of two matrices
#include<stdio.h>
int main()
{
int mat1[10][10],mat2[10][10],prod[10][10],i,j,k,m,n,p,q,sum=0;
printf("Enter order of matrix 1: ");
scanf("%d %d",&m,&n);
printf("Enter order of matrix 2: ");
scanf("%d %d",&p,&q);
if(n!=p)
{
printf("The product of matrix is not p... | ALGO | 0.999133 | 3.618539 |
21b78707-44fe-4438-9802-a14c7562c1bf | zzm99/Algorithm-Training | 模拟/面试题 01.05. 一次编辑.cpp | class Solution {
public:
bool oneEditAway(string first, string second) {
int s1 = first.size(), s2 = second.size();
if(abs(s1-s2) > 1) return false;
if(s1 < s2) return oneEditAway(second, first);
int edit = 0;
for(int i=0; i<s1; i++) {
if(first[i] != second[i-(s1-... | ALGO | 0.999976 | 5.898154 |
7f5c34ad-f289-4d3e-b5b8-3d2093514f44 | n01e0/IDULLVM | libcxx/test/std/algorithms/alg.modifying.operations/alg.remove/remove_if.pass.cpp | // <algorithm>
// template<ForwardIterator Iter, Predicate<auto, Iter::value_type> Pred>
// requires OutputIterator<Iter, RvalueOf<Iter::reference>::type>
// && CopyConstructible<Pred>
// constexpr Iter // constexpr after C++17
// remove_if(Iter first, Iter last, Pred pred);
#include <algorithm>... | TEST | 0.903247 | 7.036469 |
41de2f85-0550-4ce7-a53c-8ed7716eadf3 | moo1o/AlgorithmPractice | Baekjoon/1786.cpp | #include <cstdio>
#include <string>
using namespace std;
char T[1000005];
char P[1000005];
int hT[1000005];
int hP;
int n, m;
int cnt, loc[10000005];
int _strlen(char* dest) {
int len = 0;
while (*dest != '\0') {
dest++;
len++;
}
return len;
}
int main(void) {
scanf("%[^\n]", T);
scanf("%s", P);
scanf("%[... | ALGO | 0.999978 | 3.848862 |
e50a99b5-d136-4f1e-8e49-6f276d4fb5ee | ISHU9958/-6Companies30DaysChallenge | random Flip.cpp | class Solution {
int m,n;
set<pair<int,int>>st;
public:
Solution(int m, int n) {
this->m=m;
this->n=n;
}
vector<int> flip() {
int randomi=rand() % m;
int randomj=rand()% n;
if(st.find({randomi,randomj})==st.end()){
st.insert({randomi,... | ALGO | 0.994836 | 5.423923 |
4d12d9a0-7018-41a7-9678-75a5a84b35e3 | bharat1718swami/leetcode | 1_Two_Sum.cpp |
class Solution {
public:
vector<int> twoSum(vector<int>& nums, int target) {
vector<int> output;
int n=nums.size();
vector<int> temp=nums;
int arr[2];
// cout<<temp[0];
sort(temp.begin(),temp.end());
// cout<<temp[0];... | ALGO | 0.99975 | 6.139702 |
f2f6a2ba-c304-49df-9b2a-b3bfc2251f10 | komalkvy/LEET_CODE | 347-top-k-frequent-elements/top-k-frequent-elements.cpp | class Solution {
public:
vector<int> topKFrequent(vector<int>& nums, int k) {
// Hash map to count frequencies of each number
unordered_map<int, int> freq;
// Count frequencies
for (int& num : nums)
freq[num]++; // Increment frequency count for each number
prior... | ALGO | 0.999993 | 6.734971 |
4b804ba3-d9ff-4569-acad-6f7ea04d98c8 | shubhankar-31/DS-using-cpp | construction _max_heap.cpp | #include <iostream>
#include <cmath>
#include <cstdio>
#include <vector>
#include <array>
#include <queue>
#define space cout<<"\n\n\n\n";
using namespace std;
void heapify(vector<int> &arr, int n, int i)
{
int largest = i; // Initialize largest as root
int l = (2 * i) + 1;//left child index
int r = (2 * i... | ALGO | 0.999874 | 4.210486 |
641b1b39-b012-49ba-a209-910562d21bf5 | SI-Abid/ACM | LU-MU_colab2/b.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
int k=sqrt(n);
cout<<k*k<<endl;
return 0;
} | ALGO | 0.99943 | 4.052408 |
300ceb3e-7801-47ad-831b-bb9c680a4e50 | ZhangXinNan/Geodesic-Object-Proposals | lib/python/segmentation.cpp | #include "segmentation/segmentation.h"
#include "segmentation/iouset.h"
#include "contour/sketchtokens.h"
#include "contour/structuredforest.h"
#include "contour/directedsobel.h"
#include "map.h"
#include "gop.h"
#include <boost/python/suite/indexing/vector_indexing_suite.hpp>
static np::ndarray segmentBinaryGraph( co... | ALGO | 0.988611 | 6.250852 |
8dd8270a-ae9b-44d1-87f2-7963de7612a3 | Lalit-Dumka/Leetcode-DSA | 3056-determine-if-a-cell-is-reachable-at-a-given-time/3056-determine-if-a-cell-is-reachable-at-a-given-time.cpp | class Solution {
public:
bool isReachableAtTime(int sx, int sy, int fx, int fy, int t) {
if(sx==fx && sy==fy){
if(t==1) return false;
return true;
}
if(max(abs(sx-fx),abs(sy-fy))<=t) return true;
return false;
}
}; | ALGO | 0.999928 | 5.778327 |
900e8982-8a4b-416b-b8f9-c53f09cfa29c | shivamgohri/ds_codes | Stack/smallestNumber.cpp | #include <bits/stdc++.h>
using namespace std;
typedef unsigned long long int ull;
typedef long long ll;
#define pb push_back
#define mp make_pair
#define MAX (int)1e7+5
string getString(stack<char> &s){
string ans = "";
while(!s.empty()){
char x = s.top();
ans += x;
s.pop();
}
while( ans[ans.length()-1]==... | ALGO | 0.999912 | 4.918745 |
ef8e7460-9ebe-4545-96b7-6f51b4ac48b0 | ehnryx/acm | prognova2020/d-bad.cpp | #include <bits/stdc++.h>
using namespace std;
#define _USE_MATH_DEFINES
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
typedef long long ll;... | ALGO | 0.999869 | 4.619227 |
07675286-f85b-47e1-b90f-a658d8d7ba3f | chiseungii/baekjoon | 09316.cpp | #include <iostream>
using namespace std;
int main() {
int N; cin >> N;
for (int i = 0; i < N; i++)
cout << "Hello World, Judge " << i + 1 << "!\n";
}
| ALGO | 0.975006 | 3.389634 |
1fdab4cb-f9e1-4553-a4a2-e3eb2992a742 | svk-123/SU2_solver_custom | SU2_CFD/src/solver_direct_turbulent.cpp | #include "../include/solver_structure.hpp"
CTurbSolver::CTurbSolver(void) : CSolver() {
/*--- Array initialization ---*/
FlowPrimVar_i = NULL;
FlowPrimVar_j = NULL;
lowerlimit = NULL;
upperlimit = NULL;
}
CTurbSolver::CTurbSolver(CConfig *config) : CSolver() {
Gamma = config->GetGamma();
Gamma_... | ALGO | 0.997167 | 5.690443 |
15a21c62-839e-492a-8c76-5e5903a32bc0 | zsol/android_frameworks_base | libs/utils/ZipFileRO.cpp | //
// Read-only access to Zip archives, with minimal heap allocation.
//
#define LOG_TAG "zipro"
//#define LOG_NDEBUG 0
#include <utils/ZipFileRO.h>
#include <utils/Log.h>
#include <utils/misc.h>
#include <zlib.h>
#include <string.h>
#include <fcntl.h>
#include <errno.h>
#include <assert.h>
using namespace android;
... | TOOL | 0.943534 | 5.714615 |
f8008d96-4d0e-4059-a7b0-ca5aabc75a1a | m4oughi/100DaysofCode | pureCPP/0007. Day 7/Functions/009. Recursion/008. Recursion with Memoization - Fibonacci Sequence Optimization/main.cpp | #include <iostream>
#include <vector>
// Recursive Fibonacci with memoization
int fibonacciMemo(int n, std::vector<int>& memo) {
if (n <= 1)
return n;
if (memo[n] == -1)
memo[n] = fibonacciMemo(n - 1, memo) + fibonacciMemo(n - 2, memo);
return memo[n];
}
int main() {
int n = 10;
... | ALGO | 0.999974 | 7.309989 |
c265b4eb-802e-4384-be59-180432bdcff0 | Wawrzyn321/Polynomial-Fighter | Polynomial-Fighter/PolynomialFactor.cpp | #include <cmath>
#include "PolynomialFactor.h"
#include "Debug.h"
PolynomialFactor::PolynomialFactor(int x, int constant) : x(x), constant(constant) {}
int PolynomialFactor::getX() const
{
return x;
}
void PolynomialFactor::setX(int x)
{
PolynomialFactor::x = x;
}
int PolynomialFactor::getConstant() const
{... | TOOL | 0.876317 | 5.078435 |
dba7ab60-cc20-4cc3-b19b-8c36b7a913b2 | rsk0315/library | test/yj_static_range_sum.test.cpp | #define PROBLEM "https://judge.yosupo.jp/problem/static_range_sum"
#include <cstdint>
#include <cstdio>
#include <vector>
#include "DataStructure/basic_segment_tree.cpp"
int main() {
size_t n, q;
scanf("%zu %zu", &n, &q);
std::vector<intmax_t> a(n);
for (auto& ai: a) scanf("%jd", &ai);
basic_segment_tree... | ALGO | 0.999818 | 5.71621 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.