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 |
|---|---|---|---|---|---|---|---|
add1cb5b-85c6-4872-8992-c837299c149a | hehuizhu/3d_geometry_key_points_shortest_path | examples/shortest_path_example.cpp | #include "vtkAutoInit.h"
#include <vtkNew.h>
#include <vtkRenderWindow.h>
#include <vtkSmartPointer.h>
#include <vtkPoints.h>
#include <vtkMath.h>
#include <vtkPolyData.h>
#include <vtkCellArray.h>
#include <vtkVertex.h>
#include <vtkPolyDataMapper.h>
#include <vtkPLYReader.h>
#include <vtkActor.h>
#include <vtkRender... | ALGO | 0.981368 | 3.925737 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-04-12T06:42:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f5f8b496aab0... |
ff8b21f5-a7b9-40b6-89e3-7d72b2965bf2 | r3kste/code | src/progC/gb2023/2/N.cpp | #include <bits/stdc++.h>
using namespace std;
#define MOD (LL)(1e9 + 7)
#define fastio \
ios_base::sync_with_stdio(false); \
cin.tie(NULL);
#define endl "\n"
#define yesno(a) cout << ((a) ? "Yes" : "No");
#define F first
#define S second
#define mp make_pair
#define pb push_back
#defin... | ALGO | 0.999478 | 4.000009 | {
"github_metadata": {
"branch": "main",
"commit_count": 29,
"repo_created_at": "2023-12-25T18:16: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": "548f57bc9cc... |
8d6e905a-8221-47ba-8d95-2a84d5137b35 | R-i-t-i-k-a/CPP | arrays/Centered_average.cpp | //g prep
//Return the "centered" average of an array of ints,
// which we'll say is the mean average of the values, except ignoring the largest and smallest values in the array.
// If there are multiple copies of the smallest value, ignore just one copy, and likewise for the largest value.
// Use int division to pro... | ALGO | 0.999621 | 5.507268 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2023-08-25T20:52:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "74a5fb16259... |
eb4639e4-7612-4b18-949f-ea5ae18bdf49 | Navnathjadhav08/Cpp-Programming | Practice programs/program211.cpp | /*
iRow = 4
iCol = 4
* * * *
* * * *
* * * *
* * * *
*/
#include<iostream>
using namespace std;
class Pattern
{
public:
int iRow;
int iCol;
Pattern(int X, int Y)
{
iRow = X;
iCol = Y;
}
void Display()
{
... | ALGO | 0.983321 | 4.318689 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-09-15T06:57:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bb3c9ee22169... |
227aaad3-e85f-4dcc-8eb9-fe9bae892d05 | austinmw/code | C++/FILEIO_hash.cpp | #include <iostream>
#include <fstream>
#include <sstream>
#include <vector>
#include <string>
#include <queue>
#include "trie.h"
using namespace std;
void getFileData(vector<string> &data1, vector<string> &data2, vector<string> &queries1,
vector<string> &queries2, vector<int> &counts1, vector<int> &counts2) {... | ALGO | 0.971267 | 3.896951 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2017-01-21T23:36:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "aa585f9a9... |
dedac4ac-2e8b-4b9a-97c6-5eb7a7744e38 | vgvgvvv/ResetCore | C++/LearnCpp/Template/examples/meta/loop1.hpp | /* The following code example is taken from the book
* "C++ Templates - The Complete Guide"
* by <NAME> and <NAME>, Addison-Wesley, 2002
*
* (C) Copyright <NAME> and <NAME> 2002.
* Permission to copy, use, modify, sell and distribute this software
* is granted provided this copyright notice appears in all copies.... | ALGO | 0.97234 | 6.072436 | {
"github_metadata": {
"branch": "master",
"commit_count": 201,
"repo_created_at": "2018-01-18T15:08:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 63,
"forks": 24,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "05f5e6... |
9043f616-e11b-4420-92a5-adf16451671c | lytvynenkomaksim/Crypto | RSA.cpp | #include <iostream>
#include <cstdlib>
#include <iomanip>
#include <string>
#include <vector>
using namespace std;
const int MAX = 20;
/////////////////////////////////////////////////////////////////////
//Алгоритм "<NAME>". Выбирает все простые числа
//до заданного (случайно сгенерированного).
int sundaram(int n)
{... | ALGO | 0.999853 | 3.817213 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2018-07-23T17:38: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": "8612394d83... |
e407603a-c025-40c4-bc0e-c9122e8a731a | SR-Sunny-Raj/Hacktoberfest2021-DSA | 03. Recursion/validSudoku.cpp | #include<iostream.h>
#include<bits/stdc++.h>
using namespace std;
bool validateRow(vector<vector<char>> &board,int row){
map<char,int> m;
for(int i=0;i<9;i++){
if(board[row][i]=='.'){
continue;
}
if(m.find(board[row][i])!=m.end()){
return false;
}
... | ALGO | 0.999054 | 5.598194 | {
"github_metadata": {
"branch": "master",
"commit_count": 2783,
"repo_created_at": "2020-05-08T05:36:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 236,
"forks": 982,
"issues": 3,
"pull_requests": 161
},
"file_meta": {
"content_id": "4... |
7b6ef988-48bf-40cf-92cb-4c936fb967b5 | ishandutta2007/codeforces-m | mhq/normal/1295/B.cpp | #ifdef DEBUG
#define _GLIBCXX_DEBUG
#endif
//#pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
typedef long double ld;
typedef long long ll;
const int maxN = 2 * (int)1e5 + 100;
int nxt[27][maxN];
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
//freopen("input.txt", ... | ALGO | 0.999404 | 3.923024 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-06-06T01:03: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": "2416e03232d6... |
f36528b4-4808-42d5-a90f-cafa629b0b0d | ToshmikRahangdale/PROJECT1 | Assignment4_Q9.cpp | /*9. Write a program to multiply 2 matrices. */
#include<iostream>
using namespace std;
int main()
{
int r1,c1,r2,c2;
cout<<"Enter the no. of rows for matrix1: ";
cin>>r1;
cout<<"Enter the no. of column for matrix1: ";
cin>>c1;
cout<<"Enter the no. of rows for matrixr2: ";
cin>>r2;
cout<... | ALGO | 0.997451 | 4.124782 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2023-10-11T05:40: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": "5a3577a40ef... |
d33cbb20-e0a9-4d86-8ee1-e230a10235e4 | JinHyung16/Algorithm_Practice | Solvedac & Baekjoon/[Algorithm]Greedy/1931.cpp | #include<iostream>
#include<vector>
#include<algorithm>
#define FastIO ios::sync_with_stdio(false); std::cin.tie(NULL); std::cout.tie(NULL);
/// <summary>
/// Silver1 회의실 배정 - Greedy 알고리즘
/// 사용할 수 있는 회의의 수가 많아지려면 결국 끝나는 시간을 기준으로 반대로 채워나가면 된다.
/// 즉 회의 시간을 {start, end}순으로 넣었다면 내림차순 정렬을
/// {end, start}로 넣었다면 오름차순 정렬을... | ALGO | 0.99996 | 4.74036 | {
"github_metadata": {
"branch": "main",
"commit_count": 514,
"repo_created_at": "2022-06-29T04:10: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": "9317fe23d2... |
42318177-b629-4744-823f-df076f1b44fb | Seo-sang/Algorithm | baekjoon/2304.cpp | #include <bits/stdc++.h>
#define pii pair<int,int>
using namespace std;
vector<pii> arr, st;
int main() {
int N; cin >> N;
for(int i = 0; i < N; i++) {
int a, b; cin >> a >> b;
arr.push_back(pii(a, b));
}
sort(arr.begin(), arr.end());
st.push_back(arr[0]);
int ans = 0;
f... | ALGO | 0.999907 | 3.642039 | {
"github_metadata": {
"branch": "master",
"commit_count": 256,
"repo_created_at": "2021-11-19T07:10: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": "3f5929a0... |
28a92563-510a-471e-a1fc-27404d4ed8b7 | Francisco-Paulino-Arruda-Filho/AtividadePai | main.cpp | // Turma 04: manhã, terça e quarta
// <NAME> - 538134
// <NAME>- 538451
#include <iostream>
#include <vector>
#include <unordered_set>
#include <unordered_map>
#include <fstream>
#include "binarytree.h"
using namespace std;
//Define as variaveis globais
#define T pair<int, unordered_set<string>>
//Cria o numero de do... | ALGO | 0.999641 | 4.084561 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-08-31T17:38: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": "8a4d4fa43551... |
c7a0e609-58e0-4cc8-9fa8-50fbe35907b9 | rumdien113/Algorithm | OLP/other/Non-coprimeSplit.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <climits>
#include <bits/stdc++.h>
#define nln '\n'
#define ll long long
#define FORI(q, w) for(int i = q; i < w; i++)
#define FORJ(q, w) for(int j = q; j < w; j++)
using namespace std;
void indef(){
#ifndef ONLINE_JUDGE
freopen("input.txt", "r",... | ALGO | 0.999826 | 4.459804 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2023-11-01T03:42: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": "0ba7430dd... |
acbe4967-4cd8-4493-9211-580807fab187 | JarlSamseth/locateLoudestSound | loudestSoundOrientation.ino |
/*
* Formaal: finne retningen (vinkel) til den høyeste lydkilden
* 2 keyes mikrofoner og 1 Arduino Uno
*/
//#include <vector>
//Avansert psedokode:
//optimaliserer for 440 Hz: low-pass-filter for å sile ut støy i begge input fra høytalerne
//Bruk FFT + convolution for å finne retning på lyden.
//Fjerne konstant-le... | ALGO | 0.994479 | 4.295761 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2018-12-08T15:32: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": "cc6fce7b02... |
9c01ff75-7a05-4fe6-9c57-7ccd020beda2 | rcetangle/DelaunayTriangulation | triangle.cpp | #include "triangle.h"
#include <QtDebug>
Triangle::Triangle()
:isBad(false)
{
}
Triangle::Triangle(const Vertex a, const Vertex b, const Vertex c)
:isBad(false), a(a), b(b), c(c)
{
calculateCircumCircle();
}
Triangle::Triangle(const Triangle ©)
:isBad(false), a(copy.a), b(copy.b), c(copy.c)
{
... | ALGO | 0.914659 | 5.031253 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-07-01T11:05:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "670290e497... |
e8a6d465-1c66-4a63-b4fb-d9b7dca119b9 | rsadhu/Work | playground/cpp/matrix_operations.cpp | #include <iostream>
#include <vector>
void display(std::vector<std::vector<int>>& mat) {
for (int i = 0; i < mat.size(); i++) {
for (int j = 0; j < mat.size(); j++) {
std::cout << mat[i][j] << " ";
}
std::cout << "\n";
}
}
int calc(std::vector<std::vector<int>>& mat) {
i... | ALGO | 0.99998 | 5.012449 | {
"github_metadata": {
"branch": "trunk",
"commit_count": 467,
"repo_created_at": "2012-09-11T17:11:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "09c80293d... |
eaa3b167-e14c-419a-9ed7-e37809a7dab9 | OmeletWithoutEgg/CompetitiveProgramming | TIOJ/1726.cpp | #include <bits/stdc++.h>
#ifdef local
#define debug(x) (cerr<<#x<<" = "<<(x)<<'\n')
#else
#define debug(x) ((void)0)
#endif // local
#define pb emplace_back
using namespace std;
constexpr int N = 60025, K = 300, inf = 1e8;
vector<int> id[N],ans[K];
int big[N],totb,n,q,v[N];
void precalc(int k) {
ans[k].resize(n+1... | ALGO | 0.999798 | 4.310205 | {
"github_metadata": {
"branch": "master",
"commit_count": 262,
"repo_created_at": "2020-08-18T02:18:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f58f6155... |
1238598a-4605-4249-b1ae-d9eb5431f151 | khanhduy1407/Learn-C-Cpp | baitap/trentruong/ktlt/bai_tap_1_buoi_2.cpp | #include<iostream>
#define MAX 100
typedef int maTran[MAX][MAX];
void ThietLap(int &a, int &b);
void Nhap(int dong, int cot);
void Xuat(int dong, int cot);
void TimVTPTLonNhat(int dong, int cot, int &vtdong, int &vtvot);
void TimGiaTriX(int dong, int cot);
void TimDongCoTongLon(int dong, int cot);
void ThietLap(int... | ALGO | 0.999257 | 3.315843 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2022-01-08T14:11:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "aa0f2e12a... |
b92ec9f4-8e70-4c3e-9621-3bebd81593cd | iljavaleev/simple_oauth2 | client/Utils.cpp |
#include "Utils.hpp"
#include <iostream>
#include <sstream>
#include <format>
#include <cpr/cpr.h>
#include <nlohmann/json.hpp>
#include "DB.hpp"
using json = nlohmann::json;
using Client = models::Client;
using Server = models::Server;
const std::string server_uri = std::format(
"http://{}:{}", std::getenv("... | TOOL | 0.9391 | 7.092427 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2024-09-10T13:37: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": "c864cd52937... |
3dc9653c-d7de-4ed0-bbd3-6d64c1fd43b3 | mehmetfarukkomurculer/University-Programming-Assignments | cs201/take-home-exam5/Source.cpp | #include <iostream>
#include <string>
#include <fstream>
#include <sstream>
#include "strutils.h"
#include <vector>
#include <algorithm>
using namespace std;
//<NAME>
struct structt{
string name_series;
string name_actors;
double rating;
double avg;
int counter;
};
bool Comparison(const structt& a, con... | TOOL | 0.944024 | 3.950925 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2024-01-14T13:00: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": "200783860dd4... |
73f5a085-11ae-4aca-bc87-806d798098cc | hiroshi-maybe/topcoder | solutions/LittleElephantAndXor/LittleElephantAndXor.cpp | #include <fstream> // for greed plugin
#include <iostream>
#include <algorithm> // max,min
#include <vector>
#include <string>
#include <sstream>
#include <set>
#include <map>
#include <iostream>
#include <utility>
#include <cctype>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cmath>... | ALGO | 0.999475 | 4.489326 | {
"github_metadata": {
"branch": "master",
"commit_count": 1437,
"repo_created_at": "2015-05-24T07:26:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4f67ba2... |
113c2e17-e325-4098-84ca-ce883614df4c | iconicmajo/OpenMp | heatPDE_sec.cpp | #include <stdio.h>
#include <math.h>
#include "DynamicMatrix.cpp"
void Heat(int intervals);
double T0(int j, double Tr,double Tl, int N){
return (Tl-Tr)/(j*N);
}
bool stopCondition(double i){
return (i>100000);
}
void Heat(int intervals, double Tl, double Tr, double C, int x_intervals, int t_intervals) {
... | ALGO | 0.999969 | 3.812043 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2022-02-26T01:33:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "13075dc747a1... |
264a8e10-6ea5-4242-b357-17c7968b8c33 | AshkenSC/Programming-Practice | LeetCode/!0107. Binary Tree Level Order Traversal II.cpp | /*
0107. Binary Tree Level Order Traversal II
给定一个二叉树,自底向上、从左到右地返回结点的值。
从样例来看,应该返回一个二维数组,每个子数组是每层返回的结果。
思路:可以先自顶向下、从右到左地层序遍历该树,然后将数组里的元素逆序排列(但要保持二维数组的结构)。
问题:
1)层序遍历
使用队列进行。
queue.enque(root)
while queue is not empty:
current = queue.deque()
result.add(current)
queue.enque(current.right)
queue.enque(c... | ALGO | 0.999985 | 6.000416 | {
"github_metadata": {
"branch": "master",
"commit_count": 609,
"repo_created_at": "2018-03-29T15:50: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": "fd492208... |
c1f6ebe5-332c-4e04-953a-ecbc36592225 | bulletphysics/bullet3 | src/BulletSoftBody/btSoftBody.cpp | /*
Bullet Continuous Collision Detection and Physics Library
Copyright (c) 2003-2006 <NAME> https://bulletphysics.org
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to ... | ALGO | 0.998087 | 6.375493 | {
"github_metadata": {
"branch": "master",
"commit_count": 9404,
"repo_created_at": "2011-04-12T18:45:08.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 13557,
"forks": 2973,
"issues": 238,
"pull_requests": 141
},
"file_meta": {
"content_id"... |
66327664-0abb-4645-bde2-832a2bc3bf5a | chinmayparekh/Data-Structures-and-Algorithms | week8/alternatesolns/alternateP2.cpp | #include <bits/stdc++.h>
using namespace std;
long long int PrefixSum(long long int BIT[],long long int i)
{
long long int sum = 0; // Iniialise sum
while (i>0)
{
sum += BIT[i];
i -= i & (-i);
}
return sum;
}
void updateBIT(long long int BIT[], long long int n, long long int i,long long int X)
{
while (i... | ALGO | 0.999996 | 3.923933 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2021-09-11T04:59: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": "03bfc48461b2... |
5b92ebb0-6bbb-4817-92ed-96498104d6ba | Lee-Duck-03/template_cp | codetumlumtala/PBL1.cpp | #include <bits/stdc++.h>
#define MOD 1000000007
#define base 31
#define Pi 3.141592654
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const int N = 100006;
typedef map<int, int> mii;
typedef vector<int> vti;
int n;
float A[N], a, b, e;
bool oii = false;
float x;
void Input(){
cout << "> ... | ALGO | 0.999934 | 3.432556 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-06-28T04:16: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": "022d400c5891... |
583c876a-247f-4905-ade7-665845eb0c9e | minhngoc-2001/Game | HANGMAN.cpp | #include <bits/stdc++.h>
using namespace std;
char IMG[71][13];
vector <string> words;
string answer,s;
int a,b,cnt;
void loaddata(){
ifstream fin1("HANGMANIMG.inp",ios::in);
for(int i=1;i<71;i++)
for(int j=1;j<13;j++)
fin1 >> IMG[i][j];
fin1.close();
ifstream fin2("HANGMANWORDS.inp"... | ALGO | 0.998663 | 3.367641 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2020-04-07T03:47:45.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "83c0336ebc1... |
836ece83-e4cb-4dfc-ad92-a75d123e2d93 | ChangminYi/Baekjoon_code | 12869_뮤탈리스크/main.cpp | #include <iostream>
#include <queue>
using namespace std;
struct qn {
int a, b, c, cnt;
qn(int _a, int _b, int _c, int _cnt) {
a = _a, b = _b, c = _c, cnt = _cnt;
}
};
const int minus_val[6][3] = {
{1, 3, 9},
{1, 9, 3},
{3, 1, 9},
{3, 9, 1},
{9, 1, 3},
{9, 3, 1}
};
int n,... | ALGO | 0.99992 | 4.056319 | {
"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": "606b38d6... |
1c5435fb-bbcc-43e2-8e39-0981bcd3eb5c | AyushYadav/competetiveArchive | ideone_xibJ0R.cpp | #include <iostream>
#include <cstring>
#include <vector>
using namespace std;
#define lli long long int
const lli MOD = 1000000007;
lli powerFunc(lli a, int p);
int main(void){
vector<lli> fact(1111);
vector<lli> inp(1111);
fact[0] = 1;
for (int i=1; i<=1000; i++)
for (int j=1; j<=4; j++)
... | ALGO | 0.999978 | 4.517323 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2017-10-19T04:32:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "879244fc84... |
a5c722c2-2ef1-451e-8af1-7cc4a24ff284 | daspers/CP | TLX/Arsip Kontes Pemrograman/TOKI Regular Open Contest/1/D.cpp | #include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define INF 2000000000000000000LL
#define EPS 1e-8
#define debug(a) cerr<<#a<<"="<<(a)<<"\n"
typedef long long ll;
typedef unsigned long long ull;
typedef complex<double> cd;
typedef pair<ll, ll... | ALGO | 0.999953 | 3.70329 | {
"github_metadata": {
"branch": "master",
"commit_count": 447,
"repo_created_at": "2017-08-01T14:39: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": "62aa6ca9... |
a0f7a935-4841-47dd-8d5a-ebf0aa5b864c | arrows-1011/CPro | AOJ/Volume22/2217.cpp | #include <iostream>
#include <vector>
#include <cstring>
using namespace std;
#define MAX 100
int tx, ty, ans;
int n, X[MAX][MAX], Y[MAX][MAX];
bool visited[MAX][MAX], found[MAX][MAX];
bool used[MAX][MAX], flg;
void rec(int x, int y){
if(visited[x][y]){
if(!found[x][y] && tx == x && ty == y){
found[x]... | ALGO | 0.999385 | 3.774262 | {
"github_metadata": {
"branch": "master",
"commit_count": 258,
"repo_created_at": "2015-11-18T15:08:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "049d5fee... |
0e972fd7-2e77-480e-85d1-2a5a6558b10a | NadineAB/MPC-Meshing_Point_Clouds | CGAL/include/CGAL/Point_2_Point_2_intersection.h | // Copyright (c) 2000
// Utrecht University (The Netherlands),
// ETH Zurich (Switzerland),
// INRIA Sophia-Antipolis (France),
// Max-Planck-Institute Saarbruecken (Germany),
// and Tel-Aviv University (Israel). All rights reserved.
//
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
// ... | ALGO | 0.959339 | 6.450588 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2015-12-18T21:22:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 22,
"forks": 7,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "50bdee9d... |
089b37ab-a3c8-4d56-ba63-47455d337640 | masal9pse/atcoder-practice | abc/150~200/182/c3.cpp | #include <iostream>
#include <vector>
#include <math.h>
#include <stdio.h>
#include <algorithm>
#include <set>
#include <regex>
#include <iomanip>
#include <map>
#include <cassert>
#include <stack>
#include <queue>
#include <deque>
#include <string>
#include <numeric>
using namespace std;
using ll = long long;
template... | ALGO | 0.999725 | 3.46037 | {
"github_metadata": {
"branch": "master",
"commit_count": 221,
"repo_created_at": "2022-03-11T08:41: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": "6a0adc27... |
e2cf2bae-f450-4b95-b6dc-79d6fda3d03b | Alberich-x/TcpServer | MD5.cpp | #include <MD5.h>
#include <cmath>
MD5::MD5()
{
for (int i = 0; i < 64; i++)
{
k[i] = floor(abs(sin(i + 1) * pow(2, 32)));
}
int h1 = 0x67452301;
int h2 = 0xEFCDAB89;
int h3 = 0x98BADCFE;
int h4 = 0x10325476;
}
void MD5::trans(QByteArray message)
{
init(message);
}
void MD5::init(QByteArray message)
{
... | ALGO | 0.989185 | 3.904407 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2024-03-16T02:59: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": "481c0738e2... |
607babf0-594d-4ec2-8255-ae886d2b0147 | switchpiggy/Competitive_Programming | usaco/hoofPaperScissors.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
ll n, pref[3][100007], ans = 0;
char temp;
int main() {
scanf("%lld", &n);
pref[0][0] = pref[1][0] = pref[2][0] = 0;
for(ll i = 1; i <= n; ++i) {
cin >> temp;
if(temp == 'P') pref[2][i]++;
else if(temp == 'S')... | ALGO | 0.999791 | 3.645736 | {
"github_metadata": {
"branch": "master",
"commit_count": 164,
"repo_created_at": "2020-08-27T23:38:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "414363f0... |
c9db3e7f-a9d9-4670-9e39-d8f5e4219fce | runrunbian/leetcode | 15_三数之和/main.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include "utils.h"
using namespace std;
using namespace Utils;
class Solution {
public:
vector<vector<int> > threeSum(vector<int>& nums) {
vector<vector<int> > results ;
sort(nums.begin(), nums.end());
// 排序
// 依次遍历
... | ALGO | 0.999983 | 5.140112 | {
"github_metadata": {
"branch": "master",
"commit_count": 33,
"repo_created_at": "2017-01-01T09:38: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": "57fdfdf55... |
3e51c190-ad91-4c51-afca-83764724a72b | ishandutta2007/codeforces-c | ch_egor/normal/352/A.cpp | #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <string>
#include <cstring>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <cassert>
#include <algorithm>
#include <iomanip>
#include <ctime>
#include <cmath>
#include <bitset>
#pragma comment... | ALGO | 0.999824 | 3.350142 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:17: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": "ec8c907d0d88... |
360f54aa-b2f4-4a2c-ab70-1502f12fc72c | antlr/antlr4 | runtime/Cpp/runtime/src/atn/PredictionContextMergeCache.cpp | // Copyright 2012-2022 The ANTLR Project
//
// Redistribution and use in source and binary forms, with or without modification, are permitted
// provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice, this list of conditions
// and the following... | TOOL | 0.983068 | 7.617666 | {
"github_metadata": {
"branch": "dev",
"commit_count": 9401,
"repo_created_at": "2010-02-04T01:36:28.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 18144,
"forks": 3372,
"issues": 868,
"pull_requests": 157
},
"file_meta": {
"content_id": "... |
4bc233c0-50ff-4523-8d7b-5819baf829f6 | BrandonRolston/CrabBot | Libraries/LineFollower.cpp | #include "LineFollower.h"
#include "arduino.h"
LineFollower::LineFollower(unsigned int leftSensorPin, unsigned int middleSensorPin, unsigned int rightSensorPin,
Motor *rfMotor, Motor *rrMotor, Motor *lfMotor, Motor *lrMotor, RangeFinder *forwardSensor){
m_leftSensorPin=leftSensorPin;
m_middleSensorP... | TOOL | 0.909333 | 4.129857 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2017-04-09T20:36: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": "22d2c31b95... |
682159ad-eb5d-40d4-a3d9-6cf18afe8e2b | Yash59ops/Leetcode-Solution | Steps by Knight - GFG/steps-by-knight.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
public:
//Function to find out minimum steps Knight needs to reach target position.
int minStepToReachTarget(vector<int>&KnightPos,vector<int>&TargetPos,int N)
{
int n=N;
int x=TargetPos[0]-1... | ALGO | 0.999861 | 5.909941 | {
"github_metadata": {
"branch": "main",
"commit_count": 1162,
"repo_created_at": "2023-01-24T17:20:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "88dbbc601... |
f0cc6968-59ac-43fc-b2e5-ca7ca76dc197 | audacity/audacity | au3/lib-src/libscorealign/comp_chroma.cpp | /* comp_chroma.cpp -- compute chroma distance
*
* 2008 RBD
*/
#include <string.h>
#include <math.h>
#include <fstream>
#include <algorithm>
#include "allegro.h"
#include "audioreader.h"
#include "scorealign.h"
#include "gen_chroma.h"
#include "comp_chroma.h"
using namespace std;
#ifdef min
#undef min
#endif
#defi... | ALGO | 0.967073 | 5.893686 | {
"github_metadata": {
"branch": "master",
"commit_count": 21239,
"repo_created_at": "2015-03-26T10:46:17.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 13904,
"forks": 2362,
"issues": 1143,
"pull_requests": 31
},
"file_meta": {
"content_id... |
7ccb2135-5062-4c6d-b59d-d41cfe6e0093 | Teamforalgorithm/study_codes | rokwon/14889_스타트와_링크.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
const int MAX = 20;
const int INF = 987654321;
int N, result;
int team[MAX][MAX];
void DFS(string bit, int startTeam, int linkTeam)
{
//N/2명씩 팀원을 가졌을 경우
if (bit.size()==N)
{
vec... | ALGO | 0.999974 | 4.112479 | {
"github_metadata": {
"branch": "master",
"commit_count": 121,
"repo_created_at": "2020-01-07T08:22:28.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "5855e7369... |
223f8522-e90f-4b27-9712-cb29375f4e34 | zongy17/Cage_AutoGen | include/igl/smooth_corner_adjacency.h | #ifndef IGL_SMOOTH_CORNER_ADJACENCY_H
#define IGL_SMOOTH_CORNER_ADJACENCY_H
#include <Eigen/Core>
#include "igl_inline.h"
namespace igl
{
// Determine the corner-to-face adjacency relationship that can be used for
// computing crease-aware per-corner normals.
//
// Inputs:
// V #V by 3 list of mesh verte... | ALGO | 0.995422 | 6.650593 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2021-12-23T09:09:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b330dc17e1... |
1fbbf869-f131-4708-a3bd-6e0f8b5935ab | unjambonakap/prog_contest | tc/tcc06/old.WordGuessingGame.cpp | // BEGIN CUT HERE
// END CUT HERE
#line 5 "WordGuessingGame.cpp"
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <algorithm>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <cstdlib>
#include <string>
#in... | ALGO | 0.999709 | 3.883026 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2018-08-16T18:21:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d7d490238e... |
8568609a-9249-4f18-953e-e71d6f9fb722 | rizveeredwan/Sequential-Pattern-Mining-Algorithms | SPAM/spam.cpp | #include <bits/stdc++.h>
using namespace std;
#define MAX_SYMBOL 30
#define BASE 'a'
struct Pattern{
string p; //pattern
set<int>S; //occurrence vector set
};
vector<Pattern>generatedFrequentPatterns;
vector<string>transactions; //to save the information about transactions
int maxEvent;
int numberOfBit;
ma... | ALGO | 0.999225 | 3.600769 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2019-03-06T22:26:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a1c6beec9... |
596cf93d-8960-4bd0-93af-d19d035b4584 | Dream-ID97/Adventure-Extended | adv.cpp | #include <iostream>
#include <cstdlib>
using namespace std;
void clearScreen() {
system("clear"); // Linux/MacOS
// system("cls"); // Windows
}
void printTitle() {
cout << "=====================================" << endl;
cout << " Adventure Game " << endl;
cout << "===========... | TOOL | 0.954849 | 3.542087 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2025-01-12T13:40:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e31392f1702d... |
c679dbc7-8636-4244-a57a-ac6cd436be51 | KeepCodeing/AlgorithmRecords | 挑战程序设计竞赛/搜索/Property Distribution Aizu - 0118.cpp | #include <iostream>
#include <cstdio>
using namespace std;
// 爆搜,但是要求多个连通块,实际上只用对每个点都进行DFS,如果是苹果,蜜桔,梨子就遍历,否则跳过
// 另外要在爆搜里记录当前字符,因为有三种连通块...
const int N = 110;
char graph[N][N];
int n, m;
int res = 0;
void dfs(int sx, int sy, char c) {
if (sx < 1 || sx > n || sy < 1 || sy > m) return;
if (graph[sx][sy] != c) retur... | ALGO | 0.999907 | 3.798299 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-08-04T00:50: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": "dc351733e8fa... |
97b14a3e-ee81-4db2-b2d2-07f6d04d9b48 | ayushjaswal/DSA-problems | LinkedList/AddTwoNumbers.cpp | // Medium level question
/**
* 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:
... | ALGO | 0.999951 | 5.910941 | {
"github_metadata": {
"branch": "master",
"commit_count": 83,
"repo_created_at": "2023-02-25T20:09: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": "f4eed9f1b... |
7843ee9f-7283-4015-921f-3bd8e8bdd32f | IvanAli/CP | Codeforces/LadderD/203d.cpp | #include <bits/stdc++.h>
#define eps 1e-9
using namespace std;
double a, b, m;
double vx, vy, vz;
int main() {
cin >> a >> b >> m;
cin >> vx >> vy >> vz;
double tx = a / fabs(vx);
double ty = m / -vy;
double tz = b / vz;
int bx = (int)(ty / (tx / 2.)) ? 1 + (ty - tx / 2.) / tx : 0;
int bz ... | ALGO | 0.999887 | 3.712209 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2015-08-16T06:56:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b93d0c989... |
d7c5bda6-b116-4ca5-b43c-9ef368fd2141 | Noodle96/contestProgramming | CDFC/CampamentoNacional2024/K_Cow_Beauty_Pageant_Bronze_Level.cpp | #include <bits/stdc++.h>
#define all(x) x.begin(),x.end()
#define msg(str,str2) cout << str << str2<< endl
using namespace std;
using ll = long long;
using ld = long double;
using uint = unsigned int;
using ull = unsigned long long;
template<typename T>
using pair2 = pair<T, T>;
using pii = pair<int, int>;
using pli =... | ALGO | 0.999953 | 4.0388 | {
"github_metadata": {
"branch": "main",
"commit_count": 787,
"repo_created_at": "2022-02-23T23:20: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": "d4f58c427e... |
a901042e-a2bd-4a01-8bd0-2febf59a69f8 | truongduy134/uva-online-judge-solutions | Volume_11/UVA1197.cpp | #include <cstdio>
#include <vector>
using namespace std;
class UnionFind {
private:
vector<int> parentVector, rankVector, sizeVector;
public:
UnionFind(int numSet);
int findSet(int element);
int getSetSize(int element);
bool isSameSet(int eleOne, int eleTwo);
void unionSet(int eleOne, int ele... | ALGO | 0.999511 | 3.734269 | {
"github_metadata": {
"branch": "master",
"commit_count": 36,
"repo_created_at": "2013-05-09T16:23:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 21,
"forks": 17,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "82d3199... |
5cbbf885-4244-45cd-9001-040388ca4468 | KratosMultiphysics/Kratos | external_libraries/vexcl/vexcl/sparse/distributed.hpp | #ifndef VEXCL_SPARSE_DISTRIBUTED_HPP
#define VEXCL_SPARSE_DISTRIBUTED_HPP
#include <vector>
#include <unordered_map>
#include <algorithm>
#include <vexcl/util.hpp>
#include <vexcl/backend.hpp>
#include <vexcl/operations.hpp>
#include <vexcl/sparse/product.hpp>
#include <vexcl/sparse/spmv_ops.hpp>
namespace vex {
nam... | TOOL | 0.974732 | 6.566762 | {
"github_metadata": {
"branch": "master",
"commit_count": 106408,
"repo_created_at": "2017-02-13T10:58:24.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1141,
"forks": 265,
"issues": 381,
"pull_requests": 258
},
"file_meta": {
"content_id"... |
9adc63f4-a3cc-41fd-a429-5d484213a4c2 | NgTienHungg/PTIT-Source | SAMSUNG/MÃ GRAY.cpp | #pragma GCC optimize("O2")
#include <bits/stdc++.h>
using namespace std;
void TestCase() {
int n;
cin >> n;
vector<string> v;
v.push_back("0");
v.push_back("1");
for (int i = 2; i <= n; ++i) {
int len = v.size();
for (int j = len - 1; j >= 0; --j) {
v.push_back(v[j... | ALGO | 0.999855 | 4.300153 | {
"github_metadata": {
"branch": "main",
"commit_count": 106,
"repo_created_at": "2021-07-04T02:14:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 130,
"forks": 36,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a072e76... |
42a93779-b476-40b0-8980-203e49258187 | lcccc/nfcjcodes | ag2.cpp | /*
ID:lc757692
TASK:agrinet
LANG:C++
*/
#include<iostream>
#include<fstream>
#include<algorithm>
#define INF 2147483646
using namespace std;
int n,edge,t=0,ans=0;
int p[10005],r[10005];
int u[10005],v[10005],w[10005];
int cmp(const int i, const int j){return w[i] < w[j];}
int find(int x) {return p[x] == x?x:p[x] = find... | ALGO | 0.999987 | 3.696499 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2011-12-09T05:04:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f10d0a96f... |
b0286756-2c53-4b06-beb1-6561f14eaa3b | jstraub/cudaPcl | include/cudaPcl/normalExtractSimpleGpu.hpp | /* Copyright (c) 2014, <NAME> <<EMAIL>>
* Licensed under the MIT license. See the license file LICENSE.
*/
#pragma once
#include <iostream>
#include <stdint.h>
#include <algorithm>
#include <Eigen/Dense>
#include <pcl/point_types.h>
#include <pcl/features/normal_3d.h>
#include <opencv2/core/core.hpp>
#include <ope... | ALGO | 0.950859 | 5.691132 | {
"github_metadata": {
"branch": "master",
"commit_count": 155,
"repo_created_at": "2015-04-04T19:42:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 106,
"forks": 26,
"issues": 4,
"pull_requests": 0
},
"file_meta": {
"content_id": "fb168... |
decbd291-1e61-4fe6-b6b0-ca250c6049fb | shepard-liu/algorithm | src/leetcode/173_binary_search_tree_iterator.hpp | // https://leetcode.cn/problems/binary-search-tree-iterator/ Binary Search Tree
// Iterator
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode() : val(0), left(nullptr), right(nullptr) {}
... | ALGO | 0.999994 | 6.48617 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2024-11-20T06:06: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": "c20da33ea7... |
1ca13c45-fda7-45ad-949e-182be2262ce4 | lzyrapx/Codeforces | 600F.cpp | #pragma comment(linker, "/STACK:102400000,102400000")
//#include<bits/stdc++.h>
#include<stdio.h>
#include<string.h>
#include<algorithm>
#include<iostream>
#include<cstring>
#include<vector>
#include<map>
#include<cmath>
#include<queue>
#include<set>
#include<stack>
#include <utility>
using namespace std;
typedef long... | ALGO | 0.999992 | 3.380749 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2018-03-21T10:07:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6fe05ea956... |
ddcf7af9-a43c-4b22-b230-f2cf3ea76be9 | lamphanviet/competitive-programming | uva-online-judge/accepted-solutions/706 - LC Digit.cpp | #include <stdio.h>
#include <string.h>
#include <stdlib.h>
int ifEnd(int s, char n[])
{
if (s==0 && n[0]=='0') return 1;
else return 0;
}
int read(int *s,char n[])
{
int i;
scanf("%d ",s);
gets(n);
return ifEnd(*s,n);
}
void printline(char line[], int s)
{
int i;
for (i=0;i<s;i++)
... | ALGO | 0.998673 | 3.028103 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2014-06-20T02:07:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 83,
"forks": 56,
"issues": 1,
"pull_requests": 1
},
"file_meta": {
"content_id": "7f9523bc... |
5c36e690-ea36-476b-b03d-7eda605cb327 | ZJU-warren/PAT | PAT - A/Problem_1136.cpp | #include <bits/stdc++.h>
using namespace std;
#define Fin(i,f,t) for(int i=f;i<=t;++i)
#define Fde(i,f,t) for(int i=f;i>=t;--i)
#define MAXN 1200
struct BigInt{
int arr[MAXN],len;
BigInt operator + (BigInt A) {
BigInt res;
int maxLen = max(len,A.len);
Fin(i,len,maxLen)
arr[... | ALGO | 0.999312 | 3.665789 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-10-01T10:31:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "85d825a0f3... |
64ef9f66-2870-4c44-a530-0ca9494bf107 | GlaucoMasi/CompetitiveProgramming | Olinfo/ois_gnomesort.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int n; cin >> n;
vector<int> v(n); for(auto &i : v) cin >> i;
vector<array<int, 2>> intervals;
for(int i = 0; i < n; i++){
if(v[v[i]] != i){
cout << "NO";
return 0;
}else if(i ... | ALGO | 0.999996 | 3.999325 | {
"github_metadata": {
"branch": "main",
"commit_count": 472,
"repo_created_at": "2022-10-01T17: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": "dc5442de43... |
0593abe4-a3af-4629-b5dd-65957eaaebe7 | earthsiege2/borland-cpp-ide | EXAMPLES/STDLIB/ICECREAM.CPP | #include "stlexam.h"
#pragma hdrstop
/**************************************************************************
*
* icecream.cpp - priority queue example program. Section 11.3.1
*
***************************************************************************
*
* (c) Copyright 1994, 1998 Rogue Wave Software, Inc.
*... | ALGO | 0.988961 | 6.326213 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2021-08-10T19:48:24.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 14,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e71fcb63c1... |
dd23d452-f96a-4e6a-8c58-803e55f84444 | Mahfuzar148/Data-Structure-Lab | Practice/Stack and Queue/Stack using array (Character)).cpp | #include<bits/stdc++.h>
using namespace std;
#define MAX 1000
class Stack{
int top;
public :
Stack(){top = -1;}
char stk[MAX];
void push(char chr);
char peek();
char pop();
bool isEmpty();
void display();
};
void Stack::push(char chr){
if(top>=MAX-1)
{
... | ALGO | 0.998911 | 3.453424 | {
"github_metadata": {
"branch": "main",
"commit_count": 77,
"repo_created_at": "2023-02-28T10:42:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "8b022ff165c... |
3d071f06-26b5-43b0-9cca-8ae6132aec84 | yash-93/Coding-Practice | Codeforces/Round693/A.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
void test(){
ll w,h,n;
cin >> w >> h >> n;
ll init_a = 1;
ll timescut_a = 1;
while(w%2 == 0){
init_a = 2 * timescut_a;
timescut_a *= 2;
w /= 2;
}
//cout << init_a << " ";
ll init_b = 1;
ll t... | ALGO | 0.999877 | 3.688421 | {
"github_metadata": {
"branch": "master",
"commit_count": 266,
"repo_created_at": "2020-04-20T08:41: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": "e62fd21f... |
6871b342-b451-4000-8fe5-ae7542fbf27d | Mrddddx/my_acm | cf/R943_G1.cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long
string s;
int n, k;
bool check(int x){
if(x == 0) return 1;
cout << x << ' ';
int ans = 1;
for(int i = x; i < n; i++){
if(s[0] == s[i]){
int j = 0;
while(j < x && j + i < n && s[j] == s[x + j]) j++;
... | ALGO | 0.999903 | 4.235305 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2024-04-17T07:04:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c46d3f91969e... |
618bca34-ccca-4327-95ae-263ee253aa81 | vaibhuujaiswal/DSAQuestionSolutions | Reverse a Doubly Linked List - GFG/reverse-a-doubly-linked-list.cpp | //{ Driver Code Starts
//Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
struct Node
{
int data;
Node * next;
Node * prev;
Node (int x)
{
data=x;
next=NULL;
prev=NULL;
}
};
Node *newNode(int data)
{
Node *temp=new Node(data);
... | ALGO | 0.999452 | 5.668095 | {
"github_metadata": {
"branch": "main",
"commit_count": 993,
"repo_created_at": "2022-04-15T13:56: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": "0b33cc48b3... |
0378514a-114d-48c6-889d-97cdb159e913 | Sonyalichman/openmp_lab | main.cpp | #include <iostream>
#include <cmath>
#include <omp.h>
double f(double x) {
return sin(x); // Функція інтегрування
}
double integrate_trapezoidal(double a, double b, int n, int num_threads) {
double h = (b - a) / n;
double sum = 0.0;
omp_set_num_threads(num_threads);
#pragma omp parallel for reductio... | ALGO | 0.999789 | 5.580821 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2025-04-22T10:09: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": "fc2dff9624ac... |
6d736974-41fe-481a-8382-d8d8cf6d38eb | ArronHZG/Algorithm | utils/TreeNode.cpp | //
// Created by 侯正罡 on 2020/4/19.
//
#include "TreeNode.h"
string treeNodeToString(TreeNode *root) {
if (root == nullptr) {
return "[]";
}
string output;
queue<TreeNode *> q;
q.push(root);
while (!q.empty()) {
TreeNode *node = q.front();
q.pop();
if (node ==... | ALGO | 0.997509 | 5.965969 | {
"github_metadata": {
"branch": "master",
"commit_count": 78,
"repo_created_at": "2019-04-22T17:26: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": "805c51d4f... |
885c240d-fca8-4aae-adae-2762eb3eeeb7 | JeromeGJH/LeetCode | 1478_1.cpp | class Solution {
public:
int minDistance(vector<int>& houses, int k) {
int l = houses.size();
if(l == 1)
return 0;
sort(houses.begin(), houses.end());
vector<vector<int>> dp(l , vector<int>(k+1, INT_MAX));
vector<vector<int>> dis(l , vector<int>(l, 0));
i... | ALGO | 0.999987 | 5.191031 | {
"github_metadata": {
"branch": "main",
"commit_count": 473,
"repo_created_at": "2021-05-30T20:26:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7fd6870296... |
c741fafe-fe50-4ff7-9980-7a0bec4ca088 | morris821028/UVa | volume126/12673 - Football.cpp | #include <stdio.h>
#include <algorithm>
#include <vector>
using namespace std;
bool cmp(pair<int, int> x, pair<int, int> y) {
return x.first - x.second > y.first - y.second;
}
int main() {
int N, G, S, R;
while(scanf("%d %d", &N, &G) == 2) {
vector< pair<int, int> > D;
for(int i = 0; i < N; i++) {
scanf("%d ... | ALGO | 0.999433 | 3.049736 | {
"github_metadata": {
"branch": "master",
"commit_count": 1197,
"repo_created_at": "2013-06-14T12:34:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 571,
"forks": 269,
"issues": 1,
"pull_requests": 1
},
"file_meta": {
"content_id": "dc8... |
43ca45c6-7d4d-4bc8-9716-cef5333f8e7b | P37RIFIED/DSLAb | LAb/Lab 2/q2.cpp | #include <iostream>
using namespace std;
// Define matrix sizes
const int ROWS = 3;
const int COLS = 3;
// Define matrices as boolean arrays
bool A[ROWS][COLS] = {{1, 0, 1}, {0, 1, 0}, {1, 1, 0}};
bool B[ROWS][COLS] = {{0, 1, 0}, {1, 0, 1}, {0, 1, 1}};
bool C[ROWS][COLS] = {{0, 1, 1}, {1, 0, 0}, {0, 1, 0}};
// Func... | ALGO | 0.999721 | 6.251834 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2023-04-30T03:39: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": "23614c50b444... |
edeeb5db-3445-403b-9d55-557cf7bc78c6 | vfolunin/archives-solutions | UVa Online Judge/10311.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <string>
using namespace std;
vector<int> getPrimes() {
const int N = 4e4;
vector<int> isPrime(N, 1), primes;
for (int i = 2; i < N; i++) {
if (isPrime[i]) {
primes.push_back(i);
... | ALGO | 0.999286 | 4.51991 | {
"github_metadata": {
"branch": "master",
"commit_count": 2367,
"repo_created_at": "2017-11-27T10:19:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 1,
"pull_requests": 5
},
"file_meta": {
"content_id": "faa7c39... |
f2e76d38-d353-4588-9c1e-c27654281906 | Noconfiesenmiscodigos/IOE-Data-Structure-and-Algorithms-Lab-Code-Solutions | Lab 1/1.3.2.cpp | /*WAP to check parenthesis of algebraic expression using stack*/
#include<iostream>
#define max 10
using namespace std;
template<class T>
class Stack
{
T data[max];
int top;
public:
Stack():top(-1) {}
void push(T value)
{
if(top==max-1)
{
cout<<"overflow"<<endl;
}... | ALGO | 0.995049 | 4.45489 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2020-10-14T05:11:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ebf506deb5a... |
fcd62841-a1f8-45bd-aa64-dda031bb5488 | zhudelong/VDB-EDT | src/vdb_edt/include/vdb_edt/dynamicVDBEDT.h | /*
* Copyright (c) Deron (<NAME>)
The Chinese University of Hong Kong
Carnegie Mellon University
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source co... | ALGO | 0.997579 | 4.815666 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2019-11-20T12:02:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 102,
"forks": 20,
"issues": 5,
"pull_requests": 0
},
"file_meta": {
"content_id": "4679b95... |
0f2eabd6-509f-4a4e-b8a2-bc754bc37965 | QbitQuantum/Basics | Исходники/EnemyTest.cpp | /*!
* @brief 衝突検出と解決。
*@param[in] nextPosition 次の座標。
*/
void EnemyTest::CollisionDetectAndResolve(CVector3 nextPosition)
{
//XZ平面を調べる。
{
int loopCount = 0;
while (true) {
CVector3 addPos;
addPos.Subtract(nextPosition, position);
CVector3 posTmp = position;
posTmp.y += radius + 0.2f;
btTransform st... | ALGO | 0.999176 | 4.360456 | {
"github_metadata": {
"branch": "main",
"commit_count": 68,
"repo_created_at": "2024-03-06T07:05:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "51e38e51b6d... |
e23ebb80-ac07-4c8b-834f-cc60ac72c691 | polub333/mipt_infa | 2_sem/Kontr/8/8.cpp | #include <sstream>
#include <iostream>
using namespace std;
struct BMine {
unsigned income; // ожидаемый доход от разработки бериниума в этом зале
BMine *next_cham; // указатель на информацию о следующем зале
};
unsigned max_income(BMine *mine, unsigned steps);
// функция чтения данных из карты
BMine* r... | ALGO | 0.999675 | 3.745764 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2023-02-09T14:44: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": "df72db48d12... |
461b5fa3-993f-4d53-bc10-9b3c305c9c43 | sheldona/slrbs | include/collision/CollisionDetect.h | #pragma once
#include <Eigen/Dense>
#include <vector>
class Contact;
class RigidBody;
class RigidBodySystem;
//
// The main collision detection class,
// it will test the geometries of each pair of rigid bodies
// and populate an array with contacts.
//
class CollisionDetect
{
public:
// Constructor.
//
... | ALGO | 0.988097 | 6.877884 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2023-08-11T22:34:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4c5ce73b29c... |
bb152e50-b530-49a0-a7ca-c7e07b67bc4d | arxk9/rai | applications/examples/poleBalwithPPO/poleBalwithRPPO.cpp | //
// Created by jhwangbo on 10/08/17.
//
#include <rai/RAI_core>
// Eigen
#include <Eigen/Dense>
// task
#include "rai/tasks/poleBalancing/POPoleBalancing.hpp"
//#include "rai/tasks/poleBalancing/PoleBalancing.hpp"
// noise model
#include "rai/noiseModel/NormalDistributionNoise.hpp"
// Neural network
//#include ... | ALGO | 0.960277 | 5.47367 | {
"github_metadata": {
"branch": "master",
"commit_count": 306,
"repo_created_at": "2018-11-02T01:32:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "2f20255a... |
c460a918-b98c-42ae-847b-390cd7d23541 | SuraRengoku/algorithms | src/leetcode1143.cpp | #include "leetcodeheader.h"
class Solution1 {
public:
static int longestCommonSequences(string text1, string text2) {
int len1 = text1.size(), len2 = text2.size();
vector<vector<int>> cache(len1, vector<int>(len2, -1));
function<int(int, int)> dp = [&](int i, int j) -> int {
if(... | ALGO | 0.999832 | 6.016642 | {
"github_metadata": {
"branch": "main",
"commit_count": 84,
"repo_created_at": "2023-07-17T10:06:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "124038b0cda... |
79ec737d-384f-48fe-a89d-8e64e5895c1f | moucheh/URA-cpp | zadaca1/zadatak1/divide.cpp | #include <iostream>
#include <iomanip>
int divide(int a, int b, int counter = 0) {
if (a == 0) {
return counter;
} else if (a < 0) {
return counter - 1;
}
return divide(a - b, b, counter + 1);
}
// T(n) = b => O(n)
int main() {
std::cout << " 10 / 3 = " << std::setw(2) << divide(10, 3) << std::endl;
std::... | ALGO | 0.962928 | 5.387253 | {
"github_metadata": {
"branch": "main",
"commit_count": 25,
"repo_created_at": "2024-05-07T16:44:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d02fa51ce13... |
c898bb5e-88f5-449a-b829-c1b6042d365b | Dragonfire3900/Multi_Dim_Analysis | OGDF_Mods/src/ogdf/energybased/davidson_harel/Overlap.cpp | /** \file
* \brief Implementation of class Overlap
*
* \author <NAME>
*
* \par License:
* This file is part of the Open Graph Drawing Framework (OGDF).
*
* \par
* Copyright (C)<br>
* See README.md in the OGDF root directory for details.
*
* \par
* This program is free software; you can redistribute it and/... | ALGO | 0.945753 | 6.610338 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2020-11-08T01:47:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "917defbe0a9... |
9e5aef96-4c0f-45a1-a093-bc2969c10e0b | Takeuchi-Akihide/Atcoder | ARC/ARC150/prob5.cpp | #include <bits/stdc++.h>
#include <atcoder/all>
#include <vector>
#include <map>
using namespace std;
using namespace atcoder;
using ll = long long;
using mint = atcoder::modint998244353;
#define MAX_N 100005
#define MAX_A 1000001
int main(int argc, char *argv[]) {
int i, j;
int N;
cin >> N;
vector... | ALGO | 0.999982 | 3.823412 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2022-11-01T13:48: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": "617cd2a332... |
5158b91c-7985-4ccb-8c17-6e7b4f214303 | DragoPhoenix/CP_Submissions | codeforces/1469/D.cpp | #include "bits/stdc++.h"
using namespace std;
#define max(a, b) (a < b? b : a)
#define min(a, b) ((a>b)?b:a)
#define MOD 1000000007
#define FOR(a,c) for ( int (a)=0; (a)<(c); (a)++)
#define FORL(a,b,c) for ( int (a)=(b); (a)<(c); (a)++)
#define FORR(a,b,c) for ( int (a)=(b); (a)>=(c); (a)--)
#define INF 100000... | ALGO | 0.997095 | 3.601864 | {
"github_metadata": {
"branch": "master",
"commit_count": 716,
"repo_created_at": "2021-11-15T10:07: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": "a6aeaa5a... |
611502bc-ada9-4b49-ba69-134d8e3c5505 | DanaPar/TSI-programming | PracticeN1_part1_2_solution/PracticeN1_part1_2_project/main.cpp | #include <iostream>
using namespace std;
int main()
{
int a, b;
int square, sum, subtraction, multiplication;
float division;
// user inputs
cout << "Enter number 1: ";
cin >> a;
cout << "Enter number 2: ";
cin >> b;
// maths
square = a * a;
sum = a + b;
subtraction = a - b;
multiplication = a * b;
divi... | TOOL | 0.917967 | 3.49362 | {
"github_metadata": {
"branch": "main",
"commit_count": 16,
"repo_created_at": "2024-10-13T13:28: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": "63b1fe5fc00... |
554ee9a0-ce20-4e76-8ae5-ce78c22cc240 | Provenance-Emu/Provenance | Cores/Gambatte/Sources/libresample/common/resample/src/makesinckernel.cpp | /***************************************************************************
* Copyright (C) 2008 by <NAME> *
* <EMAIL> *
* *
* This program is free software; you ... | ALGO | 0.976463 | 5.079051 | {
"github_metadata": {
"branch": "develop",
"commit_count": 6467,
"repo_created_at": "2013-08-27T20:34:36.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 6133,
"forks": 702,
"issues": 269,
"pull_requests": 10
},
"file_meta": {
"content_id": ... |
9294bc7a-4fb4-4e0c-95a6-da1565c907fe | Etherealblade/CLRS | Chapter 25/FloydWarshall/FloydWarshall/FloydWarshall.cpp | /* https://www.geeksforgeeks.org/floyd-warshall-algorithm-dp-16/
Finding shortest distances between every pair of vertices
in a given edge weighted directed Graph.
Negative-weight edges are allowed,
but no negative-weight cycles
*/
#include <iostream>
#include <iomanip>
using namespace std;
// Number of vertices in ... | ALGO | 0.999961 | 5.073653 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2021-03-25T02:26:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d40bab89ad... |
a4f16293-f9c6-49a0-8c36-624de5b5fa0a | harsh-kumar-css/DSA | binary tree/all_nodes_at_dist_K.cpp | // void parent_tracker(TreeNode*root,unordered_map<TreeNode*,TreeNode*>&parent_track)
// {
// queue<TreeNode*>q;
// q.push(root);
// while(!q.empty())
// {
// TreeNode*node = q.front();
// q.pop();
// if(node->left)
// {
// ... | ALGO | 0.999991 | 5.293712 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2022-08-03T18:33:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "355a680e6f... |
088d9b61-8721-4a7a-a825-fe5f7542fe79 | WYQ3333/light_server | everday/Fib_n_6_2.cpp | #include <iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<stdlib.h>
using namespace std;
string str_add(string str1, string str2){
vector<string> result;
if(str1.size() < str2.size()){
swap(str1, str2);
}
reverse(str1.begin(), str1.end());
reverse(str2.begin(), str2... | ALGO | 0.999911 | 4.422358 | {
"github_metadata": {
"branch": "master",
"commit_count": 222,
"repo_created_at": "2019-03-18T00:09: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": "03fab0d1... |
c5574b9a-32d2-41ce-984f-2f4043cf12fa | ishandutta2007/codeforces-o | onionpringles/normal/630/Q.cpp | #pragma warning(disable:4996)
#include <stdio.h>
#include <stdlib.h>
#include <cmath>
#include <vector>
#include <assert.h>
#include <algorithm>
#include <set>
#include <map>
#include <queue>
#include <tuple>
#include <limits.h>
#include <iostream>
#include <iomanip>
#include <complex>
#include <string.h>
#include <st... | ALGO | 0.997847 | 3.894263 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T15:45: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": "754ea0cf9884... |
e7ed3b5b-2e82-4392-9ffa-06c82cd3b6ad | racsosabe/Miscelanea | UPC/Contests/Simple Segment Tree Contest/Solution Codes/S.cpp | #include<bits/stdc++.h>
using namespace::std;
/*
Author: <NAME>
Idea:
- Segment Tree problem.
- This is just a particular case of D2, so please check that solution for more
references.
- Complexity: O(n log(n + m)).
*/
const int N = 1000000+5;
const long long inf = 1e18;
int n;
int m;
int a;
int b;
int ... | ALGO | 0.999917 | 3.380322 | {
"github_metadata": {
"branch": "master",
"commit_count": 135,
"repo_created_at": "2019-04-24T01:30:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "99ff981d... |
90923b29-5f94-4ce9-b5cd-0e6f392f96e0 | gnuh24/Programming-Techniques | Chapter 2 Pointer/FoP_T_2_2.cpp | /* Đề bài 2.2
2.2 Trong kỳ thi tốt nghiệp đại học có n thí sinh tham dự. Mỗi thí sinh cần quản lý các thông tin được mô tả như sau:
- MSSV
- Họ và tên
- Điểm môn cơ bản
- Điểm chuyên ngành 1
- Điểm chuyên ngành 2
a) Hãy khai báo kiểu dữ liệu cho bài toán như mô tả trên. Nhập thông tin cho n ... | TOOL | 0.983017 | 3.515783 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2023-06-24T05:10: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": "38034143c5... |
9720c65f-c0c8-433e-b8a0-7f1da9849d23 | pugachAG/compet | cpp/DataStructures/SegmentTree/lazy_test.cpp | #include <bits/stdc++.h>
using namespace std;
#include "lazy.h"
struct Naive {
vector<int> a;
Naive(const vector<int> &a): a(a) {
}
int get(int l, int r) {
int ans = 0;
for (int i = l; i <= r; i++) {
ans += a[i];
}
return ans;
}
void upd(int l, in... | ALGO | 0.997117 | 6.101532 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2019-06-20T10:02:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "a454e5c69... |
192ade9f-4e8e-4ffe-a56f-900bee4221c4 | memcpy0/LeetCode-Conquest | Solutions/331-340/338. Counting Bits[动态规划,位操作] 简单.cpp | /*
** Problem: https://leetcode.cn/problems/counting-bits/
** Article: https://memcpy0.blog.csdn.net/article/details/132680516
** Author: memcpy0
*/
// BEST: 去除最低设置位
class Solution {
public int[] countBits(int n) {
int[] bits = new int[n + 1];
for (int i = 1; i <= n; i++)
bits[i] = bits[... | ALGO | 0.999383 | 7.074225 | {
"github_metadata": {
"branch": "main",
"commit_count": 366,
"repo_created_at": "2021-08-14T13:49:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8ccfd49dbb... |
f9234ddf-2eef-40f4-947b-fc3c07367af1 | yeomsh/algorithm | picnic.cpp | #include<iostream>
using namespace std;
bool pairFriends[10][10];
int n;
bool check[10] = {};
int countPair() {
int firstFree = -1;
for (int i = 0; i < n; i++) {
if (check[i] == false) {
firstFree = i;
break;
}
}
//기저사례 -> 짝을 다 찾은 경우는 종료
if (firstFree == -1) return 1;
int ret = 0;
for (int i = first... | ALGO | 0.999963 | 4.099192 | {
"github_metadata": {
"branch": "master",
"commit_count": 22,
"repo_created_at": "2019-10-02T13: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": "9ca201dff... |
dcb345e0-5b56-4eef-ad08-8fe2ea63d6ae | wdzeng/cp-solutions | codeforces/contest/1451/e.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
#define x first
#define y second
#define all(v) v.begin(), v.end()
#define ms(v) memset(v, 0, sizeof(v))
#define mss(v) memset(v, -1, sizeof(v))
#define len(v) int(v.size())
#ifndef hy
#define fastio() cin.tie(0), ios::sync_... | ALGO | 0.999938 | 3.286636 | {
"github_metadata": {
"branch": "master",
"commit_count": 170,
"repo_created_at": "2019-03-26T03:15:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8c6af45a... |
7724a43a-f0eb-4dc2-a014-1d2b2b42c3dc | bolongz/MonteCarloLinearSystem | neumann.h | #ifndef _NEUMANN_H_
#define _NEUEMAN_H_
#include "matrix.h"
#include "pdf.h"
#include <time.h>
#include<stdlib.h>
#include<algorithm>
#include <thread>
template <typename Type>
class Neumann{
private:
size_t row;
size_t col;
double err, sum1, sum2, x, err_w;
int next, step, times;
int hops;
Matrix<Type> A_ForT... | ALGO | 0.999936 | 3.893013 | {
"github_metadata": {
"branch": "master",
"commit_count": 40,
"repo_created_at": "2016-02-23T19:26: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": "7c490d080... |
0fe847ed-692f-471b-92ed-0059f277f154 | Yawn-Sean/Daily_CF_Problems | daily_problems/2024/03/0316/personal_submission/cf665d_md.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
const int PCnt = 2e6 + 1;
std::vector<bool> isPrime(PCnt, true);
auto __init__ = [&]() -> int {
isPrime[0] = false;
isPrime[1... | ALGO | 0.999969 | 3.819744 | {
"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": "9f38... |
6fbb8fb2-c2e8-4fd3-86a3-f1a57375932b | quirrelHK/DSA | LUV/graph/dijkstra.cpp | // https://leetcode.com/problems/network-delay-time/
/*
It is used for weighted graphs
It is a single source multiple destination algorithm; we have to calculate distance of source for each node
For optimized code we use priority queue(we can use multiset instead because it is less complex; here set will suffice)
TC:... | ALGO | 0.999979 | 4.838752 | {
"github_metadata": {
"branch": "main",
"commit_count": 59,
"repo_created_at": "2022-12-28T14:43: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": "e2ff68caee4... |
7986c766-8048-4e15-a412-1cf77c208bc2 | electricalpigeon/Competitive-Programming | closest to lest, closest to right, binary search 2.cpp | //CLOSEST TO LEFT
#include <iostream>
#include <vector>
using namespace std;
int main()
{
int n,k;
cin>>n>>k;
vector<int> a(n);
for (int i=0;i<n;i++){
cin>>a[i];
}
for (int i=0;i<k;i++){
int x;
cin>>x;
int l=-1; //a[l]<=x
int r=n; //a... | ALGO | 0.99999 | 4.75034 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2023-11-23T15:34: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": "ca7b858a4fe7... |
2aca8357-7e8f-421f-804f-b36e4da2ca8b | VuDinhLongg/Competitive_Programming | DSA/DSA05003.cpp | // LonggVuz.
#include<bits/stdc++.h>
using namespace std;
// Noob C++
void End(){
cerr << "=> Thời gian code chạy: ";
cerr << (1.0 * clock() / CLOCKS_PER_SEC) << " giây" << string(27, '\t');
}
#define LonggVuz() ios_base::sync_with_stdio(false); cin.tie(NULL);
#define use(x) freopen(x".inp", "r", stdin); freope... | ALGO | 0.999926 | 4.314157 | {
"github_metadata": {
"branch": "LonggVuz",
"commit_count": 213,
"repo_created_at": "2024-08-12T13:29:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5804e1... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.