uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
03dd6c3e-3158-43c5-8f5a-6e2e4aaf24a2
jennienn/codetree-TILs
240307/단어로 구분하기 3/separate-words-with-words-3.cpp
#include <iostream> using namespace std; int main() { string str[10]; for(int i=0; i<10; i++){ cin >> str[i]; } for(int i=9; i>=0; i--){ cout << str[i] << endl; } return 0; }
ALGO
0.994433
3.266705
388f4370-7243-4214-8486-65f4b675fd7c
khaledsliti/CompetitiveProgramming
TCTC2019/TCTC#02/i.cpp
#include <bits/stdc++.h> using namespace std; #define endl '\n' #define pb push_back #define sz(x) ((int)(x).size()) #define all(x) begin(x), end(x) int main() { int q; scanf("%d", &q); while(q--){ int a, b, n; scanf("%d%d%d", &a, &b, &n); int g = __gcd(a, b); if(b > a) swap(a, b); a /=...
ALGO
0.999923
4.343178
fb9dbb8f-1804-4ea8-817e-938675a3a50d
heavenMOJANG/ICPC
.history/Codeforces/CF2026/D_20241114101805.cpp
#pragma GCC optimize(1) #pragma GCC optimize(2) #pragma GCC optimize(3, "Ofast", "inline") #include <bits/stdc++.h> #define int long long using namespace std; constexpr int N = 3e5 + 10; constexpr int INF = 0x7fffffff; void solve() { int n; cin >> n; vector<int> a(n + 1); for (int i = 1; i <= n; ++ i) cin >...
ALGO
0.999751
4.449472
faef104c-0580-4bf2-a4f9-bd7d4114c35b
clickykeyboard/SEM-3-DSA
Week11/SelectionSort.cpp
#include <iostream> using namespace std; void printArray(int arr[], int size) { int i; for (i = 0; i < size; i++) cout << arr[i] << " "; cout << endl; } main() { int array[] = { 1, 6, 2, 4, 7, 10, 8 }; int size = 7; for (int i = 0; i < size - 1; i++) { int minimum = i; ...
ALGO
0.999971
4.48422
364206a9-e3b0-483f-8ca5-d630fe6af8f8
qpanx/Programming-advices-course
Course5/problem#7.2.MySolution/problem#7.2.MySolution/problem#7.2.MySolution.cpp
#include <iostream> using namespace std; int ReadPositiveNumber(string Message) { int Number = 0; do { cout << Message << endl; cin >> Number; } while (Number < 0); return Number; } void ReverseOfDigits(int Number) { int Remainder = 0; while (Number > 0) { Remainder = Number % 10; Number /= 10; c...
ALGO
0.989047
4.511266
261316c0-69d5-49a3-b55b-bbb78c489cbe
pcastro93/Maratones
Maraton 08 junio 2013 - Escuela Ingenieros/fibonacci2.cpp
//WTF team #include <iostream> #include <vector> #include <algorithm> #include <string> #include <cstring> #include <cstdlib> #include <cstdio> #include <cmath> using namespace std; #define MAXSIZEP 29 #define MAXN 110 typedef unsigned long long ll; int N; string p; vector<ll> fibo(MAXSIZEP); string palabra[MAXN]; l...
ALGO
0.999751
3.83347
0082f5a5-dd4a-4537-abb5-7cece371ae72
ishandutta2007/codeforces
orzdevinwang/normal/1684/B.cpp
#include<bits/stdc++.h> #define L(i, j, k) for(int i = (j); i <= (k); ++i) #define R(i, j, k) for(int i = (j); i >= (k); --i) #define ll long long #define vi vector <int> #define sz(a) ((int) (a).size()) #define me(f, x) memset(f, x, sizeof(f)) #define uint unsigned int using namespace std; const int N = 1e6 + 7, O = ...
ALGO
0.99968
3.546245
b4b4eb87-cc25-4e95-8427-0c9d8c327044
ISSuh/Study
ProblemSolving/Backjoon/Search/10816/main.cpp
/* * https://www.acmicpc.net/problem/10816 * * 숫자 카드는 정수 하나가 적혀져 있는 카드이다. 상근이는 숫자 카드 N개를 가지고 있다. 정수 M개가 주어졌을 때, 이 수가 적혀있는 숫자 카드를 상근이가 몇 개 가지고 있는지 구하는 프로그램을 작성하시오. * */ #include <iostream> #include <map> #include <vector> #include <algorithm> int main(){ int N = 0,M = 0; std::cin >> N; ...
ALGO
0.999936
5.133923
b976dc95-0e9a-4687-baa1-453c43305572
i-rony18/leetcode
my-folder/problems/contains_duplicate_ii/solution.cpp
class Solution { public: bool containsNearbyDuplicate(vector<int>& nums, int k) { unordered_map<int,int>st; int i = 0,j = 0; for(; j<nums.size(); j++){ if(j>k){ st[nums[i++]]--; } if(st[nums[j]]>0){ return true; ...
ALGO
0.999899
5.956211
c95c65cd-7b4e-4767-a281-e6619e858d31
tanyavasilkiv21/RainySnake
TestSnake/Snake.cpp
#include "Snake.h" Snake::Snake() { intY = intHeight / 2; intX = intWidth / 2; intLenght = 1; vecBodyOnX.push_back(intX); vecBodyOnY.push_back(intY); } //Logic funtions void Snake::ChangeDir(eDirection dir) { dirDirection = dir; } void Snake::MoveSnake() { switch (dirDirection) { case RIGHT: intX++; break...
ALGO
0.954162
5.263741
14033345-c0f2-4a9e-ad97-902016a80d8a
TengFeiyang01/Algorithm
bishi/9-7京东/b.cpp
#include <bits/stdc++.h> const int inf = 0x3f3f3f3f; using i64 = long long; void solve() { int n, k, s; std::cin >> n >> k >> s; i64 l = 0, r = 1e12; auto check = [&](i64 x) { i64 p = (sqrtl(1 + 8LL * x) - 1) / 2; x -= p * (p + 1) / 2; i64 cur = 0; i64 cnt = p + 1 - x; // 这是n-p的个数...
ALGO
0.999727
4.251907
9549edf2-9e68-419c-99ab-96de7aca01cd
ishandutta2007/codeforces
dlalswp25/normal/1696/E.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; const ll MOD = 1000000007; const int MX = 400000; int N; ll F[404040]; ll I[404040]; ll pw(ll a, ll b) { ll ret = 1; while(b) { if(b & 1) ret = ret * a % MOD; a = a * a % MOD; b >>= 1; } return ret; } ll inv(ll x) { return pw(x, MOD - 2)...
ALGO
0.999891
3.85441
e2c851ef-7d85-4b20-9354-c4546af05772
ConnorUsaty/competitive-programming
solutions/codeforces/question_marks.cpp
// #include <bits/stdc++.h> #include <algorithm> #include <bitset> #include <cassert> #include <chrono> #include <cmath> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <random> #include <set> #include <string> #include <vector> #include <stack> typedef long long ll; t...
ALGO
0.999862
5.021643
9c402ab0-68d4-44cf-b335-d862cbb698c0
SOAIB56/Problem-solving-club
week 5/day 4 and 5/N_Minimize_the_Thickness.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { int testCase; cin >> testCase; while (testCase--) { int n; cin >> n; vector<int> v(n); for (int i = 0; i < n; i++) { cin >> v[i]; } int sum = accumulate(v.be...
ALGO
0.999745
3.976174
17572bed-e29c-4309-a635-5ecbe57cc471
acassis/emlinux-ssd1935
libs/oss/others/APL/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/src/agc.cpp
/* ------------------------------------------------------------------------------ Filename: agc.cpp Funtions: energy_old energy_new agc_init agc_reset agc_exit agc agc2 ------------------------------------------------------------------------------ M...
ALGO
0.969745
5.119219
a6855d4b-f90a-4c5c-80c6-3c5702c72273
matthewschallenkamp/Euler
C++/23.cpp
#include <iostream> #include <vector> #include <set> #include <algorithm> #include <cmath> #include <fstream> using namespace std; long long sum_divisors(long long n) { long long sum = 1; for (long long i = 2; i < n; i++) { if (n % i == 0) sum += i; } return sum; } int main() { vector<long long> abu...
ALGO
0.999856
5.333762
e63090db-8c77-479e-9512-3fb5a9b8e12b
ashutosh-singh83/45dayschallenge
arrays/7.cpp
class Solution { public: void moveZeroes(vector<int>& nums) { int n=nums.size(); int j=0; for(int i=0;i<n;i++){ if(nums[i]!=0){ nums[j++]=nums[i]; } } for(;j<n;j++){ nums[j]=0; } return; } };
ALGO
0.99992
6.345608
f89e6ec5-05e8-415d-843e-bbb0db8cbf5e
camil0palacios/Competitive-programming
solutions/Light oj/1010 - Knights in Chessboard/solution.cpp
#include <bits/stdc++.h> //#define endl '\n' using namespace std; void solve(){ int n, m; cin >> m >> n; int ans = 0; if(m > n)swap(m,n); if(n == 1 || m == 1){ ans = m*n; } else if(n == 2 || m == 2){ if(n == m){ ans = n*m; } else if(n % 2 == 1){ ...
ALGO
0.999946
5.396113
f9a3611c-ab60-41ab-b304-35f4fd0b0b84
sardonicankita/6companies30days
Microsoft/Longest Happy Prefix.cpp
class Solution { public: string longestPrefix(string s) { string ans=""; vector<int>pos(s.size(), 0); int i=0, j=1; while(j<s.size()){ if(s[i]==s[j]){ pos[j]=i+1; i++; j++; } else if(i){ ...
ALGO
0.999964
5.802603
da1967fb-2d7d-4655-ab2e-572c9e4769fa
androidfans/DataStructAndAlgorithm
SeparateChainingHashTable.cpp
#include "SeparateChainingHashTable.h" #include "SinglelyLinkedList.h" #include "DataStructAndAlgorithm.h" SeparateChainingHashTable::SeparateChainingHashTable(int size) { capacity = size; data = new SinglelyLinkedList[size]; } SeparateChainingHashTable::~SeparateChainingHashTable() { delete[] data; } int Separat...
ALGO
0.995526
4.547318
30e4f11d-a838-4d93-8b45-ba0440c065c8
denismalyshev211-729/vvPROGRAM
VV5/VV5.cpp
#include <iostream> #include <cmath> #include <math.h> using namespace std; int main() { setlocale(0, ""); int number; for (int i = 0; i > -1;){ cout << endl << endl << "Введите номер задания(1-5): "; cin >> number; switch (number) { case 1: int x1, x2, y1, y2; ...
ALGO
0.989082
3.496865
d56ef70f-772d-4c8e-97b5-edeeceb94751
TobeyChao/leetcode-practice
proj/src/1-200/119.杨辉三角II.cpp
//#include <vector> //#include <unordered_map> // //using namespace std; // //class Solution { //public: // vector<int> getRow(int rowIndex) { // vector<int> v; // int res = 1; // v.push_back(res); // for (int col = 1; col <= rowIndex; col++) // { // int num = res * (row...
ALGO
0.999511
5.92983
91e4fc5d-1541-493e-8a92-7d65950ca2c2
b-henriques/TER_HILBERT_CURVE
src/HilbertCurve/HilbertCurve2D_Adaptive.cpp
#include "HilbertCurve2D_Adaptive.h" #include <string> #include <algorithm> /*nth_element*/ #include <functional> /*ref*/ #include <iterator> #include <thread> #include <math.h> /*ceil*/ #include <unordered_map> #include <queue> #include <set> #include<iostream> HilbertCurve2D_Adaptive::HilbertCurve2D_Adaptive(std::v...
ALGO
0.99996
4.499987
0eeaa9d5-7f9f-45fc-8502-6ba08340d7f7
ahmedmostafa-cell/Dr-Mostafa-Sad-DataStructure-Course-Problems-Solutions
Trie/Easy/5.cpp
// ConsoleApplication6.cpp : This file contains the 'main' function. Program execution begins and ends there. // #include <iostream> #include <vector> #include <map> using namespace std; class Trie { private: map<string, Trie*> child; bool isleaf{}; public: void insert(const vector<str...
ALGO
0.998375
5.263498
adc47080-07ce-4a81-b4f8-51e8eef943aa
yashvitankar27/CODSOFT
tic_tac_toe.cpp
#include <iostream> #include <vector> #include <cctype> using namespace std; const char EMPTY = ' '; const char PLAYER_X = 'X'; const char PLAYER_O = 'O'; void initializeBoard(vector<char>& board) { for (int i = 0; i < 9; i++) { board.push_back(EMPTY); } } void displayBoard(const vector<char>& board...
ALGO
0.999225
6.897129
ae8999f2-504d-410d-b237-4cf097c8ca88
ishandutta2007/codeforces
pointy/normal/1493/B.cpp
#include<bits/stdc++.h> using namespace std; #define ll long long #define mem(x) memset(x,0,sizeof(x)) //const ll inf=1000000000000000000; const int N=100001; int n,m,T; int a[N]; inline int read() { char C=getchar(); int F=1,ANS=0; while (C<'0'||C>'9') { if (C=='-') F=-1; C=getchar(); } while (C>='0'&&C...
ALGO
0.998213
4.099776
8f5fc298-3a37-48a7-8e09-987dc569dca6
mario8705/cpp-module-09
ex02/main.cpp
#include "PmergeMe.hpp" #include <iostream> int main(int argc, char* argv[]) { PmergeMe pmergeMe; double a, b; if (argc < 2) return 0; if (!pmergeMe.LoadSequence(argc - 1, argv + 1)) return 1; pmergeMe.PrintSequence(std::cout, "Before: "); pmergeMe.Sort(a, b); pmergeMe.Pri...
ALGO
0.975003
4.27785
ac922526-2861-4058-ad40-afbcbe5494c5
benjaminva/TC2037-Methods
Concurrent programs/example deadlock solved.cpp
#include<iostream> #include<mutex> #include<thread> std::mutex m1; std::mutex m2; void thread1() { std::cout << "1. Acquiring m1." << std::endl; std::this_thread::sleep_for(std::chrono::milliseconds(100)); m1.lock(); std::cout << "1. Acquiring m2" << std::endl; m2.lock(); m1.unloc...
ALGO
0.959286
4.483162
15705535-c266-4ed2-8b64-746c2fdf9212
Shadikul-Islam/Programming-Contest-Data-Structure-And-Algorithm
Chapter_2/No.16__Onushiloni_Ascending (Page 28).cpp
/** No.16__Onushiloni_Ascending (Page 28).cpp তিনটি সংখ্যা ইনপুট নিয়ে তাদের ছোটো হতে বড় অনুসারে প্রিন্ট কর। Purpose: Solve the book "Programming Contest, Data Structure And Algorithm" by Md. Mahbubul Hasan" @author: Md. Sadikul Islam Shuvo */ #include<bits/stdc++.h> using namespace std; int ma...
ALGO
0.999911
3.935376
4a76b09d-0347-4bf4-85e5-1f024afe321e
Sakenkz118/Cplusplus
Ch4.Pr.Ex.22 (8th edition).cpp
#include <iostream> using namespace std; int main () { int number; /* test number, except 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, and 31 */ cout << "Enter positive integer between 1 and 1000 (inclusive): "; cin >> number; cout << endl; // Warning messages if (number < 0) cout << "Ent...
ALGO
0.998426
3.832048
9b3836d2-f2e9-47a1-b4e9-765bc1d59ae8
hi-ogawa/practice
codechef/DEC20/DGMATRIX/main.cpp
// WIP #include <bits/stdc++.h> using namespace std; #define ALL(X) (X).begin(), (X).end() #define FOR(I, X, Y) for (auto I = decltype(Y)(X); I < (Y); ++I) using ll = int64_t; using ull = uint64_t; namespace std { template<class ...Ts> istream& operator>>(istream& i, tuple<Ts...>& x) { apply([&](auto&&.....
ALGO
0.99996
3.764548
c77831b9-e4c3-4ccd-9927-993ec8cb93c3
sehajs5/Data-Structures-and-Algorithms
pointerfunc.cpp
#include<iostream> using namespace std; void print(int *p){ cout<<"Value : "<<*p<<endl; cout<<"Address: "<<p<<endl; } void update(int *p){ *p = *p+1; } int sumArr(int *arr, int size){ int i=0,sum=0; cout<<"Size of pointer"<<sizeof(arr)<<endl; for(i;i<size;i++){ sum+=arr[i]; } ret...
ALGO
0.998422
4.713934
e2615a55-1955-410f-9d6f-90e7acf053a9
codemonkeyricky/lc
2437.cpp
#include <iostream> #include <vector> #include <cassert> #include <stack> #include <queue> #include <algorithm> #include <unordered_map> #include <unordered_set> #include <map> #include <set> #include <bitset> #include <numeric> #include <cmath> using namespace std; struct TreeNode { int val; TreeNode *left; ...
ALGO
0.999503
4.496101
f520a88b-6cdc-4033-bcff-9185c9ff0f6f
ishandutta2007/codeforces
huah/normal/1517/E.cpp
#include <bits/stdc++.h> typedef unsigned long long ull; typedef long long ll; #define inf 0x3f3f3f3f #define rep(i, l, r) for (int i = l; i <= r; i++) #define nep(i, r, l) for (int i = r; i >= l; i--) void sc(int &x) { scanf("%d", &x); } void sc(int &x, int &y) { scanf("%d%d", &x, &y); } void sc(int &x, int &y, int &z...
ALGO
0.999927
3.702878
a162cc66-d574-4f29-8b08-17a9bd8c6414
Chanmi0205/c
multiplication_table_2.cpp
#include <stdio.h> main ( ) { int a, b; for ( a=2; a<=9; a++ ) { for ( b=1; b<=9; b++ ) { printf ("%d * %d = %d\n", a, b, a*b); } } }
ALGO
0.992988
3.148149
fb82bd60-883e-4149-a2d7-ea5bca3fbfee
ishandutta2007/codeforces
reyna/normal/721/A.cpp
// In the name of God #include <iostream> #include <algorithm> #include <fstream> #include <vector> #include <deque> #include <assert.h> #include <queue> #include <stack> #include <set> #include <map> #include <stdio.h> #include <string.h> #include <utility> #include <math.h> #include <bitset> #include <iomanip> usin...
ALGO
0.999839
3.4893
fe6bd7d8-7277-47e9-b23e-5934fc1221c5
ishandutta2007/codeforces
bicsi/normal/609/A.cpp
#include <bits/stdc++.h> using namespace std; int A[500000]; int main() { int n, buzz; cin>>n>>buzz; for(int i=1; i<=n; i++) { cin>>A[i]; } sort(A+1, A+n+1); int sum = 0; for(int i=n; i>=1; i--) { sum += A[i]; if(sum >= buzz) { cout << n-i+1; ...
ALGO
0.99992
3.894804
5f3fd3ab-cf86-483f-a32b-810eba37ab52
TotallyNotAB0t/MathExtrusion
Extrusion/ThirdParty/openal-soft/alc/effects/fshifter.cpp
#include "config.h" #include <cmath> #include <cstdlib> #include <array> #include <complex> #include <algorithm> #include "al/auxeffectslot.h" #include "alcmain.h" #include "alcontext.h" #include "alu.h" #include "alcomplex.h" namespace { using complex_d = std::complex<double>; #define HIL_SIZE 1024 #define OVERS...
ALGO
0.949794
6.251162
2638aa32-ce27-4ea0-b0dd-9ba971c0670d
Anonymous314159265358/FlightBench
benchmarks/benchmark_ego-planner/uav_simulator/so3_quadrotor_simulator/include/ode/libs/numeric/odeint/examples/heun.cpp
#include <iostream> #include <boost/fusion/container/vector.hpp> #include <boost/fusion/container/generation/make_vector.hpp> #include <boost/array.hpp> #include <boost/numeric/odeint.hpp> namespace fusion = boost::fusion; //[ heun_define_coefficients template< class Value = double > struct heun_a1 : boost::array<...
ALGO
0.999796
6.92598
b8d01b62-0a64-40a8-b100-1a82cd8a41ec
Areandra/Praktikum
Modul5/main.cpp
#include <iostream> using namespace std; const int MAX_SIZE = 100; class Stack { private: int top; int data[MAX_SIZE]; public: Stack() { top = -1; } bool isEmpty() { return top == -1; } bool isFull() { return top == MAX_SIZE - 1; } void push (int va...
ALGO
0.998119
5.126804
d5fa0307-4fe8-4bf1-b074-cc56e0dabc8b
CodeCamper-Sub/Problem_Solving
codeforce/Codeforces Round (Div. 2)/848/B/main.cpp
#include <bits/stdc++.h> #define INF 999999999999 typedef long long ll; using namespace std; ll T; int main() { ios_base::sync_with_stdio(false); cin.tie(0); cin >> T; while(T--) { ll n, m, d; cin >> n >> m >> d; vector<ll> p(n), a(m); vector<ll> pos; for(ll i =...
ALGO
0.999969
4.845828
f1fdd293-6b60-4920-bf68-45b35552e4ba
Stock44/TC2038
A01197991-A00830475_Act4.3/main.cpp
/** * Actividad 4.3 Implementación Polígonos Convexos aplicando geometría computacional. * Hiram Maximiliano Muñoz Ramirez A01197991 * Angel Rigoberto García García A00830475 * * This program implements an algorithm to determine the smallest convex polygon that surrounds * set of points by applying the Graham's S...
ALGO
0.999951
6.933971
fe60e50f-ecf5-40a5-bf80-4ae9cafe8d47
TheAlgorithms/C-Plus-Plus
others/pascal_triangle.cpp
/** * @file * @brief Pascal's triangle implementation */ #ifdef _MSC_VER #include <string> // required for Visual C #else #include <cstring> #endif #include <iomanip> #include <iostream> /** * Print the triangle * \param [in] arr 2D-array containing Pascal numbers * \param [in] n depth of Pascal triangle to...
ALGO
0.983855
7.161383
6a68153d-b7fa-4f1a-8bf5-4a45903e6148
Deserve82/KK_Algorithm_Study
Keonwoo/BOJ_12100_2048.cpp
#include <iostream> #include <algorithm> #include <vector> using namespace std; int n; int map[20][20]; // ִ int answer = 0; // , , Ʒ, const int dy[] = { 0, 0, 1, -1 }; const int dx[] = { 1, -1, 0, 0 }; // Ž Ϸ ڷ ޾ƿͼ answer void renew(int map[][20]) { int check_max = 0; for (int i = 0; i < n; i++) { for (in...
ALGO
0.999958
4.016429
f831f9cf-96db-42b8-8822-41487bd6dd01
talas/OpenJK-OJP
codemp/qcommon/huffman.cpp
/* This is based on the Adaptive Huffman algorithm described in Sayood's Data * Compression book. The ranks are not actually stored, but implicitly defined * by the location of a node within a doubly-linked list */ #include "qcommon/qcommon.h" static int bloc = 0; void Huff_putBit( int bit, byte *fout, int *off...
ALGO
0.999205
4.607492
a5c1252b-c61a-4b7e-82c7-60e4d4b12e46
MilanFan/CC150
Ch05 Bit Manipulation/5.5.cpp
/* * 5.5.cpp * * Write a function to determine the number of bits required to convert integer A to integer B * * Created on: Mar 31, 2015 * Author: Milan Fan */ #include <iostream> using namespace std; int main() { int a, b; int count = 0; cin >> a >> b; for (int c = a ^ b; c > 0; c = c >> 1) { ...
ALGO
0.999954
4.826636
4c7e0cf1-fef9-4cc7-be34-5bc3e1a5c883
UpamanyuRoyChowdhury/LeetCode_Problems
diagonalSort.cpp
class Solution { public: vector<vector<int>> diagonalSort(vector<vector<int>>& mat) { int m = mat.size(); int n = mat[0].size(); // Sort diagonals starting from the topmost row for (int i = 0; i < m; i++) { sortEachDiagonal(mat, i, 0); } // S...
ALGO
0.999966
6.753548
697e5387-b8a0-46f0-8a77-4d819314c3c8
bugggggggg/AlgorithmTemplate
线段树.cpp
struct SegmentTree { #define ls p << 1 #define rs ls | 1 int sum[100066 * 16]; int w[100066 * 16]; void build(int p, int l, int r) { if (l == r) { sum[p] = vec[l - 1].first; w[p] = 1; return ; } int mid = (l + r) >> 1; build(ls, l, mid); build(rs, mid + 1, r); sum[p] = sum[ls] + sum[rs]; w[...
ALGO
0.999835
3.825603
d827de51-9f1d-40bd-bd95-2953d9922851
blackbird2003/acm_cpp
2022PreSummer_Graph_S_BiGraph.cpp
// // Created by vv123 on 2022/4/12. // #include <bits/stdc++.h> using namespace std; const int N = 2e6 + 10; int n1, n2, m, match[N], book[N]; vector<int> g[N]; int find(int u) { for (auto v:g[u]) { if (!book[v]) { //book数组在对每一个男主开启dfs前都会清零,表示在本次尝试中,这名女主是否已经被别人(别人既可能是main里的u也可是递归产生的u),当前的u只能从被book剩下的当中选(这...
ALGO
0.999721
4.630802
036f4022-5dd7-4082-9256-7f2cc7d75ea1
nazmul-1117/DSA
Pointer/Reference-Variable-Basic.cpp
#include <bits/stdc++.h> using namespace std; void arrayPass(/*int (&arr)[5]*/ int* arr){ arr[0] = 10; cout << &arr << endl; } void updateData(int& c){ c = 10; } int32_t main(){ int a = 5; int& b = a; ++a; cout << "Before Update Call: \n"; cout << "a = " << a << endl; cout << "b = "...
ALGO
0.867208
3.519982
44f9991a-0097-4d3b-856f-1d40b7c6e680
Gabordlr/C-Files-and-Examples
C++/Tec/5to Semestre/mazes/mazeTest.cpp
#include <iostream> #include <vector> using namespace std; // Define the dimensions of the maze const int rows = 6; const int cols = 6; // Define possible moves (up, down, left, right) const int dx[] = {0, 0, -1, 1}; const int dy[] = {-1, 1, 0, 0}; // Function to check if a cell is valid bool isValid(int x, int y, ...
ALGO
0.999992
6.586232
ca64df96-5059-4437-9862-71ecc523d9aa
remote-android/platform_external_mesa3d
src/intel/compiler/brw_vec4_live_variables.cpp
#include "brw_cfg.h" #include "brw_vec4_live_variables.h" using namespace brw; /** @file brw_vec4_live_variables.cpp * * Support for computing at the basic block level which variables * (virtual GRFs in our case) are live at entry and exit. * * See Muchnick's Advanced Compiler Design and Implementation, section ...
ALGO
0.916012
7.249859
2479016c-fba7-473e-a13b-2a95c4d20453
ANISHAGHOSHAL/Leetcode-solution
0857-minimum-cost-to-hire-k-workers/0857-minimum-cost-to-hire-k-workers.cpp
class Solution { public: double mincostToHireWorkers(vector<int>& quality, vector<int>& wage, int k) { int n=quality.size(); double sum=0, result=INT_MAX; vector<pair<double,int>> details; for(int i=0;i<n;i++){ details.push_back({wage[i]/(double)quality[i],quality[i]}); ...
ALGO
0.999971
5.008136
62852c2c-0833-4933-b6f5-4cf991f5d15d
TanmayeeMali/6companies30days
Walmart/Question2.cpp
class Solution { public: bool stoneGame(vector<int>& piles) { return helper(piles, 0, 0, 0, (int)piles.size() - 1, 0); } bool helper(vector<int>& piles, int cur0, int cur1, int left, int right, int player) { if (left > right) return cur0 > cur1; if (player == 0) { re...
ALGO
0.999991
5.033408
2d80f34b-eac9-4794-b24b-6a91bb17fa25
ishandutta2007/codeforces
rivalq/normal/1425/F.cpp
#include<bits/stdc++.h> #define rep(i,a,n) for(int i=a;i<n;i++) #define rep3(n) for(int i=0;i<n;i++) #define ll long long #define int long long #define pb push_back #define all(v) v.begin(),v.end() #define endl "\n" #define eb emplace_back #de...
ALGO
0.999946
3.035893
70eb8417-0db8-49f5-8041-6011c3698a95
Md-Minhajul-Islam/Codeforces
_Random/Mind_Control.cpp
#include<bits/stdc++.h> using namespace std; typedef long long int ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef vector<int> vii; typedef vector<ll> vll; typedef long double ld; #define fi first #define se second #define pb push_back #define yes cout << "YES\n" #define no cout << "NO\n" #ifndef ON...
ALGO
0.999943
4.142415
3b64ffe8-4c51-49ff-937c-dbb8527a9e3f
Tessarvo/Artillery-Genius-MKS-SGen-L-V2
Marlin/src/lcd/fontutils.cpp
/** * @file fontutils.cpp * @brief help functions for font and char * @author Yunhui Fu (<EMAIL>) * @version 1.0 * @date 2016-08-19 * @copyright GPL/BSD */ #include "../inc/MarlinConfig.h" #define MAX_UTF8_CHAR_SIZE 4 #if HAS_WIRED_LCD #include "marlinui.h" #include "../MarlinCore.h" #endif #inc...
TOOL
0.907405
5.779163
2caddc36-fa06-4ebf-8b63-37af1529d73c
MoKee/android_frameworks_av
media/libaudioprocessing/AudioResamplerDyn.cpp
#define LOG_TAG "AudioResamplerDyn" //#define LOG_NDEBUG 0 #include <malloc.h> #include <string.h> #include <stdlib.h> #include <dlfcn.h> #include <math.h> #include <cutils/compiler.h> #include <cutils/properties.h> #include <utils/Debug.h> #include <utils/Log.h> #include <audio_utils/primitives.h> #include "AudioRe...
TOOL
0.859018
6.649372
18a0eb2b-7232-4386-bde1-573e364bc2a3
ShivaanjayNarula/LeetCode
0300) Longest Increasing Subsequence.cpp
class Solution { public: int lengthOfLIS(vector<int>& nums) { int n = nums.size(); if(nums.empty()) { return 0; } vector<int> ans(n, 1); for(int i = 1; i < n; i++) { for(int j = 0; j < i; j++) { if(nums[i] > ...
ALGO
0.999989
6.19131
6d8f81c7-c553-4982-9f64-27162e0469c4
andsve/pxf
Libraries/Box2D/sdk/src/b2PolygonContact.cpp
#include <Box2D/Dynamics/Contacts/b2PolygonContact.h> #include <Box2D/Common/b2BlockAllocator.h> #include <Box2D/Collision/b2TimeOfImpact.h> #include <Box2D/Dynamics/b2Body.h> #include <Box2D/Dynamics/b2Fixture.h> #include <Box2D/Dynamics/b2WorldCallbacks.h> #include <new> b2Contact* b2PolygonContact::Create(b2Fixtur...
ALGO
0.991142
7.24547
641119fd-9466-4fbc-99bd-81bd4168817e
devlooploop/CppProjectsAndCode
C++_Course_Projects/03-Programming Using C++ - Level 1/HomeWork_Lesson_20-7-Arithmetic Operators/Problem-17_Triangle Area.cpp
// Problem-17_Triangle Area.cpp #include <iostream> using namespace std; int main() { float h, a, area; cin >> a; cin >> h; area = (a / 2 ) * h; cout << "\n" << area; return 0; }
ALGO
0.979222
3.776581
3baaa69c-00df-4324-9080-49408f200e3c
arkayyy/leetcode-problems
1673-find-the-most-competitive-subsequence/1673-find-the-most-competitive-subsequence.cpp
class Solution { public: vector<int> mostCompetitive(vector<int>& nums, int k) { vector<int> stack; int nums_to_delete = nums.size()-k; for (int i = 0; i < nums.size(); i++) { while (!stack.empty() && nums[i] < stack.back() && nums_to_delete) { stack.pop_back(); ...
ALGO
0.999999
6.234002
8da61783-565c-4a85-abb8-583541adf2fc
Divyanshu9794/GFG_POTD
Difficulty: Basic/Search a node in BST/search-a-node-in-bst.cpp
bool search(Node* root, int val) { while (root != NULL) { if (root->data == val) { return true; } else if (val < root->data) { root = root->left; } else { root = root->right; } } return false; }
ALGO
0.999876
3.328526
00416d37-ce41-4601-a791-d8f5e07ee507
m-talha/Self-Driving-Car-Udacity
P7-Path-Planning-Project/src/Eigen-3.3/bench/benchCholesky.cpp
// g++ -DNDEBUG -O3 -I.. benchLLT.cpp -o benchLLT && ./benchLLT // options: // -DBENCH_GSL -lgsl /usr/lib/libcblas.so.3 // -DEIGEN_DONT_VECTORIZE // -msse2 // -DREPEAT=100 // -DTRIES=10 // -DSCALAR=double #include <iostream> #include <Eigen/Core> #include <Eigen/Cholesky> #include <bench/BenchUtil.h> using na...
TEST
0.989523
5.938015
56d53767-a0ed-4d41-8fd6-70862f648bde
Slimani-amin/Problem-Solving
328.odd-even-linked-list.cpp
/* * @lc app=leetcode id=328 lang=cpp * * [328] Odd Even Linked List */ // @lc code=start /** * 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, ListN...
ALGO
0.999823
6.046181
7ba412cd-1888-4f0f-84e2-7a96d9a7a16c
mlcommons/hpc_results_v2.0
NVIDIA/benchmarks/oc20/implementations/pytorch/cugraph-ops-binding/torch_extension.cpp
#include "torch_utils.hpp" #include <cugraph-ops/dimenet/agg_edge_to_edge.hpp> #include <cugraph-ops/dimenet/radial_basis.hpp> #include <pybind11/pybind11.h> #include <torch/torch.h> #include <tuple> #include <vector> namespace torch_extension { static constexpr int NUM_RADIAL = 6; static constexpr int NUM_SPHERI...
DATA
0.896116
7.353121
a9093ba0-cf9e-4c37-8d16-261f13d278d5
khabh/Algorithm
bfs/영역_구하기.cpp
#include <iostream> #include <queue> #include <vector> #include <algorithm> #define X first #define Y second using namespace std; int map[100][100] = {}; int M, N, K; int deltaX[4] = {0, 0, 1, -1}; int deltaY[4] = {1, -1, 0, 0}; int bfs(int a, int b) { queue<pair<int, int>> q; int count = 1; q.push({a, b}); while...
ALGO
0.999783
3.517526
9a02d25d-0111-46d4-a14c-47d936c4138a
gaurika27/Cpp_DSA_Codes
lec210_BT_IterativePreorderTraversal.cpp
class Solution{ public: vector<int> preOrderTraversal(TreeNode* root){ vector<int> preorder; if(root==NULL) return preorder; stack<TreeNode*> st; st.push(root); while(!st.empty()){ root=st.temp(); st.pop(); preorder.push_back(root->val); if(root->right!=NULL){ ...
ALGO
0.999967
6.032704
d7370d7f-247a-4683-8a7b-29413b758ce5
FloresSebastian23/ejercicios
g01,ej3/main.cpp
#include <iostream> using namespace std; /* 3 Unaconcesionaria deautos paga a los vendedores un sueldo fijo de $5000 ms $700 de premio por cada auto vendido. Hacer un programa que permita ingresar por teclado la cantidad de autos vendidos por un vendedor y luego informar por pantalla el sueldo total a pagar....
ALGO
0.945119
3.85394
fe282dd3-1c25-44d6-b354-9f82d2859a56
JuJangGwon/algorithm
back_2292.cpp
#include <iostream> using namespace std; int main() { int number; int i = 0; cin >> number; for(int sum=2; sum <= number; i++) { sum += 6*i; } if(number == 1) i=1; cout << i; return 0; }
ALGO
0.99918
3.110684
b8ac29fe-f630-4434-8e9b-e6c74f82a3fd
SehajMander/dsa_with_cpp
While loop/fullTrianglePattern_1.cpp
#include<iostream> using namespace std; int main(){ int n; cout<<"Enter the value of n(rows) : "; cin>>n; int i = 1; while(i<=n){ int space = n-i; //spaces while(space>0){ cout<<" "; space = space-1; } //numbers 1 to n i...
ALGO
0.999659
4.211423
2ecb96c9-24fa-4d06-a559-0fb835de1261
bhagvadgita/Leetcode
661-image-smoother/image-smoother.cpp
class Solution { public: vector<vector<int>> imageSmoother(vector<vector<int>>& img) { int rows=img.size(); int cols=img[0].size(); vector<vector<int>> result(rows,vector<int> (cols)); for (int i=0; i<rows; i++){ for (int j=0; j<cols; j++){ int sum=0; ...
ALGO
0.999088
6.780733
7cf17d8b-46ad-40c8-a4ac-776461cf1069
EECS-NTNU/gem5-dom
src/systemc/tests/systemc/misc/sim_tests/srlatch/nor.cpp
/***************************************************************************** nor.cpp -- Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15 *****************************************************************************/ /***************************************************************************** ...
ALGO
0.990628
6.382857
c347ef41-3bfb-4436-9201-9fcacdec8b86
MohitBishesh/logical_programming_cpp
print_even_bw_1_to_n.cpp
#include<iostream> using namespace std; int main() { int n; cin>>n; for(int i=2;i<=n;i++) { if(i%2==0) { cout<<i<<" "; } } return 0; }
ALGO
0.986673
3.465464
0f6cc463-d737-4fd8-b4ee-7c7bedeb5cab
JongZero/AlgorithmStudy
OneDay_OneAlgorithm/2-E-6.cpp
#include <bits/stdc++.h> using namespace std; int n; char a[65][65]; string quad(int sy, int sx, int size) { if (size == 1) return string(1, a[sy][sx]); char s = a[sy][sx]; for (int i = sy; i < sy + size; i++) { for (int j = sx; j < sx + size; j++) { if (s != a[i][j]) { size /= 2; string ret = "...
ALGO
0.99979
4.565484
a3816a3e-2a2f-4d3e-ae6a-1321ac67fdeb
liangkyle08/competitive-programming
CodeForces/all-possible-digits.cpp
#include <bits/stdc++.h> using namespace std; #define fi first #define se second const int MOD = 1e9+7; const int INF = (1<<30); const int ALP = 26; const long long LL_INF = (1LL<<60); const int MAX_N = 100; int T, N, P; int A[MAX_N + 5]; set<int> s; bool check(int add) { int L = -1; int R = -1; int sk...
ALGO
0.999955
4.271943
93cb4b78-a7c2-4ea0-ad16-a1719a57cb52
Shishank93774/LeetCode-Solutions
3108-minimum-cost-walk-in-weighted-graph/3108-minimum-cost-walk-in-weighted-graph.cpp
struct DSU{ vector<int> par, rnk, sz, cost; DSU(int n): par(n+1), sz(n+1, 1), rnk(n+1, 0), cost(n+1, INT_MAX) { for(int i = 0; i<=n; i++) par[i] = i; } int find(int i){ return par[i] == i? i: (par[i] = find(par[i])); } int merge(int i, int j, int w){ if((i = fin...
ALGO
0.999928
5.549758
ddfe3807-3a2f-4ce0-afd0-222482881388
seaify/poj-codes
1019/3961611_WA.cpp
#include<stdio.h> #include<math.h> int main() { long t; __int64 c,d,max,min,j,k,i; scanf("%ld",&t); while(t--) { scanf("%I64d",&i); min=sqrt(2*i-1.0/4)-1.5; max=sqrt(2*i-1.0/4)-0.5; for(j=min;j<=max;j++) if(j*j+j>2*i) break; j=j-1;printf("%I64d\n",j); c=j*(j+1); c=c/2; ...
ALGO
0.999103
3.331203
cb1e9782-8c01-4a09-abc6-5f1046a3191f
vinerdi/ConsoleApplication1445
ConsoleApplication1445.cpp
#include <iostream> #include <memory> #include <string> #include <vector> // 1: std::unique_ptr class Employee { public: Employee(const std::string& name, int id) : name(name), id(id) {} void display() const { std::cout << "Employee Name: " << name << ", ID: " << id << std::endl; } private: ...
TOOL
0.989916
5.38956
e015f5ad-6b86-4c02-84fe-3e8cd558296b
YuchanJung/ps
graph/union-find/[백준]20040. 사이클 게임/solution.cpp
#include <bits/stdc++.h> using namespace std; int n, m, a, b, res; int parent[500000]; int find (int x) { if (parent[x] == x) return x; return parent[x] = find(parent[x]); } void _union(int x, int y) { int px = find(x); int py = find(y); if (px > py) parent[px] = py; else parent[py] = px; } ...
ALGO
0.999971
4.657886
f873a880-3afe-4a17-8fec-d90db1ddf35c
Andreibatman/OOP
lab1/main2.cpp
#include <stdio.h> #include <string.h> #include <stdlib.h> #include <iostream> using namespace std; #define MAX_WORDS 100 #define MAX_LEN 100 int compare(const void *a, const void *b) { char *word1 = *(char **)a; char *word2 = *(char **)b; int len1 = strlen(word1), len2 = strlen(word2); if (len1 != le...
ALGO
0.999965
4.741238
1b3c1665-d9dd-4f88-9784-3c2c4e82fcb5
Rawat-Sagar/LOVE-BABBAR-450-DSA
longest_consecutive_subsequence(optimal).cpp
// Hash set is used , Time Complexity :O(n) // Space Complexity : O(n) // 5 4 3 2 1 // 5 -1 4 X // 4 -1 3 X // 3 -1 2 X // 2 -1 1 X // 1 -1 0 yes this is a way:) #include <bits/stdc++.h> using namespace std; int longestConsecutive(vector<int> &nums) { //{5,4,3,2,1}; std::set<int> hashS...
ALGO
0.999956
5.044432
d5e138e8-61a9-4144-ba99-58a7687fd3f6
Lalit-N97/learning-from-lc
lc-1371.cpp
// https://leetcode.com/problems/find-the-longest-substring-containing-vowels-in-even-counts/ class Solution { public: /** void print(int *arr, int n){ for(int i = 0; i < n; i++) cout << arr[i] << " "; cout << "\n"; } bool isOddFreqVovels(int vovelFreq[26]){ for(int i ...
ALGO
0.999783
6.20584
35477d32-5d77-4c3d-9e2a-cd178b8e542d
AlessandroS01/thesis-polimarche
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.998784
6.761023
9f245b79-b22e-4467-abb0-9a0afb73dbfe
Riki-Coddee/Data-Structure-Algorithm
graph/topologicalSort.cpp
#include<iostream> #include<algorithm> #include<vector> #include<queue> #include<set> #include<stack> #include<string> #include<map> using namespace std; #define vi vector<int> #define vvi vector<vi> #define pii pair<int,int> #define vii vector<pii> #define rep(i,a,b) for(int i=a; i<b; i++) #define ff first #define ss...
ALGO
0.999997
3.95207
54109e63-f9cd-4b51-8ce8-b3b2aaa69f70
Pkataki/Problem_Solving
codeforces/9C.cpp
#include <bits/stdc++.h> using namespace std; vector<int> v; void gen(string s, int depth) { if(depth == 10) return; v.push_back(stoi(s)); gen(s + '1', depth+1); gen(s + '0', depth+1); } int main() { gen("1",0); //v.push_back(1000000000); sort(v.begin(),v.end()); int n; cin >> n; int ans = upper_bound(v.beg...
ALGO
0.999757
4.763293
70ca7a85-f7cc-4d6d-8976-27ddf98b7851
jessetsaoj/leetcode_practice_cpp
139_WordBreak.cpp
#include <string> #include <unordered_map> #include <vector> using namespace std; /* Success Runtime: 21 ms, faster than 42.86% of C++ online submissions for Word Break. Memory Usage: 14.7 MB, less than 21.91% of C++ online submissions for Word Break. #DP #Recursion #Memoization */ class Solution { public: bool...
ALGO
0.999403
6.110156
e230f4e9-76a6-432b-984f-6bd4e481cd96
HG-IMMORTALS/GFG-POTD
Easy/Check whether BST contains Dead End/check-whether-bst-contains-dead-end.cpp
//{ Driver Code Starts //Initial template for C++ #include<bits/stdc++.h> using namespace std; struct Node { int data; struct Node *left; struct Node *right; Node(int x){ data = x; left = NULL; right = NULL; } }; void insert(Node ** tree, int val) { Node *temp = NULL; if(!(*tree)) ...
ALGO
0.999727
5.287749
1e9d8668-bb76-47d3-80ec-8e3382d99a71
LSH3333/PS
baekjoon/1002.cpp
#include <iostream> #include <cmath> using namespace std; int n; int _x1, _y1, _x2, _y2; int _r1, _r2; // 두 점 사이 거리 구함 double CalculateDistance(int x1, int y1, int x2, int y2) { return sqrt(pow(x1-x2,2) + pow(y1-y2,2)); } int main() { cin >> n; for(int i = 0; i < n; i++) { cin >> _x1 >> _y1 ...
ALGO
0.999861
3.5192
2e3026f1-df7d-4bdc-ac34-1fabf2e9e7d4
hcx1-hp/ARX1
src/base/tools/cryptonote/BlockTemplate.cpp
#include "base/tools/cryptonote/BlockTemplate.h" #include "3rdparty/rapidjson/document.h" #include "base/crypto/keccak.h" #include "base/tools/cryptonote/BlobReader.h" #include "base/tools/Cvt.h" void xmrig::BlockTemplate::calculateMinerTxHash(const uint8_t *prefix_begin, const uint8_t *prefix_end, uint8_t *hash) { ...
ALGO
0.97372
6.070579
78518970-0c2b-45e0-b60e-f640c30eb197
asteroid5566/ZeroJudge
g217-A.成雙成對(pairs).cpp
// https://zerojudge.tw/ShowProblem?problemid=g217 #include <iostream> using namespace std; int main() { int i, t, n, pos[50001], neg[50001], max, temp; cin >> t; while (t--) { cin >> n; max = -1; for (i = 0; i < 50001; i++) pos[i] = neg[i] = 0; for (i = 0; i < n; i++) { cin >> temp; i...
ALGO
0.999987
4.350932
d545135f-8156-4b3c-9f7f-511d3ebfa067
qq143626/aseprite-v1.3.7
src/app/script/app_fs_object.cpp
#ifdef HAVE_CONFIG_H #include "config.h" #endif #include "app/app.h" #include "app/resource_finder.h" #include "app/script/luacpp.h" #include "app/script/security.h" #include "base/fs.h" namespace app { namespace script { namespace { struct AppFS { }; int AppFS_pathSeparator(lua_State* L) { const char sep[2] = {...
TOOL
0.879114
6.813964
ae49a78e-8268-44e4-83c3-ef3d6990d1ff
prateek1802/Codechef
temple_land.cpp
#include<iostream> using namespace std; int c1(int arr[],int n) { if(n%2==0) return 0; else return 1; } int c2(int arr[],int n) { int s=0; if(n%2!=0) { for(int i=0;i<n/2;i++) { if((arr[i]+1)==arr[i+1]) { s++; } ...
ALGO
0.999881
3.832543
9d840c31-9773-4873-b3b0-ccafb04ee3a4
acc-cosc-1337-spring-2023/course-Otter2022
src/examples/02_expressions/01_expressions/expressions.cpp
/* Function operator_precedence_1 add the first two parameters and multiplies them with the third @param int num1 @param int num2 @param int num3 @return num1 + num2 / num3 */ /* Function operator_precedence_1 add the first two parameters and multiplies them with the third @param int num1 @param int num2 @param in...
TOOL
0.931703
4.420116
4b8b98ec-00e8-4beb-86c1-962b2d0e9a4d
duxingyi-charles/pattern-viewer
3rdparty/LearningQuadrangulationsCore/SCIP/soplex/spxdefaultrt.cpp
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* */ /* This file is part of the class library */ /* SoPlex --- the Sequential object-oriented simPlex. */ ...
ALGO
0.998466
5.999835
7648ca21-573f-4943-a522-0956729a3a55
user14159902/wasted_time
hopcroft-karp-matching.cpp
#include <bits/stdc++.h> class Matching { public: Matching(int left, int right) : adj_(left), distances_(left), left_(left), right_(right), match_left_(left, -1), match_right_(right, -1) { } inline void AddEdge(int from, int to) { adj_[from].emplace_b...
ALGO
0.999607
4.574084
f2fa7e6f-2b90-4825-81c8-fb8813481d87
sinian666/codes_102_2
cpp_副本32/chapter_graph/graph_adjacency_matrix.cpp
/** * File: graph_adjacency_matrix.cpp * Created Time: 2023-02-09 * Author: what-is-me (<EMAIL>) */ #include "../utils/common.hpp" /* 基于邻接矩阵实现的无向图类 */ class GraphAdjMat { vector<int> vertices; // 顶点列表,元素代表“顶点值”,索引代表“顶点索引” vector<vector<int>> adjMat; // 邻接矩阵,行列索引对应“顶点索引” public: /* 构造方法 */ ...
ALGO
0.999406
6.276136
0131f50c-4324-4211-9748-4a6470ac82c7
yashk9293/Aditya-Verma-Dynamic-Programming
37_Evaluate_expressionToTrue_memoization_usingMap.cpp
// Question Link :- https://www.geeksforgeeks.org/problems/boolean-parenthesization5610/1 // Boolean Parenthesization // (giving TLE) class Solution{ public: unordered_map<string, int> mp; int Solve(string& s, int i, int j, bool isTrue) { if (i > j) { return 0; } if (i == j) { ...
ALGO
0.999996
5.814287
7ec43e46-ac00-422c-b97e-9d4a3f7a0abe
sinian666/codes_102_3
cpp_副本37/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.999757
5.581266
5d3d5408-1653-4ec2-a26b-1e974a9d962f
hadigghazi/problem-solving-questions
gcd-strings.cpp
// Link of the problem on LeetCode: https://leetcode.com/problems/greatest-common-divisor-of-strings/description/?envType=study-plan-v2&envId=leetcode-75 class Solution { public: string gcdOfStrings(string str1, string str2) { if (str1 + str2 != str2 + str1) { return ""; } int ...
ALGO
0.999836
6.569629