uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
3ac16543-aa67-4e24-9916-69d9af9cb553 | ulyazzh/Tugas-tugas-Dasar-Pemrograman | latihan/jenis segitiga.cpp | //judul: jenis segitiga
#include <iostream>
using namespace std;
//kamus:
int a, b, c;
//deskripsi:
main()
{
cout << "menentukn jenis segitiga" << endl;
cout << " " << endl;
cout << "masukkan panjang sisi a: " ;
cin >> a;
cout << "masukkan panjang sisi b: " ;
cin >> b;
cout << "masukkan pa... | ALGO | 0.998104 | 3.956205 |
40c3d6b6-7a1d-408b-a09d-4674f323ab5e | sendoru/problem_solving | source/boj/1086.cpp | #include <iostream>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
int decimalMod[51];
ll factorial(ll a)
{
ll ret = 1;
for (int i = 1; i <= a; i++)
{
ret *= i;
}
return ret;
}
ll getGCD(ll a, ll b)
{
if (b == 0)
{
return a;
}
return getGCD(b, a % b);
}
int getMod(string... | ALGO | 0.999851 | 4.313872 |
8097a7dd-16ef-4f7b-947f-da620f8bcd6c | imicola/Questions-and-Impressions | main/LeetCode/No5.cpp | //#pragma GCC optimize(3)
#include <bits/stdc++.h>
//#define int LL
#define endl '\n'
#define size_t int
#define all(v) v.begin(), v.end()
using namespace std;
typedef long long LL;
typedef vector<int> vint;
typedef vector<vint> vvint;
typedef vector<string> vstr;
typedef pair<int, int> pii;
typedef vector<pii> vpii;
... | ALGO | 0.999965 | 5.024857 |
16de2025-fe05-4080-9ebb-f7924c395c40 | sptea/atclog | 2017/Nov/abc077/B.cpp | #include<iostream>
#include<string>
#include<algorithm>
#include <map>
#include <string.h>
#include <math.h>
using namespace std;
int main()
{
int n, r;
cin >> n;
r = (int)pow((double)n, 0.5);
cout << (int)pow(r, 2) << endl;
return 0;
} | ALGO | 0.998568 | 3.268213 |
4ce23ae8-9221-4e4c-b21f-55edecdb05b5 | raincross7/code-similarity | codes/train_code/problem392/problem392_488.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
char c;
cin >> c;
bool vowel = false;
if (c == 'a')
{
vowel = true;
}
else if (c == 'i')
{
vowel = true;
}
else if (c == 'u')
{
vowel = true;
}
else if (c == 'e')
{
vowel = true;
}
else if (c == 'o')
{
... | ALGO | 0.998696 | 4.138006 |
5a2601ec-4ce5-4503-9adc-7802bead6cc8 | avinashsai/Codechef | Explore/exp4.cpp | #include<iostream>
#include<string.h>
using namespace std;
int main()
{
string x,y;
long long int a[26]={0},b[26]={0},i,n,m;
cin>>x>>y;
n=x.length();
m=y.length();
if(n!=m)
cout<<"Not Anagram";
else
{
for(i=0;i<n;i++)
++a[x[i]-97];
for(i=0;i<m;i++)
++b[y[i]-97];
for(i=0;i<26;i++)
{
if(a[i]!=b[i])
{
cout<<"Not Anagram";... | ALGO | 0.999989 | 3.210155 |
5a246771-ef6e-470c-8d9f-aff0fab0aa51 | HariKrishnaShah/CollegeWork | Programs for Data Structures/Singly Linked list with data.cpp | #include <stdio.h>
#include <malloc.h>
//Coded By Hari Krishna Shah
struct node{
char regno[20];
char name[50];
struct node *next;
};
struct node *create_and_expand(struct node *);
struct node *insert_end(struct node *);
struct node *display(struct node *);
struct node *add_head(struct node *);
struct node *delet... | ALGO | 0.994355 | 3.839306 |
717714db-93d5-46ed-af98-b9e7cf3f6073 | victor50408/TKU | repos/A/A/P20.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <stdio.h>
#include <queue>
#define IN "C:\\Users\\lxu93\\source\\repos\\TEST_INPUT(TXT)\\P20IN.txt"
#define OUT "P20OUT.txt"
using namespace std;
void P(string s,int len,char chara) {
if(chara == '-') ... | ALGO | 0.998672 | 3.486687 |
2e920687-a2ec-48a7-a07a-e164ba322882 | zengkehao/operating-system-experiment | ptable.cpp | #include "ptable.h"
#include "pcb.h"
#include <cstring>
#include<string>
#include<sstream>
#include <iostream>
#include <QMessageBox>
using namespace std;
//初始化分区表
void InitTable (Table *tlink)
{
(*tlink) = (Table)malloc(sizeof(Node2));
(*tlink)->PID = 0;
(*tlink)->address = -1;
(*tlink)->memsize = -1;... | TOOL | 0.894556 | 3.700723 |
96209913-85de-4a0d-8d82-664782071056 | witmaos6/LeetCode | 3075-maximize-happiness-of-selected-children/3075-maximize-happiness-of-selected-children.cpp | class Solution {
public:
long long maximumHappinessSum(vector<int>& happiness, int k)
{
sort(happiness.begin(), happiness.end(), greater<>());
const int N = static_cast<int>(happiness.size());
long long Result = 0;
int Decrease = 0;
for(int i = 0; i < k; i++)
... | ALGO | 0.999989 | 5.626482 |
9938b330-311e-4ad3-92bf-7e6ea3239283 | Nemo21/Random-Bullshit-Go | CodeForces Questions/CodeForces First 100/GigaTower.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define pii pair<ll,ll>
#define vi vector<ll>
#define vt(type) vector<type>... | ALGO | 0.998472 | 3.81091 |
36ce9219-1b58-4d8c-97ed-ad5f68443629 | BeezCrypto/BeezCore | src/hash.cpp | #include "hash.h"
#include "crypto/hmac_sha512.h"
#include "crypto/scrypt.h"
inline uint32_t ROTL32(uint32_t x, int8_t r)
{
return (x << r) | (x >> (32 - r));
}
unsigned int MurmurHash3(unsigned int nHashSeed, const std::vector<unsigned char>& vDataToHash)
{
// The following is MurmurHash3 (x86_32), see http:... | ALGO | 0.984957 | 5.03172 |
ba474350-9b2a-4690-8b03-6259040b8ea9 | aplqo/exercises | luogu/00-Unknown/P6804-Generator.cpp | #include <algorithm>
#include <fstream>
#include <iterator>
#include <random>
#include <unordered_set>
#include "debug_tools/generator.h"
using namespace std;
using namespace apdebug::generator;
const int maxn = 1e5, maxd = 500, maxu = 2e5, maxq = 50000, maxh = 1e9;
void createChange(ofstream& in, const unsigned int ... | TOOL | 0.994614 | 4.365387 |
f38e36c1-dfcc-4720-8927-bc4c6fe375dc | anu2403/Data-structure-using-C | Recursion/9Factorial/fact2.cpp | #include<stdio.h>
int Ifact(int n)
{
int f=1;
int i;
for(i=1;i<=n;i++)
f=f*i;
return f;
}
int main()
{
int r;
r=Ifact(5);
printf("%d",r);
return 0;
}
| ALGO | 0.999943 | 4.180026 |
b93a4dc6-5f46-42d3-a1a1-50f1788d2aa4 | WIZARD-CXY/pl | leetcode2/editdistance.cpp | class Solution {
public:
int minDistance(string word1, string word2) {
int m=word1.size();
int n=word2.size();
// dp[i][j] means the min distance to change word1[0,i) to word2[0,j]
vector<vector<int> > dp(m+1,vector<int>(n+1,0));
dp[0][0]=0;
//initial the fir... | ALGO | 0.999993 | 5.74435 |
aed69005-3e8a-4dfd-a055-5696c6cc8551 | Urvashi003/practice.24 | reverse.cpp | #include<iostream>
using namespace std;
void reverse(int arr[] , int n){
int start = 0;
int end = n-1;
while(start<=end){
swap(arr[start],arr[end]);
start++;
end--;
}
}
void printArray(int arr[] , int n){
for(int i=0 ; i<n ; i++){
cout<< arr[i]<<" ";
}
cout<<... | ALGO | 0.996788 | 5.117401 |
fc4bc080-330a-4821-ba86-3c4389139677 | coruscating/Jarvis | www/prog/RamseyScanFastRepump.cpp |
// Ramsey scan that uses a delay to rotate about z-axis:
// start in |0>, do pi/2 X pulse with laser detuned to f+\delta
// wait a variable delay to rotate about Z axis
// do another pi/2 pulse X pulse with detuned laser
// same as normal ramsey scan, just with large detuning to quickly
// check if we're on the right ... | ALGO | 0.980379 | 4.060659 |
27470f26-c623-4cca-be01-1006db9d3cfd | kyduke/Coding | LeetCode/312_BurstBalloons.cpp | // https://leetcode.com/problems/burst-balloons/
#include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
int maxCoins(vector<int>& nums) {
vector<vector<int>> cache;
vector<int> copy;
vector<int> v;
int i, l, r, m, n, t;
copy.push_back(1);
for (i = 0; i < nums.size(); i++... | ALGO | 0.999901 | 5.458602 |
4422bb0e-7ce6-41da-ac14-ee22005031c5 | pkini2002/DSA | CSES_PROBLEM_SET_SOLUTIONS/Repititions.cpp | /*You are given a DNA sequence: a string consisting of characters A, C, G, and T. Your task is to find the longest repetition in the sequence. This is a maximum-length substring containing only one type of character.*/
// Input
// The only input line contains a string of n characters.
// Output
// Print one integer... | ALGO | 0.999968 | 3.96807 |
e60ba230-e2a5-460a-92c4-b940d6dad551 | Vortexx2/DSA-questions | leetcode/medium/80-remove-duplicates-2/sol.cpp | /**
* @file sol.cpp
* @author Vortexx2
* @brief Problem 80 - Remove Duplicates From Sorted Array 2
* @date 07-05-2023
*
* Runtime - 0 ms O(n)
* Memory Usage - 11.2 MB O(n)
*/
#include <bits/stdc++.h>
using namespace std;
class Solution {
public:
int removeDuplicates(vector<int>& nums) {
if (nums.size(... | ALGO | 0.999929 | 6.194656 |
aa047b12-e0c2-47d7-802f-f3e5ac031355 | ishtian-revee/Problem-Solving | UVa/10038 - Jolly Jumpers.cpp | #include<iostream>
#include<stdio.h>
#include<stdlib.h>
using namespace std;
int main(){
int n;
while(scanf("%d", &n) == 1){
int arr[n], temp[n-1] = {0};
for(int i=0; i<n; i++){
cin >> arr[i];
}
for(int i=0; i<n-1; i++){
if(abs(arr[i] - arr[i+1]) < n)... | ALGO | 0.99986 | 3.616578 |
464901d0-adb6-4e16-a42d-1a5f9b5c5337 | dvaitam/codeforces | 1000-1999/1200-1299/1240-1249/1243/solB2.cpp | #include<bits/stdc++.h>
using namespace std;
const int N = 1e4 + 10;
char s[N], t[N];
int tot[30];
struct node{
int a, b;
}p[200];
int main()
{
int T;cin>>T;
while(T--){
memset(tot, 0, sizeof tot);
int n, cnt = 0, flag = 0;
scanf("%d", &n);
scanf("%s", s + 1);
scanf("%s", t + 1);
for(int i = 1; i <= n; ... | ALGO | 0.999964 | 3.87952 |
54a5ed00-e22b-4c9d-a073-60c14a8eb1dc | bmin-09/cloud-operations | deps/icu-small/source/common/propsvec.cpp | #include <stdlib.h>
#include "unicode/utypes.h"
#include "cmemory.h"
#include "utrie.h"
#include "utrie2.h"
#include "uarrsort.h"
#include "propsvec.h"
#include "uassert.h"
struct UPropsVectors {
uint32_t *v;
int32_t columns; /* number of columns, plus two for start & limit values */
int32_t maxRows;
... | TOOL | 0.994661 | 6.53508 |
92a1b660-3330-49dd-9a84-ab4b3d8444da | ishandutta2007/codeforces | tute7627/normal/1419/D2.cpp | //#define _GLIBCXX_DEBUG
#include<bits/stdc++.h>
using namespace std;
#define endl '\n'
#define lfs cout<<fixed<<setprecision(10)
#define ALL(a) (a).begin(),(a).end()
#define ALLR(a) (a).rbegin(),(a).rend()
#define spa << " " <<
#define fi first
#define se second
#define MP make_pair
#define MT make_tuple
#define P... | ALGO | 0.999924 | 3.856115 |
d1b109dc-9521-4acf-810c-836f8f3a3db8 | senthilnathan01/DSA | Basics/Problems/UsingRecursions/palindrome_partitioning.cpp | /*
Given a string s, partition s such that every substring of the partition is a palindrome. Return all possible palindrome partitioning of s.
LeetCode Link: https://leetcode.com/problems/palindrome-partitioning/description/
*/
class Solution {
public:
bool isPalindrome(string &t)
{
// Using two point... | ALGO | 0.999901 | 6.657424 |
2aaab139-c7ae-4927-858c-2ed3f21c45a4 | Wolframm74/cnmf_bss | helper_modules/complex_argument_costfun_module2/Y_update_3.cpp | #include "local_inc.hpp"
/*cx_cube::fixed<F_static, N_static, K_static> P_Xh1_wrt_Ylk_fnk_l[L_static];
cx_cube::fixed<F_static, N_static, K_static> P_Xh2_wrt_Ylk_fnk_l[L_static];*/
cx_mat::fixed<F_static, N_static> P_Xh1_wrt_Ylk_fn;
mat::fixed<F_static, N_static> P_G1_wrt_Ylk_fn;
mat::fixed<F_static, N_static> P_H1... | ALGO | 0.999477 | 3.164865 |
28500496-5edf-41cc-996d-a7b6848af178 | BALAJInallusamy/Coding-Practice | Pseudo-Palindromic Paths in a Binary 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.999941 | 5.550297 |
652675a9-aa3c-4abd-bfb9-7f6db36245f5 | ashmin-yoon/baekjoon | 1343.cpp | #include <iostream>
using namespace std;
string ChangeString(int count) {
string str = "";
if (count % 2 != 0) {
cout << "-1";
exit(0);
}
for (int i = 0; i < (count / 4); i++) {
str += "AAAA";
}
for (int i = 0; i < (count % 4 / 2); i++) {
str += "BB";
}
return str;
}
int main() {
string str = "";
... | ALGO | 0.999425 | 3.536828 |
9b5fbe84-a40c-47ea-8be7-590755e3ffb9 | Gaurav-singh101/Strivers-A2Z-DSA-Course | DP/DP on Grids/UniquePaths2.cpp | ////////////////////// Normal Solution //////////////////
// #include <bits/stdc++.h>
// using namespace std;
// int uniquePathsWithObstacles(vector<vector<int>>& ob, int row, int col) {
// if (row >= 0 && col >= 0 && ob[row][col] == 1) return 0;
// if (row == 0 && col == 0) return 1;
// if (row < 0 |... | ALGO | 0.999925 | 5.824538 |
dc3a9543-624c-49e2-9141-b79f47886ef3 | bgodala/gem5_ARM_FDIP | src/systemc/tests/systemc/misc/unit/data/datawidth_unsigned/promote_extension/datawidth.cpp | /*****************************************************************************
datawidth.cpp --
Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
*****************************************************************************/
/**************************************************************************... | ALGO | 0.964915 | 5.316374 |
146ce389-2ff7-4a74-b59e-947057a1abcf | meghna-biju/OOPS | code/check validity of isbn number.cpp | #include <iostream>
using namespace std;
int main()
{
long long n;
cin>>n;
int check=n%10;
n=n/10;
int sum=0;
for(int i=0;i<6;i++)
{
sum+=(n%10);
n=n/10;
}
if(sum%10==check)
cout<<"Valid ISBN Number"<<endl;
else
cout<<"Invalid ISBN Number"<<endl;
} | ALGO | 0.999539 | 4.532785 |
e3e06b80-1ddd-41d2-9532-535c7b9847ec | mb11797/FuN | Dynamic Programming/optimal_read_list_for_given_number_of_days.cpp | #include<iostream>
using namespace std;
void update_assignment(int optimal_path[], int path[], int path_len){
for(int i=0; i<path_len; i++)
optimal_path[i] = path[i] + 1;
return;
}
void assign_chapters(int u, int sum, int n_chapters, int k, vector<vector<int>> &dag, int optimal_path[], int path[], int path_len){
... | ALGO | 0.999997 | 3.669911 |
1cc6c3a1-6384-41db-8a05-21e129c7d7e6 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_8980_13.cpp | #include <bits/stdc++.h>
using namespace std;
inline long long add(long long a, long long b) {
a += b;
if (a >= 1000000007) a -= 1000000007;
return a;
}
inline long long sub(long long a, long long b) {
a -= b;
if (a < 0) a += 1000000007;
return a;
}
inline long long mul(long long a, long long b) {
return ... | ALGO | 0.999751 | 4.288011 |
16903224-0def-4115-b319-b7070d8db2a9 | AmadIrfan/cpp-programs | mode.cpp | // #include <fstream>
#include <iostream>
// #include <conio.h>
// #include <cmath>
using namespace std;
int main()
{
int num, count;
cout << "Enter a number ";
cin >> num;
for (int i = num; i != 0; i = i / 10)
{
i = i % 10;
count++;
}
cout << count;
//
return 0;
} | ALGO | 0.998838 | 3.305075 |
dfce11c7-2ef1-4c56-895a-b77705979454 | AdarshGaur/Competitive-Programming | LeetCode/60. Permutation Sequence.cpp | // Author : @AdarshGaur
class Solution {
public:
string getPermutation(int n, int k) {
string s;
for(auto c='1'; c <= n+'0'; c++)
s += c;
k--;
while(k--){
next_permutation(s.begin(), s.end());
}
return s;
}
};
| ALGO | 0.999943 | 6.421628 |
a1eb99a1-4614-4e57-a4b9-f88b1afde94f | KimRabbert/BaekjunSolve | B)A+B - 3.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int main() {
int n;
int a, b;
scanf("%d", &n);
for (int i = 0; i < n; i++) {
scanf("%d %d", &a, &b);
printf("%d\n", a + b);
}
} | ALGO | 0.999203 | 3.715616 |
b69a0e69-3644-49cd-ba94-f824abfc9280 | spacetime-ecologist/Edition_1 | Chap_7/CAR.cpp | #include <TMB.hpp>
template<class Type>
Type objective_function<Type>::operator() ()
{
using namespace density;
// Data
DATA_VECTOR( c_i ); // counts for observation i
DATA_IVECTOR( s_i ); //
DATA_VECTOR( rho_bounds );
DATA_MATRIX( X_sk );
DATA_SPARSE_MATRIX(I_ss);
DATA_SPARSE_MATRIX(A_ss);
// Para... | ALGO | 0.985146 | 6.554506 |
95dc3f9d-52d7-4cdd-858c-db3991977bf4 | ShiYu0318/CP-Code | Kattis/Basic/stafur.cpp | #include <bits/stdc++.h>
using namespace std;
#define ShiYu ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define int long long
#define vi vector<int>
#define pii pair<int,int>
#define F first
#define S second
#define EB emplace_back
#define endl "\n"
#define SZ(x) ((int)x.size())
#define all(x) x.begin(), x.en... | ALGO | 0.999789 | 3.592725 |
2cd6cf86-d2e6-4294-98b6-e287d149e0a6 | yulingtianxia/LeetCode | LeetCode/LeetCode/55 Jump Game.cpp | #include "commonheader.h"
class Solution {
public:
bool canJump(int A[], int n) {
if (n<=1) {
return true;
}
int end=n-1;
int start=end-1;
while (start>=0) {
if (A[start]>=end-start) {
end=start;
}
start--;
... | ALGO | 0.999974 | 5.823863 |
8264fb63-caa0-4659-b321-bfb8207e3a96 | gberlanga/leetcode | 292.cpp | /*You are playing the following Nim Game with your friend: There is a heap of stones on the table, each time one of you take turns to remove 1 to 3 stones. The one who removes the last stone will be the winner. You will take the first turn to remove the stones.
Both of you are very clever and have optimal strategies fo... | ALGO | 0.999928 | 6.022975 |
2443aef9-b01e-477c-861f-fcd40b08356b | devos50/programmingchallenges | SPOJ/nkmobile/main.cpp | #include <iostream>
using namespace std;
int square[1028][1028];
int main(int argc, char *argv[])
{
int instr, S; cin >> instr >> S;
for(int y = 0; y < S; y++)
for(int x = 0; x < S; x++)
square[y][x] = 0;
cin >> instr;
while(instr != 3)
{
if(instr == 1)
{
long long x, y, a; cin >> x >> y >> a;
... | ALGO | 0.982533 | 3.62787 |
44fab016-2b1a-4724-b565-9cbe7bb0e176 | ishandutta2007/codeforces | rush_d_cat/normal/1080/F.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
const int N=300000+20;
vector<int> v;
int id(int x){
return lower_bound(v.begin(),v.end(),x) - v.begin() + 1;
}
int root[N],lson[60*N],rson[60*N],mx[60*N],tot;
int n,m,k;
void update(int old_k,int &new_k,int l,int r,int pos,int val){
... | ALGO | 0.999997 | 4.316301 |
6f4dc12e-f145-4bf1-bed6-cd45e2bc2fcf | ishandutta2007/codeforces | egor.lifar/normal/1510/K.cpp | /*
KAMUI!
*/
#include <iostream>
#include <complex>
#include <vector>
#include <string>
#include <algorithm>
#include <cstdio>
#include <numeric>
#include <cstring>
#include <ctime>
#include <cstdlib>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <list>
#include <cmath>
#incl... | ALGO | 0.999622 | 3.430298 |
3b31e456-468e-4267-82c0-4b67a6884de1 | pkuzw/LeetCode-Zhao-Wei- | Binary Tree Maximum Path Sum.cpp | ///@file Binary Tree Maximum Path Sum
/*
Given a binary tree, find the maximum path sum.
The path may start and end at any node in the tree.
For example:
Given the below binary tree,
1
/ \
2 3
Return 6.
*/
///@author zhaowei
///@date 2015.07.25
///@version 1.0
///@date 2015.08.22
///@version 1.1
///... | ALGO | 0.999986 | 5.600746 |
167b4192-111c-46ef-b97e-e6068ab8f634 | Efrosine/nokasir | 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.998776 | 6.763923 |
3910be6f-73cc-4126-8552-ab395f0e9cca | ishandutta2007/codeforces | 300iq/normal/1466/E.cpp | #include <cmath>
#include <functional>
#include <fstream>
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <set>
#include <map>
#include <list>
#include <time.h>
#include <math.h>
#include <random>
#include <deque>
#include <queue>
#include <cassert>
#include <unordered_map>
#includ... | ALGO | 0.999489 | 4.206642 |
2ac435ce-ff53-4ab3-a279-45596fbfdbb6 | ShivaBansfore-JGEC/Codeforces_Contest_Question | A_Shortest_Path_with_Obstacle.cpp | // Author : Shiva Bansfore
// College : Jalpaiguri Government Engineering College
// Address : Siliguri,West Bengal
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define dd double
#define all(a) a.begin(),a.end()
#define pie 3.1415926535898
#define mod (ll)(998244353)
#define MOD (int) 1e9+7
#defin... | ALGO | 0.999906 | 4.957947 |
a280f18a-f9c8-4556-97af-afc928379825 | snehakumawat72/LeetCode | 14-longest-common-prefix/longest-common-prefix.cpp | class Solution {
public:
string longestCommonPrefix(vector<string>& strs) {
if (strs.empty()) {
return "";
}
// Use the first string as reference
string prefix = strs[0];
// Compare with each subsequent string
for (int i = 1; i < strs.siz... | ALGO | 0.999787 | 6.921431 |
91aefdd8-f2a2-4427-b442-d272e6a21762 | ob22a/Leetcode | 448-find-all-numbers-disappeared-in-an-array/find-all-numbers-disappeared-in-an-array.cpp | class Solution {
public:
vector<int> findDisappearedNumbers(vector<int>& nums) {
vector<int> sol;
for(int i=0;i<nums.size();++i){
if (nums[abs(nums[i])-1]>0) nums[abs(nums[i])-1]*=-1;
}
for(int i=0;i<nums.size();++i){
if(nums[i]>0) sol.push_back(i+1);
... | ALGO | 0.999845 | 5.584324 |
575ad800-8edd-41dc-add1-5b0711016e21 | ishandutta2007/codeforces | ytkn/normal/1712/B.cpp | #include <iostream>
#include <algorithm>
#include <iomanip>
#include <vector>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <tuple>
#include <cmath>
#include <numeric>
#include <functional>
#include <cassert>
#define debug_value(x) cerr << "line" << __LINE__ << ":<" << __func__ << ">:" << #x... | ALGO | 0.999915 | 4.796603 |
56e6ef21-e256-4e0b-9133-03fea1bdf7e3 | devialet/3rdparty_llvm-project | llvm/lib/CodeGen/MachinePostDominators.cpp | #include "llvm/CodeGen/MachinePostDominators.h"
#include "llvm/InitializePasses.h"
using namespace llvm;
namespace llvm {
template class DominatorTreeBase<MachineBasicBlock, true>; // PostDomTreeBase
extern bool VerifyMachineDomInfo;
} // namespace llvm
char MachinePostDominatorTree::ID = 0;
//declare initializeMa... | ALGO | 0.997992 | 7.615111 |
68880b1c-000a-45c2-bfc9-4fc825413f7f | TrellixVulnTeam/Bachelor_Arbeit_TD4S | VPR_PROJECT/vpr/src/util/histogram.cpp | #include <algorithm>
#include <string>
#include <sstream>
#include <cmath>
#include "vtr_log.h"
#include "vtr_assert.h"
#include "vtr_util.h"
#include "histogram.h"
std::vector<HistogramBucket> build_histogram(std::vector<float> values, size_t num_bins, float min_value, float max_value) {
std::vector<HistogramBu... | TOOL | 0.94877 | 6.286229 |
8212387a-adfe-4e15-9dd7-b0fd2a0b9191 | 45639/1111 | utaustinvilla3d-master/utwalk/math/MVTools.cpp | /**
* @file MVTools.cpp
* Contains helper functions for Vector_n and Matrix_nxn
*
* @author <a href="mailto:<EMAIL>">Stefan Uhrig</a>
*/
//------------------------------------------------------------------------------
#include "MVTools.h"
#include <limits>
#include <cstring>
//------------------------------------------... | TOOL | 0.962646 | 6.051866 |
8d0fcd5d-221a-4963-8b8c-64219aec9166 | dazzlemon/diit_121-ipz_y3_os | mk4/2/src/server.cpp | #include <algorithm>
#include "common.h"
int conn = 0;
pthread_mutex_t thread_flag_mutex;
pthread_mutex_t thread_busy_mutex;
pthread_cond_t thread_flag_cv;
int free_thr;
bool thread_flag;
int socketFileDescriptor;
char buffer[MSG_SIZE];
void service() {
std::cout << "service started\n";
bool continue_ = true;
do ... | WEB | 0.971041 | 4.653854 |
845bcbc9-e5c5-4b63-a74d-e32c88e5098b | DweHoang04/EE3491_20241_Code | Mini_Project_Info/20222503_20222506_mini_project_20241/Task_2/task_23.cpp | #include <bits/stdc++.h>
using namespace std;
struct sensor {
int id;
char time[20];
float value;
};
struct Summary {
int id;
char parameter[10];
char time[20];
float value;
};
/* Convert Human Calendar to Machine Calendar (Unix time format) */
time_t convertToSeconds(const char* timeStr... | DATA | 0.983475 | 5.403666 |
a0307287-469d-47e5-be47-0bb6192b4414 | sunnySudheer21/CSA0467-OS | question number 38 os.cpp | #include <stdio.h>
#include <math.h>
int main()
{
int queue[20], n, head, i, j, k, seek = 0, max, diff, temp, queue1[20],
queue2[20], temp1 = 0, temp2 = 0;
float avg;
printf("Enter the max range of disk\n");
scanf("%d", &max);
printf("Enter the initial head position\n");
scanf("%d", &head);... | ALGO | 0.999861 | 3.132237 |
669d354c-e359-4bc9-9a11-340f80d42f0b | jaiskid/amzn | mathematics/evaluate.cpp | #include<bits/stdc++.h>
#include <cpp_int.hpp>
using namespace std;
cpp_int function(cpp_int x) {
retun (3 * (x * x) - x + 10) + (4 * (x * x * x) + 2 * (x * x) - 5 * (x) + 4);
}
int main() {
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
cpp_int x;
cin >> x;
cpp_... | ALGO | 0.999649 | 4.397854 |
3033cb92-2294-4e2a-8e3e-70879d46e5c5 | 10alswhd/BlueHouseProject | string/가상상속.cpp | /virtual 상속을 이용한 다중 상속의 모호함 해결
//Program.cpp
#include <iostream>
#include <string>
using namespace std;
class Man
{
string name;
public:
Man(string name)
{
this->name = name;
}
void View()
{
cout<<"이름은 "<<name<<"입니다."<<endl;
}
};
class Student:virtual public Man
{
publ... | ALGO | 0.954555 | 4.943369 |
b95842cf-85f3-4f2f-bba1-e7459051366c | pawelsag/Studies | sdizo/project_1/src/binary_tree.cpp | #include "binary_tree.h"
#include <iostream>
#include <string>
#include <new>
#include <chrono>
binary_tree::binary_tree(){
// variables used in printing
cr = cl = cp = " ";
cr[0] = 218; cr[1] = 196;
cl[0] = 192; cl[1] = 196;
cp[0] = 179;
}
binary_tree::binary_tree(std::initializer_list<int32_t> args_vector){... | ALGO | 0.980777 | 4.200455 |
5ae2c1ca-17eb-47bc-9285-e01044d19543 | Aniketdhar810/gfg-grind | Difficulty: Medium/Bottom View of Binary Tree/bottom-view-of-binary-tree.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
#define MAX_HEIGHT 100000
// Tree Node
struct Node
{
int data;
Node* left;
Node* right;
};
// Utility function to create a new Tree Node
Node* newNode(int val)
{
Node* temp = new Node;
temp->data = val;
temp->left = NULL;
... | ALGO | 0.999696 | 6.597485 |
ef656e7e-aaf9-4dc0-8f79-4e066d801630 | smdogroup/a2d-multiphysics | examples/amgx/toy_amgx.cpp | #include "amgx_c.h"
int main(int argc, char* argv[]) {
// Init
AMGX_SAFE_CALL(AMGX_initialize());
// System
// AMGX_SAFE_CALL(AMGX_register_print_callback(&print_callback));
// AMGX_SAFE_CALL(AMGX_install_signal_handler());
// library handles
AMGX_Mode mode = AMGX_mode_dDDI;
AMGX_config_handle cfg;
... | ALGO | 0.966224 | 5.485941 |
5ca072f9-5cac-4549-802d-8fdc275da5c0 | MahmoudGoda2003/problem-solving | codeforces/158/B.cpp | /******************************************************************************
Welcome to GDB Online.
GDB online is an online compiler and debugger tool for C, C++, Python, PHP, Ruby,
C#, OCaml, VB, Perl, Swift, Prolog, Javascript, Pascal, HTML, CSS, JS
Code, Compile, Run and Debug online from anywhere in world.
**... | ALGO | 0.999961 | 4.051458 |
c1079311-adc0-4d77-af91-2128248e9bf3 | diegomazala/multilevel_bspline | src/app/vert_polyfit.cpp | #include <Eigen/QR>
#include <vector>
#include <filesystem>
#include "poly_fit.h"
#include "timer.h"
#include "vector_read_write_binary.h"
namespace fs = std::filesystem;
#define USE_LERP_APPROXIMATION 0
template<typename T> T normalize(T begin, T end, T value)
{
return (value - begin) / (end - begin + FLT_MIN);
}
... | ALGO | 0.99807 | 5.443233 |
d9d634eb-7c20-47fb-aa8b-1784d7857a8d | filipe-jsales/AutoGPT-master | frontend/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.998396 | 6.76073 |
445c0bc6-bc44-42e9-8085-fc3cb2ac831c | ishandutta2007/codeforces | clovers/normal/377/C.cpp | /*
the vast starry sky,
bright for those who chase the light.
*/
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define mk make_pair
const int inf=(int)1e9;
const ll INF=(ll)5e18;
const int MOD=998244353;
int _abs(int x){return x<0 ? -x : x;}
int add(int x,int y){x+=y; ret... | ALGO | 0.999881 | 3.450336 |
b33b59a7-6731-4c63-801b-30c01daf0719 | Hyuk-II/Algorithms-Study | 03. class2-1/11_2869_달팽이.cpp | // 2024.03.25
// 높이가 V미터인 나무 막대를 올라갈 것이다.
// 달팽이는 낮에 A미터 올라갈 수 있다. 하지만, 밤에 잠을 자는 동안 B미터 미끄러진다. 또, 정상에 올라간 후에는 미끄러지지 않는다.
// 달팽이가 나무 막대를 모두 올라가려면, 며칠이 걸리는지 구하는 프로그램을 작성하시오.
// 0.25초 이내 실행 -> 계산식 딸깍
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
cout << fixed;
cout.precision(0);
doub... | ALGO | 0.998683 | 3.835192 |
30ebad85-e55a-4da9-95a8-4914694acf00 | MarSonyTM/42ViennaComonCore | CPP_MODULES/CPP_08/ex01/Span.cpp | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* Span.cpp :+: :+: :+: ... | ALGO | 0.993628 | 5.776053 |
155cd10f-e1b9-4c2f-84b2-795b5607519b | makometr/piaa_9383 | Kreysmann/lab2/Source/A-star/main.cpp | #include "astar.hpp"
int main()
{
Vertex* start, * finish1, * finish2;
std::ifstream file("Input.txt");
Graph graph = initGraph(file, &start, &finish1, &finish2);
file.close();
PairPaths paths = findTwoPaths(graph, start, finish1, finish2);
std::optional<Path> path1to2;
std::optional... | ALGO | 0.999281 | 4.032918 |
c1d4d21d-1948-4cfa-941f-85d308dad780 | haram1117/AlgorithmStudy | Graph/GR11725.cpp | //
// Created by haram on 2023-02-27.
//
#include <iostream>
#include <vector>
using namespace std;
int result[100001];
vector<int> input[100001];
int n;
void dfs(int x){
for(auto it = input[x].begin(); it != input[x].end(); it++){
if(!result[*it]){
result[*it] = x;
dfs(*it);
... | ALGO | 0.999997 | 5.565588 |
ae2f7698-f276-4c00-a598-096ab9f7a02f | satyampgt4/6Companies30days | GoldmanSach/02.Overlapping rectangles.cpp | #include<bits/stdc++.h>
using namespace std;
class Solution {
public:
int doOverlap(int l1[], int r1[], int l2[], int r2[]) {
if(r1[0]<l2[0] || r2[0]<l1[0])
return false;
if(r1[1]>l2[1] || r2[1]>l1[1])
return false;
return true ;
}
}... | ALGO | 0.999279 | 4.177419 |
ea2fb0c4-4d1a-4fdf-93e7-e069b24413eb | J384ya/C---codes | L16_1.cpp | // Program to find nth fibonacci number
#include<iostream>
using namespace std;
int fib(int n){
if(n == 1 or n == 1) return n;
return fib(n-1) + fib(n-2);
}
int main(){
int result = fib(5);
cout<<result;
return 0;
}
| ALGO | 0.999692 | 4.717705 |
b2bc25e6-92b2-4f89-896d-4bf89323d530 | TheStremty/cpp_exercises | 2.01-2.36/2.17.cpp | #include <iostream>
using namespace std;
int main()
{
int a;
cin >> a;
if (a > 10)
cout << "Tak";
else
cout << "Nie";
return 0;
} | ALGO | 0.972865 | 3.161246 |
ac58385b-b6be-484a-90b8-98e9a00a1ecf | riku546/cpp-tutorial | atcoder_problems/ABC306/B.cpp | #include <bits/stdc++.h>
#define rep(i, m, n) for (int i = m; i < n; i++)
using ull = unsigned long long;
using namespace std;
long long self_pow(int value, int i)
{
ull result = 1;
rep(j, 0, i ) result *= value;
return result;
}
int main()
{
vector<int> A(64);
rep(i, 0, 64) cin >> A[i];
ull ans = 0;
r... | ALGO | 0.999463 | 4.089565 |
39035a0d-956e-4426-b119-162c0d92c3c6 | Dfkuaid/My_Files | cpp/Practice/AtCoder/arc103_d/main.cpp | #define LOCAL
#include <bits/stdc++.h>
#define ll long long
using namespace std;
const int N = 100010;
const int INF = 0x3f3f3f3f;
template <typename T> inline void read(T &x) {
x = 0; int f = 1; char c = getchar();
for (; !isdigit(c); c = getchar()) if (c == '-') f = -f;
for (; isdigit(c); c = getchar())... | ALGO | 0.999964 | 3.593493 |
ed6fbbef-5ede-484e-a648-a387771c9ab4 | mealisohail/cpp_code | CP/incclusionExclusionDivisible.cpp | #include<bits/stdc++.h>
using namespace std;
int divisible(int n, int a, int b){
int c1 = n / a;
int c2 = n / b;
int c3 = n / (a*b);
return c1 + c2 - c3;
}
int main(){
int n, a, b;
cin>>n>>a>>b;
cout<<divisible(n, a, b)<<endl;
return 0;
} | ALGO | 0.999579 | 4.22165 |
f6dbb805-576b-483a-aa60-33abdce1d810 | bryaanabraham/EcoCode_Sustainable_banking_System | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.9988 | 6.76073 |
397c9801-0e6e-4fc7-a4bc-276490e2a92f | ZERstar/Leetcode | 0901-online-stock-span/0901-online-stock-span.cpp | class StockSpanner {
public:
stack<pair<int,int>> s;
StockSpanner() {
}
int next(int price) {
int span = 1;
while(!s.empty() and s.top().first <= price){
span = span + s.top().second;
s.pop();
}
s.push({price, span});
... | ALGO | 0.998504 | 6.220057 |
4c40c66c-d47f-448c-893e-bef84d1c3812 | MrMarmalad/fl512 | lr4-2_winapi/lr4-2_winapi/Triangle.cpp | #include <iostream>
#include "Triangle.h"
using namespace std;
double Triangle::area() {
double hP = 0;
for (auto side : this->sides)
{
if (side == 0) {
cout << " 0" << endl;
return 0;
}
hP += side / 2;
}
return sqrt(hP * (hP - this->sides[0]) * (hP - this->sides[1]) * (hP - this->sides[2]));
}
... | TOOL | 0.911083 | 5.003175 |
b3c5042e-d234-4de8-bdd6-36e61befaeb5 | Bikubisw/Coding | DATA STRUCTURES AND ALGORITHMS/binary_search_of_any_array.cpp | #include<iostream>
using namespace std;
int bubble_sort(int arr[][100],int row,int col){
for(int i=0;i<row;i++){
for(int j=0;j<col-1;j++){
for(int k=0;k<col-1-j;k++){
if(arr[i][k]>arr[i][k+1]){
int temp=arr[i][k];
arr[i][k]=arr[i][k+1];
arr[i][k+1]=temp;
}
}
}
}
}
void binary_search(i... | ALGO | 0.999936 | 3.663941 |
6831c24a-c82b-44f7-bb21-d0fd4acde4d8 | muskaanshraogi/SE_IT-Sem-1 | PL/A02_Matrix/matrix_try.cpp | #include<stdio.h>
#include<stdlib.h>
void accept(int *mat,int row,int col);
void display(int *mat,int row,int col);
void add(int *mat1,int *mat2,int *mat3,int row1,int col1,int row2,int col2);
void multiply(int *mat1,int *mat2,int *mat3,int row1,int col1,int row2,int col2);
void transpose(int *mat,int *result,int row,... | TOOL | 0.967475 | 3.274303 |
093dd7ec-3307-43d3-9068-f9a66393d434 | bitdove/DailyLearning | A02_数据结构与算法/2两数相加.cpp | #include <iostream>
struct ListNode{
int val;
ListNode* next;
ListNode() : val(0), next(nullptr) {}
ListNode(int val) : val(val), next(nullptr) {}
ListNode(int val, ListNode* next) : val(val), next(next) {}
};
ListNode* Solution(ListNode* l1, ListNode* l2){
ListNode* dummy = new ListNode(-1);
... | ALGO | 0.999844 | 4.329772 |
47ba43be-cceb-4e1c-b5bc-d859b0786b88 | mertpasacukur/riscv_llvm | libc/src/math/generic/log2f.cpp | #include "src/math/log2f.h"
#include "common_constants.h" // Lookup table for (1/f)
#include "src/__support/FPUtil/FEnvImpl.h"
#include "src/__support/FPUtil/FPBits.h"
#include "src/__support/FPUtil/PolyEval.h"
#include "src/__support/FPUtil/except_value_utils.h"
#include "src/__support/FPUtil/multiply_add.h"
#include ... | ALGO | 0.999096 | 7.041809 |
88d71d12-669b-4e7a-912a-91c6e44e4020 | RokwonK/Problem_solving | codeforces/Round_663_div2/B__Fix_You.cpp | #include <iostream>
#include <vector>
#include <cstring>
#include <set>
#include <algorithm>
#include <string>
using namespace std;
char arr[101][101];
int main(void) {
ios_base :: sync_with_stdio(0);
cin.tie(0);
int T;
cin >> T;
while(T--) {
int n, m;
cin >> n >> m;
... | ALGO | 0.999668 | 4.533072 |
9df8addf-f324-45b1-bed6-aa06f24ed0a5 | mathunder286546/StudentCppRevisionTask02Project | StudentCppRevisionTask02Project/taskX.cpp | #include "tasks.h"
/* Task X. The Next Even Number [следующее чётное число]
*
* На вход дается натуральное число N. Вычислите следующее за ним четное число.
*
* Формат входных данных [input]
* На вход дается целое положительное число N.
*
* Формат выходных данных [output]
* Выведите одно целое число - ответ на задачу.... | ALGO | 0.999422 | 5.15698 |
8197c85c-e5c7-488a-8a72-04afb9facc6c | Brendan-FIXOT/AI-Boosting | src/main/utility.cpp | #include "utility.h"
// For the single decision tree multithreading
int adjustNumThreads(int numThreads) {
if (numThreads <= 0)
return 1;
if ((numThreads & (numThreads - 1)) == 0)
return numThreads;
int power = 1;
while (power * 2 <= numThreads)
power *= 2;
return power;
}
// input function to... | TOOL | 0.935282 | 5.261662 |
037587be-5848-4f67-8a41-66212445f8cd | Noordicsea/FrictionCalculatorAtIncline | FrictionCalculatorAtIncline/FrictionCalculatorAtIncline.cpp | #include <iostream>
#include <cmath> // For cos() and sin() functions
// Define PI in case it's not included in the compiler
const double PI = 3.14159265358979323846;
// Function to convert degrees to radians
double toRadians(double angleInDegrees) {
return angleInDegrees * (PI / 180.0);
}
int main() {
doubl... | ALGO | 0.997902 | 6.342118 |
cc8e0bca-4caa-44ea-98dd-4f4d94812068 | vrangr1/competitive-programming | contests/codeforces/sponsored_rounds/pinely_rounds/pinely_round_4/c.cpp | /***************************************************
* Author : Anav Prasad
* Nick : vrangr
* Created : Sun Jul 28 20:20:15 IST 2024
****************************************************/
#include <bits/stdc++.h>
#include <iostream> // Strange mac vs code issue!
#define debug(...) (void)42
#ifdef LOCAL
#undef de... | ALGO | 0.999941 | 4.079609 |
d3afa02c-7a45-4556-81fb-8fcd62a5e74e | sinian666/code_86_8 | 1cpp_副本/chapter_array_and_linkedlist/linked_list.cpp | /**
* File: linked_list.cpp
* Created Time: 2022-11-25
* Author: Krahets (<EMAIL>)
*/
#include "../utils/common.hpp"
/* 在链表的节点 n0 之后插入节点 P */
void insert(ListNode *n0, ListNode *P) {
ListNode *n1 = n0->next;
P->next = n1;
n0->next = P;
}
/* 删除链表的节点 n0 之后的首个节点 */
void remove(ListNode *n0) {
if (n0... | ALGO | 0.999684 | 5.584367 |
f2e74d5c-4083-46c1-8ea4-79f828a93d2a | ishandutta2007/codeforces | sunzh/normal/1142/C.cpp | #include<cstdio>
#include<cmath>
#include<algorithm>
using namespace std;
int n;
double ans;
struct node{
double x,y;
}p[100010];
int stk[100010];
int size;
bool cmp(node a,node b){
if(a.x!=b.x) return a.x<b.x;
return a.y<b.y;
}
const double eps=1e-5;
double getX(int x){
return p[x].x;
}
double getY(int x){
return... | ALGO | 0.999892 | 4.098101 |
993f8ad6-8914-48ed-85ee-dd3282751b54 | yoon20002000/DataStructure | Pracs/Prac04/DataStructures/Heap/Heap04.cpp | #include "Heap04.h"
#include <memory>
Heap04::Heap04()
{
}
Heap04::~Heap04()
{
}
Heap04::Heap04(const Heap04& other)
{
heap = other.heap;
}
Heap04& Heap04::operator=(const Heap04& other)
{
if (&other != this)
{
heap = other.heap;
}
return *this;
}
Heap04::Heap04(Heap04&& other... | ALGO | 0.987293 | 4.618033 |
bb7d02ae-bbd7-44d8-a210-beb37735b745 | Hasil-Sharma/leet-code | palindrome-number-2.cpp | // https://leetcode.com/problems/palindrome-number/description/
class Solution {
public:
bool isPalindrome(int x) {
if (x < 0) return false;
int y = 0, orig = x;
while(orig){
y = y*10 + (orig%10);
orig /= 10;
}
return x == y... | ALGO | 0.99991 | 6.27698 |
db22660e-f303-4aa8-94a3-dcc2a23feb5d | brenimcode/CompetitiveProgramingSolving | grafos/MenorCaminho/babel.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define NMAX 2000
#define par pair<int, int> // (peso, vertice)
#define INF 9999999
vector<par> adj[NMAX]; // (peso, vertice)
int n, m;
bool visited[NMAX];
int distancia[NMAX];
// Mapeamento de vértices (string) para índices (int)
unordered_map<str... | ALGO | 0.999982 | 5.768434 |
0a8ff205-52af-443f-b07d-ed21ab5af1a4 | sspeedy99/APS-2020 | Graphs/Depth-First-Search.cpp | #include <bits/stdc++.h>
#define MAXN 10000
using namespace std;
stack <int> order;
vector<int> adjlist[MAXN];
int visitados [MAXN];
void dfs(int u){
visitados[u] = 1;
for(int j = 0; j < (int)adjlist[u].size(); j++){
int v = adjlist[u][j];
if(visitados[v] == 0){
dfs(v);
}
... | ALGO | 0.999888 | 4.864926 |
32e5dd2b-d801-4e63-9d5c-2ee3a74bdf77 | LeKSuS-04/Competitive-Programming | Codeforces/problems/1814B.cpp | /* 1814B. Long Legs */
// https://codeforces.com/problemset/problem/1814/B
// Date: 2023-04-14 23:11:11
// Run time: 15 ms
// Memory: 8 KB
// Verdict: AC
#ifndef LOCALENV
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
#endif
#include <bits/stdc++.h>
using namespace std;
typed... | ALGO | 0.999388 | 5.342379 |
3b2c5197-358c-4a72-8699-6b9f584e02ff | AhmedAshraf0/problem-solving-codeforces | A. Lever.cpp | /*
CST
10-Aug-22
*/
#include<bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
string str;
long long lw = 0, rw = 0;
cin>>str;
int idx = find(str.begin(),str.end()... | ALGO | 0.999987 | 3.676758 |
111ee3da-22b4-4cb1-824c-196452a09d87 | toshunster/MAI-da | lab4/utils.cpp | #include "utils.hpp"
namespace utils {
int modular_exponentaions(uint32_t num, uint32_t pow, uint32_t mod)
{
uint64_t res = 1;
while (pow > 0) {
if (pow & 1) {
res = (res * num) % mod;
}
pow /= 2;
num = (num * num) % mod;
}
return res;
}
size_t strstr_rk (c... | ALGO | 0.999065 | 5.617553 |
4700b1cf-e649-4a61-aaca-300aa71ba44d | caiopetruccirosa/mc521-2022s1 | contest-2022-04-29/A.cpp | #include <bits/stdc++.h>
#include <stdio.h>
#define _ ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long
using namespace std;
int main() {_
ll k, n, w;
cin >> k >> n >> w;
ll amout_to_pay = 0;
for (int i = 1; i <= w; i++) {
amout_to_pay += i*k;
}
if (amout_t... | ALGO | 0.999936 | 3.458584 |
d581e002-7c19-4ef6-a193-e17020bb89c2 | PrathapRKL/MonsieurMonet | Source Files/AI/BTTask_Swift_FoundPlayer.cpp | // This code belongs to Learning Machines.
#include "BTTask_Swift_FoundPlayer.h"
#include "NavigationSystem.h"
#include "Engine.h"
#include "BehaviorTree/BehaviorTree.h"
#include "BehaviorTree/BehaviorTreeComponent.h"
#include "BehaviorTree/BlackboardComponent.h"
#include "BehaviorTree/Blackboard/BlackboardKeyAllTypes... | TOOL | 0.896107 | 4.872251 |
103ee9f3-a68c-49c2-8fe7-b7acc7ccad8f | ishandutta2007/codeforces | egor.lifar/normal/1491/A.cpp | #include <iostream>
#include <complex>
#include <vector>
#include <string>
#include <algorithm>
#include <cstdio>
#include <numeric>
#include <cstring>
#include <ctime>
#include <cstdlib>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <list>
#include <cmath>
#include <bitset>
#... | ALGO | 0.999762 | 4.118256 |
5db96ccc-89eb-4593-8160-09227a03071e | JorgeIba/Competitive-Programming-Problems | Training Camp 2023 Medellín/Contest 5/I.cpp | #include <bits/stdc++.h>
#define endl '\n'
#define lli long long int
#define ld long double
#define all(v) v.begin(), v.end()
#define fastIO(); ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define SZ(s) int(s.size())
#define debugg(x) cerr << #x << " = " << x << endl;
#define forn(i, n) for(int i = 0; i < (... | ALGO | 0.999331 | 3.293218 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.