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 |
|---|---|---|---|---|---|---|---|
8f36164d-84ac-4dfb-bc56-f39bd5db11a9 | lds217/lds | DTQG/hcn.cpp | // Template //
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#incl... | ALGO | 0.995417 | 4.652511 | {
"github_metadata": {
"branch": "main",
"commit_count": 29,
"repo_created_at": "2023-04-05T19:12:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4fc96eacd50... |
6b5d7787-1aad-4c93-b1c5-52dfd36d8216 | alexds2002/CherryEngine | sandbox/algorithms/graph_algorithms.h | #include <stack>
#include <unordered_map>
#include <unordered_set>
namespace CherryMath
{
// acyclic graphs -> no cycles, also they are directed graphs
inline void dfs_stack(std::unordered_map<char, std::vector<char>>& graph, char starting_node)
{
std::stack<char> nodes;
std::unordered_set<char> visited;
... | ALGO | 0.999823 | 5.513519 | {
"github_metadata": {
"branch": "main",
"commit_count": 121,
"repo_created_at": "2024-06-25T21:15: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": "dd91ba1f26... |
3ffac566-bfdb-47c9-8f56-b1dc66d5adbd | developer-ravi-03/100-day-dsa-challange | day-05/Searching Algo/03_Binary_search_with_recursion.cpp | // Binary Search with recursion
// it works on sorted array
// TC- O(log n)
// SC- O(1)
#include <iostream>
using namespace std;
int BinarySearch(int arr[], int target, int st, int end)
{
if (st <= end)
{
int mid = st + (end - st) / 2;
if (target < arr[mid])
return BinarySearch(arr, target, st, mid -... | ALGO | 0.999963 | 5.917544 | {
"github_metadata": {
"branch": "main",
"commit_count": 228,
"repo_created_at": "2025-05-14T10:29: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": "712e29d350... |
71b85647-f911-4830-9419-1258e291ccf2 | sid6932/DS-Algos | Ds&algos/CF79B.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
int n,m,k,t;
cin >> n >> m >> k >> t;
int x;
int y;
vector<pair<int,int>> v;
while(k--){
cin >> x >> y;
v.push_back({x,y});
}
sort(v.begin(),v.end());
for(auto i :... | ALGO | 0.999965 | 3.662071 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2022-03-29T17:44: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": "a26df66a3a1... |
213127d2-4034-458c-a46f-af4d25a1f023 | 25kudit/DSA-CP | C_Fighting_Tournament.cpp | #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;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
#define int long long
#define float long double
#define endl "\n"
#... | ALGO | 0.999953 | 3.442515 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2023-07-19T13:22:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a1cbc2ae016... |
fa0dcf14-8d20-48be-a489-519442e05d56 | CodeSrushti-3105/Data-Communication-and-Network | subnet.cpp | #include <iostream>
#include <cmath>
#include <bitset>
#include <string>
using namespace std;
// Function to convert CIDR to Subnet Mask
string cidrToSubnetMask(int cidr)
{
unsigned int mask = 0xFFFFFFFF << (32 - cidr);
string subnet = to_string((mask >> 24) & 0xFF) + "." +
to_string((mask... | TOOL | 0.946446 | 5.277004 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2025-05-28T11:15: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": "c9f9a4226b7... |
b4ee8918-6a9d-4a86-bc5f-6fc4f5d285e1 | vohrahul/ML-ang-coursera | Octave/octave-4.2.1/include/octave-4.2.1/octave/qrp.h | /*
Copyright (C) 1994-2017 <NAME>
Copyright (C) 2009 VZLU Prague
This file is part of Octave.
Octave is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 3 of the License, or (at your
option) any late... | TOOL | 0.914754 | 4.96915 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-10-16T12:26: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": "097f1422c1... |
48421c45-e064-4c39-af4b-7d1a7fc7d260 | ai-sprint-eu-project/GPUScheduler | src/random_greedy.cpp | // Copyright 2020-2021 <NAME>
//
// 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 writin... | ALGO | 0.998551 | 5.27872 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-12-11T09:48:03.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b9cff658dc898... |
e5b60b9e-333a-487b-a917-e2f99c21d189 | TM-DEV-PRO/DSA-CP | funtion-snippets/leetcode/medium/tree/two-trees-in-list.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999997 | 6.028111 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2022-06-18T08:20: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": "250844de1965... |
bf07d19e-fdbe-4995-ab74-bbae0262b99e | DIPlib/diplib | src/detection/hough.cpp | /*
* (c)2017, <NAME>
*
* 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, ... | ALGO | 0.998518 | 4.457873 | {
"github_metadata": {
"branch": "master",
"commit_count": 2699,
"repo_created_at": "2017-03-21T04:07:31.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 245,
"forks": 53,
"issues": 17,
"pull_requests": 1
},
"file_meta": {
"content_id": "c989... |
44dae64a-ef8b-49f4-a9dd-5f007f3250f7 | Kenyon-CS/kenyondatastructures2024-web-words-in-class-CountWebpageWords | word_count.cpp | #include <iostream>
#include <map>
#include <vector>
#include <algorithm>
#include <string>
#include <sstream>
#include <cctype>
#include <curl/curl.h>
using namespace std;
// Callback function to write data received from curl
size_t WriteCallback(void* contents, size_t size, size_t nmemb, void* userp) {
((string... | ALGO | 0.996762 | 6.626217 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-09-25T20:45:30.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c2137f809adf2... |
859fa896-5062-4565-bd24-a39c7201c75e | humanbeeng/competitive-programming | UVa/514_Rails.cpp | /*
Author : humanbeeng
*/
#include <bits/stdc++.h>
using namespace std;
#define fo(i, n) for (int i = 0; i < n; i++)
#define pb(num) push_back(num)
#define ppb pop_back()
#define all(arr) arr.begin(), arr.end()
#define pi(arr) for(int i=0; i<sizeof(arr)/sizeof(arr[0]); i++) cout << arr[i] << ' '
#define imn INT_MIN
#de... | ALGO | 0.999339 | 3.217543 | {
"github_metadata": {
"branch": "master",
"commit_count": 170,
"repo_created_at": "2021-02-05T11:04:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cedc4427... |
d4c93667-c3ab-44be-abbd-df1e4c8d86ef | ishandutta2007/codeforces-nonalphabetic | -...-/normal/1654/D.cpp | #include<bits/stdc++.h>
using namespace std ;
#define ll long long
#define pb push_back
#define all(v) v.begin(),v.end()
#define sz(a) (ll)a.size()
#define F first
#define S second
#define INF 2000000000000000000
#define popcount(x) ... | ALGO | 0.9998 | 5.138861 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:49:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "09087401ff38... |
557d6dfe-12a8-48d4-a24a-8726f4e255b1 | AbdulMalek-swe/algorithm_problem_solving | custom_sort/frequency_sort_with_custom.cpp | #include <bits/stdc++.h>
using namespace std;
class Frequency
{
public:
int count;
char ch;
};
bool cmp(Frequency a, Frequency b)
{
if (a.count == b.count)
{
return a.ch < b.ch;
}
else
return a.count > b.count;
}
int main()
{
string s;
cin >> s;
Frequency freq[100];
... | ALGO | 0.999974 | 4.064608 | {
"github_metadata": {
"branch": "main",
"commit_count": 25,
"repo_created_at": "2024-05-11T13:28: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": "e6843231175... |
e01e80ea-8c1b-43a0-8d15-f40044c96b1e | purisaurabh/Codeforces-Problem | nearly_lucky_number.cpp | /*
Petya loves lucky numbers. We all know that lucky numbers are the positive integers whose decimal representations contain only the
lucky digits 4 and 7.
For example, numbers 47, 744, 4 are lucky and 5, 17, 467 are not.
*/
/*
inputCopy
40047
outputCopy
NO
inputCopy
7747774
outputCopy
YES
inputCopy
100000000000000... | ALGO | 0.999732 | 4.286065 | {
"github_metadata": {
"branch": "main",
"commit_count": 37,
"repo_created_at": "2022-06-02T18:25:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8e584bc6d8a... |
de70a913-5a25-4f34-a26b-8874ad55bff2 | rjenez/W266-final-project | data/programming-homework-dataset-plagiarism-detection/src/B2016/Z1/Z3/student9931.cpp | #include<iostream>
#include<vector>
#include<iomanip>
#include<stdexcept>
#include<cmath>
std::vector<std::vector<double>>RastuciPodnizovi(std::vector<double>vektor){
std::vector<std::vector<double>>matrica ;
std::vector<double>testnivektor ;
for (int i = 0; i < vektor.size()-1; i++) {
if(vektor[i]... | ALGO | 0.999741 | 4.794677 | {
"github_metadata": {
"branch": "main",
"commit_count": 125,
"repo_created_at": "2022-02-09T00:45:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bada016a0e... |
d9e5cf70-9497-4193-9620-ade81c20ba66 | Epicmouse00/SP3-Team-D4 | Base/Source/Scene2D/Strategy_Shoot.cpp | #include "Strategy_Shoot.h"
#include <iostream>
using namespace std;
/********************************************************************************
Constructor
********************************************************************************/
CStrategy_Shoot::CStrategy_Shoot()
{
SetType(E_STRATEGY_SHOOT);
bounce ... | TOOL | 0.96195 | 5.189805 | {
"github_metadata": {
"branch": "master",
"commit_count": 360,
"repo_created_at": "2019-08-14T07:19: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": "360c3c4b... |
dabe1541-8161-4220-ae94-250a804e078b | zhenglab/Analytic-ICP | Analytic_ICP/algorithm/ICP/icpPointToPlane.cpp | /*
Copyright 2011. All rights reserved.
Institute of Measurement and Control Systems
Karlsruhe Institute of Technology, Germany
Authors: <NAME>
libicp is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
Foundation; either versi... | ALGO | 0.998542 | 5.174292 | {
"github_metadata": {
"branch": "main",
"commit_count": 69,
"repo_created_at": "2024-02-22T06:18:28.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "73e8131e0e62... |
5d5f67fd-94e1-49bb-8f71-f578956b3550 | zhan2030/leedcode | 004 LongestCommonPrefix.cpp | //14. Longest Common Prefix
//Write a function to find the longest common prefix string amongst an array of strings.
//If there is no common prefix, return an empty string "".
//Example 1:
//Input: ["flower","flow","flight"]
//Output: "fl"
//Example 2:
//Input: ["dog","racecar","car"]
//Output: ""
//Explanation: Ther... | ALGO | 0.99973 | 5.606643 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2018-12-02T00:49: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": "a3b7faa45... |
38cb36b5-8905-4e64-939c-a223eefd23cb | SeoHyungjun/Coding_Test | algorithm/certi/D3/회문1/회문1.cpp | #include <iostream>
#include <string>
int main(int argc, char** argv) {
std::ios_base::sync_with_stdio(0); std::cin.tie(0); std::cout.tie(0);
int test_case, N, i, j, k, answer;
std::string board[8], print_answer = "";
bool is_palindrome;
for(test_case = 1; test_case <= 10; ++test_case) {
answer... | ALGO | 0.998397 | 3.844192 | {
"github_metadata": {
"branch": "master",
"commit_count": 1091,
"repo_created_at": "2020-12-16T11:45: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": "c6d1985... |
f6602ab2-0f56-4395-b047-745c56cf30cd | minhngkh/Algos | src/algorithms.cpp | #include "algorithms.hpp"
void Swap(int &num1, int &num2) {
int temp = num1;
num1 = num2;
num2 = temp;
}
// Selection sort
void SelectionSortWithoutCounting(int arr[], int n) {
for (int i = 0; i < n - 1; ++i) {
int cur_min = i;
for (int j = i + 1; j < n; ++j)
if (arr[cur_m... | ALGO | 0.999423 | 5.366843 | {
"github_metadata": {
"branch": "main",
"commit_count": 39,
"repo_created_at": "2022-06-08T15:00: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": "e73c1c505e4... |
0d7e3fec-3e03-4d27-9084-9739c50c295c | Hadeso-0/DSA-Practice | longest-valid-parentheses/longest-valid-parentheses.cpp | class Solution {
public:
int longestValidParentheses(string s) {
int ans = 0;
int n = s.size();
int cur = 0;
int j = -1;
for(int i=0; i<n; i++){
if(s[i] == '(') cur++;
else if(s[i] == ')') cur--;
if(cur < 0){
cur = 0;
... | ALGO | 0.999653 | 5.40027 | {
"github_metadata": {
"branch": "main",
"commit_count": 1177,
"repo_created_at": "2022-12-16T12:51: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": "b54acf82f... |
c322a9a8-99ce-4889-b725-3f8809737d88 | Growlingfern/Hackerrank | 30 Days of Code (C++)/Day 6 Let's Review.cpp | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main() {
int T = 0;
string s1;
string s2;
//how many test cases are there?
cin >> T;
cin >> s1;
cin >> s2;
for(int i = 0; i < s1.length... | ALGO | 0.999931 | 3.615383 | {
"github_metadata": {
"branch": "master",
"commit_count": 22,
"repo_created_at": "2018-03-08T18:44:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "77b16a49e... |
7463f226-9d77-44bb-8657-f9f38ca23ca3 | r-mutax/tenkei90 | 067.cpp | #include <iostream>
#include <vector>
#include <deque>
#include <queue>
#include <string>
using namespace std;
string tostr(long long n){
string ans;
deque<char> q;
while(n > 0){
long long m = n % 9;
q.push_back(m + '0');
n = n / 9;
}
while(q.size()){
ans += q.back(... | ALGO | 0.999606 | 4.283194 | {
"github_metadata": {
"branch": "master",
"commit_count": 27,
"repo_created_at": "2023-03-01T23:02:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d0915bf12... |
f57fdacf-76aa-456c-b81b-cfd3bbf32156 | Atrix256/ProgressiveProjectiveBlueNoise | main.cpp | #include <stdio.h>
#include <vector>
#include <array>
#include <random>
#include <string>
#include <stdint.h>
#include <stdarg.h>
#include "image.h"
#include "raytrace.h"
#include "AO.h"
#include "SSAO.h"
#define STB_IMAGE_WRITE_IMPLEMENTATION
#define STBI_MSC_SECURE_CRT
#include "stb_image_write.h"
#define STB_IMAG... | ALGO | 0.970869 | 5.754252 | {
"github_metadata": {
"branch": "master",
"commit_count": 88,
"repo_created_at": "2018-10-23T03:04:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fb8321d2e... |
061c8e48-6ed0-494b-baca-ea220c4caa84 | DavidMWu/computerScienceClass | Chapter 13/tortureWithNodes/tortureWithNodes/list.h | #ifndef LIST_H
#define LIST_H
#include "nodes/node.h"
class list
{
//fix _copy
//do copy constructor
//do = operator
public:
//constructors
list();
list(node* head);
list(const list& other); //BIG 3:copy constructor (DONE!)
list(ITEM_TYPE input);
~list();//BIG 3:destructor (DONE!)... | TOOL | 0.966786 | 4.310876 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2015-03-30T20:36: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": "229cca80c... |
0548a182-2f6b-4ab9-90f2-bfa1dd27c79e | lballabio/QuantLib | ql/pricingengines/greeks.cpp | /* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
Copyright (C) 2005 StatPro Italia srl
This file is part of QuantLib, a free-software/open-source library
for financial quantitative analysts and developers - http://quantlib.org/
QuantLib is free software: you can redistribute it ... | ALGO | 0.947746 | 6.494193 | {
"github_metadata": {
"branch": "master",
"commit_count": 17543,
"repo_created_at": "2015-12-17T16:29:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6151,
"forks": 1964,
"issues": 51,
"pull_requests": 11
},
"file_meta": {
"content_id":... |
56d51548-ade7-4486-aee4-69f12af77044 | daepoid/algorithm-study | baekjoon/11000/11800.cpp | #include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iostream>
#include <queue>
#include <string>
#include <vector>
using namespace std;
char str[6][10] = {"Yakk", "Doh", "Seh", "Ghar", "Bang", "Sheesh"};
int main() {
int n;
scanf("%d", &n);
fo... | ALGO | 0.999884 | 3.392064 | {
"github_metadata": {
"branch": "main",
"commit_count": 116,
"repo_created_at": "2021-04-14T08:40: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": "8a878f396e... |
6639b0f5-6ed5-49c6-880c-ec111c9e5b6c | DionysiosB/CodeForces | 0500-0599/549B-LookseryParty.cpp | #include <iostream>
#include <vector>
int main(){
std::ios_base::sync_with_stdio(false);
int n; std::cin >> n;
std::vector<std::vector<bool> > g(n, std::vector<bool>(n, 0));
for(int row = 0; row < n; row++){
std::string s; std::cin >> s;
for(int col = 0; col < s.size(); col++){g[row][... | ALGO | 0.999902 | 3.371067 | {
"github_metadata": {
"branch": "master",
"commit_count": 4487,
"repo_created_at": "2013-06-27T18:15:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 690,
"forks": 163,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "75c... |
2dbf9e30-e5a9-4d62-83b3-3a249c5429d0 | Romelai28/competitive-programming | notebook/searching/binary_search.cpp | // Asumiento que quiero hacer una busqueda binaria en el rango [0, n)
// Importante: chequear el indice porque en caso de que no exista elemento que cumple P(X) puede haber problemas
// Encontrar el indice del elemento v en el array A ordenado
int binarySearch(int start, int end, vector<ll> &A, ll v){
if (start > ... | ALGO | 0.999962 | 4.300021 | {
"github_metadata": {
"branch": "main",
"commit_count": 150,
"repo_created_at": "2024-07-12T22:49: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": "cf73834407... |
d14b36f6-6383-414e-bac9-f70abc10bbeb | raincross7/code-similarity | codes/train_code/problem441/problem441_141.cpp | #include <algorithm>
#include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <limits>
#include <functional>
using namespace std;
int f(long long A, long long B)
{
int a = 1, b = 1;
while (A >= 10)
{
a++;
A = A / 10;
}
while (B >= 10)
{
b++;
... | ALGO | 0.99986 | 4.318323 | {
"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": "d44fdbd9b637... |
639cdde0-6da2-4cd2-9fed-35b6613f925c | Shahriar-Rahi/MyCodes | AllSort.cpp | #include<bits/stdc++.h>
#include<iostream>
#include<ctime>
#include<algorithm>
using namespace std;
void insertionSort(int *arr, int n);
int partition(int *arr, int start, int end);
void quickSort(int arr[], int start, int end);
void heapSort(int arr[], int n);
void heapify(int arr[], int n, int i);
int main(){
int ... | ALGO | 0.999466 | 4.712412 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2017-08-23T20:42: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": "ad70a0656... |
054c76da-fc56-4b49-acdb-6b2cc32ead14 | intel-iot-devkit/FRD-CV-Demo-Pedestrian-Detection | src/algorithms/hog_ocl_fpga.cpp | #include "hog_ocl_fpga.hpp"
#include "AOCLUtils/aocl_utils.h"
#define SCALE_GRAN 256
#define NBINS 9
#define BLOCK_SIZE 2
#define CELL_SIZE 8
#define BLOCK_HIST (NBINS * BLOCK_SIZE * BLOCK_SIZE)
#define HIT_THRESHOLD 0.01
#define CONF_LIMIT 20
#define INTERSECT_THRESHOLD 0.5
using namespace aocl_utils;
using namespa... | ALGO | 0.996878 | 6.161116 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2017-09-07T01:36:01.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 7,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "912f1a8da72... |
d0a26c4d-7b2c-4a6a-a03f-d99cdfa55ceb | vansirect/LearnDSA | DSAN/Mergesort.cpp | #include<iostream>
#include <vector>
using namespace std;
/*
How merge sort works is you divide an array into individual elements and put it back together
eg 4 9 6 8 2
split into 49 and 682 then 49- 4 and 9 , 682 - then 68 and 2 and 68 - 6 and 8
merge 4 and 9 back to 49 since its in order , same with 68
... | ALGO | 0.999958 | 5.555303 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2024-12-18T16:28:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a2901f96b... |
d5cdf0b7-fa3d-4573-99b9-edfaea06a7c7 | paramkansagra/CPP-codes | DSA/Binary Tree/BinaryTree_ReverseLevelOrderTraversal.cpp | #include <iostream>
#include <queue>
using namespace std;
class Node{
public:
int data;
Node* left;
Node* right;
Node(int data){
this->data = data;
this->left = NULL;
this->right = NULL;
}
};
// we would be using queue for traversing th... | ALGO | 0.999977 | 4.735707 | {
"github_metadata": {
"branch": "master",
"commit_count": 35,
"repo_created_at": "2022-02-06T05:02: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": "49e6a9a96... |
2578a75b-b91e-4dbb-be09-ea103072e724 | AppledoreM/OI | PastFiles/Practice/Ideas/codeforces1028D.cpp | #include "stdafx.h"
#include <iostream>
#include <stdio.h>
#include <string>
#include <cstring>
#include <algorithm>
#include <map>
#include <vector>
#include <set>
using namespace std;
const int maxn = 4e5 + 10;
typedef pair<int, int> pii;
int n, tree[maxn << 2], tag[maxn << 2], tot, L, H;
const int mod = 1e9 + 7;
se... | ALGO | 0.999973 | 3.99085 | {
"github_metadata": {
"branch": "master",
"commit_count": 175,
"repo_created_at": "2018-08-02T09:00:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "21bd449f... |
f70f2429-ce09-4dff-b58d-8cab93286b71 | BinZlP/StackCalculator | StackCalculator.cpp | // 2017203044 <NAME>
#include <iostream>
#include <fstream>
#include <vector>
#include <stack>
#include <string>
char operationAt[3][3] = { { 'a','b','c' },{ 'b','c','a' },{ 'c','a','b' } };
char operationSharp[3][3] = { { 'a','c','b' },{ 'b','a','c' },{ 'c','b','a' } };
char operationAnd[3][3] = { { 'a','a','a' },{ ... | ALGO | 0.999927 | 4.550766 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2018-12-23T06:53: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": "3d841f2612... |
d5ecc017-51d0-4e60-8365-4d2cd4b8d676 | ftErSandeepYadav/CP-SIGMA-CODES | CP files/CSES DP/countin towers.cpp | // Problem: Counting Towers
// Contest: CSES - CSES Problem Set
// URL: https://cses.fi/problemset/task/2413
// Memory Limit: 512 MB
// Time Limit: 1000 ms
//
// Powered by CP Editor (https://cpeditor.org)
#include<bits/stdc++.h>
using namespace std;
#define fast (ios_base::sync_with_stdio(false), cin.tie(NULL))
#def... | ALGO | 0.999903 | 4.710566 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-03-08T16:30: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": "9d0c0eaf5cce... |
b20b238d-3ea4-421c-88c9-9eee33666f01 | liuriloami-zz/competitive-programming | URI/1845.cpp | #include <bits/stdc++.h>
using namespace std;
int main (int argc, char** argv) {
char ch;
bool bef = false;
while ((ch = getchar()) != EOF) {
if (ch == 's' || ch == 'j' || ch == 'b' || ch=='z' || ch=='p'
|| ch=='v' || ch=='x') {
ch = 'f';
} else if (ch == 'S' || ch == 'J' || ch == 'B' || ... | ALGO | 0.999418 | 3.764456 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2015-11-10T14:36:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "64125adbe... |
3e4de496-4151-455e-8484-720381572ec1 | Arunvenkatesh7/Crypto-Mobile-Computing | Ciphers/HillCipher2.cpp | #include <bits/stdc++.h>
using namespace std;
void printMatrix(vector<vector<int>> &matrix){
for(int row=0;row<matrix.size();row++){
cout<<"+---+---+---+"<<endl;
cout<<"| ";
for(int col=0;col<matrix[row].size();col++){
cout<<matrix[row][col]<<" | ";
}
cout<<en... | ALGO | 0.999952 | 4.260978 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2024-08-21T08:06:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0e04f6f5992c... |
67d66d3c-d585-4eb8-8c8f-13c6630e43a0 | Rajveer100/CSES-ProblemSet | DynamicProgramming/RemovingDigits.cpp | //
// main.cpp
// CompetitiveProgramming
//
// Created by <NAME> on 14/01/20.
// Copyright © 2020 <NAME>. All rights reserved.
//
#include <algorithm>
#include <array>
#include <chrono>
#include <cstring>
#include <ctime>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#in... | ALGO | 0.999914 | 5.892493 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2021-08-22T10:04: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": "036671178911... |
142d46b4-88e7-4830-a7c4-6a59f1c2617d | kloetzl/mugsy | mugsy-seqan/projects/library/seqan/find/find_shiftand.h | /*==========================================================================
SeqAn - The Library for Sequence Analysis
http://www.seqan.de
============================================================================
Copyright (C) 2007
This library is free software; you ... | ALGO | 0.995699 | 6.85113 | {
"github_metadata": {
"branch": "master",
"commit_count": 57,
"repo_created_at": "2020-04-02T09:44:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 1,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "f84fc9afa... |
d0382c93-d5fc-4135-b7c0-ed4e7584e4d1 | dennisjueni/algolab-2023 | potw/w13-schneewittchen/main.cpp | #include <CGAL/Gmpz.h>
#include <CGAL/QP_functions.h>
#include <CGAL/QP_models.h>
#include <iostream>
#include <map>
#include <vector>
typedef int IT;
typedef CGAL::Gmpz ET;
typedef CGAL::Quadratic_program<IT> Program;
typedef CGAL::Quadratic_program_solution<ET> Solution;
struct Mine {
int dangerThreshold;
std:... | ALGO | 0.999355 | 4.281647 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2024-02-07T10:42: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": "44f5cb8008f... |
a9ae3f75-7a45-4246-8df2-2b1e7138df27 | tbindi/hackerrank | insert_sorted_doubly.cpp | /*
You’re given the pointer to the head node of a sorted doubly linked list and an integer to insert into the list. Create a node and insert it into the appropriate position in the list. The head node might be NULL to indicate that the list is empty.
I/P:
NULL , data = 2
NULL <-- 2 <--> 4 <--> 6 --> NULL , data = 5
... | ALGO | 0.999945 | 4.789377 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2015-01-10T12:52: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": "0b5f8f4348... |
d1f6d3bb-c7c4-48fe-a716-b20ad0e50068 | WindowsNT/sha3cng | sphincs/sha3/include/sponge.hpp | #pragma once
#include "keccak.hpp"
#include <algorithm>
#include <cstring>
// Keccak family of sponge functions
namespace sponge {
// Compile-time check to ensure that domain seperator can only be 2/ 4 -bits
// wide
//
// When used in context of extendable output functions ( SHAKE{128, 256} )
// domain seperator bits... | ALGO | 0.985045 | 7.069548 | {
"github_metadata": {
"branch": "master",
"commit_count": 22,
"repo_created_at": "2023-01-10T20:34:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 4,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "c79f93de1... |
406eb953-f310-4713-82ab-e19c1ef52784 | sxs-collaboration/spectre | src/Evolution/DgSubcell/DgSubcell.hpp | // Distributed under the MIT License.
// See LICENSE.txt for details.
#pragma once
namespace evolution::dg {
/*!
* \ingroup DgSubcellGroup
* \brief Implementation of a generic finite volume/conservative finite
* difference subcell limiter
*
* Our implementation of a finite volume (FV) or finite difference (FD) s... | ALGO | 0.999131 | 6.84719 | {
"github_metadata": {
"branch": "develop",
"commit_count": 17103,
"repo_created_at": "2017-04-07T17:28:20.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 168,
"forks": 202,
"issues": 530,
"pull_requests": 57
},
"file_meta": {
"content_id": ... |
68155e90-24a0-459c-97db-e3a79ec4882a | elijaharita/eseed-math | include/eseed/math/matops.hpp | // Copyright (c) 2020 <NAME>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, dis... | ALGO | 0.978297 | 7.151715 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2020-03-20T22:45:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 20,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "00569b09... |
4aac6832-f1e4-4ec2-b054-7327a2e8885d | ffs97/iitk-courses | sem5/cs345/assignments/special-assign/leda/incl/LEDA/core/bin_heap22.h | /*******************************************************************************
+
+ LEDA 6.3
+
+
+ bin_heap22.h
+
+
+ Copyright (c) 1995-2010
+ by Algorithmic Solutions Software GmbH
+ All rights reserved.
+
*******************************************************************************/
LEDA_BEGIN_NAMESPAC... | ALGO | 0.998831 | 5.604139 | {
"github_metadata": {
"branch": "master",
"commit_count": 86,
"repo_created_at": "2017-09-12T18:48:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 91,
"forks": 88,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d4367fa... |
68ca8db0-4677-4f1b-8d1e-84850ee566a6 | XBodya/third_course | OPP/L3/main.cpp | #include <iostream>
#include <omp.h>
#include <vector>
#include <fstream>
#include <ctime>
#include <string>
#include <cmath>
#define INIT_TIMER double start_time, run_time
#define START_TIMER start_time = omp_get_wtime()
#define STOP_TIMER run_time = omp_get_wtime() - start_time
#define PRINT_TIME_MESSAGE(MESSAGE, TI... | ALGO | 0.999052 | 4.63055 | {
"github_metadata": {
"branch": "main",
"commit_count": 69,
"repo_created_at": "2024-09-07T16:59: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": "3a46c6b8c59... |
63e54095-a1ab-470c-b7f7-8f6df2a48c6c | sxs-collaboration/spectre | src/PointwiseFunctions/GeneralRelativity/Lapse.hpp | // Distributed under the MIT License.
// See LICENSE.txt for details.
#pragma once
#include <cstddef>
#include "DataStructures/DataBox/Tag.hpp"
#include "DataStructures/Tensor/TypeAliases.hpp"
#include "PointwiseFunctions/GeneralRelativity/Tags.hpp"
#include "Utilities/Gsl.hpp"
#include "Utilities/TMPL.hpp"
/// \in... | TOOL | 0.986865 | 6.980974 | {
"github_metadata": {
"branch": "develop",
"commit_count": 17103,
"repo_created_at": "2017-04-07T17:28:20.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 168,
"forks": 202,
"issues": 530,
"pull_requests": 57
},
"file_meta": {
"content_id": ... |
09520083-df79-4dce-939b-43f3b7fe30e9 | manthans873/Codeforces-Solutions | 1200/Pursuit.cpp | // prob link: https://codeforces.com/contest/1530/problem/C
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll N = 2e5;
ll a[N];
ll b[N];
ll n;
bool ok(int m){
ll A=0,B=0;
ll take = m - m/4;
ll hdr = min(m-n, take);
A += hdr*100;
ll i = n-1;
ll j = n - min(n,take);
... | ALGO | 0.999974 | 3.620535 | {
"github_metadata": {
"branch": "main",
"commit_count": 44,
"repo_created_at": "2021-02-20T05:52:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "701949befca... |
b8fab7a2-7788-4171-9305-875d904d6a26 | shishirkj/DSA | sliding window/Sliding Window Mximum.cpp | Sliding Window Maximum
You are given an array of integers nums, there is a sliding window of size k which is moving from the very left of the array to the very right. You can only see the k numbers in the window. Each time the sliding window moves right by one position.
Return the max sliding window.
Example 1... | ALGO | 0.999975 | 6.173998 | {
"github_metadata": {
"branch": "main",
"commit_count": 282,
"repo_created_at": "2022-12-28T12:58:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "44056cd61d... |
30988ccd-014b-480c-96a8-56554aaa35c8 | TarunSinghania/Prewritten-code | algorithims/binary search/lowerbound.cpp | Return iterator to lower bound
Returns an iterator pointing to the first element in the range [first,last) which does not compare less than val.(equal or greater )
upper_bound:::::::::
eturns an iterator pointing to the first element in the range [first,last) which compares greater than val.
The elements are compare... | ALGO | 0.999937 | 3.935944 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2020-02-07T15:33:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2df869be0e... |
a33eb85c-27be-4a3b-b864-62b4f2661971 | IvanTicona/Competitive-Programming | Contest/IcpcAsia/L.cpp | #include <bits/stdc++.h>
using namespace std;
#define all(x) x.begin(), x.end()
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> ii;
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
int R, C, n, p;
cin >> R >> C >> n >> p;
vvi grid(R, vi (C));
vector<ii> pos(n+1);... | ALGO | 0.999609 | 4.38609 | {
"github_metadata": {
"branch": "main",
"commit_count": 256,
"repo_created_at": "2024-04-14T03:07: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": "230dd10b47... |
3ef71e35-48c9-44a0-b18a-2fc9c0fd939c | DQSSSSS/Algorithm-Competition-Code | 2019寒假wannafly/day3/H.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef long double LD;
typedef pair<LL,LL> pii;
const int SZ = 800100;
const int INF = 1e9 + 10;
const int mod = 998244353;
const LD eps = 1e-8;
LL read() {
LL n = 0;
char a = getchar();
bool flag = 0;
while(a > '9' || a < '0') { if(a... | ALGO | 0.999944 | 4.552756 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2020-11-02T16:48:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "64108b29db... |
ab8a1bfa-c353-4d03-8dbb-9fa8d32135a0 | erwincoumans/experiments | dynamics/corotational_fem/OpenTissue/core/math/math_power2.h | #ifndef OPENTISSUE_CORE_MATH_MATH_POWER2_H
#define OPENTISSUE_CORE_MATH_MATH_POWER2_H
//
// OpenTissue Template Library
// - A generic toolbox for physics-based modeling and simulation.
// Copyright (C) 2008 Department of Computer Science, University of Copenhagen.
//
// OTTL is licensed under zlib: http://opensource.o... | ALGO | 0.947893 | 6.817949 | {
"github_metadata": {
"branch": "master",
"commit_count": 443,
"repo_created_at": "2011-05-31T01:15:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 132,
"forks": 26,
"issues": 4,
"pull_requests": 0
},
"file_meta": {
"content_id": "8ae27... |
c2fba71d-1923-42e7-8c94-ed63489c54e1 | 188080501/JQTools | library/JQLibrary/src/JQGuetzli/guetzli/butteraugli_comparator.cc | /*
* Copyright 2016 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in w... | ALGO | 0.989726 | 6.608847 | {
"github_metadata": {
"branch": "master",
"commit_count": 296,
"repo_created_at": "2016-05-15T04:09:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1786,
"forks": 519,
"issues": 20,
"pull_requests": 0
},
"file_meta": {
"content_id": "ea... |
51a3194b-c185-411c-907f-6b63aa39ca84 | JSHBaxter/DeepFlow | CPP/dagmf_meanpass_solver.cc |
#include "dagmf_meanpass_solver.h"
#include "hmf_trees.h"
#include <iostream>
#include <limits>
#include "common.h"
#include "cpu_kernels.h"
#include "cpu_kernels_meanpass.h"
#ifdef USE_CUDA
#include "gpu_kernels.h"
#include "gpu_kernels_meanpass.h"
#endif
template<typename DEV>
DAGMF_MEANPASS_SOLVER<DEV>::DAGMF_MEA... | ALGO | 0.999823 | 4.915372 | {
"github_metadata": {
"branch": "master",
"commit_count": 97,
"repo_created_at": "2019-04-03T09:00: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": "f3147e61c... |
f31c5f32-6f25-4aa6-8dd3-0b61fb9c07dc | yunpengxiao/LeetcodeSolution | CppSolution/Utility.h | #include <iostream>
#include <vector>
#include <queue>
#include <stack>
#include <unordered_set>
#include <unordered_map>
using namespace std;
struct ListNode
{
int val;
ListNode *next;
ListNode(int x) : val(x), next(NULL) {}
};
struct TreeNode
{
int val;
TreeNode *left;
TreeNode *right;
T... | ALGO | 0.999627 | 3.90805 | {
"github_metadata": {
"branch": "master",
"commit_count": 152,
"repo_created_at": "2013-12-27T18:33: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": "834d1f0e... |
8e53e8af-a292-4cac-b7b3-beba96b8496d | wangqinghe95/MSOffer | II_76_数组中的第 k 大的数字.cpp | /*
* quickSort
*/
class Solution {
public:
int findKthLargest(vector<int>& nums, int k) {
quickSort(nums, 0, nums.size()-1);
return nums[nums.size()-k];
}
private:
void quickSort(vector<int>& nums, int low, int high) {
if(low < high) {
int pivotpos = partition(nums, low,... | ALGO | 0.999986 | 5.533207 | {
"github_metadata": {
"branch": "main",
"commit_count": 188,
"repo_created_at": "2021-05-19T11:32: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": "05652525f1... |
f25812c8-fd31-41b3-aaef-0d3e6739a9b6 | NelsonGomesNeto/Competitive-Programming | Online Judges/CodeForces/Contests/1167 - Educational Codeforces Round 65 (Rated for Div. 2)/E - Range Deleting.cpp | #include <bits/stdc++.h>
#define lli long long int
using namespace std;
/* Tutorial:
We will count this way:
for each i in [0, x - 1]:
ans += x - last
it's ascending for: f(i, last), where last is [p, x]
p is the (smallest value where f(0, p) is ascenfing) or
(the biggest value before... | ALGO | 0.999955 | 4.247655 | {
"github_metadata": {
"branch": "master",
"commit_count": 333,
"repo_created_at": "2019-08-07T17:50:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 10,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2237ed2... |
4519d837-ceea-4dd1-ae82-5a1bab55cbb5 | SR-Sunny-Raj/Hacktoberfest2021-DSA | 27. LeetCode Problems/44. Wildcard Matching.cpp | class Solution {
public:
bool isMatch(string s, string p) {
int n = s.length();
int m = p.length();
vector<bool> dp(m + 1, false), dp1(m + 1, false);
dp[0] = true;
for (int j = 1; j <= m; j++) {
if (p[j - 1] != '*')
break;
dp[j... | ALGO | 0.999987 | 5.209953 | {
"github_metadata": {
"branch": "master",
"commit_count": 2783,
"repo_created_at": "2020-05-08T05:36:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 236,
"forks": 982,
"issues": 3,
"pull_requests": 161
},
"file_meta": {
"content_id": "a... |
e025d764-cb5b-4bb8-bf53-eb0d2fe5f0ec | gan74/y | y/math/math.h | /*******************************
Copyright (c) 2016-2020 <NAME>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, m... | ALGO | 0.956375 | 7.09595 | {
"github_metadata": {
"branch": "master",
"commit_count": 1537,
"repo_created_at": "2016-09-11T20:02: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": "b95053d... |
c3ed8526-2132-4475-aa4b-849d733c4231 | fulatin/MyAlgorithmProblemCode | codefoces/r970d3/d.cpp | #include <iostream>
#include <queue>
#include <vector>
using namespace std;
int t;
vector<int> arr, ans;
vector<bool> isblack;
vector<bool> vis;
void solve() {
int n;
cin >> n;
arr.clear();
isblack.clear();
vis.clear();
ans.clear();
arr.resize(n + 1);
vis.resize(n + 1, false);
isblack.resize(n + 1)... | ALGO | 0.999977 | 4.247085 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2024-12-09T13:38:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2e4b28d192... |
f0bf5b62-0209-4a98-967c-8968ac9252d5 | dbaumg/competitive-programming | Bronze/open-2020/socdist1.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ifstream fin("socdist1.in");
ofstream fout("socdist1.out");
int n;
string s;
fin >> n >> s;
int dist = 0;
int cows = 0;
vector<int> d;
for (int i = 0; i < n; i++) {
if (s[i] == '1') {
cows += 1;
... | ALGO | 0.999995 | 3.446402 | {
"github_metadata": {
"branch": "main",
"commit_count": 549,
"repo_created_at": "2021-04-25T23:09: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": "385363df35... |
53983eb7-670d-4c0b-8995-cb40b41c71f7 | Hermera/OI | Code/Codeforces/717E.cpp | #include <cstdio>
using namespace std;
inline int read() {
char ch = getchar(); int x = 0, t = 1;
while(ch < '0' || ch > '9') { if(ch == '-') t = -1; ch = getchar(); }
while(ch >= '0' && ch <= '9') x = x*10+ch-'0', ch = getchar();
return x*t;
}
const int maxn = 1e6+5;
int N, cnt, lack, back, q[maxn], head[maxn], s... | ALGO | 0.999952 | 3.958395 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2017-06-07T14:16: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": "d2f926a48... |
507b51d0-47e5-4492-b1a7-fce487bd4c1d | KrAbhas/green-code | codeforces/1631/B.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define all(x) (x).begin(), (x).end()
#define intl int64_t
#define pb(x) push_back(x)
#define unmap unordered_map
#define unset unordered_set
template<class T> bool asnmx (T& a, const T& b){return a < b? a = b, 1: 0;}
template<class T> bool asnmn (T& ... | ALGO | 0.999917 | 5.017123 | {
"github_metadata": {
"branch": "master",
"commit_count": 505,
"repo_created_at": "2021-07-23T09:57: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": "306b6d61... |
c8c9d50b-b25c-4c93-bc19-9e32df324362 | AigaGoto/AtCoders | BiginnerContest/219/D.cpp | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
const int INF = 1 << 29;
int main() {
int N, X, Y;
cin >> N >> X >> Y;
vector<pair<int, int>> foods;
pair<int, int> food;
int dp[N+10][X+10][Y+10];
for (int i = 0; i < N+10; ++i) for (int j = 0;... | ALGO | 0.999823 | 3.972575 | {
"github_metadata": {
"branch": "main",
"commit_count": 68,
"repo_created_at": "2021-09-04T05:30: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": "bdd64edaf2e... |
f1a2ff1b-ce8f-4adb-a3fc-03cef90e6f6b | Lcrypto/classic-PEG- | classic_PEG/CyclesOfGraph.cpp | #include "CyclesOfGraph.h"
#include "Utility.h"
#include <cstdlib>
#include <iostream>
#include <valarray>
using namespace std;
class NodesOfGraph{
public:
NodesOfGraph();
~NodesOfGraph();
int GetNumOfParityConnections() const { return int( parityConnections.size() ); }
int GetNumOfSymbolConnections() cons... | ALGO | 0.999465 | 3.222457 | {
"github_metadata": {
"branch": "master",
"commit_count": 65,
"repo_created_at": "2018-07-08T13:03:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 25,
"forks": 10,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "65f4bbe... |
5cec9e12-f1a2-4640-9a2a-19566f60cfab | Harshit-Vashisth/Dsa-Supreme | 09 Linked List/01 linkedlist/reversesinglyLL.cpp | #include<bits/stdc++.h>
using namespace std;
class Node{
public:
int val;
Node* next;
Node(){
val=0;
next=NULL;
}
Node(int val){
this->val=val;
next=NULL;
}
};
void print(Node* head){
Node* temp=head;
while(temp!=NULL){
cout<<temp->val<<" -> "... | ALGO | 0.999931 | 4.144373 | {
"github_metadata": {
"branch": "main",
"commit_count": 911,
"repo_created_at": "2023-02-04T12:14:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9cda8b2784... |
505c444f-b5f2-4741-87f0-4eaa7e917e2b | HangboQuan/algorithm-problem | acwing_base/study/STL/dfs.cpp | //
// Created by quanhangbo on 2023/3/26 20:26.
//
//#include<iostream>
//using namespace std;
//int n;
//
//const int N = 10;
//int path[N];
//bool vis[N];
//
//void dfs(int s) {
// if (s == n) {
// for (int i = 0; i < n; i ++ ) {
// printf("%d", path[i]);
// }
// puts("");
// }
... | ALGO | 0.999746 | 4.461406 | {
"github_metadata": {
"branch": "master",
"commit_count": 115,
"repo_created_at": "2021-10-19T09:26:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a88b7442... |
5526cacb-51d6-4634-8f7f-496db0433027 | FastStim/decisionMaking | homeWork/hw4/src/bl.cpp | using namespace std;
class bl
{
public:
bl(int, int, int, int, int*, float*, float*);
~bl();
float getE();
int getP();
void printE();
void printS(int year);
void printMat(int);
private:
int** pMat;
int** pMat2;
float* pS1;
float* pS2;
float* el;
int p;
float e;
int** build(int, int, int*, int);
... | ALGO | 0.998887 | 3.366962 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2017-09-06T10:44: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": "60b622406... |
68b7a70e-7291-4d64-bd0a-dc8b1983cacf | VakhitK/ShootThemUpGame | ShootThemUpGame/Source/ShootThemUpGame/Private/Components/STUAIPerceptionComponent.cpp | // Shoot Them Up Game. All Rights Reserved.
#include "Components/STUAIPerceptionComponent.h"
#include "AIController.h"
#include "STUUtils.h"
#include "Components/STUHealthComponent.h"
#include "Perception/AISense_Sight.h"
AActor* USTUAIPerceptionComponent::GetClosestEnemy() const
{
TArray<AActor*> PerceivedActors... | ALGO | 0.973364 | 5.545459 | {
"github_metadata": {
"branch": "main",
"commit_count": 38,
"repo_created_at": "2025-02-14T10:22: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": "674f0f28e18... |
22843b01-7f9d-48e3-9cc8-2e952693c4d9 | eshanuniyal/ucla-classes | CS 31 - Introduction to Computer Science I/Lecture Code/lecture_5.cpp | #include <iostream>
using namespace std;
// lines 6 to 21 imported from lecture_3.cpp
int main() {
double payRate;
cout << "How many hours did you work this week? ";
cin >> hoursWorked;
cout << "What is your hourly rate of pay? ";
cin >> payRate;
// Calculating and printing results
double totalPay = hoursW... | TOOL | 0.990939 | 3.491438 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2020-08-02T09:27: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": "76ac9b1857... |
5a91f2e3-ad50-4ce5-b532-289309fc34d0 | wisdompeak/LeetCode | Segment_Tree/699.Falling-Squares/699.Falling-Squares_SegTree_v1.cpp | // 线段树可动态开点
class SegTree
{
public:
int start,end,status;
SegTree* left;
SegTree* right;
SegTree(int a,int b,int s):start(a),end(b),status(s),left(NULL),right(NULL){}
void remove(SegTree* &node)
{
if (node==NULL) return;
remove(node->left);
remove(node->right);
... | ALGO | 0.999956 | 5.124752 | {
"github_metadata": {
"branch": "master",
"commit_count": 8912,
"repo_created_at": "2017-03-01T10:30:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6018,
"forks": 1314,
"issues": 4,
"pull_requests": 0
},
"file_meta": {
"content_id": "e... |
dec40088-2f74-4e6b-8c20-722fb3718b4c | UestcXiye/Leetcode | 932.漂亮数组.cpp | /*
* @lc app=leetcode.cn id=932 lang=cpp
*
* [932] 漂亮数组
*/
// @lc code=start
// 性质1:如果 X, Y, Z 是一个漂亮数组,则 k*X+b, k*Y+b, k*Z+b 也一定是漂亮数组
// 性质2:奇数 + 偶数 = 奇数
// 思路:
// 对于一个正整数 n,我们将其等分为两部分 left 和 right,
// 如果 left 和 right 都是漂亮数组,且 left 全部是奇数,right 全部是偶数,
// 那么此时 left + right 一定是漂亮数组。
// 自顶向下的分治算法:
// 先将数组分为两部分,将奇数... | ALGO | 0.999848 | 5.361539 | {
"github_metadata": {
"branch": "main",
"commit_count": 338,
"repo_created_at": "2023-05-04T13:56:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "783e73ea38... |
b30a1876-0535-446d-a047-43160777c913 | saamiyaahsan/LeetCode | 0div-idbig-omega-company-tagsdiv-idbig-omega-topbardiv-classcompanytagscontainer-styleoverflow-x-scroll-flex-wrap-nowrap-div-classcompanytagscontainer-tagno-companies-found-for-this-problem-div-divdiv-classcompanytagscontainer-chevrondivsvg-version11-idicon-xmlnshttp-wwww3org-2000-svg-xmlns-xlinkhttp-wwww3org-1999-xlin... | class Solution {
public:
static bool myComp(string &s1,string &s2)
{
return s1.size() < s2.size();
}
bool isCompare(string &s1,string &s2)
{
int n = s1.size();
int m = s2.size();
if(n != m+1)
{
return false;
}
... | ALGO | 0.999997 | 5.573463 | {
"github_metadata": {
"branch": "main",
"commit_count": 1863,
"repo_created_at": "2023-01-02T09:42: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": "bdec7bbbc... |
77a39ac9-360c-4f99-9e23-53125cce7a38 | ShubhamAgrawal-13/CSES-Problem-Set | EDU_codeforces/2.Segment_tree_part_1/step_3/5.Addition_to_Segment.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define mod 1000000007
#define deb(x) cout << #x << "=" << x << "\n"
#define ar array
#define all(v) v.begin(),v.end()
#define clr(x,v) memset(x,v,sizeof(x))
typedef long long item;
// class item{
// public:
// //items
// };
class SegTree{
public... | ALGO | 0.999834 | 5.313495 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2020-06-15T18:47: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": "e71b1e18f... |
62dc90b4-13d6-42d9-b8d3-c5748c6a2872 | kassonlab/gmxapi | src/gromacs/linearalgebra/gmx_lapack/slasdq.cpp | #include <cctype>
#include "../gmx_blas.h"
#include "../gmx_lapack.h"
void
F77_FUNC(slasdq,SLASDQ)(const char *uplo,
int *sqre,
int *n,
int *ncvt,
int *nru,
int *ncc,
float... | ALGO | 0.998482 | 4.932148 | {
"github_metadata": {
"branch": "master",
"commit_count": 19315,
"repo_created_at": "2017-05-25T14:05:14.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 53,
"forks": 13,
"issues": 93,
"pull_requests": 2
},
"file_meta": {
"content_id": "a22b... |
5bab117d-01ec-4113-b54c-3128162ec4b1 | WorldWideWebster/Data-Structures | Prog2/PwlFcn.cpp | /*----------PwlFcn.cpp-------------
by: <NAME>
16.322 Data Structures
ECE Dept.
UMASS Lowell
Purpose: Defines functions to work on peicewise linear function
*/
#include <iostream>
#include "Point.h"
#include "PwlFcn.h"
using namespace std;
/*
Type "PwlFucn" represends a piecewise-linear function as a sequence of ... | TOOL | 0.939755 | 5.552618 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2016-05-01T18:18: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": "ca5e9f902d... |
cc33a1d9-4824-4310-918f-10dc56ff181f | adityasinghhh/coding | algorithms/kdtree/kdtree_double.cpp | #include<cstdio>
#include<algorithm>
#include<utility>
#include<vector>
using namespace std;
class node
{
public:
pair<double, double> point;
node *right, *left;
};
bool sortx(pair<double, double> p1, pair<double, double> p2)
{
return (p1.first < p2.first || (p1.first == p2.first && p1.second < p2.second));
}
... | ALGO | 0.99979 | 3.457898 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2013-05-26T14:49: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": "c13be39e4f... |
bc40aedb-c098-40b4-9c76-583b386b39be | allem40306/Competitive-Programming | atcoder/abc209D.cpp | #include <bits/stdc++.h>
using namespace std;
using LL = long long;
using ULL = unsigned long long;
using PII = pair<int, int>;
using PLL = pair<LL, LL>;
using VI = vector<int>;
using VVI = vector<vector<int>>;
const int INF = 1e9;
const int MXN = 0;
const int MXV = 1e5 + 5;
const int LOG = 20;
const double EPS = 1e-9;... | ALGO | 0.999995 | 4.487469 | {
"github_metadata": {
"branch": "master",
"commit_count": 337,
"repo_created_at": "2015-11-16T11:48: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": "19137575... |
a9f2f044-422e-4e14-850c-e344629dc2e4 | kronbichler/adaflo | source/level_set_okz_reinitialization.cc | // --------------------------------------------------------------------------
//
// Copyright (C) 2020 by the adaflo authors
//
// This file is part of the adaflo library.
//
// The adaflo library is free software; you can use it, redistribute it,
// and/or modify it under the terms of the GNU Lesser General Public Lic... | ALGO | 0.999649 | 5.736108 | {
"github_metadata": {
"branch": "master",
"commit_count": 310,
"repo_created_at": "2016-03-24T16:27:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 24,
"forks": 14,
"issues": 3,
"pull_requests": 5
},
"file_meta": {
"content_id": "b93d3c... |
24ac54e4-efa5-4b70-8d18-179345a2bbae | 0voice/cpp_new_features | cpp_11/003_stl_std_unordered_multiset.cpp | #include <iostream>
#include <unordered_set>
template<class Os, class Co> Os& operator<<(Os& os, const Co& co) {
os << "{";
for (auto const& i : co) { os << ' ' << i; }
return os << " } ";
}
int main()
{
std::unordered_multiset<int> a1{3, 1, 3, 2}, a2{5, 4, 5};
auto it1 = std::next(a1.begin())... | TOOL | 0.922336 | 4.74131 | {
"github_metadata": {
"branch": "main",
"commit_count": 1513,
"repo_created_at": "2021-07-09T03:04:23.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 5739,
"forks": 1196,
"issues": 10,
"pull_requests": 1
},
"file_meta": {
"content_id": "6ab... |
35c07e2e-894e-4477-a658-8d6bf1e1197b | 0x0cqq/Codes | luogu/p4116.cpp | #include <bits/stdc++.h>
using namespace std;
const int MAXN = 110000;
struct LCT{
int c[MAXN][2],f[MAXN],w[MAXN],mn[MAXN];// mn[x] 代表 x 的最小的黑点,==0 代表没有
bool noroot(int x){return c[f[x]][0]==x||c[f[x]][1]==x;}
void push_up(int x){
mn[x] = mn[c[x][0]] ? mn[c[x][0]] : (w[x]?x:mn[c[x][1]]);
}
void rotate(i... | ALGO | 0.999978 | 4.341018 | {
"github_metadata": {
"branch": "master",
"commit_count": 330,
"repo_created_at": "2018-01-26T02:51: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": "33df8f08... |
ccda629b-7824-43c1-84d1-357aa33e5ec6 | ploffer11/CPP | 2855.cpp | #include <bits/stdc++.h>
//#pragma GCC optimize("Ofast")
//#pragma GCC optimize("O3")
//#pragma GCC optimize ("unroll-loops")
//#define int long long
using namespace std;
using ll = long long;
using pii = pair<int, int>;
const int INF = 0x3f3f3f3f;
//const ll INF = 0x3f3f3f3f3f3f3f3f;
const int MOD = 1e9 + 7;
const int... | ALGO | 0.999956 | 3.270538 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2020-01-08T06:23: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": "cad6a2e1c... |
eba52314-e79a-46ce-b746-9732534138f1 | morris821028/UVa | volume119/11992 - Fast Matrix Operations[四分樹v2].cpp | #include <stdio.h>
#include <algorithm>
using namespace std;
#define INF 0x7fffffff
#define MaxN 1000005
struct Node {
int mxv, mnv, sum;
int add, set;
int son[4];
};
Node tree[MaxN<<2];
int NSize;
void build(int k, int lx, int rx, int ly, int ry) {
tree[k].mxv = tree[k].mnv = tree[k].sum = 0;
tree[... | ALGO | 0.998415 | 3.615083 | {
"github_metadata": {
"branch": "master",
"commit_count": 1197,
"repo_created_at": "2013-06-14T12:34:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 571,
"forks": 269,
"issues": 1,
"pull_requests": 1
},
"file_meta": {
"content_id": "d4b... |
4d03e80b-f0ff-46da-876a-9ad8d8d89474 | debopriyodjghosh/Programs | CPP/ME CPP/slinklis.cpp | #include<iostream.h>
#include<conio.h>
template<class T>
class linklist
{
private:
struct node
{
T data;
node *link;
}*root;
public:
linklist();
~linklist();
void addend(T);
void addbeg(T);
void addafter(int,T);
void delnode(int);
void delitem(T);
void sort();
void reverse();
void delduplicate();
void display();
void c... | ALGO | 0.999366 | 4.136819 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2021-09-13T04:02: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": "8809f0f7ac... |
3bdbadb9-c996-4a31-b195-d1bc9ea9dc6c | gradientspace/geometry3cpp | external/GTEngine/Include/Mathematics/GteIntrLine3OrientedBox3.h | // <NAME>, Geometric Tools, Redmond WA 98052
// Copyright (c) 1998-2018
// Distributed under the Boost Software License, Version 1.0.
// http://www.boost.org/LICENSE_1_0.txt
// http://www.geometrictools.com/License/Boost/LICENSE_1_0.txt
// File Version: 3.0.0 (2016/06/19)
#pragma once
#include <Mathematics/GteOriente... | ALGO | 0.992106 | 7.591064 | {
"github_metadata": {
"branch": "master",
"commit_count": 60,
"repo_created_at": "2017-01-25T16:47:56.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 62,
"forks": 22,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "2108651f... |
3aa90436-a550-4667-803e-0a85d9daa3a0 | Kimbbakar/LightOj-Solutions | LightOj 1192.cpp | // Problem name : 1192 - Left Right
// Algorithm : Nim Game
// Contest/Practice : Off Line Practice
// Source : Lihgt Oj
// Comment : Whenever you start to believe yourself, people also start to believe in you
// Date : 15-Oct-14
#include<bits/stdc++.h>
#define pause system("pause");
#define FOR(s,e,inc) for(int i=s... | ALGO | 0.999903 | 3.438923 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2017-12-22T15:46:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 10,
"forks": 7,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7c8365e5... |
0fcbe2b6-a33f-4c2d-a596-2c1f62305535 | ishandutta2007/codeforces-y | yuma_/normal/611/C.cpp | #include<stdio.h>
#include <iostream>
#include <math.h>
#include <numeric>
#include <vector>
#include <map>
#include <functional>
#include <stdio.h>
#include <array>
#include <algorithm>
#include <string>
#include <string.h>
#include <assert.h>
#include <stdio.h>
#include <queue>
#include<iomanip>
#include<bitset>
#inc... | ALGO | 0.998695 | 4.335562 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:40: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": "3300264a76c2... |
28c82ad4-8763-46f9-a6a9-22c0572fcd75 | Yawn-Sean/Daily_CF_Problems | daily_problems/2024/11/1125/personal_submission/cf700b_lyxxys.cpp | #include <bits/stdc++.h>
using namespace std;
template <class T> void fmax(T &a, const T &b){
if (b > a) a = b;
}
template <class T> void fmin(T &a, T b){
if (b < a) a = b;
}
void solve(){
int n, k;
cin >> n >> k;
vector<vector<int>> g(n);
vector <int> sz(n);
for (int i = 0, u; i < 2*k; ++ ... | ALGO | 0.99972 | 4.094927 | {
"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": "148d... |
64ac5dc1-8947-4073-968e-9160de7b9205 | avidLearnerInProgress/CTCI-solutions | Miscellaneous/path_with_given_sum.cpp | //https://ide.geeksforgeeks.org/hVsJkaT2vQ
#include<bits/stdc++.h>
using namespace std;
struct Node{
int data;
Node *left, *right;
};
Node *newNode(int data){
Node *curr = new Node();
curr->data = data;
curr->left = curr->right = NULL;
return curr;
}
//recursive
bool pathWithGivenSumRec(Node *... | ALGO | 0.999959 | 5.05485 | {
"github_metadata": {
"branch": "master",
"commit_count": 212,
"repo_created_at": "2019-05-28T05:26:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c641a5cd... |
6fdda681-6b09-45c2-b2ff-197735f0b17c | rockysingh2003/-GFG-Mastery-Blueprint | Array/find the number that appear once /ones.cpp | //using the hasp map which is of two type:
//hash array.
//hash data structure...
//using xor...
#include <bits/stdc++.h>
using namespace std;
// using hash array
void countdown(vector<int> &v,int n)
{
//we have to find the maximum in the array.
int maximum = 0;
for (int i = 0; i < n;i++)
{
maximum... | ALGO | 0.9998 | 4.047511 | {
"github_metadata": {
"branch": "main",
"commit_count": 86,
"repo_created_at": "2024-05-14T12: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": "fc19a1ed1f7... |
b7892585-bfb5-4c66-a797-040b7305da02 | cp-upv/Summer-Bootcamp-2023-Leaderboard | bootcamp-2023/solutions/week 5/problemB.cpp | #include <bits/stdc++.h>
using namespace std;
int w, h;
vector<string> maze;
int solve(int px, int py, int x, int y) {
int r;
if (maze[y][x] == 'S') { return 1; }
if (x > 0 && px >= x && maze[y][x-1] != '#') {
r = solve(x, y, x-1, y);
if (r > 0) { return r+1;}
}
if (x < w-1 && px <= x && maze[y][x+1] != '#... | ALGO | 0.999888 | 3.963242 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2023-07-30T09:18:08.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c334ea3ee7a9... |
bcfb96bd-7e19-46e6-b6e2-4485080a8314 | tatsukawa/contest | codeforces/Round/384/B.cpp | #include <bits/stdc++.h>
#define get_variable_name(x) #x
#define debug(x) cout << #x << " = " << x << endl
#define rep(i, begin, end) for(int (i) = (begin); (i) < (end); (i)++)
#define ALL(x) (x).begin(), (x).end()
#define SORT(x) sort((x).begin(), (x).end())
#define REVERSE(x) reverse( (x).begin(),(x).end())
#define... | ALGO | 0.99995 | 4.099994 | {
"github_metadata": {
"branch": "master",
"commit_count": 74,
"repo_created_at": "2013-08-11T10:33: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": "f0df07152... |
ef739ec0-2f5e-4779-9d73-a17324a5dbd4 | ChuangRoy/RoyChuangs-Code | Algo/AtCoder/abc400/abc400_b.cpp | #pragma GCC optimize("Ofast")
#include <iostream>
#include <utility>
#include <cmath>
#define AC ios_base::sync_with_stdio(false); std::cin.tie(nullptr); std::cout.tie(nullptr);
#define pb emplace_back
#define ALL(x) begin(x),end(x)
#define MP(x) make_pair((x), (x))
#define SQ(x) ((x)*(x))
using namespace std;
typedef... | ALGO | 0.999977 | 3.524325 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2024-06-14T13:02: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": "ac3b37e24... |
deac73b7-a3df-40cc-8835-cba8fc282b60 | ashwin21rao/Leetcode-Solutions | Solutions/Practice/cpp/Merge Intervals/Merge Intervals.cpp | class Solution {
public:
vector<vector<int>> merge(vector<vector<int>>& intervals) {
int n = intervals.size();
sort(intervals.begin(), intervals.end());
vector<vector<int>> out;
vector<int> merged = intervals[0];
for (auto &interval : intervals) {
... | ALGO | 1 | 6.289635 | {
"github_metadata": {
"branch": "main",
"commit_count": 76,
"repo_created_at": "2021-11-24T18:55:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f87b428cd40... |
f5737e48-6d69-48f7-9c74-03fab902dd11 | zhanglei1949/Leetcode-solutions | 11-Container With Most Water/11-Container With Most Water.cpp | #include<iostream>
#include<vector>
using namespace std;
int maxarea(vector<int> &height)
{
int len = height.size();
int head = 0;
int rear = len - 1;
//two pointer
int maximum = 0;
int tmp;
while (rear > head){
maximum = max(min(height[head], height[rear])*(rear-head), maximum);
... | ALGO | 0.999872 | 4.754873 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2017-01-09T09:22:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b03a32579d... |
5b2ab570-5dd9-4b3c-b493-b7e13ac7ba6f | busebd12/InterviewPreparation | LeetCode/C++/General/Medium/Permutations/main.cpp | #include <iostream>
#include <unordered_set>
#include <vector>
/*
* Solution: we use backtracking to generate all the permutations. However, since we want our permutations
* to not have any duplicate numbers, we use an unordered_set<int>, skipIndices, to track which indices
* we have visited before so we can skip t... | ALGO | 0.999973 | 6.435005 | {
"github_metadata": {
"branch": "master",
"commit_count": 218,
"repo_created_at": "2015-12-15T14:19: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": "072e324f... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.