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 |
|---|---|---|---|---|---|---|---|
6765ce6a-c505-4d65-a672-262811358b15 | MalisaRadosavljevic/mlrB2019seminarski | 12 interval/interval.cpp | #include <iostream>
#include<iomanip>
using namespace std;
int main(){
int n,a,b;
double x,proizvod = 1; // производ иницијализујемо на неутрал за множење
bool indikator = false; //индикатор нам служи да проверимо да ли се неки број налази у траженом интервалу
// и на почетку пр... | ALGO | 0.999592 | 4.305974 | {
"github_metadata": {
"branch": "master",
"commit_count": 90,
"repo_created_at": "2019-03-19T07:43: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": "b4e119949... |
fd65bad1-b4ff-40d8-a4b6-2f5cb374acb2 | niloychandrasarker/CS-Fundamentals- | 02.Introduction to C++ For DSA/Weak 01-Introduction to C++/Module 03.5-Weak 01 practice Day 02/W_Mathematical_Expression.cpp | #include <iostream>
#include <string>
using namespace std;
int main() {
int a, b, c;
char s1, s2, q;
cin >> a >> s1 >> b >> q >> c;
if (s1 == '+' && a + b == c) {
cout << "Yes" << endl;
} else if (s1 == '-' && a - b == c) {
cout << "Yes" << endl;
} else if (s1 == '*' && a * b ... | ALGO | 0.999768 | 3.963054 | {
"github_metadata": {
"branch": "main",
"commit_count": 75,
"repo_created_at": "2023-04-04T11:45: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": "c84640bc1c1... |
b76cdac3-6318-4371-8346-582e88cd82b3 | ishandutta2007/codeforces-k | kraskevich/normal/178/E1.cpp | #include <iostream>
using namespace std;
int a[2000][2000];
int u[2000][2000];
int n;
int cur = 1;
int maxX = -1, minX = 2000, minY = 2000, maxY = -1;
void dfs(int x, int y)
{
minY = min(y, minY);
maxY = max(y, maxY);
minX = min(minX, x);
maxX = max(maxX, x);
u[x][y] = cur;
if(x > 0 && !... | ALGO | 0.999742 | 4.028226 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T06:06: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": "8bef9b34bb54... |
290e6b69-1251-40f5-9c25-71bfd60ff2d8 | AI-Planning/autoscale | planners/ipc2018-opt-complementary2-3584mb/src/search/modular_pdbs/pattern_collection_evaluator.cc | #include "pattern_collection_evaluator.h"
#include "../option_parser.h"
#include "../plugin.h"
//#include "../task_proxy.h"
#include "../task_tools.h"
using namespace std;
//PatterCollectionEvaluator is to be the driver for 8 PDB-based options
//RandomCollectionGeneration: CBP, RBP, CGamer, the one used by *Po... | TOOL | 0.970434 | 6.139286 | {
"github_metadata": {
"branch": "main",
"commit_count": 1270,
"repo_created_at": "2021-07-13T08:45:03.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 5,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2eb5b9a322... |
d9c9752e-5405-4f29-8f1e-887b4a06912d | shefben/world-opponent-network | world-opponent-network/wonapi/WONGUI/TextBox.cpp | #include "TextBox.h"
#include "Clipboard.h"
#include "ColorScheme.h"
#include <algorithm>
using namespace WONAPI;
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
TextSegmentBase::TextSegmentBase()
{
mLine ... | TOOL | 0.924815 | 5.926754 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2015-07-28T22:52:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 13,
"forks": 3,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "9ee78ac7f... |
b61e4a4d-4395-4150-a1f6-85012c8224df | Prakash-sa/Competitive-Programming | bridge/articulated.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long int lli;
#define F(i,a,b) for(lli i = a; i <= b; i++)
#define RF(i,a,b) for(lli i = a; i >= b; i--)
#define endl "\n"
#define speed ios_base::sync_with_stdio(false);cin.tie(NULL);
using namespace std;
typedef pair<lli,lli> PII;
//EC_P - Critical Edges
//SU... | ALGO | 0.999743 | 3.805976 | {
"github_metadata": {
"branch": "master",
"commit_count": 240,
"repo_created_at": "2019-08-27T18:29:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bddb80ce... |
1c2f8fab-9237-40a0-af3e-40c1da85c77d | rsirefelt/ProgrammingExercises | C++/CTCI/Chapter1/1.3/permutation.cc | #include <stdio.h>
#include <string>
bool IsPermutation(std::string str1, std::string str2);
int main()
{
int buffSize = 256;
char buff[buffSize];
printf("Input c_string1: ");
if (scanf("%256s", buff) != 1) {
fprintf(stderr, "Error\n");
return 1;
}
std::string str1(buff);
printf("Input c_s... | ALGO | 0.998839 | 4.68322 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2015-08-24T08:35: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": "79e51380cc... |
29f3e8a4-69c7-47a6-a094-dd8a619f7772 | hertera1/tensorflow | third_party/xla/xla/service/gpu/nccl_clique.cc | /* Copyright 2024 The OpenXLA Authors.
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 agreed to in writing, sof... | TOOL | 0.978338 | 7.740049 | {
"github_metadata": {
"branch": "master",
"commit_count": 159159,
"repo_created_at": "2023-01-02T10:15:39.000Z",
"is_fork": true,
"is_org_owned": false,
"forked_from": "tensorflow/tensorflow",
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"c... |
7a774c77-5540-4ee6-8aa4-bcdd5e3b7d60 | Adityaingale333/DSA | 0229-majority-element-ii/0229-majority-element-ii.cpp | class Solution {
public:
vector<int> majorityElement(vector<int>& nums) {
int n = nums.size();
int count1 = 0;
int count2 = 0;
int candidate1 = INT_MIN;
int candidate2 = INT_MIN;
for(int i=0; i<n; i++){
if(count1==0 && candidate2 != nums[i]){
... | ALGO | 0.999995 | 5.686892 | {
"github_metadata": {
"branch": "main",
"commit_count": 1840,
"repo_created_at": "2024-07-18T17:57: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": "bf7e4ef88... |
23aa1e87-eb4d-46fa-94a7-8c8a69f938bd | guicrisostomo/College-exercises | Programming language/Dia 10-11/exercicio 1/main.cpp | #include <iostream>
#define MAX 10
using namespace std;
typedef struct structPilha {
int dados[MAX];
int topo;
} pilhas;
void menu(int *opcao) {
cout << "----------------------- MENU -----------------------\n\n";
cout << "\t1 - Push (inserir elemento na pilha)" << endl;
cout << "\t2 - Pop (remove... | ALGO | 0.965099 | 4.034944 | {
"github_metadata": {
"branch": "main",
"commit_count": 52,
"repo_created_at": "2021-12-09T01:15: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": "d17434867c3... |
61d3e4ad-b5d9-4d05-ab00-15223599d315 | ishandutta2007/codeforces-t | takio/normal/711/B.cpp | #include <bits/stdc++.h>
#define LL long long
#define pii pair <LL, LL>
#define xx first
#define yy second
using namespace std;
const LL N = 510;
LL a[N][N];
LL sum[N];
int main () {
// freopen ("in.txt", "r", stdin);
LL n;
cin >> n;
if (n == 1) {
cout << 1 << endl;
return 0;
}
... | ALGO | 0.999954 | 3.407604 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:27:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "759a972d5053... |
a2dc8dd6-acbd-425c-9dd1-0a2fd5860d45 | gdhzLZ/leetcode | leetcode321.cpp | class Solution {
public:
vector<int> maxNumber(vector<int>& nums1, vector<int>& nums2, int k) {
vector<int> ans;
int length = 0;
string s1,s2;
for(int i = 0 ; i < nums1.size() ; i++){
char c = nums1[i]+'0';
s1+=c;
}
for(in... | ALGO | 0.999984 | 5.284759 | {
"github_metadata": {
"branch": "master",
"commit_count": 147,
"repo_created_at": "2020-01-26T20:24: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": "c25851cc... |
f02c71c6-c723-4756-aab2-88158d12ce20 | Divyansh-Mehta/Coding-ninja-dsa | Data-Structures-in-C++/Lecture-8-Linked-List-1/Code/palindrome-linked-list.cpp | /*
Palindrome LinkedList
You have been given a head to a singly linked list of integers. Write a function check to whether the list given is a 'Palindrome' or not.
Input format :
The first line contains an Integer 't' which denotes the number of test cases or queries to be run. Then the test cases follow.
First and the... | ALGO | 0.999722 | 5.955854 | {
"github_metadata": {
"branch": "master",
"commit_count": 77,
"repo_created_at": "2021-09-07T13:45:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 27,
"forks": 19,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "0d77dc6... |
d9e6afd8-7aa7-4d1a-bfa4-dd64bb8b7065 | alok7139/DSA-with-cpp | 4 Strings/Reverse a word in given string.cpp | /*
Given an input string s, reverse the order of the words.
A word is defined as a sequence of non-space characters. The words in s will be separated by at least one space.
Return a string of the words in reverse order concatenated by a single space.
Note that s may contain leading or trailing spaces or multiple spa... | ALGO | 0.999728 | 5.378814 | {
"github_metadata": {
"branch": "main",
"commit_count": 267,
"repo_created_at": "2023-12-10T20:19: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": "2ea68c6d33... |
a10e4594-84ae-4d4e-a1d5-e8956c478161 | mhwen/competitive-programming | CodeChef/Starters134/5_prison.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <map>
#include <set>
#include <stack>
#include <functional>
#include <cmath>
#include <numeric>
#include <iomanip>
#include <deque>
using namespace std;
typedef long long ll;
#define sz(x) (int)(x).size()
constexpr int INF = 1e9;
int... | ALGO | 0.999942 | 4.433251 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-08-27T00:30: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": "95891b422ad3... |
ab3e9855-5834-4b7f-8b31-78e7aa9003ba | logic-three-body/DataStructure_ListLink | remov_duplicate_2/removeDup.cpp | #include<iostream>
#include<stdlib.h>
/**
*https://leetcode-cn.com/problems/remove-duplicates-from-sorted-list/
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
/*
此处撰写解题思路:
注意逻辑运算规律&&:从左向右
current->next&&c... | ALGO | 0.999852 | 4.371861 | {
"github_metadata": {
"branch": "master",
"commit_count": 35,
"repo_created_at": "2020-09-21T13:55: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": "cfef86bd2... |
413f8db8-9948-4b87-a8ca-7e647f575e2a | Drishty06/Data-Structures-and-Algorithms | Binary Tree/lowest_common_ancestor.cpp |
//Function to return the lowest common ancestor in a Binary Tree.
// method 1: naive
// we find two paths from root to n1 and root to n2
// and from these two path vectors, the element before the first uncommon element is the lca
// bool findPath(Node *root, vector<Node *> &p, int n)
... | ALGO | 0.999986 | 6.20426 | {
"github_metadata": {
"branch": "main",
"commit_count": 842,
"repo_created_at": "2021-05-22T19:32:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 9,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ba660af73b... |
be10c876-9424-4c0f-b010-6ae29226c381 | Atari2/AdventOfCode | 2022/Day15/main.cpp | // compile with: cl /nologo /O2 /EHsc /std:c++latest main.cpp
#include <version>
#ifndef _MSC_VER
#error "This code requires an MSVC compiler"
#else
#if _MSC_VER < 1935 || !defined(_WIN64) || !_HAS_CXX23 || __cpp_lib_ranges < 202207L
#error "This code is for x64 MSVC 19.35+ only and requires C++23 features"
#endif
#end... | ALGO | 0.999486 | 6.024081 | {
"github_metadata": {
"branch": "main",
"commit_count": 65,
"repo_created_at": "2023-12-01T10:16: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": "a187809c3b1... |
03e71773-f763-41e6-b519-78aefa0a9fc2 | Venkataraman-Nagarajan/Graphics-and-Multimedia-Lab | Trials/conePush.cpp | // #include<windows.h>
#include<GL/glut.h>
#include<iostream>
#include<algorithm>
#include<utility>
#include<stdlib.h>
#include<cmath>
#include<vector>
using namespace std;
typedef long long ll;
typedef long double ld;
const ll X_LIMIT = 100, Y_LIMIT = 100, Z_LIMIT = 20;
const ll WINDOW_WIDTH = 700, WINDOW_HEIGHT =... | ALGO | 0.903788 | 3.826222 | {
"github_metadata": {
"branch": "main",
"commit_count": 38,
"repo_created_at": "2021-07-17T14:07: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": "021da155fee... |
96ad3713-f203-4590-b2bb-55aa8f9de12d | orbant12/VU-Computer_Programming | H_6/rpn.cpp | #include <iostream>
#include <stack>
class Token{
public:
bool isOperator;
char op;
double value;
};
Token getToken(){
double val;
Token retVal;
std::string rawToken;
std::cin >> rawToken;
if ( std::cin.fail() ) throw std::runtime_error("end of file");
try{
... | ALGO | 0.999485 | 4.970261 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2024-09-17T16:24: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": "8e1410010f7... |
4e802db4-4797-4046-bbf6-aa0b8bcd393a | Dristy03/Samsung-Coding-Tests | 31-marathon.cpp | /*
Initially you have H amount of energy and D distance to travel. You may travel with any of the given 5 speeds. But you may only travel in units of 1 km. For each km distance traveled, you will spend corresponding amount of energy. e.g. the given speeds are:
Cost of traveling 1 km: [4, 5, 2, 3, 6]
Time taken to trave... | ALGO | 0.999939 | 4.476721 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-01-12T11:55:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "29513c649f3b... |
e0bfac89-c210-4f62-b3b2-18468dfcaa34 | kandika-Rohan/leetcode-practicing | Difficulty: Hard/Shortest Path by Removing K walls/shortest-path-by-removing-k-walls.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 shotestPath(vector<vector<int>> &mat, int n, int m, int k) {
if (k == 0 && mat[0][0] == 1) return -1;
... | ALGO | 0.999982 | 5.777384 | {
"github_metadata": {
"branch": "main",
"commit_count": 2858,
"repo_created_at": "2024-07-04T10:40:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "71d24ef04... |
f8892bf5-0297-42df-ac86-4787fc844ca2 | ISTanveer/XPSC | Week 8/Day 03/D. Prefix Permutation Sums.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
void solve()
{
long long n; cin>>n;
vector<ll> v(n-1); for(int i=0; i<n-1; i++) cin>>v[i];
ll tem=((n*(n+1))/2);
if(v.back()>tem){
cout<<"NO\n";
return;
}
if(v.back()<tem) {
v.push_back(tem);
vecto... | ALGO | 0.999834 | 3.910137 | {
"github_metadata": {
"branch": "main",
"commit_count": 98,
"repo_created_at": "2023-06-16T13:28: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": "520866b6b24... |
ecb40086-eb7a-4131-aafd-8d14920babc7 | taotao54321/cpp-procon | attic/test/segtree_lazy_rmq_raq/solve.cpp | #include "procon.hpp"
#include "segtree.hpp"
signed main() {
i64 N = RD();
i64 Q = RD();
using Monoid = i64; // 区間の最小値
using Action = i64; // 区間に一様に加える値
auto seg = segtree_lazy_make<Monoid,Action>(
/* fm= */ [](Monoid m1, Monoid m2) { return MIN(m1,m2); },
/* fa= */ [](Monoid m, ... | ALGO | 0.999414 | 6.071541 | {
"github_metadata": {
"branch": "master",
"commit_count": 741,
"repo_created_at": "2019-03-13T15:13: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": "154bd126... |
1e64aef2-7732-4772-bbfc-7411a79ec7b6 | red-sprout/SimSimAlgo | 백준/Diamond/1626. 두 번째로 작은 스패닝 트리/두 번째로 작은 스패닝 트리.cc | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
typedef pair<int, int> pii;
typedef long long ll;
struct Edge {
int u, v, w;
Edge(int _u, int _v, int _w) : u(_u), v(_v), w(_w) {}
};
const int MAX = 50001;
bool check[200000];
vector<pii> g[MAX], mst[MAX];
vector<Edge> edges;
... | ALGO | 0.999885 | 4.504029 | {
"github_metadata": {
"branch": "main",
"commit_count": 1034,
"repo_created_at": "2024-11-15T13:50:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e5ed72188... |
0036907c-08aa-41b4-b76a-6c9345e08042 | chosh95/STUDY | BaekJoon/2020/아기 상어 (16236번).cpp | #include <iostream>
#include <cstring>
#include <algorithm>
#include <queue>
using namespace std;
int dx[4] = { -1,0,0,1 };
int dy[4] = { 0,-1,1,0 };
int p[21][21], dist[21][21]; // 지도, 물고기들의 거리
int minX, minY, minDist; // 가장 가까운 물고기 위치, 거리
int sX, sY, sSize, sEatCnt; // 상어의 위치, 크기, 먹은 수
int N, res; // 지도 크기, 결과값
void... | ALGO | 0.999938 | 3.723386 | {
"github_metadata": {
"branch": "master",
"commit_count": 462,
"repo_created_at": "2019-01-21T15:32:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8b257ad8... |
b0eaadab-7d5e-4fcc-86a6-c4add11dd16f | bisnu16cse039/CP | DP/maxumum_sum_suarray_kadane.cpp |
#include<bits/stdc++.h>
using namespace std;
/**
********************************************************************
******************* Author:<NAME> ****************************
********************************************************************
**/
#define ull unsigned long long
#define ll ... | ALGO | 0.999992 | 3.883545 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2019-09-26T20:01:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "42d1d4ca4... |
2ce360ee-0083-4b00-8ccd-1d79efc5e1c0 | jinyoung0612/Algorithm | c++/BOJ/simulation/2933.cpp | #include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <cstring>
using namespace std;
#define MAX 101
int R,C;
char cave[MAX][MAX];
vector<int> stick;
bool visited[MAX][MAX];
int dx[4]={1,-1,0,0};
int dy[4]={0,0,1,-1};
queue< pair<int,int> > q;
void throw_stick(int idx,int turn){
int ro... | ALGO | 0.999845 | 4.119395 | {
"github_metadata": {
"branch": "master",
"commit_count": 151,
"repo_created_at": "2021-03-10T08:34: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": "70c46de3... |
7e3c956c-e3c2-4bb8-9831-87b748543ee2 | tensorflow/tensorflow | tensorflow/lite/kernels/rng_bit_generator.cc | /* Copyright 2023 The TensorFlow Authors. 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 law or a... | ALGO | 0.930173 | 7.447032 | {
"github_metadata": {
"branch": "master",
"commit_count": 182413,
"repo_created_at": "2015-11-07T01:19:20.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 190773,
"forks": 74758,
"issues": 873,
"pull_requests": 553
},
"file_meta": {
"content... |
20725478-424d-41c8-a5bc-fd86252436e1 | xuxinyang/leetcode | 670.最大交换.cpp | /*
* @lc app=leetcode.cn id=670 lang=cpp
*
* [670] 最大交换
*/
// @lc code=start
class Solution {
public:
static char cmp(char a , char b){ //辅助将string从大到小排序
return a>b;
}
int maximumSwap(int num) {
string change = to_string(num);
string exchange = change;
sort(exchange.beg... | ALGO | 0.999827 | 5.606949 | {
"github_metadata": {
"branch": "master",
"commit_count": 475,
"repo_created_at": "2020-10-28T09:23:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1495c661... |
f79faa33-a321-436d-8a41-95b5fb3a1916 | Yawn-Sean/Daily_CF_Problems | daily_problems/2024/06/0613/personal_submission/cf1292b_ToC.cpp | // https://codeforces.com/contest/1292/submission/265695993
/*
爆long long, 用高精度
*/
void sol_new()
{
LL _x0, _y0, _ax, _ay, _bx, _by, _xs, _ys, _t;
cin >> _x0 >> _y0 >> _ax >> _ay >> _bx >> _by;
cin >> _xs >> _ys >> _t;
LL u = _ys + _t, d = _ys - _t, r = _xs + _t, l = _xs - _t;
vector<pair<vector<i... | ALGO | 0.999688 | 4.962905 | {
"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": "9422... |
067fb5d3-3485-4898-a561-1bd8285986da | ishandutta2007/codeforces-c | couplefire/normal/909/F.cpp | #include <bits/stdc++.h>
using namespace std;
//7 : 7 6 1 5 3 2 4
//6 : 3 6 1 5 4 2
void solve(int n){
if(n == 0) return;
int largest = pow(2, floor(log2(0.0+n)));
solve(largest-(n-largest)-2);
for(int i = n; i>=largest-(n-largest)-1; i--) cout << i << " ";
}
int main(){
// freopen("input.txt", "... | ALGO | 0.999902 | 3.947522 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:17:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4e75631a5a5b... |
f171aaf8-9680-4be9-b366-1cb80d768880 | shmohammadi86/SCINET | inst/include/stats/prob/ppois.ipp | /*################################################################################
##
## Copyright (C) 2011-2018 <NAME>
##
## This file is part of the StatsLib C++ library.
##
## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with ... | ALGO | 0.998954 | 7.096021 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2019-07-15T22:40:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 18,
"forks": 5,
"issues": 2,
"pull_requests": 1
},
"file_meta": {
"content_id": "b7c3e5f2... |
9e49fd7d-0280-4ddf-a523-9f709fe2bc81 | nolan0801/Competitive-Programming | VNOJ/shth.cpp | /*
Author : vidut_206_CNH
*/
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define pb push_back
#define gcd(a,b) (__gcd(a,b))
#define lcm(a,b) (a/gcd(a,b)*b)
#define sz(x) (int)(x.size())
#define fast_cin() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define db(x) cerr << "... | ALGO | 0.999952 | 3.020859 | {
"github_metadata": {
"branch": "main",
"commit_count": 144,
"repo_created_at": "2021-12-21T06:10:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3ffe23d689... |
f1a2e62b-cdd6-4dc7-a4cf-60f020c90784 | ApolloAuto/apollo | modules/perception/camera_location_estimation/transformer/singlestage/singlestage_transformer.h | /******************************************************************************
* Copyright 2020 The Apollo Authors. 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
*... | TOOL | 0.917442 | 6.443896 | {
"github_metadata": {
"branch": "master",
"commit_count": 19341,
"repo_created_at": "2017-07-04T19:03:31.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 25847,
"forks": 9793,
"issues": 895,
"pull_requests": 104
},
"file_meta": {
"content_id... |
daf86f89-28c7-4cc4-8aed-fda740cccf97 | Siddhant103/LeetCode | 0020-valid-parentheses/0020-valid-parentheses.cpp | class Solution {
public:
bool match(char start, char end) {
if ((start == '(' && end == ')') || (start == '[' && end == ']') || (start == '{' && end == '}')) {
return true;
}
return false;
}
bool isValid(string s) {
stack<char> st;
for (char c: s)... | ALGO | 0.999356 | 6.100978 | {
"github_metadata": {
"branch": "main",
"commit_count": 3087,
"repo_created_at": "2021-05-04T08:05: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": "b8014138a... |
7f563012-ff45-48c6-a8f0-29fa325c6acc | fooofei/leetcode | cn-015-three-sum-cpp/main.cc | #include <algorithm>
#include <array>
#include <bitset>
#include <chrono>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <stack>
#include <stdarg.h>
#include <stdio.h>
#include <string>
#include <thread>
#include <vector>
using namespace std;
// 015 https://leetcode-cn.com/problems/3sum/... | ALGO | 0.999976 | 5.578291 | {
"github_metadata": {
"branch": "master",
"commit_count": 230,
"repo_created_at": "2019-09-09T13:27: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": "b400fd0d... |
18071a4d-b805-4dd0-9cd3-229fc130939b | kaspermunch/sap | ext/barcoder/MbEigensystem.h | /*!
* \file
* This file contains the declaration of MbEigensystem
*
* \brief Declaration of MbEigensystem
*
* MrBayes version 4.0 beta
*
* (c) Copyright 2005.
* \version 4.0 Beta
* \date Last modified: $Date: 2006/06/04 16:25:45 $
* \author <NAME> (1)
* \author <NAME> (2)
* \author <NAME> (3)
* \author <N... | ALGO | 0.998222 | 4.783476 | {
"github_metadata": {
"branch": "master",
"commit_count": 336,
"repo_created_at": "2013-09-30T13:11:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 2,
"issues": 0,
"pull_requests": 4
},
"file_meta": {
"content_id": "7b8cbe9f... |
530f600c-d054-4848-b0f8-ff023412d9a9 | nexes/leetcode | include/medium/sort_by_frequency.h | #pragma once
#include <queue>
#include <string>
#include <unordered_map>
namespace Leet::Medium {
// Given a string, sort it in decreasing order based on the frequency of
// characters.
// Example 1:
// Input: "tree"
// Output: "eert"
// Explanation:
// 'e' appears twice while 'r' and 't'... | ALGO | 0.999926 | 6.354812 | {
"github_metadata": {
"branch": "master",
"commit_count": 685,
"repo_created_at": "2020-08-28T16:23:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "30a68567... |
79e34a92-1bee-427c-b69e-3c7336e730a5 | singlarohan/leetcode_sol | 0062-unique-paths/2023-05-31 11.46.55 - Accepted - runtime 0ms - memory 6.5MB.cpp | class Solution {
public:
vector<vector<int>> dp;
int x,y;
int solve(int i, int j){
if(i >= x || j >= y) return 0;
if(i == x - 1 && j == y - 1) return 1;
if(dp[i][j] != -1) return dp[i][j];
return dp[i][j] = solve(i + 1, j) + solve(i, j + 1);
}
int uniquePaths(int m,... | ALGO | 0.999975 | 5.615072 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2023-08-05T02:14: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": "bcd855700a10... |
3e0099c6-5a5d-47a2-839a-94e8c645c28c | af-orozcog/ICPC2023 | strings_contest/H.cpp | //I love Manuela
#include <bits/stdc++.h>
#define ff first
#define ss second
#define pb push_back
#define ll long long
using namespace std;
struct state {
int len, link;
//Cuenta cuantas veces aparecen los strings que correponden a este nodo en el string
ll cnt = 0;
//Almacena cuantos strings (diferen... | ALGO | 0.999816 | 3.695358 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2023-04-01T18:03: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": "cdad121d2d16... |
eb0c61ee-9d29-4084-89aa-a6e77fcb3f92 | Maaz-24503/maaz_leetcode | 403 Frog Jump/403frog-jump.cpp | class Solution {
public:
bool helper(int i, int k, vector<int>& stones, unordered_map<string, bool>& memo, unordered_map<int, int>& pos){
if(i == stones.size() - 1) return true;
string key = to_string(i)+" "+to_string(k);
if(memo.find(key) != memo.end()) return memo[key];
memo[key] =... | ALGO | 0.99994 | 5.664274 | {
"github_metadata": {
"branch": "main",
"commit_count": 1339,
"repo_created_at": "2025-04-04T12:16: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": "f037b8016... |
9f46bfcf-2f12-4786-aded-a40c1db7b7f6 | TechieSingh/Java | Functions-and-arrays/differnenceof2array.cpp | #include<iostream>
using namespace std;
int main(){
int n1,n2;
cin>>n1;
int a1[n1];
for (int i = 0; i < n1; i++)
{
cin>>a1[i];
}
cin>>n2;
int a2[n2];
for (int i = 0; i < n2; i++)
{
cin>>a2[i];
}
int sum[n2]={0};
int borrow=0;
int j=n2-1;
in... | ALGO | 0.99974 | 3.205496 | {
"github_metadata": {
"branch": "master",
"commit_count": 47,
"repo_created_at": "2020-09-29T19:12: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": "c3c72f3d2... |
88221340-7320-499b-bb0d-d9495b6c14ab | QianMo/GPU-Gems-Book-Source-Code | GPU-Gems-3-CD-Content/content/12/demo/gpuocclusion_standalone/gpuscattering/DiscTree.h | /*! \file DiscTree.h
* \author <NAME>, <NAME>
* \brief Defines the interface to a
* crappy hierarchy for the discs.
*/
#ifndef DISC_TREE_H
#define DISC_TREE_H
#include <gpcpu/Vector.h>
#include <vector>
class DiscTree
{
public:
typedef float3 Point;
typedef float3 Normal;
struct Disc
... | ALGO | 0.995241 | 7.304265 | {
"github_metadata": {
"branch": "master",
"commit_count": 28,
"repo_created_at": "2018-04-21T15:43:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1080,
"forks": 449,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "fd4c... |
48044ca2-295a-4594-98aa-c02e957344e1 | xiaozhuo12138/StdSamples | Core/core_stereovector.hpp | #pragma once
namespace Casino
{
template<typename T>
struct StereoVector
{
sample_vector<T> samples[2];
StereoVector(size_t n) {
for(size_t i = 0; i < n; i++) samples[i].resize(n);
}
sample_vector<T>& operator[](size_t channel) { return samples[channel]; }
... | TOOL | 0.908225 | 5.685216 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2023-03-29T01:37: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": "8e88e189c66... |
d5914385-3c86-4b18-8d5b-1b9306eaad63 | animesh9893/dsa_questions | triology_q1.cpp | #include <bits/stdc++.h>
using namespace std;
#define max(a,b) (a<b? b:a)
#define min(a,b) (a<b? a:b)
#define mod 1e9+7
#define FOR(a,c) for(int (a)=0;(a)<(c);(a)++)
#define FORL(a,b,c) for(int (a)=(b);(a)<=(c);(a)++)
#define FORR(a,b,c) for(int (a)=(b);(a)>=(c);(a)--)
#define INF 1000000000000000003
typedef long lon... | ALGO | 0.998904 | 3.808244 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2022-04-12T05:28: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": "5a32a17c55c... |
211d2421-3d99-43a6-a017-07f8d44207d2 | jsanchezperez/ica | fast_float_method/inverse_compositional_algorithm.cpp | // This program is free software: you can use, modify and/or redistribute it
// under the terms of the simplified BSD License. You should have received a
// copy of this license along this program. If not, see
// <http://www.opensource.org/licenses/bsd-license.html>.
//
// Copyright (C) 2015, <NAME> <<EMAIL>>
// All ri... | ALGO | 0.99967 | 5.534293 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2016-12-29T13:09:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d754debe55... |
167abbfe-afb2-4c72-9309-bc8c866d6ef2 | SLAM7F3/projects | src/mains/isds/image2map.cc | // ==========================================================================
// Program IMAGE2MAP performs a least squares minimization of a chisq
// function that quantifies the discrepancy between 2D features
// selected for some orthorectified image and corresponding (long,lat)
// coordinates extracted from Google ... | ALGO | 0.998733 | 4.963225 | {
"github_metadata": {
"branch": "master",
"commit_count": 949,
"repo_created_at": "2019-01-17T10:42:23.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 5,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "404006e49... |
987c79c7-f1ae-43ae-b7c6-095aa1569b19 | cosmosapjw-quantum/omoknuni_small | src/mcts/mcts_node_virtual_loss.cpp | // src/mcts/mcts_node_virtual_loss.cpp
#include "mcts/mcts_node.h"
#include <thread>
#include <chrono>
namespace alphazero {
namespace mcts {
void MCTSNode::addVirtualLoss() {
// OPTIMIZED: Use relaxed ordering for better performance
// Virtual loss only needs to be eventually visible to other threads
vir... | ALGO | 0.939369 | 7.100636 | {
"github_metadata": {
"branch": "main",
"commit_count": 45,
"repo_created_at": "2025-05-08T02:30: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": "700393b35cb... |
dfbabd23-1756-495c-aa10-312a8f7cde30 | ishandutta2007/codeforces-s | siberian/normal/1408/C.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
#define all(a) (a).begin(),(a).end()
template<typename T1, typename T2> inline void chkmin(T1 & x, const T2 & y) {if (y < x) x = y;}
template<typename T1, typename T2> inline void chkmax(T1 & x... | ALGO | 0.999944 | 4.836312 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:07: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": "02e5272ebafc... |
56d64370-bf93-45cd-a5ce-ae3e442ef419 | HaranRoga/MyStl | algorithm/03_copy2.cpp | // swap between elements
// 1. swap elements by value
// 2. swap two vectors
// 3. swap elements by pointers
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
// Source vectors
vector<char> v1 = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'e', 'f', 'G', 'n'};
vector<char> v2 = {'... | ALGO | 0.99435 | 5.813966 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2024-09-01T17:33: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": "cbadf2c44e9... |
fa71b55a-fbd8-4493-b98a-cda3413bc5cc | notwatermango/cp-submissions | atcoder/abc231/F.cpp | #include <bits/stdc++.h>
using namespace std;
typedef int64_t i64;
typedef int32_t i32;
i32 water = !not!iscntrl(isupper(isgraph(iscntrl(ispunct(isalpha(EOF))))));
#define mango(x)
#define fastmango cin.tie(nullptr)->sync_with_stdio(water)
#ifdef notwatermango
#undef mango
#undef notwatermango
#define mango(x) { wate... | ALGO | 0.99995 | 4.121246 | {
"github_metadata": {
"branch": "main",
"commit_count": 530,
"repo_created_at": "2022-06-08T16:10:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0a57733b26... |
b5141196-70b5-44d3-b9a8-cae3e8507744 | PhilipHsu609/learncpp | Chapter_13/Q2.cpp | #include <cstdint>
#include <iostream>
class Average {
public:
Average() : m_sum{0}, m_seen{0} {}
Average &operator+=(int val) {
m_sum += val;
m_seen++;
return *this;
}
friend std::ostream &operator<<(std::ostream &os, const Average &avg) {
os << static_cast<double>... | TOOL | 0.980642 | 6.572351 | {
"github_metadata": {
"branch": "master",
"commit_count": 27,
"repo_created_at": "2021-02-17T03:57: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": "561369d62... |
aa1dcb13-3925-467c-b33d-6cff66da09da | ReusTylor/leetcode_practice | leetcode/缓存/LRU.cpp | /*
使用双向链表 + 哈希实现LRU
双向链表存储数据,哈希实现随即访问
*/
#include<iostream>
#include<unordered_map>
#include<vector>
using namespace std;
struct DLinked {
int key, value;
DLinked* prev;
DLinked* next;
DLinked(): key(0), value(0), prev(nullptr), next(nullptr) {}
DLinked(int _key, int _value): key(_key), va... | ALGO | 0.999576 | 5.769825 | {
"github_metadata": {
"branch": "main",
"commit_count": 27,
"repo_created_at": "2023-07-03T09:39: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": "204c40e1273... |
f73ea28f-5cb1-4891-98e9-4723228f2e2a | NidhiKamal05/leetcode_solutions_CPP | leetcode_problem_0101_to_0200/leetcode_147_insertionSortList.cpp |
// 147. INSERTION SORT LIST
#include<iostream>
#include<vector>
using namespace std ;
struct ListNode{
int val ;
ListNode * next ;
}
ListNode * sortList(ListNode * head)
{
if(head == NULL){
return head ;
}
int temp ;
ListNode * p = NULL ;
ListNode * q = NULL ;
p = head ;
while... | ALGO | 0.999992 | 5.26129 | {
"github_metadata": {
"branch": "main",
"commit_count": 95,
"repo_created_at": "2025-03-30T12:30:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9692836f268... |
d84e8b72-8f18-4b44-bf0a-451b0783b15e | yamate11/compprog | arc/arc012/c/cans2.cc | #include <bits/stdc++.h>
#include <cassert>
typedef long long int ll;
using namespace std;
// @@ !! LIM()
template<typename T>
struct Board {
int nR;
int nC;
T def;
vector<T> brd;
Board(int nr, int nc, T def_ = T(0)) :
nR(nr), nC(nc), def(def_), brd(nR*nC, def_) {}
int enc(int r, int c) const {
i... | ALGO | 0.999954 | 4.692343 | {
"github_metadata": {
"branch": "main",
"commit_count": 219,
"repo_created_at": "2021-03-11T06:12:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7ddf54d37c... |
0924e9bd-a97c-4be2-88b0-be1eeb073cbb | Vicky-Jha/DataStructures | bitManipulation.cpp | //
// main.cpp
// bitManupalation
//
// Created by test on 09/07/19.
// Copyright © 2019 test. All rights reserved.
//
#include <iostream>
using namespace std;
bool isPowerOfTwo(int x)
{
/*if (x == 0)
return false;
else
return !(x&(x-1));
*/
return (x && !(x & (x - 1)));
}
bool che... | ALGO | 0.998286 | 5.052576 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2019-07-29T05:21:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "80aa266444... |
e5640a3d-1290-41cb-aa68-9b85d614ca4e | Masttf/XCPC | atcoder/ABC378/c.cpp | #include<bits/stdc++.h>
#define int long long
using namespace std;
#define dbg(x...) \
do { \
cout << #x << " -> "; \
err(x); \
} while (0)
void err() {
cout << endl << endl;
}
template<class T, class... Ts>
void err(T arg, Ts ... args) {
cout << fixed << setprecision(10) << arg << ' ';
err(args.... | ALGO | 0.999961 | 4.191016 | {
"github_metadata": {
"branch": "master",
"commit_count": 39,
"repo_created_at": "2025-02-09T13:42:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ee6fecf4c... |
ffd25c52-6765-4d9c-b52f-a06427e8cb89 | Shikhar-S/Analysis-of-Competitive-Codebase | Data/Contest1248/Standings2/29178686_63003486.cpp | #include<bits/stdc++.h>
typedef long long LL;
const LL maxn=1e6+9,mod=1e9+7;
const LL dx[]={0,-1,0,0,1},dy[]={0,0,-1,1,0};
inline LL Read(){
LL x(0),f(1); char c=getchar();
while(c<'0' || c>'9'){
if(c=='-') f=-1; c=getchar();
}
while(c>='0' && c<='9'){
x=(x<<3)+(x<<1)+c-'0'; c=getchar();
}return x*f;
}
LL n,m,... | ALGO | 0.999983 | 3.638429 | {
"github_metadata": {
"branch": "master",
"commit_count": 74,
"repo_created_at": "2019-11-22T14:40: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": "73501904b... |
0f803227-48b4-4f05-b35d-16bbd699590f | kgwisawa/Data-security-Cipher | RSA.cpp | #include <iostream>
#include <algorithm>
#include <stdio.h>
#include <cmath>
#include <string>
using namespace std ;
int prepareData(string inputText,string sum[]) {
string copy = inputText;
copy.push_back('-');
int count = 0;
for(int i = 0 ; i < copy.length() ; i++) {
if(copy[i] == '-') {
... | ALGO | 0.999966 | 4.102523 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-08-11T07:19: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": "13b5a0e89dc9... |
eab879d8-d5dc-444b-be16-5f3c9436da58 | cloud-007/Online-Judge-Solutions | CodeForces/851D.cpp | /*One touch and i IGNITE*/
#include<bits/stdc++.h>
using namespace std;
#define To_Infinity_And_Beyond ios_base::sync_with_stdio(false),cin.tie(0)
#define ll long long
#define F first
#define S second
#define endl "\n"
#define Endl "\n"
const int sz = 5e5 + 5, N = 1e6 + 5;
ll tc, n, x, y, a[sz], lp[N + 1];
vector<int>... | ALGO | 0.999931 | 4.315639 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2022-09-20T19:30:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0abce23e1... |
02d2a3c2-ecbc-4487-b19a-3aec26c16aea | zyadfahmy2/My-Courses | ProblemSolving/DataStructure/quickSortlast.cpp | #include <iostream>
using namespace std;
void quick_sort(int arr[], int l, int r);
int main(void)
{
int arr[] = {1, 4, 3, 1, 9, 6, 10};
quick_sort(arr, 0, 6);
for (int i = 0; i < 7; i++)
{
cout << arr[i] << " ";
}
}
void quick_sort(int arr[], int l, int r)
{
if (l >= r)
{
re... | ALGO | 0.999935 | 5.403141 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2021-08-31T13:05: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": "88998dbdb254... |
3d16c28e-b100-4050-a16d-c524c60b04d8 | Deepbhalsod/CodeEveryDay | Day109-EqualDifference.cpp | #include<bits/stdc++.h>
using namespace std;
class Solution{
public:
int majorityElement(int a[], int n)
{
if(n < 3)
return 0;
sort(a, a + n);
int same = 1, max = 0;
for(int i = 1; i < n; i++)
{
if(a[i-1] == a[i])
{ ... | ALGO | 0.99984 | 5.532403 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2023-01-21T14:16: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": "b606e2e20f5... |
5c950188-c1c9-4f8d-94d5-b58608d2ec7a | TheUnicat/competitive-pwogramming | usaco/bronze/2016/February/3_load_balancing.cpp | //
// Created by TheUnicat
//
#include <vector>
#include <sstream>
#include <iostream>
#include <fstream>
#include <string>
#include <algorithm>
int compute_max(int x_position, int y_position, std::vector<std::pair<int, int> > positions, std::vector<std::pair<int, int> > positions_reversed) {
int q1 = 0;
int... | ALGO | 0.999726 | 3.677939 | {
"github_metadata": {
"branch": "main",
"commit_count": 290,
"repo_created_at": "2024-05-12T07:59: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": "0f80f67ecc... |
fae78411-d821-4036-ba9b-c8516a2b960d | saurabh7054/dsa-cpp | 01_arrays_problem/findSecLargeEle.cpp | #include<iostream>
#include<vector>
#include<climits>
using namespace std;
int fideSecLarge(vector<int>& arr, int n) {
int large = arr[0]; // Initialize 'large' with the first element of the array
int secLarge = INT_MIN; // Initialize 'secLarge' to the smallest integer value
// Iterate through the arr... | ALGO | 0.999978 | 6.254972 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2025-06-23T10:47: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": "4af26eb898cc... |
5ac610db-544d-4a00-84e0-4bb74895803a | ru-ccmt/eDMFT | src/impurity/NCA/nca.cc | // @Copyright 2007 <NAME>
//
#include <sys/stat.h>
#include <sys/types.h>
#include "parser.h"
#include "timer.h"
#include "util.h"
#include "complex.h"
#include "mesh.h"
#include "blas.h"
#include "function.h"
#include "Common.h"
using namespace std;
namespace Parameters{
StringPar Sig ("Sig", "sig.inp",... | ALGO | 0.995068 | 4.982331 | {
"github_metadata": {
"branch": "master",
"commit_count": 94,
"repo_created_at": "2024-03-29T22:52:08.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 29,
"forks": 3,
"issues": 8,
"pull_requests": 0
},
"file_meta": {
"content_id": "4a5588d05... |
421354ce-3c1b-4e8d-a789-fa077004aaee | shangjiaxuan/Simple-shell | sjx/UJr2/Crossing/CrossingColor.cpp | #include "Crossing.h"
#include "CrossingColor.h"
using namespace std;
namespace UJr2_funcs {
namespace crossing {
void Color::find_groups() {
cout << "\nFinding solutions...\n";
cout << "Please wait..." << endl;
for(int i = 0; i < crossing::possi; i++) {
assign(i);
}
cout << "Done!\n" << endl;
... | ALGO | 0.994113 | 3.386122 | {
"github_metadata": {
"branch": "master",
"commit_count": 168,
"repo_created_at": "2018-08-12T20:25:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f729b6c8... |
73b83f79-75ab-4976-98f2-2c0fc4d6f6e2 | Alexkkir/VMK-first-course | algorithms_mail/3_hw/4_base2_ans.cpp | #include <cstdlib>
void fast_sort(unsigned *begin, unsigned *end) {
size_t n = (size_t) (end - begin);
const int deg = 16; // deg should be divider of 32
const int base = 2 << deg;
const int max_digit_ind = 32 / deg;
unsigned mask;
if (deg == 1) {mask = 0b1;}
else if (deg == 2) {mask = 0b11;}
else if ... | ALGO | 0.999559 | 4.432972 | {
"github_metadata": {
"branch": "main",
"commit_count": 39,
"repo_created_at": "2021-06-21T16:54: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": "d25b7e62f73... |
14aa1017-7288-43d2-b01f-8eee17777055 | FRCTeam1073-TheForceTeam/RookiePreseason2014 | Group B/5.1_5.4/5.3_Follow_line_with_calibration/line_follow_2_sensors_calib/line_follow_2_sensors_calib.ino | /* Software 1073 Example Program
Written and debugged for use on the Arduino boebot platform
last updated: 10/20/14
Program: Using both of the light sensors, follow a line AND:
1) auto-calibrate (so that the user does not have to change the code)
2) be able to continue moving when both line sensors see a black line
*/... | TOOL | 0.953253 | 5.774711 | {
"github_metadata": {
"branch": "master",
"commit_count": 52,
"repo_created_at": "2014-07-12T20:04:34.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "393a23f04c... |
073ba31d-f833-4201-8fde-f4b2f7e87489 | mjenrungrot/competitive_programming | UVa Online Judge/v8/868.cc | /*=============================================================================
# Author: <NAME> - https://github.com/mjenrungrot/
# FileName: 868.cc
# Description: UVa Online Judge - 868
=============================================================================*/
#include <iostream>
using nam... | ALGO | 0.999918 | 3.157372 | {
"github_metadata": {
"branch": "master",
"commit_count": 258,
"repo_created_at": "2015-11-17T04:41:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b906c021... |
2b987078-5477-4c62-acc3-327d02483735 | rincedd/simtool | src/sim/output/DegDistOutput.h | /**
* @file DegDistOutput.h
* @date 30.07.2009
* @author gerd
*/
#ifndef DEGDISTOUTPUT_H_
#define DEGDISTOUTPUT_H_
#include "IntervalOutput.h"
#include <largenet/motifs.h>
#include <largenet/measures/measures.h>
#include <map>
#include <iomanip>
namespace sim {
namespace output {
/**
* Calculates and outputs t... | ALGO | 0.9034 | 5.686061 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2010-09-30T14:59: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": "f9ec82f05... |
c671b5d2-3697-4fcd-98bf-9d740c6ca0d9 | NishaBisht493/Week2-DP5-CipherSchools | 21. Longest Palindrome.cpp | #include<bits/stdc++.h>
using namespace std;
string longestPalindrome(string s){
string result = "";
int len = s.size();
int maxLen = 0;
vector<vector<int>> dp(len, vector<int>(len, 0));
for(int i = 0; i < len; i++){
dp[i][i] = 1;
if(maxLen < dp[i][i]){
maxLen = dp[i][i]... | ALGO | 0.999876 | 3.847279 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2023-02-04T16:12: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": "51fb22f257a... |
7dfc1c7e-71f1-4686-9d61-8411087711df | AngelescuCiprian/ExamenATP | SumaRecursivMatrice-SortareLinie/SumaRecursivMatrice-SortareLinie/SumaRecursivMatrice-SortareLinie.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <malloc.h>
/*
* Suma recursiva a elementelor de pe diagonala principala
Ordonarea unei linii
*/
int sumaRecursivaDiagonala(int** mat, int n, int i)
{
if (i == n)
return 0;
return (mat[i][i] + sumaRecursivaDiagonala(mat, n, i+1));
}
void ordonareLinie(int*... | ALGO | 0.999412 | 4.022394 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2025-06-22T19:03:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e86b9cc291... |
f20b5a39-5f50-4e23-9cda-76977faf6c84 | lachfoy/SIT315 | Module2/Task1/matmul_seq.cpp | #include <iostream>
#include <fstream>
#include <string>
#include <time.h>
#include <chrono>
#include <cstdlib>
// A, B and C are all N*N
// C = A * B
// initialize A and B with random values
#define MATRIX_SIZE 512
#define NUM_TESTS 10
// the matrix is a pointer to a pointer...
// where the first pointer is an arra... | ALGO | 0.984434 | 5.372987 | {
"github_metadata": {
"branch": "main",
"commit_count": 35,
"repo_created_at": "2022-07-16T13:23: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": "452fd190ccc... |
3445e967-f70c-4305-997b-27017ee985af | ishandutta2007/codeforces-e | e869120/normal/1198/D.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int H, W, dp[59][59][59][59];
int A[59][59];
int ranged(int px, int py, int qx, int qy) {
return A[px - 1][py - 1] + A[qx][qy] - A[px - 1][qy] - A[qx][py - 1];
}
int dfs(int px, int py, int qx, int qy) {
if (ranged(px, py, qx, qy) == 0... | ALGO | 0.999535 | 4.217615 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:34: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": "4848f8ec00af... |
c4a32e22-bca8-432a-85c7-117014215073 | Zlin0509/Zlin_ACM | _CF/GYM/The 2024 ICPC Kunming Invitational Contest/J.cpp | //
// Created by Zlin on 2024/10/5.
//
#include "bits/stdc++.h"
using namespace std;
typedef double db;
typedef long double ldb;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<long long> vll;
typedef pair<int, int> pii;
typedef pair<long long, long long> pll;
const int ... | ALGO | 0.99999 | 5.10404 | {
"github_metadata": {
"branch": "main",
"commit_count": 170,
"repo_created_at": "2024-08-16T08:10:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "00657c17e2... |
e234a863-ac33-4b02-b03e-8bdf09c0b561 | ankitsharma1530/Weekly-Contest | 1324. Print Words Vertically.cpp | class Solution {
public:
vector<string> printVertically(string s) {
vector<string>res;
string temp = "";
int len = 0;
for(int i=0;i<s.length();i++)
{
if(s[i]!=' ')
{
temp.push_back(s[i]);
}
else
{
... | ALGO | 0.999981 | 5.214878 | {
"github_metadata": {
"branch": "main",
"commit_count": 368,
"repo_created_at": "2021-01-19T14:46:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9d244fc0f8... |
d6cc9d26-4ca0-463d-aa1b-a8418b2bf90f | MAZHARMIK/Interview_DS_Algo | strings/Detect Capital.cpp | /*
MY YOUTUBE VIDEO ON THIS Qn : https://www.youtube.com/watch?v=DrVLI_NXaic
Company Tags : GOOGLE
Leetcode Link : https://leetcode.com/problems/detect-capital/
*/
//Approach-1 (Simple Checks)
//NOTE : YOU can also use isupper() C++ function to check capital
class Solution {
p... | ALGO | 0.999453 | 5.960227 | {
"github_metadata": {
"branch": "master",
"commit_count": 5946,
"repo_created_at": "2020-07-12T13:13:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2586,
"forks": 1357,
"issues": 7,
"pull_requests": 37
},
"file_meta": {
"content_id": "... |
055cf298-a753-4840-942c-a09846e1d9ee | SFTtech/openage | libopenage/datastructure/pairing_heap.h | // Copyright 2014-2025 the openage authors. See copying.md for legal info.
#pragma once
/** @file
* This file contains the implementation of a pairing heap.
* It is a priority queue with near-optimal runtime.
*
* The main advantage over the STL heap is the presence
* of the decrease_key operation.
*
* Literatu... | ALGO | 0.990399 | 7.090345 | {
"github_metadata": {
"branch": "master",
"commit_count": 5803,
"repo_created_at": "2013-11-03T22:35:23.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 13711,
"forks": 1201,
"issues": 196,
"pull_requests": 10
},
"file_meta": {
"content_id":... |
6f85d248-2f70-4340-9f4c-995099346677 | zhangxin0518/learning-cpp | string.cpp | #include <iostream>
#include <string>
#include <cctype>
char *a = "love";
int main(int argc, char **argv)
{
//1-定义与初始化sring对象
std::string s1; //默认初始化,s1是一个空字符串
std::string s2(s1); //s2是s1的副本, 或者拷贝初始化: string s2 = s1;
std::string s3("zhangxin"); //s3是该字符串字面值的副本,或者拷贝初始化: string s3 = "zhangxin";
std:... | TOOL | 0.949256 | 3.560723 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2019-06-06T08:36: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": "b88448f94... |
a5df2015-71d1-4178-b00f-4718690c796e | tonywang663/interview | medianoftwosortedarray.cpp | #include <iostream>
#include <vector>
#include <cassert>
#include <algorithm>
using namespace std;
void findMedianSortedArrays(int A[], int m, int B[], int n) {
// Start typing your C/C++ solution below
// DO NOT write int main() function
}
int ksmallestintwosortedarray(int A[], int m, int B[], int n... | ALGO | 0.999973 | 4.001205 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2013-08-15T21:46: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": "76a51f516b... |
06c825e2-56f9-4f7d-a1e3-d8d920932a29 | HSA-Libraries/Bolt | include/bolt/amp/detail/transform_scan.inl | /***************************************************************************
* © 2012,2014 Advanced Micro Devices, Inc. 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 Licen... | ALGO | 0.990288 | 4.879706 | {
"github_metadata": {
"branch": "master",
"commit_count": 706,
"repo_created_at": "2012-10-16T15:56:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 373,
"forks": 64,
"issues": 19,
"pull_requests": 5
},
"file_meta": {
"content_id": "b637... |
d63f201e-e77b-4572-8739-6c5be964a8e8 | TareqAlKushari/Search-Engine-Project-for-Data-Structures | Queue.h | #include <iostream>
#include <vector>
#include <string>
#include <chrono>
using namespace std;
// A class template for dynamic queues using vector
/// @brief
/// @tparam T
template <class T>
class DynamicQueue {
private:
vector<T> data; // The underlying vector to store the elements
int size; /... | ALGO | 0.999252 | 3.62309 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-11-29T02:12:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "be84a39f8502... |
0690a3c3-1526-4f94-b919-c124e55a2aba | MVPatM/Solved | Code/13223.cpp | /* using namespace std를 사용함에 따라서 end의 variable를 선언하는 것은
모호함을 만들어 낼 수 있다.
*/
/*
<string> library에 to_string 함수는 int형 값을 string으로 바꾸어 준다.
*/
#include <iostream>
#include <cstring>
#include <string>
using namespace std;
#define fastio ios_base::sync_with_stdio(0), cin.tie(0)
//string now, finish;
string now, finish;
v... | ALGO | 0.999136 | 3.853816 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2021-01-17T08:34: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": "517a6f330bc... |
4b29a718-ce49-44f6-9fdb-4ff2218e6c89 | AliOsm/CompetitiveProgramming | CodeForces/898C. Phone Numbers.cpp | #include <bits/stdc++.h>
typedef long long ll;
using namespace std;
int n;
map<string, vector<string> > mp;
vector<string> tmp;
set<string> sol;
int main() {
cin >> n;
string name, cur;
int ent;
for(int i = 0; i < n; ++i) {
cin >> name >> ent;
for(int j = 0; j < ent; ++j) {
cin >> cur;
mp[name].push_... | ALGO | 0.999921 | 3.666987 | {
"github_metadata": {
"branch": "master",
"commit_count": 595,
"repo_created_at": "2016-10-14T11:29:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 138,
"forks": 49,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "92e2f... |
0bf84a42-f36a-4e92-8d24-2483422bd4ab | azabrod1/ParallelTarjan | Tarjan Code/multiThreadedTarjan.cpp | //
// multiThreadedTarjan.cpp
// Tarjan
//
// Created by <NAME> on 4/30/17.
// Copyright © 2017 <NAME>. All rights reserved.
//
#include "multiThreadedTarjan.hpp"
#include "tarjan.hpp"
#include <thread>
#include <stdio.h>
#include <chrono>
#include <iostream>
MultiThreadedTarjan::~MultiThreadedTarjan(){;}
SCC_... | ALGO | 0.995642 | 5.404877 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2021-01-03T01:03:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "703716f25338... |
d73a3bae-722d-44c6-bfca-feceabb5db46 | SA-K1B/Problem-Solving | Codeforces Contest/round 696 div 2/b.cpp | #include<bits/stdc++.h>
#define ll long long int
#define db double
#define pb push_back
#define mp make_pair
#define Max 10000000000000000
#define Min -10000000000000000
#define gcd(a, b) __gcd(a, b)
#define lcm(a, b) (a * (b / gcd(a, b)))
using namespace std;
bool cmp(pair<ll,ll>a,pair<ll,ll>b){
return a.second<b.s... | ALGO | 0.999876 | 3.747877 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2024-07-10T18: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": "74d2f76f5... |
d8a17707-7ae1-4b31-a596-36a50ea013c1 | plKamilPawlik/MD5 | main.hpp | #ifndef MAIN_HPP
#define MAIN_HPP
/* * * * * * * * * * * * * * * * * * * * */
// regular libs
#include <iostream>
#include <cstring>
#include <fstream>
#include <vector>
#include <thread>
#include <mutex>
// signals
#include <signal.h>
// hash utilities
#include <openssl/... | ALGO | 0.980184 | 3.845155 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2022-01-02T12:09: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": "f1c4f82fde... |
759f16e3-49f5-4c02-b276-5a1036a34d42 | dariudrew/TG | TG/dijkstra/dijkstra2.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <queue>
#include <limits>
#include <cstring>
#include <sstream>
using namespace std;
struct Aresta {
int v1, v2, peso;
};
struct Grafo {
int n, m;
vector<vector<pair<int, int>>> adj; // Lista de adjacência
};
// Função de leitura do grafo... | ALGO | 0.999933 | 5.819925 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-11-15T02:31: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": "6332f086ded5... |
9bd2bc72-ac08-4386-b791-fab7fc304b31 | yusufab/CPP-Project | matrix_determinant_calculator.cpp | #include <iostream>
#include <cmath>
using namespace std;
const int COLUMNS = 4;
void Get_Matrix(double temp[][COLUMNS], int n){
if (n == 2){
double elm1, elm2, elm3, elm4;
cout << "So you want to create a two by two matrix." << endl;
cout << "Let's input the entries of the matrix." << end... | ALGO | 0.997874 | 4.064226 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2023-10-01T18:36: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": "1fe01f3b6970... |
60a15086-00c7-45a0-add7-9d202fcc0f9f | Akrielz/Algorithms | Graph/Tree Graph/Tree Diameter.cpp | /*
* Input: A list with the edges of the tree
* Output: Tree's diameter
* Complexity: O(n), where n = len(nodes)
*/
#include <vector>
#include <queue>
#include <memory>
#include <fstream>
using namespace std;
ifstream fin ("darb.in");
ofstream fout ("darb.out");
const int N = 1e5+1;
vector <int> edges[N];
que... | ALGO | 0.997754 | 3.777342 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2020-12-30T15:42:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ce567ada9630... |
0aa250ed-7132-4b6e-9705-2e3bf40840f9 | Mandeep-017/Operating-System-LINUX- | Mutual Exclusion using monitor.cpp | #include <iostream>
#include <thread>
#include <mutex>
#include <condition_variable>
#include <vector>
class Monitor {
private:
std::mutex mtx;
std::condition_variable cv;
bool in_use;
public:
Monitor() : in_use(false) {}
void enter() {
std::unique_lock<std::mutex> lock(mtx);
cv.w... | ALGO | 0.989443 | 5.767869 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2024-06-16T13:09: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": "be295dd4781... |
077710a8-3c10-47be-ad9a-adffd9fb018d | Ziklon/algorithms | tc/testprograms/SnakeCount.cpp | #include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <utility>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cstring>
using namespace std;
#define REP(... | ALGO | 0.999227 | 4.592419 | {
"github_metadata": {
"branch": "master",
"commit_count": 37,
"repo_created_at": "2012-12-28T20:25:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "994ee5da3... |
b38bb093-0622-42bf-a688-25c75de7060f | nasa/trick | trick_source/er7_utils/integration/euler/include/euler_second_order_ode_integrator.hh | /**
* @if Er7UtilsUseGroups
* @addtogroup Er7Utils
* @{
* @addtogroup Integration
* @{
* @endif
*/
/**
* @file
* Defines the class EulerSecondOrderODEIntegrator, which integrates a state
* comprising a zeroth derivative / first derivative pair via Euler's method.
*/
/*
Purpose: ()
*/
#ifndef ER7_UTILS_EU... | ALGO | 0.936348 | 7.658428 | {
"github_metadata": {
"branch": "master",
"commit_count": 2287,
"repo_created_at": "2015-02-17T16:17:32.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 87,
"forks": 38,
"issues": 130,
"pull_requests": 12
},
"file_meta": {
"content_id": "31a... |
12c75393-a292-4837-891b-d608683ced24 | bahvalo/ColESo | src/es_source.cpp | // *********************************************************************************************************************
// ***** *****
// ***** Collection of exact solutions (ColES... | ALGO | 0.998319 | 5.425139 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2020-10-14T10:44:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "acd97dfa7... |
5748edeb-c919-4451-a5dd-b8e490cbd9d4 | dcampora/cpp11 | concurrency/cond_var.cpp | #include <iostream> // cout, endl
#include <condition_variable> // conditon_variable
#include <mutex> // mutex, unique_lock, lock_guard
#include <thread> // thread
using std::cout; using std::endl;
std::mutex mutex;
std::condition_variable condition;
int question = -1;
int answer =... | ALGO | 0.998136 | 5.448761 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2015-03-23T10:58: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": "42c5126d15... |
cae0ce36-94d6-4619-b08b-512473fe95ef | Victrid/undergraduate-course-projects | CS158-homework/SJTUOJ/4240.cpp | #include <cstdio>
#include <iostream>
using namespace std;
//barrel sort
//assume no duplicat.
//NO WA please🙏
bool barrel[4000010] = {0};
// int barrelblock[4001] = {0};
int main() {
int n, proc;
scanf("%d", &n);
while (n--) {
scanf("%d", &proc);
barrel[2000005 + proc] = 1;
/* ++b... | ALGO | 0.999907 | 3.744577 | {
"github_metadata": {
"branch": "master",
"commit_count": 930,
"repo_created_at": "2025-02-23T12:58:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f25f9cbf... |
1ccdf9a2-43eb-4eff-8a66-bf76a2b760b3 | VVZzzz/DataStructure-Algorithms | DataStructure-Algorithms/DataStructure-Algorithms/Ch9practice.hpp | #pragma once
#include <vector>
#include <string>
#include <iostream>
#include <fstream>
using namespace std;
const int INFINTY = 99999;
struct Vertex {
vector<int> adj; //邻接表
vector<int> weight; //自身到其邻接点的距离,即c(v,w)
bool known;
int dist; //s到该点的距离
string name;
int path; //父路径
};
void printPath(int vInd... | ALGO | 0.998262 | 3.823403 | {
"github_metadata": {
"branch": "master",
"commit_count": 84,
"repo_created_at": "2018-06-08T09:16:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "474ed8ae0... |
ab04ebb5-3c8e-4e76-80f2-b70338817b24 | MalikaDenis/tpChemin | tpChemin.cpp | #include <iostream>
#include <deque>
#include <cstdlib>
#include <cmath>
static bool destinationReached = false;
struct Point
{
Point(int _x, int _y) :x(_x), y(_y)
{}
int x = 0;
int y = 0;
bool passable = true;
bool person = false; //verifie si le joueur est sur cette case
bool dest = fal... | ALGO | 0.995779 | 3.596708 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-07-04T10:30: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": "63812504f4e7... |
e6dc8cb3-c7c8-4308-932f-102f83943d9b | serzaxlucifer/Leetcode | binary search/Logic Building (same as Advanced)/1898. Maximum Number of Removable Characters.cpp | // What needs to be realized here is that we can use Binary Search to improve brute force (one by one remove elements as in removable array and check if 'p' is still a subsequence of 's') into
// logarithmic time complexity. We need to count fro beginning of removables vector. That means try checking middle first. If a... | ALGO | 0.999916 | 5.97353 | {
"github_metadata": {
"branch": "main",
"commit_count": 379,
"repo_created_at": "2023-01-09T20:01:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ac078f3ebc... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.