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 |
|---|---|---|---|---|---|---|---|
9ae688a3-cd9e-4322-b422-2c81dfe81ca9 | saurabhyadavz/Sport-Programming | LEETCODE/Weekly contest 197/2.cpp | class Solution {
public:
int modInverse(int a, int m)
{
int m0 = m;
int y = 0, x = 1;
if (m == 1)
return 0;
while (a > 1)
{
// q is quotient
int q = a / m;
int t = m;
// m is remainder now, process same as
// Euclid's algo
m = a % m, a = t;
t =... | ALGO | 0.999987 | 4.91723 | {
"github_metadata": {
"branch": "master",
"commit_count": 106,
"repo_created_at": "2020-03-12T15:01:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f9ac3078... |
f6e052a2-848d-4ede-a98d-646675505ba4 | ico12319/LeetCode-Tasks | 785. Is Graph Bipartite?/main.cpp | #include <iostream>
#include <queue>
//785. Is Graph Bipartite?
//There is an undirected graph with n nodes, where each node is numbered between 0 and n - 1. You are given a 2D array graph, where graph[u] is an array of nodes that node u is adjacent to. More formally, for each v in graph[u], there is an undirected edg... | ALGO | 0.999824 | 6.050811 | {
"github_metadata": {
"branch": "main",
"commit_count": 424,
"repo_created_at": "2024-03-27T21:49:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bedc921b9b... |
9ee40e33-a9b1-46b0-815b-af9b3c0bcfa5 | luqmanarifin/cp | Penyisihan VOCOMFEST 2017/wire.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
const double eps = 1e-9;
double equal(double a, double b) {
return abs(a - b) < eps;
}
double cmp(double a, double b) {
return equal(a, b) || a < b;
}
int a[N], n, u, v;
bool can(long long t) {
if (u == v) return 1;
double slope = (doubl... | ALGO | 0.999818 | 5.361639 | {
"github_metadata": {
"branch": "master",
"commit_count": 772,
"repo_created_at": "2016-02-09T04:26:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "619cc454... |
71f293b9-3080-4870-bd70-189596ea5d74 | C0ldSmi1e/CompetitiveProgramming | Contests/CodeforcesEducationalCodeforcesRound159RatedforDiv.2/B_GettingPoints.cpp | /**
* Author: C0ldSmi1e
* Created Time: 2023-12-03 06:42:56
**/
// time-limit: 1000
// problem-url: https://codeforces.com/contest/1902/problem/B
#include <bits/stdc++.h>
using namespace std;
#ifdef DANIEL_DEBUG_TEMPLATE
#include "../debug.h"
#else
#define debug(...) 42
#endif
int main() {
cin.tie(nullptr)->syn... | ALGO | 0.999756 | 4.962564 | {
"github_metadata": {
"branch": "master",
"commit_count": 46,
"repo_created_at": "2021-12-04T15:25:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c44756cd8... |
41eff218-f630-4b1e-981c-c839685cc7a9 | Ewenwan/MVision | PCL_APP/Basic/Filtering/project_inliers_filter.cpp | /*
投影滤波 输出投影后的点的坐标
使用参数化模型投影点云
如何将点投影到一个参数化模型上(平面或者球体等),
参数化模型通过一组参数来设定,对于平面来说使用其等式形式。
在PCL中有特定存储常见模型系数的数据结构。
投影滤波类就是输入点云和投影模型,输出为投影到模型上之后的点云。
#include <pcl/ModelCoefficients.h> //模型系数头文件
#include <pcl/filters/project_inliers.h> //投影滤波类头文件
*/
#include <iostream>
#include <pcl/point_types.h>
//#include <pcl... | TOOL | 0.935779 | 5.847722 | {
"github_metadata": {
"branch": "master",
"commit_count": 3396,
"repo_created_at": "2017-09-24T06:25:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8384,
"forks": 2800,
"issues": 17,
"pull_requests": 2
},
"file_meta": {
"content_id": "... |
39f28e5f-614e-4a9c-9af9-3fef71ec7fd1 | lsst-dm/legacy-coadd_kaiser | src/CoaddComponent.cc | // -*- LSST-C++ -*-
/*
* LSST Data Management System
* Copyright 2008, 2009, 2010 LSST Corporation.
*
* This product includes software developed by the
* LSST Project (http://www.lsst.org/).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Publi... | TOOL | 0.90094 | 7.003203 | {
"github_metadata": {
"branch": "main",
"commit_count": 41,
"repo_created_at": "2014-08-16T07:39:35.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4567a73e8ac6... |
c8222d4a-7891-43aa-bad7-bea6bb9df610 | wind5293/testabc | Exercise_week_5/equalStack.cpp | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int equalStacks(vector<int> h1, vector<int> h2, vector<int> h3) {
int sum1 = 0;
int sum2 = 0;
int sum3 = 0;
for (int i = 0; i < h1.size(); i++) {
sum1 += h1[i];
}
for (int ... | ALGO | 0.99994 | 4.461143 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-10-11T14:43:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "51336f72e8ac... |
e335ab0b-c09c-4ccf-9e18-801ec5e4793e | wendajiang/leetcode | cpp/1658.minimum-operations-to-reduce-x-to-zero.cpp | /*
* @lc app=leetcode id=1658 lang=cpp
*
* [1658] Minimum Operations to Reduce X to Zero
*
* https://leetcode.com/problems/minimum-operations-to-reduce-x-to-zero/description/
*
* algorithms
* Medium (29.82%)
* Likes: 244
* Dislikes: 4
* Total Accepted: 6.8K
* Total Submissions: 22.8K
* Testcase Examp... | ALGO | 0.999992 | 5.857653 | {
"github_metadata": {
"branch": "master",
"commit_count": 510,
"repo_created_at": "2017-07-02T16:19: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": "14447820... |
22b1f6af-2671-4987-a764-c1f5321bb8ab | manavdewan02/linked-list-assignment | delete all odd nodes.cpp | //function to delete all odd nodes from circular linked list
void deleteOddNodes() {
// only head
if(head != NULL && head->next == head) {
free(head);
head = NULL;
}
else if(head != NULL) {
//more than one element
Node* temp = head;
while(temp->next != head) {
temp = temp->next;
}
... | ALGO | 0.991752 | 3.492986 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2022-06-04T10:31: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": "c4459f0ca492... |
ad834766-c000-440f-a713-08d31a044093 | mahmoudbadawy5/CompetitiveProgramming | codeforces/CF799-D12-E.cpp | /*
Deciding how many common decoratins will they need decides the rest. We can try all possible. The rest is implementation details. I debugged for a long time to consider corner cases. The idea is easy but the implemntation was a nightmare for me.
*/
#include <bits/stdc++.h>
using namespace std;
const int N=2e5+5;
... | ALGO | 0.999984 | 3.396462 | {
"github_metadata": {
"branch": "master",
"commit_count": 96,
"repo_created_at": "2019-12-07T19:32: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": "af4bb9dcb... |
2a8c0466-c3c8-48d8-9e82-ca2b2600deb9 | jiniljeil/BOJ_Problem | Floyd Warshall/11404.cpp | #include <iostream>
#include <climits>
#define INF INT_MAX
#define MAX 101
using namespace std ;
int n, m ;
long long a, b, c ;
long long DIST[MAX][MAX] ;
void Init() {
for (int i = 0 ; i < n ; i++) {
for (int j = 0 ; j < n ;j++) {
DIST[i][j] = INF ;
}
DIST[i][i] = 0 ... | ALGO | 0.999991 | 4.157693 | {
"github_metadata": {
"branch": "master",
"commit_count": 194,
"repo_created_at": "2020-08-06T10:45: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": "598743cd... |
3807013f-35d5-4a01-9e6d-198d168b1f1a | qclijun/LeetCode | src/p120.cc | /*
* p120.cc
*
* Created on: 2018年10月3日
* Author: jun
*/
/**
* 120. Triangle
*
* Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.
For example, given the following triangle
[
[2],
[3,4],
[6,5,7],
[4,1,8,3]
]
The mi... | ALGO | 0.999882 | 6.216589 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2018-09-13T12:32: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": "db1f20bd2d... |
b4a6b837-14e9-4a76-9806-1bb81be60c18 | Shenyii/my_navigation | include/opt_quintic_curve.h | #ifndef OPT_QUINTIC_CURVE_H
#define OPT_QUINTIC_CURVE_H
#include <iostream>
#include <ros/ros.h>
#include <sensor_msgs/PointCloud.h>
#include <Eigen/Dense>
#include "osqp.h"
#define PI 3.14159265
using namespace std;
using namespace Eigen;
class MyPath {
public:
vector<double> x_;
vector<double> y_;
ve... | ALGO | 0.999514 | 4.701016 | {
"github_metadata": {
"branch": "master",
"commit_count": 46,
"repo_created_at": "2020-07-10T11:51:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 10,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "05dad535... |
e49370cf-87dd-4a68-b0e3-065839ed38c7 | FelipeSulser/AlgorithmsLab-ETH | week7/portfolios/portfoliosv2.cpp | #include <iostream>
#include <cassert>
#include <CGAL/basic.h>
#include <CGAL/QP_models.h>
#include <CGAL/QP_functions.h>
#include <CGAL/Gmpzf.h>
#include <vector>
using namespace std;
// choose exact floating-point type
typedef CGAL::Gmpzf ET;
// program and solution types
typedef CGAL::Quadratic_program<double> P... | ALGO | 0.99963 | 3.729911 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2017-02-08T11:20:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0cefc86b7c... |
6481a023-8749-4a85-be78-13d4ff0d5cfb | Dai0526/Algorithm | Algorithm/OnlineAssessment/LeetCode/Medium/156_binaryTreeUpsidedown.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999995 | 6.51307 | {
"github_metadata": {
"branch": "master",
"commit_count": 515,
"repo_created_at": "2020-06-13T04:23:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9f232bed... |
38405963-8b3a-4b38-8f27-e1f064756235 | Gemy33/DS-course | single linked list 1 .cpp | #include <bits/stdc++.h>
using namespace std;
struct Node
{
int data=0;
Node* next=nullptr;
Node(int data):data(data){}
};
class liked_list
{
private:
Node* head=nullptr;
Node* tail=nullptr;
int lenght=0;
public:
void print()
{
for(Node* cur=head;cur!=nullptr;cur=cur->next)
... | ALGO | 0.999578 | 4.317678 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-02-10T10:02: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": "81f588d99419... |
2a478935-90d9-444c-8819-763f28d67435 | TacoBoss458/wwcc-cpp | week7/assignment1-shape_calculator.cpp | #include <iostream>
#include <cmath>
using namespace std;
class Rectangle {
private:
double length;
double width;
public:
Rectangle(double l, double w);
double getLength() const;
double getWidth() const;
double area() const;
void area(double& result) const;
Rectangle&... | TOOL | 0.970839 | 5.430071 | {
"github_metadata": {
"branch": "main",
"commit_count": 80,
"repo_created_at": "2025-04-10T03:27: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": "66837ccbe3b... |
bf3423dd-affa-42a4-9429-e4baf3499291 | sethbrin/leetcode | construct_binary_tree_from_preorder_and_inorder_traversal.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
typedef vector<int>::iterator IntIterator;
TreeNode* buildTree(vector<int>& preorder, vector<int>& ... | ALGO | 0.999994 | 6.520874 | {
"github_metadata": {
"branch": "master",
"commit_count": 138,
"repo_created_at": "2016-02-22T12:22: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": "5307f6a1... |
0c6b7736-da3e-4167-bfaa-163c9ff738cc | rushendra471/MissionRnD-C-Strings-Worksheet | src/NumbertoStr.cpp | /*
OVERVIEW: Given a float number ,Convert it into a string
INPUTS: A Float,Final string ,How many digits after decimal has to be displayed .
Its zero for integers.
OUTPUT: No need to output anything ,Modify the str in function parameter such that it
now holds the string format of the float number specified
Exampl... | ALGO | 0.911941 | 3.358513 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2015-11-23T13:49:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "79a78f0ae... |
471bade8-1135-4d86-82a7-de392dbf53e9 | duckhanson/nthu-oj-problem | 12742-guess-gender/function.h | #ifndef FUNCTION_H
#define FUNCTION_H
class Vertex {
// class Graph can access the private data of Vertex
friend class Graph;
private:
int index;
Vertex *nextVertex;
public:
Vertex(int index = 0) {
this->index = index;
this->nextVertex = nullptr;
}
};
/*
* There are 2 way to save the graph in data structur... | ALGO | 0.999644 | 5.330922 | {
"github_metadata": {
"branch": "master",
"commit_count": 37,
"repo_created_at": "2020-03-07T08:13: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": "6ca55e2ad... |
b1b95434-f273-4092-b548-14f4e15328aa | sachuverma/DataStructures-Algorithms | Leetcode Top Interview Questions/solutions/Intersection of Two Arrays II.cpp | /*
Intersection of Two Arrays II
=============================
Given two arrays, write a function to compute their intersection.
Example 1:
Input: nums1 = [1,2,2,1], nums2 = [2,2]
Output: [2,2]
Example 2:
Inpt: nums1 = [4,9,5], nums2 = [9,4,9,8,4]
Output: [4,9]
Note:
Each element in the result should appear as many... | ALGO | 0.999974 | 6.383327 | {
"github_metadata": {
"branch": "master",
"commit_count": 1430,
"repo_created_at": "2020-10-07T10:08:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2049,
"forks": 541,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "e0... |
bec0ae02-c795-4764-ac88-bd57b73171f9 | varshney565/My-LeetCode-Submissions | 0130-surrounded-regions/0130-surrounded-regions.cpp | class Solution {
public:
void solve(vector<vector<char>>& board) {
int n = board.size();
int m = board[0].size();
//direction array
int dir[][2] = {{1,0},{-1,0},{0,1},{0,-1}};
//making dfs call
function<void(int,int)> dfs = [&](int x,int y){
board... | ALGO | 0.999665 | 6.508855 | {
"github_metadata": {
"branch": "main",
"commit_count": 1181,
"repo_created_at": "2022-08-06T12:17:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5511c5614... |
c8cdeb27-cdfb-447c-9789-7a3324e4c0c1 | SyGame-Engine-Team/SyGame-Engine | Scarab-Engine/Source/Lib/Math/Geometry/Surfaces/SurfaceLibrary/NURBSSurface.inl | /////////////////////////////////////////////////////////////////////////////////
// File : Lib/Math/Geometry/Surfaces/SurfaceLibrary/NURBSSurface.inl
/////////////////////////////////////////////////////////////////////////////////
// Version : 1.0a
// Began Code : 29/05/2010
// Status : Alpha
// Portability : Any
///... | ALGO | 0.946933 | 5.753137 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2015-09-29T19:53:46.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 4,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c977c179121... |
2cc960ff-0cbe-44e0-822f-55d70cb4f394 | Tusharsd123/gfg-solutions | Binary-Tree/diamter-of-binary-tree.cpp | //* the diameter of T’s left subtree
//* the diameter of T’s right subtree
//* the longest path between leaves that goes through the root of T (this can be computed from the heights of the subtrees of T)
//T.C - O(n^2)
int height(struct Node* node);
int max(int a, int b)
{
return (a >= b)? a: b;
}
int di... | ALGO | 0.999956 | 5.094077 | {
"github_metadata": {
"branch": "master",
"commit_count": 128,
"repo_created_at": "2020-06-07T18:28:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4933230f... |
89c6a494-67b9-4099-bca4-70f84bb9ec65 | darrenleeleelee1/PCB-ADR-Routing | inc/basic_ds.hpp | #include "component_data.hpp"
#include <algorithm>
#include <cmath>
#include <queue>
#include <string>
#include <unordered_map>
#include <vector>
class UnionFind
{
private:
std::unordered_map<Component *, Component *> parent;
public:
Component *find(Component *c)
{
if (parent.find(c) == parent.end(... | ALGO | 0.995409 | 5.50316 | {
"github_metadata": {
"branch": "main",
"commit_count": 53,
"repo_created_at": "2023-10-17T07:03: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": "e4fd63e229d... |
13d9cc4f-232c-410a-addb-f3cec0a139a5 | rezaulhsagar/KUET_Thundercloud | SCC_Kosaraju.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long int lli;
#define FILE_IN freopen("in.txt","r",stdin);
#define FILE_OUT freopen("out.txt","w",stdout);
#define FILE_IO FILE_IN;FILE_OUT;
#define FAST_IO ios::sync_with_stdio(false);cin.tie(NULL);
vector <lli> adj_list[100000 + 10];
vector <lli> adj_list_... | ALGO | 0.999974 | 3.435554 | {
"github_metadata": {
"branch": "master",
"commit_count": 113,
"repo_created_at": "2018-08-02T14:19:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d1db130f... |
328eb818-14fc-43a5-8779-3ef71f8aafe7 | Wanna-Get-High/M3DS | tp/winged/src/main/WVertex.cpp | #include "WVertex.h"
#include "Error.h"
#include "UtilGL.h"
/**
@file
@author <NAME>
@brief Winged-Edges : opérations sur les sommets
*/
using namespace prog3d;
using namespace std;
/** ************************************************************************************
** A COMPLETER : WVertex::computeNormal(... | ALGO | 0.982192 | 4.622231 | {
"github_metadata": {
"branch": "master",
"commit_count": 67,
"repo_created_at": "2013-01-23T07:28:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 2,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "841952b1e... |
80dd6060-409f-4ece-a7f7-ca34abc52c9c | ck89119/Algorithm | Template/heap.cpp | /*
ID: ck89119
PROG:
LANG: C++
*/
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <string>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <fstream>
#include <iostre... | ALGO | 0.999875 | 3.082266 | {
"github_metadata": {
"branch": "master",
"commit_count": 58,
"repo_created_at": "2015-01-30T05:58:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c16646394... |
88bf8e73-2e48-42dd-8be9-8f0de780107a | Aniket965/Hello-world | C++/tic.cpp | /* run this program using the console pauser or add your own getch, system("pause") or input loop */
#include <iostream>
using namespace std;
char square[10] = {'o','1','2','3','4','5','6','7','8','9'};
int checkwin();
void board();
int main()
{
int player = 1,i,choice;
char mark;
do
{
board();
player=(pla... | ALGO | 0.996637 | 3.612144 | {
"github_metadata": {
"branch": "master",
"commit_count": 8808,
"repo_created_at": "2018-10-03T15:00:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1447,
"forks": 2826,
"issues": 4,
"pull_requests": 17
},
"file_meta": {
"content_id": "... |
19232fcc-7f97-479a-844c-1aa21990b74f | niessner/VoxelHashing | DepthSensing/Source/GlobalCameraTrackingState.cpp | #include "stdafx.h"
#include "GlobalCameraTrackingState.h"
#include "stdafx.h"
// Five level hierarchy
/*unsigned int GlobalCameraTrackingState::s_blockSizeNormalize[GlobalCameraTrackingState::s_maxLevels] = {512, 256, 128, 64, 32};
unsigned int GlobalCameraTrackingState::s_numBucketsNormalize[GlobalCameraTrackingS... | CONFIG | 0.993309 | 3.556432 | {
"github_metadata": {
"branch": "master",
"commit_count": 56,
"repo_created_at": "2014-06-08T23:29:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 694,
"forks": 203,
"issues": 12,
"pull_requests": 1
},
"file_meta": {
"content_id": "b601... |
67e03587-b06a-479d-be36-d1b523765ed0 | nampluskr/coding_test | solved_old/180210_복합화합물/solution_manual_3.cpp | #if 1
// [TC = 50] Manual 2524 ms / STL 2628 ms / Brue force 160,544 ms
#ifndef _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_WARNINGS
#endif
#include <string.h>
#define NUM_COMPOUNDS (5000)
struct INFO {
char first[11];
char second[11];
char third[11];
char fourth[11];
char fifth[11];
};
ext... | ALGO | 0.99816 | 3.138426 | {
"github_metadata": {
"branch": "main",
"commit_count": 365,
"repo_created_at": "2023-07-31T12:11: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": "404ce45428... |
00c23ebf-51f0-4145-b769-4fdf4a2e396e | gzhwanghub/ICSA-SHU | 2D-THA-ADMM/src/sync_admm.cpp | /*****************************************************************************************
> File Name: sycn_admm.cpp
> Author: <NAME>
> Date: 2021-7-16
> Function:Primal ADMM,Using MPI_ALLREDUCE or 2D-Torus, Ring AllReduce, 2D-THA, Hierarchical AllReduce聚合w.
*******************************************... | ALGO | 0.999108 | 4.51236 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2024-02-19T07:50: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": "cefe5b6dc0dc... |
22656422-9651-4c49-8ad4-22e8287e9b3f | theashwinabraham/CS293-213-Resources | Lab10/printJourney.cpp | /*
* IMPLEMENTED BY: <NAME>
*/
#ifndef PRINT_JOURNEY_CPP
#define PRINT_JOURNEY_CPP
#ifndef STD_HEADERS_H
#include "std_headers.h"
#endif
#include "planner.h"
#include "dictionary.h"
using namespace std;
struct InfoStr
{
int JourneyCode;
std::string start;
std::string end;
int dep_time;
int ar... | ALGO | 0.988322 | 4.767724 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2022-12-11T04:30:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "23c9c776e1... |
41aaf497-3feb-4cbb-9e86-d33ae246a086 | qq734628996/ac-code | POJ/2018/19210299_AC_79ms_1620kB.cpp | //#include <bits/stdc++.h>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <cmath>
#include <ctime>
#include <cassert>
#include <iostream>
#include <algorithm>
//#include <unordered_map>
//#include <unordered_set>
#include <sstream>
#include <utility>
#include <string>
#include <vec... | ALGO | 0.999822 | 3.208289 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2019-05-23T08:33:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "76882a8f70... |
1b1caacc-2557-4b0a-9fdd-e912b225d56d | hjchoe/compFinal | src/main.cpp | /*----------------------------------------------------------------------------*/
/* */
/* Module: main.cpp */
/* Author: VEX ... | TOOL | 0.954966 | 5.199559 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2021-10-05T10:13:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7d288489efc1... |
bf910bf0-938d-48a9-959d-703d7916b8bb | mdshakib007/XPSC-4 | Week-19(SZ)/Day-8/Binary_Simulation.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 1e5 + 5;
ll t[4 * N], lazy[4 * N];
void push(int n, int b, int e)
{
if (lazy[n] == 0)
return;
t[n] = (e - b + 1) - t[n];
if (b != e)
{
int l = 2 * n, r = 2 * n + 1;
lazy[l] ^= lazy[n];
l... | ALGO | 0.999328 | 4.477654 | {
"github_metadata": {
"branch": "main",
"commit_count": 134,
"repo_created_at": "2024-03-16T15:07: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": "799d83ae81... |
50fbaf01-1431-4d80-8210-5284f5df2c91 | Sameer12223044/DSA | money.cpp | #include<iostream>
using namespace std;
int main(){
int amount;
cout << "Enter the amount: " << endl;
cin >> amount;
int Rs100, Rs50, Rs20, Rs1;
int counter = 0;
switch (counter) {
case 0:
Rs100 = amount / 100;
amount = amount % 100;
cout <<... | ALGO | 0.985297 | 3.581682 | {
"github_metadata": {
"branch": "main",
"commit_count": 58,
"repo_created_at": "2025-03-10T04:44: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": "c4019dc12d1... |
80fddc20-d729-47d0-a822-90b41388b717 | it-dieuanh/CompetitiveProgramming_bydieuanh | daycontrungvi.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
int n, res = 0;
signed main() {
ios_base::sync_with_stdio(0); cin.tie(NULL);
cin >> n;
vector<int> a(n), preequal(n + 1, 0), presmall(n + 1, 0);
for (int i = 0; i < n; i++) cin >> a[i];
vector<int> sorted_a = a;
sort(sorted_a.begi... | ALGO | 0.999889 | 3.997561 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-02-18T14:20: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": "3649312babcd... |
b530515a-d808-4ea7-8278-620abbc5c996 | lizy14/data-structure-assignments | tree/problem6_60.cpp | /*
文件名:
描 述: 数据结构习题6.60:统计孩子-兄弟链表存储的树T中叶子的个数
作 者: 李肇阳, 清华大学软件学院, <EMAIL>
创建于: 2015-11-13
环 境: Visual Studio 2012 (MSVC++ 11.0)
*/
#ifndef _DEBUG
#define nullptr NULL
#endif
#include <iostream>
#include <vector>
using namespace std;
struct Edge{
int a, b;
Edge(int a_, int b_){a = a_, b = b_;}
};
typedef vec... | ALGO | 0.99955 | 3.81109 | {
"github_metadata": {
"branch": "master",
"commit_count": 71,
"repo_created_at": "2015-11-11T14:33: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": "3c724e59b... |
1bd929b5-45b7-40d5-ab8b-0f164f66eeff | alps-jbnu/23ALPStudy | 2023-1/Basic/JinHaeun/Tree/1240.cpp | #include <iostream>
#include <vector>
#include <queue>
using namespace std;
int N, M, u, v, d;
vector<pair<int, int>> adj[100001];
int dist[1003] = { 0, };
int bfs(int s, int e) {
int sum = 0;
fill(dist, dist + 1003, -1);
queue<int> q;
q.push(s);
dist[s] = 0;
while (!q.empty()) {
int cur = q.front();
q.pop(... | ALGO | 0.999989 | 4.798552 | {
"github_metadata": {
"branch": "main",
"commit_count": 2930,
"repo_created_at": "2023-02-03T06:11:26.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 12,
"forks": 59,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "035f4c7c... |
034e5f32-75d5-451c-96b5-72079e602616 | oxen-io/oxen-core | src/rpc/http_client.cpp | #include "http_client.h"
#include <cpr/cpr.h>
#include <cpr/ssl_options.h>
#include <chrono>
#include <nlohmann/json.hpp>
#include <regex>
#include "common/string_util.h"
#include "logging/oxen_logger.h"
namespace cryptonote::rpc {
static auto logcat = log::Cat("rpc.http_client");
http_client_connect_error::http_... | WEB | 0.921663 | 7.842265 | {
"github_metadata": {
"branch": "dev",
"commit_count": 15375,
"repo_created_at": "2018-01-15T22:50:09.000Z",
"is_fork": true,
"is_org_owned": true,
"forked_from": "monero-project/monero",
"stars": 328,
"forks": 129,
"issues": 112,
"pull_requests": 9
},
"file_meta": {
"... |
b3074114-f262-433c-b109-66af7db98bb6 | zebra6/polecat | algorithms/21_anagram_list.cpp | /*
Given a list of strings, return a list of lists of strings that groups all
anagrams.
Ex. given {trees, bike, cars, steer, arcs} return { {cars, arcs}, {bike},
{trees, steer} }
m = # of words n = length of longest word
I solved this in O(m * n * log n) time.
*/
#include <stdio.h> #include ... | ALGO | 0.999784 | 5.216327 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2014-09-27T18:09:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "84c480ffa... |
24009435-153c-412e-bb89-1070826cced4 | mrmohim/All-OJ-Contest-Problem-Solution | CodeChef/CB2/CB1.cpp | /* ===================================*/
/* Author : <NAME> */
/* Email : <EMAIL> */
/* Institute: HSTU */
/* ===================================*/
#include <cstdio>
#include <iostream>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <cctype>
#include <algorithm>
#includ... | ALGO | 0.999961 | 3.863998 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2018-12-02T10:47:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "be40c95ff... |
a00f5486-f77e-4680-aae8-97e5f7e1de8f | henrywoo/PricingEngine | BSMCBarrier.cpp | #include "DAOC.h"
Real BSMCBarrier(){
try
{
Barrier::Type barrierType(Barrier::DownOut);
Option::Type optionType(Option::Call);
Date todaysDate(2, Apr, 2010);
Date settlementDate = todaysDate;
Date maturityDate = settlementDate;
maturityDate += 2 * Months;
maturityDate += 12 * Days;
... | ALGO | 0.971249 | 5.297654 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2014-10-19T08:21: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": "e67d502332... |
2dd7ac52-7dc5-4938-8742-515b8b03afa7 | wilebeast/FireFox-OS | B2G/gecko/tools/profiler/shared-libraries.h | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 et cindent: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.... | TOOL | 0.962261 | 6.808495 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2013-09-03T19:02:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e798d4f99... |
c0994a72-23b5-4644-a6c0-4028ac7b20d3 | ngueveu/shuttles-and-robots-challenge-for-students | celluleflexible/ros_ws/src/commande/src/main_commande.cpp | /*########################################################################
## ______ _____ ___ __ __ ___ ______ ##
## /_ __/__ ____ _____ ___ / ___// | / / / / / | / ____/ ##
## / / / _ \/ __ `/ __ `__ \ \__ \/ /| | / / / / / /| |/ / __ ##
## / / / __/ /_/ / ... | TOOL | 0.908708 | 3.148216 | {
"github_metadata": {
"branch": "main",
"commit_count": 97,
"repo_created_at": "2022-10-16T21:41:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4b7f95b7b70... |
6f5a9ec2-5ccf-4721-97ca-cce66905927c | raincross7/code-similarity | codes/train_code/problem268/problem268_352.cpp | #include <iostream>
#include <bitset>
#include <vector>
#include <string>
#include <algorithm>
#include <set>
#include <map>
#include <cmath>
#include <regex>
#include <iomanip>
#include <climits>
#include <utility>
#include <queue>
using namespace std;
using ll = long long int;
using dd = long double;
const ll MOD = 1... | ALGO | 0.999963 | 3.719327 | {
"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": "d6ad957e4baa... |
691ea50b-bc97-43c7-81e0-0911e6d58fe6 | phankl/llm | main.cpp | #include <string>
#include <vector>
#include "solver.h"
int main() {
// physical and mathematical constants
double pi = 3.14159265359;
double h = 6.62607004e-34;
double e = 1.60217662e-19;
double vF = 8.0e5;
double g = 0.25;
// variables
// grid
int nGrid = 100;
double xMax = 100.0e-6;
//... | ALGO | 0.999836 | 4.98296 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2022-01-19T16:02:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "59e6aa211273... |
556609fc-bbd9-4cde-8714-ea31c56edbc4 | cuicunze1/SwordToOffer | 面试题7:重建二叉树/面试题7:重建二叉树.cpp | #include<cstdio>
#include<exception>
#include"binary_tree.h"
BinaryTreeNode* ConstructCore(int* startPreorder, int* endPreorder, int* startInorder, int* endInorder);
BinaryTreeNode* Construct(int* preorder, int* inorder, int length) {
if (preorder == nullptr || inorder == nullptr || length <= 0)
return nullptr;
re... | ALGO | 0.996816 | 4.976868 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2018-03-06T13:50: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": "c933f80d2... |
a84c677d-2631-4a61-8d2a-f2431d3beaab | Overial/TridiagonalMatrixAlgorithm | TridiagonalMatrixAlgorithm/TridiagonalMatrixAlgorithm.cpp | // IDB-19-07
// <NAME>
// Tridiagonal matrix algorithm
#include <iostream>
#include <iomanip>
#include <vector>
void alloc_matr(float**& matr, int iRowCount, int iColCount) {
// Rows
matr = new float* [iRowCount];
// Columns
for (int i = 0; i < iRowCount; ++i) {
matr[i] = new float[iColCount];
}
}
void del_ma... | ALGO | 0.998318 | 4.262454 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2021-03-22T20:50:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3192fb0e1ded... |
213cd175-5ee8-4167-80aa-79d770bfa58c | lixingtao/leetcode | Course Schedule/main.cpp | #include <vector>
#include <map>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <algorithm>
#include <iostream>
using namespace std;
const int maxn = 10010;
const int maxe = 100010;
int first[maxn];
int U[maxe], V[maxe], next[maxe];
int edge = 0;
int visited[maxn];
void addE(int x, int y) {
U... | ALGO | 0.999574 | 4.147267 | {
"github_metadata": {
"branch": "master",
"commit_count": 49,
"repo_created_at": "2015-03-06T01:49:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "833adcdb4... |
59c01529-efd4-4f7a-9548-d16bba83277c | foreverlms/slam14 | project/vo_map/src/visual_odometry.cpp | #include <myslam/common_include.h>
#include <myslam/frame.h>
#include <myslam/map.h>
#include <myslam/visual_odometry.h>
#include <myslam/config.h>
#include <algorithm>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/calib3d/calib3d.hpp>
#include <myslam/g2o_types.h>
#in... | ALGO | 0.990642 | 5.919633 | {
"github_metadata": {
"branch": "master",
"commit_count": 43,
"repo_created_at": "2019-03-07T03:04:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 3,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "0d4356277... |
3ba29a9c-c5fd-4317-a5b4-e60759432101 | Nudlas/min-finder | min_finder.cpp | #include <iostream>
#include <cstdlib>
#include <ctime>
#include <thread>
#include <algorithm>
#include <vector>
using namespace std;
#define ARRAY_SIZE 20
// Function to find minimum in a range of the array
int findMinInRange(const vector<int>& arr, int start, int end) {
int min_val = arr[start];
for(int i ... | ALGO | 0.999979 | 6.514694 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-02-24T02: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": "ef03fb0d1218... |
d248b744-b060-47ca-ac75-3a3f499030ee | Tr0ph1c/Chess-Time | src/AI.cpp | #include <iostream>
#include "AI.hpp"
AI::AI (Board* _board) {
board = _board;
}
Move AI::CalculateMove () {
SizeArray legal_moves;
chosen_move = 0;
board->GetAllMoves(&legal_moves);
if (legal_moves.Empty()) {
printf("%s\n", board->IsInCheck()? "You won!" : "Draw by stalemate.");
... | ALGO | 0.996884 | 5.443851 | {
"github_metadata": {
"branch": "main",
"commit_count": 110,
"repo_created_at": "2024-11-01T14:58:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "43120d0bf7... |
e78b520c-bd96-4f29-a302-d9be7a77cda4 | gyuilLim/DataStructures_Univ | HW02/hw02_palindrome.h | // 20192927 임규일
#pragma once
#include <iostream>
#include <string>
using namespace std;
int findDigits(int number);
int reverseDigits(int number, int number2 = 0);
bool isPalindromeInt(int number);
string reverseString(string str);
bool isPalindromeString(string str);
int findDigits(int number){
int n = 1;
wh... | ALGO | 0.998146 | 4.487317 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2020-05-14T12:35: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": "c527d4c711... |
d86eb97b-53d7-47e6-843b-f87466e987d3 | derbess/Algorithms-and-Data-Structures-2018 | vJudge/NurlashKO_solution/C.cpp | //Solution by NurlashKO
#include <iostream>
#include <cstdio>
#include <queue>
using namespace std;
void solve(int test_case) {
int len, l, m, ans = 0;
string side;
queue<int> queueL, queueR;
cin >> l >> m;
l *= 100;
for (int i = 1; i <= m; i++) {
cin >> len >> side;
if (side ... | ALGO | 0.999796 | 3.258947 | {
"github_metadata": {
"branch": "master",
"commit_count": 63,
"repo_created_at": "2018-10-14T19:08:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "779e26e00... |
a075b444-1a0a-4aaf-ac3f-dadcd28b68fe | caoahn/CodePTIT-DSA | cu phai thu da.cpp | #include<bits/stdc++.h>
using namespace std ;
int n,k ;
int a[1001] ;
int ok = 1 ;
int b[1001] ;
vector<string> v ;
void Try(int i,int pos,string res) {
if(pos > k) return ;
if(pos == k) {
res.pop_back() ;
v.push_back(res) ;
res = "" ;
return ;
}
for(int j=i+1; j<= n ... | ALGO | 0.999951 | 4.316651 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-08-23T13:43: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": "99e7f4c6e10a... |
d7898b58-b904-4c30-b20a-af575b5a1969 | jojohello/KDTree | KDTree/KDTreeMain.cpp | // KDTree.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <stdio.h>
#include <conio.h>
#include <cstdlib>
#include <vector>
#include "EosKDTree.h"
std::vector<EosMistLineSegment> createLines(float l, float r, float b, float t, int count);
void testFindMidPoint(float l, float... | ALGO | 0.983004 | 3.203613 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2016-11-25T06:45:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d7175d310a... |
cabb66a2-50d3-406a-9b20-8e12c1cf8e70 | VDprog/labs.op | lab3/assignment_1.3.cpp | #include <iostream>
#include <string>
#include <math.h>
#include "stack_array.h"
using namespace std;
int getPriority(char c)
{
switch(c)
{
case '(':
return 0;
case '+':
return 1;
case '-':
return 1;
case ')':
return 1;
case '*':
return 2;
case '/':
return 2;
case '@':
return 2;
... | ALGO | 0.999531 | 4.008428 | {
"github_metadata": {
"branch": "master",
"commit_count": 25,
"repo_created_at": "2019-04-08T11:10: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": "f3be2fb80... |
9b36e2b2-eac5-49da-8439-e846b55bc064 | gerac83/ug_bluerobot | clopema_testbed/segmentation/src/SegmentationGMMGrabCut.cpp | #include <segmentation/SegmentationGMMGrabCut.h>
#include <boost/foreach.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <iostream>
#include <fstream>
#include <boost/archive/binary_iarchive.hpp>
#include <boost/archive/binary_oarchive.hpp>
void SegmentationGMMGrabCut::set_strategy(const int strategy) {
if(st... | ALGO | 0.984373 | 5.733344 | {
"github_metadata": {
"branch": "master",
"commit_count": 33,
"repo_created_at": "2017-07-05T11:14:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "eff796d56... |
b157ac2e-8cd2-411b-bd90-0d3a809df102 | alexandraback/datacollection | solutions_5631572862566400_1/C++/qwertier/C_2.cpp | #include<stdio.h>
#include<algorithm>
#include<string.h>
#include<map>
#include<set>
#include<vector>
#include<string>
#define REP(i,n) for(int i=0; i<n; i++)
#define FOR(i,n) for(int i=1; i<=n; i++)
typedef long long LL;
using namespace std;
typedef pair<int,int> pii;
#define MP make_pair
#define N 1010
int f[N],n;... | ALGO | 0.999936 | 4.026667 | {
"github_metadata": {
"branch": "master",
"commit_count": 58,
"repo_created_at": "2017-03-08T11:33:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "32b1ed47e... |
bf0c948b-99a4-4fc3-bfc7-c1aa286a40eb | Nattyu3/tessoku | chap4/B17.cpp | #include <bits/extc++.h>
#include <atcoder/all>
#define repp(i,m,n) for(int i=(int)m;i<(int)n;i++)
#define rep(i,n) repp(i,0,n)
#define fore(x,a) for (auto &x:a)
#define rall(x) (x).rbegin(),(x).rend()
#define all(x) (x).begin(),(x).end()
#define vi vector<int>
#define ll long long
using namespace atcoder;
using namesp... | ALGO | 0.99998 | 3.935501 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2024-04-05T03:59: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": "5437f59c57b... |
eabaee68-9b2a-424c-8503-5cc17ae44c4c | wavefunction91/GauXC | src/load_balancer/rebalance.cxx | /**
* GauXC Copyright (c) 2020-2024, The Regents of the University of California,
* through Lawrence Berkeley National Laboratory (subject to receipt of
* any required approvals from the U.S. Dept. of Energy). All rights reserved.
*
* See LICENSE.txt for details
*/
#include "load_balancer_impl.hpp"
#include <gaux... | ALGO | 0.998369 | 5.655552 | {
"github_metadata": {
"branch": "master",
"commit_count": 924,
"repo_created_at": "2020-07-23T19:10:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 36,
"forks": 24,
"issues": 27,
"pull_requests": 4
},
"file_meta": {
"content_id": "b084c... |
4a6872dd-a386-43cb-8056-af1e2a2a3aeb | Joselsneto/Codeforces-Solutions | 237a.cpp | ///<NAME>
///Computer Engineering - Federal University of Itajubá
#include <bits/stdc++.h>
using namespace std;
#define INF 0x3F3F3F3F
#define LINF 0x3F3F3F3F3F3F3F3FLL
#define pb push_back
#define mp make_pair
#define F first
#define S second
typedef pair <int,int> pii;
typedef vector <int> vi;
typedef vector < ... | ALGO | 0.999156 | 3.103422 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2017-04-27T22:30: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": "7a2ef82ad3... |
a358bc8a-3c5d-48e8-a29c-9699a3836287 | ekamnitc/LLMs-for-CT | CPP-Programs/s819483766.cpp | #include <iostream>
#include <string>
#include <iomanip>
#include <algorithm>
#include <cassert>
#include <queue>
#include <set>
#include <vector>
#include <cmath>
#include <bitset>
#include <functional>
#include <limits>
#include <map>
using namespace std;
typedef long long ll;
#define rep1(i, n) for(ll i = 1; i <=(l... | ALGO | 0.99993 | 3.984247 | {
"github_metadata": {
"branch": "main",
"commit_count": 22,
"repo_created_at": "2025-01-27T04:39: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": "7854fdc0f67... |
b90d38fb-c61c-4fd2-829a-39f756636f66 | AISTRAGEN/Pelichi-Exercises | C++/Labs/lab10/task 1.1/main.cpp | #include <iostream>
#include <vector>
#include <string>
class Human
{
protected:
std::string name;
int age;
public:
Human(std::string _name, int _age) : name(_name), age(_age) {}
virtual void display()
{
std::cout << "Ім'я: " << name << ", Вік: " << age;
}
};
class Citizen : public... | TOOL | 0.939165 | 5.054376 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2024-03-05T13:43: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": "8768d293741... |
57bec90d-e5f7-47b7-b61b-ec34b09d9539 | nycu-caslab/AQB8 | RayTracingInVulkan/src/Vulkan/RayTracing/build.hpp | #ifndef BUILD_HPP
#define BUILD_HPP
#include <iostream>
#include <fstream>
#include <vector>
#include <bvh/triangle.hpp>
#include <bvh/sweep_sah_builder.hpp>
#include <array>
#include <cassert>
#include <queue>
#include <stack>
#include <memory>
#include <string>
#include <tuple>
#define INT_BVH_ALIGNMENT 64
#define ... | TOOL | 0.910644 | 4.826942 | {
"github_metadata": {
"branch": "main",
"commit_count": 17,
"repo_created_at": "2025-05-06T14:54:55.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "841b1e47f7e5... |
fe0f9878-19fd-4f00-b6cd-de579e54d59b | MADAI/RHIC | coral/src/coral/Kernel/kernel_chooser.cc | #include "kernel_chooser.h"
#include "message.h"
#include "constants.h"
bool pair_match(string p1a, string p2a, string p1b, string p2b){
string pairb(p1b+p2b);
return (((p1a+p2a)==pairb)||((p2a+p1a)==pairb));
}
CKernel* chooseKernel(string particle1, string particle2, const parameterMap& m){
string kdatad... | ALGO | 0.994926 | 5.046674 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2014-09-16T17:37:26.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1,
"forks": 2,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "3f7ec800fe1... |
ade3266a-95bd-4691-826f-66833dc569ae | gabriel-moraes03/Projeto-Grafos | teste1.cpp | #include <iostream>
#include <fstream>
#include <sstream>
#include <vector>
#include <string>
#include <cmath>
#include <algorithm>
#include <limits>
using namespace std;
struct ponto {
int id;
double latitude, longitude;
bool visitado;
};
double distancia_dois_pontos_haversine(ponto p1, ponto p2) {
... | ALGO | 0.999908 | 5.394608 | {
"github_metadata": {
"branch": "main",
"commit_count": 17,
"repo_created_at": "2025-01-15T22:26: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": "73390a0a9db... |
e1c36f87-1f0a-4af9-991a-0d7bc2a058ae | Bungmint/competitiveprogramming | contest/cses/max_subarray2.cpp | #pragma GCC optimize("O3")
#pragma GCC target("sse4")
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using pi = pair<int, int>;
using vpi = vector<pair<int, int>>;
#define all(v) (v).begin(), (v).end()
#define ar array
#define PB push_back
... | ALGO | 0.99956 | 3.818323 | {
"github_metadata": {
"branch": "master",
"commit_count": 42,
"repo_created_at": "2021-02-28T11:36: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": "a42518678... |
d80a44f1-bf8e-4a90-ab5c-cdc29b10222c | jinbeomdev/daily-algorithm-problems | [BOJ]9465/소스.cpp | /*
https://www.acmicpc.net/problem/9465
문제
상근이의 여동생 상냥이는 문방구에서 스티커 2n개를 구매했다. 스티커는 그림 (a)와 같이 2행 n열로 배치되어 있다. 상냥이는 스티커를 이용해 책상을 꾸미려고 한다.
상냥이가 구매한 스티커의 품질은 매우 좋지 않다. 스티커 한 장을 떼면, 그 스티커와 변을 공유하는 스티커는 모두 찢어져서 사용할 수 없게 된다. 즉, 뗀 스티커의 왼쪽, 오른쪽, 위, 아래에 있는 스티커는 사용할 수 없게 된다.
모든 스티커를 붙일 수 없게된 상냥이는 각 스티커에 점수를 매기고, 점수의 합이 최대가 ... | ALGO | 0.999976 | 4.940135 | {
"github_metadata": {
"branch": "master",
"commit_count": 356,
"repo_created_at": "2017-05-14T02:20:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "1bb90f56... |
89d72b33-ff82-406e-8188-bcb7c78580bf | Dangerdrive/Cpp | exam/new/exam05_updated/Level_1/string_bigint/bigint_simple.cpp | #include "bigint_simple.hpp"
#include <algorithm>
// Core addition algorithm (the only complex part)
bigint bigint::operator+(const bigint& other) const {
std::string result;
int carry = 0;
// Work from right to left
auto i = value.rbegin(), j = other.value.rbegin();
while (i != value.ren... | ALGO | 0.99455 | 5.72518 | {
"github_metadata": {
"branch": "master",
"commit_count": 54,
"repo_created_at": "2024-10-14T19:01: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": "102f7c026... |
6d73d7ca-714d-47f6-b18e-70dd64eadf98 | jegonzal/PowerGraph | toolkits/graph_analytics/warp_pagerank.cpp | /*
* Copyright (c) 2009 <NAME> University.
* All rights reserved.
*
* 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
*
* Unl... | ALGO | 0.999705 | 6.152665 | {
"github_metadata": {
"branch": "master",
"commit_count": 5464,
"repo_created_at": "2013-07-01T07:59:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 356,
"forks": 514,
"issues": 39,
"pull_requests": 9
},
"file_meta": {
"content_id": "31... |
fef5503d-1afa-4f8b-bac2-838a896a95d6 | Hell0Kitty/pku-online-judge | 1397.cc | #include <iostream>
#include <stdlib.h>
#include <stdio.h>
#include <memory.h>
using namespace std;
struct ParallelXLine {
int X1;
int X2;
int Y;
int Z;
} LineArray[20000], ZPlaneLine[10000], ZPlaneLineTemp[10000];
struct C2DLine {
int X1;
int X2;
} curLineArray[10000], nextLineArray[10000];
struct point {
... | ALGO | 0.994754 | 3.825033 | {
"github_metadata": {
"branch": "master",
"commit_count": 4334,
"repo_created_at": "2017-03-03T05:44:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ff485be... |
9902b1e8-0e28-4c6b-8ed3-f2c42f8a554d | mamun4122/My-Online-Judge-Submission | Codeforces/2014-2015 ACM-ICPC Southwestern Europe Regional Contest (SWERC 14) - 100783/100783A-GREAT+SWERC=PORTO.cpp | #pragma comment(linker, "/stack:640000000")
#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-9;
const int INF = 0x7f7f7f7f;
const double PI=acos(-1.0);
#define READ(f) freopen(f, "r", stdin)
#define WRITE(f) freopen(f, "w", stdout)
#define MP(x, y) make_pair(x, y)
#... | ALGO | 0.999979 | 3.794033 | {
"github_metadata": {
"branch": "master",
"commit_count": 27,
"repo_created_at": "2016-07-15T03:28: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": "31830dae2... |
a24fec87-2d30-463b-b4f5-e1fc62f9e6a9 | mahiuddin-dev/URI | 2030.cpp |
#include <iostream>
#include <string.h>
using namespace std;
int main(){
short int n;
char a[7],b[7];
cin>> n;
while(n--){
cin>>a>>b;
if( strcmp(a,"ataque") == 0 && strcmp(b,"papel") == 0){
cout<< "Jogador 1 venceu" <<endl;
}else if( strcmp(a,"papel") == 0 && strc... | ALGO | 0.999958 | 3.917129 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2020-12-28T15:58:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3d553001ec50... |
093d979b-b794-473c-a7a3-c0241c200cd1 | WhoAmI-Chan/data-structures-cpp | binarySearchTree/tree.cpp | // Copyright 2018 <NAME>
#include <cstdlib>
#include <unistd.h>
#include "root.h"
int main(int argc, char **argv)
{
// treat as a struct since BinarySearchTree is a class and we're calling public variables. DERP structs.
BinarySearchTree accessorVariable;
if (argc < 2)
{
std::cout<<"Send N... | ALGO | 0.973625 | 3.698902 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2019-06-23T13:03: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": "896e1b7547... |
cd9f3eaf-d8fc-41dd-902b-bf417558173e | ryo-manba/AtCoder | EDPC/c/Vacation.cpp | #include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;
const int INF = (int)1e9;
const ll INFL = (ll)1e15;
const int MOD = 1e9 + 7;
int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};
template<class T> inline bool chmax(T& a, T b) {... | ALGO | 0.999966 | 3.977436 | {
"github_metadata": {
"branch": "master",
"commit_count": 319,
"repo_created_at": "2021-02-24T11:34: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": "0705f8b9... |
a7fe4398-d959-4b4e-aa01-0ac752c02feb | LutzGross/esys-escript.github.io | trilinos_source15/packages/nox/src-loca/src/LOCA_Pitchfork_MooreSpence_SolverStrategy.H | // $Id$
// $Source$
//@HEADER
// ************************************************************************
//
// LOCA: Library of Continuation Algorithms Package
// Copyright (2005) Sandia Corporation
//
// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
// license for use... | ALGO | 0.99955 | 7.302448 | {
"github_metadata": {
"branch": "master",
"commit_count": 5724,
"repo_created_at": "2020-08-10T02:31:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 34,
"forks": 15,
"issues": 63,
"pull_requests": 0
},
"file_meta": {
"content_id": "c87e... |
5d9e7dc2-2bee-4441-a827-61a2a8ffa773 | camrdale/building-habits | habits/position.cpp | #include "position.hpp"
#include <bitset>
#include <cctype>
#include <cstdint>
#include <iostream>
#include <string>
#include <string_view>
namespace habits {
namespace {
constexpr std::string_view FEN_PIECES = "PNBRQKpnbrqk";
} // namespace
std::string Square::Algebraic() const {
std::string an;
an += stati... | ALGO | 0.974094 | 6.032555 | {
"github_metadata": {
"branch": "main",
"commit_count": 39,
"repo_created_at": "2023-11-20T00:41:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3f1da255262... |
a49096ed-8ef4-4eb8-b5dd-097384eaa1c4 | muhammad-sayem/CSES | Range_XOR_Queries.cpp | #include<bits/stdc++.h>
#define endl '\n'
#define yes (cout << "YES\n")
#define no (cout << "NO\n")
#define ll long long
#define pb push_back
#define pii pair <int,int>
#define pll pair <long long,lo... | ALGO | 0.999995 | 4.533327 | {
"github_metadata": {
"branch": "main",
"commit_count": 24,
"repo_created_at": "2023-08-03T16:18: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": "5c792b9f4de... |
5cd2883e-4074-416d-b172-828639daaa28 | brgccf/C-Programs | BFS-Pedro(matrix).cpp | #include <stdio.h>
/*
Problema:
Eh dado um mapa inicialmente como esse abaixo.
###############################################################
#..........#.......#...........................#T............T#
#...T......#..###TT#...........................#..............#
#..........#..#.####........................... | ALGO | 0.99891 | 3.735364 | {
"github_metadata": {
"branch": "master",
"commit_count": 49,
"repo_created_at": "2016-03-25T15:33:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cf5c0dc74... |
1a5ab795-3bcc-4170-8a7d-3ae06a10f754 | ishandutta2007/codeforces-a | abeker/normal/736/D.cpp | #include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e3 + 5;
const int MAXM = 5e5 + 5;
int N, M;
bitset <MAXN> mat[MAXN], inv[MAXN];
int a[MAXM], b[MAXM];
void load() {
scanf("%d%d", &N, &M);
for (int i = 0; i < M; i++) {
scanf("%d%d", a + i, b + i);
mat[--b[i]].set(--a[i]);
}
}
void solve() {
fo... | ALGO | 0.999985 | 3.98618 | {
"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": "5fc25fba794e... |
6dedf48f-a720-4fb3-9e92-da0e83345ce8 | mahroosanwar/CodingBlock | 14_DeepDivingIntoRecursion/ChallengesDeepDivingIntoRecursion/6TowerofHanoi.cpp | //Tower of Hanoi
#include <bits/stdc++.h>
using namespace std;
int cnt=0, i=0;
void TOH(int n, string src, string helper, string dest){
//base case
if(n == 0){
return;
i++;
}
//recursive case
//1--> n-1 disc from src to helper
TOH(n-1, src, dest, helper);
if(cnt>=0){
... | ALGO | 0.999969 | 4.438991 | {
"github_metadata": {
"branch": "main",
"commit_count": 542,
"repo_created_at": "2022-01-26T23:26:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6e2ea81422... |
97b99655-3761-42fa-a170-61f2e981e1d4 | cornelizbasa-pinteam/klee-demo | qsort.cpp | /* C implementation QuickSort */
// From: https://www.geeksforgeeks.org/quick-sort/
#include <stdio.h>
// A utility function to swap two elements
void swap(int* a, int* b)
{
int t = *a;
if (*a != 'A')
*a = *b;
*b = t;
}
/* This function takes last element as pivot, places the pivot element at its cor... | ALGO | 0.999885 | 6.117885 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2022-11-14T09:22: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": "96498b7d6... |
be51bd85-bf3c-4257-9ad5-be7c86d91aa7 | TheDLCrimson/My-CP-journey | Pre-Uni Phase/CodeForce/Practice/330B.cpp | #include<bits/stdc++.h>
using namespace std;
main(void)
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int n, m, x, y, mid;
cin >> n >> m;
bool *called = new bool[1001];
for (int i = 1; i <= n; i++)
called[i] = false;
for (int i = 0; i < m; i++)
... | ALGO | 0.999985 | 3.220428 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2024-12-31T11:02: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": "e567adac6d74... |
91e4527a-b590-45ee-82f7-ad26c6838518 | UniLauX/VideoMatting | VideoEditing/BeizerCurveDataManager.h | #ifndef BEIZERCURVEDATAMANAGER_H
#define BEIZERCURVEDATAMANAGER_H
#include "Beizer.h"
#include <vector>
#include "stdafx.h"
using namespace std;
class Beizer;
class ControlPoint // for Rotoscoping
{
public:
ControlPoint():cp(CPoint(0,0)), bIsInteractive(false){}
ControlPoint(CPoint& p): cp(p), bIsInteractive(false... | ALGO | 0.95183 | 4.495173 | {
"github_metadata": {
"branch": "master",
"commit_count": 22,
"repo_created_at": "2021-01-28T01:14:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "403c91896... |
2f71367f-dfdf-4d9a-9656-e5d8b12ab8ec | Nikhil-karoriya/OS_Sem-4_lab | Exp13 FIFO_page_replace.cpp | #include<iostream>
#include <unordered_map>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
vector<int> pageReferences = {1, 2, 3, 1, 4, 1, 3, 2, 4,
2};
int numFrames = 3;
vector<int> frames(numFrames, -1);
unordered_map<int, int> frequency;
for (int i = 0; i < pageReferences.s... | ALGO | 0.999939 | 4.95921 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-04-07T12:33:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5719883f9a92... |
27138086-ad5b-488c-b333-70c28bf52506 | Log-in-off/leetcode | 977_squares_of_a_sorted_array/main.cpp | #include <iostream>
#include <cassert>
#include <vector>
class Solution {
public:
std::vector<int> sortedSquares(std::vector<int>& nums) {
std::vector<int> answer(nums.size());
int lh = 0, rh = nums.size()-1;
for(int i = nums.size()-1; i >= 0; i--)
{
if(std::abs(nums[lh]) > std::abs(nums[rh]))
{
... | ALGO | 0.999837 | 5.96963 | {
"github_metadata": {
"branch": "main",
"commit_count": 104,
"repo_created_at": "2023-03-14T12:06:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "65822ce6be... |
f70d3de6-b3f1-47cf-bba3-9567eba11a39 | silvercobraa/competitive-programming | 1. Introduction/Ad Hoc Problems/Interesting Real Life Problems, Harder/12342.cpp | #include <iostream>
using namespace std;
int main(int argc, char const *argv[]) {
int n;
cin >> n;
for (int t = 1; t <= n; t++) {
int m;
cin >> m;
// cout << m << endl;
long long tax = 0;
if (m > 1180000) {
tax += 25LL*(m - 1180000);
m = 1180000;
// cout << m << endl;
}
if (m > 880000) {
t... | ALGO | 0.999794 | 3.663706 | {
"github_metadata": {
"branch": "master",
"commit_count": 322,
"repo_created_at": "2018-08-05T00:13: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": "b2a6b202... |
7e3f1645-b2fc-4520-88e5-5c49ffe554c5 | pumfit/PracticeForCodingTest | CodingTestExProject/CodingTestExProject/백준/비트마스킹/11723.cpp | /*
11723 집합
비트마스킹으로 집합 연산하기
명령어가 3,000,000개까지 있어서 ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); 꼭해줘야하고
제출 후 70퍼센트 대에서 틀렸는데 all 연산을 (1<<20)-1로 진행하여서 틀렸다.
*/
#include <iostream>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(NULL); cout.tie(NULL);
int T;
string C; int N;
... | ALGO | 0.996098 | 5.305015 | {
"github_metadata": {
"branch": "master",
"commit_count": 450,
"repo_created_at": "2021-06-30T02:44:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4270171a... |
7e548be9-5ea7-40e8-89e6-ec8a5e205a8a | marco-ocean-model/PETSc-MARCO | src/mat/impls/aij/seq/seqhipsparse/aijhipsparse.hip.cpp | /*
Defines the basic matrix operations for the AIJ (compressed row)
matrix storage format using the HIPSPARSE library,
Portions of this code are under:
Copyright (c) 2022 Advanced Micro Devices, Inc. All rights reserved.
*/
#include <petscconf.h>
#include <../src/mat/impls/aij/seq/aij.h> /*I "petscmat.h" I*/
#i... | ALGO | 0.995171 | 6.216018 | {
"github_metadata": {
"branch": "main",
"commit_count": 91460,
"repo_created_at": "2025-02-28T15:02: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": "f466b5b3... |
c16f0b1f-4e93-49af-8258-7a30bdcf2f7d | stbakeas/EADARP | EADARP/Solution.h | #pragma once
#include "Route.h"
#include "Position.h"
#include "Instance.h"
#include <array>
class Solution
{
public:
/*
* Hash map to assign each vehicle to a particular route.
*/
std::unordered_map<EAV*, Route> routes;
std::vector<Request*> rejected, removed;
std::unordered_map<CStation*, unsigned int> stati... | ALGO | 0.993064 | 5.655038 | {
"github_metadata": {
"branch": "master",
"commit_count": 103,
"repo_created_at": "2022-10-24T09:42:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e4276cf0... |
cedf913a-5c5e-4780-a1f8-fb49b5e63cb1 | HengruiZhu99/ahfind | arrangements/EinsteinAnalysis/AHFinderDirect/src/driver/setup.cc | // setup.cc -- top level driver to setup our persistent data structures
// $Header$
//
// <<<prototypes for functions local to this file>>>
// <<<access to persistent data>>>
//
// AHFinderDirect_setup - top-level driver to setup persistent data structures
///
/// decode_method - decode the method parameter
/// decod... | ALGO | 0.95872 | 5.254 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2024-10-08T18:48:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c3372a4a85b6... |
153e599c-8d5c-4d74-be69-685830fde361 | JacobianDet/CompeteUp | 521E/cycc.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define MV 200001
#define LMV 21
#define ff first
#define ss second
#define pb push_back
#define eb emplace_back
#define emp emplace
#define mp make_pair
#define ins in... | ALGO | 0.999901 | 4.590606 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2018-08-04T16:37:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
"content_id": "359cc7b7a5... |
dd7aa1ca-3c09-4c79-9865-53e30e27198d | madhu9613/dsa_codeforce_folder | contest/div2/div21031/q2.cpp | #include <iostream>
using namespace std;
bool can_tile(int w, int h, int a, int b, int x1, int y1, int x2, int y2) {
int tx1 = x1 - (x1 % a);
int ty1 = y1 - (y1 % b);
int tx2 = x2 - (x2 % a);
int ty2 = y2 - (y2 % b);
// Check if both tiles fit inside the rectangle
bool fits1 = (tx1 + a <= w) &... | ALGO | 0.998738 | 3.933146 | {
"github_metadata": {
"branch": "main",
"commit_count": 30,
"repo_created_at": "2025-03-26T07:13: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": "eb0d6ec002c... |
8811d7fb-d6f3-4351-9cb5-777eb73adb0c | Joel-Milla/Lidar_Obstacle_Detection | src/helper/cluster.cpp | /* \author <NAME> */
#include "cluster.h"
#include "pcl/PointIndices.h"
#include <cstddef>
#include <queue>
#include <vector>
template <typename PointT>
EuclideanCluster<PointT>::EuclideanCluster() {}
template <typename PointT>
EuclideanCluster<PointT>::~EuclideanCluster() {}
/*
Input:
@input_cloud => pointer to t... | ALGO | 0.978472 | 6.450441 | {
"github_metadata": {
"branch": "master",
"commit_count": 123,
"repo_created_at": "2025-02-21T02:02: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": "01e54489... |
ff71557e-60ca-43bc-a8d1-08e5682142b3 | sahilarora02/Leetcode_Questions | 0958-check-completeness-of-a-binary-tree/0958-check-completeness-of-a-binary-tree.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999817 | 6.028801 | {
"github_metadata": {
"branch": "main",
"commit_count": 736,
"repo_created_at": "2022-10-29T12:20: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": "4dd4ecff9e... |
d86b2a69-b2c7-438a-b5d2-3413b75313f0 | Bill-Board/Codeforces-problem-solutions | 500/Longest Strike.cpp | //<NAME>
//ALLAH IS WATCHING ME
// <NAME>
// Dept of ICE, NSTU
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=200005;
void solve()
{
int n, k; cin >> n >> k;
map<int,int> mpp;
for(int i= 0; i<n; i++){
int x; cin >> x;
mpp[x]++;
}
mpp[INT_MAX-1]=0;
... | ALGO | 0.99993 | 3.99297 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2023-06-26T16:09:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "10ce2d7f60f... |
7fecb4a9-bcf3-4893-9566-031034e582ce | terrykwon/practice_problems | cses/introductory/chessboard_and_queens.cpp | #include <iostream>
using namespace std;
const int N = 8;
char board[N][N];
bool row_taken[N];
bool col_taken[N];
bool diag1_taken[2*N-1];
bool diag2_taken[2*N-1];
int successes = 0; // global "count" is a taken name
bool place(int r, int c) {
if (board[r][c] != '*' &&
!row_taken[r] &&
... | ALGO | 0.9996 | 4.334954 | {
"github_metadata": {
"branch": "main",
"commit_count": 128,
"repo_created_at": "2021-04-15T08:43:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "58b969c96d... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.