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 |
|---|---|---|---|---|---|---|---|
7f1691bb-bccc-47d8-b615-38758cb836b0 | VariianWrynn/OOP_project | test_computer_choose_ace.cpp | #include <iostream>
#include <numeric>
using namespace std;
//if (sum <= playercards[0] || sum <= 10) then switch to 11
int main()
{
const int count = 2;
int cards[count] = {1,10};
int sum1 = 0;
sum1 = std::accumulate(cards, cards+count, sum1);
cout << "sum1 is: " << sum1 << endl;
if ( sum1 <=... | ALGO | 0.985989 | 4.485781 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2022-05-17T07:19: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": "dcdf29df4408... |
e9294d09-e3bd-4fde-96b7-f8db5acb91cd | JoshCantwell/cop4534_Project2 | Simulation.cpp |
#include "Simulation.h"
#include <iostream>
#include <random>
#include <math.h>
#include "PriorityQueue.h"
void Simulation::Run() {
PriorityQueue* prio;
prio = new PriorityQueue();
std::string userAnswerString;
int userAnswerInt, n = 0;
std::cout << "Welcome to the simulation" << std::endl;
std::c... | ALGO | 0.997182 | 4.162897 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2020-10-04T19:05: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": "61d1721fb8... |
c981e12c-566b-4816-a485-bc8f4e6ebc8f | yqliving/Practice | 3-Longest-Substring-Without-Repeating-Characters/solution.cpp | class Solution {
public:
int lengthOfLongestSubstring(string s) {
if (s.empty()) return 0;
int p1 = 0, p2 = 1;
int maxLen = p2 - p1;
for (; p2 < s.size(); p2++) {
for (int i = p1; i < p2; i++) {
if (s[i] == s[p2]) {
p1 = i ... | ALGO | 0.999891 | 6.3109 | {
"github_metadata": {
"branch": "master",
"commit_count": 1342,
"repo_created_at": "2016-07-10T18:39: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": "6dafe82... |
21898b01-9731-4ec2-ad81-2bebedeea80d | ishandutta2007/codeforces-d | dragonslayerintraining/normal/1689/E.cpp | #include <cstdio>
#include <array>
#include <cassert>
#include <set>
int as[2005];
struct State{
std::array<int,30> uf;
int has;
State(){
for(int i=0;i<30;i++){
uf[i]=i;
}
has=0;
}
bool good(){
int cc=-1;
for(int k=0;k<30;k++){
if(has&(1<<k)){
int tmp=find(k);
if(cc==-1){
... | ALGO | 0.999889 | 3.462924 | {
"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": "06ab0002b591... |
cded7023-5b00-4098-956a-f65b7965f523 | Mengsen-W/algorithm | cpp/2962_count_subarrays/count_subarrays.cpp | #include <algorithm>
#include <cassert>
#include <tuple>
#include <vector>
using namespace std;
class Solution {
public:
long long countSubarrays(vector<int>& nums, int k) {
int mx = *max_element(nums.begin(), nums.end());
long long ans = 0;
int cnt = 0, left = 0;
for (int x : nums) {
if (x =... | ALGO | 0.999725 | 6.597587 | {
"github_metadata": {
"branch": "main",
"commit_count": 1562,
"repo_created_at": "2021-01-17T11:54: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": "faa62e538... |
86e381c8-7f03-4164-90f0-4b0fe961ff67 | cyrussafaie/TC_submission | main.cpp |
const int TRAIN_AUGMENTS = 200;
const int TEST_AUGMENTS = 200;
const bool USE_CUSTOMER_PREDICTIONS = false;
const bool USE_BASIC_FEATURES = true;
#include <bits/stdc++.h>
#include <sys/time.h>
//#include <emmintrin.h>
#ifdef LOCAL
int THREADS_NO = 3;
#else
int THREADS_NO = 1;
#endif
using namespace std;
#define ... | DATA | 0.992198 | 3.170832 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2016-06-13T21:35:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "eb93ca9b92... |
e209eeb5-9411-411a-982f-986550238c8a | ObedAndradeOrtiz/ED1-MasterLobed | 10.Evaluaciones/Primer-Parcial/Primera Opcion/UPoliListaSm.cpp | // ---------------------------------------------------------------------------
#include "UPoliListaSm.h"
// ---------------------------------------------------------------------------
PoliListaSm::PoliListaSm(CSMemoria * mem) {
KEOAO = new ListaSM(mem);
nt = 0;
}
bool PoliListaSm::es_cero() {
return nt == 0;
}... | ALGO | 0.9015 | 3.875086 | {
"github_metadata": {
"branch": "main",
"commit_count": 30,
"repo_created_at": "2021-10-03T21:47:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b7800ec7ffa... |
fee565cd-a467-4f5f-99e2-7fe6fa40d8ad | Katrin-Kad/Cpp | Lab2/Task2.cpp | #include <iostream>
#include <string>
bool isSnils(std::string str) {
if (str.length() != 11) {
return false;
}
int sum = 0;
int prev_number = -1;
int double_prev_number = -1;
for (int i = 0; i < 9; i++) {
int number = str[i] - '0';
if (number == prev_number && numb... | ALGO | 0.923417 | 4.950219 | {
"github_metadata": {
"branch": "master",
"commit_count": 31,
"repo_created_at": "2023-12-02T09:43: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": "1e1524dda... |
2a6fc7d5-d219-418c-859e-029f82ebc6d6 | Sagorika28/DSA-CN | 10. Test 2/Increasing_numbers.cpp | /*
Given an integer n, print all n digit increasing numbers in increasing order in one line.
Numbers you need to print should be in increasing order and only those numbers should be printed which have digits in increasing order.
Input Format :
Integer n
Output Format :
Numbers in increasing order
Constraints :
1 <= n... | ALGO | 0.999595 | 5.71826 | {
"github_metadata": {
"branch": "master",
"commit_count": 76,
"repo_created_at": "2021-05-12T07:47: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": "4a403859d... |
dbc71036-b9d4-4082-99bb-9b3248879a55 | DariaYakovleva/university-projects | Labs/automata_minimization/isomorphism/main.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 100010;
int n1, m1, k1;
int aut1[N][30];
int n2, m2, k2;
int aut2[N][30];
bool term1[N];
bool term2[N];
bool used1[N];
bool used2[N];
bool bfs() {
queue< pair<int, int> > q;
q.push(make_pair(1, 1));
while (!q.empty()) {
pair<int, int> cur = q.front();... | ALGO | 0.999976 | 3.957794 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2016-05-02T13:45:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3e20331e5... |
e850a0ca-9d57-4b20-ac40-f2c178bfb064 | lannn2410/kIC | Algorithm.cpp | #include "Algorithm.h"
Algorithm::Algorithm(const Dataset &d)
: data(d), num_queries(0)
{
common_ins = MpCommon::getInstance();
}
uint Algorithm::get_num_queries() const
{
return num_queries;
}
double Algorithm::query(const Seed &s)
{
#pragma omp critical
{
++num_queries;
}
if (Const... | ALGO | 0.999563 | 5.522435 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2021-05-25T19:56: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": "c74adfeafcb9... |
fca0a7a0-b606-4ed0-8dbe-2bb943ed299c | johnedquinn/challenges-assignments | challenge00/program.cpp | /*
* File: program.cpp
* Author: <NAME>
*
*/
#include <iostream>
#include <string>
using namespace std;
/// Function: isTidy
/// Description: Determines if a number is tidy.
/// Time Complexity: O(m) if m is the number of digits in input
/// Space Complexity: O(1)
bool isTidy (int input) {
string num_string = ... | ALGO | 0.999153 | 5.408203 | {
"github_metadata": {
"branch": "master",
"commit_count": 73,
"repo_created_at": "2021-10-05T00:51: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": "36fe75b0a... |
c724b4ae-fce7-4499-99bd-b1808879b4fb | anubansal17/Coding-Career-Journey | RoadMap/37_FlattenBTToLinkedList.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.999992 | 6.078891 | {
"github_metadata": {
"branch": "master",
"commit_count": 901,
"repo_created_at": "2020-02-09T14:11: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": "a258b159... |
c542f97e-300a-40fd-9571-7ae3a258b6a5 | sahilsharma20/Leet-Code-Problems | Arrays/Two_sum.cpp | #include <iostream>
#include <vector>
using namespace std;
class Solution
{
public:
vector<int> twoSum(vector<int> &arr, int x)
{
vector<int> v(2);
int n = arr.size();
for (int i = 0; i < n; i++)
{
for (int j = i + 1; j < n; j++)
{
if (arr... | ALGO | 0.999986 | 6.265704 | {
"github_metadata": {
"branch": "main",
"commit_count": 248,
"repo_created_at": "2024-12-15T16:09:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "a58bd973a5... |
7824189e-2909-4ef7-be62-d88c724b0a6a | glbitm-coder/LeetCode-and-GeeksForGeeks-solutions | 0463-island-perimeter/0463-island-perimeter.cpp | class Solution {
public:
int xDir[4] {0, 0, 1, -1};
int yDir[4] {1, -1, 0, 0};
int dfs(int curr_x, int curr_y, int rows, int cols, vector<vector<int>> &grid, vector<vector<bool>> &visited){
int val = 4, xVal = 0, yVal = 0;
int ans = 0;
visited[curr_x][curr_y] = true;
for... | ALGO | 0.999911 | 5.865143 | {
"github_metadata": {
"branch": "main",
"commit_count": 1570,
"repo_created_at": "2022-11-16T05:30: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": "cf8f38d92... |
c1cd5d43-8217-4682-a986-6ac928ed9e12 | montsigur/PAMSI-lab05 | generujGraf.hpp | // <NAME>
// nr albumu 218705
#ifndef GENERUJGRAF_HPP
#define GENERUJGRAF_HPP
#include <ctime>
#include <cstdlib>
#include "graf.hpp"
#include "permutacje.hpp"
using namespace std;
int silnia(int n) {
if (n < 0)
return -1;
else if (n < 2)
return 1;
else
return n * silnia(n-1);
}
void polac... | ALGO | 0.985095 | 4.216861 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2016-04-27T16:58: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": "3480b97f2... |
c8f671b4-bf92-464e-a5e7-f76e97466073 | bulletphysics/bullet3 | src/BulletSoftBody/BulletReducedDeformableBody/btReducedDeformableBodySolver.h | #ifndef BT_REDUCED_DEFORMABLE_BODY_DYNAMICS_WORLD_H
#define BT_REDUCED_DEFORMABLE_BODY_DYNAMICS_WORLD_H
#include "BulletSoftBody/btDeformableBodySolver.h"
#include "btReducedDeformableContactConstraint.h"
class btReducedDeformableBody;
class btReducedDeformableBodySolver : public btDeformableBodySolver
{
protected:... | ALGO | 0.947754 | 6.288204 | {
"github_metadata": {
"branch": "master",
"commit_count": 9404,
"repo_created_at": "2011-04-12T18:45:08.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 13557,
"forks": 2973,
"issues": 238,
"pull_requests": 141
},
"file_meta": {
"content_id"... |
88de7f17-89aa-4453-ab29-8a99d9946c46 | arthurma2001/leetcode | c++/leetcode/22.cpp | /*
22. Generate Parentheses
Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.
Example 1:
Input: n = 3
Output: ["((()))","(()())","(())()","()(())","()()()"]
Example 2:
Input: n = 1
Output: ["()"]
Constraints:
1 <= n <= 8
**/
#include <iostream>
#incl... | ALGO | 0.999638 | 6.226365 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2022-09-03T16:32: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": "04240a1a5735... |
09a1658b-bbcb-4042-9b2c-f8b068bd077b | kaletap/cracking | linked_list/linked_list.cpp | #include "linked_list.h"
#include "node.h"
#include <iostream>
#include <cstddef>
#include <unordered_set>
#include <deque>
LinkedList::LinkedList(int value) {
Node* head = new Node(value);
this->head = head;
}
LinkedList::LinkedList(int* values, int n) {
Node* head = new Node(values[0]);
this->head ... | TOOL | 0.975381 | 3.360764 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2019-01-27T13:45: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": "944326e448... |
c245a039-2d9a-474b-add5-0dc642eddfa3 | MrIncog/Snek | snek_1.1.h | #pragma once
typedef enum { LEFT, UP, RIGHT, DOWN, NOWAY } t_direction;
#include <vector>
class Cell
{
public:
t_direction next_in_cycle; // следующая клетка в гамильтоновом цикле
bool is_taken; // занята ли клетка яблоком или частью змейки
Cell* adjacent[4]; // соседние клетки
Cell();
};
class Snake
{
pro... | ALGO | 0.997977 | 4.049838 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2021-12-09T21:02: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": "b9dfe8087882... |
2e3899c4-b75b-4bf8-b5ba-94ce59f4ee71 | ShelpAm/competitive_programming | competitest/NowCoder/unknown_contest/简单题/main.cpp | #pragma once
// Problem: 简单题
// Contest: unknown_contest
// Judge: NowCoder
// URL: https://ac.nowcoder.com/acm/contest/106899/C
// Start: Sun 06 Apr 2025 05:42:27 PM CST
// Author: ShelpAm
// #include <bits/stdc++.h>
#include <algorithm>
#include <bit>
#include <bitset>
#include <cassert>
#include <chrono>
#include ... | ALGO | 0.999991 | 4.912574 | {
"github_metadata": {
"branch": "main",
"commit_count": 69,
"repo_created_at": "2024-02-12T16: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": "aa6e5cb6aa0... |
74848e24-9fe2-47dc-83b2-3afd2450daee | User-Howard/Howard-OJ | ZeroJudge/a349.cpp | #include <iostream>
using namespace std;
const int MAX_SIZE = 1<<16;
int MS[MAX_SIZE]={0}, RD[MAX_SIZE]={0};
void load(int rd, int ms){
RD[rd] = MS[ms];
}
void store(int md, int rs){
MS[md] = RD[rs];
}
void add(int rd, int rs1, int rs2){
RD[rd] = RD[rs1] + RD[rs2];
}
void move(int rd, int rs){
RD[rd] ... | ALGO | 0.992758 | 4.300315 | {
"github_metadata": {
"branch": "master",
"commit_count": 1370,
"repo_created_at": "2021-05-19T13:19:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9f3aff1... |
c99b2fb8-e5f6-45f4-a373-a729cff26395 | jbhartman99/HartmanJacob_CSC5_40718 | Hmwk/Assignment 5/Gaddis_7thEd_Chap6_Prob2/main.cpp | /*
File: main.cpp
Author: <NAME>
Created on January 26, 2015, 4:39 PM
Purpose: Gaddis, 7th Edition, Chapter 6, Problem 3
Title: Winning Division
*/
//System Libraries
#include <iostream>
#include <string>
#include <iomanip>
#include <cstdlib>
using namespace std;
//User Libraries
//Global Constants
/... | ALGO | 0.960043 | 4.410458 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2015-01-07T03:42:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e9c6a4c60... |
c34cf756-ceaf-48e1-a2b2-bc905adf9f93 | gudfhr95/Algorithm-Cpp | BOJ/11658.cpp | #include <iostream>
using namespace std;
int N, M;
int a[1025][1025];
int tree[1025][1025];
void update(int x, int y, int val) {
for (int i = x; i <= N; i += (i & -i)) {
for (int j = y; j <= N; j += (j & -j)) {
tree[i][j] += val;
}
}
}
int sum(int x, int y) {
int result = 0;
for (int i = x; i ... | ALGO | 0.99985 | 5.186891 | {
"github_metadata": {
"branch": "main",
"commit_count": 825,
"repo_created_at": "2021-07-29T11:33: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": "28ce06388d... |
bf7a0a30-0797-4a7c-bab7-025a402d2956 | YayuanZhang/UWSN | ns-2.30/underwatersensor/uw_mac/GeoMAC/GOAL.h | #ifndef __GOAL_H__
#define __GOAL_H__
/***********************************************************
* This is a geo-routing MAC designed in cross-layer approach
* It smoonthly integrates VBF and handshake to avoid collisions
* and guarantee a better reliability
* The corresponding conference paper is
@inproceeding... | TOOL | 0.932821 | 3.973169 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2018-04-17T03:15:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7551df876... |
990bdf33-a4a2-4b7b-af34-5263bdbbbea9 | Silverhorse7/Problem-Solving-Training | codeforces/459/C.cpp | #include<bits/stdc++.h>
#define ll long long
using namespace std;
const int N = 2020 * 2 + 1000;
int n, k, d;
/*
* print the student busses in days [1,d]
* for(int i = 0 ; i <d;i++){
* for(int j =0 ; j <n;j++)
* cout<<ans[i][j]<<' ';
* cout<<endl;
* }
*/
vector<vector<int>> ans;
void solve(int i, ve... | ALGO | 0.999817 | 3.325134 | {
"github_metadata": {
"branch": "master",
"commit_count": 565,
"repo_created_at": "2022-05-04T17:49:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "88b424cd... |
26d27aba-7778-42cf-a8a9-d3c474635660 | Jayden-Nyamiaka/Graphics__Pipeline-Shaded-Surface-Rendering | transformation.cpp | #include <cstdlib>
#include <vector>
#include <fstream>
#include <sstream>
#include <iostream>
#include <assert.h>
#include <time.h>
#include "utils.h"
#include "transformation.h"
using Eigen::Vector3f;
Matrix4f translation(float tx, float ty, float tz) {
Matrix4f m;
m << 1, 0, 0, tx,
0, 1, 0, ty,
... | ALGO | 0.90406 | 4.843258 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2022-12-18T21:50: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": "1c2f067173... |
77fb1525-2455-4b8c-ad4b-b7c7c2e0d69a | GarageGames/Torque3D | Engine/source/math/mPlane.h | //-----------------------------------------------------------------------------
// Copyright (c) 2012 GarageGames, LLC
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restrictio... | ALGO | 0.969445 | 7.147376 | {
"github_metadata": {
"branch": "development",
"commit_count": 3540,
"repo_created_at": "2012-09-18T20:33:56.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 3358,
"forks": 1193,
"issues": 309,
"pull_requests": 64
},
"file_meta": {
"content_... |
fbc4ca59-b1ad-4517-ab69-a1535f4ffef8 | cpp-core/sort | include/core/sort/fixed_sort.h | // Copyright (C) 2022, 2023 by <NAME>
//
#pragma once
#include <algorithm>
namespace core::sort {
template<class Compare>
class conditional_swap {
public:
conditional_swap(Compare&& cmp)
: _compare(std::forward<Compare>(cmp)) {
}
inline void operator()(auto a, auto b, size_t l) const {
if (not _co... | ALGO | 0.999898 | 6.305829 | {
"github_metadata": {
"branch": "main",
"commit_count": 77,
"repo_created_at": "2023-04-24T21:11:12.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "a72dea77f6e7... |
ef1818a0-8054-4cbc-af94-cc3204a36af5 | rociomelara7/LabosFunda | corto 4 programacion/25alumnos.cpp | #include <iostream>
#include <conio.h>
using namespace std;
void alturaalumno(int n, float x[ ]){
int i;
for (int i = 0; i < n; i++)
{
cout << "Ingrese la altura del alumno " << i + 1 << " : " << endl;
cin >> x[i];
}
}
float promedio(float x[ ]){
int i;
float suma = 0;
... | TOOL | 0.985909 | 3.705453 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2020-03-27T03:36: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": "5b7576b82... |
02b99f23-c518-4354-a136-1af81832cd60 | Shubham-9798/competitive-programming | youtubeCodingblock/countingMoneyProblem.cpp | #include<iostream>
#include<bits/stdc++.h>
using namespace std;
void countCurrency(int amount)
{
int notes[9] = { 2000, 500, 200, 100,
50, 20, 10, 5, 1 };
//sort(notes,notes+9);
int noteCounter[9] = { 0 };//all initilizes to zero
// count notes using Greedy approach
for (int i... | ALGO | 0.947646 | 3.711979 | {
"github_metadata": {
"branch": "master",
"commit_count": 58,
"repo_created_at": "2018-04-04T02:21:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "81cd238c4... |
214ffdad-6caf-4546-9487-467a1b1ae6d2 | Tahsin005/Algorithms | Practice/B_Restore_the_Weather.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define Tahsin ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
const ll N = 1e7 +7;
// vector<bool> visited(N,false);
bool visited[N] = {false};
int main(){
Tahsin
ll t;
cin >> t;
while(t--)
{
ll n, k;
cin ... | ALGO | 0.999987 | 4.06097 | {
"github_metadata": {
"branch": "main",
"commit_count": 56,
"repo_created_at": "2023-07-27T16:26: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": "a7c5ad3b534... |
921549e1-3f68-4898-aa21-2fa32eff78fa | JanJureStojanovic/UL-FRI-Algorithms-and-data-structures-1 | lectures/lecture_4/lecture_4_code.cpp | #include <iostream>
#include <string>
#include <utility>
#include <vector>
#include <array>
#include <map>
#include <set>
#include <algorithm>
#include <random>
using namespace std;
template<typename T>
void print(vector<T> sez) {
for (T x : sez) cout << x << " ";
cout << endl;
}
class BinaryHeap {
public:
... | ALGO | 0.996814 | 3.814138 | {
"github_metadata": {
"branch": "main",
"commit_count": 104,
"repo_created_at": "2023-10-01T18: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": "bbceb0ec8c... |
7ffed201-702e-4356-a189-6f2097909e77 | ViniR-RB/ifpi-ads-algoritmos2021-Vinicius-Roosevelt | c++/lista 1/lista 2/q8.cpp | /* Leia o salário de funcionários de uma empresa, calcule e escreva o novo salário (segundo os
critérios descritos abaixo), a soma dos salários atuais, a soma dos salários reajustados e a
diferença entre as 2 somas. (Flag: salário=0) */
#include <stdio.h>
#include <iostream>
int main(){
using namespace std;
cou... | TOOL | 0.961531 | 3.402556 | {
"github_metadata": {
"branch": "main",
"commit_count": 89,
"repo_created_at": "2021-05-19T16:00:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ceb317c77b9... |
0105b074-07f3-4fb3-be67-d9ba5e1f9f57 | miscalculation53/library | template/template_algo.hpp | #pragma once
#ifndef INF
#define INF 4'000'000'000'000'000'037LL
#endif
#include "template_types.hpp"
#include "template_rep.hpp"
#include "template_vector.hpp"
/**
* @brief テンプレート(アルゴリズム)
* @docs docs/template/template_algo.md
*/
template <class V>
auto SUM(const V &v)
{
typename V::value_type s{};
fec(vi :... | ALGO | 0.999347 | 5.5814 | {
"github_metadata": {
"branch": "main",
"commit_count": 448,
"repo_created_at": "2024-08-26T10:23:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 7,
"pull_requests": 0
},
"file_meta": {
"content_id": "4a90e9098e... |
269ab64b-450b-4e13-af6d-6c0af1e32e6b | isyanthony/algorithm | Luogu/Special_Practice/ch01-dp/list-2/P1020.cpp | #include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define pb push_back
#define mm memset
#define LL long long
#define FAST ios::sync_with_stdio(false) , cin.tie(0) , cout.tie(0)
#define rep(i , a , b) for(int i=a;i<=b;i++)
#define per(i , a , b) for(int i=a;i>=b;i--)
const int INF = 0x3f3f... | ALGO | 0.999741 | 3.361596 | {
"github_metadata": {
"branch": "master",
"commit_count": 30,
"repo_created_at": "2021-12-06T12:45:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1e3d8e083... |
3a61f74c-2194-4b7e-b848-ce76ccda25fc | WU-SUNFLOWER/My-LeetCode-Solutions | src/binary_tree/binary-tree-maximum-path-sum.cc | /**
* 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.999987 | 6.272298 | {
"github_metadata": {
"branch": "main",
"commit_count": 66,
"repo_created_at": "2024-09-16T05:41: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": "43f92838d1f... |
2340b7bf-892a-423f-9548-b3cf5a86be2d | Shaan-X/CP-31-Sheet | 800-Rated/A_We_Need_the_Zero.cpp | #include <bits/stdc++.h>
#define ll long long
const double PI = 3.14159265358979323846;
const ll MOD = 1e9 + 7;
template<typename T>T gcd(T x, T y){if(y==0)return x;else return gcd(y,x%y);}
#define loop(i, a, n) for (int i = a; i < n; i++)
using namespace std;
int solve(){
int n; cin >> n;
vector<int> arr(n);
... | ALGO | 0.999957 | 4.36539 | {
"github_metadata": {
"branch": "main",
"commit_count": 84,
"repo_created_at": "2025-02-11T12:56: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": "246b9c1fa1a... |
b287d079-b5d3-4780-9de1-ae225d405d29 | jongwuner/ps-study | exercise/BOJ/14500.cpp | #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
const int MAX = 600;
const int LEFT = 6;
int N, M, hei, wid, bn, sn, ans, board[MAX][MAX];
int tboard[MAX][MAX];
void turn() {
for (int j = 0; j < bn + LEFT; j++) {
for (int k = 0; k < bn + LEFT; k++) {
tboard[k][j] = board[j][bn + LEF... | ALGO | 0.999946 | 3.991293 | {
"github_metadata": {
"branch": "master",
"commit_count": 119,
"repo_created_at": "2018-11-07T15:03:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 8,
"pull_requests": 0
},
"file_meta": {
"content_id": "35a4def3... |
cd1c6f34-ecc9-4a65-8a97-b1aaecf032ed | amueller/GPU-Quickshift-Python-Bindings | main.cpp | #include "Image.h"
#include "Exception.h"
#include <fstream>
#include "quickshift_common.h"
#include <cutil_inline.h>
void write_image(image_t im, const char * filename)
{
/********** Copy from matlab style **********/
Image IMGOUT(im.K > 1 ? Image::RGB : Image::L, im.N2, im.N1);
for(int k = 0; k < im.K; k++)
... | ALGO | 0.971309 | 5.198699 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2011-06-15T16:56:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "38032e97a... |
3ab383c1-07ff-46c1-9f6c-97c7b7a7f621 | imjoyhalder/Live-Contest- | Codechef/Starters-173/Overwrite.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
vector<int> getCyclicShift(const vector<int>& B, int shift) {
vector<int> shifted(B.begin() + shift, B.end());
shifted.insert(shifted.end(), B.begin(), B.begin() + shift);
return shifted;
}
vector<int> findLexMinArray(int N, ... | ALGO | 0.999995 | 4.170595 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2025-01-04T16:47: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": "bdbfe29946f... |
67abe7f2-b646-4f8d-99ad-5110658b0825 | Yohello1/idk-what-name | testing/ccc/lightHeavy.cpp | #include <bits/stdc++.h>
#include <vector>
#include <algorithm>
#include <cmath>
#define INF 1e9
std::vector<std::string> lines;
std::map<char, int> lightHeavyIndex;
int n = 0;
void heavyChars(int index)
{
// search each character, get the value from map, and then, add to it
for(int i = 0; i < n; i++)
{... | ALGO | 0.999559 | 4.286826 | {
"github_metadata": {
"branch": "main",
"commit_count": 520,
"repo_created_at": "2023-03-21T04:55:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a7c94990c7... |
7a863d2f-4852-4822-9a60-72269c230465 | Drrany/Algorithms_Code | C&C++/School_curriculum/Recursion/05Merge_sort/912_SortanArray.cpp | #include <vector>
using namespace std;
class Solution
{
public:
void Merge(vector<int> &arr, int left, int mid, int right) // 将排好序的两段元素[left,mid]和[mid+1,right]合并
{
int *copy = new int[right - left + 1];
int i = left, j = mid + 1, index = 0;
while (index < right - left + 1)
{
... | ALGO | 0.999997 | 5.789826 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2020-08-22T03:13:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "78e68d15ff... |
c2c6163a-f25b-4091-b716-3c6e41945b41 | yryrgogo/data-structure-algorithm | utils/old_prime_factor.cpp | // #include <bits/stdc++.h>
#include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <algorithm>
#include <numeric>
#include <tuple>
#include <map>
using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define repd(i, a, b) for (ll i = (ll)(a); i < (ll)(b... | ALGO | 0.999815 | 4.098196 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2022-07-27T12:36: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": "bf84656de422... |
319e1154-38eb-49f4-9027-1fde877eff88 | luongphambao/cattuong | OOP.KHCL/19521242-TH5/19521242-TH/bai5/HCN.cpp | #include<iostream>
#include "HCN.h"
using namespace std;
HCN::HCN()
{
dai = 0;
rong = 0;
}
HCN::~HCN()
{}
bool HCN::Check()
{
Point *s = GetCoor();
double xAB = pow(s[0].x - s[1].x, 2);
double yAB = pow(s[0].y - s[1].y, 2);
double xBC = pow(s[1].x - s[2].x, 2);
double yBC=pow(s[1].y - s[2].y, 2);
double AB = sq... | ALGO | 0.988365 | 3.054549 | {
"github_metadata": {
"branch": "master",
"commit_count": 467,
"repo_created_at": "2020-02-15T11:59: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": "c077a6d8... |
87a051fc-d3b6-496f-a918-334c5abd9072 | bibocat12/data-visualization-app | header/State/Tree234/Tree234.h | #pragma once
#include <vector>
#include <string>
#include <iostream>
class Tree234 {
public:
struct Node {
std::vector<int> keys;
std::vector<int> nodes;
std::vector<Node*> children;
int edge;
bool isLeaf() const { return children.empty(); }
};
Tree234();
~Tree... | ALGO | 0.997185 | 5.086101 | {
"github_metadata": {
"branch": "main",
"commit_count": 124,
"repo_created_at": "2025-02-15T14:45: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": "4bed23f735... |
8268c1d5-702a-4aad-906b-13f6846b133a | abeaumont/competitive-programming | atcoder/abc149/e.cc | // https://atcoder.jp/contests/abc149/tasks/abc149_e
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll n, m;
vector<ll> a, b;
ll count(ll sum) {
ll c = 0;
for (int i = 0; i < n; i++) {
c += n - (lower_bound(a.rbegin(), a.rend(), sum - a[i]) - a.rbegin());
}
return c;
}
ll sum(ll sum)... | ALGO | 0.999958 | 3.801881 | {
"github_metadata": {
"branch": "master",
"commit_count": 2070,
"repo_created_at": "2018-01-15T20:00:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 568,
"forks": 185,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "504... |
0ac62d46-17c8-42c1-8439-ada4a79b59db | OlehZ17/lab6.4 | lab6.4(1).cpp | #include <iostream>
#include <iomanip>
#include <time.h>
#include <Windows.h>
using namespace std;
void Create(double*& a, const int size, const double Low, const double High)
{
a = new double[size];
for (int i = 0; i < size; i++)
a[i] = (High-Low) * rand()/RAND_MAX + Low;
}
void Print(double* a, const int size)
... | ALGO | 0.998901 | 3.797629 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2021-12-09T09:10: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": "3a91f741a121... |
21a6d17e-82cc-41a1-8b43-c6741da3314c | ultraman257/ant-farm | main.cpp | #include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Double_Window.H>
#include <FL/Fl_Box.H>
#include <thread>
#include <iostream>
#include <random>
#include "Person.h"
#include "Building.h"
const int pCount = 100;
Person *p[pCount];
Fl_Button *pBox[pCount];
std::vector<std::vector<int>> houseArray;
Fl_Doub... | ALGO | 0.931374 | 4.289413 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2023-06-16T22:19: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": "a119455623... |
fc0358a9-7f46-4d94-9ade-d3a550471112 | EugeoSynthesisThirtyTwo/INT23 | AlphaBeta/AlphaBeta/src/main.cpp | #include <iostream>
#include <vector>
#include <string>
#include <sstream>
#include "timer.h"
#define INFINI 999
int min(int a, int b)
{
return (a < b) ? a : b;
}
int max(int a, int b)
{
return (a > b) ? a : b;
}
class Node
{
private:
std::string key;
bool feuille;
int value;
std::vector<Node*> fils;
int bM... | ALGO | 0.999928 | 3.6019 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-06-02T12:32: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": "a3cb3d680d... |
f11de6bd-c3c9-426b-bfbd-bbdcbd16c702 | siddu2355/assignments2 | os-programs/Able-Baker-2_servers.cpp | #include <stdio.h>
#include <conio.h>
#include <stdlib.h>
#include <iostream>
#include <malloc.h>
#include <time.h>
using namespace std;
int main()
{
srand((unsigned)time(NULL));
int n, i, id = 0, sta = 0, stb = 0, st1, st2;
struct node
{
int idno;
int at;
int st;
int rst;
int tt;
int wt;
int ft;
... | ALGO | 0.996366 | 3.536229 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-08-05T15:17: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": "513f62262ce9... |
8bd4790b-e42e-474e-84fe-189dc111d6b3 | ishandutta2007/codeforces-m | maximumshot/normal/656/B.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <time.h>
#include <set>
#include <string>
#include <tuple>
#include <fstream>
#include <stdio.h>
#include <cstring>
#include <map>
#include <queue>
#include <bitset>
#include <list>
#include <stack>
#include <math.h>
using namespace std;
#define vec ... | ALGO | 0.999613 | 3.495314 | {
"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": "27aa43b2c6d2... |
64801b2e-d7a6-4a62-a712-c8fd1d41f3fd | WaliDev/WALi-OpenNWA | Source/wali/wfa/ITrans.hpp | #ifndef wali_wfa_ITRANS_GUARD
#define wali_wfa_ITRANS_GUARD 1
/*!
* @author <NAME>
*/
#include <iostream>
#include "wali/Common.hpp"
#include "wali/Markable.hpp"
#include "wali/Printable.hpp"
#include "wali/SemElem.hpp"
#include "wali/KeyContainer.hpp"
#include "wali/TaggedWeight.hpp"
#include "wali/util/WeightCha... | TOOL | 0.91509 | 7.306159 | {
"github_metadata": {
"branch": "master",
"commit_count": 2130,
"repo_created_at": "2012-11-13T21:30:53.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 18,
"forks": 14,
"issues": 2,
"pull_requests": 2
},
"file_meta": {
"content_id": "582714... |
b8ea4dd9-1d73-4691-a233-63d7ba358d2d | Seulwoo/SSU_LikeSeal-Study-Group04 | Algo/2020-10/1003/seulwoo_1.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
#define min(a,b) a<b?a:b
using namespace std;
int move_x[4] = { 0,0,1,-1 };
int move_y[4] = { -1,1,0,0 };
int main(void) {
int N, L, R;
scanf("%d %d %d", &N, &L, &R);
int A[50][50] = { {0,} };
for (int r = 0; r < N; r++) {
for (int c =... | ALGO | 0.999923 | 3.581926 | {
"github_metadata": {
"branch": "master",
"commit_count": 161,
"repo_created_at": "2020-08-29T05:49:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "559290a1... |
17fd4f7e-5a5d-4571-adbc-4816b84aaa29 | MATF-RS20/RS015-ipds-iterated-prisoners-dilemma-simulation | IPDS_QT_Project/simulation.cpp | #include "simulation.h"
Simulation::Simulation(const unsigned foodNo, std::vector<unsigned> &specimenNoInfo)
: m_foodNo(foodNo)
{
m_specimenNo = std::accumulate(std::begin(specimenNoInfo), std::end(specimenNoInfo), 0);
m_graphInfo.update(specimenNoInfo);
int size = static_cast<int>(specimenNoInfo.size... | ALGO | 0.997274 | 4.722268 | {
"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": "c48d8c6d5... |
cb167f00-2b62-4c58-970c-fef1ffe16562 | cinderlee/Minesweeper | Minesweeper.cpp | //
// Minesweeper.cpp
//
// Created by <NAME> on 9/22/17.
// Copyright © 2017 <NAME>. All rights reserved.
//
// Purpose: Simulate a minesweeper game for the user to interact with
#include <vector>
#include <cstdlib>
#include <iostream>
#include <ctime>
using namespace std;
struct Cell {
int numberBomb = 0;
... | TOOL | 0.939369 | 5.174353 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2017-09-25T16:52:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "08eb904cf8... |
13e7480b-73b7-4ea8-b1ac-1541c36ade5e | AdamczykMaciej/CTasks | Task/Solution.cpp | #include <iostream>
#include <string>
#include <cstring>
/*
*
* For dynamically allocated strings(type char* as arrayString), create a function
* replaceString that takes three parameters, each of type arrayString: source, target,
* and replaceText.
* The function replaces every occurrence of target in source ... | ALGO | 0.986587 | 3.663737 | {
"github_metadata": {
"branch": "master",
"commit_count": 32,
"repo_created_at": "2018-02-08T15:36: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": "21bc2922a... |
e71cbb36-9db3-412c-8769-e7f11bafde9f | JonahEgashira/competitive-programming | joi6-8.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using P = pair<int,int>;
const int N = 200005;
int J[N];
int O[N];
int I[N];
int JO[N];
int JI[N];
signed main() {
int n;
string s;
cin >> n >> s;
for (int i = 0 ; i < n; i++) {
J[i + 1] += J[i] + (s[i] ==... | ALGO | 0.999931 | 3.416371 | {
"github_metadata": {
"branch": "master",
"commit_count": 169,
"repo_created_at": "2020-05-19T15:56: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": "bbb4e789... |
6fce5572-d874-4064-ae94-753344686714 | akankshadixit/rankbased_SkipList | rank_skiplist.cpp | #include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include<algorithm>
#include<sstream>
#include <vector>
#include <string.h>
#include<rank_skiplist.h>
#include<sha256.h>
using namespace std;
//===================================================Private Member Functions======================================... | ALGO | 0.999872 | 3.59486 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2018-05-16T12:27: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": "cff1aabbc1... |
77b891e8-9afa-4309-94dd-b2e3a5ac5951 | hoangpc0112/dsa-ptit | Đồ thị nâng cao/DSA10001 - TÌM ĐƯỜNG.cpp | #include <bits/stdc++.h>
using namespace std;
#define FOR(i, a, b) for (auto i = (a); i <= (b); ++i)
#define ROF(i, a, b) for (auto i = (a); i >= (b); --i)
#define sz(x) (int)(x).size()
#define pb push_back
#define ppb pop_back
#define endl '\n'
#define fi first
#define se second
#ifdef Juhan404
#include "debug.h"
#e... | ALGO | 0.999948 | 4.379762 | {
"github_metadata": {
"branch": "main",
"commit_count": 54,
"repo_created_at": "2024-01-24T10:22:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a26807d510b... |
9d8311a3-e985-44d8-b269-a3973fcaba7e | mdurrer/cgd | tutorial/lodev.org/cgtutor/files/fourier1d.cpp | /*
Copyright (c) 2004-2007, <NAME>
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following... | ALGO | 0.993967 | 5.309127 | {
"github_metadata": {
"branch": "master",
"commit_count": 65,
"repo_created_at": "2016-02-26T10:52:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6e689d4be... |
b77b47e9-729d-4cca-8139-5233ed79aec3 | daydramas/competitive-programming | CSES/1661.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace __gnu_cxx;
using namespace std;
const int N = 200010;
struct custom_hash {
static uint64_t splitmix64(uint64_t x) {
// http://xorshift.di.unimi.it/splitmix64.c
x += 0... | ALGO | 0.999926 | 4.547246 | {
"github_metadata": {
"branch": "master",
"commit_count": 534,
"repo_created_at": "2021-04-11T20:23: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": "042a3259... |
a5eee911-0889-4f73-a071-0ef8f163a436 | aminul-38/random-cpp | KnapSack.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 1e4;
int value[N], weight[N];
int DP[N][N];
int KnapSack(int element, int nk_weight_left)
{
if (element < 0)
return 0;
if (nk_weight_left <= 0)
return 0;
if (DP[element][nk_weight_left] != -1)
return DP[element][nk_weight_le... | ALGO | 0.999994 | 4.303547 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2023-06-12T18:17: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": "e78c2cd49cd5... |
520fc043-cb9c-4f54-9dfb-2092af09a705 | yeon-kyu/algorithm_exercise | 카카오기출/2022 kakao 신고 결과 받기.cpp | #include <string>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <iostream>
using namespace std;
map<string, set<string>> mapOfReported; // <블럭당한 사람, 신고한 사람들>
vector<string> blocked;
vector<string> split(string str) {
vector<string> v;
int pos = str.find(' ');
v.push_back(s... | ALGO | 0.999721 | 5.027602 | {
"github_metadata": {
"branch": "main",
"commit_count": 121,
"repo_created_at": "2020-12-01T14:51: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": "cc901c1657... |
e0624683-f0ec-4db2-91ce-9fd4b9c2f761 | tritic/c-Algorithm | prob_11367.cc | #include<queue>
#include<vector>
#include<iostream>
using namespace std;
//solved
//dijkstra; each step move one unit along the chosen road, and minimize its cost;
const int INF=100000+10;
int idx,n,m;
int cost[1001]; //the cost to reach the target
vector<vector<int> > froms(1000); // Es from same node;
int dp... | ALGO | 0.999932 | 3.873137 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2015-05-22T19:01:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7045899e95... |
1fc1a7bb-e70b-46d4-984f-1f0a60a69b35 | hmazhar/physbam_public | PhysBAM_Tools/Matrices/MATRIX_2X2.h | //#####################################################################
// Copyright 2003-2007, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>.
// This file is part of PhysBAM whose distribution is governed by the license contained in the accompanying file PHYSBAM_COPYRIGHT.txt.
//######... | ALGO | 0.997775 | 5.969267 | {
"github_metadata": {
"branch": "master",
"commit_count": 41,
"repo_created_at": "2014-04-02T21:48:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 30,
"forks": 13,
"issues": 2,
"pull_requests": 1
},
"file_meta": {
"content_id": "0ebdec5... |
c1423e83-3ff6-4725-9753-d0e4e4d0878a | Swoorup/prj-reboot | vice_convert/DEPENDENCIES/libgtaformats/gtaformats/util/image.cpp | /*
Copyright 2010-2013 David "Alemarius Nexus" Lerch
This file is part of gtaformats.
gtaformats 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 lat... | TOOL | 0.985737 | 5.192305 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2015-03-06T14:29:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d23bd209dc... |
566c270d-0da3-4a95-a54f-59891d08fce0 | ankita0335/-CrackYourInternship | Difficulty: Medium/Minimize the Heights II/minimize-the-heights-ii.cpp | //{ Driver Code Starts
// Initial template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// User function template for C++
class Solution {
public:
int getMinDiff(vector<int> &arr, int k) {
int n = arr.size();
if (n == 1) return 0;
sort(arr.begin(), arr.... | ALGO | 0.999591 | 5.620985 | {
"github_metadata": {
"branch": "main",
"commit_count": 1033,
"repo_created_at": "2024-07-15T14:20: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": "40bc4d4a3... |
50c398db-5c3f-4747-9bc2-10bf5c9c71a5 | TakeKiyo/DARP | specified_vector.cpp | #include <iostream>
#include <vector>
#include <random>
using namespace std;
void removeElement(vector<int> &vector, int index);
void removeElement(vector<int> &vector, int index) {
vector.erase(vector.begin()+index);
}
int main(){
cout << "tes" << endl;
vector<vector<int> > vec;
vector<int> temp;
... | ALGO | 0.998854 | 3.121573 | {
"github_metadata": {
"branch": "master",
"commit_count": 367,
"repo_created_at": "2019-11-21T02:23: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": "2b889d8b... |
6f351031-9029-41a3-a67f-f258fef124c7 | alexandrerays/computational_physics | introduction-to-programming/introduction-programming/maio-28-3.2.cpp | #include<stdio.h>
#include<conio.h>
#include<stdlib.h>
void preencher_matriz(int **m, int l, int c){
for(int i=0; i<l; i++)
for(int j=0; j<c; j++)
m[i][j]=(rand()%10);
}
int imprimir_matriz(int **m, int l, int c){
for(int i=0; i<l; i++){
printf("\n");
for(int j=0; j<c; j++)
... | TOOL | 0.927502 | 4.189823 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2023-01-26T23:14: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": "e063ef2d1a... |
f5b0193a-09ee-4fb4-8dba-fc3d3a0387f8 | NagatoYuki0943/CPPLearn | 08/26_functional.cpp | #include <iostream>
#include <vector>
#include <functional>
using namespace std;
void test1(){
plus<int> plus;
cout << plus(1, 2) << endl;
minus<int> minus;
cout << minus(1, 2) << endl;
multiplies<int> multiplies;
cout << multiplies(1, 2) << endl;
divides<int> divides;
cout << divid... | TOOL | 0.967684 | 4.577823 | {
"github_metadata": {
"branch": "master",
"commit_count": 51,
"repo_created_at": "2021-01-03T12:58:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e9a6ea6ca... |
df606327-9942-431a-b836-1d6307302a43 | radoslawniewiadomski/Fondamenti2023-2024 | esercitazioni/esercitazione_20_marzo/esercizio12_10.cpp | #include <iostream>
#include <ctime>
using namespace std;
bool MatriceSimmetrica(int mat[][2], int rig, int col) {
for (int i=0; i<rig; i++)
for (int j=0; j<col; j++)
if (*(*(mat + i) + j) != *(*(mat + j) + i))
return false;
return true;
}
void RiempiMatrice(int mat[][2], int rig, int col) ... | ALGO | 0.999063 | 4.658677 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2024-02-10T15:55:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6bb935774... |
5f7fb401-4867-4211-8a6e-add400b87f1d | n3k0fi5t/competitive_programming | atcoder/B171/c.cpp | #include<map>
#include<list>
#include<queue>
#include<iostream>
#include<unordered_set>
#include<set>
#include<vector>
#include<cmath>
#include<algorithm>
#define ull unsigned long long
#define ll long long
#define mp make_pair
#define imei(...) "[ "<< #__VA_ARGS__ <<" = "<< __VA_ARGS__ <<" ] "
using namespace std;... | ALGO | 0.99998 | 3.440057 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2020-08-04T11:51: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": "bba8addb4b... |
a26dd201-ca7e-45eb-9cd6-9331d9f66ae2 | ykdy3951/Baekjoon | 1620.cpp | #include <bits/stdc++.h>
using namespace std;
#define fio ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define endl '\n'
#define ll long long
#define INF 987654321
#define sc1(a) scanf("%c", &a)
#define ss1(a) scanf("%s", s)
#define sd1(a) scanf("%d", &a)
#define sd2(a, b) scanf("%d %d", &a, &b)
#define sd3(... | ALGO | 0.99977 | 3.803941 | {
"github_metadata": {
"branch": "main",
"commit_count": 815,
"repo_created_at": "2020-12-20T10:17: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": "532878f6ba... |
8cee0c41-92e0-40cf-a935-bbbaa4a6cb7a | shanky1947/Data-Structures-and-Algorithm | Coding Ninjas/Lec-19- Graphs1/2_has_path.cpp | /*
Code : Has Path
Send Feedback
Given an undirected graph G(V, E) and two vertices v1 and v2(as integers), check if there exists any path between them or not. Print true or false.
V is the number of vertices present in graph G and vertices are numbered from 0 to V-1.
E is the number of edges present in graph G.
Input ... | ALGO | 0.999915 | 5.341455 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2020-11-12T13:47: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": "a1ccab8655... |
4a9da8da-2dd0-4404-bb25-e7ba1b3ff0ae | Gemechu-Asfaw/Leetcode-Problems | 01_Matrix/submission1.cpp | class Solution {
public:
vector<vector<int>> updateMatrix(vector<vector<int>>& mat) {
int m = mat.size(), n = mat[0].size();
vector<vector<bool>> visited(m, vector<bool>(n, false));
queue<pair<int, pair<int, int>>> q;
vector<vector<int>> ans(m, vector<int>(n));
for (int i=0;... | ALGO | 0.999929 | 6.333234 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2025-05-15T06:01:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "57702f2e83fa... |
779099f9-7511-4db0-a943-058ed0e8ff34 | Kyogre223/Competitive-programming_practice_set | CodeForces/303C. WoodCutters.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll n, a, b;
int main() {
cin >> n;
vector<pair<ll, ll>>t(n);
for (int i = 0; i < n; ++i) {
cin >> a >> b;
t[i] = make_pair(a, b);
}
vector<vector<ll>>dp(n, vector<ll>(3, 0));
dp[0][1] = 1;
if ((n > 1 && t[1].... | ALGO | 0.999977 | 3.929567 | {
"github_metadata": {
"branch": "master",
"commit_count": 162,
"repo_created_at": "2023-08-31T16:46: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": "411d1512... |
648221cc-6705-4b26-912e-5f606b497b9f | AmrKhaled77/data-structer-assignment-2 | problem4/problem4.cpp | #include <iostream>
using namespace std;
const int SIZE = 50;
struct node {
string name;
int severity;
int timestamp;
node() {}
node(string n, int s, int t) {
name = n;
severity = s;
timestamp = t;
}
};
class priority_queue {
node heap[SIZE];
int count;
v... | ALGO | 0.999493 | 5.783113 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2025-05-08T21:40: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": "15537cc2f0... |
19834852-9e5f-49a4-81e2-0edbda0005bf | AMReX-Astro/Castro | Exec/science/planet/problem_initialize_state_data.H | #ifndef problem_initialize_state_data_H
#define problem_initialize_state_data_H
#include <prob_parameters.H>
#include <eos.H>
#include <model_parser.H>
#include <ambient.H>
AMREX_GPU_HOST_DEVICE AMREX_INLINE
void problem_initialize_state_data (int i, int j, int k,
Array4<Real> cons... | ALGO | 0.997928 | 5.126943 | {
"github_metadata": {
"branch": "main",
"commit_count": 9932,
"repo_created_at": "2015-01-21T20:10:37.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 322,
"forks": 101,
"issues": 92,
"pull_requests": 25
},
"file_meta": {
"content_id": "0f6b... |
f2e39f3b-1297-48ed-85aa-4d7d94a46821 | prabhaKaranpy/Dynamic_Programming | LC_983.cpp | class Solution { // MEMOIZATION - DP
public:
int f(int i, vector<int> &days, vector<int> &costs, unordered_set<int> &sett, int &n, vector<int> &dp){
// base case
if(i > days[n-1]) return 0;
// if the current day is not in days[], just skip and continue as well as possible!
i... | ALGO | 0.999502 | 5.180189 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2024-10-31T11:24: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": "41026a264cb... |
7fc84be6-01d1-40de-a9cb-b7515a371cce | Johndisc/leetcode | n123.h | //
// Created by 58253 on 2023/1/12.
//
#ifndef LEETCODE_N123_H
#define LEETCODE_N123_H
#include "global.h"
class Solution {
public:
int maxProfit(vector<int>& prices) {
int total = 0;
int leftmax = 0, leftmin = prices[0];
vector<int> rightprice(prices.size(), 0);
int rightmax = pr... | ALGO | 0.99985 | 6.016288 | {
"github_metadata": {
"branch": "master",
"commit_count": 36,
"repo_created_at": "2022-07-15T07:32: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": "2538ae374... |
95480ee0-711e-487a-999c-1bce624162bd | amitray1608/PCcodes | codechef/CCDSAP/nonzero.cpp | //“Make it work, make it right, make it fast.” – <NAME>
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double dd;
const int siz = 1e6 + 5;
const int MOD = 1e9 + 7;
#define endl '\n'
#define deb(x) cout << #x << " = " << x << endl;
void solve(){
int n;
cin >> n;
int a[n];
int sum = 0, pr... | ALGO | 0.999897 | 3.964088 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2020-10-19T07:31: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": "ffc51a810... |
711c7c5f-3aed-49db-952a-60ff8992d424 | divyuk/LeetCode | 0241-different-ways-to-add-parentheses/0241-different-ways-to-add-parentheses.cpp | class Solution {
public:
vector<int> diffWaysToCompute(string expression) {
vector<int> results;
// Base case: if the string is empty, return an empty list
if (expression.length() == 0) return results;
// Base case: if the string is a single character, treat it as a number
... | ALGO | 0.999973 | 6.961046 | {
"github_metadata": {
"branch": "main",
"commit_count": 3516,
"repo_created_at": "2022-09-02T15:18:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b8cc632f4... |
9d7183fd-dbf1-4254-9459-c378158e87f6 | ishandutta2007/codeforces-c | cookiedoth/normal/796/B.cpp | /**********
* *
* HELLO *
* *
**********/
#include <iostream>
#include <fstream>
#include <vector>
#include <set>
#include <map>
#include <array>
#include <bitset>
#include <algorithm>
#include <cmath>
#include <string>
#include <cstdlib>
#include <stdio.h>
#define ll long long
#define mp make_pair
#... | ALGO | 0.999973 | 3.943293 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:17:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b78994c42580... |
2b13d786-51d7-4d2e-adc0-33e51ff32cbb | devid8642/Algorithms-and-Data-Structures | problems/problem078/main.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, c, s;
int cont = 0;
int pos = 1;
int posi[105];
cin >> n >> c >> s;
for (int i = 0; i < n; i++)
posi[i] = i + 1;
if (s == 1)
cont = 1;
for (int i = 0; i < c; i++) {
int x;
... | ALGO | 0.999906 | 3.361557 | {
"github_metadata": {
"branch": "master",
"commit_count": 335,
"repo_created_at": "2020-11-27T00:29:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "098aee0d... |
705b353d-0911-49c4-bd98-234b81f42530 | Aturaya25/SLAU | mainwindow.cpp | #include "mainwindow.h"
#include "./ui_mainwindow.h"
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
, ui(new Ui::MainWindow)
{
ui->setupUi(this);
this->setWindowTitle("Решение СЛАУ");
changeEq();
connect(matrix, SIGNAL(editFinish()), this, SLOT(changeEq()));
}
MainWindow::~MainW... | ALGO | 0.991358 | 5.525517 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2022-09-05T12:45: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": "e072a41b984a... |
d51f5b6b-41da-4bb0-a156-c327902bad3e | VarunKumarBantupalli/DataStructures_With_CPP | insertAtMiddle.cpp | #include <iostream>
using namespace std;
class Node
{
public:
int data;
Node *next;
Node(int a)
{
this->data = a;
this->next = nullptr;
}
};
void insertAtHead(Node *&head, int d)
{
Node *temp = new Node(d);
temp->next = head;
head = temp;
}
void insertAtMiddle(Node *&head... | ALGO | 0.999766 | 5.145475 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-11T12:26: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": "84c9d5739b70... |
177c0b73-a494-4239-8d10-68576a2483fa | Prakash-sa/Competitive-Programming | graph/1192. Critical Connections in a Network.cpp | //https://leetcode.com/problems/critical-connections-in-a-network/
class Solution {
public:
int cnt=0;
vector<bool>vis;
vector<vector<int>>adj;
vector<vector<int>>res;
vector<bool>ap;
vector<int>low,tin;
void dfs(int start,int p){
vis[start]=true;
cnt++;
int childr... | ALGO | 0.999981 | 5.49792 | {
"github_metadata": {
"branch": "master",
"commit_count": 240,
"repo_created_at": "2019-08-27T18:29:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "59f83e4a... |
5d3be874-c4ab-4946-9edf-fa0028de47c0 | ryanzhang15/RJ_HKOI | J183.cpp | #include <bits/stdc++.h>
#define ef else if
using namespace std;
typedef long long _;
typedef string str;
typedef const long long constant;
constant maxn = 5E3+8; //not sure what size
_ n, m, k, sr, sc, er, ec, cnt;
struct outputStatement {
str dir;
_ len;
} o[maxn];
outputStatement ms(str dir, _ len);
void fin... | ALGO | 0.999842 | 3.125324 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2025-02-03T18:14:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3268a363a1ba... |
be649ef8-4186-4df3-a18d-973c8b652810 | PaulConradRCC/CSC_11_BASE | arm32/russe/russe.cpp | /* * PROGRAMMER: <NAME>
* PROBLEM TITLE: Multiplcation a la Russe
* PROBLEM DEFINITION: This program contains the multiplication a la Russe algorithm that is
* introduced in: Fundamentals of Algorithmics by <NAME>, <NAME>
* DATE: 4/9/2016
* SYSTEM - HARDWARE: Intel i7
* - SOFTWARE: GNU C++, Open Suse Linux 13
* ... | ALGO | 0.999993 | 5.4491 | {
"github_metadata": {
"branch": "master",
"commit_count": 66,
"repo_created_at": "2022-05-27T00:29:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cb7607dbb... |
e33946d2-2422-4c81-9b90-efd81afd2546 | FallingStar624/GSDS3_Algo | FallingStar/0x1D/BOJ_11779.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
#define INF 987654321
using namespace std;
int V, E, st, en, u, v, w;
int dist[1001];
int pre[1001];
vector<pair<int, int>> edges[1001];
int main(void) {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
cin >> V;
cin >> E... | ALGO | 0.999996 | 4.154142 | {
"github_metadata": {
"branch": "main",
"commit_count": 1008,
"repo_created_at": "2022-03-30T08:56:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ec5b4bd8b... |
d1ae1c0d-657b-4720-b99a-eb91ad526785 | ekov1/FMI---Introduction-to-Programming-2020 | Tasks/04. Put Queens/04. Put Queens.cpp | #include <iostream>
using std::cout;
using std::endl;
int const BOARD_SIZE = 8;
int board[BOARD_SIZE][BOARD_SIZE];
int boardQueens[BOARD_SIZE][BOARD_SIZE];
int counter = 0;
void InitializeBoard();
void PrintBoard(int board[][BOARD_SIZE]);
bool PutQueens(int n, int numOfQueensOnBoard = 0, bool havePutAllQueens = 0);... | ALGO | 0.99834 | 4.743134 | {
"github_metadata": {
"branch": "main",
"commit_count": 31,
"repo_created_at": "2020-10-23T19:14: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": "6cf78b8c6f6... |
f43a175b-722e-4d9a-a5a0-4c32a2b17c66 | OmarMuhammmed/Data-Structure | CPP/array.cpp | #include <iostream>
using namespace std;
void insert(int arr[], int& n, int value, int pos, int capacity) {
if (n >= capacity) {
cout << "Array is full, can't insert!" << endl;
return;
}
for (int i = n; i > pos; i--) {
arr[i] = arr[i - 1];
}
arr[pos] = value;
n++;
}... | ALGO | 0.999475 | 5.496172 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2024-12-02T04:28: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": "56924a65b7a... |
5b8cea68-a2b1-4988-ba2b-1d3977a48628 | 23520761/NMLT_Struct | 23520713_BT05/Bai246/Bai246.cpp | #include<iostream>
using namespace std;
struct SoPhuc
{
float Thuc, Ao;
};
typedef SoPhuc SOPHUC;
void Nhap(SOPHUC&);
void Nhap(SOPHUC[][100], int& m, int& n);
int KiemTra(SOPHUC[][100], int m, int n, int d);
int Dem(SOPHUC[][100], int, int);
int main()
{
SOPHUC a[100][100];
int m, n;
Nhap(a, m, n);
cout << De... | ALGO | 0.999077 | 3.609917 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2023-11-12T16: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": "8555baa57d9... |
ec0be4f6-627d-42cf-9a60-77a4ee922051 | jhyang13/UWMadison-ME759-HPC | HW07/HW07_3/task3.cpp | // task3.cpp
/*After completing my test,
I requested suggestions from ChatGPT
for improving the code.*/
#include <iomanip>
#include <cstdio>
#include <ctime>
#include <iostream>
#include <random>
#include <chrono>
#include <cuda.h>
#include <curand_kernel.h>
#include <cuda_runtime.h>
#include <iostream>
#include <thr... | ALGO | 0.996256 | 4.897001 | {
"github_metadata": {
"branch": "main",
"commit_count": 63,
"repo_created_at": "2023-09-10T22:07: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": "aac6d3b1e56... |
09de272c-3522-4893-ab08-7bbc4066601b | NASD-Bulgaria/egt-training | Rosen Karadinev/STL-HomeWork/10. ShortestWay/10. ShortestOperations.cpp | #include <iostream>
#include <list>
#include <string>
#include <algorithm>
#include <iterator>
#include <sstream>
using namespace std;
int main()
{
list<int> values;
int n,m;
cout << "Enter N: ";
cin >> n;
cout << "Enter M: ";
cin >> m;
string sequence = "";
stringstream ss;
ss << n;
sequence.append(ss.... | ALGO | 0.999946 | 3.839968 | {
"github_metadata": {
"branch": "master",
"commit_count": 230,
"repo_created_at": "2014-09-04T12:47:37.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b479e09ba... |
6eeefcb7-5cb4-40da-85b1-e16e805ea50a | P-SUBHAM/LeetCode | 3646-sum-of-good-subsequences/3646-sum-of-good-subsequences.cpp | // Approach 1: DP Counting technique
class Solution {
public:
int sumOfGoodSubsequences(vector<int>& nums) {
int N = 1e5+2, n = nums.size();
vector<long long> cnt(N,0);
vector<long long> sum(N,0);
long long totSum = 0;
int mod = 1e9+7;
for(int i = 0; i < n; i++) {
... | ALGO | 0.999996 | 5.398954 | {
"github_metadata": {
"branch": "main",
"commit_count": 1834,
"repo_created_at": "2022-06-10T18:59:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c9a7b0dcb... |
f935732f-8f6f-4f26-9699-5318be25b367 | DEEPANSHI558/cpp-codes | log.cpp | #include<bits/stdc++.h>
using namespace std;
int getMax(int arr[], int n)
{
stack<int> t;
int m_area = 0;
int k;
int area;
int i = 0;
while (i < n)
{
if (t.empty() || arr[t.top()] <= arr[i])
t.push(i++);
else
{
k = t.top();
t.pop... | ALGO | 0.999667 | 3.190473 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2022-06-10T18:52: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": "3016e05d022... |
6601da14-4055-47e8-9601-df938bf307a6 | HRF05/DMOJSolutions | dmopc21c7p2.cpp | #pragma GCC optimize("Ofast,unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,fma")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
typedef long long unsigned llu;
typedef pair<int,int> pii;
typede... | ALGO | 0.999984 | 4.444576 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2022-08-10T03:36: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": "89af0200317... |
db4b7c99-8468-4a6a-825b-b62b0c023ca2 | MateyApostolov/Olimpiici_D | multiplier.cpp | #include <bits/stdc++.h>
using namespace std;
const int maxn = 30002;
long long pref1[maxn], pref2[maxn];
int main () {
int n, m, r;
cin >> n >> m >> r;
pref1[1] = 1;
pref1[0] = 1;
for(int i = 2; i <= n; i++) {
pref1[i] = (pref1[i - 1] * i) % m;
}
pref2[n] = n % m;
pref2[n + 1]... | ALGO | 0.999987 | 3.523381 | {
"github_metadata": {
"branch": "main",
"commit_count": 168,
"repo_created_at": "2024-09-18T18:24: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": "4f40552d54... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.