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 |
|---|---|---|---|---|---|---|---|
ab27a074-ebd7-49dd-bcbe-7632f36b2256 | Ahnaf-41M/Data-Structures-and-Algorithms | Number-Theory/Number of Triplets having LCM n.cpp | #include<bits/stdc++.h>
#define MX 10000005
#define ff first
#define ss second
#define pb push_back
#define int long long
#define PII pair<int,int>
#define all(v) v.begin(),v.end()
using namespace std;
int unq, NUT; //NUT = Number of Unordered Triplets
int NOT, k1, k2, k3; //NOT = N... | ALGO | 0.999297 | 3.893585 | {
"github_metadata": {
"branch": "master",
"commit_count": 59,
"repo_created_at": "2020-10-24T07:16:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5b73c7a4e... |
c1f340d4-86e5-426c-8e95-38b3e0f15442 | Husain0007/HackerBlocks | Bitmasking/Inclusiong&ExclusionwithBitMasking/p.cpp | #include <iostream>
using namespace std;
#define ll long long
int main()
{
ll t;
cin >> t;
ll primes[] = {2, 3, 5, 7, 11, 13, 17, 19};
while (t--)
{
ll n;
cin >> n;
ll subsets = (1 << 8) - 1; // total subsets are 2^8
ll ans = 0;
for (ll i = 1; i <= subse... | ALGO | 0.99939 | 3.862228 | {
"github_metadata": {
"branch": "master",
"commit_count": 89,
"repo_created_at": "2020-04-07T09:44: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": "948870c65... |
0c8d8870-2eb2-4610-85cb-796978d81671 | lucasb-eyer/pydensecrf | pydensecrf/densecrf/src/objective.cpp | /*
Copyright (c) 2013, <NAME>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditi... | ALGO | 0.979383 | 4.590583 | {
"github_metadata": {
"branch": "master",
"commit_count": 94,
"repo_created_at": "2015-11-13T18:15:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1987,
"forks": 424,
"issues": 42,
"pull_requests": 0
},
"file_meta": {
"content_id": "fd9... |
38e949cc-0f18-4b46-a94b-82b2b36ba494 | asdadeeeee/OJ | leetcode/101/a.cpp | struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode() : val(0), left(nullptr), right(nullptr) {}
TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
TreeNode(int x, TreeNode *left, TreeNode *right)
: val(x), left(left), right(right) {}
};
class Solution {
public:
bool compare... | ALGO | 0.999979 | 6.311293 | {
"github_metadata": {
"branch": "main",
"commit_count": 42,
"repo_created_at": "2024-10-29T14:23: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": "5a927bcf9c3... |
2868422f-bb1e-4559-ad95-d38fdb9ff471 | MazharRehan/DSA | Data Structures & Algorithms - Theory/7 - Binary Search Tree - BST/BST.cpp | //BST
#include <iostream>
using namespace std;
struct Node
{
int data;
Node* left, * right;
};
class BST
{
private:
Node* root;
Node* insert(Node* node, int data)
{
if (node == NULL)
{
node = new Node;
node->data = data;
node->left = node->right... | ALGO | 0.999929 | 4.855874 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2023-09-29T15:35: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": "17a4ba575d6a... |
69b2773d-0363-437c-a432-adad0639df88 | Victrid/undergraduate-course-projects | CS158-homework/SJTUOJ/1214.cpp | #include <cstdio>
#include <iostream>
using namespace std;
struct tree {
tree* left;
tree* brat;
int weight;
bool isroot;
tree() : left(nullptr), brat(nullptr), weight(0), isroot(true){};
};
tree seq[1000002] = {};
//pretrav
bool pretrav_f = false;
void pretrav(tree* root) {
if (pretrav_f)
... | ALGO | 0.99994 | 3.800416 | {
"github_metadata": {
"branch": "master",
"commit_count": 930,
"repo_created_at": "2025-02-23T12:58:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "224af33d... |
8e428b41-c823-4fdf-9051-c29c533b35ae | ujjwald7/C--Templates | Roads_In_Berland_C_Codeforces.cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long int
#define ld long double
#define F first
#define S second
#define P pair<int,int>
#define V vector
#define eb emplace_back
#define pb push_back
#define mp make_pair
#define endl "\n"
// #pragma comment(linker, '/STACK:200000') //prevent stack o... | ALGO | 0.999987 | 3.906487 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2020-07-04T18:00: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": "b8bfa935eb... |
c963d48a-acea-42a3-938d-89a49f74a157 | amov-lab/Prometheus | Modules/motion_planning/min_snap_trajectory/uav_simulator/so3_quadrotor_simulator/include/ode/boost/numeric/odeint/integrate/detail/integrate_times.hpp | /*
[auto_generated]
boost/numeric/odeint/integrate/detail/integrate_times.hpp
[begin_description]
Default integrate times implementation.
[end_description]
Copyright 2009-2012 <NAME>
Copyright 2009-2012 <NAME>
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt ... | ALGO | 0.994269 | 7.323481 | {
"github_metadata": {
"branch": "main",
"commit_count": 1572,
"repo_created_at": "2019-12-03T06:28:07.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2835,
"forks": 441,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "fc7b0... |
cab41a16-0a40-4c74-8177-f070c170270e | ruihanxu2/HttpProxyServer | old_version.cpp | #include <iostream>
#include <cstring>
#include <sys/socket.h>
#include <netdb.h>
#include <unistd.h>
#include <vector>
#include <assert.h>
#include <sys/time.h>
#include "potato.h"
using namespace std;
struct Player{
int player_id;
int player_port;
int player_fd;
char player_addr[512];
};
int main(int argc, ch... | WEB | 0.970662 | 3.762193 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2019-06-19T20:42: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": "b727129a17... |
69492b99-0630-4644-bb6d-697be22fc393 | giladshm1/hw2_wet | HashTable.h | //
// Created by gilad on 05/01/2022.
//
#ifndef HW2_WET_HASHTABLE_H
#define HW2_WET_HASHTABLE_H
#include <iostream>
#include "LinkedList.h"
template<class T>
class HashTable {
static const int initial_size = 2; //maybe another size
int size;
int current_size;
Node<T> **table;
public:
HashTabl... | ALGO | 0.997734 | 5.697228 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2022-01-07T09:44: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": "cdff944478... |
aab5c7cd-cfe3-4db6-bae9-06c30b364be4 | jamieabc/Design-pattern | Template-method/examination.cc | /*
** All students with same problems in the same examination, how to have a class
** that generates examinations?
*/
#include <iostream>
#include <string>
using namespace std;
class Exam {
public:
virtual void DoProb1() { cout << "Prob 1, a: a, b:b, c:c, d:d " << endl; }
virtual void DoProb2() { cout << "Prob 2,... | ALGO | 0.927032 | 7.043877 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2022-09-11T06:14:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "eefeed2a86f7... |
6d4819ee-8edd-458e-a44d-f597fb97be9f | wu-qing-157/Aerial-Ace | Training/0730/D.cpp | #include <bits/stdc++.h>
using namespace std;
<<<<<<< HEAD
typedef long long ll;
const int maxn = 6e4 + 10;
#define ___ __attribute__((optimize("-O3")))
bitset<maxn / 2> A[maxn / 2];
vector<int>G[maxn];
vector<pair<int, int> >E;
int n, t;
___ ll solve0() {
return 1ll * n * n * n;
}
___ ll solve1() {
return 1ll ... | ALGO | 0.999849 | 4.536706 | {
"github_metadata": {
"branch": "master",
"commit_count": 150,
"repo_created_at": "2019-07-15T14:46:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b365dc98... |
491be99c-d0f6-4c2d-9cf5-d11b2459f642 | Abdullrhhmann/flip_matrix | matrix.cpp | #include <bits/stdc++.h>
using namespace std;
/*
problem description :
Sean invented a 2n x 2n game involving a matrix where each cell of the matrix contains an integer.
He can reverse any of its rows or columns any number of times.
The goal of the game is to maximize the sum of the elements in
the n x n submatrix ... | ALGO | 0.999987 | 4.92652 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2023-07-26T03:48: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": "1305a1cf91... |
5155da8d-bea3-43e2-ac41-8fdee2bf4075 | goodstudyqaq/ACM | daimayuan/structure/102.cpp | // http://oj.daimayuan.top/course/15/problem/635
#include <bits/stdc++.h>
#include "./structure/others/binary-indexed-tree.hpp"
using namespace std;
#ifdef LOCAL
#include "copypaste/debug.h"
#else
#define debug(...) 42
#endif
struct fast_ios {
fast_ios() {
cin.tie(nullptr);
ios::sync_with_stdio(... | ALGO | 0.997924 | 5.449949 | {
"github_metadata": {
"branch": "main",
"commit_count": 844,
"repo_created_at": "2021-05-25T15:11:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fe9f21ef18... |
fd51f141-d787-44f7-a4e3-7ac24c377b47 | tangjz/acm-icpc | hdu/6053.cpp | #include <cstdio>
#include <algorithm>
using namespace std;
namespace fastIO {
#define BUF_SIZE 100001
//fread -> read
bool IOerror = 0;
inline char nc() {
static char buf[BUF_SIZE], *p1 = buf + BUF_SIZE, *pend = buf + BUF_SIZE;
if(p1 == pend) {
p1 = buf;
pend = b... | ALGO | 0.999908 | 4.419215 | {
"github_metadata": {
"branch": "master",
"commit_count": 293,
"repo_created_at": "2013-10-06T18:57:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 45,
"forks": 13,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "bb0bbc... |
57f9ac23-065b-431d-b806-03527a61d3f7 | thirofoo/atcoder-archives | abc405/abc405_f_65688468_AC.cpp | /*
* Author: through
* Submission URL: https://atcoder.jp/contests/abc405/submissions/65688468
* Submitted at: 2025-05-10 22:24:34
* Problem URL: https://atcoder.jp/contests/abc405/tasks/abc405_f
* Result: AC
* Execution Time: 639 ms
*/
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using ... | ALGO | 0.999962 | 4.450384 | {
"github_metadata": {
"branch": "main",
"commit_count": 5513,
"repo_created_at": "2022-12-17T09:45:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
"content_id": "08ee0e40e... |
ff864b18-ab81-4a4c-aad2-5f5d11d6aa01 | Yawn-Sean/Daily_CF_Problems | daily_problems/2024/05/0501/personal_submission/cf631c_luchy0120.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <iostream>
#include <array>
using namespace std;
vector<array<int,2>> vs;
int main() {
int n, m; cin >> n >> m;
vector<int> a(n);
for (int i = 0;i < n;++i) {
cin >> a[i];
}
vector<array<int, 2>> stk;
for (int i = 0;i < m;++i) {
int tp, r; c... | ALGO | 0.99998 | 3.601982 | {
"github_metadata": {
"branch": "main",
"commit_count": 20410,
"repo_created_at": "2024-02-26T01:04:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 478,
"forks": 302,
"issues": 0,
"pull_requests": 7
},
"file_meta": {
"content_id": "e681... |
62c643aa-04cd-4ef4-b0c6-17296cb04049 | iouatu/mySmilei | src/Tools/userFunctions.h | #ifndef USERFUNCTIONS_H
#define USERFUNCTIONS_H
class userFunctions
{
public:
static double erfinv( double x );
static double erfinv2( double x );
//! Load repartition in 1d between MPI processes
static void distributeArray( int rank,
... | TOOL | 0.995976 | 4.106725 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2021-08-18T17:00:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "725147b81986... |
2c721384-3928-4711-ac3c-bf631a431ce6 | mgh3326/OpenCV_practice | 교재예제/10장_예제/예제_10.2.1/harris_dectect - 복사본.cpp | #include <opencv2/opencv.hpp>
using namespace cv;
using namespace std;
void cornerharris_eigen(Mat image, Mat& corner, int blockSize, int ksize, float k)
{
corner = Mat(image.size(), CV_32F, Scalar(0));
Mat resp = Mat::zeros(image.size(), CV_32FC(6));
Mat a1(image.size(), CV_32F, Scalar(0));;
Mat a2(image.size(),... | ALGO | 0.997181 | 5.091838 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2018-07-01T09:42:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 3
},
"file_meta": {
"content_id": "0dd5e5d57... |
89cf2e64-c7da-4435-95bc-82e569311f82 | rishavanand/30-Days-of-DS | tree/binary-tree.cpp | #include <iostream>
#include <stdlib.h>
using namespace std;
// Node structure for tree
struct tNode{
int key;
struct tNode * left;
struct tNode * right;
};
// Node structure for queue
struct Node{
struct tNode * keyNode;
struct Node * next;
};
// Adds a node to the end of the queue
void enqueue(struct Node ** ... | ALGO | 0.999941 | 4.386961 | {
"github_metadata": {
"branch": "master",
"commit_count": 47,
"repo_created_at": "2018-12-10T05:28:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 19,
"forks": 13,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "3b19c14... |
63a548c1-9af8-43bd-8f91-d1b572c39cb4 | rana5679/sorting | mainwindow.cpp | #include "mainwindow.h"
#include "ui_mainwindow.h"
#include <random>
#include <time.h>
#include <iostream>
#include <algorithm>
using namespace std;
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
, ui(new Ui::MainWindow)
{
ui->setupUi(this);
}
MainWindow::~MainWindow()
{
delete ui;
}
... | TOOL | 0.913925 | 4.117115 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-09-22T18:12:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3006a023100d... |
f3ce6908-f154-488e-bc60-1da23d30fec8 | bunnerlemon/PTA-Advanced | 1018.cpp | #include <bits/stdc++.h>
using namespace std;
#define fin freopen("in.txt", "r", stdin)
#define fout freopen("out.txt", "w", stdout)
const int maxn = 505;
struct node {
int id, tm;
node(int id, int tm) {
this->id = id;
this->tm = tm;
}
};
vector<node> p[maxn];
int graph[maxn][maxn];
int... | ALGO | 0.999988 | 3.86363 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2020-02-23T14:09: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": "5995835215... |
2e3f884b-aea4-4a00-98c5-4d7fb2e336e2 | anandkulkarnisg/repogit | temp/TopViewBT.cpp | #include<iostream>
#include<string>
#include<map>
#include<vector>
using namespace std;
struct BTNode
{
int data;
BTNode* leftChild;
BTNode* rightChild;
BTNode(const int& item)
{
data=item;
leftChild=rightChild=nullptr;
}
};
map<int, int> m_lmap; // Level order information.
map<int, int> m_vmap; // Vert... | ALGO | 0.999995 | 4.61157 | {
"github_metadata": {
"branch": "master",
"commit_count": 133,
"repo_created_at": "2017-07-03T14:15:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "9fc729c5... |
5c24ab1b-b505-4d65-881a-21abddb4b8a3 | dlwlehd/BOJ_Cpp | Silver_4/10825.cpp | #include <bits/stdc++.h>
using namespace std;
int n;
struct STU {
string name;
int kor, eng, math;
};
bool cmp(STU a, STU b) {
if (a.kor == b.kor && a.eng == b.eng && a.math == b.math) return a.name < b.name;
if (a.kor == b.kor && a.eng == b.eng) return a.math > b.math;
if (a.kor == b.kor) return ... | ALGO | 0.999389 | 3.800957 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2022-03-17T06:41: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": "718e54385c... |
723a9d38-d5d6-4b1a-8944-11ab14f4a767 | ishikkkkaaaa/DSA | 03 Sorting & Searching/2-InsertionSort.cpp | #include <iostream>
using namespace std;
void insertionSort(int arr[], int n)
{
for (int i = 1; i < n; i++)
{
int current = arr[i];
int prev = i - 1;
while (prev >= 0 and arr[prev] > current) // while prev is greater than current
{
arr[prev + 1] = arr[prev]; ... | ALGO | 0.999936 | 5.060866 | {
"github_metadata": {
"branch": "main",
"commit_count": 68,
"repo_created_at": "2021-05-08T14:47:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 28,
"forks": 12,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "b03cfc8f4... |
b5d5c8e2-cfdc-4fa8-8368-1019372be978 | sintegrial/qwtplot3d | src/qwt3d_types.cpp | #if defined(_MSC_VER) /* MSVC Compiler */
#pragma warning ( disable : 4786 )
#endif
#include <stdlib.h> // qsort
#include <algorithm>
#include <float.h>
#include "qwt3d_data.h"
using namespace Qwt3D;
#ifndef QWT3D_NOT_FOR_DOXYGEN
namespace {
// convex hull
typedef double coordinate_type;
int ccw(coordinate_type *... | ALGO | 0.992854 | 4.15038 | {
"github_metadata": {
"branch": "master",
"commit_count": 54,
"repo_created_at": "2014-11-10T15:34:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 88,
"forks": 53,
"issues": 6,
"pull_requests": 0
},
"file_meta": {
"content_id": "3621ed1... |
bacfbfd6-f7ac-478b-b51b-5a725afa01af | HarshitPan/Study-Material | Sem4/Networks/Codes/temp/tempCodeRunnerFile.cpp | #include<iostream>
using namespace std;
const int key=4;
int toDecimal(int x)
{
int temp=1;
int i=0;
int decimal=0;
while(x!=0)
{
decimal+=(x%10)*temp;
temp=temp*2;
x=x/10;
}
//cout<<endl<<"Decimal ->"<<decimal<<endl;
return decimal;
}
int toBinary(int x)
{
i... | ALGO | 0.999971 | 3.262857 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2023-04-11T19:32: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": "5f2321bcc... |
0fb14893-0674-4dd0-8fc0-56825e4bdc7d | AliKarakus/camwa | libs/mesh/src/meshCubatureNodesHex3D.cpp | /*
The MIT License (MIT)
Copyright (c) 2017 <NAME>, <NAME>, <NAME>, <NAME>
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 restriction, including without limitation the rights
to use, co... | ALGO | 0.985232 | 4.120589 | {
"github_metadata": {
"branch": "main",
"commit_count": 2841,
"repo_created_at": "2022-05-12T19:17:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "49714c8cf... |
f69a036f-11f6-41ae-b8ea-436a5ec3092c | 101magikarp101/USACO | 2019-fools/G.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define MOD 998244353
#define MOD2 1000000007
#define vt vector
struct pii {int x, y;};
struct pll {ll x, y;};
int T, N;
int a[200005];
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
string ord = "RPS";
string res = "";
string p... | ALGO | 0.999694 | 3.756567 | {
"github_metadata": {
"branch": "main",
"commit_count": 66,
"repo_created_at": "2024-09-25T15:08:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dcb1ea1309a... |
082768d8-99fc-45a0-af3b-8d39f8eab5f8 | ay2306/Competitive-Programming | hackerCup/2018/round1/b.cpp | /*
____________________________________________________________
| |
| Author: ay2306 |
|____________________________________________________________|
*/
#include <bits/stdc++.h>
#define MOD 1000000007
#define test i... | ALGO | 0.999431 | 4.195296 | {
"github_metadata": {
"branch": "master",
"commit_count": 22,
"repo_created_at": "2019-08-29T14:45:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bdfc05373... |
a81accb3-8622-4c2b-b670-67418de19e43 | ping203/BanCaClient | runtime-src/Classes/curve/Spline.h | //
// Created by byter on 6/15/18.
//
#ifndef THREE_PP_SPLINE_H
#define THREE_PP_SPLINE_H
#include "../core/Curve.h"
#include "../core/Interpolations.h"
#include "../math/Vector2.h"
namespace three {
namespace extras {
namespace curve {
class Spline : public Curve
{
public:
std::vector<math::Vector2> points;
e... | ALGO | 0.992407 | 7.344856 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2019-02-14T08:50: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": "75fcf64cb2... |
9a906b98-7362-4a46-a812-01384998bbdb | Kubrazareen/DSA-LAB | Circular.Singly.DELECTATION.cpp | #include <iostream>
using namespace std;
class Node {
public:
int data;
Node* next;
Node(int value) {
data = value;
next = NULL;
}
};
class CircularLinkedList {
private:
Node* last;
public:
CircularLinkedList() {
last = NULL;
}
void createInitialList(int arr[... | ALGO | 0.999876 | 6.317416 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2024-10-25T16:35:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0009f29eefc... |
d48efdc0-7daf-4512-9fd1-9b26835044d1 | Mtaylorr/Competitive-programming-Solutions | ACPC/ECPC/2024/C.cpp | // Mtaylor
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define fi first
#define se second
#define mp make_pair
#define endl '\n';
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
void dbg_out() { cerr << endl; }
template <typename Hea... | ALGO | 0.999642 | 4.34775 | {
"github_metadata": {
"branch": "main",
"commit_count": 1208,
"repo_created_at": "2021-07-28T20:32:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 49,
"forks": 7,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dae8307c... |
e728290c-b6b6-4eb7-9e99-7a4cbba6d298 | sudiksha23/walmart_hackathon | source_codeANDdocumentation/C3walmart.cpp | #include<iostream>
#include<fstream>
#include<bits/stdc++.h>
#include<sstream>
using namespace std;
struct items{
int itemId, basePrice, baseUnits, p1, u1, p2, u2, p3, u3, p4, u4, baseRevenuePerItem;
int revenuePrice1,revenuePrice2,revenuePrice3,revenuePrice4;
int finalHit;
int k;
string result;
};
bool comparetw... | DATA | 0.984068 | 3.422993 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2020-08-07T09:26:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ab4c4bcb77... |
e7444a72-7f6b-4e46-a3d5-f4766ca29228 | VictorGomes5/tpa | exercicio22.cpp | /*
Funcão: mostrar algumas operações escolhidas pelo usuario
Autor: <NAME>
Data de criação: 12/11/2019
*/
#include <stdio.h>
#include <windows.h>
#include <locale.h>
int main(){
setlocale(LC_ALL, "");
int num1 = 0, num2 = 0, op = 0, valor = 0;
printf("Informe um número: ");
scanf("%i", &num1);
printf("Informe ou... | TOOL | 0.985985 | 3.139463 | {
"github_metadata": {
"branch": "master",
"commit_count": 44,
"repo_created_at": "2019-09-26T10:55: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": "01cb70ad6... |
8ae5d3af-4ee5-442c-9d56-bbad375bed27 | YazanIST/CP | Notebooks/CSESSolutions/02-DynamicProgramming/15-IncreasingSubsequence.cpp | // You are given an array containing n integers. Your task is to determine the longest increasing subsequence in the array, i.e., the longest subsequence where every element is larger than the previous one.
int lis(vector<int> const &a) {
int n = a.size();
vector<int> dp(n + 1, INF);
dp[0] = -INF;
for (... | ALGO | 0.999951 | 4.960202 | {
"github_metadata": {
"branch": "main",
"commit_count": 41,
"repo_created_at": "2022-09-25T23:55:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6d2f3463649... |
8f4d24b7-ec30-4f88-9d02-c3e038e6446d | qtwebkit/qtwebkit | Source/ThirdParty/libwebrtc/Source/webrtc/modules/audio_processing/aec3/fullband_erle_estimator.cc | /*
* Copyright (c) 2018 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contribut... | ALGO | 0.990948 | 7.628178 | {
"github_metadata": {
"branch": "qtwebkit-dev-wip",
"commit_count": 219621,
"repo_created_at": "2015-12-31T17:38:35.000Z",
"is_fork": true,
"is_org_owned": true,
"forked_from": "WebKit/WebKit-http",
"stars": 485,
"forks": 134,
"issues": 517,
"pull_requests": 23
},
"file_me... |
8d43c46a-5b2e-486c-a3ae-aeb5d458c184 | angelcoder/oop-lab-2 | oop-lab-2/Multer.cpp | //
// Multer.cpp
// oop-lab-2
//
// Created by <NAME> on 05.10.2018.
// Copyright © 2018 <NAME>. All rights reserved.
//
#include "LongInt.hpp"
#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
#include <complex>
using namespace std;
Multer* LongInt::m = nullptr;
void extend_vec(std::ve... | ALGO | 0.977996 | 3.765733 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2018-11-14T17:16: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": "342b6e6a6... |
47798abb-40a8-4563-8d08-379016689b57 | guilhermesilveira/uva-problems | v1/p193/p193.as.cpp | #include <stdio.h>
#include <vector>
using namespace std;
#define INCOLOR 0
#define BLACK 1
#define WHITE 2
struct node {
int id;
int color;
vector<node *> filhos;
int nfilhos;
};
// os nodes cacheados e a lista de estado
int nodeCount;
vector<node> pool;
int maxBlackCount;
bool melhor[100];
void recursao(... | ALGO | 0.9998 | 4.230587 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2010-12-15T00:27:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dbe70e3522... |
b06a9be1-5f53-44f1-999f-6b35317f6ad0 | Winneyp/0763-Lab24 | lab24.cpp | #include<iostream>
#include<cmath>
using namespace std;
class ComplexNumber{
public:
double real;
double imag;
ComplexNumber(double,double);
ComplexNumber operator+(const ComplexNumber &);
ComplexNumber operator-(const ComplexNumber &);
ComplexNumber operator*(const ComplexNumber &);
ComplexNumber o... | ALGO | 0.908688 | 4.434269 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2023-03-07T07:56: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": "204b972c51... |
eb8699bf-9984-4d95-8b47-c2c213329d69 | Anastasiyapash/OOP | srcCourseSnake/screen.cpp |
#include "snake.h"
#define STEP 25
extern int rungame;
int getrand(int min, int max)
{
return rand() % (max - min) + min;
}
Screen::Screen(int x, int y):sizex(x),sizey(y){
this->ky = 0;
this->kx = 0;
for (int i = 0; i < this->sizex; i+=STEP) kx++;
for (int i = 0; i < this->sizey; i+=STEP) ky++;
}
voi... | TOOL | 0.959363 | 4.334536 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2017-11-26T14:07: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": "3f9a5d2d8... |
66200049-ca9c-4102-8700-031513b3239e | sachin-ag/DSA-Problems-with-Explaination | 21. Dynamic Programming - 1/2_min_steps_to_1.cpp | #include <bits/stdc++.h>
#include <climits>
using namespace std;
/* Given a positive integer 'n', find and return the minimum
number of steps that 'n' has to take to get reduced to 1.
You can perform any one of the following 3 steps:
1.) Subtract 1 from it. (n = n - 1) ,
2.) If its divisible by 2, divide by 2.( if... | ALGO | 0.99996 | 4.443739 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-04-28T17:30: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": "90081902c903... |
d1b09f92-a898-473c-b1b5-ae8b9a405519 | ElvisLiu1994/LeetCode | _005_LongestPalindroicSubstring.cpp | //
// Created by liujing on 18-4-19.
//
/*
*
Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000.
Example 1:
Input: "babad"
Output: "bab"
Note: "aba" is also a valid answer.
Example 2:
Input: "cbbd"
Output: "bb"
*/
#include "add.h"
int lo, maxLen;
... | ALGO | 0.999718 | 5.642988 | {
"github_metadata": {
"branch": "master",
"commit_count": 29,
"repo_created_at": "2018-04-17T13:18: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": "d14ef75d4... |
9c92a269-3085-4e18-862b-624b42aff413 | chirag-jn/AlgoBook | LinkedLists/DoubleLL.cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long
#define double long double
#define endl '\n'
void setEnv() {
#ifndef ONLINE_JUDGE
// for getting input from input.txt
freopen("../input.txt", "r", stdin);
// for writing output to output.txt
freopen("../output.txt", "w", stdout);
... | ALGO | 0.999876 | 4.539222 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2019-12-13T23:06:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2fc857f7b... |
e839f281-145f-4946-8510-4fbb2722917e | Yupdown/PScpp | bojc++/BOJ27651.cpp | #include <bits/stdc++.h>
#define FASTIO() cin.tie(0),cout.tie(0),ios::sync_with_stdio(0)
using namespace std;
long long table[1000000];
int main()
{
FASTIO();
int n;
cin >> n;
for (int i = 0; i < n; ++i)
cin >> table[i];
for (int i = 1; i < n; ++i)
table[i] += table[i - 1];
long long ret = 0;
for (int x... | ALGO | 0.999945 | 3.634647 | {
"github_metadata": {
"branch": "main",
"commit_count": 209,
"repo_created_at": "2022-09-16T06:08:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c262671188... |
0d4f32a8-170a-4a38-b495-f22a15e38e78 | algoboy101/LeetCodeCrowdsource | backup/source/cpp/[778]水位上升的泳池中游泳.cpp | //在一个 N x N 的坐标方格 grid 中,每一个方格的值 grid[i][j] 表示在位置 (i,j) 的平台高度。
//
// 现在开始下雨了。当时间为 t 时,此时雨水导致水池中任意位置的水位为 t 。你可以从一个平台游向四周相邻的任意一个平台,但是前提是此时水位必须同时淹没这两
//个平台。假定你可以瞬间移动无限距离,也就是默认在方格内部游动是不耗时的。当然,在你游泳的时候你必须待在坐标方格里面。
//
// 你从坐标方格的左上平台 (0,0) 出发。最少耗时多久你才能到达坐标方格的右下平台 (N-1, N-1)?
//
// 示例 1:
//
//
//输入: [[0,2],[1,3]]
//输出: 3
/... | ALGO | 0.999991 | 6.073027 | {
"github_metadata": {
"branch": "master",
"commit_count": 194,
"repo_created_at": "2020-03-06T03:43:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 3,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "0b47eb15... |
78ac8051-c00f-461c-9f06-37a8724145e1 | jasonwarta/CS405-checkers-ai | src/Game.cpp | // Game.cpp
#include "Game.h"
char Game::run(std::string theBoard) {
size_t turnCounter = 0;
bool redTeamTurn = true;
bool stalemate1 = false, stalemate2 = false;
(*os_) << "[" << std::endl;
// main loop, only exit when done
while (turnCounter < TOTAL_MOVES)
{
(*os_) << "{\"move\":\"" << std::setfill('0') <... | ALGO | 0.95272 | 3.876155 | {
"github_metadata": {
"branch": "master",
"commit_count": 300,
"repo_created_at": "2018-01-18T19:37:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6c3aeb41... |
ca6f1218-a2bc-4c3c-be41-95ddaadd8136 | ishandutta2007/codeforces-a | alexluchianov/normal/1051/F.cpp | #include <iostream>
#include <vector>
#include <queue>
using namespace std;
#define ll long long
#define MIN(a , b) (((a) < (b)) ? (a) : (b))
#define MAX(a , b) (((a) < (b)) ? (b) : (a))
int const nmax = 200000;
struct Edge{
int from;
int to;
int cost;
};
vector < Edge > g[5 + nmax];
vector < Edge > g2[5 + n... | ALGO | 0.999959 | 4.430995 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-04-11T00:51:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "29c531de625a... |
9920feef-247b-437f-aa14-0e8e48118153 | bzwh/transmission-mcmc | include/Chain.hpp | #ifndef CHAIN_HPP_INCLUDED
#define CHAIN_HPP_INCLUDED
#include <vector>
#include <fstream>
#include <string>
#include <Eigen/Dense>
#include <gsl/gsl_rng.h>
#include "Model.hpp"
class Chain {
public:
Chain(int,int,int,int,int,int);
void run();
void gen(int);
int acceptreject();
void scalefactor(int,double)... | ALGO | 0.903495 | 5.083891 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2016-06-24T09:36: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": "8a1a8c064... |
f5cce081-67ad-4d40-97b2-17ae7f6ff357 | vinod-designer1/competitive-programming | USACO/Section_1_5/pprime.cpp | /*
ID: vinod.d1
PROG: pprime
LANG: C++
*/
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <fstream>
#include <cmath>
#include <string>
#include <sstream>
using namespace std;
#define MAX 10000
#define L1D_CACHE_SIZE 10000
int is_compound[MAX+1];
int primes[MAX+1];
int prm_c = 0;
... | ALGO | 0.99995 | 4.400491 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2014-04-26T18:56:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9b1d8e2045... |
7c951ba3-bb74-44bf-bb63-c6706fb1fbc5 | Subsdip/Algorithms | C++/selection_sort.cpp | #include <iostream>
using namespace std;
int main()
{
int n, i, j, temp = 0;
cout << "Enter the size fo the container = ";
cin >> n;
int arr[n];
cout << "Enter the elements in the container = ";
for (i = 0; i < n; i++)
{
cin >> arr[i];
}
for (i = 0; i < n - 1; i++)
{
... | ALGO | 0.999895 | 4.813264 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2021-02-06T04:55: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": "e2038e93f4f3... |
150f7e9a-31d6-4517-9088-b186ee6d37a8 | AndreaGiurissich/OpenGL | MathLibrary/Mat2.cpp | #include "Mat2.h"
#include <iostream>
using namespace std;
Mat2::Mat2()
{
x11 = 1;
x12 = 0;
x21 = 0;
x22 = 1;
}
Mat2::Mat2(float x1, float x2, float y1, float y2)
{
x11 = x1;
x12 = x2;
x21 = y1;
x22 = y2;
}
Mat2::Mat2(float var)
{
x11 = var;
x12 = var;
x21 = var;
x22 = var;
}
Mat2::Mat2(const Vec2& v1,... | TOOL | 0.954197 | 5.027184 | {
"github_metadata": {
"branch": "restart",
"commit_count": 55,
"repo_created_at": "2024-09-20T09:48:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2b6251ce... |
e9c57aaf-d407-41c8-8ff6-c1fed277432c | Arslanarsal/CSES-Solutions | Introductory Problems/Coin_Piles.cpp | #include <bits/stdc++.h>
using namespace std;
string solve(int A, int B)
{
// X * 2 + Y * 4 = 2 * A
// X * 2 + Y * 1 = B
// 3 * Y = 2 * A - B
// Y = (2 * A - B)/3
// X + Y * 2 = A
// 4 * X + 2 * Y = 2 * B
// -3 * X = A - 2 * B
// X = (2 * B - A) / 3
if ((2 * A - B) % 3 || (2 * A -... | ALGO | 0.999512 | 5.315922 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2025-05-14T19:06:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c6526ade63e7... |
386772b9-6306-4b3c-a00d-de2589c51ba7 | NedkoPNedev/Introduction-To-Programming-Materials | IntroToProgrammingMaterials/практикум/Петнадесети практикум/zad7.cpp | #include<iostream>
#include<math.h>
using namespace std;
struct Point
{ double xx, yy;
};
void in(int &n, Point a[])
{ cin >> n;
for (int i = 0; i < n; i++)
cin >> a[i].xx >> a[i].yy;
}
double FindTheDistance(Point p1, Point p2)
{ return sqrt((p1.xx - p2.xx) * (p1.xx - p2.xx) + (p1.yy - p2.yy) * (p1.yy - p2.yy)... | ALGO | 0.999409 | 3.556013 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-02-04T16:11: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": "85b4459d5e... |
98ea443a-fe6e-45d5-a800-d7860e47bdc6 | yasuder/inventory | movieInventory/BinarySearchTree.cpp | //
// Created by <NAME> on 5/16/18.
//
#include "BinarySearchTree.h"
BinarySearchTree::BinarySearchTree() {
root = nullptr;
size = 0;
}
BinarySearchTree::~BinarySearchTree() {
root = clear(root);
}
bool BinarySearchTree::add(Movie *m) {
root = addHelper(m, root);
return true;
}
void BinarySearchTree::clear(... | ALGO | 0.999621 | 3.581423 | {
"github_metadata": {
"branch": "master",
"commit_count": 70,
"repo_created_at": "2018-05-07T23:52: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": "474a1540e... |
c6f4c8eb-240b-41ac-beae-7361935f9d04 | hotslab/SCRIPTS | cpp/mergeSort.cpp | #include <iostream>
#include <array>
#include <time.h>
#include <cstdlib>
void mergeSort(int array[], int arraySize);
void merge(int leftArray[], int rightArray[], int array[], int arraySize);
void printArray(int array[], int arraySize);
int main()
{
int arraySize;
int integerBound;
std::cout << "Enter ar... | ALGO | 0.999733 | 5.448266 | {
"github_metadata": {
"branch": "master",
"commit_count": 71,
"repo_created_at": "2022-01-12T13:41: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": "205f15a46... |
46540b96-9c34-42d3-88c7-50c19a731df8 | pgw1715/Test | 문제풀이/GREEDY/1946번 : 신입사원.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
vector<pair<int, int>> v;
int passCnt[20] = { 0 };
void printResult(int);
int getPassCnt(int);
bool compare(pair<int, int>, pair<int, int>);
int main() {
int testcaseCnt;
cin >> testcaseCnt;
for (int i = 0; i < testcaseCnt; i++) {
... | ALGO | 0.999833 | 4.380639 | {
"github_metadata": {
"branch": "master",
"commit_count": 118,
"repo_created_at": "2019-12-26T07: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": "912ac551... |
b939a27b-cbd0-4f63-88a4-f03c10f634b0 | Safwan-Ibrahim/CPP | Codeforces Ratingwise/1500/C_Representative_Edges.cpp | // Created on: 2025-03-19 23:26
// Author: Safwan_Ibrahim
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define endl '\n'
const int N = 75;
double A[N];
void Try() {
int n; cin >> n;
for (int i = 1; i <= n; i++) {
cin >> A[i];
}
int mx = 1;
for (int i = 1; i <= ... | ALGO | 0.999407 | 4.314664 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2025-01-13T11:10: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": "6480f820608... |
d93bf7b5-4c75-4223-ae40-9d357a7edbd6 | aBBassam/CP-Solutions | CodeForces/GNU C++20 (64)/1681D | Required Length/158515295.cpp | // Problem: D. Required Length
// Contest: Codeforces - Educational Codeforces Round 129 (Rated for Div. 2)
// URL: https://codeforces.com/contest/1681/problem/D
// Memory Limit: 512 MB
// Time Limit: 2000 ms
//
// Powered by CP Editor (https://cpeditor.org)
#include <bits/stdc++.h>
#define ll long long
#define all(... | ALGO | 0.999881 | 4.289543 | {
"github_metadata": {
"branch": "main",
"commit_count": 543,
"repo_created_at": "2022-08-19T12:03:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "db6e8c7623... |
40cab7cb-1e77-4a19-b0c3-8c17c17a3133 | TanishqThuse/ADS_SY_LAB_EXAM | Assignment-2_Searching_Techniques/Program-13/Program-13.cpp | /**Q2) 13)WAP to store k keys into an array of size n at the location computed
using a hash function, loc = key / n, where k<=n and k takes values from
[1 to m], m>n. To handle the collisions use the following collision
resolution techniques, a. Linear probing with chaining with replacement
b. Quadratic probing techniq... | ALGO | 0.9998 | 6.158164 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-11-18T07:33:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ec31b41b4c6a... |
ea6b2db8-3ba6-4144-a082-031624553ce4 | hasnat-shohag/Daily_OJ_Problem_Solve | Codeforces/F_We_Were_Both_Children.cpp | #include <bits/stdc++.h>
using namespace std;
#define FastIO ios_base::sync_with_stdio(0), cin.tie(0)
#define TxtIO freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
#define f0(i, n) for (int i = 0; i < n; i++)
#define f1(i, n) for (int i = 1; i <= n; i++)
#define f2(i, n) for (int i = 1; i < n; i... | ALGO | 0.999943 | 4.237192 | {
"github_metadata": {
"branch": "master",
"commit_count": 123,
"repo_created_at": "2023-02-01T13:48: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": "51cec537... |
3ee6eb0e-d157-4ec8-a20f-a69f8eee99bf | KimDesroches/INF1900-1013 | projet/lib/Corner.cpp | #include "Corner.h"
Corner::Corner(){}
void Corner::turnBack(Robot& robot, Navigation::TurnDirection firstDirection, Navigation::TurnDirection secondDirection){
bool isLine = true;
robot._navigation.turnJunction(firstDirection);
while(isLine){
isLine = robot._navigation.followLine();
}
ro... | ALGO | 0.984485 | 3.927683 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2023-12-22T17:10:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5b52f3ce71a... |
195b0d2b-3c77-4856-98c1-f0eae4f5ea99 | akhikolla/testpackages | fuzzedpackages/kernelTDA/src/RcppExports.cpp | // Generated by using Rcpp::compileAttributes() -> do not edit by hand
// Generator token: <PASSWORD>
#include <RcppEigen.h>
#include <Rcpp.h>
using namespace Rcpp;
// svmtrain_R
List svmtrain_R(Eigen::MatrixXd x, int r, int c, Eigen::VectorXd y, int rowindex, int colindex, int svm_type, int kernel_type, int degree,... | ALGO | 0.991297 | 6.131634 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2021-01-15T17:42:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "11960c3980... |
75689280-263d-4988-ac94-5d4de6cf2ec5 | Hakzel/ESP-Sensor-Tool | 03b_L_Acceleration.ino |
display.clear();
Wire.beginTransmission (0x53);
if (Wire.endTransmission () == 0) {
if(init_adxl == true){ // initialize adxl after first response
display.init();
display.setFont(ArialMT_Plain_10);
display.flipScreenVertically(); // Adjust to suit or remove
adxl.powerOn(); ... | TOOL | 0.947452 | 4.468643 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2018-11-05T11:17: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": "cb37fc9221... |
223dc0f9-5198-4638-87a1-ae1663da3e0d | hrishitchaudhuri/generix | traits_policies.cpp | #include<iostream>
#include<type_traits>
#if 0
template <typename T, typename Val>
Val Accumulate(T first, T last) {
// declval returns an rvalue reference
// (creates an object of type T)
Val accumulator{};
while (first != last) {
accumulator += (*first);
++first;
}
return accumulator;
}
#endif
// ideall... | TOOL | 0.951382 | 6.632971 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2022-07-11T02:42: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": "ba5be8dfcb... |
1e34144e-8ce9-4d1d-aa97-0d51134b8546 | Hazlnuss/AoC | 2022/7/main.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <string>
using namespace std;
struct file{
string name;
int size;
file(string name,int size):name(name),size(size){
}
};
struct dir{
string name;
dir* up;
vector<dir*> childs;
vector<file*> files;
long int total_size = 0;
dir(string name,d... | TOOL | 0.988303 | 4.452163 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2023-04-12T19:29: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": "7239429780... |
f2def133-31d2-4491-9aba-b49cf78974b3 | gabrielpessoa1/Competitive-Programming | BAPC preliminaries 2018/C.cpp | // Benelux Algorithm Programming Contest preliminaries 2018
// C - Criss-Cross Cables
// https://open.kattis.com/problems/crisscrosscables
#include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> ii;
const int ms = 5e5+5;
int x[ms];
int cur[ms];
int wire[ms];
priority_queue<ii, vector<ii>, greater<ii>> ... | ALGO | 0.999998 | 3.977079 | {
"github_metadata": {
"branch": "master",
"commit_count": 92,
"repo_created_at": "2019-04-16T00:08:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "875e4e9d2... |
e0e285a7-1f79-4e8f-a516-d5b5d40798a9 | gupenghu/LeetCode | 78.subsets.cpp | // •Total Accepted: 146608
// •Total Submissions: 387131
// •Difficulty: Medium
// •Contributors: Admin
// Given a set of distinct integers, nums, return all possible subsets.
// Note: The solution set must not contain duplicate subsets.
// For example,
// If nums = [1,2,3], a solution is:
// [
// [3],
//... | ALGO | 0.999927 | 5.887423 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2015-03-04T11:50: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": "a90c6aa5a... |
35bcea20-9fe7-47cc-9b6e-d7bcc909e942 | wzqwsrf/Jobdu | C++/题目1361:翻转单词顺序.cpp |
// 题目1361:翻转单词顺序
/**
* @author:wangzq
* @email:<EMAIL>
* @date:2015-06-30 18:46:48
* @url:http://ac.jobdu.com/problem.php?pid=1361
*/
#include<iostream>
#include<algorithm>
#include<string.h>
#include<stdio.h>
using namespace std;
char array[50002];
int len;
void reverseWord(int start, int end) {
while (s... | ALGO | 0.999939 | 3.93976 | {
"github_metadata": {
"branch": "master",
"commit_count": 49,
"repo_created_at": "2014-07-03T04:03:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 15,
"forks": 6,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c26caa70... |
0d00822c-329d-447f-8d72-4ac7f5ed4d6c | ldebug/sandbox | ragnarok/ds10/trunk/config.cpp | #include <windows.h>
#include "config.hpp"
namespace config
{
static char m_filename[MAX_PATH];
static bool m_bool[KEY_BOOL];
static unsigned int m_dword[KEY_DWORD];
static char m_fontnameA[LF_FACESIZE];
static char m_fontnameL[LF_FACESIZE];
///////////////////////////////////////////////////////////////////... | CONFIG | 0.912539 | 4.843919 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2016-11-29T10:14: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": "9b0ff7e837... |
87dddcf3-c16b-47d2-ae65-64764f401213 | TinkerTools/tinker-hp | v1.2/plumed2/src/mapping/PropertyMap.cpp | /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Copyright (c) 2013-2023 The plumed team
(see the PEOPLE file at the root of the distribution for a list of names)
See http://www.plumed.org for more information.
This file is part of plumed, version 2.
plumed is free software... | ALGO | 0.90667 | 6.504292 | {
"github_metadata": {
"branch": "master",
"commit_count": 576,
"repo_created_at": "2018-06-12T12:15:51.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 92,
"forks": 25,
"issues": 5,
"pull_requests": 0
},
"file_meta": {
"content_id": "4628950... |
f96053c1-b3ec-42ee-9c48-748754261e0f | anamargaridaborges/competitiveprogramming | cses/companyqueriesI.cpp | #include <bits/stdc++.h>
#define MAXN 200010
using namespace std;
int chefe[MAXN][20];
int main () {
int n, q;
scanf ("%d%d", &n, &q);
for (int i=1; i<=n; i++) {
for (int j=0; j<=19; j++) chefe[i][j] = -1;
}
for (int i=2; i<=n; i++) scanf ("%d", &chefe[i][0]);
for (int j=1; j<=19; j++... | ALGO | 0.999986 | 3.72366 | {
"github_metadata": {
"branch": "main",
"commit_count": 60,
"repo_created_at": "2024-08-03T12:49:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a7f9a66a697... |
a9ed0b1e-29e8-44a0-bda7-b4957223b0ad | RosettaCommons/rosetta | source/src/protocols/noesy_assign/util.cc | // -*- mode:c++;tab-width:2;indent-tabs-mode:t;show-trailing-whitespace:t;rm-trailing-spaces:t -*-
// vi: set ts=2 noet:
//
// (c) Copyright Rosetta Commons Member Institutions.
// (c) This file is part of the Rosetta software suite and is made available under license.
// (c) The Rosetta software is developed by the co... | ALGO | 0.924545 | 5.672832 | {
"github_metadata": {
"branch": "main",
"commit_count": 11737,
"repo_created_at": "2023-11-17T16:42:18.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 296,
"forks": 100,
"issues": 27,
"pull_requests": 9
},
"file_meta": {
"content_id": "5839... |
8e6f4da1-d58a-4a00-b8cb-d95bb1bb46e0 | mysticalwing/code_snippets | lru.cpp | // Least-Recent-Used cachea algorithm
#include <iostream>
#include <unordered_map>
using std::cout;
using std::endl;
class LRUCache
{
private:
class DLinkedListNode
{
public:
int key;
int value;
DLinkedListNode *pre;
DLinkedListNode *next;
DLinkedListNode(int key... | ALGO | 0.999477 | 5.842092 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2021-08-09T06:30: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": "875800880... |
91e4888c-2e98-4433-80d9-db3587a7b6ac | ML-UCV/ML-CodeBert-DistinctSolutions | Raw Dataset/inv/merge/train/3afe4940-137e-11eb-aef8-309c234925a0.cpp | #include <bits/stdc++.h>
using namespace std;
ifstream fin("inv.in");
ofstream fout("inv.out");
const int nmax = 100005;
const int mod = 9917;
int n, v[nmax], L[nmax], R[nmax], temp[nmax], ans;
void solve(int st, int dr)
{
if(st < dr)
{
int mid = (st + dr) / 2;
solve(st, mid);
... | ALGO | 0.999985 | 3.936236 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2022-03-06T17:44:46.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7b8c3d4fff24e... |
664e30bb-b8a4-43db-adbc-26a39992b37f | godotengine/godot | thirdparty/jolt_physics/Jolt/Physics/Constraints/ConstraintPart/IndependentAxisConstraintPart.h | // Jolt Physics Library (https://github.com/jrouwe/JoltPhysics)
// SPDX-FileCopyrightText: 2022 <NAME>
// SPDX-License-Identifier: MIT
#pragma once
#include <Jolt/Physics/Body/Body.h>
#include <Jolt/Physics/StateRecorder.h>
JPH_NAMESPACE_BEGIN
/// Constraint part to an AxisConstraintPart but both bodies have an ind... | ALGO | 0.994898 | 4.04323 | {
"github_metadata": {
"branch": "master",
"commit_count": 76043,
"repo_created_at": "2014-01-04T16:05:36.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 98972,
"forks": 22820,
"issues": 5000,
"pull_requests": 3866
},
"file_meta": {
"content... |
973ecefa-4643-4ca8-abad-a1dd74334d3e | RAJPATEL-DROID/LeetCode-Repo | Jump Game - GFG/jump-game.cpp | //{ Driver Code Starts
//Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function Template for C++
class Solution {
public:
int canReach(int A[], int N) {
// code here
//strat iterating from last index till the 0th index
//if I'm able ... | ALGO | 0.999282 | 5.174022 | {
"github_metadata": {
"branch": "master",
"commit_count": 2359,
"repo_created_at": "2023-01-27T18:37:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d6e9c3f... |
04a6d0a0-aa93-464a-b188-b617f29cae5d | ishandutta2007/codeforces-f | flashmt/normal/1137/C.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 5000500;
int n, d, num[N], low[N], flag[N], counter, numScc, sccId[N], museums[N], seen[100100];
vector<int> a[100100], st, sccEdges[N];
string schedule[100100];
inline void dfs(int x)
{
int u = x / d, du = x % d;
low[x] = num[x] = counter++;
st.push_b... | ALGO | 0.999884 | 4.069904 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:43: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": "e4d604f4e0d7... |
811c8954-93ed-4a3b-b983-a8d16f26f80a | chatann/AtCoder | cpp/s8pc_4_b.cpp | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define reps(i, a, b) for (int i = (a); i < (b); ++i)
#define all(a) (a).begin(), (a).end()
using namespace std;
using ll = int64_t;
const ll INF_L = 1LL << 60;
int main() {
int n, k;
cin >> n >> k;
vector<ll> a(n);
rep(i, n... | ALGO | 0.999978 | 3.787932 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-05-22T02:41: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": "0c6f6a0d6188... |
ad69caad-f9a6-4e11-92ac-63997a1f3355 | Jeesh1702/CPC23 | Week 6/Lowest Common Ancestor in a Binary Tree.cpp | #include <bits/stdc++.h>
using namespace std;
// Tree Node
struct Node
{
int data;
Node* left;
Node* right;
Node(){
data = 0;
left = right = NULL;
}
Node(int x){
data = x;
left = right = NULL;
}
};
// } Driver Code Ends
/* A binary tree node
struct Node
{
... | ALGO | 0.999976 | 5.909297 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2023-12-29T13: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": "87036e416def... |
84e00185-1604-4cbd-b041-b3bea6df35e4 | ori5r2/algorithm-archive | algorithm/swea/rotateRec.cpp | #include <bits/stdc++.h>
using namespace std;
#define MX 10
int rec[MX][MX];
int N, M;
void printBoard(int b[MX][MX])
{
for (int i = 0; i < N; i++)
{
for (int j = 0; j < M; j++)
cout << b[i][j] << " ";
cout << endl;
}
cout << endl;
}
void init()
{
N = 3, M = 2;
int... | ALGO | 0.99951 | 3.86098 | {
"github_metadata": {
"branch": "master",
"commit_count": 31,
"repo_created_at": "2023-01-14T07:09:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1d09966f9... |
8d9e375e-d865-485c-9e42-9136ad12d6b0 | AliOsm/CompetitiveProgramming | CodeForces/257C. View Angle.cpp | /*
Idea:
- Calculate the angel between each point and the positive x-axis.
- Then the answer will be the minimum angles[i] - angles[i-1].
*/
#include <bits/stdc++.h>
using namespace std;
int const N = 1e5 + 1;
long double const PI = acos(-1);
int n, gcd, a[N], b[N];
long double angs[N];
int main() {
// ... | ALGO | 0.999942 | 4.739935 | {
"github_metadata": {
"branch": "master",
"commit_count": 595,
"repo_created_at": "2016-10-14T11:29:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 138,
"forks": 49,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7d799... |
74b4f5ce-e7dc-4651-8473-e1df92966282 | kolbjornkelly/kattis | Reverse Rot/main.cpp | //
// main.cpp
// Reverse Rot
//
// Created by <NAME> on 17.04.2018.
// Copyright © 2018 <NAME>. All rights reserved.
//
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
using namespace std;
string reverseString(string str)
{
string out;
for (string::iterator it = str.end()... | ALGO | 0.999771 | 4.198941 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2020-09-30T14:46: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": "022954efa9... |
1bbc1173-afee-4479-b94b-e3566a27fff8 | poplpr/cp-template | 数学/多项式/4717[模板]FWT.cpp | #include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
typedef long long LL;
#define IL inline
#define ri register int
#define mk make_pair
const int N = 19;
const int MOD = 998244353;
const int inv2 = 499122177;
int n;
int a[1<<N],b[1<<N];
int ora[1<<N],orb[1<<N],orc[1<<N];
int anda[1<<N],andb[... | ALGO | 0.999973 | 3.946288 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2024-07-05T13:22:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "59dd8d6428d... |
4e2c1293-5bb6-4f42-bd51-2e29ddb56748 | okasakinagi/xmucoder_nagi | C++/骑士林克的怜悯(1)/code.cpp | #include <cstring>
#include <map>
#include <iostream>
#include <algorithm>
#define MAX 27
using namespace std;
int dir_x[] = {-1, 1, -2, 2, -2, 2, -1, 1}, dir_y[] = {-2, -2, -1, -1, 1, 1, 2, 2}; // 优先靠左的格子
int court[MAX][MAX];
int W, H;
int out_x[MAX * MAX], out_y[MAX * MAX];
void print_true()
{
for (int i = 0; i... | ALGO | 0.999815 | 3.586175 | {
"github_metadata": {
"branch": "main",
"commit_count": 26,
"repo_created_at": "2024-07-09T04:41:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "d2b3909cc1e... |
82f9c337-c80e-47a2-a559-acedc1d549d1 | arjunrajlab/testITK | LoadAndSaveTIFF.cpp | // cmake ..
// make
#include "itkImage.h"
#include "itkImageFileReader.h"
#include "itkImageFileWriter.h"
#include "itkBinaryContourImageFilter.h"
#include "itkImageRegionIterator.h"
#include <iostream>
#include <chrono> // Include the chrono library
int main()
{
// Define the image type
typedef itk::Image<un... | TOOL | 0.932763 | 6.212776 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-02-26T14:15: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": "afea8ecea115... |
513807f8-610e-4f04-9500-cd66c2c438a3 | TravisNP/QLearningSnake | dependencies/state_action_space.h | #ifndef STATE_ACTION_SPACE_H
#define STATE_ACTION_SPACE_H
#include<boost/unordered/unordered_flat_map.hpp>
#include "custom_exceptions.h"
#include "direction_maps.h"
#include "custom_structs.h"
class StateActionSpace {
private:
// size of the board
int BOARD_SIZE;
// Initial qtable value... | ALGO | 0.956983 | 5.409262 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2024-08-03T12:46: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": "9e8c3708f... |
84c501e4-faa5-4bf4-aab9-877a6a876236 | AnkurAgarwal1989/Pramp_Questions | BracketMatch/Source.cpp | /*Bracket Match
A string of brackets is considered correctly matched if every opening bracket in the string can be paired up with a later closing bracket, and vice versa.For instance, “(())()” is correctly matched, whereas “)(“ and “((” aren’t.For instance, “((” could become correctly matched by adding two closing bra... | ALGO | 0.999091 | 5.869955 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2017-07-11T07:17:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f890f7c26b... |
fbdaf04b-c1f0-4187-abaf-86ae11cfda61 | iliyian/CompetitiveProgramming | ac.nowcoder.com/20231112_69304/J.cpp | #include <bits/stdc++.h>
#define N 1000005
using namespace std;
int arow[N], acol[N], n, m;
int dx[] = {-1, 0, 1, 0}, dy[] = {0, 1, 0, -1};
int a[N];
int change(int x, int y) {
return (x - 1) * m + y;
}
int main() {
freopen("J.in", "r", stdin);
ios::sync_with_stdio(false); cin.tie(0);
cin >> n >> m;
int q;... | ALGO | 0.999498 | 3.600235 | {
"github_metadata": {
"branch": "main",
"commit_count": 354,
"repo_created_at": "2024-04-21T10:50:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ce88fb7c4f... |
e2c994fa-2058-405d-90a2-7b32446937f4 | rkurdyumov/cracking_code | ch1_arrays_and_strings/q1_4_replace_spaces.cpp | /*
Write a method to replace all spaces in a string with '%20'. You may assume
that the string has sufficient space at the end of the string to hold the
additional characters, and that you are given the "true" length of the string.
*/
#include <iostream>
#include <string>
#include <algorithm> // std::count
// Solutio... | ALGO | 0.983456 | 5.847005 | {
"github_metadata": {
"branch": "master",
"commit_count": 22,
"repo_created_at": "2016-04-22T20:57: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": "3389f02fa... |
299d8c3e-4ecb-4cd0-b047-a60c7e2b6bc3 | Anetta123/OS | kp/src/A.cpp | #include <iostream>
#include <unistd.h>
#include <fcntl.h>
#include <semaphore.h>
using namespace std;
int quick_get(sem_t *semaphore){
int s;
sem_getvalue(semaphore, &s);
return s;
}
void quick_set(sem_t *semaphore, int n){
while (quick_get(semaphore) < n){
sem_post(sema... | TOOL | 0.995516 | 3.499283 | {
"github_metadata": {
"branch": "main",
"commit_count": 44,
"repo_created_at": "2021-12-28T23:25: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": "1ac885626aa... |
5f629540-1ea5-4572-b330-e99ef2ae766d | Karina-Hliebova/ALGO_LR_10_318_Hliebova | task1.cpp | #include <iostream> // підключення бібліотеки для введення/виведення
#include "task1.h" // підключення заголовкового файлу для першого завдання
using namespace std;
// функція перевірки правильності часу
int CheckTime(TTime T) {
// перевірка, чи значення годин, хвилин і секунд у межах допустимого діапазону
if ... | ALGO | 0.975027 | 3.855944 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2025-05-05T17:11: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": "95a30ec31838... |
5222a521-3fb0-48b5-abfa-774943fda0b8 | JimmyWang0417/Algorithm-Competitive-Codes | 洛谷/P2463 [SDOI2008]Sandy的卡片.cpp | #include <bits/stdc++.h>
#define lowbit(x) (x & (-x))
#define re register
#define ll long long
#define ull unsigned long long
#define rep(i, a, b) for (re int i = a; i <= b; ++i)
#define per(i, a, b) for (re int i = a; i >= b; --i)
template <typename T>
inline void read(T &x)
{
x = 0;
char s = (char)getchar();
... | ALGO | 0.999968 | 3.277716 | {
"github_metadata": {
"branch": "master",
"commit_count": 106,
"repo_created_at": "2019-08-30T06:36:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "265044f1... |
dd57d338-9efd-41b8-a333-5574c561fb5a | KMORaza/Data_Structures | Text Processing/Knuth_Morris_Pratt_Algorithm.cpp | #include <iostream>
#include <vector>
#include <string>
void computeLPS(const std::string& pattern, std::vector<int>& lps) {
int patternLength = static_cast<int>(pattern.length());
int len = 0;
lps[0] = 0;
for (int i = 1; i < patternLength; ) {
if (pattern[i] == pattern[len]) {
++le... | ALGO | 0.999917 | 6.532479 | {
"github_metadata": {
"branch": "main",
"commit_count": 233,
"repo_created_at": "2024-01-15T08:21: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": "89be1c3d9e... |
27da8564-403b-4718-acac-62d0df171a92 | solkerwjf/pybsp | src/runtime/BSPGlobalRequestLinearMapping.cpp | /*
* BSPGlobalRequestLinearMapping.cpp
*
* Created on: 2014-8-12
* Author: junfeng
*/
#include "BSPGlobalRequestLinearMapping.hpp"
#include <stdint.h>
using namespace BSP;
GlobalRequestLinearMapping::GlobalRequestLinearMapping(
ArrayPartition &partition, const unsigned numberOfVariables,
c... | TOOL | 0.970395 | 5.392302 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2015-08-25T08:39:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a8bf8f4545... |
a6e7d1d8-412e-4f34-9612-bae0f77e0b41 | Coding4Evers/CPIII | UVa10324.cpp | #include <iostream>
#include <cstring>
#include <cstdio>
#define DEBUG(x) cerr << #x << " = " << x << endl;
using namespace std;
const int N = 1e6 + 5;
string s;
int nxt[N];
int main() {
freopen("test.inp", "r", stdin);
int caseNo = 0;
while (cin >> s) {
int n, L, R;
memset(nxt, -1, sizeof(... | ALGO | 0.999948 | 3.180994 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2016-02-18T12:13:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "481781ba64... |
b433a491-f6c5-4643-88ae-32650de396d4 | sleepteacher/sleepteacher-s-PS-notenook | 피보나치_더하기.cpp | #include <bits/stdc++.h>
using namespace std;
unsigned long long fibo[1000];
int main() {
cin.tie(NULL);
cout.tie(NULL);
ios::sync_with_stdio(false);
int i, j, k, l, TC, fibo_size;
set<unsigned long long> V[4];
unsigned long long x;
// cout << V[0].size() << " " << V[1].size() << " " << V[2].size() << " " << ... | ALGO | 0.999921 | 4.374768 | {
"github_metadata": {
"branch": "main",
"commit_count": 35,
"repo_created_at": "2024-05-05T23:37: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": "a454bb49836... |
b216ad96-6a0c-4c27-bdbd-60d7a600d19a | ZoranPandovski/al-go-rithms | data_structures/Tree/c++/trie1.cpp | #include<iostream>
#include<cstring>
using namespace std;
/*
A Trie is a special form of a Nary tree. Typically, a trie is used to store strings.
Each Trie node represents a string (a prefix). Each node might have several children
nodes while the paths to different children nodes represent different characters. An... | ALGO | 0.999805 | 5.358406 | {
"github_metadata": {
"branch": "master",
"commit_count": 7457,
"repo_created_at": "2017-06-05T19:20:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1359,
"forks": 1929,
"issues": 20,
"pull_requests": 44
},
"file_meta": {
"content_id": ... |
31dc1f1b-c33c-4f6b-844a-a5685fac3ace | milkv-duo/duo-buildroot-sdk-v2 | tdl_sdk/modules/core/lane_detection/lane_detection.cpp | #include <memory.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <algorithm>
#include <map>
#include <memory>
#include <numeric>
#include <string>
#include <core/core/cvtdl_errno.h>
#include <error_msg.hpp>
#include "coco_utils.hpp"
#include "core/core/cvtdl_core_types.h"
#include "core/cvi_tdl_... | ALGO | 0.990301 | 5.754043 | {
"github_metadata": {
"branch": "develop",
"commit_count": 556,
"repo_created_at": "2024-06-21T02:00:55.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 86,
"forks": 72,
"issues": 33,
"pull_requests": 1
},
"file_meta": {
"content_id": "2f74e... |
6cfb14e5-d209-4802-a617-924ec1d916c6 | Jestefano/competitive-programming | week-7/solutions/SPOJ-WATER.cpp | #include<bits/stdc++.h>
using namespace std;
#define MAX 109
#define FOR(i,n,m) for(int i = (n);i<(m);i++)
#define REP(i,n) FOR(i,0,n)
#define pb push_back
#define fst first
#define snd second
#define mp make_pair
typedef pair<int,int> ii;
typedef long long ll;
int main(){
int tab[MAX][MAX], n, m, dp[MAX][MAX];
in... | ALGO | 0.999973 | 3.132627 | {
"github_metadata": {
"branch": "master",
"commit_count": 177,
"repo_created_at": "2019-02-05T21:26: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": "c54721eb... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.