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 |
|---|---|---|---|---|---|---|---|
a6a22870-ead3-42ec-a7a0-035a85f5210f | osamahatem/CompetitiveProgramming | TopCoder/Hotel.cpp | #include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cst... | ALGO | 0.99955 | 4.779197 | {
"github_metadata": {
"branch": "master",
"commit_count": 125,
"repo_created_at": "2017-12-09T14:02:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "654f6119... |
aa637cff-44f4-41a0-9811-ff46e9c82a68 | Ankit-india/LeetCode-Solutions | 97-interleaving-string/97-interleaving-string.cpp | class Solution {
public:
int dp[101][101];
bool solve(int i,int j,string temp,string &s1,string &s2,string &s3){
if(i == s1.length() && j == s2.length() && i+j == s3.length())
return temp == s3;
else if(dp[i][j] != -1)
return dp[i][j];
bool op1 = false,... | ALGO | 0.999938 | 5.638534 | {
"github_metadata": {
"branch": "main",
"commit_count": 1226,
"repo_created_at": "2022-03-20T15:38:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4b60c165f... |
5a8bdf2a-d08d-47cf-9bac-75451a883d79 | Accelerator950113/Solutions_For_HDU | 1081.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#define getmax(x,y) ((x > y) ? (x) : (y))
using namespace std;
int n,ans,x;
int s[512][512];
int main() {
while (scanf("%d",&n) == 1) {
memset(s,0,sizeof(s));
for (int i = 1;i <= n;+... | ALGO | 0.999914 | 3.136574 | {
"github_metadata": {
"branch": "master",
"commit_count": 62,
"repo_created_at": "2017-12-29T01:23:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c575149f8... |
d3ad23a1-8348-46e1-b387-fafcc52f21d1 | monero-project/monero | src/cryptonote_protocol/block_queue.cpp | // Copyright (c) 2017-2024, The Monero Project
//
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification, are
// permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice, this list o... | TOOL | 0.935369 | 6.910735 | {
"github_metadata": {
"branch": "master",
"commit_count": 12102,
"repo_created_at": "2014-04-30T14:38:28.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 9640,
"forks": 3235,
"issues": 477,
"pull_requests": 247
},
"file_meta": {
"content_id"... |
a3aa103e-dca0-4105-80cf-b7d4ae7c6fcf | yesiamjc/100DaysOfCode | Day9/P-18.cpp |
//Given two sorted arrays arr1[] of size N and arr2[] of size M.
//Each array is sorted in non-decreasing order. Merge the two arrays
//into one sorted array in non-decreasing order without using any extra space.
#include<iostream>
using namespace std;
void mergeArrays(int arr1[], int arr2[], int n1,int n2, int arr3... | ALGO | 0.999988 | 4.438679 | {
"github_metadata": {
"branch": "main",
"commit_count": 103,
"repo_created_at": "2021-10-06T07:45:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ed9d06a320... |
522cd83e-4bc6-42f8-bce9-0686b1ef01e5 | yamate11/compprog | zCodeForces/gr010/e/cans.cc | #include <bits/stdc++.h>
#include <cassert>
typedef long long int ll;
using namespace std;
// @@ !! LIM()
int main(/* int argc, char *argv[] */) {
ll n; cin >> n;
for (ll i = 0; i < n; i++) {
for (ll j = 0; j < n; j++) {
if (j > 0) cout << " ";
ll x = (j % 2) << (i + j - 1);
cout << x;
}... | ALGO | 0.999722 | 3.728631 | {
"github_metadata": {
"branch": "main",
"commit_count": 219,
"repo_created_at": "2021-03-11T06:12: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": "c96bebbe21... |
22043de5-2a57-4806-830c-ca662d308b38 | dt-yee/easyegine | ECore/EMath.cpp | #include "EMath.h"
#include "EVector.h"
#include "EMatrix.h"
#include "ECore.h"
namespace E3D
{
// translation
void GetTranslateMatrix44(EMatrix44 &mat, EFloat x, EFloat y, EFloat z)
{
mat.m[0][0] = 1, mat.m[0][1] = 0, mat.m[0][2] = 0, mat.m[0][3] = 0;
mat.m[1][0] = 0, mat.m[1][1] = 1, mat.... | ALGO | 0.966434 | 4.945302 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2018-09-06T15:08:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "472679af9... |
7345026a-14a7-4bb7-baf0-b322aa1fbe38 | fetchai/ledger | libs/ml/src/dataloaders/word2vec_loaders/vocab.cpp | //------------------------------------------------------------------------------
//
// Copyright 2018-2020 Fetch.AI Limited
//
// 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
//
// ... | TOOL | 0.93143 | 6.565695 | {
"github_metadata": {
"branch": "master",
"commit_count": 2056,
"repo_created_at": "2018-01-15T16:15:05.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 84,
"forks": 43,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "83d0ce... |
d0af16a6-d1de-49c5-ae37-130b353386f7 | root-project/root | math/mathcore/src/GaussIntegrator.cxx | // @(#)root/mathcore:$Id$
// Authors: <NAME> 01/2008
/**********************************************************************
* *
* Copyright (c) 2006 , LCG ROOT MathLib Team *
* ... | TOOL | 0.993511 | 6.450866 | {
"github_metadata": {
"branch": "master",
"commit_count": 93033,
"repo_created_at": "2013-06-27T10:46:59.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2899,
"forks": 1363,
"issues": 467,
"pull_requests": 269
},
"file_meta": {
"content_id"... |
4a756359-64b6-412d-8a9c-f604972ba840 | anonymousz97/SPOJ_PTIT | P152PROF-src.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int m, s, rmin[105], rmax[105];
int Process()
{
// tim Max
int x = s, n = 0;
while (x > 9)
{
n++;
rmax[n] = 9;
x -= 9;
if (n > m) return 0;
}
if ((n == m) && (x != 0)) return 0;
if (m - n == 1)
{
n++;
rmax[n] = x;
}
else
{
n++;
... | ALGO | 0.999586 | 3.11675 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2018-05-25T11:13:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 6,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2e9a21b67... |
9f589215-634d-44a2-83fb-0e34f9267739 | thomazthz/programming-challenges | URI/Ad-Hoc/1030_a-lenda-de-flavious-josephus.cpp | #include <iostream>
using namespace std;
class Node{
public:
int valor;
Node *proximo;
};
int main(int argc, char const *argv[])
{
int n, homens, saltos, caso = 1;
cin >> n;
for(int i = 0; i < n; i++){
cin >> homens >> saltos;
Node *cabeca, *node;
cabeca = node = new Node();
cabeca->valor = 1;
cabeca... | ALGO | 0.999942 | 3.090366 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2015-07-04T19:14:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "782feb2c3... |
195a0a58-d3ef-4b27-b2d8-c930801d92c9 | c0n5umer/IS-2021-algo-1-sem | Lab1/E/E/main.cpp | #include <iostream>
#include <vector>
using namespace std;
vector <float> InsertionSort(vector <float> vect, int l)
{
int j;
float key;
for (int i = 1; i < l; i++)
{
key = vect[i];
j = i;
while (j > 0 && vect[j - 1] > key)
{
vect[j] = vect[j - 1];
... | ALGO | 0.999971 | 3.33903 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2021-09-11T06:59: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": "3b8c73de3... |
a160da3a-7a54-4dfa-8084-0fdb25c15c10 | raincross7/code-similarity | codes/train_code/problem044/problem044_335.cpp | //#include <bits/stdc++.h>
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <cmath>
#include <algorithm>
#include <map>
#include <iomanip>
#include <stdlib.h>
#include <stdio.h>
#include <queue>
#include <deque>
#include <set>
#include <stack>
#include <time.h>
using namespace std;
... | ALGO | 0.999967 | 3.929529 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-03-06T05:07:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bfebb0c2be74... |
69a64e08-ce91-482b-8449-1cbe886d6ae6 | techcentaur/Data-Mining-Assignments | Assignment-1/2016CS50400-Assgn1/fptree.cpp | // FP-tree implementation
#include<iostream>
#include<fstream>
#include<set>
#include<vector>
#include<unordered_map>
#include<sstream>
using namespace std;
struct Node{
int count;
int label;
vector<Node*> children;
Node* parent;
Node(int l, int c, Node* p){
this->label = l;
this->count = c;
this->paren... | ALGO | 0.998453 | 4.432496 | {
"github_metadata": {
"branch": "master",
"commit_count": 106,
"repo_created_at": "2019-07-27T14:54:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "f2194aa5... |
c2948513-9337-4411-898a-517cb5d239e6 | Handwhale/Coursera | WhiteBelt/Week5/FinalWhiteBeltTask.cpp | // Финальная задача курса
// https://www.coursera.org/learn/c-plus-plus-white/programming/sO7Vq/final-naia-zadacha-kursa
#include <iostream>
#include <sstream>
#include <string>
#include <map>
#include <set>
#include <exception>
#include <algorithm>
#include <iomanip>
using namespace std;
class Date
{
public:
Dat... | TOOL | 0.97776 | 5.289614 | {
"github_metadata": {
"branch": "master",
"commit_count": 77,
"repo_created_at": "2019-07-07T16:14: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": "e823f43a7... |
f0077d73-3e8b-4810-a09d-3e19518ae8f4 | BenGavan/PHYS30762-Cpp | Week_10/pre-lecture/list/main.cpp | #include<iostream>
#include<list>
void print_list(std::list<int> &list_in)
{
std::cout << "List contents: ";
for (auto li=list_in.begin(); li != list_in.end(); ++li) {
std::cout << *li << " ";
}
std::cout << std::endl;
}
int main()
{
std::cout << "Week 10 - Pre-lecture: List" << std::endl;... | TOOL | 0.934847 | 5.351804 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2022-04-08T04:58: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": "636fd686237b... |
a91e8272-a7ef-40d5-8559-1254388e0219 | oldground/coding | boj/cpp_boj/SILVER/2630.cpp | // 2630. 색종이 만들기 -> 실버 2
#include <bits/stdc++.h>
using namespace std;
int n;
int arr[129][129];
int cnt[2];
bool check(int a, int b, int n) {
for (int i = a; i < a+n; i++) {
for (int j = b; j < b+n; j++) {
if (arr[a][b] != arr[i][j]) return false;
}
}
return true;
}
void paper(int a, int b, int... | ALGO | 0.999831 | 4.588349 | {
"github_metadata": {
"branch": "main",
"commit_count": 133,
"repo_created_at": "2024-07-30T17: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": "53e10dde3f... |
2b0f3993-3a7d-4840-ac6c-75736861efaa | Marcus-techtile/model_predictive_control_autonomous_car | controller/lat_controller/include/AcadoLat.hpp | /*
* Copyright (c) 2020 - 2021, VinAI. All rights reserved. All information
* information contained herein is proprietary and confidential to VinAI.
* Any use, reproduction, or disclosure without the written permission
* of VinAI is prohibited.
*/
#ifndef MPC_ACADO_LAT_H
#define MPC_ACADO_LAT_H
#include "adas/c... | TOOL | 0.996048 | 5.364306 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-10-19T05:32: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": "c26a58ac3c4e... |
4702860d-4ec5-45cf-b2e1-de391abe6ca6 | ShoheiYoshinari/Competitive_Programming | code/.vscode/ahc/ahc047/a/b.cpp | #include <bits/stdc++.h>
// #include <atcoder/all>
using namespace std;
// using namespace atcoder;
using ll = long long;
using ull = unsigned long long;
const double pi = acos(-1);
#define OVERLOAD_REP(_1, _2, _3, name, ...) name
#define REP1(i, n) for (auto i = std::decay_t<decltype(n)>{}; (i) != (n); ++(i))
#define ... | ALGO | 0.999944 | 4.118279 | {
"github_metadata": {
"branch": "main",
"commit_count": 171,
"repo_created_at": "2024-05-06T03:14: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": "c71f7da74e... |
9a69018a-fdc7-421c-8304-b1766ed05371 | Henry1132004/PythonProgramming | CTDL_005.cpp | #include <iostream>
// Định nghĩa cấu trúc cho một nút trong danh sách liên kết đơn
struct Node {
int data;
Node* next;
Node(int value) : data(value), next(nullptr) {}
};
// Hàm để thêm một phần tử vào cuối danh sách
void append(Node*& head, int value) {
Node* new_node = new Node(value);
if (head ... | ALGO | 0.999967 | 5.501555 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2024-06-02T07:10: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": "1301b9acfe... |
5a94ae6b-2da2-4ad0-962d-4ee2b2681873 | mdmahfuz307/ProblemSolving | LeetCode/Binary Search/367_Valid_Perfect_Square.cpp | /* 367. Valid Perfect Square
https://leetcode.com/problems/valid-perfect-square/?envType=study-plan&id=binary-search-i */
class Solution
{
public:
bool isPerfectSquare(int num)
{
// Binary Search
int s = 1, e = num;
while (s <= e)
{
long long int mid = s + (e - s) / 2... | ALGO | 0.999945 | 5.599407 | {
"github_metadata": {
"branch": "master",
"commit_count": 630,
"repo_created_at": "2022-09-23T17:25:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "07a1e6ad... |
40c3353d-cac4-4ff4-8b31-3579370dec32 | alejoseed/AoC2024 | day4/aoc_4.1.cpp | #include <iostream>
#include <stdlib.h>
#include <vector>
#include <tuple>
#include <string>
using namespace std;
bool dfs(vector<vector<char>> grid, int r, int c, tuple<int,int> dir, int step);
vector<tuple<int, int>> directions = {
{0, 1}, // right
{0, -1}, // left
{1, 0}, // down
{-1, 0}, ... | ALGO | 0.999431 | 4.688198 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2024-12-09T00:44: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": "6ca4216d9... |
93199128-1464-43bb-a30f-6b65d66e4d27 | rzyanhao/osspoc | lec9/gongzuoji.cpp | #include <cstdio>
#include <cstring>
#include <algorithm>
#include <iostream>
#include <ctime>
#include <cmath>
using namespace std;
struct pageLink
{
pageLink *prev;
pageLink *next;
int pageNumber;
int pageTime;
};
int main()
{
freopen("input.txt","r",stdin);
int N,T,M;
scanf("%d%d%d",&N,&T... | ALGO | 0.999464 | 3.292809 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2016-06-15T09:29: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": "7914c7a19b... |
79581965-f0f5-410d-8f80-f81825ff68dc | jonasschultemattler/kmerdict | source/dict.cpp | #include <filesystem>
#include <seqan3/core/debug_stream.hpp>
#include <seqan3/search/views/kmer_hash.hpp>
#include <seqan3/search/views/minimiser_hash.hpp>
#include "dict.h"
#include "kmer_minimiser_hash.hpp"
seqan3::dna4_vector kmer_to_string(uint64_t kmer, size_t const kmer_size)
{
seqan3::dna4_vector result... | ALGO | 0.936206 | 4.750234 | {
"github_metadata": {
"branch": "main",
"commit_count": 108,
"repo_created_at": "2025-02-17T11:42: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": "a8437cac98... |
5701f733-c41f-48b9-8859-f2854fe3d6f5 | Novae28/Algorithmic-Toolbox | week 1/submission1.cpp | #include <iostream>
#include <cstdlib>
#include <vector>
#include <algorithm>
long long MaxPairwise_product(const std::vector<int> &number)
{
long max1=number[0],max2=-1,temp,index=0;
for(int i=1;i<number.size();i++)
{
if(number[i]>max1)
{
index=i;
max1=number[i];
}
}
//std::cout<<"\n"<<... | ALGO | 0.999739 | 4.042017 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2020-07-28T03:29: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": "4adcd50a1c... |
3eb24134-699a-4519-af4b-10c704e8bb1e | dhankb/practice | cpp/0576_Out_of_Boundary_Paths.cpp | #include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <vector>
#include <queue>
#include <stack>
#include <deque>
#include <list>
#include <map>
using namespace std;
/*
class Solution {
public:
void dfs(int x, int y, int m, int n, int step, int& ans) {
cout << x << " " << y ... | ALGO | 0.999957 | 5.169271 | {
"github_metadata": {
"branch": "master",
"commit_count": 406,
"repo_created_at": "2019-06-10T06:43: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": "7681813e... |
fd5eb12f-cba3-4330-9ee2-f8a1101c47ec | yashbhanu/Data-Structure-and-Algorithms | Problem Solving/Tries/trie_implement_phone_directory_2.cpp | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
// Problem => You are given an array => ["cod" ,"coding", "codding", "code", "coly"] && queryStr i.e ("coding")
// you need to give suggestion of all words with prefixes in queryStr(i.e "coding") // In "coding" , I type "c" all 5 suggestion shall come -... | ALGO | 0.999648 | 5.632539 | {
"github_metadata": {
"branch": "master",
"commit_count": 43,
"repo_created_at": "2022-08-06T07:06:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2c613ad52... |
1e3809e5-763b-4b4d-8cd3-c3b30ed4c6e4 | the-chosen-wan/Leetcode | 2050.cpp | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
const int inf = 1e9;
#define pb push_back
#define mp make_pair
int dfs(int src, vector<vector<int>> &adj, vector<int> &complete, vector<int> &time)
{
if (complete[src] != -1)
return complete[... | ALGO | 0.999976 | 5.036752 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2023-05-13T08:04: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": "667194953f... |
198c7c6f-89ea-4040-943a-fce00f40ebb9 | kul1511/DSA-Learning | BinaryTree/BinaryTree.cpp | #include<iostream>
#include<queue>
using namespace std;
class node{
public:
int data;
node* left;
node* right;
node(int data){
this->data = data;
this->left = NULL;
this->right = NULL;
}
};
node* insertIntoTree(node* root){
int data;
cout<<"Enter the data: ";
... | ALGO | 0.999937 | 4.371146 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2024-04-11T09: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": "d319efa804b... |
8d565917-add7-4421-aa89-e9cf771bbddd | mhromatka/Team-IV | ros/AU_UAV_stack/AU_UAV_ROS/include/fuzzylite/AreaCentroidAlgorithm.h | /* Copyright 2010 <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, ... | TOOL | 0.990139 | 6.735135 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2012-06-05T18:41:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a172375a0... |
6b8ba71c-9488-44ea-afdd-28f71b9b1a6f | ranak8811/Personal_Projects | C++/Toph's code/CashChange.cpp | // #include <iostream>
// #include <vector>
// using namespace std;
// int main() {
// int n;
// cin >> n;
// vector<int> a;
// while (n >= 1) { // Modified condition: exit the loop when n < 1
// if (n >= 500) {
// n = n - 500;
// a.push_back(500);
// }
// ... | ALGO | 0.999959 | 4.084302 | {
"github_metadata": {
"branch": "main",
"commit_count": 65,
"repo_created_at": "2023-05-24T17:27: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": "588c127cab1... |
d1e2449f-08c9-4f67-8b5b-1128a577e899 | raghav-aditya/competitive_programming | Contest/CodeForces/OLD/code_forces_910/B.cpp | /*
Author: <NAME> [ zerojude ]
INDIA
*/
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define all(x) begin(x) , end(x)
#define mask(i) (1LL << (i))
#define vi vector<int>
#define vvi vector<vi>
const int mod = pow(10,9)+7 ;
const int MAX = pow(10,5)+1 ;
const int dx[8] = ... | ALGO | 0.999913 | 3.939621 | {
"github_metadata": {
"branch": "main",
"commit_count": 48,
"repo_created_at": "2023-10-01T08:55:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1bcb964af10... |
cb545c68-9191-4a17-a7b6-66149d154768 | Koki-Yamaguchi/competitive-programming | codeforces/1352/c/a.cpp | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; (i) < (int) (n); (i) ++)
using namespace std;
void solve() {
int n, k;
cin >> n >> k;
long long lb = 0, ub = 1e18;
while (ub - lb > 1) {
long long mid = (lb + ub) / 2;
long long v = mid - mid / n;... | ALGO | 0.999862 | 3.322965 | {
"github_metadata": {
"branch": "master",
"commit_count": 137,
"repo_created_at": "2020-06-27T01:47: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": "61536eda... |
8719a1fc-1332-4d48-9350-2fa997abdd01 | sanjanakapukotuwa/Data-Structures-and-Algorithms | stack_as_an_array/main.cpp | // Implementing stack as an array
#include <bits/stdc++.h>
#include <iostream>
#include <cstdlib>
#include <ctime>
#include <chrono>
#include <algorithm>
using namespace std;
using namespace std::chrono;
const int n=100;
int top=-1;
int arr_stack[n];
void push(int val) {
if(top>=n-1)
cout<<"Stack Overflow"<<e... | ALGO | 0.998896 | 4.724208 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2023-04-09T11:31: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": "5508e81ce768... |
9d7853bb-d727-4fbc-ae63-184654c3ca24 | mattceriello/CSCI-1300 | Hmwk8/gameDriver.cpp | #include "Team.cpp"
#include <iostream>
#include <cmath>
#include <cstdlib>
#include <unistd.h>
#include <stdio.h>
#include <cctype>
#include <string>
#include <fstream>
#include <vector>
using namespace std;
//Algorithm: input 2 teams and see who wins
//1. total up points for each team's first 4 players
//2. whichev... | ALGO | 0.997338 | 3.372688 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2022-02-18T19:34: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": "b62d0964ddde... |
9f78457b-5a4f-4e99-a901-9e1ca2320e91 | HarshadThorat/CPP-Langauge | Problems_On_N_Numbers/program31.cpp | // Accept N nmber from user and return product of all Odd numbers
//input N : 6
// eletments : 15 66 3 70 10 88
// output : 45 (15 * 3)
#include<iostream>
using namespace std;
class ArrayX
{
public:
int OddProduct(int Arr[], int Size)
{
int iCnt = 0;
int Mult = ... | ALGO | 0.999854 | 4.212481 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2023-04-05T05:57: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": "dedb228f1b56... |
8b1f60d1-0919-49f9-a53b-55e22beac205 | inchency/AlgorithmStudy | sourceCode/day11/backjoon_해킹_10282.cpp | #include <iostream>
#include <queue>
#include <vector>
#include <climits>
#include <algorithm>
using namespace std;
int T, n, d, c;
// 다익스트라 풀이
void solve(vector<vector<pair<int, int>>>& v);
struct comp {
bool operator()(const pair<int, int>& a, const pair<int, int>& b) {
return a.second > b.second;
}
};
int m... | ALGO | 0.999791 | 4.175766 | {
"github_metadata": {
"branch": "main",
"commit_count": 180,
"repo_created_at": "2021-11-17T10:23: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": "70614f323a... |
d7728350-a75b-485b-8f8b-73aaca558749 | google/carfac | cpp/carfac_util.h | // Copyright 2013 The CARFAC Authors. All Rights Reserved.
// Author: <NAME>
//
// This file is part of an implementation of Lyon's cochlear model:
// "Cascade of Asymmetric Resonators with Fast-Acting Compression"
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except... | ALGO | 0.933506 | 7.090723 | {
"github_metadata": {
"branch": "master",
"commit_count": 294,
"repo_created_at": "2013-07-18T16:28:12.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 128,
"forks": 47,
"issues": 2,
"pull_requests": 4
},
"file_meta": {
"content_id": "d102f0... |
2ecb4dbd-d597-4f38-8e1e-207ca324e927 | ishandutta2007/codeforces-s | shnirelman/normal/1391/E.cpp | #include <bits/stdc++.h>
#define f first
#define s second
//#define int li
using namespace std;
using li = long long;
using ld = long double;
using pii = pair<int, int>;
const int INF = 1e9 + 13;
const li INF64 = 2e18 + 13;
const int N = 1e6 + 13;
const int LOGN = 20;
const int K = 11;
const int M = 1e9 + 7;
const i... | ALGO | 0.999556 | 4.254874 | {
"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": "bc34da43e9a8... |
375a4b25-4f46-4b95-9f96-34ed295ff0eb | second-state/gpscat | lib/CoFloCoWrapper.cpp | #include <gpscat/CoFloCoWrapper.h>
#include <gpscat/Utils.h>
#include <llvm/IR/Module.h>
#include <llvm/IR/Function.h>
#include <llvm/IR/Constant.h>
#include <llvm/IR/Type.h>
#include <llvm/Support/Program.h>
#include <llvm/Support/CommandLine.h>
#include <llvm/Support/FileSystem.h>
#include <vector>
#include <string... | ALGO | 0.949233 | 6.319149 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-08-30T04:09:00.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "478f325959a... |
afa78d5d-744b-4bcb-8c52-edb5b1feddcd | EmilyPaek/Problem-Solving | cpp/14889.cpp | #include <iostream>
#include <cstdio>
#include <vector>
using namespace std;
int N;
int Sboard[20][20];
int ischeck[20];
int answer = 40000;
void Input(){
cin >> N;
for(int i=0; i<N; i++){
for(int j=0; j<N; j++){
scanf("%d", &Sboard[i][j]);
}
}
}
void Marking(int num, int star... | ALGO | 0.999977 | 3.604572 | {
"github_metadata": {
"branch": "master",
"commit_count": 59,
"repo_created_at": "2019-10-27T05:09: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": "14d779b98... |
81863d0d-62e5-4772-8573-6c9b753127ae | kevinptt0323/CodeBook | code/dinic.cpp | class Flow {
public:
int ncnt;
void reset() {
for(int i=0; i<3605; ++i)
edge[i].clear();
}
void AddEdge(int s, int t){
edge[s].emplace_back(t, 1, edge[t].size());
edge[t].emplace_back(s, 0, edge[s].size()-1); //
}
int MaxFlow(int s, int t){ // Dinic
int f = 0, df;
while (BFS(s, t)!=-1){
while (tru... | ALGO | 0.999309 | 3.604128 | {
"github_metadata": {
"branch": "master",
"commit_count": 69,
"repo_created_at": "2014-05-16T09:00:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "42c18b6f7... |
9cf12fd9-cfd4-43e4-ac64-eeda777b7da7 | alaindeluxe/Master_Thesis | Code_without_CGAL/Cliques/clique_with_singles.cpp | #include <iostream>
#include <jsoncpp/json/value.h>
#include <jsoncpp/json/json.h>
#include <jsoncpp/json/writer.h>
#include <fstream>
#include <string>
#include <vector>
#include <utility>
#include <iomanip>
#include <algorithm>
using namespace std;
std::vector<int> edge_i, edge_j;
std::vector<long> x,y;
//helper f... | ALGO | 0.999537 | 4.524275 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-03-25T12:33: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": "887f718eebdf... |
36ac14b5-37d9-4b01-9205-d789b1631cb3 | jundaf2/FETD-MFEM | fem/lor.hpp | // Copyright (c) 2010-2021, Lawrence Livermore National Security, LLC. Produced
// at the Lawrence Livermore National Laboratory. All Rights reserved. See files
// LICENSE and NOTICE for details. LLNL-CODE-806117.
//
// This file is part of the MFEM library. For more information and source code
// availability visit ht... | ALGO | 0.978988 | 7.162853 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2022-03-19T10:38:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e6f18c0916d5... |
48985e92-701b-467c-8454-5c4aba4ea832 | ikr/algo-practice | topcoder/2021/DistinctStrings/solution.cpp | #include "lest.hpp"
#include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
template <typename T> constexpr int inof(const T x) {
return static_cast<int>(x);
}
template <typename T> constexpr int sz(const T &xs) { return inof(xs.size()); }
string pad(const int L, const char z, string xs) {
whi... | ALGO | 0.99952 | 6.04636 | {
"github_metadata": {
"branch": "master",
"commit_count": 5422,
"repo_created_at": "2016-06-23T07:28:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5f84309... |
cfb591d0-b7ce-4e56-aefe-f66af51f7226 | ZiadSheriif/Algorithms-CMP-2030 | Assignments/Assignment3/Encryption_Key.cpp | #include <iostream>
#include <algorithm>
#include <queue>
#include <math.h>
#include "climits"
#include <map>
#include <string>
#include <unordered_map>
#include <iomanip>
#include <list>
using namespace std;
typedef long long ll;
struct Node
{
int data;
Node *right;
Node *left;
Node(int value)
{
... | ALGO | 0.999985 | 4.086576 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2022-02-17T19:14: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": "8f5a4765018b... |
64a56547-774c-4979-bad4-337d5e5ac422 | ishandutta2007/codeforces-u | um_nik/normal/763/C.cpp | #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <cmath>
#include <ctime>
#include <string>
#include <cstring>
#include <complex>
#include <unordered_set>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
#define... | ALGO | 0.999993 | 3.303577 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:31:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e920f75cd938... |
9903a70c-9435-405c-8088-fa6550ca65fd | OrigenesZhang/-1s | codeforces/ER73/CF1221F.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
#define FOR(i, a, b) for (int (i) = (a); (i) <= (b); (i)++)
#define ROF(i, a, b) for (int (i) = (a); (i) >= (b); (i)--)
#define REP(i, n) FOR(i, 0, (n)-1)
#define sqr(x) ((x) * (x))
#define all(x) (x).begin(), (x).end()
#de... | ALGO | 0.99998 | 3.571492 | {
"github_metadata": {
"branch": "master",
"commit_count": 1525,
"repo_created_at": "2017-02-01T16:05:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7091828... |
7e3a6b78-e4d2-4d63-8ac3-a7010eeec9c5 | imsuck/solutions | templates/data_structure/disjoint_sparse_table.hpp | #include <cassert>
#include <vector>
using namespace std;
template<class M> struct DisjointSparseTable {
using T = typename M::T;
DisjointSparseTable(const vector<T> &v) : n(v.size()) {
t.push_back(v);
for (int p = 1; 1 << p < n; p++) {
t.emplace_back(n);
for (int mid = ... | ALGO | 0.999799 | 5.424164 | {
"github_metadata": {
"branch": "main",
"commit_count": 87,
"repo_created_at": "2022-09-27T08:50: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": "2a43628ef39... |
d530d11e-2bbb-4b5c-a685-4a1aef7e26e2 | jccarvalhosa/maratona | uva/done/tribonacci.cpp | #include <stdio.h>
#include <string.h>
#define MOD 1000000009
typedef long long ll;
struct matrix {
ll elem[3][3];
matrix() {
ll aux[][3] = {1, 1, 1, 1, 0, 0, 0, 1, 0};
for(int i=0;i<3;i++) for(int j=0;j<3;j++) elem[i][j] = aux[i][j];
}
matrix(int i) {
memset(elem, 0, sizeof(... | ALGO | 0.999935 | 3.823354 | {
"github_metadata": {
"branch": "master",
"commit_count": 482,
"repo_created_at": "2012-12-12T23:19:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2359abbc... |
b80f242a-dec2-40cc-8262-ebde859e2e6b | anonyhostvn/WorkSpaceCpp | CRYPTKEY.cpp | #include <bits/stdc++.h>
#define forinc(i,a,b) for (int i = a ; i <= b ; i ++)
#define fordec(i,a,b) for (int i = a ; i >= b ; i --)
#define forv(j,u) for (int j = 0 ; j < u.size() ; j++)
#define pb push_back
#define pf push_front
#define fi first
#define se second
#define mk make_pair
#define pii pair<int,int>
#define... | ALGO | 0.998655 | 4.315205 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2017-12-17T01:21: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": "cd0ac82854... |
50ab3c8e-e88b-40e7-b666-813f2b872907 | scottkchu/restaurantFinder | restaurant.cpp | #include "restaurant.h"
/*
Sets *ptr to the i'th restaurant. If this restaurant is already in the cache,
it just copies it directly from the cache to *ptr. Otherwise, it fetches
the block containing the i'th restaurant and stores it in the cache before
setting *ptr to it.
*/
void getRestaurant(restaurant* ptr, int... | ALGO | 0.998928 | 4.564764 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2020-02-17T04:24: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": "eeafc1682... |
e01f45bf-d34e-42e7-9cdb-107609ee8109 | gabriel88766/C-CPP-AlgorithmsAndContests | Codeforces/2027/C.cpp | #include <bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
const ll INF_LL = 0x3f3f3f3f3f3f3f3f, MOD = 998244353; //1e9+7
const int INF_INT = 0x3f3f3f3f;
const long double PI = acosl(-1.), EPS = 1e-9;
using namespace std;
//cout << fixed << setprecision(6)
int main(){
ios_base::sync_wi... | ALGO | 0.999952 | 4.711718 | {
"github_metadata": {
"branch": "master",
"commit_count": 436,
"repo_created_at": "2020-08-21T00:21: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": "e49da636... |
f50daf1f-e5d1-4edc-9cbf-8049c33c033d | dirckvdende/PDE-hybrid-converter | src/pde/grid/groups/depgrid.cc | /**
* PTOC: PDE to ODE converter
* Created by <NAME>, Leiden University
* https://github.com/dirckvdende/PDE-hybrid-converter
*/
#include "dbg/dbg.h"
#include "depgrid.h"
#include <iostream>
#include <queue>
#include <sstream>
#include <stdexcept>
using namespace pde;
using namespace pde::grid;
using namespace pd... | ALGO | 0.999007 | 5.769029 | {
"github_metadata": {
"branch": "main",
"commit_count": 857,
"repo_created_at": "2023-05-07T09:05:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8a499f3122... |
bcd0cdc0-2471-4ef5-a7ec-bc1e73b5d8b5 | jyakaranda/autoware_ros | Autoware/ros/src/sensing/drivers/lidar/packages/sick/ldmrs/sick_ldmrs_driver/src/driver/src/datatypes/Fields.cpp | //
// Fields.cpp
//
// Created on: 30.08.2011
// Author: wahnfla
//
#include "Fields.hpp"
#include "../tools/errorhandler.hpp" // for print...
namespace datatypes
{
//
// //////////////////////////// FieldSegmentated /////////////////////////////////////////
//
/// fills the polygon clockwise
void FieldSegm... | TOOL | 0.931837 | 5.428521 | {
"github_metadata": {
"branch": "dev_zh",
"commit_count": 10,
"repo_created_at": "2019-04-15T13:15:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 28,
"forks": 28,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "fb04308... |
e1c836b1-308c-4ed6-8cdf-5219c596e641 | fogsail/solution-to-ICPC | character-string/SAM/hiho1449/hiho1449/main.cpp | //
// main.cpp
// hiho1449
//
// Created by <NAME> on 2019/2/22.
// Copyright © 2019 <NAME>. All rights reserved.
//
#include <iostream>
#include <cstdio>
#include <cstring>
#include <queue>
#include <vector>
#include <stack>
#include <algorithm>
#define Cpy(a, b) memcpy(a, b, sizeof(a))
#define Set(a, v) memset(... | ALGO | 0.999985 | 3.767828 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2019-05-27T07:23:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2a251e068a... |
5d9cc80c-579b-4e9b-8da3-bf74ea9ab38a | kth-competitive-programming/kactl | stress-tests/numerical/BerlekampMassey.cpp | #include "../utilities/template.h"
const ll mod = 5;
ll modpow(ll a, ll e) {
if (e == 0) return 1;
ll x = modpow(a * a % mod, e >> 1);
return e & 1 ? x * a % mod : x;
}
#define mod dummy
#define modpow dummy2
#include "../../content/number-theory/ModPow.h"
#undef mod
#undef modpow
#include "../../content/numerica... | ALGO | 0.999853 | 3.623366 | {
"github_metadata": {
"branch": "main",
"commit_count": 984,
"repo_created_at": "2017-05-28T21:22:20.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2974,
"forks": 819,
"issues": 51,
"pull_requests": 17
},
"file_meta": {
"content_id": "2c00... |
7902105a-92ac-4fa8-b920-d1443bbdf0d0 | jermp/dint | include/dint/statistics_collectors.hpp | #pragma once
#include "hash_utils.hpp"
#include "dint_configuration.hpp"
namespace ds2i {
struct block_type {
block_type() : freq(1) {}
uint64_t hash() const {
return hash_bytes64(data.data(), data.size());
}
uint64_t freq;
std::vector<uint32_t> data;
};
typedef std::unordered_map<uint... | ALGO | 0.981642 | 6.098255 | {
"github_metadata": {
"branch": "master",
"commit_count": 232,
"repo_created_at": "2018-05-10T07:52:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 23,
"forks": 6,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2409359... |
ee44d50f-a0db-40ce-af69-4a1b4a4142b2 | HarikumarG/Algorithms | Back_Tracking/Coloring_problem.cpp | #include<bits/stdc++.h>
using namespace std;
#define V 4
void printsolution(int color[V])
{
for(int i=0;i<V;i++)
cout<<color[i]<<" ";
}
bool isSafe(bool graph[V][V],int c,int v,int color[V])
{
for(int i=0;i<V;i++)
{
if(graph[v][i]==1 && c==color[i])
return false;
}
return true;
}
bool graphColoringUtil(bool... | ALGO | 0.999971 | 4.839935 | {
"github_metadata": {
"branch": "master",
"commit_count": 22,
"repo_created_at": "2017-10-26T18: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": "590f80841... |
8de049f5-3e4d-4ce5-bead-c34d073d4af4 | AaronWu-train/sprout-algo2022 | week13/398.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define endl '\n'
#define AI(x) begin(x),end(x)
#ifdef DEBUG
#define debug(args...) LKJ("[ "+string(args)+" ]", args)
template<class I>void LKJ(I&&a){cerr << a << endl;}
template<class I, class ...T>void LKJ(I&&a, T&&...t){cerr << a << " ";LKJ(t...);}
t... | ALGO | 0.999744 | 4.615875 | {
"github_metadata": {
"branch": "main",
"commit_count": 79,
"repo_created_at": "2022-03-11T01:06: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": "bf4339f1d4a... |
166fd0c6-3803-4f53-87fd-9ec1f3f37ff7 | kainotoa/Solutions | prodArryExceptSelf.cpp | // https://www.youtube.com/watch?v=riBWq1DvVb8
// T.C. = O(n) S.C. = O(1)
typedef long long int ll;
ll* sol(int* arr, size_t n)
{
ll prod = 1;
int zeros = 0;
for (int i = 0; i < n; i++)
{
if (arr[i] != 0)
prod *= arr[i];
else
zeros++;
}
ll* out = new ul... | ALGO | 0.999921 | 4.881294 | {
"github_metadata": {
"branch": "main",
"commit_count": 22,
"repo_created_at": "2022-03-18T06:11:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "28661554ecd... |
eff4f874-7fa7-4e23-a11c-f44e37791d2f | saad0104/Codeforces | CF_Comparison_String.cpp | // Comparison String
#include <bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin >> t;
while (t--)
{
int n;
cin >> n;
string str;
cin >> str;
int gr = 1;
int ls = 1;
int countgr = 1, countls = 1;
for (int i = 0; i < n - 1; i++)... | ALGO | 0.999943 | 3.756666 | {
"github_metadata": {
"branch": "main",
"commit_count": 215,
"repo_created_at": "2024-03-05T14:23:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a86f42f723... |
c50252e0-18e1-4939-b038-a29757520309 | IsrakAhmed/Compiler_Design | All/2.cpp | /*
Write a program that read the following string:
“Munmun is the student of Computer Science & Engineering”.
a) Count how many vowels and Consonants are there?
b) Find out which vowels and consonants are existed in the above string?
c) Divide the given string into two separate st... | ALGO | 0.999334 | 3.488004 | {
"github_metadata": {
"branch": "main",
"commit_count": 16,
"repo_created_at": "2023-08-30T19:16:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b467f029351... |
c0742791-7ccc-4ce1-970b-41e80dd99b5e | mihika1110/TicTacToe-CPP | tic_tac_toe.cpp | #include <bits/stdc++.h>
using namespace std;
char square[9] = {'1', '2', '3', '4', '5', '6', '7', '8', '9'};
int check_win() {
if (square[0] == square[1] && square[1] == square[2]) {
if (square[0] == 'X') return 1;
else return 2;
}
else if (square[3] == square[4] && square[4] == square[5]... | ALGO | 0.999955 | 5.527711 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-11-15T21:32: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": "181e3fc800bd... |
4259d334-dd18-4051-a6d1-f8605263d3be | yonasadiel/cp | TLX/PemrogramanDasar/15_F_Quadtree2Penerjemahan.cpp | #include<bits/stdc++.h>
using namespace std;
int r,c,rt,ct;
int pet[150][150];
int m=0;
int stat[20];
char kode[100005][20];
void penerjemahan(int pos, int ra, int rb, int ca, int cb, int d) {
if (strlen(kode[pos]) <= d) {
for (int i=ra; i<=rb; i++) {
for (int j=ca; j<=cb; j++) {
pet[i][j] = 1;
}
}
} ... | ALGO | 0.999903 | 3.617462 | {
"github_metadata": {
"branch": "master",
"commit_count": 187,
"repo_created_at": "2017-07-08T00:59:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e1960fe8... |
f55e0825-f833-446a-a309-9faf350e52aa | imarfin/CS172-and-cpp | RandomNumberGame/main.cpp | #include <iostream>
#include <vector>
using namespace std;
// ---> 05/17/2022 Class
int main() {
int randomNumber = 0;
int choice;
char retry;
srand(time(NULL));
randomNumber = rand() % 50 + 1;
cout << "Random NUmber: " << randomNumber << endl;
cout << "********************************" << endl;
d... | TOOL | 0.958946 | 3.101199 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2022-02-09T21:54: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": "71cefe4c8c24... |
f2a3856a-5e44-4721-a28e-1b82b2da6ac0 | vaf888/studies | cpp/movesemantics000.cpp | //------------------------------------------------
// file.........: movesemantics000.cpp
// description..: move semantics studies
// version......: v0
// author.......: <NAME>
//------------------------------------------------
#include <cstdio>
#include <vector>
#include <string>
#include <utility>
#include <iostream... | TOOL | 0.972484 | 5.32488 | {
"github_metadata": {
"branch": "master",
"commit_count": 80,
"repo_created_at": "2021-01-04T07: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": "9df09f62d... |
4fd089f8-3038-4953-bbde-5413424a0834 | glitched-sudhanshu/DSA-problems | Misc/869_Reordered_Power_of_2.cpp | /*Permutation*/
//TC: O((logN)!*logN)
//SC: O(1)
/*
Try out all possible permutations of the given number if any of the permutation if power of 2 return true
*/
void next_perm(string &s)
{
int n = s.size(), idx = 0;
for (idx = n - 2; idx >= 0; idx--)
{
if (s[idx] < s[idx + 1])
break;
... | ALGO | 0.999245 | 5.294743 | {
"github_metadata": {
"branch": "master",
"commit_count": 68,
"repo_created_at": "2022-07-28T10:28:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "233111d7c... |
07b136ed-9833-4343-954b-c5568b6583cb | Samarth1105/Add-Number-Linked-Lists | Solution.cpp | struct Node {
int data;
struct Node* next;
Node(int x) {
data = x;
next = NULL;
}
};
class Solution {
public:
Node* reverseLL(Node* head){
Node* curr=head;
Node* prev=NULL;
Node* next=NULL;
while(curr!=NULL){
next=curr->next;
... | ALGO | 0.999989 | 5.966819 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-09-05T01:59:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5e865159045b... |
1e3e1349-3974-4b7f-bd86-07ee09d57868 | xyzyzl/compprog | probs/usaco/lightsout/lightsout.cpp | #include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> pii;
#define f first
#define s second
#define ll long long
#define X 97ll
#define M 999999929ll
int n, m, H[505], p[505];
vector<int> k;
pii arr[205];
void gen_hash()
{
p[0] = 1;
for(int i = 1; i < m; i++)
{
p[i] = (ll)(p[i-1]*X) % (ll)M;
}... | ALGO | 0.999964 | 3.880993 | {
"github_metadata": {
"branch": "master",
"commit_count": 364,
"repo_created_at": "2019-06-11T03:19:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "4852660c... |
da61c718-390f-4bfb-8d5c-7f0982de40f5 | taodaling/contest_cpp | internal/sparse_table.cpp | #pragma once
#include "binary.cpp"
#include "common.cpp"
namespace dalt {
template <class T>
struct SparseTable {
private:
Vec<Vec<T>> table;
Reducer<T> reducer;
public:
using Self = SparseTable<T>;
SparseTable() {}
SparseTable(int n, const Indexer<T> &data, Reducer<T> f) : reducer(f) {
i32 m = Log2Flo... | ALGO | 0.99698 | 6.585424 | {
"github_metadata": {
"branch": "master",
"commit_count": 101,
"repo_created_at": "2022-02-01T03:26: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": "74b8609d... |
ce7b1de6-7dc1-4b1e-87d6-79a815b7cd92 | tinganho/l10ns | src/Program/CommandParser.cpp |
#include <vector>
#include <string>
#include "Utils.cpp"
#include "Types.cpp"
#include "Diagnostics.cpp"
using namespace std;
namespace L10ns {
static Flag help_flag = Flag(FlagKind::Help, "--help", "-h", "Print help description.", /*has_value*/ false);
static Flag language_flag = Flag(FlagKind::Language, "--langua... | TOOL | 0.963708 | 7.007415 | {
"github_metadata": {
"branch": "c++",
"commit_count": 1605,
"repo_created_at": "2013-01-09T12:58:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 233,
"forks": 21,
"issues": 27,
"pull_requests": 1
},
"file_meta": {
"content_id": "09aa3e... |
7b845559-76e4-4987-835c-55ad13f8cb55 | anirudhagaikwad/CPP_Programming | Programs/15-16/six.cpp | /*
Create program to check if two numbers are equal without using arithmetic operators comparison operators
Input: 5 5
Output: x is equal to y
*/
#include <iostream>
using namespace std;
int main()
{
int x;
int y;
cin >> x >> y; // Read two integer values (x and y) from the user.
// The expression ... | ALGO | 0.999757 | 6.014924 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-07-26T04:22:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "03eac2e1927d... |
b8da92fe-24f1-49c6-a8a0-88aa1572e72a | SiluPanda/competitive-programming | google/cj3.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
int min_needed(int arr[], int dep[], int n){
sort(arr, arr+n);
sort(dep, dep+n);
int i = 0, j = 0;
int ret = 0, needed = 0;
while(i < n && j < n){
if(arr[i] < dep[j]){
needed++;
i++;
ret... | ALGO | 0.999967 | 4.191581 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2019-06-29T21:14: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": "fa9ce04a6... |
94ea1e96-a6b0-40a5-8d99-49502c5c9f9d | raincross7/code-similarity | codes/train_code/problem410/problem410_58.cpp | /* ░░█ ▄▀█ █ █▀ █░█ █▀█ █▀▀ █▀▀ █▀█ ▄▀█ █▀▄▀█
█▄█ █▀█ █ ▄█ █▀█ █▀▄ ██▄ ██▄ █▀▄ █▀█ █░▀░█ */
// Author : Udit "luctivud" Gupta @ (https://www.linkedin.com/in/udit-gupta-1b7863135/)
#include <bits/stdc++.h>
#pragma GCC optimize "trapv"
using namespace std;
typedef long long int lld;
typedef ... | ALGO | 0.999856 | 3.36514 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-03-06T05:07:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "869a20928a23... |
3e1a4f68-7735-4205-9df2-c25be19f52c6 | leehandsub/studyCpp | 백준/6064.cpp | /*
문제 : 백준 카잉 달력
시간 : 25분
ide 활용 : x
질문 보기 : x
피드백 : 최소공배수를 구해서 최대를 잡아놓고
두 숫자를 비교하면서 같아지면 print아니면 작은 것을 커지게 해서 풀었다.
*/
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <vector>
#include <queue>
#include <algorithm>
using namespace std;
int gcd(int... | ALGO | 0.999957 | 3.459949 | {
"github_metadata": {
"branch": "master",
"commit_count": 336,
"repo_created_at": "2021-08-05T09:52:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "aca96ec2... |
a11e0ca0-8b8a-4c2d-ba35-a04ab9e92759 | nkersting/Code | array-permute.cpp | // given an array[N] and a desired permutation perm[N], permute the array in-place.
#include<iostream>
using namespace std;
const int N = 10;
void Permute(string vals[], int perm[])
{
for (int i = 0; i < N; ++i)
{
if (perm[i] == i) { continue;}
swap(vals[i], vals[perm[i]]);
for (in... | ALGO | 0.999957 | 5.916979 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2013-12-31T19:50:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "f0bda30b8... |
b47ea6b1-87a6-43e3-aacb-30ebc631f3ab | wondol2/ps | problems/baekjoon/17478.cpp | #include <bits/stdc++.h>
using namespace std;
#ifndef ONLINE_JUDGE
#include "debug.h"
#else
#define debug(x)
#endif
int N;
void printUnderBar(int n){
for(int i=0; i<n; ++i) cout << "____";
}
void recursion(int n){
printUnderBar(n);
cout << "\"재귀함수가 뭔가요?\"\n";
if(n == N){
printUnderBar(n... | ALGO | 0.992741 | 3.957545 | {
"github_metadata": {
"branch": "master",
"commit_count": 43,
"repo_created_at": "2022-01-12T06:44: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": "b0a35cc03... |
60c448a6-80be-4d43-be73-87c6846f143b | Fezaan/CodingWithCPP | immediateSmallerElement.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function template for C++
class Solution{
public:
void immediateSmaller(vector<int>&arr, int n) {
// code here
stack<int> st;
vector<int> res;
st.push(arr[0]);
for(int i=1;i<n;i++){
i... | ALGO | 0.999992 | 6.079574 | {
"github_metadata": {
"branch": "main",
"commit_count": 160,
"repo_created_at": "2023-05-05T16:31: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": "38fb522108... |
9245d180-9e6d-429f-9ab5-40ccdeb3b7be | hwiwonK/algorithm | problem/J1701_ver1(30점).cpp | //좀 더 간단하게 생각하기!, 왜 이 방법은 안될까, 놓친부분 찾아보기
//tcgatagggatttctccgcacagtag 여기서 놓친 부분 찾아보기 (답은 16, 출력은 14)
#include <iostream>
using namespace std;
const int N_MAX = 500;
char DNA[N_MAX + 2] = { 0, };
//int KOI[N_MAX + 2] = { 0, };
int KOI_A[N_MAX + 2] = { 0, };
int KOI_B[N_MAX + 2] = { 0, };
int dpArr[N_MAX + 2][N_MAX ... | ALGO | 0.999865 | 3.558184 | {
"github_metadata": {
"branch": "main",
"commit_count": 208,
"repo_created_at": "2021-04-08T01:29: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": "62f55e621c... |
169013dc-e9ee-449f-8194-de8bd29c9807 | dmllr/fast-lopq | fast-lopq/model.cpp | #include "include/fast-lopq/model.h"
#include <fstream>
#include <blaze/Math.h>
#include <blaze/math/Row.h>
#include <blaze/math/Vector.h>
#include <blaze/math/Matrix.h>
#include "lopq_model.pb.h"
namespace {
uint8_t predict_cluster(const blaze::DynamicVector<double>& x, const blaze::DynamicMatrix<float>& centroi... | DATA | 0.940161 | 6.250323 | {
"github_metadata": {
"branch": "master",
"commit_count": 70,
"repo_created_at": "2018-06-07T00:32:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 35,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "77dca27a... |
bd98b39b-3baa-40b6-919f-d9bd83138fed | MeshInspector/MeshLib | source/MRMesh/MRPositionVertsSmoothly.h | #pragma once
#include "MRMeshFwd.h"
#include "MREnums.h"
namespace MR
{
/// Puts given vertices in such positions to make smooth surface both inside verts-region and on its boundary;
/// \param verts must not include all vertices of a mesh connected component
/// \param fixedSharpVertices in these vertices the surfa... | ALGO | 0.997442 | 6.857014 | {
"github_metadata": {
"branch": "master",
"commit_count": 5624,
"repo_created_at": "2021-12-30T12:20:15.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 647,
"forks": 79,
"issues": 36,
"pull_requests": 14
},
"file_meta": {
"content_id": "e27... |
724ffaa0-8676-4751-b633-e0660e388d3e | ar-zoop/leetcode_solutions | maxswt.cpp | #include <bits/stdc++.h>
#include <iostream>
using namespace std;
bool comparator(pair<long long, long long >p1, pair<long long, long long >p2) {
if(p1.second > p2.second) {
return true;
} else if(p1.second == p2.second){
if(p1.first<p2.first) return true;
}
return false;
}
int main(void){
int t;
ci... | ALGO | 0.999917 | 3.70015 | {
"github_metadata": {
"branch": "main",
"commit_count": 226,
"repo_created_at": "2022-04-07T19:01: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": "ba2a3685c5... |
f3630658-c210-492f-857d-297f356fe0ce | lucala/algolab | week06/coins.cpp | #include <stdlib.h>
#include <vector>
#include <algorithm>
#include <iostream>
#include <climits>
#include <cassert>
using namespace std;
int rec(vector<vector<int> > &matrix, vector<int> &coins, int i, int j){
//cout << "being called with i=" << i << " and j=" << j << endl;
if(i==j){
//one coin remains
return ... | ALGO | 0.999785 | 3.946567 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2018-11-15T01:23: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": "71fb6aaf0a... |
5bc9d60f-460a-40d1-a4ac-86fc7e5346e5 | chmnchiang/bcw_codebook | Contest/XVIOpenCupBashkortostan/pF.cpp | #include<bits/stdc++.h>
#include<unistd.h>
using namespace std;
#define FZ(n) memset((n),0,sizeof(n))
#define FMO(n) memset((n),-1,sizeof(n))
#define F first
#define S second
#define PB push_back
#define ALL(x) begin(x),end(x)
#define SZ(x) ((int)(x).size())
#define IOS ios_base::sync_with_stdio(0); cin.tie(0)
#ifdef O... | ALGO | 0.999921 | 4.113653 | {
"github_metadata": {
"branch": "master",
"commit_count": 361,
"repo_created_at": "2014-06-03T11:38:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 111,
"forks": 22,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f7e0b... |
ffc3efed-cedd-4818-9644-ba502d3d0b9f | choreonoid/choreonoid | src/Util/TruncatedSVD.h | /**
\file
\author <NAME>
*/
#ifndef CNOID_UTIL_TRUNCATED_SVD_SOLVER_H_INCLUDED
#define CNOID_UTIL_TRUNCATED_SVD_SOLVER_H_INCLUDED
#include <Eigen/Core>
namespace cnoid {
template <class MatrixType>
class TruncatedSVD
{
typedef typename MatrixType::Scalar Scalar;
Eigen::JacobiSVD<MatrixType> svd;
E... | ALGO | 0.997583 | 6.748658 | {
"github_metadata": {
"branch": "master",
"commit_count": 6913,
"repo_created_at": "2020-06-25T17:36:56.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 166,
"forks": 49,
"issues": 7,
"pull_requests": 6
},
"file_meta": {
"content_id": "adbdd... |
6d7ef471-60e4-402e-a238-48db1415eec9 | brycesandlund/CompetitiveProgramming | Vim/Desktop.cc | #include <iostream>
#include <fstream>
using namespace std;
typedef long long ll;
int main() {
ifstream cin("input.txt");
ofstream cout("output.txt");
ll h, w;
cin >> h >> w;
if (h == 1 || w == 1)
cout << 0 << endl;
else {
ll horizontal = (h/2) * (w-1);
ll vertic... | ALGO | 0.999827 | 3.018178 | {
"github_metadata": {
"branch": "master",
"commit_count": 70,
"repo_created_at": "2014-08-31T20:46:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3658b7bec... |
8886bc20-ea89-44d0-885a-ece3802b79d8 | basaraking1221/SJTU-Online_Judge | 2018-2019 1/weekwork3/1034.cpp | #include <iostream>
using namespace std;
int a[200010];
int n,k;
bool check(int m)
{
int round = 1;
int now = 0;
int left = k;
while(!( (round == 2) && (now == k)))
{
if (left == 0) return 1;
if (a[now] <= m) left--;
else left = k;
now++;
if (now == n)
... | ALGO | 0.999992 | 3.654124 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2019-03-01T14:09:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b29d00ac98... |
4e9374fe-926e-4c4a-923f-6f08295a1871 | matthewschallenkamp/Red-Team-Code | open_kattis/lowpower/lowpower.cpp | #include <bits/stdc++.h>
using namespace std;
int n, k;
vector<int> arr;
bool possible(int diff) {
if(arr[1] - arr[0] > diff) return false;
int cnt = 0;
for(int i = 0; i < arr.size()-1; ++i) {
if(i > cnt*k*2) {
return false;
}
if(arr[i+1] - arr[i] <= diff) {
... | ALGO | 0.999975 | 4.103633 | {
"github_metadata": {
"branch": "master",
"commit_count": 260,
"repo_created_at": "2018-09-02T05:40:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8ced1342... |
e6b6364f-29e7-4968-b9f9-a9ea0dda54f5 | OskarAllerslev/thielecpp | main.cpp | #include <iostream>
#include "include/Eigen/Dense"
using namespace Eigen;
using namespace std;
//compute P(s,t) using a discrete approximation
MatrixXd computeTransitionMatrix(const MatrixXd& Lambda, double dt, int steps){
Eigen::MatrixXd P = MatrixXd::Identity(Lambda.rows(), Lambda.cols());
for (int i = 0;... | ALGO | 0.999988 | 7.075316 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2025-02-08T20:05: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": "a37a008c2983... |
b53d0f1d-2e51-4cb8-9392-7fff6827fb9f | KaHIP/KaHIP | lib/partition/uncoarsening/refinement/quotient_graph_refinement/partial_boundary.h | /******************************************************************************
* partial_boundary.h
* *
* Source of KaHIP -- Karlsruhe High Quality Partitioning.
* <NAME> <<EMAIL>>
*****************************************************************************/
#ifndef PARTIAL_BOUNDARY_963CRO9F_
#define PARTIAL_B... | ALGO | 0.913823 | 6.799263 | {
"github_metadata": {
"branch": "master",
"commit_count": 648,
"repo_created_at": "2013-10-16T15:25:48.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 442,
"forks": 101,
"issues": 13,
"pull_requests": 8
},
"file_meta": {
"content_id": "373e... |
55b6adba-5ca6-4bb8-82fa-de0d4be015ae | Shikhar-S/Analysis-of-Competitive-Codebase | Data/Contest1243/Standings4/29777554_64384270.cpp | #include<iostream>
#include<bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/detail/standard_policies.hpp>
#define ll long long
#define pb push_back
#define mp make_pair
#define inf 1000000007
#define pi acos(-1.0)
#define pf(a) cout<<"a "<<a<<endl;
#define... | ALGO | 0.999899 | 3.250701 | {
"github_metadata": {
"branch": "master",
"commit_count": 74,
"repo_created_at": "2019-11-22T14:40:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ee1348e84... |
d85f7d7b-c3e3-4dc0-8e2c-028e54c5ea3a | fusumwan/CPlusPlusProject | UniClassScheduler/Utility.h | /**************************************************
// Course: PSSD
// Weekly assignment
// Author: <NAME>, FU
// Date: 2-11-2019
// Student ID: 1714470
// Description: Utility class.
**************************************************/
#ifndef Utility_h
#define Utility_h
// Include files
#include <vector>
#include <l... | TOOL | 0.900408 | 3.766938 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-11-20T12:56: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": "698aaa55ed78... |
07c704ec-0339-4906-bf71-be4cdb88e545 | marovira/marching_rings | source/athena/polygonizer/BranchingManager.cpp | #include "athena/polygonizer/BranchingManager.hpp"
#include <atlas/core/Assert.hpp>
#include <atlas/core/Constants.hpp>
#include <algorithm>
namespace athena
{
namespace polygonizer
{
BranchingManager::BranchingManager()
{ }
std::vector<BranchingManager::BranchData>
Bran... | ALGO | 0.985459 | 4.533273 | {
"github_metadata": {
"branch": "master",
"commit_count": 247,
"repo_created_at": "2018-01-14T05:54: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": "c0ed068b... |
bbd5854b-2581-4aec-bd29-68c438a66663 | jahmedabeer/dsa-problemsolving | ds-problem-solving- part3/linkedlist/reference_of_pointer.cpp |
#include <bits/stdc++.h>
using namespace std;
void pf( int * &p )
{
*p = 20; // dereference
cout <<"inside function: "<<*p <<endl;
// p = NULL;
// cout <<"Address of p: "<<&p <<endl; // different address
// track the reference passing ref to parameter
... | TOOL | 0.977595 | 3.559383 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2022-10-24T05:36:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8754698ef5d6... |
2411cb7e-32d1-4e2f-b503-64d2b6ba9bfd | HanYouyang/Computer | 数据结构与算法/PKU-CS/PastClasses/@1/计算导论与C语言基础(李戈)/10_4.cpp | #include<iostream>
#include<iomanip>
using namespace std;
int main() {
char input[5][5];
for (int i = 0; i < 5; i++) {
for (int j = 0; j < 5; j++) {
cin >> input[i][j];
}
}
int m, n;
cin >> m >> n;
if ((m >= 0 && m <= 4) && (n >= 0 && n <= 4)) {
for (int i = 0; i < 5; i++) {
if (i == m && i != n... | ALGO | 0.999262 | 3.531065 | {
"github_metadata": {
"branch": "master",
"commit_count": 133,
"repo_created_at": "2017-03-19T03:43:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a37c78fc... |
f61ae49b-fa48-4d3f-9c58-2cae89d74c17 | majiaoliya/HelloWorld | pintia.com/L2_030/main.cpp | #include <iostream>
#include <vector>
#include <map>
#include <string>
#define MAX 100005
using namespace std;
int n;
map<string, int> map1;
string fst_name[MAX];
string lst_name[MAX];
bool is_man[MAX]; //判断性别
int pre[MAX];
int bcj_pre[MAX]; //并查集pre[]
string sub(string& str, int id) { //截子串 billsson->返回bill(即父节点n... | ALGO | 0.999874 | 4.082824 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2019-11-25T12:51: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": "afa095c6da... |
52bf4e49-a6eb-4489-8e49-52c008b915aa | Shikhar-S/Analysis-of-Competitive-Codebase | Data/Contest1244/Standings2/28935625_62468475.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define x first
#define y second
#define all(v) v.begin(), v.end()
#define compress(v) sort(all(v)), v.erase(unique(all(v)), v.end())
using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
typedef pai... | ALGO | 0.999975 | 3.977834 | {
"github_metadata": {
"branch": "master",
"commit_count": 74,
"repo_created_at": "2019-11-22T14:40:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e1ead9711... |
a52c178c-2d1b-4063-b58d-defb9df8ff81 | adeelHassan123/Data-Structures-And-Algorithms | LeetCode_Questions/hashmap.cpp | #include <iostream>
#include <vector>
using namespace std;
class HashMap {
private:
vector<int> table; // Hash table
int size; // Number of buckets in the table
// Hash function to compute index
int hash(int key) {
return key % size;
}
public:
// Constructor to initialize th... | ALGO | 0.999588 | 6.436467 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2025-06-27T14:42:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "30a7e9806e58... |
8153e459-327c-414a-b80c-39b34839eead | Abu-Zakaria/problemsets | 510/A.cpp | #include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define PRINT(stuff) std::cout << stuff << endl
#define PRINT_NO_LINE(stuff) std::cout << stuff
#define PRINT_VEC(stuff) \
for (size_t i = 0; i < stuff.size(); i++) \
{ \
PRINT(... | ALGO | 0.999843 | 3.934838 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2021-12-04T12:19: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": "f780a5cea... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.