uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
c2972d9f-a857-4dc0-b059-d51e5fe94486
sidgujrathi/topcoder
Day 3 - Medium (Level 2)/BusSeating/BusSeating.cpp
// BEGIN CUT HERE // END CUT HERE #include <algorithm> #include <iostream> #include <sstream> #include <string> #include <vector> #include <queue> #include <set> #include <map> #include <cstdio> #include <cstdlib> #include <cctype> #include <cmath> using namespace std; vector<string> split( const string& s, const str...
ALGO
0.999182
4.77715
16ac5a04-dcc5-4f30-802f-e7d7973dfd6f
keerthivnair/Codeforces-toSpecialist
day7/A_Game_with_Integers.cpp
#include <bits/stdc++.h> using namespace std; int main() { int t; cin >> t; while (t--) { int n; cin >> n; if (n % 3 == 0) { cout << "Second" << '\n'; } else { cout << "First" << '\n'; } } return 0; }
ALGO
0.99992
4.193533
9e44c7f2-6c11-4591-82ae-6376f691d8ae
matteblack9/ProblemSolving
leetcode/UniquePaths.cpp
// O(N * N) class Solution { public: int uniquePaths(int m, int n) { vector<double> factorial(m + n - 1, 1); for (int i = 1; i <= m + n - 2; i++) factorial[i] = factorial[i - 1] * i; return factorial[m + n - 2] / (factorial[m - 1] * factorial[n - 1]); } }; ...
ALGO
0.999951
6.70307
21426335-8073-426c-9b5d-f69dcc95f337
ambedgar777/quiz_flutter
windows/runner/utils.cpp
#include "utils.h" #include <flutter_windows.h> #include <io.h> #include <stdio.h> #include <windows.h> #include <iostream> void CreateAndAttachConsole() { if (::AllocConsole()) { FILE *unused; if (freopen_s(&unused, "CONOUT$", "w", stdout)) { _dup2(_fileno(stdout), 1); } if (freopen_s(&unuse...
TOOL
0.998809
6.763549
41b12b55-d31c-492a-89bb-373af9e68482
ishandutta2007/codeforces
nuip/normal/734/A.cpp
#include <string> #include <vector> #include<iostream> #include<cstdio> #include<cstdlib> #include<stack> #include<queue> #include<cmath> #include<algorithm> #include<functional> #include<list> #include<deque> #include<bitset> #include<set> #include<map> #include<unordered_map> #include<unordered_set> #include<cstring>...
ALGO
0.999969
3.390148
86eb45a4-004c-42c6-b133-8d9d7315b734
raghadislam/problem-solving
Dijkstra/Jagged_Roads.cpp
/* problem link: https://codeforces.com/gym/104415/problem/J * solution by: Raghad Islam * date: 1-5-2025 */ #include <bits/stdc++.h> using namespace std; void fileIO() { #ifndef ONLINE_JUDGE freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); #endif } void fastIO() { ios_base::sync...
ALGO
0.999642
4.930468
d1971515-a18f-4b4a-b985-c211fabe4f41
ncorbin003/PathFinder
main.cpp
#include <iostream> #include <limits.h> #include "d_except.h" #include <list> #include <fstream> #include "d_matrix.h" #include <queue> #include <vector> #include <stack> #include "graph.h" //#include "d_graph.h" class Map { public: Map() { myMatrix; } Map(ifstream &fin) { std::string inp...
ALGO
0.99898
4.022065
5e436d72-52d3-4352-b694-2842143dce1c
oxygen-hunter/Flashboom
data/big-vul-100/add_attention_code/MixtralExpert/top0-100/maximum-value-sum-by-placing-three-rooks-i-Solution.maximumValueSum/177773_DoS_Exec_Code_Overflow_Mem._Corr..cpp
create_surface_from_thumbnail_data (guchar *data, gint width, gint height, gint rowstride) { guchar *cairo_pixels; cairo_surface_t *surface; static cairo_user_data_key_t key; int j; cairo_pixels = (guchar *)g_malloc (4 * width * height); surface = cairo_image_surface_...
ALGO
0.999472
4.738873
d1d58834-b4e1-408c-8702-40c1cdea326a
SnowyJune973/acm
bzoj/2002.cpp
#include <cstdio> #include <cstring> #include <cstdlib> #include <algorithm> using namespace std; const int maxn = 2e5+10; int ki[maxn],dp[maxn],n,m; void init(){ memset(dp,0,sizeof(dp)); } int dfs(int x){ if(x+ki[x]>=n)return dp[x] = 1; else return dp[x] = 1 + dfs(x+ki[x]); } void work(){ int pa1,pa2,p...
ALGO
0.999952
3.614175
f11068e4-4409-4012-8aee-0a8c18907e92
ishandutta2007/codeforces-s
sys/normal/717/A.cpp
#include <bits/stdc++.h> using namespace std; const int Maxn = 205, p = 1e9 + 7; int k; long long ans, l, r, fac[Maxn], S[Maxn][Maxn], C[Maxn][Maxn]; long long get_inv(int x) { if (x <= 1) return 1; return (p - p / x) * get_inv(p % x) % p; } struct Complex { long long Re, Im; Complex (long long _re = 0, long long ...
ALGO
0.99995
3.984035
28a2b2b2-e8c5-4649-9904-f96c4847b764
enjalot/BGERTPS
blender/intern/smoke/intern/LU_HELPER.cpp
/** \file smoke/intern/LU_HELPER.cpp * \ingroup smoke */ #include "LU_HELPER.h" int isNonsingular (sLU LU_) { for (int j = 0; j < 3; j++) { if (LU_.values[j][j] == 0) return 0; } return 1; } sLU computeLU( float a[3][3]) { sLU result; int m=3; int n=3; //float LU_[3][3]...
ALGO
0.999818
4.002901
d824bce2-5506-4ef7-9b85-47a8d73c64e5
milindmadhukar/university
Design and Analysis of Algorithms/longest_common_subsequence_recursion_memoization.cpp
#include "string" #include <algorithm> #include <cstring> #include <iostream> #include <string> int dp[100][100]; int lcs(const std::string &a, const std::string &b, int i, int j) { if (dp[i][j] != -1) return dp[i][j]; if (a[i] == '\0' || b[j] == '\0') return 0; else if (a[i] == b[j]) { int val = ...
ALGO
0.999627
5.010336
72df481f-9da5-472c-b067-61a4b14bb959
jinwookss/algorithm-solutions
BOJ/Greedy/1541/1541.cpp
#include <iostream> #include <sstream> #include <vector> using namespace std; int main() { string s; cin >> s; stringstream ss; int result = 0; bool minus = false; for (char c : s) { if (c == '-' || c == '+') { int i; ss >> i; ss.clear(); ...
ALGO
0.999693
4.199671
990fc77f-91cf-46ba-afd7-4ced8399f27d
HiimHotta/URI
1.Iniciante/036_Taxes.cpp
/****************************************************************************************************************** In an imaginary country called Lisarb, all the people are very happy to pay their taxes because they know that doesn’t exist corrupt politicians and the taxes are used to benefit the population, without a...
ALGO
0.997306
4.391469
40b70da9-9015-44fa-bc3c-73445dee033f
siddharth20323/OMP
omp1.cpp
#include <iostream> #include <omp.h> using namespace std; const int n = 3; // Define the size of the matrix void matrix_mul(int a[n][n], int b[n][n], int c[n][n], int num_threads) { #pragma omp_set_num_threads(num_threads); // Set number of threads #pragma omp parallel for collapse(2) for(int i = 0; i...
ALGO
0.999915
4.623381
eba98bbe-d03f-4bf4-8379-aa569183b7cd
KiZaru0Iemon/atcoder
algorithms/gcd.cpp
/* ~~~ ユークリッド互除法による最大公約数 ~~~ */ // O(log(min(a,b))) #include <bits/stdc++.h> using namespace std; template <typename T> T gcd(T a, T b) { if(b==0)return a; else return gcd<T>(b,a%b); } int main() { int a,b; a=0; b=15; cout<< gcd<int>(a,b) <<endl; }
ALGO
0.999241
4.183112
9e0cf8e4-fc82-458b-9616-2c52171226a8
Mahad-Saffi/Programming_Fundamentals
Lab 9/task1.cpp
#include <iostream> using namespace std; void position(string word); main() { string word; cout << "Enter a word: "; cin >> word; position(word); } void position(string word) { for (int i = 0; i < word[i] != '\0'; i++) { cout << word[i] << " found at position " << i << endl; } }
ALGO
0.994824
4.513576
3f6937b5-2f97-465d-8490-d1210ec5d116
fightforhash/Interview-Prep
JungOl/1761.cpp
#include <iostream> #include <vector> #include <string> using namespace std; pair <int, int> countSB(string secret, string guess){ //민혁이 스트라이크, 볼개수 구해줌 int strike = 0, ball = 0; for (int i = 0; i < 3; i++){ if (secret[i] == guess[i]){ //전체 조합과 민혁이의 세숫자 비교해서 따로 스트라이크 볼개수 구함 strike++; ...
ALGO
0.998932
4.586487
d7736518-bea9-41a4-aa6b-776547fc0c85
ofithcheallaigh/python_projects
pythonCode/Computer Vision/opencv-master/modules/imgproc/src/cornersubpix.cpp
#include "precomp.hpp" void cv::cornerSubPix( InputArray _image, InputOutputArray _corners, Size win, Size zeroZone, TermCriteria criteria ) { CV_INSTRUMENT_REGION(); const int MAX_ITERS = 100; int win_w = win.width * 2 + 1, win_h = win.height * 2 + 1; int i, j, k; int max_i...
ALGO
0.999939
5.708128
b79699ee-141b-4307-8c51-d5f687f2ec4c
Anmol-Sri/Competitive-Environment
Codeforces Practice/61D.cpp
#include <bits/stdc++.h> #define ll long long int #define ld long double #define pb push_back #define mp make_pair #define ar array #define all(x) x.begin(), x.end() #define mem(arr,x) memset(arr, x, sizeof arr) #define db(arr) for(auto x : arr) cout << x << " "; cout << "\n"; #define db2d(arr) for(auto x : arr){ for(a...
ALGO
0.999968
4.392784
52168115-b4e0-4b3b-82c3-17ad5bc85b46
metehkaya/Algo-Archive
Problems/LeetCode/Solutions/1137.N-th_Tribonacci_Number.cpp
class Solution { public: int tribonacci(int n) { if(n <= 1) return n; vector<int> f(n+1,0); f[1] = 1; f[2] = 1; for( int i = 3 ; i <= n ; i++ ) f[i] = f[i-1] + f[i-2] + f[i-3]; return f[n]; } };
ALGO
0.99995
5.995246
a693c603-7851-4338-bba6-8b0943c03fc5
feixh/VISMA
thirdparty/libigl/include/igl/normalize_row_sums.cpp
template <typename DerivedA, typename DerivedB> IGL_INLINE void igl::normalize_row_sums( const Eigen::MatrixBase<DerivedA>& A, Eigen::MatrixBase<DerivedB> & B) { #ifndef NDEBUG // loop over rows for(int i = 0; i < A.rows();i++) { typename DerivedB::Scalar sum = A.row(i).sum(); assert(sum != 0); } #e...
ALGO
0.995353
3.82338
c3858629-1055-4070-a46d-50e20be9fbc4
rohitbhatghare/c-c-
Oct-06-20/assignment183.cpp
#include<iostream> using namespace std; int main() { int i,j,n1,n2,n3,a1[100],a2[100],a3[100],mm=0,ctr=0; cout<<"Enter the 1st number of elements \n"; cin>>n1; cout<<"Enter elements of 1st array \n"; for(i=0;i<n1;i++) { cin>>a1[i]; } cout<<"Enter the 2nd number of elements \...
ALGO
0.999952
3.279577
3a69d0f4-bb22-43a8-a1e1-e1e13a69e98c
inferenceengine/renderdoc
renderdoc/driver/vulkan/vk_layer_android.cpp
#include <stdlib.h> #include <string.h> // RenderDoc Includes #include "vk_common.h" #include "vk_core.h" #include "vk_hookset_defs.h" #include "vk_resources.h" // The android loader has limitations at present that require the enumerate functions // to be exported with the precise canonical names. We just forward th...
TOOL
0.921904
6.610729
4aaf4d05-a421-40f8-981e-03ef9bd50e8c
nathanzhu144/practices
tree/1379_find_corresp_node_in_clone_tree.cpp
/* Nathan Zhu April 17th, 2020 Starting at salesforce tomorrow!! * Leetcode 1379 | medium | easy * Category: Binary tree * This question kinda boring. */ struct TreeNode { int val; TreeNode *left; TreeNode *right; TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} }; TreeNode* helper(Tr...
ALGO
0.999809
6.009349
6a9ed2af-62e6-41d0-8780-04197225f93c
aashan007/Coding
challenges/LeetCode30DayChallenge-June/2.deleteNodeInALinkedList.cpp
void deleteNode(ListNode* node) { ListNode * curr=node; ListNode * nxt=node->next; ListNode * prev=NULL; while(nxt!=NULL){ curr->val=nxt->val; prev =curr; curr = curr->next; nxt = nxt->next; } prev->next=NULL; }
ALGO
0.99898
3.969215
e52f6c64-2e6f-4ddb-9735-8863988305c2
amsraman/Competitive_Programming
USACO/Contests/Silver/2017-2018/Contest 3/silver18feb2.cpp
#include <fstream> #include <iostream> using namespace std; int n, b, f[250], m[250], ans; pair<int,int> s[250]; bool v[250][250] = {false}; void dfs(int x, int y) { if(v[x][y]) { return; } v[x][y] = true; if(f[x]>s[y].first) { return; } if(x==n-1) { ans = ...
ALGO
0.999943
3.8456
99da8533-8361-4df0-8345-491e99d065af
tiwaripari/codechef
chefffav2.cpp
#include<iostream> #include<string> using namespace std; void fav(string str, int n) { int flag=0; string sub; for(int i=1;i<=n;i++) { if(str[i]=='c') { sub=str.substr(i,4); if(sub=="code") { cout<<"AC"<<endl; ...
ALGO
0.999336
3.102791
0efc84d1-dda6-4e31-a375-16ed5c8ed97f
Aethereux/Hikari-LLVM19
libc/src/math/generic/lroundl.cpp
#include "src/math/lroundl.h" #include "src/__support/FPUtil/NearestIntegerOperations.h" #include "src/__support/common.h" #include "src/__support/macros/config.h" namespace LIBC_NAMESPACE_DECL { LLVM_LIBC_FUNCTION(long, lroundl, (long double x)) { return fputil::round_to_signed_integer<long double, long>(x); } } ...
TOOL
0.991938
6.113328
8d316a3d-003e-49cc-9d1a-eac0dd752b5d
ishandutta2007/codeforces
mhq/normal/1237/E.cpp
#ifdef DEBUG #define _GLIBCXX_DEBUG #endif #pragma GCC optimize("O3") #include <bits/stdc++.h> using namespace std; typedef long double ld; typedef long long ll; int n; const int maxN = 4 * (int)1e6 + 100; int f[maxN]; bool ok[maxN]; int sz[maxN]; int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr);...
ALGO
0.999986
3.910653
489fa81b-828b-4b2e-a2b3-ff0a8f2fe9cf
tommy16102/2022-algorithm-study
2022/21주차/정환훈/3687_성냥개비.cpp
#include <iostream> #include <string> #include <vector> using namespace std; int t; int n; long long dpS[101]; void init(){ int num[9] = {0, 0, 1, 7, 4, 2, 0, 8, 10}; for(int i=1;i<=9;i++){ dpS[i] = num[i]; } dpS[6] = 6; // 27 36 45 for(int i=9;i<=100;i++){ dpS[i] = 888888888888888; for(int j=2;j<8;j++){ ...
ALGO
0.99977
4.578245
50a7752c-2ba5-4939-ac2d-6bd08bc93cee
istiaqueahmedarik/Phitron
week14/A_Two_Vessels.cpp
/******************************************* @b |I|s|t|i|a|q|u|e| |A|h|m|e|d| |A|r|i|k| ********************************************/ #pragma GCC optimize("O3") #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; void _...
ALGO
0.999785
4.333364
8953846f-3837-45ae-bd95-13f0324d684f
Morpheus636/FWCoreManager
src/CoreMgr/data_utils.cpp
#include <vector> #include <string> #include <fstream> namespace data_utils { const std::string WHITESPACE = " \n\r\t\f\v"; // Public Function std::string StringLTrim(const std::string &s) { size_t start = s.find_first_not_of(WHITESPACE); return (start == std::string::npos) ? "" : s.substr(start); } // Public F...
TOOL
0.993016
6.197839
4b6392f0-7c6a-4da6-8795-007162637469
spirit6535/Codsun
vsCODE/recurs_funk/recfunck12.cpp
#include <iostream> //Бибилиотека ввода-вывода using namespace std; //пространство стандартных имен int decitich(int bin, int m = 1) { //Рекурсивная функция, для перевода в десятичную систему if (bin == 0){ return 0; //Условие для нуля } return bin % 10 * m + decitich(bin / 10, 2 * m); //Вызов ф...
ALGO
0.999546
4.279331
ba8ddcd8-75d2-481e-b02c-690fc1ff0347
ZhumaevaVika/Semester3
week1/classwork.cpp
#include <iostream> using namespace std; void qsort(void *base, size_t nmeb, size_t size, int (*compar)(const void *, const void *)); template<typename T> bool compare(const T&l, const T&r){ return l<r; } struct S{ string name; }; bool compare(const S&l, const S&r){ return l.name < r.name; } class Com...
ALGO
0.985756
4.024495
5bf0b971-76f7-4477-95aa-bd603aa01770
huypham37/sph
src/ParticleSystem.cpp
#include "ParticleSystem.hpp" #include <cmath> #include <iostream> #include <algorithm> #include "SPHConfig.hpp" namespace sph { ParticleSystem::ParticleSystem(float width, float height, float smoothingRadius) : width(width), height(height), smoothingRadius(Config::SMOOTHING_RADIUS) { // Create Grid for...
TOOL
0.921562
6.057406
439894b0-2340-40ed-8e34-76b5ab28aaca
ammardab3an/AleppoCPC
level_2/subjects/complete search/brute force/during session codes/10360 - Rat Attack/rat_2.cpp
// By AmmarDab3an - Aleppo University #include "bits/stdc++.h" using namespace std; //#define int int64_t //#define lli int64_t typedef unsigned int uint; typedef long long int lli; typedef unsigned long long ull; typedef pair<int, int> pii; typedef pair<lli, lli> pll; typedef pair<int, pii...
ALGO
0.999831
4.372519
fcac43ad-4a2d-40cc-baec-2247b204d9dd
tanvir14012/Sphere-Online-Judge-My_Solutions
spoj FACT1.cpp
#include <bits/stdc++.h> using namespace std; #define sqN 1194967296 long long unsigned prime_list[100000000];/// long long unsigned na dile bipod bool prime[sqN/2]; void Sieve() { long long unsigned count = 1,sqn = (long long unsigned)sqrt(sqN); for(long long unsigned i = 3; i<= sqn; i+=2) { if(pr...
ALGO
0.999897
4.119901
9bc051a4-df83-47dd-bcaf-c9c5dfa5e59e
iuyoy/basicCSKnowledge
leetcode/21. Merge Two Sorted Lists/MTSL.cpp
/* Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists. Example: Input: 1->2->4, 1->3->4 Output: 1->1->2->3->4->4 */ /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * Lis...
ALGO
0.999939
6.035256
bdcf6d2a-85a8-4cf6-9746-1e30b73cc898
Saif502/CP_Hunter
C & c++ code/Codeforces/999a.cpp
#include<bits/stdc++.h> #include<iostream> #include<math.h> #include<map> #include<vector> #include<string.h> #define ll long long int #define i_for(n) for(ll i=0;i<n;i++) #define ri_for(n) for(ll i=n-1;i>=0;i--) #define for_i(n) for(ll i=1;i<=n;i++) #define j_for(n) for(ll j=0;j<n;j++) #define rj_for(n) for(ll j=n-1;j...
ALGO
0.999967
3.545766
54a8a533-7a95-4af4-b675-0df6f60b152a
mrinal-mann/Leetcode-Solved
0005-longest-palindromic-substring/0005-longest-palindromic-substring.cpp
class Solution { public: string longestPalindrome(string s) { string res = ""; int reslen = 0; for (int i = 0; i < s.length(); i++) { // Odd-length palindrome int l = i, r = i; while (l >= 0 && r < s.length() && s[l] == s[r]) { if ((r - l ...
ALGO
0.999975
6.383703
93ecb105-feba-400c-9801-d6ac03f8057d
zerls/PAT
pat_advanced/1100.cpp
using namespace std; string ge[]={"tret","jan", "feb", "mar", "apr", "may", "jun", "jly", "aug", "sep", "oct", "nov", "dec"}; string shi[]={"###","tam", "hel", "maa", "huh", "tou", "kes", "hei", "elo", "syy", "lok", "mer", "jou"}; void func1(string &s){ int t=stoi(s); if (t / 13) cout << shi[t / 13]; if ((t / ...
ALGO
0.999326
3.806528
f34c867a-8874-40fa-b29f-3438a93fb276
ishandutta2007/codeforces
alpha_q/normal/754/D.cpp
#include <bits/stdc++.h> #include <ext/pb_ds/tree_policy.hpp> #include <ext/pb_ds/assoc_container.hpp> using namespace std; using namespace __gnu_pbds; typedef tree <pair <int, int>, null_type, greater <pair <int, int> >, rb_tree_tag, tree_order_statistics_node_update> OrderedSet; const int N = 3e5 + 10; const int ...
ALGO
0.999982
3.763667
dd244f3f-8621-44cc-af91-c1192f90a62c
mehakk-Bhatia/Data-Structures
arrays/Maximum Sum With Exactly K Elements.cpp
class Solution { public: int maximizeSum(vector<int>& nums, int k) { int n = nums.size(); int maxi = *max_element(nums.begin(), nums.end()); int x = 0 , ans=0; for(int i=0 ; i<k ; i++){ x = maxi + i; ans += x; } return ans; ...
ALGO
0.999935
5.326857
8342f54b-dec6-4494-a82b-d9b965783303
tsandheep/nd013-c6-control-starter
project/pid_controller/eigen-3.3.7/doc/examples/DenseBase_middleCols_int.cpp
#include <Eigen/Core> #include <iostream> using namespace Eigen; using namespace std; int main(void) { int const N = 5; MatrixXi A(N,N); A.setRandom(); cout << "A =\n" << A << '\n' << endl; cout << "A(1..3,:) =\n" << A.middleCols(1,3) << endl; return 0; }
ALGO
0.97437
3.137892
ea8aa22e-4a83-4630-a182-cf74a66d562e
Chribela/Self_Driving_car
project_11_path_planning/src/Eigen-3.3/unsupported/doc/examples/MatrixFunction.cpp
#include <unsupported/Eigen/MatrixFunctions> #include <iostream> using namespace Eigen; std::complex<double> expfn(std::complex<double> x, int) { return std::exp(x); } int main() { const double pi = std::acos(-1.0); MatrixXd A(3,3); A << 0, -pi/4, 0, pi/4, 0, 0, 0, 0, 0; std::...
ALGO
0.999274
4.365858
4ccae67e-fe53-4d0b-aadd-81bd1f8be2e0
zhang-fengdi/ControlGS
SIBR_viewers/src/core/view/IBRBasicUtils.cpp
#include "IBRBasicUtils.hpp" namespace sibr { std::vector<uint> IBRBasicUtils::selectCameras(const std::vector<InputCamera::Ptr>& cams, const Camera & eye, uint count) { // Select one method return selectCamerasAngleWeight(cams, eye, count); //return selectCamerasSimpleDist(cams, eye, count); } std::vector<...
ALGO
0.995631
6.362492
85fa1178-f4ab-4ead-aeaf-95a0395d5647
icoty/LeetCode
Algorithms/287.Find_the_Duplicate_Number.cpp
#include "AllInclude.h" class Solution { public: // https://www.cnblogs.com/grandyang/p/4843654.html int findDuplicate(vector<int>& nums) { if(nums.size() < 2) return -1; int l = 1; int r = nums.size(); while(l < r){ int cnt =...
ALGO
0.999914
5.627198
8b319666-9d8e-455b-93b9-e491b27f0e74
byung-u/PracticeTest
_Algorithm/AlgoSpot_cpp/XHAENEUNG.cpp
#include <iostream> #include <climits> #include <cstring> #define MAXCNT 10000 #define MAXBUF 32 struct T { int outnum; char in[MAXBUF]; char out[MAXBUF]; }; struct T t[MAXCNT]; char number[11][MAXBUF] = {"zero","one","two","three","four","five","six","seven","eight","nine","ten"}; char ord_num[11][MAXB...
ALGO
0.999547
3.691984
85ef977d-6547-4646-ac80-617907d70055
sagarbhokre/Chariot
src/Eigen-3.3/doc/examples/TutorialLinAlgExSolveColPivHouseholderQR.cpp
#include <iostream> #include <Eigen/Dense> using namespace std; using namespace Eigen; int main() { Matrix3f A; Vector3f b; A << 1,2,3, 4,5,6, 7,8,10; b << 3, 3, 4; cout << "Here is the matrix A:\n" << A << endl; cout << "Here is the vector b:\n" << b << endl; Vector3f x = A.colPivHouseholderQr...
ALGO
0.999882
3.366961
bca5b01c-58ea-45db-ac06-56162a2fc9fe
FalseF/Problem-Solving
Toph/Problematic Problem Setters.cpp
/*######## IN THE NAME OF ALLAH ##########*/ #pragma GCC diagnostic ignored "-Wunused-variable" #pragma GCC diagnostic ignored "-Wunused-parameter" #include<bits/stdc++.h> using namespace std; #pragma GCC diagnostic ignored "-Wunused-but-set-variable" #pragma GCC diagnostic ignored "-Wformat" #define ll long long...
ALGO
0.999777
3.927181
77146098-4f94-4297-8e61-c68b871dd05d
Tastypotato245/boj
1/1149/main.cpp
// https://www.acmicpc.net/problem/1149 // github/Tastypotato245 #include <iostream> #include <algorithm> #include <vector> #include <cmath> using namespace std; int N; int rgb[1000][3]; void Solve() { cin >> N; cin >> rgb[0][0]; cin >> rgb[0][1]; cin >> rgb[0][2]; for (int i = 1 ; i < N ; ++i) { int r, g,...
ALGO
0.952375
4.544645
fdc50f1f-4f64-4078-ae3a-e22a929ad357
IshyWishy17/Competitive-Coding
CSES/Sorting and Searching/tasks_deadlines.cpp
#include <iostream> #include <string> #include <bits/stdc++.h> using namespace std; void solve() { int n; cin >> n; vector<pair<long long int, long long int>> tasks(n); for (int i = 0; i < n; i++) cin >> tasks[i].first >> tasks[i].second; sort(tasks.begin(), tasks.end()); long long int ans = 0;...
ALGO
0.999906
4.752884
cb30c08f-dad0-49fb-8ec7-38743351d36f
ishandutta2007/codeforces
yousef_salama/normal/95/B.cpp
#include <iostream> #include <vector> #include <string> #include <stack> #include <algorithm> #include <bitset> #include <math.h> #include <queue> #include <map> #include <set> #include <limits.h> #include <limits> #include <stdio.h> #include <stdlib.h> #include <sstream> #include <string.h> #include <assert.h> #includ...
ALGO
0.999844
4.547673
06b4c633-febb-4433-aee6-125e4bcf79df
Cattle0Horse/algorithm-problem
leetcode/leetcode_2492.cpp
/** * @file leetcode_2492.cpp * @author Cattle_Horse (<EMAIL>) * @brief https://leetcode.cn/problems/minimum-score-of-a-path-between-two-cities/description/ * @version 0.1 * @date 2024-07-13 * * @copyright Copyright (c) 2024 * */ #ifdef OY_LOCAL #include <vector> #include <iostream> #include <algorithm> using...
ALGO
0.999948
5.753992
b17866c1-1174-4190-bc1e-c3db58973be1
TLutonsky/ngsolve
comp/l2hofespace.cpp
/*********************************************************************/ /* File: l2hofespace.cpp */ /* Author: Start */ /* Date: 24. Feb. 2003 */ /*********************************...
ALGO
0.908163
6.237309
231f0ddc-a80e-48b3-b7ad-d2706a507e67
LMFRomero/codingForInterview
leetCode/MayChallenge/day23.cpp
class Solution { public: vector<int> minPair (int a, int b) { vector<int> ans(2); ans[0] = min(a, b); ans[1] = ans[0] == a ? 0 : 1; return ans; } vector<int> maxPair (int a, int b) { vector<int> ans(2); ans[0] = max(a, b); ans[1] = ans[0] == a ? 0 : 1;...
ALGO
0.999992
5.74574
d9529438-c0e8-4406-bafe-4da5e2da332a
ishandutta2007/codeforces
pb0207/normal/930/C.cpp
#include<cstdio> #include<iostream> #include<cstring> #include<algorithm> using namespace std; const int N=1e5+1e3+7; int n,m,a[N],f[N],g[N],w[N]; int main() { scanf("%d%d",&n,&m); for(int i=1;i<=n;i++) { int l,r; scanf("%d%d",&l,&r); a[l]++,a[r+1]--; } for(int i=1;i<=m;i++) a[i]+=a[i-1]; memset(w,0...
ALGO
0.99997
3.475846
1a1c7ca0-f409-4744-bed9-5d100f02f9cf
pradeeptosarkar/CodeChef
BALLOON.cpp
#include <iostream> using namespace std; int main() { // your code goes here long long t; cin>>t; while(t--) { long long n; cin>>n; long long a[n]; for(long long i=0;i<n;i++) cin>>a[i]; long long okay=0; long long count=0; long long i=0; while(okay!=7) { ...
ALGO
0.99921
3.514966
21c4c12f-5767-4cce-8097-d8cb39cf804f
basavarajakj/DataStructure_Algo_CPP
08-LinkedList/02-IntermediateQuestion/04-DetectStartingPointOfLoop.cpp
#include <iostream> using namespace std; // Definition for singly-linked list node struct ListNode { int val; ListNode *next; ListNode(int x) : val(x), next(NULL) {} }; class Solution { public: // Function to detect the cycle in a singly-linked list ListNode *detectCycle(ListNode *head) { ...
ALGO
0.999975
6.645192
4c455c2f-51d1-406f-9f37-f739f2cfa904
drunkwater/leetcode
hard/cpp/c0109_630_course-schedule-iii/00_leetcode_0109.cpp
// DRUNKWATER TEMPLATE(add description and prototypes) // Question Title and Description on leetcode.com // Function Declaration and Function Prototypes on leetcode.com //630. Course Schedule III //There are n different online courses numbered from 1 to n. Each course has some duration(course length) t and closed on dt...
ALGO
0.999719
5.972507
79699424-38b3-4805-a4ce-2983da5c86a3
vivekshinde45/Data-Structures-And-Algorithm
Graph/24_Course_Schedule_Kahn's.cpp
https://leetcode.com/problems/course-schedule/ class Solution { public: bool canFinish(int n, vector<vector<int>>& prerequisites) { vector<int> inDegree(n, 0); vector<vector<int>> graph(n); for(auto const& e : prerequisites){ int u = e[0]; int v = e[1]; ...
ALGO
0.999864
7.04323
ded9ee21-151c-4fb6-ba75-039a284898a3
dghtucs/OI2023
ACM_template/1/3 图论/Maxflow/2 ISAP.cpp
// 点的下标从零开始,注意初始化 #include<cstdio> #include<cstring> #include<queue> #include<vector> #include<algorithm> using namespace std; const int maxn = 10000 + 10; const int INF = 1000000000; struct Edge { int from, to, cap, flow; }; bool operator < (const Edge& a, const Edge& b) { return a.from < b.from || (a.from == b...
ALGO
0.999955
4.401656
0a68a4cd-3ea2-4eaa-bded-d623df72af60
Khushi-Bagadia/Assignment-Tops
Module-3/Practicals/10.cpp
// 3. Multiplication Table // o Write a C++ program to display the multiplication table of a given number using a // for loop. // o Objective: Practice using loops. #include<iostream> using namespace std; int main() { int num,i; cout<<"Enter the value of n1: "; cin>>num; for(i=1;i<=10;i++) { ...
ALGO
0.998207
3.31061
dd12f5be-e9da-4b45-878a-cdeb42b449cc
ishandutta2007/codeforces
dottle/normal/1088/F.cpp
#include<bits/stdc++.h> #define int long long const int N=1005000,P=20; using namespace std; int rt,n,a[N],f[P][N],ans; #define _to e[i].to #define fore(k) for(int i=hd[k];i;i=e[i].nx) struct edge{ int to,nx; }e[N];int hd[N],S; void add(int fr,int to){ e[++S]=(edge){to,hd[fr]},hd[fr]=S; } void dfs(int k,int f...
ALGO
0.999869
3.496443
2d9be01b-9270-4b3c-8775-995bbbe2a420
kimberlytangha/wallbreakers
week2/intersection_of_two_arrays.cpp
class Solution { public: // time O(n^2) // space O(n) for set vector<int> intersection(vector<int>& nums1, vector<int>& nums2) { set<int> common; for (int i = 0; i < nums1.size(); i++) { for (int k = 0; k < nums2.size(); k++) { if (nums1[i] == ...
ALGO
0.999954
6.059169
5e37eca2-37bf-42e1-8654-bbd3adee41c3
AKHIL-GIREESH/DSA
Arrays/singleNumber.cpp
#include <bits/stdc++.h> #include <iostream> using namespace std; int main() { vector<int> v1 = {1}; int xor1 = 0; for (auto i = v1.begin(); i != v1.end(); i++) { xor1 = xor1 ^ *(i); } cout << xor1; }
ALGO
0.999881
3.557119
50a122b0-a8df-4e17-aa11-0ea3064b74ca
ishandutta2007/codeforces
sunzh/normal/954/H.cpp
#include<cstdio> #include<iostream> #include<queue> #include<algorithm> #include<cstring> #include<set> #include<vector> #include<cmath> #define PII pair<int,int> #define pb push_back #define ep emplace_back #define mp make_pair #define fi first #define se second using namespace std; inline int read(){ int x=0,f=1;cha...
ALGO
0.999981
3.450447
6b139361-2bbf-4721-be01-9ee1796c9625
naderman/orca-robotics
src/hydrolibs/hydropathplan/test/testpathplan.cpp
#include <iostream> #include <cstdlib> using namespace std; #include <hydromapload/ogmaploadutil.h> #include <hydroogmap/hydroogmap.h> #include <hydroogmap/oglostracer.h> #include <hydropathplan/hydropathplan.h> void testPathPlan( const hydropathplan::IPathPlanner2d &planner, const hydroogmap::OgMap...
ALGO
0.96212
5.601557
3a5d2dc2-3d64-4185-a7db-b168835479b1
jkalend/SIMD-3D-graphics
src/math/matrix4.cpp
#include "../../include/math/matrix4.h" #include <cstring> #include <iomanip> #include <iostream> #include <cmath> // Pre-computed identity for even faster access static const Matrix4 IDENTITY_MATRIX = Matrix4(); // Constructors Matrix4::Matrix4() { // Initialize to identity matrix using AVX _rows[0] = _mm_se...
ALGO
0.996819
4.800571
17c7dc83-6c47-4765-a6c0-d983732aa96a
aksaddleback/class-codes-s2024
P10-LoopII/p8.cpp
#include<iostream> using namespace std; int main() { string str; cin >> str; // solution 1 int k = 0; for(int i = 0; i < 4; i++) { for (int j = 0; j < 4; j++) { cout << str[k++] << " "; } cout << endl; } cout << endl; // solution 2 for(i...
ALGO
0.999339
3.860547
846fbc82-3d76-4941-a7af-2b21ee042ed1
lazywaterpig/BOJ_Problems
solved.ac CLASS/CLASS 4/1753.cpp
#include <bits/stdc++.h> using namespace std; #define MAX 20001 #define INF 2147483647 int v, e, k; vector <pair<int,int>> edge[MAX]; vector<int> dijkstra(int s, int v){ vector<int> dist(v, INF); dist[s]=0; priority_queue<pair<int,int>, vector<pair<int,int>>, greater<pair<int,int>>> pq; pq.push({0,s...
ALGO
0.999939
3.961462
7e5abec0-94db-40e1-ba01-70898ecb102a
pt2121/mbtiles
jni/geos-3.3.8/src/operation/polygonize/EdgeRing.cpp
#include <geos/operation/polygonize/EdgeRing.h> #include <geos/operation/polygonize/PolygonizeEdge.h> #include <geos/planargraph/DirectedEdge.h> #include <geos/geom/CoordinateSequence.h> #include <geos/geom/LinearRing.h> #include <geos/geom/Coordinate.h> #include <geos/geom/Envelope.h> #include <geos/geom/GeometryFacto...
TOOL
0.9135
6.352638
0d106701-cc62-4eb1-8a84-3f68ea0bb831
sinian666/codes_102_4
1cpp_副本3/chapter_backtracking/n_queens.cpp
/** * File: n_queens.cpp * Created Time: 2023-05-04 * Author: Krahets (<EMAIL>) */ #include "../utils/common.hpp" /* 回溯算法:N 皇后 */ void backtrack(int row, int n, vector<vector<string>> &state, vector<vector<vector<string>>> &res, vector<bool> &cols, vector<bool> &diags1, vector<bool> &diags2) { ...
ALGO
0.999529
5.923316
bd35c740-78ad-49a3-bfe3-b0b87a8ba34f
sumitkumar16dec/LeetCode
Maximum path sum from any node - GFG/maximum-path-sum-from-any-node.cpp
// { Driver Code Starts #include <bits/stdc++.h> using namespace std; // Tree Node struct Node { int data; Node *left; Node *right; Node(int val) { data = val; left = right = NULL; } }; // Function to Build Tree Node *buildTree(string str) { // Corner Case if (str.length()...
ALGO
0.999794
7.095431
204365e1-c5ca-47f7-ae71-c5d17d3998d0
bytendpixel/Leetcode-Solution
Target Sum.cpp
class Solution { public: int findTargetSumWays(vector<int>& nums, int target) { const int sum = accumulate(nums.begin(), nums.end(), 0); if (sum < abs(target) || (sum + target) % 2 == 1) return 0; return knapsack(nums, (sum + target) / 2); } private: int knapsack(const vector<int>& nums, int ...
ALGO
0.999969
6.420217
a33b800c-e04f-4c6d-9303-ad0ca438874c
lucic71/llvm-ub-free
clang-tools-extra/clang-include-fixer/find-all-symbols/PathConfig.cpp
#include "PathConfig.h" #include "llvm/ADT/SmallString.h" #include "llvm/Support/Path.h" namespace clang { namespace find_all_symbols { std::string getIncludePath(const SourceManager &SM, SourceLocation Loc, const HeaderMapCollector *Collector) { llvm::StringRef FilePath; // Walk up the...
TOOL
0.902566
7.720238
3811ac5e-cdbf-44c7-bb42-f559b9b4f66d
statco19/BOJ-problems
1103.cpp
#include <bits/stdc++.h> using namespace std; #define vt vector #define ll long long #define pb push_back #define pf push_front #define all(c) (c).begin(), (c).end() #define rev(c) (c).rbegin(), (c).rend() #define sz(x) (int)(x).size() #define mset(ar, val) memset(ar, val, sizeof(ar)) #define vi vector<int> #define vv...
ALGO
0.999765
4.475283
95171636-0a41-49f9-b9f0-27ec5679355a
Sefayet-Alam/New-CP-submissions_vol_3
D_Yet_Another_Real_Number_Problem.cpp
#include <bits/stdc++.h> using namespace std; const int N = 2e5 + 9, inf = 1e9, mod = 1e9 + 7; using ll = long long; using T = pair<int, int>; T t[N][19]; int a[N]; void build(int n) { for (int i = 1; i <= n; ++i) t[i][0] = T(a[i], i); for (int k = 1; k < 19; ++k) { for (int i = 1; i + (1 ...
ALGO
0.999983
3.698192
c64e4f38-f5e7-4dff-a5ef-f9674a775a53
PANISHAR/Programming
random practice problem /c++.cpp
#include <iostream> #include <vector> std::string determineSeriesWinner(const std::vector<int>& matches) { int indiaWins = 0, englandWins = 0; for (int matchResult : matches) { if (matchResult == 1) indiaWins++; else if (matchResult == 2) englandWins++; } if (i...
ALGO
0.999943
6.489614
78b0a056-9b82-4460-85c5-17523f455a24
oyberntzen/competitive-programming
ioi2023camp/day3/task1/glo_dlazaw/glolib.cpp
#include <iostream> #include <vector> #include "glolib.h" int _n; std::vector<int> _manager; bool _inited = false; std::vector<int> _taken; std::vector<bool> _is_manager; void _initialize() { if (_inited) { return; } _inited = true; std::cin >> _n; _manager.resize(_n + 1); _taken.resi...
ALGO
0.999975
3.768033
5ccc47ae-0f73-49b2-a182-d61ff2648dca
KangwooChoi/LeetCode
2683-neighboring-bitwise-xor/2683-neighboring-bitwise-xor.cpp
class Solution { public: bool doesValidArrayExist(vector<int>& derived) { return DFS(derived, 0, 0, 0) || DFS(derived, 0, 1, 1); } bool DFS(vector<int>& derived, int index, int start, int current) { if (index == derived.size() - 1) { if (start == current^derived[index]) return ...
ALGO
0.999832
5.738395
d44d64aa-81fa-4ac1-b58f-25134224a244
ANUSHKA78613/DSA
17-letter-combinations-of-a-phone-number/letter-combinations-of-a-phone-number.cpp
class Solution { public: void solve(string digits,int index,string v, vector<string>&ans,string mapping[]){ //base case if(index >= digits.length()){ ans.push_back(v); return; } int number = digits[index] - '0'; string value = mapping[number]; for(int i = 0;i<value.length();i++){ v.push_back(value[i]); ...
ALGO
0.999952
6.778533
a53895fe-91c1-4dd8-8550-3ba6580ca645
StoneMa/coderepo
C/水题不容易/main.cpp
#include <iostream> #include <stdio.h> using namespace std; #define N 1000 int main() { int n; int a; int sum; scanf("%d",&n); while(n--) { sum = 3; scanf("%d",&a); for(int i=0;i<a;i++) { sum = (sum-1)*2; } printf("%d\n",sum); } ...
ALGO
0.999235
3.14219
936a7d32-7071-4436-a706-621d8bdf022b
TSakamoto-evo/funding
visualize/main.cpp
#include"parameters.hpp" #include"discipline.hpp" #include<vector> #include<fstream> #include<iostream> int main(){ //Parameter settings Parameters paras; paras.width = 101; paras.depth = 101; paras.x_peak_pos.assign( {20.0, 20.0, 80.0, 80.0} ); paras.y_peak_pos.assign( {20.0, 80.0, 20.0, 80.0} ); paras...
ALGO
0.964678
4.587481
2be8d03a-a1ac-44cd-a566-4d66c31e3108
kimmk1533/StarCraft
CoreEngine/Scripts/Camera.cpp
#include "stdafx_Core.h" #include "Camera.h" namespace CoreEngine { void C_Camera::Calculate_U_Vector() { static const D3DXVECTOR3 up(0.0f, 1.0f, 0.0f); D3DXVec3Cross(m_pU, &up, m_pW); D3DXVec3Normalize(m_pU, m_pU); } void C_Camera::Calculate_V_Vector() { D3DXVec3Cross(m_pV, m_pW, m_pU); } void C_Camera...
TOOL
0.859897
5.518691
feaf0a69-7260-46ff-9592-5f973ef0b97f
yancouto/competitive-programming
contests/mashup3/I.cpp
#include <bits/stdc++.h> using namespace std; #define pb push_back int main() { int i, n; scanf("%d", &n); if(n == 1) { puts("no"); return 0; } for(i = 2; i * i <= n && (n % i); i++); if(n % i) puts("yes"); else { while(!(n % i)) n /= i; if(n > 1) puts("no"); else puts("yes"); } }
ALGO
0.999994
4.47754
a35d0fe5-2001-428f-911c-c58c64e925a5
anshu1515/cb_cpp
Bit Manipulation/bitwiseOperators.cpp
#include<iostream> using namespace std; int main(){ int a=7,b=5; //AND cout<<(a&b)<<endl; cout<<(8&5)<<endl; //OR cout<<(7|5)<<endl; cout<<(14|2)<<endl; //XOR cout<<(7^5)<<endl; cout<<(14^1)<<endl; //LEFT SHIFT a=a<<b; a=a*2^b; int x=1; cout<<"left shift: "<<(x<<2)<<endl; //RIGHT SHI...
ALGO
0.994896
3.403138
cebf53a6-75d9-431a-9e29-7ed726dd6b83
trilinos/Trilinos
packages/triutils/src/Trilinos_Util_GenerateCrsProblem.cpp
#include "Trilinos_Util.h" #include "Epetra_ConfigDefs.h" #include "Epetra_Comm.h" #include "Epetra_Map.h" #include "Epetra_Vector.h" #include "Epetra_MultiVector.h" #include "Epetra_CrsMatrix.h" // Constructs a 2D PDE finite difference matrix using the list of x and y offsets. // // nx (In) - number of grid poi...
ALGO
0.997734
4.966603
0387b833-f114-4727-a6d0-e08ecfd081f7
Murad501/Phitron
Contests/Codeforces/Educational Rounds/178 (Div 2)/B_Move_to_the_End.cpp
// 28/04/2025 20:40 #include <bits/stdc++.h> using namespace std; #define nl '\n' #define int long long #define all(x) x.begin(), x.end() #define ll long long int #define yes cout << "YES" << '\n' #define no cout << "NO" << '\n' #define cyes cout << "Yes" << '\n' #define cno cout << "No" << '\n' #define minus cout << -...
ALGO
0.999932
4.683633
f02aff73-bba7-4031-9fdf-58093e23cdfe
supreethkurpad/Tailbench
tailbench/moses/moses/ChartHypothesis.cpp
// vim:tabstop=2 #include <algorithm> #include <vector> #include "ChartHypothesis.h" #include "RuleCubeItem.h" #include "ChartCell.h" #include "ChartManager.h" #include "TargetPhrase.h" #include "Phrase.h" #include "StaticData.h" #include "DummyScoreProducers.h" #include "LMList.h" #include "ChartTranslationOptions.h"...
ALGO
0.931845
5.045986
c28466c3-b7c6-4835-92da-f0fc045a0d43
aaryan6789/cppSpace
Matrix/search_in_2D.cpp
#include "_matrix.h" using namespace std; /** Search a 2D Matrix | 74 LEETCODE M | https://leetcode.com/problems/search-a-2d-matrix/ * Write an efficient algorithm that searches for a value in an m x n matrix. * This matrix has the following properties: * * Integers in each row are sorted from left to right. * ...
ALGO
0.999967
6.327952
6e054819-2e54-4f2f-abe7-6853f6ba5e93
leejang/baxter_code
src/baxter_controller.cpp
/* * File: baxter_controller.cpp * Author: Jangwon lee * Email: <EMAIL> */ #include "baxter_controller.h" #define DEBUG 0 // position threshold in radians across each joint // when move is considered successful #define POSITION_THRESHOLD 0.008726646 // equals to 0.5 degree #define CONTROL_FREQ 100 #define TIMEOU...
TOOL
0.896057
5.231048
5cbe0e17-1891-4e2e-abd7-2cc73698c0f9
Vivashwan/LeetCodes
1641-count-sorted-vowel-strings/1641-count-sorted-vowel-strings.cpp
class Solution { public: int countVowelStrings(int n) { int a=1, e=1, i=1, o=1, u=1; n=n-1; while(n--) { o += u; i += o; e += i; a += e; } return a+e+i+o+u; } };
ALGO
0.999793
6.64403
0ffa7a35-d339-4958-995a-df246a98b09e
mono-1729/AtCoder_cpp
ABC/397/a.cpp
#include <bits/stdc++.h> #include <unordered_map> #include <stdlib.h> #include <boost/multiprecision/cpp_int.hpp> #include <atcoder/all> using namespace atcoder; using namespace boost::multiprecision; using namespace std; #define rep(i, a, n) for(ll i = a; i < n; i++) #define rrep(i, a, n) for(ll i = a; i >= n; i--) #d...
ALGO
0.999611
3.674328
6a938285-a8ce-4f63-a6b3-f085cc929733
shivanshsanoria1/LeetcodeSolutions
CPP [501-1000]/930.binary_subarrays_with_sum [3].cpp
class Solution { private: // returns num of subarrays with sum <= k int subarraySumLessThanOrEqualTo_K(vector<int>& nums, int k){ int left = 0, right = 0; int prefixSum = 0; int count = 0; while(right < nums.size()) { // expand the window-size by 1 ...
ALGO
0.999979
6.491376
2c6f043a-8121-4dc0-8287-dd782f026872
Volgarenok/spbspu-labs-2025-tp-a
belyaev.veniamin/T3/command-handlers.cpp
#include "command-handlers.hpp" #include <stream-guard.hpp> template< typename Pred > void belyaev::areaOddEven(const std::vector< Polygon >& data, std::ostream& out, Pred predicate) { std::vector< double > areas; std::vector< Polygon > polysByPredicate; std::copy_if(data.begin(), data.end(), std::back_inserter...
DATA
0.935295
6.856798
4bf4473b-dd1f-4a35-9251-381fa5adfba1
surya-veer/Data-structure-Algorithms-practice
Data Structure/stack/balancing_parentheses.cpp
#include<bits/stdc++.h> using namespace std; int main(){ string exp; cin>>exp; stack<char> st; int len = exp.size(); int i; for(i=0;i<len;i++){ if(exp[i]=='('||exp[i]=='{'||exp[i]=='['){ st.push(exp[i]); } else if(!...
ALGO
0.999661
4.727852
7a675aef-c9a0-42f9-8eda-4da91f72641d
AleXLaeR/Asm-Second-Sem-Indivs
10/10.1.cpp
#define N 25 #include <iostream> using namespace std; int main(void) { long int result_maximum = 0; long int num_array[N]; srand(time(0)); cout << "The array: "; for (int i = 0; i < N; i++) { num_array[i] = (rand() % 2 == 1) ? -(rand() % 100) : rand() % 100; cout.width(3); cout << num_array[i] << ' '; ...
ALGO
0.999791
3.534225
d50e8325-7214-4d77-a688-5fb5b6a8a98c
date3k2/Programming
C++/souocsole.cpp
#include <bits/stdc++.h> #define ll long long using namespace std; int main() { ios_base::sync_with_stdio(0); cin.tie(0); ll n; cin>>n; if (sqrt(n)==trunc(sqrt(n))) cout<<"YES"; else cout<<"NO"; return 0; }
ALGO
0.999822
4.426478