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 |
|---|---|---|---|---|---|---|---|
39de5571-1e73-4abf-a6f0-0e2229e28127 | sna-lincom/LINCOM | src/louvain.cpp | // File: louvain.cpp
// -- community detection source file
//-----------------------------------------------------------------------------
// Community detection
// Based on the article "Fast unfolding of community hierarchies in large networks"
// Copyright (C) 2008 <NAME>, <NAME>, <NAME>, <NAME>
//
// This file is pa... | ALGO | 0.998827 | 5.001803 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2017-01-21T17:10:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 8,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "46211987f... |
8d9f7a2f-2b1a-4be3-93ba-3f0045cc2d49 | kennyjung0223/cse_100 | lab16/kjung10.cpp | // I used the lecture notes, TA Arman's skeleton code, and video: https://www.youtube.com/watch?v=cplfcGZmX7I&ab_channel=MichaelSambol
// I also used this typedef to reduce clutter: https://en.cppreference.com/w/cpp/language/typedef
// Here are more references I used for understanding the pair documentation
// - http:... | ALGO | 0.999997 | 5.172921 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2020-09-17T17: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": "cffb1103a... |
27c3aa7d-ea09-4de5-ab6d-628c89606590 | atlas25git/codeforces | Practice/141A.cpp | /***************************************
*****Solution authored by Atlas25.******
*****************************************/
#include<bits/stdc++.h>
using namespace std;
#define int long long int
#define ld long double
#define F first
#define S second
#define P pair<int,int>
#define pb push_back
const int mod = 1e9 + 7... | ALGO | 0.999936 | 3.876729 | {
"github_metadata": {
"branch": "master",
"commit_count": 41,
"repo_created_at": "2021-06-30T21:17:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "66a5ff79d... |
07905311-662a-44e7-ae3e-92a1b1c8dcb0 | mhco0/Big-Data-IC | app/quantile_quadtree_experiment/quadtree_data_bounds.cpp | #include <aabb/aabb.hpp>
#include <utils/utils.h>
#include <qsbd_debug/qsbd_debug.h>
#include <fstream>
#include <iostream>
using namespace std;
using namespace qsbd;
/*
GLOBALS
*/
double gminx, gminy, gmaxx, gmaxy;
/*
Copy functions from quantile quadtree search. BEGIN
*/
short direction(const aabb<int>& ... | ALGO | 0.986738 | 5.076849 | {
"github_metadata": {
"branch": "master",
"commit_count": 124,
"repo_created_at": "2020-08-24T15:51:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 4,
"pull_requests": 0
},
"file_meta": {
"content_id": "3fbd605a... |
b6fe653e-7c93-40e6-b4aa-57729bb156df | MrityunjayMaharana/CipherCoders_Updates | assignment_04.cpp | #include <iostream>
#include <vector>
#include <climits> // For INT_MAX and INT_MIN
using namespace std;
void findMinMax(vector<int>& arr, int& minEle, int& maxEle) {
int n = arr.size();
int i = 0;
// Initialize min and max
if (n % 2 == 0) {
// If even number of elements, initialize with the f... | ALGO | 0.999979 | 5.761477 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2024-12-04T14:55:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4a7869537dc... |
3e290e65-f211-4ea7-83f2-61efe633ad7b | komekome09/comp_prog | aoj/itp1_7_c.cpp | #include <iostream>
using namespace std;
int main(){
int r, c;
cin >> r >> c;
int g[101][101];
fill(g[0], g[101], 0);
for(int i = 0; i < r; i++){
for(int j = 0; j < c; j++){
int t;
cin >> t;
g[i][j] = t;
g[i][c] += t;
g[r][j] +... | ALGO | 0.999912 | 3.692855 | {
"github_metadata": {
"branch": "master",
"commit_count": 324,
"repo_created_at": "2020-04-27T15:14: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": "59fbcb3f... |
79d4ac2e-8e79-433c-8c03-baf8627e29f4 | bitchbitch/ACM-ICPC | contests/13changsha/1011.cpp | // File Name: 1011.cpp
// Author: darkdream
// Created Time: 2014年11月11日 星期二 14时58分05秒
#include<vector>
#include<list>
#include<map>
#include<set>
#include<deque>
#include<stack>
#include<bitset>
#include<algorithm>
#include<functional>
#include<numeric>
#include<utility>
#include<sstream>
#include<iostream>
#include<... | ALGO | 0.999738 | 3.483541 | {
"github_metadata": {
"branch": "master",
"commit_count": 134,
"repo_created_at": "2015-06-09T13:18: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": "2ccc18fe... |
0333f6f7-2b85-4be4-ac90-31c3b86c7a74 | hxchengtj/leetcode | Integer to English Words.cpp | class Solution {
public:
vector<string> v;
string a[20] = {"", "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten", "Eleven", "Twelve", "Thirteen", "Fourteen", "Fifteen", "Sixteen", "Seventeen", "Eighteen", "Nineteen"};
string b[10] = {"", "", "Twenty", "Thirty", "Forty", "Fifty",... | ALGO | 0.997223 | 5.397662 | {
"github_metadata": {
"branch": "master",
"commit_count": 773,
"repo_created_at": "2016-10-15T00:31: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": "1fde6c7e... |
370f7866-c227-4df4-93e9-c0132cf7db9f | Zapryanovx/FMI-SDA-2024-PREP | Week 05/Additional/Leetcode/Singly Linked List/2487. Remove Nodes From Linked List/remove_nodes.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
ListNode* reverse(Li... | ALGO | 0.999998 | 5.701339 | {
"github_metadata": {
"branch": "main",
"commit_count": 184,
"repo_created_at": "2024-10-05T13:10:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "4e6ea160d0... |
e53fefc9-8cee-4946-bef9-1a0ae447e6e8 | mazen-alasas/Problem-Solving | CodeForces/Groups/ICPC Assiut University Training - Juniors Phase 1 Sheets/Juniors Phase 1 Practice #1 ( Prefix sum , Frequency Array )/Y - Nikita and string.cpp | /// بِسْمِ اللَّـهِ الرَّحْمَـٰنِ الرَّحِيمِ
/** إن الله وملائكته يصلون على النبي يا أيها الذين آمنوا صلوا عليه وسلموا تسليما **/
#include <bits/stdc++.h>
#define ll long long
#define fix(n) setprecision(n)
#define T ll tests; cin >> tests; while(tests--)
#define IOS ios_bas... | ALGO | 0.999476 | 3.234161 | {
"github_metadata": {
"branch": "main",
"commit_count": 103,
"repo_created_at": "2023-09-01T14:59: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": "085d503e06... |
373ab9d5-ca5f-49ba-a7e3-b89b8ae3c555 | mcreng/parallel | 1_mpi/main.cpp | /*
* Do not change this file
*/
#include <iostream>
#include <fstream>
#include <cassert>
#include <cstring>
#include <string>
#include <chrono>
#include "mpi_smith_waterman.h"
using namespace std;
using namespace std::chrono;
namespace utils {
int a_len;
int b_len;
char *a;
char *b;
int read_file(string fi... | ALGO | 0.998809 | 4.510115 | {
"github_metadata": {
"branch": "master",
"commit_count": 45,
"repo_created_at": "2020-03-06T07:46:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b84d949d9... |
aa597e14-43ec-4b1c-8a8c-d340f9a292da | sccn/lsl_archived | LSL/liblsl/external/lslboost/algorithm/string/detail/find_format.hpp | // Boost string_algo library find_format.hpp header file ---------------------------//
// Copyright <NAME> 2002-2003.
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.lslboost.org/LICENSE_1_0.txt)
// See http://www.lsl... | TOOL | 0.954597 | 7.26047 | {
"github_metadata": {
"branch": "master",
"commit_count": 590,
"repo_created_at": "2015-04-04T00:02:05.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 243,
"forks": 133,
"issues": 102,
"pull_requests": 0
},
"file_meta": {
"content_id": "172... |
64db11b8-4a9c-42e6-b7a0-fdda75527599 | lucasbertovic/StochasticVolatilityPricing | Simulation.cpp | #include"Simulation.hpp"
// Normal generator of a single normal random number
double GenNormal(boost::variate_generator<boost::mt19937, boost::normal_distribution<> >& generator)
{
return generator();
}
// Function to do Cholesky decomposition
vector< vector<double> > Cholesky(vector< vector<double> >& data)
{
int... | ALGO | 0.999916 | 5.055774 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-12-18T05:55:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "98d0d6b2f7fa... |
7f4deca3-ea89-4735-aafe-775623a58a4f | akashfit2max/DSA-coding-answers | Strings/leetcode/16.Minimum Window Substring.cpp | class Solution {
public:
string minWindow(string s, string t) {
if( s.length()==0 || t.length()==0) return "";
unordered_map<char,int>mp;
for(auto it : t)
{
mp[it]++;
}
int i=0,j=0,count = mp.size();
int left=0,right=s.length()-1,minlen = ... | ALGO | 0.999987 | 6.350114 | {
"github_metadata": {
"branch": "main",
"commit_count": 334,
"repo_created_at": "2022-02-09T16:44:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1272de942d... |
cdaf1a8a-22d4-4724-a694-d4ca09923262 | QuyDatSadBoy/DSA_Tong_Hop | Dp/B34_cua_hang_hh.cpp | #include <bits/stdc++.h>
#define ll long long
#pragma GCC optimize("Ofast")
const ll mod = (ll)1e9 + 7;
#define endl "\n"
#define all(v) v.begin(), v.end()
#define ms(a) memset(a, 0, sizeof(a))
#define faster() \
ios_base::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0);
u... | ALGO | 0.999953 | 3.965877 | {
"github_metadata": {
"branch": "main",
"commit_count": 37,
"repo_created_at": "2023-03-29T07:57:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9f79d4241a5... |
cb937298-f6a5-434a-bd6c-ebdbca1cd4b0 | mr-s1p9x/homeworkThis | main.cpp | #include <iostream>
#include <string>
using namespace std;
//Задание 1.
//Создайте программу, имитирующую многоквартирный дом. Необходимо иметь классы «Человек», «Квартира», «Дом».
//Класс «Квартира» содержит динамический массив объектов класса «Человек».
//Класс «Дом» содержит массив объектов класса «Квартира».
//Каж... | TOOL | 0.917903 | 4.274682 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-06-14T22: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": "df983b4bc921... |
67529d18-d1a7-4b39-a531-9a983168b33d | Sosuke23/CSES | Graph Algorithms/1672.cpp | // Problem Link: https://cses.fi/problemset/task/1672
#include <bits/stdc++.h>
using namespace std;
#define i23 long long
void solve() {
int n, m, q;
cin >> n >> m >> q;
vector<vector<i23>> g(n, vector<i23> (n, 1e18));
for (int i = 0; i < n; i++) {
g[i][i] = 0;
}
for (int i = 0; i... | ALGO | 0.999925 | 4.417169 | {
"github_metadata": {
"branch": "main",
"commit_count": 165,
"repo_created_at": "2024-02-12T15:40:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f4fb880882... |
eab45a9c-c6d3-46bf-919a-9160c22d20ff | olimpiadi-informatica/oii | 2012/nazionali/matita/sol/sol_stefano_lenta.cpp | /*
Autore: <NAME>
Too tired for documentation
*/
#include <cassert>
#include <cstdio>
#include <vector>
#include <list>
#include <map>
#include <utility>
using namespace std;
const int MAXN = 100000;
const int MAXM = 1000000;
list<int> G[MAXN];
map< pair<int, int>, int > vis;
int N, M, A, B;
int NN;
list<int... | ALGO | 0.99999 | 3.595859 | {
"github_metadata": {
"branch": "master",
"commit_count": 57,
"repo_created_at": "2015-01-04T00:55:52.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 26,
"forks": 4,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "7673c2e3c... |
def2e7ab-45ce-4b6e-b4bf-99fff0869a93 | Porlain/CMU-15-213-CSAPP | Code/ch03/test_63.cpp |
// 参考P139和P160
// (gdb) x/6gx 0×4006f8
// 0x4006f8: 0X00000000004005a1 0x00000000004005c3
// 0x400708: 0X00000000004005a1 0x00000000004005aa
// 0x400718: 0x00000000004005b2 0x00000000004005bf
// 首先看汇编代码:
// #long switch_prob(long x,long n)
// #x in %rdi,n in %rsi
// 0000000000400590 <switch_prob>:
// 400590: 48 8... | ALGO | 0.998321 | 3.723738 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2024-06-06T06:38: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": "e15adc7d6289... |
7ff28304-d7b6-4d09-9d0d-16d068d13955 | eungmo/Algorithms | TopCoderSeason3/knapsack_dinamicprogramming_4_20161211.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int main(void) {
int weight[5] = { 3, 4, 1, 2, 3 };
int value[5] = { 2, 3, 2, 3, 6 };
int maxw = 10;
int dp[6][11];
int max_value = 0;
// initialize whole matrix
for (int i = 0; i < 6; i++) {
for (int j = 0; j < 11; j++) {
dp[i][j] = 0;
}
}... | ALGO | 0.999926 | 4.351417 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2016-12-10T03:55: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": "cfe543278... |
3405ae5b-f456-45e5-99c6-bb73a384cd9c | Simon-howlin/Homework1_paradigmas | ejercicio3/ejercicio3.cpp | #include <iostream>
#include <memory>
using namespace std;
struct Node{
int data;
shared_ptr<Node> next;
};
struct list{
shared_ptr<Node> head;
size_t size;
};
// crea un nuevo nodo
shared_ptr<Node> create_node(int value){
shared_ptr<Node> node = make_shared<Node>();
node->data = value;
... | ALGO | 0.949111 | 5.489493 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2025-03-14T19:28: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": "819d3a0f3422... |
92427abd-f2bc-4bd3-b187-03edca3b5ec6 | huqinwei/algorithm | jumpFloor.cpp | class Solution {
cout << "number:"<<number<<endl;
long long iTotal = 0;//int不够用
int x,y,z;
{
//如果能除开
//计算此种情况的排列组合数
y = (number - x) / 2;
z = x + y;
cout << x << " " << y << "... | ALGO | 0.999988 | 3.52184 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2016-03-09T15:28: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": "43c26c04c... |
c10c3a15-90bf-413a-9200-006a74d1677c | soul-king-kk/c-programming | assignment 3 (6-4-23)/Untitled9.cpp | #include <stdio.h>
#define MAX_SIZE 100
int main() {
int arr1[MAX_SIZE], arr2[MAX_SIZE], *p1, *p2;
int i, n;
printf("Enter the number of elements in the array: ");
scanf("%d", &n);
printf("Enter the elements of the array: ");
for (i = 0; i < n; i++) {
scanf("%d", &arr1[i]);
}
... | ALGO | 0.993518 | 4.521968 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2023-04-04T15:21: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": "791709ba8d03... |
8ff3615d-88cb-402c-b736-08d23bec5714 | 4lejandro-LR/POO | act06.cpp | #include <iostream>
#include <cmath>
#include <vector>
#include <memory>
using namespace std;
// Interfaz general para figuras
class Figura {
protected:
double _area = -1;
public:
virtual double calcularArea() = 0;
virtual double calcularPerimetro() const = 0;
virtual void mostrar() const = 0;
vir... | TOOL | 0.954735 | 6.988871 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2025-05-27T02:18: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": "a9f52c8c907... |
5267f051-5dd9-47c8-a7b6-3b262a7510d2 | itsmohiniii/100DaysOfCode | Graph/21_CourseSchedule2.cpp | //Course Schedule II (Pre requisite tasks)
//Problem link : https://www.geeksforgeeks.org/problems/course-schedule/1
//Possible Approach: Cycle Detection in Directed graph (Topo sort | Kahn's Algorithm | BFS)
#include<bits/stdc++.h>
using namespace std;
class Solution {
public:
vector<int> findOrderOfTasks(i... | ALGO | 0.999998 | 5.651592 | {
"github_metadata": {
"branch": "main",
"commit_count": 421,
"repo_created_at": "2021-12-03T08:09:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bfcd7da8ea... |
a5067feb-526b-4c94-bae9-9e0e036432cb | thirofoo/atcoder-archives | abc250/abc250_c_50460452_AC.cpp | /*
* Author: through
* Submission URL: https://atcoder.jp/contests/abc250/submissions/50460452
* Submitted at: 2024-02-20 09:20:42
* Problem URL: https://atcoder.jp/contests/abc250/tasks/abc250_c
* Result: AC
* Execution Time: 27 ms
*/
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P ... | ALGO | 0.999977 | 4.715188 | {
"github_metadata": {
"branch": "main",
"commit_count": 5513,
"repo_created_at": "2022-12-17T09:45:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
"content_id": "1fb86f93a... |
b435fe94-d75e-4b3d-ba2b-cd7a714e126d | c-s-n-v-7-7/TestGit | CP/MinSteps.cpp | #include<iostream>
#include<queue>
using namespace std ;
int a[101] ;
queue<int>greater , smaller ;
int min( int a , int c )
{
return (a<c)? a:c ;
}
void Swap ( int x , int y )
{
int temp ;
temp = a[x] ;
a[x] = a[y] ;
a[y] = temp ;
}
int AArrange( int bn , int n )
{
if ( bn == n ) return 0... | ALGO | 0.999888 | 3.652694 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2020-06-22T02:09: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": "b6c6d013dd... |
ceca124e-7489-4a97-b1f0-002d39fce6c3 | ishandutta2007/codeforces-d | dbradac/normal/513/C.cpp | #include <cstdio>
#include <algorithm>
using namespace std;
const int MAX = 10000;
int n;
int l[5], r[5];
double rje;
double Vjer(int ind, int lo, int hi)
{
if (hi < l[ind] || lo > r[ind])
return 0;
int pres = min(r[ind], hi) - max(l[ind], lo) + 1;
return (double) pres / (r[ind] - l[ind] + 1);
}
void Rek... | ALGO | 0.998484 | 3.907397 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:31:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d4864c7c4ae1... |
6a1d9a83-41d9-42e1-83ef-6defaba7084d | markfloryan/pdr | labs/lab11/middleearth.cpp | #include "middleearth.h"
#include <algorithm>
#include <stdlib.h>
#include <math.h>
#include <time.h>
// The list of all the place names that we'll be using
string all_city_names[] = {
// human towns, cities and strongholds
"Bree", // a human and hobbit town between the Shire and Rivendell
"Is... | ALGO | 0.997888 | 4.771205 | {
"github_metadata": {
"branch": "master",
"commit_count": 1593,
"repo_created_at": "2017-02-14T17:48:25.000Z",
"is_fork": true,
"is_org_owned": false,
"forked_from": "aaronbloomfield/pdr",
"stars": 38,
"forks": 61,
"issues": 35,
"pull_requests": 2
},
"file_meta": {
"co... |
2b2d916c-aeff-428d-87c4-a5f5f44326d3 | sifue/cpp-study | abc084/b.cpp | #include <bits/stdc++.h> // g++ -std=c++14 -o a a.cpp
using namespace std;
typedef pair<int, int> P;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define repto(i, n) for(int i = 0; i <= (n); i++)
#define all(c) (c).begin(), (c).end()
#define uniq(c) c.erase(unique(all(c)), (c).end()) // ちゃんとユ... | ALGO | 0.999903 | 4.060148 | {
"github_metadata": {
"branch": "master",
"commit_count": 161,
"repo_created_at": "2017-06-14T16:07: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": "28da83b2... |
23744de7-3ed5-4cae-92b9-89a739c3c9fc | Gnaroshi/practice-algorithm-solvedac | With_Levels/Bronze/Bronze_4/16199.cpp | #include <bits/stdc++.h>
using namespace std;
int main(void)
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
int brth[3];
int dte[3];
for (int i = 0; i < 3; i++)
cin >> brth[i];
for (int i = 0; i < 3; i++)
cin >> dte[i];
int mannai, senai, yeonnai;
if (dte[0] > brth... | ALGO | 0.999623 | 3.263961 | {
"github_metadata": {
"branch": "main",
"commit_count": 476,
"repo_created_at": "2024-03-13T08:59: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": "666c69817f... |
f5afe565-0449-46e6-bd71-57ddcd9c2ee7 | catch22/contractor | contractor/inequality.hpp | #pragma once
#include "bitset.hpp"
#include "subsystem.hpp"
#include <array>
#include <iostream>
namespace contractor {
//////////////////////////////////////////////////////////////////////////////
// inequality -- represents entropy inequality with +1/-1 coefficients
////////////////////////////////////////////////... | TOOL | 0.963469 | 6.992237 | {
"github_metadata": {
"branch": "master",
"commit_count": 29,
"repo_created_at": "2015-08-30T01:22: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": "8719ae09e... |
d20658bd-f120-4210-9c15-8d1c5bdadbc4 | NickYxy/Fxxx_Leetcode | 82.删除排序链表中的重复元素-ii.cpp | /*
* @lc app=leetcode.cn id=82 lang=cpp
*
* [82] 删除排序链表中的重复元素 II
*/
// @lc code=start
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode ... | ALGO | 0.999977 | 6.336304 | {
"github_metadata": {
"branch": "main",
"commit_count": 385,
"repo_created_at": "2023-02-27T11:50:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "993ea24033... |
21b57e0b-b275-4542-ac8c-23e93e2c0e28 | RebelToolbox/RebelEngine | core/math/a_star.h | // SPDX-FileCopyrightText: 2023 Rebel Engine contributors
// SPDX-FileCopyrightText: 2014-2022 Godot Engine contributors
// SPDX-FileCopyrightText: 2007-2014 <NAME>, <NAME>
//
// SPDX-License-Identifier: MIT
#ifndef ASTAR_H
#define ASTAR_H
#include "core/oa_hash_map.h"
#include "core/reference.h"
/**
A* pathfind... | ALGO | 0.943085 | 6.121358 | {
"github_metadata": {
"branch": "main",
"commit_count": 579,
"repo_created_at": "2022-09-03T12:04:51.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 9,
"forks": 2,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
"content_id": "8afe398346d... |
f22d1758-a6e5-4b86-8f85-dd1ff58d11b8 | cowboy35927/ESL | Hw1/Data buffers/test_2/Median_MeanFilter.cpp | #include <cmath>
#include <vector>
#include "Median_MeanFilter.h"
using namespace std;
Median_MeanFilter::Median_MeanFilter(sc_module_name n) : sc_module(n)
{
SC_THREAD(do_filter);
sensitive << i_clk.pos();
dont_initialize();
reset_signal_is(i_rst, false);
}
void Median_MeanFilter::merge(vector<unsigned char> ... | ALGO | 0.990337 | 4.014057 | {
"github_metadata": {
"branch": "main",
"commit_count": 23,
"repo_created_at": "2023-04-11T16:54: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": "751b9cc8743... |
6e7984b0-8ca4-4292-9e10-44949eba8a71 | soronto3603/Algorithm | baekjoon/1929.cpp | // 소수 구하기
// https://www.acmicpc.net/problem/1929
#include<iostream>
using namespace std;
// int primes[1000001];
const int MAX = 1000000;
bool check[MAX+1];
int M,N;
int main(){
// check[0]=true;
// check[1]=true;
// for(int i=2;i*i<=n;i++){
// if(check[i]==false){
// for(int j... | ALGO | 0.999966 | 4.312361 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2018-01-24T07:57: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": "a6dbfd19f... |
5dc9fb1d-289c-4d48-ae69-7ade921cbdfa | dotrann1412/final-exam-algorithmic-thinking-course | solutions/Problem16/Solution02.cpp | #include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> ii;
typedef vector<ii> vii;
#define mp make_pair
#define fi first
#define se second
#define io ios_base::sync_with_stdio(false); cin.tie(nullptr);
int dx[] = {-1, 1, 0, 0};
int ... | ALGO | 0.999926 | 4.459338 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2022-12-24T17:50:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "546cf810c... |
ce7f689d-c819-4d1c-bd17-b71316c04ccb | moinulshaon/UVa-Problems | vol 120/12002/12002.cpp | #include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
int n;
int arr[510];
int lis1[510];
int lds1[510];
int dfs1( int x ){
if ( lis1[x]!= -1 )return lis1[x];
int mx=1;
for (int i=x+1;i<n;++i){
if ( arr[i]>=arr[x] ){
mx=max( mx,1+dfs1(i) );
}
}
... | ALGO | 0.999944 | 3.896665 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2016-07-05T15:35:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 7,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "be97b1e25... |
c56354c5-4561-433f-8f64-46dc6dd0eb16 | rceman325/acm-icpc-c-programming | Problem R Math Curiosity.cpp | #include<iostream>
#include<conio.h>
#include<math.h>
using namespace std;
double a,b,n,m,result;
char sResult[20];
double y;
int save[20],i = 0,x;
main()
{
int counter = 0;
do
{
counter = 0;
cin>>n;
cin>>m;
for(b = (n - 1) ; b >= 1 ; b--)
{
for(a = 1 ; a ... | ALGO | 0.999617 | 3.43133 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2020-06-05T06:31: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": "e275982ec4... |
4244e39e-ba6b-4441-9aaf-0bf680e9eb08 | NileshVerma001/100-days-100-contest | 21-11-24-CR-987/A_Penchick_and_Modern_Monument.cpp | #include <bits/stdc++.h>
using namespace std;
void solve() {
int n;
cin >> n;
vector<int> h(n);
for (int i = 0; i < n; i++) {
cin >> h[i];
}
int longest = 1; // Maximum length of a streak of equal elements
int current = 1; // Current streak length
for (int i = 1; i < n; i++) {... | ALGO | 0.999642 | 4.773003 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-11-22T07:10:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5dd946e886f1... |
203cf7ee-4da8-42d6-af91-8b8fa5bf4620 | CHKingSun/KEngine | src/Core/transform.h | //
// Created by KingSun on 2018/4/23.
//
#ifndef KENGINE_TRANSFORM_H
#define KENGINE_TRANSFORM_H
//translate rotate scale
//lookAt perspective ortho frustum
//project unproject(vec3 obj, mat4 model, mat4 proj, vec4 viewport)
#include <cassert>
#include <cmath>
#include "../KHeader.h"
#include "./Vector/Vec3.h"
#inc... | TOOL | 0.906507 | 5.511231 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2018-05-01T03:41: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": "5d5cb4350... |
789ff1f9-4095-4e3f-9225-84f901f1310e | Chiki1601/Hackerearth-Solutions | Math/Combinatorics/Basics of Combinatorics/Future Failure.cpp | #include <bits/stdc++.h>
using namespace std;
int n, k, MOD, d[250001], hi[250001], f[250001], rf[250001];
int binPow(long long x, int p)
{
long long res = 1;
while(p)
{
if(p & 1)
res = res * x % MOD;
p >>= 1;
if(p)
x = x * x % MOD;
}
return (int)res;
}
int c(int n... | ALGO | 0.999992 | 4.963635 | {
"github_metadata": {
"branch": "main",
"commit_count": 1808,
"repo_created_at": "2022-09-09T09:13:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 14,
"forks": 2,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
"content_id": "593c4d12... |
2f31f662-9204-41bd-844c-ad668ddb2d98 | aesanchezteran/c-prog | ProgramacionCplusplus/sortingExample.cpp | #include <iostream>
using namespace std;
int main(){
int i = 0;
int j =0;
int temp = 0;
int n= 0;
int a[100];
cout << "Ingrese cuantos elementos " << endl;
cin >> n;
// Ingreso los numeros en el arreglo "a"
for(i=0;i<n;i++){
cout << "Ingrese los valores del elemento a[" <<... | ALGO | 0.999472 | 4.200674 | {
"github_metadata": {
"branch": "main",
"commit_count": 43,
"repo_created_at": "2025-01-22T15:25:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6b61e038b22... |
2390b73f-7f05-4714-9e66-6eab4e6211f1 | deepaknirala/Coding-with-Cpp | 52_FunctionTemplates.cpp | #include <iostream>
using namespace std;
//function templates=describe what a function looks like
//it is used to create a function that can work with any data type as needed
//can say it is used to generate overloaded functions as much as we want
/* here for using max function with different data types,
we have ... | ALGO | 0.996553 | 4.702118 | {
"github_metadata": {
"branch": "main",
"commit_count": 70,
"repo_created_at": "2025-05-05T14:51: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": "247126d9102... |
6ec8b4a5-2d44-4718-a324-9a2e49e9d6d4 | sreenivaskodur/leetcode-solutions | src/setMatrixZeroes.cc | class Solution {
public:
void setZeroes(vector<vector<int> > &matrix) {
// IMPORTANT: Please reset any member data you declared, as
// the same Solution instance will be reused for each test case.
int nrows = matrix.size();
if(nrows == 0) return;
int nc... | ALGO | 0.98457 | 6.517052 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2014-01-01T17:53: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": "32da254612... |
158f691e-8dad-4e99-aba4-de99bdca397a | Faizanusmani06/DSA | 3567-convert-date-to-binary/convert-date-to-binary.cpp | class Solution {
public:
string convertDateToBinary(string date) {
vector<int> d;
string str = "";
for (char ch : date) {
if (ch == '-') {
d.push_back(stoi(str));
str = "";
continue;
}
str += ch;
}
... | ALGO | 0.999625 | 4.505 | {
"github_metadata": {
"branch": "main",
"commit_count": 902,
"repo_created_at": "2024-02-02T13:20: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": "b1c48b739b... |
8e11ba83-0078-46f6-a524-4d1a83b0084c | AutuanLiu/Code-Storm2019 | leetcodeCPP/345.reverse-vowels-of-a-string.cpp | /*
* @lc app=leetcode.cn id=345 lang=cpp
*
* [345] 反转字符串中的元音字母
*
* https://leetcode-cn.com/problems/reverse-vowels-of-a-string/description/
*
* algorithms
* Easy (45.71%)
* Total Accepted: 6.1K
* Total Submissions: 13.3K
* Testcase Example: '"hello"'
*
* 编写一个函数,以字符串作为输入,反转该字符串中的元音字母。
*
* 示例 1:
*
... | ALGO | 0.999891 | 5.759578 | {
"github_metadata": {
"branch": "master",
"commit_count": 191,
"repo_created_at": "2019-02-16T11:15:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "72e906b3... |
6c27d322-1729-4fe0-8dc4-e68b74318906 | Zero-Vec/cppACM | scnu/ACM/4/I.cpp | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
set<int> s;
int n, m;
int ans = -1;
int dx[] = {0, 1}, dy[] = {1, 0};
void dfs(int x,int y,vector<vector<int>> mp,vector<vector<bool>> v){
if(x==n-1&&y==m-1){
for (int i = 0; i <= n * m ;i++){
if(!s.count(i)){
ans... | ALGO | 0.999662 | 5.349922 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-03-04T17:21: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": "bf49257a5673... |
5721fa03-c6cf-4856-95f3-a28e25d41ca0 | kaiboy05/CodingPractice | Codeforces/ladder/ladder2/09.cpp | #include <iostream>
#include <vector>
#include <array>
#include <algorithm>
#include <map>
#define ll long long
using namespace std;
void maxSwp(int &a, int &b) {
if(a < b) {
int tmp = b;
b = a;
a = tmp;
}
}
int main() {
int a, b; cin >> a >> b;
maxSwp(a, b);
int re... | ALGO | 0.999957 | 3.548376 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2021-09-10T01:26: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": "b8ffee889... |
49652f8a-dcb4-4a15-a647-ce069562a501 | pmSaurabhp/programs | 450 sheet/DP/Coding ninjas/loot_house.cpp | // we need to find max sum of elements which are not adjacent
// 6 9 1 3 8 2 4
// 6+1+8+4 = 19
// 9+3+2 = 14
// 9+8+4 = 21
// 6+3+2 = 11
// greedy algorithm fails so we make recursive solution to find all possibilities
// and then optimize it by memoiztion ( DP solution )
#include <iostream>
#include <vector>
using n... | ALGO | 0.99994 | 3.75727 | {
"github_metadata": {
"branch": "master",
"commit_count": 50,
"repo_created_at": "2019-07-20T07:39:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "dfdfb820c... |
8a37f46f-26ff-4c7a-8218-8c9f240accf0 | GiuMaz/XPOMCP | shielding/src/node.h | #ifndef NODE_H
#define NODE_H
#include "beliefstate.h"
#include "utils.h"
#include <iostream>
class HISTORY;
class SIMULATOR;
class QNODE;
class VNODE;
//-----------------------------------------------------------------------------
// Efficient computation of value from alpha vectors
// Only used for explicit POMDPs... | ALGO | 0.991237 | 6.252579 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2021-05-14T19:45:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3ad2be9cbe... |
caadd763-9eea-471b-b185-2f4af5640d79 | sh3986/Algorithmic-Problem | 광학문자인식_OCR/소스.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <vector>
#include <string>
#include <cmath>
using namespace std;
int WORD_COUNT, Q;
string WORDS[501];
int mapping[100];
double M[501][501];
double T[501][501];
double cache[102][502];
int choices[102][502];
int N;
double solve(int start, int prevword);
v... | ALGO | 0.99993 | 3.837578 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2019-12-06T14:40:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "23ea75013... |
4a8f2e77-0dcd-4759-a28b-d745c802bab9 | whdgur9121/CodeTree_PS | 25_2월말_코드트리 코딩캠프/3일차/문자에 따른 명령 2/text-based-commands2.cpp | #include <iostream>
using namespace std;
string dirs;
int main() {
cin >> dirs;
// Please write your code here.
int x = 0;
int y = 0;
int dx[4];
dx[0] = 1;
dx[1] = 0;
dx[2] = -1;
dx[3] = 0;
int dy[4];
dy[0] = 0;
dy[1] = 1;
dy[2] = 0;
dy[3] = -1;
int di... | ALGO | 0.999985 | 4.402824 | {
"github_metadata": {
"branch": "main",
"commit_count": 609,
"repo_created_at": "2025-01-31T06:34: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": "ccc8af6d45... |
c1c109c7-f2ab-4089-a8e1-6405e7f2cdbf | liv1n9/competitive-programing | codeforces/1181b.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 1008;
char s[N][N];
int f[N][N][26];
int n, m;
bool single(int x, int y, int u, int v) {
int cnt = 0;
for (int k = 0; k < 26; k++) {
int b = f[u][v][k] - f[u][y - 1][k] - f[x - 1][v][k] + f[x - 1][y - 1][k];
if (b > 0) {
c... | ALGO | 0.999992 | 3.316865 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-10-20T00:12: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": "d4c1006904... |
22cb36fc-2688-4484-9578-1e29f8be4cd9 | boyboy007000/MindX | linked_list/source/node.cpp | #include "stdlib.h"
#include "node.h"
#include "stdio.h"
node * getNode(int value){
node* p;
p = (node*)malloc(sizeof(struct node));
if (p == NULL){
printf("Loi khong du bo nho\n");
exit(0);
}
p->value = value;
p->pNext = NULL;
return p;
}
void addFirst(node * head, int val... | ALGO | 0.999538 | 3.381407 | {
"github_metadata": {
"branch": "master",
"commit_count": 31,
"repo_created_at": "2022-10-15T13:13:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1345bc70d... |
7aaf02c7-5aa8-4cf1-979b-ac574582f4f2 | josemiguel/icpc-training | uva-judge/uva10067.cpp | #include<iostream>
#include<algorithm>
#include<vector>
#include<cstring>
#include<numeric>
#include<cctype>
#include<cstdio>
#include<cstdlib>
#include<sstream>
#include<fstream>
#include<string>
#include<stack>
#include<queue>
#include<set>
#include<map>
using namespace std;
int paso[2] = {9,1};
int dist[10][10][1... | ALGO | 0.999696 | 4.217764 | {
"github_metadata": {
"branch": "master",
"commit_count": 37,
"repo_created_at": "2013-11-04T00:48:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f837faeef... |
8e4e291c-d13b-4b35-a956-116a65a1467d | khushimanembang/Discrete | Lab 1/q1.cpp | #include<iostream>
using namespace std;
int main(){
int A[10],B[10],n1,n2;
cout<<"Enter the no.of elements of A: ";
cin>>n1;
cout<<"Enter the elements of A: "<<endl;
for(int i=0;i<n1;i++){
cin>>A[i];
}
cout<<"Enter the no.of elemets of B: ";
cin>>n2;
cout<<"Enter the elements of B:"<<endl;
for(int i=0;i<n2... | ALGO | 0.99963 | 4.617495 | {
"github_metadata": {
"branch": "master",
"commit_count": 34,
"repo_created_at": "2025-06-10T10:30: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": "5e17a9374... |
d028c2b8-8d9e-4f73-b280-753012efe4c5 | Yungan2313/CSES | 1B.cpp | #include <iostream>
#include <stack>
#include <string>
using namespace std;
int position(string s,int start,int mode){//0 = number 1 = alphabat
if(mode){
for(int j = start;j<s.length();j++){
if(s[j] >= '0' && s[j] <= '9'){
return j;
}
}
}
else{
... | ALGO | 0.995991 | 3.68204 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-07-15T08:09: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": "8e1f6983b4c4... |
55e14f98-39df-47af-a8f3-4fd57674e2ab | xpharry/coding-battle | leetcode/cpp/219.cpp | /**
* Hash Table
*/
class Solution {
public:
bool containsNearbyDuplicate(vector<int>& nums, int k) {
unordered_map<int, int> m;
for (int i = 0; i < nums.size(); ++i) {
if (m.find(nums[i]) != m.end() && i - m[nums[i]] <= k) return true;
else m[nums[i]] = i;
}
... | ALGO | 0.99996 | 6.477641 | {
"github_metadata": {
"branch": "master",
"commit_count": 226,
"repo_created_at": "2015-10-04T05:11:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6ac1f007... |
1b499dda-3d7b-40cf-88bb-6efc3a8d012e | ArmandoRosasB/Fun_Cplusplus | Introducción/Ejercicio_1.cpp | #include <iostream>
using namespace std;
int main (){
float num1, num2;
float suma, resta, div, mul;
cout << "Escribe un numero: ";
cin>> num1;
cout << "Escribe otro numero: ";
cin>> num2;
suma = num1 + num2;
resta = num1 - num2;
div = num1/num2;
mul = num1 * num2;
cout... | TOOL | 0.947663 | 3.331275 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2022-12-24T19:54: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": "6f14a21833a2... |
07e2eeb5-da70-4447-a968-819abf61efbf | ThatDNS/UVa-solutions | UVA/Ch 5. Mathematics/10212 - The Last Non-zero Digit.cpp | // Problem: 10212 - The Last Non-zero Digit.
#include <bits/stdc++.h>
using namespace std;
inline long long MAX3(long long a, long long b,long long c){return (a)>(b)?((a)>(c)?(a):(c)):((b)>(c)?(b):(c));}
inline long long MIN3(long long a, long long b,long long c){return (a)<(b)?((a)<(c)?(a):(c)):((b)<(c)?(b):(c)... | ALGO | 0.999987 | 3.648137 | {
"github_metadata": {
"branch": "master",
"commit_count": 285,
"repo_created_at": "2018-08-29T12:08: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": "bbfd6966... |
d1d887e5-fe68-4664-883f-422ceff5c469 | Poncirus/leetcode | 373.find-k-pairs-with-smallest-sums/373.find-k-pairs-with-smallest-sums.cpp | /*
* @lc app=leetcode id=373 lang=cpp
*
* [373] Find K Pairs with Smallest Sums
*
* https://leetcode.com/problems/find-k-pairs-with-smallest-sums/description/
*
* algorithms
* Medium (35.47%)
* Likes: 1305
* Dislikes: 96
* Total Accepted: 99K
* Total Submissions: 272.8K
* Testcase Example: '[1,7,11]... | ALGO | 0.999962 | 6.648479 | {
"github_metadata": {
"branch": "master",
"commit_count": 231,
"repo_created_at": "2019-07-27T07:29: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": "c5dd5939... |
ecdc96bc-cdd0-45c2-97a0-da70b4c7cb63 | computingdolas/Adv-project | Optimizer.cpp | #include"Optimizer.h"
Optimizer::Optimizer(std::string buildname_,std::string filename_): sim(50,0,6,1),buildname(buildname_),generationnum_(0){
sim.fileRead(filename_);
// Custom Build list for buildpossible void ray and colossus
build_possible_void_ray = {"void_ray","stargate","cybernetics_core","... | ALGO | 0.980801 | 3.149047 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2016-12-09T19:49: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": "19db73c06b... |
18fa76a0-e4ed-4132-88a4-8f5efec1bc5d | opengm/opengm | src/tutorials/c++/basics/buildModelEfficent.cxx | /***********************************************************************
* Tutorial: Build Grid Model
* Author: <NAME>
* Date: 04.07.2014
* Dependencies: None
*
* Description:
* ------------
* This tutorial show some tricks how to speed up the build of a model
* and which pitfall can appear... | TOOL | 0.978166 | 5.681963 | {
"github_metadata": {
"branch": "master",
"commit_count": 2107,
"repo_created_at": "2012-06-01T11:37:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 421,
"forks": 153,
"issues": 58,
"pull_requests": 9
},
"file_meta": {
"content_id": "25... |
26814ab6-1ee2-451a-8de3-e345f28fd509 | Luc1d1ty/DataStructures_Algorithms | CPP/Number_Theory/Basic_Algebra/Sum_of_AP_with_n_terms.cpp | /*
Arithmetic progression is a sequence of numbers such that
the difference between each consecutive term is constant,
commonly denoted by d.
For example:
3, 5, 7, 9, ...
Here, the first term, a = 3 , and the common difference, d = 2 .
In general, AP is a, a+d , a+2d, ... , a+(n-1)d
So , sum of AP is : a ... | ALGO | 0.999925 | 4.468268 | {
"github_metadata": {
"branch": "main",
"commit_count": 43,
"repo_created_at": "2022-07-02T10:14: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": "1b4a29bc754... |
7a1e54e4-aa5a-4a4a-965b-49ce649b893c | 0x0cqq/Codes | luogu/p2014.cpp | #include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;
const int MAXN = 400;
namespace normal_io{
inline char read(){return getchar();}
inline void read(int &x){scanf("%d",&x);}
inline void read(char *x){scanf("%s",x);}
inline void print(int x){printf("%d",x);}
inline void p... | ALGO | 0.999852 | 3.216235 | {
"github_metadata": {
"branch": "master",
"commit_count": 330,
"repo_created_at": "2018-01-26T02:51: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": "3fbfdf4d... |
cbca993e-84a5-4827-baf7-4d1bfe9b9f97 | njlookforward/Persistent-LeetCode | BinaryTree/CountCompleteBtreeNodes.hpp | #ifndef COUNT_COMPLETE_BTREE_NODES_HPP
#define COUNT_COMPLETE_BTREE_NODES_HPP
#include <queue>
using std::queue;
struct TreeNode
{
TreeNode() = default;
TreeNode(int v): val(v), left(nullptr), right(nullptr) {}
TreeNode(int v, TreeNode *l, TreeNode *r): val(v), left(l), right(r) {}
int val = 0;
T... | ALGO | 0.999365 | 6.31434 | {
"github_metadata": {
"branch": "main",
"commit_count": 108,
"repo_created_at": "2025-03-11T12:56:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d9f8a91495... |
6015593c-c964-4601-a1e0-dfaf62ba0d30 | Patricccc/CB_ICS4U | Unit 3: Search and Sort/202.cpp | #include <iostream>
#include <cmath>
using namespace std;
//Q1
void print(int arr[], int n){
for(int i = 0; i < n; i++){
cout << arr[i] << " ";
}
cout << endl;
}
void q1(int arr[], int n) {
for (int i = 1; i < n; i++) {
int j = i - 1;
int temp = arr[i];
while (j >= 0 &&... | ALGO | 0.999982 | 4.883287 | {
"github_metadata": {
"branch": "main",
"commit_count": 40,
"repo_created_at": "2022-09-09T01:12:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "62085f3fb65... |
0eb8220b-fd90-41d0-ac18-7bfebaa4ee5b | Hemantgithubpro/leetcode | AtCoder/Contests/abc411/c/main2.cpp | #include <iostream>
#include <vector>
using namespace std;
int main()
{
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
int N, Q;
cin >> N >> Q;
vector<int> queries(Q);
for (int i = 0; i < Q; i++)
{
cin >> queries[i];
}
vec... | ALGO | 0.999127 | 4.311751 | {
"github_metadata": {
"branch": "main",
"commit_count": 236,
"repo_created_at": "2025-03-06T19:40: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": "2fe35a5799... |
8308e37f-5127-4891-8067-8e155cb22f4f | ac1975334/CampbellAndrew_CSC5_40718 | Hmwk/Assignment1/Savitch_9thEd_Chap1_PracProg5/main.cpp | /*
* File: main.cpp
* Author: <NAME>
*
* Created on January 12, 2015, 6:36 PM
* Purpose: Homework Assignment (Savitch_9thEd_Chap1_PracProg5)
*/
//System Libraries
#include <iostream>
using namespace std;
//User Libraries
//Global Constants
//Function Prototypes
//Execution begins:
int main(int argc, char*... | TOOL | 0.99396 | 3.664153 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2015-01-07T03:42: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": "e84e823a7... |
b8320a6f-8e7c-4823-9dd8-9ef4b141deef | qhoa256/PTIT-CODE-DSA | Duyet do thi/DSA09031_CHU_CUU_XA_CACH.cpp | #include <bits/stdc++.h>
#pragma gcc optimize("Ofast")
#define endl '\n'
#define mp make_pair
using namespace std;
using ll = long long;
int n, m, k;
vector<pair<pair<int, int>, pair<int, int>>> vp;
vector<pair<int, int>> a;
int dx[] = { -1, 1, 0, 0};
int dy[] = {0, 0, -1, 1};
int f[105][105] = {};
int idx = 0;
int C... | ALGO | 0.99996 | 4.037136 | {
"github_metadata": {
"branch": "main",
"commit_count": 92,
"repo_created_at": "2023-02-28T16:05:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 14,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c7ab93de23... |
de2e8f68-5c20-4843-a7d3-03dc86612188 | opencv/opencv_contrib | modules/mcc/src/mcc.cpp | // This file is part of OpenCV project.
// It is subject to the license terms in the LICENSE file found in the top-level directory
// of this distribution and at http://opencv.org/license.html.
/*
* MIT License
*
* Copyright (c) 2018 <NAME>
*
* Permission is hereby granted, free of charge, to any person obtaining... | TOOL | 0.919074 | 6.040029 | {
"github_metadata": {
"branch": "4.x",
"commit_count": 4557,
"repo_created_at": "2013-09-11T13:28:04.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 9757,
"forks": 5828,
"issues": 553,
"pull_requests": 88
},
"file_meta": {
"content_id": "54... |
ad59ff20-69d2-4008-b164-22ace54f6e85 | tanmaysahay94/Algorithm | CPP/1033_ChennaiB.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long LL;
vector<vector<double> > pascal;
vector<vector<double> > generate(int A) {
vector<vector<double> > sol;
if (A == 0) {
return sol;
}
vector<double> tmp; tmp.push_back(1);
sol.push_back(tmp);
double k = 1;
for (int i = 1; i < A; i++) {
vect... | ALGO | 0.999433 | 3.388276 | {
"github_metadata": {
"branch": "master",
"commit_count": 424,
"repo_created_at": "2014-05-26T07:29:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "41d31500... |
caa76c4b-9f2b-4338-be90-7c751e3faf5e | CloudCompare/CloudCompare | plugins/core/Standard/qRANSAC_SD/extern/RANSAC_SD/Sphere.cpp | #include "Sphere.h"
#include <MiscLib/Performance.h>
#include <GfxTL/IndexedIterator.h>
#include <GfxTL/MathHelper.h>
#ifdef DOPARALLEL
#include <omp.h>
#endif
extern int dmat_solve ( int n, int rhs_num, double a[] );
void tetrahedron_circumsphere_3d ( double tetra[3*4], double *r, double pc[3] )
//*****************... | ALGO | 0.999576 | 5.798347 | {
"github_metadata": {
"branch": "master",
"commit_count": 5089,
"repo_created_at": "2012-11-06T20:15:51.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 4019,
"forks": 1100,
"issues": 256,
"pull_requests": 4
},
"file_meta": {
"content_id": "... |
ed9114cf-aba5-4eb9-9f35-ca53bb7ebfc6 | ujjwalpathaak/DSA | Searching_and_Sorting/Bubble_sort.cpp | /* Code to sort array using bubble sort
array - 1, 2, 6, 3, 9, 7, 4 */
#include <iostream>
using namespace std;
void bubble_sort(int* array, int size)
{
for(int i = 0; i < size - 1 ; i++)
{
for(int j = 0; j < size - 1 - i; j++)
{
if(array[j] > array[j+1])
{
... | ALGO | 0.999901 | 4.883029 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2022-03-07T03:52: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": "e0fcbfb7645... |
a3ca9941-7261-4d29-8ebc-1f8c9d3c174f | RishabhDevbanshi/Leetcode_Problems | Move all zeros to the front of the linked list - GFG/move-all-zeros-to-the-front-of-the-linked-list.cpp | // { Driver Code Starts
//Initial Template for C++
#include<bits/stdc++.h>
using namespace std;
struct Node
{
int data;
struct Node* next;
Node(int x){
data = x;
next = NULL;
}
};
void push(struct Node **head_ref, int new_data) {
struct Node *new_node = new Node(new_data);... | ALGO | 0.999708 | 4.370691 | {
"github_metadata": {
"branch": "main",
"commit_count": 3339,
"repo_created_at": "2021-02-14T03:32:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d0bba0f99... |
afb6fbcf-ca82-463f-b009-31626f7c380a | raincross7/code-similarity | codes/train_code/problem104/problem104_273.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
ll N, M;
cin >> N >> M;
vector<pair<ll, ll> > s(N);
vector<pair<ll, ll> > c(M);
for(ll i = 0; i < N; i++) {
cin >> s.at(i).first >> s.at(i).second;
}
for(ll i = 0; i < M; i++) {
cin >> c.at(i)... | ALGO | 0.999997 | 4.231449 | {
"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": "a9ec8fc993ef... |
81af2dcc-b51d-4322-97d4-fa040afe46f0 | WetRobot/tebex | include/tebex/tools/misc_utils.hpp | #ifndef UTILS_HPP
#define UTILS_HPP
#include <string>
#include <vector>
#include <fstream>
#include <iostream>
#include <regex>
#include <functional>
#include <map>
#include <sys/stat.h>
namespace utils{
// -------------------------------------------------------------------------
// --------------------------... | TOOL | 0.968907 | 5.993434 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2023-07-05T19:25: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": "a20040af53... |
5f34defc-cadf-4f5c-b29c-d8f05d728eba | youoj/Algorithm | Baekjoon/[10216]CountCircleGroups.cpp | /* 10216번 Count Circle Groups(DFS/BFS)
* https://www.acmicpc.net/problem/10216
*/
#include <iostream>
#include <vector>
#include <cmath>
using namespace std;
struct ENEMY {
int X;
int Y;
int R;
};
int inputN, answer;
bool isConnected(ENEMY e1, ENEMY e2) {
int distance1 = pow(e1.X - e2.X, 2) + pow(... | ALGO | 0.999908 | 5.211817 | {
"github_metadata": {
"branch": "master",
"commit_count": 101,
"repo_created_at": "2018-05-28T04:30: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": "d9ef7105... |
b902b367-3d71-4bdb-9855-9b95af827f58 | tr0j4n034/Project-Euler | Solutions/211.cpp | //
// main.cpp
// practice
//
// Created by Mahmud on 5/6/18.
// Copyright © 2018 Mahmud. All rights reserved.
//
#pragma GCC optimize("-0g")
#include <iostream>
#include <cstring>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <ctime>
#include <utility>
#include <cassert>
using namesp... | ALGO | 0.999789 | 4.401963 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2019-04-15T07:09: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": "65577f63ed... |
5c3bf200-8251-45a9-9afa-abcef9849e2b | Huvok/Competitive-Programming | LeetCode/235 - Lowest Common Ancestor of a Binary Search Tree.cpp | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <string>
#include <stack>
#include <queue>
#include <map>
#include <functional>
#include <queue>
#include <bitset>
#include <sstream>
#include <set>
#include <iomanip>
#include <string.h>
#include <unordered_map>
usi... | ALGO | 0.999999 | 5.734909 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2017-06-23T02:09:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "40af6c91e... |
cb6fcc01-51ed-4ec5-ab9f-4e45fc745181 | gleal42/CPP-Modules | C02/ex03/main.cpp | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.cpp :+: :+: :+: ... | ALGO | 0.904177 | 5.019734 | {
"github_metadata": {
"branch": "master",
"commit_count": 127,
"repo_created_at": "2022-03-27T16:14: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": "7f39f8b9... |
420d473f-6aa1-4fb4-8002-db6ec69ae756 | thinkjin99/Do_with_C | 0418/list.cpp | #include <iostream>
#include <string>
#include <sstream>
#include "list.h"
using namespace std;
void LinkedList::Append(int data){
tail->next = new Node(data);
tail->next->prev = tail;
tail = tail->next;
}
void LinkedList::Prepend(int data){
Node* new_head = new Node(data);
new_head->n... | TOOL | 0.903523 | 4.872095 | {
"github_metadata": {
"branch": "BOJ",
"commit_count": 61,
"repo_created_at": "2021-03-25T07:52: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": "802f0e8e4862... |
ecbcd492-216c-462e-947f-7e403f9b31eb | OUC-MYM/Summer-training | 8-21/A - Silver Cow Party.cpp | #include <iostream>
#include <cstring>
#include <cstdio>
#include <queue>
#define MAX 1000100
#define INF 0x3f3f3f3f
using namespace std;
int N,M,X;
int ans[MAX],ans_T;
int vis[MAX],d[MAX];
int head1[MAX],head2[MAX];
int cnt1,cnt2;
struct Edge
{
int v;
int next;
int w;
} e1[MAX],e2[MAX];
void addEdge(int ... | ALGO | 0.999896 | 4.078985 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2015-07-20T12:42: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": "c494a6ad7... |
c5023430-fddd-497d-87aa-d599df639b3d | MATF-RS20/RS015-ipds-iterated-prisoners-dilemma-simulation | IPDS_QT_Project/simulation.h | #ifndef _USE_MATH_DEFINES
#define _USE_MATH_DEFINES
#endif
#include "specimen.h"
#include "statehistory.h"
#include "strategiesheaders.h"
#include "estrategy.h"
#include "food.h"
#include <memory>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <random>
#include <ctime>
#ifndef SIMULATION_H
#define ... | ALGO | 0.972157 | 5.022766 | {
"github_metadata": {
"branch": "master",
"commit_count": 172,
"repo_created_at": "2019-11-28T12:33:47.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bd8710e0b... |
d9a5515b-a92a-4f8d-af35-31fb7de75aa9 | kacruzv011/FEM_vs_FDM_Poisson | Poisson_FEM/src/.ipynb_checkpoints/poisson_sincronizacion-checkpoint.cpp | // --- ARCHIVO: src/poisson_sincronizacion.cpp (MODO DUAL) ---
// Este archivo puede funcionar en dos modos:
// 1. Benchmark (por defecto): Mide el tiempo y lo imprime en una línea.
// 2. Solution: Imprime la malla completa (x,y,V) para graficar.
// ADVERTENCIA: Esta implementación es conceptualmente diferente (usa mat... | ALGO | 0.999973 | 6.45358 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2025-06-21T19:58: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": "6adc3cd85e1... |
98682dad-0905-48b5-9ddc-f26463a96f7a | btnkij/ACM | luogu/LUOGU4054.cpp | /**
* Number:LUOGU4054
* Title:[JSOI2009]计数问题
* Status:AC
* Tag:[树状数组]
**/
#include <cstdio>
#include <iostream>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <numeric>
#include <vector>
#include <queue>
#include <cassert>
using namespace std;
#define INF 0x3f3f3f3f
typedef long long ll;
typedef u... | ALGO | 0.999711 | 4.859757 | {
"github_metadata": {
"branch": "master",
"commit_count": 155,
"repo_created_at": "2019-02-26T14:21: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": "999d5d26... |
b557dba5-e777-4b46-a63f-e4a2b80a100c | ishandutta2007/codeforces-m | matrixcascade_qwq/normal/1556/E.cpp | //This code is made by <NAME>.
//GrandMaster When??
//#pragma GCC optimize("Ofast", "unroll-loops")
//#pragma GCC target("sse", "sse2", "sse3", "ssse3", "sse4", "avx")
#include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define int long long
#define YES puts("YES")
#define NO puts("NO")
#defin... | ALGO | 0.999875 | 3.565595 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-06-06T01:03:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e556355282ff... |
1194f5d0-6acd-4298-86c5-118700a67af6 | abhissh11/leetcode | 1298-reverse-substrings-between-each-pair-of-parentheses/1298-reverse-substrings-between-each-pair-of-parentheses.cpp | class Solution {
public:
string reverseParentheses(string s) {
// Traverse a string by using pointer
//If we found '(' then we simply push this into stack.
//Else if we found ')' then we will match it with '(' which is top element of a stack.
//We initialize 2 pointers namely "start" and "end" of... | ALGO | 0.999735 | 5.641555 | {
"github_metadata": {
"branch": "main",
"commit_count": 210,
"repo_created_at": "2024-03-04T18:25: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": "9916864d09... |
50306bec-b121-4189-ade5-b57112b5f405 | danilopereira10/codeforces | 363B.cpp | //#include <stdio>
#include <iostream>
#include <cmath>
#include <vector>
#include <stack>
#include <tuple>
#include <cstring>
#include <cstdlib>
#include <bits/stdc++.h>
#include <iomanip>
#include <unordered_map>
#include <set>
#include <algorithm>
#include <set>
using namespace std;
typedef long long ll;
typedef v... | ALGO | 0.999985 | 3.958334 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-02-25T22:12: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": "0ea3206cedeb... |
749e4938-6093-48cc-a067-43f396b7f646 | rodea0952/competitive-programming | AOJ/1618.cpp | #include <bits/stdc++.h>
#define chmin(a, b) ((a)=min((a), (b)))
#define chmax(a, b) ((a)=max((a), (b)))
#define fs first
#define sc second
#define eb emplace_back
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
typedef tuple<int, int, int> T;
const ll MOD=1e9+7;
const ll INF=1e18;
int dx[]={1, ... | ALGO | 0.999923 | 3.787948 | {
"github_metadata": {
"branch": "master",
"commit_count": 408,
"repo_created_at": "2019-08-15T06:22:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "eb8fa578... |
d3d91594-aea2-450f-bb7b-78c7d021596d | dalmemail/AmayaOS-German | srv/DeviceServer.h | /*
* Copyright (C) 2009 <NAME>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distribute... | WEB | 0.904487 | 5.830081 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2014-08-29T08:12: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": "4dfd2f2cc8... |
25e63202-0ee9-41c5-b514-c06dcf5910c5 | SKliaznyka/KS.UIP.Cpp.HomeWork | KS.UIP.Cpp.HomeWork.HW03.ArrayFunctionTask05/KS.UIP.Cpp.HomeWork.HW03.ArrayFunctionTask05.cpp | // KS.UIP.Cpp.HomeWork.HW03.ArrayFunctionTask05.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
//HomeWork 03. TASK 04 (optional).
//Input two Arrays. Arrays initiates in Random way.
//Find equal numbers within two arrays. List these numbers.
//
#include "pch.h"
#include <ios... | ALGO | 0.999903 | 5.304605 | {
"github_metadata": {
"branch": "master",
"commit_count": 37,
"repo_created_at": "2019-05-15T11:05: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": "5f7f98d64... |
4842e3d2-e57f-40d3-b44f-d659ff336b50 | LadnerJonas/bachelor-thesis-implementation | prototype/src/main.cpp | #include <filesystem>
#include <iostream>
#include <thread>
#include <vector>
#include "input_preparation/BinaryRelation.hpp"
#include "morsel-driven/input_data_storage/MorselManager.hpp"
#include "morsel-driven/output_data_storage/LockFreeListBasedPartitionManager.cpp"
#include "morsel-driven/output_data_storage/StdV... | DATA | 0.917992 | 5.992828 | {
"github_metadata": {
"branch": "master",
"commit_count": 253,
"repo_created_at": "2024-09-16T19:16: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": "c4d3dac4... |
ba9fb949-ebd8-456e-98fd-3586d66065b7 | deeepeshthakur/CodeFiles | HackerRank/GraphTheory/RoadsAndLibraries.cpp | #include <bits/stdc++.h>
using namespace std;
void modified_dfs_call( int city, std::vector<bool> &dfsCheck, std::vector < std::vector <int> > &cityRoads, long& temp_ans){
temp_ans++;
dfsCheck[city] = true;
int roads_from_curr_city = cityRoads[city].size();
for(int index = 0; index < roads_from_curr_city; inde... | ALGO | 0.998866 | 3.371675 | {
"github_metadata": {
"branch": "master",
"commit_count": 75,
"repo_created_at": "2018-12-02T06:26:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3e1a94ee8... |
10f7b684-173f-4063-80e6-77310ce0b84c | Seungchan0325/baekjoon | solutions/25016/cpp/evolution.cpp | #include "evolution.h"
#ifdef LSC_ENV
#include "grader.cpp"
#endif
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 505050;
struct DataStruct {
vector<pair<int, int>> s;
void insert(int key, int x)
{
bool flag = true;
for(auto& [i, k] : s) {
if(k == key) {
... | ALGO | 0.99991 | 3.710307 | {
"github_metadata": {
"branch": "main",
"commit_count": 795,
"repo_created_at": "2023-12-31T15:30: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": "a23eeec41b... |
3de7c252-6fdb-4ff6-a21c-63e5ded4a35d | majwic/SortingGraphs | Sorting.cpp | #include "Sorting.h"
#include <ncurses.h>
#include <iostream>
#include <chrono>
void Sorting::setVect(const std::vector<int> nVect) {
vect = nVect;
}
void Sorting::printBar(const int column, const int value) {
int nColumn = column * 3;
for (int i = 0; i < value; ++i) {
mvprintw(LINES - 1 - i, nColumn, "... | ALGO | 0.989984 | 5.176546 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2022-11-04T03:02:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9df95616bf... |
fc381c58-de5c-41e8-9b15-2d3043e24462 | JackeyLove1/Leetcode | ACM/Acwing/acwing327.cc | #pragma GCC optimize(2)
#include <bits/stdc++.h>
using namespace std;
static inline void fhj() {
ios::sync_with_stdio(false);
cin.tie(nullptr), cout.tie(nullptr);
}
template<typename T>
inline T read() {
T ans = 0;
char c = getchar();
while (!isdigit(c)) c = getchar();
while (isdigit(c)) ans... | ALGO | 0.999994 | 4.691854 | {
"github_metadata": {
"branch": "master",
"commit_count": 547,
"repo_created_at": "2020-08-14T01:48:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "df13eca3... |
25042ade-2cc6-4440-be83-4fce1f2b5483 | gn08/210-midterm2 | main.cpp | // Midterm 2 || <NAME> || CS 210
// https://github.com/gn08/210-midterm2.git
#include <iostream>
#include <fstream>
#include <cstdlib>
#include <vector>
#include <string>
#include <ctime>
using namespace std;
const int MIN_NR = 10, MAX_NR = 99, MIN_LS = 5, MAX_LS = 20;
class DoublyLinkedList {
private:
struct No... | ALGO | 0.997382 | 3.987212 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2024-10-18T01:31: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": "8ab4068c83f5... |
3a2e559d-f40f-4b64-901d-d22e07786f03 | GowthamSatya/DSA | DSA Sheets/A2Z DSA Striver Sheet/Sliding Window and Two Pointer/Medium/count_subarray_with_k_odd.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution
{
public:
int countSubarray(int n, vector<int> &nums, int k)
{
// Code here
unordered_map<int, int> mp;
int i = 0, j = 0;
int cnt = 0;
int cntOdd = 0;
for (int i = 0; i < n; i++)
{
... | ALGO | 0.999853 | 5.586538 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-08-01T10:54: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": "5ace0453e79b... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.