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 |
|---|---|---|---|---|---|---|---|
b6a48baf-6351-4ee7-9350-534abdc97d87 | gyana88sahu/bootstrapping | demo/crtMultExp.cpp | #include <palisade.h>
#include "../src/crtFunc.cpp"
using namespace std;
using namespace lbcrypto;
typedef NativeInteger Int;
typedef NativePoly Element;
template <class T>
void crtMultExperiment();
void crtTest();
int main(){
//crtTest();
crtMultExperiment<Element>();
//crtMultExperiment<Poly>();
return 0;... | TEST | 0.9049 | 5.294102 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2018-05-07T05:04:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "70d9b00e0... |
f9f153ba-cd68-4ee7-9aa8-e51fd6c8e2b2 | NSCC-Winter-2022/PROG2400-700-Lectures | linkedlist/main.cpp | #include <iostream>
#include <memory>
using namespace std;
class LinkedListNode {
public:
int m_data; // the data to store (could be anything)
LinkedListNode* m_next; // a pointer to the next node in the chain
LinkedListNode() : m_data(-1), m_next(nullptr) {}
};
class LinkedList {
private:
... | ALGO | 0.916026 | 5.869416 | {
"github_metadata": {
"branch": "main",
"commit_count": 24,
"repo_created_at": "2022-01-12T12:48:50.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d94e4841a0c0... |
4241bac8-3412-414d-b5bf-46873423fa6f | sammochen/cp-submissions | codeforces/1037C.cpp | /*
Original problem: https://codeforces.com/problemset/problem/1037/C
Author: sammochen
*/
#define _CRT_SECURE_NO_WARNINGS
#include "bits/stdc++.h"
using namespace std;
#define REP(x,l,u) for(ll x = l;x<u;x++)
#define RREP(x,l,u) for(ll x = l;x>=u;x--)
#define PII pair<int,int>
#define PLL pair<ll,ll>
#define MP ma... | ALGO | 0.999956 | 3.376026 | {
"github_metadata": {
"branch": "master",
"commit_count": 1396,
"repo_created_at": "2019-07-26T21:44: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": "9158b4b... |
6fca7b0d-f7ee-4727-bd3d-0e41d557fc52 | giabach1106/cp | 2022/gift.cpp | #include <bits/stdc++.h>
#define f0(i,n) for(int i=0;i<n;i++)
#define f1(i,n) for(int i=1;i<=n;i++)
#define ll long long
#define all(a) a.begin(), a.end()
#define fi first
#define se second
#define endl '\n'
using namespace std;
const int maxn = 1e5 + 10;
//int A[maxn];
ll n,m,k,t,sum= 0;
string s;
void file() {
fre... | ALGO | 0.999961 | 3.776895 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-02-19T12:09: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": "e955b4b278de... |
35b5126a-c276-4a37-8403-4fba170b25d9 | weqjkqj/DS2024 | exp2/main.cpp | #include <iostream>
#include <cctype> // for isdigit
#include "C:\Users\81202\Desktop\DS2024-main\exp2\Stack.h" // 请根据实际路径调整
#define N_OPTR 9
typedef enum { ADD, SUB, MUL, DIV, POW, FAC, L_P, R_P, EOE } Operator;
const char pri[N_OPTR][N_OPTR] = {
'>', '>', '<', '<', '<', '<', '<', '>', '>',
'>', '>', '<', '<... | ALGO | 0.999924 | 4.697057 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2024-10-05T09:51:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "006488ba3e2... |
106142d6-b787-4145-b6ec-8487e4d590f7 | utkarsh-iitbhu/DSA-Code | Graphs_final/g/Edge_deletion_max_mul.cpp | #include <bits/stdc++.h>
using namespace std;
#pragma GCC optimization ('unroll-loops')
#define max(a, b) (a < b ? b : a)
#define min(a, b) ((a > b) ? b : a)
const int mod = 1e9 + 7 ;
#define FOR(a, c) for (int(a) = 0; (a) < (c); (a)++)
#define FORL(a, b, c) for (int(a) = (b); (a) <= (c); (a)++)
#define FORR(a, b, c) ... | ALGO | 0.999929 | 4.169451 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2023-02-03T15:41: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": "ad5a37de490f... |
f4c22a5c-5363-4b67-9596-a55b23c53742 | yanyun888/Study | STL/day05/list.cpp | #include <iostream>
#include <list>
#include <algorithm>
using namespace std;
template<typename T>
ostream& operator<< (ostream& os, list<T> const& l){
for (typename list<T>::const_iterator it =
l.begin (); it != l.end (); ++it)
os << *it << ' ';
return os;
}
void square (int& i) {
i *= i;
}
class IntCmp {
publi... | ALGO | 0.998394 | 4.12178 | {
"github_metadata": {
"branch": "master",
"commit_count": 45,
"repo_created_at": "2017-03-01T12:03: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": "26ac845b9... |
9e5ec5fc-b207-405b-8947-350f4b8fa625 | unisa-acg/inverse-dynamics-solver | ur10_inverse_dynamics_solver/include/ur10_inverse_dynamics_solver/getInertiaCurrents.h | /* -------------------------------------------------------------------
*
* This module has been developed by the Automatic Control Group
* of the University of Salerno, Italy.
*
* Title: getInertiaCurrents.h
* Author: <NAME>, <NAME>
* Org.: UNISA
* Date: Jul 7, 2023
*
* This is a function returning t... | ALGO | 0.991222 | 5.923625 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2025-04-03T10:00:22.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 6,
"forks": 1,
"issues": 3,
"pull_requests": 2
},
"file_meta": {
"content_id": "7f0342c39c66... |
a419d92e-c891-47c9-b987-94337188734e | thilio/Competitive-programming-team | Trainings/ECPC 2019 Kickoff/m.cpp | #include "bits/stdc++.h"
using namespace std;
#define pb push_back
#define fst first
#define snd second
#define fr(i,n) for (int i = 0; i < n; i++)
#define frr(i,n) for (int i = 1; i <= n; i++)
#define endl '\n'
#define gnl cout << endl
#define chapa cout << "oi meu chapa" << endl
#define dbg(x) cout << #x ... | ALGO | 0.999929 | 3.720803 | {
"github_metadata": {
"branch": "main",
"commit_count": 391,
"repo_created_at": "2021-01-09T16:55:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "727340fb4c... |
a712fac8-e0d9-4749-8a6b-a8385ee0fde7 | harshittaneja090/My-Leaqrning-codes- | daa/main code.cpp | // C++ program for Naive Pattern
// Searching algorithm
#include <bits/stdc++.h>
using namespace std;
int search(char* pat, char* txt)
{ int count=0,index[100];
int M = strlen(pat);
int N = strlen(txt);
/* A loop to slide pat[] one by one */
for (int i = 0; i <= N - M; i++) {
int j;
/* For curren... | ALGO | 0.999572 | 5.116433 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2020-10-27T07:30: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": "337e950eeb... |
6e8feac5-633c-4e62-a7c7-a73379e22b72 | raincross7/code-similarity | codes/train_code/problem049/problem049_182.cpp | #include <iostream>
#include <algorithm>
#include <queue>
#include <vector>
#include <cstring>
#include <list>
using namespace std;
#define INF (INT_MAX/2)
#define MAXV 10001
#define MAXE 100001
#define NIL -1
list<int> ans;
bool vis[MAXV];
int head[MAXE], indegree[MAXV];
int cnt;
struct Edge {
int to, nex... | ALGO | 0.999981 | 4.336354 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-03-06T05:07:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "caaa495c06ba... |
49bbedff-9aff-4ad3-b62b-466290690b54 | alebergamo/vlg_extractor | src/ssim/SelfSimDescriptor_fc.cpp | // This is based on <NAME> contribution. Below is the original copyright:
//
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to t... | ALGO | 0.997799 | 5.018984 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2016-05-07T20:49:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 6,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "33215986a4... |
4cc9f4ec-d7d9-4363-bf94-026fa4caf0b4 | agusbes7/Practica-AEDD | guias basicas/guia7vectores.cpp | #include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
#define N 100
void cargarvector(int a[],int tl);
void cargarvectorR(int a[],int tl);
void mostrarvector(int a[],int tl);
void rotarder(int a[],int);
void rotarizq(int a[],int);
void eliminar(int a[],int& tl,int indice);
void agregar(int a[],in... | ALGO | 0.997842 | 3.32931 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2025-03-29T18:50: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": "11410f2aea0... |
0eff06b4-e8f1-46d1-af0c-c385a937573f | JisuHann/Algorithm_BOJ | 10845.cpp | //BaekJoon Problem: https://www.acmicpc.net/problem/10845
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int queue[10000];
int top = 0, bottom = 0, num = 0;
void push(int x) {
queue[bottom++] = x;
++num;
}
void pop() {
if (num != 0) {
printf("%d\n", queue[top++]);
--num;
... | ALGO | 0.999276 | 4.153362 | {
"github_metadata": {
"branch": "master",
"commit_count": 185,
"repo_created_at": "2019-06-21T09:50:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e899dd11... |
bb205e6b-396b-4872-bced-dc1d11bfbc47 | EXAPARS/FMM-lib | src/LB/LBMortonSyncMPI.hpp | /*
Copyright 2015 - UVSQ
Authors list: <NAME>, <NAME>
This file is part of the FMM-lib.
FMM-lib is free software: you can redistribute it and/or modify it under the
terms of the GNU Lesser General Public License as published by the Free Software
Foundation, either version 3 of the License, or (at your opt... | ALGO | 0.997888 | 5.682106 | {
"github_metadata": {
"branch": "master",
"commit_count": 77,
"repo_created_at": "2015-11-25T17:17:55.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0b5c62d459... |
5105fe66-ba16-4cde-89bf-b74bd471aab2 | CrustyAuklet/freertos-bug-repro | include/larid/inplace_function.hpp | /*
* Boost Software License - Version 1.0 - August 17th, 2003
*
* Permission is hereby granted, free of charge, to any person or organization
* obtaining a copy of the software and accompanying documentation covered by
* this license (the "Software") to use, reproduce, display, distribute,
* execute, and transmit the S... | TOOL | 0.904462 | 7.721457 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-07-25T22:46: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": "5e5b5cb5d4c9... |
e29bb6c1-b7c3-470e-9859-5c8c243d4e6e | rikuTanide/atcoder_endeavor | apc001/apc001_e.cpp | #include <bits/stdc++.h>
const double PI = 3.14159265358979323846;
using namespace std;
typedef long long ll;
const double EPS = 1e-9;
#define rep(i, n) for (int i = 0; i < (n); ++i)
//#define rep(i, n) for (ll i = 0; i < (n); ++i)
//typedef pair<ll, ll> P;
typedef pair<ll, ll> P;
const ll INF = 10e17;
#define cmin(x,... | ALGO | 0.999388 | 3.991804 | {
"github_metadata": {
"branch": "master",
"commit_count": 4423,
"repo_created_at": "2020-12-05T04:36:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8a0037a... |
c19ad162-3c39-438f-bfef-ed66beaa4f68 | AlexAksentyev/CPP_INTEGRATOR | src/right_hand_side.cc | // TODO:
// * add E_field_prime and update the energy formula (required? by the RF element)
#include "right_hand_side.h"
#include "particle.h"
#include "element.h"
#include <boost/numeric/odeint.hpp>
using namespace std;
using namespace rhs;
using namespace element;
RightHandSide::RightHandSide(Particle& reference,... | ALGO | 0.996569 | 4.912821 | {
"github_metadata": {
"branch": "master",
"commit_count": 159,
"repo_created_at": "2018-01-26T14:12: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": "f13fb149... |
ace593c7-1d3b-4445-975f-b903d7adb1aa | donikgoxha/Object-Oriented-Programming-24-25 | prv_kolok_zad_courses/prv_kolok_zad11.cpp | #include <iostream>
#include <cstring>
using namespace std;
class Ucesnik {
char *name;
bool male; //true = male ,false = female
int age;
void copy(const Ucesnik &other) {
this->name = new char [strlen(other.name) + 1];
strcpy(this->name, other.name);
this->male = other.male;
... | ALGO | 0.970623 | 3.723758 | {
"github_metadata": {
"branch": "main",
"commit_count": 35,
"repo_created_at": "2025-01-17T01:09: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": "b6a8700ce38... |
7ad10414-7317-4f60-933d-e0d3aaf11625 | akifislam/Competitive-Programming | 2021/#5. June 2021/B_Just_Eat_It_.cpp | #include <bits/stdc++.h>
using namespace std;
#define finish(x) return cout << x << endl, 0
#define ll long long
bool solve()
{
int n;
cin >> n;
vector<int> a(n);
for (int i = 0; i < n; i++)
{
cin >> a[i];
}
ll sum = 0;
//Checking from left
for (int i = 0; i < n; i++)
... | ALGO | 0.999919 | 5.148141 | {
"github_metadata": {
"branch": "main",
"commit_count": 41,
"repo_created_at": "2021-03-10T20:26: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": "510d787d9b3... |
d7371278-2908-472e-8eee-1eedfae8d899 | starCloudXY/chfs | src/include/rsm/raft/node.h | #pragma once
#include <atomic>
#include <mutex>
#include <chrono>
#include <thread>
#include <ctime>
#include <algorithm>
#include <thread>
#include <memory>
#include <stdarg.h>
#include <unistd.h>
#include <filesystem>
#include "rsm/state_machine.h"
#include "rsm/raft/log.h"
#include "rsm/raft/protocol.h"
#include "... | TOOL | 0.906337 | 6.795536 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2024-01-16T00:52:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4bda9d8733f... |
4fb86ae1-4884-4133-9d25-29fd6192a9ac | jaehoo1/Baekjoon-Online-Judge | BOJ/10000 ~ 19999/16973.cpp | # include <iostream>
# include <queue>
using namespace std;
typedef struct {
int x, y;
}pos;
int N, M, H, W, FR, FC, cou;
bool map[1002][1002], visited[1002][1002];
queue<pos> q;
bool cango(pos cur, char vec) {
if(vec=='U') {
if(cur.x==1)return false;
if(visited[cur.x-1][cur.y])return false;
for(int j=cur.y... | ALGO | 0.999906 | 3.627502 | {
"github_metadata": {
"branch": "master",
"commit_count": 1534,
"repo_created_at": "2021-03-06T07:36:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "da3acc1... |
e8752982-85da-4296-9891-9ca5f385d664 | ishandutta2007/codeforces-i | intothenight/normal/1598/B.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
cin.tie(0)->sync_with_stdio(0);
cin.exceptions(ios::badbit | ios::failbit);
auto __solve_tc = [&](auto __tc_num)->int{
int n;
cin >> n;
vector<vector<int>> a(n, vector<int>(5));
for(auto i = 0; i < n; ++ i){
for(auto j = 0; j < 5; ++ j){
cin... | ALGO | 0.999896 | 5.604044 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T05:39: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": "1a14530c9b99... |
30e75a48-a8f1-46d6-abc5-28f254ced494 | joel2995/Striver-A-Z-DSA-Sheet-Cpp | 16. DP/1D - DP/climbing_stairs.cpp | // Input:
// n = 3
// Output:
// 3
// Explanation:
// There are three ways to climb to the top.
// 1. 1 step + 1 step + 1 step
// 2. 1 step + 2 steps
// 3. 2 steps + 1 step
// Recursion
int climbStairs(int n)
{
if(n==0) return 1;
if(n<0) return 0;
return climbStairs(n-1)+climbStairs(n-2);
}
// Memoiza... | ALGO | 0.999994 | 6.381292 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-01-11T06:24:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "96e6316a0888... |
40d09aa0-9803-465d-920d-009297415c29 | StrunetsD/PPOIS | sem_1/lab_4/src/VertexIter.h | #pragma once
#include <iostream>
#include <vector>
#include <algorithm>
#include <iterator>
#include <stdexcept>
#ifndef VERTEXITER_H
#define VERTEXITER_H
template <typename GraphType, typename T>
class VertexIterator {
public:
using iterator_category = std::bidirectional_iterator_tag;
using value_type = T;
... | TOOL | 0.974886 | 6.628541 | {
"github_metadata": {
"branch": "main",
"commit_count": 40,
"repo_created_at": "2024-09-28T07:54: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": "0e74e78a3de... |
2b21b8a1-7e18-474a-9fb6-e482803cb308 | silicontrip/SkyReader | checksum.cpp | #include "checksum.h"
/*
data checksums
The checksums are a mess. There are four "types" of checksums:
Type 0: this is a CRC16 checksum of the first 0x1E unsigned chars of sector 0. The checksum itself is stored in block 0x01, offset 0x0E.
Type 1: this is a CRC16 checksum of the data area header. As there are two data... | TOOL | 0.946553 | 5.690167 | {
"github_metadata": {
"branch": "master",
"commit_count": 55,
"repo_created_at": "2013-01-24T22:31:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 92,
"forks": 55,
"issues": 24,
"pull_requests": 2
},
"file_meta": {
"content_id": "57d522... |
82a40929-5a88-4f49-bd9d-06d064adc01a | Haudkozaur/masterThesis | Solver/solver.h | #ifndef SOLVER_H
#define SOLVER_H
#include "node.h"
#include "nodeload.h"
#include "nodesupport.h"
#include "member.h"
#include "uniformload.h"
#include "matrixoperations.h"
#include "MemberSupportConditions.h"
#include "../DataBaseManagers/DataBaseManagers.h"
#include <Eigen/Dense>
#include <map>
// Forward declarat... | ALGO | 0.972681 | 5.968089 | {
"github_metadata": {
"branch": "master",
"commit_count": 92,
"repo_created_at": "2023-08-15T20:02: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": "81d981834... |
dbbe9a7b-2597-45cd-862d-d51b62f9de6f | zhengwei101/DesignPatterns | 结构型设计模式/组合模式/Composite.cpp | #include <iostream>
#include <list>
#include <string>
#include <algorithm>
using std::cout;
using std::endl;
class Component
{
public:
virtual void process() = 0;
virtual ~Component() {}
};
// 树节点
class Composite : public Component
{
std::string name;
std::list<Component *> elements;
public:
Com... | TOOL | 0.927145 | 5.620961 | {
"github_metadata": {
"branch": "dev",
"commit_count": 21,
"repo_created_at": "2024-04-02T05:07:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2db7c8e152dc... |
232c91d8-9d9a-4377-bd2b-a231eb50d739 | maknunlakme/Uva-Solutions | 872.1.cpp | #include<iostream>
#include<vector>
#include<cstring>
#include<sstream>
#include<map>
#include<algorithm>
#define X 50
using namespace std;
int mat[X][X];
vector<string>arr;
map<string,int>mark;
int visit[X];
char answer[X];
int length;
bool no;
int check(int pos,int len)
{
//cerr<<"BLAH "<<pos<<" "<<len<<endl;
... | ALGO | 0.999962 | 3.954578 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2018-11-27T12:29: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": "70a97afbe8... |
03d32550-7a5b-4462-a234-f9f0c9ac6168 | danieltrt/SBFL | results/PRINT_POSSIBLE_STRINGS_CAN_MADE_PLACING_SPACES_2.java.cpp | void printSubsequences ( string s ) {
string :: size_type pos = s . find ( " " ) ;
if ( pos != string :: npos ) {
int n = s . length ( ) ;
int opsize = ( int ) ( pow ( 2 , n - 1 ) ) ;
for ( int counter = 0 ;
counter < opsize ;
counter ++ ) {
for ( int j = 0 ;
j < n ;
j ++ ) {
... | ALGO | 0.986038 | 3.77461 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2022-08-03T19:59: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": "5b0e427d0439... |
323dc02b-e7d6-411a-998f-ef4e826cf9ef | Shawn314/myleetcode | 78.子集.cpp | /*
* @lc app=leetcode.cn id=78 lang=cpp
*
* [78] 子集
*
* https://leetcode-cn.com/problems/subsets/description/
*
* algorithms
* Medium (74.28%)
* Total Accepted: 30.1K
* Total Submissions: 40.4K
* Testcase Example: '[1,2,3]'
*
* 给定一组不含重复元素的整数数组 nums,返回该数组所有可能的子集(幂集)。
*
* 说明:解集不能包含重复的子集。
*
* 示例:
*... | ALGO | 0.99988 | 6.106704 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2019-05-31T02:29: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": "eca29a1c6... |
a464560c-37c3-4940-8bad-493f145726f6 | kulhanek/nemesis | src/lib/NemesisCore/selection/masks/asl/ASLSelection.cpp | // =============================================================================
// NEMESIS - Molecular Modelling Package
// -----------------------------------------------------------------------------
// Copyright (C) 2011 <NAME>, <EMAIL>
// This code is based on ASL mask implementation in
// ... | TOOL | 0.922898 | 5.532935 | {
"github_metadata": {
"branch": "24.x",
"commit_count": 127,
"repo_created_at": "2015-12-03T16:41: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": "7ff6693e1d... |
99d955d5-2d2d-4545-abd7-c7ca281038b7 | rummansust/Codeforces-Contest | Codeforces/Codeforces Round #145 (Div. 2, ACM-ICPC Rules)/F. Fence.cpp | #include <bits/stdc++.h>
using namespace std;
#define SZ(x) ((int)x.size())
#define all(a) a.begin(),a.end()
#define allr(a) a.rbegin(),a.rend()
#define clrall(name,val) memset(name,(val),sizeof(name));
#define EPS 10e-9
#define ll long long
#define ull long long unsigned
#define SF scanf
#define PF printf
#define ps... | ALGO | 0.999965 | 3.482675 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2017-12-26T22:16: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": "b05d44718... |
d250988d-8c96-43d3-916e-5db61fa2d27b | yongukpark/BOJ | Brute force/1248.cpp | //확인을 위한 함수를 하나 만들어야 한다는 점에서 조금 복잡했던 문제였음
//check 함수와 같이 sum을 이용하여 한번에 계산하지 않으면 시간초과가 날수도 있다고 생각되는 문제임
#include <iostream>
using namespace std;
int num;
char arr[11][11];
int res[11];
bool check(int a)
{
int sum = 0;
for(int i = a ; i >= 0 ; i--)
{
sum += res[i];
if(arr[i][a] == '+' && sum... | ALGO | 0.999968 | 4.045865 | {
"github_metadata": {
"branch": "main",
"commit_count": 351,
"repo_created_at": "2021-11-18T11:45: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": "2240d23aa4... |
67cef788-bfe2-4851-8e17-bdc4fd1d4689 | HannahJHan/BlueNoiseSampling | 18-utk-master/src/discrepancy/SymmetricL2Discrepancy.hpp | /*
* <NAME> <EMAIL>
* and <NAME> <EMAIL>
*
* Copyright (c) 2018 CNRS Université de Lyon
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain ... | ALGO | 0.931692 | 6.405063 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-10-20T09:26:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "735557fb36... |
d30b9023-7f54-4126-b7dc-d2573e1e6273 | haotianteng/PHANTOM-toolbox | c_Intersect.cpp | /*==========================================================
* arrayProduct.c - example in MATLAB External Interfaces
*
* Multiplies an input scalar (multiplier)
* times a 1xN matrix (inMatrix)
* and outputs a 1xN matrix (outMatrix)
*
* The calling syntax is:
*
* outMatrix = arrayProduct(multiplier, inMatrix... | ALGO | 0.999743 | 5.188684 | {
"github_metadata": {
"branch": "master",
"commit_count": 24,
"repo_created_at": "2016-04-28T21:02: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": "c65ee4ce2... |
0002315e-3aa6-46c7-92cd-2964059adcec | ilrexho2011/Project-EULER-Possible-Solutions-Problems-401_to_500 | Exercise 471/Exercise 471.cpp | #include <stdio.h>
#include <time.h>
#include <math.h>
#include <string.h>
typedef unsigned int uint;
typedef unsigned long long ull;
/*
r = b(a-2b)/(a-b)
= b(a-b-b)/(a-b)
= b - b^2/(a-b)
*/
static const uint nmax = 1e7;
static double S[nmax];
static double S2 (ull n)
{
if (n<nmax)
return S[n];
const do... | ALGO | 0.99945 | 3.589233 | {
"github_metadata": {
"branch": "main",
"commit_count": 304,
"repo_created_at": "2024-01-13T11:56: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": "5dd96b6b1c... |
2975832d-e3d7-42b1-b4a8-d6e41427cdd8 | AHMET-CAGDAS-GIRIT/REPOSITORY | sudoku/sudoku.cpp | #include <stdio.h>
#include <cstdlib>
bool checker(int board[9][9],bool isItOriginal[9][9],int rowNumber ,int columnNumber ,int inputValue){
if(isItOriginal[rowNumber][columnNumber]){
return false;
}
for(int i = 0; i < 9 ; i++){
if(board[i][columnNumber] == inputValue){
return f... | ALGO | 0.972412 | 4.185606 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2023-08-08T15:08: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": "9a4d9530d68... |
b3c3e007-dd66-4421-95b7-0ec2796e3ae2 | dhs347/Dream | Team_Training/16、2019-nowcoder-multi-5/标程/2019牛客暑期多校训练营第五场标程/subsequence1.cpp | #include<cstdio>
const int MAX_N = 3005;
const int MOD = 998244353;
int n, m;
char s[MAX_N], t[MAX_N];
long long C[MAX_N][MAX_N];
void ADD(long long &x, long long v) {
x += v;
if(x >= MOD) x -= MOD;
}
void pre() {
for(int i = 0;i < MAX_N; i++) {
C[i][0] = 1;
for(int j = 1;j <= i; j++) {
... | ALGO | 0.999988 | 4.65529 | {
"github_metadata": {
"branch": "master",
"commit_count": 1232,
"repo_created_at": "2019-09-26T15:21:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 16,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d1883c... |
61f4a6dc-abdb-4051-a8c3-27533fe0ffa8 | kumar8317/dsa | 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.999966 | 5.504679 | {
"github_metadata": {
"branch": "main",
"commit_count": 700,
"repo_created_at": "2024-02-01T09:51:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5c55496d92... |
d6a1be23-682c-47be-9769-ccd1f3bc00bf | squaresLab/BatFix | results/transcoder/translations/py/COUNT_NUMBERS_CAN_CONSTRUCTED_USING_TWO_NUMBERS.cpp | public : int countNums ( int n , int x , int y ) {
bool arr [ n + 2 ] ;
arr [ 0 ] = false ;
arr [ 1 ] = false ;
if ( ( x <= n ) && ( x < n ) ) arr [ x ] = true ;
if ( ( y <= n ) && ( y < n ) ) arr [ y ] = true ;
int result = 0 ;
for ( int i = min ( x , y ) ;
i <= n ;
i ++ ) {
if ( ( arr [ i ] ) ) ... | ALGO | 0.99983 | 4.456468 | {
"github_metadata": {
"branch": "main",
"commit_count": 26,
"repo_created_at": "2023-05-21T15:21:59.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 5,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "80e5081729bb... |
fbc5e98b-06ac-40f1-a661-b8716818ee6a | Mahak008/Data-Structures-and-Algorithms | Backtracking/Path with Maximum Gold.cpp | int find(vector<vector<int>>& grid, int i, int j, vector<pair<int, int>>& dir) {
if (i >= grid.size() || i < 0 || j >= grid[0].size() || j < 0 ||
grid[i][j] == 0) {
return 0;
}
int val = grid[i][j];
grid[i][j] = 0;
int maxGold = 0;
for (auto d : dir) {
int row = i + d.f... | ALGO | 0.99992 | 6.127073 | {
"github_metadata": {
"branch": "main",
"commit_count": 1194,
"repo_created_at": "2023-07-14T04:18: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": "1874e264b... |
d09367d2-1c45-42eb-b5da-384a61b58c13 | AyushYadav/competetiveArchive | linkedlist.cpp | #include <iostream>
using namespace std;
typedef struct node{
int data;
struct node* next;
}node;
/*
1-- to create the head
2-- to add a node to the given linked list at the end
3-- to add the node before the head
4-- to add the node to the 'i' position in the linked list
5-- print the linked list
6-- reverse the ... | ALGO | 0.999982 | 4.336189 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2017-10-19T04:32:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2691067859... |
64175a25-883f-4a46-9196-d2a4a57ac3a3 | NilFoundation/crypto3 | libs/block/include/nil/crypto3/block/md4.hpp | //---------------------------------------------------------------------------//
// Copyright (c) 2018-2020 <NAME> <<EMAIL>>
// Copyright (c) 2020 <NAME> <<EMAIL>>
//
// MIT License
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (... | ALGO | 0.941028 | 7.658401 | {
"github_metadata": {
"branch": "master",
"commit_count": 10456,
"repo_created_at": "2019-04-13T23:20:12.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 84,
"forks": 13,
"issues": 44,
"pull_requests": 9
},
"file_meta": {
"content_id": "2054... |
4267e7e5-f571-4dce-87ea-78ad23b81e28 | yogeshvishnole/DSA-1 | 2023-cherno-and-ankit-thak/dsa/section-10-binary-search/p3-binary-search.cpp | /*
Binary serach is efiicient algorithm to search elements sorted in arrays in O(logn) time
*/
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
// using iteration
int binarySearch(vector<int> const &v, int key)
{
int start = 0;
int end = v.size() - 1;
int middle;
whil... | ALGO | 0.999956 | 5.650851 | {
"github_metadata": {
"branch": "master",
"commit_count": 24,
"repo_created_at": "2023-08-15T06:50: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": "be076e720... |
8be60b74-2244-4043-ae1d-864d6c72bdc6 | nhatcoi/myos | src/modules/math_functions.cpp | #include <common/types.h>
using namespace myos::common;
// Hàm tính căn bậc hai sử dụng phương pháp Newton
int32_t sqrt_int(int32_t x)
{
if(x <= 1) return x;
int32_t guess = x / 2;
int32_t prev_guess;
for(int i = 0; i < 10; i++)
{
prev_guess = guess;
guess = (guess + x / ... | TOOL | 0.996171 | 4.293071 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2025-06-11T10:50: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": "a602e447b9d... |
d589e787-d5f8-4db6-91fd-ef4a4dc66712 | rprakashdass/Leetcode-Problems | DSA/Medium/86. Partition List/bruiteForceApproach.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
ListNode* partition(L... | ALGO | 0.999993 | 5.481553 | {
"github_metadata": {
"branch": "main",
"commit_count": 405,
"repo_created_at": "2024-05-29T01:48:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "325b46c1b6... |
08ddeff1-3064-4a51-90c2-6d04a102d202 | CraigDaGama/Computer-Engineering | Operating Systems (TE)/Experiment3/SJFWA.cpp | //SJF with Arrival
#include<iostream>
using namespace std;
int main()
{
int n; // Number of processes
cout << "Enter the number of processes: ";
cin >> n;
int temp, Min = 0, k = 1, sum = 0;
int p[n]; // Array to store process numbers
int BT[n]; // Array to store burst times
int AT[n]; // A... | ALGO | 0.999995 | 4.513157 | {
"github_metadata": {
"branch": "main",
"commit_count": 97,
"repo_created_at": "2024-08-15T11:41: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": "d595173290d... |
5b8aa219-1f33-481e-bb67-d47dfe4d65fc | jchengai/gpir | common/utils/math.h | /**
* Copyright (C) 2022, RAM-LAB, Hong Kong University of Science and Technology
* This file is part of GPIR (https://github.com/jchengai/gpir).
* If you find this repo helpful, please cite the respective publication as
* listed on the above website.
*/
#pragma once
namespace common {
double NormalizeAngle(con... | TOOL | 0.942327 | 7.242532 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2021-07-01T05:24:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 244,
"forks": 54,
"issues": 4,
"pull_requests": 0
},
"file_meta": {
"content_id": "2392f719a... |
d32f906f-aa29-4c79-9fc6-ac63a6ecce12 | viren-sureja/Love-Babbar-450 | 07_binary_search_trees/20_check_wether_BST_contains_dead_end.cpp | /*
link: https://practice.geeksforgeeks.org/problems/check-whether-bst-contains-dead-end/1
sol: https://www.geeksforgeeks.org/check-whether-bst-contains-dead-end-not/
*/
// ----------------------------------------------------------------------------------------------------------------------- //
/*
usin... | ALGO | 0.999997 | 4.42677 | {
"github_metadata": {
"branch": "master",
"commit_count": 49,
"repo_created_at": "2021-03-21T14:17:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 356,
"forks": 169,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "a50a2... |
5faaa61a-fe7d-4141-a044-a7f9740c95e0 | antusaha970/My-source-code-DSA | leetcode/middleOflinkedlst.cpp | #include <iostream>
using namespace std;
struct ListNode
{
int val;
struct ListNode *next;
};
struct ListNode *middleNode(struct ListNode *head)
{
int count = 0;
struct ListNode*p = head;
struct ListNode*q = head;
while (p!=NULL)
{
p = p->next ;
count++;
}
if (count... | ALGO | 0.999731 | 4.767385 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2022-09-26T19:01: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": "b5c9fe71e... |
12541338-8944-41ea-8c86-280b3e72d329 | itsvijaychoudhary/CPP | bubble_sort.cpp | #include <iostream>
using namespace std;
// using sorting function for bubble sorting //
void BubbleSort(int arr[], int n)
{
int i, j, temp;
for (i = 0; i < n - 1; i++)
{
for (j = i + 1; j < n; j++)
{
if (arr[i] > arr[j])
{
temp = arr[i];
arr[i] = arr[j];
arr[j] = tem... | ALGO | 0.999968 | 5.416611 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2022-07-01T05:22: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": "a514ec376... |
067ff45f-91dc-4bcf-a32a-db9fc1b01d19 | damu1000/hypre_ep | hypre_ep/src/FEI_mv/ml/src/Include/ml_epetra_utils.h | /*BHEADER**********************************************************************
* Copyright (c) 2008, Lawrence Livermore National Security, LLC.
* Produced at the Lawrence Livermore National Laboratory.
* This file is part of HYPRE. See file COPYRIGHT for details.
*
* HYPRE is free software; you can redistribute... | TOOL | 0.93666 | 6.553889 | {
"github_metadata": {
"branch": "master",
"commit_count": 46,
"repo_created_at": "2015-09-03T17:52:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "975ba2814... |
f3d75f2a-a456-4bcf-837b-1bd86cf9da24 | Nazmul-Hassan10/problem-solving-club | week 4/right_left_wrong.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int t;
cin >> t;
while (t--) {
int n;
cin >> n;
vector<int> a(n);
for (int i = 0; i < n; i++) {
cin >> a[i];
}
string s;
... | ALGO | 0.999543 | 4.912822 | {
"github_metadata": {
"branch": "main",
"commit_count": 88,
"repo_created_at": "2024-10-26T18:16: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": "e9c6587a295... |
c03cd465-32e5-49f0-b810-434825a82e7d | shuliaka95/programming | 6.1.cpp | #include <iostream>
#include <string>
struct Student {
std::string name;
int age;
int course;
char gender;
double gpa;
};
void print_students(const Student students[], int size) {
for (int i = 0; i < size; ++i) {
std::cout << "ФИО: " << students[i].name << ", Возраст: " << students[i].... | TOOL | 0.934895 | 4.614327 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2024-12-09T15:44:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "4b1c81f7106... |
095c82eb-7211-4685-ba38-633313387767 | dipietrantonio/PBRTParser | src/utils.cpp | #include "utils.h"
//
// read_file
// Load a text file as a string.
//
std::string read_file(std::string filename) {
std::fstream inputFile;
inputFile.open(filename, std::ios::in);
std::stringstream ss;
std::string line;
while (std::getline(inputFile, line)) {
ss << line << "\n";
}
// set filename and path pr... | TOOL | 0.951497 | 5.295296 | {
"github_metadata": {
"branch": "master",
"commit_count": 50,
"repo_created_at": "2018-02-18T17:24:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d03f3fb3f... |
c7c761aa-085b-44ca-b066-816386e2036f | russellkoons/learning-c- | 15constant/01constant.cpp | #include <iostream>
// Constants
using namespace std;
class Demo
{
public:
int x = 10;
int y = 20;
void Display()const // This makes the ints unmodifiable
{
// x++;
cout << x << " " << y << endl;
}
};
void fun(const int &x, int &y) // Adding const to params makes x unmodifiable al... | TOOL | 0.918312 | 4.007251 | {
"github_metadata": {
"branch": "master",
"commit_count": 124,
"repo_created_at": "2019-05-02T12:18: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": "31be4230... |
f1edb2a0-5a6d-49b3-a3f1-e5f55b57b8d4 | HaruteGG/CPE-DS | tips.cpp | bool cmp(int a, int b) {
if(a % m != b % m) return a % m < b % m;
if(abs(a % 2) != abs(b % 2)) return a % 2;
return a % 2 == 0 ? a < b : a > b;
}
const int N = 1e6; // 1000000
bool isP[N+1];
vector<int>primes;
int main() {
for(int i=2; i<=N; i++) isP[i] = true;
for(int i=2; i<=N; i++) {
if (isP[i]) primes.push... | ALGO | 0.999911 | 3.901564 | {
"github_metadata": {
"branch": "main",
"commit_count": 347,
"repo_created_at": "2021-02-24T01:19:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "eb529c4734... |
ba7b14c4-7c4e-4e42-a252-a98427152998 | Aadarsh45/leetcode | 2493-reverse-odd-levels-of-binary-tree/2493-reverse-odd-levels-of-binary-tree.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.999989 | 6.330605 | {
"github_metadata": {
"branch": "main",
"commit_count": 2462,
"repo_created_at": "2023-01-30T17:52:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e96f9357a... |
ec276cbf-f476-412b-8e37-1331034c2752 | nguyenchiemminhvu/DSA | Problems/SortingAndSearching/FriendsOfAppropriateAges/main.cpp | /**
https://leetcode.com/problems/friends-of-appropriate-ages/
There are n persons on a social media website. You are given an integer array ages where ages[i] is the age of the ith person.
A Person x will not send a friend request to a person y (x != y) if any of the following conditions is true:
age[y] <= 0.5 * ag... | ALGO | 0.999494 | 5.7922 | {
"github_metadata": {
"branch": "main",
"commit_count": 471,
"repo_created_at": "2024-06-30T06:28:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e45d768a78... |
c1c317cc-ed2a-4204-8d9f-3512c215569e | jeonggyunkim/problemsolving | boj/b592d482dd51.cpp | #include <iostream>
#include <memory.h>
using namespace std;
int dp[5001][5001];
int p[5001][5001];
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
memset(dp, -1, sizeof(dp));
int n, a, l;
cin >> n >> a >> l;
dp[0][l] = a;
int x, y;
for (int i = 1; i <= n; ++i) {
cin >> x >> y;
for (int j = 0; j <= 5... | ALGO | 0.999962 | 3.317804 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2020-10-04T16:52:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2d547296b... |
0e3816e7-96c3-48ca-a462-f3e1ba08bc9a | ablondal/comp-prog | Practice/2023/Mar_20/Telephone_Poles.cpp | #include <bits/stdc++.h>
using namespace std;
// incomplete
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef complex<double> cd;
int G[2007][2007] = {... | ALGO | 0.9999 | 3.287034 | {
"github_metadata": {
"branch": "master",
"commit_count": 67,
"repo_created_at": "2020-02-27T21:30:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3d0de54a7... |
40954436-ef81-4ab0-a8ee-30514bc870a0 | Rudreshwar-S/POJ | 2242.cpp | #define _USE_MATH_DEFINES
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<math.h>
#include<iomanip>
using namespace std;
typedef long long ll;
int main()
{
double x1,y1,x2,y2,x3,y3;
while(cin>>x1>>y1>>x2>>y2>>x3>>y3)
{
double midx1,midx2,midy1,midy2;
midx1 =... | ALGO | 0.99974 | 3.822328 | {
"github_metadata": {
"branch": "master",
"commit_count": 31,
"repo_created_at": "2020-09-17T19:27:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f9ecae6dd... |
a80d1fc7-53ce-4efd-9c68-84683894ee83 | leezear2019/bishi | L0094.cpp | //
// Created by root on 2020/9/14.
//
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
#include "leetcode.h"
using namespace std;
class Solution {
public:
void dfs(... | ALGO | 0.999936 | 6.795283 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2020-09-13T10:16:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ff0c91b4a2... |
a9d61393-6c34-4c4c-b692-699c50caa2ea | dfranx/SHADERed | src/SHADERed/UI/Debug/VectorWatchUI.cpp | #include <SHADERed/UI/Debug/VectorWatchUI.h>
#include <SHADERed/UI/UIHelper.h>
#include <SHADERed/Engine/GLUtils.h>
#include <SHADERed/Objects/DefaultState.h>
#include <SHADERed/Objects/Settings.h>
#include <SHADERed/Engine/GeometryFactory.h>
#include <imgui/imgui.h>
#include <glm/gtc/type_ptr.hpp>
#include <glm/gtc/m... | TOOL | 0.905342 | 5.502412 | {
"github_metadata": {
"branch": "master",
"commit_count": 916,
"repo_created_at": "2018-09-22T23:34:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4586,
"forks": 300,
"issues": 106,
"pull_requests": 14
},
"file_meta": {
"content_id": "... |
5838905d-3d5b-44b9-a05d-5cfa8fe9cba7 | Ghanshyam444/DSA-Lab-Assignments | DSA_10_DoublyLL.cpp | //writing a program for doubly linked list operations
#include<iostream>
using namespace std;
// Constructing Node
struct node{
int data;
struct node *next,*prev;
};
// Creating Class for Doubly Linked List
class Doubly_Linked_List{
struct node *head,*end,*t,*new_node;
public :
Doubly_Linked_List(){ //Defining a constr... | ALGO | 0.999934 | 5.617499 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-01-03T11:51: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": "1bf3cd09e5a1... |
198f3f4e-2415-4903-b725-3bf9c021a16f | Danncode10/Cpp-projects | Pattern Printing Program/6.2.cpp | #include <iostream>
#include <ctime>
#include <cstdlib>
using namespace std;
int main() {
int n = 10;
char b = ' ';
int sym;
srand(time(0));
int loop;
do{
// Upper part of the diamond
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= n - i; j++) {
cout << b;
... | ALGO | 0.998499 | 3.533277 | {
"github_metadata": {
"branch": "main",
"commit_count": 56,
"repo_created_at": "2024-02-19T10:50:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "384a3b70e3b... |
bda595eb-fbce-48bd-a71c-5eab3c226afb | jiebaomaster/fuckleetcode | data_structure/树/层序遍历/103.二叉树的锯齿形层序遍历.cpp | /**
* https://leetcode-cn.com/problems/binary-tree-zigzag-level-order-traversal/
* 方法一:基于双端队列的层序遍历
* 关键在于保持双端队列中的结点顺序永远是从左往右的
*/
class Solution {
public:
vector<vector<int>> zigzagLevelOrder(TreeNode* root) {
vector<vector<int>> ret;
if (!root) return ret;
deque<TreeNode*> q; // 双端队列
vector<int>... | ALGO | 0.999994 | 6.14682 | {
"github_metadata": {
"branch": "master",
"commit_count": 136,
"repo_created_at": "2021-08-24T06:16: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": "2af21890... |
194ac01d-0168-4911-9866-a325896216a9 | carstenhagelgans/transfers | include/transfers/transfer/transfer_result.h | #pragma once
#include <ostream>
#include <string>
#include <vector>
#include "transfers/transfer/transfer_request.h"
#include "transfers/types.h"
#include "ppr/common/routing_graph.h"
#include "ppr/routing/routing_query.h"
#include "ppr/routing/search_profile.h"
#include "nigiri/types.h"
namespace transfers {
str... | ALGO | 0.978021 | 7.269556 | {
"github_metadata": {
"branch": "main",
"commit_count": 34,
"repo_created_at": "2023-10-25T06:20:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fd95cf4d7dd... |
ccf7e7fc-497b-4f46-8cf4-304ae693c231 | RaulGhisa/rc-car-microcontroller | main/drive.cpp | #include "drive.h"
#include "Arduino.h"
#define MOTOR_B_ENABLE 6
#define MOTOR_B_BWD 7
#define MOTOR_B_FWD 8
#define SERVO_A_BWD 9
#define SERVO_A_FWD 10
#define SERVO_A_ENABLE 11
#define SERVO_POT A0
int ref;
float P_CONSTANT = .55;
int it = 400;
int schreechingThreshold = 12;
int x_final = 0;
int y_final = 0;
vol... | TOOL | 0.920294 | 4.937943 | {
"github_metadata": {
"branch": "main",
"commit_count": 16,
"repo_created_at": "2021-10-13T12:28:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "016d4792491... |
94a11cf2-5f5f-46ae-9293-c8c347d9ac00 | sunoogy99/codetree-TILs | 240326/마을 구분하기/seperate-village.cpp | // https://www.codetree.ai/missions/2/problems/seperate-village/description
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int n;
int grid[26][26];
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
bool visited[26][26];
vector<int> town_size;
bool InRange(int x, int y) {
return ... | ALGO | 0.999928 | 5.13412 | {
"github_metadata": {
"branch": "main",
"commit_count": 318,
"repo_created_at": "2024-02-24T15:48:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8e5aba191f... |
2a495c66-3af0-4667-9c64-a13b8ff6bdbe | marko1597/Programming-competitions | Longest Contiguous Subsequence.cpp | #include <cstdio>
#include <cstring>
#include <iostream>
#include <math.h>
#include <string>
#include <sstream>
#include <iomanip>
#include <stdio.h>
#include <stdlib.h>
#include <ctime>
#include <time.h>
#include <string.h>
#include <algorithm>
#include <queue>
#include <stack>
#include <vector>
#include <map>
#includ... | ALGO | 0.999954 | 3.492073 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2015-10-25T16:37: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": "24c9fd4839... |
033a11c7-6bc1-4298-99c4-f3e55cf3065f | etengabeko/openedu | algds/les_3/3.1/main.cxx | #include <algorithm>
#include <fstream>
#include <iostream>
#include <map>
#include <sstream>
#include <string>
#include <vector>
#ifndef STREAM_TYPE
#define STREAM_TYPE "file"
#endif // STREAM_TYPE
namespace
{
bool is_file_stream(const std::string& type)
{
return type == "file";
}
template <typename T>
std::is... | ALGO | 0.99975 | 4.788299 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2017-02-22T06:32: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": "9755bd499... |
83a896bf-5ea2-44c8-9f4d-727d2f3e20ae | agam753/Disjoint-Set | LC-2421-number-of-good-paths.cpp | // youtube --> codestoryWithMik
class DisjointSet{
vector<int> parent, size;
public:
DisjointSet(int n){
parent.resize(n+1, 0);
size.resize(n+1, 1);
for(int i = 0; i < n+1; i++) parent[i] = i;
}
int findLeader(int x){
if(parent[x] == x)
return x;
return parent[x] = findLeader(parent[x]);
... | ALGO | 0.999898 | 5.253641 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2023-01-31T17:21: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": "ffd4db5787... |
90b24068-6a82-4de9-8c94-31851a33b50c | Robertyaya/LeetCode | 116_Populating_Next_Right_Pointers_In_Each_Node.cpp | #include <bits/stdc++.h>
using namespace std;
/**
* Level-order traverse (recursive version)
* Time: O(N), Space: O(H)
* 解題流程: 因為為perfact binary tree, 因此如果current node的left node存在, 那麼left node一定是連到current-node的right node去
* a
* b c
* d e f g
* d->e 然後如果要e連到f的判斷就是
* b->next = c也就是 c->left
* 如果此時走到c, 其n... | ALGO | 0.99998 | 4.559587 | {
"github_metadata": {
"branch": "master",
"commit_count": 118,
"repo_created_at": "2020-06-15T07:48:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6ef0f91f... |
8d37be75-2a39-4086-8643-7845d1757d2f | xcf1992/leetcode | C++/find_k_length_substrings_with_no_repeated_characters.cpp | /*
1100. Find K-Length Substrings With No Repeated Characters
https://leetcode.com/problems/find-k-length-substrings-with-no-repeated-characters/
Given a string S, return the number of substrings of length K with no repeated characters.
Example 1:
Input: S = "havefunonleetcode", K = 5
Output: 6
Explanation:
There are... | ALGO | 0.999754 | 6.334156 | {
"github_metadata": {
"branch": "master",
"commit_count": 1784,
"repo_created_at": "2017-12-26T04:19:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b9bdada... |
97ce3d94-d1a9-4282-885a-921784465d5d | Supercomputing-System-AI-Lab/VecFlow | cpp/src/neighbors/ivf_flat_c.cpp |
/*
* Copyright (c) 2024, NVIDIA CORPORATION.
*
* 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... | TOOL | 0.975234 | 6.833065 | {
"github_metadata": {
"branch": "main",
"commit_count": 303,
"repo_created_at": "2025-01-25T03:55:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 14,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ead28827f... |
2d3de116-c0bf-420f-bf5d-80e7877281ae | nik09877/Competitive_Programming-DSA | D/dp_imp_hard_C_Increase_Subarray_Sums.cpp | /**
* author : <NAME>
* created : 22.02.2022 20:53:10
**/
#include "bits/stdc++.h"
using namespace std;
template <class T>
bool ckmax(T &a, const T &b)
{
return a < b ? a = b, 1 : 0;
}
// dp[i][k] denotes maximum answer ending at i such that we can increase k elements by x
int main()
{
cin.tie(0)->sy... | ALGO | 0.99987 | 4.564929 | {
"github_metadata": {
"branch": "master",
"commit_count": 349,
"repo_created_at": "2021-05-10T11:10:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "21bc22f0... |
fb4a343d-aa1b-40e6-9297-08c26a0df92f | makio93/competitive-othersites | AOJ/Problem/Volume5/0531/main1.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i=0; i<(int)(n); ++(i))
#define rep3(i, m, n) for (int i=(m); (i)<(int)(n); ++(i))
#define repr(i, n) for (int i=(int)(n)-1; (i)>=0; --(i))
#define rep3r(i, m, n) for (int i=(int)(n)-1; (i)>=(int)(m); --(i))
#define all(x) ... | ALGO | 0.999887 | 4.277523 | {
"github_metadata": {
"branch": "main",
"commit_count": 1074,
"repo_created_at": "2021-04-26T01:47: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": "e7998bcfc... |
4883a15a-ca69-4b64-982f-d135728c988c | SampadaSingh/Leetcode | 2472-build-a-matrix-with-conditions/build-a-matrix-with-conditions.cpp | class Solution {
public:
void dfs(int u, vector<int>& visited, unordered_map<int, vector<int>>& adj, stack<int>& st, bool& cycle) {
// 0=unvisited
// 1=dfs start
// 2= visited
visited[u] = 1;
for (int& v : adj[u]) {
if (visited[v] == 0) {
... | ALGO | 0.999974 | 6.023498 | {
"github_metadata": {
"branch": "main",
"commit_count": 447,
"repo_created_at": "2024-01-27T10:37:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3f8c06c62c... |
a6a83a63-6327-4034-bd1e-48ca8eabdb01 | bestdo77/acm-code-template | Contests/Atcoder/ABC_393/d.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define double long double
#define inf 0x3f3f3f3f3f3f3f3f
#define pii pair<int, int>
#define endl '\n'
mt19937_64 RNG(chrono::steady_clock::now().time_since_epoch().count());
const int N=1e6+10;
const int N1=5e3+10;
const int mod=1e9+7;
#define db(x)... | ALGO | 0.999964 | 3.908952 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2025-06-09T11:03: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": "0817257c17f... |
d3af0f85-f550-4e62-9b45-a337345c0ce3 | sparsh2002/Placement-Course-cpp | Other-Courses/Strivers_graph_series/10_shortest_distance_in_an_undirected_graph.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vii;
typedef vector<ll> vl;
typedef vector<vl> vvl;
#define rep(i,a,b) for(int i=a ; i<b ; i++)
long long INFF = 1000000000000000... | ALGO | 0.999913 | 3.772645 | {
"github_metadata": {
"branch": "master",
"commit_count": 345,
"repo_created_at": "2021-09-08T12:52:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1cd1bef0... |
6bc3d58f-31b2-4b45-b871-20823164fdc4 | vmtk/vmtk | vtkVmtk/Misc/vtkvmtkSurfaceDistance.h | /*=========================================================================
Program: VMTK
Module: $RCSfile: vtkvmtkSurfaceDistance.h,v $
Language: C++
Date: $Date: 2006/04/06 16:47:48 $
Version: $Revision: 1.4 $
Copyright (c) <NAME>, <NAME>. All rights reserved.
See LICENSE file for details.
Porti... | TOOL | 0.977959 | 6.311271 | {
"github_metadata": {
"branch": "master",
"commit_count": 1486,
"repo_created_at": "2010-08-16T21:39:39.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 385,
"forks": 174,
"issues": 77,
"pull_requests": 6
},
"file_meta": {
"content_id": "3b0... |
50e463a2-e173-4af1-a6d0-a8b71e0a3e35 | facebookresearch/ocean | impl/ocean/tracking/pattern/PatternTrackerCore6DOF.h | /*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#ifndef META_OCEAN_TRACKING_PATTERN_PATTERN_TRACKER_CORE_6DOF_H
#define META_OCEAN_TRACKING_PATTERN_PATTERN_TRACKER_CORE_6DOF_H
... | ALGO | 0.989487 | 7.236096 | {
"github_metadata": {
"branch": "main",
"commit_count": 440,
"repo_created_at": "2024-01-06T00:32:59.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 719,
"forks": 74,
"issues": 8,
"pull_requests": 3
},
"file_meta": {
"content_id": "0546b4e2... |
23316ee6-7544-41a3-b5a5-832212ec6000 | HayatEmraan/cse_fundamentals | ds/assignment 3/Same_or_Not_II.cpp | #include <bits/stdc++.h>
using namespace std;
class myStack
{
public:
list<int> l;
void push(int val)
{
l.push_back(val);
}
void pop()
{
l.pop_back();
}
int top()
{
return l.back();
}
int size()
{
return l.size();
}
bool empty(... | ALGO | 0.999991 | 3.787716 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2024-12-29T06:09:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "13535944d858... |
71b0d23b-bc7d-45fc-95b0-033d5172dac2 | ishandutta2007/codeforces-i | ilya_msu/normal/131/C.cpp | #include<iostream>
#include<vector>
#include<string>
#include<stack>
#include<algorithm>
#include<cmath>
using std::sqrt;
using std::sort;
using std::stack;
using std::string;
using std::vector;
using std::cin;
using std::cout;
using std::endl;
using std::min;
int main() {
int n, m, t;
cin >> n >> ... | ALGO | 0.999814 | 3.644284 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T05:39: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": "c302b9ce3aa6... |
970c9a5f-4b8a-4ffb-9619-75f1f766451a | AlexandraB1806/PA | Teme_2022/Tema1/321CA_BobocuAlexandraFlorentina_Tema1/prinel.cpp | // <NAME>, 321CA
#include <bits/stdc++.h>
using namespace std;
#define MAX_TARGET 100001
#define MAX_POINTS 1000001
#define MAX_N 1001
#define SUM_MAX_TARGET 24000
class Task {
public:
void solve() {
read_input();
print_output();
}
private:
int n, k, num;
int target[MAX_N];
int p[MAX_N];
int al... | ALGO | 0.999843 | 3.762974 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-11-26T18:06: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": "339bfdeee018... |
85a1433a-1ba1-4e90-8657-f29a25567b32 | shricodev/Infinite-DS-Algorithm | src/LeetcodeDaily/WordPattern.cpp | #include <bits/stdc++.h>
using namespace std;
// more optimal than my below commented code. Not mine
class Solution {
public:
bool wordPattern(string pattern, string s) {
vector<string> temp;
stringstream ss(s);
string token;
int count = 0;
// getting the words from the s... | ALGO | 0.999463 | 5.528945 | {
"github_metadata": {
"branch": "main",
"commit_count": 287,
"repo_created_at": "2022-05-05T16:46:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "994fa4056c... |
3f9fefd0-b113-4802-963b-3aa064d12727 | anishacharya/Cracking-Coding-Interviews | String/List_All_Tokens_sorted_frequency.cpp | #include <iostream>
#include <map>
#include <cstring>
#include <fstream>
#include <queue>
#include <boost/algorithm/string.hpp>
#include <list>
#include <algorithm>
using namespace std;
std::map<std::string, int> Tokenize()
{
string filename;
cout << "What file do you want to use for input? ";
getline(cin, filen... | TOOL | 0.98067 | 3.463084 | {
"github_metadata": {
"branch": "master",
"commit_count": 280,
"repo_created_at": "2014-10-22T21:01:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "65e5559a... |
3aa0b1fc-2f53-44d1-abfd-da9dbfe2fd71 | FlyingFish-233/UVL-Algorithm-cpp | 《算法竞赛进阶指南》刷题/0x10基本数据结构/0x18总结与练习/AcWing156.cpp | # include <cstdio>
# include <algorithm>
# include <cmath>
# include <cstring>
using namespace std;
typedef unsigned long long LL;
const int NR = 1e3 + 10, PR = 131, QR = 1331;
int n, m, a, b;
char c[NR];
LL f[NR][NR], g[NR][NR];
LL p[NR], q[NR], v[NR * NR];
int main()
{
scanf("%d%d%d%d", &n, &m, &a, &b);
p[0] =... | ALGO | 0.999158 | 3.364173 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2025-01-08T09:41: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": "a83c2bc2f3... |
6c2096ee-08d0-4297-ad72-98bd632cd232 | FlyingFishPeng/jianzhioffer | Print.cpp | /*
题目:请实现一个函数按照之字形打印二叉树,即第一行按照从左到右的顺序打印,
第二层按照从右至左的顺序打印,第三行按照从左到右的顺序打印,其他行以此类推
*/
class Solution {
public:
vector<vector<int> > Print(TreeNode* pRoot) {
vector<vector<int>> res;
if(pRoot == nullptr)
return res;
vector<TreeNode*> tmp;
tmp.push_back(pRoot);
... | ALGO | 0.999975 | 5.132364 | {
"github_metadata": {
"branch": "master",
"commit_count": 142,
"repo_created_at": "2017-05-12T12:17: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": "f46474e7... |
1fb04fa7-acb7-42f6-b30c-0a146105fb31 | satyajit-patel/NOTES | rajVikramaditya/newGraph/28_Connecting the graph.cpp | // https://practice.geeksforgeeks.org/problems/connecting-the-graph/1?utm_source=youtube&utm_medium=collab_striver_ytdescription&utm_campaign=connecting-the-graph
class DSU {
public:
vector<int> parent, size;
DSU(int N) {
parent.resize(N);
for(int i=0; i<N; i++) parent[i] = i;
size.resiz... | ALGO | 0.999842 | 5.161438 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2022-12-30T06:19: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": "915bb33af... |
29f6c4a4-c60f-4f97-b00c-d3e77ae33676 | brianknguyen/data-structures | AVL:BST stuff/AVL.cpp | #include <cassert>
#include <iostream>
#include <string>
#include <queue>
#include "AVLL.h"
//#include "json.hpp"
void AVL::Insert(int key)
{
if (root_ == nullptr) {
root_ = std::make_shared<AVLNode>(key);
size_++;
root_->height = 0;
return;
}
std::shared_ptr<AVLNode> currentNode = root_, lastNode... | ALGO | 0.9869 | 4.535849 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-08-29T05:29:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "77becc462a... |
601ca75c-382a-405b-8d10-5cb4cfe0d1ed | mandog66/LeetCode | Maximum XOR of Two Numbers in an Array/Solutions.cpp | #include <iostream>
#include <vector>
#include <bitset>
using std::bitset;
using std::vector;
class TrieNode
{
public:
TrieNode *child[2];
TrieNode()
{
this->child[0] = NULL;
this->child[1] = NULL;
}
};
class Trie
{
public:
Trie() {}
int findMaximumXOR(vector<int> &nums)
... | ALGO | 0.999989 | 5.428486 | {
"github_metadata": {
"branch": "main",
"commit_count": 115,
"repo_created_at": "2023-10-09T02:16: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": "e5b868a9b0... |
9c90aa97-e6b1-40da-848e-23003d17a71a | takumi152/atcoder | abc223d.cpp | #include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <utility>
#include <string>
#include <queue>
#include <stack>
#include <unordered_set>
using namespace std;
typedef long long int ll;
typedef pair<int, int> Pii;
const ll mod = 998244353;
int main() {
cin.tie(0);
ios::sync_wi... | ALGO | 0.999978 | 4.096697 | {
"github_metadata": {
"branch": "master",
"commit_count": 115,
"repo_created_at": "2019-04-15T14:20: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": "59571bed... |
b401520e-5216-402f-9849-9f1eb61bda64 | dnapi/cpp | m09/ex02/PmergeMe.hpp | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* PmergeMe.hpp :+: :+: :+: ... | ALGO | 0.976776 | 5.60256 | {
"github_metadata": {
"branch": "main",
"commit_count": 149,
"repo_created_at": "2024-05-16T06:29:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1549c8d103... |
218fd020-18b0-4bbe-aaff-051e8ccf450a | abhisheknaiidu/dsa | Leetcode/August-Challenge/detect-capital.cpp | class Solution {
public:
bool detectCapitalUse(string word) {
int len = word.size();
int count=0, smallLetter=0, firstLetter=0;
for(int i=0; i<len; i++) {
if(word[i]>='A' & word[i]<='Z') {
count++;
cout << count << endl;
if(count ==... | ALGO | 0.999753 | 5.661872 | {
"github_metadata": {
"branch": "master",
"commit_count": 287,
"repo_created_at": "2020-04-06T16:59:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 66,
"forks": 26,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a67f15... |
2646cff6-8f6f-4a60-a0fa-8c928803e51a | ZaidSohail21/Oop_In_C-plus-plus | task1.cpp | //#include <iostream>
//using namespace std;
//
//template <typename T>
//void mySwap(T& a, T& b) {
// T temp = a;
// a = b;
// b = temp;
//}
//
//int main() {
// int x = 5, y = 10;
// float p = 1.5f, q = 2.5f;
// char c1 = 'A', c2 = 'B';
// double d1 = 3.14, d2 = 2.71;
//
// cout << "Before swapping: " << endl;
// cou... | ALGO | 0.958724 | 4.80701 | {
"github_metadata": {
"branch": "main",
"commit_count": 32,
"repo_created_at": "2025-05-25T14:51: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": "36be919b49c... |
7ff7037b-8971-46d5-ae64-4d8a96797cec | Koyingtw/CP | CF practice/1549C.cpp | #pragma region
#include <bits/stdc++.h>
#define Koying ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
#define int long long
#define pr pair<int, int>
#define fr(i, a, b) for (int i = a; i < b; i++)
#define rf(i, a, b) for (int i = a; i >= b; i--)
#define F first
#define S second
#define max(a, b) (a > b ? a : b)
#de... | ALGO | 0.999696 | 4.27994 | {
"github_metadata": {
"branch": "main",
"commit_count": 79,
"repo_created_at": "2021-07-10T12:46:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c7348b730e9... |
4769d1a7-66b2-4b67-b226-fdb41e5342bb | benardp/contours | freestyle/geometry/normal_cycle.cpp |
//
// Copyright (C) : Please refer to the COPYRIGHT file distributed
// with this source distribution.
//
// 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 ... | ALGO | 0.984937 | 4.541703 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2013-12-12T12:02:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 60,
"forks": 17,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "c3f72a9... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.