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 |
|---|---|---|---|---|---|---|---|
964b45d5-cf13-4aa8-a371-363226f4111c | buaa-hipo/DynVec-artifact | spmv/spmv_mkl/csr_spmv_simd.cpp | #include "immintrin.h"
#include "csr_matrix.h"
#include "csr_analyse.h"
#include "csr_spmv_simd.h"
#include <stdio.h>
void csc_spmv(const csrSparseMatrixPtr matrix , const double * x , double * y ) {
const int column_num = matrix->column_num;
const int row_num = matrix->row_num;
const int data_num = matrix-... | ALGO | 0.998917 | 3.497151 | {
"github_metadata": {
"branch": "main",
"commit_count": 23,
"repo_created_at": "2022-01-12T03:25:42.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 7,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e5dfc3465455... |
475324e7-44b7-4165-b10c-6874d82d4e8e | All8Up/cpf | Cpf/Libraries/Platform/Math/Include/Math/Detail/Vector2v.inl | //////////////////////////////////////////////////////////////////////////
#pragma once
namespace CPF
{
namespace Math
{
template <typename TYPE>
Vector2v<TYPE>::Vector2v()
{}
template <typename TYPE>
Vector2v<TYPE>::Vector2v(typename TYPE::LaneType value)
: mSIMD(value)
{}
template <typename TYPE... | TOOL | 0.956116 | 7.238336 | {
"github_metadata": {
"branch": "master",
"commit_count": 623,
"repo_created_at": "2017-02-13T16:18:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 16,
"pull_requests": 0
},
"file_meta": {
"content_id": "86b14ae... |
026b31ee-fbc1-4514-bbbc-62df675750c9 | solareenlo/atcoder | 05_AtCoder-Beginner-Contest/abc133/B/main.cpp | #include <iostream>
#include <cmath>
#include <vector>
#define REP(i, n) for (int i = 0; i < (n); i++)
using namespace std;
void solve(long long N, long long D, std::vector<std::vector<long long>> X){
int count = 0;
REP(i, N-1) {
for (int j = i+1; j < N; j++) {
double dist = 0.0;
... | ALGO | 0.999794 | 3.804035 | {
"github_metadata": {
"branch": "main",
"commit_count": 256,
"repo_created_at": "2020-11-30T21:16:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d6610c5507... |
feb38928-2572-40c8-a36b-3ce44bc7a943 | vsdmitri/ray-tracing | src/Distributions/TriangleDistribution.cpp | #include "TriangleDistribution.h"
glm::dvec3
TriangleDistribution::sample(const glm::dvec3 &x, const glm::dvec3 &, RandomGenerator &r, bool) const {
double u = r.get_random_float(), v = r.get_random_float();
if (u + v >= 1) {
u = 1 - u;
v = 1 - v;
}
glm::dvec3 result = triangle_->a_ + ... | ALGO | 0.931982 | 6.817592 | {
"github_metadata": {
"branch": "main",
"commit_count": 25,
"repo_created_at": "2024-02-17T09:39: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": "9290d604e05... |
6ed79653-fd15-4128-addb-eea228c4975a | shunsuke00/Lattice | AxionInflation/axion-U(1)/initialize.cpp | /* This file implements important function "initialize_ax()" and "initialize_gf()" */
#include "latticeeasy.hpp"
#include <random>
// Generating [0,1] random number using the Park-Miller algorithm
#define randa 16807
#define randm 2147483647
#define randq 127773
#define randr 2836
double rand_uniform(void)
{
if(se... | ALGO | 0.993584 | 3.296219 | {
"github_metadata": {
"branch": "main",
"commit_count": 42,
"repo_created_at": "2025-01-27T03:28: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": "070cea63679... |
a397cb84-0027-41ff-bbd2-070d8e12d121 | Wonsei12/BOJ | 20668.cpp | #define LOCAL
#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("avx,avx2")
#define IOS ios::sync_with_stdio(false);cin.tie(0)
#define all(x) x.begin(), x.end()
#define ff first
#define ss second
#define LLIN... | ALGO | 0.999968 | 3.671816 | {
"github_metadata": {
"branch": "master",
"commit_count": 24,
"repo_created_at": "2021-01-15T12:43: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": "8cf01939c... |
00c12403-f8b4-446a-a97d-61434e71362c | kassonlab/gmxapi | src/gromacs/linearalgebra/gmx_lapack/dlasd2.cpp | #include <cmath>
#include "../gmx_blas.h"
#include "../gmx_lapack.h"
#include "lapack_limits.h"
#include "gromacs/utility/real.h"
void
F77_FUNC(dlasd2,DLASD2)(int *nl,
int *nr,
int *sqre,
int *k,
double *d__,
... | ALGO | 0.999097 | 4.463343 | {
"github_metadata": {
"branch": "master",
"commit_count": 19315,
"repo_created_at": "2017-05-25T14:05:14.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 53,
"forks": 13,
"issues": 93,
"pull_requests": 2
},
"file_meta": {
"content_id": "1a83... |
e2789be0-283f-4cf9-b3d8-3a568b9d16e6 | navneetk2001/CPP_Programs | Geeks for Geeks/Problem of the Day GFG/200. QuickSort on Doubly Linked Lis.cpp | https://practice.geeksforgeeks.org/problems/quicksort-on-doubly-linked-list/1
//Solution Approach :- USING HOARE PARTITION
Node* partition(Node *l, Node *h)
{
Node *pivot=l;
Node *left=l;
Node *right=h;
while(true){
while(left != NULL && pivot->data > left->data){
left=lef... | ALGO | 0.999992 | 5.252496 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2022-02-14T06:01:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1ca463bead... |
ec759687-c987-4189-a25f-2c4cf1b8481b | MihkuU/Lible | src/lible/ints/twoel/shark_mm_kernels/shark_mm_kernels_braket_1_2.cpp | #include <lible/ints/twoel/shark_mm_kernels.hpp>
template<> void lible::ints::shark_mm_bra2<0, 1, 0, 2>(const double *E, const double *R_x_ET, double *E_x_R_x_ET)
{
E_x_R_x_ET[0] += E[0] * R_x_ET[0];
E_x_R_x_ET[0] += E[3] * R_x_ET[15];
E_x_R_x_ET[1] += E[0] * R_x_ET[1];
E_x_R_x_ET[1] += E[3] * R_x_ET[1... | ALGO | 0.966939 | 4.572781 | {
"github_metadata": {
"branch": "main",
"commit_count": 272,
"repo_created_at": "2023-06-25T17:02: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": "604d315fd1... |
015b2844-4fff-4a60-8864-ef92c6d5ad7f | SrB30/Competitive-Programming | SPOJ/MULTQ3 - Multiples of 3.cpp | #include <bits/stdc++.h>
using namespace std;
#define Size 100005
struct vert
{
int cnt[3];
int prop;
};
vert tree[Size*4];
void build_tree(int cur,int Start,int End)
{
if(Start == End)
{
tree[cur].cnt[0] = 1;
tree[cur].cnt[1] = 0;
tree[cur].cnt[2] = 0;
tree[cur].prop =... | ALGO | 0.999914 | 4.269087 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2018-11-15T03:50: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": "dcd652600f... |
feaec242-d8d7-4a6d-93c6-ba6131c45c0a | Covariance/itmo-ct-y19 | algo-ds/term1/lab/4/K.cpp | #include <bits/stdc++.h>
#define fs first
#define sc second
using namespace std;
bool debug = false;
const int mod = 1e9;
void javaMod(int* a) {
*a = (*a < 0 ? (*a + ((abs(*a) + mod - 1) / mod) * mod) : *a) % mod;
}
int main() {
int n;
cin >> n;
vector<int> arr(n, 0);
vector<vector<int>> d(n, ve... | ALGO | 0.999979 | 4.041083 | {
"github_metadata": {
"branch": "master",
"commit_count": 393,
"repo_created_at": "2022-02-26T18:25:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "52d1284d... |
69a7d7d8-4f93-4297-966e-e45df66ba95a | ankitksh81/Trees | Right_view_BT.cpp | // Right view of a binary tree using traversal: root->right->left
/**
* 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) {}
... | ALGO | 0.999856 | 6.46123 | {
"github_metadata": {
"branch": "main",
"commit_count": 49,
"repo_created_at": "2021-08-21T13:00:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "61aa306f0bb... |
0ea945c8-3cee-499b-8901-a28f8c538d11 | DonLakeFlyer/matlab-coder-utils | coder-headers/nav/mclcodegen_api.hpp | /* Copyright 2019-2020 The MathWorks, Inc. */
/**
* @file
* External C-API interfaces for Adaptive Monte Carlo Localization (AMCL).
* To fully support code generation, note that this file needs to be fully
* compliant with the C89/C90 (ANSI) standard.
*/
#ifndef MCLCODEGEN_API_H_
#define MCLCODEGEN_API_H_
#ifde... | TOOL | 0.980179 | 6.408547 | {
"github_metadata": {
"branch": "master",
"commit_count": 36,
"repo_created_at": "2023-02-18T20:55:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "c2e345814... |
71091d57-f8aa-4a42-9d8d-f66924f093a5 | victoritis/Gestion_de_Empresas | Practica_Competitiva/main.cpp | #include <fstream>
#include <vector>
#include <string>
#include <sstream>
#include <iostream>
#include <numeric>
#include <algorithm>
#include <random>
#include <filesystem>
#include <omp.h>
std::vector<int> generarPermutacionInicial(const std::vector<std::vector<int>>& Dij) {
size_t n = Dij.size();
std::vecto... | ALGO | 0.999989 | 5.789315 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2023-10-31T12:32: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": "62f7c18560c... |
bdba9fc7-fd65-482b-a5fb-eb775c2639eb | tuanle03/CodeTumLum | OOP/Phân Số/Phân Số/main.cpp | //#include <bits/stdc++.h>
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <cstdio>
#include <cmath>
#include <vector>
#include <cstring>
#include <queue>
#include <set>
#include <stack>
#include "PhanSo.h"
#define TuanLe ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define NAME ""
... | ALGO | 0.99981 | 4.882247 | {
"github_metadata": {
"branch": "main",
"commit_count": 43,
"repo_created_at": "2022-06-08T17:33:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "fb1112ed16f... |
a93f0925-6e72-4350-b574-f78143a98042 | minhaz1217/My-C-Journey | 0. Vision 2019/_10. October/accepted/uva_12626 - I Love Pizza_AC.cpp | /*
<NAME>
minhaz1217.github.io
Website: www.minhazul.com
EWU, Bangladesh
Problem Name:
Problem Link: https://onlinejudge.org/external/126/12626.pdf
Date : 28 / October / 2019
Comment: easy problem.
*/
#include<bits/stdc++.h>
//#include<iostream>
using namespace std;
#define DEBUG 1
#define check(a) DEBUG==1?(cout << a ... | ALGO | 0.999774 | 4.471989 | {
"github_metadata": {
"branch": "master",
"commit_count": 365,
"repo_created_at": "2018-12-07T07:32:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cb72a4e4... |
494307f1-4c46-47a6-b474-5b788e688964 | arash-ha/Cpp | Map Sum Pairs.cpp | /*
Map Sum Pairs
Implement the MapSum class:
MapSum() Initializes the MapSum object.
void insert(String key, int val) Inserts the key-val pair into the map. If the key already existed, the original key-value pair will be overridden to the new one.
int sum(string prefix) Returns the sum of all the pairs' value whose ke... | ALGO | 0.999361 | 6.533092 | {
"github_metadata": {
"branch": "master",
"commit_count": 982,
"repo_created_at": "2019-10-02T15:30: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": "caefadc9... |
053ed021-ad0e-409e-be6b-b2350cc5f806 | OAAX-standard/hailo-acceleration | runtime-library/deps/hailort/hailort-4.19.0/hailort/libhailort/examples/cpp/vstreams_example/vstreams_example.cpp | /**
* Copyright (c) 2020-2022 Hailo Technologies Ltd. All rights reserved.
* Distributed under the MIT license (https://opensource.org/licenses/MIT)
**/
/**
* @file vstreams_example
* This example demonstrates using virtual streams over c++
**/
#include "hailo/hailort.hpp"
#include <iostream>
#include <thread>
... | TOOL | 0.90595 | 6.217548 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2024-11-11T09:11:18.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "248187b89fac... |
74d47c6a-9feb-4a62-950e-4d21c6f4a877 | miyajiro/competitive_programming | atcoder/abc201/f/f.cpp | #include <bits/stdc++.h>
#include <atcoder/all>
#define fr first
#define sc second
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep1(i, n) for (int i = 1; i <= (n); ++i)
#define rrep(i, n) for (int i = (n)-1; i >= 0; --i)
#define rrep1(i, n) for (int i = (n); i >= 1; --i)
#define srep(i, s, t) for (int i = s... | ALGO | 0.999805 | 4.269053 | {
"github_metadata": {
"branch": "main",
"commit_count": 499,
"repo_created_at": "2020-06-20T09:19:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 3
},
"file_meta": {
"content_id": "3d05dae006... |
51a5e9f4-e845-451b-afdf-7e1cd52ee1a6 | yzliang/usaco | chap1/clocks.cc | /*
ID: liangyi1
LANG: C++
TASK: clocks
*/
#include <cstring>
#include <fstream>
#include <iostream>
using namespace std;
int clocks[12];
int times[9], best_times[9];
int ans = 3 * 9 + 1;
void search(int move, int num_steps) {
if (num_steps >= ans) return;
if (move == 9) {
ans = num_steps;
memcpy(best_tim... | ALGO | 0.999959 | 3.594796 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2013-07-06T14:45: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": "0d71ac101... |
5f2b400f-cb17-41a2-9377-e0a61992df00 | FRCTeam16/TMW2021 | src/main/cpp/Autonomous/Steps/2021/PathFinderStep.cpp | #include "Autonomous/Steps/2021/PathFinderStep.h"
#include "Robot.h"
bool PathFinderStep::Run(std::shared_ptr<World> world)
{
// Check for end condition
if (targets.empty() && finishedPath)
{
std::cout << "Pathfinder empty, exiting";
return true; // Finished with step
}
// Handl... | TOOL | 0.997581 | 5.56786 | {
"github_metadata": {
"branch": "main",
"commit_count": 70,
"repo_created_at": "2021-01-16T13:40:47.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8a4707b14843... |
984821d2-f7bf-4f78-b483-10c734209a1d | CAS-Atlantic/vtr-verilog-to-routing | vpr/src/place/compressed_grid.h | #ifndef VPR_COMPRESSED_GRID_H
#define VPR_COMPRESSED_GRID_H
#include "physical_types.h"
#include "vtr_geometry.h"
#include "vtr_flat_map.h"
struct t_compressed_block_grid {
// The compressed grid of a block type stores only the coordinates that are occupied by that particular block type.
// For instance, if ... | TOOL | 0.914642 | 6.998758 | {
"github_metadata": {
"branch": "master",
"commit_count": 19495,
"repo_created_at": "2019-06-17T14:43:37.000Z",
"is_fork": true,
"is_org_owned": true,
"forked_from": "verilog-to-routing/vtr-verilog-to-routing",
"stars": 4,
"forks": 1,
"issues": 0,
"pull_requests": 2
},
"fi... |
ff50133e-346c-4f8b-b25c-a93185e28e61 | GuruMukhPrajapati/C-PLUS-PLUS | c++/calss_practic/matrix_multi.cpp | #include <iostream>
using namespace std;
int main() {
int matrix1[2][2] = {{1, 2}, {3, 4}};
int matrix2[2][2] = {{5, 6}, {7, 8}};
int result[2][2] = {{0, 0}, {0, 0}};
// Multiply the matrices
for (int i = 0; i < 2; ++i) {
for (int j = 0; j < 2; ++j) {
for (int k = 0; k < 2; ++k... | ALGO | 0.99989 | 5.433791 | {
"github_metadata": {
"branch": "main",
"commit_count": 60,
"repo_created_at": "2023-05-18T13:01: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": "d6f1ba2c1ba... |
b004cbff-5868-4705-b928-be7fc0a72b7d | jonbaraq/uva_problems | uva/572.cc | #include <cmath>
#include <iostream>
#include <queue>
#include <vector>
using namespace std;
struct Point {
int x;
int y;
Point(int x, int y) : x(x), y(y) {}
};
bool AllVisited(const vector<bool>& visited) {
for (int i = 0; i < visited.size(); ++i) {
if (!visited[i]) {
return false;
}
}
ret... | ALGO | 0.999426 | 5.003616 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2015-10-07T04:37: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": "38c09fc41... |
345a4b5a-5a5e-446a-82a8-66bd0243a8f3 | 101magikarp101/USACO | cc-141/E.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define MOD 998244353
#define MOD2 1000000007
#define vt vector
struct pii {int x, y;};
struct pll {ll x, y;};
int T, N;
int a[200005];
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cin >> T;
while (T--) {
cin >> N;
... | ALGO | 0.999864 | 4.420706 | {
"github_metadata": {
"branch": "main",
"commit_count": 66,
"repo_created_at": "2024-09-25T15:08: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": "701ca994f78... |
281b46d1-cd98-4a02-87fa-f7d1a3198277 | TanmayMishra4/Competitive-Coding | Allocation.cpp | #include <bits/stdc++.h>
/******* All Required define Pre-Processors and typedef Constants *******/
#define SCD(t) scanf("%d",&t)
#define SCLD(t) scanf("%ld",&t)
#define SCLLD(t) scanf("%lld",&t)
#define SCC(t) scanf("%c",&t)
#define SCS(t) scanf("%s",t)
#define SCF(t) scanf("%f",&t)
#define SCLF(t) scanf("%lf",&t)
#d... | ALGO | 0.99997 | 3.850626 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2021-08-16T15:06: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": "6decea49de1... |
4eedb77e-5c69-405f-848d-cb6866c1335c | erleben/OpenTissue | OpenTissue/core/math/big/big_backsolve.h | #ifndef OPENTISSUE_CORE_MATH_BIG_BIG_BACKSOLVE_H
#define OPENTISSUE_CORE_MATH_BIG_BIG_BACKSOLVE_H
//
// OpenTissue Template Library
// - A generic toolbox for physics-based modeling and simulation.
// Copyright (C) 2008 Department of Computer Science, University of Copenhagen.
//
// OTTL is licensed under zlib: http://... | ALGO | 0.999713 | 5.334991 | {
"github_metadata": {
"branch": "master",
"commit_count": 78,
"repo_created_at": "2018-02-11T18:06:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 101,
"forks": 28,
"issues": 14,
"pull_requests": 0
},
"file_meta": {
"content_id": "39ef9... |
883a87d0-ce65-4396-972f-9cb69e000ba6 | ran-extern/Kickstart | smallerstring.cpp | /*You are given an integer K and a string S of length N, consisting of lowercase letters from the first K letters of the English alphabet. Find the number of palindrome strings of length N which are lexicographically smaller than S and consist of lowercase letters from the first K letters of the English alphabet.
A st... | ALGO | 0.99998 | 5.332273 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2021-07-23T10:02: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": "5fe52d216bf... |
5686ecb6-3d42-465e-9321-bc700c7dff91 | GaelReinaudi/arduino-bird-cage | clickDoors/clickDoors.ino | #include <Servo.h>
Servo servoLeft;
Servo servoFront;
const int pinServoLeft = 2;
const int pinServoFront = 3;
const int buttonPin = 15;
const int ledPin = 16;
const int posLeftOpen = 10;
const int posLeftClose = 195;
const int posFrontOpen = 195;
const int posFrontClose = 10;
const int posRefMax = 100;
int pos ... | TOOL | 0.968407 | 4.540822 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2018-06-24T02:42: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": "9687f9af04... |
4de17167-bb38-411b-bfad-9e83aa223f5c | yang48699997/code | exercise/2024holiday/daily-task1.0/0718/Red_Playing_Cards.cpp | #include <bits/stdc++.h>
using namespace std;
void solve() {
int n;
cin >> n;
vector<int> a(n * 2);
vector<vector<int>> pos(n);
for (int i = 0; i < n * 2; i++) {
cin >> a[i];
pos[a[i] - 1].push_back(i);
}
int ans = 0;
vector<int> mx(n);
for (int i = n - 1; i >= 0; i... | ALGO | 0.999934 | 3.74226 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2024-04-12T14:28: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": "fe75f2b93... |
9f279e91-245f-4c22-8770-e8044820d7b2 | Turtlefromocean/Algorithm_study | LeetCode/LeetCode_20.cpp | //
// Created by 신지영 on 2019/11/26.
//
#include <iostream>
#include <stack>
using namespace std;
bool isValid(string s) {
stack<char> stack;
if(s.length() == 0) {
return true;
}
if(s.length() % 2 == 1) {
return false;
}
for(int i=0;i<s.length();i++) {
char c = s[i... | ALGO | 0.994577 | 4.791712 | {
"github_metadata": {
"branch": "master",
"commit_count": 56,
"repo_created_at": "2019-11-25T15:26:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d701a77b5... |
46f1c99e-6a95-4859-894f-0ab06119213e | Akiko0210/Competitive-programming | codeforces/contest/Good Bye 2024/B.cpp | #include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define ss second
#define ff first
#define pb push_back
#define pii pair<int, int>
#define INF INT_MAX
using namespace std;
void debug_out() { cerr << endl; }
template<typename Head, typename... Tail> void debug_out(Head H, Tail... T) { cerr <... | ALGO | 0.999922 | 3.487612 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2024-01-11T06:51: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": "751620a6206a... |
a5921e6c-4ccb-40cf-8f39-520bd00b1113 | liamthuynh/cpp_playGround | 6. Arrays and Vectors/6.10.2: Finding values in vectors.cpp | /* Assign numMatches with the number of elements in userValues that equal matchValue. userValues has NUM_VALS elements.
Ex: If userValues is {2, 2, 1, 2} and matchValue is 2 , then numMatches should be 3. */
#include <iostream>
#include <vector>
using namespace std;
int main() {
const int NUM_VALS = 4;
int m... | ALGO | 0.999781 | 4.468426 | {
"github_metadata": {
"branch": "main",
"commit_count": 127,
"repo_created_at": "2021-09-12T23:57: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": "7d2dfe2f92... |
17ba7ee0-deca-4784-a01d-5c3ffdf61d3e | sathvik-shettyy/cplus-diary | Cplus diary/portion for sem2internal-mumbai university/chapters/testpaper-operators.cpp | ## Test Paper: C++ Operators
### Section A: Arithmetic Operators
**Question 1: Explain the concept of arithmetic operators in C++. Provide examples to illustrate their usage.**
Arithmetic operators in C++ are symbols used to perform mathematical operations on variables or values. The basic arithmetic operators inclu... | ALGO | 0.993637 | 7.24368 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2024-01-26T09:41: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": "af7da514758c... |
30b9385a-bc25-4c6f-b581-89e3212a24b7 | google/tensorstore | tensorstore/index_space/index_transform.cc | // Copyright 2020 The TensorStore 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 ... | TOOL | 0.921136 | 7.748196 | {
"github_metadata": {
"branch": "master",
"commit_count": 1622,
"repo_created_at": "2020-03-30T13:24:59.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1425,
"forks": 127,
"issues": 37,
"pull_requests": 3
},
"file_meta": {
"content_id": "95... |
5428bc29-e8ff-4973-bd76-52c53f6e05c2 | ishandutta2007/codeforces-e | ezoilearner/normal/901/E.cpp | #include<bits/stdc++.h>
using namespace std;
#define cout cerr
#define rep(i,a,b) for(int i=(a);i<=(b);++i)
#define per(i,a,b) for(int i=(a);i>=(b);--i)
typedef long long ll;
typedef pair<int,int> pii;
#define FR first
#define SE second
inline void rd(int &x){
x=0;char ch=getchar();int f=1;
while(ch<'0'||ch>'9'){
... | ALGO | 0.999983 | 3.364611 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:34: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": "6c9684e96d40... |
bc0686da-db54-4f77-a323-cd74661c87b7 | arcorck/DUT-AS | S2/c++/Semaine 16-21 Mars/TP 19 Mars/echange.cpp | #include<iostream>
using namespace std;
void echange1(int a, int b){
int c;
c=a;
a=b;
b=c;
cout << a << " " << b << endl;
}
void echange2(int &a, int &b){
int c;
c=a;
a=b;
b=c;
//cout << a << " " << b << " ";
}
void echange3(int &a, int b){
int c;
c=a;
a=b;
b=c;
cout << a << " " << b << endl;
}
voi... | ALGO | 0.996879 | 3.405006 | {
"github_metadata": {
"branch": "master",
"commit_count": 333,
"repo_created_at": "2020-05-20T07:45:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a22b4633... |
e0d41a72-c97c-4ead-a96b-3b9e46f5f0a1 | yjl9903/XCPC | Codeforces/2021seerc/e.cpp | #include <iostream>
#include <cstdio>
#include <cassert>
#include <cstring>
#include <cmath>
#include <functional>
#include <algorithm>
#include <utility>
#include <vector>
#include <string>
#include <map>
#include <set>
#ifdef XLor
#define dbg(args...) cout << "\033[32;1m" << #args << " -> ", err(args)
void err() ... | ALGO | 0.999901 | 4.062007 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-03-25T19:33:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "eedead56a738... |
226e123c-ceef-4c79-b5d9-3c909394c964 | footoredo/Arondight | SJTU-Training-2017/7.29/d.cpp | #include<bits/stdc++.h>
using namespace std;
char s[10][5][3];
void prepare()
{
strcpy(s[0][0]," - ");
strcpy(s[0][1],"| |");
strcpy(s[0][2]," . ");
strcpy(s[0][3],"| |");
strcpy(s[0][4]," - ");
strcpy(s[1][0]," . ");
strcpy(s[1][1],". |");
strcpy(s[1][2]," . ");
strcpy(s[1][3],". |");
strcpy(s[1][4]," . "... | ALGO | 0.999823 | 3.00349 | {
"github_metadata": {
"branch": "master",
"commit_count": 34,
"repo_created_at": "2017-07-20T12:39:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cbb24dc47... |
cd7560bc-fe74-4565-81ee-20933fd26cb4 | lazy-ps/30-day-leetcoding-challenge | 2020-04/2020-04-28/puyo.cpp | // key point is there is no POP function
class FirstUnique {
public:
unordered_map<int, int> umap; // save number count
queue<int> que; // added order for unique values
FirstUnique(vector<int>& nums) {
umap = unordered_map<int, int>();
que = queue <int>();
// this exa... | ALGO | 0.99984 | 5.531483 | {
"github_metadata": {
"branch": "master",
"commit_count": 184,
"repo_created_at": "2020-04-04T14:11:27.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "911344dec... |
6415b8b4-a358-4604-97fc-da41fbc5a52b | sepehrfazeli/Quantum-computing | QuantumTeleportation.cpp | // Include the IQS header file and the standard C++ libraries
#include <iostream>
#include "qureg.hpp"
using namespace std;
using namespace iqs;
int main()
{
// Declare the number of qubits and create a quantum register object
int num_qubits = 3;
QubitRegister<ComplexDP> psi(num_qubits);
// Initializ... | ALGO | 0.985386 | 5.397967 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2023-11-29T09:18:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8ccbf4694db5... |
63ad7a76-be9d-4e23-9484-b5fc4f6503dd | tadeeshaRoy/Practise | DSA simple/Tree/is subtree.cpp | /*
Check whether a tree A is a subtree of tree B
*/
#include<iostream>
struct TreeNode
{
int val;
TreeNode *left;
TreeNode *right;
};
TreeNode* getNewNode(int data)
{
TreeNode* newNode = new TreeNode();
newNode->val = data;
newNode->left=newNode->right= NULL;
return newNode;
}
TreeNode* ... | ALGO | 0.999926 | 5.000109 | {
"github_metadata": {
"branch": "master",
"commit_count": 145,
"repo_created_at": "2018-07-26T14:04: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": "7f9cc01e... |
7b46eff9-fff1-4a3d-9dd1-7830b69274d8 | JoelGunawan/competitive-programming | tlx/osn_ksn/osnp-2022/b5.cpp | // header file
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
// pragma
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
// macros
#define endl "\n"
#define ll long long
#define mp make_pair
#define ins insert
#define lb lower_bound
#define pb pu... | ALGO | 0.999976 | 4.291437 | {
"github_metadata": {
"branch": "main",
"commit_count": 665,
"repo_created_at": "2021-06-06T04:24: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": "ee45c4d933... |
fb9f7a53-a946-4b26-bb5a-63eaa3e588c1 | Dranack21/cpp-42-modules | 09/ex02/main.cpp | #include "PmergeMe.hpp"
void parse_args(int argc, char *argv[])
{
std::string s;
for(int i = 1; i < argc; i++)
{
s = argv[i];
if (s.find_first_not_of("0123456789") != std::string::npos || atol(argv[i]) > 2147483647)///atol overflow returns long max///
throw std::runtime_error("Error");
if (s.empty())
t... | ALGO | 0.997976 | 5.5863 | {
"github_metadata": {
"branch": "main",
"commit_count": 34,
"repo_created_at": "2025-05-30T15:17: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": "62faf253fab... |
79a4b6cf-794d-46f4-812d-c04a74660fe7 | nishant111/leetCode | 1482-minimum-number-of-days-to-make-m-bouquets/1482-minimum-number-of-days-to-make-m-bouquets.cpp | class Solution {
public:
int getBoq(vector<int>& bloomDay, int day, int k){
int count = 0;
int ans = 0;
for(int i = 0;i<bloomDay.size();i++){
if(bloomDay[i]<=day){
count++;
}
else{
count = 0;
}
if(cou... | ALGO | 0.999993 | 5.858943 | {
"github_metadata": {
"branch": "main",
"commit_count": 1991,
"repo_created_at": "2022-01-31T08:48: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": "c2df31713... |
d02bb6c4-9e50-49d5-9bb1-60c3dfa565bf | jinzcdev/PTA | 浙大版_数据结构(第2版)_题目集/编程题/习题3.8 符号配对.cpp | // https://pintia.cn/problem-sets/434/exam/problems/type/7?problemSetProblemId=5869
#include <bits/stdc++.h>
using namespace std;
bool is_left(string s) { return s == "(" || s == "[" || s == "{" || s == "/*"; }
bool is_right(string s) { return s == ")" || s == "]" || s == "}" || s == "*/"; }
int main() {
map<string... | ALGO | 0.999649 | 3.742161 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2023-01-23T14:11:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 27,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e36470536e0... |
01cb3847-5972-45d2-b035-14549ece6f5d | liuxueyang/practice-code | algorithm/newcoder/DataStructure/Tree/二叉树/BinaryTree.cpp | /*
* =====================================================================================
*
* Filename: BinaryTree.cpp
*
* Description: http://www.nowcoder.com/practice/5b80ab166efa4551844657603227caeb?rp=3&ru=/activity/oj&qru=/ta/kaoyan/question-ranking
*
* Version: 1.0
* Created: ... | ALGO | 0.999958 | 3.653067 | {
"github_metadata": {
"branch": "master",
"commit_count": 469,
"repo_created_at": "2014-03-22T13:54:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "618d6de2... |
14aa7cd7-a44f-493f-87fc-87e414ded894 | Alisherka7/Baekjoon | 1048 방 번호 2/main.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int n,pl,End;
ll k,x,co[15],ch[15],tmp[15];
struct Money {
ll cost; int num;
}a[15];
bool cmp(Money p1,Money p2) {
if(p1.cost == p2.cost) return p1.num > p2.num;
return p1.cost < p2.cost;
}
int printLen() {
End = pl = 0;
if(k ... | ALGO | 0.999986 | 3.615695 | {
"github_metadata": {
"branch": "main",
"commit_count": 257,
"repo_created_at": "2022-01-07T18:51: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": "0942744aea... |
3077206f-77f5-4b1d-a1f5-3d3ee999a145 | a00012025/Online_Judge_Code | HSNU-OJ/42.cpp | #include<bits/stdc++.h>
using namespace std;
struct pii
{
int x,y;
bool operator < (const pii &rhs) const
{
if(x!=rhs.x) return x<rhs.x ;
else return y<rhs.y ;
}
};
vector<pii> v ;
set<pii> st ;
void st_insert(const pii &p)
{
//printf("\ninsert (%d,%d)\n",p.x,p.y) ;
st.insert(p... | ALGO | 0.999903 | 3.944513 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2015-10-10T22:44:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d7b9adf41b... |
1c5235b1-2bd2-4f55-bfed-1ffa178e2509 | ishandutta2007/codeforces-r | roki/normal/6/E.cpp | #pragma comment(linker, "/STACK:167177216")
#include<stdio.h>
#include<stack>
#include<math.h>
#include<time.h>
#include<iostream>
#include<algorithm>
#include<string.h>
#include<string>
#include<set>
#include<memory.h>
#include<vector>
#include<map>
#include<queue>
using namespace std;
typedef long long li;
#defin... | ALGO | 0.999943 | 3.604929 | {
"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": "7d52fe54922b... |
c36d6bf3-95d0-4429-985a-d1f2db1ed69d | jjgomez/6s096final | nbody/src/System.cpp | #include <nbody/constants.h>
#include <nbody/System.h>
#include <nbody/Vector3.h>
#include <fstream>
#include <stdexcept>
#include <iostream>
#include <iomanip>
namespace nbody {
inline void System::interactBodies( size_t i, size_t j, float softFactor, Vector3f &acc ) const {
Vector3f r = _body[j].position() -... | ALGO | 0.988966 | 4.527081 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2014-01-27T22:37: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": "c45c7fa291... |
438eac77-af92-4559-b2f6-6ea8fac4000a | wiiwu959/Coding | LeetCode/0015-3Sum.cpp | /*
這題要用 vector<int> 中的數字湊出各種加總 = 0 的三個數字
最重要的一點就是要先 sort 這個 vector 這個 vector 中的值才能加速
不然就要用完全暴力法 時間複雜會是 O(N^3)
這題我用的方法是用 for 把每個數字都跑一遍,每次都只考慮和它之後的數字湊,避掉重複
然後因為有 sort 過,所以可從最靠前和最靠後來湊
接著避免重覆,front 也會一直往前移動
這樣的寫法效率應該會是 O(N^2)
*/
class Solution {
public:
vector<vector<int>> threeSum(vector<int>& nums) {
sort(... | ALGO | 0.999991 | 5.80868 | {
"github_metadata": {
"branch": "master",
"commit_count": 35,
"repo_created_at": "2019-04-17T17:59:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f661967e6... |
c4d516bf-6b0b-4828-a90f-b5231d5be0b4 | Utkarsh-Dyundi/Competitive-Programming | Another_Tree_with_Number_Theory.cpp | #include<bits/stdc++.h>
using namespace std;
#define tr(c,it) for(typeof(c.begin()) it=c.begin();it!=c.end();++it)
#define all(c) c.begin(),c.end()
#define mod 1000000007
#define itor(c) typeof(c.begin())
#define ll long long
#define vi vector<int>
#define si set<int>
#define msi multiset<int>
#define ii pair<int,int>
... | ALGO | 0.9999 | 3.802905 | {
"github_metadata": {
"branch": "main",
"commit_count": 43,
"repo_created_at": "2021-03-04T16:02:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6859ba27a99... |
1d6045ed-9720-49dc-a226-d22b63b02470 | alec-z/UCSD-Algorithms | week4/6_organizing_a_lottery/points_and_segments.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <cassert>
using std::vector;
struct Node {
int p_pos; // point's location;
int p_type; // segment start point is 0, point position is 1, segement end point is 2;
int index; //points's origin index;
};
vector<int> fast_count_segments(vector<int... | ALGO | 0.999959 | 5.267496 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2024-01-08T03:08: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": "18098bfb2ce0... |
fbd5d615-fb70-4bab-9c23-779600ace52f | wyrover/book-code | 数据结构STL版/第7章/Algo7-4.cpp | //Algo7-4.cpp 希尔排序类
#include "C.h"
#include "C4-1.h"
typedef int KeyType;
#include "SqTable.h"
template<typename D>class SheSort: public SqTable<D>
{
private:
vector<int> dt;
void ShellInsert(int dk)
{
int j;
D temp;
for (int i = dk; i < elem.size(); i++)
if LT(elem[i].k... | ALGO | 0.999945 | 3.818443 | {
"github_metadata": {
"branch": "master",
"commit_count": 192,
"repo_created_at": "2016-07-24T07:29:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 388,
"forks": 248,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e248... |
6dab2671-e525-4c92-a48b-d7ecb8c345b8 | TheArchons/Competitive-Programming | DMOJ/Cheerio/Contest 3/S2.cpp | #include <bits/stdc++.h>
using namespace std;
/*
1. if you opponent is shooting and they have ammo, block
2. if you have ammo and your opponent is not blocking, shoot
3. reload
*/
int main() {
cin.sync_with_stdio(0); cin.tie(0);
//freopen("2.input", "r", stdin); // for testing. Comment out for submissions
... | ALGO | 0.999799 | 4.075454 | {
"github_metadata": {
"branch": "main",
"commit_count": 362,
"repo_created_at": "2021-11-11T05:01:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "75827973fe... |
06ca9b4b-ca26-4982-a490-5ff47a3bb42f | sakundu/OpenROAD-DPI | src/ppl/src/Slots.h | /////////////////////////////////////////////////////////////////////////////
//
// BSD 3-Clause License
//
// Copyright (c) 2019, 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... | ALGO | 0.989152 | 7.25371 | {
"github_metadata": {
"branch": "master",
"commit_count": 10783,
"repo_created_at": "2022-01-02T00:36:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "369ecc... |
3abf02d5-5f35-49c7-b2db-75a53edd399a | ishita-gambhir/competitive-programming | mathematics/product-of-numbers-codeforces.cpp | // https://codeforces.com/contest/1294/problem/C
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
ll pow(ll a,ll b)
{
ll ans=1;
for(;b > 0;a = a * a ,b >>= 1)if(b & 1)ans = ans * a ;
return ans;
}
int main() {
ll t;
cin >> t;
while (t--) {
ll n, temp;
cin ... | ALGO | 0.999688 | 4.13223 | {
"github_metadata": {
"branch": "master",
"commit_count": 78,
"repo_created_at": "2020-05-16T19:37: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": "9699cb777... |
74eadb03-25fa-471e-a919-060d57242ca4 | lord-benjamin/DSA-Learning-Codes | Linked List/SearchInLinkedList.cpp | #include<iostream>
using namespace std;
class Node{
public:
int data;
struct Node *next;
};
struct Node *first;
void create(int A[],int n){
int i;
struct Node *t,*last;
first = (struct Node*)malloc(sizeof(struct Node));
first->data = A[0];
first->next = NULL;
last = first;
for(... | ALGO | 0.99996 | 3.925007 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2023-03-14T11:59: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": "f9e2f092215... |
201e5540-5bf9-49b9-9bc0-b43b6ff1b316 | 0ul/Alg | bj_15648(2).cpp | //using prev_permutation
#include <cstdio>
#include <algorithm>
#include <vector>
using namespace std;
int X, Y, K, a, b, idx, ans = -1;
vector<vector<int>> map;
vector<pair<int, int>> canmake;
vector< pair<int, int>> back(4);
bool isright() {
int cury, curx;
for (int i = 1; i <= X; i++) {
cury = 1; curx = i;
... | ALGO | 0.999978 | 3.304025 | {
"github_metadata": {
"branch": "master",
"commit_count": 31,
"repo_created_at": "2018-09-15T10:28: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": "93fa49752... |
10200ed4-df7c-4c99-9e6f-da0ee552f2ae | ishandutta2007/codeforces-z | zscoder/normal/596/C.cpp | #include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
typedef long long ll;
typedef pair<int,int> ii;
typedef vector<int> vi;
const int INF = 1e9 + 7;
const int MOD = 1e9 + 7;
const int N = 100000;
vector<ii> pt;
vi special[200001];
vi ptsp[20000... | ALGO | 0.99999 | 3.970237 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:43: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": "953dcdf2b40f... |
da09c96c-38ae-4b47-be32-9a4d7d26d04c | sauravstark/Preparations | 017 - Possible groups.cpp | #include<iostream>
void func()
{
//code
int N;
std::cin >> N;
unsigned long long int mod[3] = { 0 };
int x;
for (int i = 0; i < N; ++i) {
std::cin >> x;
mod[x % 3]++;
}
unsigned long long int possibilities = 0;
// ways of selecting two nu... | ALGO | 0.999784 | 4.411315 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2020-04-19T10:16:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "17c89cda8f... |
7b1e8c95-90ae-4ae9-9417-77bba2547311 | shwan-goofy/algorithm_study | BOJ/15685_드래곤커브/15685.cpp | #include <iostream>
#include <vector>
#include <math.h>
using namespace std;
int N;
bool H_EDGE[100][100] = {0,};
bool V_EDGE[100][100] = {0,};
vector<vector<int>> GEN;
int d_c[] = { 1, 0, -1, 0};
int d_r[] = { 0, -1, 0, 1};
int ans(0);
void check_edge(int row_1, int col_1, int row_2, int col_2){
if(row_1 < 0 ||... | ALGO | 0.999849 | 4.057177 | {
"github_metadata": {
"branch": "master",
"commit_count": 305,
"repo_created_at": "2020-06-02T13:45:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fb5dcfa3... |
41cb27e9-8d1f-49b7-ab8f-4de78f94bad4 | urlib/4l7h | BZB6I4UDvZTNnHXq/WorkSpace/lg/1864.cpp | #pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4.1,sse4.2,avx,avx2,popcnt,tune=native")
#include "bits/stdc++.h"
#define mem(x) memset((x), 0, sizeof((x)))
#define il __attribute__((always_inline))
using namespace std;
typedef long long ll;
typedef... | ALGO | 0.999992 | 3.883236 | {
"github_metadata": {
"branch": "master",
"commit_count": 725,
"repo_created_at": "2019-12-07T14:31:06.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e67e8c4e3... |
1285ac9b-5f57-42f9-8581-06e5ea6fe77d | gioh-mkv/estruturas-de-dados-em-Cpp | Arvore AVL-rec.cpp | // -----------------------------------------------------------
// ---- Livro Algoritmos (CORMEN): Capitulo 12 ---------------
// ---- Arvore de Busca Binaria (Binary Search Tree) ---------
// -----------------------------------------------------------
#include <iostream>
#include <ctime>
using namespace std;
struct n... | ALGO | 0.999689 | 3.602991 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2025-07-02T14:49: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": "ea529545c528... |
4ce40673-b385-4d11-b955-546a1d93c1d5 | ccoliu/NTUST_OOP | C++Practice/CS3005301W08/TS0701/Form.cpp | //Name:¼B®a¦¨
//Date: 2023/4/13
//Last Update: 2023/4/13
//Problem statement: With a given dictionary, find all words that can be formed by removing one character from the given word.
#include "Form.h"
#include <iostream>
#include <fstream>
#include <map>
#include <algorithm>
void Form::SetInputWord(string inputWord... | TOOL | 0.995 | 4.161688 | {
"github_metadata": {
"branch": "main",
"commit_count": 30,
"repo_created_at": "2023-06-14T05:56: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": "2944d39de21... |
d334fff4-af54-4fbf-9332-21e70264f404 | BBJDH/CodingTest_Library | CodingTest/BaekJoon/그래프/다익스트라/1504 - 특정한 최단 경로.cpp | /*
1504 - 특정한 최단 경로
v1과 v2를 반드시 거쳐야 한다
헌제 이 두 점을 거치는 경로가 어디가 더 빠를지 비교해주어야 한다
1에서 다익스트라를 시행하면,
V1 V2로 가는 경로의 길이를 저장해두고,
V1에서 다익스트라로
V1-V2 거리와 V1-N의 거리를 저장해둔다
마지막으로 V2에서 다익스트라로 V2-N의 거리를 저장해둔다(V1-V2는 이전에 구했다)
이 두 경로의 합산 (V1-V2 -N, V2-V1 -N)을 구해 비교하여 작은 값을 출력한다.
하지만 여기서 합한값이 상한값을 넘는다면, -1을 출력한다.
*/
#include<iostr... | ALGO | 0.99997 | 4.485376 | {
"github_metadata": {
"branch": "master",
"commit_count": 321,
"repo_created_at": "2022-06-03T04:11: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": "0d480fd5... |
7fc7bba0-2d8f-47f6-944b-e529cd405969 | sienkiewiczkm/milling-simulator | src/mill-gui/SamplingMillingTechnique.cpp | #include "SamplingMillingTechnique.hpp"
#include <iostream>
#include <imgui.h>
using namespace glm;
namespace ms
{
SamplingMillingTechnique::SamplingMillingTechnique()
{
}
SamplingMillingTechnique::~SamplingMillingTechnique()
{
}
bool SamplingMillingTechnique::isAvailable(
glm::dvec3 startPosition,
glm::d... | ALGO | 0.900841 | 6.210841 | {
"github_metadata": {
"branch": "master",
"commit_count": 115,
"repo_created_at": "2016-12-08T16:27:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 20,
"forks": 7,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "f5e9b54... |
befd1ada-6ab0-44f4-9afa-d84c0b27ef25 | am-Anmol/DS-Algorithm | Arrays/Smallest_Subarray_with_sum_greater_than_a_given_value.cpp | //Smallest Subarray with sum greater than a given value
# include <iostream>
using namespace std;
int smallestSubWithSum(int arr[], int n, int x)
{
int min_len = n + 1;
for (int start=0; start<n; start++)
{
int curr_sum = arr[start];
if (curr_sum > x) return 1;
for (int end=start+1; end<n; end++)
{
curr_s... | ALGO | 0.999965 | 4.067116 | {
"github_metadata": {
"branch": "master",
"commit_count": 38,
"repo_created_at": "2021-03-29T18:23:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0f70583be... |
257d4110-56aa-4129-82a2-c82234c292bd | Tamoghna-Bhattacharjee/DSA_Cpp | Basic algo (Remember)/MergeSort inversion/Inversions of subsequences.cpp | #include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// using namespace __gnu_pbds;
using namespace std;
// #pragma GCC optimize("Ofast")
// #pragma GCC target("avx,avx2,fma")
// #pragma GCC optimization ("O3")
// #pragma GCC optimization ("unroll-loops")
#defin... | ALGO | 0.999979 | 4.340684 | {
"github_metadata": {
"branch": "master",
"commit_count": 378,
"repo_created_at": "2021-06-07T08:07: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": "6c8bc66c... |
20ca9a27-3f64-4210-b42d-d8cef71cb9b6 | mdzobayer/Problem-Solving | Uva/11475 - Extend to Palindrome.cpp | #include <bits/stdc++.h>
using namespace std;
int patt[100000+5];
int main() {
//freopen("in.txt", "r", stdin);
int i, j, k ;
string text, pattern;
while(cin >> text) {
pattern = "";
for (i = text.size() - 1; i >= 0; --i) {
pattern += text[i];
}
patt[0]... | ALGO | 0.999996 | 3.728621 | {
"github_metadata": {
"branch": "master",
"commit_count": 987,
"repo_created_at": "2019-01-14T15:44:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e9b1a91b... |
ec37a65b-2e05-4122-9bf9-302c812001c2 | dingyiheng/Concurrency | studio_exercise_8/q3/concurrency_design.cpp | #include <iostream>
#include <thread>
#include <mutex>
#include <vector>
#include <utility>
#include <time.h>
using namespace std;
typedef pair<int, int> pos;
mutex m;
void search(int arr[8][8], int target, pos leftUpper, pos rightLower) {
int count = 0;
for (int i = leftUpper.first; i <= rightLower.first; i++) {
... | TOOL | 0.990194 | 3.81742 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2015-11-28T09:33: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": "f57f925227... |
f1783c14-1188-4b87-aed9-ad29ab8f4a09 | jiiink/DataStructure | STL_6900___Graph_1c/Graph_200___Algorithms_1b/Traversal___220_Recursive_DFS.cpp | #include <bits/stdc++.h>
using namespace std;
#define N 100
bool vis[N]; // mark nodes which we have already visited
vector <vector <int> > adj; // adjacency list vectors
void dfs(int node){
if(vis[node]) // if already visited, return
return;
vis[node] = 1; // mark this node as visited
// do something
//... | ALGO | 0.999911 | 4.158668 | {
"github_metadata": {
"branch": "main",
"commit_count": 159,
"repo_created_at": "2023-08-23T07:47: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": "6c2ac40159... |
92c80c09-a191-4688-87bf-72bc1ba6869b | DeepakGarg882001/Data-Structure-Algorithm | C++/Supreme/Week8/class5/wordBreak2.cpp | // Leetcode Ques : 140
// Given a string s and a dictionary of strings wordDict, add spaces in s to construct a sentence where each word is a valid dictionary word. Return all such possible sentences in any order.
// Note that the same word in the dictionary may be reused multiple times in the segmentation.
// E... | ALGO | 0.999566 | 5.554276 | {
"github_metadata": {
"branch": "main",
"commit_count": 32,
"repo_created_at": "2021-11-26T17:30:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4f83f391316... |
bc1f5cf1-4dbb-45fb-bf79-51735d802b15 | ishandutta2007/codeforces-y | yzc2005/normal/1609/G.cpp | #include <bits/stdc++.h>
using namespace std;
int n, m, q;
long long a[105], b[100005];
struct ST {
int len[400005];
long long sum[400005], lazy[400005];
void build(int p, int l, int r) {
len[p] = r - l + 1;
if (l == r) {
sum[p] = b[l];
return;
}
int mid = (l + r) >> 1;
build(p << 1, l, mid);
build... | ALGO | 0.999468 | 3.728058 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:40: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": "6c6d5886e936... |
1a6b894f-7f17-4d0e-80ab-45316bb60646 | wagoodwin/aoc2020 | day3.cpp |
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
/*
Idea here: turn the puzzle input into a giant matrix of 1s and 0s.
Trees will be 1s and open spaces will be 0s. I got this idea from <NAME> on his YT channel.
Then, we can make some sort of loop tha... | ALGO | 0.99982 | 4.568332 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2021-05-13T23:59: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": "d221591a0e... |
7c9e8fe2-f196-497e-be85-8997d173f0fd | textangel/c-refresher | cpp/grades/orig/grades-original.cpp | #include <iomanip>
#include <ios>
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <numeric>
#include <stdexcept>
using std::accumulate;
using std::cin; using std::setprecision;
using std::cout; using std::string;
using std::endl; using std::streamsize;
using std::vector; using s... | TOOL | 0.987898 | 4.367027 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2020-04-26T09:12: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": "195be822df... |
70a1da1b-a4de-4b3d-9f8f-045664fc886d | Kyzarok/MScProject_AURORA_with_RNN | OriginalCode/example_tf_sferes/cpp/sferes/ea/dom_sort_basic.hpp | //| This file is a part of the sferes2 framework.
//| Copyright 2009, ISIR / Universite Pierre et <NAME> (UPMC)
//| Main contributor(s): <NAME>, <EMAIL>
//|
//| This software is a computer program whose purpose is to facilitate
//| experiments in evolutionary computation and evolutionary robotics.
//|
//| This software... | ALGO | 0.999928 | 6.052049 | {
"github_metadata": {
"branch": "master",
"commit_count": 75,
"repo_created_at": "2020-07-28T15:22:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "eb2573d13... |
d5af0750-8f50-4ab4-b94c-02f3c5ec7bdf | z-prize/2023-entries | prize-1-fpga-gpu-proof/prize-1a-msm/fpga/Yrrid/zprize-2023-submission-fpga/fpga/nt_amsm/kernels/k_unified_proc/src/k_unified_proc.cpp | /***
Copyright (c) 2023-2024, Yrrid Software, Inc. All rights reserved.
Dual licensed under the MIT License or the Apache License, Version 2.0.
See LICENSE for details.
Author(s): <NAME>
***/
#include "hw_msm.h"
#include "k_proc.h"
#include "k_d_mult.h"
#include "k_ec_adder.h"
void k_bls12_381_unified_proc_0(
... | ALGO | 0.996894 | 4.277321 | {
"github_metadata": {
"branch": "main",
"commit_count": 30,
"repo_created_at": "2024-05-07T21:03:16.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 24,
"forks": 7,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "173bd439398... |
3b9d31c7-44fd-41c4-a292-4a3a33fa1872 | luhang-HPU/poseidon | examples/ckks/test_ckks_heartstudy.cpp | #include "src/decryptor.h"
#include "src/encryptor.h"
#include "src/factory/poseidon_factory.h"
#include "src/keygenerator.h"
#include "src/util/debug.h"
#include "src/util/random_sample.h"
using namespace poseidon;
using namespace poseidon::util;
int main()
{
std::cout << BANNER << std::endl;
std::cout << "P... | ALGO | 0.97238 | 4.950381 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2024-11-18T02:29: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": "5093cee33c9... |
02f12c66-f051-431c-92f9-c35a0e1a9846 | bidhuripriyanshu/DSAbyTUFORWARD | LeetCode/Medium/0235-lowest-common-ancestor-of-a-binary-search-tree/0235-lowest-common-ancestor-of-a-binary-search-tree-07-09-2025-23-34-38.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
TreeNode* lowestCommonAncestor(TreeNode* root, TreeNode* p, TreeNode* q) {
// Base case(we hav... | ALGO | 0.99999 | 6.613282 | {
"github_metadata": {
"branch": "main",
"commit_count": 165,
"repo_created_at": "2024-09-20T07:04: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": "f7a09a89aa... |
0c6b4d29-a5aa-4e9a-8963-99fb53ff6502 | Sudhir769/LeetCode-GFG-Daily | 18 October 2024/lc-/Solution.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution
{
public:
vector<vector<int>> dp;
int solve(int i, int currOr, int maxOr, vector<int> &nums)
{
if (i == nums.size())
{
if (currOr == maxOr)
{
return 1;
}
return 0;
... | ALGO | 0.999951 | 5.525033 | {
"github_metadata": {
"branch": "main",
"commit_count": 375,
"repo_created_at": "2024-01-01T18:09: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": "c990a30859... |
83be246e-c7ea-4c4d-b2e2-c9d32d86bf0c | cgmoreda/CompetitiveProgramming | UVA/10099/43887831_AC_0ms_0kB.cpp | #include<bits/stdc++.h> //cgmoreda || Mohamed_Reda
using namespace std;
#define vin(v) for(auto &i:(v))cin>>i
#define ll long long
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define vi vector<int>
#define vvi vector<vector<ii>>
#define ii pair<int,int>
class DSU
{
private:
vi p, rank;
pu... | ALGO | 0.999936 | 4.489742 | {
"github_metadata": {
"branch": "main",
"commit_count": 442,
"repo_created_at": "2024-01-20T21:05: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": "d5e64e94f3... |
21b33eb9-5b89-409f-b403-319e8b254e36 | iWalyNoby/iwalynoby.github.io | MyRepos/0.Other/5.常用的遍历算法.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <algorithm>
#include <vector>
#include <list>
#include <functional>
using namespace std;
void printInt(int &value)
{
cout << value << " ";
}
class Show
{
public:
Show() {
cnt = 0;
}
void operator()(int &value) {
cout << value << " ";
cnt++;
... | ALGO | 0.980403 | 5.078915 | {
"github_metadata": {
"branch": "master",
"commit_count": 38,
"repo_created_at": "2016-09-11T12:44: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": "ac675f46c... |
bc43411c-9d5e-42e4-913d-2b3bac9b89d4 | Levishery/code-for-courses | data-structure-master/ex9 路径 平衡二叉树.cpp | #include<stdio.h>
#include<stdlib.h>
//#include<queue>
//图的矩阵邻接表示
#define INFINITY INT_MAX
#define MAX_VERTEX_NUM 20
#define VertexType char
#define ArcType int
typedef struct{
VertexType vexs[MAX_VERTEX_NUM];
ArcType arcs[MAX_VERTEX_NUM][MAX_VERTEX_NUM];
int vexnum,arcnum;
int kind;
}MGraph;
int LocateVex(MGraph ... | ALGO | 0.999356 | 3.023353 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2019-03-13T12:01: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": "bd7e2bbe97... |
1f48fe01-e84f-41a8-9226-094d92223bdc | FarisKarim/cpp_exercises | 8/main.cpp | #include <iostream>
// 8.6 QUIZ - SWITCH STATEMENTS
// int calculate(int x, int y, char op)
// {
// switch (op) {
// case '+':
// return x + y;
// case '-':
// return x - y;
// case '*':
// return x * y;
// case '/':
// return x / y;
/... | TOOL | 0.91968 | 3.631687 | {
"github_metadata": {
"branch": "main",
"commit_count": 24,
"repo_created_at": "2025-05-02T23:18: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": "e5b1bd993cd... |
6bb59293-cf93-4fe3-9333-e8ae69bb01c8 | dfdfg42/Algorithm_Solve | 백준/Gold/1976. 여행 가자/여행 가자.cc | #include <iostream>
#include <vector>
#include <cstring>
using namespace std;
int parent[1'000'001];
int find(int x) {
if (parent[x] == x)
return x;
return parent[x] = find(parent[x]);
}
void merge(int x, int y) {
x = find(x);
y = find(y);
if (x == y) return;
parent[y] = x;
}
bool... | ALGO | 0.999998 | 4.631599 | {
"github_metadata": {
"branch": "main",
"commit_count": 663,
"repo_created_at": "2023-03-29T00:14:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "f477be42e2... |
2f033e39-2f66-4c4c-8e10-f505245bcb38 | dmkz/competitive-programming | acmp.ru/0572.cpp | /*
Задача: 572. Технология программирования
Решение: жадный алгоритм, сортировка, динамическое программирование, O(n^2)
*/
#include <bits/stdc++.h>
#define all(x) (x).begin(),(x).end()
#define isz(x) (int)(x).size()
typedef std::vector<int> vi;
template<typename A, typename B> A& remax(A& a, B b) { return a = (... | ALGO | 0.999968 | 3.433663 | {
"github_metadata": {
"branch": "master",
"commit_count": 2019,
"repo_created_at": "2018-04-25T11:54:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 41,
"forks": 9,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5f5cc9... |
067bfa9b-6205-4673-9ea4-09c6174726df | shivamsisodia07/codeforeces-solutions | usaco/Problem_2_Cities_and_States.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define f(i,s,e) for(long long int i=s;i<e;i++)
#define rf(i,e,s) for(long long int i=e-1;i>=s;i--)
#define pb push_back
#define eb emplace_back
#define MOD 1000000007
#define PI 3.14159265
#define prt(x) cout << (x);
int main(){
ios::sync_with_stdio(... | ALGO | 0.999719 | 3.828887 | {
"github_metadata": {
"branch": "main",
"commit_count": 83,
"repo_created_at": "2022-12-14T15:38: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": "736ba7dda22... |
2dca6240-50b7-4001-8003-b273fc475edc | njagdale/code-magic | puzzles/DP_ClimbingStairs/main.cpp | // A C program to count number of ways to reach n't stair when
// a person can climb 1, 2, ..m stairs at a time
#include<stdio.h>
int fib(int n){
int arr[n+1];
arr[0] = 0;
arr[1] = 1;
for(int i=2; i<=n; i++)
arr[i] = arr[i-1] + arr[i-2];
for(int i=0; i<=n; i++)
printf... | ALGO | 0.999842 | 3.648083 | {
"github_metadata": {
"branch": "master",
"commit_count": 180,
"repo_created_at": "2015-10-09T18:40:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4352073a... |
c87af394-763e-4fc6-86da-8e98e00866ef | MarinYoung4596/LeetCode | 875.KokoEatingBananas.cpp | /*****************************************************************
* Copyright (C) 2023 All rights reserved.
*
* @file: 875.KokoEatingBananas.cpp
* @author: <EMAIL>
* @date: 2023/10/28 19:38:25
* @brief:
Koko loves to eat bananas. There are n piles of bananas, the ith pile has piles[i] bananas. The gu... | ALGO | 0.999947 | 6.028593 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2015-04-07T10:31:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e1ca79cf1... |
7a631ece-d075-4e45-909b-ddc0a4df548b | humanbeeng/leetcode-solutions | 0160-intersection-of-two-linked-lists/0160-intersection-of-two-linked-lists.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
ListNode *getIntersectionNode(ListNode *headA, ListNode *headB) {
ListNode* pa = headA; ListNode* pb = headB;
... | ALGO | 0.999764 | 5.203149 | {
"github_metadata": {
"branch": "main",
"commit_count": 408,
"repo_created_at": "2022-09-20T05:08: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": "129bfca254... |
354aa503-4111-49f2-b83e-805ea22b33ed | lucianayahuita/PRACTICA_03 | Ejercicio_03_14.cpp | // Materia: Programación I, Paralelo 1
// Autor: <NAME> <NAME>
// Fecha creación: 5/09/2023
// Fecha modificación: 6/09/2023
// Número de ejericio: 14
// Problema planteado: Simule una elección de nuestro país Bolivia. En ello se mostrará las elecciones
//por departamento y existirá N candidatos.
//El programa debe ped... | ALGO | 0.999991 | 5.874932 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-09-04T21:52: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": "1de098bb25fe... |
a96b52ca-f996-4ebe-963f-62d92003873f | Vijaya-Raghavendra/SoC_2025 | Week-4/Easy/1.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int t; cin >> t;
while (t--) {
int n, x;
cin >> n >> x;
vector<int> a(n);
for (int i = 0; i < n; ++i) cin >> a[i];
int time = 0;
bool used = false;
int i = 0;
while (i < n) {
... | ALGO | 0.99972 | 4.981196 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2025-06-27T09:15: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": "293f1b4fd7... |
c0186f1e-2323-4800-8473-4db047cf244a | ishandutta2007/codeforces-g | gabrielwu/normal/1560/F2.cpp | #include <bits/stdc++.h>
using namespace std;
#define forn(i, n) for (int i = 0; i < (n); i++)
#define pb push_back
#define mp make_pair
#define MOD 1000000007
#define f first
#define s second
#define rand(i, j) uniform_int_distribution<ll>((ll)(i), (ll)(j))(rng)
mt19937 rng(std::chrono::steady_clock::now().time_since... | ALGO | 0.99964 | 4.512415 | {
"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": "0423537c9202... |
4fd576fe-edb6-4bcd-8c58-bba4af954b9e | Alexander-Khlybov/lab4 | include/tables.hpp | #pragma once
#include <iostream>
using namespace std;
template<class KeyType>
class TAB_RECORD {
protected:
KeyType key_;
public:
TAB_RECORD(const KeyType& key) : key_(key){}
KeyType getKey(void)const { return key_; }
};
template<class DataType>
class TABLE {
protected:
size_t size_;
size_t count_;
size_t cur_;... | ALGO | 0.966564 | 4.362081 | {
"github_metadata": {
"branch": "master",
"commit_count": 122,
"repo_created_at": "2016-02-26T06:37:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b70fd81b... |
7afe73c6-170b-46e0-a996-49c2c4fc5e7b | Sayemahamed/cpp | A_Computer_Game.cpp | #include <bits/stdc++.h>
using namespace std;
//----------------------------------------------------------------//
// definitions //
#define endl '\n'
#define PI (acos(-1.0))
#define tan(a) tan(a) / (PI / 180)
#define sin(a) sin(a) / (PI / 180)
#define cos(a) cos(a) / (PI / 180)
//-------------------------------------... | ALGO | 0.999877 | 5.074694 | {
"github_metadata": {
"branch": "main",
"commit_count": 302,
"repo_created_at": "2022-08-09T17:21:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7be6571f88... |
2b9d9318-fac0-4671-882c-86b94dd6311b | Rhithick02/C-code | Codeforces/1409/E.cpp | #include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
#define lli long long
#define For(i,a,n) for(int i=(a);i<n;i++)
#define asc(x) x.begin(),x.end()
#define des(x) x.rbegin(),x.rend()
#define pb push_back
#define fi first
#define se second
#define mod 100000... | ALGO | 0.999909 | 3.579231 | {
"github_metadata": {
"branch": "master",
"commit_count": 288,
"repo_created_at": "2020-04-21T14:09: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": "99411394... |
bead9569-f625-471a-94ad-3b284bed2e85 | GaoLF/Leetcode | Maximal Rectangle.cpp | #include<iostream>
#include<string>
#include<vector>
#include <cctype>
#include<algorithm>
#include<math.h>
using namespace std ;
typedef struct ListNode{
int val;
ListNode * next;
} ListNode;
class Solution {
public:
int maximalRectangle(vector<vector<char>>& matrix) {
int i,j,res=0;
int size1=ma... | ALGO | 0.999786 | 5.200154 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2015-05-13T02:38: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": "35ceb148f... |
ff3f1513-005a-4722-a6d8-8d3b736ca385 | robertbarrera/CIS202 | CIS202/search_sort/sortIDs/main.cpp |
/*
Given a main() that reads user IDs (until -1), complete the Quicksort() and Partition() functions to sort the IDs in ascending order using the Quicksort algorithm, and output the sorted IDs one per line.
Ex. If the input is:
kaylasimms
julia
myron1994
kaylajones
-1
the output is:
julia
kaylajones
kaylasimms
myron... | ALGO | 0.999602 | 5.663776 | {
"github_metadata": {
"branch": "main",
"commit_count": 36,
"repo_created_at": "2023-03-28T21:43: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": "2f6fd398914... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.