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 |
|---|---|---|---|---|---|---|---|
1232f1c1-619e-4617-87d5-71962ce6fa58 | opensim-org/opensim-core | OpenSim/Actuators/PolynomialPathFitter.cpp | /* -------------------------------------------------------------------------- *
* OpenSim: PolynomialPathFitter.cpp *
* -------------------------------------------------------------------------- *
* The OpenSim API is a toolkit for musculoskeletal modeling and simulation. *
... | ALGO | 0.977879 | 6.972362 | {
"github_metadata": {
"branch": "main",
"commit_count": 16390,
"repo_created_at": "2014-06-12T16:57:56.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 896,
"forks": 337,
"issues": 369,
"pull_requests": 29
},
"file_meta": {
"content_id": "69... |
7944f857-a025-4293-9c62-1aa5d89499a9 | Watermelon-1234/compete_programming | ap325_release/ch2/ch2_8_lower_bound.cpp | // demo lower_bound for struct and pair
#include <bits/stdc++.h>
using namespace std;
#define N 5
struct point {
int x,y;
};
// compare by only x
bool pcmp(point s, point t) {
return s.x < t.x;
}
int main() {
point p[N];
int n=5;
for (int i=0;i<n;i++) p[i].x=rand()%10, p[i].y=rand()%10;
sort(p, ... | ALGO | 0.999668 | 4.012108 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2024-03-24T06: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": "641a591af5b4... |
519fde8f-13e6-451d-8245-1cc4eb517e8a | ishandutta2007/codeforces-s | shubham__36/normal/1073/C.cpp | #include <bits/stdc++.h>
#include <set>
#include <list>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <map>
#include <unordered_map>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> p32;
typedef pair<ll,ll> p64;
typedef p... | ALGO | 0.999946 | 3.645983 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:07: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": "15db65235054... |
b9fb38b0-7d03-4a08-b276-6c0f652e27f4 | trietvuive/CF_Practice | CodeForces/old/1521B.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int cases;
cin >> cases;
while (cases--)
{
int n;
cin >> n;
int mn = 1e9 + 2, index = -1;
for (int i = 1; i <= n; ++i)
{
int element;
cin >> element;
if (element < mn) mn = element, index = i;
}
cout << n - 1 << endl;
for (int i = ... | ALGO | 0.999904 | 3.496555 | {
"github_metadata": {
"branch": "main",
"commit_count": 44,
"repo_created_at": "2021-06-30T22:40: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": "9e4030caf96... |
66dc4e91-8a4e-4eb6-a1d3-df14dba363f8 | adnanaziz/EPIJudge | epi_judge_cpp_solutions/search_shifted_sorted_array.cc | #include <vector>
#include "test_framework/generic_test.h"
using std::vector;
int SearchSmallest(const vector<int>& A) {
int left = 0, right = size(A) - 1;
while (left < right) {
if (int mid = left + ((right - left) / 2); A[mid] > A[right]) {
// Minimum must be in A[mid + 1, right].
left = mid + ... | ALGO | 0.999933 | 6.291059 | {
"github_metadata": {
"branch": "master",
"commit_count": 191,
"repo_created_at": "2017-12-21T06:15:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2874,
"forks": 1899,
"issues": 47,
"pull_requests": 33
},
"file_meta": {
"content_id": "... |
7d1b434e-9ac6-4fdd-8595-3624df100037 | USTC-Resource/USTC-Course | 数据结构/codes/mbinary/polynomial.cpp | /* mbinary
#########################################################################
# File : polynomial.cpp
# Author: mbinary
# Mail: <EMAIL>
# Blog: https://mbinary.xyz
# Github: https://github.com/mbinary
# Created Time: 2018-05-19 23:07
# Description:
###############################################################... | ALGO | 0.992909 | 3.807631 | {
"github_metadata": {
"branch": "master",
"commit_count": 89,
"repo_created_at": "2019-01-09T03:48:08.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 15611,
"forks": 3502,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "250... |
37e1097b-954b-4859-9688-34073ebe164f | lidaiqing/cc189 | chapter2/2.7.cpp | #include <bits/stdc++.h>
#include "linkedlist.h"
using namespace std;
pair<Node*, int> findTailAndSize(Node* head)
{
int count = 1;
Node* cur = head;
while (cur->next)
{
count++;
cur = cur->next;
}
return make_pair(cur, count);
}
Node* findIntersection(Node* l1, Node* l2)
{
pair<Node*, int> p1 = findTailA... | ALGO | 0.999815 | 4.448521 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2016-11-05T19:41: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": "7e21a1db8d... |
3227e8d9-7067-4b50-9ef9-bbdc3c2a6129 | NceSchrauwen/arduino-opdrachten | opdr_6_button_servo.cpp | // Opdracht 6 - Servo rotate from 0 to 120 degrees with differing speeds
// Written by: <NAME>
#include <Servo.h>
Servo myServo; // Create a servo object
// Define constant variables
const int BTN1 = 3;
const int BTN2 = 4;
const int SERVO = 2;
// Define states
enum Mode {
IDLE,
BTN1_MODE,
BTN2_MODE,
BOTH_BT... | ALGO | 0.950542 | 6.295151 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2024-12-30T11:31: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": "0b9b5e3c9c21... |
6f600fc1-73c2-46d4-aa1c-35015bd1ec8e | FlorianBreut/FB-Portfolio | cv_rotate_img_lib/watervolume.cpp |
class Cell
{
public:
Cell() { m_y = 0; m_x = 0; }
Cell(unsigned short row, unsigned short col, unsigned short water_lvl) :m_y(row), m_x(col), m_water_lvl(water_lvl) {}
unsigned short getRow() { return m_y; }
unsigned short getCol() { return m_x; }
unsigned short getWaterLvl() { return m_water_lvl; }
~Cell() {... | ALGO | 0.999908 | 4.861297 | {
"github_metadata": {
"branch": "master",
"commit_count": 59,
"repo_created_at": "2019-07-18T14:02: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": "2ae2f7253... |
9ec83263-259f-4a6a-8e76-16a04c81c4c7 | Brudihawo/sim2d_cpp | src/domain/simulation_domain.cpp | #include "simulation_domain.h"
#include <iostream>
#include <fstream>
#include <memory>
#include <random>
#include <regex>
#include "container.h"
SimulationDomain::SimulationDomain(SimParams& p, int n_scalar_fields)
:NX(p.NX), NY(p.NY),
DELTA(p.DELTA), DELTA_T(p.DELTA_T),
N_SCALAR_FIELDS(n_scalar_fields), N_TIM... | ALGO | 0.999073 | 7.204133 | {
"github_metadata": {
"branch": "main",
"commit_count": 48,
"repo_created_at": "2020-12-14T19:18: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": "fb9218074d0... |
5e96ced8-7763-4227-a7e2-a09c729541af | ROCm/hcc | include/experimental/impl/transform_reduce.inl | /**
* @file numeric
* Numeric Parallel algorithms
*/
#pragma once
#define _T_REDUCE_WAVEFRONT_SIZE 512
#define _T_REDUCE_STEP(_LENGTH, _IDX, _W) \
if ((_IDX < _W) && ((_IDX + _W) < _LENGTH)) {\
T mine = scratch[_IDX];\
T other = scratch[_IDX + _W];\
scratch[_IDX] = binary_op(mine, other); \
... | ALGO | 0.999946 | 7.193341 | {
"github_metadata": {
"branch": "clang_tot_upgrade",
"commit_count": 7771,
"repo_created_at": "2016-03-22T16:04:00.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 437,
"forks": 108,
"issues": 101,
"pull_requests": 11
},
"file_meta": {
"cont... |
f62f2d54-10db-4e9c-8912-e622b2455b10 | ammarhusain/challenges | project-euler/src/pe30.cpp | /** ----------------------------------------------------------------------
* Copyright 2014 < <NAME> (Carnegie Mellon University) >
*
* @file pe1.cpp
* @author <NAME> <<EMAIL>>
* @date Thu Jul 31 17:18:28 2014
*
* @brief Boiler Plate
*
*
-------------------------------------------------------------... | ALGO | 0.999579 | 5.309266 | {
"github_metadata": {
"branch": "master",
"commit_count": 37,
"repo_created_at": "2018-10-17T21:41: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": "d46f00cf8... |
9c2c11e1-fed8-45b9-88fe-2cf1f00b6bd5 | Joeehab12/ACM-Competitive-Library | UVa/C++/rock-paper-scissors.cpp | #include <bits/stdc++.h>
using namespace std;
bool isValid(int i,int j,int r,int c){
if (i<=r-1 && j <=c-1 && i>=0 && j>=0){
return true;
}
else{
return false;
}
}
bool isWinner(char first,char second){
if (first == 'P' && second == 'S'){
return false;
}
else if (first == 'S' && s... | ALGO | 0.999924 | 4.903276 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2017-09-07T13:28: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": "56a9ea3773... |
72033155-d6f9-4b55-ae59-83f115adee0a | PatrickSchm/Assessing-the-role-of-non-linear-contact-mechanics-for-flow-in-fractures---Code | dune_implementation/dune-istl/dune/istl/ilusubdomainsolver.hh | // -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// vi: set et ts=4 sw=2 sts=2:
#ifndef DUNE_ISTL_ILUSUBDOMAINSOLVER_HH
#define DUNE_ISTL_ILUSUBDOMAINSOLVER_HH
#include <map>
#include <dune/common/typetraits.hh>
#include "matrix.hh"
#include <cmath>
#include <cstdlib>
namespace Dune {
/**
* @fi... | ALGO | 0.971242 | 5.823687 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2022-06-25T18:50:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "444c76e249... |
8f0be2e4-ab5d-4da2-aee8-b3aaf38a258f | imakshug/placement_25 | coding/4. Sorting and Searching Algorithms/heap_sort.cpp | // Heap Sort
#include <iostream>
#include <vector>
using namespace std;
void heapify(vector<int>& arr, int n, int i) {
int largest = i; // Initialize largest as root
int left = 2 * i + 1; // left = 2*i + 1
int right = 2 * i + 2; // right = 2*i + 2
// If left child is larger than root
if (left < n ... | ALGO | 0.999988 | 5.440087 | {
"github_metadata": {
"branch": "main",
"commit_count": 22,
"repo_created_at": "2024-07-12T04:42:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b7162becac5... |
96b1e833-886d-4ded-88c9-3d2eea07dd90 | br0der/VsCode | Kattis/10-15-Practice/statues.cpp | //#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,fma")
//#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<double,doubl... | ALGO | 0.999988 | 3.647813 | {
"github_metadata": {
"branch": "main",
"commit_count": 24,
"repo_created_at": "2023-10-11T20:13: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": "8d7caea9787... |
fc03c2ec-addc-45a1-8d99-07e4e23ac3f2 | pawarrahul1002/cppSTL | stack/sortUsingTwoStacks.cpp | #include <iostream>
#include <stack>
using namespace std;
int *sortusingStacks(int a[], int n)
{
stack<int> s1;
stack<int> s2;
s1.push(a[0]);
for (int i = 0; i < n; i++)
{
if (a[i] > s1.top())
{
s1.push(a[i]);
}
else if (a[i] < s1.top())
{
... | ALGO | 0.999993 | 5.31534 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2021-07-14T18:34: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": "c5c7bd3ba4aa... |
666b8e6f-fc9b-47c3-b9ee-70769bc032fd | kanisht09/Data-Structures-and-Algorithms | C++/Algorithms/Dynamic Programmimg/RectangleCutting_CSES.cpp | #include <bits/stdc++.h>
#define pb push_back
#define ll long long
#define jaldi() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
// cout<<"Case #"<<t1-t<<": "<<ans<<"\n"; //KICKSTART
// cout<<fixed<<setprecision(10)<<ans<<"\n"; // print ans upto 10 dp
// 2D Vector with known rows ---> vector<v... | ALGO | 0.999875 | 4.211964 | {
"github_metadata": {
"branch": "main",
"commit_count": 442,
"repo_created_at": "2020-10-05T20:19:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 27,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6a731e852... |
2c44208a-8fa2-4730-8cfd-b87085bf9529 | EsraelSousa/Online-Judge | Codeforces/treino01/E.cpp | #include <bits/stdc++.h>
using namespace std;
#define fast ios::sync_with_stdio(0); cin.tie(nullptr); cout.tie(nullptr);
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef vector<vi> vvi;
#define ff first
#define ss second;
#define all(x) x.begin(), x.end()... | ALGO | 0.998509 | 3.613693 | {
"github_metadata": {
"branch": "main",
"commit_count": 103,
"repo_created_at": "2023-01-15T02:18:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "11788822a9... |
21fc4992-f577-4330-a053-61affd8b7e97 | zhwufd/emmettLeetCode | algorithm/spiralMatrix/spiralMatrix.cpp | #include <vector>
#include <iostream>
using namespace std;
vector<int> spiralOrder(vector<vector<int> >& matrix) {
vector<int> out;
int m = matrix.size();
if( m > 0){
int n = matrix[0].size();
if(n > 0){
int maxcnt = m * n;
int cnt = 0;
int flag = 0;
... | ALGO | 0.99999 | 4.785728 | {
"github_metadata": {
"branch": "master",
"commit_count": 142,
"repo_created_at": "2015-08-20T05:40:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6942a2a0... |
a01318ec-a3eb-4766-92f8-d709b5835958 | clumbon/arduino | self-driving_tank/self-driving_tank.ino | /*******************
モータライズタンク自律走行プログラム
var03 同挙動一定時間継続時に挙動変更処理実行追加
var04 旋回時後進挙動調整(旋回完了前に後進先停止)
旋回時間ランダム化
*******************/
//測距ピン
#define ECHO_R 10
#define TRIG_R 11
#define ECHO_L 12
#define TRIG_L 13
//モーターピン
#define MR_1 8
#define MR_2 7
#define MR_PWM 9
#define ML_1 5
#define ML_2 4
#define ML_PWM 3
#define... | TOOL | 0.967556 | 4.721037 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2020-01-28T05: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": "003e14080b... |
9a528e09-0c45-4dfa-af98-9d734cfc444b | ShellRedia/Algorithm-CPlusPlus | graph/TreeDiameter.cpp | #include <iostream>
#include <vector>
using namespace std;
struct TreeDiameter{
const static int N = 50010;
int n, diameter = 0;
int d1[N], d2[N];
vector<pair<int, int>> (&E)[N];
void dfs(int u, int fa) {
d1[u] = d2[u] = 0;
for (auto p : E[u]) {
int v = p.first, w = p.... | ALGO | 0.999926 | 4.22857 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2023-09-10T03:59: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": "764a4997e0... |
ffdb50cf-98b9-431b-b190-73e5aa4e60f5 | neel-kumar/cpp | usaco/gl_tester.cpp | #include <bits/stdc++.h>
using namespace std;
string solve(int ain, string sn) {
int n = ain;
string s = sn;
map<string,int> p;
vector<string> v;
string t=s;
int i=0;
while(p.count(t) == 0) {
v.push_back(t);
p[t] = i;
string n = "D12345678D";
for(int i = 1; i < 9; i++) {
int x = (t[i-1]=='S') + (t[i... | ALGO | 0.999985 | 4.122356 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2024-09-02T19:42: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": "c9ea55053eb1... |
6235c6d3-fb66-408f-b96d-8f858b5248dc | senapk/ed_2018_1 | s11e01_list_cpp/list/main.cpp | #include <iostream>
#include <vector>
#include <list>
#include <set> // TreeSet
#include <unordered_set> //HashSet
#include <algorithm>
using namespace std;
int main()
{
vector<int> vet = {9, 4, 3, 2, 5, 6, 1};
for(int i = 0; i < (int) vet.size(); i++)
cout << vet[i] << " ";
cout << endl;
for... | TOOL | 0.992943 | 3.638989 | {
"github_metadata": {
"branch": "master",
"commit_count": 33,
"repo_created_at": "2018-03-07T13:24:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "81a6effd9... |
9d9a3460-72cd-4e3c-b15f-f305f82f7042 | Hrtrex/Projekt_Cpp | Projekt_Cpp/Macierz.cpp | #include "Macierz.h"
Macierz::Macierz(const int m, const int n) :wiersze(m), kolumny(n)
{
//cout << "konstruktor\n";
tab = new int* [wiersze];
for (int i = 0; i < wiersze; i++)
{
tab[i] = new int[kolumny]();
}
}
Macierz::~Macierz()
{
//cout << "destruktor\n";
for (int i = 0; i < wiersze; i++)
{
delete[] t... | ALGO | 0.99903 | 3.923879 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2022-03-26T00:54: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": "f07e6d452d... |
1d86d4cc-8adf-4ea5-bc1a-de343b8d6a27 | FalseF/Problem-Solving | UVa/924 Spreading the News.cpp |
/*######## IN THE NAME OF ALLAH ##########*/
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define MAX 999999999999999999
#define nl cout<<endl
#define r0 return 0
#define r1 return 1
#define sf1(x) scanf("%lld",&x)
#define sf2(x,y) scanf("%lld %lld",&x,&y)
#define sf3(x,y,z) scanf("... | ALGO | 0.999961 | 3.630638 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2021-09-06T11:47:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "85690f814... |
b7478a1c-2538-4ff6-9a16-83d6e711def2 | SayanBanerjee-007/All_DSA_Learning | 3-DSA-CPP-Apna-College/7_pairSumProblem.cpp | //Check if there exists two elementts in an array that their sum is equal to given k
#include <iostream>
using namespace std;
void pairsum(int arr[], int size, int key)
{
int low = 0;
int high = size - 1;
while (low < high)
{
if (arr[low] + arr[high] == key)
{
cout << "arra... | ALGO | 0.999646 | 5.367383 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-03-19T07:30: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": "075b9a2e869a... |
ba989d0e-99aa-4099-94fb-7a4d2bb8b095 | briansenas/C-Projects | FirstYearCS/ExercisesDone/Cotizaciones/Combinatoria.cpp | #include <iostream>
using namespace std;
int main()
{
double max_subida, min_bajada, subida, bajada, diferencia, maximo, minimo, valor, old_valor;
valor = 0; maximo = 0; minimo = 0; subida = 0; bajada = 0; diferencia = 0; max_subida = 0; min_bajada = 0;
while (valor!=-1){
diferencia = valor - ol... | ALGO | 0.999373 | 3.384483 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2020-10-03T15:56: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": "82981c587d45... |
d7a79f94-6b24-481b-ad9f-10f2dabc5d7b | imprudence/imprudence | linden/indra/newview/rlvmultistringsearch.cpp | /**
*
* Copyright (c) 2009-2010, <NAME>
*
* The source code in this file is provided to you under the terms of the
* GNU General Public License, version 2.0, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. Terms of the GPL can be found in do... | TOOL | 0.980503 | 5.843362 | {
"github_metadata": {
"branch": "next",
"commit_count": 3206,
"repo_created_at": "2010-07-12T18:43:34.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 69,
"forks": 75,
"issues": 0,
"pull_requests": 6
},
"file_meta": {
"content_id": "3e8ca16e... |
beceeefd-c7a6-4e60-b0ca-ba4ef012f7d6 | yuki12/vecmath-cpp | Quat4.h | /*
Copyright (C) 1997,1998,1999
<NAME>, Eiwa System Management, Inc.
This program is free software.
Implemented by <NAME>(<EMAIL>),
conforming to the Java(TM) 3D API specification by Sun Microsystems.
Permission to use, copy, modify, distribute and sell this software
and its documentation for any... | TOOL | 0.944119 | 5.687521 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2018-10-01T12:48:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e71b311e69... |
d21621f8-23d2-47f2-bb4c-a786eabf03ee | KevinRLE/Progrmacion-1-Tareas | Arreglos/vectores_basico/main.cpp | //solucion del programa
#include <iostream>
#include <stdlib.h>
//cambio de posicion de declaraciones
//Declaraci˛n de Constantes
#define NUMEROALUMNOS 5
#define NUMEROMATERIAS 5
#define NUMERONOTAS 4
#define MAX_CALIFICACION 100
#define MIN_CALIFICACION 0
#define MAX_LONGITUD_CADENA 100
using namespace std;
//Decla... | TOOL | 0.969716 | 4.030022 | {
"github_metadata": {
"branch": "main",
"commit_count": 26,
"repo_created_at": "2025-01-17T15:05: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": "193570e2ebc... |
c30e7902-117a-49de-a72f-001ce6902d88 | deepindeed2022/Algorithm | cppbasic/perm.cpp | //
// Heap's algorithm
// Heap's algorithm generates all possible permutations of n objects.
// It was first proposed by <NAME> in 1963.[1]
// The algorithm minimizes movement:
// it generates each permutation from the previous one by interchanging
// a single pair of elements; the other n−2 elements are not distu... | ALGO | 0.999808 | 5.914289 | {
"github_metadata": {
"branch": "master",
"commit_count": 181,
"repo_created_at": "2014-03-19T14:47:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d3c1be82... |
6155a902-c32c-4377-a7ae-dd1a9b3a013b | tinhngovnptho/Code | CP/Code THPT/DTQG 25/VOI Traning/PreVOI 20-11/seq.cpp | /**
* author: tinhnopro (tinh nop)
* created: 2024-12-05
**/
#ifdef LOCAL
#include "debug.h"
#else
#define debug(...) 0
#endif // LOCAL
#include <bits/stdc++.h>
#define TASK "seq"
using namespace std;
const int maxN = 3e5 + 11;
int n, k, a[maxN], cnt[maxN];
void compress(int *a, int n) {
vector<int> h;
for (i... | ALGO | 0.99999 | 4.963647 | {
"github_metadata": {
"branch": "main",
"commit_count": 25,
"repo_created_at": "2024-10-13T07:51: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": "48f0fcff099... |
a27b2f5c-84e5-4d15-b093-3a25364b9341 | dbueno/euforia | src/cube.h | // Copyright 2021 National Technology & Engineering Solutions of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S. Government retains certain rights in this software. See LICENSE.txt for details.
//
// Author: <NAME>
#ifndef cube_hpp
#define cube_hpp
#include "supp/std_supp.h"
#includ... | ALGO | 0.911959 | 7.46982 | {
"github_metadata": {
"branch": "main",
"commit_count": 16,
"repo_created_at": "2021-06-15T17:15:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ebf6d965093... |
b475f1a1-5bd5-4b29-babb-cf8df46e43a8 | Svetlozar-Stefanov/FMI | Semester3-SDA/WeeklyHomework12/Task01/Task01.cpp | #include <iostream>
#include <unordered_set>
#include <vector>
using namespace std;
void connectCities(int c1, int c2, vector<unordered_set<int>>& subgraphs)
{
int s1 = -1;
int s2 = -1;
for (int i = 0; i != subgraphs.size(); i++)
{
if (subgraphs[i].find(c1) != subgraphs[i].end())
{
... | ALGO | 0.999794 | 5.034258 | {
"github_metadata": {
"branch": "master",
"commit_count": 124,
"repo_created_at": "2021-10-18T16:47: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": "f1517d8f... |
4a4ab612-6764-42fd-a3b0-4fb3e68f9734 | SymbianSource/oss.FCL.sf.mw.appsupport | tzservices/tzloc/src/TzLocalizationSortFunctions.cpp | // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
// All rights reserved.
// This component and the accompanying materials are made available
// under the terms of "Eclipse Public License v1.0"
// which accompanies this distribution, and is available
// at the URL "http://www.eclipse.org/legal/e... | TOOL | 0.990055 | 5.098883 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2016-10-14T18:48:44.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "80efaf7f23... |
de05dbd0-9eb3-43bb-8334-91d678da2876 | arangodb/arangodb | 3rdParty/boost/1.78.0/libs/graph/example/read_write_dimacs-eg.cpp | // Copyright (c) 2006, <NAME>
//
// This code may be used under either of the following two licences:
//
// 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 Software without
// restrictio... | ALGO | 0.982914 | 5.880415 | {
"github_metadata": {
"branch": "devel",
"commit_count": 51986,
"repo_created_at": "2011-10-26T06:42:00.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 13878,
"forks": 857,
"issues": 743,
"pull_requests": 38
},
"file_meta": {
"content_id": ... |
544a83c3-ad59-4524-b038-d7c6aa732c80 | adityasrathore/Codes | LeetCode/232. Implement Queue using Stacks.cpp | class MyQueue {
public:
stack<int> in;
stack<int> out;
int ele = -1;
MyQueue() {
}
void push(int x) {
if(in.empty()){
ele = x;
}
in.push(x);
}
int pop() {
if(out.empty()){
while(!in.empty()){
out.p... | ALGO | 0.999959 | 5.537018 | {
"github_metadata": {
"branch": "main",
"commit_count": 918,
"repo_created_at": "2022-06-10T16:26:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6c7ea445b6... |
d6a75b41-88a3-49e4-af85-3963d7efd646 | h4wwk3ye/code | Hackerearth/DP 2_D/prime_game.cpp | /*
C++
encoding:UTF-8
Modified: <13/May/2019 07:27:03 PM>
✪ H4WK3yE乡
<NAME>
Indian Institute Of Information Technology (IIIT), Gwalior
*/
#include <bits/stdc++.h>
using namespace std;
// clang-format off
#define ll int64_t
#define mod 1000000007
#d... | ALGO | 0.999843 | 4.603366 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2022-03-12T15:34: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": "1bbc497564... |
47c29a5c-b7c8-420b-9bb7-2b36b99680b9 | udonyang/acmps | hdu/水题热身,貌似难以AK/G/Problem G.cpp | #include <cstdio>
#include <cstdlib>
#include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>
using namespace std;
#define Rep(c, a, b) for (int c = a; c < b; c++)
#define MAXN (2000)
#define INFI (10000)
#define X2(x) (x * x)
struct Doll
{
int w, l, h;
friend bool operator > (Doll p, Doll... | ALGO | 0.999768 | 3.516479 | {
"github_metadata": {
"branch": "master",
"commit_count": 269,
"repo_created_at": "2013-04-01T00:39:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "147302d6... |
14f803c8-4d01-4433-8e5c-40b6004651f7 | Memories-of-Sun-and-Moon/cp_templates | graph/hungarian.hpp | #pragma once
#include<limits>
#include<numeric>
#include<vector>
template<bool is_min, typename T>
std::vector<int> hungarian(std::vector<std::vector<T>> a) {
T infty = std::numeric_limits<T>::max()/T(2);
int n = (int)a.size();
if(not is_min){
for(int i = 0;i < n;i++){
for(int j = 0; j < n;j++){
a[i][j]... | ALGO | 0.999825 | 4.964352 | {
"github_metadata": {
"branch": "main",
"commit_count": 497,
"repo_created_at": "2022-06-16T01:13:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 13,
"pull_requests": 0
},
"file_meta": {
"content_id": "3b02f7a89... |
758361bb-11fc-4c4e-8ecb-2f8c28fa80e5 | ChongZhengUoM/N-body-simulation | GPUSystem.cpp | #include "./include/GPUSystem.h"
extern "C" void cuda_kernel(float3 * devPos, float3 * devDir, float3 * devAcc, float* devMass, int bodyCount, float sf, float G, float deltaT);
void GPUSystem::loadData2Device() {
hostPos = new float3[bodyCount];
hostDir = new float3[bodyCount];
hostAcc = new float3[bodyCount];
ho... | ALGO | 0.964724 | 3.964566 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2022-04-04T16:17:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bf09054c96... |
30a9a6db-fc1d-4cad-9eda-375593fc77d6 | ishandutta2007/codeforces-i | -is-this-fft-/normal/1383/E.cpp | #include <iostream>
#include <vector>
using namespace std;
typedef long long ll;
const int MOD = 1e9 + 7; // change if needed
struct Modint {
ll val;
Modint (ll _val = 0)
: val(_val % MOD) {}
Modint operator+ (Modint other) const {
return Modint(val + other.val);
}
void operator+= (Modint oth... | ALGO | 0.999956 | 4.041115 | {
"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": "c21119070330... |
4c6241ec-750a-4ea6-a4cc-c80954cecdf7 | tiankonguse/leetcode-solutions | problemset-new/000/00069-sqrtx/zwkcoding-sqrtx.cpp | /*
* Filename: /home/zwk/code/data_structrue/c++/binary_search/sqrtx/main.cpp
* Path: /home/zwk/code/data_structrue/c++/binary_search/sqrtx
* Created Date: Sunday, May 5th 2019, 9:29:43 pm
* Author: zwk
*
* Copyright (c) 2019 Your Company
*/
#include "../../include/base.h"
class Solution {
public:
int myS... | ALGO | 0.999963 | 4.883909 | {
"github_metadata": {
"branch": "master",
"commit_count": 1037,
"repo_created_at": "2015-04-11T09:31:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 81,
"forks": 26,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "d04a8... |
5f9a85ff-f733-44d9-9a5e-1620f945afdc | esejjec/prac1labcc2 | ejercicio3.cpp | #include <iostream>
using namespace std;
void mostarray(int a[100], int n){
int i;
for (i=0; i < n; i++)
cout<<a[i]<<" ";
cout<<endl;
}
void mergesort(double a[10],double aux[10],int inicio, int mitad, int finl){
int inicio_end, num_elementos, aux_pos;
inicio_end=mitad-1;
aux_pos=inicio... | ALGO | 0.999961 | 4.704057 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2018-04-11T05:41: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": "5e1ed952d... |
7bf9a3cd-5991-4857-9d3d-0d6d7cceff33 | GaryChettiar/cpp | 8.1.cpp | #include<iostream>
using namespace std;
class Node{
int data;
Node *next;
public:
Node *head =NULL;
void insertAfter(){
Node *p;
int i,n,x;
cout<<"\nEnter the node after which you want to insert the new node: ";
cin>>n;
Node *te... | ALGO | 0.993555 | 4.878723 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-01-22T04:06: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": "b844f4f76d3a... |
5bfa7858-f049-4a12-980f-5fe5d319b6ae | WhiZTiM/coliru | Archive2/1d/b78eeb0186e30d/main.cpp |
#include <iostream>
#include <utility>
struct Functor2 {
int operator()(int id) const &
{
std::cout << "Functor2 &... " << id << std::endl;
return id;
}
int operator()(int id) &&
{
std::cout << "Functor2 &&... " << id << std::endl;
return id;
}
};
struct Functor1 {
int operator()(int id... | TOOL | 0.956309 | 6.848619 | {
"github_metadata": {
"branch": "master",
"commit_count": 42630,
"repo_created_at": "2016-04-21T16:34:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c63698... |
6673b3c1-3f43-4d32-b85d-c3f44dd7db30 | LeeJE12/codetree-TILs | 240827/양수 직사각형의 최대 크기/max-area-of-positive-rectangle.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int n, m;
int arr[20][20];
bool Counter(int x1, int y1, int x2, int y2) {
for(int i=x1; i<=x2; i++) {
for(int j=y1; j<=y2; j++) {
if(arr[i][j] < 1) {
return false;
}
}
}
return true;
}
in... | ALGO | 0.999846 | 4.269216 | {
"github_metadata": {
"branch": "main",
"commit_count": 100,
"repo_created_at": "2024-08-17T09:10: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": "262aa95b8a... |
f5dd18c9-0461-4609-96ae-0d8db22cd7d7 | EremK/MyBattleship | MyBattleship_v.2/ships.cpp | #include "header.h"
#include "functions.h"
bool placeShips(int arrGraph[][BS], int rands[], int i, int j, int counter)
{
srand(time(0)); // ?
int direction = rands[counter];
char dirResult = '-';
switch (direction)
{
case 0:
{
int y = 0;
for (y; y < ships[counter]; y++)
{
for (int U = 0; U < 8; U++)
... | ALGO | 0.997711 | 3.195892 | {
"github_metadata": {
"branch": "master",
"commit_count": 27,
"repo_created_at": "2022-05-20T08:41: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": "5716702b1... |
e11fec2b-3f09-4609-8710-86c97e1784dc | celyk/adventofcode2021 | day7/part2.cpp | #include<iostream>
#include<fstream>
#include<string>
#include<vector>
#include<algorithm>
using namespace std;
int main(){
vector<int> arr;
ifstream file("input.txt");
string str;
while(getline(file, str)){
size_t ot = 0;
size_t t = 0;
while(t != string::npos){
t ... | ALGO | 0.999587 | 3.75401 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2021-12-11T04:24:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1a51be885921... |
f064d982-80aa-400c-baca-16b0a6ffb7da | kartikpachori/DSA-daily-practise | 0130-surrounded-regions/0130-surrounded-regions.cpp | class Solution {
public:
void solve(vector<vector<char>>& board) {
int m = board.size();
if (m == 0) return;
int n = board[0].size();
auto bfs = [&](int i, int j) {
queue<pair<int, int>> q;
q.push({i, j});
board[i][j] = 'S';
wh... | ALGO | 0.999852 | 6.392837 | {
"github_metadata": {
"branch": "main",
"commit_count": 920,
"repo_created_at": "2023-05-30T14:49:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d90ca16825... |
639c2059-4fa8-4bc6-a9ce-94c466cc9472 | vovandreevik/Cross-Reference-Generator | main.cpp | #include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <iomanip>
std::vector<std::string> readLinesFromFile(const std::string& filename);
void printTextWithLineNumbers(const std::vector<std::string>& lines);
std::string connectLines(co... | TOOL | 0.926803 | 6.125337 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2023-05-26T14:14:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5e588cffb8... |
d5b866a3-0fed-423c-840a-ede42d03557e | OpenVPN/openvpn3 | openvpn/tun/win/nrpt.hpp | // OpenVPN -- An application to securely tunnel IP networks
// over a single port, with support for SSL/TLS-based
// session authentication and key exchange,
// packet encryption, packet authentication, and
// packet compression.
//
// Copyright (C) 2012- Op... | TOOL | 0.908546 | 4.545109 | {
"github_metadata": {
"branch": "master",
"commit_count": 4488,
"repo_created_at": "2016-09-16T01:12:39.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1086,
"forks": 424,
"issues": 66,
"pull_requests": 10
},
"file_meta": {
"content_id": "e... |
71fcb6ae-471d-4523-ab5d-41b725cf6433 | JonasToth/jt-computing | lib/crypto/Sha256.cpp | #include "jt-computing/crypto/Sha256.hpp"
#include <algorithm>
#include <bit>
#include <cassert>
#include <immintrin.h>
#include <iomanip>
#include <sstream>
namespace jt::crypto {
namespace {
std::string str(const std::array<u32, 8> &digest) {
std::stringstream s;
s << std::setfill('0') << std::hex;
auto byte... | ALGO | 0.998949 | 7.215374 | {
"github_metadata": {
"branch": "master",
"commit_count": 59,
"repo_created_at": "2021-11-23T17:30: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": "805b23290... |
c8ffd060-713b-4e4d-bb7f-527e5f600084 | FISCO-BCOS/libzkg | circuit/gadget/cm.tcc | /*
* @file: cm.tcc
* @author: jimmyshi
* @date: 4th May 2018
* @copyright: MIT license (see LICENSE file)
*/
#include <ctime>
#include <cstdlib>
#include "merkle.tcc"
#include "prf.tcc"
#include "cm_pool.hpp"
//-----------------------承诺部分------------------------
template <typename FieldT>
class cm_gadget : gad... | TOOL | 0.956368 | 3.200106 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2018-05-14T02:49:38.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 14,
"forks": 8,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f648b8a17... |
f7b6be22-779f-40d7-82f6-768eec457b38 | wilsonjr/CoolProblems | SPOJ/cocirc10.cpp | /**
http://br.spoj.com/submit/CARDAPIO
*/
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <set>
#include <algorithm>
#include <cmath>
#include <iostream>
using namespace std;
long maior = -1;
double E = 10e-10;
struct ponto {
double x;
double y;
ponto():x(0), y(0) {}
ponto(double... | ALGO | 0.99978 | 4.198872 | {
"github_metadata": {
"branch": "master",
"commit_count": 40,
"repo_created_at": "2017-04-09T01:53: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": "3523c3c49... |
8b36f6f9-9860-445c-bad1-5b8cd4646d95 | Rexskth/leetcode | 15-3sum/3sum.cpp | class Solution {
public:
vector<vector<int>> threeSum(vector<int>& nums) {
sort(nums.begin(), nums.end());
vector<vector<int>> ans;
int n = nums.size();
for (int i = 0; i < n - 2; i++) {
// Skip duplicates for i
if (i > 0 && nums[i] == nums[i - 1]) continue... | ALGO | 0.999934 | 6.604767 | {
"github_metadata": {
"branch": "main",
"commit_count": 1052,
"repo_created_at": "2024-09-25T13:41: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": "4a3189d47... |
ed9bb4ac-3ff6-49de-97d2-057aca3098dc | coderepositor/c-tutorials | Aggressivecows.cpp | /* Agressive Cows Problem*/
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
bool canWePlace(vector<int> &stalls,int dist, int cows){
int n = stalls.size();//size of array
int cntCows=1;
int last = stalls[0]; //position of last placed cow
for(int i=0;i<n;i++)
{
... | ALGO | 0.999967 | 4.947474 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2025-03-29T06:17: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": "7e470b06f0... |
4fba0f76-8708-4485-b845-fd9a9a514915 | ishandutta2007/codeforces-t | theoneyouwant/normal/321/C.cpp | //By TheOneYouWant
#pragma GCC optimize ("-O2")
#include <bits/stdc++.h>
using namespace std;
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(x) x.begin(),x.end()
#define memreset(a) memset(a,0,sizeof(a))
#defin... | ALGO | 0.999948 | 3.592036 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:27: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": "210fde8a8908... |
7412847e-3dcc-4ccf-b10f-32434bf32627 | felix-rojas/verano-algos | actividad5.1/attempt3/class replit/HashTable.h | #ifndef __HASH_TABLE_H_
#define __HASH_TABLE_H_
#include <iostream>
#include <vector>
#include <stdexcept>
#include "HashNode.h"
template<class K, class T>
class HashTable {
private:
std::vector<HashNode<K,T>> table;
int numElements;
int maxCapacity; // preferible un numero primo
public:
HashTabl... | ALGO | 0.989038 | 5.497716 | {
"github_metadata": {
"branch": "main",
"commit_count": 124,
"repo_created_at": "2022-06-27T13:16:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8325f1d9e7... |
e15d8d6a-80ef-47db-bf7a-e83a1b3d6c62 | anuvindbhat/parallel-fft | src/fft1d.cpp | #include "fft1d.h"
#include "utils.h"
#include <algorithm>
#include <cassert>
#include <complex>
#include <cstdint>
#include <utility>
#include <vector>
// 1 << 4 for GHC, 1 << 6 for PSC
inline constexpr int32_t recursion_threshold = 1 << 4;
// 1 << 16 for GHC, 1 << 17 for PSC
inline constexpr int32_t iters_in_cache =... | ALGO | 0.999959 | 7.270173 | {
"github_metadata": {
"branch": "main",
"commit_count": 110,
"repo_created_at": "2022-11-10T00:44:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "72a4db1d3a... |
aa193105-28d7-44e4-b354-2cf79990aeca | ishandutta2007/codeforces-h | hongzy/normal/1695/C.cpp | #include <bits/stdc++.h>
#define rep(i, j, k) for(int i = j; i <= k; ++ i)
#define per(i, j, k) for(int i = j; i >= k; -- i)
using namespace std;
const int N = 1029;
int n, m, a[N][N], p[N][N], q[N][N];
int main() {
int test;
scanf("%d", &test);
rep(T, 1, test) {
scanf("%d%d", &n, &m);
rep(i, 1, n) rep(j,... | ALGO | 0.999716 | 3.464159 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T02:01: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": "a719a921de14... |
e0660ac3-a7d5-40d6-a2ed-db47f34e30e3 | leek018/Algo | baekjoon/baekjoon/baekjoon_18119.cpp | #include <iostream>
#include <vector>
#include <string>
using namespace std;
vector<int> graph[26];
int SentenceOri[10000];
int SentenceVary[10000];
int doyouKnowsentence(int N)
{
int answer = 0;
for (int i = 0; i < N; i++)
{
if (SentenceOri[i] == SentenceVary[i])
answer++;
}
return answer;
}
int main()
{
... | ALGO | 0.99989 | 3.88921 | {
"github_metadata": {
"branch": "master",
"commit_count": 57,
"repo_created_at": "2020-02-01T08:37: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": "5d430f476... |
6d97c3af-b8bd-423b-bd0e-c082540a2371 | moveit/moveit | moveit_planners/sbpl/core/sbpl_interface/src/bfs3d/BFS_3D.cpp | /*********************************************************************
* Software License Agreement (BSD License)
*
* Copyright (c) 2008, <NAME>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
... | ALGO | 0.994925 | 4.49081 | {
"github_metadata": {
"branch": "master",
"commit_count": 8038,
"repo_created_at": "2016-07-27T20:38:09.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1896,
"forks": 967,
"issues": 563,
"pull_requests": 55
},
"file_meta": {
"content_id": "... |
86a3b4e4-275b-4166-bdc0-554dde548642 | koosaga/olympiad | ICPC/KAIST/kaist17fall_h.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long lint;
typedef pair<int, int> pi;
struct seg{
lint tree[2100000];
int lim;
void init(int n){
fill(tree, tree + 2100000, 1e18);
for(lim = 1; lim <= n; lim <<= 1);
}
void add(int x, lint v){
x += lim;
tree[x] = v;
while(x > 1){
x >>= 1;
... | ALGO | 0.999912 | 3.459512 | {
"github_metadata": {
"branch": "master",
"commit_count": 361,
"repo_created_at": "2015-11-06T16:01:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 285,
"forks": 31,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "deec0... |
1168f3eb-a7d3-4ceb-874a-294b4b11871e | jtrevag/cloaked-octo-computing-machine | unusedFunctions.cpp | int equalDistribution (process processes[], int size) {
int target, total = 0;
for (int i = 0; i < size; i++)
{
total += processes[i].cycles;
}
target = floor(total/5); //This is the target cycle number for each processor.
int count = 0;
for (int i =0; i < 5; i++)
{
int limit = 0;
while (limit <= tar... | ALGO | 0.999739 | 3.738624 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2014-03-07T18:16: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": "586b24ece... |
cd0c30fa-cf8b-4d7e-b38d-da2d5e8d3c17 | IvanIsCoding/CompetitiveProgramming | SPOJ/ILKQUERY2.cpp | // <NAME>
// Solution to https://www.spoj.com/problems/ILKQUERY2/
#include <cmath>
#include <cstdio>
#include <set>
#include <unordered_map>
#define MAXS 400
#define MAXN 100010
using namespace std;
set<int> conjunto;
int status[MAXN], vetor[MAXN], n, q, S, blocao[MAXS][MAXN], contador;
unordered_map<int, int> compress... | ALGO | 0.999679 | 3.999455 | {
"github_metadata": {
"branch": "master",
"commit_count": 171,
"repo_created_at": "2018-04-30T13:58:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 85,
"forks": 11,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ce1825... |
00a85df0-1890-4a53-ab30-6e0a9dc4bc82 | fsarbout/cpp | module08/ex01/span.cpp | #include "span.hpp"
Span::Span() {}
Span::~Span() {}
Span::Span(unsigned int N) : _N(N) {}
Span &Span::operator=(const Span &obj)
{
this->_N = obj.getN();
this->_V = obj.getVector();
return *this;
}
unsigned int Span::getN() const { return this->_N; }
Span::Span(const Span ©) { *this = copy; }
void Span:... | ALGO | 0.981978 | 4.562097 | {
"github_metadata": {
"branch": "master",
"commit_count": 133,
"repo_created_at": "2021-07-13T08:21:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "382171f8... |
d6b1625b-3cb8-45e5-8a93-20b0724def60 | YoungCIoud/PracticeOfFishAcmer | 2024summer/nk/3/H.cpp | // 思维 大大的思维
#include<bits/stdc++.h>
//using namespace std;
#define IOS std::ios::sync_with_stdio(false), std::cin.tie(0), std::cout.tie(0)
#define vct std::vector
#define ary std::array
#define str std::string
int main()
{
int n, m, k;
std::cin >> n >> m >> k;
vct mpx(2, vct(n + 5, vct<int>(m + 5)));
vct mpy(2, vc... | ALGO | 0.999939 | 3.459035 | {
"github_metadata": {
"branch": "main",
"commit_count": 277,
"repo_created_at": "2024-05-14T13:12: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": "655c7c7147... |
f6362c9c-9af4-4ff9-a646-bdcd7b19c273 | Haroon300/C-LAB | C++ Code/New folder/Question-1-correct-way.cpp | //Objective # 02:
//Build a Binary Tree by inserting elements in the same manner as nodes are inserted in the heap i.e. from left to right. Each node should hold a float value.
//Given a pointer to the root of a binary tree:
//Find its mirror image; mirror image of the tree is build such that the left child of the root... | ALGO | 0.99998 | 5.256155 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-06-10T09:25: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": "1d1a1eff6bca... |
b83ff033-76b1-4a17-bdf4-d7c0315adf09 | AshishSharma1203/DSA_Submissions | 0646-maximum-length-of-pair-chain/0646-maximum-length-of-pair-chain.cpp | class Solution
{
public:
static bool comp(vector<int> &a, vector<int> &b)
{
return a[0] < b[0];
}
int solve(int i, int last, vector<vector < int>> &pairs, vector< vector< int>> &dp)
{
if (i >= pairs.size())
return 0;
if (dp[i][last + 1] != ... | ALGO | 0.99987 | 4.899931 | {
"github_metadata": {
"branch": "main",
"commit_count": 933,
"repo_created_at": "2023-01-12T05: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": "77391236b7... |
7f7281ba-d6c4-484e-84b8-f347f655eeb4 | Quptex/Functions | arrays/DZ_Func.cpp | #include<iostream>
using namespace std;
#define tab "\t"
const int ROWS = 5;
const int COLS = 4;
void FillRand(int arr[], const int n, int minRand = 0, int maxRand = 100);
void FillRand(double arr[], const int n, int minRand = 0, int maxRand = 100);
void FillRand(float arr[], const int n, int minRand = 0, int maxRand... | TOOL | 0.997315 | 4.141135 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2022-09-15T13:27: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": "0da8c0116e... |
af74c6b4-adf8-4052-90e1-c2ae38bfcac3 | HelenHarman/AIS_Object_Tracking | AIS_TrackingAndDetection/DistanceMeasures/sumOfSquaredDifference.h | /*!
* \file sumOfSquaredDifference.h
* \author <NAME> (<EMAIL>)
* \date 24/03/2015
* \version 1.0
*
* \brief Holds the SumOfSquaredDifference class
*/
#ifndef SUMOFSQUAREDDIFFERENCE_H
#define SUMOFSQUAREDDIFFERENCE_H
#include "distanceBase.h"
/*!
* \class SumOfSquaredDifference
* \brief Used to calculate the... | TOOL | 0.971086 | 6.107845 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2015-09-29T15:21:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "188dbd04e... |
9f47141a-fb8a-4cc6-aafc-f66c66b94833 | RabeyaMuna/Problem-Solving | CSE419-Advanced Programming/Final/T12.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int M,N;
cin>>M>>N;
int Mat[M][N];
for(int i=0;i<M;++i){
for(int j=0;j<N;++j){
cin>>Mat[i][j];
}
}
int dp[M][N];
for(int i=0;i<M;++i){
for(int j=0;j<N;++j){
dp[i][j]=0;
... | ALGO | 0.999977 | 3.792858 | {
"github_metadata": {
"branch": "main",
"commit_count": 158,
"repo_created_at": "2022-02-05T12:39:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "711bb1f0c9... |
ed9b6ad1-4674-4900-b16a-f6073a50b60b | sambhav069/ENCRYPTIX | TIC-TAC-TOE.cpp | #include <iostream>
using namespace std;
// Function to display the current state of the tic-tac-toe board
void showBoard(char board[3][3]) {
cout << "-----------------" << endl;
for (int row = 0; row < 3; row++) {
cout << " | ";
for (int col = 0; col < 3; col++) {
cout << board[row... | ALGO | 0.999585 | 6.922545 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-08-10T11:39: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": "a1d73380da4c... |
74d4c589-2a39-4583-8e21-1e8035d33122 | mwy3055/Algorithm-codes | baekjoon/cpp/c++/1956.cpp | #include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> Pair; // dist, dest
const int INF = 0x3f3f3f3f;
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
int v, e;
cin >> v >> e;
int d[v + 1][v + 1];
memset(d, 0x3f, sizeof(int) * (v + 1) * (v + 1));
for (int i = 0; i < e;... | ALGO | 0.999832 | 3.869855 | {
"github_metadata": {
"branch": "main",
"commit_count": 1073,
"repo_created_at": "2022-01-08T11:18:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4d2f111a5... |
1fdcacea-d2db-4172-8e28-07122589dad6 | cran/nlmixr | src/PKPDLib_WW.h | //chk consistenty of par order bewteen models
#ifndef __STAN__MATH__FUNCTIONS__PKPDLIB_HPP__
#define __STAN__MATH__FUNCTIONS__PKPDLIB_HPP__
#include <stan/math/rev/core.hpp>
#include <stan/math/prim/mat/fun/Eigen.hpp>
#include <stan/math/prim/scal/err/check_greater_or_equal.hpp>
#include <vector>
#include <utility>
#i... | ALGO | 0.956596 | 5.72871 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2017-11-09T11:57:06.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f2c6c6cae4... |
90d6f620-11c2-40bd-838b-01535a6adb6e | tejas18112001/leetcode_problems | 0129-sum-root-to-leaf-numbers/0129-sum-root-to-leaf-numbers.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.999895 | 5.433604 | {
"github_metadata": {
"branch": "main",
"commit_count": 722,
"repo_created_at": "2022-11-16T17:59:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "55dc360ac0... |
26123586-411c-4117-9207-2d8c12b4fe13 | alualu628628/LOAM_HESAI | src/lib/MultiScanRegistration.cpp | // Copyright 2013, <NAME>, Carnegie Mellon University
// Further contributions copyright (c) 2016, Southwest Research Institute
// 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. Redistr... | CONFIG | 0.902029 | 4.85849 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2018-12-13T06:35:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "95033d3b65... |
b4ba8066-5a60-4b26-bf8a-5cc2e248ea10 | Abrahamcepedao/ITC | Semestre3/estructuras_de_datos_algoritmos_fundamentales/tareas/orderAlgorithms/orderExchange.cpp | // This algorithm sort a vector with the exchange method
// <NAME>
// A00827666
// August 17th 2020
#include <iostream>
#include <string>
#include <vector>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
using namespace std;
template<class T>
void exchange(vector<T> &vect, int num1, int num2){
int num ... | ALGO | 0.999965 | 5.190183 | {
"github_metadata": {
"branch": "master",
"commit_count": 156,
"repo_created_at": "2020-06-17T00:52:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 78
},
"file_meta": {
"content_id": "4d79f72... |
53ca6cda-318a-49cb-baef-c97d28ca022e | ArturChmura/ModelowanieGeometryczne | MainProject/BresenhamsAlgorithm.h | #pragma once
#include <functional>
#define LINE_OVERLAP_NONE 0 // No line overlap, like in standard Bresenham
#define LINE_OVERLAP_MAJOR 0x01 // Overlap - first go major then minor direction. Pixel is drawn as extension after actual line
#define LINE_OVERLAP_MINOR 0x02 // Overlap - first go minor then major direction... | ALGO | 0.938657 | 6.118961 | {
"github_metadata": {
"branch": "main",
"commit_count": 119,
"repo_created_at": "2022-03-11T19:31: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": "1bc2639f96... |
73df56e7-4580-4b6b-988a-87fa808f2902 | Vishal1062996/Data-Structure | Circular linkedlist/deleting_node.cpp | #include<iostream>
using namespace std;
class node{
public:
int data;
node *next;
};
class Linkedlist{
private:
node *first;
public:
Linkedlist(){
first = NULL;
}
Linkedlist(int A[], int n);
// ~Linkedlist(){
// cout << "destructor is executed\n";
// };
... | ALGO | 0.999629 | 4.463101 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-07-28T13:56: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": "d070ae622044... |
500af0e9-cf95-4619-ab21-cc089b4b80b8 | YanivFais/EFNoC | EFNoc/Test/ScheduleCalculator/LPInterface.cpp | #include "LPInterface.h"
#include "ClpSimplex.hpp"
#include "ClpInterior.hpp"
#include "ClpPrimalColumnSteepest.hpp"
#include "ClpPrimalColumnDantzig.hpp"
#include "VarRepository.h"
#include <time.h>
using namespace std;
static const double FLOW_TOLERANCE = 1e-5;
LPInterface::LPInterface(void)
{}
bool LPInterface... | ALGO | 0.996953 | 4.274889 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2020-04-10T11:01: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": "bf24728a62... |
de80467b-b696-4a87-90d8-a325b28c826b | externalxdpro/LeetcodeSolutions | CPP/CountUnguardedCellsInTheGrid_2257.cpp | // 2257. Count Unguarded Cells in the Grid
// Difficulty: Medium
// You are given two integers m and n representing a 0-indexed m x n grid. You
// are also given two 2D integer arrays guards and walls where guards[i] =
// [rowi, coli] and walls[j] = [rowj, colj] represent the positions of the ith
// guard and jth wall... | ALGO | 0.998598 | 6.738963 | {
"github_metadata": {
"branch": "main",
"commit_count": 744,
"repo_created_at": "2024-02-14T03:18:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "92b42f2522... |
78d9226e-4b3f-47f5-9c69-1fe472b5c6ce | Ronaldo-seven/design_mode | 设计模式/工厂模式.cpp | #include<iostream>
#include<list>
#include<string>
#include<vector>
using namespace std;
////简单工厂模式
// //class MyCar{
// //public:
// // virtual string CarName() = 0;
// //};
//
// //class BMWCAR:public MyCar{
// //public:
// // BMWCAR(){
// // cout << "creater BMW success" << endl;
// // }
// // string CarName(){
/... | ALGO | 0.991664 | 4.2161 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2019-11-12T14:41: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": "8865dd88f3... |
ef98247f-3a8b-4efa-b9cb-eb13b689bc60 | JulianBirsan/Competitive-Programming-Solutions | DMOJ Solutions/JOI/joi16op3.cpp | #include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#define deb(...) logger(#__VA_ARGS__, __VA_ARGS__)
template<typename ...Args>
void logger(string vars, Args&&... values) {
cerr<<vars<<" = ";
string delim="";
(...,(cerr<<delim<<values,delim=", "));
cerr<<"\n";
}
#else
#define deb(...) logger(... | ALGO | 0.99999 | 3.61755 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2023-11-12T22:21: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": "af9945b18f... |
4a22e5f3-a0c5-465b-aa09-f408932c149f | kmdare/Project_Euler | Problem_3/Problem_3.cpp | // Problem 3 of Project Euler
#include <iostream>
#include <time.h>
#include <iomanip>
#include <ctime>
long long int f(long long int input)
{
long long int output = input;
for (int i = 2; i <= input; i += 1)
{
int k = 0;
while (input%i == 0)
{
k += 1;
input /= i;
}
if (input == 1)
{
output = i... | ALGO | 0.99978 | 5.234828 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2016-09-12T08:42:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "96b5db1b7... |
53a60c4b-9589-4d64-9098-233ef99d40cb | apache/incubator-milagro-crypto | version22/ecgen.cpp | /*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this f... | ALGO | 0.904176 | 4.128138 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2016-05-19T07:00:06.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 63,
"forks": 21,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6f96a057... |
9d4fd76b-30bb-47df-a6a1-049cb1490a05 | anaypaul/LeetCode | FindLeavesOfBinaryTree.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
bool isLeaf(TreeNode * root){
if(!root){
return false;
}
re... | ALGO | 0.999956 | 6.056804 | {
"github_metadata": {
"branch": "master",
"commit_count": 753,
"repo_created_at": "2018-10-16T05:10: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": "a3200777... |
918050e7-cddb-4c4e-8ee0-6e1d90b78639 | tainzhi/acm | jobdu/1538.cpp | /*************************************************************************
> File:
> Author: muqing
> Mail: <EMAIL>
> Created Time: Mon 24 Feb 2014 07:36:54 AM CST
************************************************************************/
#include <iostream>
#include <string>
#include <vector>
#inclu... | ALGO | 0.999633 | 3.480942 | {
"github_metadata": {
"branch": "master",
"commit_count": 256,
"repo_created_at": "2014-05-09T02:35:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bd60d9f5... |
1946dabd-f99a-4975-8923-c7c2f5fce4b3 | jacklanda/CppCollection | LeetCode/LinkedList/83. Remove Duplicates from Sorted List.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) {}
* };
*/
/* Two-pointer approach */
/* time complexity: O(... | ALGO | 0.999989 | 6.134746 | {
"github_metadata": {
"branch": "main",
"commit_count": 473,
"repo_created_at": "2020-12-31T17:38:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "62329a45ed... |
1561d21c-5d2c-4546-bab6-58915818c9bf | joaomadeira1208/Trabalho-1-PAA | Main.cpp | #include "Grafo.hpp"
#include "Algoritmos.hpp"
#include <iostream>
#include <vector>
#include <chrono>
#include <cstdlib>
#include <ctime>
#include <algorithm>
#include <set>
#include <queue>
#include <random>
using namespace std;
using namespace chrono;
// Grafo gerarGrafoEulerianoAleatorio(int nVertices)
// {
// ... | ALGO | 0.998898 | 5.282138 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2025-03-06T22:42:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8c2f07bcb0... |
7b186369-ac41-4147-86da-fb38a20a5915 | prashantpandey9/create-your-own-what-you-want | c++/preorderTreeTraversal.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define sc ;
#define tc ll t sc cin >> t sc while (t--)
#define fast ios::sync_with_stdio(false)
#define spyder cin.tie(NULL)
struct Node
{
int data;
Node *left;
Node *right;
Node(int d)
{
data = d;
left = right = NU... | ALGO | 0.999995 | 5.16819 | {
"github_metadata": {
"branch": "master",
"commit_count": 482,
"repo_created_at": "2018-10-14T05:45:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 26,
"forks": 93,
"issues": 0,
"pull_requests": 10
},
"file_meta": {
"content_id": "1a9e8... |
7ad735f0-bfc5-4149-aa56-366f7131b9e8 | Kristoff-starling/OJ-Programmes | AtCoder/[ARC097F]Monochrome Cat.cpp | #include <cstdio>
#include <iostream>
#include <cstring>
#include <string>
#include <cstdlib>
#include <utility>
#include <cctype>
#include <algorithm>
#include <bitset>
#include <set>
#include <map>
#include <vector>
#include <queue>
#include <deque>
#include <stack>
#include <cmath>
#define LL long long
#define LB lo... | ALGO | 0.999967 | 3.801672 | {
"github_metadata": {
"branch": "master",
"commit_count": 293,
"repo_created_at": "2021-07-02T14:13:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "975ce026... |
2fb8348c-cac8-4fa6-ae87-b03305abdf31 | sumsuddin/ProblemSolving | LOJ/loj1061.cpp | #include<stdio.h>
#include<queue>
using namespace std;
#define inf 1000000000
long all,chk[100],i,j,mat[10][10],t,h[]={0,0,1,1,1,-1,-1,-1},v[]={1,-1,1,-1,0,1,-1,0},dp[1000050],lst;
char st[10][10];
struct ss
{
long x,y,dis;
}
mp[20],pp;
long mm[20][20],cs=1,dist[9][9];
bool vis[9][9];
queue<ss>que;
long minv(l... | ALGO | 0.999315 | 3.354167 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2016-11-28T20:42: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": "e4eeecc75a... |
4b800fc8-b066-48c0-a26c-850e2daf4b32 | dbjwhs/leetcode | 8-StringtoInteger/main.cpp | #include <iostream>
#include <string>
#include <vector>
#include <cassert>
#include <optional>
#include <limits>
using namespace std;
class Solution {
public:
int myAtoi(string s) {
// remove spaces
string cleanString = trim_leading(s);
// determine sign-ness (-,+ valid)
bool isNe... | ALGO | 0.999722 | 5.562809 | {
"github_metadata": {
"branch": "main",
"commit_count": 69,
"repo_created_at": "2025-05-08T23:55:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "a68990cb1fb... |
25a56f48-bf10-45ec-a9b9-3f4e806507ac | IAS-Astrophysics/athenak | src/pgen/rad_beam.cpp | //========================================================================================
// AthenaXXX astrophysical plasma code
// Copyright(C) 2020 <NAME> <<EMAIL>> and the Athena code team
// Licensed under the 3-clause BSD License (the "LICENSE")
//==================================================================... | ALGO | 0.928443 | 5.279896 | {
"github_metadata": {
"branch": "main",
"commit_count": 1618,
"repo_created_at": "2024-05-08T20:28:14.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 75,
"forks": 54,
"issues": 33,
"pull_requests": 12
},
"file_meta": {
"content_id": "c93f35... |
c0d73f85-9f91-41f0-91eb-47cc0c9d6808 | alexandraback/datacollection | solutions_5688567749672960_0/C++/HolkinPV/main.cpp | #pragma comment(linker, "/stack:128000000")
#include <algorithm>
#include <iostream>
#include <cassert>
#include <iomanip>
#include <climits>
#include <utility>
#include <cstring>
#include <complex>
#include <cstdlib>
#include <cstdio>
#include <vector>
#include <bitset>
#include <string>
#include <queue>
#include <st... | ALGO | 0.999519 | 4.08652 | {
"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": "ee8f73aee... |
ce5afa5d-f582-4b0e-a3bf-9a5bff772262 | amcbn06/AoC-24-Solutions | solutions/day03/part1.cpp | #include <bits/stdc++.h>
using namespace std;
ifstream fin("input.txt");
ofstream fout("output.txt");
int main() {
string line;
int answer = 0;
while (getline(fin, line)) {
for (int i = 0; i + 4 < line.size(); ++i) {
if (line.substr(i, 4) == "mul(") {
int j = i + 3, k = i + 3;
int x = 0, y = 0;
whi... | ALGO | 0.999707 | 4.175272 | {
"github_metadata": {
"branch": "main",
"commit_count": 101,
"repo_created_at": "2024-11-30T22:20:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0d97b10441... |
e2bb14ae-c570-455b-a303-6a1790530c7a | vasanthanbdev/DSA | Intervals/56. Merge Intervals.cpp | #include <bits/stdc++.h>
using std::cout, std::endl, std::vector;
/* Only works for merging two elements at a time */
// class Solution
// {
// public:
// vector<vector<int>> merge(vector<vector<int>>& intervals)
// {
// vector<vector<int>> res;
// std::sort(intervals.begin(), intervals.en... | ALGO | 0.999873 | 6.113162 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2024-05-29T18:42: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": "3fd9e4ec5c1d... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.