uuid
stringlengths
36
36
repo_name
stringlengths
5
133
relative_path
stringlengths
3
3.76k
content
stringlengths
282
4.03M
category
stringclasses
6 values
algo_rel_score
float32
0.9
1
quality_score
float32
3
8.13
source_meta
dict
3f1df45b-8f6a-40f1-9ad9-b3fbda22328e
h11322689/mesa
src/nouveau/codegen/nv50_ir_lowering_nv50.cpp
/* * Copyright 2011 <NAME> * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, p...
ALGO
0.990264
4.804996
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2024-06-28T03:22:56.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "dd244c86cff0...
867624f4-b8a4-4349-b488-f8fb8aeb2042
kkisic/Procon
CPP/AtCoder/other/joi2010ho/b.cpp
#include <cmath> #include <iostream> #include <vector> #include <queue> #include <deque> #include <map> #include <set> #include <stack> #include <tuple> #include <bitset> #include <algorithm> #include <functional> #include <utility> #include <iomanip> #define int long long int #define rep(i, n) for(int i = 0; i < (n);...
ALGO
0.999964
3.605788
{ "github_metadata": { "branch": "master", "commit_count": 1105, "repo_created_at": "2017-11-28T11:11:46.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "849be99...
7a5c8bdb-a95b-4764-9757-7c20f5e2d112
shruti170901/Leetcode
Design Front Middle Back Queue.cpp
class FrontMiddleBackQueue { private: vector<int> q; int sz; public: FrontMiddleBackQueue() { sz=0; } void pushFront(int val) { q.insert(q.begin(), val); sz++; } void pushMiddle(int val) { int pos=(sz)/2; q.insert(q.begin()+pos, val); ...
ALGO
0.999307
5.817943
{ "github_metadata": { "branch": "master", "commit_count": 781, "repo_created_at": "2020-07-30T13:04:28.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 21, "forks": 82, "issues": 9, "pull_requests": 1 }, "file_meta": { "content_id": "cd1481...
69a0b9bf-0d7c-427e-8336-f8cffcfa9dff
asilichenko/jbl-xtreme2-bms
utils/temperature-measurement/temperature-measurement.ino
/** @file temperature_measurement.ino This utility program helps calibrate constants for accurate temperature measurement and calculation. Used equipment: - Thermistor, NTC, 10kOhm. - Resistor, 10kOhm Connections: - Connect thermistor between VCC and Arduino analog pin. - Connect series resistor betw...
ALGO
0.971823
5.45404
{ "github_metadata": { "branch": "master", "commit_count": 66, "repo_created_at": "2024-01-23T02:28:08.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "838c6ed30...
28f34635-a44c-4fd9-942f-2ae78bd951d4
Ranqing/Qing
qing_aggregation.h
#ifndef QING_AGGREGATION_H #define QING_AGGREGATION_H #include "qing_common.h" #include "qing_bilateral_filter.h" //aggregate mcost volume with approximate bilateral filter guided by gray image inline void qing_bf_mcost_aggregation(float * filtered_mcost_vol, float * mcost_vol, unsigned char *gray, int w, int h, int ...
ALGO
0.995993
4.517353
{ "github_metadata": { "branch": "master", "commit_count": 41, "repo_created_at": "2016-12-21T01:55:41.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9e80e1834...
ebe6a7f8-1f7a-44e2-ab9a-0ff3d8e91d7e
hyb2001/VE280
Project-5-Related-Files/call.cpp
#include "iostream" #include "dlist.h" #include "string" using namespace std; struct customer{ string name; int startime; int stoptime; string status; }; int main(){ customer *serve,*now,*newcus; int cusnum; cin>>cusnum; auto cus=new Dlist <customer>[4]; Dlist <customer> cust; ...
ALGO
0.986865
3.443247
{ "github_metadata": { "branch": "main", "commit_count": 6, "repo_created_at": "2022-02-20T05:26:19.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "96d7d71c8954...
d171737b-7695-4e56-8904-1c331edb71bd
jangrotino/cses-problem-set-solutions
ladny_ciag.cpp
#include<bits/stdc++.h> using namespace std; int main() { int n, k, q; int max_tab = 0; cin >> n >> k >> q; int tab[n] = {}; for(int i = 0; i < n; i++) { cin >> tab[i]; max_tab = max(tab[i], max_tab); } int dp[max_tab+1][k+1] = {}; int ans[n] = {}; for(in...
ALGO
0.99997
3.725211
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2025-03-31T19:35:23.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a8fec10acd9f...
b50f5012-4acd-4207-b995-5cc7d27585d1
GJDuck/libf
fvector.cpp
/* * Copyright (c) 2017 The National University of Singapore. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * no...
TOOL
0.962301
5.562605
{ "github_metadata": { "branch": "master", "commit_count": 19, "repo_created_at": "2015-03-06T05:53:02.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 189, "forks": 15, "issues": 2, "pull_requests": 0 }, "file_meta": { "content_id": "3f6683...
bdc096b3-8e2f-441e-a243-75a1e01365d2
Anunay16/CSES-Problemset-Solutions
Introductory Problems/4_increasing_array.cpp
/* link to the problem: https://cses.fi/problemset/task/1094 */ #include <bits/stdc++.h> using namespace std; #define fast ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr); #define int long long #define vi vector<int> #define vvi vector<vector<int>> #define vs vector<string> #define rep(i, start, e...
ALGO
0.999858
4.235025
{ "github_metadata": { "branch": "main", "commit_count": 48, "repo_created_at": "2021-11-12T08:14:03.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f66463900f2...
4af75a34-31a6-4249-819e-0148cb04915c
luozhancheng/leetcode_cpp
include/98_validate_btree.h
// // Created by lelezi on 2019-08-08. // #ifndef LEETCODE_98_VALIDATE_BTREE_H #define LEETCODE_98_VALIDATE_BTREE_H #include <iostream> using namespace std; /** * Definition for a binary tree node. */ struct TreeNode { int val; TreeNode *left; TreeNode *right; TreeNode(int x) : val(x), left(NULL), right(...
ALGO
0.996839
6.607599
{ "github_metadata": { "branch": "master", "commit_count": 35, "repo_created_at": "2019-06-30T10:28:54.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a7ddf56ed...
50c7f11f-a075-4149-b71e-91192dbbb008
akashghadge/LeetCode
Daily Challange/11_22 Nov/19 587. Erect the Fence.cpp
/* You are given an array trees where trees[i] = [xi, yi] represents the location of a tree in the garden. Fence the entire garden using the minimum length of rope, as it is expensive. The garden is well-fenced only if all the trees are enclosed. Return the coordinates of trees that are exactly located on the fence p...
ALGO
0.999999
6.019254
{ "github_metadata": { "branch": "main", "commit_count": 501, "repo_created_at": "2022-03-13T13:36:46.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b363c70404...
eea5e231-7b2e-4ce8-88e7-165865ed1020
Yestercafe/leetcode-solutions
1106-parsing-a-boolean-expression/solution_topdown.cc
class Solution { string expr; public: pair<bool, int> apply(char function_name, int l) { cout << function_name << endl; int i; bool base; switch (function_name) { case '!': switch (expr[l + 2]) { case 't': re...
ALGO
0.999709
5.15506
{ "github_metadata": { "branch": "master", "commit_count": 708, "repo_created_at": "2021-03-03T07:18:04.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c3c26eca...
f201af34-63f5-4f15-88c0-4eb0c716f758
Kitware/VTK
Filters/Core/vtkDecimatePolylineFilter.h
// SPDX-FileCopyrightText: Copyright (c) <NAME>, <NAME>, <NAME> // SPDX-License-Identifier: BSD-3-Clause /** * @class vtkDecimatePolylineFilter * @brief reduce the number of lines in a polyline * * vtkDecimatePolylineFilter is a filter to reduce the number of lines in a * polyline. The algorithm functions by e...
ALGO
0.984864
6.799452
{ "github_metadata": { "branch": "master", "commit_count": 94968, "repo_created_at": "2010-04-27T15:12:58.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 2910, "forks": 1246, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6...
4dae4227-d8cc-4222-8a30-1303ddf28ad9
YANLING-H/CSC418_ComputerGraphics
computer-graphics-bounding-volume-hierarchy/src/AABBTree.cpp
#include "AABBTree.h" #include "insert_box_into_box.h" #include <iostream> AABBTree::AABBTree( const std::vector<std::shared_ptr<Object> > & objects, int a_depth): depth(std::move(a_depth)), num_leaves(objects.size()) { if (num_leaves <= 2) { // 1 or 2 objects. So children will be primitives this->...
ALGO
0.981674
5.519551
{ "github_metadata": { "branch": "master", "commit_count": 69, "repo_created_at": "2022-03-11T02:53:58.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d48d1ddff...
2a6b058e-b27d-4546-832b-60205ec50c3e
xscchoux/Leetcode-Submissions
C++/3316-Find Maximum Removals From Source String.cpp
// https://leetcode.com/problems/find-maximum-removals-from-source-string/solutions/5903944/knapsack-dp-complete-intuiton-to-solution/ class Solution { public: int Ns, Np; int dfs(string& source, string& pattern, int i, int j, unordered_set<int>& targetSet, vector<vector<int>>& memo) { if (j == Np) retu...
ALGO
0.999892
6.3956
{ "github_metadata": { "branch": "master", "commit_count": 2121, "repo_created_at": "2020-02-28T13:15:26.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c4883f9...
33a582d6-5455-4697-be3a-c2803809bbd1
johnsmith0x3f/CompetitiveProgramming
codeforces/gym/105540/D.cpp
#include <bits/stdc++.h> using namespace std; using i64 = long long; using pii = pair<int, int>; const int N = 1050; pair<int, int> f[N][N]; stack<int> st; struct Node { int a, x, b, y; } ver[N]; pii DFS(int v, int t) { auto &[ a, x, b, y ] = ver[v]; if(a == t) { if(t == 0) return { 1, 0 }; return { 1, x }; ...
ALGO
0.998411
3.737205
{ "github_metadata": { "branch": "master", "commit_count": 240, "repo_created_at": "2024-08-17T07:43:09.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5bb43da2...
e9c0caef-8972-4274-bd51-c94cdc4571cf
ishandutta2007/codeforces-d
demoralizer/normal/543/B.cpp
#include "bits/stdc++.h" using namespace std; #define int long long #define pb push_back #define ppb pop_back #define pf push_front #define ppf pop_front #define all(x) (x).begin(),(x).end() #define uniq(v) (v).erase(unique(all...
ALGO
0.999872
3.76258
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-04-11T01:31:27.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4985c67c6230...
8c6b38cc-a136-4756-95e4-71ca427a98dc
domen-osojnik/CRO_CPP
CRO_CPP/Structure.cpp
// // Structure.cpp // CRO_Algorithm // // Created by <NAME> on 10/07/2021. // #include "Structure.h" #include "Operators.h" #pragma region Performance increase functions std::vector<std::string> Structure::increasePerformance1(std::string s, std::vector<std::string> d) { std::vector<std::string> u = d; i...
ALGO
0.991983
3.370689
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2022-06-29T10:00:53.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "76e591f626...
8c7720be-efba-4c48-a64b-486ea02a8642
patreos/patreos-tools
rewards/reward.hpp
#include <math.h> #include <iostream> using namespace std; class Rewards { public: double safe_log(double value) { if(value < 1) { return 0; } return log(value); } double safe_quadrt(double value) { if(value < 1) { return 0; } return sqrt(sqrt(value)); } double safe_sq...
ALGO
0.997915
4.324107
{ "github_metadata": { "branch": "master", "commit_count": 11, "repo_created_at": "2018-08-25T14:28:38.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3f7f0ba6a...
ced3bef7-5e9e-4c3d-b8b9-f05d35f3b88f
WHOLEACS/LeetCode
328/code.cpp
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode() : val(0), next(nullptr) {} * ListNode(int x) : val(x), next(nullptr) {} * ListNode(int x, ListNode *next) : val(x), next(next) {} * }; */ class Solution { public: //空间复杂度:O(1) 时间复杂度:O(n) ...
ALGO
0.999975
5.695438
{ "github_metadata": { "branch": "master", "commit_count": 347, "repo_created_at": "2020-09-28T09:09:55.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8e0ea673...
dc869295-c4c4-4f32-b84e-620e89771f16
sbpl/sbpl
src/planners/rstarplanner.cpp
/* * Copyright (c) 2008, <NAME> * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright * notice, this list of condit...
ALGO
0.999705
3.052197
{ "github_metadata": { "branch": "master", "commit_count": 184, "repo_created_at": "2012-11-21T15:09:05.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 344, "forks": 177, "issues": 15, "pull_requests": 7 }, "file_meta": { "content_id": "8013...
02192f8e-9240-49aa-b1ed-41213ab298e2
kjeffery/SimplePath
Integrators/Integrator.cpp
/// @author <NAME> #include "Integrator.h" #include "../base/RunningStats.h" #include "../base/Scene.h" #include "../math/HSV.h" #include "../math/ONB.h" #include "../math/Ray.h" #include "../math/RGB.h" #include "../math/Sampler.h" #include "../math/Sampling.h" #include "../Lights/Light.h" #include <iostream> // TO...
ALGO
0.948589
6.038486
{ "github_metadata": { "branch": "main", "commit_count": 463, "repo_created_at": "2022-09-13T21:06:52.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a73621055c...
eb83f940-e608-4000-a250-15dc516ea821
swetanjal/Competitive-Programming
Codeforces/Solved Problems/1150B.cpp
#include "bits/stdc++.h" using namespace std; const int MAXN = 55; int N; char A[MAXN][MAXN]; bool valid(int i, int j){ if(i < 0 || j < 0 || i >= N || j >= N) return false; if(A[i][j] == '.') return true; return false; } void fill(int i, int j){ A[i][j] = 'X'; A[i + 1][j] = 'X'; ...
ALGO
0.999996
4.497891
{ "github_metadata": { "branch": "master", "commit_count": 177, "repo_created_at": "2018-04-06T10:31:39.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 13, "forks": 9, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9b8d094...
f309beac-565c-4e90-8754-23505917d7a8
fsword73/HIP-Performance-Optmization-on-VEGA64
example-5a.cpp
/* please note that the series of optmiztion technology is not in official document. All the tests are based on AMD MI25 radeon instict and AMD ROCm. */ #include <assert.h> #include <stdio.h> #include <algorithm> #include <stdlib.h> #include<iostream> #include "hip/hip_runtime.h" #define HIP_ASSERT(x) (assert(...
ALGO
0.962068
3.267954
{ "github_metadata": { "branch": "master", "commit_count": 39, "repo_created_at": "2019-07-29T08:19:44.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 61, "forks": 26, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1843ba6...
99bd9800-3dcd-47da-9022-9794b359786a
lemonadesaltbagel/algorithms
leetcode/44.wildcard-matching.cpp
#include <string> #include <vector> using namespace std; /* * [44] Wildcard Matching * * https://leetcode.com/problems/wildcard-matching/description/ * * algorithms * Hard (21.05%) * Total Accepted: 125.6K * Total Submissions: 595K * Testcase Example: '"aa"\n"a"' * * Given an input string (s) and a patte...
ALGO
0.999836
6.372171
{ "github_metadata": { "branch": "master", "commit_count": 149, "repo_created_at": "2014-05-01T08:54:08.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5a39ca15...
219d5daf-8bc4-459a-8f74-0aa2cded02e2
KangKyungSoo/autocalib
samples/src/_deprecated_autocalib_R_cam_real_ltd.cpp
#pragma warning(disable: 4800) #include <iostream> #include <vector> #include <set> #include <stdexcept> #include <opencv2/core/core.hpp> #include <opencv2/features2d/features2d.hpp> #include <opencv2/highgui/highgui.hpp> #include <opencv2/stitching/detail/matchers.hpp> #include <core/include/core.h> using namespace s...
ALGO
0.980829
6.367821
{ "github_metadata": { "branch": "master", "commit_count": 348, "repo_created_at": "2015-11-22T12:11:26.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "cd539176...
d28c3c65-212e-4c88-960e-1a57aac28feb
chenx/oj
leetcode/WiggleSort.cpp
// Works. Tested locally. class Solution4 { public: void wiggleSort(vector<int>& nums) { int n = nums.size(); for (int i = 1; i < n; ++ i) { if (i & 1) { if (nums[i-1] > nums[i]) swap(nums[i-1], nums[i]); } else { if (nums[i-1] < n...
ALGO
0.999996
5.895163
{ "github_metadata": { "branch": "master", "commit_count": 1737, "repo_created_at": "2013-12-15T09:45:12.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "60a074a...
42f148b7-c5ac-4334-a014-d8c5aac023f4
DrSwad/CP
Submissions/Varsity/2021/Dept Individual Contest/1/A_-_Subarrays_Beauty.cpp
#include <bits/stdc++.h> using namespace std; void test_case() { int n; cin >> n; vector<int> a(n); for (int &i : a) cin >> i; long long ans = 0; for (int b = 0; b < 25; b++) { for (int l = 0; l < n; ) { if (!(a[l] >> b & 1)) l++; else { int r = l; while (r < n and (a[r] ...
ALGO
0.999841
4.349478
{ "github_metadata": { "branch": "master", "commit_count": 65, "repo_created_at": "2019-10-12T13:53:06.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 21, "forks": 5, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "10c769da...
98a958f3-23a1-4d4c-aeb2-fc6967e0ef21
dcowgill/ares
src/ares/cmdline_arg_parser.hpp
// Copyright (C) 2002-2007 <NAME> // // Usage of the works is permitted provided that this instrument is retained // with the works, so that any entity that uses the works is notified of this // instrument. // // DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY. #ifndef included_ares_cmdline_arg_parser #define included_ares...
TOOL
0.900046
7.061802
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2013-02-07T21:40:53.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9094ba62c6...
725fec4e-36d1-4cb6-9a27-a3098aec52b9
Phon1209/Competitive_Programming_SourceCode
workspace/doit.cpp
#include<bits/stdc++.h> using namespace std; #define sint(a) int a; scanf("%d",&a); #define sint2(a,b) int a,b; scanf("%d %d",&a,&b); #define sint3(a,b,c) int a,b,c; scanf("%d %d %d",&a,&b,&c); #define int1(a) scanf("%d",&a); #define int2(a,b) scanf("%d %d",&a,&b); #define int3(a,b,c) scanf("%d %d %d",&a,&b,&c); #defin...
ALGO
0.999902
3.566272
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2018-10-19T06:38:25.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "13190672b6...
e2b5d348-fcf1-4d67-99a7-ce436b6f7771
vinlin24/cs131
Homework 2/src/example.cpp
// example.cc // $ g++ -o example example.cpp // $ ./example #include <iostream> #include <vector> #include <queue> using namespace std; // Question 8a size_t longestRun(vector<bool> const &vec) { size_t count = 0; size_t max = 0; for (size_t i = 0; i < vec.size(); ++i) { if (vec[i]) {...
TEST
0.994434
4.934062
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2023-09-22T06:26:26.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f1404ee0e357...
cf186450-0d3f-40c2-9354-7ad5a87b9f18
beerchainproject/beerchain
src/rpc/blockchain.cpp
// Copyright (c) 2010 <NAME> // Copyright (c) 2009-2019 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include <rpc/blockchain.h> #include <amount.h> #include <blockfilter.h> #include <chain.h> #in...
WEB
0.937345
6.161634
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2020-09-13T23:08:18.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0ba09dcfbc...
1f5bd8c3-1c4a-44df-af3e-57fe1842aab4
vkotaru/nonlinear_controls
include/quadprog/quadprog.h
// // Created by kotaru on 5/26/21. // #ifndef NONLINEAR_CONTROLS_QUADPROG_H #define NONLINEAR_CONTROLS_QUADPROG_H #include <eigen3/Eigen/Dense> namespace nonlinear_controls { class QuadProg { protected: /// \brief Equality tolerance value double equality_tol{1e-6}; /// \brief Number of decision variables ...
ALGO
0.993957
6.366477
{ "github_metadata": { "branch": "master", "commit_count": 78, "repo_created_at": "2020-07-18T00:47:18.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 16, "forks": 9, "issues": 4, "pull_requests": 1 }, "file_meta": { "content_id": "7aa8308c...
08aa63a5-d7af-45ea-a958-731f990a97b2
202030481266/CP-Templates-and-Solutions
周赛板刷/2000~2050/带限制的子序列和.cpp
// https://leetcode.cn/problems/constrained-subsequence-sum/ // 经典的单调队列优化的动态规划题目 class Solution { public: int constrainedSubsetSum(vector<int>& nums, int k) { // dp[i] = max{dp[j] + nums[i]} i-k<=j<=i-1 // 单调队列优化 int n = nums.size(); vector<int> dp(n + 1); vector<int> Q(n ...
ALGO
0.999951
6.19067
{ "github_metadata": { "branch": "main", "commit_count": 606, "repo_created_at": "2023-01-27T08:36:45.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "aa71960e0a...
9f0e0b26-d80e-49d9-b0f7-3776d536fda3
szaxar/Systemy_Operacyjne
lab1/2/pomiardrzewo.cpp
#include <stdlib.h> #include <stdio.h> #include <string.h> #include <iostream> #include <cstdlib> #include <time.h> #include "drzewo.h" int main(){ string imie[17]={"adam","kuba","andrzej","stansilaw","wiktor","ola","aleksandra","fhtstqzeof" "htncmfvzdf","ybjfrzpwot","pxytibwhjv","rrlawiyntj","kipgbsinfh", "...
ALGO
0.994479
3.151969
{ "github_metadata": { "branch": "master", "commit_count": 14, "repo_created_at": "2018-02-18T15:47:17.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5771c7f44...
768a1ff0-c31c-4e29-b306-1080dfce5d7f
Upit63/ClassKYT
과외/0122 homework.cpp
#include <iostream> #include <time.h> #include <list> #include <vector> #include <map> #include <string> using namespace std; //> //== //!= class GameObject { public: std::string name; int id; public: GameObject(const int& id=0, std::string name = "") : name(name), id(id) {} ~GameObject(){} bool operator >(cons...
ALGO
0.988678
4.383667
{ "github_metadata": { "branch": "master", "commit_count": 6, "repo_created_at": "2017-03-15T13:04:35.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "999da51ad7...
352439aa-c434-4383-975f-6feae6fff960
MartyushevVA/oop24
3/myvector/myvector.h
#pragma once #include <cstddef> #include <type_traits> #include <concepts> #include <iterator> #include <algorithm> #include <stdexcept> #include <limits> /** * @class Vector * @brief A dynamic array class template that provides similar functionality to std::vector. * * @tparam T The type of elements stored in ...
TOOL
0.965521
7.341576
{ "github_metadata": { "branch": "master", "commit_count": 165, "repo_created_at": "2025-03-03T19:36:13.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ea496854...
ac4b07be-3c75-41cd-a247-bc72e0b25dc5
mgood7123/Crafter_SDK
Crafter_Core/src/Crafter/CoordinateSystems/ViewSpace.h
// // Created by <NAME> on 17/6/21. // #ifndef CRAFTER_VIEW_SPACE_H #define CRAFTER_VIEW_SPACE_H #include "View_Matrix.h" #include "Wrappers/Translation.h" #include "Wrappers/Rotation.h" #include "WorldSpace.h" namespace Crafter { class ViewSpace { public: View_Matrix view_matrix; static Mag...
TOOL
0.961179
7.121928
{ "github_metadata": { "branch": "main", "commit_count": 20, "repo_created_at": "2021-06-11T13:36:37.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c925047e3fa...
cddd5978-62b2-4495-8030-31ff42fe214f
neetcode-gh/leetcode
cpp/0338-counting-bits.cpp
/* Given int, return array: for each i, ans[i] is # of 1's Ex. n = 2 -> [0,1,1], 0 = 0 has 0, 1 = 1 has 1, 2 = 10 has 1 x = 1001011101 = 605 x'= 0100101110 = 302 Differ by 1 bit, by removing LSB: f(x) = f(x / 2) + (x mod 2) Time: O(n) Space: O(1), the output array does not count towards sp...
ALGO
0.999993
6.030655
{ "github_metadata": { "branch": "main", "commit_count": 9682, "repo_created_at": "2021-01-20T16:10:14.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 6062, "forks": 2417, "issues": 330, "pull_requests": 215 }, "file_meta": { "content_id": ...
4400ca55-2e64-4a57-ade2-0fa22fc88e68
taitruong256/Competitive-programming
Codeforces/Codeforces784/C.cpp
/*===================================================================================== Nothing is impossible, only you think it is impossible Try, try, try again until you succeed Pratice, practice, and practice I hated every minu...
ALGO
0.999425
4.115193
{ "github_metadata": { "branch": "main", "commit_count": 6, "repo_created_at": "2025-04-14T06:59:26.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "94ed381b13bb...
3cde8162-dc7b-4455-a545-5371e2e183fb
Psycho7/LeetCode
CPP Solutions/131.cpp
class Solution { public: vector<vector<string>> partition(string s) { str = s; size = s.size(); vector<vector<bool>> isPali(size, vector<bool>(size, false)); for (int len = 1; len <= size; len++) { for (int i = 0; i <= size - len; i++) { int j = i...
ALGO
0.999956
6.340971
{ "github_metadata": { "branch": "master", "commit_count": 75, "repo_created_at": "2015-12-07T12:52:00.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "020336b68...
f91d841d-cbd2-4175-9d33-3eadb1007b2a
anidub/CPP
Array/FlipInvertImage.cpp
#include <iostream> #include <vector> using namespace std; /* https://leetcode.com/problems/flipping-an-image/ Given a binary matrix A, we want to flip the image horizontally, then invert it, and return the resulting image. To flip an image horizontally means that each row of the image is reversed. For example, flip...
ALGO
0.999793
5.704933
{ "github_metadata": { "branch": "master", "commit_count": 41, "repo_created_at": "2021-10-25T04:13:39.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "dcaab0d5a...
39211520-2c45-4f6e-b5cc-e1a5e8d6cf61
hus-king/Luogu_C
P3372.cpp
#include <bits/stdc++.h> using namespace std; using ll=long long; ll n, a[100005], d[270000], b[270000]; // n:数组长度 a:原数组 d:线段树数组 b:懒标记数组 //build:建树 update:更新 getsum:查询 void build(ll l,ll r,ll p){ // l:区间左端点 r:区间右端点 p:节点标号 if(l==r){ d[p]=a[l]; return; } ll m = l + (r-l)/2; build(l,m,p*...
ALGO
0.999849
4.729657
{ "github_metadata": { "branch": "main", "commit_count": 83, "repo_created_at": "2025-03-07T15:06:09.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "489c11b31ce...
c9c50962-fd25-4187-bc2e-f97f3c72724e
jgj1234/Competitive-Programming
Other/AtCoderDistanceQueriesOnTree.cpp
#include <bits/stdc++.h> #include <fstream> #define pii pair<int,int> #define pb push_back #define yes "YES" #define no "NO" #define ll long long #define MOD 1000000007 #define all(x) x.begin(),x.end() #define MOD2 998244353 using namespace std; mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count()); st...
ALGO
0.999988
5.004732
{ "github_metadata": { "branch": "main", "commit_count": 104, "repo_created_at": "2024-08-05T16:52:22.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7ccb4ed714...
ca17de98-9f50-4521-8590-2be0b346aaa7
Alexode05/CPP
shifumi.cpp
#include <iostream> #include <ctime> using namespace std; char userChoice(); char computerChoice(); int main() { int scoreUser = 0; int scoreComputer = 0; cout << "################# Shifumi #################" << '\n'; do{ char user = userChoice(); char computer = computerCho...
ALGO
0.935333
4.129977
{ "github_metadata": { "branch": "main", "commit_count": 23, "repo_created_at": "2024-07-14T19:29:48.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "edd5fb867c4...
a8f5e6cf-ce1d-442a-8fad-8b76001d89f5
ffengc/BitCode
数据结构/OJ练习/0612OJ练习/0612OJ练习/源.cpp
#define _CRT_SECURE_NO_WARNINGS 1 #include<iostream> #include<string> #include<vector> #include<algorithm> using namespace std; //412. Fizz Buzz class Solution { public: vector<string> fizzBuzz(int n) { vector<string>ret; for (int i = 1; i <= n; i++) { if ((i) % 3 == 0 && (i) % 5 == 0)...
ALGO
0.999173
4.014637
{ "github_metadata": { "branch": "main", "commit_count": 184, "repo_created_at": "2023-02-02T15:20:34.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 11, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7c89b2e4b...
3a7fa084-05c9-4a76-a56b-e4f1cd6b1cc5
QMCPACK/qmcpack
src/AFQMC/Estimators/Observables/atomcentered_correlators.hpp
////////////////////////////////////////////////////////////////////// // This file is distributed under the University of Illinois/NCSA Open Source // License. See LICENSE file in top directory for details. // // Copyright (c) 2016 <NAME> and QMCPACK developers. // // File developed by: // <NAME>, <EMAIL> // Lawre...
ALGO
0.966243
6.699686
{ "github_metadata": { "branch": "develop", "commit_count": 28915, "repo_created_at": "2017-01-11T19:02:29.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 345, "forks": 147, "issues": 438, "pull_requests": 16 }, "file_meta": { "content_id": ...
c72ea5a0-bdac-41b2-a3e8-55d8d7f3e30e
RumataAst/CPP_Module_08
ex01/main.cpp
#include "Span.hpp" #include "Span.tpp" #include <vector> int main() { // Create a Span object with a large capacity of 10,000 numbers Span sp(10010); // Test addNumber() with some predefined numbers sp.addNumber(6); sp.addNumber(3); sp.addNumber(17); sp.addNumber(9); sp.addNumber(11);...
TEST
0.988358
6.575874
{ "github_metadata": { "branch": "main", "commit_count": 8, "repo_created_at": "2025-02-12T20:06:09.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "105c3af84530...
930426dd-edb6-4eb2-9d63-f32f8dcbaef7
o3de/o3de
Code/Framework/AzFramework/AzFramework/DocumentPropertyEditor/SortAdapter.cpp
/* * Copyright (c) Contributors to the Open 3D Engine Project. * For complete copyright and license terms please see the LICENSE at the root of this distribution. * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ #include <AzCore/std/containers/unordered_map.h> #include <AzCore/std/ranges/zip_view.h> #include ...
TOOL
0.994038
7.706886
{ "github_metadata": { "branch": "development", "commit_count": 26515, "repo_created_at": "2021-04-05T06:38:18.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 8421, "forks": 2320, "issues": 3293, "pull_requests": 98 }, "file_meta": { "conten...
177a8693-7984-4c1a-8c37-1e90fa4f1a3c
amirphl/learning
data-structures/geeks-for-geeks/stack/stack-permutations-check-if-an-array-is-stack-permutation-of-other.cpp
// https://www.geeksforgeeks.org/stack-permutations-check-if-an-array-is-stack-permutation-of-other/ // { Driver Code Starts //Initial Template for C++ #include <bits/stdc++.h> using namespace std; // } Driver Code Ends //User function Template for C++ class Solution { public: // time: O(n), memory: O(n) i...
ALGO
0.99979
5.827883
{ "github_metadata": { "branch": "main", "commit_count": 1441, "repo_created_at": "2022-02-26T18:21:43.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "37dacd35f...
b8d2628f-38ee-4603-91d9-3c9504fb5506
sugurunatsuno/texturepass
keijo.cpp
#include<stdio.h> #include<opencv2/opencv.hpp> #include<cmath> class Keijo { private: int LineFilter(cv::Mat &input_mat) { double ver_black_blight = 0, ver_white_blight = 0; double hol_black_blight = 0, hol_white_blight = 0; double ver_ret,hol_ret; //縦の線と横の線の黒と白の数を数える //明度差があれば出力 uchar *ptr; for (int ...
ALGO
0.960814
4.239648
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2017-02-06T09:07:18.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "60aeb9bd01...
a35b2e5c-587c-42a3-b178-15552f02ea71
yfliu017258/CPP_programs
cses/2210.cpp
#include<bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, a, b) for(int i = a; i < b; i++) const int MOD = 1000000007; ll n; ll qpow(ll a, int b){ ll ans = 1; while(b){ if(b & 1){ ans = ans * a % MOD; } a = a * a % MOD; b >>= 1; } retu...
ALGO
0.999893
4.174375
{ "github_metadata": { "branch": "master", "commit_count": 244, "repo_created_at": "2020-03-27T15:18:56.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "daf70122...
9dd6de05-abef-428e-9b6d-1fbe120656c2
water-mi/My-Code
历年省选/HNOI/2015/Day2/maple.cpp
#include <cmath> #include <cstdio> #include <cstring> #include <algorithm> #include <queue> using std::min; using std::max; using std::swap; using std::sort; using std::queue; typedef long long ll; template<typename T> void read(T &x) { int flag = 1; x = 0; char ch = getchar(); while(ch < '0' || ch > '9') { if...
ALGO
0.99995
4.054414
{ "github_metadata": { "branch": "master", "commit_count": 45, "repo_created_at": "2019-02-27T12:57:53.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "41aad5775...
7443b844-8d3a-4182-9b96-d7a62596cd7d
h-hkai/PAT_ADVANCED
1109_Group_Photo.cpp
#include <bits/stdc++.h> using namespace std; int main() { int n, k; cin >> n >> k; vector<pair<string, int> > people; for (int i = 0; i < n; ++i) { string name; int height; cin >> name >> height; people.push_back({name, height}); } int row = n / k; int mod ...
ALGO
0.999966
3.241
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2020-08-09T10:09:49.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b1d6c5c08c...
bf90a54f-a7fe-4bd4-9acd-2d9cbf0bc895
google-ai-edge/mediapipe
mediapipe/calculators/util/landmarks_smoothing_calculator_utils.h
// Copyright 2023 The MediaPipe Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or a...
TOOL
0.940766
7.751684
{ "github_metadata": { "branch": "master", "commit_count": 4767, "repo_created_at": "2019-06-13T19:16:41.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 30689, "forks": 5453, "issues": 443, "pull_requests": 149 }, "file_meta": { "content_id"...
f25eb4d9-1d64-4dde-9d40-a675ab040c7d
Akshay199456/100DaysOfCode
Topics/Topic/Data Structures and Alogrithms (Topic)/Leetcode(Website)/78(Subsets).cpp
/* -------------------------Question: Given a set of distinct integers, nums, return all possible subsets (the power set). Note: The solution set must not contain duplicate subsets. Example: Input: nums = [1,2,3] Output: [ [3], [1], [2], [1,2,3], [1,3], [2,3], [1,2], [] ] */ /* -------------------...
ALGO
0.999938
6.893946
{ "github_metadata": { "branch": "master", "commit_count": 1403, "repo_created_at": "2019-12-08T19:14:41.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "decaadb...
6b2ff8e7-f192-4bab-9034-02febcc3c5aa
windrew/Baekjoon_ac_codes
22344.cpp
#include <stdio.h> #include <vector> #include <algorithm> using namespace std; typedef long long lld; vector < pair < lld , lld > > adj[100005]; lld xval[100005],yval[100005],v[100005],stk[100005],cnt,arr[100005]; lld n,m,flag,ans,x; void dfs(lld node) { lld i; for(i=0;i<adj[node].size();i++) { l...
ALGO
0.999991
3.28328
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2025-06-06T20:07:55.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "25dd14ce2427...
7626fa1f-b6da-4985-b00e-8c29970abfe1
yuki-t-2019/algorithm-study-guide
graph_algorithms/bellman-ford/src/main.cpp
/* * Copyright (c) 2024 <NAME> * * File: main.cpp * Description: This program solves the problem of arranging cows with constraints on their distances * using the Bellman-Ford algorithm. * * Input: * - The first line contains three integers, N, ML, and MD. * - N: Number of cows. * - ML: Numbe...
ALGO
0.999895
5.584914
{ "github_metadata": { "branch": "main", "commit_count": 63, "repo_created_at": "2024-05-15T01:40:39.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d5e235634ba...
684ffdab-5cd8-424c-abc0-67a37f001e76
jteulade/Tulip
layout/Grip/Distances.cpp
/** * * This file is part of Tulip (www.tulip-software.org) * * Authors: <NAME> and the Tulip development Team * from LaBRI, University of Bordeaux * * Tulip is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License * as published by the Free Software...
ALGO
0.999489
4.688015
{ "github_metadata": { "branch": "master", "commit_count": 8, "repo_created_at": "2015-03-16T21:28:23.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "99c2eb1515...
9da1d871-c4a8-4fc6-9472-7e9d43ed46b7
lagoueduCol/Algorithm-Dryad
14.DP/acwing.01.cpp
/* 有 N 件物品和一个容量是 V 的背包。每件物品只能使用一次。 第 i 件物品的体积是 vi ,价值是 wi 。 求解将哪些物品装入背包,可使这些物品的总体积不超过背包容量,且总价值最大。 输出最大价值。 输入格式 第一行两个整数,N,V ,用空格隔开,分别表示物品数量和背包容积。 接下来有 N 行,每行两个整数 vi,wi ,用空格隔开,分别表示第 i 件物品的体积和价值。 输出格式 输出一个整数,表示最大价值。 数据范围 0<N,V≤1000 0<vi,wi≤1000 输入样例 4 5 1 2 2 4 3 4 4 5 输出样例: 8 */ // 测试平台: https://www.a...
ALGO
0.999984
5.129264
{ "github_metadata": { "branch": "main", "commit_count": 126, "repo_created_at": "2021-01-15T02:18:57.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 142, "forks": 67, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8e2e1e9a...
3a46b708-adc7-4112-b843-ce312c327fd9
hritik2002/Leetcode-Problems
399-evaluate-division/399-evaluate-division.cpp
class Solution { public: void findValueOfEqn(string start, string end, double &val, bool &found, set<string> &visited, map<string, vector<string>> &graph, map<string, double> &weight) { visited.insert(start); if(start == end) { found = true; return; } ...
ALGO
0.999969
5.73538
{ "github_metadata": { "branch": "main", "commit_count": 2341, "repo_created_at": "2022-04-11T16:40:33.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "182b9c466...
e72f504c-ca88-45ea-9cf1-a89388167328
wonsangL/algorithm
Problem/SWExpertAcademy/2117.cpp
#include<iostream> #include<math.h> #include<vector> #include<utility> using namespace std; typedef pair<int, int> p; int map[20][20]; int T, N, M; int get_distance(p &origin, p &a) { return abs(a.first - origin.first) + abs(a.second - origin.second); } void solution(int row, int col, vector<p> &house) { int re...
ALGO
0.999776
4.184344
{ "github_metadata": { "branch": "master", "commit_count": 155, "repo_created_at": "2017-03-10T01:37:21.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "dbfe8b90...
6c8cad4b-700a-43bd-8f5b-a890fe98c782
dionyziz/project-euler
problem-204/204.cpp
#include <cstdio> #include <vector> #include <cmath> using namespace std; typedef unsigned long long int llu; const llu N = 1000000000; const int MAX_PRIME = 100; int prime_cnt = 1; llu primes[ MAX_PRIME ]; void eratosthenes() { primes[ 0 ] = 2; for ( llu candidate = 3; candidate < MAX_PRIME; candidate +=...
ALGO
0.999849
4.514297
{ "github_metadata": { "branch": "master", "commit_count": 106, "repo_created_at": "2012-01-17T17:32:03.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 6, "forks": 8, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1266bfb3...
e89bff20-b50a-4034-8fb8-72ad1a6a59c1
Elliotshui/leetcode_solution
381.insert-delete-get-random-o-1-duplicates-allowed.cpp
/* * @lc app=leetcode id=381 lang=cpp * * [381] Insert Delete GetRandom O(1) - Duplicates allowed */ // @lc code=start class RandomizedCollection { public: vector<int> nums; unordered_map<int, unordered_set<int>> positions; /** Initialize your data structure here. */ RandomizedCollection() { }...
ALGO
0.982879
6.489118
{ "github_metadata": { "branch": "master", "commit_count": 9, "repo_created_at": "2020-06-22T08:21:33.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4cb3e3e891...
9dc913eb-2c70-4650-8bdd-068e7ef5b1f1
Srijanakash/Coding
LeetCode/Practice/RedundantConnection.cpp
/* In this problem, a tree is an undirected graph that is connected and has no cycles. The given input is a graph that started as a tree with N nodes (with distinct values 1, 2, ..., N), with one additional edge added. The added edge has two different vertices chosen from 1 to N, and was not an edge that already exist...
ALGO
0.999973
6.370465
{ "github_metadata": { "branch": "master", "commit_count": 246, "repo_created_at": "2020-04-16T14:11:41.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7ccd1970...
902f639a-8f96-401f-a543-c18cdb43faed
Meinersbur/rosetta
benchmarks/suites/polybench/jacobi-1d/jacobi-1d.sycl.cxx
// BUILD: add_benchmark(ppm=sycl) #include <CL/sycl.hpp> #include <rosetta.h> using namespace cl::sycl; void func(handler &cgh, pbsize_t tsteps, pbsize_t n, buffer<real, 1> &A_buf, buffer<real> &B_buf) { auto A_acc = A_buf.get_access<access::mode::read>(cgh); auto B_acc = B_buf.get_access<access::mode::write>(cgh...
ALGO
0.981467
3.562374
{ "github_metadata": { "branch": "master", "commit_count": 437, "repo_created_at": "2022-12-01T22:53:46.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 3, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b3767294...
6f65851d-6d39-4598-b32d-d274a05ebb68
tiankonguse/ACM
contest/poj/vol_10/1985.cc
#include <iostream> #include <cstdio> #include <cstdlib> #include <cstring> #include <algorithm> #include <cmath> #include <string> #include <vector> #include <queue> #include <set> #include <map> #include <ctime> #define inf 0x3f3f3f3f #define Inf 0x3FFFFFFFFFFFFFFFLL using namespace std; int const maxn = 40404; int...
ALGO
0.999915
3.715332
{ "github_metadata": { "branch": "master", "commit_count": 185, "repo_created_at": "2013-03-25T04:04:26.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 69, "forks": 40, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "fdb6c1...
c4d4f7b8-823d-4a34-b395-d167058fcea2
yybigfish233333/datastructure
dijkstra.cc
#include <bits/stdc++.h> using namespace std; const int MAXN = 1010; // 根据题目需要调整 const int INF = 0x3f3f3f3f; // 代表无穷大 int G[MAXN][MAXN]; // 邻接矩阵 int dista[MAXN]; // dist数组,存储源点到各点的最短距离 bool used[MAXN]; // 标记该点的最短距离是否已经确定 int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); int n, m; ...
ALGO
0.999963
4.102458
{ "github_metadata": { "branch": "main", "commit_count": 14, "repo_created_at": "2024-12-25T01:51:09.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e3d251091dd...
69ddb231-bc0a-42bd-bf5c-9f4c59ab22bf
xenowits/cp
practice/jeani_sRoute.cpp
#include<bits/stdc++.h> using namespace std; #define fori(i,a,b) for (int i = a; i <= b ; ++i) #define ford(i,a,b) for(int i = a;i >= b ; --i) #define mk make_pair #define mod 1000000007 #define pb push_back #define ll long long #define MAXN 100001 #define rnd mt19937_64 rng(chrono::high_resolution_clock::now().time_s...
ALGO
0.999836
3.64173
{ "github_metadata": { "branch": "master", "commit_count": 35, "repo_created_at": "2019-03-22T02:16:08.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c900e2305...
72ac551d-29b9-4186-976f-7459b05d9384
falcaoanderson/CompetitiveProgramming
new-CSES/cses-2079.cpp
// 04/09/23 // #include <iostream> #include <algorithm> #include <vector> #include <queue> #include <set> #include <unordered_set> #include <map> #include <unordered_map> #include <tuple> #include <cstring> #include <stack> using namespace std; #define ll long long #define endl "\n" #define fast_io ios_base::sync_wit...
ALGO
0.999835
4.184848
{ "github_metadata": { "branch": "main", "commit_count": 337, "repo_created_at": "2023-03-08T11:51:46.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9876e81c8a...
c6d43484-f6f0-4358-a91d-0cda119397de
khangit96/Science-Research
sketch_apr06aVer3/sketch_apr06aVer3.ino
//************************************************ #include <SoftwareSerial.h> #include<stdlib.h> #include <string.h> SoftwareSerial SIM900(2,3); #include "SIM900.h" #include "sms.h" SMSGSM sms; char smsbuffer[10]; //biến tin nhắn nhận char n[20]="+841695821150"; //SĐT người gửi - chủ char pos; //biến vị trí tin nhắn t...
TOOL
0.91328
4.522569
{ "github_metadata": { "branch": "master", "commit_count": 20, "repo_created_at": "2016-03-03T07:15:06.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3ba666ec8...
ba906f51-345b-439d-9edf-8a2f1c68477a
filipao223/minesweeper-term
src/main.cpp
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <string> #include <vector> #include <set> #include <random> #include <queue> #include "ncurses.h" #define MAX_ROWS 15 #define MAX_COLS 15 #define MAX_MESSAGE 1024 #define MAX_BOMBS 20 typedef struct Cell{ int i, j; } Cell; using namespace s...
TOOL
0.970373
4.10146
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2019-05-03T23:29:38.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0b045603cc...
f6b7e601-d2a7-4277-9445-0c9607e2725d
Ankitkmm/Dynamic-Programming-Newbie-Problems
Problem-J-Bad-Substrings.cpp
// The number of all possible strings of size i is 3*(dp[i-1]), now we only need to subtract // the number of invalid strings, // Let's suppose that whenever we add a letter, we add it to the beginning of the string, then we // only care of cases when we put letter a, and the next letter is b, // so we need to sub...
ALGO
0.999943
3.611994
{ "github_metadata": { "branch": "main", "commit_count": 7, "repo_created_at": "2023-07-18T17:55:29.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "63e2e6bc4d5a...
048f47db-78c1-439e-b0e8-c611f8967f4f
EZ337/CSE431
hw3/hw3q4.cpp
#include <vector> #include <iostream> #include <map> #include <string> int main() { int N, robotID; // Run it for every robot while (std::cin >> N) { std::cin >> robotID; std::map<std::string, int> colors; std::string colorName; std::vector<std::string> colorVector; ...
ALGO
0.999771
4.678757
{ "github_metadata": { "branch": "main", "commit_count": 29, "repo_created_at": "2024-02-14T06:43:47.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ccb06a1eced...
32461c3d-df0a-4225-8a6a-51061f22632a
bamboo-hust/icpc-trainings
cerc17/j.cpp
#include <bits/stdc++.h> using namespace std; const int N = 1e6 + 6; vector<int> a[N]; int sz[N]; int cnt[N]; int n; void dfs(int u, int p = 0) { sz[u] = 1; for (int v : a[u]) { if (v != p) { dfs(v, u); sz[u] += sz[v]; } } cnt[sz[u]]++; } int main() { ios...
ALGO
0.999505
4.021198
{ "github_metadata": { "branch": "master", "commit_count": 43, "repo_created_at": "2019-09-04T14:35:45.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6e098ec033...
10bd72f8-6b7b-45b8-b5ff-cae6384ccd7e
RullDeef/cg-lab
lab_4/src/core/brescirren.cpp
#include "brescirren.hpp" void core::BresenhemCircleRenderer::draw(QImage& image, const Circle& circle, QColor color) { beginTiming(); if (circle.r == 0.0) { int x = std::round(circle.x); int y = std::round(circle.y); image.setPixel(x, y, color.rgba()); } else { ...
ALGO
0.918678
6.505001
{ "github_metadata": { "branch": "master", "commit_count": 44, "repo_created_at": "2021-07-20T08:52:00.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ce1ff75a2...
27c36a77-4752-443e-b95c-07e0ed0b8e98
Xilinx/llvm-aie
libc/src/__support/FPUtil/multiply_add.h
//===-- Common header for multiply-add implementations ----------*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===---------------------------...
ALGO
0.908781
7.395265
{ "github_metadata": { "branch": "aie-public", "commit_count": 502463, "repo_created_at": "2024-04-22T18:55:00.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 154, "forks": 25, "issues": 9, "pull_requests": 59 }, "file_meta": { "content_id":...
5b5f7c58-9b93-490b-ae8a-0448fa4645ca
peterrum/dealii-tet
source/fe/mapping_q_generic.cc
// --------------------------------------------------------------------- // // Copyright (C) 2000 - 2019 by the deal.II authors // // This file is part of the deal.II library. // // The deal.II library is free software; you can use it, redistribute // it, and/or modify it under the terms of the GNU Lesser General // Pu...
TOOL
0.971438
5.556028
{ "github_metadata": { "branch": "tet", "commit_count": 47874, "repo_created_at": "2019-12-20T20:06:48.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 3, "pull_requests": 2 }, "file_meta": { "content_id": "d82543795...
e952c9d9-f32f-441e-9cf9-a395317262a2
bcapzc/DaShenFuCode
preprocess.h
#ifndef PREPROCESS_H_ #define PREPROCESS_H_ #include <opencv2/opencv.hpp> #include <iostream> #include <vector> #include "findnumber.h" //摄像头的视频尺寸是480*640(高*长) //目前2016年大神符尺寸是1550*710(mm)(长*高) //目前单元字符的complex计算方法是获取一个单元字符的长宽,用整个大神符屏幕来计算,(大神符长-3*单元字符长)/3就是字符之间的间距了, //当然,要根据实际大神符的尺寸来调试 //2 2783 using namespace cv; u...
TOOL
0.937957
3.291064
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2017-04-04T13:54:08.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "83525a29b9...
9504996c-e3c5-4ecb-89ef-7c3e28781733
HosungJoo/BOJ_Algorithm
백준/Silver/1012. 유기농 배추/유기농 배추.cc
#include <iostream> #include<cstring> using namespace std; int T; int M, N, K; int cnt; int map[50][50]; int visited[50][50]; int dx[] = { 0,0,-1,1 }; int dy[] = { -1,1,0,0 }; void init() { memset(map, 0, sizeof(map)); memset(visited, 0, sizeof(visited)); cnt = 0; } void input() { cin >> M >> N >> ...
ALGO
0.999899
4.311227
{ "github_metadata": { "branch": "main", "commit_count": 180, "repo_created_at": "2024-01-19T03:07:53.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "70f7e51f7c...
3106a147-9c42-4959-b20b-c236e7b34d12
artoy/atcoder-clion
tasks/ABC234/CHappyNewYear.cpp
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i) #define FOR(i, a, b) for (int i = (a), i##_len = (b); i <= i##_len; ++i) #define REV(i, a, b) for (int i = (a); i >= (b); --i) #define CLR(a, b) memset((a), (b), sizeof(a)) #define DUMP(x) cout << #x << " = " << (x) << endl; #d...
ALGO
0.999962
4.522285
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2021-12-17T13:22:16.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9076267b9428...
b256cda3-63d1-4804-a870-977a7e83c013
Sarthakpurii/DSA-Quest
1367-linked-list-in-binary-tree/1367-linked-list-in-binary-tree.cpp
// /** // * Definition for singly-linked list. // * struct ListNode { // * int val; // * ListNode *next; // * ListNode() : val(0), next(nullptr) {} // * ListNode(int x) : val(x), next(nullptr) {} // * ListNode(int x, ListNode *next) : val(x), next(next) {} // * }; // */ // /** // * Definit...
ALGO
0.999971
5.035593
{ "github_metadata": { "branch": "main", "commit_count": 928, "repo_created_at": "2023-09-18T23:26:22.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "24a6653d2d...
a8d9fc2a-2ec4-4c2f-920b-845d2200fdd2
anthonymillerr/CMPE50
RationalOperations.cpp
//============================================================================ // Name : Lab7_02.cpp // Author : // Version : // Copyright : Your copyright notice // Description : Lab7_02 //============================================================================ #include <iostream> using namespa...
TOOL
0.978794
4.712509
{ "github_metadata": { "branch": "main", "commit_count": 87, "repo_created_at": "2023-04-08T01:05:52.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "64a4bf1be9b...
04195a72-109e-439e-9877-8c9b8f6e0fa3
koreantiger/Heat-equation-
matrix.h
#pragma once #ifndef MATRIX_HPP #define MATRIX_HPP #include "vector.h" template <typename T> class Matrix { // Start your implementation of the matrix class here private: std::array<int, 2> shape; std::map<std::array<int, 2>, T> data; public: // Constructor (sets length and allocates data) Matrix(int n1, int n2)...
TOOL
0.94272
6.163449
{ "github_metadata": { "branch": "master", "commit_count": 13, "repo_created_at": "2023-03-07T21:44:39.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "430f3431c...
9147a99c-1f9f-4ea6-b1ac-b95989b5310c
nikkeo/Algorithms_And_Data_Structure
Lab6/A/main.cpp
#include <iostream> #include <fstream> #include <string> #include <cmath> #include <vector> #include <algorithm> using namespace std; int height_of_tree(int arr[200000][3], int key){ //cout << arr[key][0] << " " << arr[key][1] << " " << arr[key][2] << " " << *arr[ arr[key][2] - 1] << " " << *arr[ arr[key][1] - ...
ALGO
0.999823
3.944938
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2022-04-10T16:22:28.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f8183cfabb...
9c1c95ac-c325-4062-ace1-ad6002acc59d
Seshien/OK
TSP/Tabo.cpp
#include "Tabo.h" Tabo::Tabo(std::vector<City> & cities, Config config) { //this->results.clear(); this->_config = config; this->cities = cities; this->fillMatrix(cities); this->init(); } void Tabo::init() { this->iterImprovement = 0; if (cities.size() > 4 * _config.Neigh_Size) { _config.Shuffle_Try /= 20; ...
ALGO
0.999166
3.521519
{ "github_metadata": { "branch": "master", "commit_count": 37, "repo_created_at": "2019-11-17T21:08:42.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c832d4d92...
54b0634b-bbe2-4a8a-9c74-8206684343e7
gubatron/cu-projects
CSCI_1300/Practicums/P3/P3.Practice/10.similarity2.cpp
#include <iostream> #include <fstream> #include <sstream> #include <iomanip> #include <string> #include <math.h> using namespace std; /** * similarity2 function takes in two 2-D arrays of int type and their row sizes * and returns true if the two arrays are identical and returns false if two * arrays are not same...
ALGO
0.964866
5.02355
{ "github_metadata": { "branch": "master", "commit_count": 227, "repo_created_at": "2019-02-01T04:18:47.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6e538d7b...
0ffc1713-aa4e-4167-a154-f13bd5fddcef
mquanit2k4/CTDL-GT
MergeTwoSingleLists.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long #define rep(i,a,b) for(int i=a;i<=b;i++) struct node{ int data; node *next; }; typedef struct node* Node; Node makeNode(int x) { Node newNode = new node(); newNode->data = x; newNode->next = NULL; return newNode; } void insertLast(Node &head , ...
ALGO
0.99999
3.878285
{ "github_metadata": { "branch": "main", "commit_count": 44, "repo_created_at": "2023-10-10T04:01:15.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "96d202dcf55...
06048989-f145-40ee-a3e5-24d3ed1a9490
guswl197/Baekjoon
Baekjoon/Baekjoon/스티커.cpp
#include <iostream> #include <algorithm> using namespace std; int main(void) { int t; cin >> t; for (int i = 0; i < t; i++) { int n; cin >> n; int a[3][100001]; int d[100001][4]; for (int i = 1; i <= 2; i++) { for (int j = 1; j <= n; j++) { cin >> a[i][j]; } } d[1][1] = a[1][1]; d[1...
ALGO
0.999967
3.640433
{ "github_metadata": { "branch": "main", "commit_count": 337, "repo_created_at": "2022-02-08T05:50:27.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "75a8230bb1...
3301642d-dc2d-4751-aaff-8d04acbd560e
AlexInTown/HackWorks
POJ/milking_time_poj_3616.cpp
#include <iostream> #include <algorithm> #include <memory.h> using namespace std; struct Period{ int start; int end; int eff; }; struct Comp{ bool operator()(const Period & a, const Period &b){ return a.end < b.end; } }; Period periods[1000]; int dp[1001]; int N, M, R; int main(){ ci...
ALGO
0.999892
4.0233
{ "github_metadata": { "branch": "master", "commit_count": 20, "repo_created_at": "2015-02-13T02:29:35.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "362e84244...
46822ceb-05d0-490a-81ae-b77d23ca4422
osipyonok/Templates
Data structures/mo's_algorithm_on_queries.cpp
#include<bits/stdc++.h> #define INF 1000010000 #define nl '\n' #define pb push_back #define ppb pop_back #define mp make_pair #define fi first #define se second #define pii pair<int,int> #define pdd pair<double,double> #define all(c) (c).begin(), (c).end() #define SORT(c) sort(all(c)) #define sz(c) (c).size() #define...
ALGO
0.999972
4.045611
{ "github_metadata": { "branch": "master", "commit_count": 8, "repo_created_at": "2018-04-19T16:24:10.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c0a6ff9ab1...
08da8a80-4b58-454f-967d-dfa99277dccf
ishandutta2007/codeforces-a
abc864197532/normal/1598/E.cpp
#include <bits/stdc++.h> using namespace std; #define lli long long int #define mp make_pair #define pb push_back #define eb emplace_back #define pii pair <int, int> #define X first #define Y second #define all(x) x.begin(), x.end() #define rall(x) x.rbegin(), x.rend() #define info() cout << __PRETTY_FUNCTION__ << ": "...
ALGO
0.999817
3.647761
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2024-04-11T00:51:41.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "42f84cf35081...
418b3a3e-4e9f-4d43-84eb-e062d43f2a75
rohakdebnath/CodeForces-Solutions
1973B.cpp
#include <bits/stdc++.h> using namespace std; using i64 = long long; #define UNSYNC ios::sync_with_stdio(false); cin.tie(nullptr); #define all(x) x.begin(), x.end() #define rep(i, ini, x) for (i64 i = ini; i < x; ++i) #define per(i, fin, x) for (i64 i = fin; i >= x; --i) i64 N; vector<i64> A; void addtoarrf(vecto...
ALGO
0.999766
4.978163
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2024-07-17T12:11:04.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "026c868e65...
7545d077-cbfe-4293-9e05-e36d3c9991e2
mpfeifer1/Kattis
honeyheist.cpp
#include <bits/stdc++.h> using namespace std; pair<int,vector<vector<int>>> buildrows(int n) { vector<int> lens; for(int i = 0; i <= n-1; i++) { lens.push_back(n+i); } for(int i = n-2; i >= 0; i--) { lens.push_back(n+i); } vector<vector<int>> actual(lens.size()); int t = ...
ALGO
0.999989
4.196642
{ "github_metadata": { "branch": "master", "commit_count": 881, "repo_created_at": "2017-11-27T05:28:46.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 175, "forks": 79, "issues": 3, "pull_requests": 1 }, "file_meta": { "content_id": "66baa...
c972e6bb-4f08-424c-96d3-ab642a2b0e5c
1Abhishek-tech/Data-Structure-Algorithm
1657-determine-if-two-strings-are-close/1657-determine-if-two-strings-are-close.cpp
class Solution { public: bool closeStrings(string word1, string word2) { unordered_map<char,int> mp1; //A map to get the frequency of string 1 unordered_map<char,int> mp2; //A map to get the frequency of string 2 vector<int> v1; vector<int> v2; if(word1.size()==word2.size()) //I...
ALGO
0.999981
5.880367
{ "github_metadata": { "branch": "main", "commit_count": 825, "repo_created_at": "2022-06-12T08:56:12.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "256cc68d4d...
b48598da-f001-4f17-9703-7c366714841d
reddy-lab-code-research/MuST-CoST
data/transcoder_evaluation_gfg/cpp/NUMBER_OF_BINARY_TREES_FOR_GIVEN_PREORDER_SEQUENCE_LENGTH.cpp
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // #include <iostream> #include <cstdlib> #include <string> #include <vector> #include <fstream> #include <iomanip> #include...
ALGO
0.999961
5.448363
{ "github_metadata": { "branch": "main", "commit_count": 30, "repo_created_at": "2022-02-08T19:28:59.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 11, "forks": 5, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "c959b91abbf...
ddc64a1e-762e-4102-807b-2ef96a1d3d84
jatbains/Code-Samples
NAryLevelTraversal/NAryLevelTraversal/NAryLevelTraversal.cpp
// NAryLevelTraversal.cpp : This file contains the 'main' function. Program execution begins and ends there. // #include <iostream> #include <vector> #include <queue> class Node { public: int val; vector<Node*> children; Node() {} Node(int _val) { val = _val; } Node(int _val, vector...
ALGO
0.999933
5.568511
{ "github_metadata": { "branch": "master", "commit_count": 18, "repo_created_at": "2019-10-03T04:29:40.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "260a61021...
db8ac668-0e78-4dcd-a230-5418b8478126
srh/refound
src/rdb_protocol/btree.cc
// Copyright 2010-2015 RethinkDB, all rights reserved. #include "rdb_protocol/btree.hpp" #include <stdlib.h> #include <string.h> #include <algorithm> #include <functional> #include <iterator> #include <set> #include <string> #include <vector> #include "concurrency/coro_pool.hpp" #include "concurrency/new_mutex.hpp" ...
ALGO
0.90611
7.646897
{ "github_metadata": { "branch": "master", "commit_count": 34771, "repo_created_at": "2022-09-06T04:12:08.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 32, "forks": 2, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "47c8b...
25a23dca-bf51-4694-94b0-fd2988e5162a
app126/ped20192020
TAVL_tads_MIOS_PRUEBA/funciones.cpp
void TAVLCom::CopiarAVL(const TAVLCom &arbol) { if (!arbol.EsVacio()) { this->raiz = new TNodoAVL(); this->raiz->item = arbol.raiz->item; this->raiz->iz.CopiarAVL(arbol.raiz->iz); this->raiz->de.CopiarAVL(arbol.raiz->de); } else{ this->raiz = NULL; } } // Constructor de copia TAVLCom::TAVLCom(const TAVLCo...
ALGO
0.982579
3.564744
{ "github_metadata": { "branch": "master", "commit_count": 14, "repo_created_at": "2020-01-29T19:16:33.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6c5566baf...
e12ec54c-34cc-4ca3-82e6-7b08aa908d57
csci0300/cs300-s21-projects
distributed-store/common/common.h
#ifndef SHARDING_COMMON_H #define SHARDING_COMMON_H #include <string> #include <vector> /* ========================= */ /* ====== Definitions ====== */ /* ========================= */ // thresholds for shard splitting and merging // ignore these unless you implement part 4 constexpr unsigned int HOT_THRESH = 100; co...
TOOL
0.966525
6.526812
{ "github_metadata": { "branch": "master", "commit_count": 14, "repo_created_at": "2021-01-20T04:02:05.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 6, "forks": 3, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c841eb5eea...