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 |
|---|---|---|---|---|---|---|---|
07b527c7-9ec9-45af-a100-acc07ea3ee7f | tempure/algorithm-advance | category/基础算法/二分/acwing_3578.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 2e5 + 10;
int a[N];
int n, m;
/*
先排序,增大中位数只能将中间位置中位数以及与中位数相等(如果存在)的一段全部增大才可以
或者如果不存在和中位数相同的一段,要将其变大为另外一个x,那么要将排序后中位数后所有小于x的全部变成x才可以
直接二分x即可
*/
bool check(int mid) {
ll res = 0;
for (int i = n / 2; i < n; i++)
if (a[i] <... | ALGO | 0.999992 | 3.894765 | {
"github_metadata": {
"branch": "master",
"commit_count": 1297,
"repo_created_at": "2020-11-16T08:58:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3e86c26... |
658259ff-0341-4046-a373-dfda896ecfbf | ALBA-CODES/FMS | IPMTC/source/src/IPMTC.cpp | /*
* Problem.cpp
*
* Copyright 2021 <NAME> <<NAME>@DESKTOP-HDL2CBS>
*
*
*/
#include "../include/IPMTC.h"
thread_local std::vector<std::pair <int,int>> IPMTC::twoSwap;
IPMTC::IPMTC(int numberJobs_, int numberTools_, int capacityMagazine_,std::vector<std::vector<bool>> toolJob_, std::vector<std::vector<int>>... | ALGO | 0.999936 | 4.595054 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-02-25T23:52:02.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "df79f660911ff... |
956d0e70-d34b-4552-ab25-8f9490ed4252 | bioinfomaticsCSU/BOSS | scaffoldgraph.cpp | #ifndef BUILDSCAFFOLDGRAPH_CPP_INCLUDED
#define BUILDSCAFFOLDGRAPH_CPP_INCLUDED
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <vector>
#include <exception>
#include "scaffoldgraph.h"
#include "scaffolding.h"
#include ... | ALGO | 0.91877 | 3.136792 | {
"github_metadata": {
"branch": "master",
"commit_count": 65,
"repo_created_at": "2015-10-19T01:24:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 10,
"forks": 3,
"issues": 4,
"pull_requests": 0
},
"file_meta": {
"content_id": "8df5f034... |
4cffc5e6-a2d9-47a8-8194-b94d7926a2a0 | nimacgit/CPP | class-olympiad/1394/code-forces/591/d.cpp | #include <iostream>
#include <vector>
using namespace std;
const int maxn = 1000;
int n, m;
bool mark[maxn];
vector<int> myque;
char ma[maxn + 100][maxn + 100];
vector<int> adj[maxn * maxn];
int minim = 1000 * 1000;
int cit = 0;
bool bfs(int s)
{
int cocit = 0;
myque.push_back(s);
mark[s] = true;
for(int i = 0; ... | ALGO | 0.999938 | 3.579171 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2018-11-23T15:25: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": "556b1c81a0... |
bfb41445-d782-4de2-a6af-b64ac20c146e | Yefri97/Competitive-Programming | Contests/Others/RPC/2017/04nd Contest/F.cpp | /*
* RPC 04st Contest 2017
* Problem F: Funny Strings
* Outcome: Accepted | Category: Longest Increasing Subsequence
*/
#include <bits/stdc++.h>
#define endl '\n'
#define to_int(C) (C - 'a')
using namespace std;
int main() {
ios_base::sync_with_stdio(false); cin.tie(0);
int t; cin >> t;
while (t--) {
... | ALGO | 0.999799 | 4.056527 | {
"github_metadata": {
"branch": "master",
"commit_count": 378,
"repo_created_at": "2016-06-01T01:51:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "60e8182d... |
bf4fd17f-a583-42b3-8409-336b4233e043 | wien0128/problem-solve | BaekJoon/11728_배열합치기_TwoPointer.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
// 배열합치기 11728 Two_Pointer
// 간단한 투 포인터 문제
/**
두 배열 오름차순 정렬 후 출력
@param n A배열 크기
@param m B배열 크기
*/
void printSortedArr(vector<int>& A, vector<int>& B, int n, int m)
{
int i{ 0 }, j{ 0 }; // 투 포인터
while (i < n && j < ... | ALGO | 0.999996 | 4.720203 | {
"github_metadata": {
"branch": "main",
"commit_count": 412,
"repo_created_at": "2024-03-05T13:13: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": "a61c182ace... |
f34e6b62-bbc9-4c98-a888-df0353327c2e | Yawn-Sean/Daily_CF_Problems | daily_problems/2025/05/0513/personal_submission/cf208c_lyxxys.cpp | void solve(){
int n, m;
cin >> n >> m;
vector<vector<int>> g(n);
for (int i = 0, u, v; i < m; ++ i){
cin >> u >> v;
u -= 1, v -= 1;
g[u].push_back(v);
g[v].push_back(u);
}
auto bfs = [&](int s, vector <i64> &f, vector <int> &dist)->void{
fill(dist.begin()... | ALGO | 0.999576 | 4.061322 | {
"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": "348b... |
100e033e-42b8-4b6a-9da1-5ef728d11ae9 | the-timoye/HSADP | main.cpp | #include <string>
#include <iostream>
#include <time.h>
#include <vector>
#include <unordered_map>
#include <optional>
#include <fstream>
using namespace std;
optional<vector<int>> createHierarchy(const string& S, const string& Q, int l,
const vector<int>& SA,
const optional<pair<string, vector<int>>>& val... | ALGO | 0.999879 | 5.147889 | {
"github_metadata": {
"branch": "main",
"commit_count": 22,
"repo_created_at": "2025-03-18T13:56: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": "7f96aa5a5f1... |
36ef5969-d16c-4939-a9a8-03f44f3cdb92 | Gilmardealcantara/Maratona | URI/Nao_posso_me_atrasar/errNao_posso_me_atrasar.cpp | #include<bits/stdc++.h>
#define INF 0x3f3f3f3f
using namespace std;
int M[55][55];
void fw(int n){
for(int k=0; k<n; k++){
for(int j=0; j<n; j++){
for(int i=0; i<n; i++){
M[i][j] = min(M[i][j], M[i][k]+ M[k][j]);
}
}
}
}
void print(int n... | ALGO | 0.999 | 4.026713 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2016-02-22T16:01:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "733f54307... |
d0a97736-5c1c-4997-8cb5-2c9003e8e309 | andyj0927/Baekjoon | 백준/Gold/11062. 카드 게임/카드 게임.cc | #include <bits/stdc++.h>
using namespace std;
#define endl '\n'
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const ll MAXN = 1e7;
const ll MOD = 1e9+7;
int a[1001];
int dp[1001][1001][2];
int f(int st,int ed, int state){
int &re = dp[st][ed][state];
if(re!=-1) return re;
if(st==ed){... | ALGO | 0.999889 | 4.144708 | {
"github_metadata": {
"branch": "main",
"commit_count": 348,
"repo_created_at": "2023-10-09T19:02: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": "19e3c13734... |
eebb5f3c-3a89-4f7a-92d9-ac9ddeb7c758 | btnkij/ACM | luogu/LUOGU3388.cpp | /**
* Number:luogu3388
* Title:【模板】割点(割顶)
* Status:AC
* Tag:[tarjan, 割点]
**/
#include <cstdio>
#include <iostream>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <numeric>
#include <vector>
#include <queue>
#include <cassert>
using namespace std;
#define INF 0x3f3f3f3f
typedef long long ll;
typedef... | ALGO | 0.999877 | 4.089659 | {
"github_metadata": {
"branch": "master",
"commit_count": 155,
"repo_created_at": "2019-02-26T14:21:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "aa9570da... |
f73be4b6-7f60-4c9d-8dec-488ba0029704 | mysql/mysql-server | extra/boost/boost_1_85_0/boost/geometry/algorithms/detail/closest_points/linear_or_areal_to_areal.hpp | // Boost.Geometry (aka GGL, Generic Geometry Library)
// Copyright (c) 2021, Oracle and/or its affiliates.
// Contributed and/or modified by <NAME>, on behalf of Oracle
// Licensed under the Boost Software License version 1.0.
// http://www.boost.org/users/license.html
#ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_CLOSE... | ALGO | 0.987551 | 6.661727 | {
"github_metadata": {
"branch": "trunk",
"commit_count": 186679,
"repo_created_at": "2014-09-26T09:31:03.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 11540,
"forks": 4072,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "... |
add5672e-61dc-441c-bccd-0b47ede0ff82 | NilanjanaLodh/OnlineJudge | AUGLunch/weighted.cpp | #include <bits/stdc++.h>/// I'm not doing this because of slow compilation
//
//#include <iostream>
//#include <queue>
//#include <vector>
//#include <string.h>///for memset
//#include "/home/nilanjana/Desktop/code/practice/data_structures/Heap.cpp"
//#include "/home/nilanjana/Desktop/code/practice/data_structures/D... | ALGO | 0.999961 | 3.852339 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2016-07-08T10:05: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": "0865bfaae... |
db2df983-1166-416c-b8f0-b2e91178a3e8 | Bocabbage/Leetcode | C++/Matrix/48.RotateImage.cpp | /*
Title: 48.RotateImage.cpp
Update date: 2022/03/20
Author: <NAME>
*/
class Solution {
public:
void rotateCore(
vector<vector<int>>& matrix,
int k
)
{
int n = matrix.size();
if(k >= (n>>1))
return;
int tmp;
... | ALGO | 0.999987 | 6.252961 | {
"github_metadata": {
"branch": "master",
"commit_count": 73,
"repo_created_at": "2019-08-21T12:18:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dda0524b0... |
21e687ae-0cc0-4b1b-8c7b-488a1df13f07 | SWEG-2014-EC-Batch/Dodge | FoP-I/Kaleb Demisse/symbol.cpp | //Symbol Checker
#include <iostream>
using namespace std;
int main () {
char symbol;
cout << "Enter a symbol: ";
cin >> symbol;
if (symbol >='a' && symbol <= 'z'){
if (symbol == 'a'||symbol =='e'||symbol == 'i'||symbol == 'o'||symbol == 'u'){
cout << "It's a vowel lowercase lette... | TOOL | 0.984883 | 3.834971 | {
"github_metadata": {
"branch": "main",
"commit_count": 188,
"repo_created_at": "2023-03-06T17:46:29.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2902312201d... |
5f4b625c-4bfd-41da-9f22-4ee22625fb57 | leemsia/Pathfinding_Algorithms | src/Path Searching Algorithm/Dijkstra.cpp | #include "Dijkstra.h"
#include <iostream>
#include <vector>
#include <queue>
#include <unordered_map>
#include <limits>
using namespace std;
// 사용자 정의 해시 함수 정의
struct pair_hash {
template <class T1, class T2>
size_t operator()(const std::pair<T1, T2>& p) const {
auto hash1 = std::hash<T1>{}(p.first);
... | ALGO | 0.999939 | 5.949219 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2024-11-19T07:34:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7b178c1c1cf3... |
dfd3f565-0f0b-47dd-ada1-d43aec95599a | mandagod/LeetCode | RecoverBinarySearchTree/RecoverBinarySearchTree.cpp | /*
Two elements of a binary search tree (BST) are swapped by mistake.
Recover the tree without changing its structure.
Note:
A solution using O(n) space is pretty straight forward. Could you devise a constant space solution?
confused what "{1,#,2,3}" means? > read more on how binary tree is serialized on OJ.
Hide Ta... | ALGO | 0.999993 | 6.079908 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2014-11-17T03:26: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": "ca84709839... |
e68be474-80f1-41a9-8d0b-90a0f56a2d64 | apollo-programmer/Data-structure-Visualization | src/AVL/AVL.cpp | #include <AVL/AVL.h>
AVL::AVL() : root(nullptr), curNode(nullptr), temp(nullptr), animationStep(0) {}
AVL::~AVL(){
clearTree();
if(curNode) delete curNode;
curNode=nullptr;
}
void AVL::createTree(std::string text){
clearTree();
if(text.empty()) return;
for (char& c : text) {
if (c == ... | ALGO | 0.969185 | 4.005508 | {
"github_metadata": {
"branch": "main",
"commit_count": 17,
"repo_created_at": "2025-02-16T10:57: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": "0b7b714163a... |
903d7974-a555-42f3-bab4-6252068d8c67 | richa208/bellman-ford | bellman.cpp | #include<bits/stdc++.h>
using namespace std;
struct Edge
{
int a, b, wt;
};
struct Graph
{
int v, e;
struct Edge* edge;
};
struct Graph* create(int v, int e)
{
struct Graph* graph = (struct Graph*) malloc( sizeof(struct Graph) );
graph->v = v;
graph->e = e;
graph->edge =
(struct ... | ALGO | 0.999978 | 4.404345 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2017-03-17T16:43:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c3b6956b9c... |
02119e4c-864d-4130-96c2-9971e6c25090 | Ankush-choudhary76/DSA | Binary Trees/Medium problems/check for balance binary tree/brute.cpp | #include<bits/stdc++.h>
using namespace std ;
struct node{
int data ;
node* left;
node* right;
node(int val):data(val) , left(nullptr), right(nullptr){}
};
class solution {
public:
bool isbalanced( node* root){
if(root == nullptr) return true ;
int lh = getheight(roo... | ALGO | 0.999963 | 5.168025 | {
"github_metadata": {
"branch": "main",
"commit_count": 33,
"repo_created_at": "2024-07-12T04:43:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bf17f8024b0... |
a88e30dc-179c-4794-a15e-12df57245afc | BrehamPie/Problem-Solves | Online Judge/103 - Stacking Boxes.cpp | #include<bits/stdc++.h>
using namespace std;
/**
* First Sort the dimensions of each box.
* Sort the vector of boxes.
* Find LIS with path.
*/
struct Box {
vector<int>dims;
int id;
Box() {}
Box(int n) { dims.resize(n); }
bool operator<(const Box& o) {
int n = dims.size();
for (int... | ALGO | 0.999973 | 3.387215 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2022-03-27T02:43: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": "7e466348928b... |
d255c359-ac58-4da3-bf37-8f438ccb7815 | norlab-ulaval/libpointmatcher | pointmatcher/ErrorMinimizers/PointToPlane.cpp | // kate: replace-tabs off; indent-width 4; indent-mode normal
// vim: ts=4:sw=4:noexpandtab
/*
Copyright (c) 2010--2012,
<NAME> and <NAME>, ASL, ETHZ, Switzerland
You can contact the authors at <f dot pomerleau at gmail dot com> and
<stephane at magnenat dot net>
All rights reserved.
Redistribution and use in source... | ALGO | 0.989588 | 6.540607 | {
"github_metadata": {
"branch": "master",
"commit_count": 1985,
"repo_created_at": "2011-01-18T10:00:28.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1739,
"forks": 554,
"issues": 87,
"pull_requests": 5
},
"file_meta": {
"content_id": "e4... |
08582695-2417-47dd-85c5-eefa25ed781e | Fengdalu/acm-icpc | CF/372/b.cpp | #include <bits/stdc++.h>
char s[50010];
int f[300];
int main() {
scanf("%s", s);
int len = strlen(s);
if(len < 26) {
puts("-1");
return 0;
}
for(int i = 0; i < 25; i++) f[s[i]]++;
for(int i = 25; i < len; i++) {
f[s[i]]++;
bool flag = true;
int cnt = 0;
... | ALGO | 0.999993 | 3.488782 | {
"github_metadata": {
"branch": "master",
"commit_count": 772,
"repo_created_at": "2014-12-24T15:25:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "712d0e5e... |
ea2373b4-9b82-4f97-8a98-be053a71a869 | bubbercn/LeetCode | C++/Solved/515_FindLargestValueInEachTreeRow.h | #pragma once
#include "Common.h"
// 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(NULL), right(NULL) {}
TreeNode(int x, TreeNode *left, TreeNode *right) : val(x... | ALGO | 0.999965 | 7.256088 | {
"github_metadata": {
"branch": "master",
"commit_count": 685,
"repo_created_at": "2016-04-24T12:45: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": "756705cf... |
00f54c0f-0ee3-4bbd-b5d7-a45e0cdd86a5 | introlab/rtabmap | corelib/src/util3d_surface.cpp | /*
Copyright (c) 2010-2016, <NAME> - IntRoLab - Universite de Sherbrooke
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice,... | ALGO | 0.961902 | 5.324411 | {
"github_metadata": {
"branch": "master",
"commit_count": 3531,
"repo_created_at": "2014-08-11T18:38:14.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 3232,
"forks": 839,
"issues": 525,
"pull_requests": 7
},
"file_meta": {
"content_id": "c... |
11d10f08-b8ee-4d6b-a516-c1cb6bbeacbf | neetcode-gh/leetcode | cpp/1046-Last-Stone-Weight.cpp | /*
Given array of stones to smash, return smallest possible weight of last stone
If x == y both stones destroyed, if x != y stone x destroyed, stone y = y - x
Ex. stones = [2,7,4,1,8,1] -> 1, [2,4,1,1,1], [2,1,1,1], [1,1,1], [1]
Max heap, pop 2 biggest, push back difference until no more 2 elements lef... | ALGO | 0.999891 | 5.657342 | {
"github_metadata": {
"branch": "main",
"commit_count": 9682,
"repo_created_at": "2021-01-20T16:10:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6062,
"forks": 2417,
"issues": 330,
"pull_requests": 215
},
"file_meta": {
"content_id": ... |
06a6afc2-ded6-444f-a267-8722ddd84dea | seeitsmanish/Cpp_Competitive_Repo | Practise/13_Jul_2021/toSubmit.cpp | /*
Link : https://www.codechef.com/MAY21C/problems/ISS
Author : seeitsmanish
*/
#include<bits/stdc++.h>
using namespace std;
#define x first
#define y second
#define pb emplace_back
#define vi vector<int>
#define int long long int
#define endl "\n"
#define rev(v) reverse(v.begin(), v.end())
#... | ALGO | 0.999633 | 4.726263 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2020-06-14T12:54: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": "d3f3103a4... |
7be479ed-7784-4f23-8aee-d2d573942ba5 | knuu/competitive-programming | atcoder/agc/agc034_b.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;
typedef pair<ll, ll> Pll;
typedef vector<int> Vi;
//typedef tuple<int, int, int> T;
#define FOR(i,s,x) for(int i=s;i<(int)(x);i++)
#define REP(i,x) FOR(i,0,x)
#define ALL(c) c.begin(), c.end()
#define DUMP( x ) cerr << #x... | ALGO | 0.999586 | 3.59778 | {
"github_metadata": {
"branch": "master",
"commit_count": 86,
"repo_created_at": "2014-12-11T18:59:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5c60e41d4... |
16fdd8f8-6bac-4d1c-a29b-7cd5976cca57 | fireofearth/acm | 2020/jan4/h-grid.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long int lli;
lli MAX = numeric_limits<lli>::max();
lli MOD = 1000000007;
/*
Finding the longest path by doing topological sort
and do DP on each node in the list: the length of the
longest path that ends at the node in the list.
g++ -std=c++11 h-grid.cpp -o... | ALGO | 0.99998 | 4.159574 | {
"github_metadata": {
"branch": "master",
"commit_count": 27,
"repo_created_at": "2018-02-11T09:05: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": "0c539764d... |
0d407323-fb6a-43af-b7cb-533c1accf0be | yewl1110/Study-Algorithm | BACKJOON/14890.cpp | #include <iostream>
using namespace std;
int N, L, result;
int map[101][101];
int height[101][101];
int main() {
cin >> N >> L;
result = N * 2;
for (int i = 1; i <= N; i++) {
for (int j = 1; j <= N; j++) cin >> map[i][j];
}
for (int i = 1; i <= N; i++) {
// row 검사
int p = map[i][1];
int cnt = 1;
for (... | ALGO | 0.999882 | 3.595336 | {
"github_metadata": {
"branch": "master",
"commit_count": 35,
"repo_created_at": "2019-05-17T06:58:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dff6e8ec6... |
c2b88bf8-737b-4a08-ab06-d5669ec864b0 | yskoht/atcoder | 2020-06-14-abc170/d.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define F first
#define S second
using ll = long long;
using P = pair<int,int>;
const int N = 1000001;
int main() {
int n;
cin >> n;
vector<int> v(N, false);
vector<int> tab(N, false);
rep(i, n) {
int t;
... | ALGO | 0.999688 | 3.563783 | {
"github_metadata": {
"branch": "master",
"commit_count": 48,
"repo_created_at": "2020-02-11T07:19: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": "085eaee7d... |
c28398da-3e27-4f52-8814-91239fe4bdd6 | yashc9602/Coding-Sheets---Prime-Coding | Accenture/LinkedList/Clone a LL with random pointers/cpp.cpp | #include <iostream>
using namespace std;
class Node {
public:
int val;
Node* next;
Node* random;
Node(int _val) {
val = _val;
next = NULL;
random = NULL;
}
};
Node* cloneLinkedList(Node* head) {
if (!head) return NULL;
// Step 1: Create new nodes and insert them n... | ALGO | 0.929499 | 6.269931 | {
"github_metadata": {
"branch": "main",
"commit_count": 25,
"repo_created_at": "2024-07-23T17:00:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 39,
"forks": 13,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
"content_id": "3395b14fd... |
f7b98028-6968-4e03-a8f3-78942c7f1748 | JayShahH1234/Programs-Slips | Slip Programs/SLIP3.CPP | /* Create a class Person that contains data members as person_name,
city, mob_no. Write a C++ program to perform following functions.
1. To accept and display person information
2. To search the mobile number of a given person
3. To search the person details of given mobile number */
#include<iostream.h>
#... | TOOL | 0.998016 | 4.695876 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-04T11:54: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": "d3e82d3fa0e9... |
4b338205-b757-45e9-a7c5-754f18d6b271 | AmyrAhmady/samp-plugin-crashdetect | src/fileutils-win32.cpp | // Copyright (c) 2011-2020 Zeex
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice,
// this list of conditions an... | TOOL | 0.902239 | 6.368361 | {
"github_metadata": {
"branch": "master",
"commit_count": 1005,
"repo_created_at": "2024-11-20T22:57:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 13,
"forks": 9,
"issues": 0,
"pull_requests": 3
},
"file_meta": {
"content_id": "6353d0... |
72c1b23e-a750-4442-ae57-1ea729a21c2f | rayyanabubakr/Sorting-techniques | Radix Sort.cpp | // 1. You are given an array(arr) of integers.
// 2. You have to sort the given array in increasing order using radix sort.
#include<iostream>
#include <bits/stdc++.h>
using namespace std;
void print(int arr[], int n) {
for (int i = 0; i < n; i++) {
cout << arr[i] << " ";
}
cout << "\n";
}
int getMax(int ... | ALGO | 0.999953 | 5.293796 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2021-08-28T10:01: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": "3c080dcbf56... |
0aefbbbd-ee57-48b0-97a3-bcbdc278863f | Nil0ofar/UVa_Solutions | 10891 - Game of Sum.cpp | #include<bits/stdc++.h>
#include <ext/pb_ds/detail/standard_policies.hpp>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define fi first
#define se second
#define ll long long
#define pll pair<ll , ll>
#define pii pair<int , int>
#define... | ALGO | 0.999845 | 3.806285 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2021-01-20T16:04: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": "9f061affec... |
c5bc492c-7ba7-4338-b9d4-33bc4adc2df0 | rmjarvis/tmv | src/TMV_SymCHDiv.cpp | ///////////////////////////////////////////////////////////////////////////////
// //
// The Template Matrix/Vector Library for C++ was created by <NAME> //
// Copyright (C) 1998 - 2016 //
// Al... | ALGO | 0.998833 | 5.090181 | {
"github_metadata": {
"branch": "main",
"commit_count": 107,
"repo_created_at": "2015-10-29T14:40:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0c822c60f0... |
4be70115-0a7a-4814-9493-12971f27e8a1 | YigWoo/pat | 1003.cpp | #include <iostream>
#include <string>
using namespace std;
bool checkPAT(string str) {
int np = 0;
int nt = 0;
for (size_t i = 0; i < str.length(); i++) {
if (str[i] != 'P' && str[i] != 'A' && str[i] != 'T')
return false;
if ((str[i] == 'P' && ++np > 1) || (str[i] == 'T' && ++nt > 1)) {
retur... | ALGO | 0.999487 | 4.843495 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2014-03-19T14:33: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": "51383139f4... |
de1dca35-4cab-4b8c-affb-f114e5adf415 | kitar-u/Practicas | Mate_Proyecto/Mate_Proyecto.cpp | // Mate_Proyecto.cpp : Este archivo contiene la función "main". La ejecución del programa comienza y termina ahí.
// <NAME>
#include <iostream>
int main()
{
int sel;
double n, a, deri;
std::cout << "1- Form: a(x)^n 2- Form: a^x \n";
std::cout << "3- Form: lna(x) ... | ALGO | 0.992227 | 3.678256 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2022-11-02T16:44: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": "f94e8e973e51... |
610ea7fc-cb71-4a42-8d9e-c043ffd79b3a | thuang86714/LeetCode_Cpp | 763_Partition_Lables.cc | /*
You are given a string s. We want to partition the string into as many parts as possible so that each letter appears in at most one part.
Note that the partition is done so that after concatenating all the parts in order, the resultant string should be s.
Return a list of integers representing the size of these pa... | ALGO | 0.999857 | 6.148283 | {
"github_metadata": {
"branch": "main",
"commit_count": 41,
"repo_created_at": "2022-12-07T09:13: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": "63a4e9773ac... |
bab67dce-1af0-46e7-8bba-79e938f7aab1 | AbdelruhmanAskar/Data-Structures | QueueUsing_Linkedlist.cpp | #include <iostream>
#include <cassert>
using namespace std;
/*
This code implements a Linked Queue in C++ using a singly linked list. A queue follows the FIFO (First In, First Out) principle.
The class provides operations to:
1- Enqueue: Add an element to the rear of the queue.
2- Dequeue: Remove the element from the ... | ALGO | 0.980701 | 6.53725 | {
"github_metadata": {
"branch": "main",
"commit_count": 29,
"repo_created_at": "2024-11-24T13:47:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e74f84ee2ff... |
acc295d9-3845-42a8-95f7-a6bdbe3623d0 | yyhaos/Competitions | Round 524/a.cpp |
#include<bits/stdc++.h>
#define ll long long
ll no(ll fi,ll n,ll m,ll &white,ll &black)//1 hei 0 bai
{
ll k=n*m/2;
if(n%2==1 && m%2==1)
{
if(fi==1)
{
black=k+1;
white=k;
}
else
{
black=k;
white=k+1;
}
}
... | ALGO | 0.999456 | 4.009832 | {
"github_metadata": {
"branch": "master",
"commit_count": 97,
"repo_created_at": "2018-04-08T11:42:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "57ae6e514... |
4a54dd17-e617-4e58-b92f-8239cd078822 | askeySnip/OJ_records | TopCoder/OrthogonalProjections.cpp | // BEGIN CUT HERE
// END CUT HERE
#line 5 "OrthogonalProjections.cpp"
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <n... | ALGO | 0.999935 | 3.972227 | {
"github_metadata": {
"branch": "master",
"commit_count": 279,
"repo_created_at": "2018-01-18T08:36:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6252ce5a... |
c37725c8-9c79-4d71-91ee-9ccf3a5be701 | JustinMLu/mbot_ws | mbot_autonomy/src/planning/astar.cpp | #include <planning/astar.hpp>
#include <algorithm>
#include <chrono>
using namespace std::chrono;
mbot_lcm_msgs::path2D_t search_for_path(mbot_lcm_msgs::pose2D_t start,
mbot_lcm_msgs::pose2D_t goal,
const ObstacleDistanceGrid& d... | ALGO | 0.999867 | 5.252958 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2024-11-18T23:14:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7be639b8190... |
adb2f6e9-616a-4eba-89cc-b7725abcc199 | zhouxindong/rola | drop/tuple_main.cpp | #include <tuple>
#include <iostream>
#include <string>
#include <utility>
#include <type_traits>
#include <algorithm>
#include <numeric>
// three ways to build a tuple
// 1. std::make_tuple (if you need values in the returned tuple)
// 2. std::tie (if you need lvalue references in the returned tuple)
// 3. std:... | TOOL | 0.938561 | 6.159847 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2021-08-18T12:06: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": "c55235d9e6da... |
3c26841a-49af-4721-8fad-93d39a68a80b | KaziRifatAlMuin/Code-Library | Notebook/KUET_Braindead/combinatorics/Geometric Series.cpp | // a + ar + ar^2 + ar^3 + ... + ar^n-1 = a(r^(n) - 1) / (r - 1)
// 1 + a + a^2 + a^3 + a^4 + .... + a^(n-1) = (a^n - 1) / (a - 1)
ll bigsum(ll a, ll n) {
if(n == 0 || n == 1) return n % mod;
if(n & 1) return ((a % mod) * bigsum(a % mod, n - 1) + 1) % mod;
ll x = bigsum((a * a) % mod, n / 2);
}
inline ll mod... | ALGO | 0.999714 | 4.315295 | {
"github_metadata": {
"branch": "main",
"commit_count": 17,
"repo_created_at": "2023-12-07T15:57:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c0a259e91fc... |
c40dd831-80cc-4d7a-8224-2defa63f5177 | vinci-grape/Rectifier | output/ChatGPT/avatar/Java/C++/codeforces_400_A.cpp | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
bool isSolution(int columnsCount, string x) {
vector<bool> allXs(columnsCount, true);
for (int i = 0; i < 12; i++) {
if (x[i] != 'X') {
allXs[i % columnsCount] = false;
}
}
... | ALGO | 0.999827 | 4.933363 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-07-09T09:23:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fd9deb83dd88... |
03ca355c-ef58-4a93-a344-06a36c545225 | avivweinstein/grokking | depthFirstSearch/allPathSum.cpp | using namespace std;
#include <iostream>
#include <vector>
class TreeNode {
public:
int val = 0;
TreeNode *left;
TreeNode *right;
TreeNode(int x) {
val = x;
left = right = nullptr;
}
};
class FindAllTreePaths {
public:
static vector<vector<int>> findPaths(TreeNode *root, int sum) {
vector<... | ALGO | 0.999966 | 5.883917 | {
"github_metadata": {
"branch": "main",
"commit_count": 22,
"repo_created_at": "2022-07-19T02:13: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": "0bd3855f3c9... |
02af619c-152c-4492-9685-f8a6d8634e90 | Chen-Jr/ICPC-Code-Template-in-Latex | main.cpp | #include <bits/stdc++.h>
using namespace std;
const int MAXL = 100000;
const char* cf = "/config";
const char* tf = "template.tex";
const char* head = "head";
const char* tail = "tail";
int secn;
char sec[2000][MAXL];
FILE* tex = NULL;
char temp[MAXL],temp2[MAXL];
struct LineBreaker {
char name[MAXL], file[MAXL], T... | TOOL | 0.907493 | 3.142193 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2019-06-05T01:55:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 44,
"forks": 12,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "d50dcf12... |
d688fcb5-cea9-4265-a93c-fff740266fb5 | Gfans/ISPH_NVIDIA_CUDA_CONTEST | IncompressibleFluidsPcisphCUDA/src/ISPH_NVIDIA_CUDA_CONTEST/include/cuda5.5_include/include/thrust/system/detail/internal/scalar/stable_primitive_sort.inl | /*
* Copyright 2008-2012 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... | ALGO | 0.999559 | 6.745766 | {
"github_metadata": {
"branch": "master",
"commit_count": 24,
"repo_created_at": "2014-08-03T09:23:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 62,
"forks": 14,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "d064a9f... |
87a5a6a6-d03d-46f9-a070-a7c2d9653fee | weikm/sandcarSimulation2 | Source/Framework/Collision/Collid.cpp | #include <set>
#include <iostream>
#include <stdio.h>
#include "CollisionMesh.h"
#include "CollisionBVH.h"
#include "CollisionDate.h"
extern int getCollisionsGPU(int*, int*, int*, float*, int*, int*, float*);
extern int getSelfCollisionsSH(int*);
extern void pushMesh2GPU(int numFace, int numVert, void* faces, void*... | ALGO | 0.994057 | 4.896752 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2021-12-22T12:38:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "80610e2945f7... |
9095eb68-b5da-4170-a803-d42482a98eb0 | FeiLuo/fei_c_testpoint | testpoint/src/Prim.cc | #include "Prim.h"
Prim::Prim(void)
{
}
Prim::~Prim(void)
{
}
void Prim::Action()
{
Uint32 GE[6][6] = {
{ UINT32_MAX, 16, 20, 19, UINT32_MAX, UINT32_MAX },
{ 16, UINT32_MAX, 11, UINT32_MAX, 6, 5 },
{ 20, 11, UINT32_MAX, 22, 14, UINT32_MAX },
{ 19, UINT32_MAX, 22, UINT32_MAX, 18, U... | ALGO | 0.999281 | 3.218483 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2015-12-15T08:29: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": "c6bc6e3505... |
b3b3a945-801c-4071-b21b-112a443d0f0a | sakibakon/CodeForces | Codeforces Round #599 (Div. 2)/B2.cpp | #include <bits/stdc++.h>
#define ll long long int
#define pb push_back
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define pi acos(-1)
#define N 100050
#define mod 1000000007
using namespace std;
void functionn(ll test)
{
vector<pair<ll, ll> >vector_my;
ll n, k;
cin>>n;
k=2*n;
stri... | ALGO | 0.999984 | 3.616084 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2019-10-22T06:17:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a0ba02500... |
0228e0c3-7d1d-404a-955f-dd9d3703b6ad | Double-O-Team/Codingame-Solutions | Sparrow/Easy/POWER OF THOR.cpp | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
/**
* Auto-generated code below aims at helping you parse
* the standard input according to the problem statement.
* ---
* Hint: You can use the debug stream to print initialTX and initialTY, if Thor seems not follow... | ALGO | 0.999776 | 3.938337 | {
"github_metadata": {
"branch": "main",
"commit_count": 350,
"repo_created_at": "2022-03-13T19:28:19.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1,
"forks": 9,
"issues": 2,
"pull_requests": 1
},
"file_meta": {
"content_id": "d5e1c03299a... |
a57ff903-0591-4e04-81de-56120db037f4 | ProfRTRD/Tarea05 | HW05.cpp | #include <iostream>
#include <cmath>
//using fptr = double (double); // puntero de funcion con forma : double function(double x);
const double M = 120.0;
const double G = 9.81;
const double VT = 40;
const double T = 10;
double f(double x);
template <typename func_t>
double newton(double x0, double eps, func_t func,... | ALGO | 0.999921 | 3.787159 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-05-01T14:14: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": "fd288658b828... |
53ecd310-1bdd-4cf7-b9e2-4bd0542c966e | su2umaru/competitive_programming | ABC/ABC088/d_2.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define FOR(i, a, b) for(int i=(a);i<(b);++i)
#define REP(i, n) for(int i=0;i<(n);++i)
#define ALL(v) (v).begin(),(v).end()
#define SP cout<<fixed<<setprecision(10)
typedef pair<int, int> P;
const int INF = (int) 1e9;
const int MOD = (int) 1e9 + 7... | ALGO | 0.999731 | 3.952754 | {
"github_metadata": {
"branch": "master",
"commit_count": 115,
"repo_created_at": "2018-10-25T13: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": "3cdd4669... |
75063902-67f2-4ca9-8028-f43d1a98fd0a | hiroshi-maybe/topcoder | solutions/ChocolateBar/ChocolateBar.cpp | #include <fstream> // for greed plugin
#include <iostream>
#include <algorithm> // max,min
#include <vector>
#include <string>
#include <sstream>
#include <set>
#include <map>
#include <iostream>
#include <utility>
#include <cctype>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cmath>... | ALGO | 0.999748 | 4.566272 | {
"github_metadata": {
"branch": "master",
"commit_count": 1437,
"repo_created_at": "2015-05-24T07:26:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "49427ee... |
cdf63761-3376-42eb-8617-e67d1a60ccde | reddy-lab-code-research/MuST-CoST | data/transcoder_evaluation_gfg/cpp/MINIMUM_INSERTIONS_TO_FORM_A_PALINDROME_WITH_PERMUTATIONS_ALLOWED.cpp | // Copyright (c) 2019-present, Facebook, Inc.
// All rights reserved.
//
// This source code is licensed under the license found in the
// LICENSE file in the root directory of this source tree.
//
#include <iostream>
#include <cstdlib>
#include <string>
#include <vector>
#include <fstream>
#include <iomanip>
#include... | ALGO | 0.998765 | 4.757771 | {
"github_metadata": {
"branch": "main",
"commit_count": 30,
"repo_created_at": "2022-02-08T19:28:59.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 11,
"forks": 5,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "6cdc1b36301... |
09c2e895-65fd-4a62-99b2-be29975d405a | st130004/programming-c-2024-autumn | 2024.09.27-HW2/Task5/Source.cpp | #include <cstdio>
int main(int argc, char* argv[])
{
int l1 = 0;
int w1 = 0;
int h1 = 0;
int l2 = 0;
int w2 = 0;
int h2 = 0;
int lc = 0;
int wc = 0;
int hc = 0;
scanf("%d", &l1);
scanf("%d", &w1);
scanf("%d", &h1);
if (l1 < w1)
{
int t = l1; l1 = w1; w1 = t;
}
scanf("%d", &l2);
scanf("%d", &w2);
... | ALGO | 0.999189 | 3.276776 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2024-09-04T20:02: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": "4cab68ab8287... |
58771059-9d32-4785-8b33-13f522f497d6 | ksb451/Cpp_DSA | CONTEST/Archive/691_DIV2/D.cpp | //**sn0wrus**//
#include <bits/stdc++.h>
#include <algorithm>
using namespace std;
#define fast \
ios_base::sync_with_stdio(false); \
cout.tie(NULL); \
cin.tie(NULL);
#define write(a) \
for (auto x : a) \
{ \
cout <... | ALGO | 0.999979 | 3.959836 | {
"github_metadata": {
"branch": "master",
"commit_count": 137,
"repo_created_at": "2019-01-31T17:53: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": "7ce03c30... |
d6146ff0-0c17-459d-99c1-d4f8576bfe17 | zodiacon/WindowsInternals | MemInfo/MemInfo.cpp | // MemInfo.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "MemInfo.h"
#define SUPERFETCH_VERSION 45
#define SUPERFETCH_MAGIC 'kuhC'
#pragma comment(lib, "ntdll")
SIZE_T MmPageCounts[TransitionPage + 1];
SIZE_T MmUseCounts[MMPFNUSE_KERNELSTACK + 1];
SIZE_T MmPa... | TOOL | 0.929402 | 3.545413 | {
"github_metadata": {
"branch": "master",
"commit_count": 46,
"repo_created_at": "2016-11-15T08:01:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2562,
"forks": 524,
"issues": 4,
"pull_requests": 2
},
"file_meta": {
"content_id": "b4e5... |
fd948761-4ad2-4302-95de-5b41c5d20c89 | abhay121kumar/Ninja | l9 linked list 2/video 2/MergeTwoSorted.cpp | #include<iostream>
using namespace std;
class Node{
public:
int data;
Node *next;
Node(int data){
this->data = data;
next = NULL;
}
};
Node* takeInputBetter(){
int data;
cin>>data;
Node *head = NULL;
Node *tail = NULL;
while(data != -1){
Node *new... | ALGO | 0.999897 | 4.992202 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2023-09-06T07:07:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "62ea8fbb4... |
5319292f-d606-4bf0-ac0d-cb2a8660be1b | roccoss39/C-programs | C++/Recursion/Exponentiation/main.cpp | #include <iostream>
#include <iomanip>
#include <chrono>
using namespace std;
using namespace chrono;
long double exponentiation(long double number, long double power);
int main()
{
int number, power;
cout << "Provide the number and the exponent of the power sequentially:";
cin >> number >> power;
c... | ALGO | 0.989545 | 5.890506 | {
"github_metadata": {
"branch": "main",
"commit_count": 43,
"repo_created_at": "2023-12-13T16: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": "decb4f8c0b1... |
a31786ac-a982-4734-8a3f-bad9a1b32dc1 | mrpkdeveloper/450-DSA-Questions | c++/array/nextPermutation.cpp | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
void reverse(int arr[], int start, int end)
{
int i = start, j = end;
while (i < j)
{
swap(arr[i++], arr[j--]);
}
}
void swap(int &a, int &b)
{
int temp = a;
a = b;
b = temp;
}
void nextPermutation(int arr[], int n)... | ALGO | 0.999985 | 5.099644 | {
"github_metadata": {
"branch": "main",
"commit_count": 324,
"repo_created_at": "2021-04-11T04:14:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 792,
"forks": 272,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "4eb71e... |
c4138ba0-02b2-4aaa-bf9a-d6761cc2e6f6 | al-amin-bhuiyan/Leetcode-Solution | 1359. Count All Valid Pickup and Delivery Options.cpp | class Solution {
private
static const int N=1005;
static const long long int M=1e9+7;
int fact[N];
long long int mod(long long int x){
return ((x%M+M)%M);
}
void factorial(){
fact[0]=1;
for(int i=1;iN;i++){
debug(fact[i-1])
fact[i]=(fact[i-1]1lli)%M;
... | ALGO | 0.999971 | 4.527376 | {
"github_metadata": {
"branch": "main",
"commit_count": 31,
"repo_created_at": "2024-10-29T11:46: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": "4c114a1b1a3... |
a1910106-d8a6-4482-9ad2-2be0bea8cb58 | EliasFarhan/Planet | src/main.cpp | //
// Created by efarhan on 1/27/23.
//
#include <numbers>
#include "vec.h"
#include "planet.h"
#include <SFML/Graphics/RenderWindow.hpp>
#include <SFML/Window/Event.hpp>
#include <SFML/Window/VideoMode.hpp>
#include <SFML/System/Clock.hpp>
#include <SFML/Graphics/View.hpp>
#include <SFML/Graphics/CircleShape.hpp>
#i... | TOOL | 0.910511 | 5.658915 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2023-01-27T15:18: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": "7e435fd1512... |
a6e7c096-d401-4276-94d4-fc57594f80d3 | raincross7/code-similarity | codes/train_code/problem494/problem494_58.cpp | #include <bits/stdc++.h>
#define rep(i,n) for(int i=(0);i<(n);i++)
using namespace std;
typedef long long ll;
int main()
{
cin.tie(0);
ios::sync_with_stdio(false);
ll n, a, b;
cin >> n >> a >> b;
if(a + b - 1 > n || a * b < n){
cout << -1 << endl;
return 0;
}
ll t = n;
vector<ll> v;
for(ll i = b; i >... | ALGO | 0.999731 | 3.081041 | {
"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": "8407a56aa75c... |
4203f0de-4a38-42fd-a59f-3d92da6997f1 | Gongsta/competitive-programming | codeforces/954div3/B.cpp | #include <stdio.h>
#include <string.h>
#include <algorithm>
#include <bitset>
#include <cmath>
#include <iostream>
#include <iterator>
#include <map>
#include <memory>
#include <mutex>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unor... | ALGO | 0.999984 | 3.949776 | {
"github_metadata": {
"branch": "main",
"commit_count": 116,
"repo_created_at": "2021-03-06T16:56: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": "37c54f5b18... |
6d9e2abe-8544-4748-b46c-0ed74ed11e95 | Coderangshu/450DSA | Data Structures/Binary Tree/C++/25checkMirrorInN-aryTree.cpp | // { Driver Code Starts
//Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function Template for C++
class Solution {
public:
int checkMirrorTree(int n, int e, int A[], int B[]) {
// code here
// We use a stack inside a map to store t... | ALGO | 0.999897 | 4.975594 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2021-01-11T16:10:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f6156b9d0... |
1536cd58-2295-4131-8769-5a3253fc750f | spencerkarjala/unreal-grid-navigator | Source/GridNavigator/Private/Navigation/NavGridPathFinder.cpp | #include "NavGridPathFinder.h"
#include "AStarNavigator.h"
#include "GridNavigatorConfig.h"
#include "MapData/NavGridAdjacencyList.h"
namespace UE::Math
{
inline double Distance(const FInt64Vector3& Lhs, const FInt64Vector3& Rhs)
{
const FInt64Vector3 Diff = Rhs - Lhs;
const double XSquared = static_cast<double... | ALGO | 0.999873 | 6.91654 | {
"github_metadata": {
"branch": "main",
"commit_count": 117,
"repo_created_at": "2024-07-05T00:06: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": "b854d89121... |
61c49148-3e96-4e00-896c-8c93ace3fd30 | Ericizepic/Competitive-Coding | CodeForces/B - Belted Rooms.cpp | //#include <bits/stdc++.h>
#include <iostream>
#include <vector>
#include <cmath>
#include <string>
#include <set>
#include <iterator>
#include <algorithm>
#include <list>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define pi pair<int, int>
typedef unsigned long long ull;
typedef vector<int> v... | ALGO | 0.999938 | 3.493721 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2022-05-16T07:23: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": "ddbb818b8a... |
bb02b1cb-fda2-47e2-9483-7803c6ee7200 | koreanboi13/AVR_enc | PC.cpp | #include <iostream>
#include <fstream>
#include <string>
#include <iomanip>
#include <conio.h>
#include <ctime>
#include <cstdlib>
#include <vector>
#include <iostream>
#include <cmath>
#include <Windows.h>
#include <stdlib.h>
#include <stdint.h>
#include <algorithm>
#include <functional>
using namespace std;
struct... | TOOL | 0.961025 | 3.14498 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2025-01-23T21:49:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "305f02797732... |
06d3a0b5-7da4-4f4b-852a-25fce55ab9be | GaussGreen/old-code | JP/code/drlib/market/src/JumpAffine.cpp | #include "edginc/config.hpp"
#include "edginc/JumpAffine.hpp"
#include "edginc/Algorithm.hpp"
DRLIB_BEGIN_NAMESPACE
void PoissonDiffuseHelp::Initialize(DoubleArray &_avFreq)
{
avFreq = _avFreq;
nbJumps.resize(avFreq.size());
jumpTimes.resize(avFreq.size());
for (int i=0; i<avFreq.size(); ++i)
jumpTimes[i] = D... | ALGO | 0.99967 | 4.516103 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2022-02-17T09:58:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "679947740674... |
5b970efe-3441-4de9-a368-b3dca557cd92 | ishandutta2007/codeforces-a | alireza_kaviani/normal/1019/C.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;
#define all(x) (x).begin(),(x).end()
#define X first
#define Y second
#define sep ' '
#define endl '\n'
#define SZ(x) ll(x.size())
const ll MAXN = 1e... | ALGO | 0.999967 | 3.841763 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-04-11T00:51: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": "2bf0ccb2256d... |
8487880e-6175-44b2-91fc-81ea929d76ae | anubhav100rao/CompettiveProgramming | DP/paint_house_2.cpp | #include <bits/stdc++.h>
using namespace std;
#define dbg(x) cerr<<#x<<" = "<<x<<endl
class Solution {
public:
const int inf = 1e9;
vector<vector<vector<int>>>dp;
int solve(vector<int>&houses, vector<vector<int>>&cost, int idx, int target, int neigh, int prevColor) {
if(idx >= houses.size()) {
... | ALGO | 0.999657 | 4.380229 | {
"github_metadata": {
"branch": "main",
"commit_count": 92,
"repo_created_at": "2021-10-31T14:37:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ce49c07696b... |
b09f94db-db14-408c-89cb-e566d9073069 | itzJunaedRayhan/500-Plus-Problem-Solving-JavaScript | data-structure/Binary_Search_Tree_Insert.cpp | #include<bits/stdc++.h>
using namespace std;
class Node {
public:
int val;
Node* left;
Node* right;
Node (int val) {
this->val = val;
this->left = NULL;
this->right = NULL;
}
};
Node* BinaryTreeInput () {
int val;
cin>>val;
Node* root;
if (val == -1) ro... | ALGO | 0.99989 | 4.704936 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2022-02-14T16:38:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d5840a98e865... |
f9792227-3eb8-4ddd-9efc-16e67133282e | samkitsamsukha/LeetCode-Problems | 1-500/0036_validSudoku.cpp | /*
Determine if a 9 x 9 Sudoku board is valid. Only the filled cells need to be validated according to the following rules:
Each row must contain the digits 1-9 without repetition.
Each column must contain the digits 1-9 without repetition.
Each of the nine 3 x 3 sub-boxes of the grid must contain the digi... | ALGO | 0.999577 | 7.053077 | {
"github_metadata": {
"branch": "main",
"commit_count": 505,
"repo_created_at": "2024-01-19T14:10: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": "c6bc8b8d09... |
96afe0e9-ba49-4dc1-bab4-8c60d39f6e36 | yisak1127/Code | Lab/Lab 7.3/LAB 7.3.cpp | // This program will read in prices and store them into a two-dimensional array.
// It will print those prices in a table form.
// It will also determine and print the highest and lowest price in the array.
/*Look at the following table containing prices of certain items:
12.78 23.78 45.67 12.67
7.83 4.89 5.99 56.84
... | DATA | 0.928726 | 5.037321 | {
"github_metadata": {
"branch": "main",
"commit_count": 17,
"repo_created_at": "2023-11-04T00:49: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": "4613acf91c6... |
cb62d9f7-29f7-4f2f-b866-4967512bfc94 | humbertoamdc/competitive-programming | CF-B/chat-online.cpp | #include <iostream>
#include <vector>
using namespace std;
int p, q, l, r;
int a, b, c, d;
vector<pair<int,int>> z, x;
int main() {
cin >> p >> q >> l >> r;
while (p--) { cin >> a >> b; z.push_back(make_pair(a, b)); }
while (q--) { cin >> c >> d; x.push_back(make_pair(c, d)); }
int ans = 0;
for (i... | ALGO | 0.999845 | 3.863216 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2020-03-08T18:50:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e62f470b8c... |
beebd261-9e60-4780-a9cb-79a9d009ad86 | dwcaress/MB-System | src/mbtrnav/newmat/tmth.cpp |
//#define WANT_STREAM
#include "include.h"
#include "newmatap.h"
//#include "newmatio.h"
#include "tmt.h"
#ifdef use_namespace
using namespace NEWMAT;
#endif
static int my_max(int p, int q) { return (p > q) ? p : q; }
static int my_min(int p, int q) { return (p < q) ? p : q; }
void BandFunctions(int l1, int u1... | TEST | 0.989932 | 4.51606 | {
"github_metadata": {
"branch": "master",
"commit_count": 6186,
"repo_created_at": "2018-09-07T01:51:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 142,
"forks": 45,
"issues": 47,
"pull_requests": 1
},
"file_meta": {
"content_id": "1a4... |
aa6bf5a0-0c60-4aea-bab1-d55992ece162 | jamyan99/project | leetcode string/implement strStr().cpp | class Solution {
public:
int strStr(string haystack, string needle) {
int a, b, i, j = 0, ans = -1, save, c = 0;
a = haystack.length();
b = needle.length();
for (i = 0; i < a && ans == -1; i++){
save = i;
if (haystack[i] == needle[j]... | ALGO | 0.999906 | 5.395822 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2018-07-23T07:27: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": "ef322af3aa... |
2408f9ec-bcb3-44cf-b94c-44748aa69cf4 | kangjianwei/Data-Structure | Dev-C++/CourseBook/0203_MergeSqList/MergeSqList-main.cpp | #include <stdio.h>
#include "SqList.h"
#include "MergeSqList.h" //**▲02 线性表**//
// 测试函数,打印元素
void PrintElem(ElemType e) {
printf("%d ", e);
}
int main(int argc, char** argv) {
ElemType a[4] = {3, 5, 8, 11};
ElemType b[7] = {2, 6, 8, 9, 11, 15, 20};
SqList La, Lb, Lc1, Lc2;
int... | ALGO | 0.996316 | 3.745906 | {
"github_metadata": {
"branch": "master",
"commit_count": 88,
"repo_created_at": "2018-10-05T12:51:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3719,
"forks": 987,
"issues": 9,
"pull_requests": 2
},
"file_meta": {
"content_id": "cd73... |
5cece50c-210f-438f-81f1-ff3fc6bd2bac | prashant-th18/Coding-Begins | Newton-2022-Jan/B.cpp | #ifdef LOCAL
#define _GLIBCXX_DEBUG
#endif
// #pragma GCC optimize("O3")
// #pragma GCC target("popcnt")
#include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// using namespace __gnu_pbds;
using namespace std;
#define MOD 1000000007
typedef long long ll;
typed... | ALGO | 0.999924 | 3.907637 | {
"github_metadata": {
"branch": "master",
"commit_count": 53,
"repo_created_at": "2021-11-20T20:28:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0c627ca77... |
1b0422c8-c24a-49c1-a9e4-4b5fe2d0cf0d | TongWu/Leetcode-Wrapup | Codes/Algorithm/209.minimum-size-subarray-sum.cpp | /*
* @lc app=leetcode id=209 lang=cpp
*
* [209] Minimum Size Subarray Sum
*/
// @lc code=start
class Solution {
public:
int minSubArrayLen(int target, vector<int>& nums) {
/*
滑动窗口法:
该方法使用两个指针(与双指针法极其类似)确定起始位置和终止位置。
在brute-force中,我们同样使用了滑动窗口法。在初始状态,起始位置在0,通过第一个for loop不断后调终止位置,
... | ALGO | 0.999969 | 6.569386 | {
"github_metadata": {
"branch": "main",
"commit_count": 70,
"repo_created_at": "2023-08-23T13:56:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5073db2d7fc... |
3d301ac8-c017-47ee-b105-04c477a1fd58 | akshatvermavi/DSA_akshatvermavi | Gfg_medium_Heap_Sort.cpp | class Solution
{
public:
//Heapify function to maintain heap property.
void heapify(int arr[], int n, int i)
{
int cur = arr[i];
int par = arr[(i - 1) / 2];
while(i > 0 and par < cur){
swap(arr[(i - 1) / 2], arr[i]);
i = (i - 1) / 2;
... | ALGO | 0.999971 | 4.975442 | {
"github_metadata": {
"branch": "main",
"commit_count": 962,
"repo_created_at": "2023-04-16T07:23:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 4
},
"file_meta": {
"content_id": "f42dd022ec... |
2e3d3780-c883-4816-aa38-8f89ea726eb2 | cms-sw/cmssw | Geometry/ForwardCommonData/plugins/DDBHMAngular.cc | ///////////////////////////////////////////////////////////////////////////////
// File: DDBHMAngular.cc
// Description: Position inside the mother according to phi
///////////////////////////////////////////////////////////////////////////////
#include <algorithm>
#include <cmath>
#include <map>
#include <string>
#in... | ALGO | 0.930547 | 6.012708 | {
"github_metadata": {
"branch": "master",
"commit_count": 251237,
"repo_created_at": "2013-06-26T14:09:07.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1144,
"forks": 4480,
"issues": 947,
"pull_requests": 108
},
"file_meta": {
"content_id... |
b5ec8ede-6de8-4f05-96ce-b3131118d4f8 | Nickx58/Problem-Solving | byte-int-prep/LinkedList/4.ReverseLinkedList.cpp | #include <iostream>
using namespace std;
struct Node
{
int data;
Node *next;
};
Node *head = NULL;
void print()
{
Node *t = head;
while (t)
{
cout << t->data << " ";
t = t->next;
}
cout << endl;
}
void push(int data)
{
Node *temp = new Node();
temp->data = data;
temp->next = head;
head... | ALGO | 0.999937 | 5.40467 | {
"github_metadata": {
"branch": "master",
"commit_count": 240,
"repo_created_at": "2017-10-04T14:21:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 23
},
"file_meta": {
"content_id": "97778e6... |
0e3c1622-73e3-4cbf-92b6-60d6841c1bcd | Utersoft/Ludus_exercice_62_CPP_11_03_2021 | Ludus_exercice_62_CPP_11_03_2021/CPoint.h | #pragma once
class CPoint {
private :
float flt_x;
float flt_y;
static int n_cpt;
public :
CPoint(float flt_x = 0.0, float flt_y = 0.0);
void deplace(float val_x, float val_y);
void affiche();
float abscisse();
float ordonne();
void homothetie(float flt_k);
void rotation(float flt_angle);
//Il ... | TOOL | 0.920901 | 3.590759 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2021-03-17T15:38: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": "97efb58761... |
03f224fc-52af-497e-bef2-f2f9a7e5377f | sangdo913/Algorithms | StudyAlone/StudyAlone/leetcode/4medianoftwosortedarrays.h | #include<iostream>
#include<vector>
using namespace std;
class Solution {
public:
int lower(int a, vector<int> &v2){
int s =0, e = v2.size()-1, m;
while(s<=e){
m = (s+e)/2;
if(v2[m] < a){ s = m+1;}
else e = m-1;
}
return s;
}
int upper(in... | ALGO | 0.999997 | 4.714315 | {
"github_metadata": {
"branch": "master",
"commit_count": 850,
"repo_created_at": "2018-01-06T13:25:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "46da6790... |
c08e2a73-560c-4fc5-9e5e-364d66608202 | poon-zx/kattis | solutions/bottledupfeelings.cpp | #include <algorithm>
#include <array>
#include <bitset>
#include <climits>
#include <cmath>
#include <cstddef>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <deque>
#include <functional>
#include <ios>
#include <iomanip>
#include <iostream>
#include <istream>
#include <iterator>
#include <map>
#inclu... | ALGO | 0.999493 | 4.047696 | {
"github_metadata": {
"branch": "main",
"commit_count": 289,
"repo_created_at": "2025-02-03T16:25:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "578e14af3f... |
1e5ca663-58f2-431f-8029-30c36ff2268d | abhishek2001panwar/dsa | recursion/Binarysearch.cpp | #include <iostream>
#include <vector>
using namespace std;
int binary(vector<int> v, int start, int end, int target)
{
if (start > end)
{
cout << "Element not found";
return 0;
}
int mid = (start + end) / 2;
if (v[mid] == target)
{
cout << "Element found at index " << mid... | ALGO | 0.999865 | 5.722846 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-09-02T14:05: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": "90a8bbadbadd... |
8b5474af-2d72-4799-8cf2-5581f67597d8 | taitruong256/Competitive-programming | Tags/dfs/dfs_Fillomino_21517C.cpp | /*=====================================================================================
Nothing is impossible, only you think it is impossible
Try, try, try again until you succeed
Where is the bug, delete it there ... | ALGO | 0.999961 | 3.727922 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2025-04-14T06:59: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": "827319af0bd5... |
aa62b51d-3502-4741-8cbd-e0248dd0ba27 | maelikax/348Project | code/include/solver.hpp | /*****
* TEAM ORANGE
*
* EECS 348 Expression Solver Project
* solver.hpp
* see solver.cpp for details
*
* Created:
* <NAME> (2888458)
* 18 September 2023
*
* Last Edited:
* <NAME> (2888458)
* 29 November 2023
*****/
#ifndef SOLVER_HPP
#define SOLVER_HPP
#include <string>
// TODO: move this... | TOOL | 0.997695 | 6.823236 | {
"github_metadata": {
"branch": "main",
"commit_count": 49,
"repo_created_at": "2023-09-17T22:13:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "802d74b2bd1... |
3cbae2f8-933b-41ac-b57c-3a3dc505c03a | Feng806/Hybrid_energy_optimization | fuelOpt_classDefs.cpp | //
// fuelOpt_DP.cpp
// GTLC
//
// Created by <NAME> on 6/16/18.
// Copyright © 2018 <NAME>. All rights reserved.
//
#include "fuelOpt_DP.hpp"
// Class that represents the different segments of flight and associated parameters
flight_segment::flight_segment(){
g = 9.81;
... | ALGO | 0.990712 | 6.113778 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-11-28T09:19: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": "378b935761... |
8c9a247e-04fa-47fb-9b61-6729f8c63c7d | 101magikarp101/USACO | guide-tournament/A.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <queue>
#include <map>
#include <cmath>
#include <iomanip>
#include <cstring>
#include <bitset>
#include <string>
#include <unordered_map>
#include <deque>
#include <climits>
#include <unordered_set>
using namespace std;
#define ll long... | ALGO | 0.999987 | 3.891649 | {
"github_metadata": {
"branch": "main",
"commit_count": 66,
"repo_created_at": "2024-09-25T15:08: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": "e4e000d53a9... |
e9de9acd-ccd5-4931-a637-6dea7a28e246 | nikhil-reddy-18/algfrprime | al1.cpp | #include<iostream>
#include<stdlib.h>
#include <ctime> //to calc. execution time
#include<math.h> // to include sqrt()
using namespace std;
bool primetest(int n,int upto)
{
int j;
if(n == 2 || n == 3) return true;
for(j=2;j<=upto;j++)
{
if(n%j == 0) return 0;
... | ALGO | 0.996011 | 3.805722 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2018-01-13T18:47: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": "abc2c99fc1... |
e881eba7-8711-4831-944c-29bbf91737ba | Briannider/CPPHomeworkHub | Ejercicios/Pilas_y_Colas/funciones.cpp | #include "funciones.hpp"
#include <string>
#include <string.h>
#include <iostream>
using namespace std;
void agregar(int arr[], int n, int &len, int v)
{
if (len == n)
{
cout << "El vector esta lleno" << endl;
}
else
{
arr[len] = v;
len++;
}
return;
}
void mostrar(int arr[], int len)
{
for (int i = 0... | ALGO | 0.999704 | 3.930993 | {
"github_metadata": {
"branch": "master",
"commit_count": 109,
"repo_created_at": "2023-10-26T19:02: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": "55a969e5... |
22d7a56f-eee2-44ed-80b1-933ef9e58c30 | Eileenert/MicroRecif | simulation.h | /* simulation.h
<NAME>
<NAME>
*/
#ifndef SIMULATION_H
#define SIMULATION_H
#include "lifeform.h"
#include "constantes.h"
#include <vector>
#include <string>
#include <random>
class Simulation
{
public:
Simulation(int nbr_al = 0, int nbr_co = 0, int nbr_sca = 0);
void sauvegarde(std::string nom_fichier);
... | ALGO | 0.938024 | 3.051948 | {
"github_metadata": {
"branch": "main",
"commit_count": 233,
"repo_created_at": "2024-02-25T09:23: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": "e1fad356ee... |
bc5c0d64-37fd-49ee-9e61-2bb0a3bd4519 | aplqo/exercises | luogu/06-Province/P2153-MorningJog.cpp | #ifdef APTEST
#include "debug_tools/program.h"
#endif
#include <climits>
#include <cstring>
#include <functional>
#include <iostream>
#include <limits>
#include <queue>
#include <utility>
#include <vector>
using namespace std;
const unsigned int maxn = 200, maxm = 2e4;
const unsigned int maxv = maxm * 2 + 2, maxe = (ma... | ALGO | 0.999968 | 4.073048 | {
"github_metadata": {
"branch": "master",
"commit_count": 654,
"repo_created_at": "2019-10-26T11:25:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5e4a7567... |
adba003f-49ac-49b6-96d6-09e35e04c791 | tinawebdev/cpp-lafore | chapter05/ex09.cpp | #include <iostream>
using namespace std;
struct time_s
{
int hours;
int minutes;
int seconds;
};
void swap (time_s &time1, time_s &time2);
int main()
{
time_s t1, t2;
char ch = ':';
cout << "Введите время t1 в формате (HH:MM:SS): ";
cin >> t1.hours >> ch >> t1.minutes >> ch >> t1.seconds... | ALGO | 0.996352 | 4.302514 | {
"github_metadata": {
"branch": "master",
"commit_count": 90,
"repo_created_at": "2020-09-17T12:47:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "03285306d... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.