uuid
stringlengths
36
36
repo_name
stringlengths
5
123
relative_path
stringlengths
5
4k
content
stringlengths
33
2.85M
category
stringclasses
6 values
algo_rel_score
float64
0.85
1
quality_score
float64
3
8.76
47b5f984-5571-4bc6-ab1a-d25fa163451b
injiiiiil/444
folly/settings/Settings.cpp
#include <folly/settings/Settings.h> #include <map> #include <folly/Synchronized.h> namespace folly { namespace settings { namespace detail { namespace { using SettingsMap = std::map<std::string, SettingCoreBase*>; Synchronized<SettingsMap>& settingsMap() { static Indestructible<Synchronized<SettingsMap>> map; r...
TOOL
0.938126
7.850245
951fe8be-dc6f-430b-a21b-4ae1263b8a94
samarth-thaker/Data-Structures-Algorithms
Searching/linearSearch.cpp
#include<iostream> using namespace std; int linearSearch(int arr[], int n, int key){ int i; for(i=0; i<n; i++){ if(arr[i] == key){ return i; } } return -1; } int main(){ int arr[] = {12, 13, 90, 0, 87, 34 }; int index= linearSearch(arr, 6, 87); cout<<inde...
ALGO
0.999864
4.689852
251d6c83-ca6f-4f3d-8492-deb1497ccfb2
b4ich3v/Introduction_to_programming_FMI
Seminars/Seminar. 13/exercise1.cpp
#include <iostream> int factorial(int number) { if (number < 0) { std::cout << "Error"; return -1; } if (number == 0) { return 1; } return number * factorial(number - 1); } int main() { std::cout << factorial(5); return 0; }
ALGO
0.998781
4.887361
69098579-6f09-457a-87a4-9dc36dc4897f
jeongukchoi/Algorithms
프로그래머스/2/12953. N개의 최소공배수/N개의 최소공배수.cpp
#include <vector> #include <algorithm> using namespace std; int GCD(int a, int b) { int m = max(a, b); int n = min(a, b); while (m % n != 0) { int r = m % n; m = n; n = r; } return n; } int solution(vector<int> arr) { int answer = 0; if (arr.size() < ...
ALGO
0.999949
5.311742
0ba142de-88f9-40e3-8e44-37601ce6603e
relaxcn/learn-cpp-primer
10ch/10_24.cpp
#include<string> #include<vector> #include<iostream> #include<functional> #include<algorithm> using namespace std; using namespace std::placeholders; bool check_size(const string &s, string::size_type sz) { return s.size() < sz; } int main() { vector<int> v{1, 7, 3, 4, 5, 6}; string s{"hello"}; auto w...
ALGO
0.996322
4.280685
871c0e26-cde6-4ee9-86a9-edbf46dec52c
Raynxxx/Contest
2014 多校训练/2014 多校 8/HDU 4952 Number Transformation.cpp
/* ** HDU 4952 Number Transformation ** Created by Rayn @@ 2014/08/25 */ #include <cstdio> #include <cstring> #include <cmath> #include <algorithm> using namespace std; typedef long long LL; LL x, k; int main() { #ifdef _Rayn freopen("in.txt", "r", stdin); #endif int cases = 0; while(scanf("%I64d%I64d", &...
ALGO
0.999983
3.586673
76f9eaf9-2a3c-4fe9-95c2-ac7ded2674db
AyushPandey003/Dsa
Extras/FindPairGivenDiff.cpp
// Given an array arr[] of size n and an integer x, return 1 if there exists a pair of elements in the array whose absolute difference is x, otherwise, return -1. // Example 1: // Input: // n = 6 // x = 78 // arr[] = {5, 20, 3, 2, 5, 80} // Output: // 1 // Explanation: // Pair (2, 80) have absolute difference of 78. ...
ALGO
0.999992
6.022014
f005229b-8772-4ba7-b547-f1cca3fb9e66
ErenDenek/C-and-Cpp
Pointer/Pointer-1.cpp
#include <iostream> using namespace std; int main() { int num = 10; cout << "Value of variables : " << num << endl; cout << "Address of variables : " << &num << endl; int* ptr; ptr = # cout << "Address that pointer ptr holds : " << ptr << endl; cout << "Content of the address pointer ptr holds : " << *ptr...
ALGO
0.986275
4.314097
2c4254c2-372c-450e-a5b1-06150aebf2a0
shishodiasaransh/DSA-problems
LinkedList_Insertion_deletion.cpp
#include <bits/stdc++.h> using namespace std; class Node{ public: int data; Node* next; Node(int data) { this->data=data; this->next=NULL; } }; void insertAtHead(Node* &head , int data){ Node* temp = new Node(data); temp->next=head; head=temp; } void printLL...
ALGO
0.999926
4.651853
1eed08e6-9e00-49e1-8efa-a45ddc037174
ishandutta2007/codeforces
ksun48/normal/1060/E.cpp
#include <bits/stdc++.h> using namespace std; typedef long long LL; vector<vector<int> > edges; LL ans = 0; vector<LL> cnt(2, 0); LL dfs(LL v, LL p, LL x){ cnt[x]++; LL sz = 1; for(LL a : edges[v]){ if(a == p) continue; sz += dfs(a, v, 1^x); } ans += sz * (edges.size() - sz); ...
ALGO
0.999748
4.563849
6aa64a88-60af-4984-a826-d6545dd20a03
tmdwns4949/cit_sju
20200704/factorial.cpp
#include <iostream> using namespace std; int main() { int a; int total; cin >> a; for (total = 1;a > 1; a--){ total *= a; } cout << total << endl; return 0; }
ALGO
0.99999
3.855962
8ce071fe-aeff-4b65-b993-721faf6d01aa
atharvac1301/LP5
test_bfs_dfs.cpp
#include <bits/stdc++.h> #include <omp.h> using namespace std; using namespace chrono; class Graph { int V; vector<vector<int>> adjMatrix; public: Graph(const vector<vector<int>> &matrix) { V = matrix.size(); adjMatrix = matrix; } void sequentialBFS(int source) { vector<bo...
ALGO
0.999828
6.263481
1c53386f-1225-4860-80b5-df7d5defe201
aman-codesss/recursion-2
reverse.cpp
#include<iostream> #include<string> using namespace std; void reverse(string& str,int i,int j){ cout<<str<<endl; if(i>j) return; swap(str[i],str[j]); i++; j--; reverse(str,i,j); } int main(){ string str ="aman"; int i=0; int j=str.length()-1; reverse(str,i,j...
ALGO
0.999506
3.17719
b02699c1-e302-4d1f-a9be-c1b712f45436
spsingh37/DROID_SAM2
thirdparty/DROID-SLAM/thirdparty/lietorch/eigen/doc/examples/Tutorial_simple_example_fixed_size.cpp
#include <Eigen/Core> #include <iostream> using namespace Eigen; int main() { Matrix3f m3; m3 << 1, 2, 3, 4, 5, 6, 7, 8, 9; Matrix4f m4 = Matrix4f::Identity(); Vector4i v4(1, 2, 3, 4); std::cout << "m3\n" << m3 << "\nm4:\n" << m4 << "\nv4:\n" << v4 << std::endl; }
ALGO
0.971859
3.129515
ba881eb2-1ba3-40cd-9b2a-502680864c87
Midas847/Competitive-Coding
LeetCode Submissions/jump-game/Time Limit Exceeded/7-30-2021, 10_10_13 PM/Solution.cpp
// https://leetcode.com/problems/jump-game class Solution { public: bool canJump(vector<int>& nums) { int n = nums.size(); int x; for(int i=0;i<nums.size();i=i+nums[i]){ x = nums[i]; } if(x==nums[n-1]) return true; else return fals...
ALGO
0.999994
6.120147
47709110-ab73-4abf-b567-aa123e66a7b6
tsteenbe/boost
libs/compute/example/print_vector.cpp
#include <iostream> #include <vector> #include <boost/compute/system.hpp> #include <boost/compute/algorithm/copy.hpp> #include <boost/compute/algorithm/iota.hpp> #include <boost/compute/container/vector.hpp> namespace compute = boost::compute; // this example demonstrates how to print the values in a vector int main...
TOOL
0.980349
3.46787
f45c785e-07a9-447e-b15e-7b16254858ad
rainerzufalldererste/hypersonic-rANS
src/block_rANS32x64_16w_decode.cpp
#include "block_rANS32x64_16w.h" #include "hist.h" #include "simd_platform.h" #include "block_codec64.h" #include <string.h> #include <math.h> ////////////////////////////////////////////////////////////////////////// template <uint32_t TotalSymbolCountBits, rans32x64_decoder_type_t Impl, typename hist_type> size_t...
ALGO
0.991265
6.807024
2822043a-4f92-4c61-a46f-ff906295272f
huzaifak08/AI-Text-Converter
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.998831
6.781479
5f8be92a-546a-4149-aa80-96dca430aec6
Dartpixel/Competitive-Coding
CODECHEF/PODIUM.cpp
#include <iostream> #include <math.h> #include <bits/stdc++.h> using namespace std; int main() { int testcase, a, b; cin >> testcase; while (testcase--) { cin >> a >> b; cout << a + b << endl; } return 0; }
ALGO
0.999341
5.01518
b37d874d-02c7-4039-9895-d5d31dd0aaa1
RaviTambade/TFLCPP
Solutions/CPP/Handson/TFLFirstCPPApp_1/TFLFirstCPPApp/bubbleSort.cpp
#include <stdio.h> #include <stdlib.h> #include<iostream> using namespace std; /* int main() { int a[10], i, j, num, n, mid, temp,k; cout << "enter size of array: "; cin >> n; cout << "enter elements in array: "; for (i = 0; i < n; i++) { cin>>a[i]; } //bubble sort logic for...
ALGO
0.999592
3.398521
13473774-756c-41e5-8156-be11dc1fd66f
ishandutta2007/codeforces
jonathanirvings/normal/1444/A.cpp
//start of jonathanirvings' template v3.0.3 (BETA) #include <bits/stdc++.h> using namespace std; typedef long long LL; typedef pair<int,int> pii; typedef pair<LL,LL> pll; typedef pair<string,string> pss; typedef vector<int> vi; typedef vector<vi> vvi; typedef vector<pii> vii; typedef vector<LL> vl; typedef vector<vl>...
ALGO
0.999771
4.291771
dcf706fa-9e08-466a-8cd5-7161a9972be7
behl1anmol/Problem-Solving
976-largest-perimeter-triangle/976-largest-perimeter-triangle.cpp
class Solution { public: int largestPerimeter(vector<int>& nums) { sort(nums.begin(), nums.end(), greater<int>()); int n = nums.size(); int ans = 0; for(int i=0;i<=n-3;i++){ if(nums[i] < nums[i+1]+nums[i+2]){ ans = max(ans, nums[i]+nums[i...
ALGO
0.999827
5.383647
9da00133-6691-492f-9973-c09518d8b0ae
pikpik/minix-pkgsrc
games/crimsonfields/patches/patch-src_cf_path.cpp
$NetBSD$ The inline violates the ODR rule for Path. --- src/cf/path.cpp.orig 2012-11-05 17:03:05.000000000 +0000 +++ src/cf/path.cpp @@ -212,7 +212,7 @@ short Path::Find( const Unit *u, const P // RETURNS : estimated cost to destination //////////////////////////////////////////////////////////////////////// -...
ALGO
0.998623
6.177892
7c47c874-3fa7-4a76-90ea-94352f76f828
Prerit73/cipher
Assignment2/dynamic_array.cpp
#include <iostream> using namespace std; int main() { int n; cout << "Enter number of elements" << endl; cin >> n; int *a = new int[n]; for (int i = 0; i < n; i++) { cin >> a[i]; } cout << "Entered elements are "; for (int i = 0; i < n; i++) { cout << a[i] << " "...
TOOL
0.929526
3.343548
0edce915-25ce-4e2f-ad9a-75bff332f6f4
Merci24Dec/unitech_cpp_with_oops-course
programs_AtoZ/Generate Armstrong Numbers/in_Given_Range.cpp
// C++ Print Armstrong Numbers in Given Range #include<iostream> using namespace std; int main() { int first, last, temp, noOfDigit, num, res=0, rem, pow, i; cout<<"Enter the Interval: "; cin>>first>>last; cout<<"\nArmstrong Number(s) Between "<<first<<" and "<<last<<endl; while(first<=last) { ...
ALGO
0.999412
4.98734
f9492302-66bb-44ac-bcc6-68001b7137b2
Ayush8165/HackerRank-Problem_Solving_Solution
2. Simple array sum/solution.cpp
#include <bits/stdc++.h> using namespace std; string ltrim(const string &); string rtrim(const string &); vector<string> split(const string &); /* * Complete the 'simpleArraySum' function below. * * The function is expected to return an INTEGER. * The function accepts INTEGER_ARRAY ar as parameter. */ int simp...
ALGO
0.999545
6.42351
052f1ab4-138b-42f2-a9cf-1fabbc2304e2
Rohanchhotu/c-plus-plus-program
invented.cpp
#include<iostream> using namespace std; int main(){ int n; cin >> n; for (int i; i <= n;i++){ for (int j = 1; j <= n + 1 - i; j++){ cout<<j<< " "; } cout << endl; } return 0; }
ALGO
0.999706
3.622556
460d8b5b-619f-4303-9154-31743d7edf31
cohhei/code
abc/misc/tsp.cpp
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; using P = pair<int, int>; const int MAX_N = 15; int dist[MAX_N][MAX_N]; // dist[i][j] i から j への距離 // dp[i][j]: 状態iでjにいるときの最短経路 // 状態iはビットで管理: 00011->点0と点1は通貨済 int dp[1 << MAX_N][MAX_N]; int n, m; const...
ALGO
0.999906
4.41609
abdbd65f-2af3-4910-b909-1dd68bf01e96
lisa31419/Estructura-de-Dades
SolucioExercicisC++/Exercici5.cpp
#include <iostream> using namespace std; int main() { cout << "Enter your years into the enterprise"; int years; double s = 40000.; cin >> years; if(years > 10){ s *= 1.1; }else if(years > 5){ s *= 1.07; }else if(years > 3){ s *= 1.05; }else{ s *= 1.0...
ALGO
0.998471
3.670963
a2c539da-606f-4ae8-b2bd-fabb196c9e73
sarvex/leetcode-vala
solution/1900-1999/1967.Number of Strings That Appear as Substrings in Word/Solution.cpp
class Solution { public: int numOfStrings(vector<string>& patterns, string word) { int ans = 0; for (auto& p : patterns) { ans += word.find(p) != string::npos; } return ans; } };
ALGO
0.99984
5.975692
84c30b8c-eb68-4c08-a191-1af24a6b05b3
HnpawsPham/CP-PROBLEMS
UIT/Bootcamp2024/H-INDEX.cpp
#include <bits/stdc++.h> #define el "\n" using namespace std; using ll = long long; int n; int main(){ ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); cin>>n; int a[n]; int res = 0; for(int i = 0; i<n;i++){ cin>>a[i]; } sort(a, a + n, greater<int>()); for(int i = 0...
ALGO
0.999901
4.055917
75ddbcbb-db68-40fc-b0d7-f6075657e313
buckydebugs/Leetcode
Binary Search Trees/Medium_Construct_Binary_Search_Tree_from_Preorder_Traversal_Optimal.cpp
/* Given an array of integers preorder, which represents the preorder traversal of a BST (i.e., binary search tree), construct the tree and return its root. It is guaranteed that there is always possible to find a binary search tree with the given requirements for the given test cases. A binary search tree is a binar...
ALGO
0.999996
6.950506
450756a9-e5ac-4091-84ae-2bd49598c201
EslamAsHhraf/Codeforces-practice
Gym/20152016-acmicpc-pacific-northwest-regional-contest-div-2/(O) Grid.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long char arr[500 + 9][500 + 9]; ll step[500 + 9][500 + 9]; ll dx[] = { 1 , 0 ,-1, 0 }; ll dy[] = { 0 , 1 ,0, -1 }; set<pair<ll, ll>> s; ll n, m, ti, tj; bool valid(ll i, ll j) { return(i >= 0 && i < n && j >= 0 && j < m); } int main() { ios_base::sync_wi...
ALGO
0.999918
4.434585
c3d2d253-08ad-4c16-9603-809c1828c4c8
VetementsEnvy/NYUCS_Bridge_2024
HW5/HW5/jz5880_hw5_q3.cpp
//#include <iostream> //using namespace std; //int printMonthCalender(int numOfDays, int startingDay) //{ // cout << "Mon\tTue\tWed\tThr\tFri\tSat\tSun" << endl; // for (int space = 0; space < (startingDay - 1); space++) // { // cout << '\t'; // } // for (int i = 1; i <= numOfDays; i++) // { //...
TOOL
0.996425
3.289186
aac3a5b9-fdf6-4c53-ada8-76d029c0bc79
saccdev12/utec-labs
eda-2do-semestre/contador/main.cpp
#include<iostream> using namespace std; int contador(int inicio, int fin){ if (inicio == fin){ return inicio; //caso base }else{ cout << inicio << endl; return contador(inicio+1, fin); //caso recursivo } } int main () { int inicio, fin; cout << "Ingrese valor inicial: "; cin >> inicio; cout << "Ingrese v...
ALGO
0.993676
4.051521
2a4c4188-fed7-442a-a35a-e5b85f553411
nazibur175/C-
C_Anji_s_Binary_Tree.cpp
#include<bits/stdc++.h> using namespace std; #define int long long #define mod 1000000007 #define test int t; cin>>t; while(t--) void solve(){ test{ int n; cin>>n; string s; cin>>s; vector<int>edges[n+9]; int cost[n+9]={0}; for(int i=1;i<=n;i++)...
ALGO
0.999816
4.518848
c9e668b6-5e39-4347-93f8-63b31bae6dd7
jk-jung/problem-solving
codeforces/Codeforces Round 31x/R318_div2_C.cpp
#include <cstring> #include <cstdio> #include <cmath> #include <cassert> #include <set> #include <map> #include <array> #include <stack> #include <queue> #include <vector> #include <numeric> #include <iostream> #include <algorithm> using namespace std; typedef long long ll; typedef pair<int, int> pi; typedef vector<i...
ALGO
0.999938
4.257256
884ad5bb-4181-4e10-8ddc-53129ad79689
mireskandari/Competitive-Programming
codeforces/584/A.cpp
#include <bits/stdc++.h> using namespace std; #define all(v) v.begin(),v.end() #define F first #define S second #define forn(x, y, z) for(int (z) = (x); (z) < (y); (z)++) typedef int64_t ll; int n, t; int main() { ios::sync_with_stdio(false);cin.tie(0);cout.tie(0); cin >> n >> t; if((t == 10 && n < 2)) { ...
ALGO
0.999452
3.700813
3af2675a-8614-476d-a42a-add4eb7f4a9e
fortyyearslater/My-Codes
P1947.cpp
#include <bits/stdc++.h> extern "C" int Seniorious(int) { } extern "C" int Chtholly(int n, int OvO) { int ans=1; for(int l=1,r=n,mid=(l+r)>>1;l<=r;mid=(l+r)>>1) { if (Seniorious(mid)>=0) { r=(ans=mid)-1; } else { l=mid+1; } } return ans; }
ALGO
0.999956
4.12802
32b5cd02-cc07-4851-9391-92a0f2e47eae
aaryan-00/Practice-Leetcode
1912-number-of-restricted-paths-from-first-to-last-node/1912-number-of-restricted-paths-from-first-to-last-node.cpp
class Solution { public: const int m=1e9+7; vector<int> dijkstra(int n,vector<vector<pair<int,int>>> &adj,int src) { priority_queue<pair<int, int>, vector<pair<int, int>>, greater<pair<int, int>>> pq; vector<int> dis(n, INT_MAX); pq.push({0, src}); dis[src] = 0; while...
ALGO
0.999989
5.097849
0b448c84-9e64-4a3d-b647-efc094d33143
SSGAalto/minionn
lib/minionnABY.cpp
#include "minionnABY.h" #include "minionnMath.h" ABYParty* party; void init_aby(string address, uint16_t port, bool role_is_server){ e_role role; if(role_is_server){ role = (e_role) 0; } else { // client role = (e_role) 1; } seclvl sl = get_sec_lvl(secparam); party = new ABYParty(role, (char*) add...
ALGO
0.97774
4.496856
aea0d3ec-6ac2-4c71-b85b-2158fb191eb4
alikgadzhiev/CP-Hackpack
Math/Z.cpp
using i64 = long long; using u64 = unsigned long long; using u32 = unsigned; template<typename T> constexpr T power(T a, u64 b) { T res {1}; for (; b != 0; b /= 2, a *= a) { if (b % 2 == 1) { res *= a; } } return res; } template<u32 P> constexpr u32 mulMod(u32 a, u32 b) { ...
ALGO
0.999827
5.085269
d8eb3873-7f66-453c-9be5-803de2356ef7
Milan318/cpp
Lab_Work_7.1/Q4.cpp
#include <iostream> using namespace std; int main(){ // 1 2 3 4 5 // 2 3 4 5 // 3 4 5 // 4 5 // 5 int i,j; for(i=1;i<=5;i++){ for(j=i;j<=5;j++){ cout << j ; cout << " " ; } cout << endl ; } }
ALGO
0.999826
3.010605
57a2dafe-498a-4d68-9c95-5fb0f9ba109c
KerakTelor86/AlgoCopypasta
source/07_Strings/01_Aho-Corasick.cpp
const int K = 26; struct Vertex { int next[K]; bool leaf = 0; int p = -1, ans = 0; char pch; int link = -1, mlink = -1; //magic link, is the link to find the nearest leaf int go[K]; Vertex(int p = -1, char ch = '$') : p(p), pch(ch) { fill(begin(next), end(next), -1); fill(begin(go), end(go), -1)...
ALGO
0.999967
3.955361
2e5f741f-94f2-468f-879d-3099967141da
LLNL/psuade
Src/Analysis/MomentAnalyzer.cpp
// ************************************************************************ // constructor // ------------------------------------------------------------------------ MomentAnalyzer::MomentAnalyzer() : Analyzer(), nSamples_(0), nGroups_(0), nInputs_(0), nOutputs_(0) { setName("MOMENT")...
ALGO
0.988166
3.960912
c0947a4a-46cc-4b87-979e-670b8f37ac2b
architcs12b1007/DSA
topo_bfs_kahn.cpp
#include<iostream> #include<unordered_map> #include<list> #include<vector> #include<queue> #include<stack> using namespace std; vector<int> TopologicalSortDFS(vector<vector<int>>& edges, int v, int e){ // create adjacency list unordered_map<int,list<int>> adj; vector<int> ans; for(int i=0;i<edge...
ALGO
0.99957
4.852244
a7489b1c-4eaa-4ff8-bd21-8884fbe1631d
kevcop/LinesOfAction
Game.cpp
//#include "Game.h" //#include "Player.h" //#include "HumanPlayer.h" //#include "ComputerPlayer.h" //#include "board.h" //#include <iostream> //#include <cstdlib> //#include <ctime> //#include <utility> //#include <map> //#include <vector> //using namespace std; ////used to keep track of moves //vector<string> moveLog;...
ALGO
0.952327
3.69762
93fd1be8-6751-450f-8486-4b1bcc1e6d36
amineAllache/llvm-bolt19
llvm/lib/IR/VFABIDemangler.cpp
#include "llvm/IR/VFABIDemangler.h" #include "llvm/ADT/SetVector.h" #include "llvm/ADT/SmallString.h" #include "llvm/ADT/StringSwitch.h" #include "llvm/IR/Module.h" #include "llvm/Support/Debug.h" #include "llvm/Support/raw_ostream.h" #include <limits> using namespace llvm; #define DEBUG_TYPE "vfabi-demangler" names...
TOOL
0.925409
7.928172
4b947f5b-9564-4ef0-b8be-fc8ef81facd9
HNU-ITEA-Official/10th_HNU_ITEA
pta/pta-a/a1045(twice).cpp
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int max_ ; cin >> max_ ; int n ; cin >> n ; vector<int> nums1(n) ; for(auto &x : nums1) cin >> x ; int m ; cin >> m ; vector<int> nums2(m) ; for(auto &x : nums2) cin >> ...
ALGO
0.999979
3.862777
b554f0d5-7d64-4ee9-b7ff-4c4f4b4f7f0e
akashgamage/F-Cal
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
8b3576c9-ca7e-4de9-96db-7f9b7e249a12
duny31030/My_road_of_ACM
计蒜客/The 2018 ACM-ICPC Chinese Collegiate Programming Contest/B.cpp
/* * ========================================================================= * * Filename: B.cpp * * Link: * * Version: 1.0 * Created: 2018/07/17 14时34分11秒 * Revision: none * Compiler: g++ * * Author: 杜宁元 (https://duny31030.github.io/), <EMAIL> * ...
ALGO
0.999595
3.973448
4e6c4668-bb00-424b-a4c3-436c5374094c
mdinmukhamet9/CapstoneProject
install/mpc_low/include/mpc_low/solver/acados_solver_holder.cpp
#include "acados_solver_holder.hpp" #include <iostream> #include <cmath> #include <algorithm> double normalize_angle(double angle) { while (angle > M_PI) angle -= 2.0 * M_PI; while (angle < -M_PI) angle += 2.0 * M_PI; return angle; } my_NMPC_solver::my_NMPC_solver(int n) { num_steps = n; Jackal_so...
ALGO
0.999695
3.638587
10419a6c-e2a3-4b8b-89c5-6f5df8c06b4d
LeviClark/EECS268
Lab09/MazeWalker.cpp
/** * @file MazeWalker.cpp * @author Levi Clark * @date 2015.11.13 * */ #include "MazeWalker.h" MazeWalker::MazeWalker(const char* const* mazePtr, int startRow, int startCol, int rows, int cols, Search searchChoice): m_curPos(Position(startRow, startCol)), m_startPos(Position(startRow, startCol)) { m_maze = mazePtr...
ALGO
0.983142
5.351923
7418a937-2074-4b4e-91fd-0643978040c2
ugeneunipro/ugene-old
src/corelibs/U2Algorithm/src/util_sarray/SArrayIndex.cpp
#include "SArrayIndex.h" #include "SArrayIndexSerializer.h" #include <U2Core/Log.h> #include <U2Core/Timer.h> #include <U2Core/U2SafePoints.h> #include <U2Core/DNASequenceObject.h> #include <QtCore/QFile> namespace U2 { CreateSArrayIndexTask::CreateSArrayIndexTask(const char* _seq, quint32 _size, quint32 _w, char ...
ALGO
0.85455
5.601521
41e5519d-4af0-44d2-b6df-c10a1fa173bf
ishandutta2007/codeforces
dorijanlendvaj/normal/1451/E2.cpp
//DUEL #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #define x first #define y second #define pii pair<int,int> #define pb push_back #define eb emplace_back #pragma GCC optimize("unroll-loops") #define shandom_ruffle(a, b) shuffle(a, b, rng) #define vi vector<int> #define vl vector<ll> #define popcn...
ALGO
0.999961
3.514343
11ae7f6f-20ce-47a4-9e96-42b4ad4302f7
leogeier/pt2ubungen
uebung2/dfa.cpp
#include <iostream> #include <string> #include <vector> #include <sstream> std::string step(std::string state, int value) { // Todo: Handle all possible states and values and return the respective new state // Note: Accepted coin values are {10, 20, 50}. if (state.compare("dispense") == 0)return state; switch (va...
ALGO
0.857533
5.623797
7016ddd5-f2a2-4961-ad78-dab2864de83f
openjdk/lilliput-jdk21u
src/hotspot/cpu/aarch64/macroAssembler_aarch64_log.cpp
#include "precompiled.hpp" #include "asm/assembler.hpp" #include "asm/assembler.inline.hpp" #include "macroAssembler_aarch64.hpp" // Algorithm idea is taken from x86 hotspot intrinsic and adapted for AARCH64. // // For mathematical background please refer to the following literature: // // Tang, Ping-Tak Peter. // Tab...
ALGO
0.977696
5.534327
536b9887-8e04-4f5e-8167-bbc30411b016
bijoybiswas21/DSA-Code-Help
CodeHelp-DSA-Busted-Series-main/CodeHelp-DSA/Lecture029 Dynamic Allocation (Part-2)/2dArray.cpp
#include <iostream> using namespace std; int main() { int row; cin >> row; int col; cin >> col; //creating a 2D array int** arr = new int*[row]; for(int i=0; i<row; i++) { arr[i] = new int[col]; } //taking input for(int i=0; i<row; i++) { for(int j=0; j<col; ...
ALGO
0.934301
4.176093
1d911db5-f99c-4311-8ff4-def3d0891080
hookflash/obsolete.opbb10
hookflash-libs/boost/libs/flyweight/example/perf.cpp
#include <boost/flyweight/flyweight.hpp> #include <boost/flyweight/hashed_factory.hpp> #include <boost/flyweight/set_factory.hpp> #include <boost/flyweight/static_holder.hpp> #include <boost/flyweight/simple_locking.hpp> #include <boost/flyweight/refcounted.hpp> #include <boost/flyweight/no_tracking.hpp> #include <boos...
TOOL
0.87532
7.711574
937f051c-39ff-4315-a7da-acd7b6b59098
poifull10/learn_optimize_rot
src/optimizer.cpp
#include <Eigen/Core> #include <Eigen/Geometry> #include <optimizer.h> #include <iostream> #include <numeric> namespace rot { static Eigen::MatrixXd StdVecToMat(const std::vector<float>& vec) { Eigen::MatrixXd mat(3, vec.size() / 3); for (size_t ic = 0; ic < vec.size() / 3; ic++) { mat(0, ic) = vec[ic * ...
ALGO
0.999874
6.750618
174fb6cd-602f-447e-94e4-0bb3778d2c20
TheAJ25/DSA_track
Two Sum II - Input Array Is Sorted.cpp
// Given a 1-indexed array of integers numbers that is already sorted in non-decreasing order, find two numbers such that they add up to a specific target number. Let these two numbers be numbers[index1] and numbers[index2] where 1 <= index1 < index2 < numbers.length. // Return the indices of the two numbers, index1 a...
ALGO
0.999993
6.616469
9bd8c3a4-64b1-4f96-9fcd-4e2d25f2b3fe
simX/d2x-xl
tags/v1.14.94/io/linux/findfile.cpp
#ifndef _WIN32 #ifdef HAVE_CONFIG_H #include <conf.h> #endif #include <string.h> #include <stdio.h> #include "cfile.h" #include "findfile.h" #include "error.h" int FileFindNext (FILEFINDSTRUCT *ffsP, int nFlags) { struct stat statBuf; struct dirent *deP; char szFile [FILENAME_LEN]; int i; while ((deP = ...
TOOL
0.928301
4.956767
6c744432-e7eb-472c-870c-f0c649ce5516
MizzzViolet/Computer-Vision
Assignment II/main.cpp
Mat geometric(Mat image, Mat masked){ // Perspective transformation Point2f source_points[4], destination_points[4]; int top = 0; int right = 0; int left = 0; for(int i = 0; i < image.rows; i++){ /*Go through the column of the image*/ for(int j = 0; j < image.cols;j++){ ...
ALGO
0.998116
3.316881
0d08e800-970a-4b32-b1a2-417a78487119
CryptoNeverSleeps/zodiac
src/rpcclient.cpp
#include "rpcclient.h" #include "rpcprotocol.h" #include "ui_interface.h" #include "util.h" #include <set> #include <stdint.h> #include <boost/algorithm/string/case_conv.hpp> // for to_lower() #include <univalue.h> using namespace std; class CRPCConvertParam { public: std::string methodName; //! method whose p...
CONFIG
0.979495
6.959157
7e80d0e3-bce6-45b9-9681-16a35366a89c
adi-paul-22/striver_sde
stock_buy_and_sell/2.cpp
#include<bits/stdc++.h> using namespace std; int maxProfit(vector<int> &arr){ int maxPro = 0; int n = arr.size(); int minPrice=INT_MAX; for(int i=0;i<n;i++){ minPrice = min(minPrice, arr[i]); maxPro = max(maxPro, arr[i] - minPrice); } return maxPro; } int main() { ...
ALGO
0.999775
6.179763
b3eb2404-6e6f-459f-861c-d9b1d804b726
Azzam-dev/event_management
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.998859
6.785645
f9b8050b-abca-43af-9b52-2a88c50466b6
CLDP/ACM-ICPC
Regional-2013/Europe-Northeastern/B.cpp
#include <vector> #include <cstring> #include <cstdio> #include <algorithm> #include <iostream> using namespace std; long double f[2][3005][2]; long double win[2]; int main() { freopen("bonus.in", "r", stdin); freopen("bonus.out", "w", stdout); long long a, b, n; cin >> n >> a >> b; if (a + ...
ALGO
0.999524
3.494964
90c97f63-c124-4f6e-b885-a7e2c529fdc3
shubhamthrills/Placement-Drive-Questions
MockVita/Solutions/Finding Product.cpp
#include<bits/stdc++.h> using namespace std; template <typename T> std::string to_string(const T& value) { std::stringstream ss; ss << value; return ss.str(); } vector<string> split(const string &s, char delim) { vector<string> elems; stringstream ss(s); string item; while (getline(ss, item, delim)) ...
ALGO
0.999788
3.817453
6339715d-f876-42fa-b6f9-9e866ae001ba
andreypostal/programming
URI/1301.cpp
#include <bits/stdc++.h> #define SIZE 400005 using namespace std; int t[SIZE]; int main() { int N, K, aux, a, b; char op; while (scanf("%d %d", &N, &K) != EOF) { for (int i = 0; i < N; i++) { scanf("%d", &aux); if (aux > 0) aux = 1; ...
ALGO
0.99963
3.492887
e87345d9-2209-47d4-a7de-c62d3cd10850
aryansinghsisodia3/C-basics
C++/10. Adv Patterns/rhombus.cpp
#include <iostream> using namespace std; int main() { int n; cout<<"Enter a Number: "; cin>>n; for (int i=1;i<=n;i++) { for (int j=1; j<=n-i; j++) { cout<<" "; } for (int j=1; j<=n; j++) { cout<<"*"; } cout<<endl; } retu...
ALGO
0.999438
3.942116
56230244-0197-40a6-97a6-bc536885276a
SayandeepB9/Codeforces
solved/1951E.cpp
#pragma GCC optimize("O3,unroll-loops") #pragma GCC target("avx2,bmi,bmi2,popcnt,lzcnt") // #pragma GCC target("avx2,sse4.2,bmi,bmi2,popcnt,lzcnt") #include <bits/stdc++.h> #define ll long long #define pb push_back #define int ll #define mod 998244353 #define inf 1e9+1 #define fr(i, a, b) for (ll i = a; i < b; i++) #de...
ALGO
0.99989
4.971001
9dd35b77-8d1f-4e11-9635-1765b2db787f
jheelamH/Cipher-Schools
lecture 17.cpp
#include <iostream> using namespace std; void PrintHi() { cout<<"HI"<<endl; return ; } int main() { PrintHi(); return 0; } #include <iostream> using namespace std; void PrintHi() { cout<<"HI"<<endl; return ; } int sum(int a,int b) { int c; c=a+b; return c; } int main() { PrintHi(); int a,b; a=4...
TOOL
0.973423
3.212302
52a89b33-1740-470a-8b95-aa191e819db7
tey-yong-zhun/vector
vector2/vector1d_auto/vector1d_auto.cpp
//This programme is use auto in loops for 1D vector #include <bits/stdc++.h> using namespace std; int main () { vector <int> nums = {1, 2, 3, 4, 5}; for (auto num : nums){ cout << num << " "; } }
ALGO
0.993655
3.975164
ebeb22ad-5be4-41ca-a1b9-0cc26e9f13e1
Mervan-Torlak/My_Recipes
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.998831
6.781479
59c78b50-e5ed-4b7f-a271-6c06cf8472ba
lukaskaibel/node-opencv-docker
opencv/samples/cpp/tutorial_code/calib3d/real_time_pose_estimation/src/PnPProblem.cpp
/* * PnPProblem.cpp * * Created on: Mar 28, 2014 * Author: Edgar Riba */ #include <iostream> #include <sstream> #include "PnPProblem.h" #include "Mesh.h" #include <opencv2/calib3d/calib3d.hpp> /* Functions for Möller-Trumbore intersection algorithm */ static cv::Point3f CROSS(cv::Point3f v1, cv::Point3f ...
ALGO
0.999396
6.170359
27452a30-f755-40e8-a6f5-ff8f38159ff7
MarcioMicro/beecrowd-cpp
Iniciante/Bee1005.cpp
#include <iostream> #include <iomanip> using namespace std; int main() { double A , B; cin >> A; cin >> B; cout << "MEDIA = " << fixed << setprecision(5) << A*3.5/11 + B*7.5/11 << endl; return 0; }
ALGO
0.999877
4.399071
d93b264a-1b4d-4e6e-b671-f900e3199786
aznszn/searchoverflow
build_lexicon.cpp
#include "stemminglib/english_stem.h" #include "utils/fetch_table.h" #include "inverted_index.h" //#include "utils/parseHTML.h" #define WORDS_IN_FILE 500 #define MAX_WORD_LEN 17 #define TAGS_IMP 4 #define TITLE_IMP 10 #define BODY_IMP 1 #define LINECAP 200 #define QBODY_COL 6 #define QTITLE_COL 5 #define ANSBODY_COL 5...
DATA
0.979164
3.632688
ab03a250-5b4e-42f2-bd92-ec2a9a77ae05
sarvex/leetcode-basic
solution/1600-1699/1610.Maximum Number of Visible Points/Solution.cpp
class Solution { public: int visiblePoints(vector<vector<int>>& points, int angle, vector<int>& location) { vector<double> v; int x = location[0], y = location[1]; int same = 0; for (auto& p : points) { int xi = p[0], yi = p[1]; if (xi == x && yi == y) ...
ALGO
0.999968
5.448708
3adf6fc2-51e4-4e37-9358-dd44e1a528f2
MariaChrysafis/CompetitiveProgramming
Codeforces/1132F.cpp
#include <vector> #include <iostream> #include <cmath> #include <cassert> #include <map> #include <algorithm> using namespace std; void print(vector<int> v) { for (int i: v) { cout << i << " "; } cout << endl; } void print(vector<long long> v) { for (long long x: v) { cout << x << ...
ALGO
0.999968
4.650792
d59cb135-6d1a-4054-90d2-2a3aee1b3ff4
abaddontsoi/2331-tutor-workspaces
tutor11/tut11/tut11/main.cpp
#include<iostream> #include<cstdlib> #include<string> #include<cstdio> #include<fstream> using namespace std; const int T_S = 200; const string noResult = "No result"; class HashTableEntry { public: int k; string v; HashTableEntry(int k, string v) { this->k= k; this->v = v; ...
ALGO
0.986879
4.770229
e870d20f-96d5-4d4c-95a7-eb205ff80dbb
sungzh/leetcode
LeetCode/124. Binary Tree Maximum Path Sum.cpp
//Given a binary tree, find the maximum path sum. // //For this problem, a path is defined as any sequence of nodes from some starting node to any node in the tree along the parent-child connections. The path must contain at least one node and does not need to go through the root. // //For example: //Given the below bi...
ALGO
0.999762
6.542301
545e5837-6df1-4462-b23e-c900bbc88d27
abhishek18124/PPCPPJanuary2024
Lecture 44/001DP_FibonacciNumbers.cpp
/* given a number n, find the nth fibonacci no. Example : Input : n = 7 Output : 13 */ #include<iostream> #include<vector> using namespace std; int cnt1 = 0; int fibo(int n) { cnt1++; // base case if (n == 0 || n == 1) { return n; } // recursive case return fibo(n - 1) + fibo(n - 2); } int cnt2 =...
ALGO
0.999909
5.370302
55b9fdf8-9b24-4053-a3ed-e0577bbb5125
jaindeepali/spoj_solutions
prime_sieve_of_eratosthenes.cpp
#include <iostream> #include <cmath> using namespace std; int main() { long long limit=100; //cin>>limit; long long sqrtlimit = sqrt(limit); bool sieve[101]={false}; for (int n=4;n<=limit;n=n+2) { sieve[n]=true; } for(int n=3;n<sqrtlimit;n=n+2) { if(!sieve[n]) ...
ALGO
0.999628
3.968437
3c434d3f-ece2-4e93-83d3-e031179abb9f
lttthedev/SPOJ-VNOI-VNOJ-Solution
P151SUMB-src.cpp
#include <iostream> #include <cstdio> #include <cmath> #include <string> using namespace std; int n, res; int OK(int n) { for (int i = n / 5; i >= 0; i--) { int x = n - i * 5; if (x % 3 == 0) { res = i + x / 3; return 1; } } return 0; } main() { cin >> n; if (OK(n)) cout << res; else cout << -1;...
ALGO
0.999801
4.023346
daa7700a-1a2f-48b5-9a2e-59b0ef33ffbe
pongsaphol/submission
APIO/17/merchant.cpp
#include <bits/stdc++.h> #define long long long using namespace std; const int N = 105; const int K = 1005; const long INF = 1e9+1; int n, m, k; long b[N][K], s[N][K]; long d1[N][N], d2[N][N], cost[N][N]; void apsp(long d[N][N]) { for(int k = 1; k <= n; ++k) for(int i = 1; i <= n; ++i) for(int j = 1; j...
ALGO
0.999973
4.00073
aaaa1423-ef62-4334-84fa-6af39abee3a6
zsl503/CSE124-ImitateHttp
rulematch.cpp
#include "rulematch.h" #include <algorithm> #include <arpa/inet.h> #include <fstream> #include <iostream> #include <netdb.h> #include <netinet/in.h> #include <sstream> #include <stdexcept> #include <sys/socket.h> using std::invalid_argument; using std::string; using std::stringstream; Rule::Rule(bool isAllow, const s...
TOOL
0.975455
4.201027
f2290e5c-f51a-4b99-b783-bcabdabc096e
zita-ch/elevation_mapping_cupy
plane_segmentation/convex_plane_decomposition_ros/src/ConvexPlaneDecompositionRos.cpp
#include "convex_plane_decomposition_ros/ConvexPlaneDecompositionRos.h" #include <grid_map_core/GridMap.hpp> #include <grid_map_cv/GridMapCvProcessing.hpp> #include <grid_map_ros/GridMapRosConverter.hpp> #include <convex_plane_decomposition/PlaneDecompositionPipeline.h> #include <convex_plane_decomposition_msgs/Plana...
ALGO
0.938348
7.082222
84d8c662-f6ee-405b-9d9f-39bffa363eba
gifsyn/AtCoder
ABC/ABC158/abc158b.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; int main(){ ll N; cin >> N; ll A, B; cin >> A >> B; ll cnt_AB = N/(A+B); ll cnt_C = N-cnt_AB*(A+B); ll cnt_B = cnt_AB*A + (cnt_C<A ? cnt_C : A); cout << cnt_B << endl; return 0; }
ALGO
0.999923
3.601825
aacc54f1-4800-460e-a35c-470df9fb7720
uwf-fang/cop3530-examples
m10-hashing/open-addressing.cpp
/* * Make a sample hash table * Use simple modulo hash function * Use simple linear probing */ #include "open-addressing.hpp" #include <iostream> HashMap::HashMap(int capacity): capacity(capacity), size_(0), buckets(new Bucket[capacity]) {} HashMap::HashMap(const HashMap &other): capacity(ot...
ALGO
0.996017
5.627028
97888c5c-8a76-4eef-85c0-1055512497f2
xufuq/CppBase
JianZhiOffer/6.cpp
#include "../utils.h" vector<int> reversePrint(ListNode* head) { int count = 0; ListNode *tmp = nullptr, *pre = nullptr, *cur = head; while (cur) { ++count; tmp = cur->next; cur->next = pre; pre = cur; cur = tmp; } vector<int> result(count); count = 0; cur = pre; while (cur) { r...
ALGO
0.999069
5.113634
272a0db5-680c-4099-9464-152087a38498
polarr/competitive-programming
Misc/CCC/2021S/DailyCommute.cpp
/** Code by 1egend **/ // Problem: CCC S4 2021 Daily Commute #include <bits/stdc++.h> using namespace std; #define pb push_back #define ull unsigned long long const int MAX_N = 1e5 + 1; const int MOD = 1e9 + 7; // ifstream fin(".in"); // ofstream fout(".out"); void solve(){ } int main(){ ios_base::sync_with_st...
ALGO
0.998772
3.969645
9f3d4a15-ce12-48b5-a097-797117f30fb2
Megha-singh07/pattern-problems
dsa/pattern15.cpp
#include <iostream> using namespace std; int main() { int n=5; int col; for(int row=1;row<=n; row++){ for(int col=1;col<=n;col++){ if(row==1){ cout<<col<<" "; } else if(col==row){ cout<<row <<" "; } else...
ALGO
0.999905
3.65732
614dc36e-01d6-4109-876e-80977d37e7e2
Chenyang-Joe/FractureBEM-CX
src/mainSegment.cpp
#include <openvdb/openvdb.h> #include <openvdb/tools/Composite.h> #include <openvdb/util/Util.h> #include <openvdb/tools/LevelSetSphere.h> #include <vector> #include <map> #include <set> #include <string> #include <sstream> #include <cfloat> #include <cmath> #define _DEBUG_SEGMENT_ #include "mySegment.h" using names...
ALGO
0.988125
5.49515
19954ba6-b79a-4928-a1cc-fee3689f7bfa
s0urav6529/Codeforces-Solutions
1501A CF.cpp
///GOD is Allmighty. ///Hore Krisna,Lord Krisna. #include<bits/stdc++.h> #include<math.h> using namespace std; #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> /*using namespace __gnu_pbds; template<typename T> using ordered_set=tree<T, null_type,less<T>, rb_tree_tag,tree_order_statistics_...
ALGO
0.99963
3.257635
2feba445-5a50-49cd-bf68-5c37bc828ad7
Mehedi-Hasan-Rabbi/Online-Judge-Solution
CodeForces/GYM 104736 B. Blackboard Game.cpp
// In the name of Allah the merciful. #include<bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; #define endl '\n' #define efficient() ios_base::sync_with_stdio(0); cin.tie(0); #define fraction() cout.unsetf(ios::floatfield); cout.precision(10); cou...
ALGO
0.999953
3.84806
e786820b-6ecf-4518-b37b-7a39152bbc36
ishandutta2007/codeforces
brovko/normal/1746/B.cpp
#include <bits/stdc++.h> //#define int long long #define ld long double #define f first #define s second #define pb push_back using namespace std; using li = long long; int32_t main() { ios_base::sync_with_stdio(0); cin.tie(0); int t; cin >> t; while(t--) { int n; cin >> n; ...
ALGO
0.999978
5.012794
9ac0ad7a-b0be-4bd9-9931-0cc77c76dadb
SenberWang/EE5003_project
HLS_Project/executer.cpp
#include "executer.h" _idx_instr_mem executer( volatile ap_int<32> *ddr_0, _idx_instr_mem *IdxInstr, ap_uint<1> *ClusterDone, ap_uint<1> *ClusterSync, struct sClstInputPkg *ClstInputPkg, struct sSpikeMemPkg *SpikeMemPkg, struct sPEInputPkg *PEInputPkg, st...
ALGO
0.872071
3.828065
5039a6b3-0d0e-404c-91c7-117bfde66878
hupax/algorithm-note
01/datastruct/graph/邻接矩阵.cpp
// // Created by supanx on 25-3-7. // // 图的存储: 边集数组 邻接矩阵 邻接表(链式前向星) /* * * */ #include <iostream> using namespace std; const int mx = 105; // 最大 mx 个顶点 const int inf = 1e8; // 权值上限 // 邻接矩阵存图 /* * 存点: 顶点数组 v[i]; v[i] = x : 编号为 i 的顶点存的数据为 x * 存边: g[i][j] * ---- 有向图 * 无权图: g[i][j] = 1 | 0; g[i][j] = 1 表示存在编号为 i ...
ALGO
0.999991
4.815725
4e475790-1e27-4ee3-aa8a-3a257b2249d4
MichalMroz21/Competitive-Programming
Leetcode/680.cpp
class Solution { public: bool isPalindrome(string& s, int i, int j){ while(i < j){ if(s[i++] != s[j--]) return false; } return true; } //acdcea bool validPalindrome(string s) { int i{}, j = s.size() - 1; while(i < j){ if(s[i] != s[j])...
ALGO
0.999955
6.510921
386956ea-8874-412d-8a19-73befb825609
ibrahim3761/Competitive-programming
A_Short_Sort.cpp
#include <bits/stdc++.h> #define ll long long #define ull unsigned long long #define yo cout<<"YES"<<endl; #define no cout<<"NO"<<endl; //I am Ibrahim //Yemete kudaisa using namespace std; int main() { int t; cin >>t; while (t--) { string s; cin >>s; if (s[0]=='a'||s[1]=='b'||...
ALGO
0.996907
3.610714