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 |
|---|---|---|---|---|---|---|---|
8a177fec-e021-4d3d-97bc-5ef1da485c0c | DevSharma26/LeetCode-Solutions | Median in a row-wise sorted Matrix - GFG/median-in-a-rowwise-sorted-matrix.cpp | //{ Driver Code Starts
//Initial template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function template for C++
class Solution{
public:
int count_greater(vector<int> &vg,int target){
//binary search tocount no of elements smaller than ... | ALGO | 0.999957 | 6.141864 | {
"github_metadata": {
"branch": "main",
"commit_count": 252,
"repo_created_at": "2022-09-01T05:00:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dd83a430d4... |
38350524-eef7-4343-aaa3-1620db64c5f6 | amgt-d1/top-k-weighted-stabbing | src/sequential-scan/sequentialscan.hpp | #include "../utils/utils.hpp"
#include <map>
class sequential_scan
{
/* function for result update */
void update_result(const unsigned int idx, std::multimap<unsigned int, unsigned int> &result)
{
if (result.size() < k)
{
result.insert({intervals[idx].first, idx});
}
... | ALGO | 0.999207 | 4.942202 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2023-10-21T02:27: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": "6265f80fe13c... |
0ce62946-0965-45fa-a187-6fc03fdef280 | eungaaee/ProblemSolving | 백준/Gold/1753. 최단경로/최단경로.cc | #include <bits/stdc++.h>
#define INF 0x3f3f3f3f
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int V, E, K;
cin >> V >> E >> K;
int u, v, w, dist[20001];
vector<pair<int, int>> m[20001];
for (int i = 1; i <= V; ++i) dist[i] = INF;
for (int i = 0;... | ALGO | 0.999981 | 4.482269 | {
"github_metadata": {
"branch": "main",
"commit_count": 605,
"repo_created_at": "2024-08-30T03:58: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": "9870548e64... |
262e3217-480b-480c-9153-ab010a794722 | miyatis/atcoder | atcoder-workspase/abc349/B/main.cpp | #include <iostream>
#include <sstream>
#include <fstream>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <utility>
#include <bitset>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cs... | ALGO | 0.999938 | 3.670882 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2024-09-21T06:36:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ccfabdb5098d... |
aff5f815-9bc0-4f64-a0e4-86bdd6f9ddce | saifrahmania/DataStructurePracticeWithC | CatalanSequence.cpp | #include<bits/stdc++.h>
#include<vector>
using namespace std;
struct Node{
int data;
Node* left;
Node* right;
Node(int x){
data = x;
left = NULL;
right = NULL;
}
};
int catalan(int n){
if(n<=1){
return 1;
}
int res = 0;
for(int i=0;i<n;i++){
... | ALGO | 0.999968 | 4.733336 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2022-08-20T01:55: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": "ba2bdf22d3e... |
b6e0f801-48f3-43e8-ba9c-b98f8fad809a | tempteamcode/micro-aevol | bits.h | #ifndef BITS_UTILITY_H
#define BITS_UTILITY_H
#include <cstdint>
#define R2(n) n, n + 2*64, n + 1*64, n + 3*64
#define R4(n) R2(n), R2(n + 2*16), R2(n + 1*16), R2(n + 3*16)
#define R6(n) R4(n), R4(n + 2*4 ), R4(n + 1*4 ), R4(n + 3*4 )
const uint32_t lookuptable[256] = { R6(0), R6(2), R6(1), R6(3) };
... | TOOL | 0.987169 | 3.867483 | {
"github_metadata": {
"branch": "master",
"commit_count": 105,
"repo_created_at": "2020-01-08T09:01: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": "3b5ec1ae... |
e58ac4f7-0943-44db-b48a-0cd7cb8cc8d7 | sscaglione/smallerProjects | polar.cpp | // <NAME>
// Lab 3
// Part 2: Quadrants and Polar Coordinates
// This program will prompt the user for x
// and y coordinates then find and display
// the point's corresponding polar coordinates
// and the quadrant that the point is in (or
// the axis or the origin if that is the case)
//preprocessor directives
#inclu... | ALGO | 0.97222 | 4.790906 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2017-10-11T15: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": "445d0736de... |
3a59bef8-f7b9-4794-b8ad-c3666ba90a36 | jmy45/acwing | advanced/cpp/1304.cpp | #include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
typedef long long LL;
const int N = 5;
int n, m;
void mul(int c[], int a[], int b[][N])
{
int temp[N] = {0};
for (int i = 0; i < N; i ++ )
for (int j = 0; j < N; j ++ )
temp[i] = (temp[i] ... | ALGO | 0.999998 | 3.784481 | {
"github_metadata": {
"branch": "main",
"commit_count": 191,
"repo_created_at": "2022-01-01T14:03: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": "fe41138620... |
52e6034e-ede6-4713-99e1-d9aaed48b005 | Fgdou/AdventOfCode2022 | src/Day12.cpp | //
// Created by fgdou on 12/12/22.
//
#include <stack>
#include "Day12.h"
#include "v2.h"
#include <algorithm>
#include <iostream>
#include <queue>
#include "utils.h"
void Day12::parse(std::istream &in) {
Input i{};
v2 pos;
while(!in.eof()){
pos.x = 0;
i.map.emplace_back();
stri... | ALGO | 0.999375 | 6.030932 | {
"github_metadata": {
"branch": "master",
"commit_count": 30,
"repo_created_at": "2022-12-01T07:54: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": "860ff0d91... |
aca60837-9a5a-42bf-9eaf-8dd33eac2fc1 | Vinitj088/Leetcode | TwoSum.cpp | class Solution {
public:
vector<int> twoSum(vector<int>& nums, int target) {
// Create hash map to store number:index pairs
unordered_map<int, int> numMap;
// Iterate through the vector
for (int i = 0; i < nums.size(); i++) {
// Calculate complement
i... | ALGO | 0.999972 | 6.50104 | {
"github_metadata": {
"branch": "main",
"commit_count": 16,
"repo_created_at": "2025-01-09T17:07: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": "c8ac6cf69c7... |
bd5845cc-10c9-44db-834f-3ec5faa913a9 | Shreya241/Cpp-problems | stack/prefix to postfix.cpp | //{ Driver Code Starts
// Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// User function Template for C++
class Solution {
public:
string preToPost(string s) {
reverse(s.begin(),s.end());
int n=s.length();
stack<string>st;
for(int i... | ALGO | 0.999623 | 5.913467 | {
"github_metadata": {
"branch": "main",
"commit_count": 352,
"repo_created_at": "2021-06-14T12:16: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": "2dcb23d391... |
d2ee894b-dd41-48b6-8e30-60c8e08572e1 | CarlosDaniel111/competitive-programming | ICPC/Europe/CERC/2023/K.cpp | #include <bits/stdc++.h>
using namespace std;
// <NAME>
using ll = long long;
using pi = pair<int, int>;
using vi = vector<int>;
#define pb push_back
#define SZ(x) ((int)(x).size())
#define ALL(x) begin(x), end(x)
#define FOR(i, a, b) for (int i = (int)a; i < (int)b; ++i)
#define ROF(i, a, b) for (int i = (int)a - 1; ... | ALGO | 0.999949 | 4.310932 | {
"github_metadata": {
"branch": "master",
"commit_count": 57,
"repo_created_at": "2023-08-03T01:39:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5eeace212... |
8c3869b5-0ce4-49c5-a1d7-c66ffaaf6928 | ak0327/42_CPP_Module_00-04 | cpp02/ex03/bsp.cpp | #include "Point.hpp"
#include "Fixed.hpp"
typedef Point Vec;
static Point sub(Point const a, Point const b) {
return Point(a.get_x() - b.get_x(), a.get_y() - b.get_y());
}
static Fixed cross(Point const a, Point const b) {
return Fixed(a.get_x() * b.get_y() - a.get_y() * b.get_x());
}
// a, b, c: The vertices of ... | ALGO | 0.978668 | 5.37992 | {
"github_metadata": {
"branch": "main",
"commit_count": 88,
"repo_created_at": "2023-04-19T10:27:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 5,
"pull_requests": 0
},
"file_meta": {
"content_id": "bb4c5303332... |
a0af5b8d-97f3-4cea-a4ef-6bfda74c33d6 | jizai945/leetcode | example/417_mid_太平洋大西洋水流问题.cpp | // 417. 太平洋大西洋水流问题
// 有一个 m × n 的矩形岛屿,与 太平洋 和 大西洋 相邻。 “太平洋” 处于大陆的左边界和上边界,而 “大西洋” 处于大陆的右边界和下边界。
// 这个岛被分割成一个由若干方形单元格组成的网格。给定一个 m x n 的整数矩阵 heights , heights[r][c] 表示坐标 (r, c) 上单元格 高于海平面的高度 。
// 岛上雨水较多,如果相邻单元格的高度 小于或等于 当前单元格的高度,雨水可以直接向北、南、东、西流向相邻单元格。水可以从海洋附近的任何单元格流入海洋。
// 返回 网格坐标 result 的 2D列表 ,其中 result[i] = [ri, ci]... | ALGO | 0.99993 | 5.960178 | {
"github_metadata": {
"branch": "main",
"commit_count": 421,
"repo_created_at": "2021-02-19T02:13: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": "48e0d927bb... |
11463868-765b-4fbd-9f94-bf3ff3defd88 | cyjseagull/gem5-nvmain-hybrid-simulator | gem5-stable/src/mem/ruby/network/orion/Allocator/MatrixArbiter.cc | /*
* Copyright (c) 2009 Princeton University
* Copyright (c) 2009 The Regents of the University of California
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met: redistributions of source cod... | ALGO | 0.991728 | 6.442541 | {
"github_metadata": {
"branch": "master",
"commit_count": 63,
"repo_created_at": "2015-09-14T01:17:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 77,
"forks": 49,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "70d90b3... |
110d3937-00b4-4986-b7c4-efd9d281f398 | devashishtyagi/Code | Codeforces/189/c.cpp | /* CPP Tempelate
* @author <NAME>
*/
#include <algorithm>
#include <functional>
#include <numeric>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <fstream>
#include <stack>
#include <string>
#include <vector>
#include <list>
#include <bitset>
#include <cctype>
#include... | ALGO | 0.999985 | 3.352856 | {
"github_metadata": {
"branch": "master",
"commit_count": 43,
"repo_created_at": "2012-04-17T16:41:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6c2d16596... |
415e2ad3-aaf2-46cc-9dfe-9773612bb8cf | Saif-000001/xpsc_latest | CodeChef/20Sep2023/4.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#ifdef LOKAL
#include "DEBUG_TEMPLATE.h"
#else
#define HERE
#define debug(args...)
#endif
const int MOD = 1000000007;
const int N = 2e5 + 5;
typedef pair<int, int> pii;
bool check(vector<int> a, int x, int y)
{
for (int i =... | ALGO | 0.999994 | 4.433546 | {
"github_metadata": {
"branch": "main",
"commit_count": 236,
"repo_created_at": "2023-08-17T13:46: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": "66ee97c163... |
4fe67f84-fb04-4971-a171-bbc84f9b6e5b | l-cadamuro/Statistical-Data-Analysis | 2_Simplesso/main.cpp | #include <iostream>
#include "Simplex.h"
#include <limits>
using namespace std;
int main()
{
typedef std::numeric_limits<double> dbl;
std::cout.precision(dbl::digits10);
Simplex* simplesso = new Simplex;
//simplesso->SetVerbose(true);
simplesso->SetVertex(-2000,-8000, 3000,-6000, 9000,6000);
T... | ALGO | 0.999279 | 4.277165 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2014-07-18T12:01: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": "195b11eb28... |
0aee47c4-e30e-4765-918a-c54251b09d01 | cran/netcoh | src/RcppExports.cpp | // This file was generated by Rcpp::compileAttributes
// Generator token: <PASSWORD>
#include <Rcpp.h>
using namespace Rcpp;
// rnc_solver_X
extern "C" SEXP rnc_solver_X(SEXP X, SEXP L, SEXP Y, SEXP lambda, SEXP W);
RcppExport SEXP netcoh_rnc_solver_X(SEXP XSEXP, SEXP LSEXP, SEXP YSEXP, SEXP lambdaSEXP, SEXP WSEXP) ... | ALGO | 0.981991 | 6.392262 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2016-03-03T07:26:32.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f1569c023bc... |
299b0785-e581-4cfb-bd85-fe7cce9365fe | svsannidhay/competitive-programming | HackerEarth/september_circuits_smallest_choosen_word.cpp | //problem statement:- https://www.hackerearth.com/practice/algorithms/greedy/basics-of-greedy-algorithms/practice-problems/algorithm/smallest-chosen-word-0108fd21/
// medium one
#include <bits/stdc++.h>
#define fio ios_base::sync_with_stdio(false);cin.tie(NULL)
using namespace std;
bool compare(string a, string b)
{ ... | ALGO | 0.99982 | 3.377501 | {
"github_metadata": {
"branch": "master",
"commit_count": 173,
"repo_created_at": "2019-07-08T17:21:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "94d48ad6... |
10df8898-ca41-4d6d-b21f-3a72f1da2c90 | ashib11/Sub_Zero_ | B_Nikita_and_string.cpp | #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;
template <typename T>
#define ll long long
#define pi acos(-1.0)
#define ull unsigned long long
#define endl "\n"
#define all(v) v.begin(), v.end()
#define allr(v) v.r... | ALGO | 0.999656 | 3.852599 | {
"github_metadata": {
"branch": "main",
"commit_count": 38,
"repo_created_at": "2022-11-09T13:19: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": "e2990fdae15... |
5f839488-e604-4ed7-82b2-ed325fcd08de | Tarunagg1/Ds_Alog_notes | Matrix_Operations/Matrix_Rotation90.cpp | #include <bits/stdc++.h>
#define N 3
using namespace std;
void Rotate(int matrix[][N])
{
for (int x = 0; x < N / 2; x++)
{
for (int i = x; i < N-x-1; i++)
{
int t = matrix[x][i];
matrix[x][i] = matrix[i][N-1-x];
matrix[i][N-1-x] = matrix[N-1-x][N-1-i... | ALGO | 0.99998 | 5.17253 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2021-01-19T04:18: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": "0078421745... |
33802471-0f2b-4189-8830-8b4158dd0978 | alexa0o/mipt-cpp-course | samples/sem5/lru.cpp | #include <list>
#include <unordered_map>
using namespace std;
class LRUCache {
public:
LRUCache(int capacity) : cap_(capacity) {
}
int get(int key) {
if (map_.find(key) == map_.end()) {
return -1;
}
list_.splice(list_.begin(), list_, map_[key]);
re... | ALGO | 0.999434 | 6.429765 | {
"github_metadata": {
"branch": "main",
"commit_count": 30,
"repo_created_at": "2023-02-05T07:59:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 2,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "bf96302d5ad... |
58c6f114-f759-4b2c-ba0b-47ae62007e52 | ma6di/Cpp-Modules | Cpp09/ex02/other versions/Complex Version/InsertionIndexTracker.cpp | #include "InsertionIndexTracker.hpp"
#include "PmergeMe.hpp"
bool g_errorDetected = false;
InsertionIndexTracker::InsertionIndexTracker(void) {}
InsertionIndexTracker::~InsertionIndexTracker(void) {}
// Initializes the InsertionIndexTracker with a given size, clearing and resizing internal containers.
void Insertion... | ALGO | 0.968788 | 5.662456 | {
"github_metadata": {
"branch": "main",
"commit_count": 57,
"repo_created_at": "2025-01-23T10:27:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "32afe45f7e7... |
8cbf8b01-4f24-49ce-97cd-e4e10a3c2b02 | CbIpok/SkipList | SkipList/skip_list.h | #pragma once
#include <functional>
#include <memory>
#include"SkipListIterator.h"
#include "ConstSkipListIterator.h"
#include <random>
#include <list>
#include <array>
#include <iostream>
#include <cstdlib>
#include <ctime>
template <typename Key,
typename Value,
typename Compare = std::less<Key>,
typename Alloc = ... | ALGO | 0.99672 | 4.69257 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2018-10-06T12:25:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f590cb371e... |
8adc72bc-6451-4432-87a3-bf52b7899054 | damiangluk/proyectos_materias_utn | 2021/algoritmos_y_estructuras_de_datos/TP3/resolucion/Ejercicio 8.cpp | #include <iostream>
#include <cstring>
using namespace std;
int *OrdenAscendente(int[], int);
int *OrdenDescendente(int[], int);
int main()
{
const int tope = 5;
int vec[tope] = {34,-20,10,-49,8};
cout << "Vector inicial: ";
for (int i = 0; i < tope; i++)
{
cout << vec[i];
if (i < tope-1)
{
cout << ", ... | ALGO | 0.999973 | 5.115168 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2023-08-04T21:54: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": "3f366aec862... |
5ddfc81f-02be-4287-b95b-0205ce89182f | vladfau/study | 1st-year-coding/ogneva/additional/m4.cpp | #include <iostream>
#include <cmath>
using namespace std;
struct point
{
float x;
float y;
};
float length(float x, float y)
{
return sqrt(x * x + y * y);
}
int main(void)
{
cout << "Enter number of your points: ";
int pcount;
cin >> pcount;
point* pts = new point[pcount];
for (int i = 0; i < pc... | ALGO | 0.999243 | 3.942921 | {
"github_metadata": {
"branch": "master",
"commit_count": 382,
"repo_created_at": "2014-03-12T12:29: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": "e4d74769... |
b45751da-7c08-44d3-918e-fa6340532c21 | ravireddy07/cpp-book | src/Code-Chef/AMIFIB.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
const int N = 5000;
vector<int64_t> fib(N, 0);
fib[1] = 0;
fib[2] = 1;
for (int p = 3; p < N; p++)
fib[p] = fib[p - 1] + fib[p - 2]; //OK to overflow
int t;
cin >> t;
while (t--)
{
string s;
cin >> s... | ALGO | 0.999862 | 4.887496 | {
"github_metadata": {
"branch": "master",
"commit_count": 490,
"repo_created_at": "2019-06-20T07:54:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 18,
"forks": 1,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "5a427b6... |
82f1c82e-86cf-4db9-8e72-81e8a7e82aa3 | algoboy101/LeetCodeCrowdsource | backup/source/cpp/[1358]包含所有三种字符的子字符串数目.cpp | //给你一个字符串 s ,它只包含三种字符 a, b 和 c 。
//
// 请你返回 a,b 和 c 都 至少 出现过一次的子字符串数目。
//
//
//
// 示例 1:
//
// 输入:s = "abcabc"
//输出:10
//解释:包含 a,b 和 c 各至少一次的子字符串为 "abc", "abca", "abcab", "abcabc", "bca", "bcab", "bc
//abc", "cab", "cabc" 和 "abc" (相同字符串算多次)。
//
//
// 示例 2:
//
// 输入:s = "aaacb"
//输出:3
//解释:包含 a,b 和 c 各至少一次的子字符串为 "... | ALGO | 0.999939 | 5.681593 | {
"github_metadata": {
"branch": "master",
"commit_count": 194,
"repo_created_at": "2020-03-06T03:43:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 3,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "a7233e59... |
34bc6284-e634-4459-b355-c019673a1048 | jthommen/algorithms-cpp | part-3/07-quicksort/program_07_03.cpp | /*
###
Program 7.3: Nonrecursive Quicksort (Stack)
###
Description:
Quicksort - Nonrecursive implementation of quicksort using an explicit pushdown
stack, replacing recursive calls with stack pushes (of the paramters) and the
procedure call/exit with a loop that pops parameters from the stack and process
them as long ... | ALGO | 0.999981 | 5.933273 | {
"github_metadata": {
"branch": "master",
"commit_count": 25,
"repo_created_at": "2019-01-06T10:42: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": "f398fec02... |
10b72708-42db-4ef8-922b-e19bdef6f0f4 | heghine1302/class-Account | classAccount.cpp | #include<iostream>
#include<mutex>
#include<string>
using namespace std;
//mutex mtx;
class Account1 {
private:
public:
string name;
string surname;
double balance; //$
Account1() {
cout << "Constuctor1" << endl;
name = "Heghine";
surname = "Aghajanyan";
balance = 100;
}
Account1(const string&name, cons... | TOOL | 0.905352 | 3.870016 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2019-06-22T03:11: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": "1001f97944... |
f9fcae6c-4360-4a96-bbab-7cd11da7d696 | zsd2024/cpp_development_environment | 2025.3.2/zone.cpp | #include <bits/stdc++.h>
using namespace std;
ifstream fin("zone.in");
ofstream fout("zone.out");
int N, M;
bool mp[101][101];
bool vis[101][101];
int dir[4][2] = {{0, 1}, {0, -1}, {1, 0}, {-1, 0}};
int ans = 0;
void dfs(int x, int y)
{
vis[x][y] = true;
for (int i = 0; i < 4; ++i)
{
int nx = x + di... | ALGO | 0.999719 | 4.214199 | {
"github_metadata": {
"branch": "main",
"commit_count": 126,
"repo_created_at": "2024-12-08T01:03: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": "d3a34fdf29... |
6ceae9b6-6aca-42f2-ad60-bf245826267f | TristanVenot/Openvibe | src/box-algorithms/ovpCDownsamplingBoxAlgorithm.cpp |
#include "ovpCDownsamplingBoxAlgorithm.h"
#include <cstdlib>
#include <climits>
using namespace OpenViBE;
using namespace OpenViBE::Kernel;
using namespace OpenViBE::Plugins;
using namespace OpenViBEPlugins;
using namespace OpenViBEPlugins::SignalProcessing;
using namespace std;
boolean CDownsamplingBoxAlgorithm... | ALGO | 0.987672 | 4.91538 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-03-07T14:27: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": "e9b5071eeb... |
4dc82cb0-7d0e-450b-b314-e84cd2c70451 | bqi343/cp-notebook | Contests/USACO Solutions/2018-19/Jan 2019/Plat/exercise.cpp | #pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/rope>
using namespace std;
using namespace __gnu_pbds;
using namespace __gnu_cxx;
typedef long long ll;
typedef long double ld;
typedef complex... | ALGO | 0.999925 | 4.374444 | {
"github_metadata": {
"branch": "master",
"commit_count": 1350,
"repo_created_at": "2017-07-11T03:52:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2642,
"forks": 429,
"issues": 4,
"pull_requests": 0
},
"file_meta": {
"content_id": "d3... |
33465060-348a-43aa-bc83-57e2e9c975f2 | Kushagra164/My_own_CSES_Solutions_and_DSA_Sol | Graphs/Path_Queries.cpp | #include <bits/stdc++.h>
#define rep(i,a,b) for(int i = a; i < b; i++)
#define ll long long
#define pb push_back
#define all(a) a.begin(),a.end()
#define MOD 1000000007
using namespace std;
//Code By Kush
void dfs(vector<int> adj_list[],int node,int par,int &timer,vector<int> &eulerTour,map<int,int> &timein,map<int,... | ALGO | 0.999829 | 4.549407 | {
"github_metadata": {
"branch": "main",
"commit_count": 38,
"repo_created_at": "2023-09-17T16:09:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0cdabe94edf... |
1fb3eb28-bf62-411d-b537-8b9655f1048e | supershivam13/CP_Templates | Stacks/( Imp ) Stock Span Problem ( GFG ).cpp | // STACK QUESTIONS
// IDENTIFICATION
// Brute Force - O( N^2 ) { dependent nested loop } { j loop is dependent on i loop }
// Example - for(int i=0;i<n;i++){
// inside for loop is dependent on i loop
// a) for(int j=0; j<=i; j++)
// b) for(int j=i; j>=0; j--)
// c)... | ALGO | 0.999974 | 5.019694 | {
"github_metadata": {
"branch": "main",
"commit_count": 589,
"repo_created_at": "2021-05-31T10:39:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 5,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "1a47ed4316... |
4c220ebc-66eb-4f5a-9eb1-b05d62551e2f | mono-1729/AtCoder_cpp | ABC/381/c.cpp | #include <bits/stdc++.h>
#include <unordered_map>
#include <stdlib.h>
#include <boost/multiprecision/cpp_int.hpp>
#include <atcoder/all>
using namespace atcoder;
using namespace boost::multiprecision;
using namespace std;
#define rep(i, a, n) for(ll i = a; i < n; i++)
#define rrep(i, a, n) for(ll i = a; i >= n; i--)
#d... | ALGO | 0.999922 | 3.805968 | {
"github_metadata": {
"branch": "main",
"commit_count": 296,
"repo_created_at": "2023-07-13T08:05:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "352e3fabaf... |
414adb21-1ea7-401d-9b97-50a8c54b28f9 | luop/ee590 | hw3/prob3/matrix.hh | #include <iostream>
#include <stdexcept>
class matrix_exception : public std::runtime_error {
public:
matrix_exception(const char msg[]) : std::runtime_error(msg) { }
};
template <class T>
class matrix {
public:
matrix(int r, int c);
matrix(int s) : matrix(s,s) {};
~matrix();
static matrix identity( int ... | TOOL | 0.963661 | 6.275156 | {
"github_metadata": {
"branch": "master",
"commit_count": 108,
"repo_created_at": "2016-09-30T23:47: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": "b06082a3... |
f92d2c6c-6d08-443d-b4ba-85b66f5442f5 | konanrobot/agas-ros-pkg | object_recognition/src/obj_rec_gui/src/Workers/ObjectRecognition/CvHomography.cpp | /*******************************************************************************
* CvHomography.cpp
*
* (C) 2007 <NAME> <<EMAIL>>
* Universitaet Koblenz-Landau
*******************************************************************************/
#include "CvHomography.h"
// #include "Architecture/Config/C... | ALGO | 0.990257 | 6.062403 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2015-04-18T04:07:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0961156ab... |
97f71a5c-e4fc-4283-b238-81ba7e836e47 | rambog/git | study/c++_primer_V5/chapter10/practice/10-18.cpp | /*======================================================================
* filename: 10-18.cpp
* author: rambogui
* data: 2019-01-03 09:34:37
======================================================================*/
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#inclu... | ALGO | 0.998265 | 3.868269 | {
"github_metadata": {
"branch": "master",
"commit_count": 72,
"repo_created_at": "2018-10-15T14:09: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": "f87c44a31... |
01d2a03d-0317-423d-a7a2-50f897c752a9 | ericbrandwein/competencias | Codeforces/1469/d/d.cpp | //#pragma GCC optimize("Ofast")
//#pragma GCC optimize("unroll-loops,no-stack-protector")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
#define IOS ios::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define endl '\n'
#define elif else if
#define ll long long i... | ALGO | 0.998846 | 3.98787 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2021-05-28T02:53: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": "ea8360bf3a... |
21f9ae91-b727-4abe-b16a-85f7d775017e | ithsarasak/Programming | Compettitive programming/PEG/ioi11_race.cpp | #include <bits/stdc++.h>
#define pii pair<int ,int>
#define x first
#define y second
using namespace std;
const int N = 2e5+100;
int n, dep[N], ver[N], st[N], ft[N], hv[N], ti, ans = 1e9;
map<long long, int> m;
vector<pii> g[N];
long long path[N], k;
int pre( int u, int p ) {
st[u] = ++ti;
ver[ti] = u, dep[u] = de... | ALGO | 0.999926 | 3.536038 | {
"github_metadata": {
"branch": "master",
"commit_count": 31,
"repo_created_at": "2019-04-03T08:43:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3edb89c2c... |
f0111a28-5a07-4e17-8832-02f70a9eaf0e | Oh-My-WONDERFUL-TYB/GDB-HW6 | src/include/RTreeSrc.hpp | #ifndef RTREE_SRC_H_INCLUDED
#define RTREE_SRC_H_INCLUDED
#include "Geometry.h"
#include "Tree.h"
#include <algorithm>
#include <array>
#include <queue>
#include <string>
#include <vector>
#include <memory>
namespace hw6
{
/// <summary>
/// </summary>
/// <param name="M">Maximum number of children of ea... | ALGO | 0.952962 | 5.808352 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2022-11-11T10:25:42.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8c5be475007a... |
39524f2f-d5aa-48af-85ab-c2146acd6bab | ishandutta2007/codeforces-g | greencis/normal/929/C.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int a, b, c, va[1005], vb[1005], vc[1005];
int main() {
cin >> a >> b >> c;
for (int i = 0; i < a; ++i)
cin >> va[i];
for (int i = 0; i < b; ++i)
cin >> vb[i];
for (int i = 0; i < c; ++i)
cin >> vc[i];
sort... | ALGO | 0.999888 | 3.74043 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:55: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": "8f96afe85624... |
fa15c4fb-7f0c-4a19-8fc2-079883a04604 | dboglobal/DBOGLOBAL | DboClient/Lib/NtlSimulation/DboMovingAlgorithm.cpp | #include "precomp_ntlsimulation.h"
#include "DboMovingAlgorithm.h"
#include "NtlMath.h"
////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////
RwBool CDboDeadReckonig::Refresh(... | ALGO | 0.997885 | 4.724093 | {
"github_metadata": {
"branch": "master",
"commit_count": 36,
"repo_created_at": "2020-04-24T10:59:32.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 61,
"forks": 95,
"issues": 6,
"pull_requests": 1
},
"file_meta": {
"content_id": "08e7ebf3... |
8335151f-7f2a-403e-bad7-98a5dafb0f66 | Arun-Kumar21/Leet-Code | kth_smallest_prime_fract.cpp | /*
Q786 Kth Smallest Prime Freaction
*/
#include <iostream>
#include <vector>
#include "../../../usr/include/c++/11/bits/algorithmfwd.h"
using namespace std;
class Solution
{
public:
vector<int> kthSmallestPrimeFraction(vector<int> &arr, int k)
{
vector<pair<float, pair<int, int>>> fract;
// Populate the... | ALGO | 0.99998 | 6.036511 | {
"github_metadata": {
"branch": "main",
"commit_count": 96,
"repo_created_at": "2024-06-04T18:18: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": "8b1619ba952... |
92cfd8da-0a78-46a5-a106-2cec912a96b6 | hsinyv/Algorithm_Exercise | Codeup/100000578C print_the_xth_day.cpp | #include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <string>
#include <cctype>
#include <unordered_map>
#include <iomanip>
#include <fstream>
using namespace std;
const int days_of_month[13] = { 0,31,28,31,30,31,30,31,31,30,31,30,31 };
con... | TOOL | 0.98974 | 4.007316 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2021-02-02T13:20:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0bf0d4fb38d... |
e425355c-22d7-470e-8d79-540cd8c52e76 | alexandraback/datacollection | solutions_2453486_1/C++/alex4814/a.cpp | #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
using namespace std;
#define EPS 1e-8
#define MAXN 10
#define PI acos(-1.0)
int T, blank;
char g[MAXN][MAXN];
int dia(char c)
{
int f = 1;
for (int i = 0; i < 4; ++i... | ALGO | 0.999937 | 3.906342 | {
"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": "0d3c0199d... |
8bfc89af-dd5f-4bef-8cac-ef44e32349d0 | Morales7nl21/Compiladores2021 | Proyecto/AnalizadorLexico/LL1.cpp | #include <bits/stdc++.h>
#include <iostream>
#include <algorithm>
#include <sstream>
#include <iterator>
#include <sstream>
#include "LL1.hpp"
void LL1::primeros(const vector<string> &elementoAbuscarPrimero, vector<string> &conjuntoRetorno)
{
for (auto const &eAP : elementoAbuscarPrimero)
{
if (!veri... | ALGO | 0.999615 | 3.219928 | {
"github_metadata": {
"branch": "master",
"commit_count": 91,
"repo_created_at": "2021-08-18T22:45: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": "5af496473... |
23e372b6-630f-40d2-a2d3-d72c9c6bf006 | rokkc/Programming | segmentTree.cpp | #include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("O3")
#define ll long long
template <class T>
class SegmentTree {
private:
vector<T> segtree;
int len;
const T DEFAULT;
function<T(T, T)> operation;
void build(const vector<T>& data) {
for (int i = 0; i < len; ++i) {
... | ALGO | 0.999973 | 5.460569 | {
"github_metadata": {
"branch": "main",
"commit_count": 66,
"repo_created_at": "2024-10-29T00:24: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": "755ed532ca0... |
f8c51fa6-1559-4505-839e-d3d32863d889 | iago-suarez/ELSED | src/EdgeDrawer.cpp | #include <utility>
#include <memory>
#include "EdgeDrawer.h"
namespace upm {
template<class T>
static inline std::vector<T> &
operator+=(std::vector<T> &lhs, std::vector<T> l) {
lhs.insert(std::end(lhs), std::begin(l), std::end(l));
return lhs;
}
EdgeDrawer::EdgeDrawer(const LineDetectionExtraInfoPtr &gradientIn... | ALGO | 0.986172 | 5.337544 | {
"github_metadata": {
"branch": "main",
"commit_count": 22,
"repo_created_at": "2021-08-06T12:42:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 278,
"forks": 54,
"issues": 4,
"pull_requests": 2
},
"file_meta": {
"content_id": "589c54e6... |
dd4afe28-a5c7-48cf-8c20-e731889c56c9 | fumyparli/problem-solving | movingBlock.cpp | #include <bits/stdc++.h>
using namespace std;
bool check[100][100][100][100];
int dx[] = {-1, 0, 1, 0};
int dy[] = {0, 1, 0, -1};
int ddx[] = {-1, 1, 1, -1};
int ddy[] = {1, 1, -1, -1};
pair<int, int> ddd[] = {{0, 0}, {0, 1}, {1, 0}, {1, 1}};
int n;
vector<vector<int>> a;
struct info {
int x[2];
int y[2];
... | ALGO | 0.999966 | 4.319658 | {
"github_metadata": {
"branch": "master",
"commit_count": 414,
"repo_created_at": "2021-01-05T12:42:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "506986f4... |
368edf4c-848a-4f03-ab6b-efece6bfe00a | fk721/minesweeper | minesweeper.cpp | /* TO RUN:
g++ minesweeper.cpp -o game.exe
*/
#include <iostream>
#include <vector>
#include <cstdlib>
#include <ctime>
using namespace std;
/* GlOBALS */
const int ROWS(10);
const int COLS(10);
const int BOMBS(10);
struct Tile {
Tile(): isVisible(false), isBomb(false), surroundingBombs(0) {}
bool isVisible;
b... | ALGO | 0.951707 | 5.149638 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2019-01-02T05:53: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": "25c12e343b... |
44cec5e4-0cbf-46a8-b612-9fbfb0006bdd | sandaruwan98/DSA2_graphs | graphs/matrixGraph.cpp |
#include <iostream>
#include <string.h>
#include <list>
using namespace std;
class Graph
{
int **matrix;
int v;
int *inDegree;
int *outDegree;
public:
Graph(int v);
void AddEdge(int v, int w) { matrix[v][w] = 1;}
void BFS(int s);
void DFS();
void Visit(int v, char *visited);
... | ALGO | 0.999652 | 4.838978 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2019-11-13T14:42:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d1d87e7b9... |
8dccad6c-e6bd-44b6-9bef-04c2584611b2 | organicmaps/organicmaps | geometry/calipers_box.cpp | #include "geometry/calipers_box.hpp"
#include "geometry/bounding_box.hpp"
#include "geometry/convex_hull.hpp"
#include "geometry/line2d.hpp"
#include "geometry/polygon.hpp"
#include "geometry/segment2d.hpp"
#include "base/assert.hpp"
#include <algorithm>
#include <array>
#include <limits>
namespace m2
{
namespace
{... | ALGO | 0.998937 | 7.325922 | {
"github_metadata": {
"branch": "master",
"commit_count": 42613,
"repo_created_at": "2020-12-27T19:02:26.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 11487,
"forks": 1128,
"issues": 2796,
"pull_requests": 182
},
"file_meta": {
"content_i... |
5b23c045-2c11-478d-ad88-9ae51c8c5a90 | keunsublee/School-Projects | Software-Design/335-Software-Design-3-Project 3/CountingSort.cpp | #include <iostream>
#include <vector>
#include <fstream>
#include <sstream>
#include <string>
#include <unordered_map>
#include <algorithm>
#include <set>
void countingSort(const std::string &header, std::vector<int> data) {
// Step 1: Create a hash map to count occurrences of each data value
std::unordere... | ALGO | 0.999597 | 5.550807 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-06-11T04:41: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": "9f4b423d9f6e... |
bc53ba60-be25-4a86-bf58-117ca71af6c8 | TAE-SEOP/Algorithm | Brute Force Algorithm/14500(DFS,Back Tracking).cpp | #include <stdlib.h>
#include <iostream>
#include <string.h>
using namespace std;
int tetrominox[4] = { 0,0,1,-1 };
int tetrominoy[4] = { -1,1,0,0 };
int tminox[4][4] = { {0,0,0,1},{0,1,2,1},{0,0,0,-1},{0,-1,0,1} };
int tminoy[4][4] = { {0,1,2,1},{0,0,0,1},{0,1,2,1},{0,1,1,1} };
int n, m;
int result = 0;
int paper[502... | ALGO | 0.999939 | 3.997017 | {
"github_metadata": {
"branch": "main",
"commit_count": 66,
"repo_created_at": "2021-01-26T03:46:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bfa06861cc9... |
182cc0d4-525c-48b3-b64e-6a44502ab6c8 | utexas-bwi/bwi_experimental | bwi_tasks_pnp/pnp/src/learning_plan/algo/MCESP_SAA.cpp | #include <pnp/learning_plan/algo/MCESP_SAA.h>
#include <pnp/learning_plan/exp/Exploit.h>
#include <pnp/learning_plan/exp/ExploitWithHysteresis.h>
#include <pnp/learning_plan/algo/AlphaScheduler.h>
#include <algorithm>
#include <iterator>
#include <limits>
using namespace std;
namespace learnpnp {
class SelectiveD... | ALGO | 0.998822 | 5.746395 | {
"github_metadata": {
"branch": "master",
"commit_count": 581,
"repo_created_at": "2014-03-31T16:24:51.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 4,
"forks": 18,
"issues": 2,
"pull_requests": 1
},
"file_meta": {
"content_id": "c306efea... |
955d09cb-30e9-4c1e-9fae-f7a4edf97e74 | luishpmendes/mc621-mc821-2022s2 | 2022-10-14/A/A.cpp | // https://onlinejudge.org/index.php?option=onlinejudge&Itemid=8&category=226&page=show_problem&problem=2988
// 11888 - Abnormal 89's
// A palindrome is a word that can be read the same way in either direction. More formally if a string is
// d (d > 0) characters length and the i-th character is ai, the string is pali... | ALGO | 0.991341 | 4.507896 | {
"github_metadata": {
"branch": "main",
"commit_count": 135,
"repo_created_at": "2022-07-25T00:18:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "89a8e5b4bd... |
cac29313-9357-418f-ae2d-b5cc83e01703 | arjun-holland/GFG | Difficulty: Medium/Longest String Chain/longest-string-chain.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
static bool sortBylength(string &a,string &b){
return a.length() < b.length();
}
int longestStringChain(vector<string>& words) {
// Code here
unordered_map<string,... | ALGO | 0.999727 | 5.905671 | {
"github_metadata": {
"branch": "main",
"commit_count": 418,
"repo_created_at": "2024-10-28T14:51: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": "90bf84f7ea... |
3ddccd1d-a0d7-41e0-b0b9-e2f12aa99eff | ishandutta2007/codeforces-m | molamola/normal/822/E.cpp | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <memory.h>
#include <math.h>
#include <assert.h>
#include <queue>
#include <map>
#include <set>
#include <string>
#include <algorithm>
#include <iostream>
#include <functional>
#include <unordered_map>
#include <unordered_set>
#include <list>
#include ... | ALGO | 0.999982 | 3.791441 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-06-06T01:03: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": "e08c45bb7584... |
69a1b8fd-e8e4-4a18-b75d-03f5044d6823 | pelagius2009/C-Primer-Plus-Solution | chapter16/16.7.cpp | //16.7.cpp
#include<iostream>
#include<algorithm>
#include<vector>
#include<chrono>
#include<random>
using std::vector;
using std::cout;
using std::cin;
using std::endl;
using std::string;
vector<int> lotto(int a, int b);
int main()
{
int max;
int num;
char choice;
vector<int> goodluck;
cout << "Would you like... | TOOL | 0.981171 | 3.850988 | {
"github_metadata": {
"branch": "master",
"commit_count": 36,
"repo_created_at": "2024-11-23T13:42:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "942f57bfa... |
f3b0bf2e-e49d-464a-aabb-6b93d3a290cb | BCAPATHSHALA/DSA-SUPREME-2-0-NOTES | DSA SUPREME 2.0 CODES/10. CLASS CODE/program04.cpp | // Program 04: Missing Number (Leetcode-268)
class Solution {
public:
int missingNumber(vector<int>& nums) {
int n=nums.size();
int sum = 0;
for(int i=0;i<n;i++){
sum+=nums[i];
}
int totalSum=(n*(n+1))/2;
int missingNum=totalSum-sum;
return miss... | ALGO | 0.999854 | 5.480806 | {
"github_metadata": {
"branch": "master",
"commit_count": 322,
"repo_created_at": "2023-08-28T06:24:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 235,
"forks": 86,
"issues": 1,
"pull_requests": 1
},
"file_meta": {
"content_id": "37b47... |
8d2bae2b-2820-4c40-883b-e350d659896b | Ak0000714/leetcode-DSA | 3306-count-of-substrings-containing-every-vowel-and-k-consonants-ii/3306-count-of-substrings-containing-every-vowel-and-k-consonants-ii.cpp | class Solution {
public:
bool isVowel(char ch) {
return (ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u');
}
long long countOfSubstrings(string word, int k) {
int n = word.length();
unordered_map<int, int> next;
int last = n;
for (int i = word.length() -... | ALGO | 0.99996 | 5.804336 | {
"github_metadata": {
"branch": "main",
"commit_count": 200,
"repo_created_at": "2024-12-10T15:25:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e87a668ab3... |
c7be64d1-c49e-4682-b5b5-a8814af0eb7c | raghavendrak/algebraic_MSF | ctf/mst.cxx | #include "mst.h"
Edge EdgeMin(Edge a, Edge b){
return a.weight < b.weight || (a.weight == b.weight && a.parent > b.parent) ? a : b;
}
void Edge_red(Edge const * a,
Edge * b,
int n){
#ifdef _OPENMP
#pragma omp parallel for
#endif
for (int i=0; i<n; i++){
b[i] = EdgeMin(a[i], b[i])... | ALGO | 0.999628 | 3.745235 | {
"github_metadata": {
"branch": "master",
"commit_count": 253,
"repo_created_at": "2021-12-15T00:20: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": "4de236ff... |
808bd501-1521-4dd5-8c87-ba1385e28b22 | Sachin1801/DSA_CPP_Leetcode_-_GFG | 0112-path-sum/0112-path-sum.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999985 | 5.72185 | {
"github_metadata": {
"branch": "main",
"commit_count": 1128,
"repo_created_at": "2024-11-22T14:27:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d72417788... |
32ce5c04-619a-4297-9dfd-f9769df4b026 | SaraToth/Problem-Solving-with-Cpp | chapter-2-programs/2-4.cpp |
// face value = 1,000
// interest rate = 15 percent
// length = 18 months
// Calculate interest/month: 1000 * 0.15
// 18 months / 12 in a year = 1.5
// Calculate 1.5 * interest -> total interest owed
// Face Value (1,000) - Total Interest Owed = person gets 775$
#include <iostream>
using namespace std;
int main(... | ALGO | 0.968721 | 3.906924 | {
"github_metadata": {
"branch": "main",
"commit_count": 29,
"repo_created_at": "2025-01-28T12:09: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": "7b035921c57... |
4dcfe361-71f5-4969-b17f-0512d24948ad | williamgherman/cpp-solutions | 03/01/1.21.cc | #include <iostream>
#include "Sales_data.h"
using std::cin;
using std::cout;
using std::endl;
int main()
{
double price;
Sales_data item1, item2;
cin >> item1.name >> item1.units_sold >> price;
item1.revenue = price * item1.units_sold;
cin >> item2.name >> item2.units_sold >> price;
item2.reve... | TOOL | 0.926832 | 5.115215 | {
"github_metadata": {
"branch": "master",
"commit_count": 92,
"repo_created_at": "2018-02-09T17:04:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 15,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "43b12fea... |
9a0bc686-903f-45a9-8720-f7d42401d540 | arthurherbout/crypto_code_detection | data/code-jam/files/1842485_jinlin_1484495_0_extracted_main.cc | #include <algorithm>
#include <cstdio>
using namespace std;
struct Student {
int r, i;
double x, y;
} s[2000];
bool cmpByR(const Student& sI, const Student& sII) {
return sI.r>sII.r;
}
bool cmpByI(const Student& sI, const Student& sII) {
return sI.i<sII.i;
}
int getE(int x) {
int i;
for(i=0; (1<<i)<x*2; ++i)... | ALGO | 0.999708 | 3.242198 | {
"github_metadata": {
"branch": "master",
"commit_count": 66,
"repo_created_at": "2019-09-20T18:35:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 4,
"issues": 10,
"pull_requests": 1
},
"file_meta": {
"content_id": "5e427757... |
0fa2e8d6-3510-4f84-9f55-fca48a0ee82b | hyxinchou/VOI2023 | VNOI/VNOI_CUP_VONG_1/vnoicup22_r1_b.cpp | #include <bits/stdc++.h>
using i64 = long long;
int main() {
using namespace std;
ios_base::sync_with_stdio(false); cin.tie(nullptr);
int N; cin >> N;
vector<int> A(N);
for (auto &a : A) {
cin >> a;
}
auto sub1 = [&]() -> void {
for (int i = 0; i < N; ++i) {
int ans = 0;
for (int j ... | ALGO | 0.999959 | 3.52227 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2022-07-03T02:16:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c0c2bcfbedbf... |
ed7d58fc-0554-41be-b500-e980ad7706ef | mAd-5864/SimDeserto | include/Caravanas/CaravanaSecreta.h | //
// Created by Pedro on 12/17/2024.
//
#ifndef SIMDESERTO_CARAVANASECRETA_H
#define SIMDESERTO_CARAVANASECRETA_H
#include "../Caravana.h"
class CaravanaSecreta : public Caravana {
// Podia ser uma caravana infiltrada que seguia os barbaros sem ser detetada
// Avisando os Militares para perseguir e os Mercad... | ALGO | 0.930312 | 6.056667 | {
"github_metadata": {
"branch": "main",
"commit_count": 99,
"repo_created_at": "2024-11-15T11:56: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": "9bc3bf5cbf3... |
66f0c274-54e2-4e58-8ee7-9feb358485ed | cyendra/ACM_Training_Chapter_One | Problem 1894 志愿者选拔/main.cpp | /** head-file **/
#include <iostream>
#include <fstream>
#include <sstream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <list>
#include <set>
#include <map>
#include <algorithm>
/** define-for **/
#define REP(... | ALGO | 0.996931 | 3.122809 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2013-11-17T08:33:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8beba27bf2... |
a6fa6629-8683-4ead-a1d7-32457b96112d | lee-honey/CodingTest-Study | 03주차/괄호 회전하기/hyeonwoo.cpp | #include <string>
#include <vector>
#include <stack>
using namespace std;
int solution(string s) {
int answer = 0;
bool isWrong = false;
stack<char> st;
for (int n = 0; n < s.size(); n++) {
while (!st.empty())st.pop();
isWrong = false;
for (int i = 0; i < s.size(); i++) {
... | ALGO | 0.997928 | 4.294697 | {
"github_metadata": {
"branch": "master",
"commit_count": 471,
"repo_created_at": "2023-05-19T06:10:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2e704cca... |
b25264c6-1334-4a00-98eb-8887c1653a4a | CGAL/cgal | Intersections_3/include/CGAL/Intersections_3/internal/Plane_3_Ray_3_intersection.h | // Copyright (c) 1997-2010
// Utrecht University (The Netherlands),
// ETH Zurich (Switzerland),
// INRIA Sophia-Antipolis (France),
// Max-Planck-Institute Saarbruecken (Germany),
// and Tel-Aviv University (Israel). All rights reserved.
//
// This file is part of CGAL (www.cgal.org)
//
// $URL$
// $Id$
// SPDX-Licen... | ALGO | 0.973193 | 7.129722 | {
"github_metadata": {
"branch": "master",
"commit_count": 113659,
"repo_created_at": "2014-10-01T12:22:47.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 5443,
"forks": 1475,
"issues": 511,
"pull_requests": 136
},
"file_meta": {
"content_id... |
3c26f614-b049-45a0-8436-3e6b94b87aa6 | fujis/numerical | src/rootfinding/bisection.cpp | /*!
@file bisection.cpp
@brief 二分法による求根問題の解法
@author <NAME>
@date 2012-06,2019-09
*/
//-----------------------------------------------------------------------------
// インクルードファイル
//-----------------------------------------------------------------------------
#include "rx_utils.h"
#include "rx_funcs.h"
... | ALGO | 0.999943 | 5.445542 | {
"github_metadata": {
"branch": "master",
"commit_count": 170,
"repo_created_at": "2019-09-12T08:42:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 14,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c67b916... |
1b45ec5f-9dbb-416a-a1e5-b578696ac6ba | swiftqwq/code | 2021.1.31/la.cpp | #include <bits/stdc++.h>
#define int long long
#define MOD 998244353
using namespace std;
int qpow(int a, int b, int tmp = 0) { return b ? ((tmp = qpow(a, b / 2)) * 0 + b % 2 ? tmp * tmp % MOD * a % MOD : tmp * tmp % MOD) : 1; }
int inv(int x) { return qpow(x, MOD - 2); }
int n, k, x[10000], y[10000];
signed main()
{
... | ALGO | 0.999963 | 5.304049 | {
"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": "980bbe452... |
d4a3893d-e889-44b7-b7f3-2e2f8cd70ac0 | reMarkable/cobalt | algorithms/rappor/rappor_analyzer.h | // Copyright 2017 The Fuchsia Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed... | ALGO | 0.991233 | 7.806551 | {
"github_metadata": {
"branch": "master",
"commit_count": 698,
"repo_created_at": "2018-07-31T17:56:17.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e20a2496c... |
bf4d4b8f-762b-42b3-be4e-2b544ba7ae20 | picantitoDev/ordenamiento-y-busqueda | Simulaciones Paradigmas/gnomeSort.cpp | #include "raylib.h"
#define ScreenWidth 1200
#define ScreenHeight 800
#define minScreenWidth 500
#define minScreenHeight 800
#define FPS 60
#define NUM_BARS 100
#define SORT_STEPS_PER_FRAME 3 // Número de pasos de ordenamiento por fotograma
int GnomeSortStep(int array[], int size, int index);
int main() {
//... | ALGO | 0.999806 | 5.474617 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2024-06-09T06:31: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": "9d7732211bd2... |
a8989be0-3594-4c4b-83f3-fdf428243395 | Zoanie/repository | merge-k-sorted-lists/src/merge-k-sorted-lists.cpp | //============================================================================
// Name : merge-k-sorted-lists.cpp
// Author : <NAME>
// Version :
// Copyright : I'll have 2 number 9s
// Description : https://leetcode.com/problems/merge-k-sorted-lists/
//================================================... | ALGO | 0.999037 | 5.966712 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2021-08-13T02:16: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": "5c68161cb4... |
75f7859f-28bb-4515-97e7-275419dd33fc | vkinakh/OpenCV | C++/05. Take DFT of grayscaled image/main.cpp | #include<opencv2\opencv.hpp>
// Define functions for creating DFT of image
void recenterDFT(cv::Mat& source);
void takeDFT(cv::Mat& source, cv::Mat& output);
void showDFT(cv::Mat& source);
// Function for creating DFT of image
void takeDFT(cv::Mat& source, cv::Mat& output)
{
cv::Mat origComplex[2] = { source, cv::M... | ALGO | 0.989885 | 5.16749 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2017-06-22T21:06: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": "833226dea8... |
48c3e5a4-9176-46e9-8889-760eef840fb2 | riteme/test | oi/cogs/P313/spo.cpp | #include <cstdio>
#include <cstring>
#include <cstdlib>
#include <climits>
#include <vector>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
using namespace std;
inline int readint() {
int x = 0;
char c = getchar();
while (c < '0' || c > '9')
c = getchar();
while ('0' ... | ALGO | 0.999998 | 4.01792 | {
"github_metadata": {
"branch": "master",
"commit_count": 550,
"repo_created_at": "2015-04-26T07:16:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 7
},
"file_meta": {
"content_id": "1ab84c94... |
3ef1fc8f-831e-47a7-9833-4a33dbce578d | ishandutta2007/codeforces-r | realcomplex/normal/1055/E.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll ;
typedef pair<ll, ll> pii;
typedef double db;
#define fi first
#define se second
#define mp make_pair
#define fastIO ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
int n, s, m, k;
const int N = 1505;
int a[N];
int b[N];
int rig[N];
int dp[N]... | ALGO | 0.999951 | 3.59355 | {
"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": "e7cc0e63f508... |
8fa83094-699d-4fd5-85c5-b904e5c7ac93 | nishitsharma03/Competitive_Programming | codeforces/1382/D.cpp | //#pragma GCC optimize "trapv"
#pragma GCC optimize("O3", "unroll-loops")
#pragma GCC target("avx2")
#include<bits/stdc++.h>
#define ll long long int
#define fab(a,b,i) for(int i=a;i<b;i++)
#define pb push_back
#define db double
#define mp make_pair
#define endl "\n"
#define f first
#define se second
#define all(x) x.b... | ALGO | 0.999781 | 4.142014 | {
"github_metadata": {
"branch": "master",
"commit_count": 639,
"repo_created_at": "2020-12-24T09:57:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "360270ce... |
4febecd3-c5de-4673-b05c-1ffebe2ba525 | KratosTheOne/DSA-Practice | 355-design-twitter/355-design-twitter.cpp | //T.C & S.C -> O(n)
class Twitter {
public:
// to store who each user is following
unordered_map<int, unordered_set<int>> followers;
// to store every tweet made
stack<pair<int, int>> global;
Twitter() {
}
void postTweet(int userId, int tweetId) {
// add twee... | ALGO | 0.999665 | 6.195423 | {
"github_metadata": {
"branch": "main",
"commit_count": 641,
"repo_created_at": "2022-01-11T08:09: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": "cfcf19d4ea... |
a226f1d3-2315-4996-9b45-85964cfec9a7 | lgtcreateworld/DS | Lab1/City/CityList.cpp | #include "CityList.h"
CityList::CityList() {
head = new City;
if (nullptr == head)
std::cout << "new error!" << std::endl;
}
void CityList::refresh() {
City* pCity = head;
int cnt = 1;
while (pCity != nullptr) {
if (cnt == 1) {
std::cout << "列表中的城市有:" << std::endl;
std::cout << cnt << ": " << pCity->getN... | TOOL | 0.942967 | 4.059762 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-11-08T13:48:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "77a6da279b... |
deae2bf4-9b56-4b26-939b-01c8c1b9f3e2 | DaleStudy/leetcode-study | word-search/obzva.cpp | /**
* 풀이
* - dfs와 backtracking을 이용하여 풀었습니다
*
* Big-O
* - M: 주어진 grid `board`의 행 수
* - N: 주어진 grid `board`의 열 수
* - W: 주어진 string `word`의 size
*
* - Time complexity: O(M * N * 3 ^ W)
* - `exist`함수가 grid 원소 모두를 조회합니다 -> O(M * N)
* - 만약 `dfs`함수가 실행될 경우, 해당 함수는 최대 3방향에 대해 재귀호출을 실행합니다 (이전 좌표로는 `dfs`를 호출하지 않... | ALGO | 0.999914 | 6.278885 | {
"github_metadata": {
"branch": "main",
"commit_count": 8009,
"repo_created_at": "2024-04-19T01:20:27.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 121,
"forks": 227,
"issues": 75,
"pull_requests": 18
},
"file_meta": {
"content_id": "6760... |
3c477d0e-b057-40c2-9bbf-21dbb41ec6b6 | pcentieiro/midian | Face Recognition Library/ThirdParty/OpenCV/modules/gpu/src/match_template.cpp | /*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, instal... | ALGO | 0.942179 | 6.466473 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2012-03-29T01:05:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 41,
"forks": 11,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "42348de... |
54dea70c-d56c-40e8-b2af-4523e8b4b14b | meltanrm/Cable-Robot | Prototype_Cable_Robot_Code/Prototype_Cable_Robot_Code.ino | // set serial monitor settings (newline --> no line ending)
const int dirPinB = 6; // motor B
const int stepPinB = 7;
const int dirPinD = 8; // motor D spool
const int stepPinD = 9;
const int dirPinA = 10; // motor A
const int stepPinA = 11;
const int dirPinC = 12; // motor C
const int stepPinC = 13;
const int stepsPe... | TOOL | 0.934464 | 5.801742 | {
"github_metadata": {
"branch": "main",
"commit_count": 118,
"repo_created_at": "2022-01-27T14:18: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": "57a06b137a... |
5ec976b5-732c-45e1-8b63-caa19a370587 | reiniermujica/algorithms-and-contests | SPOJ/NHAY.CPP | /*
<NAME>
17 - 11 - 2008
String Matching ( Kmp )
*/
#include <cstdio>
using namespace std;
const int
MAXN = 1000005;
int N;
int i, k;
int pkmp[MAXN];
char need[MAXN], s;
int main() {
while ( scanf( "%d\n", &N ) != EOF ) {
/* pre KMP for needle pattern */
gets( need + 1 ); k = 0;
for ( i = 2; i <= N;... | ALGO | 0.999674 | 3.091649 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2018-06-24T22:17:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9607d86736... |
a65d6285-9a26-4f69-86c0-b48927dc8df7 | apache/incubator-retired-quickstep | third_party/src/tmb/src/tmb_net_server.cc | /**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you... | CONFIG | 0.972551 | 7.740519 | {
"github_metadata": {
"branch": "master",
"commit_count": 970,
"repo_created_at": "2016-04-14T07:00:07.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 95,
"forks": 64,
"issues": 0,
"pull_requests": 4
},
"file_meta": {
"content_id": "9d8db5b... |
aaf39dd0-d6ec-42de-a274-058809a4583c | bnuq/My_Modern_Cpp | 11_File_Input_and_Output/126 Assignment 2.cpp | /*
Copying binary files and directories
*/
#include <iostream>
#include <fstream>
#include <string>
#include <filesystem>
#include <exception>
using namespace std::filesystem;
void Copy(const path&, const path&);
// path = file path, binary file 을 복사 위한 사전 준비
void CopyFileInDirectory(const path& fileName) {
path... | TOOL | 0.923795 | 5.492236 | {
"github_metadata": {
"branch": "main",
"commit_count": 42,
"repo_created_at": "2022-01-17T09:15: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": "ad85aad598b... |
205b3e54-57fa-48e8-87c4-2df7a2c55555 | AndresGaibor/cpp | investigacion-listas/03.cpp | /**
* Ingresar una lista y modificar sus valores, sumando a cada uno la cantidad de dígitos que posee
* Autor: <NAME>
*/
#include <iostream>
#include "lista.h"
#define EXT 99
#define FIN 99999
using namespace std;
void ingresarNumeros(Lista *lista)
{
int valor;
cout << "Ingrese un numero (SALGA CON " <... | ALGO | 0.993347 | 4.424831 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2023-04-10T14:52:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3e99242ad6b... |
882da553-b6e8-4815-85e5-5ddf92666008 | sushil2817/DSA-in-CPP | DSA2025/Array/array.cpp | #include<iostream>
using namespace std;
int main(){
// array creation
// int arr[101];
// char ch[20];
// bool flags[10];
// long num[900];
// short s[1000];
// cout<<"array created successfully"<<endl;
// int a = 5;
// cout<<"Address of a : "<<&a <<endl;
// cout<<"Size of a ... | ALGO | 0.999058 | 3.813413 | {
"github_metadata": {
"branch": "main",
"commit_count": 177,
"repo_created_at": "2024-03-20T07:42:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c46b85651d... |
da20f334-2ce5-4eaa-b490-27b1aecb785b | mayanksinha963/DSA | input/practice/transform_uppercase_lowercase_string.cpp | #include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main(int argc, char const *argv[])
{
cout << "Enter the 1 for converting into Upper Case... and 2 for in lower case" << endl;
int num;
cin >> num;
string str;
cin >> str;
for (int i = 0; i < str.length(); i++)
... | ALGO | 0.998706 | 4.294527 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2023-05-11T10:17: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": "35e7f6e94... |
2b73669e-ef7e-4b51-85a4-5b9e63cc1560 | woohyunjng/Coding-Practice | CP/Atcoder/ABC 371/A.cpp | #include <bits/stdc++.h>
#define int long long
#define MAX 200100
#define MOD 1000000007
#define INF 0x7f7f7f7f7f7f7f7f
#define endl '\n'
using namespace std;
typedef pair<int, int> pr;
typedef array<int, 3> tp;
bool arr[3][3];
signed main() {
ios_base::sync_with_stdio(false);
cin.tie(0), cout.tie(0);
... | ALGO | 0.999968 | 3.510118 | {
"github_metadata": {
"branch": "main",
"commit_count": 485,
"repo_created_at": "2022-06-04T14:40: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": "5233b0295c... |
de6c9d92-49b8-4dab-b591-67e586466a00 | pemesteves/AdventOfCode2020 | Day11/part1.cpp | #include <fstream>
#include <iostream>
#include <vector>
#include <string>
#include <set>
using namespace std;
int main() {
ifstream f;
f.open("input.txt");
vector<string> seats;
string line;
while(!f.eof()) {
getline(f, line);
seats.push_back(line);
}
f.close();
bo... | ALGO | 0.999714 | 5.309659 | {
"github_metadata": {
"branch": "main",
"commit_count": 26,
"repo_created_at": "2020-12-01T20:21: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": "49afe857244... |
b0f364aa-0717-4073-a68f-658aacd2f304 | nevikw39/oj | ap325/d113.cpp | /** _ _ _____ ___
* _ __ _____ _(_) | ____ _|___ // _ \
* | '_ \ / _ \ \ / / | |/ /\ \ /\ / / |_ \ (_) |
* | | | | __/\ V /| | < \ V V / ___) \__, |
* |_| |_|\___| \_/ |_|_|\_\ \_/\_/ |____/ /_/
**/
#include <bits/extc++.h>
#include <bits/stdc++.h>
#ifndef nevikw3... | ALGO | 0.999967 | 3.947934 | {
"github_metadata": {
"branch": "master",
"commit_count": 2018,
"repo_created_at": "2020-02-22T14:59:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 13,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "63e863... |
b49ac419-f797-4f86-86d4-d5f76bdfe423 | ethz-adrl/control-toolbox | ct_optcon/examples/ConstraintExampleOutput.cpp | /**********************************************************************************************************************
This file is part of the Control Toolbox (https://github.com/ethz-adrl/control-toolbox), copyright by ETH Zurich.
Licensed under the BSD-2 license (see LICENSE file in main directory)
****************... | ALGO | 0.969831 | 5.797083 | {
"github_metadata": {
"branch": "v3.0.2",
"commit_count": 1871,
"repo_created_at": "2019-04-25T21:55:23.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1596,
"forks": 332,
"issues": 59,
"pull_requests": 4
},
"file_meta": {
"content_id": "93... |
6857a460-1c39-48a9-9429-afe38ea2b520 | checkoutb/LeetCodeCCpp | ge1600/LT1684_Count_the_Number_of_Consistent_Strings.cpp |
#include "../header/myheader.h"
class LT1684
{
public:
// D D
// for (auto ch : allowed)
// ++cnt[ch - 'a'];
// for (auto &w : words)
// res += all_of(begin(w), end(w), [&](char ch){ return cnt[ch - 'a'];});
//Runtime: 88 ms, faster than 60.00% of C++ online submissions for Count the Number... | ALGO | 0.999853 | 4.704515 | {
"github_metadata": {
"branch": "master",
"commit_count": 285,
"repo_created_at": "2019-04-22T09:20:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c5913cc6... |
9c289f5b-8ddb-453f-85a3-d4b96925b954 | zjg540066169/SBMTrees | SBMTrees.Rcheck/00_pkg_src/SBMTrees/src/BART/rand_draws.cpp | /*
* BART: Bayesian Additive Regression Trees
* Copyright (C) 2017 <NAME>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) an... | ALGO | 0.998822 | 3.158879 | {
"github_metadata": {
"branch": "main",
"commit_count": 193,
"repo_created_at": "2024-05-15T01:03: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": "aa1f56d235... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.