uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
d5349a6c-514d-4f89-aabf-38bddcc34f15 | alexpopovici0/metin2server-project | src/etc/boost_1_72_0/libs/graph/test/eccentricity.cpp | #include <iostream>
#include <boost/graph/undirected_graph.hpp>
#include <boost/graph/directed_graph.hpp>
#include <boost/graph/floyd_warshall_shortest.hpp>
#include <boost/graph/eccentricity.hpp>
#include <boost/graph/exterior_property.hpp>
#include <boost/graph/property_maps/constant_property_map.hpp>
using namespa... | ALGO | 0.998842 | 5.746277 |
35f7b005-554c-44dc-8095-d4796567c613 | Bryant0618/2023aaib3 | week07/week07-2b.cpp | class Solution {
public:
void myDrawBoard(int board[3][3]){
for(int i=0;i<3;i++){
for(int j=0;j<3;j++){
cout<<board[i][j]<<" ";
}
cout<<"\n";
}
cout<<"\n";
}
bool testWin(int board[3][3],int now){
if(board[0][0]==now && boar... | ALGO | 0.999951 | 6.17102 |
74889732-2276-4e93-9edb-69de2145ea04 | sanyamdtu/competitive_programming | practice_codes/DP_2/miser_man.cpp | /*
Miser Man
Send Feedback
Jack is a wise and miser man. Always tries to save his money.
One day, he wants to go from city A to city B. Between A and B, there are N number
of cities(including B and excluding A) and in each city there are M buses numbered
from 1 to M. And the fare of each bus is different. Means for a... | ALGO | 0.999987 | 3.582839 |
3f15835e-ec7d-4b7b-9781-cd962b2a33af | Pulakesh5/_DSA_ | FEBRUARY 2025/26 February/1749. Maximum Absolute Sum of Any Subarray LC.cpp | class Solution {
public:
int maxAbsoluteSum(vector<int>& nums) {
int maxSum = 0, minSum = 0;
int mx_sum = 0, mn_sum = 0;
for(int num:nums)
{
mx_sum += num;
mn_sum += num;
if(mx_sum > maxSum)
maxSum = mx_sum;
... | ALGO | 0.999945 | 6.089194 |
87cad857-97d1-4771-9db5-011ca107c0e0 | ngthanhtrung23/CompetitiveProgramming | codeforces/533/B.cpp | #include <bits/stdc++.h>
#define int long long
#define FOR(i,a,b) for(int i=(a),_b=(b); i<=_b; ++i)
#define FORD(i,a,b) for(int i=(a),_b=(b); i>=_b; --i)
#define REP(i,a) for(int i=0,_a=(a); i < _a; ++i)
#define DEBUG(X) { cout << #X << " = " << X << endl; }
#define PR(A,n) { cout << #A << " = "; FOR(_,1,n) cout << A... | ALGO | 0.999839 | 3.879542 |
8295cbb4-5cc8-43d3-9624-fd170343bd6a | lilinj2000/leetcode | c/src/utility.cpp | #include "utility.h"
utility* utility::instance()
{
static utility utility_;
return &utility_;
}
ListNode* utility::buildList(int A[], int n)
{
ListNode* head = NULL;
ListNode* cur = NULL;
for(int i=0; i<n; i++)
{
ListNode* node = new ListNode(A[i]);
if( NULL==head )
head = node;
if... | TOOL | 0.948263 | 4.5531 |
c0901dbb-4282-4023-8f4d-21eb106c4f57 | gpenalozap/proyectoalfa | TJU/tju2468.cpp | #include<map>
#include<string>
#include<vector>
#include<iostream>
#include<algorithm>
using namespace std;
int main(){
vector<char> l;
map<char, int> s;
map<char, int>::iterator it;
string a;
int n;
cin>>n;
while(n--){
cin>>a;
int m = -1;
for( int i = 0 ; i < a.siz... | ALGO | 0.999883 | 4.042196 |
b8c40e82-9863-4de4-836a-50f1cf57b3a4 | maruf-rahad/lightoj | 1183 - Computing Fast Average2.cpp | #include<bits/stdc++.h>
using namespace std;
#define mx 100010
int tree[mx*4];
int prop[mx*4];
void init(int node,int b,int e)
{
tree[node] = 0;
prop[node] = -1;
if(b==e)
{
return;
}
int mid = (b+e)>>1;
int left = node<<1;
int right = node<<1|1;
init(left,b,mid);
init(... | ALGO | 0.99991 | 3.480344 |
e27c4576-551d-40a9-a3e6-815377e952f4 | HsxMark/SUES-Coding | OOP/Chapter02/Q1.1.cpp | #include <iostream>
using namespace std;
int isPrime(int n)
{
// 处理小于等于1的情况
if (n <= 1)
{
return 0;
}
// 处理2和3的情况
if (n == 2 || n == 3)
{
return 1;
}
// 处理其他情况
if (n % 2 == 0 || n % 3 == 0)
{
return 0;
}
for (int i = 5; i * i <= n; i += 6)... | ALGO | 0.999857 | 3.530011 |
cb65b34a-de01-41de-8afc-b209a55a892a | maydev18/DAA | dynamic programming/subset sums/knapsack.cpp | /* Knapsack - find the maximum value you can get in the knapsack so that the value is maximized if the weight of knapsack is W. We will be using dp to do so.
Time- O(n * W)
Space- O(n * W)
*/
#include <iostream>
#include <fstream>
#include <vector>
using namespace std;
class SubsetSum{
public:
int * weight;... | ALGO | 0.999996 | 4.465008 |
2a24b811-92c2-4c53-81b8-c0c55aae6601 | furkankurtoglu/CRC-Organoid | PhysiCell_v.1.6/BioFVM/BioFVM_basic_agent.cpp | #include "BioFVM_basic_agent.h"
#include "BioFVM_agent_container.h"
#include "BioFVM_vector.h"
namespace BioFVM{
std::vector<Basic_Agent*> all_basic_agents(0);
Basic_Agent::Basic_Agent()
{
//give the agent a unique ID
static int max_basic_agent_ID = 0;
ID = max_basic_agent_ID; //
max_basic_agent_ID++;
//... | ALGO | 0.937736 | 6.50698 |
035731c8-0910-4abd-9c6b-4262c34c3943 | cal-poly-csc530-2214/program-analysis-using-constraints-ziweiwu | src/smt/qi_queue.cpp | #include "util/warning.h"
#include "util/stats.h"
#include "ast/ast_pp.h"
#include "ast/ast_ll_pp.h"
#include "ast/rewriter/var_subst.h"
#include "smt/smt_context.h"
#include "smt/qi_queue.h"
namespace smt {
qi_queue::qi_queue(quantifier_manager & qm, context & ctx, qi_params & params):
m_qm(qm),
... | TOOL | 0.981424 | 6.467392 |
b5cf4833-3e53-4ed6-b35b-b79ea42298c9 | Yakumorin/Leetcode | 273. Integer to English Words.cpp | string number[]={"Zero", "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine","Ten", "Eleven","Twelve","Thirteen","Fourteen","Fifteen","Sixteen","Seventeen","Eighteen","Nineteen"};
string tens[]={"Twenty", "Thirty", "Forty", "Fifty", "Sixty", "Seventy", "Eighty", "Ninety"};
class Solution {
publi... | ALGO | 0.986752 | 6.004157 |
c441877e-fe38-47e9-9580-321ae624b161 | savthe/competitive-programming | acmp/binsearch/I. Дипломы/diplomas.cpp | #include <iostream>
using namespace std;
int main()
{
uint64_t w, h, n;
cin >> w >> h >> n;
uint64_t a = 1, b = max(w*n, h*n);
while(a < b)
{
uint64_t m = (a+b)/2;
if((m/w)*(m/h) >= n) b = m;
else a = m + 1;
}
cout << a << endl;
}
| ALGO | 0.999763 | 4.12454 |
2fb4c3d1-efe9-4bae-9462-3e223a5ce183 | inavkiratsingh/old_college_ds_with_oops | oops machine exercise 1/seventh.cpp | // sixth program
#include <iostream>
using namespace std;
int main() {
int numbers[10];
int evenCount = 0, oddCount = 0, zeroCount = 0;
// Input the array elements
for (int i = 0; i < 10; ++i) {
cout << "Enter " << i + 1 << " value : ";
cin >> numbers[i];
}
// Count even and ... | ALGO | 0.981771 | 5.138614 |
847949ca-03c7-45d1-92e9-1d8b4501eea6 | guoyujian/LeetCode | 探索/初级算法/树/1. 二叉树的最大深度/code.cpp | /*
* @Author: MetGuo
* @Date: 2020-05-06 11:16:02
* @Last Modified by: MetGuo
* @Last Modified time: 2020-05-06 11:24:58
*/
#include <stdio.h>
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* struct TreeNode *left;
* struct TreeNode *right;
* };
*/
struct TreeNode {
... | ALGO | 0.999436 | 5.513798 |
5a501c58-99a4-4031-8ea8-804c0b42a8ba | san-k0904/DSA-learning | Arrays_1D/rotatedsort_array.cpp | #include<iostream>
using namespace std;
int RotatedArray_Search(int arr[],int n,int target){//we don't get the index at which it is roatated coz that is supposed to be unknown and we don't have to write code to roatate it just take an example
int low=0;
int high= n-1;
int mid;
while(low<=high){
... | ALGO | 0.999931 | 5.439502 |
bf1dc64a-5f9e-466b-b617-f8e121b41745 | sarvex/leetcode-bash | solution/2400-2499/2439.Minimize Maximum of Array/Solution.cpp | class Solution {
public:
int minimizeArrayValue(vector<int>& nums) {
int left = 0, right = *max_element(nums.begin(), nums.end());
auto check = [&](int mx) {
long d = 0;
for (int i = nums.size() - 1; i; --i) {
d = max(0l, d + nums[i] - mx);
}
... | ALGO | 0.999986 | 6.047309 |
340aae97-0fdc-4441-907b-50622c37a1a4 | temanisparsh/leetcode | solutions/easy/1464.cpp | #include<iostream>
#include<bits/stdc++.h>
using namespace std;
class Solution {
public:
int maxProduct(vector<int>& nums) {
sort(nums.begin(), nums.end());
int n = nums.size();
return (nums[n-1]-1)*(nums[n-2]-1);
}
}; | ALGO | 0.999794 | 4.722588 |
a865920a-b542-415b-a407-d58bb08b2ea2 | bolatov/leetcode | 0853_car-fleet.cpp | class Solution {
public:
int carFleet(int target, vector<int>& position, vector<int>& speed) {
int n = position.size();
int ans = 0;
vector<pair<int, double>> vp(n);
for (int i = 0; i < n; i++) {
double time = (target-position[i]) / (double) speed[i];
vp[i] = ... | ALGO | 0.999578 | 5.923971 |
442e7590-c4ec-4f22-adfa-2551faef17df | kei1107/algorithm | problems/AOJ/AOJ2885.cpp | #include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int INF = 1e9;
const ll LINF = 1e18;
inline ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
inline ll lcm(ll a, ll b) { return a / gcd(a, b)*b; }
template<class S,class T> ostream& operator... | ALGO | 0.999867 | 4.620906 |
af75edd9-28f3-44c1-a27b-29222fbdbf54 | kotabrog/mycode_competition | AtCoder_Problems/ABC/B/128_Guidebook/main.cpp | #include <bits/stdc++.h>
using namespace std;
bool f_comp(pair<string, pair<int, int>> p1, pair<string, pair<int, int>> p2)
{
if (p1.first < p2.first)
return (true);
else if(p1.first > p2.first)
return (false);
else
{
if (p1.second.first > p2.second.first)
return (true);
else
return... | ALGO | 0.998924 | 3.897382 |
c77aed2e-c5e3-453f-8a6c-5fbeb3149610 | tenstorrent/tt-metal | ttnn/cpp/ttnn/operations/experimental/transformer/rotary_embedding_llama/device/kernels/compute/rotary_embedding_llama_sharded.cpp | #include <cstdint>
#include "compute_kernel_api/common.h"
#include "compute_kernel_api/eltwise_binary.h"
#include "compute_kernel_api/bcast.h"
#include "compute_kernel_api/matmul.h"
ALWI void ACQ() { acquire_dst(); }
ALWI void REL() { release_dst(); }
namespace NAMESPACE {
void MAIN {
constexpr uint32_t onetile ... | ALGO | 0.999378 | 6.883254 |
fbe41d79-6b13-4677-936b-220a8bdf8680 | Madhu-Biradakota/Mutation-Testing-using-DeepState | Final_SM_2/StringManipulator.mutant.150.cpp | #include "StringManipulator.h"
#include <algorithm>
#include <cctype>
#include <sstream>
#include <iterator>
#include <map>
#include <stdexcept>
#include <locale>
#include <regex>
#include <numeric>
std::string StringManipulator::reverse(const std::string& str) {
std::string reversed = str;
std::reverse(revers... | TOOL | 0.873096 | 6.462932 |
c6018523-97e4-436a-a4fa-753b9b853574 | manoj26052004/c-programming | no in between.cpp | #include <stdio.h>
int main() {
int P = 60;
int Q = 70;
int R = 3;
int i;
for (i = P; i <= Q; i++) {
if (i % 10 == R || i / 10 == R) {
continue;
}
printf("%d\n", i);
}
return 0;
}
| ALGO | 0.997971 | 3.024604 |
1fa4f552-34ff-480f-8e98-f5028ea2e843 | zhaojinm/418a4 | libigl/include/igl/repmat.cpp | template <typename DerivedA, typename DerivedB>
IGL_INLINE void igl::repmat(
const Eigen::MatrixBase<DerivedA> & A,
const int r,
const int c,
Eigen::PlainObjectBase<DerivedB> & B)
{
assert(r>0);
assert(c>0);
// Make room for output
B.resize(r*A.rows(),c*A.cols());
// copy tiled blocks
for(int i = 0... | ALGO | 0.985062 | 4.183321 |
75819afd-6daf-4d64-8535-4d3cfe5a7f66 | rverma510/Coding-Problems | 11_DynamicProgramming/42_waysToCoverADistance.cpp | #include <iostream>
#include <vector>
using namespace std;
int recursiveWay(int n) {
if (n == 0)
return 1;
if (n < 0)
return 0;
return recursiveWay(n - 1) +
recursiveWay(n - 2) +
recursiveWay(n - 3);
}
int memoizedWayHelper(int n, int *arr) {
if (n == 0)
... | ALGO | 0.999992 | 4.726684 |
14701f27-4ae0-400f-baa0-3e21516df9e9 | luv2027/Leetcode_POTD | 2962. Count Subarrays Where Max Element Appears at Least K Times.cpp | class Solution {
public:
long long countSubarrays(vector<int>& nums, int k) {
int n = nums.size();
int left = 0;
long long ans = (long long)(n)*(n+1)/2;
int maxi = INT_MIN;
int c = 0;
for(auto x:nums){
maxi = max(maxi, x);
}
long long not... | ALGO | 0.999987 | 5.802867 |
1219caa7-fbbc-4739-b341-7cf7d3a105c6 | johanvdw/SAGA-gis-git-mirror | saga-gis/src/tools/grid/grid_calculus/grid_histogram_match.cpp | //---------------------------------------------------------
#include "grid_histogram_match.h"
///////////////////////////////////////////////////////////
// //
// //
// ... | ALGO | 0.971629 | 5.535406 |
27ec722e-789e-4a9a-a3f8-4fdb4e99a1b9 | robertwyb/Computer-graphic-assignments | computer-graphics-bounding-volume-hierarchy/libigl/include/igl/barycentric_to_global.cpp | // For error printing
#include <cstdio>
#include <vector>
namespace igl
{
template <typename Scalar, typename Index>
IGL_INLINE Eigen::Matrix<Scalar,Eigen::Dynamic,Eigen::Dynamic> barycentric_to_global(
const Eigen::Matrix<Scalar,Eigen::Dynamic,Eigen::Dynamic> & V,
const Eigen::Matrix<Index,Eigen::Dynamic,... | ALGO | 0.987078 | 6.49001 |
133939f9-1966-45dc-81ec-7e1a0c4bd4a2 | mutekichi/AtCoder | ABC/376/b.cpp | #include <iostream>
#include <stdio.h>
#include <cstdio>
#include <string>
#include <vector>
#include <algorithm>
#include <iterator>
#include <functional>
#include <numeric>
#include <map>
#include <set>
#include <list>
#include <queue>
#include <stack>
#include <deque>
#include <bitset>
#include <utility>
#include <c... | ALGO | 0.99978 | 3.212166 |
898a50c0-9cc0-4377-b362-ff5fe3508a97 | linhmonkaist/Algorithm | done/auxx.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int m[]= {20,2,0,0,3,0,4,5,0,7,0,0,3,4};
vector<int> v(m, m + 14);
int begin= 0, t=0, cur=0, n=14, k=7;
int sum= 0, count= 0;
while(cur < n && sum < k){
sum += v[cur];
cur++;
}
cur--;
while (cur < n){
... | ALGO | 0.999761 | 3.603573 |
7ab15b3b-b3b8-492a-9dea-c360d73a9563 | KimNattanan/compet | otog/903_boringpath.cpp | #include<bits/stdc++.h>
using namespace std;
#define endl '\n'
#define eb emplace_back
#define pb push_back
using pii=pair<int,int>;
using ll=long long;
#define f first
#define s second
vector<pii> adj;
map<pii,ll> dp;
vector<tuple<int,int,int,int>> edge;
ll a[100005],mx[100005],ans[100005];
int P[100005];
int fSet(in... | ALGO | 0.999991 | 4.153372 |
e855ec8b-06b7-4af0-877f-eb45d24bbca1 | RamazanFIT/algorithms | part1/lab4/t1.cpp | #include <bits/stdc++.h>
#define ENDL "\n"
#define ff first
#define ss second
#define all(x) (x).begin(), (x).end()
#define endd return 0;
#define goodluck ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);
using ll = long long;
using namespace std;
struct Tree{
Tree * left;
Tree * right;
int va... | ALGO | 0.999985 | 4.056213 |
b655ea6c-eab9-4759-ba42-0e0a29fe39f2 | Abhi2622/adaptive_theme_manager | adaptive_theme_example/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.998715 | 6.76775 |
62964d28-4851-48d1-af29-36ad04ff1eba | manojsmkg/problem-solving | 0136-single-number/0136-single-number.cpp | class Solution {
public:
int singleNumber(vector<int>& nums) {
int xorOutput=0;
for(int i=0;i<nums.size();i++)
{
xorOutput = xorOutput ^ nums[i];
}
return xorOutput;
}
}; | ALGO | 0.999985 | 5.608567 |
8a7920e2-1a7f-4f04-83cc-240f28c4b745 | shalinivaggu/leetcode150 | 0747-min-cost-climbing-stairs/0747-min-cost-climbing-stairs.cpp | class Solution {
public:
int minCostClimbingStairs(vector<int>& cost) {
int n = cost.size();
int prev1 = 0 , prev2 = 0 ;
for(int i = 2 ; i <= n ; i++) {
int step1 = prev1 + cost[i-1];
int step2 = prev2 + cost[i-2];
prev2 = prev1;
prev1 = min(... | ALGO | 0.999949 | 5.97776 |
94666318-d781-4a7e-a141-c294cb5d2dc3 | ayush73/CodeForces-Solutions | div.2_D/1036D.cpp | #include<bits/stdc++.h>
typedef long long int ll;
#define elif else if
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define rep(i,a,b) for(ll i=a;i<b;i++)
#define cerr A
using namespace std;
void solve()
{
ll n,m;
cin>>n;
vector<ll> a,b;
ll sum1=0,sum2=0;
rep(i,0,n)
{
... | ALGO | 0.999949 | 3.375378 |
0990dbfc-4e57-4f08-b40a-4e1933dc2c9d | Raemerrr/AlgorithmProblemsSolved | src/BOJ/22/02/BOJ_1135_뉴스 전하기_220218.cpp | #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
int N;
vector<vector<int>> v;
int dfs(const int cur){
int result = 0;
int weight = v[cur].size();
vector<int> temp;
for (const int _next : v[cur]) {
temp.push_back(dfs(_next));
}
sort(tem... | ALGO | 0.999759 | 4.09357 |
f1188563-2b5c-43ce-97a4-a56bf7efb322 | shivamgohri/ds_codes | DP/combinationSum4.cpp | #include <bits/stdc++.h>
using namespace std;
typedef unsigned long long int ull;
typedef long long ll;
#define pb push_back
#define mp make_pair
#define MAX (int)1e7+5
int combinationSum4(vector<int>& nums, int target) {
if(nums.empty()){
if(target==0){
return 1;
}
else{
return 0;
}
}
vector<dou... | ALGO | 0.99986 | 5.215822 |
66f7faed-4d18-4de8-8558-d0981b7a4e24 | Sinchiguano/Algorithmic-Toolbox | STL/binary_search.cpp | //#include "binary_search.h"
#include <iostream>
#include <algorithm>
#include <vector>
#include <array>
using namespace std;
//IDE integrated development enviroment
//Compile my code
//g++ -std=c++14 -o temp sort.cpp
bool compare_string_by_length (string i,string j)
{
return (i.size() == j.size());
}
int main ()
... | TOOL | 0.993062 | 4.514595 |
f9fb4fa1-fafb-42a8-abc7-083216ba210a | Ace929/TheLandBeforeTime | art.cpp | #include <iostream>
#include <fstream>
#include <sstream>
#include <vector>
#include <string>
#include <iomanip>
#include <ctime>
#include <cstdlib> // for std::atof
#include <algorithm> // for std::sort
#include <TApplication.h>
#include <TCanvas.h>
#include <TGraph2D.h>
#include <TAxis.h>
#include <TStyle.h>
/**... | TOOL | 0.948136 | 7.080461 |
75f2eabf-fb5e-4a07-9088-e5dd0381db85 | yzzupgo/MFTCG | Data/abc206_a/Juntendou/wa/23593345.cpp | #include<iostream>
int main(void) {
int n;
std::cin >> n;
n *= 1.08;
if(n > 206) {
std::cout << ":(" << std::endl;
} else if(n == 206) {
std::cout << "so-so" << std::endl;
} else {
std::cout << "Yey!" << std::endl;
}
}
| ALGO | 0.993387 | 3.125682 |
298575f9-2769-4564-aa1b-5f7173983692 | YuDe0418/Cpp_practice | NTOJ/578.cpp | <<<<<<< HEAD
#include <bits/stdc++.h>
using namespace std;
signed main(void)
{
int n; cin >> n;
for(int i=1;i<n;i+=2)
{
cout << i << "\n";
}
=======
#include <bits/stdc++.h>
using namespace std;
signed main(void)
{
int n; cin >> n;
for(int i=1;i<n;i+=2)
{
cout << i << "\n";
... | ALGO | 0.997896 | 3.629592 |
f4d4829a-6621-48c5-8cc8-1ed74b236b09 | paolo-torres/interview-prep | leetcode/bloomberg/all/maximum_subarray.cpp | /*
Given int array, find contiguous subarray w/ max sum
Ex. nums = [-2,1,-3,4,-1,2,1,-5,4] -> 6, [4,-1,2,1]
Brute force: for each num at i, loop thru each num j = i & track max
At each point, determine if it's better to add to curr sum or start over
Time: O(n)
Space: O(1)
*/
class Solution {
... | ALGO | 0.999907 | 6.662885 |
3870daa7-56b0-4b75-86df-13a17e96e3a0 | simplewithalex/MyJZOfferSln | JianZhiOffer/II 057.值和下标之差都在给定的范围内.cpp | #include "header.h"
/*
һ nums k t
жǷͬ± i jʹ abs(nums[i] - nums[j]) <= t ͬʱ abs(i - j) <= k
trueڷ false
ʾ 1
룺nums = [1,2,3,1], k = 3, t = 0
true
ʾ 2
룺nums = [1,0,1,1], k = 1, t = 2
true
ʾ 3
룺nums = [1,5,9,1,5,9], k = 2, t = 3
false
ʾ
0 <= nums.length <= 2 * 10^4
-2^31 <= nums[i] <= 2^31 - 1
0 <= k <= 10^4
... | ALGO | 0.999956 | 6.196501 |
c6b9ca3e-3cf3-4ab0-8bb2-174c7eb501da | acnokego/LeetCode | 451_Sort_Characters_By_Frequency/try.cpp | class Solution {
/*
* Complexity: O(nlgn)
* Space: O(n)
*/
public:
string frequencySort(string s) {
string ans = "";
unordered_map<char, int>occurrence;
for(char& c : s){
occurrence[c] += 1;
}
vector<pair<char,int>>occur_vec(occurrence... | ALGO | 0.999981 | 6.169495 |
07d7c986-1bfe-4cce-aa61-927e5c8d1059 | JosipCestar/SPA2Zadace22-23 | zadaca2/program1Cestar.cpp | #include <iostream>
#include <list>
#include <random>
#include <vector>
#include <ctime>
#include <algorithm>
using namespace std;
vector<int> dobiznamenke(int broj) {
vector<int> znamenke;
if (broj == 0)
return {0};
while (broj > 0) {
znamenke.push_back(broj % 10);
broj /= 10;
... | ALGO | 0.99846 | 4.359864 |
94c346ec-020c-4cc1-b997-9f63096d0aff | Time1ess/MyCodes | LeetCode/442-Find All Duplicates in an Array/solution.cpp | // Author: David
// Email: <EMAIL>
// Created: 2017-03-02 10:44
// Last modified: 2017-03-02 10:45
// Filename: solution.cpp
// Description:
class Solution {
public:
vector<int> findDuplicates(vector<int>& nums) {
vector<int> ans;
int size = nums.size();
int idx;
for(int i=0; i < siz... | ALGO | 0.999993 | 5.549758 |
75e04581-b601-4d55-a194-54186fa2c527 | hreinhart/Projects | C++/Projects/Heaps/Phase3Main.cpp | #include <iostream>
using namespace std;
#include "CircularDynamicArray.cpp"
#include "Heap.cpp"
#include "FibHeap.cpp"
//inside FibHeap.cpp the definitition of FibHeapNode is expected, for example:
//template <typename keytype>
//struct FibHeapNode {
// keytype x;
// FibHeapNode<keytype> *ptr;
// etc. You m... | ALGO | 0.999739 | 3.41913 |
5889d1e5-bf4c-4025-9c76-84c923d7ed58 | prasanna-sai/Leetcode | Top Interview Questions/Striver/JobSequencingProblem.cpp | /*struct Job
{
int id; // Job Id
int dead; // Deadline of job
int profit; // Profit if job is over before or on deadline
};
*/
class Solution
{
public:
static bool compare(Job a, Job b)
{
return a.profit > b.profit;
}
//Function to find the maximum profit and the number o... | ALGO | 0.999972 | 5.633543 |
00c95725-3d95-4020-a054-5e3995608e68 | neppiness/TIL | problem-solving/boj/random-defense/1331-12-15-2023.cpp | #include <bits/stdc++.h>
using namespace std;
string b[37];
bool vis[6][6];
bool solve() {
for (int i = 0; i < 6; i++)
for (int j = 0; j < 6; j++)
if (!vis[i][j]) return 0;
for (int i = 0; i < 36; i++) {
int j = (i + 1) % 36;
int drow = abs(b[i][1] - b[j][1]);
int dcol = abs(b[i][0] - b[j][... | ALGO | 0.999561 | 4.722232 |
f8e11268-be76-4f37-9687-50a535d01652 | a092devs/DSA-Practice | lecture 039 - recursion day 9/permutationOfString.cpp | #include<bits/stdc++.h>
using namespace std;
void solve(string str, vector<string> &ans, int index){
if (index >= str.length()){
ans.push_back(str);
return;
}
for (int i = index; i < str.length(); i++){
swap(str[index], str[i]);
solve(str, ans, index + 1);
swap(str[i... | ALGO | 0.999963 | 5.664944 |
18b8e28f-d943-456e-a33c-7bbf55da75af | kuntalojha/LeetCode-And-GFG | merge-sorted-array/merge-sorted-array.cpp | class Solution {
public:
void merge(vector<int>& nums1, int m, vector<int>& nums2, int n) {
int i = m - 1, j = n - 1, tar = m + n - 1;
while (j >= 0) {
nums1[tar--] = i >= 0 && nums1[i] > nums2[j] ? nums1[i--] : nums2[j--];
}
}
}; | ALGO | 0.999976 | 5.495974 |
4271d985-3487-4746-9679-72626e4a2848 | tekumalsaisaketh/codeforces | CodeForces/A20J/103_A.cpp | #include<bits/stdc++.h>
using namespace std;
void solve();
using ll = long long;
void solve()
{
int n;
cin>>n;
int maxi=INT_MIN,maxI=0,mini=INT_MAX,minI=0;
for(int i=0;i<n;i++)
{
int a;
cin>>a;
if(maxi<a)
{
maxi=a;
maxI=i;
}
if(mini>=a)
{
mini=a;
minI=i;
}
}
if(minI>maxI)
{
co... | ALGO | 0.999954 | 4.296839 |
42179915-2196-4ba7-ad5a-a007111b4535 | chandola/squad | src/ocsvm/sax.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <map>
#include <string>
#include <stdlib.h>
#include <math.h>
#include "sax.h"
using namespace std;
#define MININT -MAXINT;
void TStoPAA(vector<vector<float> > &sequences,vector<vector<float> > &paasequences,int segment){
if(segment <= 0){cerr<<"Erro... | ALGO | 0.995214 | 3.224377 |
0c4db49b-4d7e-4a99-a7d3-39d440d4a799 | charlotterbaker/C-Classwork | Data Structures & Algorithms (CSCE 350)/QuickSort.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
#include <chrono>
using namespace std;
//Median of 3 function
int medianOfThree(vector<float>& arr, int left, int right){
int mid = left + (right - left) / 2;
if (arr[left] > arr[mid]) swap(arr[left], arr[mid]);
if (arr[left] > ... | ALGO | 0.999594 | 5.41669 |
dce7f5e1-5bd0-4aa3-adfd-9f8bff60ddab | joshualass/CP | Solutions/Contests/AC/ABC397/G397.cpp | #include <bits/stdc++.h>
typedef long long ll;
typedef long double ld;
using namespace std;
/*
guessforces is no good here.
1) remove all edges in the graph that will be dead ends/cannot reach the sink
- this helps us find the mincut
nvm, copy algorithm to find min cut edges
5 8 8
1 2
1 2
2 3
1 4
1 4
4 3
3 5
... | ALGO | 0.99999 | 4.609579 |
865d6525-4c1a-4179-9e38-49e8d59ba4a6 | IULOVE/openedr | edrav2/eprj/boost/libs/graph/example/cuthill_mckee_ordering.cpp | #include <boost/config.hpp>
#include <vector>
#include <iostream>
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/cuthill_mckee_ordering.hpp>
#include <boost/graph/properties.hpp>
#include <boost/graph/bandwidth.hpp>
/*
Sample Output
original bandwidth: 8
Reverse Cuthill-McKee ordering starting a... | ALGO | 0.999987 | 5.66029 |
8a961854-467c-4208-80a9-b7f73c8d630e | Zimse12345/Code | Codeforces_Contest/CF2057/D.cpp | #include <bits/stdc++.h>
#define Lid (id<<1)
#define Rid (Lid|1)
#define M ((L+R)/2)
using namespace std;
const int N=2.01e5;
int T,n,q,a[N];
struct node{
int ln,lx,rn,rx,s;
node(int ln=0,int lx=0,int rn=0,int rx=0,int s=0):ln(ln),lx(lx),rn(rn),rx(rx),s(s){}
}t[N*8];
node merge(node x,node y){
return nod... | ALGO | 0.999458 | 4.319041 |
b46209f4-4e9d-4585-b280-ac653d9a46f4 | HongHyeRyeong/study_Problem-Solving | BOJ/2021/1208.cpp | #include<iostream>
#include<map>
using namespace std;
int N, S;
int arr[41];
long long answer;
map<int, int> subsum;
void MeetInTheMiddle(int start, int end, int sum)
{
if (start == end) {
if (end == N)
answer += subsum[S - sum]; // 2. (=S- ) ϱ
else
subsum[sum]++; // 1. ... | ALGO | 0.999981 | 3.786506 |
ff6bd10d-4cc8-491e-8586-dde711681601 | Sahenulislam/Spoj | 2021/Number of common divisors.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define fast \
ios_base::sync_with_stdio(false); \
cin.tie(NULL);
//long long lcm(ll a, ll b)
//{
// return (a / (__gcd(a, b))) * b;
//}
#define gcd __gcd
#define yes "YES"
#define no "NO"
#define pb push_back
#define... | ALGO | 0.999506 | 5.684824 |
6d3ed5fe-f188-4544-a141-b4ff7f1fa6ea | tekjar/flying-car | fcnd.projects/FCND-Controls-CPP/src/Simulation/opticalflow.cpp | #include "opticalflow.h"
void opticalflow::opticalflow_sensor(float dt, V3F position, V3F velocity, SLR::Quaternion<float> attitude, V3F omega, float &x_measurement, float &y_measurement){
x_measurement = (dt*N_pixel/aperture) * ((attitude.Rotate_ItoB(velocity).x / attitude.Rotate_ItoB(position).z) + omega_factor * ... | ALGO | 0.995523 | 4.855803 |
9cb267d8-0e09-4f38-a26d-75bdc0b10173 | arifaulakh/Competitive-Programming | DMOJ/itami_and_candy/main.cpp | #include<iostream>
#include<vector>
#include<cstring>
using namespace std;
int N, X;
vector<int> Sieve(int N){
vector<int> primes;
vector<bool> isprime(N+1, true);
for (int i = 2; i*i<=N; i++){
if(isprime[i]){
for (int j = i*i; j<=N; j+=i){
isprime[j] = false;
... | ALGO | 0.999713 | 3.701313 |
8fb48b68-763f-4e6b-becf-9dfbda6aa0ce | binarycraft007/libcronet | src/third_party/llvm-libc/src/src/math/generic/scalblnf.cpp | #include "src/math/scalblnf.h"
#include "hdr/float_macros.h"
#include "src/__support/FPUtil/ManipulationFunctions.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
#if FLT_RADIX != 2
#error "FLT_RADIX != 2 is not supported."
#endif
namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(float,... | ALGO | 0.960703 | 4.755024 |
7c722d2d-bb11-49a2-94e2-797cb27d43b6 | dfunke/mountains | code/isolation_finder_sl/tile_cell.cpp | #include "tile_cell.h"
#include "concurrent_isolation_results.h"
#include "spherical_math_util.h"
#include "../latlng.h"
#include "../lock.h"
#include "assert.h"
#include <algorithm>
#include <cmath>
using std::floor;
TileCell::TileCell(int minLat, int minLng, int offsetLat, int offsetLng) {
// build tree
mBott... | ALGO | 0.94952 | 6.630719 |
4370a9a4-fbb3-404a-83f7-118e16bc8e78 | MrChepe09/Competitive-Programming-Codes | 450 Codes/Array/16_inversion_count.cpp | #include <iostream>
using namespace std;
int merge(int arr[], int temp[], int low, int mid, int high)
{
int i = low;
int j = mid + 1;
int k = low;
int count = 0;
while (i <= mid && j <= high)
{
if (arr[i] <= arr[j])
{
temp[k] = arr[i];
k++;
i+... | ALGO | 0.999929 | 4.953572 |
00b90e95-c413-49e2-9f6d-52ebc6404580 | Udhaykondeti004/C-OOP-codes-Dump | Complex.cpp | #include<iostream>
using namespace std;
class Complex{
int a, b;
public:
Complex(){}
Complex(int a, int b){
this -> a = a;
this -> b = b;
}
void operator+=(Complex &op){
this -> a += op.a;
this -> b += op.b;
}
void o... | ALGO | 0.994872 | 4.235262 |
524f866f-23d0-403e-a4f5-10774c7c5adc | LZP206/proj_cpp | LeetCode/242-有效的字母异位词.cpp | using namespace std;
#include<iostream>
#include<string>
class Solution {
public:
bool isAnagram(string s, string t) {
int record[26] = {0};
for (int i = 0; i < s.size(); i++) {
record[s.at(i)-'a'] += 1;
}
for (int i = 0; i < t.size(); i++) {
record[t.at(... | ALGO | 0.999851 | 5.252185 |
de8ead50-6ee0-48b4-9bd8-5e9b4c8c01e5 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_11808_0.cpp | #include <bits/stdc++.h>
using namespace std;
int p[3010], maxp[3010];
int vis[3010][3010];
int n, k, cnt = 0;
void dfs(int a, int b, int t) {
if (vis[a][b]) return;
vis[a][b] = 1;
cnt++;
if (t == k || b >= n) return;
if (p[a]) {
if (maxp[b + 1]) dfs(b + 1, b + 2, t + 1);
if (maxp[b] != 100) dfs(a, b ... | ALGO | 0.999831 | 3.670745 |
399d4433-bcfd-4cfb-9afc-4e07aa82ece9 | tuxPT/so1718-t01g2 | soipc_t/utils.cpp | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include "sim-alloc.h"
#include "utils.h"
void* memAlloc(int size)
{
void* result = malloc(size);
check_alloc(result);
return result;
}
int randomBoolean(int trueProb)
{
double r = (double)rand()/(double)RAND_MAX; // [0;RAND_MA... | TOOL | 0.902399 | 5.185163 |
d967b915-fd64-4a49-b36c-7fca054ce713 | suev7245/acmicpc | 2_math/2292.cpp | /*벌집*/
#include <iostream>
#include <algorithm>
using namespace std;
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int n;
cin>>n;
int i, num=1;
for(i=1;;i++){
if(n<=num) break;
num += i*6;
}
cout<<i;
return 0;
} | ALGO | 0.999528 | 3.287221 |
d5bea6da-470c-485c-ac75-7a3efb62b0e5 | Lingg-1304/template-cpp | graph/chu trinh.cpp | #include <bits/stdc++.h>
#define fi first
#define se second
#define fast ios::sync_with_stdio(0)
#define ll long long
using namespace std;
typedef pair<int,int> II;
typedef pair <int,II> III;
int mod = 1e9+7;
bool visit[1001];
vector<int> v[1001];
int parent[1001];
int dfs(int u){
//cout<<u<<" ";
visit[u]=true... | ALGO | 0.999979 | 4.284639 |
6210643b-cbc3-4a91-889c-a89a6f9a57bb | Hiddenworld26/DSA_Questions | Strings/reversethefirsthalf.cpp | #include<iostream>
#include<string.h>
#include<algorithm>
using namespace std;
int main()
{
string str;
cout<<"Enter string : "<<endl;
getline(cin,str);
int len=str.length();
if(len%2==0)
{
reverse(str.begin(),str.begin()+len/2);
cout<<str;
}
else{
cout<<"No rever... | ALGO | 0.99982 | 3.148729 |
1a30eea9-da18-4276-b28f-f6e67e45edfd | sarvex/solution-cpp | 1021.remove_outermost_parentheses.cpp | class Solution {
public:
string removeOuterParentheses(string s) {
string ans;
int cnt = 0;
for (char& c : s) {
if (c == '(') {
if (++cnt > 1) {
ans.push_back(c);
}
} else {
if (--cnt) {
... | ALGO | 0.999489 | 6.235264 |
cc1f6b2a-8a4c-4700-b87e-0e929d2a3406 | TUS123456/DSAjourney | treee1.cpp | #include<bits/stdc++.h>
using namespace std;
class node{
public:
int data;
node *left;
node *right;
node(int data){
this->data=data;
this->left=NULL;
this->right=NULL;
}
};
node* build_tree(int data){
if(data==-1){
return nullptr;
}
node *root=new node(data);
int ldata;
cout<<"insert data for le... | ALGO | 0.999677 | 4.286609 |
fc8e73bd-68f0-4a13-a88a-0c63ba3090da | BhryanS2/studying-programming | URI/2413.cpp | #include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> PII;
typedef long long int LLI;
typedef unsigned long long int ULLI;
#define REP(i,n) for (int i=0; i<(n); ++i)
#define FOR(var,pocz,koniec) for (int var=(pocz); var<=(koniec); ++var)
#define FORD(var,pocz,koniec) for (int var=(pocz); var>=(koniec);... | ALGO | 0.997879 | 3.518383 |
34a9093b-28dd-4403-8fd1-6be080c4067e | msjtw/Algorithmics | potyczki_algorytmiczne/PA2025/day3/mno.cpp | #include <iostream>
#include <unordered_map>
using namespace std;
typedef long long int ll;
ll mul(ll a){
ll res = 1;
while(a > 0){
res *= a%10;
a /= 10;
}
return res;
}
int main(){
int t;
cin >> t;
for(int i = 0; i < t; i++){
int n;
cin >> n;
for(... | ALGO | 0.999862 | 5.04181 |
46139f3c-e613-470a-9480-c10a5773d5f4 | ashokabairwaideology/Leet-code-problem | solution/0000-0099/0050.Pow(x, n)/Solution.cpp | class Solution {
public:
double myPow(double x, int n) {
auto qpow = [](double a, long long n) {
double ans = 1;
for (; n; n >>= 1) {
if (n & 1) {
ans *= a;
}
a *= a;
}
return ans;
};
... | ALGO | 0.999928 | 5.985795 |
87b5f738-7df6-4bef-93f0-2d86dc88ad35 | Pooja22-05-2003/DataStructures_and_Algorithms2 | Core_Subjects/1_OOPS/06_Operator_Overloading/06_3_Pre_and_Post_Increment.cpp | #include <bits/stdc++.h>
using namespace std;
class Integer{
int a;
public:
Integer(int x)
{
a=x;
}
void showdata()
{
cout<<a<<endl;
}
// unary pre and post increment operator
Integer operator ++() // pre increment
{
int temp;
temp=++a;
... | ALGO | 0.89301 | 4.014264 |
79df5775-298f-49b9-84b2-735d6842da5e | Shamsullo/DS_Algorithm | DataStructure/Lab02/p05.cpp | #include <iostream>
using namespace std;
// Who is in the middle
main (){
int a; cin >> a;
int b; cin >> b;
int c; cin >> c;
if (a > b){
int temp = a;
a = b;
b = temp;
}
if(b > c){
int temp = b;
b = c;
c = temp;
}
if (a > b){
int temp = a;
a = b;
b = temp;
}
cout << b << endl;
} | ALGO | 0.999872 | 3.374268 |
f0aa98f1-0529-4a04-8a6f-44a0aed2bc5b | Crazy-German/BlastIntegration | PhysX-main/physx/source/geomutils/src/mesh/GuBV4_CapsuleSweep.cpp | #include "GuBV4.h"
#include "GuSweepSphereTriangle.h"
using namespace physx;
using namespace Gu;
#include "foundation/PxVecMath.h"
using namespace aos;
#include "GuInternal.h"
#include "GuBV4_BoxOverlap_Internal.h"
#include "GuBV4_BoxSweep_Params.h"
namespace
{
struct CapsuleSweepParams : BoxSweepParams
{
Capsu... | ALGO | 0.979465 | 7.68248 |
49a4e3c5-aec3-4cb5-8b0c-97680deb82f5 | rzbruno/eval | solved/FizzBuzz.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <sstream>
int main(int argc, char *argv[])
{
std::ifstream stream(argv[1]);
std::string line = "", temp = "", result = "";
std::vector<int> v;
int X=0, Y=0, N=0;
while (getline(stream, line)) {
std::stringstream os(line);
wh... | ALGO | 0.993857 | 3.554843 |
fcdfabd0-a59b-4e54-8ecd-cc4dc26f260a | Blixibon/source-2013-expanded-steam | sp/src/mathlib/spherical.cpp | #include <math.h>
#include <float.h> // Needed for FLT_EPSILON
#include "basetypes.h"
#include <memory.h>
#include "tier0/dbg.h"
#include "mathlib/mathlib.h"
#include "mathlib/vector.h"
#include "mathlib/spherical_geometry.h"
// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"
floa... | TOOL | 0.997074 | 5.758006 |
188c04fd-6605-4d57-8ff7-215bc9c8df01 | kgaurav3838/CPP-C-Data-Structures | StackReverseString.cpp | // Stack - reverse string implementation.
#include<iostream>
#include<cstdio>
#include<cstring> //or <string.h>
#include<stack> //stack from STL
using namespace std;
void ReverseString(char *C, int n)
{
int i;
stack<char> S; // creating stack object
for(i=0;i<n;i++)
{
S.push(C[i]);
}
... | ALGO | 0.999674 | 5.144371 |
ad685e23-4779-45ab-804f-4ac5c736f4b7 | alexandraback/datacollection | solutions_1482492_0/C++/skynet/b.cpp | #include <iostream>
#include <iomanip>
#include <queue>
using namespace std;
int main()
{
freopen("inp.txt", "r", stdin);
freopen("out.txt", "w", stdout);
int t;
double A[2222], T[2222], x[2222];
cin >> t;
for (int i=1;i<=t;i++)
{
int n, a;
double d;
cin >> d >> n >> a;
for (int j=0;j<n;j++)
cin ... | ALGO | 0.99983 | 3.180517 |
acc66142-5865-44ab-ae64-43cc93baf064 | Yuulis/AtCoderSolution_old | AtCoder/ABC/021~040/034/B.cpp | #include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using ll = long long;
using lld = long double;
using Graph = vector<vector<int>>;
using mint = modint998244353;
#define all(x) (x).begin(), (x).end()
constexpr auto PI = 3.14159265358979;
constexpr auto INF = 1e+9;
constexp... | ALGO | 0.999572 | 5.369433 |
05ed4233-aa2d-4046-bca7-a450fbe7a25c | ghislaindemael/AdventOfCode | 2024/Day4/main.cpp | #include <fstream>
#include <string>
#include <vector>
#include <iostream>
#include <sstream>
#define SIZE 140
std::vector<std::vector<char> > extractGrid(const std::string& inputFilename) {
std::ifstream inputFile(inputFilename);
std::vector<std::vector<char> > grid;
std::string line;
while (std::get... | ALGO | 0.993847 | 5.590337 |
d6a7e3cf-e1ea-4d6a-ba21-91a1fedbd0ab | YunSungJu/Repo-for-Baekjoon | C++/1003/main.cpp | #include <iostream>
#include <vector>
void fibo(std::pair<int,int> Zero_One[], unsigned int N) {
std::pair<int,int> pair;
for (unsigned int i=0; i<N; i++){
if (i==0){
pair.first = 1;
pair.second = 0;
Zero_One[0] = pair;
}else if (i==1){
pair.firs... | ALGO | 0.999888 | 3.889887 |
16d72435-d126-4ded-8fe4-2146f4501eae | taskflow/taskflow | 3rd-party/eigen-3.3.7/doc/examples/TutorialLinAlgInverseDeterminant.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace std;
using namespace Eigen;
int main()
{
Matrix3f A;
A << 1, 2, 1,
2, 1, 0,
-1, 1, 2;
cout << "Here is the matrix A:\n" << A << endl;
cout << "The determinant of A is " << A.determinant() << endl;
cout << "The inverse of A is:\n... | ALGO | 0.999764 | 4.186114 |
502f0518-4283-467e-9455-891eb990e1ff | thissidemayur/DSA-in-3-Languages | Array/cpp/2-slidingWindows/Q4-longestStrWithoutRepeatingChar.cpp | #include <vector>
using namespace std;
#include <iostream>
#include <limits.h>
#include <unordered_map>
/*3. Longest Substring Without Repeating Characters
Solved
Medium
Topics
premium lock icon
Companies
Hint
Given a string s, find the length of the longest substring without duplicate characters.
Example 1:
Input: s... | ALGO | 0.999485 | 5.746106 |
db48bbc9-51b3-4e4c-8722-1c6c7caf3015 | Stenardt-9002/CODECHEF-Datastructure-and-algo | Gfg_list/Microsoft_30_Days/Day10/2-remove_all_duplicates_linked_list.cpp | // https://practice.geeksforgeeks.org/batch/microsdaysoft-29/track/microsoft-29days-day10/problem/remove-all-occurences-of-duplicates-in-a-linked-list
#include <bits/stdc++.h>
#include<ext/pb_ds/tree_policy.hpp>
#include<ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds ;
typedef long... | ALGO | 0.999968 | 4.780466 |
20a88326-0aaa-4668-b6b9-3c372c81f0b0 | lajulienn/mipt-algorithms | 1_term/reverse_order/5_reverse_order/Source.cpp | #include <cstdio>
#include <cstdlib>
void reverse_order(int a[], unsigned lendth);
int main()
{
int lendth, i;
scanf("%d", &lendth);
int *a = (int *)malloc(lendth * sizeof(int));
for (i = 0; i < lendth; ++i)
{
scanf("%d", &a[i]);
}
reverse_order(a, lendth);
for (i = 0; i < lendth; ++i)
{
printf("%d ", a[... | ALGO | 0.999813 | 4.058527 |
d646d706-39f9-45d7-a8d8-9c2e6798846d | dhairyashil09/sample | task1_login_page/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.99795 | 6.76073 |
ae2663cc-f155-4145-9ba4-d058f840508b | CliffLinTw/gamer_non-uniform_AMR | src/LoadBalance/LB_Refine_AllocateNewPatch.cpp | #include "GAMER.h"
#ifdef LOAD_BALANCE
void PrepareCData( const int FaLv, const int FaPID, real *const FaData,
const int FaSg_Flu, const int FaGhost_Flu, const int NSide_Flu,
const int FaSg_Pot, const int FaGhost_Pot, const int NSide_Pot,
const int FaSg_Mag, co... | ALGO | 0.9713 | 3.862848 |
d8308efd-409a-434a-9d7f-78899d9e31a3 | dayvidjuni/trabajos | TrabajosUnidad2/Trabajo diario II unidad/eje55.cpp | /*-------------------------------------------------------------------
APELLIDO Y NOMBRE: DAYVID JUNIOR SUAQUITA CCANCCAPA
Semestre: I Unidad: II
---------------------------------------------------------------------
*/
#include <iostream>
#include <cmath>
#include <iomanip>
int main() {
... | ALGO | 0.999552 | 4.378829 |
030eaf11-6452-429b-a906-c98195654a4b | BhaswatiRoy/Datastructures-Algorithms | Datastructures/Tree/Top View Of Binary Tree.cpp | /*
Using the vertical line concept - middle col is 0 and col to left is -1 and col to right is +1 and so on
so we need the 1st element from each vertical line for top view
*/
vector<int> topView(Node *root)
{
vector<int>ans;
if(root==NULL)
{
return {};
}
//storing li... | ALGO | 0.99997 | 5.581157 |
e13dcb99-7af2-4c4e-ade4-ab91487db7ff | CarlosLecval/HuffmanCoding | Decompress/ReconstructionBinary.cpp | #include "ReconstructionBinary.h"
ReconstructionBinary::ReconstructionBinary()
{
initializeRoot();
}
void ReconstructionBinary::initializeRoot()
{
root = new CharacterNode;
root = createNode('\0', "");
moveAuxToRoot();
}
CharacterNode *ReconstructionBinary::createNode(char character, string code)
{
... | ALGO | 0.998613 | 3.527367 |
5b337014-f0f6-4034-ae9f-92af23a94e72 | Shin-joongho/Gameprograming | 0909/MakeMenu.cpp | #include <stdio.h>
void draw_square(int size);
int main(void)
{
int n;
printf("簢 \n\n");
printf("簢 (ִ 37)\n");
printf("Էϰ Enter>");
scanf("%d", &n);
draw_square(n);
return 0;
}
void draw_square(int size)
{
int i, j;
unsigned char a=0xa6;
unsigned char b[7];
for(i=1;i<7;i++)
b[i]=0xa0+i;
printf("%c%c... | ALGO | 0.987065 | 3.39182 |
0b6f5cb3-dbc6-46e1-a1d7-8179dd1cfddd | its-coder5128/leetcode | my-folder/problems/minimum_time_to_make_rope_colorful/solution.cpp | class Solution {
public:
int minCost(string colors, vector<int>& neededTime) {
int time = 0;
int prev = 0;
int curr = 1;
while(curr < colors.size())
{
if(colors[prev] == colors[curr])
{
if(neededTime[prev] < neededTime[curr])
... | ALGO | 0.999867 | 6.42608 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.