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 |
|---|---|---|---|---|---|---|---|
29185f2c-c4cc-491a-ab2d-e277f832f211 | alexandraback/datacollection | solutions_2749486_1/C++/xiaodao/b.cpp | #include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<string>
#include <vector>
using namespace std;
string X = "WE", Y = "SN"; //-1/+1
int n, x, y;
const int MAX_N = 100000;
int who[MAX_N], how[MAX_N];
//X:0,Y:1
void addMove(int i, int wh, int hw) {
who[i] = wh;
how[i] = hw;
}
void ... | ALGO | 0.999975 | 3.785979 | {
"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": "5680ecf4a... |
685a95b5-a7ee-406a-af0c-138a47844039 | bishnumishra98/DSA | Leetcode&Gfg/08. Queue/InterleafTheFirstHalfOfTheQueueWithSecondHalf.cpp | // gfg: Interleave the First Half of the Queue with Second Half ---> You are given a queue Q
// of N integers of even length, rearrange the elements by interleaving the first half of the
// queue with the second half of the queue.
// Example 1:
// Input:
// Q = {2,4,3,1}
// Output:
// {2,3,4,1}
// Example 2:
// ... | ALGO | 0.99986 | 4.892755 | {
"github_metadata": {
"branch": "main",
"commit_count": 1328,
"repo_created_at": "2023-09-03T14:09: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": "5502f82e4... |
2125a641-7265-462d-9475-ea5218f5ea10 | Varanasi-Akshay/Parallel_Computing | Victor/VictorEijkhout-imp-code-5273cb440076/code/omp/reference_task.cxx | #include <stdlib.h>
#include <stdio.h>
#include <omp.h>
#include "utils.h"
#include "threepoint_local.h"
#define Indextwo(i,j,n) ( (i)*n+j )
int main(int argc,char **argv) {
int magic=201, nthreads;
double *ashared, *bshared;
double dtime,ttime;
if (hasarg_from_argcv("h",argc,argv)) {
printf("Usage: %s ... | ALGO | 0.998368 | 4.119797 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2020-02-11T21:53:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1cc058689... |
7a427156-472f-4338-a765-8e17923c873f | BarakXYZ/nand2tetris | week 8/VMTranslator/VMTranslator.cpp | // Implemented by BarakXYZ 2024
// as part of the NAND2TETRIS course offered by <NAME> and <NAME>
#include "Parser.h"
#include "CodeWriter.h"
#include <filesystem>
auto processEntry(Parser &parser, CodeWriter &codeWriter) -> bool;
auto main(int argc, char *argv[]) -> int {
if (argc != 2 && argc != 3) {
s... | TOOL | 0.952661 | 5.353709 | {
"github_metadata": {
"branch": "main",
"commit_count": 249,
"repo_created_at": "2025-07-11T16:23: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": "62bc83098e... |
104c9e74-bfc7-4a26-a9ca-38868633461a | google/filament | third_party/dawn/third_party/dxc/lib/CodeGen/MIRParser/MIParser.cpp | //===- MIParser.cpp - Machine instructions parser implementation ----------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===-------------------------------------------------------... | TOOL | 0.944319 | 7.155546 | {
"github_metadata": {
"branch": "main",
"commit_count": 7301,
"repo_created_at": "2018-08-03T17:26:00.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 18658,
"forks": 1993,
"issues": 155,
"pull_requests": 23
},
"file_meta": {
"content_id": "... |
329693e9-766c-4209-a84c-f0bc36d3bfa4 | adi-shelke/DSA | linkedList.cpp | #include<iostream>
using namespace std;
class Node{
public:
int data;
Node *next;
Node(int data)
{
this->data=data;
next=NULL;
}
};
class LinkedList{
public:
Node* head=NULL;
void insert(int data)
{
if(head==NULL)
{
Node* temp=new Node(... | ALGO | 0.999898 | 4.185591 | {
"github_metadata": {
"branch": "master",
"commit_count": 156,
"repo_created_at": "2023-01-11T03:33:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a09d9c6b... |
babe9413-bfc7-4ab7-9b21-25a944c159e5 | Hellblazer/CryptDB | crypto/sha.hh | #pragma once
#include <openssl/sha.h>
#include <vector>
template<class State,
int OutBytes,
int BlockBytes,
int (*Init)(State*),
int (*Update)(State*, const void*, size_t),
int (*Final)(uint8_t*, State*)>
class sha {
public:
sha() { Init(&s); }
void update(const v... | ALGO | 0.995961 | 7.020669 | {
"github_metadata": {
"branch": "public",
"commit_count": 1070,
"repo_created_at": "2012-09-16T16:00:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 11,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1910fd... |
c8315bd3-8d86-4faa-a2d8-019e09d908d1 | CryptDB/cryptdb | crypto/ffx.hh | #pragma once
/*
* Based on "The FFX Mode of Operation for Format-Preserving Encryption"
* by Bellare, Rogaway, and Spies.
* http://csrc.nist.gov/groups/ST/toolkit/BCM/documents/proposedmodes/ffx/ffx-spec.pdf
*
* and the addendum to the above, "A parameter collection for enciphering strings
* of arbitrary radix ... | ALGO | 0.986552 | 7.595268 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2014-01-03T16:26:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 512,
"forks": 97,
"issues": 7,
"pull_requests": 2
},
"file_meta": {
"content_id": "3d39af7... |
2a879c03-b48c-47b7-b96d-90d8f5f7213b | akira4O4/Opencv-100-Questions | A55.cpp | #include <iostream>
#include <stdio.h>
#include <opencv2/opencv.hpp>
#include "A_51_60.h"
#include <math.h>
#include <time.h>
using namespace cv;
void A55(Mat img1,Mat img2)
{
int imgHeight = img1.rows;
int imgWeight = img1.cols;
int channel = img1.channels();
printf_s("channel:%d\n", channel);
int imgh = img2... | ALGO | 0.998666 | 4.03915 | {
"github_metadata": {
"branch": "master",
"commit_count": 376,
"repo_created_at": "2020-01-11T13:25:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 18,
"forks": 7,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2f6cdac... |
16fe4202-a061-4611-bc1d-9d33655b5263 | ddunny/study | ALGORITHM/cpp/일곱 난쟁이.cpp | /*
* 일곱 난쟁이 완전탐색
* https://www.acmicpc.net/problem/2309
*
* 고려해야 할 사항
* 1. 난쟁이는 무조건 7명이고, 그들의 키의 합은 100이고, 가능한 정답이 여러 가지인 경우에는 아무거나 출력한다. → 기저 조건 설정
* 2. 오름차순으로 출력 → 알고리즘의 sort() 이용
* @ddunny
*/
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int arr[9] = { 0, };
vector<int> persons... | ALGO | 0.999814 | 4.18123 | {
"github_metadata": {
"branch": "master",
"commit_count": 298,
"repo_created_at": "2019-01-14T12:50:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
"content_id": "132406e7... |
ea8612cc-1a3c-4367-b988-e4462bb7b9c8 | asiradnan/CP | String Algorithms/Trie.cpp | #include<bits/stdc++.h>
using namespace std;
using ll=long long;
const int MAXLEN = 1e6+10;
const int alphabet = 26;
int trie_table[MAXLEN][alphabet];
int total_nodes = 1;
int cnt[MAXLEN];
void add(string &s){
int cur_node = 1;
cnt[cur_node]++;
for(int i=0; i<s.size(); i++){
int ch = s[i]-'a';
... | ALGO | 0.999891 | 4.211658 | {
"github_metadata": {
"branch": "main",
"commit_count": 86,
"repo_created_at": "2023-08-11T06:09: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": "f4ed61de9ad... |
c3e2c776-205f-47e7-a741-94aff45b29cc | olekszczepanowski/effective-programming-techniques | lab3/cmake-build-debug/CTree.cpp | //
// Created by oleks on 20.11.2023.
//
#include <iostream>
#include <sstream>
#include "CTree.h"
using namespace std;
CTree::CTree() {
root = nullptr;
isFixed = false;
}
CTree::CTree(CNode *newRoot) {
root = newRoot;
isFixed = false;
}
CTree::CTree(vector<string> formula) {
isFixed = false;
r... | ALGO | 0.999577 | 3.828073 | {
"github_metadata": {
"branch": "main",
"commit_count": 47,
"repo_created_at": "2023-10-10T16:46: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": "7f89a182ef7... |
3b61ddab-84b6-4315-ada3-18c5703b6ea9 | lballabio/QuantLib | ql/methods/finitedifferences/utilities/cevrndcalculator.cpp | /* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
Copyright (C) 2018 <NAME>
This file is part of QuantLib, a free-software/open-source library
for financial quantitative analysts and developers - http://quantlib.org/
QuantLib is free software: you can redistribute it and/or modif... | ALGO | 0.998462 | 7.604327 | {
"github_metadata": {
"branch": "master",
"commit_count": 17543,
"repo_created_at": "2015-12-17T16:29:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6151,
"forks": 1964,
"issues": 51,
"pull_requests": 11
},
"file_meta": {
"content_id":... |
8a9fc5f8-0cb5-4eca-adbb-0cbbf5e7e920 | egekabas/Competitive-Programming-Solutions | oj.uz/CEOI17/chase.cpp | #include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef pair<ull, ull> pull;
typedef pair<ll, ll> pii;
... | ALGO | 0.999839 | 3.667129 | {
"github_metadata": {
"branch": "main",
"commit_count": 204,
"repo_created_at": "2023-06-19T10:43: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": "2dc26583cc... |
d832bc67-2bee-48b5-b02a-5cd0b25de2d7 | xSeanliux/CompetitiveProgramming | CF/1207C/1207C.cpp | #include <iostream>
#include <numeric>
#include <algorithm>
#include <set>
#include <vector>
using namespace std;
vector<int> a, b, c;
set<int> st;
int main(){
a.resize(100);
iota(a.begin(), a.end(), 0);
for(int i = 0; i < 100; i++){
for(int j = i + 1; j < 100; j++){
c.push_back(a[i] ^... | ALGO | 0.99996 | 3.18381 | {
"github_metadata": {
"branch": "master",
"commit_count": 31,
"repo_created_at": "2018-11-18T06:45: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": "b7e8ed36b... |
32d060de-2a02-4460-84f9-05cb7d351d51 | Husainbw786/LeetCode | 0085-maximal-rectangle/0085-maximal-rectangle.cpp | class Solution {
public:
int histogram(vector<int>& heights) {
int n = heights.size();
vector<int> left(n);
vector<int> right(n);
stack<pair<int, int>> st;
for (int i = n - 1; i >= 0; i--)
{
while (!st.empty() && st.top().first >= heights[i])
... | ALGO | 0.999904 | 6.039477 | {
"github_metadata": {
"branch": "main",
"commit_count": 6274,
"repo_created_at": "2022-02-21T04:54:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "09d3acd6f... |
9e8d034b-4e57-410f-b315-23736900b490 | caixzn/contests | iee/16.0/what_language.cpp | #include <iostream>
#include <unordered_map>
#include <map>
#include <set>
#include <vector>
#include <codecvt>
#include <locale>
#include <algorithm>
#include <queue>
using namespace std;
struct node {
int parent, l, r;
char32_t c = 0;
};
int main(void) {
ios::sync_with_stdio(false);
cin.tie(nullptr)... | ALGO | 0.99957 | 4.34959 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2022-11-21T01:41: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": "82508b4acd3a... |
3058f18c-5e1a-4dcf-9f02-a692be6ebece | GOOTEAKIM/algo | C++/SSAFY_Embedded/SSAFY_Embedded/Dessert_cafe.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <cstring>
using namespace std;
int n;
int m[30][30];
// 우하 좌하 좌상 우상
int dr[] = { 1, 1, -1,-1 };
int dc[] = { 1,-1,-1,1 };
int visited[110]; // index = 디저트 종류, value = 경로상에 있는가
int destRow, destCol;
vector<int> path;
int ans;
void input() {
/... | ALGO | 0.999805 | 4.37324 | {
"github_metadata": {
"branch": "master",
"commit_count": 368,
"repo_created_at": "2024-06-14T08:40:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0b462874... |
5b053923-ab54-46c2-b1fe-9d1bc544081f | chenzhi87v5/LeetcodeOJ | 225-ImplementStackusingQueues.cpp | //Implement Stack using Queues 用队列来实现栈
/*Implement the following operations of a stack using queues.
push(x) -- Push element x onto stack.
pop() -- Removes the element on top of the stack.
top() -- Get the top element.
empty() -- Return whether the stack is empty.
Notes:
You must use only standard operations of a... | ALGO | 0.985339 | 4.396294 | {
"github_metadata": {
"branch": "master",
"commit_count": 111,
"repo_created_at": "2016-03-17T11:26: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": "d116cee9... |
fbff2150-4327-4571-b549-9adae1275500 | thegamer1907/Code_Analysis | contest/1542583854.cpp | #include <cassert>
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#if __cp... | ALGO | 0.999847 | 4.001914 | {
"github_metadata": {
"branch": "master",
"commit_count": 73,
"repo_created_at": "2019-05-24T10:35:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "46a834de3... |
b5e5fa1e-8899-4608-8db8-560a0ce7d55c | salmanmallah/teaching_cpp | challenge/for_loop/challenge8.cpp | #include <iostream>
using namespace std;
int main() {
// Write a C program to display the n terms of odd natural numbers and their
// // sum.
// Test Data Input number of terms : 10 Expected Output
// : The odd numbers are : 1 3 5 7 9 11 13 15 17 19 The Sum of odd
// Natural
// Number upto 10 t... | ALGO | 0.995747 | 4.106155 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2025-01-10T17:08:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "672ec605308d... |
1fb60f26-90e3-4a13-b514-4bd7f3bec024 | BigheadLiu/projekt-grupa-244 | ViolaJones.h | #include "StdAfx.h"
#include "Cascade.h"
#include "Image.h"
#include "AdaBoost.h"
#include "ImageLoader.h"
#include <list>
using namespace std;
/*
* klasa impementira Viola-Jones algoritam i stvara kaskadu
*
* @author: <NAME>
*/
class ViolaJones {
public:
vector<Image*> positiveTest; // set (integralnih) slika ... | ALGO | 0.974309 | 3.565801 | {
"github_metadata": {
"branch": "master",
"commit_count": 32,
"repo_created_at": "2015-03-16T14:43:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a6910897e... |
b62fc553-f9c4-4ab6-833e-a37afa5307d3 | ErlendLima/FYS3150 | Project1/cpp/src/solve.cpp | #include <armadillo>
#include "solve.h"
arma::vec thomas(const arma::vec& a, const arma::vec& b, const arma::vec& c, const arma::vec& v){
/* Implementation of Thomas Algorithm */
if(arma::numel(a) != arma::numel(b) ||
arma::numel(b) != arma::numel(c) ||
arma::numel(c) != arma::numel(v))
t... | ALGO | 0.999997 | 5.304173 | {
"github_metadata": {
"branch": "master",
"commit_count": 430,
"repo_created_at": "2017-08-27T14:48:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4b68f17c... |
d7fcc1b0-ef94-425a-b75f-74e87cc5dc5e | Hemeshdev/leetcode-contests-solutions | Weekly Contest 8/417. Pacific Atlantic Water Flow.cpp | class Solution {
public:
void bfs(queue<pair<int,int>>&q,vector<vector<bool>>&ocean,vector<vector<int>>& h){
int n = h.size();
int m = h[0].size();
int row[4] = {-1,0,0,1};
int col[4] = {0,-1,1,0};
while(q.size()){
int r = q.front().first;
int c = q.fr... | ALGO | 0.999931 | 6.032896 | {
"github_metadata": {
"branch": "main",
"commit_count": 143,
"repo_created_at": "2024-03-02T07:19:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ca840340b6... |
d7ab2d06-d2ac-49b9-9570-821fbc46087b | KaziRifatAlMuin/CodeDrive | Dynamic Programming/dp - Wonderful City.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const long long inf = 1e17;
ll solvedp(vector <vector<ll>> g, vector <ll> cost){
int n = cost.size();
vector <bool> ban1(n), ban2(n), ban3(n); // (FF,TT), FT, TF
for(int i = 1; i < n; i++){
for(int j = 0; j < n; j++){
i... | ALGO | 0.999917 | 4.534844 | {
"github_metadata": {
"branch": "main",
"commit_count": 249,
"repo_created_at": "2024-10-08T09:11:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "63b0eb06f5... |
0dd39b79-8716-460a-9f4b-878323beee44 | JmKanmo/ProblemSolving | AlgorithmSytudy/AlgorithmSytudy/Baekjoon/BOJ-16337(괄호추가하기).cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
typedef long long LL;
char arr[21];
int N;
LL answer = -2e9;
void init()
{
scanf("%d", &N);
getchar();
for (int i = 0; i < N; i++)
{
scanf("%c", &arr[i]);
if (i % 2 == 0) arr[i] -= 48;
}
}
LL calc(LL left_Num, char op, LL rig... | ALGO | 0.999974 | 3.801782 | {
"github_metadata": {
"branch": "master",
"commit_count": 28,
"repo_created_at": "2019-07-24T02:22: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": "5b876d629... |
efb9c26a-abba-423f-84be-b048ffde9162 | kosh7707/dataStructure | Circular_LinkedList/Circular_LinkedList.cpp | #include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
template <typename T> class Node;
template <typename T> class List;
template <typename T> class CircularList;
template <typename T, class LISTCLASS> class ListIterator;
/* Node ---------------------------------------------------------- */
te... | ALGO | 0.999038 | 5.83648 | {
"github_metadata": {
"branch": "main",
"commit_count": 25,
"repo_created_at": "2022-10-04T11:14: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": "fc7b553688a... |
170460ca-84f6-449d-9b0d-8c9561adba50 | sagnik-r/Operating-System-Laboratory_CS39002 | Assignment_5/Assignment_5_submission/Ass5_11_18CS10063_18CS10011_thread.cpp | #include <iostream>
#include <sys/ipc.h>
#include <sys/shm.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <stdio.h>
#include <pthread.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <chrono>
#include <time.h>
#include <random>
#include <vector>
#include <thread>
using namespace... | ALGO | 0.999277 | 5.319005 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2021-08-04T05:28: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": "329dfc617822... |
c0e7a689-79fd-49a3-9bf4-defb5cfa8274 | lhr0909/SimonsAlgo | _spoj/FASHION.cpp | #include<iostream>
#include<cstdlib>
using namespace std;
int compare (const void *p1, const void *p2) {
return (*(int*)p2 - *(int*)p1);
}
int main(void)
{
int t;
int N;
int hotGuys[1000], hotGirls[1000];
int sum;
cin >> t;
for (int tt = 0; tt < t; tt++) {
cin >> N;
for (i... | ALGO | 0.999972 | 3.318357 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2014-05-13T01:38:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9f762e94b... |
f617ed19-a7fa-4f42-bd90-cc10909c244d | yuebaii/projects | 2048/2048.cpp | #include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include <time.h>
#include <conio.h>
#define row 4
#define col 4
//生成随机数
int RandNum()
{
srand(time(NULL));
int num = rand()%5;
if(num==0 || num==1 || num==2 || num==3)
{
return 2;
}
else
{
return 4;
}
}
void Initial(i... | ALGO | 0.999404 | 3.282959 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2018-09-09T00:59:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "832cb52c17... |
f47f009c-decb-4848-ae00-c9372db3f784 | enuguru/algorithms_and_datastructures | c++_programming/Data Structures Through C++/Source code/Chapter 09/CH09PR06.CPP | // Program ch09pr06
// Program to sort array using quick sort
#include <iostream.h>
const int MAX = 10 ;
class array
{
private :
int arr[MAX] ;
int count ;
public :
array( ) ;
void add ( int item ) ;
int getcount( ) ;
static int split ( int *, int, int ) ;
void quiksort ( int lower, int upper ) ;
... | ALGO | 0.999984 | 5.696896 | {
"github_metadata": {
"branch": "main",
"commit_count": 35,
"repo_created_at": "2022-03-03T08:25:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 7,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2184942fc42... |
0b8c3349-0fdc-49ae-a26a-dff4cd9cfb15 | mirinta/leet_code | simulation/0059_spiral_matrix_II.cpp | #include <vector>
/**
* Given a positive integer "n", generate an "n x n" "matrix" filled with elements from "1" to "n^2"
* in spiral order.
*
* ! 1 <= n <= 20
*/
class Solution
{
public:
std::vector<std::vector<int>> generateMatrix(int n)
{
std::vector<std::vector<int>> result(n, std::vector<int... | ALGO | 0.999943 | 6.375662 | {
"github_metadata": {
"branch": "master",
"commit_count": 1725,
"repo_created_at": "2023-04-09T12:48:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6723c6b... |
306a7db3-a0dd-4639-bce2-d7ff5bdea2b1 | paesanilab/MBX | src/potential/1b/x1b_A1B4_deg5_exp0_v1x.h | /******************************************************************************
Copyright 2019 The Regents of the University of California.
All Rights Reserved.
Permission to copy, modify and distribute any part of this Software for
educational, research and non-profit purposes, without fee, and without
a written agre... | ALGO | 0.906244 | 5.503589 | {
"github_metadata": {
"branch": "master",
"commit_count": 2662,
"repo_created_at": "2016-04-22T23:24:14.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 41,
"forks": 32,
"issues": 5,
"pull_requests": 1
},
"file_meta": {
"content_id": "bff167... |
22ca69d9-34bd-46ba-92a1-4366c41c32e0 | zgyaru/testSctpa | src/ks_test.cpp | #include <Rcpp.h>
#include <iostream>
#include <typeinfo>
using namespace std;
using namespace Rcpp;
double ks_sample_gsva(IntegerVector x,
IntegerVector x_sort_indxs,
IntegerVector geneset_idxs,
IntegerVector geneset_mask,
int... | ALGO | 0.979111 | 6.136649 | {
"github_metadata": {
"branch": "main",
"commit_count": 36,
"repo_created_at": "2021-08-20T00:27:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 6,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "029b6f94705... |
bd3f704f-8e08-4eef-b2d8-8c9c12bd9bd8 | Abysman/MyLeetCode | 213.House Robber II/213.House Robber II/main.cpp | //
// main.cpp
// 213.House Robber II
//
// Created by stevenxu on 12/2/19.
// Copyright © 2019 stevenxu. All rights reserved.
//
#include <iostream>
class Solution {
public:
int rob(vector<int>& nums) {
int n = nums.size();
if (n < 2) return n ? nums[0] : 0;
return max(robber(nums, 0, ... | ALGO | 0.999882 | 5.274865 | {
"github_metadata": {
"branch": "master",
"commit_count": 548,
"repo_created_at": "2018-03-16T02:31: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": "be8f527f... |
5fd9a9ad-a952-4c44-9296-9b9113f799ad | OneStig/contests | Codeforces/EducationalCodeforcesRound154(RatedforDiv2)/CQueriesfortheArray/solution.cpp | #include <bits/stdc++.h>
using namespace std;
template<typename A, typename B> ostream& operator<<(ostream &os, const pair<A, B> &p) { return os << '(' << p.first << ", " << p.second << ')'; }
template<typename T_container, typename T = typename enable_if<!is_same<T_container, string>::value, typename T_container::va... | ALGO | 0.999964 | 4.501133 | {
"github_metadata": {
"branch": "master",
"commit_count": 142,
"repo_created_at": "2020-11-01T02:52: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": "2b1345d6... |
3d201490-ece5-41ce-b54f-62e8ae27e787 | JosephOlka/CS265 | OlkaCS265W4MidTermQuestion3/OlkaCS265W5MidTermQuestion3/OlkaCS265W4MidTermQuestion3.cpp | //******************************************************************//
//<NAME>
//CS265
//Week 4 MidTerm Question 3
//This Program takes two integers and an operator
//Then ouputs the equation and result
//*******************************************************************//
//Inlude Librarys/dependencies
#include <i... | TOOL | 0.918316 | 3.866595 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2019-07-13T01:22: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": "6dca5104ed... |
4bba4a5f-c501-4ef9-ad67-c7e4014cf71a | ZCH12/BigFigure-Lib | 库测试项目/test.cpp | #include "..\BigFigure库\BigFiugre.h"
#if _DEBUG
#if _M_X64
#pragma comment(lib,"..\\x64\\Debug\\BigFigure库.lib")
#else
#pragma comment(lib,"..\\Debug\\BigFigure库.lib")
#endif
#else
#if _M_X64
#pragma comment(lib,"..\\x64\\Release\\BigFigure库.lib")
#else
#pragma comment(lib,"..\\Release\\BigFigure库.lib")
#endif
#endif... | ALGO | 0.961038 | 3.283269 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2017-01-17T11:12:50.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5a457668c6... |
2d421191-ff60-4fed-858f-0be74eb0f574 | OmVarma18/DSA-placement | Step 3-Arrays/Easy/longestsubwithsum.cpp | // #include <iostream>
// #include <unordered_map>
// #include <vector>
// using namespace std;
// /*
// brute O(n3) or O(n2) sc with o1
// better is Hashmap
// optimal is
// */
// vector<int> longestSubarrayWithSum(int arr[], int n, int targetSum) {
// unordered_map<int, int> prefixMap; // Stores prefix sum and f... | ALGO | 0.9999 | 5.746727 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2025-01-26T17:06: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": "ddd10bdb20d... |
a5bebe0c-74f0-4296-a498-01f5d0b95e1f | naeem4265/Coding | codeforces/1968G1.cpp | #include<bits/stdc++.h>
#define Fast ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define Freed freopen ("0in.txt","r",stdin);
#define Fout freopen ("0out.txt","w",stdout);
#define ll long long int
#define pb push_back
#define pi acos(-1.0)
const ll limit = 1e6+5;
const ll Mod = 1e9+7;
const ll base1 = 29;
const ll ... | ALGO | 0.999948 | 3.731977 | {
"github_metadata": {
"branch": "master",
"commit_count": 175,
"repo_created_at": "2020-10-05T18:22:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4e799399... |
a1df59cf-5b25-4b67-828d-29204d433bd4 | lemire/Code-used-on-Daniel-Lemire-s-blog | 2016/10/05/pointersort.cpp | // g++ -O3 -march=native -std=c++11 -o pointersort pointersort.cpp -I .
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include <math.h>
#include <string.h>
#include <numeric>
#include <vector>
#include <algorithm>
#include <string>
#include <timsort.hpp>
#define RDTSC_START(cycles) ... | ALGO | 0.97846 | 5.867163 | {
"github_metadata": {
"branch": "master",
"commit_count": 2385,
"repo_created_at": "2012-04-06T00:13:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 885,
"forks": 184,
"issues": 2,
"pull_requests": 5
},
"file_meta": {
"content_id": "c15... |
c82d33e7-3f85-4e72-94ba-b040eb9c34f1 | Yawn-Sean/Daily_CF_Problems | daily_problems/2024/11/1121/personal_submission/cf1068c_WanderOvO.cpp | int n, m;
vector<vector<int>> e(N);
vector<vector<PII>> pos(N);
void meibao() {
cin >> n >> m;
for (int i = 1; i <= m; i++) {
int u, v;
cin >> u >> v;
if (u > v) swap(u, v);
e[u].push_back(v);
}
int cur_x = 1, cur_y = 1;
for (int i = 1; i <= n; i++) {
sort(e[... | ALGO | 0.999942 | 4.047054 | {
"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": "a6d5... |
04cd473d-ad25-4f70-98c6-e26110ec3ac9 | ehnryx/acm | samara-2015-cf100694/g.cpp | #include <bits/stdc++.h>
using namespace std;
#define _USE_MATH_DEFINES
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef complex<ld> pt;
typedef vector<pt> pol;
const char nl = '\n';
const int INF = 0x3f3f3f3f;
const ll INFLL = 0x3f3f3f3f3f3f3f3f;
const ll MOD = 1e9+7;
const ld EPS = 1... | ALGO | 0.999895 | 4.169688 | {
"github_metadata": {
"branch": "master",
"commit_count": 79,
"repo_created_at": "2018-05-03T04:18:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dd225ea1d... |
c3532685-7725-41b8-bda9-c004378b00c0 | julio-am/leetcode-warrior | LinkedLists/CopyListWithRandomPointer.cpp | //A linked list of length n is given such that each node contains an additional random pointer, which could point to any node in the list, or null.
//Construct a deep copy of the list. The deep copy should consist of exactly n brand new nodes, where each new node has its value set to the value of its corresponding ori... | ALGO | 0.997993 | 5.805195 | {
"github_metadata": {
"branch": "main",
"commit_count": 112,
"repo_created_at": "2022-08-21T20:29: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": "9f0c8576ce... |
24757d66-4d34-4409-a8ee-2fe9e795181b | NeeCodes/Terminal-Hangman | hangman.cpp | //build a little hangman game
/*the initial hangman will look like:
|----|
| |
| O
| /|\
| / \
*/
//V1: the user inputs the word and gets 5 guesses
//V2: bug fixes, ask the user to choose a category and randomly select a word from the chosen category
//V3 (to be done): add hints and make a std::map for ... | ALGO | 0.988627 | 3.321218 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2022-08-26T19:15: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": "50332664ee4c... |
030706da-b8e4-4058-9d32-31d4a035767f | makio93/competitive-atcoder | abc234/abc234_g/2/main0.cpp | // 学習2回目,バチャ本番,自力WA
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using ll = long long;
#define rep(i, n) for (int i=0; i<(int)(n); ++(i))
#define rep3(i, m, n) for (int i=(m); (i)<(int)(n); ++(i))
#define repr(i, n) for (int i=(int)(n)-1; (i)>=0; --(i))
#define rep3r(... | ALGO | 0.999973 | 4.599775 | {
"github_metadata": {
"branch": "main",
"commit_count": 925,
"repo_created_at": "2021-04-23T16:25: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": "7dd755bd0b... |
98761f6f-4263-47ed-912f-8b9152761d2d | thaos/GraphCut | lib/gco-v3.0/example_sthao.cpp | //////////////////////////////////////////////////////////////////////////////
// Example illustrating the use of GCoptimization.cpp
//
/////////////////////////////////////////////////////////////////////////////
//
// Optimization problem:
// is a set of sites (pixels) of width 10 and hight 5. Thus number of pixels... | ALGO | 0.998144 | 3.277025 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2019-03-08T15:44: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": "0fb2463ce... |
86e14dea-9e94-417c-b5d4-f426dcba82a8 | staffle-zz/NITS_local_solutions | solutions/invictus_solutions/C.cpp | #include "bits/stdc++.h"
using namespace std;
typedef long long ll;
const ll INF = 1e18;
#define all(v) v.begin(), v.end()
map <int, vector <int>> f0, f1;
set <int> val;
int main() {
ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
int n; cin >> n;
for(int i = 0; i < n; i ++) {
int a, b, c;
cin >> a >>... | ALGO | 0.999967 | 3.813361 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2020-04-07T17:07: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": "d157aaac43... |
0c50968a-fea8-4367-80f1-18f010f9e52f | wangjie212/ManiSDP-matlab | src/C-files/lincombc.cpp | #include "mex.h"
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) {
// Check for the proper number of input and output arguments
if (nrhs != 3 && nrhs != 5) {
mexErrMsgIdAndTxt("MyToolbox:lincomb:nrhs", "Three or five inputs required.");
}
if (nlhs != 1) {
me... | ALGO | 0.998242 | 5.166862 | {
"github_metadata": {
"branch": "main",
"commit_count": 166,
"repo_created_at": "2022-07-29T14:16:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 22,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7354b61bc... |
48e714d1-1104-471c-b511-0c31e22d69f5 | chandana7d/tinyml | keywordspotting/tensorflow/tensorflow/compiler/xla/service/gpu/fusions/fusions.cc | /* Copyright 2023 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | ALGO | 0.939598 | 7.811938 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2024-09-28T19:24:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "97072a47b51... |
c9b45260-9769-4e06-965f-fafaa86084be | anish-rajan/Cp-algos | contests/round649/a.cpp | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
#define mp make_pair
#define v vector
#define inp_push(no, v) \
ll no; \
cin >> no; \
v.push_back(no);
#define pb push_back
#define fi first
#define se second
#define ALL... | ALGO | 0.999612 | 4.18163 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2020-05-19T07:45:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f84d77b38... |
1243e832-48c2-402e-86ec-7b3a3132b985 | kangkodingnow/BAB-1-Belajar-mandiri-c- | Source Code/Dasar_dasar C++/main.cpp | #include <iostream>
using namespace std;
int cariPosisiNilai(int nilai, int *array, int n){
int indeks = -1;
for (int i = 0; i < n; i++){
if(array[i] == nilai){
indeks = i;
break;
}
}
return indeks;
}
int main(){
int data[5] = {100, 200, 300, 400, 500};
... | ALGO | 0.999856 | 5.034108 | {
"github_metadata": {
"branch": "main",
"commit_count": 69,
"repo_created_at": "2022-07-19T05:35: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": "db9393e9f2e... |
e7fa83ad-b8a6-422f-a060-47d8e3ab539b | BUZZINGPolarBear/Problem-Solving | Programmers PS/실패율.cpp | //
// 실패율.cpp
// Problem_Solving
//
// Created by joonhwi on 2022/08/17.
//
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
vector<int> solution(int N, vector<int> stages) {
sort(stages.begin(), stages.end());
vector<int> answer;
vector<pair<float... | ALGO | 0.99953 | 4.303545 | {
"github_metadata": {
"branch": "main",
"commit_count": 102,
"repo_created_at": "2022-09-05T13:19:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "eae8aa424b... |
0432f84c-8fa5-4191-80ba-8a38ef3d7978 | KuzIlya/C-Labs | 1 цикл for/for.cpp | #include <iostream>
#include <iomanip>
class NumHandler {
private:
int number;
public:
NumHandler(int num) {
number = num;
}
bool DivisibleByAllDigits(int num) {
int originalNum = num;
while (num > 0) {
int digit = num % 10;
if (digit == 0 || originalNum... | ALGO | 0.996816 | 5.877876 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-09-05T16:16:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d424cc7ad256... |
ea5d9ac0-a6ac-4245-9c5d-2124c99521bf | lijingpeng/ac | meetball_p1247.cc | #include <iostream>
using namespace std;
int main()
{
int n, seats[31];
while(cin >> n && n)
{
for(int i = 0; i < n; i++)
{
cin >> seats[i];
}
int i, j, sam[31], elle[31];
for( i = 0; i < 31; i++)
{
sam[i] = 0;
elle[i] = 0... | ALGO | 0.999993 | 3.404647 | {
"github_metadata": {
"branch": "master",
"commit_count": 172,
"repo_created_at": "2014-01-07T10:17: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": "5d5a9ece... |
a1b6bf26-8a92-4371-94bf-8435bf57c314 | HimanshuJo/Important-Programming-Concepts-With-Implementations-CPP-Java-Python-JS-SQL | Tar/C++/CodeForces/Rounds/720/NastiaAndGoodArrayB.cpp | /*
Nastia has received an array of n positive integers as a gift.
She calls such an array a good such that for all i (2≤i≤n)
takes place gcd(ai−1,ai)=1, where gcd(u,v)
denotes the greatest common divisor (GCD) of integers u and v
You can perform the operation: select two different indices i,j
(1≤i,j≤n, i≠j) and tw... | ALGO | 0.999978 | 4.32432 | {
"github_metadata": {
"branch": "master",
"commit_count": 82,
"repo_created_at": "2021-08-18T00:46: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": "059702093... |
c0136858-9f8d-4d11-9248-6a74dc4cc7ef | prajwal714/DSA-Coding-Practice | Leetcode/Linked List/intersection-of-two-linkedi-list.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
//in case their is no intersection between both list, after a certain time first list will be
// traversed nA+nB times and second will be traversed nB+nA times... | ALGO | 0.999738 | 5.080759 | {
"github_metadata": {
"branch": "master",
"commit_count": 127,
"repo_created_at": "2019-08-22T19:44:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 13,
"forks": 10,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2ead68... |
e09b1c7f-7a1c-45f5-b607-c00c8d2e16cf | OSCC-Project/iEDA | src/operation/iPL/source/module/detail_placer/operation/InstanceSwap.cc | // ***************************************************************************************
// Copyright (c) 2023-2025 Peng Cheng Laboratory
// Copyright (c) 2023-2025 Institute of Computing Technology, Chinese Academy of Sciences
// Copyright (c) 2023-2025 Beijing Institute of Open Source Chip
//
// iEDA is licensed un... | ALGO | 0.996711 | 6.262275 | {
"github_metadata": {
"branch": "master",
"commit_count": 3908,
"repo_created_at": "2022-08-28T06:18:01.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 396,
"forks": 44,
"issues": 8,
"pull_requests": 1
},
"file_meta": {
"content_id": "b6278... |
8bb719a7-5fef-4236-9b97-f64b640e3409 | Yawn-Sean/Daily_CF_Problems | daily_problems/2024/09/0903/personal_submission/cf1031d_yawn_sean.cpp | #include <bits/stdc++.h>
// #pragma GCC optimize("O3,Ofast,unroll-loops")
// #include <bits/extc++.h>
// using namespace __gnu_cxx;
// using namespace __gnu_pbds;
using namespace std;
signed main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int n, k;
cin >> n >> k;
vector<st... | ALGO | 0.999866 | 3.932732 | {
"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": "3548... |
d68cc298-bf38-4da4-b0ff-76c18f6cdaf0 | shFarrukh/coding | Yandex/yandexE.cpp | #include <bits/stdc++.h>
using namespace std;
int n, m;
int rul_order[600];
int kola[600];
string ru[510];
vector<int> res;
int rules_alive[510];
int pos_alive[510];
bool used[600], rule_used[600];
bool solve(string s)
{
int pos_sz = n;
for (int i = 0; i < n; i++)
{
used[i] = false;
pos_a... | ALGO | 0.999971 | 4.083776 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2020-04-07T04:34: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": "75cb400901... |
8d8d3bc2-14fe-43fe-bfef-a44efac04817 | zukahai/algotithm-training | perfect_square_3/random_test_case/random_test_case.cpp | #include <bits/stdc++.h>
using namespace std;
string toString(int n)
{
string ans = "";
while (n > 0)
{
ans = char(n % 10 + '0') + ans;
n /= 10;
}
if (ans.length() == 1)
{
ans = "0" + ans;
}
return ans;
}
long long solve(long long n)
{
long long index = 2;
... | ALGO | 0.999539 | 4.333243 | {
"github_metadata": {
"branch": "main",
"commit_count": 351,
"repo_created_at": "2023-03-23T11:02:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ff35d96217... |
5730f84e-64a5-4ba8-9241-4c78a5a55aa1 | wliday/clrs-c-implementation | ShortestPathsAlgorithm/SPFA_adjacency_matrix.cpp | #include<iostream>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<queue>
#include<climits>
using namespace std;
const int NV = 101;
const int inf = INT_MAX >> 1;
int m, n;
int map[NV][NV];
int dis[NV];
bool mark[NV];
int Spfa (int src, int des) {
for (int i = 0; i <= n; i++) {
mark[i] ... | ALGO | 0.999928 | 4.030272 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2012-07-02T10:37:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 23,
"forks": 9,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5074b93c... |
13822505-2b6e-434d-833f-6256770f9ecd | wesleychou7/cs37 | assignments/lab4a/main.cpp | #include <iostream>
using namespace std;
int main(){
int input;
cout << "Enter a 5-digit integer that contain only 0s and 1s: ";
cin >> input;
int min = 10000;
int max = 11111;
int current = input;
int digit;
// boolean variable to check if input are 0's and 1's
bool valid = tr... | ALGO | 0.999169 | 4.339794 | {
"github_metadata": {
"branch": "main",
"commit_count": 46,
"repo_created_at": "2023-01-18T00:30: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": "05bf9181863... |
cae746af-6ce0-4450-939c-79b6cfb2dcb3 | sjcbulldog/xeropathgen2 | XeroPathGen/PathTrajectory.cpp | //
// Copyright 2022 <NAME>
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http ://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writ... | ALGO | 0.998346 | 5.304081 | {
"github_metadata": {
"branch": "main",
"commit_count": 28,
"repo_created_at": "2022-12-14T18:29:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "53168b1b3d7... |
6eecf19a-269f-4fa5-9f0e-8d09cd012317 | embedded-kiddie/Arduino-CYD-2432S028R | LVGL/LVGL_Arduino_MP3Player/tree.hpp | /*----------------------------------------------------------------------
* N-ary Tree for directory tree
* https://www.geeksforgeeks.org/dsa/tree-data-structure/
* https://www.geeksforgeeks.org/dsa/generic-treesn-array-trees/
*----------------------------------------------------------------------*/
#ifndef _TREE_H_... | ALGO | 0.961745 | 4.500286 | {
"github_metadata": {
"branch": "main",
"commit_count": 221,
"repo_created_at": "2025-01-15T03: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": "d7df118327... |
ca202ea7-734f-4199-ae68-0b3419281343 | gabriel88766/C-CPP-AlgorithmsAndContests | At-Coder/Regular/155/C.cpp | #include <bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
const ll INF_LL = 0x3f3f3f3f3f3f3f3f, MOD = 998244353; //1e9+7
const int INF_INT = 0x3f3f3f3f;
const long double PI = acosl(-1.), EPS = 1e-9;
using namespace std;
//cout << fixed << setprecision(6)
int main(){
ios_base::sync_wi... | ALGO | 0.999998 | 3.590718 | {
"github_metadata": {
"branch": "master",
"commit_count": 436,
"repo_created_at": "2020-08-21T00:21: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": "6ac04126... |
e50eeb12-73cb-4b6d-9365-d94bdb8a47d4 | gabriel88766/C-CPP-AlgorithmsAndContests | Codeforces/1782/A.cpp | #include <bits/stdc++.h>
typedef long long int ll;
const ll INF_LL = 0x3f3f3f3f3f3f3f3f, MOD = 1e9+7;
const int INF_INT = 0x3f3f3f3f;
using namespace std;
//cout << fixed << setprecision(6)
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
//freopen("in", "r", stdin); test input
int t;
c... | ALGO | 0.999288 | 3.664537 | {
"github_metadata": {
"branch": "master",
"commit_count": 436,
"repo_created_at": "2020-08-21T00:21: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": "11be5706... |
01585c25-edf2-4273-83ce-654aedc3711c | jainhardik06/Army-Health-and-Monitering-System | particularsensor_pulsesensor.ino | int pulsePin = A2; // Pulse Sensor purple wire connected to analog pin A2
int blinkPin = 13; // Pin to blink LED at each beat
volatile int BPM; // Variable to hold heart rate
volatile int Signal; // Holds the incoming raw data
volatile int IBI = 600; ... | ALGO | 0.936018 | 5.973169 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2024-07-12T10:32: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": "5a346bcd4ba... |
ced25dc8-701c-4985-9a65-1d3ea72fe9db | JRgit03/Algorithm | voj/ZZJC 2024 spring team contest-7/A_Amanda_Lounges.cpp | // dfs染色
// https://www.cnblogs.com/fightfordream/p/6519248.html 题解
// https://codeforces.com/gym/100502/ 源地址
#include <bits/stdc++.h>
#define int long long
using namespace std;
const int N = 2e5 + 10;
int n,m;
int cnt1,cnt2;
int ans;
int suc = 1;
int vis[N];
int col[N]; // 1 染黑色 -1染白色 0未确定
vector<int> g[N];
// 当前遍历到u... | ALGO | 0.999959 | 4.248782 | {
"github_metadata": {
"branch": "master",
"commit_count": 229,
"repo_created_at": "2023-08-28T13:50:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3a73180f... |
d85feda0-c1e9-4b13-b2aa-6583fbae6211 | chenyizho0/Beauty_Of_Programming | 2-13.cpp | /*************************************************************************
> File Name: 2-13.cpp
> Author: laixukai
> Mail: <EMAIL>
> Created Time: 2014年02月11日 星期二 01时08分59秒
************************************************************************/
#include<iostream>
using namespace std;
int arr[100]... | ALGO | 0.999943 | 3.802253 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2013-11-19T12:25: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": "2c1c1cd73... |
7e5c93b9-19dd-4449-876e-7969e1754e3a | normanhoang/cpp_final_project | invnorm.h |
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
using namespace std;
//uniform random number generator
vector<double> ran(int seed, int n = 1) {
const int IM1 = 2147483563;
const int IM2 = 2147483399;
double AM = (1.0 / IM1);
int IMM1 = (IM1 - 1);
const int IA1 = 40014;
const int IA... | ALGO | 0.997329 | 3.906904 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2019-03-30T17:14: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": "a289544e10... |
a637ed98-e23c-4e9e-8250-41aba2c39c7c | DmitryUSB/HackerRank | Jumping on the Clouds/UnitTest1/unittest1.cpp | #include "stdafx.h"
#include "CppUnitTest.h"
#include "../Jumping on the Clouds/Source.cpp"
using namespace Microsoft::VisualStudio::CppUnitTestFramework;
namespace UnitTest1
{
TEST_CLASS(UnitTest1)
{
public:
TEST_METHOD(Test1)
{
std::vector<int> input = { 0, 0, 0, 0, 0, 0, 0 };
int expect = 3;
A... | TEST | 0.986302 | 5.363231 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2019-11-21T12:53: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": "131ce5a749... |
7aa34334-9ab2-4a69-b122-24fa0ff84dfa | EDPankina/OOP_LABS | laba5/src/main.cpp | #include "../lib/vector.h"
#include <map>
using namespace std;
int main() {
// мапа [x, факториал(x)]
std::map<int ,int, std::less<int>, lab5::allocator<std::pair<const int, int>>> mp;
mp[0] = 0;
mp[1] = 1;
for (int i = 2; i < 9; ++i) {
mp[i] = mp[i - 1] * i;
}
for (auto & [k, v]... | ALGO | 0.9189 | 3.374489 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2023-11-04T20:39: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": "b4cdc861d81... |
8c4778d5-6f80-49f8-a6c7-d7463fa7f545 | Abhii-Agarwal09/Data_Structures_And_Algorithms | 3-Sorting/mergeSort.cpp | #include <iostream>
using namespace std;
void merge(int arr[], int s, int e) {
int mid = (s+e)/2;
int len1 = mid - s + 1;
int len2 = e - mid;
int *first = new int[len1];
int *second = new int[len2];
int mainArrayIndex = s;
for (int i = 0; i < len1; i++) {
first[i] = arr[mainArrayIndex++];
}
m... | ALGO | 0.999928 | 5.453108 | {
"github_metadata": {
"branch": "main",
"commit_count": 25,
"repo_created_at": "2022-05-25T10:19: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": "5db852026c5... |
4abf8ae5-7224-40a9-9194-3710b37ba165 | RodrigoLiC/aed | icpc/Binary Tree Cameras/v1.cpp | // type:
// 0: sin camara (no cubierto)
// 1: cubierto por hijo
// 2: con camara (cubierto)
// aux -> pair<type, camera_count>
class Solution {
public:
int minCameraCover(TreeNode* root) {
if (!root) return 0;
pair<int, int> result = aux(root);
return result.second + (result.first == 0 ? 1 ... | ALGO | 0.999901 | 6.101133 | {
"github_metadata": {
"branch": "main",
"commit_count": 84,
"repo_created_at": "2024-08-26T22:14:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6a4c87c8eda... |
92f26604-6450-4b67-bd71-671e1ea04d07 | atatomir/work | _Codeforces/Manhan Codefest 2017/B/main.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <algorithm>
#include <cmath>
using namespace std;
#define mp make_pair
#define pb push_back
#define ll long long
#define maxN 100011
ll n, i, p, q, r;
ll a[maxN], le[maxN], ri[maxN];
int main()
{
//freopen("test.in","r",stdin);... | ALGO | 0.999854 | 3.270523 | {
"github_metadata": {
"branch": "master",
"commit_count": 302,
"repo_created_at": "2015-03-29T18:54: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": "68487b12... |
dc650dd1-8238-416e-ae79-87afeaea7793 | AMPROGGRAMER/codes | KnightTour.cpp | #include <iostream>
#include <iomanip>
#include <cstring>
using namespace std;
const int N = 8;
// All possible moves for a knight
int moveX[8] = { 2, 1, -1, -2, -2, -1, 1, 2 };
int moveY[8] = { 1, 2, 2, 1, -1, -2, -2, -1 };
// Check if position is valid and not yet visited
bool isValid(int x, int y, int board[N][N]... | ALGO | 0.999785 | 5.509115 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-05-28T02:49: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": "b468abb89769... |
8f6da455-e10d-4f2b-94c0-54cfc270d279 | msl-yvr/PracticeCode | arrays_week11_exercise1.cpp | #include "pch.h"
#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace System;
using namespace std;
void generarData(int* arreglo, int tam) {
cout << "Generando los datos del arreglo de forma aleatoria: " << endl;
for (int i = 0; i < tam; i++)
{
arreglo[i] = rand() % (100 - 1 + 1) + 1;
cout ... | ALGO | 0.997076 | 4.19628 | {
"github_metadata": {
"branch": "main",
"commit_count": 22,
"repo_created_at": "2024-10-08T00:09:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "46de18a5c09... |
78cf6d39-5928-417f-b13f-5942daa57543 | adnanaziz/EPIJudge | epi_judge_cpp_solutions/enumerate_palindromic_decompositions.cc | #include <algorithm>
#include <iterator>
#include <memory>
#include <string>
#include <vector>
#include "test_framework/generic_test.h"
using std::make_unique;
using std::string;
using std::vector;
bool IsPalindrome(const string&);
void DirectedPalindromeDecompositions(const string&, int, vector<string>*,
... | ALGO | 0.999158 | 6.807252 | {
"github_metadata": {
"branch": "master",
"commit_count": 191,
"repo_created_at": "2017-12-21T06:15:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2874,
"forks": 1899,
"issues": 47,
"pull_requests": 33
},
"file_meta": {
"content_id": "... |
ed589d7b-0e43-4222-a7d3-ba3f800b59ff | Flash-LHR/algorithm-contest-code | nk/23479/f/f.cpp | #include <bits/stdc++.h>
using namespace std;
template <typename T>
inline void scan(T& x) {
x = 0; int f = 1; char ch = getchar();
while(!isdigit(ch)) {if(ch == '-') f = -1; ch = getchar();}
while(isdigit(ch)) {x = x * 10 + ch - '0', ch = getchar();}
x *= f;
}
template <typename T>
void print(T x) {
if(x < 0) ... | ALGO | 0.999887 | 3.150807 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2022-12-23T05:30: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": "2bcf4b336bee... |
1d16cafa-7ea8-427a-83d8-61f93c11890a | k930503/coding-test | 백준/Gold/1707. 이분 그래프/이분 그래프.cc | #include <iostream>
#include <vector>
#include <queue>
using namespace std;
#define RED 1
#define BLUE 2
vector<vector<int>> graph;
vector<bool> visited;
vector<int> colors;
bool bfs(int vertex) {
queue<int> q;
q.push(vertex);
colors[vertex] = RED;
visited[vertex] = true;
while (!q.empty()) {
... | ALGO | 0.999992 | 5.483511 | {
"github_metadata": {
"branch": "main",
"commit_count": 236,
"repo_created_at": "2022-12-27T16:04: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": "90b02f7ab1... |
709aac43-8e3a-4536-b64b-76b82d6e497a | ishandutta2007/codeforces-a | al.cash/normal/611/A.cpp | #include <stdexcept>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <fstream>
#include <cassert>
#include <cstring>
#include <cstdarg>
#include <cstdio>
#include <random>
#include <cmath>
#include <ctime>
#include <functional>
#include <algorithm>
#include <complex>
#include <numeric>
#include <limi... | ALGO | 0.999464 | 3.474383 | {
"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": "e7325b3a579a... |
39d13c6f-a9e9-4dbf-b48c-ece98ffb3d4d | parallelcodefoundry/ParEval | drivers/cpp/benchmarks/geometry/11_geometry_convex_hull_perimeter/kokkos.cc | // Driver for 11_geometry_convex_hull_perimeter for Kokkos
// #include <Kokkos_Core.hpp>
//
// struct Point {
// double x, y;
// };
//
// double distance(Point const& p1, Point const& p2) {
// return std::sqrt(std::pow(p2.x-p1.x, 2) + std::pow(p2.y-p1.y, 2));
// }
//
// /* Return the perimeter of the smallest c... | ALGO | 0.987196 | 5.651611 | {
"github_metadata": {
"branch": "develop",
"commit_count": 41,
"repo_created_at": "2023-10-06T17:25:46.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 35,
"forks": 10,
"issues": 1,
"pull_requests": 1
},
"file_meta": {
"content_id": "7968b0e... |
5f3772cb-64f5-4189-aa3c-1da245cd937e | jerry3008/MyDataStructureJourney | Performance_Optimization_with_Unordered_Maps_in_C++/set_operations/delete_kth_find_3rd/main.cpp | #include <vector>
#include <string>
#include <utility>
#include <queue>
using namespace std;
std::vector<int> solution(const std::vector<int>& data, const std::vector<std::pair<std::string, int>>& queries) {
priority_queue<int, vector<int>, greater<int>>minheap(data.begin() , data.end());
std::vector<int> outp... | ALGO | 0.999721 | 5.261909 | {
"github_metadata": {
"branch": "main",
"commit_count": 82,
"repo_created_at": "2025-06-20T23:15: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": "c260c1b369d... |
68d733de-a40a-47a9-8e5e-ec586e7d283a | DaAlG/code_studying | jaeyeong/개인/c++/dijkstra/[백준]11779_최소비용 구하기 2.cpp | using namespace std;
#include <iostream>
#include <vector>
#include <queue>
#include <stack>
#define INF 0x3f3f3f3f
#define MAX 1001
int d[MAX], parent[MAX];
vector<pair<int, int>> bus[MAX]; //(도착도시, 비용)
void dijkstra(int start, int dest) {
priority_queue<pair<int,int>> q; // (-비용, 도시)
q.push(make_pair(0,start));
... | ALGO | 0.999995 | 3.766715 | {
"github_metadata": {
"branch": "master",
"commit_count": 1042,
"repo_created_at": "2020-09-13T08:06:41.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 5,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2993bb57... |
417f0907-d990-4c8f-a0b1-864e29e8972f | amaiable/blind75-cpp | Array/search_rotated_array.cpp | class Solution {
public:
int search(vector<int>& nums, int target) {
int l = 0;
int r = nums.size() - 1;
while (l <= r) {
int m = l + (r - l) / 2;
if (nums[m] == target) {
return m;
}
else if (nums[m] >= nums[l]) { // Check th... | ALGO | 0.999976 | 5.973635 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2022-03-17T11:23: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": "d30d7828bd46... |
40b89008-963e-41d4-b822-cb367ca79bb4 | AnqiYao/UIUC-CS | CS 225/potd/tree_traversal/main.cpp | #include <iostream>
#include <vector>
#include <cstddef>
using namespace std;
// Definition for a binary tree node.
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
};
int getHeight(TreeNode* root){
if(root == NULL) return -1;
else
return 1 + max(getHeight(root->left),getHeight(root->ri... | ALGO | 0.999951 | 5.874661 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2019-09-26T18:21: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": "ec0ed1f4c... |
019d1af4-3b00-40d0-9d47-bd73c7244b7b | taxijjang/algorithm | 1976.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int city[201][201];
int route[1001];
int main(void) {
int N, M;
scanf("%d %d", &N, &M);
int INF = 999999999;
for (int i = 1; i <= N; i++) {
for (int j = 1; j <= N; j++) {
if (i == j) {
city[i][j] = 0;
}
else {
city[i][j] = INF;
}
... | ALGO | 0.999995 | 4.140312 | {
"github_metadata": {
"branch": "master",
"commit_count": 678,
"repo_created_at": "2018-05-18T06:47:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "54ccbbc1... |
bd4ee457-57ed-4b5f-9e7e-6f229df13c9b | Muhammad-Ahmad17/cpp | DataStructure/vector/basic.cpp | /**
Copyright (c) 2024
Name: <NAME>.
Project Name: PF.
Date: 2024-08-30.
TIME: 12:25 AM.
*/
#include <iostream>
#include <vector>
using namespace std;
int main1() {
vector... | ALGO | 0.923961 | 3.636493 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2025-03-21T12:22:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cdf14fad9de... |
4a1905d1-57d5-430d-928e-acc442ca4821 | Hachimori/AdventOfCode | 2024/012/012-1.cpp | #include<bits/stdc++.h>
using namespace std;
int row, col;
vector<string> ch;
void read() {
string line;
while (cin >> line) {
ch.push_back(line);
}
row = ch.size();
col = ch[0].size();
}
void rec(int r, int c, vector<vector<bool>> &visited, int &area, int &perimeter) {
++area;
... | ALGO | 0.99934 | 4.280443 | {
"github_metadata": {
"branch": "master",
"commit_count": 125,
"repo_created_at": "2020-12-03T17:26:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "952f332c... |
84f69d04-38e4-4c1d-a9b2-732399e51dbf | k0michi/aoj | ITP2_11_C.cc | // Begin preamble
#include <algorithm>
#include <array>
#include <bitset>
#include <cmath>
#include <cstdint>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <numeric>
#include <queue>
#inclu... | ALGO | 0.999341 | 3.758345 | {
"github_metadata": {
"branch": "main",
"commit_count": 274,
"repo_created_at": "2021-08-31T13:53:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dfbf39eb72... |
9b92c1d4-cc3d-4f49-9b64-d4a8b60085ed | TiredAce/Awesome-Leetcode | 2435.矩阵中和能被-k-整除的路径.cpp | /*
* @lc app=leetcode.cn id=2435 lang=cpp
*
* [2435] 矩阵中和能被 K 整除的路径
*
* https://leetcode.cn/problems/paths-in-matrix-whose-sum-is-divisible-by-k/description/
*
* algorithms
* Hard (53.13%)
* Likes: 50
* Dislikes: 0
* Total Accepted: 8.5K
* Total Submissions: 16K
* Testcase Example: '[[5,2,4],[3,0,5]... | ALGO | 0.999959 | 6.188025 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-08-16T02:41: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": "43914a3b3b76... |
e6dcf6dd-c261-4cdb-b469-8df14786b475 | viralipurbey/CompetitiveProgramming-CN | str_recursion.cpp | #include<bits/stdc++.h>
using namespace std;
void replaceCharacter(char input[], char c1, char c2) {
if(input[0] == '\0'){
return;
}
if(input[0] != c1){
replaceCharacter(input + 1,c1,c2);
}
else{
input[0] = c2;
replaceCharacter(input + 1, c1 ,c2);
}
}
v... | ALGO | 0.999619 | 3.593687 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-12-28T04:49:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "928e6d1b51... |
9921765d-16fc-4e09-bbce-8d4df903e5c1 | DywangIT/PTIT-Programing | PTIT-C++/SO_SMITH.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define FASTER() ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
// Dywang //
#define N 1000005
vector<int> primes;
void sieve(){
vector<bool> isprime(N, true);
for(int i = 2; i * i <= N; i++){
if(isprime[i]){
... | ALGO | 0.999147 | 5.169329 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2025-03-21T05:23: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": "bef083f7799e... |
14da4580-2033-4ab9-9bea-c28ce7dffe8e | manwar/perlweeklychallenge-club | challenge-116/paulo-custodio/cpp/ch-1.cpp | /*
Challenge 116
TASK #1 - Number Sequence
Submitted by: <NAME>
You are given a number $N >= 10.
Write a script to split the given number such that the difference between two
consecutive numbers is always 1 and it shouldn't have leading 0.
Print the given number if it impossible to split the number.
Example
Input: ... | ALGO | 0.999649 | 5.42591 | {
"github_metadata": {
"branch": "master",
"commit_count": 44412,
"repo_created_at": "2019-03-30T01:15:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 194,
"forks": 332,
"issues": 5,
"pull_requests": 4
},
"file_meta": {
"content_id": "36... |
14c9e033-5818-41d8-8943-5ec636aa93e3 | niteshkumartiwari/daily-competitive-programming | Graph5-Word Ladder.cpp | /*
Given two words (beginWord and endWord), and a dictionary's word list, find the length of shortest transformation sequence from beginWord to endWord, such that:
Only one letter can be changed at a time.
Each transformed word must exist in the word list. Note that beginWord is not a transformed word.
Input:
beginWo... | ALGO | 0.999986 | 5.398335 | {
"github_metadata": {
"branch": "master",
"commit_count": 195,
"repo_created_at": "2019-08-28T16:49:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d8627aa6... |
67f64cc2-bf77-46e9-b370-5230e70788e4 | anaherthel/sarpfiles | AuxFiles/MDHDARP/mdhdarp/src/model/Route.h | #ifndef ROUTE_H
#define ROUTE_H
#include <algorithm>
#include <climits>
#include <fstream>
#include <iostream>
#include <queue>
#include <utility>
#include <vector>
#include "Data.h"
#include "Sequence.h"
#include "Utils.h"
#include "Vehicle.h"
using namespace std;
typedef pair<double, int> pdi;
class Route {
p... | ALGO | 0.932067 | 5.080201 | {
"github_metadata": {
"branch": "master",
"commit_count": 386,
"repo_created_at": "2019-11-28T11:14:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8f0552dd... |
5de60361-4c87-4d82-9ff1-fff5b1d82a38 | ecwu/COMP1013_SPGP | sourcecode/code/sort.cpp | #include "relay.h"
int sort() {
struct stu studentList[20];
struct stuNMarks studentMarks[20];
struct stuNSum studentSum[20];
int assignmentStatus[5] = { 0,0,0,0,0 };
int stuNumber = 0;
loadStudentList(studentList, &stuNumber);
if (loadStudentMarksforInquiry(studentMarks, &assignmentStatus[0], stuNumber) == -... | ALGO | 0.999211 | 3.991592 | {
"github_metadata": {
"branch": "master",
"commit_count": 60,
"repo_created_at": "2017-07-30T05:19:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f3ed0e07c... |
d94af8fe-3883-4744-8044-80bd094d167f | FootprintGL/algo | leetcode/98-validate-binary-search-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)... | ALGO | 0.999972 | 6.185389 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2020-06-14T01:34: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": "86f3a505e... |
84c7498f-d550-4dd1-a67c-e57af95d2bff | jh9amn/Master-DSA | GFG POTD/Largest_SubSquare_Surronded_By_X.cpp | //{ Driver Code Starts
// Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// User function Template for C++
class Solution {
public:
int largestSubsquare(int n, vector<vector<char>> a) {
// code here
int vert[n][n] = {0};
int hori[n][n] = {0}... | ALGO | 0.999682 | 5.741705 | {
"github_metadata": {
"branch": "main",
"commit_count": 450,
"repo_created_at": "2024-01-06T15:19:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bfc867ee9e... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.