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 |
|---|---|---|---|---|---|---|---|
b6febd25-af8d-44ea-8dfe-5c65b62a5c89 | ishandutta2007/codeforces-n | nuip/normal/1368/F.cpp | #include <string>
#include <vector>
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<stack>
#include<queue>
#include<cmath>
#include<algorithm>
#include<functional>
#include<list>
#include<deque>
#include<bitset>
#include<set>
#include<map>
#include<unordered_map>
#include<unordered_set>
#include<cstring>... | ALGO | 0.999742 | 3.046034 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T15:35: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": "4e96ad2cb04c... |
75c3f3af-9b1f-4c03-86b3-1af4126d0611 | sofa797/HSE | course_algorithms/contests/3rd_contest/f.cpp | #include <iostream>
#include <vector>
using namespace std;
struct bstn {
int val;
int l;
int r;
};
vector<bstn> tr;
void in(int i) {
if (i == -1) {
return;
}
in(tr[i].l);
cout << tr[i].val << " ";
in(tr[i].r);
}
void pr(int i) {
if (i == -1) {
return;
}
co... | ALGO | 0.999796 | 4.19489 | {
"github_metadata": {
"branch": "main",
"commit_count": 142,
"repo_created_at": "2024-11-02T13:57: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": "8c793ae3a2... |
0ce1fb45-9277-4694-9544-2d8bdc17f124 | shouvik126/multistage-graph | multistagedp.cpp | #include<iostream>
#include<limits.h>
#include<vector>
using namespace std;
int main()
{
int stages,n;
cout<<"\tEnter no of stages:=";
cin>>stages;
cout<<"\nEnter no of vertex:=";
cin>>n;
int wt[n+1][n+1];
cout<<"\nEnter weight matrix for the graph of "<<stages<<endl;
for(int i=1;i<=n;i+... | ALGO | 0.999981 | 3.200971 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2018-07-11T18:09:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ca253627ad... |
7d38a956-91ed-4ab2-81d1-49d8a636f4f6 | FireSquid/ecs036c_hw1_program | SearchNewBooks.cc | // ECS 36C Program 1
//
// Filename: SearchNewBooks.cc
// Developer: <NAME>
// Date: October 07, 2020
//
#include <iostream>
#include <fstream>
#include <string>
#include <sstream>
#include <vector>
#include <algorithm>
// Class for storing book information
class Book
{
private:
std::string ISBN;
std::st... | TOOL | 0.995502 | 5.23957 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2020-10-09T19:56: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": "8e954eeff1... |
b57c20ee-fde1-4f5b-af46-694be3c7e02f | shuklapranav1011/my-dsa-codes | Dynamic Programming/dp_lis-1.cpp | /*
Longest Increasing subsequesnce
LIS -1 <standard>
LIS -2 <tricky>
LIS -3 <2nd + binary search>
LIS -4 <using segment trees>
*/
/*
find the length of the longest subsequence of a given sequence such that
all elements of the subsequence are sorted in increasing order.
For example, the length of LIS for {10, 22, ... | ALGO | 0.999972 | 4.809752 | {
"github_metadata": {
"branch": "master",
"commit_count": 43,
"repo_created_at": "2020-10-29T15:25: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": "95e6ea09a... |
7c73463b-9708-4496-b695-7618694ee5da | ishandutta2007/codeforces-g | generic_placeholder_name/normal/1282/B2.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/trie_policy.hpp>
#pragma 03
using namespace std;
using namespace __gnu_pbds;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
typedef long long ll;
typedef unsigned long long ull;
typedef unsigned uint;
typedef... | ALGO | 0.999924 | 4.222424 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:55: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": "628fa4745e88... |
c3fa6b9e-0625-4678-856c-32aebc455db1 | neilsong/USACO | Star League Gold/2/Source.cpp | #include <bits/stdc++.h>
using namespace std;
vector<vector <int>> adj;
vector <int> trav;
vector<int> wells;
int n;
//matrix
long MST() {
vector <int> visited(n, 0), dist;
dist = wells;
int count = 0;
long ans = 0;
while (count < n) {
pair<int, int> minv = { 0,INT_MAX };
int ind = 0;
for (auto i : dist) {... | ALGO | 0.999983 | 3.601358 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-11-08T21:06: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": "2bad81b5c5... |
b793dbe4-580a-4f44-bbf7-b7441668d8d7 | AdityaPatil-AP/LeetCode-Questions-TopicWise | Leet_Code_Solutions/Graphs/787.cheapest-flight-within-k-stops.cpp | class Solution
{
public:
int findCheapestPrice(int n, vector<vector<int>> &flights, int src, int dst, int k)
{
vector<vector<pair<int, int>>> adj(n);
for (auto &e : flights)
{
adj[e[0]].push_back({e[1], e[2]});
}
vector<int> dist(n, numeric_limits<int>::max())... | ALGO | 0.999905 | 5.462 | {
"github_metadata": {
"branch": "main",
"commit_count": 286,
"repo_created_at": "2022-07-24T12:59:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4ddb55e74f... |
21fe2a21-c73f-4693-9238-670829c99840 | AakashJamadar/CPP-Portfolio | stringStream.cpp | // In this challenge, we work with string streams.
// stringstream is a stream class to operate on strings. It implements input/output operations on memory (string)
// based streams. stringstream can be helpful in different type of parsing. The following operators/functions are commonly used here
// Operator >> Extr... | ALGO | 0.995929 | 5.542493 | {
"github_metadata": {
"branch": "main",
"commit_count": 207,
"repo_created_at": "2024-02-07T16:57: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": "dda6d01dbf... |
4287fbcf-356f-42f2-9180-59e5b0e80546 | alittlekitten/AlgorithmStack | CodeForce/Round#784_div4/C.cpp | #include <iostream>
using namespace std;
int arr[51];
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(NULL);
int tc, n, t1, t2, input;
cin >> tc;
for (int t = 0; t < tc; ++t) {
bool tmp = true;
cin >> n;
for (int i = 0; i < n; ++i) {
... | ALGO | 0.999593 | 4.928023 | {
"github_metadata": {
"branch": "main",
"commit_count": 1650,
"repo_created_at": "2021-09-11T13:01:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c26b1b1e3... |
a3864c52-b3ec-4785-8ecf-0c15b7371eb0 | allenyllee/Parallel-Computing-Book | examples/mpi/c/mvp2d.cxx | /* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%
%%%% This program file is part of the book and course
%%%% "Parallel Computing"
%%%% by <NAME>, copyright 2013-6
%%%%
%%%% mvp2d.cxx : use Reduce_scatter and lot... | ALGO | 0.999696 | 4.626714 | {
"github_metadata": {
"branch": "master",
"commit_count": 165,
"repo_created_at": "2018-05-04T10:09:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d745c4af... |
fa498dcd-7683-4cb3-b75c-a06ad78685a6 | Chakit22/Striver_SDE_Sheet | Day2/Repeating_and_missing/code1.cpp | pair<int, int> missingAndRepeating(vector<int> &a, int n)
{
long long sm1 = 0ll, sm2 = ((long long)n * (n + 1)) / 2; //sum of n natural numbers is n*(n+1)/2
long long sm_squ1 = 0ll, sm_squ2 = ((long long)(n) * (n + 1) * (2 * n + 1)) / 6; //sum of squares of n
//natural numbers is n*(n+1)*(2n+1)/6;
for (int i = 0; ... | ALGO | 0.999911 | 3.764342 | {
"github_metadata": {
"branch": "main",
"commit_count": 49,
"repo_created_at": "2022-06-08T17:20: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": "8ef3c6b77bd... |
6c6c95d5-02ae-48b8-952c-57f3bb11a131 | nguyentuss/Competitive-Programming | CP/Code JAM/Plates/code.cpp | #include <bits/stdc++.h>
using namespace std;
int n , k , p;
vector <vector <int>> adj(5000 , vector<int> (5000));
vector<vector <int>> sum(5000 , vector<int> (5000));
vector<vector <int>> f(5000 , vector<int>(5000));
void init() {
for (int i = 0 ; i <= n; i++)
for (int j = 0 ; j <= p ; j++) {
f[i][j] = 0;
... | ALGO | 0.999899 | 3.667012 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2025-01-20T04: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": "bd89561df7e4... |
a2f8a007-67c8-4b00-85c3-213483ef0494 | roloza7/nn-test | src/utils.cpp | #include "utils.h"
#include "neuralnetwork.h"
#include <math.h>
#include <stdexcept>
#include <iostream>
#include <random>
#include <algorithm>
static const double c = 4.5;
static const double mult = 2.0 * std::sqrt(c / 3.14159265);
using std::min;
using std::max;
/**
* Steps synapse towards/away from zero accordin... | ALGO | 0.999354 | 5.602265 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2021-11-19T03:15: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": "8b467ccdfae... |
e1c28d68-ecf2-49ae-ab9f-2bf2f49c116a | sparshsinha123/competetive-programming | hackerearth/dsu/J.cpp | #pragma GCC optimize("Ofast")
#include "bits/stdc++.h"
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define IOS { ios :: sync_with_stdio(false); cin.tie(0); cout.tie(0); }
#define ll long long
#define umapii unordered_map<ll,ll>
#define u... | ALGO | 0.999905 | 4.34643 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2020-05-04T06:02:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "be4f93f6e... |
e3c5f098-0445-429a-8269-f095113142cc | vitaminniy/cpp_modern_development_white_belt | src/week_2/line/line.cpp | #include <iostream>
#include <string>
#include <vector>
enum operation { worry, quiet, come, worry_count };
operation resolve_operation(const std::string &op);
int main() {
int noperations = 0;
std::cin >> noperations;
if (noperations == 0)
return 0;
std::vector<bool> line;
for (auto i = 0; i < nope... | ALGO | 0.991856 | 4.668232 | {
"github_metadata": {
"branch": "master",
"commit_count": 55,
"repo_created_at": "2020-04-21T08:56: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": "d478bd2f0... |
26c981b5-4960-45f6-9ee4-2286e08f682b | deepakpunjabi/code | ds/stack/decode-string.cc | /*
Given an encoded string, return its decoded string.
The encoding rule is: k[encoded_string],
where the encoded_string inside the square brackets is being repeated exactly k times.
Note that k is guaranteed to be a positive integer.
You may assume that the input string is always valid; No extra white spaces, square ... | ALGO | 0.998128 | 6.344953 | {
"github_metadata": {
"branch": "master",
"commit_count": 318,
"repo_created_at": "2017-03-06T06:17:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2ef76631... |
6d94a555-bacf-4f7f-bd92-75551637469e | cliarie/grind25 | cses/increasing_subsequence_nlogn.cpp | #include <iostream>
#include <vector>
using namespace std;
/*
method using binary search
longest_subsequece[i] = smallest element that can be the last element of an increasing subsequence of length i + 1
*/
int main()
{
freopen("../input.txt", "r", stdin);
freopen("../output.txt", "w", stdout);
int n;
... | ALGO | 0.999987 | 4.339707 | {
"github_metadata": {
"branch": "main",
"commit_count": 216,
"repo_created_at": "2024-05-15T23:43: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": "17b6555fe4... |
2f65db3e-fec8-4cd3-bb0b-0d512fdfea52 | abhinavGupta16/Disk-IO-Scheduling-Scheduler | src/scheduler/FLOOK.cpp | //
// Created by gupta on 25-04-2020.
//
#include "FLOOK.h"
#include <iostream>
#include <bits/stdc++.h>
#include <string>
using namespace std;
FLOOK::FLOOK(){};
FLOOK::FLOOK(deque<IOInput*> **currentQueue, int *track, int *direction){
this->currentQueue = currentQueue;
this->track = track;
this->direct... | ALGO | 0.997118 | 3.939893 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2020-04-25T06:50:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5ecacd274f... |
3d530f0f-613d-4022-aff6-a20c2c0d9cc9 | sushantbot/DSA-Supreme-2.0 | Week 13 BT/Day3_Repeat/rightView.cpp | #include <iostream>
#include<queue>
using namespace std;
class Node
{
public:
int data;
Node *left;
Node *right;
// constructor
Node(int data)
{
this->data = data;
this->left = NULL;
this->right = NULL;
}
};
Node *createTree()
{
int data;
cout << "enter Dat... | ALGO | 0.999898 | 4.883589 | {
"github_metadata": {
"branch": "main",
"commit_count": 228,
"repo_created_at": "2024-01-07T05:49: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": "cc4de78cd8... |
8ee74586-6324-48a0-b3ee-e090ea41d5b7 | Ananasty11/git1 | z18p4.cpp | // Задача 4
#include <stdio.h>
#include <locale.h> // Указание библиотек
int main() {
setlocale(LC_ALL, "Rus");
int a[10000] = {}; // Создание массива
int N, min, max, i, x, n; // Указание типа данных переменных
printf("Введите количество элементов массива\n");
scanf("%d", &N); // Ввод количества элементов пользо... | ALGO | 0.999966 | 3.54267 | {
"github_metadata": {
"branch": "master",
"commit_count": 43,
"repo_created_at": "2020-09-17T18:37: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": "c2b8032da... |
dfe95583-4747-4ba2-b151-532e102ca9ed | SassiGl/BiofluidMechanics | src/shared/particle_dynamics/solid_dynamics/elastic_dynamics.cpp | #include "elastic_dynamics.h"
#include "base_general_dynamics.h"
#include <numeric>
namespace SPH
{
//=========================================================================================================//
namespace solid_dynamics
{
//===============================================================================... | ALGO | 0.997642 | 5.224371 | {
"github_metadata": {
"branch": "master",
"commit_count": 2998,
"repo_created_at": "2024-06-04T15:16: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": "a7ed805... |
27676103-a89d-4c42-a56a-4481cc7905c3 | trunc8/bo-quian-cpp-stl | 12_algorithms.cpp | // trunc8 did this
#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
#define FAST_IO ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
#define PB push_back
const ll MOD = 1000000007;
const ll MAXN = 1e7;
void printvec(const vector<int> &vec){
for (auto i : vec) {
... | ALGO | 0.999903 | 4.11596 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2020-07-28T15:34: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": "5d34a412a8... |
9f78f665-75ff-4161-b1a9-a8b5d0cc4a70 | kochkozharov/da-labs | lab4/src/zfunc.cpp | #include "zfunc.h"
std::size_t RelativeToAbsolute(const std::pair<size_t, size_t> &relativeIndex,
const std::vector<std::size_t> &prefixSums) {
return prefixSums[relativeIndex.first] + relativeIndex.second;
}
std::pair<size_t, size_t>
AbsoluteToRelative(std::size_t absoluteIndex,
... | ALGO | 0.999749 | 5.647565 | {
"github_metadata": {
"branch": "master",
"commit_count": 66,
"repo_created_at": "2024-03-04T23:24:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2849a4655... |
e695e85c-680d-4290-9f81-bb9557e8abb3 | Oreofeoluwa92/games | craps.cpp | #include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
int die();
void playGame();
int amount = 100;
int main() {
char ans;
bool done = false;
srand(time(0)); // Seed the random number generator
while (!done) {
if (amount > 0) {
playGame();
cou... | TOOL | 0.968874 | 4.915802 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-10-18T15:23:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2d03fa1d6a22... |
d991d887-c478-43f3-a353-57735def72c3 | amzn/pecos | pecos/core/ann/quantizer_impl/common.hpp | /*
* Copyright 2022 Amazon.com, Inc. or its affiliates. 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. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0/
*
* or in the "license" fil... | ALGO | 0.996932 | 5.930206 | {
"github_metadata": {
"branch": "mainline",
"commit_count": 219,
"repo_created_at": "2020-08-12T00:25:51.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 534,
"forks": 108,
"issues": 24,
"pull_requests": 1
},
"file_meta": {
"content_id": "13... |
4dc1f935-f622-4923-8a34-6f3843c66a28 | munich-quantum-toolkit/qmap | src/na/zoned/reuse_analyzer/VertexMatchingReuseAnalyzer.cpp | /*
* Copyright (c) 2023 - 2025 Chair for Design Automation, TUM
* Copyright (c) 2025 Munich Quantum Software Company GmbH
* All rights reserved.
*
* SPDX-License-Identifier: MIT
*
* Licensed under the MIT License
*/
#include "na/zoned/reuse_analyzer/VertexMatchingReuseAnalyzer.hpp"
#include "ir/Definitions.hp... | ALGO | 0.998801 | 6.205516 | {
"github_metadata": {
"branch": "main",
"commit_count": 1504,
"repo_created_at": "2020-10-10T00:07:09.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 118,
"forks": 27,
"issues": 11,
"pull_requests": 1
},
"file_meta": {
"content_id": "89498f... |
8779efb1-f1ca-4b99-9c8c-9140f973e55b | Ashutosh-Ardu/College-Labs | DAA/MatMul/DnC.cpp | // matrix multiplication using divide and conquer
// vid :- https://www.youtube.com/watch?v=0oJyNmEbS4w
#include "iostream"
#include "chrono"
#include "iomanip"
#include "time.h"
using namespace std;
using namespace std::chrono;
void input(int **ar, int n)
{
for (int i = 0; i < n; ++i)
{
ar[i] = new int[n];
... | ALGO | 0.999655 | 4.661385 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2022-07-05T06:06: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": "e24e4ce8f78e... |
7325b157-83e7-4868-852a-077cb3e23c65 | amaldo4/PageFaultCounter | program2.cpp | /*CS 4328 Program 1
<NAME>
3/31/2021*/
#include <stdio.h>
#include <stdlib.h>
#include <fstream>
#include <stdint.h>
#include <iostream>
#include <string>
#include <ctime>
#include <time.h>
#include <vector>
using namespace std;
const int TOTAL = 100;
<<<<<<< HEAD
//const int TOTAL = 21;
bool hitMiss(int, int[... | ALGO | 0.989574 | 4.171639 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2021-04-22T16:20:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ea2f6974f560... |
df300918-ea34-4a54-a6ce-ae200f4b9d9b | nikitonsky/olymptasks | Innopolis 2017/Day 7/b.cpp | #include<iostream>
#include<vector>
#include<cmath>
#include<set>
#include<map>
#include<algorithm>
#include<deque>
#include<queue>
#include<string>
#include<stack>
#include<iomanip>
#include<fstream>
#include<ctime>
#define lli long long int
using namespace std;
vector<vector<lli>> a;
vector<lli> p;
vector<char> use... | ALGO | 1 | 3.635602 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2017-07-12T09:27: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": "351c2ddf6... |
2d9bcdd1-5fe4-46c4-995e-d39888dd2eb5 | ARILIANO/project_the-coughing-note | Band_smoke_ring_generator-Part.ino | //this part is for stepper motor's motion
#include <AudioAnalyzer.h>
Analyzer Audio = Analyzer(2,3,5);
long coughtime[7];
long shaketime[7];
long lasttime=0;
int FreqVal[7];//
int xielv[2]={0,0};
int note=0; //coungt times i have coughed
boolean detect=true;
boolean drive=true;
long offtime;
void setup() {
Seri... | ALGO | 0.946775 | 4.748921 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2018-11-08T11:42: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": "7bbc0e9587... |
ea725122-6d7d-42d2-9969-c411cd7f9254 | LutzGross/esys-escript.github.io | trilinos_source15/packages/nox/src-loca/src/LOCA_Hopf_MooreSpence_SolverFactory.H | // $Id$
// $Source$
//@HEADER
// ************************************************************************
//
// LOCA: Library of Continuation Algorithms Package
// Copyright (2005) Sandia Corporation
//
// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
// license for use... | ALGO | 0.986444 | 6.800628 | {
"github_metadata": {
"branch": "master",
"commit_count": 5724,
"repo_created_at": "2020-08-10T02:31:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 34,
"forks": 15,
"issues": 63,
"pull_requests": 0
},
"file_meta": {
"content_id": "432d... |
5e01b2ee-334d-401f-9d52-9a81d47c6061 | khanhtc1202/cp | leetcode/prepare/552.cpp | /*
https://leetcode.com/problems/student-attendance-record-ii/
*/
#include <bits/stdc++.h>
using namespace std;
class Solution {
public:
int _checkRecord(int n) {
int mod = 1e9+7;
int dp[n+1][2][3];
memset(dp, 0, sizeof(int) * 6 * (n+1));
dp[0][0][0] = 1;
for (int i = 0; i... | ALGO | 0.999997 | 4.89106 | {
"github_metadata": {
"branch": "master",
"commit_count": 1266,
"repo_created_at": "2018-04-28T06:43:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 4
},
"file_meta": {
"content_id": "ca45c70... |
d3683cab-c393-4513-a4d1-5217fd097e44 | kawser25350/Problem-Solving | week_1/day_2/H_HOW_Many.cpp | /* autor: <NAME>
* 2024
*
*/
#include "bits/stdc++.h"
using namespace std;
#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 l... | ALGO | 0.99993 | 5.55876 | {
"github_metadata": {
"branch": "main",
"commit_count": 16,
"repo_created_at": "2024-06-07T14:11:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "32158d66394... |
0aab1dcd-7178-4ba0-a468-79e364900750 | Golangltd/codeclass | interface{}/src/opencv-master/opencv110/cv/src/cvmoments.cpp | /*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, instal... | ALGO | 0.993959 | 6.022974 | {
"github_metadata": {
"branch": "master",
"commit_count": 206,
"repo_created_at": "2018-08-14T03:58:28.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 615,
"forks": 195,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "ae4a3... |
76d335fc-8f83-4e99-942c-edca4e4e2846 | abdullaabdullazade/rio-semifinal-submissions-2025 | Əkbər_Əhmədov_İlham oğlu_9.0_21_40BAL_RIO2025_Semifinal_J4.cpp | #include <bits/stdc++.h>
#define GOOD_LUCK ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define int long long
#define itn int
#define endl "\n"
#define ff first
#define ss second
#define pb push_back
#define ppb pop_back
#define ins insert
#define lb lower_bound
#define ub upper_bound
#define bs binary_se... | ALGO | 0.999989 | 4.196966 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-02-24T15:39: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": "57e1f7e2a31d... |
ac733f4a-608b-44b7-83e9-fdea2335bfd1 | AnasImloul/Leetcode-Solutions | scripts/algorithms/M/Maximum Split of Positive Even Integers/Maximum Split of Positive Even Integers.cpp | // Runtime: 308 ms (Top 27.53%) | Memory: 40.6 MB (Top 11.24%)
class Solution {
public:
using ll = long long;
ll bs(ll low , ll high, ll fs){
ll ans = 1;
while(low<=high){
ll mid = low + (high-low)/2;
if(mid*(mid+1)>fs){
high = mid-1; // If sum till inde... | ALGO | 0.999653 | 5.000459 | {
"github_metadata": {
"branch": "main",
"commit_count": 5405,
"repo_created_at": "2022-08-07T11:14:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 382,
"forks": 120,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fa29d... |
3fb93ee5-74e7-42f0-bb76-5af38862d518 | Hangjun/CPPLeetCode | 598. Range Addition II.cpp | /*
Given an m * n matrix M initialized with all 0's and several update operations.
Operations are represented by a 2D array, and each operation is represented by an array with two positive integers a and b, which means M[i][j] should be added by one for all 0 <= i < a and 0 <= j < b.
You need to count and return the ... | ALGO | 0.999937 | 6.796155 | {
"github_metadata": {
"branch": "master",
"commit_count": 852,
"repo_created_at": "2013-11-06T14:49:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7e046fef... |
3d81eab7-2ee3-4ff2-8e28-fad77fbd04ea | SegmentFaults/SchoolProjects | Introduction to C++/Homework/Problem1.cpp | //<NAME>
//CSE 253
//Section A
//Prof. <NAME>
//Problem 1 of Homework
#include <iostream>
using namespace std;
struct Distance {
int feet;
int inch;
}distance1, distance2, sum;//declare the distances
int main() {
cout << "Enter the first distance in feet and inches." << endl;
cout << "Please enter feet " << endl... | TOOL | 0.938985 | 3.344771 | {
"github_metadata": {
"branch": "FullBranch",
"commit_count": 17,
"repo_created_at": "2017-10-22T05:52: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": "0afe0... |
814f5323-96bd-4fea-a19c-2a481c2a44d0 | kkhanipov/RPA-Optimization | RPA/main.cpp | #include <iostream>
#include "Array_Sequences.h"
#include "Primer_Set.h"
#include "Optimization_Toolbox.h"
#include <time.h>
#include "PCR_Profile.h"
#include <fstream>
#include <cstdlib>
using namespace std;
void test_1()
{
double * x = new double[100];
double * y = new double[100];
bool * pareto = new bool[100];
... | ALGO | 0.996717 | 3.866683 | {
"github_metadata": {
"branch": "master",
"commit_count": 25,
"repo_created_at": "2018-02-11T16:20:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e2970a0a5... |
ff68953a-eb4f-4ef4-aec7-25db95ae4b24 | DineshMeegada/Striver_A2Z_Sheet | 14. Binary Search Trees/14.1 Concepts/1_BinarySearchTrees.cpp | #include <bits/stdc++.h>
using namespace std;
struct TreeNode {
int data;
TreeNode *left;
TreeNode *right;
TreeNode() : data(0), left(nullptr), right(nullptr) {}
TreeNode(int x) : data(x), left(nullptr), right(nullptr) {}
TreeNode(int x, TreeNode *left, TreeNode *right) : data(x), left(left), r... | ALGO | 0.999983 | 5.259562 | {
"github_metadata": {
"branch": "main",
"commit_count": 327,
"repo_created_at": "2023-07-23T07:53: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": "929cf3e6f6... |
c5a424fb-e105-4a48-91b7-30d5f079af10 | fetchai/ledger | libs/ml/include/ml/ops/reduce_mean.hpp | #pragma once
//------------------------------------------------------------------------------
//
// Copyright 2018-2020 Fetch.AI Limited
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the Licen... | TOOL | 0.912199 | 7.46586 | {
"github_metadata": {
"branch": "master",
"commit_count": 2056,
"repo_created_at": "2018-01-15T16:15:05.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 84,
"forks": 43,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dc78bc... |
b46eb528-7580-4c61-998f-65aaabe2e8a4 | ABenazzou/Competitive-Programming | CP4/Chapter1/Section 6/d/Kattis_turtlemaster.cpp |
/*
* Author: @adnanebenazzou
*/
#include <bits/stdc++.h>
using namespace std;
template<typename A, typename B> ostream& operator<<(ostream &os, const pair<A, B> &p) { return os << '(' << p.first << ", " << p.second << ')'; }
template<typename T_container, typename T = typename enable_if<!is_same<T_container, stri... | ALGO | 0.999619 | 4.333481 | {
"github_metadata": {
"branch": "main",
"commit_count": 93,
"repo_created_at": "2025-01-05T21:03:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bb8963869d2... |
b73b2426-3897-4a3f-b929-281400e08b91 | rahulkumarguptaa/coding-ninjas-data-structure | Hashmaps/Pairs with difference K.cpp | /*
You are given with an array of integers and an integer K. You have to find and print the count of all such pairs which have difference K.
Note: Take absolute difference between the elements of the array.
Input Format:
The first line of input contains an integer, that denotes the value of the size of the array. Let u... | ALGO | 0.999928 | 5.506201 | {
"github_metadata": {
"branch": "main",
"commit_count": 22,
"repo_created_at": "2021-12-19T18:11:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 64,
"forks": 49,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "3c9e2c576... |
dcd5ce16-0beb-4605-a509-b50279a2c615 | drunkwater/leetcode | medium/cpp/c0197_384_shuffle-an-array/00_leetcode_0197.cpp | // DRUNKWATER TEMPLATE(add description and prototypes)
// Question Title and Description on leetcode.com
// Function Declaration and Function Prototypes on leetcode.com
//384. Shuffle an Array
//Shuffle a set of numbers without duplicates.
//Example:
//// Init an array with set 1, 2, and 3.
//int[] nums = {1,2,3};
//So... | ALGO | 0.999572 | 5.655016 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2018-04-03T03:07:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "63755675f5... |
57dc5657-9258-40e7-bb68-7daf7282d68c | LCAD-UFES/carmen_lcad | sharedlib/libviso2.3/src/viso.cpp | /*
Copyright 2011. All rights reserved.
Institute of Measurement and Control Systems
Karlsruhe Institute of Technology, Germany
This file is part of libviso2.
Authors: <NAME>
libviso2 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 ... | ALGO | 0.937148 | 5.715874 | {
"github_metadata": {
"branch": "master",
"commit_count": 8938,
"repo_created_at": "2015-11-04T21:33:42.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 66,
"forks": 31,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "40c1b0... |
274d5c5a-e189-4019-8b29-f72c3b3cab94 | 543877815/algorithm | leetcode/c++/309. Best Time to Buy and Sell Stock with Cooldown.cpp |
// 时间复杂度:O(n)
// 空间复杂度:O(n)
class Solution {
public:
int maxProfit(vector<int> &prices) {
int n = prices.size();
if (n <= 1) return 0;
// 记录第i天卖出的最大收益
vector<int> sell(n, 0);
// 记录到第i天最后一个操作是买进的最大收益
vector<int> buy(n, 0);
// 记录到第i天是冻结状态的最大收益
vector<in... | ALGO | 0.999928 | 5.073839 | {
"github_metadata": {
"branch": "master",
"commit_count": 283,
"repo_created_at": "2019-05-26T12:35: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": "57ce18d0... |
3e623b58-f01c-4cab-aa27-b8f03b647998 | ishandutta2007/codeforces-t | teraqqq/normal/1641/B.cpp | #include <bits/stdc++.h>
#define F first
#define S second
using namespace std;
using ll = long long;
using pi = pair<int, int>;
using vi = vector<int>;
template<class T> bool ckmin(T& a, const T& b) { return b < a ? a = b, true : false; }
template<class T> bool ckmax(T& a, const T& b) { return a < b ? a = b, true : ... | ALGO | 0.999711 | 3.558822 | {
"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": "f82ec90521cb... |
227819de-7fa9-47d6-96ed-349741641ae5 | 95gas/Mad-pod-racing | Mad Pod Racing.cpp | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
using namespace std;
/**
* Class representing the Checkpoint object
*/
class Checkpoint {
public:
int x;
int y;
int dist;
int angle;
int radius = 600;
};
/**
* Class ... | ALGO | 0.99847 | 4.251176 | {
"github_metadata": {
"branch": "main",
"commit_count": 16,
"repo_created_at": "2023-04-16T13:56: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": "93bc569e91f... |
da6e84f9-5891-41c2-bfe5-892fe34f72f9 | milkcat1994/Algorithm_HW2_KnapSack_Problem | HW2_KnapSack_Problem/HW2_KnapSack_Problem/KnapSack.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
using namespace std;
unsigned long subset_num = 0; //How many subset
//Vector, current sum, pick num(big_num), current index
unsigned long cal(vector<int> v, int sum, unsigned long* arr) {
vector<int>::iterator v_it;
int temp = 0;
//i... | ALGO | 0.999427 | 3.902439 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2017-05-01T09:07:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f71bae6178... |
736cdfdf-6606-43c6-b8da-cb54c4355f7e | dothanhdathp/PracticeCode | C++/31_Next_Permutation_Leet_Code/31_Next_Permutation_Leet_Code.cpp | #include <cstdlib>
#include <iostream>
#include <algorithm>
#include <vector>
//#include "stdio.h"
using namespace std;
#define LOG(...) logs(NUMARGS(__VA_ARGS__), __VA_ARGS__);
#define NUMARGS(...) std::tuple_size<decltype(std::make_tuple(__VA_ARGS__))>::value;
// std::cout << "num args: "
// << std::tuple_si... | ALGO | 0.999924 | 4.602941 | {
"github_metadata": {
"branch": "main",
"commit_count": 69,
"repo_created_at": "2022-01-05T06:29: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": "81f91247aa3... |
3e7f4d9e-9c4a-4e93-bb7b-3381d0e899f2 | CajazeiraAlexandre/geometria_comp | poligono.cpp | #include "poligono.h"
#include "fecho2d.h"
void Poligono::trocar(int i, int j) {
int N = this->points.size();
if(i>=0 && j < N){
Coord_2D* z = new Coord_2D(this->points.at(i)->x,this->points.at(i)->y);
this->points.at(i)->x = this->points.at(j)->x;
this->points.at(i)->y = this->points.... | ALGO | 0.99699 | 4.133788 | {
"github_metadata": {
"branch": "master",
"commit_count": 35,
"repo_created_at": "2018-03-22T01:34: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": "676ed2484... |
3cb9aa86-fd38-46e4-a5b3-3bf1e3000470 | soda1210/LeetCode | Easy/1047_Remove_All_Adjacent_Duplicates_In_String/main.cpp | #include <iostream>
#include <string>
#include <stack>
#include <algorithm>
using namespace std;
class Solution {
public:
string removeDuplicates(string S) {
stack<char> st;
for (char s : S) {
if (st.empty() || s != st.top()) {
st.push(s);
} else {
... | ALGO | 0.999652 | 6.004055 | {
"github_metadata": {
"branch": "main",
"commit_count": 50,
"repo_created_at": "2025-04-27T12:16: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": "10515fd1352... |
7be57fb7-8aff-46d7-ae53-c4196f8e4df5 | sora1441/3013-DS-Laden | Assignments/A03/priority_heap.cpp | /*
<NAME>
October 7, 2019
CMPS 3013
A03
The program reads in a json file of animals, including
name, date, log, lat, priority, validation, and version.
They are sorted into arrays of priorty queues. It will
then remove the top 5 animals from each heap and print
them out
*/
#include "json_helper.cpp"
#include <fstream... | ALGO | 0.997269 | 4.776314 | {
"github_metadata": {
"branch": "master",
"commit_count": 25,
"repo_created_at": "2019-08-29T16:43: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": "e37c41cc3... |
d7e7cff0-4c4b-4dc6-9627-ef8100067ac0 | adityanjr/cb_launchpad | course_assignments/Challenges - Linked Lists/9. Rat chases its Cheese.cpp | #include <iostream>
#define ll long long
using namespace std;
char maze[1000][1000];
int result[1000][1000];
void printresult(int n, int m){
for (int i=0; i<n; i++) {
for (int j=0; j<m; j++) {
cout << result[i][j] <<" " ;
} cout << endl ;
}
cout << endl;
}
bool ratmaze(int n, ... | ALGO | 0.999966 | 4.566571 | {
"github_metadata": {
"branch": "master",
"commit_count": 159,
"repo_created_at": "2019-09-11T06:09:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "ac806cbb... |
f299b4c4-4e48-4a7f-a4fc-00efc94cc890 | Alquama00s/Competitive-Coding | Codechef/longchallenges/20-8-auglong/SKMP/skmpAC.cpp | #include<iostream>
#include<string>
#include<bits/stdc++.h>
#include<set>
//using std::string;
using namespace std;
void _erase(char c, multiset<char> &al){
auto itra = al.find(c);
if(itra!=al.end()){
al.erase(itra);
}
}
multiset<char> multi_conv(string sal){
multiset<char> al;
for(int i=0;i<sal.leng... | ALGO | 0.999961 | 4.661836 | {
"github_metadata": {
"branch": "master",
"commit_count": 22,
"repo_created_at": "2020-08-17T20:18: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": "ee2d80ab1... |
fed799da-c2dc-400d-abb0-b57acbfe2690 | Yawn-Sean/Daily_CF_Problems | daily_problems/2024/07/0729/personal_submission/cf1105d_kamtuo.cpp | /*----------------------------------*/
/* Author : KaMtuo */
/* Email : <EMAIL> */
/* Creation_time : 2024-07-29 20:44 */
/* Software : Visual Studio Code */
/*----------------------------------*/
int main() {
std::ios::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullp... | ALGO | 0.999615 | 4.875001 | {
"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": "ac4f... |
9206b8ce-4094-42a0-bf82-e9dd63b745cc | Gr-moura/CP_Problems | First_Semester/Solved/OBI_Toupeira.cpp | #include <algorithm>
#include <bits/stdc++.h>
using namespace std;
#define fast_io cin.tie(0)->sync_with_stdio(0);
#define dbg(x) cout << #x << " = " << x << endl
#define all(x) x.begin(), x.end()
#define sz(a) ((int)((a).size()))
#define int long long
#define endl '\n'
#define f first
#define s second
#define pb push... | ALGO | 0.999416 | 3.848452 | {
"github_metadata": {
"branch": "master",
"commit_count": 106,
"repo_created_at": "2024-05-19T03:48:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f63b475e... |
bebb75a8-52e3-409d-b225-a51897665a69 | sunyzm/ZGeometry | ZGeom/include/ZGeom/VecN.h | #ifndef ZGEOM_VECN_H
#define ZGEOM_VECN_H
#include <cassert>
#include <algorithm>
#include <vector>
#include <numeric>
#include <stdexcept>
#include <iterator>
#include <functional>
#include "common.h"
namespace ZGeom {
template<typename T> class VecN;
template<typename T> class SparseMatrix;
template<typename T> Vec... | TOOL | 0.928507 | 6.221203 | {
"github_metadata": {
"branch": "master",
"commit_count": 530,
"repo_created_at": "2012-08-15T02:38: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": "d287fdde... |
98fe7bc9-19ea-4edd-aec7-ea1eeb067559 | lgratian/compiler | RangeSimplifier.cpp | // RangeSimplifier.cpp
// Copyright (c) <NAME>
//
// Implements the Range Simplifier pass.
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#include "RangeSimplifier.hpp"
#include "../IR/IRPrinter.hpp"
namespace Optimization {
void RangeSimplifier::Execute(Function* function) {... | TOOL | 0.994752 | 6.921392 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2012-06-05T15:20:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2c40c2a685... |
7b2a62c2-239d-42b0-a4b8-2109a254dd21 | shangjingbo1226/SegPhrase | src/preprocessing/from_raw_to_binary.cpp | #include "../utils/helper.h"
#include <cassert>
const string ENDINGS = ".!?,;:()\"[]";
int main(int argc, char* argv[])
{
if (argc != 3) {
cerr << "[Usage] <input-raw-text-file> <output-binary-file>" << endl;
return -1;
}
FILE* in = tryOpen(argv[1], "r");
vector<string> sentences;
for (;getLine(in);) {
s... | TOOL | 0.924445 | 4.609408 | {
"github_metadata": {
"branch": "master",
"commit_count": 83,
"repo_created_at": "2015-03-07T21:29:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 265,
"forks": 94,
"issues": 5,
"pull_requests": 0
},
"file_meta": {
"content_id": "b94d5d... |
6d927fdf-0bd6-4dc6-9db1-d81dffab267e | Hyeondeok-Shin/qmcpack | src/Particle/SoaDistanceTableAA.h | //////////////////////////////////////////////////////////////////////////////////////
// This file is distributed under the University of Illinois/NCSA Open Source License.
// See LICENSE file in top directory for details.
//
// Copyright (c) 2016 <NAME> and QMCPACK developers.
//
// File developed by: <NAME>, <EMAIL>... | ALGO | 0.984114 | 5.92497 | {
"github_metadata": {
"branch": "develop",
"commit_count": 18080,
"repo_created_at": "2019-09-11T23:19:19.000Z",
"is_fork": true,
"is_org_owned": false,
"forked_from": "QMCPACK/qmcpack",
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content... |
03d1034b-4ea0-4abe-8969-631134fcbced | glerium/acm-life | contest/240915-icpc-online-1/F2.cpp | #include <bits/stdc++.h>
#define rep(i,x,y) for(int i=x;i<=y;i++)
#define endl '\n'
using namespace std;
typedef long long ll;
constexpr int maxn = 2e5+10;
int n, a[maxn];
struct Node {
int l,r;
int val;
int size() {return r-l+1;}
bool operator<(const Node& rhs)const {
if(val != rhs.val)
... | ALGO | 0.999931 | 4.61158 | {
"github_metadata": {
"branch": "main",
"commit_count": 85,
"repo_created_at": "2023-05-16T06:00:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ca1d60d1f19... |
a944535b-9137-4429-9518-c01b27d03f32 | cfs6/DSandAlgorithm | jianzhiOffer/FindFIrstCommenNode.cpp | #include<iostream>
#include<vector>
using namespace std;
vector<int> splitnum(int num) {
vector<vector<int>> r;
vector<int> digit;
int count = 0;
int n = num;
while (n != 0) {
n /= 10;
count++;
}
for (int i = count; i>0; --i) {
int d = num / (pow(10, i - 1));
if (d / 10 == 0) {
digit.push_back(d);
... | ALGO | 0.999905 | 4.661254 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2019-09-02T02:23: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": "eb3018cea7... |
648f9ff7-69fd-41ed-8c39-5235630c81aa | kisstom/cppdist | src/cpp/main/common/graph_converter/inverse.cpp | #include "inverse.h"
#include <time.h>
Inverse::Inverse(char * input, int nnode) {
nnode_ = nnode;
input_ = fopen(input, "r");
if (input_ == NULL) {
fprintf(stderr, "Error opening file %s\n", input);
}
inverse_.resize(nnode);
MAX_ROW_LEN = 15000000;
}
void Inverse::mytime() {
time_t rawtime;
stru... | DATA | 0.996553 | 3.407131 | {
"github_metadata": {
"branch": "master",
"commit_count": 518,
"repo_created_at": "2015-02-02T14:33:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "64ef1bb9... |
525ff4c7-5c2c-422d-9b48-c9990f45b1f2 | A1aM0/DataStructure-and-Algorithm | Leetcode/922-Sort_Array_By_Parity_II/main.cpp | /*!
* @brief 按奇偶排序数组 II
*
* 给定一个非负整数数组 A, A 中一半整数是奇数,一半整数是偶数。
* 对数组进行排序,以便当 A[i] 为奇数时,i 也是奇数;当 A[i] 为偶数时, i 也是偶数。
* 你可以返回任何满足上述条件的数组作为答案。
*/
#include <bits/stdc++.h>
using namespace std;
class Solution {
public:
vector<int> sortArrayByParityII(vector<int>& A) {
// 不原地的算法:
// 遍历一遍数组把所有的偶数放进 a... | ALGO | 0.999984 | 5.341753 | {
"github_metadata": {
"branch": "master",
"commit_count": 267,
"repo_created_at": "2019-09-11T06:32: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": "96a27cce... |
113ef100-dd44-4a88-ab0a-f997ba0b6bb8 | Pigrabbit/coding-test | bfs/seek.cpp | // Problem: https://www.acmicpc.net/problem/1697
#include <iostream>
#include <queue>
#include <vector>
const int MAX_POS = 100000;
int dx[3] = {-1, 1};
bool visited[MAX_POS + 1];
std::vector<int> timeConsumed(MAX_POS+1, -1);
std::queue<int> bfsQueue;
void bfs(int pos, int target) {
if (pos == target) {
... | ALGO | 0.999921 | 4.190948 | {
"github_metadata": {
"branch": "master",
"commit_count": 174,
"repo_created_at": "2020-01-23T05:29: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": "518bc285... |
21033939-c417-4995-8f77-e6d92f5caec6 | abdillahmufki/TugasKuliahAlgoritmaPraktikum | 01_compiling/latihanSmt2/TugasPraktikum/tugas1.cpp | #include <iostream>
using namespace std;
main()
{
int i;
int cari, ketemu;
int jmlData;
int A[100];
cout << "Jumlah Data : ";
cin >> jmlData;
cout << "\n";
for (i = 1; i <= jmlData; i++)
{
cout << "masukan data ke-" << i << " : ";
cin >> A[i];
}
cout << endl;... | ALGO | 0.99807 | 3.985754 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-03-24T16:27:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e6fa3835e357... |
75660baa-0a97-464f-81cd-61578277920e | Ankit2563/Codeforces | SubSeqAdd.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define vi vector<ll>
#define vpi vector<pair<long long,long long>>
#define vint vector<int>
#define all(v) v.begin(), v.end()
#define MOD 1000000007
#define MOD2 998244353
#define MX 1000000000
#define MXL 1000000000000000000
#define PI (ld)2*acos(0.0)
... | ALGO | 0.999736 | 4.9024 | {
"github_metadata": {
"branch": "main",
"commit_count": 55,
"repo_created_at": "2023-08-19T06:19: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": "869e69228c9... |
aa54e037-6051-4f1a-b897-7068f570f2b2 | clxxrlove/algorithm-study-cpp | 4153/main.cpp | //
// main.cpp
// 4153
//
// Created by 정지용 on 4/15/25.
//
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int a, b, c;
void fast_io() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
}
bool input() {
cin >> a >> b >> c;
if (a == 0 && b == 0 && c == 0) r... | ALGO | 0.999914 | 4.262612 | {
"github_metadata": {
"branch": "main",
"commit_count": 95,
"repo_created_at": "2025-01-19T11:47: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": "aaa5bf7b30e... |
d8f15855-9020-45e9-882c-b8cda35e5c3e | dezzmol/algorithms | src/codeforce/itmo_academy_course/two_pointers/step_2/TaskB.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
unsigned long long s;
int n;
cin >> n >> s;
vector<int> a(n);
for (int i = 0; i < n; ++i) {
cin >> a[i];
}
int res... | ALGO | 0.999914 | 3.903939 | {
"github_metadata": {
"branch": "master",
"commit_count": 156,
"repo_created_at": "2024-04-28T16:21: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": "ab08ba89... |
6b819e8a-f071-42eb-9ada-fa957d6b695e | 2281940985/DataStruct | BackTracking/preorder_traversal.cpp | #include"../Tree/TreeNode.hpp"
void PreOrderWithPath(TreeNode<int> *root, vector<int> &path, vector<vector<int>> &res)
{
//剪枝
if(root == nullptr)
{
return;//回溯首先要考虑当函数走到底要怎么操作,这里是返回,有些情况是返回一个值
}
//尝试
path.push_back(root ->Val);//先添加path,找到符合要求的path后在存入res
if (root ->Val == 7)
{
... | ALGO | 0.999919 | 4.13404 | {
"github_metadata": {
"branch": "main",
"commit_count": 34,
"repo_created_at": "2024-04-02T09:58: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": "f9bd9a1b192... |
42b6c89a-5ea1-4211-9787-c15562d57189 | lztttt/CPP | 04.07.cpp | // 定义一个电话簿类,包括2个数据:北京工商大学的机构名称和编码,自行分析成员函数。要求通过对象的用法从键盘上输入要查找的编码,查出与之对应的机构名称并输出。
// 注意:本题预设代码中的对象数组已经初始化。
#include <iostream>
#include <cstring>
using namespace std;
class btbucodesheet
{
private:
int num;
string name;
int code;
public:
btbucodesheet(int c, string n)
{
num = c;
name... | TOOL | 0.90445 | 3.729872 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2025-05-13T03:14: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": "f8ef4eb3e825... |
b287a83e-1159-44c1-82cb-152f6801680c | trolando/Divine2 | divine/expression.h | // -*- C++ -*-
#include <iostream>
#include <vector>
#include <cassert>
enum Op {
SetOp, // set location c to value a (ByteCode only)
ConstOp, // constant operand (Expression only)
AddOp, SubOp, DivOp, MulOp, // arithmetic; a, b are operands,
// c is output location
And... | ALGO | 0.977068 | 6.424825 | {
"github_metadata": {
"branch": "master",
"commit_count": 49,
"repo_created_at": "2014-09-15T11:03: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": "23141b3dc... |
57553041-3504-4c03-82d2-24a8189aa1f7 | Srivatsha108/LeetCode | Floor in a Sorted Array - GFG/floor-in-a-sorted-array.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution{
public:
// Function to find floor of x
// n: size of vector
// x: element whose floor is to find
int findFloor(vector<long long> v, long long n, long long x){
// Your code here... | ALGO | 0.999935 | 5.749849 | {
"github_metadata": {
"branch": "main",
"commit_count": 337,
"repo_created_at": "2022-11-20T15:11: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": "11460d322a... |
8f15efca-6946-4557-a587-545e62ac1aeb | eggag32/Competitive-Programming | Codeforces/Baby Ehab Partitions Again.cpp | #pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef pair<int, int> pi;
#define debug(x) cerr << #x << ": " << x << '\n'
#define debug2(x, y) debug(x), debug(y)
#define repn(i, a, b) for(int i ... | ALGO | 0.999963 | 3.358268 | {
"github_metadata": {
"branch": "master",
"commit_count": 24,
"repo_created_at": "2020-09-24T22:38:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "42a1b53e2... |
c3388708-baeb-4f86-81a1-32ec1350a53c | sngkr/MyProject | PAT/1032.cpp | // #include <cstdio>
// using namespace std;
// struct NODE
// {
// int next;
// bool flag;
// } node[100000];
// int main()
// {
// int first1, first2, num;
// scanf("%d %d %d", &first1, &first2, &num);
// char temp;
// int a, b;
// for (int i = 0; i < num; i++)
// {
// scanf(... | ALGO | 0.999964 | 3.562481 | {
"github_metadata": {
"branch": "master",
"commit_count": 28,
"repo_created_at": "2021-09-05T06:30: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": "63abf8726... |
b10e8293-c004-44d9-b2df-3020a99a4e3c | dgaydukov/projecteuler | tasks/9.cpp | /*
A Pythagorean triplet is a set of three natural numbers, a < b < c, for which,
a2 + b2 = c2
For example, 32 + 42 = 9 + 16 = 25 = 52.
There exists exactly one Pythagorean triplet for which a + b + c = 1000.
Find the product abc.
*/
#include <iostream>
#include <ctime>
#include <math.h>
long run(int n)
{
f... | ALGO | 0.999942 | 4.347672 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2019-07-08T02:19: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": "a82ae1ead... |
f492e8fb-4e44-46bc-8f0a-8f47715d7b6f | Aliluev/Laba_4 | Laba_Vector/Vector.h | #pragma once
#include <iostream>
#include <clocale>
#include <iomanip>
#include"Matrix.h"
using namespace std;
template <class Vector>
class MyVector
{
protected:
int razmer;
Vector* massiv;
public:
MyVector();
MyVector(int r, Vector* A);
MyVector(MyVector& B);
~MyVector();
Vector* GetVector();
int Get... | TOOL | 0.955386 | 3.272039 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2020-05-15T22:11: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": "52d23cdbe3... |
4427fada-eb3a-402c-8dda-f9092d98d481 | DonghoonPark12/problem_solving | Problem_Solving/BOJ/2591.cpp | //#include <iostream>
//#include <string>
//using namespace std;
//
//int recur(string s)
//{
// if (s.size() == 2)
// {
// if (s[0] == '0')
// return 0;
// else if (s[1] == '0') {
// if (stoi(s) > 40)
// return 0;
// else
// return 1;
/... | ALGO | 0.999877 | 3.910229 | {
"github_metadata": {
"branch": "master",
"commit_count": 141,
"repo_created_at": "2019-05-13T04:00:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a4580ef7... |
afbcc052-1fd9-4f01-9d8d-561085cec6f1 | tushar8133/radio | project4/project4.ino | /*
TODO:
make use of getSettingsValue methods
Add reset into settings
Auto apply optimal settings as per selected band
AGC/ATT auto adjust rectify
Save station to EEPROM
Volume BAR
Skip unused band while manual tuning
Show settings text instead of numbers
Better SNR bar
Avoid unneccesary updates to oled
Improve rotary ... | TOOL | 0.955727 | 6.759327 | {
"github_metadata": {
"branch": "master",
"commit_count": 71,
"repo_created_at": "2022-03-08T18:21:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e2befd7a4... |
cfca223e-3ef0-481e-b343-4ef6e060f450 | chr1sc2y/LeetCode_Archiver | LeetCode/cpp/801.cpp | class Solution {
public:
int minSwap(vector<int> &A, vector<int> &B) {
int n = A.size();
if (n == 0)
return 0;
vector<vector<int>> dp(2, vector<int>(n, INT_MAX));
dp[0][0] = 0;
dp[1][0] = 1;
for (int i = 1; i < n; ++i) {
if (A[i - 1] < A[i] && ... | ALGO | 0.999996 | 5.60119 | {
"github_metadata": {
"branch": "master",
"commit_count": 114,
"repo_created_at": "2019-01-17T05:27:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 207,
"forks": 3,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "b5ff13... |
0199dec8-b28a-4aa5-a93b-482e068d2950 | nguyenlong1019/1000ProgrammingExercises | C++/e19.cpp | #include<iostream>
using namespace std;
int power(int x, int n)
{
int res = 1;
for(int i = 1; i <= n; i++)
res *= x;
return res;
}
int sum(int n)
{
int res = 0;
for(int i = 1; i <= n; i++)
res += i;
return res;
}
int fac(int num)
{
int res = 1;
for(int i = 1; i <= num;... | ALGO | 0.999928 | 4.365798 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2023-10-20T04:01: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": "a8622392202d... |
ddb52454-ddad-4280-bc49-3a9c83b85e81 | offercantrefuse/Problem_Solving | SWEA/View(D3).cpp | #define _CRT_SECURE_NO_WARNINGS
#define max(a,b) ((a>b)?a:b)
#include <stdio.h>
int main() {
int T, n;
int i;
int arr[1000] = { 0, };
int cnt;
int tmp1,tmp2,tmp3;
for (T = 1; T <= 10; T++) {
scanf("%d", &n);
int sum = 0;
for (i = 0; i < n; i++) {
scanf("%d", &arr[i]);
}
for (i = 2; i < n - 2;... | ALGO | 0.999786 | 3.301468 | {
"github_metadata": {
"branch": "master",
"commit_count": 113,
"repo_created_at": "2018-06-27T05:44:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9fdbecb6... |
832ea01f-5619-4080-87dd-6c24c53e86b6 | zzwblog/AlgorithmCode | 剑指offer/51丑数.cpp | //#include "head.h"
////使用遍历判断的方法
//class Solution01 {
//public:
// int GetUglyNumber_Solution(int index) {
// if (index < 1)return 0;
// int cnt = 0;
// for (int i = 1; cnt < index; ++i)
// {
// if (isChouShu(i))
// cnt++;
// if (cnt == index)
// return i;
// }
// }
// bool isChouShu(int num)
// {
// w... | ALGO | 0.999957 | 3.966431 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-09-03T10:47: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": "824ccafba5... |
4a6b1356-9efa-405a-804d-e204ec4f522d | nekosilverfox/Parallel-computing | OpenMP/020_clause_private/main.cpp | #include <iostream>
#include <omp.h>
#include <unistd.h>
int main()
{
std::cout << "===== clause private =====" << std::endl;
double a[1000], b[1000], c[1000], d[1000];
double tmp = 2.333333;
for (int i = 0; i < 1000; ++i)
{
a[i] = i;
b[i] = 1000 - i;
}
/* 每个线程都有与此变量**同名**... | TEST | 0.996346 | 3.556142 | {
"github_metadata": {
"branch": "main",
"commit_count": 70,
"repo_created_at": "2023-08-23T19:19:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8dfd3da935e... |
603d45e1-35d3-4e85-88e2-10cbda0d1cdc | PointCloudLibrary/pcl | doc/tutorials/content/sources/correspondence_grouping/correspondence_grouping.cpp | #include <pcl/io/pcd_io.h>
#include <pcl/point_cloud.h>
#include <pcl/correspondence.h>
#include <pcl/features/normal_3d_omp.h>
#include <pcl/features/shot_omp.h>
#include <pcl/features/board.h>
#include <pcl/filters/uniform_sampling.h>
#include <pcl/recognition/cg/hough_3d.h>
#include <pcl/recognition/cg/geometric_con... | ALGO | 0.995023 | 6.599022 | {
"github_metadata": {
"branch": "master",
"commit_count": 14566,
"repo_created_at": "2013-02-12T16:40:25.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 10495,
"forks": 4656,
"issues": 432,
"pull_requests": 147
},
"file_meta": {
"content_id... |
3d8e073f-67d6-4006-a1d0-fac4b2c012d8 | kritikarag/DSA-Prep | Binary Search/sum_of_square_numbers.cpp | // https://leetcode.com/problems/sum-of-square-numbers/
bool isPerfectSquare(int num)
{
long long low = 1, high = num;
while (low <= high)
{
long long int mid = low + (high - low) / 2;
if (mid * mid == num)
return true;
else if (mid * mid < num)
{
low... | ALGO | 0.999942 | 5.406166 | {
"github_metadata": {
"branch": "main",
"commit_count": 882,
"repo_created_at": "2022-05-02T23:12:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d07bbd89fb... |
af60016b-0c69-4427-8fe8-682377d7046b | gwkdgwkd/leetcode | c_c++/常用数据结构/常用枚举技巧/枚举右维护左/2815.数组中的最大数对和.cpp | /*
给一个下标从0开始的整数数组nums。
请从nums中找出和最大的一对数,且这两个数数位上最大的数字相等。
返回最大和,如果不存在满足题意的数字对,返回-1。
示例1:
输入:nums = [51,71,17,24,42]
输出:88
解释:i=1和j=2,nums[i]和nums[j]数位上最大的数字相等,且总和71+17=88。
i=3和j=4,nums[i]和nums[j]数位上最大的数字相等,且总和24+42=66。
可以证明不存在其他数对满足数位上最大的数字相等,所以答案是88。
示例2:
输入:nums = [1,2,3,4]
输出:-1
解释:不存在数对满足数位上最大的数字相等。
提示... | ALGO | 0.999965 | 5.621906 | {
"github_metadata": {
"branch": "master",
"commit_count": 266,
"repo_created_at": "2019-11-27T11:32: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": "87a84d50... |
a84fe2d6-f28d-483b-9856-0d9ed7f8eda6 | ambrsumn/Problem_Solving | 1955-count-number-of-special-subsequences/1955-count-number-of-special-subsequences.cpp | class Solution {
public:
int dp[100001][5];
int mod = (int)(1e9+7);
int recur(vector<int> &nums, int i, int prev)
{
if(i >= nums.size())
{
if(prev == 2)return 1;
return 0;
}
if(dp[i][prev] != -1)return dp[i][prev];
... | ALGO | 0.999991 | 5.448984 | {
"github_metadata": {
"branch": "main",
"commit_count": 1550,
"repo_created_at": "2022-03-21T21:48: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": "ac6537300... |
c8b0cbd9-6490-42e6-9e96-743aa8479e38 | benlindsay/modular-ft | system.cpp | // system.cpp
//
// Copyright (c) 2017 <NAME> <<EMAIL>>
#include "system.hpp"
System::System(input::Input_Reader *ir) {
Lx = new double[DIM];
Nx = new int[DIM];
NxL = new int[DIM];
dx = new double[DIM];
z_local_0 = 0;
V = 1.0;
M = 1;
for (int i = 0; i < DIM; i++) {
Lx[i] = ir->lx_struct.values[i];... | ALGO | 0.956638 | 4.37888 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2017-03-01T17:37: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": "5d9b80aa3d... |
2d21c1c8-710b-4a9d-baff-9a28e89ef7d7 | mfalang/TTK4235 | simulator/fsm.cpp |
#include "fsm.h"
#include "stdio.h"
#include "elev.h"
#include "time.h"
#include "order.h"
#include "exec.h"
#include <stdlib.h> //for exit()
//static int current_destination;
return_codes_t (*state[])(void) = {
fsm_floor_stationary_state,
fsm_initialize_state,
fsm_driving_up_state,
fsm_driving_down... | ALGO | 0.932694 | 4.59666 | {
"github_metadata": {
"branch": "master",
"commit_count": 82,
"repo_created_at": "2019-03-12T10:41:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3f953386a... |
d5ee3de5-f41d-4361-aed8-a0d8047ea92f | shrey-royal/General_CPP | Arrays.cpp | #include<iostream>
using namespace std;
/* we will see that how to pass an array to a function that checks whether the number is prime or not and return the new array of prime numbers */
bool isPrime(int);
int main() {
const int size = 10;
int arr[] = {7, 12, 13, 17, 81, 21, 30, 67, 9, 2}, i;
bool foundP... | ALGO | 0.998978 | 4.429113 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2023-07-15T12:22: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": "6c975dd43... |
08bad156-969d-466b-9937-da4aed05ff5d | Wangzhike/MyCodingInterview2 | 40_LeastNumbers/main.cpp | #include <iostream>
#include <vector>
#include <set>
#include <algorithm>
using namespace std;
#define CODE_NUM 2
#if (CODE_NUM == 1)
int parent(int i) {
return i >> 1;
}
int left(int i) {
return i << 1;
}
int right(int i) {
return (i << 1) + 1;
}
void maxHeapy(vector<int> &heap, int size, int i)... | ALGO | 0.999999 | 4.964869 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2018-09-21T13:12: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": "3b7d9ccdfd... |
05ceda06-5e67-4724-b4ea-da8d6459b3f1 | Amanhacker/Aman-Barnwal-Leetcode-Solutions | 232-implement-queue-using-stacks/232-implement-queue-using-stacks.cpp | class MyQueue {
public:
stack<int> s1, s2;
MyQueue() {
}
void push(int x) {
while(s2.empty() == false) s2.pop();
// Push all the elements form s1 to s2
while(s1.empty() == false) {
s2.push(s1.top(... | ALGO | 0.998729 | 5.578776 | {
"github_metadata": {
"branch": "master",
"commit_count": 2521,
"repo_created_at": "2021-12-24T16:13:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 441,
"forks": 140,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ce1... |
5aef4764-c201-4888-84cd-9f23dea47418 | blizzaaard/lc2015 | insertion_sort_list.cpp |
#include <iostream>
struct ListNode {
int val;
ListNode *next;
ListNode(int x) : val(x), next(NULL) {}
};
//class Solution {
//public:
// ListNode *insertionSortList(ListNode *head) {
// if (!head) {
// return 0;
// }
// ListNode *node = head;
// head = head->nex... | ALGO | 0.999991 | 5.844754 | {
"github_metadata": {
"branch": "master",
"commit_count": 40,
"repo_created_at": "2015-04-06T03: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": "dc2540a36... |
a08d720d-b9df-4013-ad66-478ff46483e8 | andrewlvovsky/Ray-Tracer | grading/hierarchy.h | #ifndef __HIERARCHY_H__
#define __HIERARCHY_H__
#include "object.h"
/*
A hierarchy is a binary tree. We represent the hierarchy as a complete
binary tree. This allows us to represent the tree unambiguously as an
array. All rows (except possibly the last) are completely filled. All
nodes in the last row ar... | ALGO | 0.977889 | 6.419255 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2019-01-17T06:58:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bcbfd88ad... |
4a501960-ad93-4ebb-bedc-431aa2f0308d | CSUwangj/LeetCode | 167.two-sum-ii-input-array-is-sorted.cpp | /*
* @lc app=leetcode id=167 lang=cpp
*
* [167] Two Sum II - Input array is sorted
*/
// @lc code=start
auto speedup = [](){
cin.tie(nullptr);
cout.tie(nullptr);
ios::sync_with_stdio(false);
return 0;
}();
class Solution {
public:
vector<int> twoSum(vector<int>& numbers, int target) {
int begin = 0;
... | ALGO | 0.999897 | 6.079866 | {
"github_metadata": {
"branch": "master",
"commit_count": 77,
"repo_created_at": "2020-10-10T01:43: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": "a7f28b7c9... |
45eefd87-6181-4257-9df5-83cfd9810de7 | sur4jsharma/CP | Heap/heapOperation.cpp | #include<bits/stdc++.h>
using namespace std;
void swap(int& x,int& y)
{
x^=y;
y^=x;
x^=y;
}
void heapify(vector<int>& arr,int index)
{
int n = arr.size();
int max = index;
// left index of root = 2*index +1, since root starts from 0;
//right index of root = 2*index +2
int l = (index<<1... | ALGO | 0.999613 | 3.945601 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2020-06-12T08:37: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": "55b34c5569... |
ef36a67f-f5d5-46ae-bf27-9c2ff48dd701 | ishandutta2007/codeforces-k | kokokostya/normal/1119/E.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
#ifdef LOCAL
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
ios_base::sync_with_stdio(false);
int n;
cin >> n;
vector<int> a(n);
for (int i = 0; i < n; i++) {
cin >> a[i];
}
long long ... | ALGO | 0.999966 | 3.607163 | {
"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": "406643b4034b... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.