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 |
|---|---|---|---|---|---|---|---|
5961340e-1d24-4f50-b925-319f867e754e | Anubhav12345678/competitive-programming | PATHWITHMINIMUMEFFORTVVVVVVVVVVVVVVVVIMPBINARYSEARCH.cpp | static int dx[] = {-1,1,0,0};
static int dy[] = {0,0,-1,1};
class Solution {
public:
bool vis[105][105];
int n,m;
vector<vector<int>> h;
queue<pair<int,int>> q;
bool check(int x)
{
int i,j,k,l;
memset(vis,false,sizeof(vis));
q.push({1,1});
vis[1][1]=1;
... | ALGO | 0.999989 | 4.996562 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-11-18T08:04:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5fda429a05... |
80bde4f5-b96e-44d2-9181-aab53858dc68 | cmdpig/code | P_2482_SDOI_2010.cpp | /*
主猪/MP:自己存活的情况下消灭所有的反猪。
忠猪/ZP:不惜一切保护主猪,胜利条件与主猪相同。
反猪/FP:杀死主猪。
*/
#include<bits/stdc++.h>
using namespace std;
const int MAXN=2000+3;
const int pin_yin=20;
#define zhu_zhu "MP"
#define zhong_zhu "ZP"
#define fan_zhu "FP"
#define tao "P"
#define sha "K"
#define shan "D"
#define jue_dou "F"
#define nan_zhu_ru_qin "N"
#d... | ALGO | 0.998814 | 3.39277 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2022-08-09T14:21: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": "7601a9c747d5... |
4bf54d42-2539-4c73-9b1c-8c0c8ec94f83 | wym6912/ACM-ICPC_wym6912 | BZOJ/2599.cpp | //#define NOSTDCPP
//#define Cpp11
#define Linux_System
#ifndef NOSTDCPP
#include <bits/stdc++.h>
#else
#include <algorithm>
#include <bitset>
#include <cassert>
#include <climits>
#include <complex>
#include <cstring>
#include <cstdio>
#include <deque>
#include <exception>
#include <functional>
#include <iomanip... | ALGO | 0.999956 | 3.391783 | {
"github_metadata": {
"branch": "master",
"commit_count": 363,
"repo_created_at": "2017-08-09T05:04:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4f2a1b02... |
9c6da213-9685-4edc-92b5-ad64df52c1c4 | ketkat-maker/Some-Problems | chat.cpp | #include <iostream>
#include <vector>
using namespace std;
int main()
{
int n;
cin >> n;
if (n < 1 || n > 1000)
return 1;
long count_even = 0;
long count_odd = 0;
long count_negative = 0;
long count_positive = 0;
vector<long> val(n);
for (long i = 0; i < n; i++)
{... | ALGO | 0.999543 | 4.459063 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2025-04-16T09:18: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": "68f011e546... |
46660d40-8fae-48da-af31-0c9c6581e080 | lbv/pc-code | solved/r-t/snakes-and-ladders.lightoj/snakes.cpp | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
using namespace std;
#define Zero(v) memset((v), 0, sizeof(v))
#define Abs(x) fabs(x)
const int MAX_ROWS = 100;
const int MAX_COLS = 101;
template <typename T>
struct Matrix {
int r, c;
T m[MAX_ROWS][MAX_COLS];
Matrix(int R, in... | ALGO | 0.999578 | 3.831182 | {
"github_metadata": {
"branch": "master",
"commit_count": 1269,
"repo_created_at": "2012-06-17T09:14:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 15,
"forks": 16,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f49b3... |
4101607b-c533-4b6c-bd8d-cb5ffc6e7a69 | lxyzzzZZZ/practice | 项目/RSA(小数)/RSA/RSA.cpp | #include "RSA.h"
//文件加密
void RSA::ecrept(const char* plain_file_in, const char* ecrept_file_out,
long ekey, long pkey)
{
std::ifstream fin(plain_file_in,std::ifstream::binary);
std::ofstream fout(ecrept_file_out,std::ofstream::binary);
if (!fin.is_open())
{
std::cout << "open file failed" << std::endl;
return... | ALGO | 0.996571 | 4.226502 | {
"github_metadata": {
"branch": "master",
"commit_count": 134,
"repo_created_at": "2019-01-21T11:06: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": "4fb4e7f8... |
73e5b33c-2a04-4913-8fdb-db444ff552c3 | sarvparteek/Cpp_practice | include/algorithms/sub_vector_sum.hpp | /*!
* @brief Computes largest sum of k successive elements in an n-dimensional vector (k <= n)
* @details: Reference - https://www.geeksforgeeks.org/window-sliding-technique/
* @author <NAME>
* @date Jan-17-2021
*/
#ifndef CPP_PRACTICE_SUB_VECTOR_SUM_HPP
#define CPP_PRACTICE_SUB_VECTOR_SUM_HPP
#include <iostream... | ALGO | 0.983565 | 6.638984 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2020-06-20T00:25: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": "682b1a218... |
002efdff-1433-4058-877f-4f6eb44d2228 | Harrypotterrrr/Algorithm-ACM | Tree/LC 0101 - elementary.cpp | /*
101. Symmetric Tree
*/
/**
* 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, T... | ALGO | 0.999951 | 6.461809 | {
"github_metadata": {
"branch": "master",
"commit_count": 172,
"repo_created_at": "2018-07-20T09:48:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7ae23410... |
3a064026-1ee9-4931-8a79-b8a58ea80635 | NishantKSinha/LeetCode | 0082-remove-duplicates-from-sorted-list-ii/0082-remove-duplicates-from-sorted-list-ii.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
ListNode* deleteDupli... | ALGO | 0.999987 | 5.428628 | {
"github_metadata": {
"branch": "main",
"commit_count": 492,
"repo_created_at": "2024-07-01T13:22:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6ca45f7169... |
da0d6d57-179d-48b6-9ecc-bbb709c6bc49 | apple/turicreate | src/external/boost/boost_1_68_0/libs/math/test/test_root_iterations.cpp | // (C) Copyright <NAME> 2015.
// Use, modification and distribution are subject to the
// Boost Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#include <pch.hpp>
#ifndef BOOST_NO_CXX11_HDR_TUPLE
#define BOOST_TEST_MAIN
#include <boost/tes... | TEST | 0.914089 | 6.485176 | {
"github_metadata": {
"branch": "main",
"commit_count": 1571,
"repo_created_at": "2017-12-01T00:42:04.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 11198,
"forks": 1137,
"issues": 502,
"pull_requests": 21
},
"file_meta": {
"content_id": "... |
23a6e7a4-c6dd-4613-aade-a46cafadb24b | zylzjucn/Leetcode | 300~399/358. Rearrange String k Distance Apart.cpp | class Solution {
public:
string rearrangeString(string s, int k) {
string res;
vector<int> count(26, 0);
vector<int> valid_pos(26, 0);
for (const auto& c : s)
count[c - 'a']++;
for (int i = 0; i < s.length(); i++) {
int candidate = find_valid_candidate... | ALGO | 0.999995 | 5.948945 | {
"github_metadata": {
"branch": "master",
"commit_count": 538,
"repo_created_at": "2018-03-19T07:18: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": "bbddc6a9... |
abc13672-69fe-45d0-bd16-ed3d2c915a83 | lab104yifan/ACM | ol/921c.cpp | #include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
const int N = 10005;
int t, n, vis[N];
int main() {
int cas = 0;
scanf("%d", &t);
while (t--) {
scanf("%d", &n);
int w;
memset(vis, 0, sizeof(vis));
for (int i = 0; i < n; i++) {
scanf("%d", &w);
int s = 10000 - (100 - w) ... | ALGO | 0.999041 | 3.282556 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2013-09-13T08:21:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6417412de... |
6451ecd0-354f-4e85-b1de-7a7f4252aa72 | edutrindade/Algoritmos-e-Estruturas-de-Dados-I | 1. Arquivos/1.2 Exercícios/exercicio3.cpp | #include <iostream>
#include <fstream>
#include <windows.h>
using namespace std;
int sumNumbers()
{
int sum[3];
int total = 0;
ifstream file;
file.open("numeros.txt");
if (!file.is_open())
{
cerr << "ERRO! Não foi possível abrir o arquivo.\n";
file.clear();
}
cout <<... | TOOL | 0.973606 | 3.815164 | {
"github_metadata": {
"branch": "master",
"commit_count": 73,
"repo_created_at": "2022-08-05T12:40:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 5,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
"content_id": "30eab5fbe... |
4b3d6b75-db6e-488f-9997-16bd7c958684 | poboll/C | luogu/P5730显示屏.cpp | //
// Created by 大妖怪 on 2024/1/26.
//
//P5730【深基5.例10】显示屏
// 题目描述
// 液晶屏上,每个阿拉伯数字都是可以显示成 3*5 的点阵的(其中 `X` 表示亮点,`.` 表示暗点)。现在给出数字位数(不超过 100)和一串数字,要求输出这些数字在显示屏上的效果。数字的显示方式如同样例输出,注意每个数字之间都有一列间隔。
// 输入格式
// 第一行输入一个正整数 n,表示数字的位数。
// 第二行输入一个长度为 n 的自然数。
// 输出格式
// 输出五行,表示显示屏上的数字。
// 样例输入
// 10
// 0123456789
// 样例输出
// XXX...X.X... | ALGO | 0.99992 | 4.843667 | {
"github_metadata": {
"branch": "master",
"commit_count": 677,
"repo_created_at": "2022-12-08T08:42:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "048e42e4... |
7c5586ce-48cc-457c-93d3-e4166fafa49e | jaredhoberock/stanford-cs193g-sp2010 | assignments/mp4/thrust/detail/util/blocking.h | /*
* Copyright 2008-2010 NVIDIA Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable... | TOOL | 0.913221 | 4.812421 | {
"github_metadata": {
"branch": "master",
"commit_count": 112,
"repo_created_at": "2015-03-14T06:09:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 220,
"forks": 84,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "4bd23... |
3ee731a4-62f0-4ba2-96f0-251f8e5759cf | yw228/CS165 | submittedHomework/cs124_prj12.cpp | /***********************************************************************
* Program:
* Project 12, Sudoku
* <NAME>, CS124
* Author:
* <NAME>
* Summary:
* This program will read a file for a sudoku game
* and allow user to the play the game according to the rule
* with some help.
*
* E... | ALGO | 0.960247 | 3.912632 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-06-10T13:47: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": "eaa73917f5... |
61cb40b1-12e6-446b-b1a6-3c9aa46f2e1b | seanyi0918/Peking_University_Coursera | 计算导论与C语言基础/苹果和虫子.cpp | //
// main.cpp
// cpluspluscoursera
//
// Created by <NAME> on 9/25/15.
// Copyright (c) 2015 <NAME>. All rights reserved.
/*
描述
你买了一箱n个苹果,很不幸的是买完时箱子里混进了一条虫子。虫子每x小时能吃掉一个苹果,假设虫子在吃完一个苹果之前不会吃另一个,那么经过y小时你还有多少个完整的苹果?
输入
输入仅一行,包括n,x和y(均为整数)。
输出
输出也仅一行,剩下的苹果个数*/
#include <iostream>
using namespace std;
int ... | ALGO | 0.9996 | 4.305813 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2015-10-06T17:42:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 11,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0b62edee1... |
05c14b0d-36f0-4231-8f13-7bf1916300d3 | wangzy0327/llvm | llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp | ///===- SimpleLoopUnswitch.cpp - Hoist loop-invariant control flow ---------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===--------------------------... | ALGO | 0.966409 | 5.583346 | {
"github_metadata": {
"branch": "sycl",
"commit_count": 435223,
"repo_created_at": "2022-06-06T05:01:59.000Z",
"is_fork": true,
"is_org_owned": false,
"forked_from": "intel/llvm",
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "... |
8c6fd1d4-e732-4ae8-8349-8a2fe4753402 | tukwila/pytest_API | common/x64/dependency/include/algoInterface/RTMatrixVecImp.h | /**
*******************************************************************************
* Continental Confidential
* Copyright (c) Continental AG. 2016-2017
*
* This software is furnished under license and may be used or
* copied only in accordance with the terms of su... | ALGO | 0.979131 | 5.663809 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2021-09-11T01:01:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2c3b194f3dfa... |
28928275-421f-47ea-a31a-9cc58095e38f | SlowBroshka/SmdComponents | HelpFunc.cpp | //
// Created by slowbro on 17.05.17.
//
#include "HelpFunc.h"
double GetMiddleAngel(const vector<Line> &Horisontal);
void dbContourPrint(const vector<Point> &contour){
cout<<"----CONTOUR dbPrint----"<<endl;
cout<<"Contour Area: "<<contourArea(contour)<<"Points: "<<contour.size()<<endl;
for(auto i = 0; i... | ALGO | 0.992904 | 3.889831 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2017-05-17T09:18: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": "43a5a93455... |
4718d4c3-96b6-46e1-ab8c-34d7ff8ca089 | moden3/tamanori_robot | source/tamanori_main/src/motor_PID.cpp | #include "common.h"
int motor_flag = 0; // モータを動かすときに立てるフラグ
double sum[3] = {0, 0, 0}; // I制御のこれまでの積山量
double olddev[3] = {0, 0, 0}; // 目標値と現在の値の差分の前回値
double en_speed[3] = {0, 0, 0}; // タイヤの実際の角速度[rad/s]
double speed_test[3] = {0, 0, 0}; // PIDテスト用スピードパラメータ
void motor_pid(double speedref[3]){
// PIDゲイ... | ALGO | 0.9901 | 4.202117 | {
"github_metadata": {
"branch": "master",
"commit_count": 33,
"repo_created_at": "2019-07-04T16:42: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": "45b4b82d5... |
f9a357d7-bc9a-45a8-a2d5-a98d65be31fe | dgodfrey206/Karagozian-Case | superwordsearch.cpp | #include <unordered_set>
#include <optional>
#include <iostream>
#include <utility>
#include <fstream>
#include <cassert>
#include <vector>
#include <string>
#include <tuple>
struct SuperWordSearch {
// The array of words that will be used for the search
std::vector<std::string> grid;
// Current word being queri... | ALGO | 0.999763 | 5.424047 | {
"github_metadata": {
"branch": "main",
"commit_count": 16,
"repo_created_at": "2022-04-09T01:51: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": "609c37cf233... |
27854c97-1119-443d-9bcc-ef066fb932b9 | lsj0822/Problem_Solving | C++/solved.ac 랜덤마라톤/코스19(241009-241016)/H[P5]_1555.cpp | #include<iostream>
#include<vector>
#include<unordered_set>
#include<algorithm>
#include<cmath>
using namespace std;
int n;
vector<int> vec, primevec;
unordered_set<int> dp[10][10];
pair<int, int> ans = { 1e9, -1 };
bool isprime[30005];
bool prime_detection(int value) {
if (value <= 1) return 0;
for (int v : primevec... | ALGO | 0.999991 | 3.970896 | {
"github_metadata": {
"branch": "main",
"commit_count": 76,
"repo_created_at": "2024-01-16T08:37: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": "4775cbbcbb3... |
30178b0d-eaec-4b7f-9d9b-6d0ccdf5e72f | opencurve/curve | src/mds/schedule/rapidLeaderScheduler.cpp | /*
* Copyright (c) 2020 NetEase Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or... | ALGO | 0.989331 | 5.640176 | {
"github_metadata": {
"branch": "master",
"commit_count": 3106,
"repo_created_at": "2020-07-01T11:57:25.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2356,
"forks": 527,
"issues": 96,
"pull_requests": 40
},
"file_meta": {
"content_id": "8... |
7d994040-3061-42d3-bf95-8c99b3c7e185 | rishabhbitsg/CompetitiveProgramming | rain.cpp | #include <bits/stdc++.h>
using namespace std;
int t, r, c, h[60][60], visited[60][60];
int main() {
cin >> t;
int x = 1;
while (t--) {
int ans = 0;
cin >> r >> c;
for (int i = 0; i < r; i++) {
for (int j = 0; j < c; j++) {
cin >> h[i][j];
visited[i][j] = 0;
}
}
for (int i = 1; i < r - 1; i... | ALGO | 0.999848 | 3.258602 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2016-12-28T07: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": "6db775193f... |
10a1a99b-3f28-46f0-906d-246161c1ae6e | jeadorf/tpofinder | src/detect.cpp | /**
* Copyright (c) 2012 <NAME>, <NAME>, <NAME>
*
* MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
#include "tpofinder/detect.h"
#include "tpofinder/util.h"
#include <boost/foreach.hpp>
#include <opencv2/calib3d/calib3d.hpp>
#include <opencv2/features2d/features2d.hpp>
#include <stdarg.h>
us... | ALGO | 0.949292 | 6.816888 | {
"github_metadata": {
"branch": "master",
"commit_count": 25,
"repo_created_at": "2015-04-14T21:53:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "66398efd0... |
6745f787-65aa-412f-86b2-325329267de1 | InsightSoftwareConsortium/ITK | Modules/ThirdParty/VNL/src/vxl/v3p/netlib/linalg/lsmrDense.h | /*=========================================================================
*
* Copyright Insight Software Consortium
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* h... | ALGO | 0.976486 | 6.051718 | {
"github_metadata": {
"branch": "main",
"commit_count": 57165,
"repo_created_at": "2010-07-27T15:48:04.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1517,
"forks": 701,
"issues": 268,
"pull_requests": 49
},
"file_meta": {
"content_id": "8... |
ee68dc10-e036-4bc2-825f-18ca48d78f7e | anuragsingh7827/Leetcode-Problems | Merge two binary Max heaps - GFG/merge-two-binary-max-heaps.cpp | // { Driver Code Starts
// Initial Template for C++
// C++ program to merge two max heaps.
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// User function Template for C++
class Solution{
public:
vector<int> mergeHeaps(vector<int> &a, vector<int> &b, int n, int m) {
// your co... | ALGO | 0.999972 | 4.425448 | {
"github_metadata": {
"branch": "main",
"commit_count": 795,
"repo_created_at": "2022-04-11T16:09: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": "33ef9ac031... |
2d804d03-2cb5-464a-a2b9-4cdce18e0adb | google/monster-mash | third_party/libigl/include/igl/rotation_matrix_from_directions.cpp | // This file is part of libigl, a simple c++ geometry processing library.
//
// Copyright (C) 2014 <NAME> <<EMAIL>>, <NAME> <<EMAIL>>
//
// This Source Code Form is subject to the terms of the Mozilla Public License
// v. 2.0. If a copy of the MPL was not distributed with this file, You can
// obtain one at http://mozi... | ALGO | 0.998607 | 6.426543 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2021-01-28T21:04:52.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1312,
"forks": 182,
"issues": 24,
"pull_requests": 0
},
"file_meta": {
"content_id": "b26421... |
769db092-d84b-4d5d-95ff-d67f8546069b | MohammadNasser-CS/DataStructure | QueueLinkedList.h | #pragma once
#include <iostream>
using namespace std;
template<class T>
class QueueLinkedList
{
private:
struct Node
{
T item;
Node* next;
};
int length;
Node* front, * rear;
public:
QueueLinkedList() :front(NULL), rear(NULL), length(0)
{}
bool isEmpty()
{
return (length == 0);
}
T dequeue()
{
if (... | TOOL | 0.995996 | 3.519869 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-08-20T03:14: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": "19293980110c... |
8c5fc841-b9ca-42c0-9b8d-969f1d53850a | SuperBigFive/Charming_XCPC | Codeforces/Edu/Edu152/E#.cpp | #include <bits/stdc++.h>
#define ll long long
#define int ll
using namespace std;
const int N = 1e6 + 5;
int n;
void init () {}
void charming () {
init ();
cin >> n;
vector <int> a (n + 5);
for (int i = 1; i <= n; ++i) cin >> a[i];
int ans = 0, sum = 0, p1 = 0, p2 = 0;
vector <int> stk_asc (n + 5), stk_desc (n... | ALGO | 0.999968 | 4.053963 | {
"github_metadata": {
"branch": "main",
"commit_count": 86,
"repo_created_at": "2023-03-06T12:05:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d8ce7c2617f... |
d9d0f047-fa26-4ffa-a5fe-d17cfa6b1bd0 | restrelas/SolvedProblems | URI/1179.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int contp = 0, conti = 0;
int vetorp[5], vetori[5];
for(int i=0; i < 15; i++){
int n; cin >> n;
if(contp == 5){
contp = 0;
for(int j=0; j < 5; j++){
cout << "par[" << j << "] = " << vetorp[j... | ALGO | 0.999696 | 3.51953 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2019-08-15T03:04: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": "233e6ec72... |
f6bea191-e617-4fac-8a78-09b25902bc15 | hyunwoo0081/Algorithm | 백준/Platinum/6549. 히스토그램에서 가장 큰 직사각형/히스토그램에서 가장 큰 직사각형.cc | #include <iostream>
#define fastIO() ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr)
using namespace std;
int histograms[100000];
long long maxSquare(int start, int end) {
if (start == end)
return histograms[start];
int mid = (start + end) / 2;
long long maxS = max(maxSquar... | ALGO | 0.999738 | 4.025957 | {
"github_metadata": {
"branch": "master",
"commit_count": 953,
"repo_created_at": "2021-06-13T04:49:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d8de97f3... |
d1ea85ba-944e-45da-8db8-03f879c0029a | TAMANNA230904/Data-Structures | Arrays/K closest elements.cpp | Given a array, arr[] of n integers, and a value x. Find the K closest elements to x in arr[].
Keep the following points in mind:
If x is present in the array, then it need not be considered.
If two elements have the same difference as x, the greater element is prioritized.
If sufficient elements are not present on the... | ALGO | 0.999995 | 5.962039 | {
"github_metadata": {
"branch": "main",
"commit_count": 122,
"repo_created_at": "2023-10-23T15:56: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": "9018545f66... |
7ab19680-cba6-4662-a24b-84e2f5bbc4c2 | maxzaptol/M16-ASIX-2023 | clase/clase/main.cpp | #include <iostream>
#include <ctime>
#include <cstdlib>
#include "Lancha.h"
using namespace std;
using namespace std;
int main() {
Lancha lancha1("Lancha 1");
Lancha lancha2("Lancha 2");
char tecla;
for (int turno = 1; turno <= 5; turno++) {
std::cout << "\nTurno de lancha 1\n ";
... | TOOL | 0.980093 | 4.294607 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2023-12-15T09:19: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": "7ca21a6d46e3... |
d3edabfc-65ef-4503-b4b5-6f56c3e625dc | RoseAlice2018/Algorithm2024 | 202507/0713.cpp | #include<vector>
#include<stack>
#include<queue>
#include<string>
#include<unordered_map>
#include<unordered_set>
using namespace std;
struct ListNode{
int val;
ListNode *next;
ListNode() : val(0), next(nullptr) {}
ListNode(int x):val(x), next(nullptr) {}
ListNode(int x, ListNode *next):val(x), next... | ALGO | 0.99999 | 5.73323 | {
"github_metadata": {
"branch": "main",
"commit_count": 155,
"repo_created_at": "2023-12-30T14:37:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0d327d0d0b... |
845932e2-2063-4f35-8d57-c08d9e552134 | fit087/mestradocc | SOLVER/GRASP.h | /*
* File: GRASP.h
* Author: alexanderdealmeidapinto
*
* Created on 17 de Abril de 2011, 11:19
*/
#ifndef GRASP_H
#define GRASP_H
#include <iostream>
#include <vector>
#include "Flight.h"
#include "Parameters.h"
#include "Instance.h"
#include "util/LocalSearchUtil.h"
using namespace std;
class GRASP {
publ... | ALGO | 0.994498 | 4.570315 | {
"github_metadata": {
"branch": "master",
"commit_count": 47,
"repo_created_at": "2015-05-01T04:25:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "e89709072... |
dd193a2b-4b9f-4bf4-ae59-1e70d340b0b6 | noobie7/CodeBank | AtCoder/abc164/E.cpp | /*
"Won't stop until I'm phenomenal."
- <NAME>
*/
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define ff first
#define Shazam ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define ss second
#define all(c) c.begin(),c.end()
#define endl "\n"
#define test() int t; cin>>t; ... | ALGO | 0.99996 | 3.334247 | {
"github_metadata": {
"branch": "main",
"commit_count": 156,
"repo_created_at": "2021-09-12T05:11:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "eecb2caef4... |
fb80466f-1e89-4d8c-8beb-0f0e13f288dd | ROCm/rocPRIM | rocprim/include/rocprim/device/detail/config/device_radix_sort_block_sort.hpp | // Copyright (c) 2022-2025 Advanced Micro Devices, Inc. All rights reserved.
//
// 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 restriction, including without limitation the rights... | ALGO | 0.995264 | 6.521496 | {
"github_metadata": {
"branch": "develop_deprecated",
"commit_count": 1581,
"repo_created_at": "2017-12-13T20:51:12.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 172,
"forks": 77,
"issues": 0,
"pull_requests": 4
},
"file_meta": {
"content... |
135981c6-966f-4647-afa5-59ef07e42fe9 | itohdak/Codeforces | Div3/prev/642/D.cpp | #include <bits/stdc++.h>
#include "/home/itohdak/Codeforces/000/print.hpp"
using namespace std;
#define ll long long
#define REP(i,m,n) for(int i=(int)(m); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define RREP(i,m,n) for(int i=(int)(m); i>=(int)(n); i--)
#define rrep(i,n) RREP(i,n-1,0)
#define REPL(i,m,n) for(ll i=... | ALGO | 0.999974 | 4.17896 | {
"github_metadata": {
"branch": "master",
"commit_count": 46,
"repo_created_at": "2018-05-21T14:37: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": "c1c7657e6... |
ff315042-4bbc-4c82-a7d5-2abce03262a7 | ryancarr/CppND-PointersLabs | Lab06/main.cpp | #include <iostream>
template <typename Type>
void swap(Type &var1, Type &var2)
{
// Swaps two variables by using pointer arithmetic
var1 += var2;
var2 = var1 - var2;
var1 -= var2;
}
int main()
{
float var1 = 23.2;
float var2 = 14.83;
std::cout << "Values before swap: " << var1 << " " << v... | ALGO | 0.999127 | 6.307416 | {
"github_metadata": {
"branch": "master",
"commit_count": 22,
"repo_created_at": "2019-07-02T15:46: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": "49c99e206... |
caf01ac2-e60c-4c52-ad5c-a009e34a5be1 | google-deepmind/reverb | reverb/cc/selectors/heap.h | // Copyright 2019 DeepMind Technologies Limited.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable l... | ALGO | 0.955111 | 7.597378 | {
"github_metadata": {
"branch": "master",
"commit_count": 735,
"repo_created_at": "2020-05-01T09:17:02.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 736,
"forks": 102,
"issues": 23,
"pull_requests": 6
},
"file_meta": {
"content_id": "364e... |
082ccd8a-d70f-4a47-8b9b-34474c9916aa | aokblast/LeetCode_Problem_Solving | Medium/911_Online_Election.cpp | //greedy
//Runtime 286
//Memory Usgae 104.1
class TopVotedCandidate {
public:
int n;
vector<pair<int, int>> vs;
TopVotedCandidate(vector<int>& persons, vector<int>& times) {
unordered_map<int, int> cnt;
n = persons.size();
for(int i = 0; i < n; ++i)
vs.push_back({times[i... | ALGO | 0.999996 | 5.8618 | {
"github_metadata": {
"branch": "master",
"commit_count": 61,
"repo_created_at": "2021-11-01T02:46: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": "8f983e974... |
a30b86ec-3cf3-4f95-8f1e-55f357c8d8cc | HC-Chang/LeetCode | complete/2182.construct-string-with-repeat-limit.cpp | /*
* @lc app=leetcode id=2182 lang=cpp
*
* [2182] Construct String With Repeat Limit
*/
// @lc code=start
class Solution
{
public:
string repeatLimitedString(string s, int repeatLimit)
{
unordered_map<char, int> hash;
for (char c : s)
hash[c]++;
priority_queue<char> pq;... | ALGO | 0.999994 | 6.914828 | {
"github_metadata": {
"branch": "master",
"commit_count": 1238,
"repo_created_at": "2018-09-11T16: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": "81be573... |
ce744c9a-99f7-4af3-ad2e-fd67de28bd91 | YingChengJun/PAT-Code | 1123 Is It a Complete AVL Tree.cpp | #include <cstdio>
#include <algorithm>
#include <queue>
using namespace std;
vector<int> ans;
vector<int> v;
struct Node {
int val;
int height = 1;
int id;
Node* left = NULL;
Node* right = NULL;
Node(int v): val(v) {};
};
int getHeight(Node* node) {
return node == NULL ? 0 : node->height;... | ALGO | 0.999999 | 4.439479 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2020-07-16T04:07:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "64a134195... |
56405955-221b-4245-9061-256d827da724 | peter-i-frazier/biz | code/cpp/BIZHET.cpp | /*
* The BIZ policy with known, heterogeneous sampling variances.
*/
#include "BIZ.h"
#include <strings.h>
// #define DEBUG
/*
* Structure for storing statistics of a logq vector.
*/
typedef struct logqstats {
double sumq;
double best_logq;
int best_x;
double worst_logq;
int worst_x;
} logqstats_t;
lo... | ALGO | 0.999895 | 5.602984 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2014-05-20T02:15: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": "af43930834... |
bfb2c4fc-33e9-49d7-9294-88ce43958dcf | RaniFerreira/Estrutura-de-dados-I | ATIVIDADE 3(LISTA)/Lista beecrownd/1111-ss.cpp | #include <iostream>
using namespace std;
struct Node{
int valor;
Node* proximo;
Node(){
valor = 0;
proximo = NULL;
}
Node(int _valor){
valor = _valor;
proximo = NULL;
}
};
struct List{
Node* primeiro;
Node* ultimo;
... | ALGO | 0.999932 | 4.554295 | {
"github_metadata": {
"branch": "main",
"commit_count": 41,
"repo_created_at": "2024-09-19T23:34:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c48d2d43d50... |
bc98f565-e50a-4a5b-a530-2caacc07334b | hasanprakash/Coding | Dsa450/Arrays/Sort012.cpp | // 14th April 2022
// Sorting an array contains only 0, 1, 2 without sort algorithm
#include <fstream>
#include <cstring>
using namespace std;
ifstream cin;
ofstream cout;
int main() {
cin.open("../../input.txt");
cout.open("../../output.txt");
int n; cin >> n;
int arr[n];
for(int i = 0; i < n; i++... | ALGO | 0.99999 | 4.713329 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2022-04-14T01:23: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": "c8c439a251... |
613ed99d-2d13-439b-ad80-a67a28934ef1 | IgnacioCofre/proyecto_tesis | includes/authors.h | #ifndef AUTHORS_H
#define AUTHORS_H
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <stdio.h>
#include <cstdlib>
class Authors{
public:
int number_articles;
int number_authors;
//number_articles_authors[id_article] = int number of authors
std::ve... | TOOL | 0.900651 | 3.759495 | {
"github_metadata": {
"branch": "main",
"commit_count": 54,
"repo_created_at": "2021-08-09T19:15:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1daee4611e4... |
8404eddd-8460-48f7-b37a-e62d6968fffb | milvus-io/knowhere | src/index/flat/flat.cc | // Copyright (C) 2019-2023 Zilliz. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable l... | TOOL | 0.969998 | 7.349612 | {
"github_metadata": {
"branch": "main",
"commit_count": 561,
"repo_created_at": "2021-12-28T11:26:20.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 214,
"forks": 83,
"issues": 47,
"pull_requests": 5
},
"file_meta": {
"content_id": "6185a0d... |
39635f30-190b-4e49-b599-1af3c8e8c490 | stalker5217/problem-solving | BAEKJOON/2239.cpp | #include <iostream>
#include <cstring>
using namespace std;
const int SIZE = 9;
const int AREA_SIZE = 3;
int sdoku[SIZE][SIZE];
bool visit[SIZE][SIZE];
bool isDone = false;
void makeAnswer(int);
bool validationCheck(int, int);
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
for(int i = 0 ; i < SIZ... | ALGO | 0.999946 | 4.61829 | {
"github_metadata": {
"branch": "master",
"commit_count": 934,
"repo_created_at": "2019-06-09T06:19:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5c8e8e05... |
8215b72f-dde8-4ed9-83e7-5409178997e6 | ishandutta2007/codeforces-m | mr.robot_28/normal/1586/A.cpp | #include<bits/stdc++.h>
#define X first
#define Y second
#define ll long long
#define sz(a) (int)a.size()
using namespace std;
signed main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int t;
cin >> t;
while(t--){
int n;
cin >> n;
vector <int> a(n);
... | ALGO | 0.999768 | 3.555775 | {
"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": "0f054efbce67... |
e2202f51-f80f-4a1a-896a-ce5c05c2373f | M1wyTka/MIPT_Networked | hw3/source/AgarGame.cpp | #include <AgarGame.hpp>
#include <random>
#include <vector>
#include <cstring>
AgarGame::AgarGame(int width, int height) :
width_(width),
height_(height),
is_running_(false)
{
}
AgarGame::~AgarGame()
{
}
void AgarGame::StartGame()
{
entiti... | ALGO | 0.914919 | 4.028994 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2022-03-25T20:17: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": "bc720fa296b6... |
8ea6d0f3-4e53-4df8-8b17-989cbca9e5f2 | DayeetaDas/Maths-Games | Yes or No.cpp | #include "pch.h"
#include<iostream>
#include<cstdlib>
#include<cstring>
#include<ctime>
using namespace std;
double eq = 0;
char operators[4] = { '+', '-', '*', '/' };
int n1 = 0, n2 = 0, n3=0;
int randIndex = 0;
char s = ' ';
char ans=' ';
int score = 0, total_score = 0;
void instructions()
{
cout << "This is a maths... | TOOL | 0.984662 | 3.170756 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2019-02-24T19:28:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b46bf5648... |
01ce8dc1-da72-4a49-bb09-de13ee3c6356 | Pedrozo/algorithms | Mathematics/ConvexHull/Convex_Hull.cpp | /*
Convex Hull, pega os pontos que tem uma orientação mais a esquerda do ponto que tem o x menor
faz isso para os proximos pontos até voltar para o inicial
Codigo testado em: https://www.urionlinejudge.com.br/judge/pt/problems/view/1982
*/
#include<bits/stdc++.h>
using namespace std;
struct point{
doub... | ALGO | 0.99898 | 4.115774 | {
"github_metadata": {
"branch": "master",
"commit_count": 76,
"repo_created_at": "2018-12-14T18:53:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a9bc357ff... |
9bee6ad0-aebb-4716-a8c7-025dca99e296 | GendalfBlack/P21_Lessons | ConsoleApplication17/ConsoleApplication17/ConsoleApplication17.cpp | #include <iostream>
using namespace std;
void t6(double a, double b, double i) {
cout << "-----";
for (double k = a; k <= b; k += i){ cout << "-------"; }
cout << "\n| x |";
for (double x = a; x <= b; x+=i){ printf("%6.2lf|", x); }
cout << "\n+---+";
for (double k = a; k <= b; k += i) { cout << "------+"; }
... | ALGO | 0.957005 | 3.44287 | {
"github_metadata": {
"branch": "master",
"commit_count": 58,
"repo_created_at": "2023-04-12T10:44:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a16678d06... |
190f06ab-805f-414e-b4c2-2102f2696a68 | ShihabShafkat/c- | 16.02.04.106_krushkal.cpp | #include<bits/stdc++.h>
using namespace std;
struct node{
int root;
int child;
int cost;
};
int parent[100];
int findset(int u){
if(u != parent[u]){
return findset(parent[u]);
}else{
return u;
}
}
int main(){
int vertex, edge, cost = 0;
cout<<"Vertex: ";
cin>>vertex;
... | ALGO | 0.999967 | 4.084515 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-01-06T14:52: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": "433883e8bb... |
89d4f582-5608-4350-b9aa-d3102c036431 | lnkkerst/oj-codes | src/codeforces/ecr127div2/d/1.cpp | #pragma GCC optimize(2)
#include <algorithm>
#include <array>
#include <bitset>
#include <cmath>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <ve... | ALGO | 0.999943 | 5.479847 | {
"github_metadata": {
"branch": "main",
"commit_count": 56,
"repo_created_at": "2022-03-23T15:37:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "090ede3b3ff... |
4aa1b5fd-8d42-469f-aa0f-c7ab1701a795 | mstrifaa/Banking-Record-System | banking.cpp | #include<iostream>
#include<fstream>
#include<cctype>
#include<iomanip>
#include <stdio.h>
#include <stdlib.h>
using namespace std;
class acc
{
int n;
char name[100];
int dep;
char type;
public:
void create_account();
void depo(int);
int return_acc() const;
};
void acc::create_account()
{
... | TOOL | 0.909328 | 3.057618 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2019-04-07T15:49:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "29c76f7c3... |
d8e4e8a9-e16a-4a6a-acc9-bace063de2bc | tysik/obstacle_detector | include/obstacle_detector/utilities/kalman.h | /*
* Software License Agreement (BSD License)
*
* Copyright (c) 2017, Poznan University of Technology
* 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 c... | ALGO | 0.997657 | 7.199522 | {
"github_metadata": {
"branch": "master",
"commit_count": 29,
"repo_created_at": "2017-06-27T15:25:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 571,
"forks": 216,
"issues": 28,
"pull_requests": 4
},
"file_meta": {
"content_id": "d4b9... |
c51eb205-1996-447f-803c-7d9b7cf33b91 | pkthapa/Leetcode | Hard/Merge-k-Sorted-Lists/Merge-k-Sorted-Lists.cpp | #include "main.hpp"
/*
* Definition for singly-linked list.
*/
struct ListNode {
int val;
ListNode *next;
ListNode() : val(0), next(nullptr) {}
ListNode(int x) : val(x), next(nullptr) {}
ListNode(int x, ListNode *next) : val(x), next(next) {}
};
/*
A brute force solution could be to add all elem... | ALGO | 0.999844 | 6.572774 | {
"github_metadata": {
"branch": "main",
"commit_count": 259,
"repo_created_at": "2022-07-08T02:29: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": "9d9ebc525d... |
e61d1baa-82bf-4f7f-b129-144463715e99 | hhungry/algorithm | algorithm/getLongestPalindrome.cpp | class Palindrome {
public:
//dp方法
int getLongestPalindrome(string A, int n) {
// write code here
if(A.size()==0||A.size()!=n)
return 0;
bool **dp=new bool*[n];
for(int i=0;i<n;++i){
dp[i]=new bool[n];
}
for(int i=0;i<n;++i){
... | ALGO | 0.999965 | 5.074514 | {
"github_metadata": {
"branch": "master",
"commit_count": 98,
"repo_created_at": "2017-03-31T06:52:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b04992140... |
a4ac1777-26af-4236-9723-574ac6d88935 | jojonicho/algorithms | codeforces/combi-dp/414B/solution.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;
#define vt vector
#define ar array
#define vi vector<int>
#define vvi vector<vector<int>>
#define vll vector<long long>
#define vpii vector<pair<int, int>>
#define all(x) (x).begin(), (x).end()
#d... | ALGO | 0.999992 | 4.156371 | {
"github_metadata": {
"branch": "master",
"commit_count": 80,
"repo_created_at": "2020-06-02T14:26:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d67c48041... |
deb89357-4530-47f6-b61f-3613a1c4b945 | vmsou/finite-state-machine | src/main.cpp | /* Trabalho 1 - Máquinas de Estados Finitos
Aluno: <NAME>
Data: 10/08/2022
# Enunciado
Para obter os pontos relativos a este trabalho, você deverá criar um programa, utilizando a
linguagem Python, C, ou C++. Este programa, quando executado, irá determinar se uma string de
entrada faz parte ... | ALGO | 0.975152 | 5.124163 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2022-08-04T00:31: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": "a55e7bece... |
99774b20-b29b-433a-9b57-9676a5d4a60d | vikashmalakar275/Data_Structure_and_Algorithm | takeUforward/Strivers_A2Z_DSA_Course/Solve_Problems_on_Arrays/Medium/Rearrange_Array_Elements_by_Sign_varaity2.cpp | /*
Problem Statement:
There’s an array ‘A’ of size ‘N’ with positive and negative elements (not necessarily equal). Without altering the relative order of positive and negative elements, you must return an array of alternately positive and negative values. The leftover elements should be placed at the very end in the s... | ALGO | 0.999998 | 5.102042 | {
"github_metadata": {
"branch": "main",
"commit_count": 248,
"repo_created_at": "2023-09-25T07:37: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": "44a5ce6756... |
a5dc8d39-f988-4b77-83c2-c302bf17a909 | ishandutta2007/codeforces-z | zjjws/normal/1486/F.cpp | #include <vector>
#include <stdio.h>
#include <algorithm>
#define LL long long
#pragma GCC optimize(3)
using namespace std;
inline LL rin()
{
LL s=0;
bool bj=false;
char c=getchar();
for(;(c>'9'||c<'0')&&c!='-';c=getchar());
if(c=='-')bj=true,c=getchar();
for(;c>='0'&&c<='9';c=getchar())s=(s<<1)... | ALGO | 0.99932 | 3.749676 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:43: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": "434400497a96... |
3880d3bc-00f0-49a7-a787-412402a870a8 | kgomezo/HerrCompt | 2022-01-14-MPIExercises/Jacksen.cpp | #include "mpi.h"
#include <iostream>
#include <stdlib.h>
#include <vector>
void print( const std::vector<int>& matrix, const int& columns, const int& rows);
int main(int argc, char **argv)
{
int pId; // rank of process
int nP; // number of processes
int N = atoi(argv[1]); // size of matrix
MP... | ALGO | 0.998539 | 4.595514 | {
"github_metadata": {
"branch": "master",
"commit_count": 57,
"repo_created_at": "2021-10-08T17:20: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": "5cd90c51f... |
f6647597-ed84-45b0-aee5-986d6b3bd21e | mansi1309/GeeksForGeeks | Easy/Sum of all divisors from 1 to n/sum-of-all-divisors-from-1-to-n.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function Template for C++
class Solution
{
public:
// int solve(int n){
// int ans=0;
// for(int i=n;i>0;i--){
// if(n%i==0){
// ans=ans+i;
// }
// }
... | ALGO | 0.999955 | 6.125117 | {
"github_metadata": {
"branch": "main",
"commit_count": 579,
"repo_created_at": "2023-11-01T08:01: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": "21e13b5e54... |
7a9ca2ed-cc22-49d8-9c22-b32d1a2dda5f | VishalBh4r4mbe/DataStructuresAndAlgorithms | contest/Library/Data Struc/Trie.cpp | #include <bits/stdc++.h>
using namespace std;
//for 'a' - 'z' change 26 to something accordingly
//Array implemenation of Trie
const int MaxNodes = 1e5+7;
int ender[MaxNodes];
int trie[26][MaxNodes];
bool created[MaxNodes];
int curSize= 0;
void insert(string &str){
int curv=0;
for(int i =0;i<str.size();i++){
... | ALGO | 0.999759 | 3.777712 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2021-03-06T09:10:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "41a9ced5f51... |
5b3835a6-daa1-4c8d-974b-97a437522bf2 | voyager23/DivisibiltyFactorials | dev/factorial_primes.cxx | /*
* factorial_primes.cxx
*
* Copyright 2021 <NAME> <<EMAIL>>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version... | ALGO | 0.995472 | 4.571246 | {
"github_metadata": {
"branch": "main",
"commit_count": 44,
"repo_created_at": "2021-10-18T14:22:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "21e5549aeb8... |
85af2019-b709-401e-ad75-1428c16b204c | ChenKuan1110/CPP_STUDY | try/point_calc.cpp | # include <stdio.h>
const int MAX = 3;
int main()
{
int var[] = {10, 20, 100};
int i, *ptr = NULL;
// ++
printf("指针 ++\n");
ptr = var; // 指向组数地址
for (i = 0; i < MAX; i++)
{
printf(" 存储地址 var[%d] = %p\t", i, ptr);
printf(" 存储值: var[%d] = %d\n", i, *ptr);
ptr++;
}
// --
printf("指针 --... | ALGO | 0.996168 | 3.861146 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2022-03-30T07:17:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2ebc587989c... |
08de0ae5-d790-49c4-b517-475258bf7394 | sungpyo9053/datastructure | BinaryTreeSearch.cpp | #include <iostream>
#include <string>
#include <fstream>
using namespace std;
char prec[4][2] = {'*',2, '/',2, '+',1, '-',1};
class Node
{
friend class Tree;
char data;
Node *left;
Node *right;
int prior;
};
class Tree
{
public:
Node *head;
Tree();
void ... | ALGO | 0.999892 | 4.12957 | {
"github_metadata": {
"branch": "master",
"commit_count": 39,
"repo_created_at": "2019-03-18T00:17: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": "daf7b4846... |
ae089f15-d79e-4367-8acb-8e15ef7115c5 | shash42/Competitive-Programming | CF/ED86/C.cpp | #include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#define pb push_back
#define F first
#define S second
#define int long long
#define lint long long
#define mp make_pair
#define pii pair<int, int>
#define vi vector<int>
#define sz(x) (int)x.size()
#define all(x) begin(... | ALGO | 0.999774 | 3.742694 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2020-07-01T12:15:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ee7561a636... |
4163785a-8364-4139-9c47-a14572417b2b | AlbertKang1004/Learn-Cplusplus | Learn C++/Chapter14/Complete/14-02-Q1.cpp | //#include <iostream>
//#include <numeric>
//
//class Fraction {
//private:
// int m_num { 0 };
// int m_den { 1 };
//public:
// Fraction(int num, int den = 1) :
// m_num { num }, m_den { den } {
// reduce();
// }
// void reduce() {
// int GCD { std::gcd(m_num, m_den) };
// if (m_num != 0) {
// m_num /= GCD;
// ... | TOOL | 0.965787 | 6.175418 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-10-27T01:12: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": "d6d3fa6ef939... |
156e8c92-5f77-4a85-a424-4e1ed2f99abd | aatman-24/DSA | LeetCode/Hard/862. Shortest Subarray with Sum at Least K.cpp | #include <bits/stdc++.h>
#define ll long long
#define REP(i,n) for(int i = 0; i < n; i++)
#define REP1(i,n) for(int i = 1; i <= n; i++)
#define debug cout << "Ok" << endl;
#define mod 1000000007
using namespace std;
typedef pair<ll,ll> ii;
typedef vector<ii> vii;
typedef map<char,int> mci;
typedef vector<int> vi;
ty... | ALGO | 0.999952 | 5.35114 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2021-04-13T13:29: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": "145af2dadc8... |
7bf215a3-68d3-462f-bc5b-81c486537171 | dreyus95/AVSP_SourceQualityPrediction | CodeJamCrawler/dataset/13_6030_70.cpp | //
// A.cpp
// BaseProj
//
// Created by <NAME> on 13/04/13.
// Copyright (c) 2013 <NAME>. All rights reserved.
//
#include <iostream>
using namespace std;
string grid[4];
bool checkH(char ch, int no) {
int c = 0;
for (int i = 0; i < 4; ++i) {
if(grid[no][i] == ch || grid[no][i] == 'T') {
... | ALGO | 0.999732 | 4.2703 | {
"github_metadata": {
"branch": "master",
"commit_count": 70,
"repo_created_at": "2017-06-08T21:00:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6a3332745... |
2ddc5d29-11d8-4ac8-b245-4f20afc66b69 | Akiko0210/Competitive-programming | codeforces/contest/950/E.cpp | #include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define ss second
#define ff first
#define pb push_back
#define pii pair<int, int>
#define INF INT_MAX
using namespace std;
void debug_out() { cerr << endl; }
template<typename Head, typename... Tail> void debug_out(Head H, Tail... T) { cerr <... | ALGO | 0.999961 | 4.757526 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2024-01-11T06:51:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5eb9988a30b8... |
b07a7c05-3371-400b-9351-270807ffff39 | jun-pac/PS | 240302/6set/C.cpp |
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define cediv(a,b) ((a)%(b)==0?((a)/(b)):((a)/(b))+1)
#define rng(i,a,b) for(int i=int(a);i<=int(b);i++)
#define rep(i,b) rng(i,0,b-1)
#define gnr(i,b,a) for(int i=int(b);i>=int(a);i--)
#define per(i,b) gnr(i,b-1,0)
#define pb push_back... | ALGO | 0.999962 | 4.601465 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2024-02-19T18:00: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": "60e8eae2442... |
b114cf0e-b777-4b95-832b-8bcc06c7fb0f | NikkiJain09/programming-abstractions | Chapter_08/Exercise_18/8_18.cpp | #include <stdio.h>
#include "simpio.h"
#include <iostream>
#include "gwindow.h"
using namespace std;
void drawSierpinski(GWindow &gw, double x, double y, double size, int order);
int main() {
GWindow gw(700, 600);
double edge = getReal("Enter an edge size: ");
int order = getInteger("Enter an order size:... | ALGO | 0.95552 | 5.29682 | {
"github_metadata": {
"branch": "master",
"commit_count": 128,
"repo_created_at": "2015-10-24T06:37:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 14,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7967d64... |
1f651bb5-1597-4f1b-b6b4-4cd6ebb20830 | emiandji/sparse-brdf | cssRecon/ReconHelpers.inl |
template <typename T>
void SL0(Eigen::Matrix<T, Eigen::Dynamic, 1>& s,
const Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic>& A,
const Eigen::Matrix<T, Eigen::Dynamic, 1>& x,
T sigma_min,
T sigma_decrease_factor,
T mu_0,
size_t L)
{
Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> A_pinv = A.transpose() * (... | ALGO | 0.999879 | 5.043117 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2022-04-28T14:31:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5c5bd16ef86b... |
499722a6-4c34-4514-90d1-f42c3cf2103f | zixfy/cpp-leetcode | [805]数组的均值分割.cpp | //给定你一个整数数组
// nums
//
// 我们要将
// nums 数组中的每个元素移动到 A 数组 或者 B 数组中,使得 A 数组和
// B 数组不为空,并且
// average(A) == average(B) 。
//
// 如果可以完成则返回true , 否则返回 false 。
//
// 注意:对于数组
// arr ,
// average(arr) 是
// arr 的所有元素的和除以
// arr 长度。
//
//
//
// 示例 1:
//
//
//输入: nums = [1,2,3,4,5,6,7,8]
//输出: true
//解释: 我们可以将数组分割为 [1,4,5,... | ALGO | 0.999866 | 5.623343 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2023-09-01T09:04: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": "8063ed89c1ba... |
373e6f70-ed71-4c53-912d-b05466884f9b | Jar0T/Hexapod | Hexapod_code/src/helpers/helpers.cpp | #include "helpers/helpers.h"
#include "math.h"
#include <stdio.h>
Vector2 polar_to_cartesian(Vector2 polarCoordinates) {
return {
.x = polarCoordinates.r * cos(polarCoordinates.fi),
.y = polarCoordinates.r * sin(polarCoordinates.fi)
};
}
Vector2 polar_to_cartesian(float r, float fi) {
retu... | TOOL | 0.976932 | 6.370271 | {
"github_metadata": {
"branch": "main",
"commit_count": 41,
"repo_created_at": "2023-12-18T20:51: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": "db9a81fcb57... |
9f060a1d-a752-4917-bbd4-8dad67880d63 | ShahjalalShohag/ProblemSolving | codeforces/1286/C1.cpp | #include<bits/stdc++.h>
using namespace std;
const int N = 3e5 + 9;
int32_t main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
int n; cin >> n;
cout << "?" << ' ' << 1 << ' ' << n << '\n';
cout.flush();
map<string, int> mp;
for (int i = 0; i < n * (n + 1) / 2; i++) {
string s; cin >> s;
sort(s.begin(), s.e... | ALGO | 0.999947 | 3.055573 | {
"github_metadata": {
"branch": "master",
"commit_count": 2261,
"repo_created_at": "2020-12-20T21:28:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 37,
"forks": 13,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a5a79... |
20fc2d0d-e257-4564-a38b-44abb28c2ef3 | Bjersgen/My_Robotics | Quadrotor/real_ws/src/px4ctrl/src/linear_control.cpp | #include "linear_control.h"
#include <iostream>
#include <ros/ros.h>
LinearControl::LinearControl(Parameter_t ¶m) : param_(param)
{
resetThrustMapping();
}
/*
compute u.thrust and u.q, controller gains and other parameters are in param_
*/
quadrotor_msgs::Px4ctrlDebug
LinearControl::calculateControl(const D... | ALGO | 0.996604 | 5.741926 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2022-07-08T03:45:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7ccd4538265... |
e29139f1-31bf-4f56-b93d-2296de570dc4 | jose-dom/bitcoin_forecasting | env/lib/python3.9/site-packages/pystan/stan/lib/stan_math/stan/math/rev/mat/functor/jacobian.hpp | #ifndef STAN_MATH_REV_MAT_FUNCTOR_JACOBIAN_HPP
#define STAN_MATH_REV_MAT_FUNCTOR_JACOBIAN_HPP
#include <stan/math/prim/mat/fun/Eigen.hpp>
#include <stan/math/rev/core.hpp>
#include <stdexcept>
#include <vector>
namespace stan {
namespace math {
template <typename F>
void jacobian(const F& f, const Eigen::Matrix<doub... | ALGO | 0.990919 | 6.987965 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2021-01-04T01:45:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 12,
"forks": 12,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "7a624a1b... |
b73d089a-7091-4227-9635-d103732875db | Ashuyadav8833/C-plusplus-basics | Beginner/array_sum.cpp | // Sum of Array Elements in C++
// This program calculates the sum of all elements in an array.
#include <iostream> // Standard input-output stream library
int main() {
int size; // Variable to store the array size
// Taking the array size input
std::cout << "Enter the number of elements: ";
std::c... | ALGO | 0.998909 | 5.440027 | {
"github_metadata": {
"branch": "main",
"commit_count": 59,
"repo_created_at": "2025-03-27T08: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": "199d8283a64... |
85189cf6-59c4-4bc6-9aaa-cc90ad2df417 | VincentXu521/LeetCode_Projects | P49_Anagrams.cpp | /*
Given an array of strings, group anagrams together.
Example:
Input: ["eat", "tea", "tan", "ate", "nat", "bat"],
Output:
[
["ate","eat","tea"],
["nat","tan"],
["bat"]
]
Note:
All inputs will be in lowercase.
The order of your output does not matter.
https://www.cnblogs.com/grandyang/p/4385822.html
*/
#include<vect... | ALGO | 0.99998 | 5.661175 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2019-09-10T14:54:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
"content_id": "85dd8d60b... |
533c1077-9dd7-4555-994e-30db12f22bfb | KevinLADLee/frontier-exploration | src/frontier_exploration.cpp |
#include "frontier_exploration.h"
namespace frontier{
FrontierExploration::FrontierExploration() : global_planner_actionlib_client_("global_planner_node_action", true),
local_planner_actionlib_client_("local_planner_node_action", true){
nh_.param<bool>("enable_visualiz... | ALGO | 0.998101 | 4.418145 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-02-18T02:40: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": "4ccd83c949... |
9e33f839-290a-4789-9f94-96122c15b82d | Leejunho/algorithm_dong-a | al12.cpp | #include <cstdio>
#include <algorithm>
#include <queue>
#define MAX 1010
using namespace std;
FILE *fp_input = fopen("watertank.inp", "rt");
FILE *fp_output = fopen("watertank.out", "wt");
int T;//test case
struct Node {
int n;
int up;
int right;
int down;
int left;
} N[MAX + 2][MAX + 2];
struct PQ {
int x;
... | ALGO | 0.998007 | 3.237478 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-06-13T07:10: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": "f2522091e1... |
3528c578-5bd2-45d1-a8c5-7f2a2f1d59f6 | Ahmed-Saayed/Compititve-Programming | AtCoder/abc383_f-Diversity.cpp | #include <bits/stdc++.h>
#define ll long long
#define tt int tc;cin>>tc;while(tc--){
#define all(v) (v).begin(),(v).end()
#define nn cout<<"\n"
using namespace std;
void Ahmed_Sayed(){
ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
}
const int N = 500;
ll n, X, k, dp[N][50001][2];
array<ll, 3>x[N];
ll rec(int i ... | ALGO | 0.999801 | 4.423976 | {
"github_metadata": {
"branch": "master",
"commit_count": 409,
"repo_created_at": "2024-10-02T12:19:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3585446a... |
ba987655-3ba5-416a-a327-ee8ebec73b69 | tjd229/Algorithm | codeforce/1496B.cpp | //implementation
#include <stdio.h>
#include <algorithm>
#include <set>
using namespace std;
int a[100002];
int mex(int n) {
for (int i = 1; i <= n; ++i) {
if (i-1 != a[i]) return i - 1;
}
return n;
}
int main() {
int t;
for (scanf("%d", &t); t--;) {
int i, n, k;
set<int> S;
for (scanf("%d%d", &n, &k), i =... | ALGO | 0.99915 | 3.07786 | {
"github_metadata": {
"branch": "master",
"commit_count": 1473,
"repo_created_at": "2017-09-03T02:47:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6d57c0a... |
6fcd3a4b-0383-4b42-b3c5-d15b557f41ae | XDEv11/Codeforces | 2019-2020_ICPC_East_Central_North_America_Regional_Contest/H.cpp | //#pragma GCC optimize ("O3")
#include <iostream>
#include <vector>
#include <array>
#include <utility>
#define fi first
#define se second
#include <map>
#include <algorithm>
#include <numeric>
using namespace std;
using ll = long long;
ll MA(ll a, ll b, ll m) { return (a + b) % m; }
ll MS(ll a, ll b, ll m) { retur... | ALGO | 0.999676 | 3.891241 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2025-02-06T13: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": "d4af8bc42d... |
2e352834-4bb3-4f2c-bd8c-273fe9ff757b | jauhararifin/cp | toc_desember_2017/a.cpp | #include <bits/stdc++.h>
using namespace std;
int n,m,_x1,_y1,_x2,_y2;
int main() {
scanf("%d%d%d%d%d%d", &n, &m, &_y1, &_x1, &_y2, &_x2);
if (_x1 == _x2 && _y1 == _y2)
printf("0\n");
else if (_x1 == _x2)
printf("%d\n", _y1 < _y2 ? 1 + n - _y1 : 1 + _y1 - 1);
else if (_y1 == _y2)
... | ALGO | 0.99996 | 3.412561 | {
"github_metadata": {
"branch": "master",
"commit_count": 200,
"repo_created_at": "2016-12-02T13:56: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": "5b60936b... |
65e56b06-7b38-4190-923b-5f1a283d13ca | puzzlemusa/ProblemSolving | ProblemSolving/src/LeetCode/PopulatingNextRightPointersInEachNode.cpp | /*
ID: puzzlemusa
PROG:
LANG: C++
*/
#include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <strin... | ALGO | 0.999917 | 3.794937 | {
"github_metadata": {
"branch": "master",
"commit_count": 246,
"repo_created_at": "2017-06-18T09:22: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": "b3af755a... |
b0314123-867f-4a45-9414-85fc67745248 | t-whiteley/ucl_rocket | airbrakes/control_system/archive/Cpp_model/airbrake.cpp | #include "IMU_sim.h"
#include "kf.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <math.h>
#include <time.h>
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define FREQ 120
#define DT 0.01
#define GRAV_CONST 9.81
#define RHO 1.293
#define MASS 5
#define DESIRED_APOGEE 750
#define MOTOR_STEP 0.01
#d... | ALGO | 0.9979 | 4.492456 | {
"github_metadata": {
"branch": "master",
"commit_count": 31,
"repo_created_at": "2023-11-22T22:56:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "438bed707... |
ca2392b5-9183-448f-824b-e54604199e3d | CNES/bulldozer | bulldozer/preprocessing/dsm_filling/cython/c_fill.cpp | /*Copyright (c) 2022-2025 Centre National d'Etudes Spatiales (CNES).
This file is part of Bulldozer
(see https://github.com/CNES/bulldozer).
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
... | ALGO | 0.996605 | 5.486615 | {
"github_metadata": {
"branch": "master",
"commit_count": 268,
"repo_created_at": "2023-01-16T14:34:27.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 28,
"forks": 3,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "a3d51f26... |
64c41096-70f7-4ab9-bbe9-8e7b1bacf89a | 0LiHengTao/MyArmor | src/ArmorNumClassifier.cpp | #include"ArmorDector.h"
//用模板匹配的方法识别装甲板数组
double TemplateMatch(const cv::Mat& inputImage, const cv::Mat& templateImage, int matchMethod) {
cv::Mat result;
cv::matchTemplate(inputImage, templateImage, result, matchMethod);
double minVal, maxVal;
cv::Point minLoc, maxLoc;
cv::minMaxLoc(result, &minVal, &maxVal, &m... | ALGO | 0.973594 | 4.370203 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2023-08-25T08:07: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": "84fe141d24... |
a89aa43d-eaaa-4a0b-95ef-67e295aed635 | kasiyan16/Programming1 | 17_lab/17_lab.cpp | #include <iostream>
#include <string>
#include <sstream>
// Function to swap the first two letters of words with the same first two letters
void swapWordsWithSameFirstLetter(std::string& input) {
std::istringstream iss(input);
std::string word;
std::string result;
while (iss >> word) {
if (wor... | ALGO | 0.999597 | 5.825037 | {
"github_metadata": {
"branch": "main",
"commit_count": 102,
"repo_created_at": "2023-10-22T21:57: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": "743a2f9123... |
0fa21948-2675-4ccb-b0a3-f075c3c68ed7 | timi-liuliang/echo | thirdparty/mlpack/thirdparty/armadillo/include/armadillo_bits/fn_sqrtmat.hpp | // Copyright 2008-2016 <NAME> (http://conradsanderson.id.au)
// Copyright 2008-2016 National ICT Australia (NICTA)
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.or... | ALGO | 0.99909 | 7.11265 | {
"github_metadata": {
"branch": "master",
"commit_count": 3016,
"repo_created_at": "2018-03-10T04:07:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 971,
"forks": 116,
"issues": 254,
"pull_requests": 0
},
"file_meta": {
"content_id": "a... |
937293e9-d3da-427d-9a25-9d2192842f38 | Harunerd/spbspu-labs-2023-aap-master | khomichenko.alisa/P3/main.cpp | #include <iostream>
#include <iomanip>
#include <exception>
#include <cctype>
#include "readString.hpp"
#include "varFunc.hpp"
int main()
{
using namespace khomichenko;
int size = 20;
char * firstInput = new char[size]{};
char c = 0;
int read = 0;
std::cin >> std::noskipws;
if (!std::cin)
{
std::ce... | ALGO | 0.999348 | 4.258546 | {
"github_metadata": {
"branch": "master",
"commit_count": 4032,
"repo_created_at": "2023-10-12T15:20:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 42,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8d798f... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.