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 |
|---|---|---|---|---|---|---|---|
fc958cd0-8827-4005-bd49-316b2d432be7 | rajneesh069/DSA-CPP | DSA/binary_search/floor_of_a_number.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
// works for sorted array ofc
int n, target;
cin >> n >> target;
int v[n];
for (int i = 0; i < n; i++) {
cin >> v[i];
}
int start = 0, end = n - 1, f = -1;
while (start <= end) {
int mid = start + (end - start)... | ALGO | 0.999991 | 4.896555 | {
"github_metadata": {
"branch": "main",
"commit_count": 123,
"repo_created_at": "2024-08-05T14:58: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": "cf3a6bf911... |
22dbc35d-f796-456c-b1c2-8824a5c09faf | ghana01/DSA_LEARNING | DP/DP6/acode.cpp | #include<iostream>
#include<string>
#include<vector>
#define ll long long int
using namespace std;
// string decode(string &input){
// string res="";
// if(input.size()==1) {
// res +=(char)(64 + input[0]-'0')
// }else{
// int num = (input[0]-'0')*10 + (input[1]-'0');
// res +=(char... | ALGO | 0.999543 | 3.829951 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2025-05-19T07:55: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": "8117415538f3... |
cc63b207-5034-4771-a221-dada1f52dd19 | JieyangChen7/PowerLA | fault_tolerance/abft_strmm.cpp | #include "magma_internal.h"
#undef max
#undef min
#include "abft_checker.h"
#include "abft_io.h"
#include <string>
#include "cuda_runtime.h"
#include "../fault_tolerance/abft_printer.h"
extern "C" void
abft_strmm(
magma_side_t side, magma_uplo_t uplo, magma_trans_t trans, magma_diag_t diag,
magma_int_t m, magm... | ALGO | 0.996915 | 4.85496 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2021-01-18T04:13:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f46e6e2ad5... |
2ae51b7a-d50c-4ac8-8e73-925851e70e5c | ZetDeluge/bupt-CSassignment-2024 | assignment/第二次上机练习/7-11 三对三篮球赛.cpp | /*三对三篮球赛规定
第4条:得分
4.1. 在圆弧线以内投篮命中得 1 分。
4.2. 在圆弧线以外投篮命中得 2 分
4.3. 罚篮命中得 1 分。
第5条:比赛时间/优胜者
5.1 一节 10 分钟(这个可以称为常规时间)。在死球状态下和罚球时应停表。再次开球时,当球权方与防守队一名球员完成一次传递球后(即一旦进攻队持球),计时器应继续计时。
5.2. 但是,在规定的比赛时间内(即在常规时间内),率先取得 21 分或以上的队伍获胜。
5.3. 如果在规定比赛时间(即在常规时间内)两队打平,则应进行加时赛。加时赛中率先取得 2 分的队伍获胜。
请你根据这些条款写一段程序来判断一场比赛的胜负。
注意:判断胜负的一个基本原则是得分高... | ALGO | 0.999872 | 3.728017 | {
"github_metadata": {
"branch": "main",
"commit_count": 79,
"repo_created_at": "2024-10-25T14:27:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "905156e0a3d... |
db755825-966f-4dd9-834c-af9b338666da | whomimohshukla/cpp-and-leetcode-questions-practise | oops/doublyLinkedlist.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
class Node
{
public:
int data;
Node *prev;
Node *next;
Node()
{
this->data = 0;
this->prev = NULL;
this->next = NULL;
}
Node(int data)
{
this->data = data;
this->nex... | ALGO | 0.999764 | 5.406559 | {
"github_metadata": {
"branch": "main",
"commit_count": 677,
"repo_created_at": "2024-07-24T20:40:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "369671a979... |
8042f280-c160-4b48-bbd1-296dc1114837 | cmin764/cmiN | projects/C++/cli/infoarena/evaluare.cpp | #include <cstdio>
#include <iostream>
#include <string>
#include <cctype>
using namespace std;
string exp;
int pos;
int nr()
{
int res = 0;
while (isdigit(exp[pos])) {
res = res * 10 + exp[pos] - '0';
++pos;
}
return res;
}
int eval(int a, int b, char sign)
{
switch (sign) {
... | ALGO | 0.999858 | 3.692885 | {
"github_metadata": {
"branch": "master",
"commit_count": 243,
"repo_created_at": "2014-07-22T22:22:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 20,
"forks": 18,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c5e976... |
b5283fd5-ada9-48bb-bfed-a7eb47f2dc17 | ishandutta2007/codeforces-s | siberian/normal/1531/B2.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
#define all(a) (a).begin(), (a).end()
#define mp make_pair
template<typename T1, typename T2>
inline void chkmin(T1& x, const T2& y) {
if (y < x) x = y;
}
template<typename T1, typename ... | ALGO | 0.999869 | 4.567056 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:07:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7549ee56259d... |
d8b6a74c-6f63-4273-8d6c-bc45b198cc2d | yoimiya-0621/nowcoder | nowcoder_week_training/Round70/F.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define fi first
#define se second
#define vi vector<int>
#define pi pair<int,int>
const int mod = 1e9+7;
const int N = 6e4+10;
int n,k;
int a[N],v[N];
int check(int x)
{
if(x>k||x<1)
return 0;
for(int i=0;i<n-1;i++)
{
if(v[... | ALGO | 0.999814 | 4.010872 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2024-09-19T15:19: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": "ec2d327643b... |
95d5a6cf-e186-4b51-b378-6d204f43b73e | mahirlabibdihan/Codeforces-Solution | 1370B.cpp | /*
______ _________ _ _ _
| ____ \|___ ___| | | | | |
| | \ \ | | | |____| | | |
| | | | | | | ____ | | |
| |____/ /___| |___| | | |_____| |
|_______/|_________|_| |_________|
*/
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define p_b push_b... | ALGO | 0.999696 | 3.865231 | {
"github_metadata": {
"branch": "master",
"commit_count": 47,
"repo_created_at": "2020-04-03T18:29:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "00062ab68... |
16b28b18-017f-4f93-91e2-fb834ab9ef04 | Yawn-Sean/Daily_CF_Problems | daily_problems/2024/04/0423/personal_submission/cf500d_WanderOvO.cpp | /*
*/
int T;
void solve1() {
cin >> n;
for (int i = 1; i < n; i++) {
cin >> edges[i].u >> edges[i].v >> edges[i].w;
e[edges[i].u].pb({edges[i].v, edges[i].w});
e[edges[i].v].pb({edges[i].u, edges[i].w});
int u = edges[i].u, v = edges[i].v;
if (u > v) {
swap... | ALGO | 0.999669 | 4.193412 | {
"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": "2dac... |
4f59695f-09c5-4bd6-afe3-4683512f16fe | gilouzi/ProgComp | Lista3/uri-2674.cpp | // #include <bits/stdc++.h>
#include <iostream>
#include <vector>
#include <math.h>
using namespace std;
int crivo[100001];
// bool primo(int n){
// for(int i=2; i<n; i++){
// if(n%i == 0) return false;
// }
// return true;
// }
bool primo(int n){
if(crivo[n]==0) return false;
return tru... | ALGO | 0.999539 | 3.7794 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2020-07-15T17:21: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": "f6b312853... |
6883faad-c732-457f-9a4b-f0dcd6166a26 | Tanjim131/Problem-Solving | LeetCode/Easy/671 - Second Minimum Node In 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.999989 | 5.789073 | {
"github_metadata": {
"branch": "master",
"commit_count": 137,
"repo_created_at": "2020-05-27T20:39: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": "4da02a12... |
006a01dd-cd9e-496c-a5d4-adc5a6d21d24 | YanCotta/SmartFarmIrrigation | src/prog1.ino | #include <Arduino.h>
#include <DHT.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include "config.h"
// Initialize objects using constants from config.h
DHT dht(DHT_PIN, DHT22);
LiquidCrystal_I2C lcd(LCD_ADDRESS, LCD_COLS, LCD_ROWS);
// Memory Optimization: Use uint32_t instead of unsigned long (same size but m... | TOOL | 0.921378 | 7.448284 | {
"github_metadata": {
"branch": "feature/phase-4",
"commit_count": 112,
"repo_created_at": "2025-05-12T13:44: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": ... |
86d12074-3f5d-42d9-ad89-3e1a6cec0e99 | tat/mimetic | examples/search.cxx | /***************************************************************************
copyright : (C) 2002-2008 by <NAME>
email : <EMAIL>
$Id: search.cxx,v 1.3 2008-10-07 11:06:25 tat Exp $
***************************************************************************/
/** \example search.c... | TOOL | 0.911936 | 4.82474 | {
"github_metadata": {
"branch": "master",
"commit_count": 51,
"repo_created_at": "2014-02-15T12:31:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 43,
"forks": 33,
"issues": 4,
"pull_requests": 3
},
"file_meta": {
"content_id": "e383854... |
77f539bb-9166-428b-9624-dccad24ece24 | ravimenariya/LEETCODE_GFG_POTD | LEETCODE_POTD/Jan 2025/24-01-2025.cpp | // problem -> https://leetcode.com/problems/find-eventual-safe-states/?envType=daily-question&envId=2025-01-24
class Solution {
bool dfs(vector<vector<int>>& graph, int curr, vector<int>& state) {
if (state[curr] != 0) {
return state[curr] == 2; // If already visited, check if it's safe
... | ALGO | 0.999985 | 6.871439 | {
"github_metadata": {
"branch": "main",
"commit_count": 414,
"repo_created_at": "2024-12-12T22:15: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": "1321b43837... |
422619b6-8113-4133-8138-a61cd4db7be4 | Robotawi/Coursera-Data-Structures-and-Algorithms-Specialization | course_1_algorithmic_toolbox/week1/pairwise_product.cpp | #include <cstdlib>
#include <iostream>
#include <vector>
using namespace std;
long long pairwise_product(vector<int> &input)
{
int max1_idx = -1;
for (int i = 0; i < input.size(); ++i)
{
if (max1_idx == -1 || input.at(i) > input.at(max1_idx))
{
max1_idx = i;
}
}
... | ALGO | 0.999882 | 5.254263 | {
"github_metadata": {
"branch": "master",
"commit_count": 58,
"repo_created_at": "2022-07-28T22:00: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": "3950f48ab... |
0a39bb62-bc10-476b-b148-92c4397c42ab | oscarpobletes/programming-mix | T_merge_sort.cpp | #include <iostream>
using namespace std;
// Merge two subarrays into a single sorted subarray
void merge(int arr[], int left, int mid, int right) {
int n1 = mid - left + 1;
int n2 = right - mid;
// Create temporary arrays
int L[n1], R[n2];
// Copy data to temporary arrays
for (int i = 0; i < ... | ALGO | 0.999999 | 6.063648 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2023-05-26T13:55: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": "6597361270... |
b74bc03a-f214-4dbc-a655-6ca966559f9a | YuldashevSherzotbek/labs-comp-practice | 4/labcomp4.2.cpp | #include <iostream>
#include <vector>
using namespace std;
// Функция для вычисления определителя матрицы 3x3
double determinant(vector<vector<double>> mat) {
return mat[0][0] * (mat[1][1] * mat[2][2] - mat[1][2] * mat[2][1]) -
mat[0][1] * (mat[1][0] * mat[2][2] - mat[1][2] * mat[2][0]) +
mat[0][2... | ALGO | 0.999979 | 5.742972 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2024-06-13T15:44: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": "00fc103e3bc... |
5c3829fe-fa2d-4c45-a22d-35849cd7ec18 | JatinDholakia/Competitive-Programming | Codeforces/Problemset/1300/1236C/main.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define deb(x) cout << #x << "=" << x << endl
#define deb2(x, y) cout << #x << "=" << x << "," << #y << "=" << y << endl
#define For(i,x,n) for(int i=x;i<n;i++)
#define pb push_back
#define print(vec) For(i,0,vec.size()) {cout<<vec[i]<<" ";} cout<<'\n';
... | ALGO | 0.999876 | 4.050148 | {
"github_metadata": {
"branch": "master",
"commit_count": 32,
"repo_created_at": "2020-11-05T03:57: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": "180971a71... |
7f48d7a3-b844-4498-9967-bf15cfe27dd0 | lavinia0724/Algorithm-Codes | Algorithm-Codes/Math/UVA12004_Bubble_Sort.cpp | #include<bits/stdc++.h>
using namespace std;
// 2022.05.30
/*
解題思維:
期望值
期望值算法:
https://zh.wikipedia.org/zh-tw/%E6%9C%9F%E6%9C%9B%E5%80%BC
擲一枚公平的六面骰子,其每次「點數」的期望值是 3.5
E(x) = 1 * 1/6 + 2 * 1/6 + 3 * 1/6 + 4 * 1/6 + 5 * 1/6 + 6 * 1/6
= (1 + 2 + 3 + 4 + 5 + 6)/6 = 3.5
本題期望值:
bubble sort 每兩兩之間交換機率是 1/2
總共會做 C(n, 2) 次
E(x... | ALGO | 0.999514 | 4.667426 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2023-04-08T15:43: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": "0a824dfaf20... |
5621223f-ee1b-4984-90f0-1289a12fb112 | GrognardsFromHell/EvilTemple-GameMath | include/matrix4.h | #ifndef MATRIX4_H
#define MATRIX4_H
#include <cstdio>
#include "gamemath_internal.h"
#include "vector4.h"
#include "quaternion.h"
GAMEMATH_NAMESPACE_BEGIN
GAMEMATH_ALIGNEDTYPE_PRE class GAMEMATH_ALIGNEDTYPE_MID Matrix4 : public AlignedAllocation {
friend GAMEMATH_INLINE Matrix4 operator *(const Matrix4 &a, const Ma... | TOOL | 0.95952 | 6.752664 | {
"github_metadata": {
"branch": "master",
"commit_count": 50,
"repo_created_at": "2015-05-19T15:54:52.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "37d263ead3... |
e8e331e8-4f79-4c75-833c-646fb26033ff | Moneemabdullah/problem_solving_journey | Codeforces Round 975 (Div. 2)/Max_Plus_Size.cpp | /*
#### ### # # ##### ##### #### ##### #####
# # # # # # # # # # #
### ##### # # #### AND #### #### #### ####
# # # # # # # # # # #
#### # # # ##### # # # ##### #####
... | ALGO | 0.999847 | 5.319115 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2024-09-21T10:07: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": "0e9217a95a9e... |
35bfddfc-ff3e-47bd-b023-eaa2fa425695 | ipc2023-classical/planner19 | planners/ipc2018-symple1/src/search/sym_evmdd/tests/genericBinaryOperator.h | // Copyright 16.05.2017, University of Freiburg,
// Author: <NAME> <speckd>.
#ifndef GENERICBINARYOPERATOR_H_
#define GENERICBINARYOPERATOR_H_
#include <meddly.h>
#include <meddly_expert.h>
#include <limits>
class genericBinaryOperator: public MEDDLY::binary_operation {
protected:
int (*OpType)(int, int);
boo... | ALGO | 0.98631 | 6.959109 | {
"github_metadata": {
"branch": "latest",
"commit_count": 317,
"repo_created_at": "2023-02-07T11:09:05.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "187bdf919... |
abe3a605-dbe8-44e9-b0ed-1aaa4fc1a5d0 | silenty4ng/uv-k5-firmware-chinese-lts | uv-k5font/uv-k5font_full/main.cpp |
#include<iostream>
#include<fstream>
#include<string>
#include <vector>
#include <array>
#include <map>
#include "font.h"
#include "bits/stdc++.h"
using namespace std;
#define IS_BIT_SET(byte, bit) ((byte>>bit) & (1))
ifstream file("../ALL_IN.txt"); // 替换成你的文件名或路径
//ifstream file("../CHINESE7000_OUT.txt"); // 替换成你的文件... | DATA | 0.990244 | 3.03334 | {
"github_metadata": {
"branch": "main",
"commit_count": 273,
"repo_created_at": "2024-01-18T15:29:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 22,
"forks": 4,
"issues": 4,
"pull_requests": 0
},
"file_meta": {
"content_id": "561a04d04... |
15d33fe9-a556-4ca6-8dcf-edc64d235d71 | shin4821/AddressBook20210313 | AddressBook20210313/Array.h | //Array.h
#ifndef _ARRAY_H
#define _ARRAY_H
typedef signed long int Long;
template<typename T>
class Array {
public:
Array(Long capacity = 256); //디폴트 생성자, 매개변수 생성자.
~Array();//소멸자.
Array(const Array& source); //복사생성자
Long Store(Long index, T object);
Long Insert(Long index, T object);
Long AppendForFront(T obje... | ALGO | 0.99812 | 4.010472 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2021-08-21T11:14: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": "60a2b42b32... |
5527f0aa-a425-4adb-b18d-ca93ff945c4f | Tadeam214/AdventOfCode | 2024/day20_part2.cpp | #include<iostream>
#include<fstream>
#include<cmath>
void pathfind(int pos, int score, int with, int size, bool world[], int scores[]){
if(score < scores[pos]){
scores[pos] = score;
if(pos % with != with -1 && !world[pos + 1]){
pathfind(pos + 1, score + 1, with, size, world, scores);
... | ALGO | 0.999753 | 4.013748 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-12-13T17: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": "aa09122abafe... |
7c4bd60d-ee7e-4ef9-869f-39809629bb9f | rjegan2000/My-First-C-CPP | bearchWHAT.cpp | #include<bits/stdc++.h>
using namespace std;
int counT=0;
// Invariant: A[l] <= key and A[r] > key
// Boundary: |r - l| = 1
// Input: A[l .... r-1]
int BinarySearch(int A[], int l, int r, int key)
{
int m;
while( l != r )
{
m = l + (r-l)/2;
if( A[m] < key ){
counT++;
l = m+1;}
else
{counT++;... | ALGO | 0.999924 | 4.413172 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2019-10-14T16:31:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "2ba24feac5... |
7a526691-3d09-496a-864c-d9a605558e0c | GYPpro/ACM | 1_Contests/CF886.2/B_JoJo_s_Incredible_Adventures.cpp | // #define D
#include <iostream>
#include <stdlib.h>
#include <math.h>
#include <algorithm>
#include <string>
#include <string.h>
#include <vector>
#include <queue>
// #define set unordered_set
// #define map unordered_map
#include <map>
#include <set>
// #pragma GCC optimize(2)
#define int long long
#define pii pa... | ALGO | 0.999685 | 4.338589 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2023-10-29T07:31:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a17812139a8... |
9609e2f6-8101-42b6-a445-d4621d963ac1 | reverg/PS | leetcode/2018.cpp | class Solution
{
bool same(vector<char> &line, int start, int end, string &word)
{
int l = word.length();
if (end - start + 1 != l)
return false;
int overlap = 0;
for (overlap = 0; overlap < l; overlap++)
{
if (line[start + overlap] != ' ' &&
... | ALGO | 0.999897 | 5.744965 | {
"github_metadata": {
"branch": "main",
"commit_count": 91,
"repo_created_at": "2021-06-24T14:39:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b0dcbc94567... |
7fc33c1f-c3f2-4a3a-bcc3-468e5607818a | google-ai-edge/mediapipe | mediapipe/tasks/cc/vision/interactive_segmenter/interactive_segmenter.cc | /* Copyright 2023 The MediaPipe Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, s... | ALGO | 0.948609 | 7.596473 | {
"github_metadata": {
"branch": "master",
"commit_count": 4767,
"repo_created_at": "2019-06-13T19:16:41.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 30689,
"forks": 5453,
"issues": 443,
"pull_requests": 149
},
"file_meta": {
"content_id"... |
f5d23941-777a-4a16-bbf6-ca399b18ded6 | quthongle/UnoQuad | Code/UnoQuad/PID.ino | /*
* PID.ino
*
* Created: 11/25/2015 10:37:40 AM
* Author: QuocTuanIT
*/
void pidInit()
{
pid.roll.Kp = 1.3; //stable: 1.3
pid.roll.Ki = 0.05; //stable: 0.05
pid.roll.Kd = 20; //stable: 25
pid.roll.max = 400; //stable: 400
pid.pitch.Kp = pid.roll.Kp;
pid.pitch.Ki = pid.roll.Ki;
pid.pitch.Kd = pid.rol... | ALGO | 0.998199 | 5.173777 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2016-04-11T10:32:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "24d3ba4c7... |
a6b44fc6-181a-4fd4-b164-06e3825d561d | leverimmy/Codes | 题目/洛谷/P3916 图的遍历/graph.cpp | #include <cstdio>
#include <cctype>
#include <cstring>
#include <algorithm>
#define il inline
#define ll long long
#define rgi register int
using namespace std;
const int oo = 0x3f3f3f3f;
const int N = 1e5 + 10;
const int M = 1e5 + 10;
int n, m, cnt, idx, top, tot;
int first[N], max_val[N], f[N], instk[N], stk[N], l... | ALGO | 0.999991 | 4.152606 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2019-11-04T09:43: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": "e94867953... |
5864028d-0300-4d32-804b-c6fa23ce28ec | matiaslindgren/advent-of-code-cpp | src/tools/elf2cpp.cpp | #include "aoc.hpp"
#include "my_std.hpp"
#include "std.hpp"
using std::operator""s;
using std::operator""sv;
using aoc::skip;
namespace ranges = std::ranges;
namespace views = std::views;
enum class Op : int {
addi = 0,
addr,
bani,
banr,
bori,
borr,
eqir,
eqri,
eqrr,
gtir,
gtri,
gtrr,
muli,... | ALGO | 0.971792 | 5.519463 | {
"github_metadata": {
"branch": "main",
"commit_count": 628,
"repo_created_at": "2023-09-24T20:13:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "149b376a82... |
19d29713-c68c-47bd-b00a-731265899cb8 | Med0sin/3013-Algorithms-Krubally | Assignments/P2/main.cpp | /*****************************************************************************
*
* Author: <NAME>
* Email: <EMAIL>
* Label: P02
* Title: AutoComplete in Linear Time
* Course: CMPS 3013
*
*
* Description:
* Contained within this header... | TOOL | 0.983853 | 4.078352 | {
"github_metadata": {
"branch": "main",
"commit_count": 27,
"repo_created_at": "2023-01-18T19:44: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": "37182237de3... |
6ec2263b-fadb-41da-8a6a-3d9bd4822081 | inglada/OTB | Utilities/ITK/Code/BasicFilters/itkVectorConnectedComponentImageFilter.h | /*=========================================================================
Program: Insight Segmentation & Registration Toolkit
Module: $RCSfile: itkVectorConnectedComponentImageFilter.h,v $
Language: C++
Date: $Date: 2010-03-02 03:40:37 $
Version: $Revision: 1.11 $
Copyright (c) Insight Sof... | TOOL | 0.938173 | 7.238711 | {
"github_metadata": {
"branch": "master",
"commit_count": 10982,
"repo_created_at": "2011-07-01T06:29:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "02be60... |
ec6af769-c561-411f-a70b-e64d0bf40d8f | taharachedi/Algorithms-Problem-Solving-Level-2 | 35 - Check Number In Array/35 - Check Number In Array.cpp | #include <iostream>
#include <cstdlib>
#include <string>
using namespace std;
int Read_Num(string Msg) {
int N = 0;
do
{
cout << Msg << endl;
cin >> N;
} while (N <= 0);
return N;
}
int Random_Number(int From, int To) {
return rand() % (To - From + 1) + From;
}
void Fi... | ALGO | 0.995975 | 3.896022 | {
"github_metadata": {
"branch": "main",
"commit_count": 109,
"repo_created_at": "2024-11-03T20:57: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": "bc1822efd0... |
e7f2844d-d43b-492b-ada9-c670d11344f7 | C5Compound/CLRS | GRAPH/minimum spanning tree.cpp | /**
* 最小生成树
* Kruskal算法的实现依赖于并查集
* Prim算法依赖于最小优先级队列
* 邻接表表示和邻接矩阵表示
*/
struct Edge
{
char x, y;
int weight;
Edge(char a, char b, int c) : x(a), y(b), weight(c) {};
};
/**
* 基于数组的并查集实现
*/
#define SET_MAX 2048
int parent[SET_MAX];
int Rank[SET_MAX];
void make_set(int x)
{
parent[x] = x;
R... | ALGO | 0.999959 | 3.654396 | {
"github_metadata": {
"branch": "master",
"commit_count": 53,
"repo_created_at": "2015-06-23T11:25: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": "6017ee468... |
0b5503fc-3d34-4f00-8c6c-ca995761fb4c | g-4-gagan/Operating-System-Practicals | FCFSWA.cpp | #include<iostream>
using namespace std;
void insertionSort(int arr[], int n,int p[],int t[])
{
int i, key, j,pos,time;
for (i = 1; i < n; i++)
{
key = arr[i];
pos = p[i];
time = t[i] ;
j = i - 1;
while (j >= 0 && arr[j] > key)
{
arr[j + 1] =... | ALGO | 0.999906 | 3.792424 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2021-09-11T17:08: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": "37fb458968df... |
5320cdb6-4c33-437a-9018-48f9d209ea95 | aws/lumberyard | dev/Code/Tools/SphericalHarmonics/PRT/SampleRetrieval.inl | /*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or t... | ALGO | 0.949629 | 5.753045 | {
"github_metadata": {
"branch": "master",
"commit_count": 62,
"repo_created_at": "2017-06-30T05:18:43.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2079,
"forks": 544,
"issues": 49,
"pull_requests": 196
},
"file_meta": {
"content_id": "5b... |
3d5d04a1-7fb2-44d1-8926-5d2fcca4dcff | federicomassa/compton | kn6.cpp | #include <iostream>
#include <string>
#include <cmath>
#include <TCanvas.h>
#include <TGraphErrors.h>
#include <TF1.h>
#include <TFitResult.h>
#include <TAxis.h>
double me = 511; //keV
double r0 = 2.81794; //fm
double Ef(double R, double theta) {
return me*R/(1+R*(1-cos(theta*4*atan(1)/180)));
}
double P(double R,... | ALGO | 0.978657 | 4.08892 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2015-01-07T15:34: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": "b0185f6d51... |
718bc6b6-2856-4970-8c8c-de019b28f94e | istimaldar/DPoSI6 | Laba1/fftwdif.cpp | #include "fftwdif.h"
#include <QDebug>
FFTWDIF::FFTWDIF()
{
}
QVector<std::complex<double>> *FFTWDIF::fastTransform(const QVector<std::complex<double>> &data, bool direction)
{
if (data.size() == 1)
{
QVector<std::complex<double>> *vector = new QVector<std::complex<double>>(1);
(*vector)[0] =... | ALGO | 0.994874 | 5.443882 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2017-01-29T21:35:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4c4c0209d... |
dadae19f-3602-40fc-b5ff-1b1b04c8e08b | SirKoto/tissue-fem | src/sim/solvers/ConjugateGradient.cpp | #include "ConjugateGradient.hpp"
namespace sim {
ConjugateGradient::ConjugateGradient(size_t size)
{
this->resize(size);
}
void ConjugateGradient::resize(size_t size)
{
m_residual.resize((Eigen::Index)size);
m_dir.resize((Eigen::Index)size);
m_Adir.resize((Eigen::Index)size);
m_A_res_precond.resize((Eigen::Inde... | ALGO | 0.999764 | 5.593797 | {
"github_metadata": {
"branch": "main",
"commit_count": 114,
"repo_created_at": "2022-01-29T12:35:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "611398afff... |
87709765-47ae-4e4f-865a-c9009c45b2b4 | GabePlusPlus/Leetcode | 2. Add Two Numbers/solution.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
inline void carry... | ALGO | 0.999982 | 6.468824 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2024-02-05T17:47: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": "de904486c44d... |
cdfe8987-c27b-4be9-bc67-8a4f0fbd1f19 | reliveinfire/codes | 662/662.cpp | #include "../helpers.cpp"
vector<int> preOrder = {100,50, 40, 80, 60, 200, 150, 180, 250};
class Solution {
public:
int ans;
int widthOfBinaryTree(TreeNode* root){
unordered_map<int, pair<int,int>> tb;
ans = INT_MIN;
helper(root, 1, 1, tb);
return ans;
}
void helper(TreeNode* node, i... | ALGO | 0.999911 | 4.896046 | {
"github_metadata": {
"branch": "master",
"commit_count": 53,
"repo_created_at": "2017-08-09T09:13: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": "58a9f1af5... |
96a64aa4-8656-4c8d-b9e9-adeb8c5127d2 | Zeyu-Li/kattis_solutions | bank/bank.cpp | #include <bits/stdc++.h>
typedef long long ll;
using namespace std;
int main() {
int c,t;
cin >> c >> t;
vector<int> picked(t+1, 0);
while (c--) {
int money, t;
cin >> money >> t;
// starting from the time they chose to leave to the start (0 min)
for (int j = t; j >=0... | ALGO | 0.99989 | 3.804574 | {
"github_metadata": {
"branch": "master",
"commit_count": 98,
"repo_created_at": "2020-07-13T13:04:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "47b34904f... |
7b89ea5c-9827-4f15-bace-aee5044d111e | aberhost0/CS1A | homework8/math.cpp | // Attached: HW_8a
// ==========================================================================
// Program: Do the Math
// ==========================================================================
// Programmer: <NAME>
// Class: CS 1A
// ==========================================================================
#inc... | TOOL | 0.994941 | 4.179063 | {
"github_metadata": {
"branch": "main",
"commit_count": 66,
"repo_created_at": "2025-06-02T21:32: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": "e62fdb34a20... |
32a46ba4-df60-4130-a74f-97383364da6f | lprdsb/acm | 2024/8/13/HHH.cpp | #include<bits/stdc++.h>
#define fs(i,x,y) for(int i=(x),_=(y);i<=_;++i)
#define fn(i,x,y) for(int i=(x),_=(y);i>=_;--i)
using namespace std;
typedef long double ll;
// typedef double db;
const int N = 2e6 + 7;
const ll pai = 3.141592653589793238462643383279;
const ll eps = 1e-12;
int n, m;
int dcmp(ll x) {
return... | ALGO | 0.999877 | 3.898124 | {
"github_metadata": {
"branch": "master",
"commit_count": 30,
"repo_created_at": "2023-12-25T11:03: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": "b095c55d9... |
bff0b404-6312-40d1-96e9-ec60127224c9 | loenard97/numerical | numerical/optimize/util.h | #pragma once
#include <cstddef>
#include "../nvector.h"
namespace numerical {
namespace optimize {
template <typename T>
struct OptimizeResult {
T x;
T fx;
std::size_t iterations;
void display() {
printf("OptimizeResult\n");
... | TOOL | 0.914992 | 5.999149 | {
"github_metadata": {
"branch": "main",
"commit_count": 17,
"repo_created_at": "2025-02-14T20:06: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": "7aff2c898a8... |
40d94835-ece7-44fb-b6d3-3be391a09353 | HYEONSIKOH/C_PP-BaekJoon | Source/B1238.cpp | // 백준 1238 [다익스트라] 아모르파티!
#include <iostream>
#include <vector>
#include <queue>
using namespace std;
#define INF 987654321
int N,M,X;
vector< vector<pair<int, int>> > vec;
vector<int> dist;
vector<int> back;
vector<int> come;
void dijkstra_back() {
back[X] = 0; // 처음 위치는 0
priority_queue<pair<int, int>, vector<pa... | ALGO | 0.999969 | 4.438581 | {
"github_metadata": {
"branch": "master",
"commit_count": 186,
"repo_created_at": "2022-07-07T12: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": "67ce6abf... |
8e364451-db37-43fe-aef6-73c2c1a06743 | YashPandey1405/DataStructures-CollegeLab-Codes | DS10_LinkedList.cpp | #include<iostream>
using namespace std;
class Node{
public:
int data;
Node* next;
Node(int CurrData){
this->data=CurrData;
this->next=NULL;
}
};
static int size_LL;
class LinkedList{
private:
Node* Head;
Node* Tail;
public:
L... | ALGO | 0.999923 | 4.733208 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2023-10-03T13:15:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a391484da68... |
19f6b3d9-85ea-468c-8712-ce37456d8071 | abhianand987/DSA | 1.BIT,MATH,STL/1.ON,OFF,TOGGLE,CHECK_SET.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int x; cin>>x;
int onbit,offbit,togbit,checkbit;
cin>>onbit>>offbit>>togbit>>checkbit;
//ON A BIT i.e, agar 0 to 1 kro and 1 to 1 hi rhne do so isme OR lelo 1 ke sath
int onval = x;
int onmask = (1 << onbit);
onval = (onval | onmask);
... | ALGO | 0.999427 | 4.292633 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2021-10-26T11:47: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": "7c2114ec71a4... |
0f3dd445-de43-4e39-b827-c1e9bcbd9407 | stevenjohnstone/lua-grammar | examples/cpp/deps/main.cpp |
#include "LuaLexer.h"
#include "LuaParser.h"
#include "LuaParserBaseListener.h"
#include "antlr4-runtime.h"
#include <iostream>
extern "C" {
#include <lua.h>
#include <luaconf.h>
}
#include <map>
#include <set>
#include <string>
#include <vector>
using namespace antlr4;
typedef std::pair<std::string, std::string> e... | TOOL | 0.922373 | 6.205363 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2020-08-19T11:26:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a7572eb35... |
8970d245-c3b2-4a6a-aa14-c155b7129243 | fengjixuchui/dguard | client/service/DgiService/helpers/internal/helpers.h | //
// Author:
// <EMAIL>
// <NAME>
//
//
#pragma once
#include <new>
#include <string>
#include <vector>
#define _WINSOCKAPI_
#include <windows.h>
#undef _WINSOCKAPI_
#include <set>
#include <map>
#include <ctime>
#include <stdint.h>
#include "log.h"
#include <lm.h>
#define NETWORK_ERROR -1
#define COUNT_OF_C... | TOOL | 0.980285 | 4.763741 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2019-10-23T11:24: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": "c86ecc02fa... |
f22e8a34-9e3e-4f5a-a7bb-7c1b62c04d1d | pratik8696/DSA | GFG/Eventual_Safe_States/solution.cpp | // Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
// Back-end complete function Template for C++
class Solution
{
public:
// Function to perform depth-first search to check if there is a cycle
// and mark the nodes present in the cycle
bool dfs(int u, vector<int> adj[], vector<boo... | ALGO | 0.999937 | 5.949351 | {
"github_metadata": {
"branch": "main",
"commit_count": 263,
"repo_created_at": "2021-08-10T06:13:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 2,
"issues": 1,
"pull_requests": 1
},
"file_meta": {
"content_id": "19cde507ce... |
3cf6a1ea-b4cb-4667-8830-adaa2591d8fe | k3rb3ros/Programming-Challenges | missing_numbers/missing_numbers.cpp | #include <stdint.h>
#include <map>
#include <iostream>
#include <vector>
using namespace std;
class NumberMatcher
{
map<uint64_t, uint32_t> _aCount;
map<uint64_t, uint32_t> _bCount;
map<uint64_t, bool> _solution;
public: NumberMatcher(vector<uint64_t>* a, vector<uint64_t>* b)
{
if (a != n... | ALGO | 0.999898 | 3.930079 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2017-12-25T00:15: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": "dc8009d465... |
495c87ba-aa9d-43bc-81dd-253d6ae3dd88 | wayneprice/AdventOfCode2021 | Day14.part1.cpp | #include <iostream>
#include <map>
#include <vector>
#include <string>
#include <tuple>
#include <algorithm>
#include <limits>
int main(int, char **)
{
// Read polymer template
std::string polymer;
std::cin >> polymer;
// read pair insertion rules
std::map<std::string, std::string> insertionRules... | ALGO | 0.999191 | 4.283677 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2021-12-07T18:28: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": "b0a2e9ed2... |
b257013d-daf4-4b2c-8077-1aa5c5cda2aa | abdelwahab-ahmed-shandy/Programming-Challenges-Multi-Language | Programming Challenges With CPP/01-CPlusPlus-Level-Two-50-Problem/18-Encrypt Decrypt Text.cpp | // 18 - Encrypt / Decrypt Text
#include <iostream>
#include <string>
using namespace std;
string ReadText()
{
string Text;
cout << "Enter Your Text : ";
getline(cin, Text);
return Text;
}
string EncrptText(string Text, int Key)
{
for (int i = 0; i < Text.length(); i++)
{
Text[i] = char((int)Text[i] + Key);
... | ALGO | 0.992452 | 4.455297 | {
"github_metadata": {
"branch": "main",
"commit_count": 191,
"repo_created_at": "2024-07-19T08:24: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": "6b9a5228da... |
cabdf93e-c776-4380-9b87-b4bd7d3f1b71 | Yaser-wyx/ACM | LG/P1023.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long int lli;
/**
* Created with IntelliJ Clion.
* @author wanyu
* @Date: 2018-04-26
* @Time: 20:00
* To change this template use File | Settings | File Templates.
*
*/
#define INF 0xfffffff
#define infinitesimal -2100000000
#define mset(t, x) m... | ALGO | 0.999976 | 3.53602 | {
"github_metadata": {
"branch": "master",
"commit_count": 50,
"repo_created_at": "2018-04-08T04:00:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e758ec990... |
7f360d6d-5d99-435a-84a0-7695ecbb48dd | scoobydooby30/Algo-Wiki | Graph/perm.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector < long long > vll;
typedef pair < long long, long long > pll;
typedef pair < int, int > pii;
typedef vector < int > vi;
typedef vector<vi> vvi;
typedef vector<pii> vpii;
#define rep(i,n) for(int i = 0; i < n; i++)
#define reps(i,a,n) ... | ALGO | 0.999802 | 4.419276 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2018-02-25T15:14:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "78944413b... |
cd418a06-c0d5-4f2f-8aea-3539e9b97746 | PabloNaranjo78/ProyectoII-DatosII-Lets-play | Server/Server.cpp | #include <SFML/Network.hpp>
#include <SFML/Graphics.hpp>
#include "rapidjson/document.h"
#include <string>
#include <iostream>
#include "tinyxml.h"
#include "../AlgoritmoG/Genetic.h"
#include "../AlgoritmoG/Genetic.cpp"
#include "../GameManagment/Board.h"
using namespace sf;
using namespace std;
using namespace rapi... | ALGO | 0.969295 | 4.020725 | {
"github_metadata": {
"branch": "master",
"commit_count": 66,
"repo_created_at": "2021-05-05T04:10:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "cb142a688... |
4ac50c98-b936-45c6-8374-3fcf183d5aab | Karthik-Ragunath/competitive_programming | MaxVolCuboid.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long int
ll testVal(ll A, ll B)
{
ll maxAns = 0;
ll maxIndex = 0;
if(A < B)
{
for(ll i = A - 1, j = 1; i > 0; i--, j++)
{
ll temp = i * (B - j) * j;
if(temp > maxAns)
{
maxIn... | ALGO | 0.999559 | 5.001708 | {
"github_metadata": {
"branch": "master",
"commit_count": 57,
"repo_created_at": "2019-07-01T18:28:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "cff6271d3... |
36de0ef6-aae5-493e-951e-20129de79e80 | alexandraback/datacollection | solutions_1484496_0/C++/ahri/c.cpp | #include <algorithm>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <map>
#include <set>
#include <ctime>
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
#define sz(X) ((int)(X).size())
#define FOREAC... | ALGO | 0.999862 | 3.129574 | {
"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": "31ff37522... |
56b946a7-e82a-4f2c-9646-847f8b20ceb6 | adung1703/Project-1 | Code/Bai 8.cpp | #include <bits/stdc++.h>
using namespace std;
typedef struct Node{
int key;
struct Node* next;
}Node;
Node* makeNode(int X){
Node* p=NULL;
p = (Node*)malloc(sizeof(Node));
p->key=X;
p->next=NULL;
return p;
}
void print(Node *head){
Node *p=head;
while(p!=NULL){
cout << p->key << " ";
p=p->next;
}
cout... | ALGO | 0.999798 | 4.158556 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-11-26T08:13:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "10008801f890... |
5a96653c-c45f-4379-9e66-be915c20ee2d | masonknight22/AAE590-RocketPayload | LightMotorPayload.ino | const int PayloadTrendTrainingKey = 0;
const int PayloadTrendFallingKey = 1;
const int PayloadTrendSteadyKey = 2;
const int PayloadTrendRisingKey = 3;
const int LowLux = 10;
const int LoadingPayload = 0;
const int WaitingPayload = 1;
const int DeployingPayload = 2;
const int Finished = 3;
... | ALGO | 0.942066 | 5.736123 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2023-10-07T06:28: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": "1f49dfe90990... |
fe7f6ff0-b3f1-4395-8327-8fae052ac233 | hermione-05/Leetcode-Problems | 19. Remove Nth Node From End of List/RemoveNthNode.cpp | #include <iostream>
struct ListNode {
int val;
ListNode* next;
ListNode() : val(0), next(nullptr) {}
ListNode(int x) : val(x), next(nullptr) {}
ListNode(int x, ListNode* next) : val(x), next(next) {}
};
class Solution {
public:
ListNode* removeNthFromEnd(ListNode* head, int n) {
L... | ALGO | 0.999962 | 5.991359 | {
"github_metadata": {
"branch": "main",
"commit_count": 42,
"repo_created_at": "2023-10-01T08:44:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 5,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "4f19e88ef5b... |
e2f55d07-65ab-4fb6-85da-06f1f07bd70c | root-project/root | roofit/roostats/inc/RooStats/BayesianCalculator.h | // @(#)root/roostats:$Id$
// Author: <NAME>, <NAME>, <NAME>, <NAME>
/*************************************************************************
* Copyright (C) 1995-2008, <NAME> and <NAME>. *
* All rights reserved. *
* ... | ALGO | 0.991888 | 6.987171 | {
"github_metadata": {
"branch": "master",
"commit_count": 93033,
"repo_created_at": "2013-06-27T10:46:59.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2899,
"forks": 1363,
"issues": 467,
"pull_requests": 269
},
"file_meta": {
"content_id"... |
8efe000b-15a7-428a-8b24-c6e80df4fe67 | Allencutinha/imaging_application | src/sobel_custom.cpp | #include "sobel_custom.h"
using namespace cv;
int sobel_x[3][3] = {-1,0,1,-2, 0,2, -1, 0,1};
int sobel_y[3][3] = {-1,-2,-1,0,0,0,1,2,1};
// Sobel edge detection using only image bugger independent of opencv
void sobel_buffer(uchar* srcBuff, uchar * dstBuff, int width, int height)
{
for (int row=1; row < height; row... | ALGO | 0.902135 | 4.134967 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2015-03-07T07:00: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": "bfdb48d64... |
4a84f74c-c784-406d-bc01-4adda97e0ce2 | mwierzbicki/leetcode-solutions | 526-beautiful-arrangement/beautiful-arrangement.cpp | //
// Suppose you have N integers from 1 to N. We define a beautiful arrangement as an array that is constructed by these N numbers successfully if one of the following is true for the ith position (1 <= i <= N) in this array:
//
// The number at the ith position is divisible by i.
// i is divisible by the number at th... | ALGO | 0.999969 | 5.422964 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2017-10-02T10:14: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": "20bdb7b776... |
7a5ad542-7659-4847-9176-946cf0c30567 | CGAL/cgal | Shape_detection/include/CGAL/Shape_detection/Region_growing/Region_growing.h | // Copyright (c) 2018 INRIA Sophia-Antipolis (France).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org).
//
// $URL$
// $Id$
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
//
//
// Author(s) : <NAME>, <NAME>, <NAME>, <NAME>
//
#ifndef CGAL_SHAPE_DETECTION_REGION_GROWING... | ALGO | 0.998719 | 3.579619 | {
"github_metadata": {
"branch": "master",
"commit_count": 113659,
"repo_created_at": "2014-10-01T12:22:47.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 5443,
"forks": 1475,
"issues": 511,
"pull_requests": 136
},
"file_meta": {
"content_id... |
52ab6665-e46d-4a52-8276-c4a9f00308ce | achintya12345/C- | TwoSum2.cpp | /*Given an array of integers nums and an integer target, return indices of the two numbers such that
they add up to target.
You may assume that each input would have exactly one solution, and you may not use the same element
twice.
You can return the answer in any order.
Example 1:
Input: nums = [2,7,11,15], targ... | ALGO | 0.999986 | 5.868595 | {
"github_metadata": {
"branch": "master",
"commit_count": 24,
"repo_created_at": "2025-01-29T09:28: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": "c3738fb74... |
82ff5999-ea58-4e2e-9d1c-f7aeb654ff99 | jcliberatol/SICSRepository | SICS/src/estimation/bayesian/LatentTraitEstimation.h | /*
* LatentTraitEstimation.h
*
* Author: cesandovalp
*/
#ifndef LATENTTRAITESTIMATION_H_
#define LATENTTRAITESTIMATION_H_
#include <model/Model.h>
#include <type/LatentTraits.h>
#include <sstream>
#include <type/Constant.h>
#include <optimizer/Brent_fmin.h>
#include <cstdlib>
#define t_zita t_model->paramete... | ALGO | 0.99551 | 5.843199 | {
"github_metadata": {
"branch": "master",
"commit_count": 356,
"repo_created_at": "2014-05-13T17:11:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 1,
"issues": 7,
"pull_requests": 0
},
"file_meta": {
"content_id": "80ee6f30... |
32d97de4-e941-40f9-8a73-7c3171a0b947 | mcygorek/ACE | src_exec/experimental/richardson_extrapolate.cpp | #include "ACE.hpp"
#include "ReadTable.hpp"
/*
Richardson extrapolation:
Combine two ACE calculations with different time step widths dt.
If ACE has an error ~dt^2, Richardson extrapolation will lead to an error ~dt^3
Usage: e.g.:
> richardson_extrapolate -infile dt5e-2.out dt1e-1.out -outfile richardson.out
*/
u... | ALGO | 0.978983 | 5.508022 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2021-01-07T22:13:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 13,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4da7bc91... |
57dd4402-54f3-413f-b841-e5feafec589a | mathewbushuru/algorithms | data-structures/binary-tree/cpp/binaryTree.cpp | // g++ -std=c++17 binaryTree.cpp -o binaryTree && ./binaryTree
/*
* Use std::unique_ptr for automatic memory management to ensure memory for
* nodes is properly deallocated when no longer needed to prevent memory leaks.
*/
#include <iostream>
#include <memory> // for smart pointers support
class Node {
pub... | ALGO | 0.999533 | 7.490265 | {
"github_metadata": {
"branch": "main",
"commit_count": 102,
"repo_created_at": "2023-05-30T15:05: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": "dcddbe4334... |
e999e8f0-3ed2-473d-b0fa-44c54192c926 | liu305/algorithm_toolbox | week5/knapsack/knapsack.cpp | #include <iostream>
#include <vector>
using std::vector;
int optimal_weight(int W, const vector<int> &ws) {
int tmp_compare;
int n = ws.size();
std::vector<std::vector<int>> dpw(W+1,std::vector<int>(n,0));
for (int w = 0; w <= W; ++w) dpw[w][0] = 0;
for (int ws_index = 0; ws_index <= n; ++ws_index... | ALGO | 0.99999 | 4.695095 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2017-03-12T04:07: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": "9d3daa6d4... |
5469f37a-15a3-4db8-9fc9-4db20cf11065 | sam19980301/MyLeetcode | 113.path-sum-ii.cpp | /*
* @lc app=leetcode id=113 lang=cpp
*
* [113] Path Sum II
*/
// @lc code=start
/**
* 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),... | ALGO | 0.999984 | 6.599048 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-02-24T15:10: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": "5551f62019fa... |
c41b6e7e-7547-42ea-bf58-1a581e41fb72 | sankalp1999/3rdSem-Data-Structures-Lab | Lab8_Doubly_Linked_List/dll.cpp | #include <iostream>
using namespace std;
class dll
{
dll *prev;
dll *next;
int data;
public :
void create(int ele);
void insBefore();
void delSpecific();
void display();
void delend();
void insAfter();
void reverse();
void insert_specific(int ele, int pos);
};
dll *first = N... | ALGO | 0.999697 | 5.221377 | {
"github_metadata": {
"branch": "master",
"commit_count": 118,
"repo_created_at": "2019-10-27T17:22:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 28,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e823bda... |
95c278e2-023b-4c75-add6-99cd951688b3 | iamahiroki/coder | AtCoderBeginnerContest/286/c.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int64_t n,a,b;
string s;
cin >> n >> a >> b >>s;
string ss = s+s;
int64_t max =1000000000000000000;
int64_t aaa =0;
int64_t A[n];
for (int i=0;i<n;i++) {
int m =0;
int v = s.size()-1;
for(int j=0;j<(n... | ALGO | 0.999293 | 3.440448 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2023-01-02T13:45:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0f30fd54d15... |
89b1a681-428f-4dc3-8dde-3c09019ffce6 | ManishDV/Engineering-Assignments | SE-SEM2-Assigns/CGL/DottedBres.cpp | #include<iostream>
#include<GL/gl.h>
#include<GL/glu.h>
#include<GL/glut.h>
#include<math.h>
using namespace std;
struct Point{
int x;
int y;
};
struct Point p1;
struct Point p2;
int count = 0;
int sign(int d){
if(d < 0)return -1;
else if(d > 0)return 1;
else return 0;
}
void putpixel(int x,int y... | ALGO | 0.967115 | 4.850612 | {
"github_metadata": {
"branch": "master",
"commit_count": 212,
"repo_created_at": "2019-07-02T13:48:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "99bfd0a4... |
0da0ba1d-c38f-4f2f-b601-a80d1f393f47 | iernstig/HackerEarth | dynamic_programming/2d/matrixSum.cpp | #include <iostream>
#include <vector>
#include <fstream>
using namespace std;
struct Pair{
int x;
int y;
};
void printMatrix(vector<vector<int>> matrix){
for(int i = 0; i < matrix.size(); i++){
for(int j = 0; j <matrix[i].size(); j++){
cout << matrix[i][j] << " ";
}
cou... | ALGO | 0.999511 | 4.480124 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2018-07-22T15:01:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4cf21a5ae3... |
7d31ea86-bc2b-47ef-8384-13535b44a149 | ChangminYi/Baekjoon_code | 17490_일감호에 다리 놓기/소스.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
typedef long long lint;
int graph[1000005][2] = { 0 };
int main(void) {
cin.sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
int N, M;
lint K;
vector<int> stones;
vector<bool> visited;
vector<vector<int>> component... | ALGO | 0.999998 | 4.392462 | {
"github_metadata": {
"branch": "master",
"commit_count": 725,
"repo_created_at": "2021-05-13T06:59:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "79f179c2... |
11a55a7b-5422-4269-a6bb-e02d67bc1e07 | kk2a/library | graph/bcc.hpp | #ifndef KK2_GRAPH_BCC_HPP
#define KK2_GRAPH_BCC_HPP 1
#include <functional>
#include <vector>
#include "lowlink.hpp"
namespace kk2 {
template <class G> struct BCC : LowLink<G> {
BCC(const G &g_) : LowLink<G>(g_) { init_bcc(); }
std::vector<std::vector<int>> group_e;
std::vector<int> comp_e;
private:... | ALGO | 0.998728 | 6.591781 | {
"github_metadata": {
"branch": "main",
"commit_count": 987,
"repo_created_at": "2023-10-05T22:31:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 11,
"pull_requests": 0
},
"file_meta": {
"content_id": "ddaf84504... |
5ab1b00c-0738-48b3-b0e8-13081abe6119 | xiaozhuyfk/DeepDriving | torcs-1.3.6/src/drivers/olethros/Trajectory.h | // -*- Mode: c++ -*-
// copyright (c) 2006 by <NAME> <<EMAIL>>
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of... | ALGO | 0.99823 | 5.554074 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2016-10-05T20:43:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e93033f966... |
be57ea16-9564-49e4-b552-383545832138 | ayamahmod/competitive-programming | LeetCode/Algortihms/37. Sudoku Solver.cpp | class Solution {
public:
void solveSudoku(vector<vector<char>>& board) {
vector<pair<int, int> > v;
vector<int> rows(9,0);
vector<int> columns(9,0);
vector<int> boxes(9,0);
Find_emptyCells(board, v, rows, columns, boxes);
cout<<Find_Soln(board, v, 0, rows, columns, bo... | ALGO | 0.999908 | 6.445285 | {
"github_metadata": {
"branch": "master",
"commit_count": 43,
"repo_created_at": "2016-10-21T11:08:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "881a75cca... |
4cbf8147-d0f8-4c69-a059-28b0c66ebd9d | ishandutta2007/codeforces-i | itst/normal/223/E.cpp | #include<bits/stdc++.h>
using namespace std;
const int _ = 3e5 + 7;
#define ld long double
struct comp{
int x , y; comp(int _x = 0 , int _y = 0) : x(_x) , y(_y){}
friend comp operator +(comp p , comp q){return comp(p.x + q.x , p.y + q.y);}
friend comp operator -(comp p , comp q){return comp(p.x - q.x , p.y - q.y);}... | ALGO | 0.999987 | 4.534905 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T05:39:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "11d76c5a06ec... |
16a60b4c-0bdf-4d54-a4e9-0c22a5051ce0 | nbirkbeck/monoflow | src/contdepth/compare.cc | /**
A function to compare the results of the disparity
estimation (including warped images and to ground truth).
*/
#include "DisparitySequence.h"
#include "EpipolarLine.h"
#include "utils.h"
#include <nmisc/commandline.h>
#include <nimage/image.h>
#include <vector>
typedef double ImageStats;
std::vector<imag... | TEST | 0.96484 | 5.831873 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2020-12-24T04:47:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "81406975201d... |
081d5786-2d3a-4c41-80b6-8aee5ab3f80b | Ganzeus/Ganzeus | Code/2022/刷题/PAT/A1139.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <string>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <math.h>
using namespace std;
#define ll long long
#define INF 0x3f3f3f3f
const int maxn = 320;
int n, m, k;
map<string, int> indx; // id->编号
map<int, ... | ALGO | 0.99984 | 3.628663 | {
"github_metadata": {
"branch": "master",
"commit_count": 150,
"repo_created_at": "2021-06-13T06:48:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bb3df55c... |
97b4d957-7fb7-40fb-afbb-9e4fc12ec2fb | Teveillan/templates | Manacher.cpp | const int MAX_LEN = 1e5 + 10;
int Len[MAX_LEN<<1]; //记录算法完成后以i点为中心最长回文串向左向右延伸的半径
struct Manacher {
char tmp_str[MAX_LEN<<1]; //记录预处理过后的字符串
int init(char *s) { //在solve中就直接调用了。对原串进行预处理。
int len = strlen(s);
int id = 0;
tmp_str[id++] = '#';
for(int i=0; i<len; ++i) {
t... | ALGO | 0.999967 | 3.900344 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2016-04-30T07:55:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "764c6aca29... |
5fda4b14-b13b-42c1-a0c9-890d091a2a02 | subharya83/cvml-exercise | ex26/logoTracker.cpp | #include <opencv2/opencv.hpp>
#include <iostream>
#include "sort.h" // Include the SORT tracker implementation
class ORBLogoDetector {
public:
ORBLogoDetector(const cv::Mat& logo_image) : logo_image(logo_image) {
orb = cv::ORB::create();
bf = cv::BFMatcher(cv::NORM_HAMMING, true);
orb->det... | ALGO | 0.999733 | 6.735268 | {
"github_metadata": {
"branch": "main",
"commit_count": 431,
"repo_created_at": "2024-12-15T18:24:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 35,
"forks": 4,
"issues": 6,
"pull_requests": 0
},
"file_meta": {
"content_id": "66034c426... |
84b73c9d-ba39-4c0b-b488-af2457565c60 | ouyangyewei429/ACM-ICPC | POJ/poj 1573.cpp | #include <stdio.h>
#include <string.h>
#define onlinejudge
const int maxn = 12;
char maze[maxn][maxn];
int n, m, s, vis[maxn][maxn];
bool IsInBound(int x, int y)
{
if (x<0 || y<0 || x>=n || y>=m)
return false;
return true;
}/* IsInBound */
int main()
{
#ifdef onlinejudge
freopen("E:\\hdoj... | ALGO | 0.999867 | 3.539356 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2014-07-31T01:34:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2e4ff8d44d... |
ed921e6e-152c-4513-b531-d9da08349b4a | CodesByNehaal/CPP_DS_Academics | PRACTICAL 3.cpp | /*
NAME : <NAME>
BATCH : A(A3)
ROLL NO. : 63
PRN NO. : 0120200245
Practical 3 : Design and develop program for insertion, up-dating, searching, sorting, listing and deletion operations using singly linked list
for placement information system
*/
#include <iostream>
using namespace std;
class node
{
public:
int r... | TOOL | 0.99915 | 3.569766 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2022-07-20T05:36: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": "faca4c1fdd4... |
6b552513-0a56-498d-9f32-606105bff8ad | codewithaman07/Codechef-Solutions | K_Boxes.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 Aman() ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define endl '\n'
#define int long long
#define pb push_back
#define all(x) x.begin(), x... | ALGO | 0.999994 | 4.412907 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2025-02-04T09:27: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": "8cdd9984c4d... |
5dae9cc3-db08-4edb-a121-d57b8d944fa9 | OHUSAR/OHUSAR.github.io | Prototype/lib/Sources/BoundingBoxes/BoundingBoxes.cpp | // BoundingBoxes.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
#include "BasicDefs.h"
#include "SimplePolygonConvexHull.h"
#include "AxisAlignedBoundingBox.h"
#include "ObjectOrientedBoundingBox.h"
#include "CollisionDetector.h"
using namespace BoundingBoxes;
... | ALGO | 0.963738 | 5.194872 | {
"github_metadata": {
"branch": "master",
"commit_count": 40,
"repo_created_at": "2016-10-24T19: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": "6e033abb0... |
7c1b7707-b89e-4bd3-9017-e96136ae41ae | ngodangtan/Data_Structure_And_Algorithm | Bai_tap/Buoi02/Bai_tap_buoi02.cpp | //
// Created by <NAME> on 21/2/25.
// MSSV: <EMAIL>
//
#include <iostream>
using namespace std;
struct Node {
float value;
Node* pNext;
};
struct List {
Node* pHead;
Node* pTail;
};
/* Hàm khởi tạo Node
Input: truyền vào float value
Output: return Node
*/
Node* initNode(float value) {
Node* newNode = ne... | ALGO | 0.999079 | 4.602118 | {
"github_metadata": {
"branch": "main",
"commit_count": 142,
"repo_created_at": "2025-02-17T11:21: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": "dd482e8efb... |
c7209cf5-da20-4fa3-a7fe-7bd35eb11583 | NandeeshPuri/CSES | Graph Algorithm/messageroute.cpp | #include <bits/stdc++.h>
using namespace std;
#define ar array
#define ll long long
const int MAX_N = 1e5 + 1;
const ll MOD = 1e9 + 7;
const ll INF = 1e9;
ll n,m,dist[MAX_N],pre[MAX_N];
vector<int>adj[MAX_N];
void solve() {
cin >> n >> m;
for (int i = 0; i < m; i++) {
int u, v; cin >> u >> v;
adj[u].push_b... | ALGO | 0.999991 | 4.066082 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-08-03T05:51: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": "663b5dff147f... |
c3dde784-759d-49e8-85ba-cc8e7e030a35 | jatinlifo/DSA-QUESTIONS-PARTICE | LEETCODE_TOP_INTERVIEW_150_QUESTION/Q11_H_INDEX_I/solution.cpp | // 274. H-Index
// Given an array of integers citations where citations[i] is the number of citations a researcher received for their ith paper, return the researcher's h-index.
// According to the definition of h-index on Wikipedia: The h-index is defined as the maximum value of h such that the given researcher has p... | ALGO | 0.999963 | 5.192199 | {
"github_metadata": {
"branch": "main",
"commit_count": 81,
"repo_created_at": "2024-07-14T07: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": "159ecc1d40c... |
4b4d1ed7-725c-4426-9489-b240f5735608 | phitronio/XPSC_Batch_05 | Starters 158/Multiply 2 to Minimize.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int t;
cin >> t;
while (t--) {
int n;
cin >> n;
vector<ll> a(n);
for (int i = 0;i < n;i++) {
cin >> a[i];
}
vector<int> ans;
... | ALGO | 0.999921 | 3.680811 | {
"github_metadata": {
"branch": "main",
"commit_count": 40,
"repo_created_at": "2024-10-26T11:59:30.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 13,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3029481bc99... |
87e34f89-3232-4c40-920d-3b572cd42d80 | akashlilhare/cpp | stack-and-queues/parenthesis_checker.cpp | /*
Parenthesis Checker
Given an expression string x. Examine whether the pairs and the orders of “{“,”}”,”(“,”)”,”[“,”]” are correct in exp.
For example, the function should return 'true' for exp = “[()]{}{[()()]()}” and 'false' for exp = “[(])”.
Example 1:
Input:
{([])}
Output:
true
Explanation:
{ ( [ ] ) }. Sam... | ALGO | 0.998581 | 5.78203 | {
"github_metadata": {
"branch": "main",
"commit_count": 89,
"repo_created_at": "2021-01-17T08:05:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "49027b68c83... |
4095c845-8d7c-4b37-b577-c13501ecb6c8 | oneminot/oo | main/binfilter/bf_sw/source/core/doc/sw_docdde.cxx | /**************************************************************
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to y... | TOOL | 0.91558 | 3.462754 | {
"github_metadata": {
"branch": "AOO34",
"commit_count": 1689,
"repo_created_at": "2014-11-05T23:34:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "486b23ec... |
6928f1f5-7001-4879-9ce1-9673d5939a97 | Paradoxiao/OJ-and-PTA | C++/OJ/H8/b.cpp | #include <iostream>
#include <string>
using namespace std;
class Score {
private:
double score;
protected:
public:
Score(double score) : score(score) {}
void input() {
cin >> score;
}
double print() const {
return score;
}
string grade() const {
if (score < 0 || score > 100)
return "err... | ALGO | 0.981817 | 3.53015 | {
"github_metadata": {
"branch": "main",
"commit_count": 57,
"repo_created_at": "2025-05-25T13:26:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0d51fd5e8df... |
0952633f-b023-4c3e-aff2-fa78251ffeeb | jonyroy/online-judge-problem-solutions | uva-online-judge/UVA-11340.cpp | #include<list>
#include<map>
#include<set>
#include<deque>
#include<queue>
#include<stack>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<utility>
#include<algorithm>
#include<iostream>
#include<cstring>
#include<vector>
#include<cstring>
#include<cassert>
#include<ctime>
#include<sstream>
#include<stdbool... | ALGO | 0.983784 | 3.150312 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2017-05-06T04:32: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": "b7336cefbb... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.