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 |
|---|---|---|---|---|---|---|---|
66e86b51-315c-499d-925f-8177a5ca5152 | DenisMartyanov01/TaMP | TaMP/vigener.cpp | #include <QDebug>
#include <QString>
QString en_alph = "abcdefghijklmnopqrstuvwxyz";
//QString ru_alph = "абвгдеёжзийклмнопрстуфхцчшщъыьэюя";
QString Encrypt(QString alphabet, QString input, QString key)
{
input = input.toLower();
key = key.toLower();
QString output;
int key_number = 0;
int n = (a... | ALGO | 0.999395 | 3.948614 | {
"github_metadata": {
"branch": "main",
"commit_count": 39,
"repo_created_at": "2024-02-01T06:09:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
"content_id": "303da761b9f... |
c4f7f0c4-8fc7-4cdd-bfba-c59993b1a13c | tenvi34/Algorithm_JWT | 스택과 큐/11286-절댓값힙/11286.cpp | #include <iostream>
#include <queue>
using namespace std;
struct compare
{
bool operator()(int o1, int o2)
{
int first_abs = abs(o1);
int secont_abs = abs(o2);
// 만약 절댓값이 같으면 음수 우선
if (first_abs == secont_abs)
{
return o1 > o2;
}
else
... | ALGO | 0.999991 | 4.822244 | {
"github_metadata": {
"branch": "main",
"commit_count": 30,
"repo_created_at": "2024-11-26T06:22:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2065c95f25c... |
0a05db67-356f-482f-ab79-74b377d76445 | davidecarini/AI_Accelerators_MSc_Thesis | Vitis-AI/Vitis-AI-Tutorials/Design_Tutorials/13-vdpu-pre-post-pl-acc/files/postproc/hls/src/dpupostproc_vhls.cpp | /*************************************************************************************
Vendor: Xilinx
Associated Filename: dpupostproc_vhls.cpp
Purpose: Vitis HLS DPU pre-processor
Revision History: 5 Aug 2021
authors: <EMAIL>, <EMAIL>
***********************************************************************... | DATA | 0.951645 | 4.618576 | {
"github_metadata": {
"branch": "main",
"commit_count": 126,
"repo_created_at": "2023-03-17T11:18:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4c9108c190... |
09381383-53a4-4aa9-8046-db101544e733 | T2hhbmEK/cp | 列队2.cpp | #include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define ll long long
#define ull unsigned long long
#define uint unsigned int
#define int long long
const int inf = 0x3f3f3f3f;
const int maxn = 1e6 + 5;
int lcm(int a, int b) { return a / __gcd(a, b) * b; }
signed main() {
freopen("line.in", "r", stdi... | ALGO | 0.99996 | 4.212198 | {
"github_metadata": {
"branch": "main",
"commit_count": 100,
"repo_created_at": "2024-11-15T14:58: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": "8f4ffc1d28... |
525a62fa-49a7-4abc-a6d2-7835531ad644 | Tanjim131/Problem-Solving | Codeforces/800/650-3-B.cpp | #include <iostream>
#include <vector>
#include <limits>
#include <algorithm>
int main(int argc, char const *argv[])
{
int T;
std::cin >> T;
while(T--){
int n;
std::cin >> n;
std::vector <int> arr(n);
int invalidEvenParityCounter = 0, invalidOddParityCounter = 0;
//bo... | ALGO | 0.999754 | 4.774895 | {
"github_metadata": {
"branch": "master",
"commit_count": 137,
"repo_created_at": "2020-05-27T20:39:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "53d45a10... |
63157e69-afa8-4b44-9f83-c527a75bfc4f | aadits1965/CODEFORCES | LEVEL B/B_2_D_Traveling.cpp | #include<bits/stdc++.h>
using namespace std;
#define fastIO ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define FOR(a, c) for (int(a) = 0; (a) < (c); (a)++)
typedef long long int ll;
typedef vector<int> vi;
typedef pair<ll, ll> pi;
#define F first
#define S second
#define PB push_back
#define POB po... | ALGO | 0.999954 | 3.507565 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2025-06-09T09:43: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": "c7ef77729800... |
5c5fc387-8c0c-4f2d-ac12-72773c3ce555 | ishandutta2007/codeforces-u | um_nik/normal/1586/C.cpp | #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
... | ALGO | 0.999967 | 4.027041 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:31:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "eb463b5ef1e9... |
30ca64fa-1732-4436-892f-cf9e9321b716 | plilja/algolib | graph/tests/floydw/floydw_test.cpp | #include <iostream>
#include <math.h>
#include <string>
#include "../../floydw.h"
#include <vector>
#include <limits>
using namespace std;
int main() {
const int INF = std::numeric_limits<int>::max();
const int NEG_INF = std::numeric_limits<int>::min();
vector <vector<double>> wt(150, vector<double>(150))... | ALGO | 0.999728 | 3.818919 | {
"github_metadata": {
"branch": "master",
"commit_count": 128,
"repo_created_at": "2015-04-18T16:08: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": "079308c9... |
8edb8ddb-967a-428f-82e7-ea893de20834 | Mortal/inplace-merge | merge.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <sys/time.h>
#include <stdexcept>
#include <random>
//#define DEBUG(x) do { std::cout << x; } while (0)
#define DEBUG(x) do {} while (0)
struct timer {
timer() {
::gettimeofday(&t1, NULL);
}
double elapsed() {
struct timeval t2;
::gettimeof... | ALGO | 0.999288 | 5.673219 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2014-11-29T21:48:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f9958d4b79... |
bf3f55a3-c6a9-4da0-9d99-1eb41c9fe7fd | ayanhmm/Codeforces-Submissions | B_Shrinking_Array.cpp | #pragma region HelperFunctions
#include<bits/stdc++.h>
#ifndef ONLINE_JUDGE
#define RESETCOL "\033[0m"
#define BOLD "\033[1m"
#define RED "\033[31m"
#define GREEN "\033[32m"
#define YELLOW "\033[33m"
#define debug(x) cerr<<RED << #x << " = " << x << endl << RESETCOL
#define showtc(x) cerr<<endl <<YELLOW <... | ALGO | 0.999482 | 4.291708 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2025-07-01T19:01: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": "f83edbf24c0d... |
881bd108-e8a3-4488-9b60-33a8569cfbfc | ishandutta2007/codeforces-a | amethyst0/normal/1338/D.cpp | #pragma comment(linker, "/STACK:1000000000")
#pragma GCC optimize("Ofast,no-stack-protector")
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <algorithm>
#include <memory.h>
#include <cassert>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <cmath>
#include <ctime>
#include <rando... | ALGO | 0.996519 | 3.701174 | {
"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": "fd7b3e9badf2... |
022600d1-c346-47a5-894f-2773c77ae2b9 | KatyaKos/AU_15-16 | C_C++/16/main.cpp | #include <iostream>
#include <vector>
#include <cstdio>
#include <fstream>
using namespace std;
class Matrix{
private:
size_t n;
vector <vector<double> > mtx;
public:
Matrix(){}
Matrix(size_t nn): n(nn){
mtx.resize(n);
for (size_t i = 0; i < n; i++){
mtx[i].resize(n);
}
}
~Matrix(){}
vector<double>&... | ALGO | 0.995592 | 4.275466 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2017-02-19T18:23: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": "75e2b89a05... |
d0f66654-c398-45fb-87d5-334523b8eacf | ishandutta2007/codeforces-d | deemo/normal/1263/E.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef long double ld;
#define F first
#define S second
const int MOD = 1e9 + 7;//XXX
const int C = 26;//XXX
void add(int &x, int y){
x += y;
while (x >= MOD) x -= MOD;
while (x < 0) x += MOD;
}
int fix(int x){
whi... | ALGO | 0.99991 | 3.577157 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:31: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": "2cc7051608c3... |
ca8cd80a-c70e-4f5d-b4f5-7b59f352340b | vasude1/UEL_cohesive_prony | UELMAT_Matrices.cpp | /* Matrices CLASS TO DEFINE UELMAT ELMENT LHS AND RHS
Created by <NAME>
--------------------------------------------------------------------------------
Memory Management -
SVARS structure -----
d1(1),f11,f12,f13...f18(8),h11x,h11y,h12x,h12y,h13x,h13y(2*nel),....
d2(1),f21,f22,f23...f28(8),h21x,h21y,h22x,h22y,h31x,h31... | ALGO | 0.994676 | 3.892166 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2020-07-23T07:05: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": "3a98663227... |
f5a82604-1618-4d6d-862f-71a6a35bd0fe | GorbunovKirill/Homework-2.5.2 | Homework 2.5.2/main.cpp | #include <iostream>
#include <windows.h>
class figure {
protected:
int sides;
int a;
int b;
int c;
int d;
int A;
int B;
int C;
int D;
std::string name;
int get_sides() {
return sides;
}
std::string get_name() {
return name;
}
int get_a() {
return a;
}
int get_b() {
return b;
}
int get_c()... | TOOL | 0.964989 | 3.201311 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-04-26T23: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": "0aee937e1479... |
8b951227-b6ca-4b67-b82f-c8257a62e8a3 | ycozco/24testvms_ps | adat_test/neh_heuristic.cpp | #include <iostream>
#include <vector>
#include <fstream>
#include <filesystem>
#include <chrono>
#include <iomanip>
using namespace std;
namespace fs = std::filesystem;
vector<vector<int>> leer_matriz(const string& nombre_archivo) {
ifstream archivo(nombre_archivo);
if (!archivo) {
cerr << "Error al ab... | ALGO | 0.999371 | 5.362252 | {
"github_metadata": {
"branch": "main",
"commit_count": 16,
"repo_created_at": "2024-07-24T00:17:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f3c7c628d49... |
f0dfe329-32d0-4bc3-acd7-cb534999efdd | sandorw/nanogo | src/board/board_state.cpp | /*
* board_state.cpp
*
* Created on: Apr 21, 2015
* Author: sandorw
*/
#include <board_state.h>
board_position getOpposingColor(board_position b) {
return (b == board_position::WHITE_STONE ? board_position::BLACK_STONE : board_position::WHITE_STONE);
}
group::group() {
n_liberties = 0;
all_libs = true;... | ALGO | 0.969393 | 5.708544 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2015-04-19T21:13:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ad44490e6d... |
2d96930f-1739-4be6-a546-c73f8b9562bd | thucvu2001/c-dsa | #1.LyThuyetSo&ToHop/Bai51_timHeSo.cpp | #include <bits/stdc++.h>
using namespace std;
long long ext(long long a, long long b, long long& x, long long& y)
{
if (b == 0) {
x = 1;
y = 0;
return a; // a = g;
}
long long x1, y1;
long long tmp = ext(b, a % b, x1, y1);
x = y1;
y = x1 - a / b * y1;
return tmp;
}
... | ALGO | 0.999982 | 4.896104 | {
"github_metadata": {
"branch": "master",
"commit_count": 31,
"repo_created_at": "2022-04-23T04:55:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "520291622... |
8827bcba-456f-4c15-a378-5c3178713e53 | patelalay231/Leetcode-Problem-Solutions | 0105-construct-binary-tree-from-preorder-and-inorder-traversal/0105-construct-binary-tree-from-preorder-and-inorder-traversal.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999995 | 6.614328 | {
"github_metadata": {
"branch": "main",
"commit_count": 932,
"repo_created_at": "2024-04-13T05:19: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": "93bb1f67b0... |
1a43b60a-80a3-445e-9138-23215bfdff9a | StoyanMalinin/Algorithms | past problems/NOI 3/2017/rect_C++98.cpp | #include <algorithm>
#include <iostream>
#include <vector>
#include <set>
using namespace std;
struct Rect
{
int x1, x2, y;
Rect(){}
Rect(int x1, int x2, int y)
{
this->x1 = x1;
this->x2 = x2;
this->y = y;
}
};
struct Zone
{
int x1, x2;
int64_t area;
Zone()
... | ALGO | 0.999829 | 4.165851 | {
"github_metadata": {
"branch": "master",
"commit_count": 110,
"repo_created_at": "2019-02-03T15:51:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3d1cf97f... |
0f931a36-267d-4bbb-89bb-972e26d3bc4a | google-deepmind/open_spiel | open_spiel/games/pathfinding/pathfinding.h | // Copyright 2022 DeepMind Technologies Limited
//
// 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 l... | ALGO | 0.999898 | 7.012219 | {
"github_metadata": {
"branch": "master",
"commit_count": 4660,
"repo_created_at": "2019-07-22T13:50:21.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 4631,
"forks": 1006,
"issues": 17,
"pull_requests": 6
},
"file_meta": {
"content_id": "c... |
6adc156d-9098-42b9-ab10-8bd750c501a5 | LearnerShreya/180 | 007_Pattern_Printing_2/1_right_head_triangle.cpp | // row = 1
// row <= 5
// print * row times
// row = row + 1
// *
// * *
// * * *
// * * * *
// * * * * *
// #include<iostream>
// using namespace std;
// int main()
// {
// int row, col;
// for(row=1; row<=5; row++)
// {
// for(col=1; col<=row; col++ )
// {
// cout<<"*"<<" ... | ALGO | 0.999358 | 3.943371 | {
"github_metadata": {
"branch": "main",
"commit_count": 260,
"repo_created_at": "2025-06-27T15:35:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "28ab2e4667... |
e681e035-2b0e-4105-8bd9-f759766ee520 | yashpadaliya08/CPP-Programs | PATTERN FOR.cpp | #include<iostream>
using namespace std;
int main(){
int n;
cin>>n;
int row = 1;
int count = 1;
for(int row=1;row<=n;row++){
for(int col=1;col<=row;col++){
cout<<col;
}
count++;
cout<<endl;
}
return 0;
}
OUTPUT
6
1
12
123
1234
12345
12345... | ALGO | 0.999925 | 3.960184 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-08-22T05:46: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": "48e3df1ccd90... |
ce060de4-e2a1-492f-b343-caa9a1e75513 | Pranab-JD/LeXInt | CUDA/Leja.hpp | #pragma once
#include "Timer.hpp"
#include "Eigenvalues.hpp"
#include "error_check.hpp"
#include "Kernels_CUDA_Cpp.hpp"
//! Include Leja interpolation functions
#include "real_Leja_exp.hpp"
#include "real_Leja_phi.hpp"
#include "real_Leja_phi_nl.hpp"
//! Include all integrators
#include "./Integrators/Rosenbrock_Eul... | ALGO | 0.998147 | 5.570104 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2021-07-20T17:42:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 11,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "820a4d559d... |
f61bd56c-b59d-4023-899a-a8593ee11c65 | Matas-V/obj-vector | main.cpp | #include "headers/main.h"
// #include <vector>
#include "funkcijos.cpp"
int main() {
int n=0, kiek;
string med, gen, k, genf;
bool pass=0;
Vector<studentas> mas;
studentas S;
mas.reserve(2);
srand(time(0));
input_check(gen, "Ar duomenis ivedinesite(1) pats ar sugeneruoti(0)?");
if (gen == "0") {
... | TOOL | 0.936405 | 3.74859 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2022-05-22T14:03: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": "502f73781e5a... |
04525f56-9156-4a9b-9178-95f38e095c1d | An77on/Advent_of_code | day5.cpp |
#include <map>
#include <iostream>
#include <algorithm>
#include <vector>
using std::vector;
using std::map;
auto rules = vector<vector<int>>{
{47,53},
{97,13},
{97,61},
{97,47},
{75,29},
{61,13},
{75,53},
{29,13},
{97,29},
{53,29},
{61,53},
{97,53},
{61,29},
{47,13},
{75,47},
{97,75},
{47,61},
{75,61},
{47,29},
{75... | ALGO | 0.999844 | 4.32689 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2025-01-06T15:24: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": "40f19c7877... |
8ff7689d-a405-4b6f-b241-d32ff7dabf47 | thaakur/CipherSchools_Assignment | Trees/ConstructFromInorderPreorder.cpp |
}
void preorderTraversal(Node* root){
if (root == NULL)
return;
cout << root->data << " ";
preorderTraversal(root->left);
preorderTraversal(root->right);
}
Node* construct(int start, int end, vector<int> const &preorder, int &pIndex, unordered_map<int,int> &map)
{
if (start > end) ... | ALGO | 0.999984 | 5.816462 | {
"github_metadata": {
"branch": "main",
"commit_count": 191,
"repo_created_at": "2021-02-13T13:09: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": "b0cd828be5... |
0cdf03f6-24a4-4ee6-86b3-c827bf331c73 | giorgiomurad/cpp_programming | Solved Exercises/Introduction To Java Programming/Chapter7 2DArrays/Problem6_20.cpp | // Problem taken from Introduction to Java Programming by <NAME> (8th ed.) (Edited)
// Multidimensional Arrays
//
// Problem 6.20 : Write a program that represents the classical game of Eight Queens where the user
// is given a chess board, and is asked to place exactly eight queens on the board.
// ... | ALGO | 0.998991 | 3.268219 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2025-06-04T10:40: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": "d87e9e7222fe... |
d3fbec4f-a556-449e-89ab-30da92144099 | priyanshi585/DSA | Graph/topologicalSort_using_DFS.cpp | #include<iostream>
#include<stack>
#include<vector>
#include<list>
#include<unordered_map>
using namespace std;
void topoSort(int node, vector<bool> &visited , stack<int> &s , unordered_map<int , list<int>> &adj)
{
visited[node] = 1;
for(auto neighbour : adj[node]){
if(!visited[neighbour]){
... | ALGO | 0.999993 | 5.865131 | {
"github_metadata": {
"branch": "main",
"commit_count": 245,
"repo_created_at": "2025-02-14T14:18:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "86ea713650... |
f7023f27-d513-442e-9a1d-b5daa65f699f | rg665n/Strings | subStrLast.cpp | #include <iostream>
#include <string>
using namespace std;
int main() {
//code
string str , subStr ;
int i,j,k, T,found;
cin >> T;
for (i=1; i<=T;i++) {
found =0;
cin >> subStr;
cin >> str;
//cout << str.length() << endl;
//cout << subStr.length() << endl;
f... | ALGO | 0.999768 | 4.050649 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2017-04-12T03:13: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": "a497244e9... |
d3bc1bb5-e8b1-4f67-9aad-42ce16ffc798 | Foysal-Munsy/Rush-Roadmap | Week-30/Day 01/Elimination.cpp | //
// Created by <NAME> on 22 / 12 / 2023
// Time: 20 : 50 : 25
//
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define nl '\n'
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#ifdef LOKAL
#include "DEBUG_TEMPLATE.h"
#else
#define HERE
#define debug(... | ALGO | 0.999911 | 4.493075 | {
"github_metadata": {
"branch": "main",
"commit_count": 189,
"repo_created_at": "2023-06-16T17:15:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "847050199b... |
2edee9ae-de95-46ea-8fb7-c802a89a3ceb | emtiajium/practice | _Online Judge/#OJ/LIGHT OJ/1164 - Horrible Queries.cpp | #include<stdio.h>
#include<iostream>
#include<ctype.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
#include<string>
#include<algorithm>
#include<vector>
#include<sstream>
#include<stack>
#include<queue>
#include<map>
#include<set>
using namespace std;
//const double PI=2*acos(0.0);
const int SIZE=100005;
st... | ALGO | 0.999523 | 4.054489 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2021-09-12T05:18: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": "09a1baa0fd... |
b287aef6-bb2f-4153-b734-c0d2e1f93535 | yarik2512/VMK-4sem | mz10-2.cpp | #include <iostream>
#include <map>
#include <set>
int
main()
{
using std::cin, std::cout, std::endl, std::string, std::multimap, std::pair, std::set;
char left;
string right;
multimap<char, string> G;
multimap<char, string> R;
set<char> v_prev = {'S'};
set<char> v = v_prev;
while (cin >... | ALGO | 0.999761 | 3.484535 | {
"github_metadata": {
"branch": "main",
"commit_count": 28,
"repo_created_at": "2024-02-25T12:12: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": "6f798aa8021... |
85659bc8-edf0-4a13-93a7-448bef85f1ca | SeonghoJin/algorithm | C++/BOJ/20191028/boj_10868_YES.cpp | /*
#include <iostream>
#include <cmath>
using namespace std;
const int MAX = 100000;
int arr[MAX];
int tree[4*MAX];
int search(int left, int right, int num, int n_left, int n_right){
if(left == n_left && right == n_right){return tree[num];}
int mid = (n_left+n_right)/2;
int ret = 2100000000;
if(left <= mid)re... | ALGO | 0.999995 | 4.912522 | {
"github_metadata": {
"branch": "master",
"commit_count": 276,
"repo_created_at": "2020-03-30T10:37: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": "96c91c59... |
762085cd-b766-4c82-a561-c41f273aa0df | MIKORU/Code-ACM | 数据结构C/单链表.cpp | //单链表
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#define TRUE 1
#define FALSE 0
#define OK 1
#define ERROR 0
#define INFEASIBLE -1
#define OVERFLOW -2
#define MAXSIZE 100
using namespace std;
typedef int Status;
typedef int ElemType;
typedef struct LNode{
ElemType data;
struct LNode *next;
}L... | ALGO | 0.999972 | 3.766456 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2016-11-10T03:21: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": "bb5dd1b913... |
589eee9f-e07c-48d3-8543-6e5697f19d02 | xiangtian/leetcode | SearchInsertPosition.cpp | #include<iostream>
#include<vector>
using namespace std;
class Solution {
public:
int searchInsert(vector<int>& nums, int target) {
return binarySearch(nums, target, 0, nums.size() - 1);
}
private:
int binarySearch(const vector<int>& nums, int target, int low, int high)
{
while ( low <= ... | ALGO | 0.999934 | 5.684101 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2016-07-29T01:26: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": "ea3c0aa06b... |
019c2c37-7c58-4c32-b712-78ef228ea189 | ishandutta2007/codeforces-n | nikolapesic2802/normal/1327/D.cpp |
// Problem : D. Infinite Path
// Contest : Educational Codeforces Round 84 (Rated for Div. 2)
// URL : https://codeforces.com/contest/1327/problem/D
// Memory Limit : 256 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_contai... | ALGO | 0.999824 | 4.350269 | {
"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": "474c50d384f4... |
2e411c86-2da5-4adc-988b-c414677f1255 | marvenlee2486/competitive-programming | cp4/ch5/5.3k/divisible.cpp | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
// (SUM - prefix) % d == 0
// SUM % d - prefix % d == 0
// SUM % d = prefix % d
void solve(){
ll d,n;
cin >> d >> n;
unordered_map<ll, ll> mp;
ll ans = 0;
ll cur = 0;
for(int i = 0; i < n; i++){
ll a; cin >> a;
cu... | ALGO | 0.999607 | 4.073046 | {
"github_metadata": {
"branch": "main",
"commit_count": 225,
"repo_created_at": "2021-01-01T07:31: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": "7decb4e012... |
5ee20ecd-e3a9-443d-9c47-afbbaf78cff5 | Rishija/practice | leetcode/Q0252.cpp | /*
Given an array of meeting time intervals consisting of start and end times [[s1,e1],[s2,e2],...] (si < ei), determine if a person could attend all meetings.
Example 1:
Input: [[0,30],[5,10],[15,20]]
Output: false
Example 2:
Input: [[7,10],[2,4]]
Output: true
*/
// Method 1
typedef vector<vector<int>> vvi;
typed... | ALGO | 0.999851 | 6.366594 | {
"github_metadata": {
"branch": "master",
"commit_count": 129,
"repo_created_at": "2018-03-11T16:02: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": "d5563aa3... |
cfb84934-9b6a-404f-8565-851fc7a7e8be | bitalov/JNJD-2022 | Matrix trace.cpp | // Source: https://usaco.guide/general/io
#include <bits/stdc++.h>
using namespace std;
int n;
const int MAXN = 4e2 + 5;
int a[MAXN][MAXN];
int trace() {
int ret = 0;
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
if (i == j)
ret += a[i][j];
}
}
return ret;
}
int rows() {... | ALGO | 0.999777 | 3.961086 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2022-05-18T17:15: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": "9c5ba3ac3051... |
eed18e4a-4d19-4b37-87dc-f1616a38c7b9 | Pankajcoder1/Competitive_Programming | Codechef/MAZE100.cpp | /*
written by <NAME>.
country:-INDIA
Institute: National Institute of Technology, Uttarakhand
*/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
typedef long long ll ;
typedef vector<ll> vl;
#define speed... | ALGO | 0.999946 | 4.043247 | {
"github_metadata": {
"branch": "master",
"commit_count": 537,
"repo_created_at": "2020-06-07T13:07:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 17,
"forks": 8,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "be68c38... |
7f85c164-bb74-4c84-8abd-448b807c1b20 | sachuverma/DataStructures-Algorithms | Leetcode Daily Challenge/July-2021/01. Gray Code.cpp | /*
Gray Code
=========
An n-bit gray code sequence is a sequence of 2n integers where:
Every integer is in the inclusive range [0, 2n - 1],
The first integer is 0,
An integer appears no more than once in the sequence,
The binary representation of every pair of adjacent integers differs by exactly one bit, and
The bin... | ALGO | 0.999902 | 6.584638 | {
"github_metadata": {
"branch": "master",
"commit_count": 1430,
"repo_created_at": "2020-10-07T10:08:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2049,
"forks": 541,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "58... |
d2f17aea-23f2-48cb-a18c-99f5a234f457 | sagarbhokre/UKF-SensorFuser | src/tools.cpp | #include <iostream>
#include "tools.h"
using Eigen::VectorXd;
using Eigen::MatrixXd;
using std::vector;
Tools::Tools() {}
Tools::~Tools() {}
using namespace std;
VectorXd Tools::CalculateRMSE(const vector<VectorXd> &estimations,
const vector<VectorXd> &ground_truth) {
/* Calculate R... | ALGO | 0.983293 | 5.854132 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2017-04-04T03:31: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": "a710839b11... |
de9a0e7c-eb1c-49c4-b9b6-2a123f0102eb | VellStraggler/group-joe-and-i | turn in/simulateProjectile.cpp | /*<NAME>, <NAME>, <NAME>*/
#include "simulateProjectile.h"
#include "artillery.h"
#include "gravity.h"
#include "air_density.h"
#include "drag_coefficient.h"
#include "speed_of_sound.h"
#include <tuple>
#include <cmath>
using namespace std;
// Simulate the projectile and return (distance, hangTime)
tuple<double, do... | ALGO | 0.994616 | 6.531671 | {
"github_metadata": {
"branch": "master",
"commit_count": 119,
"repo_created_at": "2025-05-02T17:23:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4336b72d... |
99d39747-45d7-4c93-9459-389cb0fe6e57 | tikhonow/algorithms | dinamic/Largest_overall_subsequence.cpp | #include <fstream>
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <algorithm>
#define MAX(a, b) ((a) > (b) ? (a) : (b))
using namespace std;
int main()
{
ifstream fin("input.txt");
ofstream fout("output.txt");
string A, B;
fin >> A >> B;
int n = A.length();
... | ALGO | 0.999959 | 4.047793 | {
"github_metadata": {
"branch": "master",
"commit_count": 93,
"repo_created_at": "2020-03-09T15:49:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "76bd049e5... |
26c1fec7-4a56-42b7-bf5e-3d754b62ae5a | davide-gurrieri/parallel-GCN | test/tuning_cuda.cpp | #include "../include/GetPot"
#include "../include/gcn.cuh"
#include "../include/optim.cuh"
#include "../include/parser.h"
#include <iostream>
#include <string>
int main(int argc, char **argv) {
int dev;
cudaDeviceProp devProp;
cudaGetDevice(&dev);
cudaGetDeviceProperties(&devProp, dev);
GCNParams params;
... | DATA | 0.905264 | 5.062541 | {
"github_metadata": {
"branch": "main",
"commit_count": 128,
"repo_created_at": "2023-04-29T08:36:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3c5d4d2d1b... |
37735d75-67d4-4776-b3c3-983b5fabc801 | jkaflik/OpenMowerNext | src/map_server/some_gaussian_filter.hpp | #pragma once
#include <cmath>
#include <cstdint>
#include <vector>
#include <stdexcept>
#include <algorithm>
#include <numeric>
class SomeGaussianFilter
{
private:
std::vector<float> kernel_;
int kernel_size_;
int half_kernel_size_;
float kernel_sum_;
public:
SomeGaussianFilter(const std::vector<float>& ke... | ALGO | 0.997083 | 7.171537 | {
"github_metadata": {
"branch": "main",
"commit_count": 61,
"repo_created_at": "2023-08-17T22:08:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 36,
"forks": 18,
"issues": 7,
"pull_requests": 2
},
"file_meta": {
"content_id": "a5b5578c5... |
c751ec30-78f2-4b29-b0ea-a83e80b49c00 | priyyanshisharma/PriyanshiSharma_FOCP2_C- | assi_part3_q28.cpp | // q28 Implement a function that generates an array of n Fibonacci numbers and returns it
//using dynamic memory allocation.
//int* generateFibonacci(int n);
#include <iostream>
using namespace std;
int* generateFibonacci(int n) {
if (n <= 0) return nullptr; // Handle invalid input
int* fib = new int[n]; // ... | ALGO | 0.983066 | 4.862466 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2025-02-08T11:16: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": "ecedeb280a6... |
029c6c3b-413e-4245-a2db-1b9a901a6914 | academicRobot/mmstructlib | src/alpha_shapes/inex_unfinished/angles.hpp | #ifndef BUSV_ANGLES
#define BUSV_ANGLES
#include "points.hpp"
#include "cayley_menger_matrix.hpp"
#include <cmath>
namespace busv{
template <typename T>
T invcot(T x){
//2 * tan(1) - tan(x)
return std::atan(1.0/x);
}
template <typename T>
void calcMinors4(const CayleyMengerMatrix<T>& cmm, T (&minors)[6]){
minors... | ALGO | 0.999455 | 4.501722 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2020-06-09T18:05: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": "4c48bdcfbb... |
75136e5d-294c-4bc9-a170-e703d5292c2c | palakAggarwal08/DSA | Searching and Sorting/Search an element in sorted and rotated array.cpp | // 01/02/22
/* Given a sorted and rotated array A of N distinct elements which is rotated at some point, and given an element K.
The task is to find the index of the given element K in the array A. */
#include<bits/stdc++.h>
using namespace std;
int Search(vector<int> ,int );
int main(){
int t;
cin >> t... | ALGO | 0.999965 | 5.698251 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2022-01-23T17:54: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": "1c59872c779e... |
834bc2de-c96c-466b-9d64-a1c3823b0d7c | falk-dev/maratona-de-programacao | UFMG/Aula 01 - STL e C++/CodeForces/1206A. Choose Two Numbers/main.cpp | /*
* Link da questão: https://codeforces.com/problemset/problem/1206/A
* 1206A - CHOOSE TWO NUMBERS | RESOLVIDO EM C++
* Author: falk.dev
* [STL] - find, quadrático
*/
#include <bits/stdc++.h>
using namespace std;
#define SPEED \
ios_base::sync_with_stdio(0); \
cin.tie(0);
#defi... | ALGO | 0.99998 | 3.668928 | {
"github_metadata": {
"branch": "master",
"commit_count": 128,
"repo_created_at": "2024-03-14T14:32: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": "5fb7393d... |
44c61149-1fd8-4179-b57d-3b8fc3c99aab | vikashpandian/LeetCode-Problems | DesignBitset.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
class Bitset {
public:
//vector<bool> s, r;
//bool *s, *r;
string s, r;
int cnt, n;
Bitset(int sz)// : s(sz), r(sz, 1)
{
// s = new bool[sz]();
// r = new bool[sz];
// fill_n(r, sz, 1);
... | ALGO | 0.999097 | 3.936888 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2022-01-19T17:49:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ee1298e39f... |
05a073a2-d924-46d4-bd58-f4712855cfa0 | aajjbb/contest-files | AtCoder/Multiplication4.cc | #include <bits/stdc++.h>
template<typename T> T gcd(T a, T b) {
if(!b) return a;
return gcd(b, a % b);
}
template<typename T> T lcm(T a, T b) {
return a * b / gcd(a, b);
}
template<typename T> void chmin(T& a, T b) { a = (a > b) ? b : a; }
template<typename T> void chmax(T& a, T b) { a = (a < b) ? b : a; }
int ... | ALGO | 0.999992 | 4.361244 | {
"github_metadata": {
"branch": "master",
"commit_count": 892,
"repo_created_at": "2016-03-02T13:05:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cdf1ac11... |
98892e9a-d886-4301-afd9-2a206b1f0592 | huaxiatony/CS | College/CS10/ch4/lab5_3/main.cpp | #include <iostream>
#include <string>
#include <cmath>
using namespace std;
int main() {
char sym = '*'; int theight = 0, twidth = 0, lwidth = 0, row = 0, tempwidth = 0, space = 0;
cout << "Enter trunk height: ";
cin >> theight;
cout << "Enter trunk width: ";
cin >> twidth;
if(twidth%2 ==... | ALGO | 0.999449 | 3.461209 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2018-11-05T03:01: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": "518bad7ab... |
e24dd1b5-efb0-4bdd-9f9d-f2a1a5841735 | Wind134/CPP_Primier_SourceCodes | 关联容器的用法-set-map/src/unorderedWordCount-hash.cpp |
#include <unordered_map> // 无序map
using std::unordered_map;
#include <unordered_set>
using std::unordered_set; using std::unordered_multiset;
#include <string>
using std::string;
using std::hash;
#include <iostream>
using std::cin; using std::cout; using std::endl;
#include <cstddef>
using std::size_t;
#include... | ALGO | 0.921226 | 4.103358 | {
"github_metadata": {
"branch": "main",
"commit_count": 33,
"repo_created_at": "2023-05-13T07:34: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": "fd10ac548cb... |
bd519242-e83e-4d07-a8ee-597571ca322a | CaioCity/Competitive_Programming_Questions | AtCoder/Contest356/C.cpp | // https://atcoder.jp/contests/abc356/tasks/abc356_c
// Keys
#include <bits/stdc++.h>
void bitbit (int pot2n, short int N, bool keys[]);
int main(){
short int N,M,K,C,aux,doors;
int answer=0,pot2n=1;
std::cin>>N>>M>>K;
for(short int i=0; i<N; i++)
pot2n*=2;
std::vector<std::tu... | ALGO | 0.999798 | 3.902145 | {
"github_metadata": {
"branch": "main",
"commit_count": 423,
"repo_created_at": "2024-04-25T01:41:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dff3850815... |
f7a6258a-0468-4328-8326-294373f15ca1 | osamahatem/CompetitiveProgramming | Codeforces/_Groups/AAST ACM ICPC Training/AAST ACM ICPC 2015 - Individuals Qualification #2/G. kthstring.cpp | /*
* G. kthstring.cpp
*
* Created on: Sep 7, 2015
* Author: <NAME>
*/
#include <bits/stdtr1c++.h>
#include <ext/numeric>
using namespace std;
long long dp[45][30];
string ans;
long long cnt(int idx, int last) {
if (!idx || last == 25)
return 1;
long long &ret = dp[idx][last];
if (ret != -1)
return... | ALGO | 0.999868 | 4.03621 | {
"github_metadata": {
"branch": "master",
"commit_count": 125,
"repo_created_at": "2017-12-09T14:02:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "12196a52... |
933825cf-649f-4d89-97e5-1c168c25871a | xsligroup/chronusq_public | include/orbitalrotation/ivo.hpp | /*
* This file is part of the Chronus Quantum (ChronusQ) software package
*
* Copyright (C) 2014-2022 Li Research Group (University of Washington)
*
* This program is free software; you ca redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Softwar... | ALGO | 0.998034 | 5.09275 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2022-06-13T16:17:10.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 15,
"forks": 5,
"issues": 4,
"pull_requests": 0
},
"file_meta": {
"content_id": "f0706cfb2b... |
5f26d97d-dcb1-41a6-a7d3-53457c1160d6 | ojusvini/DAA-Codes | daaaa/Chain Multiplication/chain_multiplication path.cpp | #include<iostream>
#include<cstdio>
using namespace std;
struct ar
{
int row;
int col;
};
void root( int arr[100][100], int x, int y )
{
if ( y == x )
{
printf ("%d ",arr[x][y]);
return;
}
cout << "(";
root ( arr, x, arr[x][y]-1);
root ( arr, arr[x][y], y);
cout << ")";
}
int main()
{
int indx;
int i... | ALGO | 0.999807 | 3.244891 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2016-08-16T08:28:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f91c30e3ef... |
4c2b3a28-0eb8-4e8b-a98a-8416be0e9eaa | guswns3396/CSCI104 | hw5/a_search/doublet.cpp | #include "heap.h"
#include "word.h"
#include <string>
#include <vector>
#include <map>
#include <iostream>
#include <utility>
#include <fstream>
#include <stack>
using namespace std;
// convert to all uppercase
string upper(string word) {
string result = "";
char letter;
for (int i=0; i < (int)word.size(); ++i) {
... | ALGO | 0.99998 | 4.251157 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-05-18T03:18:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e556e1b67c... |
bc0d856a-06c7-4263-a8ef-5f56a1ed8c7e | rainsun-c/MyCpp | 内置迭代器简单实现实现/迭代器的实现.cpp | #include <iostream>
#include <string>
using namespace std;
template <class type>
class Node
{
public:
type data;
Node<type>* next;
Node<type>()
{
this->data = 0;
this->next = NULL;
}
Node<type>(type data, Node<type>*next)
{
this->data = data;
this->next = next;
}
};
//
//template <class type>
//class i... | TOOL | 0.968449 | 3.881299 | {
"github_metadata": {
"branch": "master",
"commit_count": 25,
"repo_created_at": "2021-02-02T14:41: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": "5c534f801... |
7043360c-1557-40d6-b753-02621b0818b8 | Jin-SukKim/Algorithm | Problem_Solving/baekjoon/BitMask_Operator/11723_Set/set.cpp | #include <iostream>
#include <string>
// 숫자 자체는 중요하지 않고 그 숫자가 있는지 없는지만 확인해주면 된다.
// 있는지 없는지의 확인은 1 bit만 사용하면 되므로 bit를 이용해준다.
// 숫자는 1 ~ 20까지 있을 수 있으므로 32bit 길이인 int를 사용해주자.
class BitSet
{
public:
BitSet() : S(0) {};
void add(int x)
{
// or 연산자를 활용해 bit를 추가해준다.
S |= (1 << x);
}
... | ALGO | 0.9949 | 5.756121 | {
"github_metadata": {
"branch": "master",
"commit_count": 423,
"repo_created_at": "2020-05-13T07:24:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f40caf0f... |
5953ed34-bc91-4fb7-888d-174161aed733 | loongOpen/OpenLoong-Dyn-Control | third_party/pinocchio/pinocchio/algorithm/aba.hxx | //
// Copyright (c) 2016-2020 CNRS, INRIA
//
#ifndef __pinocchio_aba_hxx__
#define __pinocchio_aba_hxx__
#include "pinocchio/spatial/act-on-set.hpp"
#include "pinocchio/multibody/visitor.hpp"
#include "pinocchio/algorithm/check.hpp"
/// @cond DEV
namespace pinocchio
{
template<typename Scalar, int Options, templa... | ALGO | 0.998801 | 7.210221 | {
"github_metadata": {
"branch": "main",
"commit_count": 62,
"repo_created_at": "2024-08-28T07:16:18.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 195,
"forks": 37,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "ad1e7a6c0... |
5a300b54-fbc0-428a-ae57-d9ab5280a514 | yinweijie/Leetcode-Leetbook | all-about-lockup-table/0405-Solution.cpp | // 四数之和
// https://leetcode-cn.com/leetbook/read/all-about-lockup-table/xh5n2t/
#include <vector>
#include <algorithm>
using namespace std;
class Solution {
public:
vector<vector<int>> fourSum(vector<int>& nums, int target) {
if(nums.size() < 4) return vector<vector<int>>();
sort(nums.begin(), n... | ALGO | 0.999974 | 5.826717 | {
"github_metadata": {
"branch": "main",
"commit_count": 297,
"repo_created_at": "2021-01-01T15:55:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a0e989a6ea... |
a1f6f181-bf50-4ef8-a7ab-0ac8d925f7f2 | truongcongthanh2000/CSES-Solutions | Graph Algorithms/MessageRoute.cpp | #pragma GCC diagnostic ignored "-Wunused-parameter"
#include <bits/stdc++.h>
using namespace std;
#define INP "solve"
#define OUT "solve"
const long long INF_LL = 1e17;
const int INF = 1e9 + 100;
const int MOD = 1e9 + 7;
const int Base = 30;
const long double EPS = 1e-9;
const int BLOCK = 1000;
mt19937 rnd(chrono::s... | ALGO | 0.999937 | 4.71427 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2020-09-06T11:09:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "52801a6464... |
fe2bdf01-8ffe-4073-beea-b8e683d6cb6a | DionysiosB/CodeForces | 0800-0899/877B-NikitaAndString.cpp | #include <iostream>
#include <vector>
int main(){
std::string s; std::cin >> s;
long n = s.size();
std::vector<long> va(n + 1, 0), vb(n + 1, 0);
for(long p = 1; p <= n; p++){
va[p] = va[p - 1] + (s[p - 1] == 'a');
vb[p] = vb[p - 1] + (s[p - 1] == 'b');
}
long maxSize(0... | ALGO | 0.999241 | 3.412691 | {
"github_metadata": {
"branch": "master",
"commit_count": 4487,
"repo_created_at": "2013-06-27T18:15:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 690,
"forks": 163,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "286... |
a33238ca-9c00-43e8-a234-4fa8770cc866 | Abhishekkkkkkkkkkk/100DaysofLearningChallange | DAY19/DSA/XORofNumberwhichOccursTwice.cpp | #include <bits/stdc++.h>
#include <array>
using namespace std;
int duplicateNumbersXOR(int nums[], int n) {
sort(nums, nums + n); // Correctly sort the array using pointers
int xorResult = 0;
for (int i = 0; i < n; i++) {
for (int j = i + 1; j < n; j++) {
if (nums[i] == nums[j]) {
... | ALGO | 0.99999 | 5.861036 | {
"github_metadata": {
"branch": "main",
"commit_count": 208,
"repo_created_at": "2024-05-10T02:34:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "120659ddfd... |
483b9268-ef46-44dc-80b5-c45f1ef6e7aa | sjzez-chess/source | model/modell/Binary Indexed Tree.cpp | #include <bits/stdc++.h>
using namespace std;
int lowbit(int x)
{
return x & -x;
}
// 加值操作
void modify(int x, int v)
{
for (int i = x; i <= n; i += lowbit(i))
a[i] += v;
}
// 查询操作
int query(int x)
{
int ret = 0;
for (int i = x; i; i -= lowbit(i))
ret += a[i];
return ret;
}
//区间max 不能用树状数组
// 区间加 单点查询
// ... | ALGO | 0.999947 | 3.449819 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2023-03-01T12:10: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": "95ffc35ae4... |
ebceed42-6791-4089-ba1a-2acbea77be79 | sp4ghet/comp | aoj/alds1/10c.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
#define rep(i, n) for (int i = 0; i < n; ++i)
#pragma region Debug
template <typename T>
void view(const std::vector<T> &v)
{
for (const auto &e : v)
{
std::cout << e << " ";
}
std::cout << std::endl;
... | ALGO | 0.999993 | 4.933563 | {
"github_metadata": {
"branch": "master",
"commit_count": 101,
"repo_created_at": "2020-01-04T20:56: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": "4cbee318... |
ee6fb6ee-6aa6-4c5d-9fd5-d4bfbdeef65a | manchalaharikesh/CODES-POTDs | GeeksForGeeks/Number of Enclaves.cpp | // DATE: 29-SEP-2023
// Question URL: https://practice.geeksforgeeks.org/problem-of-the-day
// Question: Number of Enclaves
// Description: For a given grid of size N X M with 0s and 1s. Where 1 represent land and 0 represent water. Find the cound of all landfalls from which cannot walk off the boundary of the grid in ... | ALGO | 0.999922 | 6.414436 | {
"github_metadata": {
"branch": "main",
"commit_count": 389,
"repo_created_at": "2023-08-17T10:03: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": "af5d6a7b42... |
bca68231-1463-4a17-829b-709049144bf6 | MrEconomical/advent-of-code-2023 | 11/expansion_second.cpp | #include <algorithm>
#include <fstream>
#include <iostream>
#include <istream>
#include <string>
#include <vector>
using std::ifstream, std::istream;
using std::string, std::vector;
const long long EXPAND = 1'000'000 - 1;
struct Galaxy {
long long row;
long long col;
};
istream* get_input_stream() {
ret... | ALGO | 0.999865 | 5.486055 | {
"github_metadata": {
"branch": "main",
"commit_count": 24,
"repo_created_at": "2023-12-03T05:51:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "95e6062ab90... |
4f4144ec-d938-4796-acd0-348025f6f4e5 | jamcodingofficial/Baekjoon | C++/38. BFS - 고급/2589.cpp | /*
* Author : JC
* https://www.acmicpc.net/problem/2589
*/
#include <iostream>
#include <queue>
#include <string.h>
using namespace std;
string s[50];
bool visited[50][50];
int path[50][50];
int dx[] = {-1, 0, 1, 0};
int dy[] = {0, 1, 0, -1};
int l, w;
int bfs(int x, int y){
int cnt = 0;
queue<pair<int,in... | ALGO | 0.999979 | 4.148916 | {
"github_metadata": {
"branch": "main",
"commit_count": 274,
"repo_created_at": "2022-10-26T03: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": "62e6ea4fc5... |
7994c719-8421-46d6-86dc-24d6f3a4ec70 | Adityag0243/CP-DSA | codeforce/contest/10Nov/g.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll(i , s , n) for(int i = s; i < n; i++)
#define rl(i , s , n) for(int i = s; i < n; i++)
#define all(arr) arr.begin(), arr.end()
#define vi vector<int>
#define pi pair<int , int>
#define vvi ... | ALGO | 0.999998 | 4.420013 | {
"github_metadata": {
"branch": "main",
"commit_count": 73,
"repo_created_at": "2024-02-07T20:06: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": "3ee50c0fac5... |
f25da43c-b733-4ec1-9baf-2bc398620d9a | zssjh/stereo-semantic-vo | main.cpp |
#include<opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/core/affine.hpp>
#include <iostream>
#include <vector>
#include<iomanip>
#include <fstream>
#include <Tracking.h>
#include <pangolin/pangolin.h>
#include <include/view.h>
#include <unistd.h>
#include <thread>
#include <include/se... | DATA | 0.950664 | 5.019627 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2019-01-06T07:47:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 41,
"forks": 7,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "6aab78ef... |
b0ccf88e-bffa-4b01-94aa-610ab0fcbe09 | Serendipity565/CodeBackup | Luogu/test/Spreadsheets.cpp | #include<bits/stdc++.h>
using namespace std;
int n;
string s;
stack<char> st;
int k=0;
int r=0,c=0;
bool check(string s)//false stand for e
{
for (int i=0;i<s.length();i++)
{
if (s[i]<='9' && s[i]>='0')
{
if (s[i+1]=='C')
{
return true;
}
... | ALGO | 0.999872 | 3.792323 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2024-09-23T07:00:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e0c265e8ca6... |
356861c6-5ad6-4263-a380-b4b239de90e6 | hkveeranki/mycodes | codeforces/virtual/187/2.cpp | /*Author: <NAME> */
/*handle: harry7*/
/*header files*/
#include<bits/stdc++.h>
using namespace std;
/*debugging*/
#define out1(x)cout<<#x<<" is "<<x<<endl
#define out2(x,y)cout<<#x<<" is "<<x<<" "<<#y <<" is "<<y<<endl
#define out3(x,y,z)cout<<#x<<" is "<<x<<" "<<#y<<" is "<<y<<" "<<#z<<" is "<<z<<endl;
#define ... | ALGO | 0.999973 | 4.054601 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2016-04-28T19:00:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "51943abd3... |
0504f263-9c55-4b16-8044-59f76fbf16da | alexandraback/datacollection | solutions_5644738749267968_0/C++/Stun/d.cpp | #include <iostream>
#include <algorithm>
#include <queue>
#include <vector>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <map>
#include <stack>
#include <cassert>
using namespace std;
int main(){
int tcase;
cin >> tcase;
vector<double> N, K, S;
vector<int>Ni, Ki;
for(size_t c... | ALGO | 0.999776 | 3.398926 | {
"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": "123555b80... |
54beae54-b813-4a06-b9de-4bd5ca143652 | sihasmk/HackerRank- | algorithms/implementation/migratory birds.cpp | #include <bits/stdc++.h>
using namespace std;
string ltrim(const string &);
string rtrim(const string &);
vector<string> split(const string &);
/*
* Complete the 'migratoryBirds' function below.
*
* The function is expected to return an INTEGER.
* The function accepts INTEGER_ARRAY arr as parameter.
*/
int mig... | ALGO | 0.999962 | 5.219088 | {
"github_metadata": {
"branch": "main",
"commit_count": 51,
"repo_created_at": "2024-02-05T05:28:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "113e01fc964... |
e88a3d59-7bb4-4837-a763-50ffdc133c47 | cnyali-czy/code | cf/contest/1244/D.cpp | #define REP(i, s, e) for (register int i = (s), end_##i = (e); i <= end_##i; i++)
#define DREP(i, s, e) for (register int i = (s), end_##i = (e); i >= end_##i; i--)
#define DEBUG fprintf(stderr, "Passing [%s] in Line %d\n", __FUNCTION__, __LINE__)
#define chkmax(a, b) a = max(a, (b))
#define chkmin(a, b) a = min(a, (... | ALGO | 0.999846 | 3.38961 | {
"github_metadata": {
"branch": "master",
"commit_count": 1593,
"repo_created_at": "2018-02-24T06:16:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e5c4f0c... |
000571ad-50c8-432e-9735-ad6b5c034c84 | Shubhamsahu1101/cpp | D_Flipper.cpp | #include <bits/stdc++.h>
#define forall(it, cont) for (auto it = cont.begin(); it != cont.end(); it++)
#define forl(i, a, b) for (int i = a; i < b; i++)
#define forr(i, a, b) for (int i = a; i >= b; i--)
#define int long long
#define pb push_back
#define M 1000000007
#define yes cout << "YES" << endl
#define no cout <<... | ALGO | 0.999983 | 4.250904 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-06-25T07:32: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": "f5111e004539... |
aebad311-65b2-4de1-aff8-f0b107b03d67 | omar-s-ta/solved-problems | UVA/competitive_programming/chapter_4/MST standard/11710 - Expensive subway.cpp | #include <assert.h>
#include <ctype.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <time.h>
#include <algorithm>
#include <numeric>
#include <functional>
#include <bitset>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include... | ALGO | 0.999906 | 4.023659 | {
"github_metadata": {
"branch": "master",
"commit_count": 117,
"repo_created_at": "2015-02-20T15:46: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": "31678a44... |
cb8bc2df-1017-48f0-a5db-e63d1adae737 | JacobianDet/CompeteUp | 682D/alst.cpp | #include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define MV 200001
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define ins insert
#define sz size
void FLASH() {ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);}
void SETF() {cout.ios_base::setf(ios_bas... | ALGO | 0.999993 | 3.820472 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2018-08-04T16:37:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
"content_id": "e3bb167dc9... |
900ef33f-16e6-4ec4-97af-d90d3475793e | raincross7/code-similarity | codes/train_code/problem469/problem469_126.cpp | /*input
5
24 11 8 3 16
*/
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <queue>
#include <deque>
#include <bitset>
#include <iterator>
#include <list>
#include <stack>
#include <map>
#include <set>
#include <functional>
#include <numeric>
#... | ALGO | 0.99999 | 3.56745 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-03-06T05:07:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b0c398dcac3d... |
058f4322-d7f3-44d7-b0c1-82c5c9f30c32 | josh-cptssGame/School-Work | CPTS_223/PA2/main.cpp | //<NAME>
//PA 2
//
//Note: working on making CSV file bigger
// and seperating in to different files of code.'
//
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <array>
#include <list>
#include <math.h>
#include <algorithm>
#include <chrono>
... | ALGO | 0.993357 | 4.17504 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2018-12-23T17:55: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": "2307d9e01... |
c1f6008c-6f29-49ed-ba39-df09a543d5a0 | tue09/HUST_TueLDT | Thuc_Hanh_Ki_Thuat_Lap_Trinh/BTH02-732833-Tuan12-TueLDT/Bai2.9_TueLDT_0909.cpp | /*
Bài 9: Dưới đây cung cấp đoạn code đơn giản để tính hàm sigmoid theo công thức trực tiếp.
Hãy viết hàm tính xấp xỉ sigmoid(x) đến độ chính xác 10−6 và có tốc độ nhanh hơn ít nhất
30% so với code đơn giản.
Gợi ý: sử dụng kỹ thuật "chuẩn bị trước" như trong slide.
*/
//Le Dinh Tri Tue - 0909 - 732833
#include <vect... | ALGO | 0.999414 | 5.159163 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2023-12-16T18:00: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": "45826c8440... |
22b4519a-350f-45c1-a53b-256e2582cff5 | smb374/dsa-patterns | cpp/0210.course-schedule-ii/solution.cpp | // Created by <NAME> at 2025/01/13 22:52
// leetgo: 1.4.13
// https://leetcode.com/problems/course-schedule-ii/
#include "LC_IO.h"
#include <algorithm>
#include <bits/stdc++.h>
#include <queue>
#include <unordered_map>
#include <vector>
using namespace std;
// @lc code=begin
unordered_map<int, int> find_indegree(uno... | ALGO | 0.999997 | 6.134206 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2025-01-13T16:10: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": "927b76d54a5... |
fe2ddc02-022b-44b0-a23f-1395109090c2 | mah049/Programming-Assignments | pa4-sak092-mah049/boggleutil.h | // <NAME> <kbarronk>
#ifndef BOGGLEUTIL_H
#define BOGGLEUTIL_H
#include <cctype>
#include <algorithm>
#include <map>
#include <memory>
#include <string>
#include <utility>
/**
* Class that represents a position on the Boggle Board.
*
* Each position contains its sanitized string that represents the
* characters... | TOOL | 0.988287 | 3.57919 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2016-02-25T00:29: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": "07aed8be45... |
774cf8d7-d6a5-4f43-b05e-15ebd34f4b60 | tatsuya0926/spin-configuration-learning | monte_carlo_simulation/calc_parameter/2d_Potts_Metropolis_calc_parameter.cpp | #include <iostream>
#include <cmath>
#include <fstream>
#include <string>
#include <algorithm>
const long int niter = 100000;
const int L = 128;
const int nx = L; // number of sites along x-direction
const int ny = L; // number of sites along y-direction
const int monte_carlo_step = niter * nx * ny;
const int Q = 3;
co... | ALGO | 0.999692 | 4.727935 | {
"github_metadata": {
"branch": "main",
"commit_count": 34,
"repo_created_at": "2023-10-16T05:53: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": "eae3c0b0e14... |
48b577d4-d55f-49ce-801f-f0bf7644f51d | vartika2302/Crack-Your-Placement | 445-add-two-numbers-ii/445-add-two-numbers-ii.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
void iterativeReverse... | ALGO | 0.999994 | 6.284805 | {
"github_metadata": {
"branch": "main",
"commit_count": 808,
"repo_created_at": "2022-05-09T19:34:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9d88b44b7f... |
59010eb2-5283-4fae-81b4-d9fe2a1bb369 | iliyian/CompetitiveProgramming | atcoder.jp/abc364/G.cpp | // date: 2024-07-28 10:43:47
// tag: 斯坦纳树
// 顺便把s放在第一维确实能跨一点,在atcoder上这题快了14%
#include <bits/stdc++.h>
#define int long long
// using namespace std;
constexpr int inf = 0x3f3f3f3f3f3f3f3f;
int32_t main() {
std::cin.tie(nullptr)->sync_with_stdio(false);
freopen("G.in", "r", stdin);
freopen("G.out", "w", stdout... | ALGO | 0.999977 | 4.414836 | {
"github_metadata": {
"branch": "main",
"commit_count": 354,
"repo_created_at": "2024-04-21T10:50:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b45a817e0a... |
fb270e1c-dc05-4128-89b7-7ab0a21a7479 | Tianyi-Tang/Poj_Algorithm_Practice | Mixed/solution/1970.cpp | #include <iostream>
#include <cstdlib>
#include <cstring>
using namespace std;
#define mapLength 19
int gameMap[mapLength][mapLength];
bool winTheGame(int player,int x,int y){
int counter,xCurrent,yCurrent;
counter = 1;
yCurrent = y+1;
while(yCurrent < mapLength){
if(gameMap[yCurrent][x] != player)
break;... | ALGO | 0.999983 | 3.446676 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-05-26T23:17:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e99d8d3168cf... |
a23b09d4-58d9-4380-9d0f-175e6f0a718b | Fearycxy/lintcode | A_1554_LastTime_Norepeat.cpp | class Solution {
public:
/**
* @param time:
* @return: return a string represents time
*/
string lastTime(string &time) {
// Write your code here
if(time.size()!=5) return "-1";
auto pos=time.find(':');
int h=stoi(time.substr(0,pos)),m=stoi(time.substr(pos+1));
... | ALGO | 0.984597 | 4.884676 | {
"github_metadata": {
"branch": "master",
"commit_count": 77,
"repo_created_at": "2018-04-26T14:30:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5d5fa8017... |
50cb5915-c335-4a95-b8ef-86badbcddb86 | Apress/beginning-cpp20 | Exercises/NoModules/Chapter 10/Soln10_03.cpp | // Exercise 10-3.cpp
// Defining a function template for adding numbers,
// and an overload that works for pointer types.
// Extra: also make plus() work with string literals...
#include <iostream>
#include <string>
#include <string_view>
template <typename T>
T plus(const T& a, const T& b)
{
return a + b;
}
// ... | TOOL | 0.976547 | 6.76355 | {
"github_metadata": {
"branch": "main",
"commit_count": 240,
"repo_created_at": "2020-10-02T13:57:44.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 171,
"forks": 74,
"issues": 2,
"pull_requests": 1
},
"file_meta": {
"content_id": "0e0ef0c9... |
89922aa2-2855-4dfb-b6a9-ca23843815ef | HardikNegi9/CodeForces | 1400/C_News_Distribution.cpp | #include<iostream>
#include<vector>
using namespace std;
class DisJoint{
vector<int> parent;
vector<int> size;
public:
DisJoint(int n){
parent.resize(n + 1);
size.resize(n + 1);
for(int i = 1; i <= n; i++){
parent[i] = i;
size[i] = 1;
}
}
... | ALGO | 0.999991 | 4.443952 | {
"github_metadata": {
"branch": "main",
"commit_count": 175,
"repo_created_at": "2024-11-06T08:46: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": "251a8819be... |
f9b033b1-0820-444f-8fe3-2607240da9ca | kyo-ke/coding_study | cpp_study/trap_rain_water.cpp | #include<iostream>
#include<vector>
#include<string>
#include<map>
#include<queue>
#include<set>
#include<cmath>
#include<stack>
#include<random>
#include<iterator>
#include <algorithm>
#include <functional>
#include <cassert>
#include <iomanip>
#include<unordered_map>
#include<bitset>
using namespace std;
int trap_wa... | ALGO | 0.999947 | 4.582435 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2021-01-30T09:35: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": "246a6abc4b1... |
936c0252-4350-4960-8de9-40fdbde72ef0 | h4p4/chm | lab3/src/linear_systems.cpp | #include "linear_systems.h"
#include <iomanip>
void print(const std::vector<std::vector<float>>& a)
{
for (size_t i = 0; i < a.size(); i++)
{
for (size_t j = 0; j < a[i].size(); j++)
{
std::cout << std::setw(10) << a[i][j];
}
std::cout << std::endl;
}
std::cout << std::endl;
}
void gauss(const std::vec... | ALGO | 0.999398 | 4.18167 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2022-12-05T19:44:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "78765c75b3... |
84112f64-fa16-4619-b3ad-44998d2dfaba | c159cc/primer-5th | algorithms/query/find.cpp | #include <cassert>
#include <cstring>
#include <deque>
#include <fstream>
#include <iostream>
#include <sstream>
#include <vector>
#include <forward_list>
#include <list>
#include <stack>
#include <algorithm>
#include <bitset>
#include <cctype>
#include <functional>
#include <iomanip>
#include <map>
#include <memory>... | ALGO | 0.978989 | 3.745173 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2025-01-09T09:01:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c67d2f4f0d3a... |
4ec505fd-20b2-4533-b760-8d9cad93c019 | QuICC/QuICC-Solver | Components/TimestepRkcb/Timestep/RungeKuttaCB/ImExRKCB2.cpp | /**
* @file ImExRKCB2.cpp
* @brief Implementation of an implicit/explicit Runge-Kutta scheme of order 2
*/
// System includes
//
#include <stdexcept>
// Project includes
//
#include "Timestep/RungeKuttaCB/ImExRKCB2.hpp"
namespace QuICC {
namespace Timestep {
namespace RungeKuttaCB {
// Scheme requires 3 subste... | ALGO | 0.998645 | 6.338867 | {
"github_metadata": {
"branch": "main",
"commit_count": 238,
"repo_created_at": "2025-02-05T09:15:26.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 11,
"pull_requests": 8
},
"file_meta": {
"content_id": "8a3c07fd14... |
e17d4a9d-68a7-4efe-bd30-0cce2e98ca5a | arnavjaiswal2803/DSA | 2558-minimum-number-of-operations-to-sort-a-binary-tree-by-level/2558-minimum-number-of-operations-to-sort-a-binary-tree-by-level.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999993 | 6.357846 | {
"github_metadata": {
"branch": "main",
"commit_count": 1732,
"repo_created_at": "2024-09-11T06:38: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": "52d13ba51... |
225c6827-862e-4f93-8902-e57db45a2678 | rtiosfu/leetcode-solutions | solutions/104_max_depth_of_binary_tree.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999645 | 5.951923 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2024-07-06T01:23: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": "1d54ad1ffbf... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.