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 |
|---|---|---|---|---|---|---|---|
5f4c4a02-94e7-4a11-8a12-8e0d2f0d2acd | ki-opt/AtCoder-ABC | ABC301-ABC400/ABC319/C/src/src.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <unordered_map>
#include <cmath>
#include <climits>
#include <string>
#include <queue>
using ull=unsigned long long;
using ll=long long;
using namespace std;
#define rep(iter, limit) for (int iter = 0; iter < (int)(limit); iter++)
#def... | ALGO | 0.99947 | 3.811205 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2023-02-05T05:00:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f9d0d2b5e... |
629f8457-8bbf-4b53-bdbd-9cb212f8e978 | Superbestron/CP-Journey | CP4/Mathematics/MatrixPower/linearrecurrence.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll MOD;
const int MAX_N = 41; // 2x2 for Fib matrix
struct Matrix { ll mat[MAX_N][MAX_N]; }; // we return a 2D array
ll mod(ll a, ll m) { return ((a % m) + m) % m; } // ensure positive answer
Matrix matMul(Mat... | ALGO | 0.999958 | 4.44546 | {
"github_metadata": {
"branch": "main",
"commit_count": 42,
"repo_created_at": "2022-10-28T13:51:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7c7260ed13a... |
b42f3dc2-bfb6-403f-a17d-8660d538f3ca | jcazevedo/leetcode | src/0956-tallest-billboard.cpp | // 956. Tallest Billboard
// https://leetcode.com/problems/tallest-billboard/
#include <algorithm>
#include <map>
#include <set>
#include <utility>
#include <vector>
using namespace std;
#define MAXSUM 5000
class Solution {
private:
map<int, int> getDiffs(vector<int>& rods, int from, int to) {
set<pair<int, ... | ALGO | 0.999892 | 5.85509 | {
"github_metadata": {
"branch": "master",
"commit_count": 709,
"repo_created_at": "2022-03-05T00:26: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": "3c95fb29... |
d0bf37e1-38c0-46c5-bff7-3164995dd3c6 | acguez/bamcp | bamcp2d/src/samplers/flat/LazyInfGridSampler.h | #pragma once
#include "sampler2D.h"
#include "utils/utils.h"
#include "InfGridSamplerFactory.h"
class LazyInfGrid;
class LazyInfGridSampler : public Sampler2D{
public:
LazyInfGridSampler(double gamma,
int** _ATobserved,
uint** _counts_col,
uint** _counts_row,
std::vector<Pair> *PairObserved,
... | ALGO | 0.916275 | 5.910871 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2013-02-05T15:35:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 17,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cc421dfb5... |
5741c06d-f696-4fc4-8edd-080ef7c27485 | Mseddikoo/video-tracker | execute_mod1_smooth.cpp | /*! \file execute.cpp
*
*
* \brief <b>Main stream of the program: here are called creatKalman,initKalman,extractBlob and the updateKalman functions</b>
*
*
* \author Copyright (C) 2005-2006 by <NAME> <<EMAIL>>
* and <NAME> <<EMAIL>>
* and <NAME> <<EMAIL>>
* This code is distributed under the t... | ALGO | 0.945328 | 3.834959 | {
"github_metadata": {
"branch": "master",
"commit_count": 338,
"repo_created_at": "2015-04-23T16:31:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 14,
"pull_requests": 0
},
"file_meta": {
"content_id": "85ae5f7... |
c5c734ee-2e9a-4937-b279-5416a6f76309 | t3nsor/SPOJ | dna.cpp | // 2008-07-23
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
string amino[64]={
"Phe","Ser","Tyr","Cys","Phe","Ser","Tyr","Cys","Leu","Ser","---","---","Leu","Ser","---","Trp",
"Leu","Pro","His","Arg","Leu","Pro","His","Arg","Leu","Pro","Gln","Arg","Leu","Pro","Gln","Arg",
"Ile","Thr... | ALGO | 0.999968 | 3.761119 | {
"github_metadata": {
"branch": "master",
"commit_count": 392,
"repo_created_at": "2014-10-08T22:07:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 248,
"forks": 102,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "49f6... |
100f153d-5783-41c5-a2c8-6fe30920fafb | Jvalencia330/ActividadSisope1 | Actividad_Clase_Sisope.cpp | #include <iostream>
#include <string.h>
using namespace std;
void actividad1(){
int val1 = 10;
int* puntero = &val1;
cout << "Valor de la variable: " << val1 << endl;
cout << "Direccion de memoria de la variable: " << puntero << endl;
*puntero = 20;
cout << "Valor de la variable modificado: " ... | ALGO | 0.984306 | 3.748386 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-09-25T22:14: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": "ffbeade22078... |
d435895a-becf-4d04-a692-759ac9022765 | kodack64/Q3DE | fig10_q3de_throughput/src/main.cpp | // Copyright 2022 NTT CORPORATION
#include <iostream>
#include <vector>
#include <random>
#include <string>
#include <cassert>
#include <queue>
#include <fstream>
#include <algorithm>
#ifdef _MSC_VER
//#define VISUALIZE
#include <Windows.h>
void setMyCursorPos(int x, int y) {
HANDLE hCons = GetStdHandle(STD_OUTPU... | ALGO | 0.998797 | 4.214569 | {
"github_metadata": {
"branch": "main",
"commit_count": 41,
"repo_created_at": "2022-07-29T05:25:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "11e4c18371e... |
74c70d0c-c71e-4429-9fe8-a61298d4fa8b | NUbots/NUbots | module/support/optimisation/NSGA2Optimiser/src/nsga2/Individual.cpp | /*
* MIT License
*
* Copyright (c) 2024 NUbots
*
* This file is part of the NUbots codebase.
* See https://github.com/NUbots/NUbots for further info.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
... | ALGO | 0.997708 | 5.909869 | {
"github_metadata": {
"branch": "main",
"commit_count": 9901,
"repo_created_at": "2014-09-08T21:30:48.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 33,
"forks": 17,
"issues": 64,
"pull_requests": 67
},
"file_meta": {
"content_id": "ca9c66... |
15186db7-eef5-4971-adac-49c5a95398a5 | lballabio/quantlib-old | QuantLib/ql/pricingengines/vanilla/analyticptdhestonengine.cpp | /* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
Copyright (C) 2010 <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.999904 | 7.030997 | {
"github_metadata": {
"branch": "master",
"commit_count": 18714,
"repo_created_at": "2013-06-06T07:47:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 473,
"forks": 399,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6a... |
d42d8710-0a1e-4ce0-abf5-947ccbb98e06 | DEBOROY-1234/C-PRACTICE-VSCODE | prac88.cpp | //determinant of a 3x3 matrix
#include<iostream>
using namespace std;
#define M00 a[0][0]
#define M01 a[0][1]
#define M02 a[0][2]
#define M10 a[1][0]
#define M11 a[1][1]
#define M12 a[1][2]
#define M20 a[2][0]
#define M21 a[2][1]
#define M22 a[2][2]
int main(){
int determinant;
int a[3][3];
cout<<"to checko... | ALGO | 0.999936 | 4.371414 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2023-02-13T10:13:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0598665cb5... |
b9de5fdc-635c-4344-b0a4-7273e24c9ab6 | tonxdean/Projects | Hash Table/Hash.h | #ifndef Hash_h
#define Hash_h
#include <vector>
#include <string>
#include <iostream>
//the node class that is used to make the singly linked lists for the hash table
class Node
{
//this class stores a pointer to the next element in the list, a string value, and a vector of the locations the string is found
public:... | ALGO | 0.971722 | 5.030383 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2018-09-18T16:35:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5c8e34428... |
c4d3e1f8-f666-4571-9f7d-0b247c5c51c7 | skymer156/atcoder_storage_skymer | 205/abc205c.cpp | #include <iostream>
#include <cstdlib>
#include <cmath>
using namespace std;
int main()
{
long A,B,C ;
cin >> A >> B >> C;
if(C % 2 == 0){
if(abs(A) < abs(B)){
cout << '<' << endl;
}else if(abs(A) == abs(B)){
cout << '=' << endl;
}else{
cou... | ALGO | 0.999993 | 4.18852 | {
"github_metadata": {
"branch": "main",
"commit_count": 29,
"repo_created_at": "2021-05-23T08:09: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": "83917e6adc8... |
cd80c210-7942-4784-a564-a0f7b27b6869 | wengsht/Speech-Recognition-System-of-Spoken-Digits | src/Feature/HMMSeqKMeanTrainer.h | // =====================================================================================
//
// Filename: HMMSeqKmeanTrainer.h
//
// Description:
//
// Version: 0.01
// Created: 2014/11/19 08时45分06秒
// Revision: none
// Compiler: clang 3.5
//
// Author: wengsht (SYS... | ALGO | 0.950285 | 5.384512 | {
"github_metadata": {
"branch": "master",
"commit_count": 81,
"repo_created_at": "2014-09-11T11:33:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0fb9996e5... |
38af4833-d145-45d2-af52-9c5e2985ba0a | BrianOkonner/Portfolio | С++(asse)(Java)/Нераспределённое/лаб_2/К_лаб_2_7/Примеры чужих лаб/8 группа/Андреев Д.А/Лабораторная 2_1/1_2 (соседи).cpp | /*
<NAME> 8 группа
Лабораторная 2_1
Задание 1_2: найти количество элементов стека, у которых равные соседи. использовать стандартный стек
Вводим элементы с клавиатуры и кладем их в стек.
В цикле достаем элемент из стека, сохраняем, следующий, сохраняем,
достаем, сравниваем следующий с первым, если равны, увеличиваем
... | ALGO | 0.998879 | 3.333675 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-11-01T23:40: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": "4fb6ea71df02... |
78609e32-4bf9-4c47-a289-c704108cc5ad | marbogusz/EvolBiol | IndelEstimator/src/core/OptimizedModelParameters.cpp | /*
* OptimizedModelParameters.cpp
*
* Created on: Jun 17, 2014
* Author: root
*/
#include "core/OptimizedModelParameters.hpp"
namespace EBC
{
OptimizedModelParameters::OptimizedModelParameters(SubstitutionModelBase* sm, IndelModel* im, unsigned int sCount, unsigned int dCount,
bool se, bool ie, bool ae,... | ALGO | 0.976133 | 5.796247 | {
"github_metadata": {
"branch": "master",
"commit_count": 195,
"repo_created_at": "2014-02-26T15:33:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "36c993ca... |
ecc014b5-33ae-466a-a39a-5816a029a029 | attilaz/horde3d-x | Horde3D/Samples/Chicago/crowd.cpp | // *************************************************************************************************
//
// Horde3D
// Next-Generation Graphics Engine
//
// Sample Application
// --------------------------------------
// Copyright (C) 2006-2011 <NAME>
//
//
// This sample source file is not covered by the EPL as the r... | ALGO | 0.997029 | 5.464839 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2013-04-19T05:28:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 81,
"forks": 22,
"issues": 5,
"pull_requests": 0
},
"file_meta": {
"content_id": "82597dbc... |
8ffe4b81-3775-463c-876c-4fa50f7ef61e | a7a7-7/BOJ | 백준/Gold/20040. 사이클 게임/사이클 게임.cc | #include<iostream>
#include<vector>
using namespace std;
vector<int> parent;
int n, m;
int i;
int find(int a) {
if (a == parent[a])
return a;
else
return parent[a] = find(parent[a]);
}
bool union_find(int a, int b) {
a = find(a);
b = find(b);
if (a == b)
return true;
... | ALGO | 0.999937 | 3.103084 | {
"github_metadata": {
"branch": "main",
"commit_count": 145,
"repo_created_at": "2025-03-19T15:36: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": "fe18b6ed60... |
d042eb82-39e0-4186-ab42-d3bd809e8ce6 | hfudev/leetcode-cpp | 38.count-and-say.cpp | /*
* @lc app=leetcode id=38 lang=cpp
*
* [38] Count and Say
*
* https://leetcode.com/problems/count-and-say/description/
*
* algorithms
* Easy (39.85%)
* Total Accepted: 267.7K
* Total Submissions: 671.5K
* Testcase Example: '1'
*
* The count-and-say sequence is the sequence of integers with the first ... | ALGO | 0.999962 | 6.59472 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2019-02-22T23:04:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ad0df4528... |
48a106c8-64fb-41f0-8cfa-7f0d12fca957 | vaarigupta/DSA_practice | Practice_Codes/2D_ARRAYS/Matrix_Search.cpp | #include<iostream>
using namespace std;
bool matrixSearch(int a[][30], int n, int m,int key)
{
///staircase search
int i=0, j=m-1;
while(i<n && j>=0)
{
if(a[i][j]==key)
{
return 1;
}
else if (a[i][j]<key)
{
i++;
}
else
... | ALGO | 0.999969 | 3.447764 | {
"github_metadata": {
"branch": "master",
"commit_count": 79,
"repo_created_at": "2019-06-13T20:54:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d4cecd639... |
52a77f5e-e866-457a-a32a-d0d33fd246bc | Dhruv-Limbani/Data-Structures | 1_Arrays/2_array_medium/2_sort_0_1_2s.cpp | #include <bits/stdc++.h>
using namespace std;
/*
Problem Statement: Given an array consisting of only 0s, 1s, and 2s.
Write a program to in-place sort the array without using inbuilt sort functions.
( Expected: Single pass-O(N) and constant space)
*/
void brute_force(int *arr, int n){
// bubble, insert... | ALGO | 0.999966 | 5.118457 | {
"github_metadata": {
"branch": "master",
"commit_count": 156,
"repo_created_at": "2022-08-21T10:25: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": "72d7b607... |
5febe1bd-cc40-49aa-a57c-59db7e56cfd3 | tolik747/progranovanie_tuke | PS6/mastermind.cpp | #include <Arduino.h>
#include "mastermind.h"
#include "lcd_wrapper.h"
#include <stdlib.h>
#include <time.h>
#include <string.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 2);
char* generate_code(bool repeat, int length)
{
lcd.begin();
if (length < 1 || (!repeat && length > 10)) {
ret... | TOOL | 0.908939 | 3.385097 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2024-03-06T14:19: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": "a0edc360df7... |
a9facbcf-c577-4dac-b754-1434d0bf0378 | haRsh-cse-rgb/DSA | Array/reverse_array.cpp | #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
void display(vector<int> arr , int size){
for(int i=0 ; i<size ; i++){
cout<<arr[i];
}
}
int main()
{
vector<int> arr={1,2,3,4,5,6,7};
display(arr,arr.size());
cout<<endl;
reverse(arr.begin(),arr.end());
display(arr,ar... | ALGO | 0.998285 | 4.942018 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2022-06-06T05:41: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": "a9f3198e0a... |
ecc8ce08-4e63-41fa-898c-77dcedebeca3 | Rishabhltfb/DSA | codechef/july_challenge/chefina_and_swaps/temp.cpp | #include <iostream>
#include <bits/stdc++.h>
#include <algorithm>
#define fo(i, n) for (long int i = 0; i < n; i++)
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
long int T, N;
cin >> T;
fo(i, T)
{
cin >> N;
long int cost = 0, x, minimum, fou... | ALGO | 0.999969 | 3.839617 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2020-07-22T08:36: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": "ba370ffa53... |
eebeee24-0e84-4ea1-9eb4-5050902112b4 | LyTruongsinh/DSA | Algorithms/Graph_Agorithms/Kahm.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <limits.h>
#include <cstring>
#include <stack>
#define MAX 1001
using namespace std;
int Soluongdinh;
int Soluongcanh;
vector<int> adj[MAX];
bool visited[MAX];
vector<int> topo;
int ban... | ALGO | 0.999991 | 4.699547 | {
"github_metadata": {
"branch": "main",
"commit_count": 95,
"repo_created_at": "2025-02-25T13:54:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f8b11c2b240... |
71195dbe-1ccf-46e5-b794-eac6edf9f592 | powder2005/etohari | codemely/code4.cpp | // Code mely
// quy hoạch động cái túi cơ bản phiên bản tối ưu bộ nhớ hơn nữa :>
#include "bits/stdc++.h"
using namespace std;
const int MAXN = 1e3 + 10;
const int MAXM = 1e3 + 10;
int n, m, w[MAXN], v[MAXN], dp[MAXM];
int main() {
cin >> n >> m;
for (int i = 1; i <= n; i++) {
cin >> w[i] >> v[i];
... | ALGO | 0.999996 | 4.22002 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2022-11-09T10:45: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": "cb1acfb82e0... |
c3d3ba9c-296c-41c9-be9a-9675e4e348fa | henrique4d/Competitive | legado/Others/inf333/atividade7/H.cpp | #include <bits/stdc++.h>
using namespace std;
int dfs(vector<vector<int>> &M, vector<vector<int>>&dp, int i, int j, int cont){
//cout << i << " " << j << " " << dp[i][j] << endl;
if (dp[i][j] != -1) return dp[i][j];
if (M[i][j] == INTMAX_MAX) return -1;
dp[i][j] = 1;
if (M[i-1][j] < M[i][j]){... | ALGO | 0.999895 | 4.01199 | {
"github_metadata": {
"branch": "master",
"commit_count": 25,
"repo_created_at": "2022-04-10T00:27: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": "5b3199e68... |
f944a6bb-7497-418b-aaf6-f32d148073cd | raincross7/code-similarity | codes/train_code/problem500/problem500_89.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(long long i=0; i<(int)n; i++)
#define rep2(i,a,n) for(long long i=(a); i<(int)(n); i++)
#define all(vec) vec.begin(),vec.end()
using ll = long long;
using vi = vector<int>;
using vs = vector<string>;
using vvi = vector<vi>;
using vll = vector<ll>;
using... | ALGO | 0.999748 | 3.448704 | {
"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": "b9cc67750805... |
6ef0f293-fea1-41fd-826c-07b589ced786 | HeroJho/BaeckJoon | 백준/Gold/14503. 로봇 청소기/로봇 청소기.cc | #include <iostream>
#include <vector>
#include <queue>
using namespace std;
struct RobotInfo
{
pair<int, int> Pos;
int Dir;
};
int N, M;
int Matrix[51][51] = { 0 };
// 북 동 남 서
int DirX[] = { 0, 1, 0, -1};
int DirY[] = { -1, 0, 1, 0};
RobotInfo Robot;
bool IsIn(int X, int Y)
{
return X >= ... | ALGO | 0.999981 | 4.65778 | {
"github_metadata": {
"branch": "main",
"commit_count": 626,
"repo_created_at": "2023-03-20T03:54: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": "4d67bd9844... |
044eecc6-fa8d-4d5b-a9ea-840f9167fd22 | i-amritpal/Planet-Hijack | library project.cpp | // Actual Library Management Project
#include<iostream>
#include<cstring>
using namespace std;
struct information
{
char *name;
public:
information()
{
name = new char[strlen("dummy")];
strcpy(name, "dummy");
}
};
struct book
{
information info;
book *next;
book(char *n)
{
info.name = new cha... | TOOL | 0.995782 | 3.696757 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2016-10-15T09:29:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9e81d6a3b... |
a0e86bf8-1553-4722-8749-ddd71627cf5c | uddeepk/ProjectEuler | 8-largest-product-in-a-series.cpp | //Problem 8 Project Euler
//Largest product in a series
#include <iostream>
#include <fstream>
#include <vector>
#include <deque>
using namespace std;
long product( deque <int> d) {
long p = 1;
for(auto it = d.begin() ; it != d.end() ; ++it) {
p*= *it;
}
return p;
}
int main () {
//Take input
ifstr... | ALGO | 0.999808 | 4.786725 | {
"github_metadata": {
"branch": "main",
"commit_count": 22,
"repo_created_at": "2021-01-24T05:46: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": "89681d6e9b6... |
de6999c8-bd3b-46b7-bb1e-0fdd1f9f9d1a | dreyus95/AVSP_SourceQualityPrediction | CodeJamCrawler/dataset/13_11057_115.cpp | #include <stdio.h>
#include <cstdlib>
#include <cstring>
#include <cmath>
__int64 hh[500005];
int a[1005];
int cnt;
int tmp[1005];
bool isf(__int64 n)
{
int u=0;
while(n>0)
{
a[u++]=n%10;
n=n/10;
}
bool r=1;
for(int i=0;i<u;i++)
if(a[i]!=a[u-1-i]){r=0;break;}
... | ALGO | 0.999718 | 4.092015 | {
"github_metadata": {
"branch": "master",
"commit_count": 70,
"repo_created_at": "2017-06-08T21:00: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": "6aa04aacb... |
2099d2d2-bff1-4fe3-afbc-2f8aa89f6d44 | yoimiya-0621/exercises | 牛客周赛/牛客周赛/24_8_4.cpp | //#include <iostream>
//#include <map>
//#include <algorithm>
//using namespace std;
//#define ll long long
//const int N = 1e5 + 10;
//ll a[N];
//int main()
//{
// ll n, m;
// map<ll, ll>mp;
// cin >> n >> m;
// ll x;
// for (int i = 0; i < n; i++)
// {
// cin >> a[i];
// }
// sort(a, a ... | ALGO | 0.999919 | 3.93997 | {
"github_metadata": {
"branch": "master",
"commit_count": 178,
"repo_created_at": "2024-04-05T05:37: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": "85bf0aa4... |
387644c5-7f4e-4fd6-ad62-82fad91ef15c | hariharanragothaman/cppmaster | 101/move_semantics/copy_vs_move.cpp | #include "bits/stdc++.h"
using namespace std;
/*
* 1. If we create a new object based on an existing one, the copy semantic will copy the elements of the existing resource,
* whereas the move semantic will move the elements of the resource.
* 2. What are the additional consequences?
* With the copy s... | TOOL | 0.954479 | 4.086029 | {
"github_metadata": {
"branch": "master",
"commit_count": 230,
"repo_created_at": "2019-05-11T05:34:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d228e9c5... |
3235c57a-b133-41c6-b89e-597e41ca04bb | pnv2003/competitive-programming | uva/11078.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <climits>
using namespace std;
#define FASTIO ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define FILEIO freopen("input.txt", "r", stdin), freopen("output.txt", "w", stdout)
int main(int argc, char const *argv[])
{
FASTIO;
int t;
... | ALGO | 0.999942 | 4.157408 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-06-12T14:28: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": "0536ca722878... |
90b24c75-f7e1-472e-a439-2878ca8ab384 | keyuzh/ics45c | exercise3/app/example5.cpp | #include "example5.hpp"
void addAll(int* target, int* source, unsigned int size)
{
for (unsigned int i = 0; i < size; ++i)
{
target[i] += source[i];
}
}
int findMax(int* a, unsigned int size)
{
int result = a[0];
for (unsigned int i = 1; i < size; ++i)
{
if (a[i] > result)
... | ALGO | 0.9555 | 4.384327 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2021-01-05T05:14:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3632209d3b... |
36936aed-ed5f-4fe9-b7b6-074ee59fe158 | AdityaDargan/all-codes | dp/0-1 knapsack.cpp | #include <iostream>
#include <vector>
#include <climits>
using namespace std;
vector<int> w;
vector<int> val;
// int f(int i,int maxw,vector<vector<int>> dp){
// if(dp[i][maxw]!=-1){
// return dp[i][maxw];
// }
// if(i==0){
// if(w[0]<=maxw){
// dp[0][maxw] = val[0];
// ... | ALGO | 0.999982 | 3.951395 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2024-07-07T11:55: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": "b74c5cdbc... |
4bac4e3b-bd78-4fa8-9439-f385062ea63a | 3klxi/hash-functions | SHA-512.cpp | #include "SHA-512.h"
// sha512填充
std::vector<uint8_t> sha512_pad(const std::string& message) {
std::vector<uint8_t> padded(message.begin(), message.end());
uint64_t bit_len = message.size() * 8;
// 追加bit 1
padded.push_back(0x80);
// 追加bit 0,直至896
while ((padded.size() % 128) != 112) {
... | ALGO | 0.955488 | 5.377025 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2024-11-30T09:57: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": "01f7084b99a... |
6a534f06-cecc-490a-be57-d881a940d4db | OVALInterpreter/ovaldi | src/ArithmeticFunction.cpp | //
//
//****************************************************************************************//
// Copyright (c) 2002-2014, The MITRE Corporation
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification, are
// permitted provided that the following conditions are ... | TOOL | 0.969819 | 6.443999 | {
"github_metadata": {
"branch": "master",
"commit_count": 1545,
"repo_created_at": "2018-08-15T00:35:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 12,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3f2127... |
1050c8ca-5d31-4a42-987a-68e9ced17d32 | captainys/public | src/ysgebl/src/gui/airfoil/ysairfoil_lens.cpp | /* ////////////////////////////////////////////////////////////
File Name: ysairfoil_lens.cpp
Copyright (c) 2017 <NAME>. All rights reserved.
http://www.ysflight.com
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Red... | ALGO | 0.910929 | 3.644036 | {
"github_metadata": {
"branch": "master",
"commit_count": 527,
"repo_created_at": "2018-12-18T22:09:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 35,
"forks": 10,
"issues": 7,
"pull_requests": 0
},
"file_meta": {
"content_id": "2bf311... |
8a4ae247-d156-4676-9f2b-0018d3c89a54 | hljeong/cp | kattis/thekingofthenorth.cpp | #include <bits/stdc++.h>
#define A first
#define B second
#define vc vector
using namespace std;
using ll = long long; using ld = long double;
using vi = vc<int>; using vll = vc<ll>;
using si = set<int>; using sll = set<ll>;
using pii = pair<int, int>; using mii = map<int, int>;
using gr = vc<vi>;
template<class T> bo... | ALGO | 0.999793 | 4.64174 | {
"github_metadata": {
"branch": "main",
"commit_count": 71,
"repo_created_at": "2022-03-04T08:01:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3dab1dddb4d... |
c57e3173-0492-4337-9735-6a32dfb7b407 | hiratasa/atcoder | cpp/acl1/b.cpp | #include <bits/stdc++.h>
#include <atcoder/math>
#include <boost/range/adaptors.hpp>
#include <boost/range/irange.hpp>
using namespace std;
using namespace boost;
using namespace boost::adaptors;
using namespace atcoder;
int64_t test(int64_t a, int64_t b) {
auto [y, z] = crt({0L, -1L}, {a, b});
if (y == 0 &... | ALGO | 0.999943 | 4.41513 | {
"github_metadata": {
"branch": "master",
"commit_count": 757,
"repo_created_at": "2020-10-24T11:43: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": "9307860a... |
1863dc72-482b-4639-a055-9ac8e47c26dc | JosephZ7/ACM | ACM/dfs序和树链剖分/hdu6162.cpp |
#include <stdio.h>
#include <stdlib.h>
#include <cmath>
#include <string.h>
#include <string>
#include <queue>
#include <map>
#include <stack>
#include <algorithm>
#include <iostream>
#define LL long long
#define INF 0x7fffffff
//#pragma comment(linker, "/STACK:1024000000,1024000000")
using namespace std;
const int MA... | ALGO | 0.999966 | 3.648607 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2017-08-23T08:00: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": "c05b88b337... |
7aa910bf-4e5b-4bd8-be3b-0bbfe9241078 | cubercsl/The-road-to-ACMer | NowCoder/89/B.cpp | #include <bits/stdc++.h>
using namespace std;
#define clr(a, x) memset(a, x, sizeof(a))
#define mp(x, y) make_pair(x, y)
#define pb(x) push_back(x)
#define X first
#define Y second
#define fastin \
ios_base::sync_with_stdio(0); \
cin.tie(0);
typedef long long ll;
typedef long double ld;
typed... | ALGO | 0.999625 | 4.706297 | {
"github_metadata": {
"branch": "master",
"commit_count": 611,
"repo_created_at": "2017-04-28T00:42:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 54,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a13b011... |
c9be77ae-b75b-4179-b26a-10e032b8695f | swarren/advent-of-code-2020 | c++/day4b.cpp | #include <algorithm>
#include <cstring>
#include <fstream>
#include <iostream>
#include <unordered_map>
#include <set>
#include <sstream>
#include <string>
#include <vector>
using Passport = std::unordered_map<std::string, std::string>;
using Input = std::vector<Passport>;
Input readParseInput(std::string fileName) {... | ALGO | 0.992542 | 5.812777 | {
"github_metadata": {
"branch": "master",
"commit_count": 106,
"repo_created_at": "2021-01-20T04:38: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": "4b691b0b... |
a5525abc-f964-4de9-b23a-df1e3825c8e3 | engelin/GnuRadio_802-11 | gr-data_equalizing/lib/include/decode_mac.h | #ifdef DECODEMAC_H
#define ROK 0
#define D_K 48*35
#define D_L 6
#define D_POW_2_L 64
#define D_N 2
#define D_POW_2_N 4
#define D_M 1
#define D_POW_2_M 2
#define D_STAGE K/M
#define D_LEN_CODE STAGE*N
#define D_TRUNC_LEN 6
unsigned char m_stream_2_code[D_POW_2_L*D_POW_2_M][D_N] = {0, };
unsigned int m_next_state[D_P... | ALGO | 0.99874 | 4.433045 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2017-05-11T09:53:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "affd59a4fe... |
3849e5de-9cea-4ec1-83d5-f132436c3f92 | gtkn/atcoder | ABC_304_G.cpp | //title
#include <bits/stdc++.h>
using namespace std;
//#include <atcoder/all>
//using namespace atcoder;
#define rep(i,n) for (ll i = 0; i < (n); ++i)
#define rep1(i,n) for (ll i = 1; i <= (n); ++i)
#define repr(i,n) for (ll i = (n)-1; i >= 0; --i)
#define rep1r(i,n) for (ll i = (n); i > 0; --i)
#define bit(n,k) ((n>>... | ALGO | 0.999947 | 3.90464 | {
"github_metadata": {
"branch": "main",
"commit_count": 421,
"repo_created_at": "2022-03-15T05:19: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": "968c1a9a85... |
997a472e-7afe-4c7e-89bc-f8873d9e6b47 | yahiafarghaly/StandfordAlgorithms-1-Coursera | QuickSort/src/QuickSort.cpp | /*
============================================================================
Name : QuickSort.c
Author : YF
Version :
Copyright : Your copyright notice
Description : QuickSort in C, Ansi-style
============================================================================
*/
#include <iostre... | ALGO | 0.99993 | 5.294538 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2018-11-21T17:52: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": "ea4848cb0... |
6520b829-8398-4465-8f17-c3d42200bf45 | purdue-cap/DryadSynth | dryadsynth/StarExec/src/z3/src/util/lp/nra_solver.h | /*
Copyright (c) 2017 Microsoft Corporation
Author: <NAME>
*/
#pragma once
#include "util/vector.h"
#include "util/lp/lp_settings.h"
#include "util/rlimit.h"
#include "util/params.h"
#include "nlsat/nlsat_solver.h"
namespace lp {
class lar_solver;
}
namespace nra {
class solver {
struct imp;
... | TOOL | 0.990694 | 6.279778 | {
"github_metadata": {
"branch": "master",
"commit_count": 628,
"repo_created_at": "2020-02-24T07:23:23.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 28,
"forks": 6,
"issues": 1,
"pull_requests": 7
},
"file_meta": {
"content_id": "e982b9d6... |
54826d5b-9ca8-49d8-b797-3559ce6f5788 | emost22/cpp-boj | greedy/2879.cpp | #include <iostream>
#include <algorithm>
#define MAX 1000
using namespace std;
int list[MAX];
int N;
void func() {
int ans = 0;
for (int i = 0; i < N; i++) {
while (list[i]) {
int minValue = list[i];
int j = i + 1;
for (; j < N; j++) {
if (!list[j] || (minValue > 0 && list[j] < 0) || (minValue < 0 &&... | ALGO | 0.999989 | 3.888636 | {
"github_metadata": {
"branch": "main",
"commit_count": 3886,
"repo_created_at": "2020-10-21T12:31: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": "6d100e625... |
5e9f4a71-79a8-47c5-8766-4bab98c6786b | scipopt/soplex | src/soplex/spxsteeppr.h | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the class library */
/* SoPlex --- the Sequential object-oriented simPlex. */
... | ALGO | 0.997428 | 7.078173 | {
"github_metadata": {
"branch": "master",
"commit_count": 5578,
"repo_created_at": "2021-04-09T09:46:32.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 68,
"forks": 23,
"issues": 10,
"pull_requests": 1
},
"file_meta": {
"content_id": "4ef38... |
a196d491-1884-4ac0-9581-cd8f04daf31b | PuneetSharma9999/c_plusplus | cgpa_calculatorr.cpp | #include <iostream>
using namespace std;
int main() {
int numSubjects;
float percentages[100], totalPercentage = 0.0, cgpa;
cout << "Enter the number of subjects: ";
cin >> numSubjects;
if (cin.fail() || numSubjects <= 0 || numSubjects > 100) {
cout << "Invalid number of subjects! Please ... | TOOL | 0.964832 | 3.95208 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2024-01-27T17:53:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0792c04e362... |
a0f8f4d7-7c5b-4008-bbdb-2382a3193c64 | xanderlifeftoahacked/alg_hw | alg_hw/contest_11/A.cpp | #include <bits/stdc++.h>
using namespace std;
#define INF 1e18
#define ll long long
int main() {
int N, S, F;
cin >> N >> S >> F;
S--;
F--;
vector<vector<int>> graph(N, vector<int>(N));
for (int i = 0; i < N; ++i) {
for (int j = 0; j < N; ++j) {
cin >> graph[i][j];
}
}
vector<ll> dist(N,... | ALGO | 0.999888 | 4.416614 | {
"github_metadata": {
"branch": "main",
"commit_count": 24,
"repo_created_at": "2024-10-25T00:01: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": "865430e52e5... |
f713c7f1-ac04-47fa-863b-2a722bae867d | ngthanhvinh/competitive-programming | mipt18/code/day5/g/g.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 100005;
int n, m, a[N];
string s, t;
int f[N], nxt[N][2];
vector <int> vec[2];
bool valid(int l, int r) {
if (l > r) return true;
int diff = f[r] - f[l - 1];
return diff == 0 || diff == r - l + 1;
}
int main() {
ios_base::sync_with_stdio(false); cin.ti... | ALGO | 0.999998 | 4.082363 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2019-03-17T15:19:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b90af05b0... |
7a622bfc-a5e1-44e5-bcfd-8986b140f2a0 | Niteshkrjhag/RTG_DSA_Concept | DSA_Concept/pathIII.cpp | class Solution {
public:
// Here we define a helper function called DFS (Depth-First Search).
// It is our path checker for each node in the tree and determines
// the number of paths starting from this node that add up to `ts` (target sum).
unsigned int DFS(TreeNode* root, int ts) {
// F... | ALGO | 0.999997 | 6.376009 | {
"github_metadata": {
"branch": "dsa",
"commit_count": 14,
"repo_created_at": "2024-10-08T02:27: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": "7444707baed1... |
a0c6ecc2-034e-4f60-9be0-33666347387d | mirinta/leet_code | dynamic_programming/knapsack/0-1/2787_ways_to_express_an_integer_as_sum_of_powers.cpp | #include <cmath>
#include <vector>
/**
* Given two positive integers n and x.
*
* Return the number of ways n can be expressed as the sum of the xth power of unique positive
* integers, in other words, the number of sets of unique integers [n1, n2, ..., nk] where n = n1^x
* + n2^x + ... + nk^x.
*
* Since the re... | ALGO | 0.999933 | 6.350943 | {
"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": "e319d69... |
efffbd34-7435-4722-8f6f-f9ea8cdcf537 | halfprice/foundationdb | fdbclient/CoordinationInterface.h | /*
* CoordinationInterface.h
*
* This source file is part of the FoundationDB open source project
*
* Copyright 2013-2018 Apple Inc. and the FoundationDB project authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You ... | TOOL | 0.914931 | 3.464074 | {
"github_metadata": {
"branch": "master",
"commit_count": 14629,
"repo_created_at": "2021-02-01T22:31:07.000Z",
"is_fork": true,
"is_org_owned": false,
"forked_from": "apple/foundationdb",
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"conte... |
26475bfd-3b7f-4fc0-beb3-87934972f3e3 | himanshu864/DSA_CPP | String/addSubFraction.cpp | #include <iostream>
#include <vector>
using namespace std;
class Solution
{
int gcd(int a, int b)
{
a = abs(a);
int ans = 1;
for (int i = 2; i <= min(a, b); i++)
{
while (a % i == 0 && b % i == 0)
{
a /= i;
b /= i;
... | ALGO | 0.999826 | 5.633054 | {
"github_metadata": {
"branch": "main",
"commit_count": 229,
"repo_created_at": "2024-04-13T16:29: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": "da7c527a50... |
4c1c33f1-4e00-45a9-8c01-21d454daa977 | Josue-Chango/Grupo_Estructuras | Primer parcial/Lista_Simple-Proyecto/Ordenamiento.h | #include <iostream>
#include <stdio.h>
#include <vector>
#include <algorithm>
#include "Coche.h"
#include "Lista.h"
#include <functional>
#include <cmath>
template <typename T, typename Comparator>
int partition(std::vector<T>& lista, int low, int high, Comparator comp) {
T pivot = lista[high];
int i = low - 1... | ALGO | 0.998107 | 5.148655 | {
"github_metadata": {
"branch": "main",
"commit_count": 177,
"repo_created_at": "2024-11-07T14:35: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": "67ccc00daf... |
e731007d-bf6c-4433-b89c-e90c62cee4d4 | Drishti814/DSA | Binary Search/BS on Answers/nthRoot.cpp | #include<iostream>
#include<vector>
#include<algorithm>
#include<climits>
#include<math.h>
using namespace std;
int powNum(int i, int num, int n){
long long ans = 1;
for(int j = 1;j<=n;j++){
ans *= i;
if(ans>num) return 2;
}
if(ans==num) return 1;
return 0;
}
//brute force
//TC O... | ALGO | 0.999974 | 4.331781 | {
"github_metadata": {
"branch": "main",
"commit_count": 137,
"repo_created_at": "2025-07-02T13:14:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "27dab35d28... |
927c3fe4-9991-4d61-abd0-8a8c7a62ccc9 | SameerKarodia/NFIT-Assignment-B | test.cpp | #include <iostream>
#include <string>
#include <cmath>
#include <fstream>
using namespace std;
int main() {
double speedofLight = 300000000;
double PI = 3.1415926535897932384626433832795028841971693993751058209;
//input variables for signal 1
double amp1, fre1, iniphase1, t1 = 0, x1 = 0;
strin... | ALGO | 0.954883 | 4.3386 | {
"github_metadata": {
"branch": "main",
"commit_count": 17,
"repo_created_at": "2024-11-10T19:17:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a1ca6e9fb29... |
ef96c296-0f46-4a80-9bc6-a88b0e45e538 | Ahmed-Samman/Using-Array | Count Even Numbers.cpp | #include<iostream>
#include<cstdlib>
using namespace std;
int Check_Positive_Num(string Message)
{
int Num = 0;
do
{
cout << Message << endl;
cin >> Num;
if (Num <= 0)
cout << "Number must be > 0:\n";
} while (Num <= 0);
return Num;
}
int RandomNumber(int From, int To)
{
int Random = rand() % (To ... | TOOL | 0.921974 | 4.042027 | {
"github_metadata": {
"branch": "main",
"commit_count": 27,
"repo_created_at": "2025-05-09T14:12: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": "345864459cc... |
b5e6eabe-5d39-451b-b446-84ea51d9daff | aryan2574/CPP-repo | CPP Programs/Binary Search/nth_root.cpp | #include <bits/stdc++.h>
using namespace std;
#define mod 1000000007
#define mod1 998244353
#define INF 1e18
#define PI 3.141592653589793238462
#define nline "\n"
#define sz(x) ((int)(x).size())
#define set_bits __builtin_popcountll
#define setp(x, y) fixed << setprecision(y) << x
typedef long long ll;
typedef unsigne... | ALGO | 0.999785 | 4.288804 | {
"github_metadata": {
"branch": "main",
"commit_count": 133,
"repo_created_at": "2023-08-02T14:59: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": "d4fcb1bc36... |
61444156-7621-4f50-ac9b-e98a3dbe8e48 | MUX-enjoyer/PRO1-FIB | P5 - Functions & Procedures/P58459 Dates vàlides.cc | #include <iostream>
using namespace std;
#include <cmath>
bool es_any_de_traspas(int any) {
if (any % 4 == 0 and any % 100 != 0) return (true);
else if (any % 100 == 0 and (any/100 % 4)== 0) return(true);
else return(false);
}
bool es_data_valida(int d, int m, int a) {
bool traspas = es_any_de_traspas... | ALGO | 0.998905 | 3.840437 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-12-09T22:11:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "408a7244dcf9... |
ecbb75d5-0eaf-43aa-8b8a-bf55bd278279 | Kiritow/OJ-Problems-Source | HDOJ/3499_autoAC.cpp | #include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<algorithm>
#include<queue>
#include<map>
using namespace std;
typedef __int64 ll;
const int N=100010;
const int M=500010;
const ll inf=1LL<<60;
struct node
{
int to;
ll dis;
node *next;
}E[M<<1],*G1[N],*G2[N],*head;
int n,m,num;... | ALGO | 0.999979 | 3.357356 | {
"github_metadata": {
"branch": "master",
"commit_count": 939,
"repo_created_at": "2016-04-10T01:06:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 24,
"forks": 8,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3743890... |
74cf761e-1dfa-4698-8528-8fe86d8c1bb9 | MayankSrivastav/Algorithms | Uva11228.cpp | // UVa 11228 - Transportation system
#include <iostream>
#include <queue>
#include <algorithm>
#include <vector>
using namespace std;
#define REP(i, a, b) for (int i = int(a); i <= int(b); i++)
vector<int> pset(1000);
typedef pair<double, double> ii;
priority_queue< pair<double, ii> > edgeList;
void InitSet(int _siz... | ALGO | 0.999621 | 3.669157 | {
"github_metadata": {
"branch": "master",
"commit_count": 22,
"repo_created_at": "2015-07-27T17:51: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": "84fbfccdd... |
a8c7b608-c8ac-47a9-adb4-1c7cda84da46 | Ni3nayka/sketch | arduino/ещё/sfveverbrtbrtbrtbrtbrtbtrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr/sfveverbrtbrtbrtbrtbrtbtrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr.ino | int vec_N[55];
int vec_M[55];
int _ABVAR_1_v = 0 ;
int _ABVAR_2_i = 0 ;
int _ABVAR_3_j = 0 ;
int _ABVAR_4_temp = 0 ;
void setup()
{
for (int i=0;i<55;i++) vec_N[i]=0;
for (int i=0;i<55;i++) vec_M[i]=0;
Serial.begin(115200);
}
void loop()
{
for(_ABVAR_1_v = 1;
1<=54?_ABVAR_1_v <= 54:_ABVAR_1_v >= 54;
1... | ALGO | 0.999231 | 3.529421 | {
"github_metadata": {
"branch": "main",
"commit_count": 88,
"repo_created_at": "2021-01-06T19:03: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": "841dc8bf009... |
efcc1e3f-795c-4836-9cd5-fd9b4c1c5bb5 | simplealgostudy/AlgorithmStudy | 231007/애너그램_그룹_전성만.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
string str;
map<vector<int>, map<string, int>> um;
map<vector<int>, int> umCnt;
map<pair<int, string>, map<string, int>> mSort;
while(!cin.eof() && cin >> str)
{... | ALGO | 0.999339 | 3.870693 | {
"github_metadata": {
"branch": "master",
"commit_count": 1034,
"repo_created_at": "2020-05-16T12:40:44.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2,
"forks": 6,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f58a21d1... |
854b7819-4261-452c-b8e5-d75acc89fee1 | ishandutta2007/codeforces-p | princebelkovetz/normal/1556/C.cpp | #include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <set>
#include <map>
#include <cassert>
#include <queue>
#include <string>
#include <unordered_map>
using namespace std;
#define debug(x) cout << #x << " is " << x << '\n';
#define ld long double
#define int long long
const int mod =... | ALGO | 0.999745 | 3.891565 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T15:49: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": "652782d097e0... |
6fd0f844-997d-4c9a-95e3-8e9072e5a7a8 | haoel/leetcode | algorithms/cpp/decodeXORedPermutation/DecodeXoredPermutation.cpp | // Source : https://leetcode.com/problems/decode-xored-permutation/
// Author : <NAME>
// Date : 2021-02-17
/*****************************************************************************************************
*
* There is an integer array perm that is a permutation of the first n positive integers, where n is
... | ALGO | 0.999992 | 6.127023 | {
"github_metadata": {
"branch": "master",
"commit_count": 788,
"repo_created_at": "2014-10-20T03:22:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 17857,
"forks": 4931,
"issues": 26,
"pull_requests": 28
},
"file_meta": {
"content_id": ... |
957138c0-f73d-4434-a5b2-a0720c4d51e2 | PramitaPandit/My_simulation3 | src/my_simulation3_network3.cc | /*
* my_simulation_network.cc
*
* Created on: Feb 1, 2024
* Author: pramita
*/
#include <stdio.h>
#include <string.h>
#include <omnetpp.h>
using namespace omnetpp;
class node11 : public cSimpleModule
{
protected:
virtual void initialize() override;
virtual void handleMessage(cMessage *msg) overrid... | ALGO | 0.997212 | 5.367652 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-09T22:56: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": "0a977d0ce755... |
51e870c4-0705-466f-bbd1-e835e5b42b9b | NhitheesM/Strings | Reverse_string_wordwise.cpp | #include <iostream>
using namespace std;
string reverseStringWordWise(string input)
{
int n = input.length();
int word_count = 1;
for (int i = 0; i < n; i++) {
if (input[i] == ' ') {
word_count += 1;
}
}
string words[word_count];
int word_index = 0;
... | ALGO | 0.999892 | 5.154133 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-07-21T08:07:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ea1d86c14b31... |
1551548a-f5ff-464e-b255-05aa9691651d | cheris-c/c-plus-plus | 算法导论/10.1栈和队列/Queue.h | #include <iostream>
#include <string>
using namespace std;
struct queue
{
int head; //队列头指针
int tail; //队列尾指针
int *s;
int length;
queue(int size) : tail(1), head(1), length(size)
{
s = new int[size+1];
}
};
void Print(queue Q)
{
int i;
if (Q.tail >= Q.head)
{
for (i=Q.head; i<Q.tail; i++)
cout <... | ALGO | 0.997997 | 3.777873 | {
"github_metadata": {
"branch": "master",
"commit_count": 44,
"repo_created_at": "2020-04-04T10:20:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "a21a07416... |
b7c76440-fb0c-432e-8a66-3e49c55a44a1 | hPixal/aed | docs/GTPS_Resueltos/gtp2/list2map.cpp | #include <map>
#include <list>
#include <iostream>
using namespace std;
/*
list2map. Escribir una funci ́on que dadas las listas de
claves(k1,k2,k3, ...)y valores(v1,v2,v3, ...)retorna el mapMcon las
asignaciones correspondientes{ k1->v1, k2->v2, k3->v3, ...}. Utilice
la signaturavoid list2map(map<int,int> &M,list<... | ALGO | 0.995812 | 5.163585 | {
"github_metadata": {
"branch": "master",
"commit_count": 30,
"repo_created_at": "2021-08-27T19:30: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": "6699bf5fc... |
c8befc01-bd47-486e-8c02-f03633afd569 | areyykarthik/Zhukouski_Pavel_BSU_Projects | Computer architecture/MPI_Samples_2019/5_Time/Program.cpp | #include <mpi.h>
#include <iostream>
#include "Process.h"
namespace MPI
{
class Timer
{
double _startTime;
public:
Timer() { _startTime = MPI_Wtime(); }
double Seconds() const { return MPI_Wtime() - _startTime; }
};
}
class Program
{
public:
static void Main()
{
auto process = MPI::Process();
int da... | TOOL | 0.980101 | 5.31075 | {
"github_metadata": {
"branch": "master",
"commit_count": 83,
"repo_created_at": "2021-11-15T18:13:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "40cc905f0... |
771b8394-e13b-4460-a7fa-40863e04c713 | jakepf00/Kattis | cpp/yoda.cpp | #include<bits/stdc++.h>
using namespace std;
int main() {
string a, b;
cin >> a >> b;
int aa, bb;
aa = -1;
bb = -1;
while (a.length() < b.length()) a.insert(0, 1, '0');
while (b.length() < a.length()) b.insert(0, 1, '0');
for (int i = 0; i < a.length(); i++) {
if (a[i] > b[i]) ... | ALGO | 0.99992 | 3.501479 | {
"github_metadata": {
"branch": "master",
"commit_count": 391,
"repo_created_at": "2017-12-16T14:46: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": "e24f1e7c... |
74e5bb0e-e814-47af-9a27-5e5521698267 | justiceHui/icpc-teamnote | code/Math/MatroidIntersection.cpp | struct Matroid{
virtual bool check(int i) = 0; // O(R^2N), O(R^2N)
virtual void insert(int i) = 0; // O(R^3), O(R^2N)
virtual void clear() = 0; // O(R^2), O(RN)
};
template<typename cost_t>
vector<cost_t> MI(const vector<cost_t> &cost, Matroid *m1, Matroid *m2){
int n = cost.size();
vector<pair<cost_t, int>> ... | ALGO | 0.99995 | 4.901582 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2021-11-15T10:09:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 34,
"forks": 6,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c608933b2... |
95694cbe-aadd-47ad-918c-a57aca215f2f | asishcse60/Problem-Solving | Best time to buy and sell stock.cpp | /*
Say you have an array for which the ith element is the price of a given stock on day i.
If you were only permitted to complete at most one transaction (ie, buy one and sell one share of the stock), design an algorithm to find the maximum profit.
*/
class Solution {
public:
int maxProfit(vector<int> &p) {
... | ALGO | 0.999614 | 5.318728 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-08-30T19:49:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f2703764f7... |
bff4040d-7b7a-4083-a976-57cb5fd1dddd | subhadeep01/leetcode-problems | 0987-vertical-order-traversal-of-a-binary-tree/0987-vertical-order-traversal-of-a-binary-tree.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.99999 | 6.09556 | {
"github_metadata": {
"branch": "main",
"commit_count": 1018,
"repo_created_at": "2022-03-07T11:09:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "715914a34... |
ea3170ed-1703-4ac5-9395-f8d7547deb8c | raincross7/code-similarity | codes/train_code/problem226/problem226_193.cpp | #include <bits/stdc++.h>
#pragma GCC target("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
using namespace std;
#define lli long long int
#define uli unsigned long long int
#define INF 9999999999
#define rep(i,m,n) for(lli i = m;i < n;i++)
#define rrep(i,m,n) for(lli i=m-1;i>=n;i--)
#define pb(n... | ALGO | 0.999936 | 3.911067 | {
"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": "203a9e4b1c38... |
754e27c5-a0f8-4abb-ba58-5d50123ea53e | Park-MinJe/codetree-TILs | 240403/왔다 갔던 구역/area-been-to-and-from.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <tuple>
using namespace std;
int n;
long long totalSize = 0,
size,
preX = 0, curX = 0;
char op;
vector<pair<long long, int>> points; // <x, v>
void init(){
cin>>n;
preX = 0, curX = 0;
for(int i = 0; i < n; ++i){
cin>>... | ALGO | 0.999692 | 3.968001 | {
"github_metadata": {
"branch": "main",
"commit_count": 323,
"repo_created_at": "2023-12-21T04:57:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2867b37e0e... |
de3f2dd7-a569-4f9b-864c-eaa72e135e9a | dev-rice/extra_credit | src/Graph.cpp | #include "Graph.h"
#include <stdio.h>
Graph::Graph(char* filename){
load_graph(filename);
}
void Graph::construct_graph(int nodes){
graph = new int*[nodes];
for (int i = 0; i < nodes; ++i){
graph[i] = new int[nodes];
for (int j = 0; j < nodes; ++j){
//Not ideal for some other algorthims but
// it is okay... | ALGO | 0.949327 | 3.703605 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2014-04-24T16:15: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": "5f8d43db58... |
a9b99122-6dc4-4098-934c-708621440cc8 | tyt0815/BaekJoon_Solved | Gold2/1167.cpp | #include <iostream>
#include <vector>
using namespace std;
struct SNodeInfo
{
int Key;
int Weight;
};
int CalcTreeDiameter(int i, vector<pair<int, vector<SNodeInfo>>>& Nodes, vector<bool>& IsVisited);
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n;
cin >> n;
vector<pa... | ALGO | 0.999753 | 4.224159 | {
"github_metadata": {
"branch": "main",
"commit_count": 193,
"repo_created_at": "2023-03-29T01:03: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": "ea73111e33... |
1fa4d41c-c507-484a-a372-980c553ffc7f | cpumul4/cpuex | 1st/simulator/print_bit.cpp | #include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <float.h>
#include "./memory.hpp"
#define ZERO 1
typedef union{
float fnum;
int32_t inum;
struct{
unsigned int b00:1;
unsigned int b01:1;
unsigned int b02:1;
unsigned int b03:1;
unsigned int b04:1;
un... | ALGO | 0.970578 | 3.95107 | {
"github_metadata": {
"branch": "master",
"commit_count": 702,
"repo_created_at": "2012-10-02T06:04:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "efb39307... |
a16cb436-8713-4f99-b3c8-13104d899b3a | Prahlad-K/data-structures-algorithms-solutions | B-d-Tree-Creation-3.cpp | #include <iostream>
using namespace std;
int d;
typedef struct bdnode
{
int count=0;
int key[100];
struct bdnode* *ptr;
struct bdnode* parent;
}*BTPTR;
typedef struct binarynode
{
int data;
BTPTR lchild;
BTPTR rchild;
}*BPTR;
BTPTR T=NULL,root=NULL;
int p=0;
void sortnode(int* a,int n)
... | ALGO | 0.999881 | 3.54881 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-02-05T11:53: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": "e8fe5e068973... |
48a298d0-7965-46d9-a806-54a8b04e2d6e | kmore01/EDA | Exam/P71496.cc | // PRIM (MST)
// El algoritmo de Prim te devuelve el coste mínimo para que el
// grafo sea conexo
#include <iostream>
#include <queue>
#include <vector>
using namespace std;
typedef vector<vector<pair<int, int>>> grafP;
typedef pair<int, int> P;
int llegir(grafP &g, int m) {
int poble1, poble2, cost, total = 0... | ALGO | 0.999564 | 4.257172 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2025-06-22T16:20: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": "57ee4044043a... |
f258efa4-9a7e-4406-acb1-5fcc7fb28377 | Algunenano/Euler | euler013/src/Euler013.cpp | #include "Euler013.h"
#include <vector>
#include <gmpxx.h>
typedef unsigned long long int ull;
std::string stringSum10dig (std::string _input)
{
std::vector<mpz_class> bigNumV;
mpz_class newNum = 0;
for (ull i = 0; i < _input.length(); i++)
{
char a = _input.at(i);
if (a != '\n')
... | ALGO | 0.999441 | 4.306045 | {
"github_metadata": {
"branch": "master",
"commit_count": 30,
"repo_created_at": "2015-12-07T17:28:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b50de3852... |
f2ae1eee-401b-4071-b4e9-11cc693c5c95 | martenlienen/tum-graph-analytics | gaml/softmax/src/sgd_solver.cpp | #include "sgd_solver.hpp"
#include "common.hpp"
#include <vector>
#include <cstdint>
#include <algorithm>
#include <cmath>
#include <fstream>
#include <petuum_ps_common/include/petuum_ps.hpp>
#include <ml/include/ml.hpp>
#include <io/general_fstream.hpp>
namespace softmax {
SGDSolver::SGDSolver(const SGDSolverConfig&... | ALGO | 0.954801 | 6.399121 | {
"github_metadata": {
"branch": "master",
"commit_count": 122,
"repo_created_at": "2016-07-12T10:22:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "92c1eca3... |
5ca43146-eed4-4ef0-8abd-e69ea4c54a1b | gp1313/Interpolation | interpolation.cpp | #include <interpolation.h>
using namespace inter;
using namespace std;
Interpolation::Interpolation(int *piArr,int iInLength, int iOutLength)
{
iInLen = iInLength;
iOutLen = iOutLength;
piInputArr = new int[iInLen];
piOutputArr = new int[iOutLen];
pfInterMap = new float[iOutLen];
for(int i=0; i... | ALGO | 0.948774 | 4.891835 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2016-10-06T04:38: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": "8b03abddb2... |
a25d968e-80ea-4015-88fb-13ddebb58ac9 | schlaubi77/AdventOfCode | 2023/16/Part2.cpp | #include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <set>
#include <algorithm>
using namespace std;
vector<string> readFile() {
ifstream file("input.txt");
string line;
vector<string> grid;
while(getline(file, line)) {
grid.push_back(line);
}
return grid... | ALGO | 0.9999 | 4.744315 | {
"github_metadata": {
"branch": "master",
"commit_count": 41,
"repo_created_at": "2022-12-14T19:53:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "493da84b9... |
89bb43b9-9002-4391-ac29-3f5a0370bb87 | mannyzhou5/scbuildorder | GAPopulation.h | #pragma once
#include "stdafx.h"
#include "Vector.h"
#include "GAConfiguration.h"
#include "GAChromosome.h"
template<typename TGene, typename TFitnessCalc, typename TFitness>
class CGAPopulation
{
public:
CGAPopulation(const CGAConfiguration<TGene, TFitnessCalc, TFitness> &config, size_t maxPopulation);
~CGAPopulat... | ALGO | 0.99475 | 5.879303 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2015-03-28T19:27:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 16,
"pull_requests": 0
},
"file_meta": {
"content_id": "d3d83dc7... |
9014d82e-2fc2-46f0-b181-18993e271fd8 | yuukidach/OnlineJudge | LeetCode/Q463_IslandPerimeter.cpp | class Solution {
public:
const int dx[4] = {-1, 0, 1, 0};
const int dy[4] = {0, 1, 0, -1};
int islandPerimeter(vector<vector<int>>& grid) {
int h = grid.size();
int w = grid[0].size();
int ans = 0;
for (int i = 0; i < h; ++i) {
for (int j = 0; j < w... | ALGO | 0.999924 | 5.865659 | {
"github_metadata": {
"branch": "master",
"commit_count": 306,
"repo_created_at": "2020-04-04T15:08: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": "f4859e5a... |
574f03d9-236e-436b-9b9c-c24a5cfd8d40 | keshav-1303/C---Codes | __Questions__/Min_Op_to_Make0.cpp | #include <bits/stdc++.h>
#define pb push_back
#define pf push_front
#define ppb pop_back
#define ppf pop_front
#define ll long long int
#define MOD 1000000007
#define PI 3.141592653589793238462643383279
ll gcd(ll a, ll b) { return((b == 0) ? a : gcd(b, a % b)); }
ll lcm(ll a, ll b) { return (b / gcd(a, b)) * a; }
ll po... | ALGO | 0.999819 | 4.999508 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-05-13T05:58: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": "1554436a8b50... |
a10e1e81-8004-4a4f-8c32-2f3d75d706f5 | phucnguyenhirro/N22DCDK066_NguyenMinhPhuc | Chlg9/Chlg9-8.cpp | #include <iostream>
#include <unordered_map>
// Function to find the mode of an array
int findMode(const int* arr, int size) {
if (size <= 0) {
return -1; // Invalid size
}
// Create a hash map to store the frequency of each value
std::unordered_map<int, int> frequencyMap;
// Traverse the... | ALGO | 0.999912 | 6.514916 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2023-11-25T15:15: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": "702daf1deb90... |
12bc873b-8a73-4762-bd92-4f7c84da907d | minh47857/CPlusPlus | Contest/cohuong/contest16/XOR.cpp | #include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define ll long long
#define pb push_back
#define pi pair<ll,ll>
const ll N = 1000001 , MOD = 1e9 + 7 , inf = 1e15;
void file() {
freopen("XOR.inp" , "r" , stdin);
freopen("XOR.out" , "w" , stdout);
ios::sync_with_stdio(0);
cin.tie(0)... | ALGO | 0.999879 | 4.525372 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2023-10-16T15:16: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": "2ab86d8fcc... |
aa3ff7d2-6069-451c-af53-13cfcddfb07c | miguelcabral/leximaxIST | src/sorting_net.cpp | #include <leximaxIST_Solver.h>
#include <leximaxIST_printing.h>
#include <leximaxIST_types.h>
#include <utility>
#include <vector>
namespace leximaxIST {
/* a sorting network is a vector with size equal to the number of wires.
* Entry i contains the last comparator (in the construction of the sorting network)... | ALGO | 0.999978 | 4.97796 | {
"github_metadata": {
"branch": "master",
"commit_count": 423,
"repo_created_at": "2020-07-13T16:45:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "756a3eeb... |
39b73719-073f-4530-a37c-62ef60272cc1 | kevinthegreat1/CPP | Project211.2USACOFebSilver/Bakery.cpp | //
// Created by <NAME> on 2/25/23.
//
#include <iostream>
#include <cmath>
using namespace std;
const int N = 101;
long long t, n, cookieTime, muffinTime;
typedef struct Order {
long long cookies, muffins, waitTime;
} Order;
Order orders[N];
pair<long long, long long> getValidInterval(int i, long long moonie... | ALGO | 0.999963 | 5.183639 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2022-05-30T23:48: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": "b941ca39294... |
dbf220e5-e66a-4ef9-88d7-168fe61c159a | tryingfly/nabo | nabo_core/utility/algorithms.cpp | /*=========== ***doc description @ yyp*** ===========
This is part of Nabo (Naughty Boy, 小炮), an open project for the control of biped robot,
Copyright (C) 2024 YYP, Shanghai Jiao Tong University, under MIT License.
Feel free to use in any purpose, and cite Nabo or 小炮 in any style, to contribut to the advancement of th... | ALGO | 0.995166 | 4.419564 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2024-02-29T02:29:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 81,
"forks": 15,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "f639d0ddf... |
a2612b47-a290-4e78-b553-5c6c85c0c515 | arjn001/cplus_plus | class_activity_updated.cpp | #include <iostream>
using namespace std;
// Function to add 20 to numbers less than 30 in an array
void add20ToNumbers(int arr[], int size) {
for (int i = 0; i < size; ++i) {
if (arr[i] < 30) {
arr[i] += 20;
}
}
}
int main() {
int arraySize;
cout << "Enter the Size of the A... | ALGO | 0.999663 | 5.059418 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-12-03T01:50:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e54c1a246280... |
a5958838-b4fb-4212-bac3-6529abf7b94d | MSKim0215/Algorithm | 백준/Bronze/5597. 과제 안 내신 분..?/과제 안 내신 분..?.cc | #include<iostream>
using namespace std;
int main()
{
int students[30];
int studentCount = sizeof(students) / sizeof(*students);
for(int i = 0; i < studentCount; i++)
{
students[i] = i + 1;
}
int completes[28];
int completeCount = sizeof(completes) / sizeof(*completes);
for... | ALGO | 0.999905 | 3.015872 | {
"github_metadata": {
"branch": "main",
"commit_count": 456,
"repo_created_at": "2023-03-10T07:29:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a9a40a1402... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.