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
53eebfe6-9d3f-4462-9358-4533851c2e9e
LandryEliyana/Leetcode
1281-整数的各位积和之差.cc
/* 给你一个整数 n,请你帮忙计算并返回该整数「各位数字之积」与「各位数字之和」的差。 示例 1: 输入:n = 234 输出:15 解释: 各位数之积 = 2 * 3 * 4 = 24 各位数之和 = 2 + 3 + 4 = 9 结果 = 24 - 9 = 15 示例 2: 输入:n = 4421 输出:21 解释: 各位数之积 = 4 * 4 * 2 * 1 = 32 各位数之和 = 4 + 4 + 2 + 1 = 11 结果 = 32 - 11 = 21 */ #include <iostream> using namespace std; class Solution { public: ...
ALGO
0.999954
5.856363
{ "github_metadata": { "branch": "main", "commit_count": 34, "repo_created_at": "2025-07-13T11:55: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": "da7887ee14b...
5be45530-4fbf-485d-8450-a07168c229a2
shas9/codehub
Codeforces/Good Bye/Good Bye 2017/A.cpp
#include <bits/stdc++.h>` #define slld(longvalue) scanf("%lld", &longvalue) #define plld(longvalue) printf("%lld\n", longvalue) #define slf(longvalue) scanf("%lf", &longvalue) #define plf(longvalue) printf("%lf\n", longvalue) #define sc(letter) scanf("%c", &letter) #define pc(letter) printf("%c", letter) #define ss(...
ALGO
0.99901
3.244841
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2021-07-25T17:32: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": "2ef5d8897a...
9670ef4c-924a-46df-9f93-01f5ede4aec8
baptistedufour/ElementFini
main.cc
#include <iostream> #include <fstream> #include <chrono> #include "SystemSolver.h" using namespace std; using namespace Eigen; int main(int argc, char** argv) { if (argc < 2) { cout << "Please, enter the name of your data file." << endl; abort(); } const string data_file_name = argv[1]; // -------...
ALGO
0.999373
4.440839
{ "github_metadata": { "branch": "master", "commit_count": 28, "repo_created_at": "2018-12-09T13:44:14.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9b89b36cc...
bd57cc05-27c8-4825-9243-e304226bed27
oxygen-hunter/Flashboom
data/big-vul-100/add_attention_code/Phi/top0-100/minimum-number-of-visited-cells-in-a-grid-Solution2.minimumVisitedCells/177909_DoS_Exec_Code_Overflow.cpp
void Splash::scaleMaskYdXu(SplashImageMaskSource src, void *srcData, int srcWidth, int srcHeight, int scaledWidth, int scaledHeight, SplashBitmap *dest) { Guchar *lineBuf; Guint *pixBuf; Guint pix; Guchar *destPtr; int yp, yq, xp, xq, yt, y, yStep, xt, x, xStep, d; int i, j; yp = s...
ALGO
0.995083
4.74239
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2025-03-22T14:39:20.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "769a52d1aeee...
51c48295-ccd4-4620-bc5f-4a3d268752ec
danielprue/Huffman-Tree
Huffman.cpp
#include "Huffman.h" //Almost complete //Minor ordering issue, otherwise functional bool Huffman::createTree(string filename) { //read in a filename and cancel out if it's no good ifstream myfile(filename); if (myfile.fail()) { myfile.clear(); return false; } //string parceMe = ""; //string line; //this ...
ALGO
0.975421
4.103509
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2018-08-23T18:35: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": "036822db22...
c7463987-e72f-4ba1-92eb-191d950bea1b
abadid/624Assignment1
include/config.h
#ifndef CONFIG_H_ #define CONFIG_H_ #include <iostream> #include <getopt.h> #include <stdlib.h> #include <unordered_map> #include <cassert> static struct option long_options[] = { {"max_outstanding", required_argument, NULL, 0}, {"pool_size", required_argument, NULL, 1}, {"exp_type", require...
CONFIG
0.906648
5.079374
{ "github_metadata": { "branch": "master", "commit_count": 16, "repo_created_at": "2018-09-05T01:40:48.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 2, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "318946c6d...
43845783-913b-491a-85ab-081342c066b2
aviaryan/algorithms-course
midsem/heapsort.cpp
#include "bits/stdc++.h" #define MODULO 1000000007 #define endl '\n' #define m(a) ((a)%MODULO) using namespace std; typedef unsigned long long ull; typedef long long ll; class heap { private: int arr[100]; int size; public: heap(); void insert(int); void print(); void heapsort(); void build(int * in...
ALGO
0.999875
4.452725
{ "github_metadata": { "branch": "master", "commit_count": 20, "repo_created_at": "2016-01-18T04:19:17.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "218ce107f...
1d629839-9deb-40b3-a809-ac222b8cc1c1
SdobnovE/speccourse_count_models
static_test/test_fixed_set.cpp
#include <cstring> #include <iostream> #include <random> #include <set> #include <stdexcept> #include <vector> #include "fixed set.cpp" std::vector<int> ReadSequence() { size_t size; std::cin >> size; std::vector<int> sequence(size); for (auto &current : sequence) { std::cin >> current; } return seque...
ALGO
0.998913
5.844759
{ "github_metadata": { "branch": "master", "commit_count": 8, "repo_created_at": "2020-10-10T23:14:52.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d16b0d251e...
2328c364-eb79-45af-9d94-812de5a78c31
AkaPvto/cdp
src/core/core.cpp
// This file will contain the core function of the program #include "core.hpp" #include <iostream> #include <vector> #include <array> #include <chrono> #include <thread> #include "algorithm/aabb.hpp" #include "algorithm/gjk.hpp" #include "algorithm/sat.hpp" #include "sys/render.tpp" // #include "algorithm" // #incl...
ALGO
0.959091
4.761938
{ "github_metadata": { "branch": "master", "commit_count": 76, "repo_created_at": "2023-07-31T22:57: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": "b32fdb92b...
8240d97e-198f-4fd4-9468-994c9f2c7461
le-incroyable1-dev/dsa_archive
sar_phod_lo_apna_idhar/cc/betdeal.cpp
//author : aurav #include<bits/stdc++.h> using namespace std; #define mod 1000000007 #define pb push_back #define mp make_pair #define fi fira,bst #define sec second typedef long long ll; typedef long double ld; #define pii pair<ll,ll> #define vi vector< ll > #define vvi vector< vi > #define vpi vector< pii > #define ...
ALGO
0.999214
3.448998
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2024-02-09T14:27: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": "51842c2bcf08...
82418988-f7eb-482e-bff0-949114832d66
HumanThe2nd/DMOJ_solutions
goodc.cpp
/* Good Strategy Author: <NAME> Date: 2024-12-24 map problems in ordered sets by balloon count map each index to its current difficulty least balloons & highest index is max most balloons & lowest index is min no problems remain when both maps are emptied */ #include <bits/stdc++.h> using namespace std; int main() { ...
ALGO
0.999915
4.354221
{ "github_metadata": { "branch": "main", "commit_count": 1227, "repo_created_at": "2023-06-12T20:37:54.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d5d202be9...
852166aa-4e32-4f60-94f2-c70694d5feb5
patriciafiona/Comprehensive-Programming-Final-Projects
CPP/FlappyBird/FlappyBird/main.cpp
#include <SFML/Audio.hpp> #include <SFML/Graphics.hpp> #include <iostream> #include <stdlib.h> #include <time.h> #include <vector> #include <thread> #include <chrono> using namespace sf; using namespace std; using namespace std::this_thread; using namespace std::chrono; int window_width = 400; int window_height = 800...
TOOL
0.929939
4.47684
{ "github_metadata": { "branch": "main", "commit_count": 17, "repo_created_at": "2021-11-09T02:18: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": "6dcf6169f39...
cca13d43-7679-41ed-8a98-3301c77c0bb9
alexandraback/datacollection
solutions_2453486_1/C++/momohuang/GCJ2013Q_A.cpp
//By momo #include <cstdio> #include <algorithm> using namespace std; char tbl[5][5]; bool check(char c){ for(int i = 0; i < 4; i++){ int fl = 1; for(int j = 0; j < 4; j++) if(tbl[i][j] != c && tbl[i][j] != 'T') fl = 0; if(fl) return 1; } for(int j = 0; j < 4; j++){ int fl = 1; for(int i = 0; i < 4; i+...
ALGO
0.999968
3.75464
{ "github_metadata": { "branch": "master", "commit_count": 58, "repo_created_at": "2017-03-08T11:33:58.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e8776537c...
89224123-f4f2-4371-a0dd-3f843e1243a5
wanjohi/simba
simba.cpp
#include "simba.h" //setters void Simba::setBoard(string input) { int pos = 0; for(char& c : input) { if(c == ',') continue; board[pos] = c; pos = pos +1; } } void Simba::setPlayer (string input) { if(input == "b") { player_color = 'b'; opp_color = 'r'; } ...
ALGO
0.990045
3.284387
{ "github_metadata": { "branch": "master", "commit_count": 15, "repo_created_at": "2018-12-04T22:34:19.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7447cd2bf...
026cc60d-34b5-4ad3-b858-238c5d8d966f
ThangNguyen3105/programming_technical
linhCanh.cpp
#include <iostream> using namespace std; int timX(int a[], int n, int x) { int i = 0; while (i < n && a[i] != x) i++; if (i < n) return i; return -1; } // tìm max sử dụng sentinel int sentX(int a[], int n) { int x = a[0]; for (int i = 0; i < n; i++) { if (a[i] > x) ...
ALGO
0.999894
3.585405
{ "github_metadata": { "branch": "master", "commit_count": 12, "repo_created_at": "2023-10-20T05:38:01.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7bbb273a7...
caa32b65-0c2f-4b7c-811c-6c1eae340881
seekworser/competitive_library
atcoder/segtree.hpp
#pragma once #include <algorithm> #include <cassert> #include <vector> #include "atcoder/internal_bit.hpp" namespace atcoder { template <class S, S (*_op)(S, S), S (*_e)()> struct segtree { public: S (*op)(S, S) = _op; S (*e)() = _e; segtree() : segtree(0) {} explicit segtree(const std::vector<S>& ...
ALGO
0.99897
7.171784
{ "github_metadata": { "branch": "master", "commit_count": 202, "repo_created_at": "2022-09-03T09:55:03.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 2, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "900d1bd4...
439243be-0fdd-4311-b4fd-42152f997816
jjh4450/Algorithm-Practice
cpp/링크와 스타트 15661.cpp
#include<iostream> #include<vector> #include<algorithm> using namespace std; int N, answer = 1000000000, v[20][20]; bool use[20]; void view(int cnt, int idx, int target) { vector<int> start, link; int start_s = 0, link_s = 0; if (cnt == target) { for (int i = 0; i < N; i++) { ...
ALGO
0.999989
3.986434
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2023-06-13T17:09:44.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2c38c2dac50b...
fc905050-d829-402d-9f78-a95a783d062a
tcew/ATPESC18
examples/opencl/jacobi/main.cpp
#include <math.h> #include <stdio.h> #include <stdlib.h> #include <sys/stat.h> #ifdef __APPLE__ #include <OpenCL/OpenCl.h> #else #include <CL/cl.h> #endif #define datafloat float #define BX 16 #define BY 16 #define BDIM 256 // user supplied error call back function void pfn_notify(const char *errinfo, const void *...
ALGO
0.999808
4.983825
{ "github_metadata": { "branch": "master", "commit_count": 21, "repo_created_at": "2018-07-15T16:25:50.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 15, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9072e388...
e81fc0b9-a563-4882-9068-bf44cb3bc187
QianMo/GPU-Gems-Book-Source-Code
GPU-Gems-1-CD-Content/Image_Processing/OpenEXR/OpenEXR-1.0.6/Imath/ImathVec.cpp
/////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2002, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the f...
TOOL
0.915258
7.351624
{ "github_metadata": { "branch": "master", "commit_count": 28, "repo_created_at": "2018-04-21T15:43:01.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1080, "forks": 449, "issues": 3, "pull_requests": 0 }, "file_meta": { "content_id": "3126...
3983481a-9119-4b64-a2d2-24b2611e6e65
iyungui/TIL-codetree
241126/최소공배수 구하기/find-the-least-common-multiple.cpp
#include <iostream> using namespace std; void lcm(int n, int m) { int i = 1; int j = 1; int lcm; while(true) { if (n * i == m * j) { lcm = m * j; break; } if (n * i < m * j) { i++; } else { j++; } } cout << ...
ALGO
0.999974
4.894697
{ "github_metadata": { "branch": "main", "commit_count": 1727, "repo_created_at": "2024-10-20T16:39:05.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "39200eb5b...
7c90234e-6061-4e4c-be9d-3059ae4289bd
ImportMengjie/Leetcode
207.课程表.cpp
/* * @lc app=leetcode.cn id=207 lang=cpp * * [207] 课程表 * * https://leetcode-cn.com/problems/course-schedule/description/ * * algorithms * Medium (49.62%) * Likes: 327 * Dislikes: 0 * Total Accepted: 36.7K * Total Submissions: 72.4K * Testcase Example: '2\n[[1,0]]' * * 你这个学期必须选修 numCourse 门课程,记为 0 ...
ALGO
0.99991
6.36326
{ "github_metadata": { "branch": "master", "commit_count": 148, "repo_created_at": "2019-08-04T12:45:30.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "61631187...
2bfb83a4-87f6-4777-ba16-424a4b80a027
FAJITA-Packet-Processing-Framework/FAJITA-experiments
extra-elements/dyssect/solver.cpp
#include <stdio.h> #include <stdint.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include "gurobi_c++.h" #include <sstream> #include <deque> #include <cmath> #include <ctime> #include <fcntl.h> #include <cstdint> #include <cstdlib> #include <sys/stat.h> #include <sys/time.h> #include <sys/types.h> ...
ALGO
0.999707
3.234816
{ "github_metadata": { "branch": "main", "commit_count": 42, "repo_created_at": "2024-07-09T21:48:24.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e514e1e1a1dc...
87265b3f-c485-4281-a942-b3d180ccb766
EmaMule/RobotProgramming
DMAP-localizer/src/localizer/src/rp_stuff/dmap_grid_localizer_test.cpp
#include <cstdlib> #include <iostream> #include <fstream> #include <cmath> #include <sys/time.h> #include "dmap_localizer.h" #include "draw_helpers.h" #include "grid_map.h" using namespace std; using Eigen::Isometry2f; using Eigen::Rotation2Df; int main(int argc, char** argv) { if (argc<4) { std::cout << "usage...
ALGO
0.997481
5.219974
{ "github_metadata": { "branch": "main", "commit_count": 28, "repo_created_at": "2024-02-26T17:41:53.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "086ac1d55b7...
9c60e983-5d47-4b7e-a9e6-d43e71dc1fa0
cympfh/domino
domino.cpp
#include <GL/glut.h> #include "gl.h" #include <iostream> #include <math.h> #include "domino.h" #include "mymath.h" #include "kika.h" using namespace std; std::vector<domino> world; domino cursor; bool st = false; int floor_check (int idx) { const float h_2 = domino_height_2, y1 = obj.y1, y2 = obj....
ALGO
0.992045
3.936551
{ "github_metadata": { "branch": "master", "commit_count": 7, "repo_created_at": "2013-04-25T01:47: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": "13ab1448ed...
e9965878-d994-4a5d-9da6-009200d3849e
MohamedMamdouh18/Problem-Solving
Code Forces Problems/Level C/Boats Competition/main.cpp
#include <bits/stdc++.h> using namespace std; #define pb push_back #define eb emplace_back #define el "\n" #define ll long long #define all(a) a.begin(),a.end() #define IOS ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0); #define PREC cout.precision(20); const ll mod = 1e9 + 7, N = 1000406, M = 20, INF = LONG_LO...
ALGO
0.999892
3.996455
{ "github_metadata": { "branch": "main", "commit_count": 87, "repo_created_at": "2023-03-31T21:01: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": "1ec737a3f32...
d2783895-dd37-4a70-89a1-26e95866c82f
StrawHatWess/Competitive-Programming-Solutions
MyChecklist/Joker.cpp
//Never stop trying #pragma GCC target ("avx2") #pragma GCC optimization ("O3") #pragma GCC optimization ("unroll-loops") #include <bits/stdc++.h> using namespace std; #define boost ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0) typedef string str; typedef long long ll; #define int ll typedef double db; typ...
ALGO
0.999979
4.342875
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2022-04-18T12:51:25.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "80a0648b0b80...
e933cb0a-ba5a-46a8-8ece-4eb5f9a9c5c5
Nayandeep1431/Leetcode-Solutions
Binary_Search/Minimum Speed to Arrive on Time.cpp
class Solution { bool check(vector<int> &dist, int mid, double hr) { int n = dist.size(); double total = 0; for (int i = 0; i < n - 1; i++) { total += ceil((double)(dist[i]) / (double)(mid)); } total += (double)(dist[n - 1]) / (double)(mid); return total...
ALGO
0.999989
5.464925
{ "github_metadata": { "branch": "main", "commit_count": 211, "repo_created_at": "2025-05-17T04:54: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": "1d30c233b0...
ba594f27-c297-4785-ad06-a91ef48bfcd4
flowerfx/cc2dx_design_fw
lib/RKUtils/Code/RKVector_Code/RKMathTrig_NEON.cpp
#include "RKMathTrig.h" namespace RKUtils { #if defined(__ARM_NEON__) && !defined(__arm64__) // returns {sin, cos} void RKMath_SinCos(float angle, RKVector2& results) { static const uint32 constants[] = { /* q2 d4-d5 */ 0x3ea2f983, 0x40490fdb, 0x80000000, 0x80000000, // 1/pi, pi, sign bit, sign bit /* q...
ALGO
0.989678
6.648376
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2016-10-01T05:09:21.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2e21f3381c...
007f5905-048a-4a31-a3fe-c2f247d738df
BraveY/Coding
leetcode-cn/JZ06reversePrint.cc
/* * @Author: <NAME> * @Date: 2021-03-10 20:47:54 * @LastEditTime: 2021-03-10 21:45:46 * @LastEditors: Please set LastEditors * @Description: In User Settings Edit * @FilePath: \Coding\leetcode-cn\JZ06reversePrint.cc */ #include <limits.h> #include <stdio.h> #include <algorithm> #include <iostream> #include <uno...
ALGO
0.999058
5.457484
{ "github_metadata": { "branch": "master", "commit_count": 183, "repo_created_at": "2019-04-03T05:12:32.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3e02d9c5...
39eb0605-0981-4741-a3d5-2b5a6925c271
starswap/CompetitiveProgramming
CodeForces/1004/E.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> vi; int N, K; vector<vector<pair<int, int>>> AL; vector<int> par; vector<int> pw; vector<int> dist; vector<int> nodes; const int UNDEF = 1'000'000; const int INF = 1'000'000'010; void get_distances(int u, int d, int p, int i) {...
ALGO
0.99991
4.675637
{ "github_metadata": { "branch": "main", "commit_count": 389, "repo_created_at": "2021-08-23T11:40:00.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5689b60662...
427abe5a-81d0-41bc-ad65-9ef96f8a9b4c
Cybertron3/competitive
atcoder/panasonic/b.cpp
//PLUS ULTRA #include<bits/stdc++.h> using namespace std; #define SPEED ios::sync_with_stdio(false); cin.tie(0); cout.tie(0) #define pb push_back #define mp make_pair #define forn(i,st,n) for(int i = st; i < n ; i++) #define nfor(i,st,n) for(int i = st; i >= n ; i--) typedef long long ll; typedef pair <i...
ALGO
0.999761
3.880426
{ "github_metadata": { "branch": "master", "commit_count": 19, "repo_created_at": "2019-04-15T01:12:01.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7a6781e34...
d3f2c4c6-05f2-4b02-843c-f831e438a34f
raincross7/code-similarity
codes/train_code/problem132/problem132_141.cpp
/*-- ILSH --*/ #include "bits/stdc++.h" using namespace std; typedef long long ll; typedef long double ld; #define pb push_back #define pop pop_back #define mp make_pair #define vii vector < ll > #define vll vector < ll > #define dt cout<<"HERE\n"; #define pii pair < ll , ll > #define pll pair < ll , ll > #define vp...
ALGO
0.999974
3.984942
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2024-03-06T05:07:19.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "393d9f69942d...
fbd147e0-470d-41a4-a7b5-d230d01dbcc9
Denver44/CP-and-DSA-in-CPP
DSA/10LinkedList/Extra/17PalindromeLinkedList.cpp
#include <iostream> using namespace std; class Node { public: int data; Node *next; Node(int data) { this->data = data; this->next = NULL; } }; bool isPalindrome(Node *head) { if (head == NULL || head->next == NULL) return true; Node *secondptr, *fastptr = head, *slowptr = head; while (1)...
ALGO
0.999719
4.714106
{ "github_metadata": { "branch": "master", "commit_count": 329, "repo_created_at": "2020-09-19T19:53:06.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2e8f0056...
1e441136-e8fe-4ae4-a5e8-a43a7b0f3981
guswhitten/C--code-files
LeetCode75/45spiralMatrix.cpp
/* Given an m x n matrix, return all elements of the matrix in spiral order. */ class Solution { public: vector<int> spiralOrder(vector<vector<int>>& matrix) { int m = matrix.size(); int n = matrix[0].size(); vector<int> ans; int top = 0, bottom = m, left...
ALGO
0.999989
6.619952
{ "github_metadata": { "branch": "main", "commit_count": 257, "repo_created_at": "2021-10-16T14:04: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": "43e1179afe...
41cc62bb-fab5-4213-a835-1cdef0e1ee06
MadaraUchiha-314/Data-Structures-Library
BST/BST.cpp
#include <iostream> #include <cstdio> using namespace std; template <class T> struct Tree { T data; Tree *leftTree,*rightTree; }; template <class T> class BinaryTree { private : Tree<T> *TreeTop; unsigned int numberOfElements; // Some Private Functions That Serve As Helper Functions To Public Function // Too D...
ALGO
0.999846
3.548532
{ "github_metadata": { "branch": "master", "commit_count": 59, "repo_created_at": "2014-05-29T13:58:42.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 6, "forks": 3, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "ce672ccb1...
1f363e07-035f-49e1-abaf-a438427b684f
FeiiYin/hdu
4417 主席树+二分(区间小于h).cpp
/* * @Samaritan_infi */ #include <bits/stdc++.h> #define test cout << " test " ; using namespace std ; typedef long long ll ; inline bool scan(int &num) { char in; bool IsN = false; in = getchar(); if(in == EOF) return false; while(in != '-' && (in < '0' || in > '9')) in = getchar(); if(in == '...
ALGO
0.999977
4.878371
{ "github_metadata": { "branch": "test", "commit_count": 152, "repo_created_at": "2018-02-06T10:31:31.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b182273b80...
bcc4c730-c05c-4738-a456-1033f5c53d59
varg-dev/treemap-hub
source-cpp/treemap/source/layouting/SingleLevelPivot.cpp
#include <treemap/layouting/SingleLevelPivot.h> #include <numeric> #include <algorithm> #include <glm/common.hpp> #include <glm/exponential.hpp> #include <treemap/layout/Rect.h> #include <treemap/linearizedtree/LinearizedTree.h> #include <treemap/linearizedtree/LinearizedTreeNode.h> namespace { using pivotAlgori...
ALGO
0.999602
7.232871
{ "github_metadata": { "branch": "master", "commit_count": 63, "repo_created_at": "2021-04-15T09:26:24.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "57b653417c...
d0f3a24c-5f8b-4132-b4a5-5a5fafce39ff
movhdi/100daysOfCodingChallenge
p25_captilizingTitle/main.cpp
#include <sstream> #include <iostream> #include <algorithm> #include <vector> #include <cassert> std::string capitalize_title(std::string const & expression) { std::ostringstream result; auto it = expression.begin(); for(; it != expression.end(); it++) { if(*(it-1) == ' ' || *(it-1) == '.' || *...
TOOL
0.96726
5.591601
{ "github_metadata": { "branch": "main", "commit_count": 236, "repo_created_at": "2023-07-07T13:29: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": "6818f0c93d...
031fa6e6-aa88-4f12-ba27-23b031cbafb2
ishandutta2007/codeforces-a
aid/normal/1242/E.cpp
#ifdef DEBUG #define _GLIBCXX_DEBUG #endif #include <bits/stdc++.h> using namespace std; typedef long double ld; #ifdef DEBUG #define eprintf(...) fprintf(stderr, __VA_ARGS__), fflush(stderr) #else #define eprintf(...) ; #endif #define sz(x) ((int) (x).size()) #define TASK "text" const int inf = (int) 1.01e9; con...
ALGO
0.999967
3.266702
{ "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": "ecb928169af7...
f34df59f-31b6-435c-b62a-52e8a470d44f
KaizynX/Code
ByteDance/20211211G_2.cpp
/* * @Author: Kaizyn * @Date: 2021-12-11 16:35:40 * @LastEditTime: 2021-12-11 16:53:57 */ #include <bits/stdc++.h> #define DEBUG using namespace std; namespace hjt { template<typename A,typename B> std::ostream &operator<<(std::ostream &o,const std::pair<A,B> &x){ return o<<'('<<x.first<<','<<x.second<<')'; } #...
ALGO
0.998773
3.737194
{ "github_metadata": { "branch": "master", "commit_count": 351, "repo_created_at": "2018-02-19T10:48:43.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "161a322e...
c1d6f682-fb64-494e-98b0-9bd984a4964b
nwatx/CS3-Independent-Study
Quarter 1/Week 6/apartments.cpp
#include <bits/stdc++.h> using namespace std; #define ar array #define ll long long #define vt vector const int MAX_N = 2e5 + 2; const int MOD = 1e9 + 7; const int INF = 1e9; const ll LINF = 1e18; #define sz(x) (int)x.size() int apps[MAX_N]; vt<int> apts; int main() { ios_base::sync_with_stdio(0); cin.tie(...
ALGO
0.999873
4.121349
{ "github_metadata": { "branch": "master", "commit_count": 27, "repo_created_at": "2020-08-28T02:46:38.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "94b01bde5...
9afd27c4-be36-490a-8084-14269649cf88
leandrolazaro/TP1-Backtracking_PAA
structs/maze/maze.cpp
#include "maze.hpp" #include "../stack/stack.hpp" void mazeInitMaze(maze *_maze, char *fileName){ char path[100]="././inputFiles/"; FILE *file=NULL; char *line=NULL; char *temp=(char*)malloc(sizeof(char)); size_t len = 0; ssize_t read; int typeCellNum=1; strcat(path, fileName); ...
ALGO
0.994376
3.991354
{ "github_metadata": { "branch": "master", "commit_count": 12, "repo_created_at": "2019-09-26T12:48:31.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1115faf94...
1396f461-6ab6-4d8e-8066-66b6d2ff7045
ArfaAmir/PD
pd-lab6/task7.cpp
#include<iostream> using namespace std; string checkStudentStatus(int examHour, int examMinute, int studentHour, int studentMinute); main() { int examHrs; cout<<"Enter Exam Starting Time (hour): "; cin>> examHrs; int examMins; cout<<"Enter Exam Starting Time (minutes): "; cin>> examMins; int...
ALGO
0.946701
3.977188
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2023-10-13T05:12:51.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e5674f88db...
2345408b-2cdc-4db6-926e-e0e869dda27e
fengvyi/LeetCode
C++/659. Split Array into Consecutive Subsequences.cpp
class Solution { public: bool isPossible(vector<int>& nums) { unordered_map<int, int>m, f; for(auto x: nums) m[x]++; for(auto x: nums){ if(!m[x]) continue; else if(f[x]){ f[x]--; f[x + 1]++; } else if(m[x + 1] &&...
ALGO
0.999988
5.484549
{ "github_metadata": { "branch": "master", "commit_count": 1188, "repo_created_at": "2017-08-06T09:52:55.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 144, "forks": 39, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "7f2c...
8e1d8705-7f8d-4546-a707-25e53915f38e
lyrahgames/reflex-thesis
sections/code/surface-mesh-curve-face-based.hpp
struct face_based_node { face_id fid; // The location inside the adjacency of // the face given by the reference 'fid' // that points to the face adjacency // representing the previous face in the strip. // face_id loc : 16; // The amount that needs to be added to 'loc + 1' // to get the location in...
ALGO
0.983357
4.201632
{ "github_metadata": { "branch": "master", "commit_count": 84, "repo_created_at": "2022-07-18T21:54:42.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 15, "pull_requests": 0 }, "file_meta": { "content_id": "07c6b70a...
cd207ac6-9e35-4114-b8be-b876078fe332
atkvishnu/KnowledgeBase
Interview_Toil/CodeChef/Competitions/08_April_Long_2022-09_04_22/7.cpp
// https://www.codechef.com/APRIL221D/problems/XORABC #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; //----------------------------------------- #define fast() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0...
ALGO
0.999452
4.158759
{ "github_metadata": { "branch": "main", "commit_count": 46, "repo_created_at": "2022-05-14T15:47: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": "62e1b38d64d...
7dfdeaa5-13f4-4b43-97cf-da9413633385
dipender-singh/LEETCODE-SOLUTIONS
2348-number-of-zero-filled-subarrays/2348-number-of-zero-filled-subarrays.cpp
class Solution { public: long long zeroFilledSubarray(vector<int>& nums) { //Sub-arrays with elements as zero //Brute Force: Because after O(N^2) approach the solution is giving TLE. ios_base::sync_with_stdio(0); cin.tie(0);cout.tie(0); int n = nums.size()-1; long lon...
ALGO
0.999866
5.661962
{ "github_metadata": { "branch": "main", "commit_count": 894, "repo_created_at": "2022-06-08T04:53:37.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3cd7a207e1...
6cab2dc3-9dad-4e34-a35c-68f9e8bdc382
DCherish/CodingPractice
cpp File/PG85002/p85002.cpp
#include <string> #include <vector> #include <algorithm> using namespace std; struct info { double rate; int cnt; int weight; int idx; }; vector<info> vec; bool cmp(info a, info b) { if (a.rate == b.rate) { if (a.cnt == b.cnt) { if (a.weight == b.weight) { return a.idx < b.idx; } else retu...
ALGO
0.999991
4.432123
{ "github_metadata": { "branch": "master", "commit_count": 322, "repo_created_at": "2020-08-25T05:58: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": "5cff9232...
cab73655-c13b-43f6-a0c4-e355470302d2
antuan1996/code-archive
trello/timus1133.cpp
#include <algorithm> #include <cstdio> #include <deque> #include <queue> #include <string> #include <vector> #include <iostream> #include <sstream> #define pb push_back; #define mp make_pair #define sz(x) ((int)(x.size())) #define forc(i,n) for(int i = 0; i < n; ++i) using namespace std; stringstream fakestream; #i...
ALGO
0.999958
3.259986
{ "github_metadata": { "branch": "master", "commit_count": 15, "repo_created_at": "2015-07-02T17:28: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": "2a86f2810...
bb071201-fdb2-48b6-aa6c-0d02af4248a9
Maurya2811/LeetCode-GFG-Solutions
0085-maximal-rectangle/0085-maximal-rectangle.cpp
class Solution { public: int n; // true => NSL and false => NSR void nearestGreaterEle(vector<int>&temp ,vector<int>& heights, int pseudo_idx, bool NSL_Or_NSR){ stack<pair<int,int>> st; // <value,index> if(NSL_Or_NSR){ for(int i=0 ; i<n ; i++){ if(st.empt...
ALGO
0.999868
5.444816
{ "github_metadata": { "branch": "main", "commit_count": 1715, "repo_created_at": "2023-03-26T20:45:42.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6d32c8d86...
9a2562d2-db11-4d11-982a-82b28a2dc928
rviniciussouza/competitive-programming
URI/2683.cpp
#include <bits/stdc++.h> using namespace std; #define MAX_n 1010 int parent[MAX_n]; int qtdF[MAX_n]; typedef pair<int, int> ii; typedef struct{ int u, v , w; }E; struct{ bool operator()(E a, E b) const { return b.w < a.w; } } compare; void Kruskalinit(int n) { for(int i=0; i < n; ++i...
ALGO
0.999967
4.35766
{ "github_metadata": { "branch": "master", "commit_count": 17, "repo_created_at": "2018-09-05T02:11: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": "ef23807db...
7b926417-1fad-45ea-88c9-c6fb88bd529c
kamyu104/LeetCode-Solutions
C++/count-partitions-with-max-min-difference-at-most-k.cpp
// Time: O(n) // Space: O(n) // mono deque, two pointers, sliding window, dp, prefix sum class Solution { public: int countPartitions(vector<int>& nums, int k) { static const int MOD = 1e9 + 7; deque<int> max_dq, min_dq; vector<int> dp(size(nums) + 1); dp[0] = 1; for (int ...
ALGO
0.999975
6.127869
{ "github_metadata": { "branch": "master", "commit_count": 19395, "repo_created_at": "2018-10-11T17:38:35.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4939, "forks": 1616, "issues": 1, "pull_requests": 55 }, "file_meta": { "content_id": ...
01a9bc68-ffbb-4f6d-8fa1-f7f6c144072f
shahfaiz-07/dsa_archives
DynamicProgramming/Leetcode/Medium/DecodeWays/DecodeWays.cpp
#include<bits/stdc++.h> using namespace std; // MEMOIZATION int backtrack(string &s, int i, vector<int> &dp) { if (i < 0) { return 1; } if (dp[i] != -1) return dp[i]; if (s[i] == '0') { // you cannot proceed if it is the first index or if the previous index is > 2 ...
ALGO
0.999578
4.929359
{ "github_metadata": { "branch": "main", "commit_count": 296, "repo_created_at": "2024-08-14T18:01: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": "81dfe1e6e6...
76c1cb3e-320c-4718-a4ef-94b9e54bd1d7
Soumik-HasanSMK/Phitron
CPP/Data Structure/Module 10.5 Practice Day 01(Doubly LL)/problem_05.cpp
#include <bits/stdc++.h> using namespace std; class Node { public: int val; Node *next; Node *prev; Node(int val) { this->val = val; this->next = NULL; this->prev = NULL; } }; void insert_tail(Node *&head, Node *&tail, int val) { Node *newNode = new Node(val); if ...
ALGO
0.999965
4.497094
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-09-04T18:36:24.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "10c0e24bc90b...
4ff22a8b-6ce2-45fb-8504-57b4234c7934
chamow97/Interview-Prep
leetcode/1415. The k-th Lexicographical String of All Happy Strings of Length n.cpp
class Solution { public: vector<string> allS; void generateString(int n, int i, string curr) { if(i == n) { allS.push_back(curr); return; } if(i == 0) { generateString(n, i + 1, curr + "a"); generateString(n, i + 1, curr + "b"); ...
ALGO
0.999968
4.843787
{ "github_metadata": { "branch": "master", "commit_count": 75, "repo_created_at": "2017-11-29T12:29:51.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0f580d4a7...
32122858-6b5b-44df-8adc-ef88a211874d
jordi-petit/ap1-codis-2019-2020
2019-09-25/p1.cc
#include <iostream> using namespace std; int maxim2(int x, int y) { if (x > y) return x; /* else */ return y; } int maxim3(int x, int y, int z) { return maxim2(x, maxim2(y, z)); } int maxim4(int x, int y, int z, int w) { return maxim2(maxim2(x, y), maxim2(z, w)); } // funció que, donat un natura...
ALGO
0.999977
4.286181
{ "github_metadata": { "branch": "master", "commit_count": 42, "repo_created_at": "2019-09-09T10:21:00.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "33144a3bc...
cc564524-433b-4532-81c7-c583fdffe3ae
yixin-cfd/unstructured_2d
src/fluxWalls.cpp
/// @file fluxWalls.cpp /// /// Computation of fluxes at solid walls. /// //***************************************************************************** // // (c) <NAME>, CFD Consulting & Analysis, www.cfd-ca.de // Created February 15, 2014 // Last modification: July 7, 2014 // //==================================...
ALGO
0.993085
6.001899
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2024-11-04T03:11:35.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2b9534bb0ea5...
6b2a6246-6cd5-4962-9a87-54ed79b51cb2
likethestarsF/Backjun-Saves
Class_3/1260.cpp
// 240218 6 #1260 #include <algorithm> #include <iostream> #include <queue> #include <stack> #include <vector> using namespace std; class my { int startPoint; int numVertex; public: vector<vector<bool>> table; void input(const int &numOfVertex, const int &numOfEdge, const int &startingVertex) { ...
ALGO
0.999977
4.020641
{ "github_metadata": { "branch": "main", "commit_count": 387, "repo_created_at": "2024-01-23T02:37: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": "9b07cf9afe...
b8dc6943-b3cb-4ee7-abf0-0c9f9ed27626
MobeenButt/PD
Week10/task3.cpp
#include <iostream> using namespace std; bool cycle(int size, int arr[], int lengthofcycle); main() { int size; cout << "Enter the length of the array: "; cin >> size; int arr[size]; cout << "Enter the elements of the array: " << endl; for (int i = 0; i < size; i++) { cin >> arr[i];...
ALGO
0.999578
3.510582
{ "github_metadata": { "branch": "master", "commit_count": 12, "repo_created_at": "2023-09-08T10:05:24.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3f579dda7...
bf784b3a-705b-4ed2-a05e-7e58b40abc7c
ArjunParajuli/DSA
Linked List/linkedlist_cycle.cpp
// Given head, the head of a linked list, determine if the linked list has a cycle in it. // Algo: // move fast two steps and slow one step until they meet // why does this algo work? // bcoz they're moving one step and two step at a time so, if theres a cycle then they're bound to meet at one point(destined to meet...
ALGO
0.999299
4.702756
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2024-08-09T13:50:36.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "95a5e59646f9...
4f8abb04-bd80-481c-a4c2-e8ea25fac9f4
BrOverShield/AoC2019
day11_test/Part2.cpp
#include <iostream> #include <fstream> #include <vector> #include <string> // to_string(), stoi() #include <map> #include <numeric> // iota #include <chrono> #include <limits> #include "Main.h" // #include "NumberlikeArray.hh" // #include "BigIntegerLibrary.hh" void Part2() { std::cout.precision(dbl::max_digits10...
ALGO
0.985381
4.221133
{ "github_metadata": { "branch": "master", "commit_count": 15, "repo_created_at": "2019-12-01T07:04: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": "2d6fae6d8...
9549e62f-a1cf-414c-8ba8-fccb17aac06c
liuvaneshka/tp1_algoii
historia.cpp
#include <iostream> #include "historia.h" using namespace std; void copiar_vector(int coincidencias, int * aux, int* &arreglo){ for(int i =0; i < coincidencias; i++){ aux[i] = arreglo[i]; cout << aux[i] << " " << arreglo[i] << endl; } delete[]arreglo; arreglo = aux; } void almacenar_coincidencia(int &coinc...
ALGO
0.982365
3.557728
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2022-04-12T18:34: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": "f7ada8a6d29b...
9176bf79-1cc9-4163-9aa6-2d0b94e21859
huang825172/Fractal
main.cpp
#include <opencv2/opencv.hpp> #include <ccomplex> #include <iomanip> #define kWIDTH 800 #define kHEIGHT 800 class Pixel { public: char r, g, b; Pixel() : r(0), g(0), b(0) {}; Pixel(char r, char g, char b) : r(r), g(g), b(b) {}; void set(char nr, char ng, char nb) { r = nr; g = ng; ...
ALGO
0.981997
5.590444
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2020-11-21T10:56:26.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a880db6dfc...
3eb07bf8-027c-4962-9861-d8fc9cf7448a
HongTrang277/pbl1-
DiscreteMaths/BelmanFord.cpp
#include <bits/stdc++.h> #define Max 10000 using namespace std; int target,m, S, F; float c[101][101]; float d[101]; int Trance[101]; void input(int &target, int &m, int &S, int &F, float c[101][101]); void khoitao(int &S, int &target, int Trance[101], float d[101], float c[101][101]); void FordBellman(int &target, i...
ALGO
0.999963
3.677122
{ "github_metadata": { "branch": "main", "commit_count": 111, "repo_created_at": "2024-02-23T08:39:42.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4b9a65c591...
07ed697b-5678-4ecd-882e-7c507624bf7c
haozzzzzzzz/osgEarthX
environment/build/3rdParty/include/geos/geos/geom/IntersectionMatrix.h
/********************************************************************** * * GEOS - Geometry Engine Open Source * http://geos.osgeo.org * * Copyright (C) 2006 Refractions Research Inc. * * This is free software; you can redistribute and/or modify it under * the terms of the GNU Lesser General Public Licence as p...
ALGO
0.940999
4.209775
{ "github_metadata": { "branch": "master", "commit_count": 28, "repo_created_at": "2015-09-19T06:19:42.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 75, "forks": 48, "issues": 3, "pull_requests": 0 }, "file_meta": { "content_id": "882fde9...
54bf24c2-9473-4043-87e8-eb494fb50e3c
Atharva1583/Data-Structures-and-Algorihtms
LinkedList/Creating_A_Linked_List.cpp
//{ Driver Code Starts // Initial Template for C++ // Problem Link: https://practice.geeksforgeeks.org/problems/introduction-to-linked-list/1?utm_source=youtube&utm_medium=collab_striver_ytdescription&utm_campaign=introduction-to-linked-list #include <bits/stdc++.h> using namespace std; class Node { public: int da...
ALGO
0.999855
6.426309
{ "github_metadata": { "branch": "main", "commit_count": 8, "repo_created_at": "2023-06-06T09:36:00.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ece17cfb203a...
e617e37a-d25d-4286-b46c-5d9fafa46dd6
Coach-Academy/Winter-1-2023
Level 3 Class 1/Practice G1/Week 02/Problem G.cpp
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cout.tie(nullptr); cin.tie(nullptr); int x0, y0, x1, y1; cin >> x0 >> y0 >> x1 >> y1; int n; cin >> n; set<pair<int, int>> allowed; for (int r, a, b; n--; ) { cin >> r >> a >> b; for (; a <=...
ALGO
0.999744
3.849225
{ "github_metadata": { "branch": "main", "commit_count": 669, "repo_created_at": "2023-10-02T17:17:10.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 2, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "243a3f723c9...
01a965ad-4f55-46e4-8198-ae08d98a0b39
TudorOrban/Groth
include/RouteConfig.h
#pragma once #include <string> #include <functional> #include <unordered_map> #include <optional> #include<regex> #include "Http/HttpRequest.h" #include "Http/HttpResponse.h" using RouteParameters = std::unordered_map<std::string, std::string>; typedef std::function<HttpResponse(const HttpRequest&, const RouteParame...
WEB
0.923517
6.467453
{ "github_metadata": { "branch": "main", "commit_count": 11, "repo_created_at": "2024-02-08T21:30: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": "ef3b49dd93d...
ad7bfcfb-90a1-44d5-a728-128dcb979563
liubang/leetcode
src/2559.count-vowel-strings-in-ranges.cpp
// Copyright (c) 2024 The Authors. All rights reserved. // // 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 // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by app...
TEST
0.992694
6.934445
{ "github_metadata": { "branch": "main", "commit_count": 103, "repo_created_at": "2022-01-17T06:30:10.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6469e75d68...
264a6c86-c013-447f-9d41-b19a98b69f7b
Mi022/camel-code-raisim-cpp
include/Optimizer/GradientDescentOptimizer.cpp
// // Created by jaehoon on 22. 6. 1. // #include "GradientDescentOptimizer.h" #include <iostream> void GradientDescentOptimizer::setInitialState(Eigen::VectorXd initialState) { mState = initialState; mDimension = mState.size(); mTempState = Eigen::VectorXd(mDimension); mGradient = Eigen::VectorXd(mDim...
ALGO
0.999748
5.442662
{ "github_metadata": { "branch": "main", "commit_count": 130, "repo_created_at": "2022-10-17T05:40: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": "bb4f51bb8e...
e3a96583-7d71-4693-836f-a8754f349df2
emon4075/CodeForces
B_Monsters.cpp
#include <bits/stdc++.h> using namespace std; #define endl '\n' #define ll long long #define PB push_back #define All(V) V.begin(), V.end() #define F first #define S second const int MOD = 1e9 + 7; const int INF = INT_MAX; void FASTIO() { ios::sync_with_stdio(false); cin.tie(NULL); } bool compare(pair<int, ...
ALGO
0.999853
3.793339
{ "github_metadata": { "branch": "master", "commit_count": 114, "repo_created_at": "2023-09-14T14:12:02.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a46be38e...
7289e94e-0259-417e-a782-9385876f1537
Ayush01015/Stiver-DSA-Sheet-1
5_Arrays/Easy/13_missing_number.cpp
#include <bits/stdc++.h> using namespace std; int main() { cout << "Enter value of N\n"; int n; cin >> n; int a[n]; int t = 0; int hash[100000]={0}; cout << "Enter " << n << " values\n"; for (int i = 0; i < n; i++){ cin >> a[i]; hash[a[i]]+=1; } cout << "Your " ...
ALGO
0.999911
3.629408
{ "github_metadata": { "branch": "master", "commit_count": 66, "repo_created_at": "2023-02-06T01:28:43.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e942dfd1b...
624b602e-0b8b-43cd-9312-51b82267afb5
munna516/DSA-For-Coding-Round
3. Array/EASY/Union Of Array/bruteforce.cpp
#include <bits/stdc++.h> using namespace std; // TC -> O(n log n)+O(m log n) && SC -> O(n+m) void Union(int ar1[], int ar2[], int n, int m) { set<int> st; for (int i = 0; i < n; i++) st.insert(ar1[i]); for (int i = 0; i < m; i++) st.insert(ar2[i]); for (auto it : st) cout << it...
ALGO
0.999915
4.324148
{ "github_metadata": { "branch": "main", "commit_count": 9, "repo_created_at": "2023-12-21T16:38:14.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "88ad2194c254...
ac00130a-3f2d-4980-81ae-bac4d1ea26a7
pranavsuriya-sr/CircleStarPuzzle
ans.c++
#include <iostream> #include <vector> #include <map> #include <string> #include <queue> using namespace std; class AngleStarPuzzle { private: map<char, vector<char>> connections; void initializeConnections() { connections['A'] = {'F'}; connections['B'] = {'G'}; connections['C'] = {'H'...
ALGO
0.999978
6.609729
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2025-05-06T18:13:51.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ef6e4af3b8da...
193024f0-6694-4093-ac49-27ae5c6691b3
ThLentzas/leetcode
40/main.cpp
#include <iostream> #include <vector> #include <algorithm> /* * 40. Combination Sum II Given a collection of candidate numbers (candidates) and a target number (target), find all unique combinations in candidates where the candidate numbers sum to target. Each number in candidates may only be used once ...
ALGO
0.999948
6.683733
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2025-05-11T23:34: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": "223b37ed53...
cc8b95d6-3af5-4ab5-8127-9e96f93db28a
cs118/spring12-project1
http-request.cc
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /** * @file Implementation for HttpRequest class * * Skeleton for UCLA CS118 Spring quarter class */ #include "http-request.h" #include <string> // C++ STL string #include <string.h> // helpers to copy C-style strings #include "compat.h" using na...
WEB
0.973601
5.369603
{ "github_metadata": { "branch": "master", "commit_count": 49, "repo_created_at": "2012-04-09T05:32:17.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 3, "forks": 3, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9ffdbd3d6d...
d904f35d-7863-44e7-87ea-ecd3c3e87cd6
mumua666/OnlineJudge
Exercise/LeetCode/LinkList/P206.cpp
#include <iostream> #include <vector> using namespace std; /** * 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) {} ...
ALGO
0.999945
5.921472
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-09-13T11:41:01.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9793676c4613...
3040f71b-b0f2-4011-bcd9-2f22278b454c
taatzz/LeetCode
2584.分割数组使乘积互质.cpp
/* * @lc app=leetcode.cn id=2584 lang=cpp * * [2584] 分割数组使乘积互质 */ // @lc code=start #include <vector> #include <unordered_map> using namespace std; class Solution { public: int findValidSplit(vector<int>& nums) { int n = nums.size(); unordered_map<int, int> s; auto find = [&...
ALGO
0.999961
5.877604
{ "github_metadata": { "branch": "main", "commit_count": 301, "repo_created_at": "2023-11-15T00:24: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": "6fe4310f98...
74456aab-0b46-4618-98db-277c091d5b70
LaurenHampson/backup
cacheLRU.h
#ifndef CACHE_LRU_H #define CACHE_LRU_H #include <iostream> #include <exception> #include <cstdlib> #include <utility> #include <math.h> #include <vector> #include <queue> #include <map> #include <stdexcept> //#include <exception> #include "rotateBST.h" #include "bst.h" #include "splayTree.h" template <typename Key,...
ALGO
0.926657
4.183681
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2018-05-01T21:37: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": "b6dce3a8ad...
ae434861-e902-44d9-bfcd-235e7daba64e
xcf1992/leetcode
C++/minimum_swaps_to_group_all_1's_together.cpp
/* 1151. Minimum Swaps to Group All 1's Together Given a binary array data, return the minimum number of swaps required to group all 1’s present in the array together in any place in the array. Example 1: Input: [1,0,1,0,1] Output: 1 Explanation: There are 3 ways to group all 1's together: [1,1,1,0,0] using 1 swap. [...
ALGO
0.999993
5.775644
{ "github_metadata": { "branch": "master", "commit_count": 1784, "repo_created_at": "2017-12-26T04:19:33.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "45ffa81...
3fbfbf79-b0e3-4fad-8295-cc7f408cfd34
chenx/oj
leetcode/MaxSizeSubarraySumEqualsK.cpp
// Works. Tested. O(n). // From: https://leetcode.com/discuss/84037/c-easy-understand-solution-with-comment // O(n) complexity. // Core idea: for the same cumulative sum value, we // only keep it's first appearance, so at last the // subarray is guaranteed to be the longest. // Also, note the brilliant idea of using th...
ALGO
0.999439
6.585506
{ "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": "743731a...
ad9c0ac1-918e-4f46-8a67-e89b79ecb78c
jaxvanyang/acm
jax/codeforces/global-round/17/b_kalindrome_array.cc
#include <iostream> const int N = 2e5 + 10; int a[N]; int n; bool check(int val) { int i = 0, j = n - 1; while (i < j) { while (i < j && a[i] == val) ++i; while (i < j && a[j] == val) --j; if (a[i] != a[j]) return false; ++i, --j; } return true; } void solve() { sc...
ALGO
0.999933
4.306448
{ "github_metadata": { "branch": "master", "commit_count": 384, "repo_created_at": "2021-11-02T02:32: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": "c50ac72e...
16a71276-91d9-4e0b-aee5-1b697f5f2f2a
autowarefoundation/autoware_universe
planning/behavior_velocity_planner/autoware_behavior_velocity_virtual_traffic_light_module/src/utils.cpp
// Copyright 2024 <NAME>, Inc. // // 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 agreed to in...
TOOL
0.991076
3.01483
{ "github_metadata": { "branch": "main", "commit_count": 8531, "repo_created_at": "2021-11-19T02:59:37.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1208, "forks": 763, "issues": 216, "pull_requests": 161 }, "file_meta": { "content_id": "4...
acb617f2-b61c-409f-a9fb-123219188223
swri-robotics/marti_common
swri_math_util/src/trig_util.cpp
// ***************************************************************************** // // Copyright (c) 2014, Southwest Research Institute® (SwRI®) // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met:...
TOOL
0.990908
7.454668
{ "github_metadata": { "branch": "ros2-devel", "commit_count": 721, "repo_created_at": "2014-12-04T15:29:24.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 55, "forks": 70, "issues": 9, "pull_requests": 1 }, "file_meta": { "content_id": "95a...
691d73c3-4f2f-4285-be84-f3f8d1312d49
NJUCG/Moer
src/FunctionLayer/Shape/Curve.cpp
#include "Curve.h" #include "ResourceLayer/File/CurveIO.h" #include "FunctionLayer/Intersection.h" #include "CoreLayer/Geometry/BoundingBox.h" template<typename T> inline T quadraticDeriv(T p0, T p1, T p2, T p3, double t) { const double t0 = 1 - t, t1 = t; const double B0 = -(t0 * t0); const double B1 = -...
ALGO
0.996954
6.55544
{ "github_metadata": { "branch": "main", "commit_count": 408, "repo_created_at": "2022-04-12T14:20:45.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 73, "forks": 22, "issues": 6, "pull_requests": 2 }, "file_meta": { "content_id": "11fbd7db6...
b8d72883-0036-4626-aceb-1d9e6a83d993
franfill1/cses.fi-solutions
src/Tree Algorithms/1137-Subtree Queries.cpp
/* Task: 1137 Subtree Queries Sender: franfill Submission time: 2021-03-22 09:35:00 Language: C++11 Result: ACCEPTED */ #include <bits/stdc++.h> using namespace std; typedef long long ll; vector < ll > tree; ll sum(ll k) { ll ans = 0; while(k) { ans += tree[k]; k...
ALGO
0.999618
4.519227
{ "github_metadata": { "branch": "master", "commit_count": 27, "repo_created_at": "2021-07-01T10:41: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": "41862c756...
102522b8-74f7-424b-8d99-9b3f2ab385c4
shubham691438/coding-Problems
C_Fill_in_the_Matrix.cpp
#include<bits/stdc++.h> using namespace std; // DEBUG CODE void __print(int x) {cerr << x;} void __print(long x) {cerr << x;} void __print(long long x) {cerr << x;} void __print(unsigned x) {cerr << x;} void __print(unsigned long x) {cerr << x;} void __print(unsigned long long x) {cerr << x;} void __print(float x) {...
ALGO
0.999834
3.361635
{ "github_metadata": { "branch": "master", "commit_count": 6, "repo_created_at": "2024-01-26T08:57:30.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4ccd14f0b0...
ca138555-ede8-419c-8d8d-a152642bfa73
chenwi/reference
lcs.cpp
#include <cstring> #include <iostream> using namespace std; int GetLongestCommonSubString(const char *pStr1, const char *pStr2) { /* 判断参数合法性 */ if (pStr1 == NULL || pStr2 == NULL) { return -1; } int n = strlen(pStr1); int m = strlen(pStr2); int longestCommonSubString = 0; /* 申请辅助空间,并初始化为0 */ int *LCS = ne...
ALGO
0.99936
4.772023
{ "github_metadata": { "branch": "master", "commit_count": 33, "repo_created_at": "2017-09-13T00:07: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": "2fc66129e...
0b53e4cb-81a1-40e6-883b-6aac86c78ff9
DarkSharpness/DarkSharpness
Playground/Matrix/matrix2.cpp
#pragma GCC optimize("O3") #include <chrono> #include <iostream> const int N = 1000; int a[N][N]; int b[N][N]; int c[N][N]; signed main() { for (int i = 0 ; i < N ; ++i) for (int j = 0 ; j < N ; ++j) a[i][j] = rand(), b[i][j] = rand(); auto start = std::chrono::high_resolution_clock::now()...
ALGO
0.996215
3.810442
{ "github_metadata": { "branch": "main", "commit_count": 515, "repo_created_at": "2021-03-20T15:34:39.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d4ad35d232...
512a956a-f8fd-44f9-ba4f-fa6963896418
MagedElNajaar/Problem-Solving
Codeforces/242 C King's Path.cpp
#include <iostream> #include <set> #include <queue> #include <map> using namespace std; set <pair<int,int>> pts; int main() { int x1,y1,x2,y2,n; cin>>x1>>y1>>x2>>y2>>n; for(int i=0;i<n;i++){ int r,a,b; cin>>r>>a>>b; //Create Graph Points for(int row_cell=a;row_...
ALGO
0.999846
3.881125
{ "github_metadata": { "branch": "master", "commit_count": 50, "repo_created_at": "2019-03-11T03:41:39.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0d7a06d45...
f5cd3458-bad6-478c-92ad-739c7934aee4
Mosina916/May_c-_online22
Lecture23/mergesort.cpp
#include<iostream> using namespace std; // void mergetwosortedarrays(int arr1[],int arr2[],int n1,int n2){ // int temp[10000]; // int i=0,j=0,k=0; // // loop // while(j<=n2-1 and i<=n1-1){ // if(arr1[i]<arr2[j]){ //2<0 2<1 2<3 4<3 // temp[k]=arr1[i]; // i++; // k++; // } // else{ // temp[k]=arr2[j]; // ...
ALGO
0.999993
5.218535
{ "github_metadata": { "branch": "master", "commit_count": 47, "repo_created_at": "2022-05-26T16:31:55.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 5, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a8f110403...
7be7229b-cd39-4e2c-a3ce-d44c92f6fa4e
abhijais04/Competitive-Programming
Spoj/BORW.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long inline int read() { ll ret = 0; ll c = getchar_unlocked(); while(c<'0' || c>'9') c = getchar_unlocked(); while(c>='0' && c<='9') { ret = (ret<<3) + (ret<<1) + c - '0'; c = getchar_unlocked(); } return ret; } ll dp[210][...
ALGO
0.999931
3.235907
{ "github_metadata": { "branch": "master", "commit_count": 9, "repo_created_at": "2019-08-26T17:40:35.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "02d617d02e...
425f8cef-14da-4e89-84de-ee4ccaf8f154
yamanatoo/kratos_bcn2
kratos/utilities/math_utils.h
/* ============================================================================== Kratos A General Purpose Software for Multi-Physics Finite Element Analysis Version 1.0 (Released on march 05, 2007). Copyright 2007 <NAME>, <NAME> <EMAIL> <EMAIL> CIMNE (International Center for Numerical Methods in Engineering), Gran C...
ALGO
0.997538
5.420303
{ "github_metadata": { "branch": "master", "commit_count": 167, "repo_created_at": "2019-04-12T16:07:12.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b17451c0...
a4743ba9-a18f-42d2-8bcc-1d714ee40d67
bhaumikmaan/Competitve-Programming-Solutions
Codeforces/1560 - Round #739 (Div. 3)/F1. Nearest Beautiful Number (easy version).cpp
/*** KNOWLEDGE IS POWER ***/ #include<bits/stdc++.h> typedef long long ll ; #define int ll #define pb push_back #define all(v) v.begin(),v.end() #define mod 1000000000 #define inf LLONG_MAX #define N 100010 using namespace std ; set<int> st ; void solveagain(int x , int i , int j) { st.insert(x) ; if(x >= mod) ...
ALGO
0.999847
4.68729
{ "github_metadata": { "branch": "main", "commit_count": 744, "repo_created_at": "2021-10-06T06:21:10.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 5, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4c87ebc88c...
a19f582c-abd7-4b4f-b99c-c61c2b0561d8
hunter-land/Advent-of-Code-2020
15/main.cpp
#include <iostream> #include <fstream> #include <vector> #include <string> #include <map> int main() { size_t i = 0; std::map<int, std::pair<int, int>> nums;// = {{0,{0,0}}, {3,{1,1}}, {6,{2,2}}}; std::ifstream input("input.txt"); std::string line; std::getline(input, line); while (line.find(',') != std::string...
ALGO
0.999706
3.851881
{ "github_metadata": { "branch": "master", "commit_count": 21, "repo_created_at": "2020-12-04T18:18: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": "566ed7e18...
d51770af-5bc8-4199-87f5-fe0072510fa8
NSP-MO/CS60_Pempro
Untitled-1.cpp
#include <iostream> #include <vector> #include <iomanip> using namespace std; int main() { int M; cin >> M; // read the minimum threshold vector<double> scores; double value; // Read all scores until -1 is encountered while (cin >> value && value != -1) { // Only include scores th...
ALGO
0.999916
4.940102
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2025-03-05T04:12: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": "274edae8c4df...
cd1b6915-de22-487a-88ea-dd92f4ac54dc
zachcuy/dsa
leetcode/303.range-sum-query-immutable.cpp
/* * @lc app=leetcode id=303 lang=cpp * * [303] Range Sum Query - Immutable * * https://leetcode.com/problems/range-sum-query-immutable/description/ * * algorithms * Easy (61.33%) * Likes: 3038 * Dislikes: 1870 * Total Accepted: 485.7K * Total Submissions: 785.7K * Testcase Example: '["NumArray","su...
ALGO
0.999764
7.161652
{ "github_metadata": { "branch": "main", "commit_count": 54, "repo_created_at": "2023-10-20T17:09:02.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c360d1c51f7...
05825cb4-79d7-4c21-a3e0-255bb9b9c801
wanggchongg/leetcode
cpp/079_word_search.cpp
// Word Search Total Accepted: 41321 Total Submissions: 202943 My Submissions Question Solution // Given a 2D board and a word, find if the word exists in the grid. // The word can be constructed from letters of sequentially adjacent cell, where "adjacent" cells are those horizontally or vertically neighboring. The sa...
ALGO
0.999835
5.310204
{ "github_metadata": { "branch": "master", "commit_count": 13, "repo_created_at": "2015-04-08T06:34: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": "455e85d87...
ac4b27d4-eca2-47fc-95ff-c74e3fb718cc
scottdwdwdw/leetcode
299Bulls and Cows.cpp
/* 299. Bulls and Cows My Submissions QuestionEditorial Solution Total Accepted: 29781 Total Submissions: 99342 Difficulty: Easy You are playing the following Bulls and Cows game with your friend: You write down a number and ask your friend to guess what the number is. Each time your friend makes a guess, you provide a...
ALGO
0.99999
5.658723
{ "github_metadata": { "branch": "master", "commit_count": 20, "repo_created_at": "2016-01-04T13:02: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": "5e83f2c79...
ba2fcf93-5984-4353-a31c-f4dbeda597f5
AndreaCaprotti/LSN_Andrea_Caprotti
lez_06/ISING_1D/Monte_Carlo_ISING_1D.cpp
/**************************************************************** ***************************************************************** _/ _/ _/_/_/ _/ Numerical Simulation Laboratory _/_/ _/ _/ _/ Physics Department _/ _/_/ _/ _/ Universita' degli Studi di Milano _/ _/ ...
ALGO
0.98972
4.943079
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2021-07-15T09:30:44.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0eab35663ce1...