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 |
|---|---|---|---|---|---|---|---|
f4160af4-461b-4e40-933f-cc7ce7ae88a8 | raspberrypi/tools | arm-bcm2708/arm-bcm2708hardfp-linux-gnueabi/arm-bcm2708hardfp-linux-gnueabi/include/c++/4.7.1/ext/pb_ds/detail/splay_tree_/splay_tree_.hpp | // -*- C++ -*-
// Copyright (C) 2005, 2006, 2009, 2010, 2011 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library 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
// Foundatio... | ALGO | 0.966524 | 5.346428 | {
"github_metadata": {
"branch": "master",
"commit_count": 98,
"repo_created_at": "2012-02-01T22:31:37.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1900,
"forks": 863,
"issues": 34,
"pull_requests": 7
},
"file_meta": {
"content_id": "032f... |
62b77f0b-721f-4e06-8c64-3fe211cec009 | Mehatabmollik/CPP-Mehatab-Assistance | OperatorFriend7.cpp | #include<iostream>
using namespace std;
class fraction
{
int numo,deno;
public:
fraction(long int n=0,long int d=0)
{
numo=n;
deno=d;
}
friend void operator>>(istream &in,fraction &f)
{
cout<<"Numerator .."<<endl;
in>>f.numo;
cout<<"Denominator.."<<endl;
... | ALGO | 0.969231 | 4.387263 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2023-01-07T07:06:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3ca5c3ee16... |
756a0cce-7bc7-4ef7-992f-c6a6f26a2878 | luliyucoordinate/Leetcode | src/0010-Regular-Expression-Matching/0010.cpp | #include <string>
#include <iostream>
using namespace std;
static int x = []() {std::ios::sync_with_stdio(false); cin.tie(0); return 0; }();
class Solution
{
public:
bool isMatch(string s, string p)
{
int m = s.length(), n = p.length();
deque<deque<bool>> mem(m + 1, deque<bool> (n + 1, false... | ALGO | 0.999874 | 4.23443 | {
"github_metadata": {
"branch": "master",
"commit_count": 1055,
"repo_created_at": "2018-05-09T12:30:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1490,
"forks": 481,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f5... |
25a57ae2-a898-4d8b-8859-a099d54ed4a2 | UsefHussein/CP | AtCoder/abc162_d/52158074_AC_22ms_3640kB.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define enl "\n"
#define sz(x) ll(x.size())
#define all(x) x.begin(), x.end()
string s;
int n;
ll Calc(vector<ll>&r)
{
ll cnt=0;
for(int i=0;i<sz(r);i++)
{
ll op=1;
while(1)
{
if... | ALGO | 0.999276 | 4.234074 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2025-02-12T22:11: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": "96d38bfcdb3e... |
e5362859-cd1a-4345-8f99-be544f073ecf | NamHyeongSik/boj | step/UnionFind/1976.cpp | #include <iostream>
#include <vector>
using namespace std;
int arr[201];
int city[201][201];
int get_parent(int x) {
if (arr[x] == x) return x;
else return arr[x] = get_parent(arr[x]);
}
void union_parent(int a, int b)
{
a = get_parent(a);
b = get_parent(b);
if (a < b)
arr[b] = a;
el... | ALGO | 0.999999 | 5.105651 | {
"github_metadata": {
"branch": "main",
"commit_count": 68,
"repo_created_at": "2022-05-30T05:20: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": "d6e6cd7f65e... |
4133346e-5478-42a2-8122-1a531b591d6d | Shreyaspatil2310/GFG | Difficulty: Easy/Count distinct elements in every window/count-distinct-elements-in-every-window.cpp | //{ Driver Code Starts
// Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
vector<int> countDistinct(vector<int> &arr, int k) {
// code here.
int n=arr.size();
unordered_map<int,int>mp;
int j=0;
while(j<... | ALGO | 0.998159 | 6.468285 | {
"github_metadata": {
"branch": "main",
"commit_count": 667,
"repo_created_at": "2024-06-05T04:40: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": "1dfaa18992... |
7c20d1af-0a32-430f-b0ed-29111684211d | Goobley/DexRT | source/DirectionalEmisOpacInterp.cpp | #include "DirectionalEmisOpacInterp.hpp"
#include "RcUtilsModes.hpp"
void compute_min_max_vel(
const State& state,
const CascadeCalcSubset& subset,
i32 mip_level,
const FlatVelocity& vels,
const Fp1d& min_vel,
const Fp1d& max_vel
) {
min_vel = FP(1e8);
max_vel = -FP(1e8);
yakl::fenc... | ALGO | 0.998141 | 6.444873 | {
"github_metadata": {
"branch": "main",
"commit_count": 300,
"repo_created_at": "2024-02-26T22:26:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "cc64e45186... |
de8395c6-f72d-4719-b443-32972389fbc4 | CaDe27/Coding | CodeForces/1800Plus/c682.cpp | #include <iostream>
#include <algorithm>
#include <stdio.h>
#include <string>
#include <vector>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <stack>
#include <utility>
#include <queue>
#include <set>
#include <iomanip>
#define INF 1000000000000000000
#define MOD 1000000007
#define loop(... | ALGO | 0.999835 | 3.595277 | {
"github_metadata": {
"branch": "main",
"commit_count": 24,
"repo_created_at": "2023-02-23T17:53:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "59dfd6d7960... |
ce29c103-9516-41b7-98a1-7a364902a521 | Jeffrey-love/Boring_Homework | OJ/P1748 a+b+c+d==0.cpp | #include<iostream>
#include<algorithm>
using namespace std;
int answ[40000];
int sum;
void fun(int x,int len);
int main(){
int k1;
scanf("%d",&k1);
while (k1--){
int n;
scanf("%d",&n);
int lis[2000][10];
for (int i = 1; i <= n; i++)
for (int j = 1; j <= 4; j++)... | ALGO | 0.999912 | 3.463912 | {
"github_metadata": {
"branch": "main",
"commit_count": 43,
"repo_created_at": "2022-03-11T00:41:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "096a57133ee... |
012adeb9-5a02-46ba-a898-f0dba9fd940e | jaemin2682/BAEKJOON_ONLINE_JUDGE | 2800.cpp | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <stack>
#include <set>
using namespace std;
string equals;
stack<int> s;
vector<pair<int, int>> v;
set<string> list;
int main() {
cin.sync_with_stdio(0);
cin.tie(0);
cin >> equals;
int equalSize = equals.size();
... | ALGO | 0.99982 | 3.963075 | {
"github_metadata": {
"branch": "master",
"commit_count": 604,
"repo_created_at": "2019-03-27T05:24: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": "a95433de... |
713c676b-55b7-4038-afaa-0263421f84c0 | eliwinkelman/CDT | main.cpp | #include <iostream>
#include <vector>
#include <stdlib.h>
#include <math.h>
struct Vertice {
//a structure to hold each vertice on the manifold and pointers to the vertices it is connected to.
//we hold these seperatedly to avoid needing to differentiate between pointers to vertices in the future in past geome... | ALGO | 0.998771 | 4.296536 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2018-04-17T19:10: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": "bb1a3863a5... |
2a6574a3-52cb-4d62-b828-58f7734da1c0 | Pulakesh5/_DSA_ | JULY 24/18 July/1530. Number of Good Leaf Nodes Pairs LC.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.999973 | 6.262238 | {
"github_metadata": {
"branch": "main",
"commit_count": 2772,
"repo_created_at": "2022-01-10T00:04:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "73675efb9... |
23e6fabd-2f44-4a72-b7ff-39b4a64d633d | CementMaker/notes | algorithm/leetcode/032_Longest_Valid_Parentheses.cc | /*
Given a string containing just the characters '(' and ')',
find the length of the longest valid (well-formed) parentheses substring.
For "(()", the longest valid parentheses substring is "()", which has length = 2.
Another example is ")()())", where the longest valid parentheses substring is "()()",
which has leng... | ALGO | 0.999542 | 5.521238 | {
"github_metadata": {
"branch": "master",
"commit_count": 78,
"repo_created_at": "2018-06-13T03:10:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8a29ade2c... |
60d15dba-3422-4414-8294-248c92346713 | Yann-73/Practico-1---Vectores-y-Matrices | vectores3.cpp | #include <iostream>
#include <stdexcept>
#include <algorithm>
#include <map>
using namespace std;
template <typename T>
class Vector {
protected:
T *items;
int size;
int capacity;
public:
Vector(int _capacity = 10) : size(0), capacity(_capacity) {
items = new T[capacity];
}
~Vector()... | ALGO | 0.999768 | 6.22708 | {
"github_metadata": {
"branch": "main",
"commit_count": 25,
"repo_created_at": "2025-03-24T20:43: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": "db38289d82a... |
b89ff6ee-8180-407b-8b9b-81a9463eaf84 | A1doranM/HowProgrammingWork | C++/9. Standard Template Library (STL)/Challenge_1_Solution/main.cpp | // Section 20
// Challenge 1 - Solution
// Identifying palindrome strings using a deque
#include <cctype>
#include <deque>
#include <iostream>
#include <string>
#include <vector>
#include <iomanip>
bool is_palindrome(const std::string& s)
{
std::deque<char> d;
// add all the string characters that are alpha t... | ALGO | 0.99954 | 6.452948 | {
"github_metadata": {
"branch": "master",
"commit_count": 1927,
"repo_created_at": "2021-07-28T12:42:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e331634... |
60e7e8ba-7a49-4482-98b3-539cfedcc668 | dreamvrutik/Codeforces-Solutions | Codeforces Solutions/cf189_A.cpp | #include<bits/stdc++.h>
#define IOS ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define max(a,b) (a>b?a:b)
#define min(a,b) (a<b?a:b)
#define int long long
#define endl "\n"
#define double long double
#define mod 1000000007
using namespace std;
int po[101],s[101];
void pairsort(int a[], int b[], ... | ALGO | 0.999863 | 3.292091 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-07-08T07:59:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d358dd0639... |
8f37c83d-5c1d-4314-b4cb-d6f135b0de5a | wesley-a-leung/Resources | Tests/C++/geometry/2d/BentleyOttmannFuzzTest.cpp | #include <bits/stdc++.h>
#include "../../../../Content/C++/geometry/2d/BentleyOttmann.h"
#include "../../../../Content/C++/geometry/2d/Line.h"
using namespace std;
void test1() {
const auto start_time = chrono::system_clock::now();
mt19937_64 rng(0);
const int TESTCASES = 5e4;
long long checkSum = 0;
for (in... | ALGO | 0.986251 | 4.772445 | {
"github_metadata": {
"branch": "main",
"commit_count": 2107,
"repo_created_at": "2017-04-15T03:11:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 41,
"forks": 10,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a07e14e... |
7eb29489-a7c6-49d2-9ae6-5eee9520b94f | 113bommy/PathRepair | variable_trace/cpp/cpp_code/cpp_incorrect/cpp_incorrect_test_67_11.cpp | #include <bits/stdc++.h>
#pragma GCC optimize(2)
#pragma GCC optimize(3)
#pragma GCC optimize("Ofast")
using namespace std;
namespace ywy {
inline long long get() {
long long n = 0;
char c;
while ((c = getchar()) || 23333) {
if (c >= '0' && c <= '9') break;
if (c == '-') goto s;
}
n = c - '0';
while... | ALGO | 0.999946 | 3.389934 | {
"github_metadata": {
"branch": "main",
"commit_count": 17,
"repo_created_at": "2024-11-11T15:46:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "04855d74fd4... |
b544d559-f54d-4df2-a2bd-64c40694ee90 | JiaChangjiang/Object-Ortiented_Monte_Carlo_Control_Variate | Deterministic_Vol_NM_HW.cpp | //XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// Deterministic_Vol_NM_HW.cpp
//XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#include "Deterministic_Vol_NM_HW.h"
#include "OptionBase.h"
#include "IO_Manager.h"
#include "AppFactoryRegistration.h"
#in... | ALGO | 0.986066 | 6.067909 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2019-08-19T23:18:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c484c5dc72... |
f015ebfe-3ac7-4d68-a77b-8be1109082b5 | JakeMate15/competitive-programming | codeForces/C_New_Rating.cpp | #include<bits/stdc++.h>
using namespace std;
#ifndef ONLINE_JUDGE
#include "algoDebug.h"
#else
#define debug(x...)
#define RAYA
#define raya
#endif
#define sz(a) (int) a.size()
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
typedef long long ll;
typedef long d... | ALGO | 0.999914 | 4.731605 | {
"github_metadata": {
"branch": "master",
"commit_count": 163,
"repo_created_at": "2022-09-19T02:47:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "86659437... |
5c899dc9-fcb4-4f52-99e5-68e4da173656 | ManishKrShahi/Leetcode-Solutions | 705-design-hashset/705-design-hashset.cpp | class MyHashSet {
public:
const int BUCKET_SIZE = 100;
vector<int> bucket[100];
MyHashSet() {
}
void add(int key) {
int index = key % BUCKET_SIZE;
if(!contains(key))
bucket[index].push_back(key);
}
void remove(int key) {
int index = key % BUCKET_SI... | ALGO | 0.999421 | 5.502241 | {
"github_metadata": {
"branch": "main",
"commit_count": 667,
"repo_created_at": "2022-03-03T17:29: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": "0a929c14eb... |
5e1940f5-481e-498b-aeed-279f97830b87 | kenjinote/Virtual-TI | JPDEHUFF.cpp | //
// Copyright (c) 1997,1998 Colosseum Builders, Inc.
// All rights reserved.
//
// Colosseum Builders, Inc. makes no warranty, expressed or implied
// with regards to this software. It is provided as is.
//
// See the README.TXT file that came with this software for information
// on redistribution or send E-mail to ... | ALGO | 0.925171 | 5.335097 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2022-07-24T18:15:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8c86f8fdc0d4... |
e187fa75-138a-44b6-8e5e-8276c37f780e | ducsuibot/HE-THONG-QUAN-LY-SIEU-THI-MINI-CODE-C | San Pham(code c).cpp | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAX_PRODUCTS 100
// ---------------------------------CODE CAC HAM QUAN LY SAN PHAM-------------------------------------//
typedef struct {
int ma;
char ten[50];
float gia;
int soLuong;
} SanPham;
SanPham dsSanPham[MAX_PRODUCTS];
int... | TOOL | 0.989427 | 3.548058 | {
"github_metadata": {
"branch": "main",
"commit_count": 24,
"repo_created_at": "2024-07-18T14:59:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e676950ffa3... |
9f69aede-33c4-4485-a235-c4aca49d9fbd | Tharamac/Rectonote | app/src/main/cpp/PitchDetection.cpp | //
// Created by TharaMac on 9/29/2020.
//
#include "PitchDetection.h"
#include "dsp.h"
PitchDetection::PitchDetection(
std::vector<double> &audio_sample,
const double frame_size,
const int FFT_size,
const int Fs
) : audioSample(audio_sample),
fftRealSize(FFT_size / 2 + 1),
fft... | TOOL | 0.902302 | 6.233847 | {
"github_metadata": {
"branch": "master",
"commit_count": 70,
"repo_created_at": "2020-03-03T16:47:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0aef39f6d... |
2f3474aa-4f4c-4fa0-8705-35529b675de9 | minhdang26403/cs271-project0 | project2/usecase.cpp | #include "minqueue.h"
#include <iostream>
template<typename T>
std::string sliding_window(T arr[], int len, int k) {
if (len == 0) {
return "";
}
MinQueue<T> mq;
std::unordered_map<T,int> index_map;
T min_value = arr[0];
// First, finds the minimum value in the window of size k
// and maps the value... | ALGO | 0.999607 | 5.54073 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2022-08-29T21:44: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": "64b305927... |
1819726b-44ba-4110-b703-6d7d3a6f9ef8 | shuangyinli/RATM | inference.cpp | /*
* ratm-inference.cpp
*/
#include "inference.h"
void doInference(senDocument* doc, Model* model, Configuration* configuration) {
double doc_lik_old = 0.0;
double doc_lik;
double doc_var_converence = 1.0;
int doc_max_var_iter = 0;
int num_sentence = doc->num_sentences;
int win = model->win;
... | ALGO | 0.999431 | 3.826078 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2016-11-21T10:19:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "02dab82844... |
e29143ae-b708-4f2f-b304-e17d9ea8b2b3 | mdmahfuz307/ProblemSolving | Codeforces/A/A - Elephant.cpp | #include <bits/stdc++.h>
using namespace std;
typedef double dl;
typedef long long ll;
typedef vector<int> v;
typedef vector<ll> vll;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef unsigned long long ull;
#define endl "\n"
#define pb push_back
#define MOD 1000000007
#define maximum INT_MAX
#define sqr(a) ... | ALGO | 0.999901 | 3.925266 | {
"github_metadata": {
"branch": "master",
"commit_count": 630,
"repo_created_at": "2022-09-23T17:25: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": "08ec1d15... |
dbdf7ffa-26fe-4adc-928b-4a299f89b601 | dycoke/USACO | 2016-2017/January/bronze1.cpp | #include <bits/stdc++.h>
using namespace std;
bool cmp(pair<string, int> a, pair<string, int> b) {
return a.second < b.second;
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
freopen("notlast.in", "r", stdin);
freopen("notlast.out", "w", stdout);
int n; cin >> n;
vector<pair<string, int>> c... | ALGO | 0.999968 | 3.755103 | {
"github_metadata": {
"branch": "master",
"commit_count": 193,
"repo_created_at": "2022-07-09T16:45:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "427b2300... |
b5e41d33-17e4-4ba7-92d7-93e04874cb48 | ProgerDanchik/Practice_CPP | cpp_chapter_5/exercises/exercise_4.cpp | #include <iostream>
#include <ctime>
// Константы для вычисления процентов
const float SimpleInterest = 0.10;
const float CompoundInterest = 0.05;
const short SECS = 2; // Секунды для создания мини-паузами между рассчетами
int main() {
using namespace std;
// Начальная сумма Дафны и ее текущий баланс
const double... | ALGO | 0.99345 | 5.000764 | {
"github_metadata": {
"branch": "main",
"commit_count": 165,
"repo_created_at": "2022-02-07T06:59: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": "860c075c4b... |
4fbc43f6-7ac5-4384-9020-76b564836c24 | marmot0814/OmegaExercise | 圖論/遍歷/U_00200.cpp | #include <bits/stdc++.h>
using namespace std;
map<char, int> ID;
vector<char> name, topo;
int getID(char c) {
int sz = ID.size();
if (!ID.count(c))
ID[c] = sz, name.push_back(c);
return ID[c];
}
vector<vector<int> > G;
vector<bool> vis;
void dfs(int u) {
vis[u] = true;
for (auto &v : G[u])
... | ALGO | 0.999946 | 4.118865 | {
"github_metadata": {
"branch": "master",
"commit_count": 39,
"repo_created_at": "2018-12-28T09:01:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4a546c14e... |
ea4649d1-3d8e-432d-8023-c9387efaf5fa | cleverhans-lab/capc-demo | mpc/test_sigmoid.cpp | #include "emp-sh2pc/emp-sh2pc.h"
#include <iostream>
using namespace std;
using namespace emp;
//Don't change!
const int BITLENGTH = 32;
int party;
Integer mod(const Integer& a) {
return a;// & Integer(BITLENGTH, (1<<MOD_LENGTH) - 1, PUBLIC);
}
Float IntToFloat(const Integer &input) {
const Integer zero(32, 0, ... | ALGO | 0.989853 | 4.335634 | {
"github_metadata": {
"branch": "main",
"commit_count": 51,
"repo_created_at": "2021-08-13T01:51:44.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 4,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5fd6a03b66e3... |
4a233384-f2f7-4e07-80fc-83a686e6cd36 | shwldus067/algorithm | algorithm/2021 icpc sinchon/segment tree/acm_5480.cpp | #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
typedef pair<int, int> pii;
int N, K, w[100000], ans[100000];
pii x[100000], y[100000], ls[100000];
vector<int> X, Y;
int xseg[1<<20], yseg[1<<20];
void update(int *seg, int idx, int d, int base){
int i=idx+base;
seg[i]=min(seg[i], d);
for(... | ALGO | 0.999971 | 3.863749 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2021-08-02T18:15: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": "4dd7100ece... |
cb019f5a-de04-4039-9b47-6e4ea1be8b10 | QbitQuantum/Basics | Исходники/BlockTower.cpp | int run_test_case(int casenum__) {
switch (casenum__) {
case 0: {
int blockHeights[] = {4,7};
int expected__ = 11;
clock_t start__ = clock();
int received__ = BlockTower().getTallest(vector <int>(blockHeights, blockHeights + (sizeof blockHeights / sizeof blockHei... | TEST | 0.983274 | 4.949761 | {
"github_metadata": {
"branch": "main",
"commit_count": 68,
"repo_created_at": "2024-03-06T07:05:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3fb2d83ea06... |
1a91883e-f11b-4226-9be1-be4aa5f7193a | princeofcrows/archiveCPcodes | archived/codeforces/cf799B.cpp | /////////////////////////////////////////////////////////////////////////
//.....................................................................//
///////////__jasper_skywalker__fsociety()__BUET_mushroom__///////////////
//.....................................................................//
////////////////////////... | ALGO | 0.999987 | 3.216717 | {
"github_metadata": {
"branch": "main",
"commit_count": 35,
"repo_created_at": "2022-05-16T02:52:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6c10f284e2d... |
f5cffa38-6cd1-4bf8-9b0b-d27537dcf1ce | waynezhangw/some-demos-for-cplusplus | Contest/1_highestScholarship.cpp | #include<iostream>
#include<vector>
#include<string>
#include<sstream>
using std::vector;
using std::cout;
using std::cin;
using std::string;
using std::getline;
using std::endl;
using std::stringstream;
class Solution1 {
private:
int studentsNum;
vector<string> vecStudentsName;
vector<int> averageScore;
... | ALGO | 0.998255 | 3.684613 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2020-12-26T11:33: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": "bfc85dc925... |
9fe99100-08d3-4ce2-ab10-72063c1300fe | Kinfe123/cp-dummies | 0124-binary-tree-maximum-path-sum/0124-binary-tree-maximum-path-sum.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.999978 | 5.847866 | {
"github_metadata": {
"branch": "main",
"commit_count": 1453,
"repo_created_at": "2022-08-26T08:34:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5c463b75c... |
8d45b4fd-2ecd-4147-bea8-4f2e7813c2c9 | AlvinJ15/CompetitiveProgramming | ACM-contest/DP-numeros/369.cpp | #include <bits/stdc++.h>
using namespace std;
#define M 1000000007
int N=51;
int numero[51];
long long memo[18][18][18][52];
long long recur(int n3,int n6,int n9,int index,bool flag){
if(index==N)
return (n3==n6 && n3==n9 && n3!=0)?1:0;
if(n3>N/3||n6>N/3||n9>N/3)
return 0;
if(memo[n3][n6][n9][index]!=-1 &&... | ALGO | 0.999599 | 4.531796 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2021-03-13T16:00: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": "c4910f7f68... |
6bdc42a9-9af2-4958-a434-6a5c5773548a | eotkd4791/Algorithms | for_SW_TEST/BFS&DFS/BJ16985.cpp | #include <iostream>
#include <algorithm>
#include <queue>
#include <cstring>
#include <climits>
using namespace std;
int MIN = INT_MAX;
int field[4][5][5][5];
int maze[5][5][5];
int dist[5][5][5];
bool check[5][5][5];
int dx[] = { 0,0,0,0,1,-1 };
int dy[] = { 0,0,1,-1,0,0 };
int dz[] = { 1,-1,0,0,0,0 };
struct node { ... | ALGO | 0.999939 | 3.825051 | {
"github_metadata": {
"branch": "main",
"commit_count": 999,
"repo_created_at": "2019-01-10T07:23:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "03c46fd0a0... |
f642c282-2c68-480f-a18d-228add49d3d2 | shmohammadi86/NetLibR | src/prpack/prpack_solver_ge.cc | #include "prpack_solver.h"
#include "prpack_utils.h"
#include <cmath>
#include <cstdlib>
#include <cstring>
using namespace prpack;
using namespace std;
prpack_result* prpack_solver::solve_via_ge(
const double alpha,
const double tol,
const int num_vs,
const double* matrix,
con... | ALGO | 0.999767 | 3.757987 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2019-11-24T18:37:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e7348b15f... |
927ba906-4384-473e-940c-814a48188117 | taylor-santos/Hack-Man | Hack-Man/adjacent.cpp | #include "adjacent.h"
Point offsetPoint(Point pt, int offset) {
if (offset == -1)
return pt;
int dx[4] = { 0,1,0,-1 };
int dy[4] = { -1,0,1,0 };
Point newPoint(pt.x + dx[offset], pt.y + dy[offset]);
return newPoint;
}
int is_adjacent(Point a, Point b) {
/*
-1=not adjacent
0=up
1=right
2=down
3=left
*/
... | ALGO | 0.983365 | 5.394443 | {
"github_metadata": {
"branch": "master",
"commit_count": 22,
"repo_created_at": "2017-02-06T21:42: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": "4ea1ee40a... |
62f44523-b9e1-4f06-87c9-4e8a8e4cedc4 | pierceheyerdahl/Contest-Calculator | a08/a08/a08.cpp | /*CS 161 Assignment 8: Records (structs)
Filename: a08.cpp
Author: <NAME>
Date: 6/14/2017
Summary: Collects scores from a txt file and stores them in arrays, then calculates and displays the winner along with all contestants and their highest score
Functions:
N/A
Input variables:
ifstream inFile = the file wher... | TOOL | 0.972436 | 3.91537 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2018-12-04T02:50: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": "e653139b8b... |
73b84511-5994-4508-b0ef-52b2a09584b0 | Yokileforever/leetcode | 697.cpp | class Solution {
public:
int findShortestSubArray(vector<int>& nums) {
int maxn = -1;
for (int i = 0; i < nums.size(); ++i) {
maxn = max(maxn, nums[i]);
}
vector<int> index[maxn + 5];
for (int i = 0; i < nums.size(); ++i) {
index[nums[i]].push_back(i);... | ALGO | 0.999985 | 5.640948 | {
"github_metadata": {
"branch": "master",
"commit_count": 53,
"repo_created_at": "2018-03-08T03:25:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "cc30ade84... |
a3e13211-6955-4176-bfe1-184813462c1f | yellow378/Daima | 数据结构实验/ASet/main.cpp | #include "ASet.h"
/*计算1913李文轩*/
int main()
{
int k,n,d;
int a[MaxSize]={10,9,8,7,6,5,4,3,2,1},b[MaxSize]={10,45,48,2,65,8,12,5,4,63};
cout<<"请输如数组a,b的大小(MaxSize = 30):";
cin>>n;
cout<<"请初始化数组a:";
for(int i = 0; i != n; i ++) cin>>a[i];
cout<<"请初始化数组b:";
for(int i = 0; i != n; i ++) cin>>b[i];
Set s1,s2,s3;
s... | ALGO | 0.989265 | 3.636504 | {
"github_metadata": {
"branch": "master",
"commit_count": 29,
"repo_created_at": "2020-03-19T02:59: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": "d5213b152... |
0ef6e360-24be-43a7-8960-29deef32a06f | Arunkumar0176/Basic_DSA | Dqueue/queue_circular.cpp | #include <iostream>
#include <vector>
using namespace std;
class Queue {
int front;
int back;
vector<int> v;
int cs;
int ts;
public:
Queue(int n) {
v.resize(n);
this->ts = n;
this->back = n - 1;
this->front = 0;
this->cs = 0;
}
void enqueue(int ... | ALGO | 0.99889 | 4.374159 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2025-01-30T08:45: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": "d97b488e80... |
66638bac-4693-452f-b590-537f689daad8 | sybui2004/DSA---PTIT | DSA - PTIT code by C++/DSA08009 - BIEN DOI S - T.cpp | /*Author: <NAME> B22DCCN702 from ProPTIT with love
DSA08009 - BIEN DOI S - T
*/
#include <bits/stdc++.h>
using namespace std;
#define fast \
ios_base::sync_with_stdio(false); \
cin.tie(0);
#define pb push_back
#define ll long long
#define FORU(i, a, b) for (int i = a; i < b; i++)
#defin... | ALGO | 0.999986 | 4.285913 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2024-02-03T14:08:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6904237af4d8... |
92850213-00e5-462b-8fa9-aaa452a81469 | tnakaicode/dealii-sample | dealii-44/step-44.cc | /* ---------------------------------------------------------------------
*
* Copyright (C) 2010 - 2020 by the deal.II authors and
* & <NAME> and <NAME>
*
* This file is part of the deal.II library.
*
* The deal.II library is free software; you can use it, redistribute
* it, and/or m... | ALGO | 0.988268 | 5.548537 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2022-02-20T00:37: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": "c011a7f13... |
64e03e3d-4527-4ce4-a1da-68e5ac5a63bf | codetrixter/ViveShake | Abhishek/DS_Algo/strings/reverse.cpp | /**
* @file reverse.cpp
* @author Abhishek
* @brief Reversing the string from bothe directions technique:
* complexityO(n/2)-> O(n)
* @version 0.1
* @date 2022-04-25
*
* @copyright Copyright (c) 2022
*
*/
#include <iostream>
void reverse(char *str)
{
int count = 0;
for(int i = 0; str[i] != '\0'; ... | ALGO | 0.998559 | 4.523081 | {
"github_metadata": {
"branch": "main",
"commit_count": 588,
"repo_created_at": "2022-04-19T05:24:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7e07b8442b... |
fd47cb78-5979-4d15-ac13-94bb2c5ef963 | MijaelTola/icpc | TopCoder/PosNegDice.cpp | #include <bits/stdc++.h>
using namespace std;
class PosNegDice {
public:
vector <int> evaluateRoll(int, vector <int>, vector <int>);
};
int a[510], b[510];
vector <int> PosNegDice::evaluateRoll(int T, vector <int> positiveDice, vector <int> negativeDice) {
memset(a, 0, sizeof a);
memset(b, 0, sizeof b);
for (... | ALGO | 0.999552 | 4.662083 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2020-08-28T22:47: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": "8f38a6e837... |
ee1ed68a-b316-43b1-a54b-f7efae2eab2c | Hk0509/Leetcode-Solutions | Out of Boundary Paths.cpp | class Solution {
public:
const int mod = 1e9 + 7;
int dp[51][51][51];
int solve(int i, int j, int n, int m, int moves){
if(moves < 0) return 0;
if(i < 0 || j < 0 || i > n-1 || j > m-1) return 1;
if(dp[i][j][moves] != -1) return dp[i][j][moves];
int l = solve(i-1, j, n, m, m... | ALGO | 0.999958 | 5.389708 | {
"github_metadata": {
"branch": "main",
"commit_count": 372,
"repo_created_at": "2023-05-07T16:57: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": "aaa29ce226... |
b8489c39-70e3-4e6f-b555-50f41acb4316 | Archit669/data-structures-and-algorithms | dsa/15_dynamic_programming/Dp_by_striver/16_cherry_pickup_2.cpp | #include <bits/stdc++.h>
using namespace std;
// recursion
class Solution {
int solve(vector<vector<int>>& grid, int row, int col1, int col2){
if (col1 < 0 || col2 < 0 || col1 >= grid[0].size() || col2 >= grid[0].size()){
return 0;
}
if (row == grid.size()-1){
if (... | ALGO | 0.999872 | 5.780663 | {
"github_metadata": {
"branch": "master",
"commit_count": 108,
"repo_created_at": "2022-04-24T10:26:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5bfad660... |
087480fd-a381-4fe1-b21e-ce86abeccbc0 | OmarAlSeddik/competitive-programming-codeforces | 1100/interesting-drink.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, q;
cin >> n;
int a[n];
for (int i = 0; i < n; i++) cin >> a[i];
sort(a, a+n);
cin >> q;
int ans[q];
for (int k = 0; k < q; k++) {
int x;
cin >> x;
int low = 0, high = n-1, mid;
ans[k] = 0;
... | ALGO | 0.999919 | 4.253448 | {
"github_metadata": {
"branch": "master",
"commit_count": 22,
"repo_created_at": "2023-10-30T23:08: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": "61775f099... |
cc8dbc51-f091-421a-b66b-dbd99ca189b6 | Kitware/VTK | Common/DataModel/vtkReebGraphSimplificationMetric.h | // SPDX-FileCopyrightText: Copyright (c) <NAME>, <NAME>, <NAME>
// SPDX-License-Identifier: BSD-3-Clause
/**
* @class vtkReebGraphSimplificationMetric
* @brief abstract class for custom Reeb graph
* simplification metric design.
*
* This class makes it possible to design customized simplification metric
* eva... | ALGO | 0.991739 | 6.793825 | {
"github_metadata": {
"branch": "master",
"commit_count": 94968,
"repo_created_at": "2010-04-27T15:12:58.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2910,
"forks": 1246,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4... |
cd365794-f48b-43fa-af11-356741226637 | AllanVasc/Competitive-Programming | Contests/UFPE Camping Data Structures/F - Mean of array .cpp | // F - Mean of array
#include <bits/stdc++.h>
using namespace std;
#define int long long
const int inf = 1e18;
using ii = pair<int,int>;
using iii = tuple<int,int,int>;
using ll = long long;
const int INF = 1e18;
const int MAXN = 200000 + 100;
vector<int> seg;
vector<int> v;
void update(int p, int l, int r, in... | ALGO | 0.99988 | 3.923413 | {
"github_metadata": {
"branch": "main",
"commit_count": 115,
"repo_created_at": "2021-05-12T20:29: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": "7c78d54eb9... |
deadacc1-1b77-4fd5-8b00-e302b52b61c6 | takkrish/datastructures-and-algorithms-cpp | 3D DP/Cherry Pickup II.cpp | // You are given a rows x cols matrix grid representing a field of cherries where grid[i][j] represents the number of cherries that you can collect from the (i, j) cell.
// You have two robots that can collect cherries for you:
// Robot #1 is located at the top-left corner (0, 0), and
// Robot #2 is located at the to... | ALGO | 0.999994 | 6.304096 | {
"github_metadata": {
"branch": "main",
"commit_count": 210,
"repo_created_at": "2023-12-25T18:22: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": "d9222295ac... |
85842cb7-d316-42ae-b85f-e87fb7a038a7 | jjzhang166/LumixEngine | src/engine/geometry.cpp | #include "geometry.h"
#include <cmath>
namespace Lumix
{
Frustum::Frustum()
{
xs[6] = xs[7] = 1;
ys[6] = ys[7] = 0;
zs[6] = zs[7] = 0;
ds[6] = ds[7] = 0;
}
void Frustum::computeOrtho(const Vec3& position,
const Vec3& direction,
const Vec3& up,
float width,
float height,
float near_distance,
float far_di... | TOOL | 0.909435 | 6.649546 | {
"github_metadata": {
"branch": "master",
"commit_count": 3240,
"repo_created_at": "2017-06-08T07:25: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": "6e9e00a... |
abd68568-bb4a-4369-beeb-e1994c7712e2 | vfolunin/archives-solutions | EOlymp/1482.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <string>
using namespace std;
int main() {
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
int ah, aw;
cin >> ah >> aw;
vector<vector<int>> a(ah, vector<int>(aw));
for (int ... | ALGO | 0.999012 | 3.495732 | {
"github_metadata": {
"branch": "master",
"commit_count": 2367,
"repo_created_at": "2017-11-27T10:19:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 1,
"pull_requests": 5
},
"file_meta": {
"content_id": "e25d35a... |
5bdb416c-547a-455a-8858-27f608048e70 | marbl/parsnp | muscle/libMUSCLE/clwwt.cpp | #include "libMUSCLE/muscle.h"
#include "libMUSCLE/tree.h"
#include "libMUSCLE/msa.h"
namespace muscle {
/***
Compute weights by the CLUSTALW method.
Thompson, Higgins and Gibson (1994), CABIOS (10) 19-29;
see also CLUSTALW paper.
Weights are computed from the edge lengths of a rooted tree.
Define the strength of an... | ALGO | 0.999295 | 6.208632 | {
"github_metadata": {
"branch": "master",
"commit_count": 399,
"repo_created_at": "2014-07-07T21:42:06.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 145,
"forks": 27,
"issues": 29,
"pull_requests": 0
},
"file_meta": {
"content_id": "d50fc... |
2e54b890-a874-49cc-af3d-fe6f167e9c78 | sabachan/framework | src/PhysicsEngine/RigidBodySimulator.h | #ifndef PhysicsEngine_RigidBodySimulator_H
#define PhysicsEngine_RigidBodySimulator_H
#include "Common.h"
#include "CollisionDetection.h"
#include <Core/ArrayList.h>
#include <Core/SmartPtr.h>
#include <Math/Quaternion.h>
#include <Math/Vector.h>
namespace sg {
namespace physics {
//==================================... | ALGO | 0.920112 | 6.673854 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2017-09-04T22:13: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": "debff91067... |
930b9ef8-e7a2-477d-88de-546af10a228c | logoutAgain/DataSutrctureSample | 朋友圈和简单集合的应用.cpp | #include<iostream>
using namespace std;
/*
到此为止的集合都是用数组,但是用法不一样,之前书上那个是每个元素都是一个结构体,结构体有他自己的data和他的parent
然后凭此也可以得到自己的根节点是哪一个
而这次采取了不同的措施,就是非根节点,他的值为它根节点的序号,而根节点,他的值就为他所在集合的元素个数,这个很巧妙。
而每次集合合并的操作都只为根节点操作,如果根节点不相同,说明集合不同,然后根据大小进行合并。
只用了一个数组就可以实现集合的相关。可以可以
*/
#define max 30000
typedef int elementtype;
typedef in... | ALGO | 0.999838 | 3.407516 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2017-07-14T10:32: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": "dcccf616b... |
91e8187f-aeba-4b15-a4bf-2019e4fad3eb | sidjha57/Coding | C++/Google Kickstart/Arithmetic_Square.cpp | //template
#include<bits/stdc++.h>
//#include<ext/pb_ds/assoc_container.hpp>
//#include<ext/pb_ds/tree_policy.hpp>
//#include <ext/pb_ds/trie_policy.hpp>
//using namespace __gnu_pbds;
using namespace std;
//typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> pbds;
//typedef trie<strin... | ALGO | 0.999507 | 4.506358 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-04-13T07:03: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": "a0fecb35214a... |
0da0be5c-93f7-4f0c-9276-ed6029d36509 | seemyhurt/projects_CPP | object_oriented_programming/long_number/long_number.h | // verylong.h
// описатель класса сверхбольших целых чисел
#include <cwchar>
const int SZ = 1000; //максимальное число разрядов
class verylong
{
private:
wchar_t vlstr[SZ]; //число как строка
size_t vlen; //длина строки verylong
public:
verylong() : vlen(0) //... | TOOL | 0.90067 | 3.262861 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-06-04T20:06:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "46fb2dcace96... |
85d722de-eea6-49a2-aabc-1c1a7e45ed60 | lmyybh/cuda-kernel | gemm/main.cpp | #include <cuda_runtime.h>
#include "cmdline.h"
#include "helper_cuda.cuh"
#include "helper_data.h"
#include "gemm.h"
int main(int argc, char* argv[]) {
cmdline::parser args;
args.add<int>("kernel", 'x', "which kernel", true, 0, cmdline::range(0, 9));
args.add<int>("M", 'm', "rows of matrix A", false, 2048);
ar... | ALGO | 0.93179 | 5.024506 | {
"github_metadata": {
"branch": "master",
"commit_count": 38,
"repo_created_at": "2025-03-06T12:04:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "179e17ff8... |
44b58f46-9463-4d7a-b5f8-9ecd1bb5b5b6 | nims11/coding | ICPC/13/KGP/SUBSTR.cpp | /*
<NAME> (nims11)
*/
#include<iostream>
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<map>
#include<string>
#include<vector>
#include<queue>
#include<cstring>
#include<cstdlib>
#include<cassert>
#include<cmath>
#include<stack>
#include<set>
#include<utility>
#define in_T int t;for(scanf("%d",&t);t-... | ALGO | 0.998933 | 3.866053 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2020-03-14T20:16:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dbd62dab5... |
bc7cb2cb-b21b-4ef9-9c12-c0d146255d65 | khongphaifu/luatnguu | Creating Strings II.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
#define pb push_back
#define ll long long
#define el "\n"
#define alla(a,n) a+1,a+n+1
#define fi first
#define se second
#define all(v) v.begin(),v.end()
#define fu(i,a,b) for(ll i=a;i<=b;i++)
#... | ALGO | 0.999998 | 4.396777 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2024-08-06T00:16:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "31919fbe7b5... |
26afc34b-6bbd-45b2-a122-65168a26ac90 | MTGermany/calibLevmar | determineDrivingRegimes.cpp |
/*
(2023-10-31, answer to a question of Venkat)
Hi Venkat,
from my program identifying the regimes, I obtain
double vc=0.8*v0data;
double Tc=1.5*Tdata;
double ac=0.2*adata;
double bc=0.2*bdata;
double sc=1.5*s0data;
Here, v0data is the maximum speed in the data, adata and bdata are the maximum observed acceleration... | ALGO | 0.928335 | 3.483619 | {
"github_metadata": {
"branch": "main",
"commit_count": 16,
"repo_created_at": "2023-11-25T00:00: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": "5e9d24cb562... |
30e3fb3c-4bff-4291-b36e-55249c903b15 | hao6164/Sicily-online-judge-code | smie-exercise2-1001-放弃优先队列/源.cpp | #include<math.h>
#include<iostream>
#include <vector>
#include<algorithm>
#include <stdio.h>
#include<iomanip>
using namespace std;
struct node
{
int point1;
int point2;
double distance;
node(int a, int b, double c)
{
point1 = a; point2 = b; distance = c;
}
};
bool cmp(node a, node b);
bool cmpp(double a, doubl... | ALGO | 0.999949 | 3.954378 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2014-10-18T02:26: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": "6bd1216242... |
4bf66398-6100-4f11-bd31-8fa8bd196a02 | pkprajapati7402/LeetCode-Solutions | 169-Majority-Element.cpp | /*
169. Majority Element
Solved
Easy
Topics
Companies
Given an array nums of size n, return the majority element.
The majority element is the element that appears more than ⌊n / 2⌋ times. You may assume that the majority element always exists in the array.
Example 1:
Input: nums = [3,2,3]
Output: 3
Example 2:
In... | ALGO | 0.999992 | 6.496104 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2024-07-31T10:34:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "47c9de934c6... |
2abec78f-bed4-42e0-9c83-7f38ef5deaf3 | coin8086/programming-challenges | ch7_ex4.cpp | /***********************************************************
* Factovisors
* PC/UVa IDs: 110704/10139
* Author: <NAME>(<EMAIL>)
* This program is distributed under GNU GPL.
**********************************************************/
#include <iostream>
#include <vector>
#include <utility>
#include <cmath>
using ... | ALGO | 0.999806 | 4.731659 | {
"github_metadata": {
"branch": "master",
"commit_count": 84,
"repo_created_at": "2015-04-01T03:59:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 15,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9ac62748... |
48fdb0bc-dd10-4953-a9f7-7bfddb26a3cc | phuocchubeo123/Codeforces | Contests/ICPCTrain/2020Taipei/bsol.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define vt vector
#define forlr(i, l, r, k) for (int i = l; i < r; i += k)
#define for0(i, n) for (int i = 0; i < n; i++)
#define for1(i, n) for (int i = 1; i <= n; i++)
#define pb push_back
const int N = 1e5 + 4;
int T;
void prepare(){
}
vt<vt<int... | ALGO | 0.999862 | 4.232045 | {
"github_metadata": {
"branch": "main",
"commit_count": 179,
"repo_created_at": "2022-01-04T03:31: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": "a459989fa0... |
20ae2a6c-6de3-45ac-8238-4145da9c404d | G1rmmr/code-test | BOJ/C++/1167_diameter_of_tree.cpp | #include <iostream>
#include <vector>
#include <queue>
static const int kMAX = 100001;
static std::vector<std::pair<int, int>> gGraph[kMAX];
static std::vector<int> gVisited(kMAX);
void BFS(const int& startNode,
int& treeDiameter, int& deepestNode) {
gVisited[startNode] = 0;
std::queue<int> bfsQueue;
... | ALGO | 0.999456 | 4.387037 | {
"github_metadata": {
"branch": "main",
"commit_count": 51,
"repo_created_at": "2023-03-08T09:32: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": "d36861cfd48... |
4114e182-702f-4394-ad28-107e08824ce6 | PKUcoldkeyboard/AntTreeSearch | include/helper.hpp | #ifndef __HELPER_HPP__
#define __HELPER_HPP__
#include "numpy.hpp"
#include "utils.hpp"
int simulate(Matrix adj, Vector passage, float incRate, float decay, Matrix optPath,
Matrix pher, float ffStart = 1, float bfEnd = 1, float thold = 0.999, Decision *decision = new Linear(),
int printPerio... | ALGO | 0.999575 | 4.747997 | {
"github_metadata": {
"branch": "main",
"commit_count": 41,
"repo_created_at": "2023-03-01T12:15:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "94c9fe773e8... |
3472783e-b62a-47ed-85de-4bbeb091c007 | alibaba/GraphScope | analytical_engine/test/run_vy_ldbc.cc | /** Copyright 2020 Alibaba Group Holding Limited.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law... | ALGO | 0.976503 | 5.637128 | {
"github_metadata": {
"branch": "main",
"commit_count": 2271,
"repo_created_at": "2020-10-28T03:19:33.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 3461,
"forks": 458,
"issues": 418,
"pull_requests": 28
},
"file_meta": {
"content_id": "77... |
82f2915a-354c-4bdb-8415-d1434e074f31 | Buttiyeeppp/Code | Luogu/P4062.cpp | #include <bits/stdc++.h>
using namespace std;
#define clo 1000.*clock()/CLOCKS_PER_SEC
#ifndef xxzx
#define endl '\n'
#endif
using ll=long long;
using PII=pair<int,int>;
const int N=5e5+10;
const int M=1e6+10;
bool mem1;
int n,type,a[N],cnt[N*10],vis[N];
ll ans;
void sol(int l,int r) {
if(l==r) return ans++, void()... | ALGO | 0.999915 | 3.767602 | {
"github_metadata": {
"branch": "master",
"commit_count": 386,
"repo_created_at": "2023-02-11T04:30:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cc82370f... |
f30f8bdc-3430-4f1d-990d-9cd6d8e7e5bd | kongzii/SFastText | Sources/CFastText/CFastText.cpp | #include "include/CFastText.hpp"
#include "FastText/fasttext.h"
#include <string>
#include <sstream>
#include <iostream>
const void * initializeFastTextObject() {
auto ft = new fasttext::FastText();
return (void *)ft;
}
void fasttextLoadModel(const void *object, const char* path) {
auto ft = (fasttext::F... | DATA | 0.909264 | 5.97884 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2020-03-12T11:56: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": "4f4abd7982... |
ecabfb7b-87ac-4c41-860e-b65ede5dd97c | ductai05/Y2S1-DSA | W1/Exercise_2.cpp | #include<iostream>
#include <fstream>
#include <sstream>
using namespace std;
bool readMatrix(const char* filename, int** &matrix, int &rows, int &cols){
fstream inFile;
inFile.open(filename, ios::in);
if (!inFile) return false;
rows = cols = 0;
string line;
while (getline(inFile, line)){
... | ALGO | 0.998838 | 4.697098 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2024-12-26T13:31: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": "eadf7ec8f09b... |
4feebe85-0f00-4a28-9684-363b2c29c23e | dcrebbin/cpp-kata | src/day_1/search/binary-dfs.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
using namespace std;
struct BinaryNode
{
int value;
BinaryNode *left;
BinaryNode *right;
BinaryNode(int val) : value(val), left(nullptr), right(nullptr) {}
};
void dfs(BinaryNode *currentNode,vector<int>& bstValues)
{
if (... | ALGO | 0.999986 | 4.345236 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2023-12-29T10:56:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "023e29844... |
74d3876f-06fe-4d5f-86ca-ffc85efe2467 | vgslavov/Problems | codility/lesson_6/dominator.cc | // 100%
int solution(const vector<int> &A) {
int n = A.size();
int candidate = -1;
int leader_index = -1;
int candidate_count = 0;
int candidate_value = 0;
int candidate_index = -1;
for (int i = 0; i < n; i++) {
if (candidate_count == 0) {
++candidate_count;
... | ALGO | 0.999938 | 5.088933 | {
"github_metadata": {
"branch": "main",
"commit_count": 549,
"repo_created_at": "2014-12-02T05:33: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": "7d5d6e98e2... |
9e3c67ce-6c8a-4261-be16-c1850c28d994 | PradCoder/Programming-Contests | CSES/Chaptersix.cpp | #include <bits/stdc++11.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
int main(){
/*Dynamic Programming*/
/*It's a programming technique that combines the correctness of
complete search and the efficiency of greedy algorithms (so it's fast
and correct or... | ALGO | 0.999961 | 3.930763 | {
"github_metadata": {
"branch": "master",
"commit_count": 383,
"repo_created_at": "2018-07-11T23:40: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": "d6dd351f... |
000ed54e-edd0-4c74-b2f6-c147a1162dec | marvel97/Mytest | graph.hpp | #ifndef GRAPH_H__
#define GRAPH_H__
#include<iostream>
#include<vector>
#include<string>
namespace mits{
#define MAX_VERTICES 250
class BitMapMatrix{
private:
char* vbitmap;
int nvertex;
public:
BitMapMatrix(){
}
BitMapMatrix(int nv);
bool getBit(int i, int j);
void setBit(int i, int... | ALGO | 0.933198 | 4.581993 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2017-04-08T09:18: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": "740a5ca8b7... |
18682f74-5648-4658-8b0c-ff60bdb0eef9 | likunjk/LeetCode | Maximal_Rectangle.cpp | class Solution {
public:
// 这个题有两个关键点:
// 1: O(n)的时间复杂度确定每一行每个位置上1的高度,形成1个高度矩阵
// 2: O(n)的时间复杂度在上面找出的高度矩阵中找出最大矩阵
int maximalRectangle(vector<vector<char> > &matrix)
{
int n = matrix.size();
if(n==0)
return 0;
int m = matrix[0].size();
if(m==0)
... | ALGO | 0.999959 | 5.685173 | {
"github_metadata": {
"branch": "master",
"commit_count": 100,
"repo_created_at": "2014-09-13T13:57: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": "28b83a55... |
10fcd2bf-16f8-456b-9ce9-742778cae7cd | kibo27/coding | Rhezoandcrticallinks.cpp | /*
Rhezo likes to play with graphs having N nodes and M edges. Lonewolf is ready to give him such a graph only on one condition. He wants Rhezo to find the number of critical links in the graph.
A critical link in a graph is an edge that has the following property: If we cut the link/edge, the graph will have exactly ... | ALGO | 0.999991 | 4.325749 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2020-02-05T08:56: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": "7533d44964... |
b9ff0806-b9de-40b3-baf3-15a8b68c1988 | lhlssmile/leetcode-practice | lc_cpp/lcCpp/arraY/MaxProduct.cpp | #include <vector>
#include <string>
#include <iostream>
class maxProductSolution{
public:
int maxProduct(std::vector<std::string>& words){
int n = words.size();
std::vector<int> bitmask(n,0);
std::vector<int> wordLengths(n,0);
for (int i = 0; i < n; ++i) {
int mask = 0;
... | ALGO | 0.999395 | 5.309464 | {
"github_metadata": {
"branch": "main",
"commit_count": 46,
"repo_created_at": "2025-04-20T15:43: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": "5364a3c1096... |
9b8f242e-125d-487a-a948-3a923e867ddd | tanmesh/curly-doodle | leetcode/Rotate List.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
ListNode* rotateRight... | ALGO | 0.999975 | 5.997902 | {
"github_metadata": {
"branch": "master",
"commit_count": 249,
"repo_created_at": "2020-06-14T21:50: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": "3ac2d654... |
51754627-5d2c-4aa3-b840-7b833666a02f | Byte717/USACO_TRAINING | Codeforces/Particles/particles.cpp | #include <bits/stdc++.h>
#define INF 1e18
#define MOD 1e9+7
#define all(x) begin(x),end(x)
#define rall(x) x.rbegin(), x.rend()
typedef long long ll;
using namespace std;
const int dirX[] = {-1, 0, 1, 0};
const int dirY[] = {0, 1, 0, -1};
int LOG2(int n){
int ret = 0;
while((1<<(ret+1)) <= n){ret++;}
r... | ALGO | 0.999922 | 4.88224 | {
"github_metadata": {
"branch": "main",
"commit_count": 324,
"repo_created_at": "2022-12-05T00:24:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "94ea4c65e2... |
a13c033a-6f20-406e-9ce8-234dc7c9bd5a | abhishek18124/PPCPPOct2021 | 3. December/Lecture 16 - 18thDecember2021/001NQueen.cpp | /*
N Queens Problem
The problem is to place 'n' queens on an 'n x n' chessboard, so that no two queens are attacking
each other, this means that no two queens are in the same row, the same column, or the same diagonal.
Example
Input : N = 4
Output:
_ Q _ _ _ _ Q _
_ _ _ Q Q _ _ _
... | ALGO | 0.999982 | 5.319665 | {
"github_metadata": {
"branch": "main",
"commit_count": 46,
"repo_created_at": "2021-10-23T04:32:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 7,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "94631528546... |
72a559eb-5b6c-4963-a62c-1f83c2f3cacc | As1i1/Competitive-programming | LabITMO_S3/DISC/1/B.cpp | //
// Created by asi1i on 10/21/23.
//
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
const int INF = 1e9, MOD = 1e9 + 7, Q = 38;
const ld eps = 1e-9;
const ll ll_INF = 1e18;
mt19937 gen;
bool is_ore(vector<vector<int>>& g, set<int>& v, int n) {
vector<int> cnt(n, 0);
... | ALGO | 0.999995 | 4.678675 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2021-12-24T10:33:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1648ec832... |
6ce712de-855b-439f-a98f-8ad6089e39ce | kookjd7759/Algorithm | 백준/Bronze/31243. ВРЕМЕ/ВРЕМЕ.cc | #include <bits/stdc++.h>
#define Sync ios_base::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr)
#define Fixed(x) cout << fixed; cout.precision(x)
#define Interactive cin.tie(0)->sync_with_stdio(0)
#define instr(x) getline(cin, x)
#define ll long long
#define in cin >>
#define out cout <<
#define spc << " " <... | ALGO | 0.999396 | 3.704682 | {
"github_metadata": {
"branch": "main",
"commit_count": 2962,
"repo_created_at": "2023-08-07T12:27: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": "a40bf1cdb... |
cbb0a8a0-30f3-4bd5-8bfa-c38b07ad7536 | kuzzmak/leetcode | reverse-words-in-a-string.cpp | #include <algorithm>
#include <iostream>
#include <vector>
class Solution
{
public:
std::string reverseWords(std::string s)
{
std::vector<std::string> words;
int sSize = s.size();
int wordSize = 0;
int startIndex = 0;
int totalSize = 0;
for (int i = 0; i < sSize;... | ALGO | 0.999948 | 5.52129 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2024-10-20T13:02: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": "6252b3cb7e... |
00ce9b1c-4f26-4b03-a4ca-a31c95629e28 | rafaelGuasselli/exercicios | judges/vjudge/topicos_2/lista_5/c.cpp | #include <bits/stdc++.h>
#define int long long
using namespace std;
vector<pair<int, int>> intervalos;
signed main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
while (true) {
int tamanhoRua, qtdPostos; cin>>tamanhoRua>>qtdPostos;
int remover = 0;
if (tamanhoRua == 0 && qtdPostos == 0) {
b... | ALGO | 0.997997 | 4.052334 | {
"github_metadata": {
"branch": "main",
"commit_count": 347,
"repo_created_at": "2023-08-12T16:11:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "244765ef55... |
b9215666-1bb7-4776-a7eb-1e0249e65ab4 | Earth-worm/atcoder | abc351/d.cpp | #include<iostream>
#include<string>
#include<vector>
#include<set>
using namespace std;
struct UnionFind {
vector<int> par;
vector<int> s;
UnionFind(int N) : par(N), s(N,1) {
for(int i = 0; i < N; i++) par[i] = i;
}
int root(int x) {
if (par[x] == x) return x;
return pa... | ALGO | 0.999891 | 4.260012 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-05-11T11:20: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": "717c06477229... |
adc68443-05e9-4416-8a34-03ffa3eae217 | Astronomax/cpp-algorithms | comba.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
#include <random>
#include <chrono>
using namespace std;
typedef long double C;
typedef complex<C> P;
#define X real()
#define Y imag()
#define endl '\n'
#define int long long
#define all(X) (X).begin(), (X).end()
#define rall(X) (X).rbegin(), (X).rend()
mt1993... | ALGO | 0.999883 | 3.904755 | {
"github_metadata": {
"branch": "master",
"commit_count": 129,
"repo_created_at": "2019-08-04T12:18:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b81365e2... |
07880507-d685-4a4b-b287-0ffcf082fe57 | ablondal/MASH_2024 | Cake_Cutting/submissions/brute_force_hailey.cpp | #include <iostream>
#include <vector>
using namespace std;
vector<vector<int>> assignment;
vector<vector<int>> reserved;
int w, n;
bool incrementAssignment(const int& i, const int& j) {
if (j == w) {
return incrementAssignment(i+1, 0);
}
if (i == 2) {
return false;
}
if (reserved[i... | ALGO | 0.999876 | 4.430839 | {
"github_metadata": {
"branch": "main",
"commit_count": 34,
"repo_created_at": "2023-12-17T20:50:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "30eb9650431... |
ef95f4c6-b1fc-4ded-817c-3b909058729f | levendlee/data-structure-and-algorithms | c++/leetcode/1157-Online_Majority_Element_In_Subarray-H.cpp | // 1157 Online Majority Element In Subarray
// https://leetcode.com/problems/online-majority-element-in-subarray
// version: 1; create time: 2019-12-22 11:10:57;
// reach time limit
/*
class MajorityChecker {
private:
int n_;
std::vector<int> arr_;
std::unordered_map<int, std::map<int, int>> seg_trees_;
p... | ALGO | 0.99999 | 6.013428 | {
"github_metadata": {
"branch": "master",
"commit_count": 629,
"repo_created_at": "2019-10-19T19: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": "f648747f... |
5e8b1aaa-0649-4885-bd7e-838192bab764 | koshcher/op | src/labs/lab3.h | #ifndef LAB3
#define LAB3
#include <iostream>
#include <sstream>
#include "shared.h"
namespace lab3 {
double fx(const long& k, const int& x, const long& kFactorial) {
return (pow(-1, k) * (k + 1) * pow(x, k)) / kFactorial;
}
void showState(
const int& x, const long& k, const double& internalSum, const double& ... | ALGO | 0.996498 | 5.266144 | {
"github_metadata": {
"branch": "main",
"commit_count": 60,
"repo_created_at": "2023-09-06T18:54: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": "b610dfb968e... |
2fe3bc5b-e73e-439b-95e6-8278b80472b7 | Shmona/Leetcode | Array/Leetcode_2706_Buy_two_chocolates.cpp | /*
You are given an integer array prices representing the prices of various chocolates in a store.
You are also given a single integer money, which represents your initial amount of money.
You must buy exactly two chocolates in such a way that you still have some non-negative leftover money.
You would like to minimiz... | ALGO | 0.999948 | 5.630879 | {
"github_metadata": {
"branch": "main",
"commit_count": 88,
"repo_created_at": "2024-01-14T17:35:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "35a8a9d188c... |
47f928a0-b11d-44fe-8f43-de08331a2463 | charmdong/Lectopia | HW1/HW1/HW54.cpp | #include <stdio.h>
#include <string.h>
int input(char*, char*);
int strcheck(char*, char,int);
void flush();
int main()
{
char str[100];
char ch;
int res, check;
while (1)
{
res = input(str, &ch);
if (res == 1) // 정상 입력
{
check = strcheck(str, ch, - 1);
if (check != -1) // 문자열에 찾는 문자가 있는 경우
{
... | TOOL | 0.993665 | 3.247079 | {
"github_metadata": {
"branch": "master",
"commit_count": 45,
"repo_created_at": "2016-12-27T10:50:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4382eceec... |
cc6c9605-955d-450f-82c1-4d038788c056 | wooksong/acmicpc-cpp11 | 9093/9093.cc | #include <iostream>
int
main ()
{
std::string line;
int N;
// freopen("input.txt", "r", stdin);
std::cin >> N;
std::cin.ignore ();
for (int i = 0; i < N; ++i) {
std::string word;
size_t len;
std::getline (std::cin, line);
len = line.length ();
for (size_t i = 0; i <= len; ++i) {
... | ALGO | 0.998988 | 4.178411 | {
"github_metadata": {
"branch": "main",
"commit_count": 186,
"repo_created_at": "2022-07-16T16:50:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0be268495d... |
27def7af-feee-42dc-9fb3-54009d763bcd | KarthikaVijayanNV/DataStructures-LinkedList | Cycles_in_LL/1.Make_aCycle_inLL.cpp | #include<iostream> // Linked List Making a cycle
using namespace std;
class node
{
public:
int data;
node* next;
node(int val)
{
data =val;
next = NULL;
}
};
void insertAtTail(node* &head , int val)
{
node* n = new node(val);
if(head == NULL)
... | ALGO | 0.999864 | 3.839531 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2022-03-09T07:39:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5b1448361158... |
96b965f7-2cc7-46a4-bf03-cca21db548d8 | PhanNgocTrieu/Problem_Solving | _leet_code/solved/medium/1404_NumStepsReduceNumberInBinaryRepresentationToOne.cpp | /*
Given the binary representation of an integer as a string s, return the number of steps to reduce it to 1 under the following rules:
If the current number is even, you have to divide it by 2.
If the current number is odd, you have to add 1 to it.
It is guaranteed that you can always reach one... | ALGO | 0.999996 | 5.502434 | {
"github_metadata": {
"branch": "master",
"commit_count": 89,
"repo_created_at": "2024-04-30T05:28: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": "ef0594ab8... |
0ba2f32c-fecb-474a-b19e-0952324037c3 | ishandutta2007/codeforces-q | quang/normal/1065/C.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 200010;
const int INF = 2e9;
int n, k;
int h[N];
struct BIT {
int t[N];
void add(int x, int v) {
while (x < N) {
t[x] += v;
x += (x & -x);
}
}
int get(int x) {
int res = 0;
while (x)... | ALGO | 0.999941 | 4.119468 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T15:56: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": "780de7fa713b... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.