uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
600176b9-894e-4d59-ad71-9f6d981fde00
tzupengwang/PECaveros
contest/PWTCNNSU/g.cpp
// eddy1021 #include <bits/stdc++.h> using namespace std; typedef double D; typedef long double LD; typedef long long ll; typedef long long LL; typedef pair<int,int> PII; typedef pair<LL,LL> PLL; typedef pair<LD,LD> Pt; typedef tuple<int,int,int> tiii; typedef tuple<LL,LL,LL> tlll; #define mod9 1000000009ll #define mod...
ALGO
0.999847
3.95084
032d6f0a-1ed4-4c65-b807-1242755cd8df
Fr0n-k/EDD
Listas_Pila.cpp
#include <iostream> #include <fstream> #include <stdlib.h> #include <ctime> #include <stdio.h> #include <string.h> // std::cout #include <string> #include <opencv2/highgui.hpp> using namespace std; typedef struct ListaDepartamentos;// doble enlazada ordenada typedef struct NodoDepartamento; //doble enlazado typedef...
TOOL
0.978406
3.23754
4dd1289a-fbf1-457a-91a5-99cc0256823b
manikanta2901/ubuntu
.history/codingChallenges/cpp/Codechef/longChallenges/Year2021/January/ChefAndAnts_20210112143240.cpp
#include<bits/stdc++.h> #include<vector> #include<iostream> #include<cmath> #include<algorithm> #include<iterator> #include<string> #include<map> #define vv vector #define F first #define S second #define MP make_pair #define EXECUTE_FASTER ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); #define printM...
ALGO
0.99997
3.706885
744470aa-25e7-44d1-a01c-74a9d9d1fab1
hannanaarif/Striver-Dp-Series
DP 6. House Robber 2.cpp
//https://bit.ly/3F6q83P long long int houseRobberUtil(vector<int> valueInHouse, int start, int end){ long long int IthHouse[valueInHouse.size()]; // Check if the thief may steal the first house or not. if (start == 0){ IthHouse[0] = valueInHouse[0]; IthHouse[1] = max(valueInHouse[0], valu...
ALGO
0.999995
5.328887
cf9e9dd8-c44f-40b8-a55d-3e26cd24501a
gfandrade10/Generic-Code
LastDigit.cpp
#include <iostream> #include <vector> #include <functional> #include <cmath> int last_digit(const std::string &s1, const std::string &s2) { int num = s1[s1.length() - 1] - '0'; if (s2 == "0") return 1; if (num == 0 || num == 1 || num == 5 || num == 6) return num; if (s2.length() == 1...
ALGO
0.999472
5.54065
11d66ef6-46b6-4db8-913b-65eea241a6f2
Gauravv001/Linked-List
02DynamicallyLL.cpp
#include <iostream> using namespace std; class Node { public: int data; Node *next; Node(int data) { this->data = data; this->next = NULL; } }; int main(){ //DYNAMICALLY Node *n1 = new Node(1); Node *head = n1; Node *n2 = new Node(2); n1->next = n2; Nod...
ALGO
0.996573
4.396238
1cde8961-b3ad-4d13-88a1-22f01a660c3d
CombiningIdeas/exams
Создание пользовательских приложений на С++ №1.cpp
//#include <iostream> //#include <iomanip> //#include <conio.h> //#include <ctime> //#include <thread> //#include <thread> // // ///* //Второе задание //Создайте игру «Пятнашки». //Правила игры на английском языке можно прочесть по этой ссылке. //Главные особенности реализации игры: //1) Выбор режима игры: //• 8 (3×3);...
TOOL
0.982521
3.438869
432693b0-b3fb-4bf7-864f-ea69c8a9140e
ketansahu07/Interview
Graph/m colouring problem.cpp
/* Two methods: 1. Backtracking O(m^V) 2. BFS O(V + E) */ // ============================================ // Backtracking solution starts here // ============================================ bool isSafe(int v, bool graph[V][V], int color[], int c) { for(int i = 0; i < V; i++) if (graph[v][...
ALGO
0.999984
5.821158
8b364296-87aa-485c-857e-e330e43ad5a3
AhmedEzzatG/competitiveProgramming
spoj/PT07Z.cpp
#include <bits/stdc++.h> #include <unordered_map> #include <unordered_set> using namespace std; #define endl "\n" #define ll long long #define oo 0x3f3f3f3fLL #define sz(s) (int)(s.size()) #define RT(s) return cout<<s,0 #define INF 0x3f3f3f3f3f3f3f3fLL #define all(v) v.begin(),v.end() #define watch(x) cout<<(#x)<<" = "...
ALGO
0.999219
3.975396
c1dacd88-ad28-4715-ae89-e6b3abb09877
0xSiddhant/CodeSnippet_Cplus
Queue.cpp
#include <iostream> using namespace std; class Queue { int *arr; int cs,ms,f,r; public: Queue(int size = 5) { arr = new int[size]; cs = 0; ms = size; f= 0; r = ms-1; } bool full() const { return cs == ms; } void push(const int data) { if(!f...
ALGO
0.946844
3.863139
f9f7d9fb-d97d-4689-8ea3-0563d9729c24
Professor-Berni/android_frameworks_av
media/module/codecs/amrnb/common/src/gc_pred.cpp
/* Pathname: ./audio/gsm-amr/c/src/gc_pred.c Functions: gc_pred_reset gc_pred gc_pred_update gc_pred_average_limited ------------------------------------------------------------------------------ MODULE DESCRIPTION This file contains the functions that perform code...
ALGO
0.999529
6.137325
42ebed15-8daf-46a8-9b71-66dfcfb43635
ishandutta2007/codeforces
cheissmart/normal/1434/B.cpp
#include <bits/stdc++.h> #define IO_OP std::ios::sync_with_stdio(0); std::cin.tie(0); #define F first #define S second #define V vector #define PB push_back #define MP make_pair #define EB emplace_back #define ALL(v) (v).begin(), (v).end() #define debug(x) cerr << "Line(" << __LINE__ << ") -> " << #x << " is " << x << ...
ALGO
0.999994
3.60978
09286399-556e-4ae2-a983-2211b7652893
ishandutta2007/codeforces
heno239/normal/1278/A.cpp
#include<iostream> #include<string> #include<cstdio> #include<vector> #include<cmath> #include<algorithm> #include<functional> #include<iomanip> #include<queue> #include<ciso646> #include<random> #include<map> #include<set> #include<bitset> #include<stack> #include<unordered_map> #include<utility> #include<cassert> #in...
ALGO
0.999927
4.667863
f661d4d3-d49f-421e-b88f-6b34cd4d43f4
eujuu/Algorithm
baekjoon/백준 10824 네 수.cpp
#include <iostream> #include <vector> #include <string> #include <algorithm> using namespace std; int alp[26]; int main() { ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); string a, b, c, d; cin >> a >> b >> c >> d; a = a + b; c = c + d; //string s = to_string(a) + to_string(b); //string s1 = to_st...
ALGO
0.999801
3.854995
cb366d3f-2f36-4d6b-a79e-aefd63ad7d30
wistex-united/wistex-system-2024
Src/Modules/Configuration/FrictionLearner/FrictionLearner.cpp
/** * @file FrictionLearner.cpp * * This file implements a module that estimates the ball friction coefficient. * * @author Tim Laue * @author Felix Wenk */ #include "FrictionLearner.h" MAKE_MODULE(FrictionLearner); void FrictionLearner::update(DummyRepresentation&) { if((theBallPercept.status == BallPercep...
ALGO
0.993519
5.459616
b67cbfda-f041-42ac-ac3d-518b089f3679
FedericoMazzone/openfhe-statistics
src/test-sorting.cpp
#include "sorting.h" #include "utils-basics.h" #include "utils-eval.h" #include "utils-matrices.h" #include "utils-ptxt.h" #include <omp.h> void testSorting( const size_t vectorLength, const usint compareDepth, const usint indicatorDepth, const bool tieCorrection = false ) { const usint integralP...
ALGO
0.99845
6.182024
cb140dfc-14ce-44e7-abc9-7410dabb7510
ruturajch/neetcode-main
cpp/0329-longest-increasing-path-in-a-matrix.cpp
/* Given matrix, return length of longest increasing path Ex. matrix = [[9,9,4],[6,6,8],[2,1,1]] -> 4, [1,2,6,9] DFS + memo, cache on indices, compare to prev for increasing check Time: O(m x n) Space: O(m x n) */ class Solution { public: int longestIncreasingPath(vector<vector<int>>& matrix)...
ALGO
0.999992
6.668949
6fd71b46-86df-44c7-8be8-2bd0be847c42
sinhadiptiprakash/dsa
Dynamic Programming/palindromic_partitioning_problem.cpp
#include <bits/stdc++.h> using namespace std; bool isPalindrome(string str, int i, int j) { while (i < j) { if (str[i] != str[j]) return false; i++, j--; } return true; } //recursive int palindromicPartitioning(string str, int i, int j) { if (i >= j || isPalindrome(str, i...
ALGO
0.99999
6.135322
1573efef-c877-44be-9c75-5c50b9a6d6d8
CedricKuang/LeetCode
labuladong/98.validate-binary-search-tree.cpp
/* * @lc app=leetcode id=98 lang=cpp * * [98] Validate Binary Search Tree */ // @lc code=start /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nullptr), right(nullptr) {} * TreeNode(int x) : val(x), ...
ALGO
0.999969
7.307522
d674a3d5-96b1-44ba-a6d2-b523f2139e9a
zainf2327/Leetcode_Solutions
0210_courseSchedule(2).cpp
#include <vector> #include <stack> using namespace std; class Solution { private: bool dfs(int node, vector<vector<int>>& adj, vector<int>& state, stack<int>& st) { state[node] = 1; // in visiting for (int nei : adj[node]) { if (state[nei] == 0) { if (!dfs(nei, adj, stat...
ALGO
0.999995
6.32454
f4f4e7a0-a45f-488f-8ed3-7beaf559d5a9
RazorBach/Leetcode
solutions/060-permutation-sequence/permutation-sequence.cpp
// The set [1,2,3,...,n] contains a total of n! unique permutations. // // By listing and labeling all of the permutations in order, we get the following sequence for n = 3: // // // "123" // "132" // "213" // "231" // "312" // "321" // // // Given n and k, return the kth permutation sequence. // // Note: // // /...
ALGO
0.999934
7.06893
376f2162-9fed-4e01-adc2-3ec88fc04db4
husain-khan/DSA
890-lemonade-change/lemonade-change.cpp
class Solution { public: bool lemonadeChange(vector<int>& bills) { int notes[3]={0,0,0};//onr for 5,one for 10 one for 20 int i=0; int n=bills.size(); if(bills[0]!=5){ return false; } for(i=0;i<n;i++){ if(bills[i]==5){ notes[0]+...
ALGO
0.999595
6.03626
722b94e4-3469-4ba5-8fc7-45a5c5e665e9
zavvio/HackerRankSubmission
organizing-containers-of-balls.cpp
// https://www.hackerrank.com/challenges/organizing-containers-of-balls #include <bits/stdc++.h> #include <algorithm> /* 10 2 1 0 0 1 2 1 2 2 1 3 0 4 0 2 0 1 1 0 2 4 1 2 3 4 2 1 4 3 3 4 2 1 4 3 1 2 4 0 0 5 0 4 0 0 0 0 2 0 1 0 1 0 2 2 2 1 0 0 2 2 1 0 1 3 1 2 3 3 2 1 2 3 1 3 1 0 0 0 2 0 0 2 0 4 1 2 1 3 2 1 3 1 1 3 2 1 3 ...
ALGO
0.999951
5.314408
2b16f294-6aa4-4f97-9c75-ff452e2cb8e4
ishandutta2007/codeforces
purplecrayon/normal/1031/E.cpp
#include <bits/stdc++.h> using namespace std; #define sz(v) int(v.size()) #define ar array typedef long long ll; const int MAXN = 3e5+10, MOD = 1e9+7; struct basis { static constexpr int D = 15; ll base[D]={}; ll who[D]={}; void add(ll x, ll me) { for (int i = 0; i < D; i++) if ((x>>i)&1) { ...
ALGO
0.99996
3.523069
1179fb17-fc37-4f3e-b11e-d82f268270db
BS-Algo/Algorithm
jaeyeongPark/2024/2024-12/backjoon/1439.cpp
#include <iostream> #include <string> #include <algorithm> #include <vector> using namespace std; string s; int result = 0; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); cin >> s; for(int i=0;i<s.length();i++) if(s[i]!=s[i+1]) result++; if(!result) cout << result; els...
ALGO
0.999758
3.517651
a8802b95-2be4-4ce6-8f03-5686147c7b2c
manato/ghostEye_server
geye_pds/CAR_TRACKING/dt.cpp
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////dt.cpp Decide best filter position by dynamic programing ////////////////////////////////////////////////// //C++ library #include <stdio.h> #include <stdlib.h> #include "switch_float.h" //////...
ALGO
0.999815
5.122068
cbcf659c-39c7-4969-80c2-c1b83d33793d
leeeyupeng/leeeyupeng.github.io
project/algorithm/leetcode2021/src/88.merge.cpp
#include"leetcode.h" class Solution { public: void merge(vector<int>& nums1, int m, vector<int>& nums2, int n) { int i = m-1; int j = n-1; int ij = m+n-1; while(j>=0){ if(i < 0){ nums1[ij] = nums2[j]; ij --;j --; } ...
ALGO
0.999932
5.146452
55f5a795-ede9-4dbf-a487-d27096690ab9
MoazMohamedHamzaGaber/Emotion-Analysis
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
fa420da1-0228-40e5-92ff-9c0f1d01f0d9
Ayush05G/Cpp_DSA
Data Structures & Algorithms/Maps&Tries/2sum.cpp
class Solution { public: vector<int> twoSum(vector<int>& nums, int target) { unordered_map<int,vector<int> > map; //value to indexes store for(int i=0; i<nums.size(); i++) { int val = nums[i]; map[val].push_back(i); } //ab aapne har value k...
ALGO
0.999898
6.075561
324c6614-9abc-4a9c-aedf-86a82e6c6738
mrayyan421/quote_app
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
018ded9a-5e3b-4789-87e4-7fd0d4bf55ba
sreakdgeek/Path-Planning
src/Eigen-3.3/bench/benchmark.cpp
// g++ -O3 -DNDEBUG -DMATSIZE=<x> benchmark.cpp -o benchmark && time ./benchmark #include <iostream> #include <Eigen/Core> #ifndef MATSIZE #define MATSIZE 3 #endif using namespace std; using namespace Eigen; #ifndef REPEAT #define REPEAT 40000000 #endif #ifndef SCALAR #define SCALAR double #endif int main(int ar...
ALGO
0.976822
3.689405
3491b435-ee46-4b50-910f-d43abf616135
xiyanykt/code
Codeforces/2050/B.cpp
#include<bits/stdc++.h> using u32 = unsigned int; using i64 = long long; using u64 = unsigned long long; using f64 = long double; using i128 = __int128; using u128 = unsigned __int128; using f128 = __float128; #ifndef ONLINE_JUDGE #include "algo/debug.hpp" #else #define debug(...) (void)42 #endif template<class T> c...
ALGO
0.999888
5.688846
1b299353-b0fc-4303-8268-a65e554ede86
cathyliu0308/cs106b
project2/WordLadder/lib/StanfordCPPLib/dawglexicon.cpp
/* * File: dawglexicon.cpp * --------------------- * A lexicon is a word list. This lexicon is backed by two separate data * structures for storing the words in the list: * * 1) a DAWG (directed acyclic word graph) * 2) a Set<string> of other words. * * Typically the DAWG is used for a large list read from a f...
TOOL
0.898334
6.90251
896e09ec-d0b7-4821-b5c5-4bc314218deb
UmeshGayashan/Expense_Tracker
expense_tracker/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.998514
6.76073
4986b46b-bdeb-4db7-98aa-8c942fd72338
giovaneaf/OCT
gls.cpp
#include <bits/stdc++.h> using namespace std; #define mp(a, b) make_pair(a, b) #define vb vector<bool> #define vi vector<int> #define ii pair<int, int> #define EPS 1e-3 #define TIMEOUT 300 struct Edge { int u, v; double len; int id; Edge(int u = 0, int v = 0, double len = 0.0, int id = 0) : u(u), v...
ALGO
0.999782
3.391035
aa06d6a9-bc63-4554-9034-22cb0f5c9dd0
yhchen/games101homework
homework/eigen/doc/snippets/MatrixBase_all.cpp
Vector3f boxMin(Vector3f::Zero()), boxMax(Vector3f::Ones()); Vector3f p0 = Vector3f::Random(), p1 = Vector3f::Random().cwiseAbs(); // let's check if p0 and p1 are inside the axis aligned box defined by the corners boxMin,boxMax: cout << "Is (" << p0.transpose() << ") inside the box: " << ((boxMin.array() < p0.arra...
ALGO
0.980832
3.601679
3d1fe6dc-2c87-4a72-9e9e-497785851794
devFancy/KNU
algorithm/week9/9-2.cpp
#include <iostream> #include <vector> using namespace std; bool isFeasible(vector<int> deadline, vector<int>& K) { for (int i = 1; i < K.size(); i++) { if(deadline[K[i]] < i) return false; } return true; } void schedule(int n, vector<int> deadline, vector<int>& J) { vector<int> K;...
ALGO
0.999998
4.559495
6a6ffbe0-204c-4d13-8c70-f74f9bea4a5d
OpenFaker/MyScaleDB
src/Processors/Transforms/DistinctSortedTransform.cpp
#include <Processors/Transforms/DistinctSortedTransform.h> namespace DB { namespace ErrorCodes { extern const int SET_SIZE_LIMIT_EXCEEDED; extern const int LOGICAL_ERROR; } /// calculate column positions to use during chunk transformation static void calcColumnPositionsInHeader(const Block& header, const Nam...
ALGO
0.970511
7.817491
9c9977e1-2004-4ccd-8dc0-a6cd3edc9ce0
ishandutta2007/codeforces
niyaznigmatul/normal/445/B.cpp
#include <bits/stdc++.h> int p[1234]; int main() { int n, m; scanf("%d%d", &n, &m); long long ans = 1; for (int i = 0; i < n; i++) p[i] = i; for (int i = 0; i < m; i++) { int v, u; scanf("%d%d", &v, &u); while (v != p[v]) v = p[v]; while (u != p[u]) u = p[u]; if (u != v) ans *= 2; p[v] = u; } printf("%lld\n", ans); }
ALGO
0.999916
4.01606
53f16a47-279e-4c24-9a0b-90145e5ad834
purnimamehta/Articles-n-Algorithms
Competitive Programming/codechef/DMNT2014/REVADD.cpp
#include<stdio.h> #include<stdio.h> #include<string.h> using namespace std; long long nCr[200][200]; void generatenCr(int n,long long MOD) { for(int i=0;i<=n;i++) for(int j=0;j<=i;j++) { if(i==0||j==0) nCr[i][j]=1%MOD; else nCr[i][j]=(nCr[i-1][j-1]+nCr[i-1][j])%MOD; } } long long p(long long n,l...
ALGO
0.999961
4.234971
43068d69-2be4-4ae7-8ed4-44b27aca7b0c
skandavc18/logic_detector
backend/CDataset/numIslands/numIslands_28.cpp
class Solution { public: int numIslands(vector<vector<char>>& grid) { //test edge cases if(grid.size()==0) return 0; int numIslands = 0; //lets traverse the matrix now and check for every cell for(int i=0; i<grid.size(); i++) { for(int j=0; j<grid[0].size(...
ALGO
0.999852
6.355121
610d037c-4d9c-4d90-921b-0cc644083d76
sjcode99/LeetcodeSubmissions
0130-surrounded-regions/0130-surrounded-regions.cpp
class Solution { private: void dfs(int row, int col, vector<vector<int>> &vis, vector<vector<char>> &board, int delrow[], int delcol[]){ vis[row][col] = 1; int n = board.size(); int m = board[0].size(); for(int i=0; i<4; i++){ int nrow = row...
ALGO
0.999933
6.349739
7063bdcc-e736-441a-ab94-ec55669c8642
Saad-Dev13/DSA-Basic-Codes-in-Cpp
6_1_2_Circular Queue_Generalized.cpp
#include <iostream> using namespace std; class CircularQueue { private: int* arr; int rear; int front; int size; public: CircularQueue(int si) { front = -1; rear = -1; size = si; arr = new int[size]; } bool isFull() { return ((rear + 1) % size) == f...
ALGO
0.998607
5.812931
5722837d-bab1-427f-98db-672b6e82b82c
nck404/tui-hoc-cpp
tui la retard/vt/vt09.cpp
#include <iostream> #include <cmath> #include <algorithm> #include <vector> using namespace std; bool isPrime(int n) { if (n <= 1) { return false; } for (int i = 2; i <= std::sqrt(n); i++) { if (n % i == 0) { return false; } } return true; } int main() { int...
ALGO
0.999966
4.527836
91c24d78-7859-4dad-93a7-8dd4359183ea
bityecoin/coinyecoin
src/sync.cpp
#include "sync.h" #include "util.h" #include "utilstrencodings.h" #include <stdio.h> #include <boost/foreach.hpp> #include <boost/thread.hpp> #ifdef DEBUG_LOCKCONTENTION void PrintLockContention(const char* pszName, const char* pszFile, int nLine) { LogPrintf("LOCKCONTENTION: %s\n", pszName); LogPrintf("Loc...
TOOL
0.946428
6.084898
05a0667c-f2b4-47a8-be21-d33f26d2f997
tsugiar/CarND-Path-Planning
src/Eigen-3.3/doc/examples/QuickStart_example.cpp
#include <iostream> #include <Eigen/Dense> using Eigen::MatrixXd; int main() { MatrixXd m(2,2); m(0,0) = 3; m(1,0) = 2.5; m(0,1) = -1; m(1,1) = m(1,0) + m(0,1); std::cout << m << std::endl; }
ALGO
0.98603
3.474624
c87af032-5a86-4a07-8093-4af64f9eee98
mn619/cf-practise
E. Field of Wonders.cpp
#include<bits/stdc++.h> #define start_routine cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(false); int begtime = clock(); #define end_routine int endtime = clock(); cerr << endl << "Time elapsed: " << (endtime - begtime)*1000/CLOCKS_PER_SEC << " ms"; return 0; #define pb push_back #define lb lower_bound #define u...
ALGO
0.999866
3.657561
8bc1e81f-7dea-47fb-9590-a98eca4f7bc6
konfiker-kido/DSA-Course
string/removeDuplicateString.cpp
#include <iostream> using namespace std; // void removeDuplicate(string str) // { // string s = ""; // for (int i = 0; i < str.length() - 1; i++) // { // if (str[i] == str.length() - 2 and str[i] != str[i + 1]) // s += str[i + 1]; // if (str[i] != str[i + 1]) // s +...
ALGO
0.999441
4.543876
9f5a818b-d176-4a49-b802-f62af5378b41
dachev1919/cpp03_2020
nuk/chm/CHM_4/Oleg.cpp
#include <iostream> #include <fstream> #include <math.h> #include <omp.h> #include <cstdlib> using namespace std; void Mul(int N, double **A, double *x, double *y) { for (int i = 0; i < N; i++) { y[i] = 0; for (int j = 0; j < N; j++) y[i] = y[i] + (A[i][j] * x[j]); } } void Pri...
ALGO
0.999811
3.296125
42f75cec-5f05-40dd-a283-60f470f7aa41
zefklop/reactos-playground
dll/directx/msdvbnp/networkprovider.cpp
#include "precomp.h" #define DEVICE_FILTER_MASK (0x80000000) class CNetworkProvider : public IBaseFilter, public IAMovieSetup, public IBDA_NetworkProvider { public: typedef std::vector<IUnknown*>DeviceFilterStack; STDMETHODIMP QueryInterface( REFIID Interface...
TOOL
0.924176
6.467459
b7d7d5ff-638a-4c7b-8f3c-2ef9d17b0922
xiami2019/LeetCode
剑指Offer/42.连续子数组的最大和.cpp
class Solution { public: int maxSubArray(vector<int>& nums) { int maxSubsum = INT_MIN; int curSum = 0; for (int i : nums) { curSum = max(curSum + i, i); maxSubsum = max(maxSubsum, curSum); } return maxSubsum; } };
ALGO
0.999903
6.627481
9d3212fc-abe8-4516-93e7-708a7c8f5b59
larsj-blip/TAFFO
test/polybench-cuda/stencils/jacobi-2d-imper/jacobi2D.cpp
/** * jacobi2D.cu: This file is part of the PolyBench/GPU 1.0 test suite. * * * Contact: Scott Grauer-Gray <<EMAIL>> * Will Killian <<EMAIL>> * Louis-Noel Pouchet <<EMAIL>> * Web address: http://www.cse.ohio-state.edu/~pouchet/software/polybench/GPU */ #include <stdio.h> #include <unistd.h> #include <time.h> #...
TEST
0.859114
5.728809
0f88f2bf-2833-47fc-af99-7aec554f0dd5
mamunurRoshid14/cf-solves
1935D | Exam in MAC/249879623.cpp
//https://codeforces.com/profile/mamunur_roshid_517 #include <bits/stdc++.h> using namespace std; #define ll long long #define pll pair<long long, long long> #define pb push_back #define ff first #define ss second #define LL_INF (1LL << 62) #define SetBit(x, k) (x = (1LL << k)) #define ClearBit(x, k) (x &= ~(1L...
ALGO
0.999978
4.420242
7b4d477b-408b-4d72-841c-9b8a87ab41a6
JunhwiLee/BusApp
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.998799
6.776823
1073f32d-de2d-4973-9dda-b09782c8b1dd
Phhofm/ShareArchiver
v0.1/executable/folder/Ubuntu20/share/compressors/bsc-3.2.2-src/libbsc/bwt/bwt.cpp
/*-----------------------------------------------------------*/ /* Block Sorting, Lossless Data Compression Library. */ /* Burrows Wheeler Transform */ /*-----------------------------------------------------------*/ #include <stdlib.h> #include <memory.h> #include "bwt.h" #inc...
ALGO
0.999833
7.040662
f9f8157b-3b10-43bd-a8d5-bfda7725d9f9
mdsozon24/C-and-C-
Add_object.cpp
#include <bits/stdc++.h> using namespace std; class ax { int a; public: void set(int x) { a = x; } int get() const { return a; } ax operator+(const ax &y) { ax c; c.a = this->a + y.a; return c; } }; int main() { ax a, b, c; a.set(5); b.set(10); c = a + b;...
ALGO
0.997683
4.274065
e85df7ca-7de0-4baf-8bc0-b1d06b4d5c5d
KyusokLee/TMU_cpp
kadai_Day1/kadai_Day1/kadai1_1.cpp
// // main.cpp // kadai_Day1 // // Created by Kyus'lee on 2022/05/12. // #include <iostream> #include <stdio.h> #include <stdlib.h> #include <random> //#include <iomanip> // Input Output Manipulator : 入出力の調整を行うライブラリ // iomanip 代表的な提供関数 // setw(): 出力のスペース調整 // setbase(): ?進数の設定可能 (8, 10, 16進数のみ可能) // ...
TOOL
0.955599
3.553174
d884d2f1-8926-4ef1-b87a-d47c4eace18b
binthafra/Problem-solving-and-competitive-programming
c++/add 2 number.cpp
#include <iostream> using namespace std; int main() { int a,b,c,d,x,y; cout << "enter 2 integer "; cin >> x >> y; a=x+y; b=x-y; c=x*y; d=x/y; cout << "add = " << a << "sub = "<< b << "mul= " <<c<< "div= "<< d; return 0; }
ALGO
0.994637
3.497572
1865b7dc-6208-4dd3-9be5-ba13fc3e48b7
MadhuraDhake/sos
10_Heap.cpp
#include <iostream> using namespace std; void min_heapify(int *a,int i,int n) { int j, temp; temp = a[i]; j = 2 * i; while (j <= n) { if (j < n && a[j+1] < a[j]) j = j + 1; if (temp < a[j]) break; else if (temp >= a[j]) { a[j/2] = a...
ALGO
0.999739
3.99913
cb6379ba-5ab5-41d4-8b51-7a66821b1dbc
heavenMOJANG/ICPC
.history/luogu/P2756 飞行员配对方案问题_20241031194208.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 INF = 0x7fffffff; constexpr int N = 110; struct Edge {int to, nxt, w;}e[N << 4]; int n, m, head[N << 1], idx, u, v, lv[N << 1], cur[N << 1]; void a...
ALGO
0.999741
4.04553
bbf4e042-61f5-4826-ad2e-f80ca90ee881
ShapeShiftOS-LTS/android_frameworks_native
cmds/installd/otapreopt_utils.cpp
#include "otapreopt_utils.h" #include <sys/types.h> #include <sys/wait.h> #include <unistd.h> #include <android-base/logging.h> #include <android-base/stringprintf.h> #include <android-base/strings.h> using android::base::Join; using android::base::StringPrintf; namespace android { namespace installd { bool Exec(c...
TOOL
0.891764
6.737495
b8b5ba05-b15f-41a0-ae64-4a686b98cf1a
LLaammTTeerr/HCMUS-HLD-Notebook
resources/Code/Math/NumberTheory/EulerTotient.cpp
int phi(int n) { int result = n; for (int i = 2; i * i <= n; i++) { if (n % i == 0) { while (n % i == 0) n /= i; result -= result / i; } } if (n > 1) result -= result / n; return result; }
ALGO
0.999886
4.422577
4210a734-6e97-4b59-8935-bb2600a37af5
risal-shefin/Competitive-Programming
CodeForces/Solutions/999D.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long struct node { ll rem, pls, id; }; struct comp{ bool operator()(node left, node right){ return left.rem < right.rem; } }; ll ara[200009], cnt[200009], used[200009]; int main() { ll n, m; cin >> n>> m; ll ct =...
ALGO
0.999995
3.166426
f1ca35f0-8ade-4e40-a6bd-66da8a7fbc23
Mitesh12ehd/DSA
4. Binary Search/q6_minimum_in_rotated.cpp
#include<iostream> #include<vector> #include<limits.h> using namespace std; //leetcode 153 //find minimum in rotated sorted array //brute force can be done using linear search //O(logn) int findMin(vector<int>& nums) { int start = 0; int end = nums.size()-1; int ans = INT_MAX; while(start<=end){ ...
ALGO
0.99999
5.415213
30ca010e-657a-4d89-bfe7-0c9239aeee5a
tsuchishinka/graduation_paper
depends_package/visp/modules/core/src/tools/geometry/vpTriangle.cpp
#include <visp3/core/vpDebug.h> #include <visp3/core/vpTriangle.h> /*! Basic constructor. By default, the three 2D points coordinates which define the triangle are \f$ (0,0) \f$, \f$ (1,0) \f$ and \f$ (0,1) \f$. */ vpTriangle::vpTriangle() : goodTriange(true), S1(), uvinv00(0), uvinv01(0), uvinv10(0), uvinv11...
TOOL
0.974981
7.133236
5c290845-67fd-4b1c-a398-1f59ec7210dc
ishandutta2007/codeforces
gabrielwu/normal/1206/A.cpp
#include <bits/stdc++.h> using namespace std; #define forn(i, n) for(int i=0; i<(n); i++) #define printVec(v) for(auto e: v){cout << e << " ";} cout << endl; #define pb push_back #define MOD 1000000007 #define f first #define s second typedef long long ll; typedef double ld; typedef long double lld; typedef pair<int,...
ALGO
0.999965
3.503354
73f68d39-e76b-4893-8be6-2aa9f9e18062
raghav161/Leetcode
2334-number-of-flowers-in-full-bloom/2334-number-of-flowers-in-full-bloom.cpp
class Solution { public: vector<int> fullBloomFlowers(vector<vector<int>>& flowers, vector<int>& people) { int m = flowers.size(), n = people.size(); vector<int> result(n), start_time(m), end_time(m); for(int i=0;i<m;i++) { start_time[i] = flowers[i][0]; end_t...
ALGO
0.999943
6.19382
375fa3ec-81c8-4660-9c8b-6bebdd0286ae
gimli-org/gimli
core/src/wingetopt.cpp
#include <errno.h> #include <stdlib.h> #include <string.h> #include <wingetopt.h> #include <stdarg.h> #include <stdio.h> #include <windows.h> #define REPLACE_GETOPT /* use this getopt as the system getopt(3) */ #ifdef REPLACE_GETOPT int opterr = 1; /* if error message should be printed */ int optind = 1; /* index ...
TOOL
0.90578
5.31344
39d73782-deb5-4adc-ba2d-17b9704c19fb
HISSTools/HISSTools_Impulse_Response_Toolbox
HISSTools_IR_Toolbox_Common/HIRT_Core_Functions.cpp
#include "HIRT_Core_Functions.hpp" ////////////////////////////////////////////////////////////////////////// ////////////////////////// FFT Size Calculation ////////////////////////// ////////////////////////////////////////////////////////////////////////// uintptr_t int_log2(uintptr_t in, bool& inexact) { uin...
ALGO
0.99533
5.73469
866f1eac-c732-4f9b-9b2f-65a1f3d28500
Beisenbek/FallPP12021
lab-solutions/lab04/74302.cpp
#include <iostream> using namespace std; int main() { int n, max = -1e9 - 17; cin >> n; int arr[n][n]; for(int i = 0; i < n; i++) for(int j = 0 ; j < n; j++) cin >> arr[i][j]; for(int i = 0; i < n; i++) for(int j = 0 ; j < n; j++) if(arr[i][j]...
ALGO
0.999832
3.864509
2d345728-0d21-4a14-b033-cb863fb8e79b
ishandutta2007/codeforces
vkgainz/normal/1175/E.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long int tab[500001][20]; vector<int> intervals[500001]; int main(){ int n,m; cin >> n >> m; for(int i=0;i<n;i++){ int l,r; cin >> l >> r; intervals[r].push_back(l); } int leastL = 500000; for(int i=500000;i>=0;i--){ ...
ALGO
0.999942
3.707559
ca3079ba-c43a-410a-9297-be274ac94377
eratofly/algorithms
lw2/lw2.cpp
#include <cstdlib> #include <iostream> #include <fstream> #include <set> #include <vector> #include <windows.h> /* -22 20 VS Code 1.15.1 20. . , , (9). */ using namespace std; struct Stack { int key; Stack *nextS; }; struct Queue { i...
ALGO
0.952104
3.491639
5c454492-203c-497b-9d77-279e190c79d5
ishandutta2007/codeforces
dotorya/normal/847/K.cpp
#include <stdio.h> #include <algorithm> #include <assert.h> #include <bitset> #include <cmath> #include <complex> #include <deque> #include <functional> #include <iostream> #include <limits.h> #include <map> #include <math.h> #include <queue> #include <set> #include <stdlib.h> #include <string...
ALGO
0.999667
3.678625
72eaae46-8fd8-4379-b5e5-55143c7f996b
Arif-462/data_stucture_cpp
Week 7 Introduction To Queue/Module 24 Introduction to Queue/24-4 Queue using Circular array theory.cpp
#include<bits/stdc++.h> using namespace std; const int MAX_SIZE = 500; class Queue{ public: int a[MAX_SIZE]; int l,r,sz; Queue() { l = 0; r = -1; sz = 0; } //tc=O(1) void enqueue(int value) { if(r+l >= MAX_SIZE) { cout<<"Queue is fu...
ALGO
0.97662
4.184595
ae4be148-31c2-4c71-b67d-d8f3b700e11c
ishandutta2007/codeforces
eric_hooo/normal/1166/A.cpp
#include <bits/stdc++.h> using namespace std; int cnt[26]; char buf[50]; int main(){ int n; scanf("%d", &n); for (int i = 0; i < n; i++){ scanf("%s", buf); cnt[buf[0] - 'a']++; } int ans = 0; for (int i = 0; i < 26; i++){ int x = cnt[i] / 2, y = cnt[i] - x; ans += x * (x - 1) / 2 + y * (y - 1) / 2; } p...
ALGO
0.999988
4.139904
face099d-5aea-4722-bdbd-5f1c5f1ab416
piash76/UVA
uva10324.cpp
#include<bits/stdc++.h> #include<string> using namespace std; int main() { char a[1000015]; int i,j,cnt=0,q,k,l,m,flag=0,temp; while(1) { m=1; flag=0; gets(a); cin>>q; for(i=1;i<=q;i++) { cnt=0; cin>>j>>k; if(j>k) { temp=j; ...
ALGO
0.999845
3.550543
8014f9da-6c11-4e34-9932-5a378b870b73
midasestanislao/C-
Trabajo_final-lll_Gustavo_Richarte.cpp
//Gustavo Richarte Perez //Ingenieria en Computacion Inteligente //2°E //24/03/2022 #include <iostream> #include <conio.h> #include <string.h> #include <stdlib.h> #define tam 20 using namespace std; int prioridad(char simbolo); int main(){ int opcion,tope=-1,pos=-1,tamexp; char pila[tam],epos[tam],epre[tam]...
ALGO
0.999602
3.323298
ca2237a7-db51-43fd-88e1-71761e0457f5
alexandraback/datacollection
solutions_5751500831719424_0/C++/sysuhuan/main.cpp
#include<iostream> #include<cstdio> #include<algorithm> #include<cmath> #include<vector> #include<cstring> using namespace std; char str[101][200]; int f(int *a, int n){ int c[200]; for(int i = 0;i<n;i++)c[i] = a[i]; sort(c,c+n); int t = c[n/2]; int ans = 0; for(int i = 0;i<n;i++)ans+=abs(t-c[i]); return ans; }...
ALGO
0.999862
3.862797
fa86b234-5b8c-4ccf-bca3-ea45606a1efd
aanchal2320/LeetCode
delete-node-in-a-bst/delete-node-in-a-bst.cpp
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nullptr), right(nullptr) {} * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} * TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l...
ALGO
0.999977
6.74084
e714ae79-b068-4323-a38f-9d2e436216ce
17vali/COL106
A4/evaluator.cpp
/* Do NOT add/remove any includes statements from this header file */ /* unless EXPLICTLY clarified on Piazza. */ #include "evaluator.h" bool is_integer(string s) { if(s[0] == '-') { s = s.substr(1); } for(auto c: s) { if(c < '0' || c > '9') { return false; } } r...
ALGO
0.915212
5.423334
111eb552-3db8-49bd-8453-e14ee6f4317c
herbstrith/oblivious_nbody
no_recursion_nbody/nbody.cpp
#include <GL/glew.h> #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64) #include <GL/wglew.h> #endif #if defined(__APPLE__) || defined(MACOSX) #pragma clang diagnostic ignored "-Wdeprecated-declarations" #include <GLUT/glut.h> #else #include <GL/freeglut.h> #endif #include <paramgl.h> #includ...
ALGO
0.957906
4.877375
b24b011c-3d9d-499a-8a1e-517425813d71
NaveenVaratharaj/Problem-Solving
V2 N to 1.cpp
// Print From N to 1 #include <bits/stdc++.h> using namespace std; void print(int n) { if(n == 0) return; //base condition cout<<n<<" "; print(n-1); //Recursive call } int main() { print(5); return 0; }
ALGO
0.999959
5.214088
2c269e30-e48e-47f8-a363-acaa163ec9a5
Gautham001/481581DOCS
extern/bullet2/src/BulletCollision/CollisionShapes/btStridingMeshInterface.cpp
#include "btStridingMeshInterface.h" #include "LinearMath/btSerializer.h" btStridingMeshInterface::~btStridingMeshInterface() { } void btStridingMeshInterface::InternalProcessAllTriangles(btInternalTriangleIndexCallback* callback, const btVector3& aabbMin, const btVector3& aabbMax) const { (void)aabbMin; (void)aabb...
ALGO
0.927327
6.528596
c6253c8b-1d2b-47c5-bccb-6ca61bbd5e19
akshat123436/Strivers-SDE-Sheet-Challenge
ChessTournament.cpp
#include <bits/stdc++.h> bool checker(int num, int c, vector<int> &pos, int n) { int count = 1; int prev = pos[0]; for (int i = 1; i < n; i++) { if (pos[i] - prev >= num) { count++; prev = pos[i]; } } return count >= c; } int chessTournament(vector...
ALGO
0.999998
5.393055
9c7dfae5-c7c5-41bb-ae73-0bf11859a9cf
avnish10232/Coding_Blocks_CPPwithDSA
Lecture_6_Arrays-I_13th_July_2023/4_ReadNumbersAndPrintReverse.cpp
#include <iostream> using namespace std; int main() { int a[100]; int n; cin >> n; for (int i = 0; i < n; ++i) { cin >> a[i]; } for (int i = n - 1; i >= 0; --i) { cout << a[i] << " "; } cout << endl; return 0; }
ALGO
0.999854
3.893106
e1ecf2e4-2deb-4e65-bc2a-1d9b5ce5e2f2
morris821028/UVa
OnlineJudge/ZEROJUDGE/BST(Descartes).cpp
#include <stdio.h> #include <algorithm> #include <string.h> using namespace std; struct Node { int key, value; int lson, rson, parent; }; Node D[65536]; void insertCartesianTree(int index, Node D[]) { int p = index - 1; while(D[p].value > D[index].value) p = D[p].parent; D[index].lson = D[p]...
ALGO
0.999986
4.293707
aef7dbc3-1053-4711-ad77-87f988738c86
gokulmaran/SDE-Role
2. DSA/13) Linked List/Slow&FastPointers/LinkedListCycle.cpp
#include <iostream> using namespace std; // Definition for singly-linked list node struct ListNode { int val; ListNode* next; ListNode(int x) : val(x), next(nullptr) {} }; //Link: https://leetcode.com/problems/linked-list-cycle/ // Class containing the hasCycle function class Solution { public: bool h...
ALGO
0.999641
6.444831
99cc1bcf-e998-42e4-b629-6de45974c311
nitink3006/Code_chef
tax_in_chefland.cpp
#include <iostream> using namespace std; int main() { int t; cin>>t; for(int i=0;i<t;i++){ int x; cin>>x; if(x<100){ cout<<x<<endl; } else if(x>100){ cout<<(x-10)<<endl; } else{ cout<<x<<endl; } } return 0; }
ALGO
0.999673
3.397375
c9e67396-5f76-4e86-b62d-6250ddf03d43
fhfuih/CodeIT-Suisse-2019-Pig1Dan
cpp/technicalAnalysis/technicalAnalysis.cpp
#include <bits/stdc++.h> #include "../rapidjson/document.h" #include "../rapidjson/prettywriter.h" using namespace rapidjson; using namespace std; const int maxn = 105; const int maxk = 5; const double pi = acos(-1.0); int K; int N; vector<int> arr[maxk]; void input(const char *path) { ifstream file(path); ...
ALGO
0.997574
3.174767
10bea7a5-a12b-41f7-94c8-0b957c1e3abd
lamphanviet/competitive-programming
uva-online-judge/accepted-solutions/10849 - Move the bishop.cpp
/*****************/ /* LAM PHAN VIET */ /* UVa: 10849 - Move the bishop /* Time limit: 3.000s /********************************/ #include <algorithm> #include <bitset> #include <cctype> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <queue> #include <stack> #include <s...
ALGO
0.999815
3.555721
2dded54a-555a-401f-923a-4b6ef84d9786
DanielWaldene/CS
PA4/PA4/src/LCS.cpp
#include "LCS.hpp" using namespace std; LCS::LCS(const string &s1,const string &s2){ str1=s1; str2=s2; row = str1.length(); col = str2.length(); lcs_matrix.resize(row+1,vector<int>(col+1, 0)); b_matrix.resize(row+1, vector<int>(col+1,0)); }; void LoadStrings(vector<string>&str,const string &stri...
ALGO
0.998258
4.309664
b44dc56d-a637-4d09-93bb-c150ea048369
chiranjib22/DSA_Abdul_Bari_Udemy_Course
Array/multiple_missing_number_in_array_sorted_and_unsorted.cpp
#include <iostream> using namespace std; int main() { int A[11] = {6, 7, 8, 9, 11, 12, 15, 16, 17, 18, 19}; // method 1(only worked in sorted array) O(n) /* int diff = A[0] - 0; for (int i = 0; i < 11; i++) { if (A[i] - i != diff) { while (diff < A[i] - i) { cout << "The missi...
ALGO
0.99916
4.097611
dbc4e4ee-a7ae-453e-b5d0-eed972b71081
Dpramax19/IIP-Sexto-Codelab
shrine/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.998194
6.76073
6a3eaa6a-0e54-4ebf-a202-803fc730c7f0
Codeblade98/DSACodes
Recursion/rec_num_denominations.cpp
//This program does not work as we require number of combinations but it gives number of permutations #include<bits/stdc++.h> using namespace std; //denominations in terms for 3,5,10 int num_of_denominations(int n) { if(n == 3 or n == 5 or n == 10) { return 1; } if(n < 3) { return...
ALGO
0.999399
4.529485
c3923f70-06c9-41d5-a8c1-6e34b36cc05d
Bhavshresth/DataStructureAlgos
optimalWaytofindOutPower.cpp
//to find power of a number #include<iostream> using namespace std; int power(int a,int n){ int ans=1;//use long long int for high values while(n>0){ if(n%2==1){ ans*=a; } n/=2; a*=a;//use mod for higher values mod=10^9+7 %mod } return ans; } int main(){ int n=2,a=6; cout<<power(n,a)<<endl; return...
ALGO
0.999949
3.909196
af0bd326-de65-468a-8e6a-c37abb8ec865
Swarangi-7711/CNS_Codes
Caesar Cipher.cpp
#include <iostream> #include <string> using namespace std; string encrypt(string text, int shift) { string result = ""; for (int i = 0; i < text.length(); i++) { if (isupper(text[i])) { result += char(int(text[i] + shift - 65) % 26 + 65); } else if (islower(text[i])) { ...
ALGO
0.999839
6.198682
419c7a42-4e9a-40a3-b2d4-e59d1f622aac
TheShiveshMishra/apna-C--
space.pattern.cpp
#include<iostream> using namespace std; int main() { int n; cin>>n; int i=1; while(i<=n) { int space=n=i; while(space) { cout<<" "; space=space-1; } int j=1; while(j<=i) { cout<<"*"; j++; } cout<<endl; i++; } return 0; }
ALGO
0.999963
3.662933
f6b7bffe-d9bf-445e-b914-32d205d0ff2f
samek567/ZadaniaAlgorytmiczne
OKI_2022_2023_ZAWANSOWANE/challange8_lotniska_zachlan_100pkt.cpp
#include <iostream> #include <vector> #include <algorithm> using namespace std; int n = 0; vector<int> ile; vector<vector<int>> wystapienia; int main() { // Zachlan. ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); cin >> n; ile.assign(n,0); for (int i = 0; i < n; ++i) cin...
ALGO
0.999985
3.481099
2091ee4a-40bf-4138-b717-3100554866fd
mr-mamun-50/Codeforces-Problems-Solution
1296A. Array with Odd Sum.cpp
#include<bits/stdc++.h> #define mamun() ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); #define endl '\n' #define tab '\t' #define ll long long #define lli long long int #define pb push_back #define fin(file) freopen(file".txt", "r", std...
ALGO
0.999701
3.678138
b58d71c4-0f07-4768-b767-0bdc2413e3df
hacch141/Coding-Practice
GFG/String/02.Medium String Problems/01.Sort-Characters-by-frequency.cpp
// Sort Characters by frequency string sortByFrequency(int n, string& s) { // Write Your Code here unordered_map<char,int> mp; for(auto i : s) { mp[i]++; } priority_queue<pair<int,char>> pq; for(auto i : mp) { pq.push({i.second,i.first}); } string ans; while(!pq.empty()) { ...
ALGO
0.999954
6.259251