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
e8ba8de2-f6f0-4171-a888-25a090997b56
snibug/algorithms
graph/bcc_vertex_list_and_cut_vertex.cpp
// bcc에는 각 bcc마다 속해있는 정점의 목록이 들어감. 정점은 각 bcc 내에서 unique함. // cut_vertex가 0이면 절점이 아니고, 0이 아니면 절점임 // 사실 bcc는 edge 목록 구현이 정석이고 속 편한데, vertex 목록인 이게 더 짧네? //poj 3352 #include <stdio.h> #include <vector> #include <algorithm> using namespace std; int n,m; vector<int> gnext[1003]; int v[1003],vtime; int up[1003]; vector<...
ALGO
0.99989
4.276998
{ "github_metadata": { "branch": "master", "commit_count": 151, "repo_created_at": "2019-04-01T02:18:58.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4618d94c...
98dbe1a8-497f-428b-8646-8bc580800a21
llenroc/CP
AlgoExpert/Recursion/subsets-leetcode-II.cpp
/* <NAME> */ //https://leetcode.com/problems/subsets-ii/ #include<bits/stdc++.h> using namespace std; #define endl '\n' #define INF LLONG_MAX/4 #define MOD 1e9+7 #define DEBUG(x) cerr << #x << " is " << (x) << endl; class Solution { private: int N=0; vector<vector<int>> result; vector<int> st; void he...
ALGO
0.99996
5.78935
{ "github_metadata": { "branch": "master", "commit_count": 656, "repo_created_at": "2021-04-08T08:43:11.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "97fda231...
29675660-e248-4a6a-b098-5528f943c618
ftiasch/secret-weapon
2014-04-28/d.cpp
#include <cstdio> #include <cmath> #include <algorithm> using namespace std; const double pi=acos(-1.0); struct point { double x,y; point(){} point(double x,double y):x(x),y(y){} }; inline point operator -(const point &a,const point &b) { return(point(a.x-b.x,a.y-b.y)); } inline double det(const point &...
ALGO
0.999936
3.818916
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2019-02-02T10:07:49.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8aad41e382...
79526a63-28f9-4b70-ad26-b86f7af2911f
holgus103/3dGraphics
PerlinNoise/PerlinNoise.cpp
#include "PerlinNoise.h" #include <iostream> #include <cmath> #include <random> #include <algorithm> #include <numeric> // source http://mrl.nyu.edu/~perlin/noise/) PerlinNoise::PerlinNoise(int seed, int height, int width, double xm, double ym, double zm) : p(std::vector<int>()) { this->map = gcnew array<double>(he...
ALGO
0.989781
4.436314
{ "github_metadata": { "branch": "master", "commit_count": 56, "repo_created_at": "2017-10-18T23:04: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": "d741b5066...
b8417e89-af53-4e6e-a0f2-266bb588a148
graphbig/graphBIG
benchmark/bench_TopoMorph/topomorph.cpp
//====== Graph Benchmark Suites ======// //======= Graph Moralization =======// // // Usage: ./moralization --dataset <dataset path> #include "common.h" #include "def.h" #include "perf.h" #include "openG.h" #include "omp.h" #ifdef SIM #include "SIM.h" #endif using namespace std; unsigned threadnum=1; class vertex_pr...
ALGO
0.990088
4.555212
{ "github_metadata": { "branch": "master", "commit_count": 60, "repo_created_at": "2015-01-20T21:51:51.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 70, "forks": 34, "issues": 4, "pull_requests": 1 }, "file_meta": { "content_id": "35fcc9ec...
91584d11-719e-4b2c-9c73-6edf002d0888
timothyylim/Imperial-College
fall/intro-to-c-plus-plus/exercise-solutions/Exercise-sheet-3/Farenheit-to-celsius/Farenheit-to-celsius-modular.cpp
/* This program prints out a conversion table of temperatures, after prompting the user for upper and lower bounds of the table in Fahrenheit, and the temperature difference between table entries. */ #include <iostream> #include <iomanip> using namespace std; void print_preliminary_message(); void input_table...
TOOL
0.930617
5.068636
{ "github_metadata": { "branch": "master", "commit_count": 113, "repo_created_at": "2015-09-02T12:52:34.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 20, "forks": 7, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "0c82291...
5e9bc97c-5ac0-43ae-ba17-c31074db343e
kamyu104/LeetCode-Solutions
C++/the-latest-time-to-catch-a-bus.cpp
// Time: O(nlogn + mlogm) // Space: O(1) // sort, two pointers class Solution { public: int latestTimeCatchTheBus(vector<int>& buses, vector<int>& passengers, int capacity) { sort(begin(buses), end(buses)); sort(begin(passengers), end(passengers)); int cnt = 0, j = 0; for (int i = ...
ALGO
0.999935
5.864325
{ "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": ...
bc41a32d-1a23-4adf-9723-325401abbf7e
Dragonfire3900/Multi_Dim_Analysis
OGDF_Mods/src/ogdf/lib/abacus/sub.cpp
/*!\file * \author <NAME> * * \par License: * This file is part of ABACUS - A Branch And CUt System * Copyright (C) 1995 - 2003 * University of Cologne, Germany * * \par * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by...
ALGO
0.996844
4.141789
{ "github_metadata": { "branch": "main", "commit_count": 12, "repo_created_at": "2020-11-08T01:47: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": "2f4efb9db65...
ffa7623e-b578-4914-96cf-4a7fbb9567d8
ViniciusResende/PROG_COMP_UFMG
list_2/1365.cpp
#include <iostream> #include <algorithm> #define INF 0x3f3f3f3f #define USED_SEAT 'X' #define DIMENSION_THRESHOLD 301 using namespace std; int subConfig[DIMENSION_THRESHOLD][DIMENSION_THRESHOLD][DIMENSION_THRESHOLD]; char roomConfig[DIMENSION_THRESHOLD][DIMENSION_THRESHOLD]; int main() { while(1) { int R, C, ...
ALGO
0.999572
4.103869
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2025-04-02T13:46: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": "5f69f7c9e7...
a0b4e8f1-35c2-4196-8a87-305cd0493abf
DARSHAN-THE-CODER/Leetcode-solutions
1073-number-of-enclaves/number-of-enclaves.cpp
class Solution { public: int numEnclaves(vector<vector<int>>& grid) { int n = grid.size(); int m = grid[0].size(); vector<vector<int>> vis(n+1, vector<int>(m+1, 0)); queue<pair<int, int>> q; int count = 0; for(int i=0;i<n;i++){ for(int j=0;j<m;j++){ ...
ALGO
0.999977
5.869007
{ "github_metadata": { "branch": "main", "commit_count": 722, "repo_created_at": "2022-06-18T06:38:03.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "998b50ae16...
c8215991-3cdd-4f27-8100-fd06f24c5e57
Cegax123/Competitive-Programming
online judges/codechef/XOR_ORDER.cpp
#include <bits/stdc++.h> using namespace std; #define all(c) (c).begin(), (c).end() #define rall(A) A.rbegin(),A.rend() #define pb push_back #define dbg(x) do {cerr << #x <<" = " << (x) << endl; } while (false) typedef long long ll; typedef pair<int, int> ii; typedef vector<int> vi; typedef vector<ii> vii; //cout << s...
ALGO
0.999979
4.2611
{ "github_metadata": { "branch": "main", "commit_count": 10, "repo_created_at": "2022-09-15T13:50: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": "b77f837f980...
60ab39b1-5626-45b2-ac21-3ab6e0b010df
gaojs/algorithm
leetcode/clang/99. 恢复二叉搜索树.cpp
#include <stdio.h> #include <stdlib.h> #include <string.h> struct TreeNode { int val; struct TreeNode *left; struct TreeNode *right; }; void inOrder(struct TreeNode* root, struct TreeNode**prev, struct TreeNode**errMin, struct TreeNode**errMax) { if (root == NULL || prev==NULL || errMin == NULL || errMax == NULL...
ALGO
0.999992
4.11515
{ "github_metadata": { "branch": "master", "commit_count": 262, "repo_created_at": "2019-11-05T00:14:50.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 6, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8c769caf...
9e382217-69d5-478c-8f23-43a8615217c8
ishandutta2007/codeforces-k
kpw29/normal/346/C.cpp
#include <bits/stdc++.h> using namespace std; #define e1 first #define e2 second #define pb push_back #define mp make_pair #define boost {ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); } #define eb emplace_back #define OUT(x) {cout << x; exit(0); } #define FOR(i,a,b) for(int i=(a);i<=(b);++i) #define scanf(...
ALGO
0.999904
3.829007
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-04-11T06:06: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": "038612562c2d...
ac27abc6-c79e-4aaa-b5e7-a0e3713b88c4
abdullaayyad96/visual_servoing_DVS_2D
include/CornerDetectorHARRIS.h
/* * CornerDetectorHARRIS.h * * Created on: Apr 7, 2019 * Author: raj */ #ifndef VISUAL_SERVO_DAVIS_SRC_CORNERDETECTORHARRIS_H_ #define VISUAL_SERVO_DAVIS_SRC_CORNERDETECTORHARRIS_H_ #include <deque> #include <Eigen/Dense> #include <ros/ros.h> #include <dvs_msgs/EventArray.h> #include <dvs_msgs/Event.h> ...
ALGO
0.991878
5.607953
{ "github_metadata": { "branch": "master", "commit_count": 17, "repo_created_at": "2020-07-27T09:29:31.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "444be5049...
061c634b-cb5d-4e34-875b-1ec4d986aafa
sjj-2048/Computer
Data structures and algorithms/binarytree/binarytree.cpp
#include"binarytree.h" #include"stack.h" #include"queue.h" /******************************************************* 二叉树节点操作接口 ********************************************************/ //添加左孩子 template<typename T> TreeNode(T) BinNode<T>::insertAsLC(const T& e) { return lChild = new BinNode(e, thi...
ALGO
0.999409
3.640543
{ "github_metadata": { "branch": "main", "commit_count": 47, "repo_created_at": "2020-11-09T10: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": "d660bb5adfe...
7eb48af2-f846-4e3a-a480-df238b154fa9
OwlNjust/LargeNumbersCalculator
LNShow.h
//提交日期2024年4月21日 #pragma once #include<iostream> #include<vector> #include<string.h> #include <cstdlib> #include"LNcalculator.h" #include"LargeNumbersLinkedList.h" using namespace std; Number ReuseFun1(LNLinkedList TROC, char* name1) { Number num1; if (TROC.isEmpty() == 0) { while (true) { ...
TOOL
0.98761
3.383148
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-04-23T14:55: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": "643738b4aa95...
e06977ee-378b-46d2-84f5-2568de3dfc9c
kabhinayak02/DS-Algo
DP/Dp on Grids/62. Unique Paths.cpp
/* top down approach tc: o(n*m) sc: o(n*m) for dp array + o(n+m) for recursion stack */ class Solution { public: int solve(int i, int j, int m, int n, vector<vector<int>>& dp){ // Base case if(i == m-1 && j == n-1){ return 1; } if (i >= m || j >= n) { retu...
ALGO
0.99997
6.48253
{ "github_metadata": { "branch": "master", "commit_count": 241, "repo_created_at": "2023-07-27T00:12: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": "f68db49a...
0b2a8666-8033-46e6-ae34-bcc7fc91585f
kaitco13/Advent-of-Code-2019
day2.cpp
#include <iostream> #include <fstream> #include <vector> #include <string> #include <sstream> using namespace std; //code moved to this method for part 2 int runComputer(vector<int> computer){ //pass by value so that the vector is reset each time int i = 0; while(computer[i] != 99){ int num; i...
ALGO
0.998978
3.977073
{ "github_metadata": { "branch": "master", "commit_count": 7, "repo_created_at": "2019-12-01T06:46: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": "e926f17981...
7bba2e62-b00f-46fd-b184-5e7ea7df60ef
swiftqwq/code
2021.1.19/ac2707-10.cpp
#include <bits/stdc++.h> #define N 1000000 #define inf 1000000000 using namespace std; int n, m, s, t, cnt, L, R; int head[N], nxt[N], len[N], to[N], in[N], out[N]; void add(int a, int b, int l, bool _rev = false) { nxt[++cnt] = head[a]; to[cnt] = b; len[cnt] = l; head[a] = cnt; if (!_rev) add(b, a, 0, true);...
ALGO
0.99997
3.468113
{ "github_metadata": { "branch": "master", "commit_count": 52, "repo_created_at": "2020-09-17T12:21: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": "ea7506d79...
8ffb2706-343f-4bec-90fa-b80665a9683e
tsane1/superfan-rbe2002-group-16
SuperfanFinal/Robot.h
/* FILENAME: Robot.h * * BRIEF: * * AUTHORS: * @author <NAME> * @author <NAME> * @author <NAME> * @author <NAME> * * START DATE: Dec. 8, 2015 */ #pragma once #include "Arduino.h" #include <Servo.h> #include <Wire.h> #include <L3G.h> #include <I2CEncoder.h> #include <LiquidCrystal.h> #include "PidController.h...
TOOL
0.910617
6.050945
{ "github_metadata": { "branch": "master", "commit_count": 65, "repo_created_at": "2015-12-01T20:40:43.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "7d191c194...
b0df291c-67bd-41ed-9df7-3244f6f56447
tongmon/fundamental-practice
Problem Solving/Beakjoon Algo Judge/DFS BFS/Beakjoon_2178.cpp
#include <iostream> #include <cstring> #include <queue> #include <vector> #include <cmath> #include <algorithm> using namespace std; /* https://www.acmicpc.net/problem/2178 7576번 문제와 유사한 BFS 문제이다. BFS에서 탐색 중 가장 먼저 도착한 루트가 가장 빠르다라는 사실을 이용하면 쉽게 풀린다... 사실 7576번 문제를 풀었다면 코드 몇줄 바꾸면 끝난다... 이 문제는 시작점이 여러개는 아니지만 최단 경로를 찾는 것이기...
ALGO
0.999965
4.159784
{ "github_metadata": { "branch": "master", "commit_count": 1036, "repo_created_at": "2020-07-26T10:43:52.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "87789ed...
7c3d397b-22e7-4947-82ee-146e95fb5d1f
jromero132/online-judges-problem-solutions
Codeforces/Gym/101353/B.cpp
// Problem name: Max and <NAME> to Conquer the World // Problem link: https://codeforces.com/gym/101353/problem/B // Submission link: https://codeforces.com/gym/101353/submission/37262124 #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef long double ld; ld P...
ALGO
0.998822
4.296982
{ "github_metadata": { "branch": "master", "commit_count": 39, "repo_created_at": "2021-09-24T15:56:57.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 5, "forks": 3, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7ad227d69...
c7939cf0-4821-4698-82b0-ce6b4226bb72
shubhamlokhande2147/CDAC-Buddy
C++/c++/Lab date 15-09-2023/loop/Armstrong_count.cpp
#include <iostream> #include <cmath> using namespace std; int main() { int num1=0, num2=999, i, num, digit, sum, count,result=0; if (num1 > num2) { num1 = num1 + num2; num2 = num1 - num2; num1 = num1 - num2; } cout << "Armstrong numbers between " << num1 << " and " << num2 << " are: " << end...
ALGO
0.998624
4.116885
{ "github_metadata": { "branch": "main", "commit_count": 701, "repo_created_at": "2023-09-12T11:13:15.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "00f27a66b7...
cbd26131-b697-459a-b495-9e219c1fe40c
CoolProp/CoolProp
include/PolyMath.h
#ifndef POLYMATH_H #define POLYMATH_H #include "CoolProp.h" #include "CoolPropTools.h" #include "Exceptions.h" #include <vector> #include <string> #include "Solvers.h" #include "MatrixMath.h" #include "unsupported/Eigen/Polynomials" namespace CoolProp { // Just a forward declaration class Poly2DResidual; class Poly...
ALGO
0.955329
6.85732
{ "github_metadata": { "branch": "master", "commit_count": 5705, "repo_created_at": "2014-05-14T10:43:50.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 890, "forks": 324, "issues": 373, "pull_requests": 18 }, "file_meta": { "content_id": "9...
8a6c80be-32e2-48d2-96e2-7d6ee429eb7d
louhmmsb/IME
3sem/desafios/aula8/d.cpp
#include<bits/stdc++.h> using namespace std; typedef long long int ll; typedef unsigned long long int ull; int keys[112345]; bool visitado[112345]; bool trancado[112345]; bool nafila[112345]; queue<int> q; bool bfs(int ini, int end, vector<int> chambers[]){ visitado[ini] = 1; if(end == ini) return true; ...
ALGO
0.999774
3.526813
{ "github_metadata": { "branch": "master", "commit_count": 53, "repo_created_at": "2020-04-22T02:52: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": "da7db99e6...
e4f6324a-60ea-455e-914f-b09cc505656f
corntofu/myCGlibrary
convexhull3d/3dhull_type.cpp
#include <bits/stdc++.h> using namespace std; typedef struct vertex3_ tvertex; typedef struct edge3_ tedge; typedef struct face3_ tface; typedef tvertex *pvertex; typedef tedge *pedge; typedef tface *pface; using ll = long long; #define X 0 #define Y 1 #define Z 2 #define ONHULL true #define REMOVED true #define VIS...
ALGO
0.995637
3.878965
{ "github_metadata": { "branch": "master", "commit_count": 21, "repo_created_at": "2024-01-12T06:43:59.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "733399b37...
f1d4a28d-0866-466c-8af1-a79638dc869c
Ahnuf-Karim-Chowdhury/Algorithms
00.DS/00.Practise/01_shifting.cpp
#include <bits/stdc++.h> using namespace std; class maxHeap { vector<int> heap; private: void UpShift(int index) { while (index > 0) { int parent = (index - 1) / 2; if (heap[index] > heap[parent]) { swap(heap[index], heap[parent]); ...
ALGO
0.999429
5.518477
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2024-06-08T08:04:22.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c8e7768688db...
e74e17da-365a-4065-a901-60d04d279cf9
ishandutta2007/codeforces-r
romanandreev/normal/172/E.cpp
#include <algorithm> #include <iostream> #include <cstdlib> #include <cstdarg> #include <cassert> #include <climits> #include <cstring> #include <complex> #include <cstdio> #include <vector> #include <string> #include <queue> #include <cmath> #include <ctime> #include <set> #include <map> using namespace std; typedef...
ALGO
0.998766
3.473963
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-10-30T15:58: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": "017bbaca1ae8...
8d9f22b8-c12a-45d3-807d-0672d4b191b6
AlekseiKireev/leetcode_com
1004. Max Consecutive Ones III/my_code_easy_reader.cpp
class Solution { private: // https://github.com/SkosMartren/leetcode_com/tree/main/485.%20Max%20Consecutive%20Ones int findMaxConsecutiveOnes(vector<int>& nums) { int Ans = 0; int CurrentSum = 0; for(int num : nums){ if(num == 1){ ++CurrentSum; ...
ALGO
0.99992
6.354993
{ "github_metadata": { "branch": "main", "commit_count": 5109, "repo_created_at": "2023-01-22T16:52: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": "1c3b9e992...
90b0b10a-15f2-42fe-b468-e277a7692ec7
PabloAlvarado/reviewlfm
matlab-mauricio/lfmComputeUpsilonVector.cpp
/* * lfmComputeUpsilonVector.cpp * * Computes Upsilon given a input vector * inputs: * gamma: gamma value system * sigma2: squared lengthscale * t1: first time input (x 1) * outputs: * upsilon vector (x 1) * * This is a MEX-file for MATLAB. * * <NAME>, 2015. * * How to compile this? * * 1) Genera...
ALGO
0.998853
5.392235
{ "github_metadata": { "branch": "master", "commit_count": 121, "repo_created_at": "2017-09-18T09:02: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": "7cbcf1c1...
9549b991-c6ba-4bf0-a45d-eb82672eaccb
ajay0175/Striver-SDE-Sheet
17_unique_path.c++
#include<bits/stdc++.h> using namespace std; class Solution { public: int countPaths(int i,int j,int n,int m,vector<vector<int>> &dp) { if(i==(n-1)&&j==(m-1)) return 1; if(i>=n||j>=m) return 0; if(dp[i][j]!=-1) return dp[i][j]; else return dp[i][j]=countPaths(i+1,j,n,m,dp)+countPath...
ALGO
0.999977
5.319957
{ "github_metadata": { "branch": "master", "commit_count": 74, "repo_created_at": "2022-06-05T13:53:34.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1cef89330...
bd69b8ce-78ec-453f-a9a1-b6f1f7336a0b
tzxcmer/CppCode
2022_10_19/2022_10_19/test.cpp
#define _CRT_SECURE_NO_WARNINGS 1 #include<iostream> #include<vector> using namespace std; int countStudents(vector<int>& students, vector<int>& sandwiches) { vector<int> cnt(2); for (auto s : students) cnt[s]++; auto stu = students.begin(); auto san = sandwiches.begin(); for (;san < sandwiches.e...
ALGO
0.99924
3.639627
{ "github_metadata": { "branch": "master", "commit_count": 18, "repo_created_at": "2023-06-24T12:22: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": "186dc70f2...
9da804e5-be41-4347-9a73-896870360af6
bula173/LogViewer
src/application/config/Config.cpp
#include "config/Config.hpp" #include <fstream> #include <spdlog/spdlog.h> namespace config { static Config configInstance; // This is a singleton instance of the Config class // that is used to manage the configuration settings. // It is defined in the cpp file to ensure that there is only one instance // of the Con...
CONFIG
0.965704
6.339039
{ "github_metadata": { "branch": "main", "commit_count": 101, "repo_created_at": "2024-01-22T07:10: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": "b23b594730...
38573fe6-2d7c-4bb3-b18e-5d27a6ee67bc
TakalaWang/NTNU-Algorithm
HW2/p2.cpp
#include <bits/stdc++.h> using namespace std; int main(){ ios_base::sync_with_stdio(false); cin.tie(nullptr); int n; cin>>n; vector<int> tree(n); for(int &node : tree) { cin>>node; } sort(tree.begin(), tree.end()); vector<vector<long long int>> dp(n, vector<long long int>...
ALGO
0.999933
4.412631
{ "github_metadata": { "branch": "main", "commit_count": 24, "repo_created_at": "2023-03-01T12:00: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": "edf7340ddb8...
3ed6ed69-da81-486d-8589-1a2b595f5723
lInvisible/Tree
tree.cpp
#include <iostream> #include <cassert> #include <stdarg.h> #include <iostream> #include <cstdlib> #include <vector> #include <stdio.h> #include <sstream> #include <string> #include <algorithm> #include <iterator> using namespace std; template <class T> class Tree { class Node { public: T data; ...
ALGO
0.998766
4.188729
{ "github_metadata": { "branch": "master", "commit_count": 9, "repo_created_at": "2018-06-04T07:55:32.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "25eb16b1b6...
bf4f52ce-16f8-4567-b40d-c044e4cff9f7
laurie-hxf/cs203-dsaa-
lab9/lab9c/main.cpp
#include <iostream> #include <vector> #include <queue> #include <functional> #include <limits.h> using namespace std; struct Edge { pair<int, int>from; pair<int, int>to; long long weight; Edge(pair<int,int> _from, pair<int,int> _to, long long _weight) : from(_from), to(_to), weight(_weight) {} boo...
ALGO
0.999992
4.472652
{ "github_metadata": { "branch": "main", "commit_count": 40, "repo_created_at": "2024-09-11T12:25: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": "e6ba7f31a62...
a50062ab-d9c7-430a-bd5a-ea9b1fe0fd12
anishanawar/Data-Structures-and-Algorithm-Projects
AVL Tree/main.cpp
#include <iostream> #include "AVLTree.h" // Include the header file for the AVLTree class using namespace std; // Function to display the menu and get user input int menu() { int choice = 0; // Display the menu options cout << endl << "Enter menu choice: "; cout << endl; cout << "1. Insert" << e...
ALGO
0.990279
6.157053
{ "github_metadata": { "branch": "main", "commit_count": 6, "repo_created_at": "2025-02-03T20:31: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": "942dcc54c77b...
b0cfe770-bf54-4a1e-ad53-a00c88270d21
alishazin/Network-Security-Lab
3/main.cpp
#include <iostream> using namespace std; int gcd1(int a, int b) { int step = 1; while (b != 0) { cout << "Step " << step << ": a = " << a << ", b = " << b << endl; // Calculate a % b and store it in a temporary variable int temp = b; b = a % b; a = temp; step++; } return a; } int gcd(int a, i...
ALGO
0.999959
5.818224
{ "github_metadata": { "branch": "main", "commit_count": 25, "repo_created_at": "2024-07-29T03:42:58.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "12dff234329...
8341cfe9-dfc5-4dc0-a0a9-ba7353c71ede
GHeier/FFirefly
src/objects/vec.cpp
/** * This file contains the implementation of the Vec class * * Author: <NAME> */ #include "vec.hpp" #include <complex> #include <iostream> #include <math.h> #include <string> #include <vector> using namespace std; Vec::Vec() { dimension = 3; area = 0; x = 0; y = 0; z = 0; w = 0; n =...
TOOL
0.918389
5.766659
{ "github_metadata": { "branch": "main", "commit_count": 309, "repo_created_at": "2023-10-03T23:10: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": "866026cc89...
ca8419ea-f76c-487d-8a00-7a6294d43659
khaledsliti/CompetitiveProgramming
Codeforces/Other/CF342-D2-E.cpp
// We only fail when we stop trying #include <iostream> #include <stdio.h> #include <vector> #include <map> #include <bitset> using namespace std; #define pb push_back #define mp make_pair #define endl '\n' #define D(x) cerr << #x << " = " << (x) << '\n' #define sz(x) ((int)(x).size()) #define all(x) (x).begin(), (x).e...
ALGO
0.999862
4.450849
{ "github_metadata": { "branch": "master", "commit_count": 454, "repo_created_at": "2019-02-20T20:20:22.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "fff3412c...
ffcb5c1f-7e21-4d4a-b382-7a2bd2e5e7f2
bobstine/lang_C
random/random.cc
// $Id: random.cc,v 1.5 2007/11/13 00:21:15 bob Exp $ /* Based on code used to generate random values in XLisp-Stat */ /* xlrand.c - random number generators */ /* Copyright (c) 1989, by <NAME>. */ #include <iterator> #include <time.h> #include...
TOOL
0.983578
4.667301
{ "github_metadata": { "branch": "master", "commit_count": 996, "repo_created_at": "2019-06-03T14:19: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": "43c2ab71...
8c2642c8-6ce0-409a-8f80-e5761a5b39cb
OmkarLolage21/CPU_Scheduling_Algorithms
bestfit.cpp
#include <iostream> #include <limits.h> using namespace std; struct Block { int size; bool allocated; }; void bestFit(Block *memory, int numBlocks, int processSize) { int bestFitIndex = -1; int minSize = INT_MAX; for (int i = 0; i < numBlocks; ++i) { if (!memory[i].allocated && memory...
ALGO
0.998168
5.360284
{ "github_metadata": { "branch": "master", "commit_count": 13, "repo_created_at": "2023-10-04T17:33: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": "7dd3d8757...
ab2544e3-9383-411f-9b1b-05ab3b782db1
MistMezalla/Laptop-Backup
CS 201 (Algorithm)/Lab Assgn/Lab 3/Q1.cpp
#include <bits/stdc++.h> using namespace std; class Solution { public: int kth_smallest(vector<int>&nums,int k) { return partition(nums,0,nums.size()-1,k-1); } int partition(vector<int>&nums,int p,int r,int pos) { if (p>=r) return num...
ALGO
0.999964
5.759382
{ "github_metadata": { "branch": "main", "commit_count": 23, "repo_created_at": "2024-07-15T19:20: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": "e0da9d6d7f1...
47006e62-d3f9-4939-8ddb-2766fc405669
ishandutta2007/codeforces-k
kostia244/normal/405/D.cpp
#include<bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define mp make_pair #define pb push_back #define eb emplace_back #define xx first.first #define yy first.second #define __V vector #define all(x) x.begin(), x.end() #define rall(x) x.rbegin(), x.rend() #define oit ost...
ALGO
0.999837
3.287037
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-04-11T06:06: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": "ae5f0cf619b4...
4d182fb1-d541-44c8-ada8-7ffdf8b152b7
Camithilwen/Code-Cloning-Analysis
src/llm-scripts/testing/Project_CodeNet_experimentation_dataset/data/p02318/s602085767.cpp
#include <bits/stdc++.h> using namespace std; #define FOR(i,s, t) for(int i = s; i < t; i++) #define ALL(a) a.begin(), a.end() #define SZ(x) (int)x.size() #define UNIQ(c) (c).erase(unique(ALL((c))), end((c))) #define SORT(a) sort(ALL(a)) using VI = vector<int>; using LL = long long; using VVL = vector<vector<LL>>; u...
ALGO
0.999978
4.832096
{ "github_metadata": { "branch": "main", "commit_count": 243, "repo_created_at": "2025-06-06T16:57:42.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 0, "issues": 3, "pull_requests": 0 }, "file_meta": { "content_id": "bc2cd71f0a...
ddf855b2-e15e-47a1-854f-ffcdd79785ff
hzw20071003/works
vjudge/E/hack.cpp
/* * @Author: hzw20071003 <EMAIL> * @Date: 2023-06-25 14:13:43 * @LastEditors: hzw20071003 <EMAIL> * @LastEditTime: 2023-06-25 14:13:48 * @FilePath: \workspace\vjudge\E\hack.cpp * Copyright (c) 2023 by hezewei, All Rights Reserved. */ #include <iostream> #include <queue> using namespace std; struct V { int d...
ALGO
0.999956
5.576636
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2023-06-29T11:54: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": "363979ee20...
7be7744f-09d7-4a36-9606-df7628fd6e05
ArinaZotova/Zotova_a_a
prj.cw/BilaterialFilter/main.cpp
#include <opencv2/opencv.hpp> #include <iostream> #include <cmath> using namespace cv; using namespace std; // Функция для расчета гауссовского веса inline double gaussian(double x, double sigma) { return exp(-(x * x) / (2.0 * sigma * sigma)); } // Расчет евклидова расстояния между двумя цветами в пространстве R...
ALGO
0.980176
5.938466
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2022-12-13T12:07: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": "64f253126b9f...
16558d8b-bea4-40b4-abb6-28fbfa556d8f
kantuni/Codeforces
1015C/songs-compression.cpp
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; vector<int> a(n), b(n); for (int i = 0; i < n; i++) { cin >> a[i] >> b[i]; } long long sum = 0; for (int i = 0; i < n; i++) { sum += b[i]; } if (sum > m) { cout << -1 << "\n"; return 0; } sum = 0; ...
ALGO
0.999998
3.371212
{ "github_metadata": { "branch": "master", "commit_count": 1466, "repo_created_at": "2017-02-05T18:52:25.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 211, "forks": 58, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "fc1f...
b4734919-5603-4300-b4d6-df3e16a28516
SrjPdl/3D-Renderer
OPengl/Helper.cpp
#include "Helper.h" void Helper::calculateVertexNormal(float* vertices, uint32_t vertexCount, uint32_t* indices, uint32_t indexCount, uint32_t vertexLength, uint32_t normalOffset) { for (uint32_t i = 0; i < indexCount; i+=3) { uint32_t positionLocation[3] = { indices[i] * vertexLength, indic...
TOOL
0.99873
5.2335
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2022-06-14T10:24: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": "0dabb17156ac...
146d8c7a-e43b-496e-9057-f9009250d25e
agnik2019/CPP-Learnings
DAY3/Lab3Q1.cpp
#include<iostream> #include<string> using namespace std; class Rectangle{ private : int length; int width; string colour; Rectangle(){ length = 0; width = 0; } public : Rectangle(int len,int wid,string colour); int getArea(){ return length*width; } int compare(Re...
TOOL
0.98674
3.811361
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2021-06-22T13:03:58.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6c5cc3a41f79...
1c4016ae-1d67-4a71-bc46-9d3b27fc961b
ffskyfan/LeetcodeTest
Leetcode/code/two_sum_II_input_array_is_sorted.cpp
/*----------------------------------------------------------------- //167. Two Sum II - Input array is sorted //Easy //Given an array of integers that is already sorted in ascending order, find two numbers such that they add up to a specific target number. // //The function twoSum should return indices of the two numbe...
ALGO
0.999979
5.985106
{ "github_metadata": { "branch": "master", "commit_count": 99, "repo_created_at": "2016-10-03T19:02: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": "d727b886d...
2fbd5577-b9e0-4514-9273-bd9f90c9275e
atanaskoskizivko/OOP
AuditoryExercise8/Shapes.cpp
#include <iostream> #include <cstring> using namespace std; class Shapes { protected: double height; public: Shapes(double height=0) { this->height=height; } virtual void print()=0; virtual double volume()=0; double getHeight() { return height; } }; class Cylinder :...
TOOL
0.977042
3.502477
{ "github_metadata": { "branch": "main", "commit_count": 49, "repo_created_at": "2024-02-29T13:23: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": "dffb2dbdc05...
e610ee49-29d8-40e9-bfc5-96a3a6446f4c
Sachitanmuo/EDA_HW2
Hypergraph.cpp
#include "Hypergraph.h" #include <fstream> #include <sstream> #include <limits> void Hypergraph::addNode(int id) { nodes.push_back(id); } void Hypergraph::addEdge(const std::vector<int>& nodeIds) { Hyperedge edge; for (int id : nodeIds) { Node* node = &nodes[id - 1]; edge.addNode(node); ...
ALGO
0.993526
3.712764
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-04-11T07:08:32.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b58e8715b230...
697a99e3-e772-4e2d-9379-7d09737e5c7f
polgrisha/AlgorithmsMIPT
semester3/Ukkonen/main.cpp
#include <iostream> #include <map> #include <vector> using std::cin; using std::cout; using std::map; using std::ostream; using std::string; using std::vector; const int AlphabetSize = 256; //структура вершины struct Node { explicit Node(int size); Node(int parent_, int left_, int right_, char nextSymbo...
ALGO
0.999891
4.421348
{ "github_metadata": { "branch": "master", "commit_count": 6, "repo_created_at": "2019-04-17T16:17: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": "9cc58fd97b...
dcc59f43-b320-45e8-8ff1-eeb8c0681501
wlbr/csvfix
csvfix/src/csved_sort.cpp
//--------------------------------------------------------------------------- // csved_sort.cpp // // sort command for CSVED // // Copyright (C) 2009 <NAME> //--------------------------------------------------------------------------- #include "a_base.h" #include "a_collect.h" #include "a_sort.h" #include "csved_cli.h...
TOOL
0.97738
6.097681
{ "github_metadata": { "branch": "master", "commit_count": 26, "repo_created_at": "2021-07-05T18:44:08.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 19, "forks": 7, "issues": 1, "pull_requests": 1 }, "file_meta": { "content_id": "a3c522fb...
e55b2f64-8f44-4073-8064-96fe1945ecec
ErikGervasi/EdDUnivali-SistemaEstoque-Vendas
Main.cpp
#include <iostream> #include <fstream> #include <limits> #include <sstream> #include <string> #include <vector> #include <map> #include <windows.h> using namespace std; struct Produto { string codigo; // Modificado de char para string string nome; float preco; int quantidade; }; struct NoProduto { ...
TOOL
0.906406
4.58087
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2024-04-07T19:44: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": "49a44b1160bc...
726a910b-64ed-445a-a036-ae700755f71a
luyocarp/Algorithmic-Contests
Codeforces/cf_738B.cpp
#include <bits/stdc++.h> using namespace std; #define all(v) (v).begin(),(v).end() #define pb push_back #define sqr(x) ((x)*(x)) #define mp make_pair #define EPS 1e-9 #define ones(x) __builtin_popcount(x) #define fast_io() ios_base::sync_with_stdio(0);cin.tie(0); #define debug(x) cout << #x << ": " << x << endl; #defin...
ALGO
0.999988
3.50906
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2020-09-10T15:25: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": "f74a50065b...
8d05b353-7006-4e78-8169-0f304729e8a7
AleXamuel/Proyecto-Nestor
Problemas/Problems/Shortest path of the king.cpp
//https://codeforces.com/contest/3/problem/A using namespace std; #include <bits/stdc++.h> #define all(A) A.begin(), A.end() #define fori(i, k, n) for (int i = k; i < n; i++) #define ln "\n" #define ll long long #define ull unsigned long long #define conv(a) (9-a) void solve() { string a, b; cin >> a >> b; ...
ALGO
0.999975
4.074408
{ "github_metadata": { "branch": "main", "commit_count": 852, "repo_created_at": "2024-01-27T19:31:50.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3f09c11431...
7e42fa52-a97c-4a76-9540-74d4947f2440
shaneyale2005/cs336
assignment/assignment1-basics/encoder.hxx
#define USE_PARALLEL_HASH #include <vector> #include <string> #include <string_view> #include <unordered_map> #ifdef USE_PARALLEL_HASH #include <parallel_hashmap/phmap.h> #endif #include "LRUCache11.hpp" #include <limits> #include <chrono> #include <iostream> using Bytes = std::vector<unsigned char>; using PairBytes ...
ALGO
0.997891
6.715561
{ "github_metadata": { "branch": "master", "commit_count": 9, "repo_created_at": "2025-07-08T02:18: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": "8ae5cad39a...
c5e325a7-cf80-4c5c-86bd-81fda5bbcaa1
leh60245/Algorithm
프로그래머스/3/42579. 베스트앨범/베스트앨범.cpp
#include <bits/stdc++.h> using namespace std; using vi = vector<int>; using pii = pair<int, int>; vector<int> solution(vector<string> genres, vector<int> plays) { vector<int> answer; unordered_map<string, int> genre_num; unordered_map<string, vector<pii>> song_in_genre; int N = genres.size(); ...
ALGO
0.999754
4.806664
{ "github_metadata": { "branch": "main", "commit_count": 371, "repo_created_at": "2025-01-18T14:22: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": "0389e0c431...
b2ccd859-30c3-4ca3-91ef-55c478e53810
Ayush8165/Hacker.CodingBlocks_solution
sorting books/sorting_books.cpp
#include <iostream> using namespace std; int main() { freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); int n; cin >> n; char book[n]; for (int i = 0; i < n; i++) { cin >> book[i]; } bool flag = true; while (flag == true) { flag = false; ...
ALGO
0.999974
3.830588
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2023-07-26T05:01:52.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "29e2eb2e4c...
88235a87-f07b-4268-9e3d-cf992e71cf93
MSP07/LeetCode-Solutions-CPLUSPLUS
ParsingABooleanExpression.cpp
/*approach stack we push all chars before ) and find the op given accordingly we calculate the final result whether t or f*/ class Solution { public: bool parseBoolExpr(string expression) { stack<char>st; for(char c:expression){ if(c == ')'){ vector<char>expr; ...
ALGO
0.999613
5.404268
{ "github_metadata": { "branch": "main", "commit_count": 671, "repo_created_at": "2024-05-10T19:10: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": "5d8ca19d16...
d3295454-9fb5-4915-bff3-8bd94aa96107
krishnaph23/HoG_parallel
hog_omp.cpp
#include<iostream> #include<stdio.h> #include<opencv2/opencv.hpp> #include<cstring> #include<stdlib.h> #include<vector> #include<algorithm> #include<cmath> #include<ctime> #include<fstream> #include<string> #include<omp.h> #include<chrono> using namespace cv; using namespace std; using namespace std::chrono; #define ro...
ALGO
0.998066
3.928421
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2021-07-07T09:27:32.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2ac98bc5c088...
81ae3b26-c368-49f3-a303-305b0cd3878f
tomdial/adventofcode
2021/tdial/day-1/main.cc
#include <fstream> #include <iostream> using ::std::cerr; using ::std::cout; using ::std::endl; using ::std::getline; using ::std::ifstream; using ::std::string; // Read next valid depth. bool next_depth(ifstream& stream, int* depth) { if (stream.eof()) { return false; } string token; getline(stream, tok...
ALGO
0.999055
5.348219
{ "github_metadata": { "branch": "master", "commit_count": 24, "repo_created_at": "2021-12-02T03:07: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": "2c75b621b...
2b4228ef-80c4-4cf0-a827-21750b672b4b
sfegan/ChiLA
VSDataReduction/VSMLMAnalysis.hpp
//-*-mode:c++; mode:font-lock;-*- /*! \file VSMLMAnalysis.hpp Maximum likelihood method. \author <NAME> \n UCLA \n <EMAIL> \n \version $Revision: 3.6 $ \date 07/29/2007 $Id: VSMLMAnalysis.hpp,v 3.6 2010/10/20 03:33:16 ma...
ALGO
0.914267
6.827572
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2016-02-09T11:51:36.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c577166f168e...
69d98c82-5f3a-4bdd-a042-30c8e8e6043c
Yawn-Sean/Daily_CF_Problems
daily_problems/2025/01/0101/personal_submission/cf769c_WanderOvO.cpp
/* 从字典序的角度,D L R U 逐渐变大,所以选择走的顺序是下左右上 长度为 k 能走回来,所以 k 必须是偶数 可以多次访问同一个位置,所以只要 X 最开始没被包围且是偶数,就一定有合法方案 按照 D/L/R/U 的顺序去看行不行 什么叫行?意思是这个位置是空的能走,且走了之后剩下的步数还足够走回去 */ int n, m, k; int dx[4] = {1, 0, 0, -1}, dy[4] = {0, -1, 1, 0}; int d[M][M]; bool vis[M][M]; void meibao() { cin >> n >> m >> k; vector<string> grid(n + ...
ALGO
0.999979
4.651337
{ "github_metadata": { "branch": "main", "commit_count": 20410, "repo_created_at": "2024-02-26T01:04:08.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 478, "forks": 302, "issues": 0, "pull_requests": 7 }, "file_meta": { "content_id": "f6e7...
3aec93b4-a730-4d4b-b080-3bbb0b6b73b5
shreya21p/DSA-LAB
Lab10/max_heap.cpp
// Program to implement a Priority Queue ADT using Max Heap with operations: insert, delete, display, search, and sort #include <cstdio> #include <vector> #include <algorithm> using namespace std; class MaxHeap { private: vector<int> heap; void heapifyUp(int index) { while (index > 0 && heap[(index -...
ALGO
0.999763
5.338506
{ "github_metadata": { "branch": "main", "commit_count": 78, "repo_created_at": "2025-05-01T12:55: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": "1441eafc3c0...
480125e2-53a8-4cdd-92c6-46a0165b7dc0
endlessm/chromium-browser
services/network/trust_tokens/trust_token_key_commitment_parser.cc
// Copyright 2020 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "services/network/trust_tokens/trust_token_key_commitment_parser.h" #include "base/base64.h" #include "base/json/json_reader.h" #include "base/n...
TOOL
0.92615
7.537421
{ "github_metadata": { "branch": "master", "commit_count": 91, "repo_created_at": "2015-07-03T21:40:44.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 26, "forks": 18, "issues": 0, "pull_requests": 3 }, "file_meta": { "content_id": "12080aee...
40e615f2-5159-4f49-bd8c-26a8c1fd93ff
douxl5516/OJ
template/kmp拓展.cpp
/* |16/11/06ztx| */ #include<iostream> #include<cstring> using namespace std; const int MM=100005; int next[MM],extand[MM]; char S[MM],T[MM]; void GetNext(const char *T) { int len = strlen(T),a = 0; next[0] = len; while(a < len - 1 && T[a] == T[a + 1]) a++; next[1] = a; a = 1; for(int k...
ALGO
0.999736
3.780136
{ "github_metadata": { "branch": "master", "commit_count": 12, "repo_created_at": "2019-04-23T15:17:01.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9b685878f...
0de0f9cf-d34e-4d7d-b391-b649595fd078
engSinteck/A133_Image
longan/test/dragonboard/src/testcases/audiotester/common/FFT.h
/* * Copyright (C) 2016 The Dragonboard Open Source Project * * 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...
ALGO
0.928108
6.014617
{ "github_metadata": { "branch": "main", "commit_count": 20, "repo_created_at": "2022-02-08T19:37:14.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 17, "forks": 8, "issues": 2, "pull_requests": 1 }, "file_meta": { "content_id": "7adfd4df91...
eecb3048-62aa-43c0-bed2-353ebb79f6ea
muhammadhasan01/cp
Online Judge/Codeforces/Contests/EDU-DIV2/EDU-DIV2-25/D.cpp
#include <bits/stdc++.h> using namespace std; const int K = 30; string s[2]; long long len[2]; long long cnt[2][K]; bool can(long long x) { int cur = cnt[0][26]; for (int it = 0; it < 26; it++) { if (cnt[1][it] * x <= cnt[0][it] + cur) { long long dif = max(0LL, cnt[1][it] * x - cnt[0][i...
ALGO
0.999996
3.41952
{ "github_metadata": { "branch": "master", "commit_count": 1187, "repo_created_at": "2019-07-13T15:49:08.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 9, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8b5abb3...
3773496b-dc04-4be0-9172-85c41d3d8c52
Keshav7891/Leetcode-Solutions
1269-number-of-ways-to-stay-in-the-same-place-after-some-steps/1269-number-of-ways-to-stay-in-the-same-place-after-some-steps.cpp
class Solution { private: const int MOD = 1000000007; const int MAX_LEN = 251; vector<vector<int>> dp; int recurse(int steps, int arrLen, int pos) { if (steps == 0) return pos == 0 ? 1 : 0; if (dp[steps][pos] != -1) return dp[steps][pos]; long long left = 0; if (pos > ...
ALGO
0.999962
4.980765
{ "github_metadata": { "branch": "main", "commit_count": 2045, "repo_created_at": "2022-04-23T11:26:58.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f4f50b649...
4023d7fa-5c32-409f-91dc-d0de35b469de
bacchus/bacchuslib
src/image/filters_smooth.cpp
#include "filters_smooth.h" #include <iostream> #include <iomanip> #include "image.h" namespace bacchus { void print_kernel(float* kern, int r) { int k = 0; for (int i = -r; i <= r; ++i) { for (int j = -r; j <= r; ++j) { std::cout<<std::setw(7)<<std::setprecision(2)<<kern[k++]<<" "; ...
ALGO
0.994083
5.662328
{ "github_metadata": { "branch": "master", "commit_count": 117, "repo_created_at": "2016-01-12T14:26: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": "956f4f9f...
2517d45e-ce21-47bf-b536-b41a591b506a
yassin64b/competitive-programming
GCJ/2018/qual/A.cc
#include <bits/stdc++.h> using namespace std; class gcj_saving_the_universe_again { private: int calc_damage(const string &P) { int dmg = 0, strength = 1; for (char c : P) { if (c == 'S') { dmg += strength; } else { strength *= 2; ...
ALGO
0.999881
4.182183
{ "github_metadata": { "branch": "master", "commit_count": 786, "repo_created_at": "2016-03-07T18:10: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": "6aeba7fc...
3b7d8753-9697-4297-8063-00260fe5fb07
garciacallejas/IPM_basic
R/IPM_functions.cpp
#include <Rcpp.h> //#include <RcppArmadillo.h> using namespace Rcpp; // [[Rcpp::export]] NumericVector fExpCpp(NumericVector x, NumericVector param, int t_diff, double max_diam){ int n = x.size(); NumericVector q = (max_diam - x) * (1-exp(-t_diff*(param[0]*log(x)+param[1]))); NumericVector z(n); double mean_z...
ALGO
0.994609
5.933021
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2023-06-30T16:35:28.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c5e9c67fd6...
ac33eb99-7705-4561-a438-d13fca252b17
wwwwodddd/Zukunft
luogu/P2017_.cpp
#include <bits/stdc++.h> using namespace std; int n, p1, p2, x, y; vector<int> a[100020]; bool v[100020]; int pos[100020], cnt; void dfs(int x) { for (int i = 0; i < a[x].size(); i++) { if (!v[a[x][i]]) { dfs(a[x][i]); } } v[x] = true; pos[x] = cnt++; } int main() { cin >> n >> p1 >> p2; for (int i = 0; i...
ALGO
0.999991
4.160762
{ "github_metadata": { "branch": "master", "commit_count": 206, "repo_created_at": "2018-12-31T17:17:31.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 13, "forks": 5, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f8687a0...
14c5d321-1ec4-4102-a15d-0d715eb8b574
Kawser-nerd/CLCDSA
Source Codes/CodeJamData/09/63/8.cpp
// GCJ 2009 World Finals (C) // Author: hos.lyric #include <cstdio> #include <cstdlib> #include <cstring> #include <cmath> #include <cassert> #include <iostream> #include <sstream> #include <string> #include <vector> #include <queue> #include <set> #include <map> #include <utility> #include <algorithm> #include <bitse...
ALGO
0.999838
4.061388
{ "github_metadata": { "branch": "master", "commit_count": 20, "repo_created_at": "2019-09-30T05:38:13.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 22, "forks": 8, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "c7a9c0c0...
8f683a4e-d14d-4555-aa82-1b9b40ae661a
AlbertoEstep/Metaheuristicas
P3/src/ES.cpp
#include <iostream> #include <vector> #include <stdlib.h> // srand y rand #include <time.h> #include <random> // uniform_real_distribution #include <math.h> using namespace std; // Estructura para representar una solucion struct solucion{ vector<bool> v; // Vector de 1's y 0's donde 1 en la posicion i ...
ALGO
0.999835
3.812369
{ "github_metadata": { "branch": "master", "commit_count": 51, "repo_created_at": "2020-02-25T11:55: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": "223f940c8...
832157be-32f4-4b5e-af84-62f4607c4f2a
Smit6/LeetCode
NumberOfConnectedComponentsInAnUndirectedGraph.cpp
// Time: O(N.amortized(N)) = O(N) // Space : O(N) class UnionFind { public: UnionFind(int); int uf_union(int, int); private: vector<int> parent; vector<int> rank; int uf_find(int); }; UnionFind::UnionFind(int n) { for (int i = 0; i < n; i++) parent.push_back(i); rank = vector<int>...
ALGO
0.999933
5.93757
{ "github_metadata": { "branch": "main", "commit_count": 155, "repo_created_at": "2023-08-05T17:04: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": "0cfea44cf1...
dddff55e-4c97-414e-939f-1a2506becf23
yes-ee/PS-Algorithm
Algospot/Greedy/lunchbox.cpp
#include <iostream> #include <algorithm> #include <vector> #define MAX 10000 using namespace std; int t, n, ans, beginTime; vector<pair<int, int>> arr; int m[MAX], e[MAX]; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); cin >> t; for (int j = 0; j < t; j++) { cin >> n...
ALGO
0.999986
3.895341
{ "github_metadata": { "branch": "main", "commit_count": 700, "repo_created_at": "2022-07-19T08:07: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": "722fac7f26...
6350e8b7-9aa9-4251-8c23-24279ef6158b
wsl8779752/srcRep
learnc++/src/chapter3/part4.cpp
/** * @file part4.cpp * @brief * @author <EMAIL> * @version 1.0 * @date 2018-07-13 */ #include <iostream> #include <string> #include <cstdio> #include <cstring> #include <sstream> #include <cstdlib> #ifndef uint8_t #define uint8_t unsigned char #endif /* ifndef uint8_t */ using namespace std; /** * @brief nimam...
ALGO
0.982121
3.364196
{ "github_metadata": { "branch": "master", "commit_count": 25, "repo_created_at": "2018-07-11T08:55:34.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0519929e0...
b4a3cc4f-c2f8-4960-8d13-f5b77731d229
Hyeyeon-Kim/Algorithm
프로그래머스/3/49189. 가장 먼 노드/가장 먼 노드.cpp
#include <string> #include <vector> #include <queue> #include <iostream> #include <algorithm> #define INF 987654321 using namespace std; vector<vector<int>> edges; vector<int> dist; int max_ = 0; void bfs(){ priority_queue<pair<int,int>> q; q.push({0, 1}); dist[1] = 0; while (!q.empty()){ ...
ALGO
0.997786
4.5552
{ "github_metadata": { "branch": "main", "commit_count": 280, "repo_created_at": "2024-07-04T01:47:50.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b357d89863...
99c87190-04f5-43f7-8676-82974f6b77be
PatrykFlama/UWr
Sem6/AP/List11/4.cpp
#include <bits/stdc++.h> using namespace std; #define cerr if(0) cout #define fst first #define snd second typedef long long ll; typedef pair<int, int> pii; typedef pair<int, ll> pill; typedef pair<ll, int> plli; typedef pair<ll, ll> pll; class Graph { public: vector<unordered_set<int>> adj; vector<int> deg;...
ALGO
0.999989
4.254278
{ "github_metadata": { "branch": "main", "commit_count": 1366, "repo_created_at": "2023-03-05T15:36:10.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "313e3a498...
618fb37f-ff98-4791-b66c-38ad9fd56590
wyx150137/wyx-infinity37-ac-code-on-BZOJ
1023_wyx.cpp
#include <vector> #include <stdio.h> #include <string.h> #include <iostream> #include <algorithm> #define fir first #define sec second #define mp make_pair #define pb push_back const int N = 2000000+5; const int inf = 0x3f3f3f3f; using namespace std; vector <int> V1[N], V2[N], val[N]; inline void add(int x,int y) {V...
ALGO
0.999556
3.563657
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2017-07-12T01:10:34.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d571be31af...
1be0a9c8-65f7-470e-9de1-35916ad620f9
ishandutta2007/codeforces-r
realcomplex/normal/1354/B.cpp
#pragma GCC optimize("Ofast") #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll,ll> pii; typedef long double ld; #define fi first #define se second #define mp make_pair #define fastIO ios::sync_with_stdio(false);cin.tie(0);cout.tie(0); mt19937 rng(chrono::steady_clock::now().time_s...
ALGO
0.999493
4.143061
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-10-30T15:58: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": "d2a98aaa966c...
8b7fee29-afb2-45d2-9db1-c59c941ff73b
nazmulh24/XPSC-code
Week_1/Day_7/Problem_9.cpp
/*********************************************************************** Name --> <NAME> Link --> https://codeforces.com/problemset/problem/637/B Example--> ***********************************************************************/ #include <bits/stdc++.h> using namespace std; #define int long long #define no cout ...
ALGO
0.999964
4.688335
{ "github_metadata": { "branch": "main", "commit_count": 90, "repo_created_at": "2024-10-26T07:31: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": "cf9370ccb85...
beb12593-e15e-48ac-9455-75bdab219a38
Flyingrhino007/DataStructure
564.cpp
class Solution { public: string Mirror(string n) { auto len = n.size(); string res = n.substr(0,len/2); string str = n.substr(0,len/2); if(len%2==1) { reverse(str.begin(),str.end()); res = res + n[len/2] + str; } else if(len%2==0) ...
ALGO
0.999989
5.492687
{ "github_metadata": { "branch": "master", "commit_count": 11, "repo_created_at": "2018-08-28T06:47: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": "6e6349b4a...
9d71a02a-1c79-40c7-a889-4cece76a3fa4
Aryan-chaudhry/DSA-SUPREME-3.O
Graph/Traversal/DFS.cpp
#include<iostream> #include<unordered_map> #include<list> using namespace std; class Graph{ public: // 1st int --> u // 2nd int --> v // 3rd int --> wt unordered_map<int, list<pair<int,int> > >adjList; void addEdge(int u, int v, int weight, bool direction){ // direction --> 0 --> und...
ALGO
0.999959
5.471023
{ "github_metadata": { "branch": "main", "commit_count": 23, "repo_created_at": "2024-05-31T08:59:25.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a5c98bd422c...
b4286f40-5b37-4f8e-b9f1-1eda87fdc315
Lucas3H/MAC0214
Codeforces/harbour2021/f.cpp
#include<bits/stdc++.h> using namespace std; #define fr(i, n) for(ll i = 0; i < n; i++) #define frr(i, n) for(ll i = 1; i <= n; i++) #define frm(i, n) for(ll i = n-1; i >= 0; i--) #define pb push_back #define f first #define s second typedef long long ll; typedef pair<ll,ll> pii; typedef vector<vector<ll>> matrix; ...
ALGO
0.999968
3.549007
{ "github_metadata": { "branch": "master", "commit_count": 30, "repo_created_at": "2021-08-22T02:28: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": "3d8a4b20a...
a9ccb13d-369d-45db-9b51-b3305d08e22b
rituraj0/OtherCompetitions
241/3.cpp
#include <algorithm> #include <iomanip> #include <iostream> #include <sstream> #include <cstring> #include <cstdlib> #include <climits> #include <fstream> #include <cctype> #include <cstdio> #include <string> #include <vector> #include <queue> #include <stack> #include <cmath> #include <ctime> #include <map> #include <...
ALGO
0.99979
3.056017
{ "github_metadata": { "branch": "master", "commit_count": 15, "repo_created_at": "2014-11-02T03:17: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": "589a2df16...
625bd7d3-a1b6-49f3-975c-9e7c5e932b7b
arturgorak/abstract_programming_project
equipment/Weapon.h
// // Created by Artem on 17.01.2024. // #ifndef WOMBAT_WEAPON_H #define WOMBAT_WEAPON_H #include "Attack.h" template <SubAddMult T> class Weapon{ std::map<std::string, Attack<T>>& attacks; public: explicit Weapon(std::map<std::string, Attack<T>> &attacks) : attacks(attacks) {} void print_attacks_names()...
TOOL
0.919292
4.412971
{ "github_metadata": { "branch": "master", "commit_count": 12, "repo_created_at": "2024-01-10T00:54: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": "e1f7042be...
67bcb3cc-b50a-4e15-910e-c24f866a2127
LeeSeongDong/Security
AESCipher/AES.cpp
#include "AES.h" byte AES::GFMultiplication(byte a, byte b) { byte res = 0x00, temp = a; byte mask = 0x01; // 00011011 = 0x1B for (int i = 0; i < 8; ++i) { if (b & mask) { res ^= temp; } temp <<= 1; if (temp & 0x80) { temp ^= 0x1B; } mask <<= 1; } return res; } void AES::encryption(b...
ALGO
0.999883
4.988333
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2016-11-04T00:33: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": "8eed3f65da...
937286b7-4d49-4676-b4b2-3c5a09b87868
dmohammadullah/data-structures-and-algorithms
maxMinOfAnArray.cpp
#include <iostream> using namespace std; struct Pair { int min; int max; }; Pair getminMax(int arr[], int n) { struct Pair minMax; int i; //if one there have one element if (n == 1) { minMax.min = arr[0]; minMax.max = arr[0]; return minMax; } //if more the...
ALGO
0.999892
4.411564
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2022-01-26T18:45: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": "6d96f0a199f0...
498710e1-a1f6-4784-b3db-7d4bcf76c39a
matthewsamuel95/ACM-ICPC-Algorithms
Data Structures/Trie/trie.cpp
#include<bits/stdc++.h> using namespace std; typedef struct node{ struct node *children[26]; int isLeaf; char data; }node; //This function creates a new node and sets the data value to the parameter passed. node *create(char data){ node *newNode = (node *)malloc(sizeof(node)); newNode->data = data; newNode->...
ALGO
0.999773
3.878511
{ "github_metadata": { "branch": "master", "commit_count": 1421, "repo_created_at": "2017-10-21T21:46:48.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2203, "forks": 1277, "issues": 4, "pull_requests": 48 }, "file_meta": { "content_id": "...
d1ea33b4-355a-4d46-a699-be2ccb4248df
MQLib/MQLib
include/heuristics/qubo/merz2004.h
#ifndef HEURISTICS_QUBO_MERZ_2004_H_ #define HEURISTICS_QUBO_MERZ_2004_H_ #include "heuristics/qubo/merz2002.h" #include "heuristics/qubo/qubo_solution.h" #include "problem/qubo_heuristic.h" #include "problem/qubo_instance.h" // merz2004 borrows many components from previous papers: // - Its randomized greedy proce...
ALGO
0.9999
5.364207
{ "github_metadata": { "branch": "master", "commit_count": 14, "repo_created_at": "2015-04-29T02:07:02.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 79, "forks": 40, "issues": 4, "pull_requests": 4 }, "file_meta": { "content_id": "66afd973...
a071bc66-2aaa-4cf9-ae3a-8f5470ce8936
Pinguill/tareaCasino
Model/CajaMisteriosa.cpp
#include "CajaMisteriosa.h" float CajaMisteriosa::jugar( float gonzosApostar ) { // int bandera = 0; float resultadoJuego; srand( time( NULL ) ); cout << "Elije una caja: " << std::endl; cout << "1. Caja 1\n2. Caja 2\n3. Caja 3" << std::endl; cout << " "; // Control para verificar qu...
ALGO
0.961341
4.381072
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2021-05-16T00:09: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": "114edd0d79d4...
d8882418-d084-41b4-b773-3562bbf553a3
mxnuag/Leetcode
0015-3sum/0015-3sum.cpp
#include <vector> #include <algorithm> class Solution { public: std::vector<std::vector<int>> threeSum(std::vector<int>& nums) { std::vector<std::vector<int>> ans; int n = nums.size(); std::sort(nums.begin(), nums.end()); for (int i = 0; i < n; i++) { int a = nums[i]; ...
ALGO
0.999978
6.429875
{ "github_metadata": { "branch": "main", "commit_count": 363, "repo_created_at": "2024-01-13T09:47: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": "adf435eef3...
913d4544-4799-4615-b8f2-1a7569509e6d
olimjon1606/semester_1_exs
semester1/prac_ex3.cpp
#include<iostream> #include<ctime> using namespace std; void input_arr(int *arr, int n); int check_arr(int *arr, int n); double av_arr(int *arr, int n); int main() { const int n=10; int a[n]; input_arr(a, n); if(check_arr(a, n)>0) cout << "The average of elements with values that does not belong...
ALGO
0.998624
3.913332
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2022-06-05T12:30: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": "b08d67c8c04c...
e3d88ae2-33ce-4db8-add7-c0cb918d6b2b
aadarshahebsingh/Leetcode-DSA-
2028-the-earliest-and-latest-rounds-where-players-compete/2028-the-earliest-and-latest-rounds-where-players-compete.cpp
class Solution { public: vector<int> earliestAndLatest(int n, int firstPlayer, int secondPlayer) { int left = min(firstPlayer, secondPlayer); int right = max(firstPlayer, secondPlayer); // base condition if (left + right == n + 1) return {1, 1}; if (n == 3 || n =...
ALGO
0.999941
5.95205
{ "github_metadata": { "branch": "main", "commit_count": 547, "repo_created_at": "2023-05-03T14:27: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": "d4f73e61b6...
7e6b5157-d462-4404-b83a-5b0c11c3f570
weiwenjiang/FPGA_NAS_REPO
zhuorui/HLS_NEW/lib_dconv.cpp
#include "source_fix.h" #include <math.h> #include <stdlib.h> #define MAX(x, y) (((x) > (y)) ? (x) : (y)) #define MIN(x, y) (((x) < (y)) ? (x) : (y)) void dconv(hls::stream<DMA_DATA_128B_FIX> &input_dma_W, hls::stream<DMA_DATA_128B_FIX> &input_dma_I, hls::stream<DMA_DATA_128B_FIX> &input_dma_B, hls::stream<DMA_D...
ALGO
0.993022
3.134748
{ "github_metadata": { "branch": "master", "commit_count": 77, "repo_created_at": "2020-03-06T14:40:20.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6f5d8088e...