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 |
|---|---|---|---|---|---|---|---|
688085e9-3861-4545-aadd-0e8a9bd54bbc | oisinresearch/nfs5d | mpz_poly.cc | #include <math.h>
#include <stdlib.h>
#include <string.h>
#include "mpz_poly.h"
#include <algorithm>
#include <iostream> // cout
#include <cassert> // assert
#include <cstdint>
using std::cout;
using std::endl;
using std::flush;
using std::max;
/*
* Compute the resultant of f and g and set the resultat in res.
* S... | ALGO | 0.99806 | 4.23662 | {
"github_metadata": {
"branch": "main",
"commit_count": 47,
"repo_created_at": "2024-08-07T22:18:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "12fb9b275ef... |
56983ab6-331a-4791-9eb9-2b404b6af5af | Bigmichalych/c-- | Zadanie_7.1.cpp | #include <iostream>
void calculate(int* arrA, int* arrB, int size, int minA, int minB) {
for (int i = 0; i < size; i++) {
arrA[i] = arrA[i]/minA;
}
std::cout << "Массив А после деления на его же наименьшее значение: ";
for (int i = 0; i < size; i++) {
std::cout << arrA[i] << " ";
}... | ALGO | 0.999845 | 4.12268 | {
"github_metadata": {
"branch": "main",
"commit_count": 22,
"repo_created_at": "2024-10-28T11:29: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": "dd258b7f116... |
0cc1a565-c1a6-4020-834c-94ea3589d48d | Haneul99/Baekjoon | 14001-15000/14401-14500/14500.cpp | #include<stdio.h>
int n, m;
int mat[501][501];
int visit[501][501] = { 0, };
int dx[4] = { 0,0,1,-1 };//동서남북
int dy[4] = { 1,-1,0,0 };
int h_shape_x[4][3] = {
{0, 0, -1},
{0, 0, 1},
{-1, 1, 0},
{-1, 1, 0}}; //ㅗ ㅜ ㅏ ㅓ
int h_shape_y[4][3] = {
{-1, 1, 0},
{-1, 1, 0},
{0, 0, 1},
{0, 0, -1}};
int ans = 0;
void... | ALGO | 0.999986 | 3.713817 | {
"github_metadata": {
"branch": "main",
"commit_count": 1192,
"repo_created_at": "2020-09-12T07:46:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cb43bcae6... |
800ab347-df24-4a3e-9abb-90206b555113 | morris821028/UVa | volume125/12543 - Longest Word.cpp | #include <stdio.h>
#include <string.h>
#include <iostream>
using namespace std;
int main() {
string end = "E-N-D", ans;
int anslen = 0, i;
char s[10005];
while(scanf("%s", s) == 1) {
if(!strcmp(s, "E-N-D"))
break;
for(i = 0; s[i]; i++) {
if((s[i] >= 'a' && s[i] <... | ALGO | 0.999913 | 3.074371 | {
"github_metadata": {
"branch": "master",
"commit_count": 1197,
"repo_created_at": "2013-06-14T12:34:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 571,
"forks": 269,
"issues": 1,
"pull_requests": 1
},
"file_meta": {
"content_id": "d40... |
e0b5435b-454b-4adb-8ca6-a0d6a35d8b3e | AmazingCaddy/acm-codelab | HDU/hdu_3875.cpp | /*
author: AmazingCaddy
time:
*/
#include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <vector>
#include <algorithm>
#include <stack>
#include <queue>
#include <complex>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <map>
using namespace std;
//typedef long long... | ALGO | 0.999916 | 3.760395 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2013-11-28T15:42: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": "a564a5d55... |
8b392c9a-e7b0-47e5-b400-6eab50dc80da | Kanadae/codetree-TILs | 240327/컨베이어 벨트/conveyor-belt.cpp | #include <iostream>
using namespace std;
int n, t;
int map[2][201];
int temp[2];
int main() {
cin >> n >> t;
for (int i = 0; i < 2; i++)
{
for (int j = 0; j < n; j++)
{
cin >> map[i][j];
}
}
while (t--)
{
temp[0] = map[0][n-1];
temp[1] = map... | ALGO | 0.999987 | 3.16085 | {
"github_metadata": {
"branch": "main",
"commit_count": 561,
"repo_created_at": "2024-02-27T08:58:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a1aff3bde4... |
c486c76a-1e7b-40d5-a713-973f97d507d3 | MostafaAE/LeetCode | 2418-sort-the-people/2418-sort-the-people.cpp | class Solution {
public:
/**
* Approach:
* - Use a map to associate heights with names, sorting by height automatically since map keys are sorted.
* - Traverse the map in reverse order to get names in descending order of heights.
* - Push each name into the result vector.
*
* Complexit... | ALGO | 0.999992 | 6.626112 | {
"github_metadata": {
"branch": "master",
"commit_count": 3923,
"repo_created_at": "2022-09-06T16:24:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "863d53a... |
1862fd2b-ae52-4ba7-b35d-be83d616301e | Lalo1017/Ejercicios_Club | codeforces/suits.cpp | #include <bits/stdc++.h>
using namespace std;
int calcula (int &a, int &b, int &c, int &d, int &e, int &f){
if(d == 0)
return 0;
if( a == 0 && ( b== 0 || c == 0 ) )
return 0;
int tipo1 = e * min(a, d);
int min_tipo2 = min(b, min(c, d));
int tipo2 = f * min_tipo2;
int e_final = (tipo1 + f * min (b, mi... | ALGO | 0.999905 | 3.52448 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2019-12-26T18:42:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "835ecc80f2... |
4e65d9f8-15b7-4e81-9ee7-8de9ec1eaa15 | ricardobuuueno/neuronet | src/Net.cpp | #include <iostream>
#include <vector>
#include <cstdlib>
#include <cassert>
#include <cmath>
#include "Net.h"
using std::vector;
Net::Net(const vector<unsigned>& topology)
{
unsigned numLayers = topology.size();
for (unsigned layerNum = 0 ; layerNum < numLayers; ++layerNum)
{
m_layers.push_back(Layer{});
uns... | ALGO | 0.98792 | 4.717392 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2022-04-24T20:57: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": "8c9404ec8c... |
74d5419d-4908-4575-bcdc-14617efb8ddf | thanhhtung3008/code | songuyetogannhat.cpp | /* Author : <NAME> - Tran Hung Dao High School */
#include <bits/stdc++.h>
using namespace std;
#define ft first
#define sc second
#define ll long long
#define FOR(i, l, r) for (ll i = (l); i <= (r); ++i)
#define FORD(i, r, l) for (ll i = (r); i >= (l); --i)
const ll maxnn = 1e6 + 7;
const ll N = 2e5 + 7;
const lon... | ALGO | 0.999971 | 3.151103 | {
"github_metadata": {
"branch": "main",
"commit_count": 32,
"repo_created_at": "2024-08-09T09:31: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": "ebc09aa0ed8... |
37685402-6d9e-41ed-b1ac-59734ab22f72 | Lehyu/LeetCodeOJ | completed/43/MultiplyStrings
.cpp | #include<iostream>
#include<string>
using namespace std;
class Solution{
public:
//LeetCode 43. Multiply Strings
string multiply(string num1, string num2){
int m = num1.size();
int n = num2.size();
if((m==1 && num1[m-1]-'0' == 0)
||(n==1 && num2[n-1]-'0' == 0)){
return "0";
}
int le... | ALGO | 0.999957 | 5.354659 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2017-02-17T11:56: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": "0f48e291a... |
12a90408-d666-4f75-9cc9-23bfba859275 | arcanjolevi/conteudo_maratonas_programcao | baseMaratona/helloWorld.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int pilotos[105][105];
int vet[105];
int main(){
int g, p, i, s, k, j, maior, aux, w, flag;
cin >> g >> p;
while(g && p){
for(i = 1;i <= g;i++){
for(j = 1; j <= p;j++){
cin >> aux;
pilotos[i][aux] = j;
}
... | ALGO | 0.9999 | 3.232242 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2020-08-10T21:57: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": "017bbe9c39... |
ca6050b1-3436-4eac-80e7-5144b8cd83c9 | PointCloudLibrary/pcl | surface/src/on_nurbs/fitting_curve_2d.cpp | /*
* Software License Agreement (BSD License)
*
* Copyright (c) 2012-, Open Perception, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code... | ALGO | 0.999591 | 5.822442 | {
"github_metadata": {
"branch": "master",
"commit_count": 14566,
"repo_created_at": "2013-02-12T16:40:25.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 10495,
"forks": 4656,
"issues": 432,
"pull_requests": 147
},
"file_meta": {
"content_id... |
cf272d66-2b86-4d12-889b-a47d82665372 | mkharray/Data-Structures-and-Algorithms | 112-path-sum/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.999959 | 5.546346 | {
"github_metadata": {
"branch": "main",
"commit_count": 936,
"repo_created_at": "2022-01-08T07:19: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": "f7020c04f8... |
58437e45-d05d-4d6a-bb44-ae996a567203 | kiangelm/Programacion | Studywork/p1p1derexpx2.cpp | #include <iostream>
#include <cmath>
#include <cstdio>
double f (double x);
double fderivcentral (double x, double h);
double fderivforward (double x, double h);
double fderivrichardsoncentral (double x, double h);
double fderivrichardsonforward (double x, double h);
double error (double x , double exact);
int main (... | ALGO | 0.995102 | 4.738671 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2018-03-23T13:14:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6ab8cbd2f... |
1c1645c3-aebf-4538-9e42-f457f9d7e720 | UIKit0/metalscroll | TextFormatting.cpp | /*
* Copyright 2009 <NAME>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, softw... | TOOL | 0.978418 | 3.409199 | {
"github_metadata": {
"branch": "master",
"commit_count": 81,
"repo_created_at": "2015-03-16T01:20:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 18,
"pull_requests": 0
},
"file_meta": {
"content_id": "d9829590... |
dc640fb4-0b73-4920-b515-3a08d8049862 | gunwonpark/coding_test | 백준/Gold/1717. 집합의 표현/집합의 표현.cc | #include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <cmath>
#define FAST ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)
typedef long long ll;
using namespace std;
int n, m;
vector<int> parent;
vector<bool> isParent;
int FindParent... | ALGO | 0.999996 | 4.245914 | {
"github_metadata": {
"branch": "main",
"commit_count": 349,
"repo_created_at": "2023-06-19T13:34:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4e46b46bb0... |
2f6e2374-587c-4f44-baf0-befd3db247a1 | Malashree99/tictactoe | tictak.cpp | #include <iostream.h>
#include <ctime.h>
#include <random>
using namespace std;
char board[9] = {' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' '};
void show_board();
void get_x_player_choice();
void get_computer_choice();
int count_board(char symbol);
char check_winner();
void computer_vs_player();
int main()
{... | ALGO | 0.999716 | 4.090574 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2021-01-19T13:32: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": "8be277e871ea... |
478ea03c-2a40-4737-bcf8-153f4e9f890d | Shubham28/TopCoder | testprograms/AdditionGame.cpp | #include <vector>
#include <map>
#include <queue>
#include <algorithm>
#include <sstream>
#include <iostream>
#include <cmath>
#include <cstdlib>
#include <set>
#include <numeric>
#define FOR(A,B,C) for(int A=B;A<C;A++)
#define EFOR(A,B,C) for(int A=B;A<=C;A++)
#define RFOR(A,B,C) for(int A=B;A>=C;A--)
#define PB(A,B)... | ALGO | 0.999846 | 4.895116 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2013-05-23T12:52: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": "1480c747aa... |
53b79c72-b505-4c20-9a23-400a5f0d957a | QW1k0YA/A-Fast-Index-free-Subsequence-Matching-Algorithm-for-Dynamic-Time-Warping | LB_q.cpp | #include <iostream>
#include "def.h"
#include "funcs.h"
using namespace std;
/// LB_q Compute the Lower Bound (LB) for a query
/// This function calculates the lower bound for Dynamic Time Warping (DTW) in nlog(m).
///
/// Variable Explanation:
/// q : The query sequence.
/// t : The time... | ALGO | 0.999988 | 5.146571 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2024-12-30T10:29: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": "838c89959e1... |
32cb3dd3-0786-40d4-bd3b-f7159bf57f28 | LuoshuiTianyi/Code | Luogu/P3317/3317.cpp | #include <cmath>
#include <cstdio>
#include <iostream>
using namespace std;
#define LL long long
#define go(G, x, i, v) \
for (int i = G.hd[x], v = G.to[i]; i; v = G.to[i = G.nx[i]])
#define inline __inline__ __attribute__((always_inline))
inline LL read() {
LL x = 0, w = 1;
char ch = getchar();
while (!isdigit... | ALGO | 0.999976 | 3.780799 | {
"github_metadata": {
"branch": "master",
"commit_count": 971,
"repo_created_at": "2019-09-09T08:42: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": "b55089bf... |
5b3d0bb0-841d-4da2-a6cc-8ebecc9cbf9b | martinekvili/StringMatching | cpp/MatchableString/MatchableString/suffixarray/mergesort.hpp | #ifndef MERGE_HPP
#define MERGE_HPP
#include <algorithm>
#include <functional>
#include "tbb\tbb.h"
template <typename T>
class MergeSort {
static const int mergeTreshold;
static const int sortTreshold;
public:
using Comparator = std::function<bool(T, T)>;
private:
static void sequentialMerge(T* arr1, T* end1,... | ALGO | 0.999914 | 6.303369 | {
"github_metadata": {
"branch": "master",
"commit_count": 118,
"repo_created_at": "2015-04-22T12:45: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": "079fef3c... |
82c90c40-c4fe-43bf-8b6d-e02cd220d130 | ushmita4/Leetcode-Daily-Challenge-2022 | 08. August/wordladderII.cpp | class Solution {
public:
bool canBeNext(string s1, string s2){
int uncmn=0;
for(int i=0; i<s1.size(); i++)
uncmn += (s1[i] != s2[i]);
return uncmn==1;
}
void bfs(vector<vector<int>>& graph, vector<int> parent[], int n, int start, int end){
vector<int> dist(n, 501);
queue<int> q;
q.push(star... | ALGO | 0.99998 | 5.957482 | {
"github_metadata": {
"branch": "main",
"commit_count": 386,
"repo_created_at": "2022-01-01T17:09: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": "8e552c9184... |
27db78b4-6ab1-469d-8fd3-2827583763e7 | yuukoyuu/firefly_rk3588_android12.0 | packages/modules/ExtServices/native/pHash/phash_fingerprinter.cpp | /*
* Copyright 2021 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applica... | ALGO | 0.91818 | 6.780229 | {
"github_metadata": {
"branch": "firefly",
"commit_count": 8,
"repo_created_at": "2023-04-20T11:09:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d1a1466de... |
786fb59e-acff-4b33-9315-f3918e6f5375 | qq734628996/ac-code | UVA/1615/14694551_AC_0ms_0kB.cpp | #include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i = 0; i < n; i++)
#define FOR(i,l,r) for(int i = l; i <= r; i++)
#define TR(e,x) for(auto e = x.begin(); e != x.end(); e++)
#define DEBUG(x) cout << #x << "=" << x << endl;
#define SHOW1(A,n) { REP(i,n-1) printf("%d ", A[i]); printf("%d\n", A[n-1]... | ALGO | 0.999765 | 3.547509 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2019-05-23T08:33: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": "1c01650893... |
18204bff-17f4-4867-9fe5-38e9d5ecb54e | shashwatshiv/Basic-CPlusPlus-Programs | 7bmiCalculator.cpp | #include <iostream>
using namespace std;
int main()
//BMI Calculator
//Fit if 18.5<bmi<24.5
//underweight if bmi < 18.5
// Overweight if bmi >24.5
{
float m, h;
float bmi;
cout << "Enter your body weight in kg" << endl;
cin >> m;
cout << "Enter your height in cm" << endl;
cin >> h;
h /= 100... | ALGO | 0.995525 | 4.178221 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-02-18T17:41:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0f0c4c97a836... |
642e78f9-8747-4deb-81da-dc0706b4a435 | fank040118/CPP_Basic | CS216/Notes/Chapter_1/2_Map.cpp | #include <iostream>
#include <string>
#include <map>
#include <vector>
using namespace std;
int main(){
// ==================== C++ map 容器详解 ====================
// 1. map 基本概念
// - map 是关联容器(Associative Container)
// - 存储 key-value 键值对,类似 Python 字典
// - 每个 key 唯一,不允许重复
// - 底层实现:红黑树(自平衡二... | TOOL | 0.988514 | 5.358603 | {
"github_metadata": {
"branch": "main",
"commit_count": 41,
"repo_created_at": "2024-08-27T23:22: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": "222fdfa240d... |
37f0684f-9304-408d-a367-31abfc4cbd2a | tongdaxu/ECE-9343-Exercise | 3-11-2.Hash_Table/main.cpp | /*
11.1 Direct Hashing
11.2 Hash Table with LinkNode
11.3 Hash Function
*/
#include <stdlib.h>
#include <stdio.h>
#include <vector>
#include <iostream>
#include <stack>
#include <math.h>
#include <random>
#define HASH 2
template<class T>
class Bucket{
public:
int aRecord = -1;
int bRecord = -1;
int key;
... | ALGO | 0.99835 | 4.222791 | {
"github_metadata": {
"branch": "master",
"commit_count": 79,
"repo_created_at": "2018-09-15T23:01:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6cdb5f7ad... |
8bd9f6e4-0f00-4797-89a3-2b5b3e44bf86 | M16EL/Module-4-Introduction-To-Oops-Programming | Inheritance and Polymorphism/12.cpp | //Write a program to swap the two numbers using friend function
//without using third variable
#include <iostream>
using namespace std;
class Number {
private:
int value;
public:
Number(int val) : value(val) {}
void display() const {
cout << value << endl;
}
friend void swap(Number &a,... | ALGO | 0.998683 | 5.971498 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-06-25T06:03: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": "e3d8e4be4642... |
b457eeea-b039-441e-8f12-3b39112c2bfb | InsightSoftwareConsortium/ITK | Modules/Filtering/CurvatureFlow/include/itkCurvatureFlowFunction.h | /*=========================================================================
*
* Copyright NumFOCUS
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.o... | ALGO | 0.991774 | 7.722172 | {
"github_metadata": {
"branch": "main",
"commit_count": 57165,
"repo_created_at": "2010-07-27T15:48:04.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1517,
"forks": 701,
"issues": 268,
"pull_requests": 49
},
"file_meta": {
"content_id": "8... |
3713868c-3ed7-4846-be75-17f26c07f9b5 | dickynovanto1103/CP | Online Judges/Google/Google Kickstart/2019/Round D/b.cpp | #include <bits/stdc++.h>
using namespace std;
#define inf 1000000000
#define unvisited -1
#define visited 1
#define eps 1e-9
#define mp make_pair
#define pb push_back
#define pi acos(-1.0)
#define uint64 unsigned long long
#define FastSlowInput ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
typedef l... | ALGO | 0.999597 | 3.214801 | {
"github_metadata": {
"branch": "master",
"commit_count": 212,
"repo_created_at": "2018-08-22T06:40: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": "6d5689eb... |
094c5631-d914-4254-9f42-dbad3cf0a20f | Silverlan/pragma | core/shared/src/lua/classes/lmatrix.cpp | // SPDX-FileCopyrightText: (c) 2019 Silverlan <<EMAIL>>
// SPDX-License-Identifier: MIT
#include "stdafx_shared.h"
#include <mathutil/umath.h>
#include <glm/gtx/matrix_decompose.hpp>
#include <glm/gtx/quaternion.hpp>
#include "pragma/lua/libraries/lmatrix.h"
#include <pragma/engine.h>
#include "luasystem.h"
#include <... | TOOL | 0.955061 | 5.281747 | {
"github_metadata": {
"branch": "main",
"commit_count": 4072,
"repo_created_at": "2019-02-13T11:30:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 197,
"forks": 20,
"issues": 4,
"pull_requests": 0
},
"file_meta": {
"content_id": "36e757... |
0355697e-493b-48da-bf52-57d269734799 | hitoyozake/competitive_programming | atcoder/ABC/300points/70.cpp | #include <iostream>
#include <string>
int main(){
int a, b, c, d;
std::string s;
std::cin >> s;
a = s[0] - '0';
b = s[1] - '0';
c = s[2] - '0';
d = s[3] - '0';
std::string pm = "+-";
int pmi[2] = {1, -1};
for(int j = 0; j < 2; ++j)
for(int k = 0; k < 2; ++k)
for(int l = 0; l < 2; ++l){
... | ALGO | 0.999223 | 3.499741 | {
"github_metadata": {
"branch": "master",
"commit_count": 98,
"repo_created_at": "2018-04-06T10:16:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "71bfda579... |
280d2aaa-067c-43c2-9522-a1b1a7ab42be | BenRitmicoCode/Olympiad-Preparation | IZHO/2014/Divide and conquer.cpp | #include <iostream>
using namespace std;
const long long MAXN = 1e5+5;
long long tree[4*MAXN];
long long x[MAXN];
long long g[MAXN];
long long d[MAXN];
long long s[MAXN];
long long tog[MAXN];
void build(long long curr,long long l,long long r){
if(l==r){
tree[curr] = s[l-1]-x[l];
}else{
long lo... | ALGO | 0.999885 | 3.701301 | {
"github_metadata": {
"branch": "master",
"commit_count": 185,
"repo_created_at": "2018-01-19T00:58: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": "fe0cd21d... |
20923f6b-3205-4386-83f9-7284b65ac9e5 | harsh96902/All-programs | C++ Programs/PraticeQuestion/practice3.cpp | #include<bits/stdc++.h>
using namespace std;
class Solution{
public:
vector<vector<int>> threeSum(vector<int>& nums){
vector<vector<int>> result;
if(nums.size() < 3){
return result;
}
sort(nums.begin(), nums.end());
for(int i =0;i<nums.size() - 2;i++){
... | ALGO | 0.999892 | 5.354129 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2021-09-20T13:13: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": "d0ef9ec8a0... |
98575315-07a4-4783-b2c9-f0ba74029131 | yilmazbayindir/HackerRank_Solutions | Data Structures/Linked Lists/Merge two sorted linked lists/src/main.cpp | #include <bits/stdc++.h>
using namespace std;
class SinglyLinkedListNode {
public:
int data;
SinglyLinkedListNode *next;
SinglyLinkedListNode(int node_data) {
this->data = node_data;
this->next = nullptr;
}
};
class SinglyLinkedList {
public:
S... | ALGO | 0.999838 | 4.937288 | {
"github_metadata": {
"branch": "main",
"commit_count": 27,
"repo_created_at": "2022-02-12T20:19: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": "20b24e4952a... |
ba975d7e-24ac-40a9-9b34-d04c36289e4b | alexandraback/datacollection | solutions_2458486_0/C++/mark2222/QD.cpp | #include<cstdio>
#include<vector>
#include<cstring>
using namespace std;
struct keyset{
int numkeys[200];
keyset(){
memset(numkeys,0,sizeof(numkeys));
}
};
keyset clone(keyset k){
return k;
}
int keyneeded[200];
vector<int> contents[200];
bool dp[1048576];
bool visited[1048576];
bool ischestclos... | ALGO | 0.999817 | 3.633557 | {
"github_metadata": {
"branch": "master",
"commit_count": 58,
"repo_created_at": "2017-03-08T11:33:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e70bf7c38... |
2b000e56-2f91-4c0d-a0f1-30d17338d2d8 | rocket323/acm | poj/2355/4600086_WA.cc | #include <iostream>
#define MaxN 10010
#define INF 1000000010
using namespace std;
int l1, l2, l3, c1, c2, c3, S, T, N;
int P[MaxN];
int A[MaxN], B[MaxN], f[MaxN];
int head, tail;
void init()
{
scanf("%d%d%d%d%d%d", &l1,&l2,&l3,&c1,&c2,&c3);
scanf("%d", &N);
scanf("%d%d", &S, &T);
P[1] = 0;
for(in... | ALGO | 0.999889 | 3.723533 | {
"github_metadata": {
"branch": "master",
"commit_count": 144,
"repo_created_at": "2021-09-11T10:40: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": "1d6c8a84... |
3be12382-034b-40c3-839b-9aed9a8e1f90 | theducdev/CodePTIT-DSA | dsa02027.cpp | #include <bits/stdc++.h>
using namespace std;
int n, c[16][16],s=0, cmin = 1e9, MIN = 1e9, a[100];
int chuaxet[100];
void Try(int i) {
if (s + cmin*(n-i+1) >= MIN) return;
for (int j = 1; j <= n; j++) {
if(chuaxet[j]) {
a[i] = j;
chuaxet[j] = 0;
s+=c[a[i - 1]][a[i]];
... | ALGO | 0.999975 | 3.767427 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-02-06T15:34: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": "7f7910bf9635... |
76a87f9b-c348-4eb2-9be6-f5fc7c5fcf09 | thegamer1907/Code_Analysis | CodesNew/1025.cpp | #include <iostream>
#include <string>
#include <algorithm>
#include <set>
using namespace std;
int N, M;
set<string> A;
set<string> B;
set<string> C;
int main()
{
ios::sync_with_stdio(0);
cin >> N >> M;
for (int i = 0; i < N; i++)
{
string s;
cin >> s;
A.insert(s);
}
f... | ALGO | 0.99999 | 3.842165 | {
"github_metadata": {
"branch": "master",
"commit_count": 73,
"repo_created_at": "2019-05-24T10:35:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "913f37b58... |
79c8febf-a239-41fc-9ff7-df578c919304 | aprogramme/Data-Structure-and-Algorithm | 14 Two D Array/1_2D_Array.cpp | #include<iostream>
using namespace std;
void printcol(int arr[][4], int row, int col){
// column wise
for(int i=0; i<col; i++){
for(int j=0; j<row; j++){
cout<<arr[j][i]<<" ";
}
cout<<endl;
}
}
int main(){
// create 2D array
int arr[3][4] = {1, 2, 3, 4, 5, 6,... | ALGO | 0.997794 | 5.129755 | {
"github_metadata": {
"branch": "main",
"commit_count": 36,
"repo_created_at": "2024-08-29T06:39: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": "864d52c45a7... |
7bb56a69-00d1-4b77-aea0-d977e20e2294 | llvm/llvm-project | clang-tools-extra/clang-tidy/readability/UseStdMinMaxCheck.cpp | //===--- UseStdMinMaxCheck.cpp - clang-tidy -------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===---------------------------... | TOOL | 0.976869 | 7.372825 | {
"github_metadata": {
"branch": "main",
"commit_count": 545188,
"repo_created_at": "2016-12-07T09:39:33.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 33545,
"forks": 14484,
"issues": 5000,
"pull_requests": 5000
},
"file_meta": {
"content_... |
5b99b608-7944-4eec-b479-cbb424f300e1 | Taejin1221/Problem-Solving | Baekjoon/Baekjoon01012.cpp | // Baekjoon01012_OrganicCabbage.cpp
// https://www.acmicpc.net/problem/1012
#include <iostream>
#include <queue>
using namespace std;
struct Position {
int row, col;
Position( int y, int x ): row(y), col(x) {};
};
int main(void) {
ios_base::sync_with_stdio( false );
cin.tie(NULL);
cout.tie(NULL);
int t;
cin ... | ALGO | 0.999938 | 4.443779 | {
"github_metadata": {
"branch": "master",
"commit_count": 1156,
"repo_created_at": "2019-10-06T05:54:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f86faeb... |
b08d214c-bb59-4929-893a-82d473b87eb1 | vesk4000/Informatics | Problems/Act!O(N)/ThreeSumMitko.cpp | /// Sup guys
/// now you will understand how
/// to solve this BS problem
/// a.k.a. ThreeSum by <NAME>
/// more popular as
/// The Homosexual Man
/// Solution by <NAME>
/// a.k.a The Dick God
#include <bits/stdc++.h>
#define MOD 1000000007
#define MAXN 200000
#define endl '\n'
using namespace std;
int n;
long long d[4... | ALGO | 0.999967 | 4.315464 | {
"github_metadata": {
"branch": "master",
"commit_count": 56,
"repo_created_at": "2018-03-15T12:37: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": "cd96986c5... |
824dc6f1-05cc-4572-9f7b-6cbe61cca3b9 | moxcodes/spectre | src/PointwiseFunctions/GeneralRelativity/GeneralizedHarmonic/SpacetimeDerivOfDetSpatialMetric.cpp | // Distributed under the MIT License.
// See LICENSE.txt for details.
#include "PointwiseFunctions/GeneralRelativity/GeneralizedHarmonic/SpacetimeDerivOfDetSpatialMetric.hpp"
#include "DataStructures/DataVector.hpp" // IWYU pragma: keep
#include "DataStructures/Tags/TempTensor.hpp"
#include "DataStructures/Tensor... | ALGO | 0.981384 | 6.912971 | {
"github_metadata": {
"branch": "develop",
"commit_count": 8541,
"repo_created_at": "2018-09-07T20:39:07.000Z",
"is_fork": true,
"is_org_owned": false,
"forked_from": "sxs-collaboration/spectre",
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
... |
526ea84a-3ccd-422e-8082-657d31e2cd75 | PierreSue/FRAIG | src/cir/cirSim.cpp | /****************************************************************************
FileName [ cirSim.cpp ]
PackageName [ cir ]
Synopsis [ Define cir simulation functions ]
Author [ Chung-Yang (<NAME> ]
Copyright [ Copyleft(c) 2008-present LaDs(III), GIEE, NTU, Taiwan ]
***************************... | TOOL | 0.908193 | 3.846014 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2018-03-02T14:33:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6cef2b505... |
9a3c0280-b3d4-46b6-a9b8-4b2e88757127 | psi4/psi4attic | deprecated_CI/sigma.cc | /*
* @BEGIN LICENSE
*
* Psi4: an open-source quantum chemistry software package
*
* Copyright (c) 2007-2016 The Psi4 Developers.
*
* The copyrights for code used from other parties are included in
* the corresponding files.
*
* This program is free software; you can redistribute it and/or modify
* it under t... | ALGO | 0.999762 | 3.121965 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2016-01-19T18:33:34.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "8061f90069... |
e4e46fdf-7249-4b07-bb76-abb903a88f7f | kmjp/procon | codeforce/181-200/cf200/d.cpp | #include <cstdlib>
#include <cstring>
#include <memory>
#include <cstdio>
#include <fstream>
#include <iostream>
#include <cmath>
#include <string>
#include <sstream>
#include <stack>
#include <queue>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
using namespace std;
#include <stdio.h>
#include ... | ALGO | 0.999922 | 3.987848 | {
"github_metadata": {
"branch": "master",
"commit_count": 3966,
"repo_created_at": "2015-02-15T11:25:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 12,
"forks": 2,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
"content_id": "15cf53... |
1b6550f0-135f-4533-b64b-87e2abe9dba8 | ahnaf1524/B5-CPS-Academy-CPC | Daily-CF-Problem-Solving/800-900-rating/B_Not_Quite_a_Palindromic_String.cpp | #include <algorithm>
#include <iostream>
#include <string>
#define endl '\n'
#define Y cout << "YES\n"
#define N cout << "NO\n"
#define all(x) (x).begin(), (x).end()
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
int tc;
cin >> tc;
while (tc--) {
... | ALGO | 0.999954 | 5.032367 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2025-05-11T09:46: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": "80ee70c4fdc1... |
c901ad23-c8c9-46c7-af3f-f9370b382bd7 | inpyeong/sw-academy-algorithms | 백준 SW 역량테스트/아기 상어.cpp | #include <iostream>
#include <vector>
#include <cstring>
#include <algorithm>
#include <queue>
using namespace std;
const int MAX = 20, D[4][2] = {{-1,0},{1,0},{0,-1},{0,1}};
struct Shark {
int y, x;
int size;
int eatCnt;
int time;
}Shark;
struct Fish {
int y, x;
int dist;
};
int N;
int Board[MAX][MAX]... | ALGO | 0.999899 | 3.816273 | {
"github_metadata": {
"branch": "master",
"commit_count": 99,
"repo_created_at": "2021-02-17T05:17: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": "6b2311fa0... |
becf6ae3-3b43-4e29-95f8-c32c492c31b0 | jasper166/CP | Codeforces/427/C/sol.cpp | #include "bits/stdc++.h"
// @Jasper
using namespace std;
using ll = long long;
using pii = pair < int, int >;
using pll = pair < ll, ll >;
template<class T> bool ckmin(T& a, const T& b) { return b < a ? a = b, 1 : 0; }
template<class T> bool ckmax(T& a, const T& b) { return a < b ? a = b, 1 : 0; }
#define FOR(i, a,... | ALGO | 0.99997 | 3.539291 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2023-09-17T08:57: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": "e7b067485... |
2c2bb303-306f-45cb-805f-9591a05f435f | BessieChen/Academic-Project-on-Options-Pricing-based-on-object-oriented-programming-in-Cpp | hw03/hw3 0002/Class.cpp | //
// Class.cpp
// hw3 0002
//
// Created by 陈贝茜 on 2017/10/5.
// Copyright © 2017年 陈贝茜. All rights reserved.
//
#include "Class.hpp"
#include <iostream>
#include <cmath>
using namespace std;
double functionfromhw(double X)
{
return pow(X,3)-pow(X,2)+1;
}
double DefInt::ByTrapezoid(int N)
{
double I = 0... | ALGO | 0.998516 | 4.757104 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2018-08-12T17:28:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 4,
"pull_requests": 0
},
"file_meta": {
"content_id": "6dce59ca2... |
c5bf1f7a-d72a-41d2-baa6-26422d0ccaa9 | xahiru/CPP_YNU_SPRING_2025 | USM39/session 3/Q2.cpp | #include <iostream>
#include <climits>
using namespace std;
void findThreeLargest(int arr[], int size) {
int first, second, third;
first = second = third = INT_MIN;
for (int i = 0; i < size; i++) {
if (arr[i] > first) {
third = second;
second = first;
first ... | ALGO | 0.999965 | 4.398814 | {
"github_metadata": {
"branch": "main",
"commit_count": 1337,
"repo_created_at": "2025-02-26T02:25:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 21,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "286df527... |
a6c74c49-2275-485c-ab3d-135e0bf945f9 | mkmojo/inbox | treeworks/code/mpi/knn_combine.hpp | /***
* Project: TreeWorks
*
* File: user_combine_function.hpp
* Created: Mar 25, 2009
*
* Author: <NAME> <<EMAIL>>
*/
#ifndef KNN_COMBINE_HPP
#define KNN_COMBINE_HPP
#include "base_tree.hpp"
#include "user_value_type.hpp"
#include "user_input.hpp"
#include "user_head.hpp"
class KNNCombine {
private:
pu... | ALGO | 0.974745 | 6.685779 | {
"github_metadata": {
"branch": "master",
"commit_count": 248,
"repo_created_at": "2015-01-20T00:28: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": "fb88b408... |
1b97461e-5f5e-4bfc-9427-f18035fecfc1 | YeongjinOh/Algorithm-practice | Contest/CodeForce/170415/C/main.cpp | #include <iostream>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <queue>
#include <set>
#include <map>
#include <string>
#include <bitset>
#include <vector>
#include <complex>
#include <algorithm>
using namespace std;
typedef long long ll;
typedef double db;
typedef... | ALGO | 0.999942 | 3.143199 | {
"github_metadata": {
"branch": "master",
"commit_count": 317,
"repo_created_at": "2016-03-24T12:56: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": "3e604276... |
674cfdb9-ecca-49a5-bdd3-8d0e297d1c26 | davepagurek/StrokeStrip | external/Cornucopia/PathFinder.h | /*--
PathFinder.h
This file is part of the Cornucopia curve sketching library.
Copyright (C) 2010 <NAME> (<EMAIL>)
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 ve... | ALGO | 0.999807 | 4.698652 | {
"github_metadata": {
"branch": "main",
"commit_count": 41,
"repo_created_at": "2021-01-29T19:10:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 60,
"forks": 15,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "6ca9b6d8c... |
8683bb28-1a89-4474-b052-7ad8d79b2b4a | nishantmehta/datapath | Libs/probdb/GLAs/CountProbGLA.h | #ifndef _COUNTPROBGLA_H_
#define _COUNTPROBGLA_H_
/** Info for the meta-GLAs
* GLA_DESC
*
* NAME(</CountProbGLA/>)
* INPUTS(</(p, FLOAT)/>)
* OUTPUTS(</(l,INT),(h,INT)/>)
* RESULT_TYPE(</single/>)
*
* LIBS(zPoly)
* END_DESC
*/
#include "probdb/zPoly/zPoly.h"
#include <iostream>
#include <iomanip>
// #include... | ALGO | 0.955014 | 5.969155 | {
"github_metadata": {
"branch": "master",
"commit_count": 91,
"repo_created_at": "2015-04-24T23:15:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "f2cd71d9e... |
b884a8bf-df8a-4515-af26-89e95f477728 | YeongjuJeong/BOJ | 20000-25000/23881.cpp | // 23881 알고리즘 수업 - 선택 정렬 1
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int arr[10005];
int selection_sort(int n, int k){
int cnt = 0;
for (int last = n - 1; last > 0; last--){
int mx = 0, idx;
for (int i = 0; i <= last; i++){
if (mx <= arr[i]){
... | ALGO | 0.999987 | 4.324781 | {
"github_metadata": {
"branch": "main",
"commit_count": 508,
"repo_created_at": "2022-01-17T12:24:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "470fb9dd07... |
250b54dd-7a63-4961-93e4-04c52f1ae3e1 | HeRaNO/OI-ICPC-Codes | HSAHRBNUOJ/P16xx/P1691.cpp | #include <cstdio>
#include <cstring>
#define MAXN 10010
using namespace std;
int l1, l2, l3, c1, c2, c3;
int n, a, b, d, x;
int dis[MAXN], dp[MAXN];
inline int mymin(int a, int b)
{
return a < b ? a : b;
}
int main()
{
memset(dp, 0x7f, sizeof dp);
scanf("%d %d %d %d %d %d", &l1, &l2, &l3, &c1, &c2, &c3);
scanf("... | ALGO | 0.999938 | 3.279677 | {
"github_metadata": {
"branch": "master",
"commit_count": 246,
"repo_created_at": "2018-12-31T09:57:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 24,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "55194b5... |
6d43f4c7-e22b-426b-8792-31639f26f354 | cocos/cocos-engine | native/cocos/core/geometry/Sphere.cpp | /****************************************************************************
Copyright (c) 2021-2023 <NAME> Software Co., Ltd.
http://www.cocos.com
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the So... | ALGO | 0.925404 | 7.05067 | {
"github_metadata": {
"branch": "v3.8.7",
"commit_count": 22238,
"repo_created_at": "2015-12-05T03:28:59.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 8826,
"forks": 2015,
"issues": 777,
"pull_requests": 63
},
"file_meta": {
"content_id":... |
427a0976-c9a1-4e13-86c9-93858620c8f3 | hku-mars/Point-LIO | src/Estimator.h | #ifndef Estimator_H
#define Estimator_H
#include "common_lib.h"
#include "parameters.h"
#include <pcl_conversions/pcl_conversions.h>
#include <pcl/point_cloud.h>
#include <pcl/point_types.h>
#include <pcl/filters/voxel_grid.h>
// #include <ikd-Tree/ikd_Tree.h>
#include <pcl/io/pcd_io.h>
#include <unordered_set>
exter... | ALGO | 0.94121 | 4.582975 | {
"github_metadata": {
"branch": "point-lio-with-grid-map",
"commit_count": 15,
"repo_created_at": "2022-12-08T07:50:51.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 970,
"forks": 165,
"issues": 61,
"pull_requests": 1
},
"file_meta": {
"co... |
8f214ccc-3eff-41af-ad6f-32626641c01b | rjenez/W266-final-project | data/programming-homework-dataset-plagiarism-detection/src/B2016/Z3/Z4/student7774.cpp | #include <iostream>
#include <list>
#include <vector>
#include <string>
#include <stdexcept>
#include <set>
using std::cout;
using std::cin;
using std::endl;
using std::vector;
using std::string;
using std::set;
bool SlovoCifra(char c) {
if((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9'... | ALGO | 0.998134 | 4.563953 | {
"github_metadata": {
"branch": "main",
"commit_count": 125,
"repo_created_at": "2022-02-09T00:45:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "506792ac59... |
139d71bd-f965-470e-9c9f-92ff6f935e21 | towmiess/c_plush_plush | web_c++PTIT/CPP0322tong2songuyenlon.cpp | #include <bits/stdc++.h>
using namespace std;
string add(string num1, string num2) {
string res = "";
int i = num1.size() - 1, j = num2.size() - 1, carry = 0;
while (i >= 0 || j >= 0 || carry) {
int sum = carry;
if (i >= 0) sum += num1[i--] - '0';
if (j >= 0) sum += num2[j--] - '0';... | ALGO | 0.999955 | 5.825572 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2023-08-03T11:25: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": "44c79df8f9fb... |
118ee633-6d55-4f5f-b6dd-48fae5018014 | sifaserdarozen/CodeTrain | codility/CountDiv/src/code.cpp | // you can use includes, for example:
// #include <algorithm>
// you can write to stdout for debugging purposes, e.g.
// cout << "this is a debug message" << endl;
#define MAX_CROSSING_CARS 1000000000
#include <vector>
/** @brief function that returns the number of numbers divisible by K
*
* Function return the... | ALGO | 0.999335 | 4.899084 | {
"github_metadata": {
"branch": "master",
"commit_count": 175,
"repo_created_at": "2016-06-22T20:10:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 23,
"pull_requests": 0
},
"file_meta": {
"content_id": "8eb723e... |
3013c746-3af6-498f-b146-01d225ad4d35 | miyatis/atcoder | atcoder-workspase/abc350/C/quick_sort.cpp | #include <iostream>
#include <sstream>
#include <fstream>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <utility>
#include <bitset>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cs... | ALGO | 0.999924 | 4.318982 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2024-09-21T06:36:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b4b7d8329dce... |
8932e838-ae50-4694-955d-1d59a16f6c7c | natgmariam/Introduction-To-Loops | mainlab6a.cpp | /*
Description: Using while loops to print out a range of stars
that form a pyramid based on input from user. A for
loop to build down from user input to 1. using a
do..while loop to take inot account user input errors.
Input: user in prompted to input integer from 2 tto 20
Output: stars ar... | ALGO | 0.980039 | 3.693684 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-01-02T01:18: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": "238a82b92312... |
b23e6dee-1e84-4f92-ac8c-966a5280cae8 | Beatrix-0/Competitive-Programming | Let's Recape/Backtracking/N-Queens Problem/N-Queens code.cpp | #include <bits/stdc++.h>
using namespace std;
void addSolution(vector<vector<string>>& ans, vector<vector<char>>& board, int n)
{
vector<string> tmp(n);
for (int row = 0; row < n; row++)
{
for (int col = 0; col < n; col++)
{
tmp[row] += board[row][col];
}
}
ans.p... | ALGO | 0.999969 | 5.739192 | {
"github_metadata": {
"branch": "main",
"commit_count": 69,
"repo_created_at": "2024-11-26T05:33:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8071ea3ece6... |
6dfe620f-0090-430c-91af-47fd5f31723d | Vancasola/DataStructure | DataStructure/A1066.cpp |
//
// A1066.cpp
// DataStructure
//
// Created by vancasola on 2020/2/5.
// Copyright © 2020 none. All rights reserved.
//
/*
#include <stdio.h>
#include <iostream>
#include <cmath>
using namespace std;
struct node{
int x;
node*lc,*rc;
int h;
node(){}
node(int d){
x=d;
lc=rc=NUL... | ALGO | 0.999915 | 3.90838 | {
"github_metadata": {
"branch": "master",
"commit_count": 439,
"repo_created_at": "2019-06-02T13:55:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "90c468fd... |
bb2e2f29-2598-4c8f-bd5c-0b3792207576 | hasnat0006/CP_SOLUTION | Codeforces/Educational Round/Edu Round 175 (Div. 2)/D_Tree_Jumps.cpp | #pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define vf(v) (v).begin(), (v).end()
#define vr(v) (v).rbegin(), (v).rend()
const ll mod = 998244353;
const ll inf = 1e18;
void solve() {
int n;
cin >> n;
vector<int> adj[n + 5];
for (int v = 2; v <= n; v++)... | ALGO | 0.999836 | 5.135633 | {
"github_metadata": {
"branch": "main",
"commit_count": 188,
"repo_created_at": "2024-01-15T18:05: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": "d0c336a4eb... |
d1c802db-5381-4585-b059-dbe9a747555d | yashss1/Sublime_CP | atcoder_dp_1.cpp | //YashS
#include <bits/stdc++.h>
using namespace std;
#define test int T;cin>>T;while(T--)
#define int long long
#define pb push_back
#define all(x) (x).begin(),(x).end()
#define rep(i,a,b) for(int i=a;i<b;i++)
#define pVec(v) for(auto e:v)cout<<e<<"... | ALGO | 0.999946 | 4.318578 | {
"github_metadata": {
"branch": "main",
"commit_count": 67,
"repo_created_at": "2023-01-16T14:50:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2e1d647c31a... |
8e462093-c4d7-44fe-a070-cda1ea00b0d6 | poorvaditya18/PRACTISE-CPP | BinaryTrees/IterativePostOrderTraversalUsing-2-stacks.cpp | #include<bits/stdc++.h>
using namespace std;
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), left(left), righ... | ALGO | 0.999988 | 5.563293 | {
"github_metadata": {
"branch": "main",
"commit_count": 159,
"repo_created_at": "2022-12-11T19:51:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3fe8597889... |
002ddd3b-eb9b-4aac-9a25-47efaad3fc8d | ishandutta2007/codeforces-l | lucina/normal/1726/B.cpp | #include<bits/stdc++.h>
using namespace std;
const int nax = 3e5 + 10;
int n, m;
int a[nax];
void solve() {
cin >> n >> m;
/**
max number can be anything
*/
if (n == 1) {
cout << "YES\n";
cout << m << '\n';
return;
}
if (m < n) {
cout << "NO\n";
r... | ALGO | 0.999955 | 3.399735 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T06:17: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": "d3593307204a... |
9ba30bf1-5157-4c01-93d6-5778519ed5f9 | kaycbas/dslib_bastoul-master | hw8/grading/qsort.h | #ifndef Q_SORT_H
#define Q_SORT_H
#include <iostream>
#include <string>
using namespace std;
struct Student{
string name;
int ability;
};
struct IntComp{
bool operator()(const int val1, const int val2){
return val1 < val2;
}
};
struct StdComp{
bool operator()(const Student std1, const Student std2){
ret... | ALGO | 0.999059 | 5.348835 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2018-02-06T23:38: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": "a9eb8f9070... |
7433b8ab-8b48-42e9-8bf7-dc535d2bfa6c | Sundae2608/QuantNetAdvancedCpp | son_pham Level 4 HW submission/son_pham Level 4 HW submission/HW1/HW1_Exercise2.cpp | /*
* Advanced C++ and Modern Design
* Level 4
* Author: <NAME>
* Homework 1, Exercise 2: Adapter Classes for Bitsets
*/
#include <algorithm>
#include <functional>
#include <iostream>
namespace {
// Vector class of fized size N and can hold any template type T
template<typename T, int N>
class Vector
{... | TOOL | 0.954745 | 6.79536 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-12-25T23:51: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": "a4e5ee525954... |
490d16d8-d454-4b1e-8fbd-d0cd20983465 | ishandutta2007/codeforces-a | acrush/normal/1466/E.cpp | #ifdef _MSC_VER
#define _CRT_SECURE_NO_WARNINGS
#endif
#include <bits/stdc++.h>
using namespace std;
#define POW2(X) (1LL<<(X))
#define CKBIT(S,X) (((S)&POW2(X))!=0)
const double pi=acos(-1.0);
const double eps=1e-11;
template<class T> inline void ckmin(T &a,T b){ a=min(a,b); }
template<class T> inline void ckmax(T ... | ALGO | 0.997745 | 3.88116 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-04-11T00:51:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "467c36e00fb3... |
c7ada247-a688-4f9e-89aa-cde5c551de80 | beltegeuse/spatialTF_code | src/integrators/photonmapper/msppm/imp/visual.h | #pragma once
#include "importanceFunc.h"
#include "../../gpaccel.h"
MTS_NAMESPACE_BEGIN
/**
* This importance function is from the paper:
* "Visual importance-based adaptive photon tracing"
* <NAME>, <NAME>
* The Visual Computer, 2015
*/
class VisualIF : public ImportanceFunction {
public:
VisualIF(const P... | ALGO | 0.994543 | 5.761699 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2017-03-19T09:23:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 20,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a5ad0f090... |
a3c1f778-2dfb-48ed-bca8-8f09c51e2ddf | technojam/Ultimate_Algorithms_Repository | Basic Algorithms/CountSetBits.cpp | /* An efficient C++ program to count No. of set/high bits in an integer-
using Brian Kernighan's Algorithm */
/* Useful Prerequisite knowledge-
When u subtract 1 from a decimal no. 'n', all bits after the rightmost set bit(i.e 1) are flipped
including this righmost bit.
For eg. 8 = 1000 , 7= 0111, Here R... | ALGO | 0.999889 | 6.770366 | {
"github_metadata": {
"branch": "master",
"commit_count": 188,
"repo_created_at": "2019-10-25T18:09:23.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 84,
"forks": 165,
"issues": 12,
"pull_requests": 2
},
"file_meta": {
"content_id": "b20fa... |
15b4cb01-6898-4f30-b488-689f8c5ca450 | coke-jiyong/algorithmStudy | 4659/4659.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
bool whats_al(char a)
{ // true -> 모음 false -> 자음
if (a == 'a' || a == 'e' || a == 'i' || a == 'o' || a == 'u')
{
return true;
}
return false;
}
// 모음(a,e,i,o,u) 하나를 반드시 포함하여야 한다.
bool check_1(string str)
{
for ... | ALGO | 0.997045 | 4.0696 | {
"github_metadata": {
"branch": "main",
"commit_count": 53,
"repo_created_at": "2024-12-04T05:49: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": "e9c4839e74e... |
2e0b9aa5-8512-49ba-9d7f-6bd1a9402214 | Davidah121/SMPL | src/VectorGraphic_VectorPolygon.cpp | #include "VectorGraphic.h"
#include "SimpleGraphics.h"
#include "Sort.h"
#include "StringTools.h"
#include "BezierCurve.h"
#include "ColorNameConverter.h"
namespace smpl
{
#pragma region VectorPolygon
VectorPolygon::VectorPolygon() : VectorShape()
{
}
VectorPolygon::~VectorPolygon()
{
}
void VectorPolygo... | TOOL | 0.971107 | 4.756575 | {
"github_metadata": {
"branch": "master",
"commit_count": 174,
"repo_created_at": "2019-12-27T22:01:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 32,
"pull_requests": 0
},
"file_meta": {
"content_id": "5ecca96... |
0796d6a4-2c1e-462c-b8de-1f4c7de6d319 | cofla159/2021-2-computer-graphics | shader.cpp | #include "shader.h"
#include <math.h>
#include <stdio.h>
using namespace raytraceData;
void norm(point* p);
shader::shader()
{
}
shader::~shader()
{
}
material* shader::makeMaterial(GLfloat r, GLfloat g, GLfloat b, GLfloat amb, GLfloat dif, GLfloat spe) {
material* m;
/* allocate memory */
m = new material();
... | ALGO | 0.962501 | 5.929452 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2021-09-14T07:01:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0290be842873... |
8d11d2c5-a561-439d-b4cc-3d7564249936 | MokshKanthaliya02/DSA | code360/aggressivecows.cpp | #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
bool isPossible(vector<int> &stalls, int k, int mid){
int space = stalls[0];
int cowsCount = 1;
for(int i = 0; i < stalls.size(); i++){
if(stalls[i] - space >= mid){
cowsCount++;
space = stalls[i];... | ALGO | 0.999989 | 5.845486 | {
"github_metadata": {
"branch": "main",
"commit_count": 39,
"repo_created_at": "2025-06-14T03:10: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": "5fa7bd6c9b8... |
9e134d5a-50e0-4c68-abde-ba94686542ab | oOIFOo/2016_spring_OOP | quiz6/6.cpp | #include <iostream>
#include <string>
using namespace std;
class BigInteger {
public:
BigInteger() {
}
BigInteger(string a) {
int j;
int count;
count = 0;
size = a.size();
negative = false;
if (a[0] == '-'){
negative = true;
count++;
//size--;
}
for (int i = 29; i >= 0; i--) {
num[i] = ... | ALGO | 0.999674 | 3.984868 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-04-15T08:53: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": "8cd3ca756a... |
c36f6ab8-8923-45e0-a6a0-fb4d5364318d | TheSohrabX/Distributed-processing-on-ESP8266s | platform/src/interpreter/core/expression-solver.h | #ifndef EXPRESSION_SOLVER_H
#define EXPRESSION_SOLVER_H
#include "llcore.h"
#include <algorithm>
#include <math.h>
class ExpressionSolver{
public:
ExpressionSolver(const std::string& expression, LLCore * core)
: interpreter(core)
{
std::string copy = interpreter->removeSpaces(expression);
... | ALGO | 0.999815 | 5.914339 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2022-11-25T13:46:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4c9c0a0cb74... |
a954fa7b-2555-49eb-84f5-6a65753fd451 | ngthanhtrung23/ACM_Notebook_new | Graph/MaxFlow/MinCostMaxFlowSPFA.h | // Min Cost Max Flow - SPFA
// Index from 0
// edges cap changed during find flow
// Lots of double comparison --> likely to fail for double
// Example:
// MinCostFlow mcf(n);
// mcf.addEdge(u, v, cap, cost);
// cout << mcf.minCostFlow() << endl;
// Tested:
// - ***TLE*** https://codeforces.com/blog/entry/70740
// - **... | ALGO | 0.998159 | 4.706635 | {
"github_metadata": {
"branch": "master",
"commit_count": 942,
"repo_created_at": "2015-01-11T13:46:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 442,
"forks": 128,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "520e... |
aa363dea-621d-4ee4-aeee-1f03f7ec8551 | Raunak-Kumar7/Leetcode_DSA | BinaryTree/2583KthLargestSuminBinaryTree.cpp | vector<vector<int>> levelOrder(TreeNode* root) {
queue<TreeNode*> q;
vector<vector<int>> ans;
if(root==nullptr) return ans;
q.push(root);
while(!q.empty())
{
int nodeCount =q.size();
vector<int> t;
while(nodeCount>0)
{
... | ALGO | 0.999988 | 5.145871 | {
"github_metadata": {
"branch": "main",
"commit_count": 25,
"repo_created_at": "2022-11-04T12:02: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": "6bee173c393... |
a9ac1b67-9c1f-4c80-88b6-8336de117226 | DarkRec/Algo | Ex.2/Lesson.cpp | #include <iostream>
using namespace std;
struct node
{
int val;
node *next;
};
void Show(node *H)
{
cout << "H->";
node *p = H;
while (p != NULL)
{
cout << p->val << "->";
p = p->next;
}
cout << "NULL" << endl;
}
void Add(node *&H, int x)
{
node *p = new node;
... | ALGO | 0.999912 | 4.407482 | {
"github_metadata": {
"branch": "main",
"commit_count": 24,
"repo_created_at": "2022-03-07T03:17:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "684f9e85a36... |
e6f5dfa1-e00e-4120-bef5-3ddd6eb8a483 | AndersonPetall/AcWing | 算法基础课/W5动态规划/5-5.1.0 数位统计DP_338. 计数问题.cpp | #include<iostream>
#include<vector>
using namespace std;
int base[10], f[10][10], g[10][10];
void init(){
base[0] = 1;
for(int i=1; i<=9; ++i) base[i] = base[i-1]*10;
for(int i=0; i<=9; ++i) f[1][i] = 1;
for(int i=2; i<=9; ++i) for(int j=0; j<=9; ++j) f[i][j] = f[i-1][j]*10 + base[i-1];
for(int i=1;... | ALGO | 0.999765 | 4.201093 | {
"github_metadata": {
"branch": "main",
"commit_count": 776,
"repo_created_at": "2022-07-05T03:07:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cb72fcc09d... |
86543965-4262-4a7e-b7d4-c5ab3cfbb9b2 | lamphanviet/competitive-programming | uva-online-judge/accepted-solutions/852 - Deciding victory in Go.cpp | //----------------------------
// <NAME>
// UVA 852 - Deciding victory in Go
// Time limit: 3s
//----------------------------
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstring>
using namespace std;
#define N 9
int Count, white, black;
bool isb, isw;
char s[N+2][N+2];
void DFS(int x, int y) ... | ALGO | 0.999819 | 4.227799 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2014-06-20T02:07:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 83,
"forks": 56,
"issues": 1,
"pull_requests": 1
},
"file_meta": {
"content_id": "9f8ba9eb... |
603c98a9-b808-44ed-9b5a-c6f17f9c9293 | cschreib/qphot | state_extract.hpp | void get_background_apertures(const vec2b& mask, double radius, vec1u& y, vec1u& x) {
y.clear();
x.clear();
// First segment the mask
segment_output sdo;
vec2u seg = segment(mask, sdo);
// Add segments at the edges
seg(0,_) = seg(seg.dims[0]-1,_) = seg(_,0) = seg(_,seg.dims[1]-1) = max(sdo... | ALGO | 0.981858 | 6.76981 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2017-02-27T11:13: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": "9fc90d869... |
2d1de1d4-64df-4609-a3c7-4ab365750ec0 | amardaus/AlgorithmsAndDataStructures- | 09_Floyd_Warshall/main.cpp | #include <iostream>
#include <vector>
#include <fstream>
#include <sstream>
#include <queue>
#include <algorithm>
#include <functional>
#include <map>
#include <climits>
#include <cstring>
using namespace std;
template <typename T>
struct Edge;
template <typename T>
struct Vertex{
public:
T vertexName;
vecto... | ALGO | 0.999538 | 4.62131 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2020-04-03T10:13: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": "718865e133... |
1cd23f3f-4a48-4195-a321-cb9660b71731 | squidieee/AlgorithmPractice | LintCode-Cpp/BFS/CoursePrerequisite-DetectConflict.cpp | /*
615. Course Schedule
There are a total of n courses you have to take, labeled from 0 to n - 1.
Some courses may have prerequisites, for example to take course 0 you have to first take course 1, which is expressed as a pair: [0,1]
Given the total number of courses and a list of prerequisite pairs, is it possible fo... | ALGO | 0.999061 | 6.269951 | {
"github_metadata": {
"branch": "master",
"commit_count": 119,
"repo_created_at": "2017-11-29T00:47:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "366b89cf... |
b7610a48-2d78-4ab3-ac32-830d0fbad140 | sergiosilvarubio/gato | src/board.cpp | #include <iostream>
#include "board.hpp"
Board::Board()
{
// Bitboards para cada jugador.
// Usando valores binarios, inicialmente vacíos.
board[X] = 0b000000000; // Bitboard para X
board[O] = 0b000000000; // Bitboard para O
turn = X; // Comienza jugando X
}
Board::Board(const uint16_t x, const ... | ALGO | 0.998899 | 5.30184 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2024-09-01T19:39:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "95780b7bba... |
5b078cda-25e9-4a7c-ad93-68ba1ea86351 | sjtu-imperishable-night/code-library | Template/Template of Other Teams/Spear-of-Longinus/acm/2016-07-24(2016-Multi-University-Training-Contest-2)/B.cpp | #include<cstdio>
#include<cstdlib>
#include<algorithm>
#include<iostream>
#include<cmath>
#include<cstring>
#include<vector>
using namespace std;
int calc(int x, int y, int type) {
if(type == 1) {
return x & y;
}
if(type == 2) {
return x | y;
}
return x ^ y;
}
const int N = 1 << 17;
const int MOD = 1000000... | ALGO | 0.999846 | 3.982269 | {
"github_metadata": {
"branch": "master",
"commit_count": 47,
"repo_created_at": "2019-07-26T11:23:24.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1f4adda797... |
e362c18c-e505-4b05-a8b2-93d3e98c70c3 | mennamohamed0207/Problem-Solving | AddTwoNumbers.cpp | /*
You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order, and each of their nodes contains a single digit. Add the two numbers and return the sum as a linked list.
You may assume the two numbers do not contain any leading zero, except the number 0 itsel... | ALGO | 0.999972 | 6.937723 | {
"github_metadata": {
"branch": "main",
"commit_count": 243,
"repo_created_at": "2024-04-27T15:21: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": "3134ad7c26... |
304d7682-ef26-4fc7-8148-b04ae60d31db | Dhyey77-debug/cpp | prac6_3.cpp |
#include <iostream>
using namespace std;
class DynamicArray {
private:
int* data;
int size;
public:
DynamicArray(int s) : size(s) {
data = new int[size];
}
~DynamicArray() {
delete[] data;
}
int getSize() const {
return size;
}
void set(int index, int va... | ALGO | 0.999699 | 5.476745 | {
"github_metadata": {
"branch": "main",
"commit_count": 34,
"repo_created_at": "2025-04-14T12:31:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "37ec6725d68... |
0fd628f1-1a3a-4dae-aecd-d7991e54ebfa | CGAL/cgal | Convex_hull_3/doc/Convex_hull_3/CGAL/Convex_hull_3/dual/halfspace_intersection_with_constructions_3.h | namespace CGAL {
/*!
\ingroup PkgConvexHull3Functions
\brief computes the intersection of the halfspaces defined by the planes contained in the range [`begin`, `end`). The result is stored in the polyhedron `pm`.
If `origin` is given then it must be a point strictly inside the polyhedron. If an interior point is not ... | ALGO | 0.994783 | 7.39275 | {
"github_metadata": {
"branch": "master",
"commit_count": 113659,
"repo_created_at": "2014-10-01T12:22:47.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 5443,
"forks": 1475,
"issues": 511,
"pull_requests": 136
},
"file_meta": {
"content_id... |
31a389e0-53e9-4ce8-ad4a-ee2a5f47ed53 | CGAL/cgal | Circular_kernel_3/include/CGAL/Circular_kernel_3/internal_function_compare_spherical_kernel.h | // Copyright (c) 2008 INRIA Sophia-Antipolis (France).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org).
//
// $URL$
// $Id$
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
//
// Author(s) : <NAME>, <NAME>, <NAME>,
// <NAME>, <NAME>
// Partially supported by the... | ALGO | 0.985253 | 6.999529 | {
"github_metadata": {
"branch": "master",
"commit_count": 113659,
"repo_created_at": "2014-10-01T12:22:47.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 5443,
"forks": 1475,
"issues": 511,
"pull_requests": 136
},
"file_meta": {
"content_id... |
d9ee0045-f92f-441e-ba5f-709977661649 | maeth2/Leetcode | hard/permutation_sequence.cpp | #include <iostream>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
using namespace std;
using ll = long long;
string getPermutation(int n, int k) {
string ans = "";
vector<int> a(n);
int p = 1;
for(int i = 0; i < n; i++){
a[i] = i + 1;
p *=... | ALGO | 0.999993 | 5.242646 | {
"github_metadata": {
"branch": "main",
"commit_count": 161,
"repo_created_at": "2023-09-23T11:28: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": "ba5a7c365f... |
e6df7e77-87a0-4633-8a30-88164b8e4933 | zwang271/WEST | src/MLTL_interpreter/evaluate_mltl.cpp | #include <string>
#include <vector>
#include <iostream>
#include <stdexcept>
#include <tuple>
#include <algorithm>
#include "utils.h"
using namespace std;
/*
checks if inputted string is a number
*/
bool digit_check(string s) {
for (int i = 0; i < s.length(); ++i) {
if (s[i] < '0' || s[i] > '9') {
... | ALGO | 0.997656 | 4.730689 | {
"github_metadata": {
"branch": "main",
"commit_count": 441,
"repo_created_at": "2022-06-06T20:53:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "92554d92f0... |
a8d9bed4-ae97-4f93-805d-ce5438254227 | osw00817/Army | 알고리즘/이등병/11004_K번째수.cpp | #include <iostream>
#include <vector>
using namespace std;
//퀵정렬로 풀기
/*
pivot 기준 설정
start < pivot start++;
end > pviot end--;
start > pivot && end < pivot start하고 end swap,start++,end--;
start와 end가 만남,만나는지점의 val < pivot,만난 지점의 오른쪽에 pivot 삽입
val > pivot이면 왼쪽에 삽입.
분리집합후 다시 pivot 설정
분리집합이 1개 이하가 될때까지 과정을 반복
*/
/*
이해... | ALGO | 0.999996 | 4.399339 | {
"github_metadata": {
"branch": "main",
"commit_count": 72,
"repo_created_at": "2025-04-03T13:05:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3c42998cc75... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.