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 |
|---|---|---|---|---|---|---|---|
ca479b21-d990-41a7-b045-8f65ffb6de96 | parikhitritgithub/DataStructures-Algorithms | Graphs/g5.cpp | // undirected
#include<iostream>
#include<vector>
using namespace std ;
int main () {
int vertex , edges ;
cin >> vertex >> edges ;
vector <int > adj [vertex] ;
int u , v ;
for (int i = 0 ; i < edges ; i++) {
cin >> u >> v ;
adj[u].push_back(v) ;
adj[v].push_... | ALGO | 0.999931 | 4.56678 | {
"github_metadata": {
"branch": "main",
"commit_count": 16,
"repo_created_at": "2024-04-16T17:25:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "104da07c6bb... |
f3216ede-63c7-4adb-88bc-1add6267b673 | gpgpu-sim/pytorch-gpgpu-sim | caffe2/video/video_io.cc | #include <caffe2/video/video_io.h>
#include <caffe2/core/logging.h>
#include <algorithm>
#include <random>
#include <string>
namespace caffe2 {
// assume CLHW order and color channels RGB
void Saturation(
float* clip,
const int length,
const int crop_height,
const int crop_width,
const float alpha... | TOOL | 0.987084 | 6.825769 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2018-11-11T16:37:58.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 55,
"forks": 30,
"issues": 6,
"pull_requests": 1
},
"file_meta": {
"content_id": "7245826e... |
391ff4c7-2b2d-4855-836d-332f3ce1722d | zjucsxxd/VisionSDK | s32v234_sdk/benchmarks/cvORB/Source_Code/filtering.h | /*****************************************************************************
*
* Freescale Confidential Proprietary
*
* Copyright (c) 2014 Freescale Semiconductor;
* All Rights Reserved
*
*****************************************************************************
*
* THIS SOFTWARE IS PROVIDED BY FREESCALE "AS IS" A... | CONFIG | 0.978143 | 3.803004 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2016-05-15T14:02:18.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "75a776b75e... |
4c3286fe-2b0e-452f-8ee2-869bb2dcc201 | MostafaGalal1/CP-Submissions | Codeforces/1631/172593966.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll N = 1e5+7, mod = 1e9+7;
void fast() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); }
int main()
{
fast();
ll t;
cin >> t;
while (t --> 0){
ll n, m1 = 0, m2 = 0;
cin >> n;
ve... | ALGO | 0.999991 | 4.221552 | {
"github_metadata": {
"branch": "main",
"commit_count": 1484,
"repo_created_at": "2023-10-10T14:00:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1f6e9a861... |
9681f053-a943-4cbd-8bb8-d17ec6a0a6da | caupiiz/club-algoritmia-upiiz | EjerciciosSesiones/2020-1/semana7/optBubbleSort.cpp | #include <bits/stdc++.h>
#define ciclo for
using namespace std;
// Algoritmo de ordenamiento burbuja optimizado
void ordenar(int arr[], int n);
void mostrar(int arr[], int n);
int main() {
// 6, 5, 3, 1, 8, 7, 2, 4
int arr[] = {6, 5, 3, 1, 8, 7, 2, 4};
int n = 8;
mostrar(arr, n);
ordenar(arr, n);
... | ALGO | 0.999979 | 5.144814 | {
"github_metadata": {
"branch": "master",
"commit_count": 230,
"repo_created_at": "2020-01-29T19:10:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 31,
"forks": 7,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "104fa04... |
7b05d949-8d52-46df-9fa0-f1d798c53287 | yangjinyin/OffTimePractice | Maxfilp.h | #include <iostream>
#include <queue>
#include <cstdio>
#include <cstring>
using namespace std;
int v[100][100];
bool hasPaht(int g[][5],int s,int t,int *path)
{
bool visited[6]={false};
queue<int> q;
q.push(s);
visited[s] = true;
//BFS
while(q.size())
{
int top =q.front();
q.pop();
for(int i = 0;i<5;i+... | ALGO | 0.999761 | 3.923704 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-03-01T03:43:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0a3631a24f... |
019fc578-f9f9-4ea5-8952-d17fcc21825a | miracl/MIRACL | source/curve/pairing/ake2cpt2.cpp | /*
Scott's AKE Client/Server testbed
See http://eprint.iacr.org/2002/164
Compile as
cl /O2 /GX /DZZNS=16 ake2cpt2.cpp ecn2.cpp zzn2.cpp big.cpp zzn.cpp ecn.cpp miracl.lib
using COMBA build
Cocks-Pinch curve - Type 2 Tate pairing
Requires file k2.ecs which contains details of non-supersingular... | ALGO | 0.995982 | 4.438039 | {
"github_metadata": {
"branch": "master",
"commit_count": 45,
"repo_created_at": "2012-11-06T01:20:49.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 683,
"forks": 243,
"issues": 67,
"pull_requests": 12
},
"file_meta": {
"content_id": "2699... |
8349108f-ad32-4af8-ab26-3458e83c99f1 | shaomingfu/sgraph | mwutest/src/optimization.cc | /*************************************************************************
ALGLIB 3.10.0 (source code generated 2015-08-19)
Copyright (c) <NAME> (ALGLIB project).
>>> SOURCE LICENSE >>>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as publishe... | ALGO | 0.999606 | 6.477821 | {
"github_metadata": {
"branch": "master",
"commit_count": 84,
"repo_created_at": "2016-07-28T01:08: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": "48e13ba68... |
eecc7de7-b97e-420d-9a8b-9405b02780fd | hujunyu1222/leetcode | Spiral Matrix.cpp | #include <iostream>
#include <vector>
#include <string>
using namespace std;
//[[ 1, 2, 3 ],[ 4, 5, 6 ],[ 7, 8, 9 ]]
vector<int> spiralOrder(vector<vector<int>>& matrix) {
vector<int> res;
int i, j;
int x1 = 0;
int y1 = 0;
int rows = matrix.size();
int cols = matrix... | ALGO | 0.999979 | 5.658019 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2016-10-23T07:52: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": "afc3ed0104... |
d9791486-8ade-4f56-b151-39609acb7e4d | Yawn-Sean/Daily_CF_Problems | daily_problems/2024/08/0830/personal_submission/cf768b_Equinox.cpp | #include <bits/stdc++.h>
// #include <ranges>
using u32 = unsigned;
using i64 = long long;
using u64 = unsigned long long;
constexpr int P = 1'000'000'007;
void solve() {
i64 n, l, r;
std::cin >> n >> l >> r;
auto dfs = [&](auto &&self, i64 x, i64 l, i64 r) -> int {
if (x < 2) return x;
... | ALGO | 0.999682 | 5.05729 | {
"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": "5639... |
6ca9f6f4-250b-4798-a973-f07bd1ffc9a1 | duckdb/duckdb | extension/icu/third_party/icu/common/ubidiwrt.cpp | // © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
******************************************************************************
*
* Copyright (C) 2000-2015, International Business Machines
* Corporation and others. All Rights Reserved.
*
***********... | ALGO | 0.999789 | 7.639557 | {
"github_metadata": {
"branch": "main",
"commit_count": 59407,
"repo_created_at": "2018-06-26T15:04:45.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 31074,
"forks": 2450,
"issues": 412,
"pull_requests": 112
},
"file_meta": {
"content_id":... |
80e55df2-af28-4878-918a-823bc0d02dc9 | awerty1/basics_C_plus_plus_programming | 9 variant/lab2.4.cpp | /*
Задание 4. Написать программу для вычисления суммы бесконечного
сходящегося ряда. Суммирование прекратить при появлении в сумме слагаемых,
имеющих абсолютную величину, меньшую заданной погрешности вычисления
функции d. Другими словами, производить суммирование до тех пор, пока
текущий член ряда больше погрешност... | ALGO | 0.999641 | 4.331815 | {
"github_metadata": {
"branch": "main",
"commit_count": 1603,
"repo_created_at": "2023-04-05T19:36:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6542542b3... |
5fa63bc9-26fc-4d1f-8115-b8ea27b0c7e7 | yfurukawa/AOJ | ITP1_6B/find.cpp | #include <iostream>
#include <string>
using namespace std;
void output( const bool *card, const string type);
int main(){
int n(0);
bool s[13], h[13], c[13], d[13];
char cardType;
int number(0);
for( int i = 0; i < 13; ++i ){
s[i] = false;
h[i] = false;
c[i] = false;
d[i] = false;
}
ci... | ALGO | 0.977691 | 3.570843 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2015-03-29T14:11: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": "b07d44184... |
04504792-c72a-47eb-8b4d-5a3cc1638b78 | sumitpatidar9/Data-Structures-and-Algorithms | BinarySearch/KokoEatingBananas875.cpp | class Solution {
public:
int maximum(vector<int> piles){
int maxElement = INT_MIN;
int n = piles.size();
for(int i = 0; i<n; i++){
maxElement = max(maxElement, piles[i]);
}
return maxElement;
}
long long int maxHours(vector<int> piles, int hrs){
i... | ALGO | 0.999961 | 5.595128 | {
"github_metadata": {
"branch": "main",
"commit_count": 29,
"repo_created_at": "2024-10-21T14:36: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": "79aed7bbe33... |
add86f3c-509d-45f4-9746-ec6f9ecf8635 | ACM-TOMS/CALGO | 0940/Original-Submission/Nektar/library/Demos/LocalRegions/LocPrismExpDemo.cpp | #include "StdRegions/StdExpansion3D.h"
#include "LocalRegions/PrismExp.h"
#include "LocalRegions/LocalRegions.hpp"
#include "LibUtilities/Foundations/Foundations.hpp"
#include "LibUtilities/Foundations/Basis.h"
#include "SpatialDomains/MeshComponents.h"
#include <algorithm>
#include <iostream>
#include <limits>
#... | ALGO | 0.96137 | 5.191999 | {
"github_metadata": {
"branch": "main",
"commit_count": 36,
"repo_created_at": "2021-11-17T18:24:28.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 11,
"forks": 1,
"issues": 9,
"pull_requests": 0
},
"file_meta": {
"content_id": "4879fe5ecd9... |
09d09d01-0cf4-4d9f-94e1-802a1408b4bf | andrei-boaca/my_temp | templates/bignum.cpp | #include <bits/stdc++.h>
//#pragma GCC optimize ("03")
#define FastIO ios_base::sync_with_stdio(false) , cin.tie(0) , cout.tie(0)
#define FILES freopen("gard2.in" , "r" , stdin) , freopen("gard2.out" , "w" , stdout)
#define ll long long
#define ull unsigned long long
#define ld long double
#define eb emplace_back
#defi... | ALGO | 0.998823 | 3.561526 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-03-26T18:47: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": "b48265a56de3... |
41c6520f-1004-451a-b981-8209791cd138 | Muneef-10/2nd-Year | Ashish sir/Linked list/a14.cpp | #include<iostream>
using namespace std;
struct node
{
int cons,exp;
struct node *next;
};
typedef struct node node;
void CreateNode(node **head,int cons, int exp)
{
node *tmp = (node*)malloc(sizeof(node));
tmp->cons = cons;
tmp->exp = exp;
tmp->next = NULL;
if (*head==NULL)
{
... | ALGO | 0.999458 | 3.929029 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2025-07-02T08: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": "4682faa44a6... |
e21ce454-b715-4962-b365-a2dbec16ba58 | singhkunal01/Some-Algos-Techniques | Design Stack using array.cpp | /*---------------------------------Design stack ---------------------------------*/
#include<bits/stdc++.h>
using namespace std;
void push(int value , int &top, vector<int> &stack) {
if (top == stack.size() - 1)
cout << " Stack is Full " << endl;
else {
top++;
stack[top] = value;
}
}
void pop(int &top, ve... | ALGO | 0.995108 | 3.747735 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2021-08-07T18:41: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": "0df4387f4... |
21abe022-60a9-45be-8b32-99858c9e1146 | ishandutta2007/codeforces-n | neal/normal/1572/F.cpp | #include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <chrono>
#include <cmath>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <vector>
using namespace std;
// htt... | ALGO | 0.999456 | 4.228623 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T15:35: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": "060054a548bb... |
36ec64db-4f2b-4ef0-8031-81445aefe6c9 | SaiVamshiK/revised-ds | Graphs/prim algorithm.cpp |
#include <bits/stdc++.h>
using namespace std;
int getMinVertex(bool *visited,int *wt,int n)
{
int ans=-1;
for(int i=0;i<n;i++)
{
if((!visited[i])&&(ans==-1||(wt[ans]>wt[i])))
{
ans=i;
}
}
return ans;
}
int main() {
int n,e;
cin>>n>>e;
int **edges=n... | ALGO | 0.999997 | 4.329424 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2022-03-20T15:43: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": "8634d94dc4... |
fb6993f2-ff80-455d-a684-77559fbc48fe | aaronzshey/COMSC200 | Assignment 8/Aaron_Shey_Polynomial.cpp | #include "Aaron_Shey_Polynomial.h"
#include <iostream>
#include <vector>
using namespace std;
#ifndef POLYNOMIAL_H
#define POLYNOMIAL_H
// 1. I started out by automatically setting the size of the vector to 5 and
// filling it with 0's.
Polynomial::Polynomial() { vector<int> internal(5, 0); };
// 2. I also overloade... | TOOL | 0.968694 | 4.364616 | {
"github_metadata": {
"branch": "main",
"commit_count": 66,
"repo_created_at": "2023-08-21T22:36:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b95b1f53c92... |
d1e5bfdf-797c-4ca7-aef0-ddc8af2fe3a3 | seongahpark/Algorithm_Study | Week005/Thedum2/boj_14889_Thedum2.cpp | #include <iostream>
#include <vector>
using namespace std;
int fsize;
int result=4500000000;
bool check[21] = { false, };
int startlist[10];
int linklist[10];
int Field[21][21];
void dfs(int cur, int cnt) {
if (cnt == fsize / 2) {
int start = 0;
int link = 0;
int k = 0;
for (int... | ALGO | 0.999968 | 3.814677 | {
"github_metadata": {
"branch": "main",
"commit_count": 335,
"repo_created_at": "2021-09-13T08:27:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "46641bd7c1... |
5c44f50b-76c7-4c32-9534-8e0c8fcc999e | AIS-Bonn/TopiCo | ROS/topico/src/abcefg_T_P.cpp | //
// Academic License - for use in teaching, academic research, and meeting
// course requirements at degree granting institutions only. Not for
// government, commercial, or other organizational use.
//
// abcefg_T_P.cpp
//
// Code generation for function 'abcefg_T_P'
//
// Include files
#include "abcefg_T_P.h"
#in... | ALGO | 0.999364 | 6.040004 | {
"github_metadata": {
"branch": "master",
"commit_count": 27,
"repo_created_at": "2018-10-22T08:14:58.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 136,
"forks": 36,
"issues": 3,
"pull_requests": 1
},
"file_meta": {
"content_id": "0a2e882... |
9963e4e3-f06d-4f05-9391-8fe3fb501238 | yusukeuemura/cs_academy_practice | Greedy/Monotone_Subarray/monotone_subarray.cpp | #include <iostream>
#include <vector>
#include <algorithm>
int main() {
int n, status = 0, monotone = 1, max = 0, equal = 1;
std::cin >> n;
std::vector<int> a(n);
std::cin >> a[0];
for (int i = 1; i < n; i++) {
std::cin >> a[i];
if (status == 0) {
if (a[i - 1] > a[i]) {
... | ALGO | 0.999986 | 4.252627 | {
"github_metadata": {
"branch": "master",
"commit_count": 127,
"repo_created_at": "2018-04-04T09:29:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "cf087836... |
f07cb46a-38bc-4bd1-a4a2-a25164cf5089 | OpenXRay/xray-15 | cs/sdk/include/boost/mpl/lower_bound.hpp | //-----------------------------------------------------------------------------
// boost mpl/lower_bound.hpp header file
// See http://www.boost.org for updates, documentation, and revision history.
//-----------------------------------------------------------------------------
//
// Copyright (c) 2001-02
// <NAME>
//
... | ALGO | 0.999183 | 6.778915 | {
"github_metadata": {
"branch": "xd_dev",
"commit_count": 610,
"repo_created_at": "2014-08-22T12:09:41.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 175,
"forks": 64,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "d3fdcf... |
353f2518-3596-4451-a39e-0a0a70fb916b | ishandutta2007/codeforces-r | rns3/normal/947/B.cpp | #include <bits/stdc++.h>
using namespace std;
#define N 101010
int n, a[N], b[N];
long long s[N];
int t[N];
void add(int i, int j) {
t[i-1] ++;
t[j] --;
}
long long ans[N];
void solve() {
int sum = 0;
for (int i = 1; i <= n; i ++) {
sum += t[i-1];
ans[i] += 1ll * sum * b[i];
}
}
int main() {
//freopen... | ALGO | 0.999869 | 3.14212 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T15:58: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": "603e0107cc9d... |
904759a0-8023-4d70-a46a-a2d9af498e7b | ishandutta2007/codeforces-a | andreinet/normal/681/D.cpp | #include <bits/stdc++.h>
#define SZ(x) ((int) (x).size())
using namespace std;
typedef long long i64;
const int NMAX = 100005;
vector<int> tree[NMAX];
vector<int> G[NMAX];
int father[NMAX];
int level[NMAX];
int add[NMAX];
int wish[NMAX];
bool isWish[NMAX];
void dfs(const int node, const int lastWish) {
int nex... | ALGO | 0.999967 | 4.040304 | {
"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": "91345124f2a2... |
3a1a4d68-f8dd-4ffb-a82f-499eeed067f6 | dev-Anamul/practice | cpp/objects-classes/ret-obj.cpp | #include <iostream>
using namespace std;
class Distance
{
private:
int feet;
float inches;
public:
Distance() : feet(0), inches(0.0)
{
// do nothing
}
Distance(int f, float inc) : feet(f), inches(inc)
{
// do nothing
}
void getDis()
{
cin >> feet >> in... | TOOL | 0.931693 | 4.272336 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2024-08-14T16:19: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": "d78e75e0b93b... |
6d7a3c1a-b919-4b4d-b479-36def5a15db7 | Bziyue/Beiyue-CodeLearning | src/递归-搜索/DFS/洛谷P1101单词方阵.cpp | #include <bits/stdc++.h>
using namespace std;
const int MAX_N = 105;
int n;
char word_matrix[MAX_N][MAX_N];
char mask_matrix[MAX_N][MAX_N];
bool is_yizhong;
const string yizhong = "yizhong";
#define belong_yizhong 1
#define not_yizhong 2
#define MaxDep 7
bool is_vaild(char &letter)
{
if (letter == 'y' ||
... | ALGO | 0.999714 | 3.018764 | {
"github_metadata": {
"branch": "main",
"commit_count": 73,
"repo_created_at": "2025-04-15T15:32: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": "456ea720d5d... |
c726023c-87bf-43fd-90de-8f3198db4fcd | zxclss/code-practice | 蓝书/0x01/23.荷马史诗.cpp | #include <iostream>
#include <cstring>
#include <algorithm>
#include <queue>
#define x first
#define y second
using namespace std;
typedef unsigned long long ULL;
typedef pair<ULL, int> PII;
const int N = 1e5 + 10;
priority_queue<PII, vector<PII>, greater<PII>> heap;
int n, k; //k - 1 | n - 1
int main()
{
s... | ALGO | 0.999943 | 3.212039 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2022-01-28T03:36:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "037613991... |
9db66f1f-fa0f-44e4-bf0b-f548f423621f | hs05june/CP | cp_practice/contests/diff_of_gcd.cpp | #include<bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define deq deque<int>
#define mii map<int,int>
#define pii pair<int,int>
#define all(x) (x).begin(), (x).end()
int M = 1000000007;
using namespace std;
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int t;
... | ALGO | 0.999679 | 3.241602 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2022-07-20T13:09: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": "a7c8fe8b74f... |
205f6d2a-2fbd-4137-98b3-822b2049345c | mosmn/cpp-programs | advanced/q10.cpp | /*
(Function Template) Write a C++ program that uses a function template called max() to
determine the largest of three arguments. Test the program using integer, character and double
arguments.
*/
#include <iostream>
using namespace std;
template <class T>
T max(T a, T b, T c)
{
T max = a;
if (b > max)
... | ALGO | 0.997464 | 5.767941 | {
"github_metadata": {
"branch": "main",
"commit_count": 55,
"repo_created_at": "2023-01-13T03:11: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": "b074c5da72a... |
ae270bab-5125-4427-81c4-c3a8592c8b9d | ShujiaHuang/Cpp-Primer-Plus-6th | bookcodes/chapter08/leftover.cpp | // leftover.cpp -- overloading the left() function
#include <iostream>
unsigned long left(unsigned long num, unsigned ct);
char * left(const char * str, int n = 1);
int main()
{
using namespace std;
char * trip = "Hawaii!!"; // test value
unsigned long n = 12345678; // test value
int i;
char * t... | TOOL | 0.905463 | 4.749823 | {
"github_metadata": {
"branch": "main",
"commit_count": 83,
"repo_created_at": "2021-07-15T08:44:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2796,
"forks": 576,
"issues": 9,
"pull_requests": 2
},
"file_meta": {
"content_id": "e7226e... |
7ce30c3e-943f-4039-a789-ca153c0ca203 | catam0rphism/colloquium_cpp | modules/natural/SUB_NDN_N.cpp | // Copyright 2015 Галеева, Межуева 4371
#ifndef SUB_NDN_N_CPP
#define SUB_NDN_N_CPP
#include <stdexcept>
#include <iostream>
#include "../../structs/struct.h"
#include "../../structs/operators.h"
#include "MUL_ND_N.cpp"
#include "COM_NN_D.cpp"
#include "SUB_NN_N.cpp"
natural SUB_NDN_N(const natural& a, const natura... | ALGO | 0.996827 | 4.902195 | {
"github_metadata": {
"branch": "master",
"commit_count": 235,
"repo_created_at": "2015-04-14T19:46:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "18a47ca6... |
8caaba0e-90c0-4484-b3e0-171670bd8f7e | JunBinLiang/OI | 蓝桥杯/1214-波动数列.cpp | #include <iostream>
#include <vector>
#include <string>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <queue>
#include <list>
using namespace std;
using ll = long long;
#define pb push_back
//11 : 10 - 11 : 40
const... | ALGO | 0.999754 | 4.796936 | {
"github_metadata": {
"branch": "main",
"commit_count": 780,
"repo_created_at": "2022-07-07T05:53:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b9ec0cde76... |
fb17bd28-956b-4667-97e1-3544c71faf40 | sevagh/umx.cpp | src/dsp.cpp | #include "dsp.hpp"
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <iostream>
#include <libnyquist/Common.h>
#include <libnyquist/Decoders.h>
#include <libnyquist/Encoders.h>
#include <memory>
#include <string>
#include <unsupported/Eigen/FFT>
#include <vector>
using namespace nqr;
static constexpr ... | ALGO | 0.903576 | 6.331555 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2023-06-30T14:56:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 48,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e9dad04a1a... |
9ae7ac2f-1bfd-4698-8861-a6137868b8fa | spaceOfSoul/baekjunSolve_c- | cpp_solve/6593/6593.cpp | #include <iostream>
#include <queue>
using namespace std;
int l,r,c;
int visited[30][30][30];
char arr[30][30][30];
int dx[6] = {1,-1,0,0,0,0};
int dy[6] = {0,0,1,-1,0,0};
int dz[6] = {0,0,0,0,1,-1};
int escape[3];
int start[3];
int bfs(int sx, int sy, int sz){
queue<pair<pair<int, int>,int>> que;
que.push({{sx... | ALGO | 0.999785 | 4.4238 | {
"github_metadata": {
"branch": "main",
"commit_count": 75,
"repo_created_at": "2021-10-19T07:44:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "96e7d34f5a9... |
aa7e8eca-121f-4c64-b7be-59c221075121 | KSoonYo/TIL | Algorithm/Programmers/c++/programmers_lv1_달리기경주/s1.cpp | #include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <iostream>
using namespace std;
vector<string> solution(vector<string> players, vector<string> callings);
int main(){
vector<string> players = {"mumu", "soe", "poe", "kai", "mine"};
vector<string> callings = {"kai", "kai", "mine", "... | ALGO | 0.999992 | 5.324549 | {
"github_metadata": {
"branch": "master",
"commit_count": 144,
"repo_created_at": "2022-09-10T10:36:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e36a444d... |
b6b8fc79-2b20-4ad6-9b22-2d0f72233ad7 | salimmia/Workstation | Problem Solving/Code_Template/Notes and files/Notebook/Data Srtucture/segment tree/Various Seg Tree type.cpp | /*Bracket Sequence */
struct info{
int open,close,ans;
};
info Merge(info a,info b){
info re;
int valid=min(a.open,b.close);
re.open=a.open+b.open-valid;
re.close=a.close+b.close-valid;
re.ans=a.ans+b.ans+valid;
/* works for maximum length of correct bracket sequence in l to r range*/
return re;
}
/* Kth elemen... | ALGO | 0.999872 | 3.420865 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2023-05-22T17:51:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "19620e3547... |
f5e9ce89-faec-4f3a-bcd6-1d1beada865b | Cegax123/Competitive-Programming | online judges/codeforces/1984 Global26/d.cpp | #include <bits/stdc++.h>
using namespace std;
#define all(c) (c).begin(), (c).end()
#define rall(A) A.rbegin(),A.rend()
#define pb push_back
#define dbg(x) do {cerr << #x <<" = " << (x) << endl; } while (false)
typedef long long ll;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
//cout << s... | ALGO | 0.999697 | 3.743132 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2022-09-15T13:50:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b4a93ee70e1... |
207085b5-97a9-4830-959b-b228635cba17 | lyy-ai/SLAM-Learning | homework_19_20/icp (复件).cpp | /****************************
* 题目:给定一个轨迹1,数据格式:timestamp tx ty tz qx qy qz qw
* 自定义一个任意的旋转矩阵和平移向量(可以尝试不同的值看看结果有什么变化),对轨迹1进行变换,得到一个新的轨迹2
* 使用ICP算法(提示:取平移作为三维空间点)估计轨迹1,2之间的位姿,然后将该位姿作用在轨迹2
* 验证:ICP算法估计的旋转矩阵和平移向量是否准确;轨迹1,2是否重合
*
* 本程序学习目标:
* 熟悉ICP算法的原理及应用。
*
* 公众号:计算机视觉life。发布于公众号旗下知识星球:从零开始学习SLAM,参考答案请到星球内查看。
*... | ALGO | 0.999745 | 4.489601 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-05-13T06:07:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 33,
"forks": 14,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "19d0cf23... |
cc118a10-319a-4984-a9a4-ba31b9e7c207 | kinetic-rb/kinetic-rb.github.io | code/CF1669A.cpp | #include <cstdint>
#include <iostream>
namespace Anonymous {
bool State = 1;
char re();
void re(char*);
template <typename Typex>
void re(Typex&&);
template <typename Typex, typename... Typey>
void re(Typex&&, Typey&&...);
} // namespace Anonymous
using Anonymous::re;
using namespace std;
using tp = long long;
conste... | ALGO | 0.997179 | 3.064719 | {
"github_metadata": {
"branch": "main",
"commit_count": 63,
"repo_created_at": "2022-11-19T06:37: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": "88e037d42fa... |
eaf3d508-7376-4b85-bb83-db4073fe9548 | ermolaevv/ppc-2024-autumn | tasks/mpi/khasanyanov_k_average_vector/include/avg_mpi.hpp | #ifndef _AVG_MPI_HPP_
#define _AVG_MPI_HPP_
#include <gtest/gtest.h>
#include <algorithm>
#include <boost/mpi/collectives.hpp>
#include <boost/mpi/communicator.hpp>
#include <iterator>
#include <memory>
#include <numeric>
#include <random>
#include <thread>
#include <utility>
#include <vector>
#include "core/task/in... | ALGO | 0.962319 | 6.540837 | {
"github_metadata": {
"branch": "master",
"commit_count": 440,
"repo_created_at": "2024-10-04T18:18:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 157,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "432ffb... |
5b4fe121-8ec9-482c-bc11-93caf85b2efe | gitrider/wxsj2 | EngineSDK/ThirdParty/VSInclude/cgal/CGAL/Homogeneous/predicates_on_pointsH2.h | // Copyright (c) 1999 Utrecht University (The Netherlands),
// ETH Zurich (Switzerland), Freie Universitaet Berlin (Germany),
// INRIA Sophia-Antipolis (France), Martin-Luther-University Halle-Wittenberg
// (Germany), Max-Planck-Institute Saarbruecken (Germany), <NAME> (Austria),
// and Tel-Aviv University (Israel). ... | ALGO | 0.996585 | 6.291774 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2015-08-26T14:38:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 15,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "82b5ac02b... |
6daaaeca-fca0-4051-b81d-1208f6a73df2 | WebKit/WebKit-http | Source/ThirdParty/libwebrtc/Source/webrtc/sdk/media_constraints.h | /*
* Copyright 2013 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing ... | TOOL | 0.912476 | 5.309893 | {
"github_metadata": {
"branch": "master",
"commit_count": 231005,
"repo_created_at": "2011-01-11T13:50:19.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 4992,
"forks": 1983,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "... |
2b3c7742-2dac-4984-93ff-0f70b2d725ec | kirrishima/4-sem | MatProg/6/Aboba/Aboba/Aboba.cpp | #include <iostream>
#include "Graph.h"
using namespace std;
int main() {
setlocale(LC_ALL, "Russian");
// Пример: создадим граф из 7 вершин.
// Пусть ориентированный граф имеет следующие ребра:
// 0 -> 1, 0 -> 3, 2 -> 5, 3 -> 1, 3 -> 4, 3 -> 6, 3 -> 2, 4 -> 1, 4 -> 6, 5 -> 6
int n = 7; // число вершин
AMatr... | ALGO | 0.986279 | 4.776453 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-06-15T20:25: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": "2f37c9df4eec... |
dd5e14b6-617f-46c1-8593-ba5a517919dc | govg/podcuda | magma-1.5.0/src/cgetrf_gpu.cpp | /*
-- MAGMA (version 1.5.0) --
Univ. of Tennessee, Knoxville
Univ. of California, Berkeley
Univ. of Colorado, Denver
@date September 2014
@author <NAME>
@generated from zgetrf_gpu.cpp normal z -> c, Tue Sep 2 12:38:19 2014
*/
#include "common_magma.h"
/**
Purpose
... | ALGO | 0.999854 | 6.418895 | {
"github_metadata": {
"branch": "master",
"commit_count": 67,
"repo_created_at": "2014-08-25T14:08:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8f1f0c898... |
3aeb80ce-a79a-4efb-86f5-c6e9c6015114 | IljaSir/CopilotSolverForLeetCode | C++/Medium/Accepted/ugly-number-iii_5.cpp | class Solution {
public:
int nthUglyNumber(int n, int a, int b, int c) {
if (n == 1) return 1;
int l = 1, r = 2e9;
while (l < r) {
int m = l + (r - l) / 2;
if (count(m, a, b, c) >= n) r = m;
else l = m + 1;
}
return l;
}
lo... | ALGO | 0.999988 | 5.825463 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2023-07-28T08:23: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": "cf6a58b2daa8... |
c881ec07-0a80-40b9-9d3f-a559e755ad48 | hangim/ACM | LightOJ/1284_Lights inside 3D Grid/1284.cc | #include <bits/stdc++.h>
using namespace std;
double get_p(int x, int n) {
return 1.0 - 1.0 * ((x - 1) * (x - 1) + (n - x) * (n - x)) / (n * n);
}
double f(double p, int n) {
return (1.0 - pow(1.0 - 2.0 * p, n)) / 2.0;
}
int main() {
int T;
cin >> T;
for (int cases = 1; cases <= T; ++cases) {
... | ALGO | 0.997775 | 4.350411 | {
"github_metadata": {
"branch": "master",
"commit_count": 79,
"repo_created_at": "2014-05-15T16:12:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4ad351bba... |
e27c23c3-dd99-41ce-a5f7-1d0e6c398ee7 | YeluriKetan/project-TREADS | Codeforces/D/1607 D. Blue-Red Permutation/Solution.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
bool cmp(pair<int, int> &a, pair<int, int> &b) {
if (a.first == b.first) {
return a.second < b.second;
} else {
return a.first < b.first;
}
}
string solve() {
int n, ai, red = 0, blue = 0;
string s;
... | ALGO | 0.999934 | 4.241915 | {
"github_metadata": {
"branch": "master",
"commit_count": 245,
"repo_created_at": "2021-07-01T09:54:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d5630342... |
4854b2cb-80c0-4e52-82e7-22abfbaf95f9 | QQinglin/path-planning | A_star/src/grid_path_searcher/src/Astar_searcher.cpp | #include "Astar_searcher.h"
using namespace std;
using namespace Eigen;
// setting up the grid map, including defining the grid's dimensions, resolution, and initializing the grid nodes.
void AstarPathFinder::initGridMap(double _resolution, Vector3d global_xyz_l, Vector3d global_xyz_u, int max_x_id, int max_y_id, int... | ALGO | 0.999485 | 3.601739 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2025-05-19T09:40: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": "17abdb0b5a... |
bc605564-5161-4a7b-a322-20ee5b02c5f4 | Anisha2001/CP_practice | externalMergeSortAlgo.cpp | #include <iostream>
#include <algorithm>
#include <queue>
#include <limits>
using namespace std;
struct MinHeapNode
{
// element to be stored
int element;
// array index from which the element is taken
int i;
};
// Comparison object to be used to order the heap
struct comp
{
bool operator()(co... | ALGO | 0.999313 | 4.588852 | {
"github_metadata": {
"branch": "main",
"commit_count": 84,
"repo_created_at": "2021-09-30T12:47:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 28,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "6286df590f... |
0202805a-6f73-432a-ba65-2ae3be1090c2 | ishandutta2007/codeforces-s | series_205/normal/1388/A.cpp | #include <bits/stdc++.h>
#define FOR(i, a, n) for(ll i = (ll)a; i < (ll)n; i++)
#define FORR(i, n) for(ll i = (ll)n - 1LL; i >= 0LL; i--)
#define rep(i, n) FOR(i, 0, n)
#define ALL(x) begin(x), end(x)
using namespace std;
using ll = long long;
constexpr ll Mod = 998244353;
constexpr ll mod = 1e9 + 7;
constexpr ll inf =... | ALGO | 0.999344 | 3.900916 | {
"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": "b11cef055824... |
c06ffcbb-9edc-4ee4-80c1-1d6dc72b409a | ishandutta2007/codeforces-i | izban/normal/538/A.cpp | #include <sstream>
#include <vector>
#include <algorithm>
#include <cstring>
#include <cstdlib>
#include <iostream>
#include <string>
#include <cassert>
#include <ctime>
#include <map>
#include <math.h>
#include <cstdio>
#include <set>
#include <deque>
#include <memory.h>
#include <queue>
#pragma comment(linker, "/STA... | ALGO | 0.999142 | 3.320939 | {
"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": "ba935e7e1cb3... |
33cccb17-3c8c-4bdc-bff1-3ec3083472e7 | liandd/Competitive_programming_2020_2024 | RPC/RPC_04_04_05_2024/SolucionesOficiales/E_window/window.cpp | // <NAME>
// 8/11/2023
// Solution to 2023 UCF Local Qualifying Round Problem: Weighted Window Sum
using namespace std;
#include <bits/stdc++.h>
typedef long long ll;
int main() {
// Read in numbers.
int n, k;
cin >> n >> k;
vector<ll> nums(n);
for (int i=0; i<n; i++)
cin >> nums[i];
... | ALGO | 0.999913 | 4.207472 | {
"github_metadata": {
"branch": "main",
"commit_count": 34,
"repo_created_at": "2024-05-05T01:44:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ec059000a19... |
7259a1e3-95f8-4ac2-aaeb-f871aa542f8a | wangtongxue-369/xcpc_Code_file | file/codeforces/old_/Codeforces Round 975 (Div. 2)/C/C.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
const ll mod = 1e9 + 7;
const ll N = 500005;
ll _ = 1, n, m, ans = 0, k, a[N], f[N];
void solve()
{
cin >> n >> k;
for (int i = 1; i <= n; i++)
{
cin >> a[i];
}
ll maxn = 0;
ll sum = 0;
... | ALGO | 0.999987 | 4.289809 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2025-02-24T09:13:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "69bb6580721... |
00a55862-e6a1-40fa-a54b-e397cbd86ae7 | blender/blender | source/blender/editors/space_clip/tracking_ops_solve.cc | /* SPDX-FileCopyrightText: 2016 Blender Authors
*
* SPDX-License-Identifier: GPL-2.0-or-later */
/** \file
* \ingroup spclip
*/
#include "MEM_guardedalloc.h"
#include "DNA_camera_types.h"
#include "DNA_object_types.h" /* SELECT */
#include "DNA_screen_types.h"
#include "DNA_space_types.h"
#include "BLI_listbase... | TOOL | 0.951672 | 4.865277 | {
"github_metadata": {
"branch": "main",
"commit_count": 152123,
"repo_created_at": "2019-10-09T12:47:28.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 15670,
"forks": 2395,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b... |
1a630de2-6b00-4e16-b53c-135a469aff19 | MAZHARMIK/Interview_DS_Algo | Recursion/Subsets.cpp | /* Scroll down to see JAVA code also /*
/*
MY YOUTUBE VIDEO ON THIS Qn : https://www.youtube.com/watch?v=p4bP_FIXGWw
Company Tags : Microsoft
Leetcode Link : https://leetcode.com/problems/subsets/
*/
//N... | ALGO | 0.996471 | 6.035942 | {
"github_metadata": {
"branch": "master",
"commit_count": 5946,
"repo_created_at": "2020-07-12T13:13:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2586,
"forks": 1357,
"issues": 7,
"pull_requests": 37
},
"file_meta": {
"content_id": "... |
7c2c1b32-e13e-44b2-8e7d-1f8bc50ff2fa | cherevatovm/PathTracingFQW | SquareMatrix.h | #ifndef SQ_MAT_H
#define SQ_MAT_H
#include <math.h>
template <int N>
class SquareMatrix {
public:
double contents[N][N];
SquareMatrix() {
for (int i = 0; i < N; ++i)
for (int j = 0; j < N; ++j)
contents[i][j] = (i == j) ? 1 : 0;
}
SquareMatrix(std::initializer_lis... | TOOL | 0.996155 | 5.17013 | {
"github_metadata": {
"branch": "main",
"commit_count": 25,
"repo_created_at": "2025-04-19T10:10: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": "2d31f329afb... |
09df48dc-6655-45aa-9a7a-4705309f305d | SSAFYSHYSHY/AlgoPractice | Algo/Backjoon_BFS_Platinum5_2.h | #pragma once
#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
using namespace std;
int n, k;
queue<pair<int, int>> q;
bool visited[500001][2] = { false, };
int BFS() {
q.push({ n,0 });
visited[n][0] = true;
int time = 0;
while (1) {
int brother = k + time * (time + 1) / 2;
if (bro... | ALGO | 0.99993 | 3.897431 | {
"github_metadata": {
"branch": "master",
"commit_count": 354,
"repo_created_at": "2025-04-17T06:53:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "82751675... |
443ead18-de0c-4e6d-8745-4ba18dc04f9c | yantiantianlx/leetcode | code1/深度优先搜索/Palindrome Partitioning.cpp | #include <iostream>
#include <vector>
#include <string>
using namespace std;
class Solution {
public:
vector<vector<string>> partition(string s) {
vector<vector<string>> result;
vector<string> path;
string substr = "";
dfs(s,0, path, result);
return result;
}
void dfs(string s, int start, vector<string>& p... | ALGO | 0.999964 | 5.456695 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2017-10-13T13:53: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": "a65a27249... |
cf6b3b92-e735-4cd3-bbef-16d233c1b06b | yawut/ntrview-wiiu | config/Config.cpp | #include "Config.hpp"
#include <string>
#include <inipp.h>
typedef inipp::Ini<char> Ini;
void configGetRect(Ini& ini, const std::string& section, const std::string& name, Gfx::Rect& rect) {
inipp::extract(ini.sections[section][name + "x"], rect.x);
inipp::extract(ini.sections[section][name + "y"], rect.y);
... | CONFIG | 0.938164 | 6.815559 | {
"github_metadata": {
"branch": "master",
"commit_count": 84,
"repo_created_at": "2020-07-01T13:24:36.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 87,
"forks": 8,
"issues": 14,
"pull_requests": 0
},
"file_meta": {
"content_id": "52eebab8... |
7f020c48-0f44-423b-b40b-7c1dd944b89e | felipehummel/QtSearch | similarity/similarity.cpp | /*******************************************************************************
**
** This file is part of QtSearch **
**
**
** Name: Qt Search
** Version: Beta
** Contact: <NAME> <<EMAIL>>
** <NAME> <<EMAIL>>
**
** Qt Search is free software: you can redistribute it and/or modify
** it under the terms of the... | ALGO | 0.936918 | 4.630242 | {
"github_metadata": {
"branch": "master",
"commit_count": 49,
"repo_created_at": "2011-11-26T15:32:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a9f346e43... |
3730e39d-ee59-41c2-8db8-a4813fddd66c | allwellll/cf_code_jiangly | cuiaoxiang/1071/1071B-B-Minimumpath.cpp | // url:https://codeforces.com/contest/1071/problem/B
// time:2022-03-18 04:51:36
// name:B-Minimumpath
// #define LOCAL
#define _USE_MATH_DEFINES
#include <array>
#include <cassert>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <iomanip>
#include <string>
#include <sstream>
#include <vector>
#inclu... | ALGO | 0.999979 | 3.366194 | {
"github_metadata": {
"branch": "main",
"commit_count": 23,
"repo_created_at": "2022-10-17T23:31:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 97,
"forks": 9,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6e4d9333a6... |
48bde75a-0a29-4df2-9c99-df793b227e6b | shivaylamba/Hacktoberfest | pancakesort.cpp | #include<bits/stdc++.h>
using namespace std;
void flip(int arr[], int i)
{
int temp, start = 0;
while (start < i)
{
temp = arr[start];
arr[start] = arr[i];
arr[i] = temp;
start++;
i--;
}
}
int findMax(int arr[], int n)
{
int mi, i;
for (mi = 0, i = 0; i < n; ++i)
if (arr[i] > arr[mi])
mi = i;
r... | ALGO | 0.999947 | 5.142147 | {
"github_metadata": {
"branch": "master",
"commit_count": 1629,
"repo_created_at": "2019-09-25T18:23:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 275,
"forks": 1919,
"issues": 84,
"pull_requests": 948
},
"file_meta": {
"content_id": ... |
8ffd383e-5c77-4694-8fed-7ee7f88dca27 | ETO-leader/OI | CodeForces-Problemset/CodeForces-1923F Shrink-Reverse.cpp | #include<bits/stdc++.h>
#define cir(i,a,b) for(int i=a;i<b;++i)
using namespace std;
using ull=unsigned long long;
static constexpr auto MOD=(int)(1e9+7);
class hashing{
private:
static constexpr auto hashc=251ull;
vector<ull> pw,h;
auto init(const string&s){
pw.resize(s.size()+1,1);
cir(i,1... | ALGO | 0.999987 | 4.467109 | {
"github_metadata": {
"branch": "main",
"commit_count": 116,
"repo_created_at": "2024-07-08T01:50: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": "5ec6c7bb6f... |
1ff1475a-7459-4e54-9591-171228339936 | ZE0TRON/C-CPP-Feats | threading/threads.cpp | #include <iostream>
#include <vector>
#include <thread>
class multFunctor
{
private:
long long int _res;
public:
void operator()(const std::vector<int> &v, unsigned int begin, unsigned int end)
{
_res = 1;
for (unsigned int i = begin; i < end; i++)
{
_res *= v[i];
... | ALGO | 0.999406 | 6.073938 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2019-09-20T20:03: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": "543ed98b8... |
40c09f4a-8e6c-4ed0-8165-4cef9d265553 | rkandur/uber | DependencyPlanner.cxx | #ifndef __DEPENDENCY_PLANNER__
#define __DEPENDENCY_PLANNER__
#include <queue>
#include <unordered_set>
#include "DependencyPlannerUtils.cxx"
#include "ThreadPoolTask.cxx"
struct thread_pool_min_heap_comparator {
bool operator()(ThreadPoolTask i, ThreadPoolTask j) {
return i.get_time() > j.get_time();
}
};
struc... | ALGO | 0.997159 | 5.741047 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2015-09-28T20:56: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": "40ae5f27e3... |
2ae55843-98fe-4a9b-9137-6c5d70995e42 | aleks-trifonova/Comp-Sci-222-Virtual-Memory-Address-Mapping | main.cpp | #include <stdio.h>
#include <stdlib.h>
/* Define page table as dynamic structure containing virtual page and page frame
and initialize variable as pointer to structure */
struct node {
int vp;
int pf;
} *pt = nullptr;
typedef struct node entry;
/* Declare global var's */
int num_entries, page_size, mainmme... | TOOL | 0.965868 | 4.60779 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2018-11-01T22:16: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": "0669765bf6... |
6c30327e-53ba-4aea-b54b-3ad3ebccc5bf | Roushankumarsingh/Datastrucutesandalgorithms | SINGLY LINKED LIST ALL OPERATION CPP - Copy.cpp | #include<iostream>
#include<string>
#include<cstring>
#include<cmath>
using namespace std ;
struct node{
int data ;
struct node* next ;
};
void insert_at_beg(struct node** head_ref , int data){
struct node* newnode = (struct node*)malloc(sizeof(struct node)) ;
newnode->data = data ;
// newnode-... | ALGO | 0.999926 | 4.315383 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-01-15T06:22: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": "68b6e7bd059f... |
7eff95d0-cf34-4a14-8881-decda79f83b9 | vivekm07/DSA-Problem-Solving | Leetcode/Arrays/1909_Remove_One_Element_to_Make_the_Array_Strictly_Increasing.cpp | class Solution {
public:
bool canBeIncreasing(vector<int>& nums) {
int count = 0;
int index = -1;
int n = nums.size();
for (int i = 1; i < n - 1; i++) {
if (nums[i - 1] >= nums[i]) {
count++;
index = i-1;
break;
... | ALGO | 0.999996 | 5.834382 | {
"github_metadata": {
"branch": "main",
"commit_count": 120,
"repo_created_at": "2021-02-09T13:32: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": "a7e8048d98... |
330f267c-c12f-4e0e-8f43-2364d8bce4c4 | SaintFrost/CPP-Projects | BasicCalculator/main.cpp | #include <iostream>
using namespace std;
double num1, num2;
char symbol;
void ChooseNumber();
void ChooseOperator();
void Calculate();
int main()
{
ChooseNumber();
ChooseOperator();
Calculate();
return 0;
}
void ChooseNumber()
{
cout << "Please enter first number: ";
cin >> num1;
cou... | TOOL | 0.9657 | 3.73827 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2025-02-14T09:11:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "95bc695234f... |
45493ff2-356e-4b3b-8d23-71738fa0a063 | rst0070/problem-solving-practice | ucpc2020준비/20예선/ㄷㄷㄷㅈ2.cpp | #include <iostream>
#include <vector>
using namespace std;
int N;
vector<int> graph[300001];
int d_memo[300001][4];
bool d_check[300001][4];
int c_memo[300001][3];// combination nCr = c_memo[n][r-1]
int combination(int n, int r) {
if(n == r || r == 0) return 1;
if(c_memo[n][r-1]) return c_memo[n][r-1];
r... | ALGO | 0.999635 | 3.887844 | {
"github_metadata": {
"branch": "master",
"commit_count": 161,
"repo_created_at": "2020-07-13T05:37:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0d6abfe8... |
7dea8acf-acd7-41fa-9d63-fd9b0b90f8e6 | krishukr/cpp-code | src/LGR/LGR-091/lgr-091-B1.cpp | #include <algorithm>
#include <cstdio>
#include <iostream>
typedef long long ll;
ll a[10050];
template <typename T>
T read();
int main() {
// std::ios::sync_with_stdio(false);
int t = read<int>(), T = read<int>();
while (T--) {
int n = read<int>(), k = read<int>();
int p = n - k * 2, q... | ALGO | 0.999723 | 3.855787 | {
"github_metadata": {
"branch": "master",
"commit_count": 193,
"repo_created_at": "2021-01-19T08:15:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "143bb5e0... |
dc706f7a-eea4-46c1-a455-05b2b4c736fd | frejur/aoc-2024-cpp | source/day_18/bytegrid.h | #ifndef BYTEGRID_H
#define BYTEGRID_H
#include "../lib/bit_grid.h"
#include "../lib/direction.h"
#include "../lib/vec2d.h"
#include <array>
namespace aoc24_18 {
class Point;
class Byte_grid : public aoc24::Bit_grid
{
//
// State
//--------------------------------------------------------------------------
enum c... | ALGO | 0.99603 | 6.670431 | {
"github_metadata": {
"branch": "main",
"commit_count": 101,
"repo_created_at": "2024-12-02T20:57: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": "6ad7c7bbbc... |
cbde2599-d39b-40b5-ae6f-4c3653da2085 | El-Medonho/Contests | Geral/CodeForces/Contests/rnd 865/b2.cpp | // ░░░░░░░░░░░░▄▄▄█████████▄▄▄░░░░░░░░░░░░
// ░░░░░░░░▄▄██████▀▀▀▀▀▀▀██████▄▄░░░░░░░░
// ░░░░░░▄████▀▀░░░░░░░░░░░░░▀▀████▄░░░░░░
// ░░░░▄███▀░░░░░░░░░░░░░░░░░░░░▀▀███▄░░░░
// ░░▄███▀░░░░░░░░░░░░░░░░░░░░░░░░░████░░░
// ░▄███▀░░░░░▄▄▄▄░░░░░░░░░░░░░░░░░░▀███░░
// ░███░░░░░░█████▄░░░░░░░░░░░░░░░░░░▀███░
// ███▀░░░░░░██████... | ALGO | 0.999867 | 4.544567 | {
"github_metadata": {
"branch": "main",
"commit_count": 34,
"repo_created_at": "2022-09-03T14:12:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b784c6a33e1... |
0505d745-349c-405e-84fc-ec1f2e505dda | Royna2544/c_cpp_telegrambot | src/command_modules/builder/android/ConfigParsers.hpp | #pragma once
#include <absl/log/log.h>
#include <fmt/format.h>
#include <map>
#include <memory>
#include <ostream>
#include <set>
#include <stdexcept>
#include <string>
#include <string_view>
#include <utility>
#include <variant>
#include "../RepoUtils.hpp"
class ConfigParser {
public:
struct ArtifactMatcher... | TOOL | 0.969042 | 7.437228 | {
"github_metadata": {
"branch": "master",
"commit_count": 2444,
"repo_created_at": "2023-02-16T08:55:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c873c05... |
296ff1d1-e775-450e-bf76-eb1b6f2cee3a | Sumit70510/Programs | GfG/Surpasser_count.cpp | // { Driver Code Starts
//Initial template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function template for C++
void merge(int arr[],vector<int>&count,int l,int mid,int r)
{
int n1=mid-l+1;
int n2=r-l;
int a[n1],b[n2];
for(int i=0;i<n1;i++)
{a[i]=arr... | ALGO | 0.99989 | 5.768935 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-06-11T11: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": "f23686e1f72c... |
0ee67d10-5696-46db-8fdd-0f3898cbf6c9 | zephyr-bj/algorithm | search/0004_findMedianSortedArrays.cpp | int kthElement2SA(vector<int>& nums1, int a1, int b1, vector<int>& nums2, int a2, int b2, int k){
if(a1>b1)return nums2[a2+k-1];
if(a2>b2)return nums1[a1+k-1];
if(k==1)return min(nums1[a1],nums2[a2]);
int k1 = min(b1-a1+1,k/2);
int k2 = k-k1;
if(a2+k2-1>b2){
... | ALGO | 0.999997 | 5.915546 | {
"github_metadata": {
"branch": "master",
"commit_count": 864,
"repo_created_at": "2017-02-09T08:24: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": "4bc2640c... |
4908eeb8-83bc-4875-a089-4b1599491fdc | suisen-cp/cp-library-cpp | test/src/math/set_power_series/arc105_f.test.cpp | #define PROBLEM "https://atcoder.jp/contests/arc105/tasks/arc105_f"
#include <iostream>
#include <atcoder/modint>
using mint = atcoder::modint998244353;
#include "library/math/set_power_series.hpp"
#include "library/transform/subset.hpp"
using namespace suisen;
int main() {
int n, m;
std::cin >> n >> m;
... | ALGO | 0.998273 | 4.376032 | {
"github_metadata": {
"branch": "main",
"commit_count": 1417,
"repo_created_at": "2021-07-15T19:06:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 19,
"forks": 1,
"issues": 18,
"pull_requests": 0
},
"file_meta": {
"content_id": "460208c... |
e7aa7534-4dd9-4814-8039-1fa18efa0e15 | AkashSingh3031/The-Complete-FAANG-Preparation | 1]. DSA + CP/1]. DSA/3]. 450 DSA by Love Babbar/C++/01]. Array/_16)_Count_Inversions.cpp | #include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution{
public:
// arr[]: Input Array
// N : Size of the Array arr[]
// Function to count inversions in the array.
long long int mergeSort(long long arr[], long long temp[], int left, int right)
{
long long int ... | ALGO | 0.999923 | 5.823972 | {
"github_metadata": {
"branch": "master",
"commit_count": 1827,
"repo_created_at": "2021-05-29T04:41:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 11343,
"forks": 2526,
"issues": 3,
"pull_requests": 2
},
"file_meta": {
"content_id": "... |
30212848-9913-4852-b107-93c3a28a8c7a | FIR2/Assignment-folder | MaxProfit.cpp | #include <bits/stdc++.h>
#include <iostream>
using namespace std;
int maxProfit(vector<int>& prices) {
int n = prices.size();
if (n < 2) {
return 0;
}
vector<int> leftProfit(n), rightProfit(n);
int minPrice = prices[0];
for (int i = 1; i < n; i++) {
minPrice = min(minPrice, pri... | ALGO | 0.99941 | 5.412594 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-02-23T17:11:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "710d3c8bb116... |
f14d1642-98bf-4fd8-8767-89261c3ce464 | jeannetoh99/cp | kattis/rockpaperscissors.cpp | #include <iostream>
#include <iomanip>
#include <cmath>
#include <string>
#include <sstream>
#include <tuple>
#include <vector>
#include <queue>
#include <climits>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>
#include <cstring>
using namespace std;
int getWinner(int p1, string m1, int p2, st... | ALGO | 0.999301 | 4.539697 | {
"github_metadata": {
"branch": "main",
"commit_count": 31,
"repo_created_at": "2021-12-12T16:03:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1228a0d83be... |
41c30a80-9b01-436d-9937-97649118e90f | alexandraback/datacollection | solutions_5634947029139456_0/C++/whsb/main.cpp | #line 2 "TorusSailing.cpp"
#include <cstdlib>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <iostream>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <fstream>
#include <numeric>
#inc... | ALGO | 0.999938 | 3.849979 | {
"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": "560dd1e76... |
af89baf1-4544-4e67-9695-5cff393a8259 | firebase/firebase-ios-sdk | Firestore/core/src/immutable/llrb_node_iterator.h | /*
* Copyright 2018 Google
*
* 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 w... | ALGO | 0.996186 | 7.708262 | {
"github_metadata": {
"branch": "main",
"commit_count": 7964,
"repo_created_at": "2017-04-22T00:26:50.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 6275,
"forks": 1639,
"issues": 357,
"pull_requests": 86
},
"file_meta": {
"content_id": "a... |
ff8fcf1b-13ba-45a6-9e16-df06dc861396 | hashiryo/Library | test/sample_test/abc155_f.test.cpp | // competitive-verifier: STANDALONE
// https://atcoder.jp/contests/abc155/tasks/abc155_f
// sp judge
#include <sstream>
#include <string>
#include <cassert>
#include <algorithm>
#include <vector>
#include "src/Graph/incidence_matrix_equation.hpp"
using namespace std;
bool test(int (*solve)(stringstream&, stringstream&... | ALGO | 0.999765 | 4.001767 | {
"github_metadata": {
"branch": "master",
"commit_count": 2057,
"repo_created_at": "2020-03-25T09:12:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0f5b329... |
f54d35cb-d3f0-45b7-87b8-f60d6be1c458 | shubhamthrills/Placement-Drive-Questions | MockVita/Solutions/Count Bits_2.cpp | #include<bits/stdc++.h>
#include<stdlib.h>
using namespace::std;
int main(){
//Data declaration
int n; string input; vector<string > arrs; vector<int> arri; int i; char temp[100];
vector<int > ones; int one; int res=0;
// Data entry
cin>>n;
fflush(stdin);
getline(cin,input);
cout<<"input ... | ALGO | 0.999904 | 4.168894 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2020-03-27T14:56:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "15b828fde... |
869c2423-4409-4831-94e9-fb310e7c7a58 | fract4d/gnofract4d | fract4d/c/model/pointfunc.cpp | #include "pointfunc.h"
void pointFunc::calc(
// in params
const double *params, int nIters,
// periodicity
int min_period_iters, double period_tolerance,
// warping
int warp_param,
// only used for debugging
int x, int y, int aa,
// out params
rgba_t *color, int *pnIters, float ... | ALGO | 0.979147 | 5.403952 | {
"github_metadata": {
"branch": "master",
"commit_count": 713,
"repo_created_at": "2015-05-30T17:34:18.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 116,
"forks": 27,
"issues": 22,
"pull_requests": 1
},
"file_meta": {
"content_id": "15dbf... |
6867f545-8676-467a-a8a7-3783e3579af4 | Dillan-03/Computer_Graphics | cw2/vmlib/mat44.cpp | #include "mat44.hpp"
Mat44f invert( Mat44f const& aM ) noexcept
{
// We could implement this with any number of methods, including Gaussian
// Elimination or similar. However, a straigth line solution exists for
// small matrices, including 4x4 ones.
//
// This particular one is from:
// http://www.euclideanspac... | ALGO | 0.993961 | 6.450059 | {
"github_metadata": {
"branch": "main",
"commit_count": 96,
"repo_created_at": "2023-11-27T12:17:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 3
},
"file_meta": {
"content_id": "d07c18b1e71... |
101cea32-e536-4f79-a3f1-1faaf952f51b | sybila/NewBioDiVinE | tool/ltl2ba/support_dve.hh | /*
* Transformation LTL formulae to Buchi automata
*
* - colection of helping functions
* - reading LTL formulae from text file
* - writing Buchi automaton to DiVinE source file
*
* <NAME> - <EMAIL>
*
*/
#ifndef DIVINE_LTL_SUP_DVE
#define DIVINE_LTL_SUP_DVE
//#define CC_ONLY_OPT
/* compile only funct... | ALGO | 0.986087 | 4.195652 | {
"github_metadata": {
"branch": "master",
"commit_count": 22,
"repo_created_at": "2014-08-27T16:32:33.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1e2242923c... |
4c0b741a-9fec-4466-a615-6d293256b07d | asdsds142/labs | algorithms_/bin_search.cpp | #include <iostream>
#include <vector>
using namespace std;
/*функция принимает на вход отсортированный массив и делает бинарный поиск
результат выдается в виде bool значения (присутствует/отсутствует искомый элемент)*/
bool binary_search(vector<int> v, int search_value)
{
bool result = 0;
if (v.size() == ... | ALGO | 0.999902 | 4.45501 | {
"github_metadata": {
"branch": "main",
"commit_count": 82,
"repo_created_at": "2022-09-06T18:46:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "954d5396f05... |
461047ea-7922-4ca3-bfc7-1ea03c0fdfd3 | txtxj/USTC-AI-Lab | CSP/src/main.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <chrono>
#include <algorithm>
constexpr int max_size[] = {196, 360, 6};
int n, d, s;
int min_limit, max_limit;
int satisfied = 0;
bool requests[max_size[0]][max_size[1]][max_size[2]] = {};
int shifts[max_size[1]][max_size[2]] = {};
int ans[max_size[1]... | ALGO | 0.999719 | 4.873951 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2023-05-26T09:44: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": "9636aa9cd7... |
99f00ca4-5356-4184-9992-0baa8dec40e6 | loloxwg/Vscode_CPP | BigHomeWork/num1.cpp | #include<stdio.h>
#include<string.h>
#define MaxSize 1000
typedef struct Student
{
int num;
char name[20];
int age;
float score[10];
/*
//运算符重载
bool operator == (const Student& datetype) const
{
if((num == datetype.num) && (stricmp(name, datetype.name)) && (age == datetype.age))... | TOOL | 0.979546 | 3.34397 | {
"github_metadata": {
"branch": "master",
"commit_count": 44,
"repo_created_at": "2020-10-24T15:24:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8567c126b... |
9ec76426-5464-46f4-8a0b-812b0b66cc8e | SJMA11723/Problem-solving | codeforces/Codeforces Round 776 (Div. 3)/D.cpp | #include <bits/stdc++.h>
using namespace std;
int ordenar(vector<int> &arr, int x){
int pos = 0;
for(int i = 0; i < arr.size(); ++i)
if(arr[i] == x){
pos = i + 1;
break;
}
int ret = 0;
if(x <= pos) ret = pos - x;
else ret = pos;
//cout << pos << ' '... | ALGO | 0.999933 | 4.216139 | {
"github_metadata": {
"branch": "main",
"commit_count": 558,
"repo_created_at": "2022-10-19T22:29: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": "23ea692f89... |
71d4ecdc-b28d-40b1-9a02-201a5b9a0162 | haxbos/Vscode_Backup | 04ex/03hard/digitDP.cpp | #include <bits/stdc++.h>
using namespace std;
int atMostNGivenDigitSet(vector<string>& digits, int n) {
int size = digits.size();
string s = to_string(n);
int len = s.length();
vector<int> arr(size,0);
for(int i=0; i<size; ++i){
arr[i] = stoi(digits[i]);
}
int res = 0;
for(int ... | ALGO | 0.999692 | 4.902649 | {
"github_metadata": {
"branch": "main",
"commit_count": 27,
"repo_created_at": "2023-03-31T11:42:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6ba836ce768... |
6ff65a01-6c34-4932-9035-8067fb36e233 | kentatakiguchi/GameCompetition2016_2 | DXBase/DXBase/sources/Actor/Body/BoundingBox.h | #ifndef BOUNDING_BOX_H_
#define BOUNDING_BOX_H_
#include "../../Math/Math.h"
#include "Body.h"
class BoundingBox : public Body {
public:
//四角の判定を作成する(判定を行う場合) topLeft:左上の点(Vector2) topRight:右上の点(Vector2) bottomLeft:左下の点(Vector2) bottomRight:右下の点(Vector2)
BoundingBox(const Vector2& topLeft, const Vector2& topRight... | TOOL | 0.932034 | 4.551613 | {
"github_metadata": {
"branch": "master",
"commit_count": 398,
"repo_created_at": "2016-09-30T02:24: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": "a9bf866e... |
0818ac34-0476-4457-9b03-2cdda132ed8a | Jinqiang/demo_lidar | isamlib/covariance.cpp | /**
* @file covariance.cpp
* @brief Recovery of marginal covariance matrix, for details see Kaess09ras.
* @author <NAME>
* @author <NAME>
* @version $Id: covariance.cpp 8578 2013-07-01 00:28:49Z kaess $
*
* Copyright (C) 2009-2013 Massachusetts Institute of Technology.
* <NAME>, <NAME>, <NAME>,
* <NAME> and <N... | ALGO | 0.999425 | 6.540931 | {
"github_metadata": {
"branch": "master",
"commit_count": 73,
"repo_created_at": "2014-09-12T10:53:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 265,
"forks": 242,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5f8e4... |
00711b16-46b8-4ef8-be35-477ea901984c | DucTriCE/PTTKTT | heuristic/astar.cpp | #include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <limits.h>
#include <queue>
using namespace std;
class Graph{
vector<vector<int>> matrix; //adjacent matrix
map<string, int> v_index; //vertex
vector<string> v_names; //vertex name
vector<int> h; ... | ALGO | 0.999904 | 4.305871 | {
"github_metadata": {
"branch": "master",
"commit_count": 49,
"repo_created_at": "2023-09-23T11:49:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3d6574885... |
aebdca36-aed2-4de2-8627-abf8b628a46a | circle-oo/PS | BOJ/5463/5463.cpp | #include<bits/stdc++.h>
using namespace std;
using lld = long long int;
using lf = long double;
using uint = unsigned int;
using ulld = unsigned long long int;
using pii = pair<int, int>;
using pll = pair<lld, lld>;
int N, M;
int R[55][55], P[55][55];
int D[55][55][55][55];
int solve(int a, int b, int c, int d) {
... | ALGO | 0.999888 | 3.501707 | {
"github_metadata": {
"branch": "master",
"commit_count": 72,
"repo_created_at": "2018-11-07T09:53:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1e3b0392d... |
ebdf2440-5a27-40a2-9421-fc5b100fe1db | Tudor67/Competitive-Programming | LeetCode/Problems/Algorithms/#2161_PartitionArrayAccordingToGivenPivot_sol6_divide_and_conquer_O(NlogN)_time_O(logN)_extra_space_52ms_128MB.cpp | class Solution {
private:
int getIndexOfFirstGreaterNum(const int L, const int R, vector<int>& nums, const int THRESHOLD){
for(int i = L; i <= R; ++i){
if(nums[i] > THRESHOLD){
return i;
}
}
return R + 1;
}
void stablePartition(const int L, co... | ALGO | 0.999987 | 6.748918 | {
"github_metadata": {
"branch": "master",
"commit_count": 615,
"repo_created_at": "2020-02-27T19:56:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6ac60e80... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.