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 |
|---|---|---|---|---|---|---|---|
ec079381-abbe-4c9c-a13d-5e6f41bb7de0 | WillemKauf/AdventOfCpp | 2017/solns/19.cpp | /////////////////
//// std
/////////////////
#include <cctype>
#include <string>
#include <vector>
/////////////////
//// local
/////////////////
#include "../common/advent_base.h"
#include "../common/common.h"
#include "../common/read_input.h"
#include "grid.h"
namespace AOC2017 {
struct day_19 : public Advent_type... | ALGO | 0.999983 | 5.517839 | {
"github_metadata": {
"branch": "master",
"commit_count": 101,
"repo_created_at": "2023-09-28T23:53:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5f5f56ed... |
a5dcf308-1bee-45e5-b095-43bcff0238f3 | atanughosh01/Leetcode-grinder | Permutation with Spaces - GFG/permutation-with-spaces.cpp | // { Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// Problem : https://practice.geeksforgeeks.org/problems/permutation-with-spaces3627/1
class Solution {
private:
void fun(int i, string curr, vector<string> &ans, string &s){
if (i == s.size()-1){
... | ALGO | 0.997358 | 6.112538 | {
"github_metadata": {
"branch": "main",
"commit_count": 4265,
"repo_created_at": "2022-01-11T06:48: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": "726936faa... |
131323b9-fbe7-4b15-bc62-c7443510b4d8 | Mistsink/PAT-Advanced | 1022-digit-lib.cpp | #include <iostream>
#include <unordered_map>
#include <set>
using namespace std;
unordered_map<string, set<string>> names, authors,
keys, publisher, years;
void print(set<string>& s) {
if (s.empty()) cout << "Not Found\n";
for (auto t: s) {
cout << t << "\n";
}
}
int main() {
... | ALGO | 0.95355 | 3.763039 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2022-08-08T12:44:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "aba0f6eba692... |
1f389d48-3962-41fd-9705-9570681acd73 | Lukkai/PAMSI_1_Stack | Stosy/main.cpp | #include <iostream>
#include <fstream>
#include <ctime>
#include <cmath>
#include "TStack.hpp"
#include "LStack.hpp"
using namespace std;
int main()
{
string fileName = "data100000.txt";
bool print = false;
unsigned int stackSize = 100000;
clock_t start, stop, time_1, time_2;
StackTab<int> stos_1(stackSize);
... | TOOL | 0.915559 | 4.367831 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2021-06-14T07:57:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "43cdbde9f... |
49285cc1-5c7d-40b1-8720-33cbd1e8619e | dani-tro/DAA_practicum_23_24 | Exam 2/students-solutions/mytsvetkov/Krisi_01_40p.cpp | #include <bits/stdc++.h>
#define MAXN 100010
using namespace std;
int n, m, k, q, a, b, c;
//to, cost
vector<pair<int, int>> gr[MAXN];
int d[MAXN];
bool visited[MAXN];
vector<int> places;
vector<int> ans;
//dist, to
priority_queue<pair<int, int>> pq;
void dijkstra(int v){
d[v] = 0;
pq.push({d[v], v});
wh... | ALGO | 0.999962 | 4.199853 | {
"github_metadata": {
"branch": "main",
"commit_count": 63,
"repo_created_at": "2024-02-16T11:05:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ebd28c239f7... |
7a11b6cb-9032-4614-b58c-8815c58461cd | SLAM7F3/projects | src/mains/games/ttt/test_ttt_network.cc | // ==========================================================================
// Program TEST_TTT_NETWORK imports a neural network trained via
// reinforcement learning in program TTT. It then uses the trained
// network to play against a human opponent.
// =============================================================... | ALGO | 0.990781 | 5.358072 | {
"github_metadata": {
"branch": "master",
"commit_count": 949,
"repo_created_at": "2019-01-17T10:42:23.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 5,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e6b17323d... |
0de7359b-3e9e-4787-afde-6034b387a5e5 | ritwishi/Data_Structure_and_Algorithms | Linked list/Remove duplicate from sorted linked list/Remove_duplicate-1.cpp | #include <bits/stdc++.h>
using namespace std;
struct Node
{
int data;
Node *next;
Node(int data)
{
this->data = data;
this->next = NULL;
}
};
void print(Node *head)
{
Node *curr = head;
while (curr != NULL)
{
cout << curr->data << " ";
curr = curr->n... | ALGO | 0.999626 | 4.072346 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2023-07-27T07:13: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": "ea58f8dbdeb... |
abcbab33-a1dd-4e37-bfef-b4207208e1a3 | manongEric/C- | alorithm/oj538_2re.cpp | /*************************************************************************
> File Name: oj538_2re.cpp
> Author:
> Mail:
> Created Time: Wed 30 Mar 2022 10:56:22 PM CST
************************************************************************/
#include<iostream>
using namespace std;
int arr[25][25], mark[30], n, ... | ALGO | 0.999865 | 3.576514 | {
"github_metadata": {
"branch": "main",
"commit_count": 25,
"repo_created_at": "2022-08-27T12:45: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": "4b6e72be342... |
ce9d4952-befb-4e56-9906-77e7e7d1c6ff | cmyang1218/Leetcode | 210-course-schedule-ii/course-schedule-ii.cpp | class Solution {
public:
vector<int> findOrder(int numCourses, vector<vector<int>>& prerequisites) {
vector<int> ret;
unordered_map<int, int> inDegrees;
vector<vector<int>> graph(numCourses);
for (int i = 0; i < numCourses; i++) {
inDegrees[i] = 0;
}
for (... | ALGO | 0.999991 | 6.372575 | {
"github_metadata": {
"branch": "main",
"commit_count": 929,
"repo_created_at": "2024-01-17T16:58:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4c4044ee57... |
44f4f72f-bfff-47df-a339-c2d046017015 | Shailendra1703/DSA | Backtracking/Nqueens.cpp | #include <iostream>
using namespace std;
int count = 0;
bool isSafe(int **arr, int x, int y, int n)
{
// for column
for (int i = 0; i < x; i++)
{
if (arr[i][y] == 1)
return false;
}
int row = x;
int col = y;
// left up diagonal
while (row >= 0 && col >= 0)
{
... | ALGO | 0.99996 | 5.500128 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2022-02-09T09:41: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": "17508d0e9... |
b84f7a2d-e8c5-4e08-987b-2688647db9ea | harryuan65/Minishogi | Minishogi/Transposition.h | #ifndef _TRANSPOSITION_H_
#define _TRANSPOSITION_H_
#include <assert.h>
#include "Types.h"
#include "Zobrist.h"
struct TTentry {
uint32_t key32; // 4 Bytes
int16_t value; // 2 Bytes
int8_t depth; // 1 Bytes
Move move; // 4 Bytes
enum Bound : uint8_t { // 1 Bytes
UNKNOWN = 1,
FAILHIGH = 2,
E... | ALGO | 0.982334 | 5.283678 | {
"github_metadata": {
"branch": "master",
"commit_count": 116,
"repo_created_at": "2017-11-14T14:01:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bc6e7c2e... |
e4a1d67c-0261-488c-a9c8-582a3d23364f | RowenaZhong/codespace | 202410/Week8/P1349.cpp | #include <bits/stdc++.h>
using namespace std;
template <typename T>
inline void readi(T &x)
{
T f = 1;
x = 0;
int ch;
while (ch = getchar(), !feof(stdin) && !isdigit(ch) && ch != '-')
;
if (ch == '-')
f = -f, ch = getchar();
while (!feof(stdin) && isdigit(ch))
{
x = (... | ALGO | 0.999981 | 4.159343 | {
"github_metadata": {
"branch": "main",
"commit_count": 376,
"repo_created_at": "2024-10-18T07:20: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": "241f1566c2... |
4ec4280a-097b-4960-bc24-1d08e1939ba9 | wodexinxin2015/MultiPhase-SPH-Solver | Vector3.h | /************************************************************************************
Multi-Phase and Parallelized SPH program
--parallelized and optimized for SMP (Symmetric multiprocessing ) architecture.
--Copyright (c) 2018-2023, <NAME>, GeoHohai, Hohai University.
**************************************************... | TOOL | 0.993374 | 4.721023 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2023-05-05T06:15:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "76b7c308c73... |
c914fcfc-a15e-48e3-86cc-7b459769a6cb | supudo/contests | codeforces/859/B/solve.cpp | // @supudo
// g++ -O2 -std=gnu++14 -Wall -Wextra -Wfatal-errors -Wshadow -Wno-vla-extension -pedantic -o solve solve.cpp -DLOCALHOST -D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC
#include <bits/stdc++.h>
using namespace std;
#define _ ios::sync_with_stdio(false); cin.tie(nullptr); cout.precision(10);
#define forto(var,... | ALGO | 0.999895 | 4.220747 | {
"github_metadata": {
"branch": "master",
"commit_count": 39,
"repo_created_at": "2019-07-09T06:38: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": "d34caa587... |
5038bf77-b6e1-475f-9605-c3d8e37c9e5d | jackros1022/Segmenter-1.0 | apps/SegmenterTests/Segmenter.cpp | /**
* Copyright (C) 2012
* <NAME>, <NAME>, <NAME>
* Automation and Control Institute
* Vienna University of Technology
* Gusshausstraße 25-29
* 1170 Vienn, Austria
* ari(at)acin.tuwien.ac.at
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of... | ALGO | 0.993395 | 4.193514 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2017-06-10T13:17:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c228124eef... |
9a4e700b-ac9f-4295-be9d-1cc30f7338da | mezotaken/numerical-methods | LabWork1_a/model.cpp | #include "model.h"
//Реализация функций структуры model0
double model0::count(double x,double v)
{
return -5*v/2;
}
void model0::set(double i_x0,double i_u0,
double i_h, double i_end, double i_epsBrd,
double i_epsCtrl, int i_maxStep, bool i_isStepFixed)
{
x0 = i_x0;
u0 = i_u0;
... | ALGO | 0.999613 | 4.162939 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2022-09-20T11:44:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7cab39fb5665... |
fd95983d-3564-4010-afcd-61321eb79852 | goel-aman/CompetitiveCoding | LeetCode_Problem/MergeKSortedList.cpp | // Merge k Sorted Lists
// Problem Statement
// You are given an array of k linked-lists lists, each linked-list is sorted in ascending order.
// Merge all the linked-lists into one sorted linked-list and return it.
// Example 1:
// Input: lists = [[1,4,5],[1,3,4],[2,6]]
// Output: [1,1,2,3,4,4,5,6]
// Explanati... | ALGO | 0.999964 | 6.076792 | {
"github_metadata": {
"branch": "master",
"commit_count": 1081,
"repo_created_at": "2020-08-18T14:58:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0daaf24... |
a64a655d-01b2-4c16-b109-273cdb3136da | robotlyb/HW3_Whitebox_Testing | 3.cpp | #include <iostream>
#include <stdio.h>
using namespace std;
void fuzhi(int temp,int i,int j,int num);
int judge(int temp,int i,int j);
int numOfNode(int *node,int n,int temp);
int m = 0;
typedef struct{
int first;
int second;
char state;
}ctj;
ctj s[200];
int l[200][200] ;
int main()
{
int num = ... | ALGO | 0.999646 | 3.88234 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2013-11-06T09:49: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": "d17442e561... |
83497313-d3ef-4e5f-ad07-919fc73623a4 | raincross7/code-similarity | codes/train_code/problem226/problem226_397.cpp | #include <algorithm>
#include <climits>
#include <iostream>
#include <string>
#include <utility>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <iomanip>
#include <cmath>
using namespace std;
using ll = long long int;
template <class T> ostream &operator<<(ostream &os, vector<T> &v) {
for... | ALGO | 0.999931 | 3.373396 | {
"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": "735bc71b94a1... |
df9ef73b-4fe4-4cf5-b2d1-a6fc1a842bb0 | zhanglidada/code | sword_to_offer/28_isSymmetricTree.cpp | #include <iostream>
#include <vector>
using namespace std;
// Definition for a binary tree node.
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode(int x) : val(x), left(NULL), right(NULL) {}
};
class Solution {
public:
bool isSymmetric(TreeNode* root) {
// 根节点为空,直接return true
ret... | ALGO | 0.999984 | 6.246123 | {
"github_metadata": {
"branch": "master",
"commit_count": 94,
"repo_created_at": "2021-08-06T01:12: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": "2aa6b44ed... |
14bfa8cc-cdee-4e62-aa07-263bdf4ef63f | DavidLCPyML/Algorithms | codeforces/contests/UTPC/Jan27/FlushThrowingC.cpp | #include <bits/stdc++.h>
using namespace std;
#define vi vector<int>
#define vd vector<double>
#define pii pair<int, int>
#define pdd pair<double, double>
#define vpdd vector<pdd>
#define vpii vector<pii>
#define ll long long
#define vl vector<ll>
#define fastio ios::sync_with_stdio(false);cin.tie(0);
#define mp mak... | ALGO | 0.999732 | 3.728215 | {
"github_metadata": {
"branch": "main",
"commit_count": 61,
"repo_created_at": "2023-05-28T00:39: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": "ff076402900... |
bb6b7e9e-eecd-4733-af3b-f314db54ac4e | imsanjoykb/Computer-Science-Study | 03. Discrite Mathematics Lab/Lab Work - 15.cpp | /*
Write a function to store a function (polynomial/expression), and then evaluate the ploynomial.
(For example store f(x) = 4n^3 + 2n + 9 in an array and for a given value of n, say n=5, evaluate. (i.e.
compare the value of f(5)).
*/
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
cout... | ALGO | 0.998721 | 4.60469 | {
"github_metadata": {
"branch": "master",
"commit_count": 86,
"repo_created_at": "2022-11-14T17:18:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "afb1381bc... |
9dc7316e-f646-4d8e-9dcc-40b4ad22414d | pedroBhering/TrabalhoDeIA | c++/buscaIrrevogavel/buscaIrrevogavel.cpp | #include <iostream>
#include <random>
using namespace std;
void imprimeMat(char** mat, int n){
for(int i = 0; i < n; i++){
for(int j = 0; j < n; j++)
cout << mat[i][j] << "\t";
cout << endl;
}
}
char verificaRegra(char** mat, char* vet, int n, int line , int col){
bool passCo... | ALGO | 0.999121 | 3.183362 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2023-09-18T23:50: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": "67a14237e75... |
0a9b8683-fdb8-4b94-912e-6d2e7bc8fe5c | MathieuCarriere/multipers | dionysus_vineyards/geometry/weighted-l2distance.h | #ifndef __L2_DISTANCE_H__
#define __L2_DISTANCE_H__
#include <utilities/types.h>
#include <utilities/log.h>
#include <vector>
#include <fstream>
#include <functional>
#include <cmath>
#include <string>
#include <sstream>
typedef std::vector<double> Point;
typedef std::vec... | ALGO | 0.979364 | 6.679152 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2020-10-21T21:26:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 10,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "62c01d1616... |
14e7e734-2a97-4c4e-bc8b-6e896e734b8a | shyam2347/leetcode_2022 | number_of_provinces.cc | class Solution {
public:
class QuickUnion {
public:
QuickUnion(int size) : root(size) {
for (int i = 0; i < size; i++) {
root[i] = i;
}
}
int find(int x) {
if (x == root[x]) {
return x;
}
return root[x] = find(root[x]);
}
... | ALGO | 0.999905 | 6.035592 | {
"github_metadata": {
"branch": "main",
"commit_count": 17,
"repo_created_at": "2022-01-16T00:56: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": "6623db1aa67... |
1687cbab-e65a-44af-baac-f443775cc665 | microsoft/WinObjC | Frameworks/Accelerate/blasDouble.cpp | //******************************************************************************
//
// Copyright (c) 2016 Intel Corporation. All rights reserved.
// Copyright (c) 2015 Microsoft Corporation. All rights reserved.
//
// This code is licensed under the MIT License (MIT).
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WAR... | TOOL | 0.95543 | 4.862052 | {
"github_metadata": {
"branch": "develop",
"commit_count": 3544,
"repo_created_at": "2015-06-23T23:14:58.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 6253,
"forks": 807,
"issues": 381,
"pull_requests": 10
},
"file_meta": {
"content_id": ... |
992aaf39-54ba-4ff0-99f7-913e1fe65e1f | PanagiotisIatrou/VelociFlow | Examples/SingleConvectionDiffusion/single_convection_diffusion_steady.cpp | #include <SingleConvectionDiffusionSteady.hpp>
#include <chrono>
#include <fstream>
#include <iostream>
#include <string>
const int grid_size_x = 30;
const int grid_size_y = 30;
const double domain_size_x = 1.0;
const double domain_size_y = 1.0;
const double viscosity = 0.01;
int main() {
// Create the mesh
M... | ALGO | 0.998556 | 6.095913 | {
"github_metadata": {
"branch": "main",
"commit_count": 244,
"repo_created_at": "2024-11-11T16:23:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1831d386ed... |
54767888-f9f2-4515-b6f6-9daa4b89525c | ishandutta2007/codeforces-t | tabr/normal/1251/E2.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, a, b) for (int i = (a); i < (b); i++)
int main() {
int q;
cin >> q;
while (q--) {
int n;
cin >> n;
vector<vector<ll>> v(n);
rep(i, 0, n) {
int m, p;
cin >> m >> p;
... | ALGO | 0.999727 | 3.568657 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:27: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": "3a9cbec37613... |
4f7ad793-e731-4bdc-b3ac-fb2762c59d96 | vuhoangminh/MedicalSensors_Report | Codes/libs/contourletHMT/utils.cc | //-----------------------------------------------------------------------------
// utils.cc
//-----------------------------------------------------------------------------
#include <stdio.h>
#include <string.h>
#include <math.h>
#include "utils.hh"
/*------------------------------------------------------------------... | TOOL | 0.993768 | 4.792517 | {
"github_metadata": {
"branch": "master",
"commit_count": 28,
"repo_created_at": "2016-10-25T15:17:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c70488fc2... |
97c06eb0-29ee-4058-85ce-927b893c1295 | kamrulcse404/cp | cp/phase 0/malfunction on codeforce/evenOddPositiveNegative.cpp | #include<iostream>
using namespace std;
int main()
{
int n, num, p = 0, neg = 0, even = 0, odd = 0;
cin >> n;
while(n--)
{
cin >> num;
if(num > 0)
{
p++;
if(num % 2 == 0)
{
even++;
}
else
{... | ALGO | 0.999933 | 4.261268 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-09-08T11:49: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": "9db7c59810d8... |
93f391da-fcf2-4565-9f3e-6035cb73e8cf | Yuvraj2172/myleetcode | 3439-find-minimum-diameter-after-merging-two-trees/3439-find-minimum-diameter-after-merging-two-trees.cpp | class Solution {
public:
int diameter(vector<vector<int>>& edges){
int n = edges.size() + 1 ;
vector<int> deg(n,0);
vector<vector<int>> adj(n);
for(auto it : edges){
auto u = it[0];
auto v = it[1];
adj[u].push_back(v); adj[v].push_back(u);
... | ALGO | 0.999555 | 5.57581 | {
"github_metadata": {
"branch": "main",
"commit_count": 2730,
"repo_created_at": "2023-01-08T08:54:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4af4a6ec7... |
e28f7aba-0aac-4982-b1ea-a54552d98242 | ChrisKimZHT/Algorithm-Problems | Contest/Codeforces/Other/Educational #138 (Rated for Div. 2)/B.cpp | #include <bits/stdc++.h>
#define int long long
using namespace std;
void solve()
{
int n;
cin >> n;
vector<pair<int, int>> p(n);
for (int i = 0; i < n; i++)
cin >> p[i].first;
for (int i = 0; i < n; i++)
cin >> p[i].second;
int max_spell_val = 0, max_spell_pos = 0;
for (int... | ALGO | 0.999959 | 4.162906 | {
"github_metadata": {
"branch": "master",
"commit_count": 366,
"repo_created_at": "2022-03-26T17:03:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7c8662df... |
ba8e8388-28ad-4450-a458-fcfa4d14feb5 | lekhraj718chouhan/cppcode03 | insertion_in_HEAP.CPP | // #include<iostream>
// #include <vector>
// using namespace std;
// class MaxHeap{
// private:
// vector<int> heap;
// void bubbleUp(int index){
// while (index > 0){
// int parentIndex = (index - 1) / 2;
// if (heap[index] <= heap[parentIndex]) {
// break;
// //i... | ALGO | 0.999484 | 4.099012 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-07-06T06:23:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5b1228addede... |
23e8da36-8f9b-4c30-b457-3493195818ec | ngthanhtrung23/CompetitiveProgramming | codeforces/234/G.cpp |
#include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a),_b=(b); i<=_b; i++)
#define FORD(i,a,b) for(int i=(a),_b=(b); i>=_b; i--)
#define REP(i,a) for(int i=0,_a=(a); i<_a; i++)
#define EACH(it,a) for(__typeof(a.begin()) it = a.begin(); it != a.end(); ++it)
#define DEBUG(x) { cout << #x << " = "; cout << (x) << en... | ALGO | 0.999634 | 3.987969 | {
"github_metadata": {
"branch": "master",
"commit_count": 4554,
"repo_created_at": "2019-04-04T14:21:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 90,
"forks": 17,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e326a... |
7cb727b8-8cda-4f88-b33b-f5a8bde2f52a | YaminLi/Leetcode | 132-palindromePartitionII/132-palindromePartitionII/main.cpp | //
// main.cpp
// 132-palindromePartitionII
//
// Created by Michael on 11/9/16.
// Copyright © 2016 Michael. All rights reserved.
//
#include <iostream>
#include <vector>
using namespace std;
class Solution{
public:
int minCut(string s){
int n=s.size();
if (n<=1) return 0;
vector<vec... | ALGO | 0.999803 | 5.711318 | {
"github_metadata": {
"branch": "master",
"commit_count": 42,
"repo_created_at": "2016-11-08T23:13:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0a32eb234... |
0a8a9ebb-7adc-43f8-a402-2eaeae75ae53 | hoangphu7122002/ICPC_academic | graph/DFS-tree/khopCauUndirect.cpp | #include <bits/stdc++.h>
using namespace std;
const int maxN = 1e6 + 1;
//O(N + M)
int n,m;
bool joint[maxN]; //check Khop-vertex
int timeDFS = 0;
int bridge = 0;
int low[maxN],num[maxN];
vector <int> g[maxN];
void dfs(int u,int pre){
int child = 0; //child of direct traversal
num[u] = low[u] = ++timeDFS;
... | ALGO | 0.999886 | 4.649494 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2022-10-21T17:01: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": "9fc19bc3e2c... |
5e844d00-2c21-4121-9144-a1871892fff0 | orbuluh/fundamental | problem_sets/sliding_window/fixed_size/substr_with_concat_of_all.h | class Solution {
public:
using WordCntDict = unordered_map<std::string_view, int>;
WordCntDict wordIdxTemplate_;
int wSz_ = 0;
int wordsCnt_ = 0;
vector<int> findSubstring(string s, vector<string>& words) {
wSz_ = words.front().size();
wordsCnt_ = words.size();
for (int i =... | ALGO | 0.999543 | 6.278528 | {
"github_metadata": {
"branch": "main",
"commit_count": 487,
"repo_created_at": "2022-06-23T13:20:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9c34465ca5... |
54ae1902-03c6-4bec-8ebf-6e47dfc9d573 | LQgdwind/Bit_DataStructure | week6/无向图的各连通分支/solution.cpp | #include "bits/stdc++.h"
using namespace std;
const int N = 1e5 + 10;
int st[N];
class Edge
{
public:
int e, ne;
}edge[N];
int h[N], idx;
inline void add(int a, int b)
{
edge[idx].e = b;
edge[idx].ne = h[a];
h[a] = idx++;
}
int n;
vector <int>v;
inline void bfs(int num)
{
queue<int>q;
q.push(num);
st[num] ... | ALGO | 0.999763 | 4.271371 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2022-09-07T03:33:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a4aff727d2... |
03af0cf3-12e4-41f7-8ed2-a3c3d422ad5b | quinoacomputing/quinoa | src/Inciter/Sorter.cpp | // *****************************************************************************
/*!
\file src/Inciter/Sorter.cpp
\copyright 2012-2015 <NAME>,
2016-2018 Los Alamos National Security, LLC.,
2019-2021 Triad National Security, LLC.
All rights reserved. See the LICENSE file f... | ALGO | 0.994754 | 5.544688 | {
"github_metadata": {
"branch": "develop",
"commit_count": 9101,
"repo_created_at": "2015-07-02T20:06:30.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 111,
"forks": 22,
"issues": 14,
"pull_requests": 2
},
"file_meta": {
"content_id": "30e... |
6abdc01e-2c4c-44cb-af63-1cf899a68b21 | hermetico/parallel-computing | matmul-cpp/dgemm.cpp | const char* dgemm_desc = "dgemm custom implementation";
#include <iostream>
#include <stdlib.h> /* malloc, free, rand */
#include <immintrin.h>
using namespace std;
#define min(a,b) (((a)<(b))?(a):(b))
unsigned int KC = 256;
unsigned int MC = 64;
unsigned int NR = 4;
unsigned int MR = 8;
unsigned int PADD = 4;
/... | ALGO | 0.999429 | 3.531438 | {
"github_metadata": {
"branch": "master",
"commit_count": 177,
"repo_created_at": "2017-09-06T09:57:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "409c498b... |
f3849800-c669-4a15-9244-c70187b686ee | suibianchun/cxcysj | project9/project.cpp | #include <stdio.h>
#include <string.h>
#include <stdint.h>
#include <thread>
#include <windows.h>
#define th_num 16
#define m_bits 10000000
static void dump_buf_32(uint32_t* buf, uint32_t len);
static void dump_buf_8(uint8_t* buf, uint32_t len);
uint32_t move(uint32_t data, int length);
uint32_t t(uint32_t input);
void... | ALGO | 0.987925 | 3.502402 | {
"github_metadata": {
"branch": "main",
"commit_count": 103,
"repo_created_at": "2023-07-05T04:59:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c924dd24e8... |
c5baf52c-0997-4c46-b1ee-e4a04c7d66b5 | Yawn-Sean/Daily_CF_Problems | daily_problems/2025/03/0322/personal_submission/cf617c_deckedge.cpp |
void solve() {
int n = read(), x1 = read(), y1 = read(), x2 = read(), y2 = read();
ve<pi> a(n);
rep(i, 0, n) {
int x = read(), y = read();
i64 dx = x - x1, dy = y - y1;
a[i].fi = dx * dx + dy * dy;
dx = x - x2, dy = y - y2;
a[i].se = dx * dx + dy * dy;
}
sor... | ALGO | 0.999672 | 3.844215 | {
"github_metadata": {
"branch": "main",
"commit_count": 20410,
"repo_created_at": "2024-02-26T01:04:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 478,
"forks": 302,
"issues": 0,
"pull_requests": 7
},
"file_meta": {
"content_id": "d3e1... |
9c4b8c69-39f3-424b-8047-bcbd441b32ac | walrus7521/code | toys/cbox/algo/random_cpp/Hash_csi.cpp | #include <iostream>
#include <unordered_set>
#include <string>
#include <vector>
using namespace std;
struct ContactList {
// Equal function for hash.
bool operator==(const ContactList& that) const {
return unordered_set<string>(names.begin(), names.end()) ==
unordered_set<string>(that.names.b... | ALGO | 0.995509 | 5.320463 | {
"github_metadata": {
"branch": "master",
"commit_count": 4820,
"repo_created_at": "2015-11-17T19:00:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 8
},
"file_meta": {
"content_id": "161d6ed... |
0171562d-bf9a-42e5-ad33-a38348d78218 | eraldoribeiro/semaphore-class | 02_producer_consumer/main.cpp | //
// Example from: http://www.amparo.net/ce155/sem-ex.c
//
// Adapted using some code from Downey's book on semaphores
//
// Compilation:
//
// g++ main.cpp -lpthread -o main -lm
// or
// make
//
#include <unistd.h> /* Symbolic Constants */
#include <sys/types.h> /* Primitive System Data Types */
#in... | ALGO | 0.998363 | 5.342704 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2017-11-09T00:26:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9b4ac3ab09... |
8d4d5493-ae78-4487-8d64-df4eed880a2d | CheYHinSpark/DVDM-2DRiemann | twoDRP_main/source/RedEquil_DVDDVM.cpp | #include <iostream>
#include <cmath>
#define _USE_MATH_DEFINES
#include <math.h>
#include "../include/RedEquil.h"
using namespace std;
double RedEquil_DVDDVM(double rho, double u, double E, double* rhoeq)
{
// 使用BFGS拟牛顿法,以Goldstein - Armijo rule选择步长
// 2022/03/04:由于使用GA法则出现了停不下来的困难,最终弃用,
// 使用简单的步长规则:从1... | ALGO | 0.999964 | 3.809273 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2022-03-14T12:05: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": "90bf8b6278... |
3315efcd-5f38-4a03-b87d-be9eb7c69587 | ipc2023-classical/planner17 | planners/symk/src/search/search_space.h | #ifndef SEARCH_SPACE_H
#define SEARCH_SPACE_H
#include "operator_cost.h"
#include "per_state_information.h"
#include "search_node_info.h"
#include <vector>
class OperatorProxy;
class State;
class TaskProxy;
namespace utils {
class LogProxy;
}
class SearchNode {
State state;
SearchNodeInfo &info;
public:
... | ALGO | 0.991785 | 7.303683 | {
"github_metadata": {
"branch": "latest",
"commit_count": 149,
"repo_created_at": "2023-02-07T11:08:49.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8da86c8d1... |
4dbc5ce2-a804-41f0-abcd-8fd656b8156b | arthurx07/fib-pro1 | exams/M1/X52952_en/grid.cc | // Input: An arbitrary number of cases, each of them consisting of three positive natural numbers n,m, side on one line.
// Output: grids with n*m squares with side 'side' as those shown in examples.
#include <iostream>
using namespace std;
int main() {
int n, m, side;
while (cin >> n >> m >> side) {
for (int... | ALGO | 0.99604 | 4.34953 | {
"github_metadata": {
"branch": "main",
"commit_count": 61,
"repo_created_at": "2023-10-03T18:34: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": "3f2ed53108f... |
03cff0e6-7e71-4d78-94bc-593820de259b | dianaamfr/MNUM_feup | exam/exam09_recurso/3_gradiente/Source.cpp | #include <iostream>
#include <cmath>
using namespace std;
double w(double x, double y) {
return -1.7 * x * y + 12.0 * y + 7.0 * pow(x, 2) - 8.0 * x;
}
double dwx(double x, double y) {
return -1.7 * y + 14.0 * x - 8.0;
}
double dwy(double x, double y) {
return 12.0 - 1.7 * x;
}
void gradiente(double x0, doubl... | ALGO | 0.999971 | 4.739209 | {
"github_metadata": {
"branch": "master",
"commit_count": 37,
"repo_created_at": "2019-12-09T19:18: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": "7395a9670... |
b7b2a427-a010-43bf-add3-396364a65fd9 | DemonJAZ/Algorithm-and-Design-Analysis- | RepBinarySearch.cpp | #include <iostream>
#include <limits.h>
using namespace std;
void BinarySearch(int arr[],int start,int end,int f,int &min,int &max)
{
int mid = (start+end)+1/2;
if(start<=end){
if(arr[mid]==f)
{
if(arr[mid-1]==f)
BinarySearch(arr,start,mid-1,f,min,max);
else
{
if(mid < min... | ALGO | 0.99958 | 4.455552 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2016-08-15T08:36:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "820d79b129... |
17b7064e-f45f-4e7e-b9a9-028899173f97 | PeiAllen/Code | Problems/USACO/2019/December/Platinum/main.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long int lli;
typedef pair<int,int> pii;
typedef pair<lli,lli> pll;
void sc(){}
template<typename T,typename... Args>
void sc(T& a, Args&... args) {cin>>a,sc(args...);}
template<typename T>
void pr(T a){cout<<a;}
template<typename T,typename... Args>
void pr(T ... | ALGO | 0.999316 | 3.96468 | {
"github_metadata": {
"branch": "master",
"commit_count": 392,
"repo_created_at": "2019-07-31T20:11:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f56b85fc... |
53a807be-ee88-4f96-957e-f811d4674ac6 | Imon739/Data-Structure_using-CPP | Sort_It_Again.cpp | #include <bits/stdc++.h>
using namespace std;
class Student {
public:
string nm;
int cls;
char s;
int id;
int math_marks;
int eng_marks;
};
bool compare(const Student& a, const Student& b) {
if (a.eng_marks != b.eng_marks) {
return a.eng_marks > b.eng_marks;
}
if (a.ma... | ALGO | 0.99346 | 3.603948 | {
"github_metadata": {
"branch": "main",
"commit_count": 27,
"repo_created_at": "2024-06-19T18:03:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7558f75b4e5... |
a12d92e8-1b73-4652-9034-8aeaa8015fd6 | Anguei/OI-Codes | LuoguCodes/P2431.cpp | #include <cmath>
#include <cctype>
#include <cstdio>
#include <cstring>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <string>
#include <vector>
#include <numeric>
#include <iomanip>
#include <iostream>
#include <algorithm>
#define ll long long
#define int unsigned long long
#define pc(x) put... | ALGO | 0.99992 | 3.236091 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-02-14T14:22: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": "251c87ab9a... |
cdce1f58-6c2c-47bc-a983-50d0714befc6 | lukmccall/nisko | 11/03/main.cpp | // Kompilacja: g++ -std=c++11 -o main.o -c main.cpp
#include <iostream>
#include <vector>
#include <emmintrin.h>
#include <smmintrin.h>
#include <algorithm>
#include <immintrin.h>
using namespace std;
const int dim=256;
const int N=dim;
float buffor[N];
void matmulSSE_v2(float mat1[N][N], float mat2[N][N], float re... | ALGO | 0.999719 | 4.451382 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2021-10-11T10:42: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": "19daffbb28f8... |
8f38af1c-fc19-435d-93b0-88c0a6374185 | charlesdccti/programming-contests | 2016/VI Olimpíada Interna de Programação do IFSULDEMINAS - OLIP 2016/as_aventuras_de_pakman.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n, m, c;
while (cin >> n >> m >> c && n) {
string str[n];
getline(cin, str[0]);
for (int i = 0; i < n; i++)
getline(cin,str[i]);
int p_x, p_y;
for (int i = 0; i < n; i++)
for (int j = 0; j < m; j++)
if (str[i][j] == '<'){ str[i][j]... | ALGO | 0.999959 | 3.812181 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2017-08-03T19:46:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cd01938a2... |
abb19504-234a-4592-900c-3aef4543d896 | Krisspal/Cpp | Kỹ thuật lập trình/BTH3: Con trỏ/BTH3_BT6.cpp | #include <iostream>
using namespace std;
void DAONGUOC(int* a, int n)
{
int* p, * q, temp;
p = a, q = a + (n - 1);
while (p < q)
{
temp = *p;
*p = *q;
*q = temp;
p++;
q--;
}
}
int main()
{
int n, * a, * p;
cout << "Nhap chieu dai cua mang\n";
cin >> n;
a = new int[n];
for (int i = 0; i < n; i++)
... | ALGO | 0.99848 | 3.654635 | {
"github_metadata": {
"branch": "main",
"commit_count": 203,
"repo_created_at": "2021-12-05T13:02:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9e72d10018... |
12e2611e-f905-4ecd-bef5-5db3bfa7cc60 | opencobra/cobratoolbox | src/analysis/sampling/BarrierRound/CMatrix/cholMex.cpp | #include <random>
#include <qd/dd_real.h>
#include <qd/qd_real.h>
#include "CMatrixUtils.h"
namespace Eigen
{
template<> struct NumTraits<dd_real> : DefaultNumTraits<dd_real> {};
template<> struct NumTraits<qd_real> : DefaultNumTraits<qd_real> {};
}
enum realType : uint32_t
{
doubleType = 1,
dd_realType = 2,
q... | ALGO | 0.995074 | 3.719469 | {
"github_metadata": {
"branch": "master",
"commit_count": 9670,
"repo_created_at": "2012-11-02T20:38:05.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 263,
"forks": 329,
"issues": 61,
"pull_requests": 0
},
"file_meta": {
"content_id": "bde... |
97c9ed18-5600-4df3-8d2b-a144d07ac723 | ameliasieg/OOP-Assignment1 | line.cpp | #include "line.h"
#include <iostream>
using namespace std;
Line::Line() // Constructor 1
{
XCoord = 0;
YCoord = 0;
slope = 1;
}
Line::Line(double x, double y, double s) // Constructor 2
{
XCoord = x;
YCoord = y;
slope = s;
}
Line::Line(double y, double s) // Constructor 3
{
XCoord = 0;
... | ALGO | 0.926338 | 4.376899 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2024-01-24T21:40:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "32f814c185bf... |
168a30af-93e6-45a2-ad00-cdf44786b7d2 | ishandutta2007/codeforces-h | hitonanode/normal/1398/F.cpp | #include <bits/stdc++.h>
using namespace std;
using lint = long long;
using pint = pair<int, int>;
using plint = pair<lint, lint>;
struct fast_ios { fast_ios(){ cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_;
#define ALL(x) (x).begin(), (x).end()
#define FOR(i, begin, e... | ALGO | 0.999978 | 3.904269 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T02:01: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": "7f2f93d9da3e... |
c3b30682-2011-4ca2-92a7-8e55ade8a622 | nirjhor01/Codeforces | 1775A1. Gardener and the Capybaras (easy version).cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define inf (1LL<<61)
#define len(s) (int)s.size()
#define all(a) a.begin(), a.end()
#define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
void er... | ALGO | 0.999573 | 3.994128 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2023-01-17T10:26:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "af77fc4b80f... |
3d3b88b5-5b94-436b-84c3-733749aa8452 | ohookins/aoc2020 | day7/main.cpp | #include <iostream>
#include <fstream>
#include <string>
#include <filesystem>
#include <vector>
#include <regex>
#include <map>
#include <set>
const std::string INPUT_FILENAME = "input.txt";
const std::string TARGET_BAG = "shiny gold";
struct Node
{
std::string Name;
std::vector<std::pair<int, Node*>> Childr... | ALGO | 0.997109 | 5.63872 | {
"github_metadata": {
"branch": "main",
"commit_count": 32,
"repo_created_at": "2020-12-05T09:02: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": "5cd2426e098... |
77ab9dd9-b533-44b6-8aab-6ef1b4f32b90 | Const5215/Leetcode | 20180529/457.cpp | class Solution {
public:
int getnxt(int now, vector<int>& nums) {
return now+nums[now] >= 0 ? (now+nums[now])%nums.size() : (now+nums[now]+nums.size())%nums.size();
}
bool circularArrayLoop(vector<int>& nums) {
for (int i = 0; i < nums.size(); i++) {
if (nums[i] == 0)
... | ALGO | 0.999987 | 5.538308 | {
"github_metadata": {
"branch": "master",
"commit_count": 91,
"repo_created_at": "2018-04-24T07:59: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": "dbc70720d... |
2c9ff491-ebc4-4a09-b0ef-2ce47cb327c3 | Farhanalam0844/DSA-Sem3 | Tree/ruf.cpp | #include<iostream>
//#include<list>
//#include<stack>
using namespace std;
struct node {
int data;
node* next;
};
class forward_list {
private:
node* FRONT;
int n;
public:
forward_list() {
FRONT = NULL;
n = 0;
}
// forward_list(const forward_list &r) {
// clear();
// node* temp = r.FRONT;
// node* temp2 =... | ALGO | 0.999091 | 4.264575 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2023-08-09T07:47: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": "33df211a5350... |
59f5f9df-2c9b-4980-9fe3-7d2336ec4b32 | Tulio-bardini/processamento_XML | component_counter.cpp | #include <string>
#include <fstream>
#include <tuple>
#include <vector>
#include "queue.h"
#include "tag_validator.h"
namespace counter {
// Implementa o algoritimo vizinhança-4 nos seguintes passos:
// 1 - Constroi uma matriz do tipo vetor com o tamanho necessário.
// 2 - Percorre a matriz de string em b... | ALGO | 0.996304 | 4.4803 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2022-02-02T20:49: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": "477a93dad93... |
26acdea9-9a25-4df7-85c7-486cc6a93e02 | RMI-NITT/Pepper_DRL_MAExploration | catkin_ws/src/m-explore/map_merge/include/combine_grids/estimate_transform.h | /*********************************************************************
*
* Software License Agreement (BSD License)
*
* Copyright (c) 2015-2016, <NAME>.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following con... | ALGO | 0.999285 | 4.538935 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2020-11-09T15:04:03.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 35,
"forks": 8,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b28401fa952... |
8022be5f-fd22-4a6e-91f7-1d12f733dda2 | Anmol2307/Codechef | Practice-Medium/ANUBGC.cpp | #include <bits/stdc++.h>
using namespace std;
inline void inp(int &n ) {//fast input function
n=0;
int ch=getchar(),sign=1;
while( ch < '0' || ch > '9' ){if(ch=='-')sign=-1; ch=getchar();}
while( ch >= '0' && ch <= '9' )
n=(n<<3)+(n<<1)+ ch-'0', ch=getchar();
n=n*sign;
}
typedef unsigned ... | ALGO | 0.999707 | 4.397105 | {
"github_metadata": {
"branch": "master",
"commit_count": 41,
"repo_created_at": "2014-05-06T22: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": "3652db0b7... |
3a5dcf45-7875-4568-9ea1-6cf5fbd0c386 | ishandutta2007/codeforces-r | rns_cus/normal/1142/A.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int n, k, a, b;
int main() {
scanf("%d %d %d %d", &n, &k, &a, &b);
ll mx = 0, mi = 1ll * n * k, m = 1ll * n * k;
for (int i = 0; i < n; i ++) {
long long x = abs(__gcd(a + b + 1ll * i * k, m));
mx = max(mx, x);
mi... | ALGO | 0.999895 | 3.475494 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T15:58: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": "05dc0fc81b46... |
9747ae6e-adec-49e8-90c4-aa517865cca2 | svn2github/kratos | kratos/applications/ContactStructuralMechanicsApplication/custom_conditions/mortar_contact_condition.h | // KRATOS ___| | | |
// \___ \ __| __| | | __| __| | | __| _` | |
// | | | | | ( | | | | ( | |
// _____/ \__|_| \__,_|\___|\__|\__,_|_| \__,_|_| MECHANICS
//
// License: BSD License
// ... | ALGO | 0.997372 | 6.006523 | {
"github_metadata": {
"branch": "master",
"commit_count": 19343,
"repo_created_at": "2016-03-24T17:47:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "6384be... |
0e83ab8f-eb0d-450a-9ad2-2dfc4fdaf312 | xrj-sysu/hdu_submit | hdu5083.cpp | #include<iostream>
#include<cstring>
#include<string>
#include<cstdio>
#include<sstream>
using namespace std;
string query[31] = {"00001", "00010", "00011", "00100", "00101", "00110",
"00111", "01000", "01001", "01010", "01011", "01100",
"01101", "01110", "01111", "10000", "10001", "10010",
... | ALGO | 0.997472 | 3.441039 | {
"github_metadata": {
"branch": "master",
"commit_count": 40,
"repo_created_at": "2014-09-24T15:43: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": "89a93d12d... |
b66a15a4-643c-4b0e-9154-ac2a6f3c3142 | msr8/school | practicals/2/ds/22.cpp | #include <stdio.h>
#define SIZE 100
struct Stack {
int data[SIZE];
int top;
};
void initialiseStack(struct Stack *s) {
s->top = -1;
}
void push(struct Stack *s, int val) {
// Check the overflow condition
if (s->top == SIZE-1) {
printf("ERROR: OVERFLOW\n");
return;
}
s-... | ALGO | 0.984727 | 4.782291 | {
"github_metadata": {
"branch": "main",
"commit_count": 103,
"repo_created_at": "2022-10-21T19:27:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "038c229687... |
f7b3746f-34ac-4d72-a350-d8a3956566ad | NanthR/IPMP | week3/arrays/array_13.cpp | #include<vector>
#include<iostream>
#include<climits>
using namespace std;
void find_seq(vector<int> &arr) {
if(arr.size() < 3) {
cout << "Less than 3\n";
return;
}
int found = 1;
int min = arr[0];
int max_found = INT_MIN;
int x = min;
for(int i = 1; i < arr.size(); i++) {
if(arr[i] == min)
... | ALGO | 0.999908 | 4.354532 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2021-03-28T10:44: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": "e13ea55e838... |
be996a2f-ecf7-484a-b9ea-77cf6c3effbf | nibolyoung/leetcode | .leetcode/445.两数相加-ii.cpp | /*
* @lc app=leetcode.cn id=445 lang=cpp
*
* [445] 两数相加 II
*/
// @lc code=start
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
string bigNumberPlus(string s, string t){
strin... | ALGO | 0.999983 | 6.724909 | {
"github_metadata": {
"branch": "master",
"commit_count": 101,
"repo_created_at": "2020-04-07T05:39:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d10aa1cc... |
2fd5be74-2bb7-4fe9-abd9-f0c7f61b9182 | Nepochatova-Polina/Laboratories-2 | list.cpp | #include "iostream"
#include "tree.h"
using namespace std;
List::List() {
count = 0;
}
List::~List() {
while (Head) {
Tail = Head->Next;
delete Head;
Head = Tail;
}
}
void List::Add(tree *x, List listA) {
Node *temp = new Node;
temp->Next = nullptr;
temp->x = x;
... | TOOL | 0.954893 | 3.177063 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2020-02-11T15:23: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": "2585db2324... |
92d69047-8e00-4e3a-8cdb-c4d5c95a99b9 | Garvnanwani/OS_Lab_Sem4 | program6/program6.cpp | #include<stdio.h>
#include<string.h>
void sort(int arr[][7],char str[][10], int at, int bt, int pr, char p[], int n, int m);
void print(int n, char str[][10], int arr[][7] );
void ganttChart(int time[],char gantt[][10], int m, int l);
int main(){
char process[10], gantt[100][10];
int time[100];
int at,bt,n,pr;
pri... | ALGO | 0.999848 | 3.258868 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2021-02-27T18:25:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e80a43f568e... |
2a98d71b-9c7a-47cb-894d-196619c7522f | uxth/leetcode | cpp/500.keyboard-row.cpp | /*
* @lc app=leetcode id=500 lang=cpp
*
* [500] Keyboard Row
*
* https://leetcode.com/problems/keyboard-row/description/
*
* algorithms
* Easy (64.71%)
* Likes: 561
* Dislikes: 680
* Total Accepted: 113.7K
* Total Submissions: 175.4K
* Testcase Example: '["Hello","Alaska","Dad","Peace"]'
*
* Given... | ALGO | 0.999579 | 5.862462 | {
"github_metadata": {
"branch": "main",
"commit_count": 202,
"repo_created_at": "2023-08-31T18:12: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": "b163fa5ce8... |
4b5c6eb1-2485-4ade-a04d-27b03ae50aa6 | friendsandvis/TestingDX12 | CommonDataStructures.h | #pragma once
#include<vector>
using namespace std;
template<class T>
class Set
{
public:
Set() {}
Set(T* invalues, size_t valuecount);
~Set() {}
size_t GetSize() { return m_data.size(); }
T* GetDataptr() { return m_data.data(); }
inline void Push(T val) { m_data.push_back(val); }
void PushUnique(T val);
void R... | TOOL | 0.937197 | 4.610933 | {
"github_metadata": {
"branch": "master",
"commit_count": 394,
"repo_created_at": "2022-01-15T15:22:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a4d68f4a... |
15708efc-7768-4211-855b-fa62b0a7b9d8 | Sohail22515/CodeForces | A. Laptops.cpp | // I this question I have learn 1 new concept and and implementation of retunr 0
/*
The concept which I have learned is of pair, pair is a set of data just like map, but i found it much easiesr to uses in comparision ot map.
retun 0 is used to end the function and at the end of this code you will found that how be... | ALGO | 0.999932 | 3.229198 | {
"github_metadata": {
"branch": "main",
"commit_count": 44,
"repo_created_at": "2023-09-29T11:06: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": "82cf121aa7e... |
a990b0f5-712d-4043-bf76-fdc4ed03bb62 | AndreiDaniDev/Informatica | Structuri-De-Date-Liniare/dreptunghi1.cpp | #include <fstream>
#include <algorithm>
#include <utility>
#include <stack>
#define x first
#define y second
using namespace std;
ifstream in("dreptunghi1.in");
ofstream out("dreptunghi1.out");
typedef pair <int, int> pii;
const int sizee = 10002;
int n, m, k, dp[sizee], lf[sizee], rg[sizee];
pii pos[sizee]; int idx = ... | ALGO | 0.999948 | 3.315739 | {
"github_metadata": {
"branch": "main",
"commit_count": 100,
"repo_created_at": "2024-06-17T13:12:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "140a3adfd3... |
aa22e0d6-0b6b-4cf1-bf1c-f58ea3da02f2 | wowfun/leetcode | algorithms/cpp/merge_k_sorted_lists/solution.cpp | #include<iostream>
#include <vector>
using namespace std;
struct ListNode {
int val;
ListNode *next;
ListNode(int x) : val(x), next(NULL) {}
};
class Solution {
public:
ListNode *mergeTwoLists(ListNode *l1, ListNode *l2) {
ListNode head(0);
ListNode *tail = &head;
while (l1 && l2) {
... | ALGO | 0.999908 | 5.684462 | {
"github_metadata": {
"branch": "master",
"commit_count": 69,
"repo_created_at": "2019-05-28T02:42: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": "408ddc07c... |
5abdc697-5e8b-42df-acfa-42b71f6935c5 | liuty10/CourseProjects | os-projects/2AdinningPhilosopher/source/main-part2.cpp | /*
* =====================================================================================
*
* Filename: main.cpp
*
* Description:
*
* Version: 1.0
* Created: 11/01/2017 10:02:29 AM
* Revision: none
* Compiler: gcc
*
* Author: YOUR NAME (),
* Organizati... | ALGO | 0.949087 | 3.914504 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2017-09-27T22:21: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": "02a6d1415... |
b06479a6-ea85-4d26-8263-c0702fe59df7 | akshat-o5/Data-Structures-and-Algorithms | Revision/BST/Bst.cpp | #include<iostream>
#include<queue>
using namespace std;
class Node {
public:
int data;
Node* left;
Node* right;
Node(int data){
this->data = data;
this->left = NULL;
this->right = NULL;
}
};
Node* insertIntoBst(Node* root, int data){
if(root == N... | ALGO | 0.999965 | 4.927097 | {
"github_metadata": {
"branch": "main",
"commit_count": 415,
"repo_created_at": "2022-01-08T05:43:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 83,
"issues": 1,
"pull_requests": 57
},
"file_meta": {
"content_id": "36cf847b... |
26980e56-55ac-4873-80a7-a03f6efa46d0 | kevinleandrogomes/UFPB_ED | Ordenações.cpp | //Dupla: <NAME> e <NAME>
//Matrículas: 20190038391 e 20190098694
#include "ordenacao.h"
#include <iostream>
#include <stdlib.h>
using namespace std;
// IMPLEMENTANDO AS FUNÇÕES DE ORDENAÇÃO E A FUNÇÃO PRA CONTROLE DE TEMPO.
void Start(){
t = clock();
}
double End(){
t = clock() - t;
return... | ALGO | 0.999635 | 5.333505 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2023-03-17T00:12:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "218747d29d32... |
23d5ef2f-9961-4f34-9774-986e399999d9 | code-azeemahmad/Programming-Day | week12/LM/task09.cpp | #include<iostream>
using namespace std;
int identity(int arr[][3], int rowSize);
main()
{
int rowSize, index, count;
cout << "Enter row size: ";
cin >> rowSize;
int arr[rowSize][3];
cout << "Enter the elements of the matrix: "<< endl;
for(int row=0; row<rowSize; row++)
{
for(int co... | ALGO | 0.998012 | 4.141332 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2024-09-29T15:54:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f2ef92eb1bb... |
066743a7-1317-45e2-8c36-ef73b0ce317b | z397318716/C-Plus-Plus | 20_4_3_OJ35/20_4_3_OJ35/test1.cpp | #include<iostream>
#include<iomanip>
#include<vector>
/*
错排算法原理:
https://blog.csdn.net/x121850182/article/details/51489453
公式: a(n) = n!/2! - n!/3! + n!/4! + .....
递推版: a(n) = (n-1)(a(n-1) + a(n-2)); a(1) = 0, a(2) = 1;
*/
// 阶乘
long long Jie(int n)
{
long long tmp = 1;
for (int i = 2; i <= n; i++)
{
tmp *= i;
}
... | ALGO | 0.999516 | 3.520668 | {
"github_metadata": {
"branch": "master",
"commit_count": 284,
"repo_created_at": "2019-08-24T09:03: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": "0fccb409... |
032e0382-26ec-4f13-983a-278a08eaf07f | brpapa/algorithms | solutions/uri/1148.cpp | /*
graphs > shortest path > dijkstra
difficulty: none
date: none
by: @brpapa
*/
#include <iostream>
#include <vector>
#include <queue>
#define MAX_V 500
#define INF 2147483647
using namespace std;
struct T {
int id, peso;
};
vector<T> adj[MAX_V]; //adj[i].size(): grau de i
int c[MAX_V]; //c[i] = custo ... | ALGO | 0.999946 | 3.921992 | {
"github_metadata": {
"branch": "master",
"commit_count": 197,
"repo_created_at": "2019-01-25T20:40:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 35,
"forks": 15,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9f8af4... |
13d203a8-81ee-4f3d-af2e-8501cb95b20f | wtain/LeetCodeCpp | BinaryPrefixDivisibleBy5/BinaryPrefixDivisibleBy5.cpp |
#include <iostream>
#include <vector>
#include <iomanip>
#include <algorithm>
#include <iterator>
using namespace std;
/*
https://leetcode.com/problems/binary-prefix-divisible-by-5/
Given an array A of 0s and 1s, consider N_i: the i-th subarray from A[0] to A[i] interpreted as a binary number (from most-significant... | ALGO | 0.999641 | 5.79109 | {
"github_metadata": {
"branch": "master",
"commit_count": 50,
"repo_created_at": "2020-06-10T11:16: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": "dedaae7f4... |
9a27eb02-895f-4b90-8ad9-2ca11792a37d | markjayson545/paTutorial | intersection.cpp | #include <iostream>
using namespace std;
int main(){
int arr1[5] = {1,2,3,4,5}; //declare the array na dalawa
int arr2[5] = {2,4,5,6,8}; // pati yung pangalawa
int intersection[5];
for (int i = 0; i < 5; i++) // for loop hanggang size lang ng arr1
{
for (int j = 0; j < 5; j++) // for loop... | TOOL | 0.98152 | 3.639099 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2024-03-15T13:03: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": "90d8d59ba7d... |
c835a6b5-29ab-494f-9e10-389f71850282 | coding-blocks-archives/CPP-Standard-Template-Library-STL | Unordered Map/unordered_map_stl_01.cpp | #include <iostream>
#include<unordered_map>
#include<string>
using namespace std;
int main() {
unordered_map<string,int> m;
//1. Insert
m.insert(make_pair("Mango",100));
pair<string,int> p;
p.first = "Apple";
p.second = 120;
m.insert(p);
m["Banana"] = 20;
//2. Search
str... | TOOL | 0.922773 | 4.238159 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-02-14T15:24:57.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 131,
"forks": 105,
"issues": 0,
"pull_requests": 4
},
"file_meta": {
"content_id": "671aae1... |
df87172a-1c89-4107-a667-164928a97711 | tingluotw/leetcode | 77_combinations.cpp | class Solution {
public:
/* solution:
* choice: k positions, each position can choose a number from 1 to n
* constraints: each positions' number is different
* goal: finish choosing k numbers
*/
void _combine(int start, int count, int n, int k, vector<int>cand, vector<vector<int>>& ans) {
... | ALGO | 0.99999 | 6.238961 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2020-07-07T04:27: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": "8d321cae0... |
de8b813f-32e2-4b9e-b354-d48e0abcc62d | karthikjodangi/codeclub_qotd | day30-lv1.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int t;
cin >> t;
while(t--){
int n;
cin >> n;
unordered_set<string>v1(n);
unordered_set<string>v2(n);
unordered_set<string>v3(n);
string str;
int a = 0, b = 0, c = 0;
for(int i=0;i<n... | ALGO | 0.999928 | 3.776869 | {
"github_metadata": {
"branch": "main",
"commit_count": 39,
"repo_created_at": "2024-04-13T04:16:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8315fb0ab0c... |
b316e54a-66df-4dca-b461-dd8aee7d64e1 | emilyju0314/gpt_code_plagiarism | dataset/code_content_classifier/allpro_train/1_10232_81.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
template <typename T>
using lim = numeric_limits<T>;
template <typename T>
istream& operator>>(istream& is, vector<T>& a) {
for (T& x : a) {
is >> x;
}
return is;
}
template <typename T>
struct grid : public vector<vec... | ALGO | 0.999949 | 3.677808 | {
"github_metadata": {
"branch": "main",
"commit_count": 50,
"repo_created_at": "2024-04-28T03: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": "f3880a7548d... |
62467ebc-8b3f-4250-a6d9-672f4f0c83ed | upesacm/21DaysOfCode-2024 | DSA/Anisha_Parveen/Day_1_Ques_1.cpp | #include <bits/stdc++.h>
using namespace std;
int divideBar(vector<int> candy, int n, int day, int month)
{
int sum = 0;
int ways = 0;
if (month > n)
return 0;
for (int i = 0; i < month; i++)
{
sum += candy[i];
}
if (sum == day)
ways++;
for (int i = month; i <... | ALGO | 0.999767 | 4.401268 | {
"github_metadata": {
"branch": "main",
"commit_count": 5391,
"repo_created_at": "2024-06-21T06:40:54.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 4,
"forks": 114,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "65888b1f... |
a7242cae-0afc-45b6-9674-f57973fdf8ac | gratus907/Gratus_PS | Codeforces/Round 569 (Div.2) (1180)/B. Nick and Array.cpp | #include <bits/stdc++.h>
#pragma GCC optimize ("O3")
#pragma GCC optimize ("Ofast")
#define ll long long
#define MAX(A,B) ((A)>(B)?(A):(B))
#define MIN(A,B) ((A)<(B)?(A):(B))
#define gcd(A,B) (__gcd(A,B))
#define lcm(A,B) A/(__gcd(A,B))*B
#define MP make_pair
#define PB push_back
#define EPS 1e-9
#define ld long double... | ALGO | 0.999982 | 4.115372 | {
"github_metadata": {
"branch": "master",
"commit_count": 93,
"repo_created_at": "2020-01-20T15:19:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e2cf40b87... |
216d3fdc-0d5f-42e6-b982-13f26cad55dd | cobalthex/BlzGameJam2022 | ai/HiveMind.cc | #include "HiveMind.hh"
#include "Colony.hh"
#include "Z.hh"
#include "Utils.hh"
bool HiveMind::EmployeePriorityComparer::operator()(Citizen::Id a, Citizen::Id b)
{
const auto hydratedA(z.TryGet(a));
if (!hydratedA)
return true;
const auto hydratedB(z.TryGet(b));
if (!hydratedB)
return false;
return hydratedA... | ALGO | 0.972242 | 5.872408 | {
"github_metadata": {
"branch": "main",
"commit_count": 24,
"repo_created_at": "2022-03-05T03:19: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": "ae387cbf3d6... |
dbac4b4d-9403-4772-aed3-630ea979793a | ArchitKumar1/Competitive_Programming | CODEFORCES/PRACTICE/1095C.cpp | #include<bits/stdc++.h>
using namespace std;
template<class T> ostream& operator<<(ostream &os,vector<T> V){
os<<"[ ";for(auto v:V)os<<v<<" ";return os<<"]";
}
template<class L,class R> ostream& operator<<(ostream &os,pair<L,R> P){
return os<<"("<<P.first<<","<<P.second<<")";
}
#define TRACE
#ifdef TRACE
#def... | ALGO | 0.999969 | 4.233963 | {
"github_metadata": {
"branch": "master",
"commit_count": 57,
"repo_created_at": "2019-08-26T21:58:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c34b32688... |
cb12675d-708e-4e6f-aca6-1705f7e94a15 | ishandutta2007/codeforces-b | beyondheaven/normal/1566/F.cpp | #include <bits/stdc++.h>
using LL = long long;
int main()
{
std::ios::sync_with_stdio(false);
int T; std::cin >> T;
while(T--)
{
int n, m; std::cin >> n >> m;
std::vector<LL> a(n);
for(int i = 0; i < n; ++i) std::cin >> a[i];
std::sort(a.begin(), a.end());
std::vector<std::vector<std::pair<LL, LL>>> s... | ALGO | 0.999938 | 3.52146 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-04-11T01:05: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": "e898204dea6b... |
4a39aa8c-7fe7-4e4f-b8ca-0751234d1741 | wonyangs/42Seoul | 42cursus/CPP_Module/CPP09/ex02/PmergeMe.hpp | #pragma once
#ifndef __PMERGEME_HPP__
#define __PMERGEME_HPP__
#include <cstddef>
#include <ctime>
#include <deque>
#include <string>
#include <vector>
class PmergeMe {
public:
static void execute(int argc, char** argv);
private:
typedef std::vector<std::vector<int> > vecMatrix;
typedef vecMatrix::iterator v... | ALGO | 0.984087 | 5.403841 | {
"github_metadata": {
"branch": "main",
"commit_count": 284,
"repo_created_at": "2022-06-06T05:13: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": "baa799cf85... |
b65c93a9-8027-4fdb-ae4c-f39b91c339f1 | iwilare/CompetitiveProgramming | Library/SegmentTreeLazy.cpp | #include <bits/stdc++.h>
#define LEFT(i) (2 * (i) + 1)
#define RIGHT(i) (2 * (i) + 2)
struct range {
size_t a, b;
range(size_t a, size_t b) : a(a), b(b) {}
};
template<typename T> class segment_tree {
std::vector<T> tree;
std::vector<T> lazy;
std::function<T(T, T)> binary;
size_t size_;
... | ALGO | 0.999716 | 5.624609 | {
"github_metadata": {
"branch": "main",
"commit_count": 70,
"repo_created_at": "2020-09-14T20:20:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f503298f255... |
bc22e5f5-4574-4929-aa44-753375f5614b | ehsanrashid/CodeJam | CountingRooms.cpp | #include <bits/stdc++.h>
using namespace std;
constexpr char FLOOR = '.';
constexpr char WALL = '#';
class Building final {
public:
Building(const vector<vector<char>>& map) noexcept :
n(map.size()), m(map[0].size()), map(map) {}
size_t countRooms() noexcept {
size_t room... | ALGO | 0.999855 | 6.12526 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2012-08-15T19:29: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": "73a88e712... |
1fab1e1f-7398-48da-8b0a-9a71d5c38f8c | jonchan1997/Data-Structures-Nqueen | NQueens.cpp | #include <iostream>
using namespace std;
struct QBoard {
bool hasQueen;
QBoard () {
hasQueen = false;
}
};
void PrintChessBoard(QBoard** board, int n) {
for (int row = 0; row < n; row++) {
for (int column = 0; column < n; column++) {
if (board[row][column].hasQueen) {
cout << "1";
... | ALGO | 0.999666 | 4.774969 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-09-30T23:17: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": "40af8ca48e... |
cea88666-e212-47ad-a7cb-9314824ab635 | decodepriyanka/DSA-SHEET-450 | medianOfSortedRow.cpp | https://practice.geeksforgeeks.org/problems/median-in-a-row-wise-sorted-matrix1527/1
Given a row wise sorted matrix of size R*C where R and C are always odd, find the median of the matrix.
Example 1:
Input:
R = 3, C = 3
M = [[1, 3, 5],
[2, 6, 9],
[3, 6, 9]]
Output: 5
Explanation: Sorting matrix elements ... | ALGO | 0.999971 | 5.630221 | {
"github_metadata": {
"branch": "main",
"commit_count": 25,
"repo_created_at": "2023-06-29T16:58: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": "d3552778a55... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.