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 |
|---|---|---|---|---|---|---|---|
80166153-e456-4cf1-a6d8-2b6368a04fcd | o3de/o3de | Code/Framework/AtomCore/AtomCore/std/containers/vector_set_base.h | /*
* Copyright (c) Contributors to the Open 3D Engine Project.
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
#pragma once
#include <AzCore/std/algorithm.h>
#include <AzCore/std/sort.h>
namespace AZStd
{
... | TOOL | 0.974833 | 6.928714 | {
"github_metadata": {
"branch": "development",
"commit_count": 26515,
"repo_created_at": "2021-04-05T06:38:18.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 8421,
"forks": 2320,
"issues": 3293,
"pull_requests": 98
},
"file_meta": {
"conten... |
992eac7f-a582-4cb5-99ff-83b8947e3b1e | ay2306/Competitive-Programming | codeforces/edRound14/F_Couple_Cover.cpp | #include<bits/stdc++.h>
#define int long long
using namespace std;
const int N = 3e6+5;
const int M = 3e6;
// const int N = 20;
// const int M = 15;
int F[N], cnt[N], arr[N];
int q,x,n;
signed main(){
scanf("%lld",&n);
for(int i = 0; i < n; ++i)scanf("%lld",arr+i);
sort(arr,arr+n);
for(int i = 0; i < ... | ALGO | 0.999393 | 3.632373 | {
"github_metadata": {
"branch": "master",
"commit_count": 22,
"repo_created_at": "2019-08-29T14:45:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bcb256200... |
39deb4a5-7382-4ff6-ac6b-27b3c90eb5a3 | fshp971/ACM-ICPC | codeforces/cf-856C.cpp | #include<bits/stdc++.h>
using namespace std;
#define mem(a,b) memset(a,b,sizeof(a))
#define REP(i,a,b) for(int i=a; i<=b; ++i)
#define FOR(i,a,b) for(int i=a; i<b; ++i)
#define MP make_pair
#define PB push_back
typedef long long LL;
typedef pair<int,int> pii;
const int maxn = 2100;
const int md = 998244353;
int n;
... | ALGO | 0.999899 | 4.383615 | {
"github_metadata": {
"branch": "master",
"commit_count": 517,
"repo_created_at": "2016-05-13T15:22:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a74eaf50... |
fb9f4466-7cba-461a-89c8-dd39e13ebd0e | mathbarc/arduino-controllers | controllers/Controlador_PI.ino | /* ----- Controlador proporcional para um circuito RC ----- */
const int Referencia = 0; // O sinal de referencia sera lido a partir do pino de
// entrada analogica A0
const int Sensor = 1; // O sensor sera conectado ao pino de entrada analogica A1
const int Atuador = 3; // O sinal de c... | TOOL | 0.984336 | 4.716774 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2022-06-12T19:42:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "99791de277... |
4a8ddb49-5652-4317-b9f4-c9815a8787a1 | khanhvu207/competitiveprogramming | atcoder/abc363/e.cpp | #include <bits/stdc++.h>
#include <ranges>
using namespace std;
#ifdef LOCAL
#include "../../debug.h"
#else
#define debug(...) 42
#endif
namespace utils {
template <typename T, typename... Args>
void setValues(const T& value, T& first, Args&... args) {
first = value;
if constexpr (sizeof...(args) > 0) {
... | ALGO | 0.999956 | 5.021862 | {
"github_metadata": {
"branch": "master",
"commit_count": 147,
"repo_created_at": "2018-11-20T08:25:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 18,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cda9d01... |
3f121c85-abfd-453a-afa8-bfda4a29d547 | alexandraback/datacollection | solutions_2645486_0/C++/anorange0409/B.cpp | /*
* Problem :
* Author : <NAME> from Dept.Computer Science & Technology, PKU
* Date : 2013-04-27
* Algorithm :
*
*/
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <cstdlib>
#include <string>
#include <vector>
#include <cstdio>
#include <cmath>
#include <map>
#incl... | ALGO | 0.999902 | 3.483529 | {
"github_metadata": {
"branch": "master",
"commit_count": 58,
"repo_created_at": "2017-03-08T11:33:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1736eac6f... |
2cfe76f8-bd43-4687-b7b3-06a2c76cd38c | kdh5107/GAME_PGM | c game/8_5_1_fixed.cpp | #include <stdio.h>
#include <conio.h>
#include <math.h>
#include <stdlib.h>
#include <time.h>
#include <windows.h>
void intro_game(int* freq);
void horizontal_slide(int x, int y, char *c2);
void draw_rectangle(int r, int c);
void display_text(int count, int r_count);
void game_control(int* r_c, int rnd, int count);
vo... | TOOL | 0.975614 | 3.74929 | {
"github_metadata": {
"branch": "main",
"commit_count": 52,
"repo_created_at": "2022-09-07T08:37: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": "de5fc781041... |
4777cebb-b3e1-43b8-b141-ffe693df80cd | BrayanMBeltre/CPP | For Fun/masclases.cpp | /* Nombre: Brayan
Apellido: <NAME>
Matricula: 2019-0946 */
#include <iostream>
using namespace std;
class vector
{
private:
int array[10];
public:
void ingresar();
void verificar();
};
void vector::ingresar()
{
for (int i = 0; i < 10; i++)
{
cout << "Ingrese el " << i + 1 << " numero: ... | ALGO | 0.991581 | 4.625464 | {
"github_metadata": {
"branch": "master",
"commit_count": 35,
"repo_created_at": "2019-06-15T03:09: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": "090583e96... |
579956dd-7b37-425d-aabf-42ee68639d07 | jaivardhan-bhola/LeetCodeSubmissions | 0150-evaluate-reverse-polish-notation/0150-evaluate-reverse-polish-notation.cpp | class Solution {
public:
int evalRPN(vector<string>& tokens) {
ios::sync_with_stdio(false);
cin.tie(nullptr);
stack<string> st;
int a, ans;
for (auto i : tokens) {
if (i == "+") {
a = stoi(st.top());
st.pop();
ans = ... | ALGO | 0.999842 | 5.35439 | {
"github_metadata": {
"branch": "main",
"commit_count": 415,
"repo_created_at": "2023-10-25T05:48: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": "98198e3c98... |
8038f19f-f945-455d-b772-ae418da8985f | kinjal-jn/CRT | phase 2/graph/DFS.cpp | #include <bits/stdc++.h>
using namespace std;
#define forn(i, n) for (int i = 0; i < n; i++)
typedef vector<vector<int>> vvi;
typedef vector<int> vi;
vvi adj_list(int n, vvi edges) {
vvi adjList(n);
for (vi edge : edges) {
if (edge[0] != edge[1]) {
adjList[edge[0]].push_back(edge[1]);
... | ALGO | 0.999962 | 5.44435 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-06-01T06:41: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": "49d2d6bbc066... |
00f33b5b-cfb3-48cc-988f-66567cebed79 | MaradjaAryelle/ArvorePerfeita | arvorePerfeita.cpp | #include <iostream>
using namespace std;
struct NoArvore {
int data;
NoArvore *esquerda;
NoArvore *direita;
};
void preOrdem(NoArvore *raiz) {
if (raiz != NULL) {
cout << raiz->data << " ";
preOrdem(raiz->esquerda);
preOrdem(raiz->direita);
}
}
int profundidade(NoArvore *... | ALGO | 0.998433 | 4.421663 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-11-21T19:19: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": "ec02bf4d3210... |
25a570f4-39e7-43fd-a431-e08b27b5f5e7 | ashanka234/DS_and_algo | Revision/graph_bfs_dfs.cpp | #include<iostream>
#include<queue>
#include<list>
#include<stack>
using namespace std;
class Graph
{
int V;
list<int> *adj;
void DFSUtil(int v, bool *visited);
void topologicalSortUtil(int v, bool *visited, stack<int> &st);
bool isCyclicUtil(int v, bool *visited, int parent);
public:
Graph(i... | ALGO | 0.999981 | 5.215496 | {
"github_metadata": {
"branch": "master",
"commit_count": 29,
"repo_created_at": "2019-07-04T12:40:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "064a904f7... |
e13fb758-b773-4c03-9e9d-fc95f9137b99 | yegyanathan/Data-Structures-and-Algorithms | list/SLL.h | #include<iostream>
using namespace std;
struct Node{
int data;
Node* link;
};
struct LinkHead{
int count;
Node* head;
};
class SLL{
public:
LinkHead* Head;
SLL(){
Head = new LinkHead();
Head->count = 0;
Head->head = NULL;
}
void insertBa... | ALGO | 0.996906 | 3.485931 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2022-01-10T12:27:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "097975cdf... |
65138b97-c85a-48b6-8f8d-5f4afdaaceaa | gokulll2/LEETCODE | Merge two sorted linked lists - GFG/merge-two-sorted-linked-lists.cpp | //{ Driver Code Starts
#include<iostream>
using namespace std;
/* Link list Node */
struct Node
{
int data;
struct Node *next;
Node(int x)
{
data = x;
next = NULL;
}
};
Node* sortedMerge(struct Node* a, struct Node* b);
/* Function to print Nodes in a given linked list */
voi... | ALGO | 0.99991 | 4.793159 | {
"github_metadata": {
"branch": "main",
"commit_count": 411,
"repo_created_at": "2022-12-01T09:52: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": "c187805b8a... |
e9cd033d-3596-415f-b3b8-1edf8c3a0a4d | Cameron-Basara/Snowflake | src/reactive_system_urc/src/ReactiveSystemPath.cpp | /**
* Created by <NAME> on Nov 3 2018
* Implementation for Reactive System Pathfinder
*/
#include <ReactiveSystemPath.h>
nav_msgs::Path
ReactiveSystemPath::getPath(mapping_msgs_urc::RiskAreaArray risk_areas,
sb_geom_msgs::Point2D goal_pos,
float traj_time_inc... | ALGO | 0.999802 | 6.197194 | {
"github_metadata": {
"branch": "master",
"commit_count": 212,
"repo_created_at": "2022-08-10T09:13: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": "892ea4c3... |
af62711e-9296-45db-b202-e24d07816ff1 | osannadeng/cs010c_lab9 | main.cpp | #include <iostream>
#include <cstdlib>
#include <ctime>
#include <vector>
#include <algorithm>
using std::cout;
using std::endl;
using std::swap;
using std::sort;
using std::clock_t;
const int CLOCKS_PER_MS = CLOCKS_PER_SEC/1000; // clock per milliseconds
const int NUMBERS_SIZE = 50000;
// random number in range -> ... | ALGO | 0.999819 | 5.622259 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-05-02T00:40: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": "66a73bb358e2... |
62f41334-dbb8-4543-a6a3-ea96bb103cb8 | mingliangwsu/CropSyst_MicroBasin | common/soil/hydrology/pedotransfer_abstract.cpp | #include "pedotransfer_abstract.h"
//______________________________________________________________________________
Pedotransfer_functions_abstract::Pedotransfer_functions_abstract //080419
(float32 & _sand, float32 &_clay, float32 &_silt
,float32 & _saturation ,bool saturation_fixed
,f... | ALGO | 0.91012 | 5.054036 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2022-08-03T00:31:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3b5032ec83... |
5180df0f-a061-48d3-838b-c522ca9be3ae | Strusinio/Laboratoria | lab1/lab1.zad1/ConsoleApplication2/ConsoleApplication2.cpp | #include<iostream>
#include<math.h>
using namespace std;
int main()
{
cout.setf(ios::fixed);
cout.setf(ios::showpoint);
cout.precision(3);
double a, b, c, d, e, f;
double x, y;
double W, Wx, Wy;
cout << " podaj wspolczynnik a" << endl;
cin >> a;
cout << " podaj wspolczynnik b" << endl;
cin >> b;
cout <... | ALGO | 0.9995 | 3.308112 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2017-01-19T14:04:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4ce857512c... |
91d8b5e8-6198-4efd-88ad-b8f2a214dfa2 | Rakesh-0786/DSA_Problems | Binary_Search/one.cpp | #include<bits/stdc++.h>
using namespace std;
int binarySearch(vector<int>& arr, int target) {
int low = 0; // start of the search space
int high = arr.size() - 1; // end of the search space
// Use a while loop for binary search
while (low <= high) {
// calculate mid for the search space
... | ALGO | 0.999903 | 6.563268 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2024-10-22T18:32: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": "df146ba9d... |
9cc51e36-6a65-4154-9bfa-19d4695ac5cb | b0sya/ADS_labs | lab3/main.cpp | #include <iostream>
#include "List.h"
#include "Map.h"
#include <gtest/gtest.h>
#include <gmock/gmock.h>
class MyNode {
public:
int freq;
char symbol;
MyNode *left, *right;
MyNode(){
left=right=nullptr;
}
MyNode(MyNode *L, MyNode *R){
left = L;
right = R;
freq... | ALGO | 0.999443 | 3.98999 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2019-05-06T14:37: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": "ea1fe91560... |
47cbad4c-3a27-4f41-bbdb-5c802a4ad8d1 | diffractor/diffractor | third-party/libde265/libde265/intrapred.cc | /*
* H.265 video codec.
* Copyright (c) 2013-2014 struktur AG, <NAME> <<EMAIL>>
*
* This file is part of libde265.
*
* libde265 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 3 o... | ALGO | 0.944297 | 6.189614 | {
"github_metadata": {
"branch": "master",
"commit_count": 70,
"repo_created_at": "2020-06-03T22:35:32.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 80,
"forks": 6,
"issues": 120,
"pull_requests": 0
},
"file_meta": {
"content_id": "750eebf... |
8a8f8f46-9a24-4646-bb0f-7a6fca3ee642 | liuyubobobo/Play-Leetcode | 0501-1000/0935-Knight-Dialer/cpp-0935/main.cpp | /// Source : https://leetcode.com/problems/knight-dialer/
/// Author : liuyubobobo
/// Time : 2018-11-03
#include <iostream>
#include <vector>
using namespace std;
/// Memory Search
/// Time Complexity: O(10 * N)
/// Space Complexity: O(10 * N)
class Solution {
private:
int MOD = 1e9 + 7;
const vector<ve... | ALGO | 0.999925 | 5.647883 | {
"github_metadata": {
"branch": "master",
"commit_count": 2592,
"repo_created_at": "2016-12-01T17:08:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2732,
"forks": 718,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "dd... |
ffa681a3-0f97-4541-95a4-bcd22a774752 | manibhushan20/DSA-in-CPP | 2dArrays1/sumOfelements.cpp | #include <iostream>
using namespace std;
int main()
{
int n;
cout << "Enter number of rows:";
cin >> n;
int m;
cout << "Enter number of columns:";
cin >> m;
int arr[n][m];
cout << "Enter the " << n * m << " elements of array:" << endl;
for (int i = 0; i < n; i++)
{
for (i... | ALGO | 0.999546 | 4.298145 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2024-09-19T18:48: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": "7d865624fc... |
cf140eb1-b2ac-430c-b25a-f9ac7c3627f5 | ChrisVilches/Algorithms | spoj/ADARAINB-ada_and_rain_ii.cpp | #include <bits/stdc++.h>
using namespace std;
typedef tuple<int, int, int> tiii;
struct BIT {
BIT(int n) : bit_n(n + 1) { A.assign(bit_n, 0); }
void range_update(int i, int j, int v) {
update(i, v);
update(j + 1, -v);
}
int query(int i) {
i++;
int sum = 0;
for (; i > 0; i -= i & -i) sum +... | ALGO | 0.999957 | 4.548295 | {
"github_metadata": {
"branch": "main",
"commit_count": 855,
"repo_created_at": "2021-10-04T16:05:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 11,
"pull_requests": 0
},
"file_meta": {
"content_id": "458b5b98a... |
060b1cbb-53fb-40e8-b0e9-19c42b608918 | FabriceScoupe/ProjectEuler | 090/Problem090.cc | #include <iostream>
#include <string>
#include <vector>
/*
* Project Euler: Problem 090 (http://projecteuler.net/problem=90)
*/
// ============================================================================
// Two dice, each with distinct digits among [0..9].
// Must be able to display all squares 0 < x < 100, ie:... | ALGO | 0.999448 | 6.445714 | {
"github_metadata": {
"branch": "master",
"commit_count": 29,
"repo_created_at": "2012-05-11T14:42: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": "0f4979934... |
e51ce042-58b1-4a2e-80c8-f2f6bc816da9 | Ansharma21/Leetcode-Problems | Permutations of a given string - GFG/permutations-of-a-given-string.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution{
public:
void solve(string S , vector<string>&ans , int ind){
if(ind >= S.size()){
ans.push_back(S);
return ;
}
for(int j = ind ; j<S.size() ; j++){
... | ALGO | 0.99983 | 6.328546 | {
"github_metadata": {
"branch": "main",
"commit_count": 144,
"repo_created_at": "2023-03-19T02:45: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": "4e73c56516... |
884d5b41-7418-4dac-a704-56c88256952c | scout451/Top-Academy | OOP/Handbook/source.cpp | #include <iostream>
#include <string>
#include <vector>
#include <fstream>
#include <map>
using namespace std;
//Встреча 26
//Задание 1
//class Directory
//{
// string companyName;
// string owner;
// int number;
// string adress;
// string typeOfActivity;
//public:
// Directory() : Directory ("", "", 0, "", "") {}
/... | TOOL | 0.991576 | 4.489425 | {
"github_metadata": {
"branch": "main",
"commit_count": 79,
"repo_created_at": "2024-04-04T14:40: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": "4fc296cad11... |
334bb4eb-51f9-457f-b8e9-6c73b8dd0908 | LABZHG/AlgorithmsTraining- | Huffman Codes.cpp | #include <bits/stdc++.h>
using std::priority_queue;
using std::vector;
using std::cin;
using std::cout;
using std::endl;
using std::string;
using std::map;
typedef struct TreeNode* Huff_Tree;
struct TreeNode{
char Element;
int Weight;
Huff_Tree Left;
Huff_Tree Right;
};
struct cmp{
bool operator(... | ALGO | 0.999993 | 3.617887 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2020-02-07T13:45: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": "4332d2f7f... |
792e7851-60e6-44bf-ba36-449fd21d4521 | matumoto1234/cp-crawler | AtCoder/agc027/agc027_a/20116547.cpp | // detail: https://atcoder.jp/contests/agc027/submissions/20116547
#include <bits/stdc++.h>
using namespace std;
#define range(i, l, r) for (int i = (int)(l); i < (int)(r); (i) += 1)
#define rrange(i, l, r) for (int i = (int)(r)-1; i >= (int)(l); (i) -= 1)
template <typename T1, typename T2> inline void chmax(T1 &a, T2... | ALGO | 0.999961 | 3.869281 | {
"github_metadata": {
"branch": "main",
"commit_count": 9329,
"repo_created_at": "2022-04-22T07:12:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 4,
"pull_requests": 0
},
"file_meta": {
"content_id": "cf4dc252f... |
794834e4-c639-4400-a9a0-55aacfc2e88b | khanhvu207/competitiveprogramming | old_files/Codeforces/782/b.cpp | #include <bits/stdc++.h>
#define fi first
#define se second
#define ll long long
using namespace std;
const int N = 60005;
const double eps = 1e-9;
int n;
double x[N], v[N];
bool chk(double t) {
double L = -1e18, R = 1e18;
for (int i = 0; i < n; ++i)
L = fmax(L, x[i] - t * v[i]), R = fmin(R, x[i] + t * v[i]);
r... | ALGO | 0.999995 | 4.607037 | {
"github_metadata": {
"branch": "master",
"commit_count": 147,
"repo_created_at": "2018-11-20T08:25:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 18,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7055661... |
5c78d26d-719c-451a-b752-615e2b5e27be | GaoZiqiang/leetcode_practice | 00_三刷/7_动态规划/322_coin_change.cpp | /* leetcode T322:零钱兑换
* 原题链接:https://leetcode-cn.com/problems/coin-change/
* */
/* 方法一:动态规划--类似于T343:整数拆分
*
* 算法思想:
* 以下面这个例子为例:
* 输入:coins = [1, 2, 5], amount = 11
* 输出:3
* 解释:11 = 5 + 5 + 1
* 假设x总金额共dp[x]中组合
* d[11] = min(dp[11-1]+1, dp[11-2]+1, dp[11-5]+1) = min(dp[11-1], dp[11-2], dp[11-5]) + 1
* 以此类推:d... | ALGO | 0.999967 | 5.647882 | {
"github_metadata": {
"branch": "master",
"commit_count": 254,
"repo_created_at": "2021-05-12T03:09: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": "33f68f1a... |
40c29e07-bcce-41aa-99d8-645b4f08d1c9 | zheng327/my_leetcode | P206/main.cpp | /*
* 206. 反转链表
* 给你单链表的头节点 head ,请你反转链表,并返回反转后的链表。
*
* 示例 1:
* 输入:head = [1,2,3,4,5]
* 输出:[5,4,3,2,1]
*
* 示例 2:
* 输入:head = [1,2]
* 输出:[2,1]
*
* 示例 3:
* 输入:head = []
* 输出:[]
*/
#include <iostream>
#include <vector>
using namespace std;
struct ListNode {
int val;
ListNode *next;
ListNode() :... | ALGO | 0.999967 | 5.514703 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-02-22T07:17: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": "3bc4be791bd4... |
43ad8d06-784d-412d-ba8f-bf68b4086033 | jigsaw5071/algorithms | Trees/merge_two_BSTs.cpp | /*
Please note that it's Function problem i.e.
you need to write your solution in the form of Function(s) only.
Driver Code to call/invoke your function would be added by GfG's Online Judge.*/
/* The structure of Node is
struct Node {
int data;
Node * right, * left;
};*/
/*You are required to complete below method *... | ALGO | 0.999997 | 4.999886 | {
"github_metadata": {
"branch": "master",
"commit_count": 203,
"repo_created_at": "2016-08-30T06:34:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bc0bd04d... |
bce4fa1d-f412-4ab1-98ea-f7383f7e5e42 | Eden1114/ACM_ICPC | 未分类/lecture02H.cpp | /*
*题号:Uva
*时间:2017年07月26日
*解题思想:链表的数组实现
*
*/
//include <bits/stdc++.h>
#include <functional>
#include <algorithm>
#include <iostream>
#include <cstdlib>
#include <cstring>
#include <string>
#include <cstdio>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <cmath>
#i... | ALGO | 0.999355 | 3.426303 | {
"github_metadata": {
"branch": "master",
"commit_count": 25,
"repo_created_at": "2017-05-07T15:38:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "30aa06780... |
bf6644bd-ec28-4868-abe2-ef709f455201 | maksmakuta/CProcessing | examples/019.cpp | /**
* Snake game 2.1
* Author: <NAME>
* URL: https://youtu.be/bcIsRJrt50c
*/
#define USE_KEYS
#include "processing.h"
#include "extensions.h"
#define WIN_SIZE 100
#define BOTS_SIZE 2
#define BODY_SIZE 10.00f
#define SPEED_ADD .05f
#define SPEED_MIN .20f
#define SPEED_MAX 5.00f
PVector r(){
return creat... | ALGO | 0.996054 | 6.031893 | {
"github_metadata": {
"branch": "dev",
"commit_count": 122,
"repo_created_at": "2021-12-06T18:04:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 25,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cb7b2b6246... |
25742898-0010-401b-91e8-130172bcd2ae | simhyunmin/AVLTree | AvlTree/AvlTree.cpp | /*
MIT License
Copyright (c) 2024 INHA_OSAP_002_T6
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publis... | ALGO | 0.944537 | 5.183901 | {
"github_metadata": {
"branch": "main",
"commit_count": 132,
"repo_created_at": "2024-10-29T02:38:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 3,
"pull_requests": 3
},
"file_meta": {
"content_id": "e1b6f79382... |
4872aebe-d557-458f-8e62-c255945f564b | lillianafinn/Data-Structures | Recursion/nqueens.cpp | //utilizing backtracking to solve Nqueens
#include <iostream>
using namespace std;
class nqueens {
public:
nqueens() {verbose = false; findall = false; }
void set_verbose() {verbose = true; }
void set_findall() {findall = true; }
void play_game(int N = 0);
private:
bool is_valid(int, int);
... | ALGO | 0.999843 | 5.450129 | {
"github_metadata": {
"branch": "main",
"commit_count": 26,
"repo_created_at": "2025-04-25T23:57: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": "aeea883c210... |
5a1f1fd7-c0bf-4c91-add6-41e3e05fadf0 | JulioEmmmanuel/Data-Structures-and-Algorithms-Specialization | Graphs/4 Paths in graphs 2/3 Exchanging money/shortest_paths.cpp | #include <iostream>
#include <limits>
#include <vector>
#include <queue>
using std::vector;
using std::queue;
using std::pair;
using std::priority_queue;
void dfs(vector<vector<int>> &adj, vector<bool> &visited, vector<int> &shortest, int x){
if(!visited[x]){
visited[x] = true;
shortest[x] = 0;
for(int ... | ALGO | 0.999957 | 3.766715 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2023-09-10T06:08: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": "b74d0194eb37... |
837b207a-4232-46da-9c3b-6edbf170d175 | mfem/mfem | miniapps/shifted/extrapolator.cpp | // Copyright (c) 2010-2025, Lawrence Livermore National Security, LLC. Produced
// at the Lawrence Livermore National Laboratory. All Rights reserved. See files
// LICENSE and NOTICE for details. LLNL-CODE-806117.
//
// This file is part of the MFEM library. For more information and source code
// availability visit ht... | ALGO | 0.998554 | 3.409825 | {
"github_metadata": {
"branch": "master",
"commit_count": 24273,
"repo_created_at": "2015-06-11T21:42:21.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1934,
"forks": 544,
"issues": 96,
"pull_requests": 189
},
"file_meta": {
"content_id": ... |
141ccb06-247a-4be3-b8ea-fa616b7e7302 | habunla/c-practice | 1_two_sum.cpp | #include <stdio.h>
#include <iostream>
#include <vector>
#include <unordered_map>
using namespace std;
// brute way
/*
class Solution {
public:
vector<int> twoSum(vector<int>& nums, int target) {
vector<int> sol(2);
for (int i=0; i<nums.size(); i++) {
for (int j=i+1; j<nums.size(); j++... | ALGO | 0.999964 | 5.720773 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2021-07-27T11:28: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": "e9e015159... |
0d7c4118-395c-4ede-8047-96c247d61167 | jingkongmtsu/xTron.mKP16 | src/result/src/denmtrx2.cpp | /**
* \file denmtrx2.cpp
* \brief describe the functions SCF guess generation for density matrices
* \author <NAME>
*/
#include "mo.h"
#include "shell.h"
#include "excep.h"
#include "gints2d.h"
#include "oneemtrx.h"
#include "molecule.h"
#include "gintsinfor.h"
#include "atomdenmtrx.h"
#include "scfparam.h"
... | ALGO | 0.996259 | 3.740818 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2022-09-21T14:39:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 2,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "a2197b2661... |
0ca02971-d41a-49e4-85e4-529e439a200c | kushalnareda/DSA | Stack and Queue/Day2/stack_middle.cpp | #include <iostream>
using namespace std;
class DLLNode {
public:
DLLNode* prev;
int data;
DLLNode* next;
};
class myStack {
public:
DLLNode* head;
DLLNode* mid;
int count;
};
myStack* createMyStack() {
myStack* ms = new myStack();
ms->count = 0;
ms->head = nullptr;
ms->mid = n... | ALGO | 0.999424 | 5.69784 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2024-06-06T17:48: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": "785dd295827... |
d2eb59bc-6cec-4890-b0a2-5a0231e28f59 | Elizabethvk/UP-2020 | Group 4 (20-21)/Week 06/task07.cpp | //ne e fix dokraq
#include <iostream>
#include <cmath>
//void writeArray(int a[], size_t size);
int main() {
const unsigned MAX_SIZE = 200;
unsigned n;
bool flag = true;
int array[MAX_SIZE];
std::cin >> n;
for (unsigned i = 0; i < n; ++i) {
std::cin >> array[i];
}
for (int i ... | ALGO | 0.999624 | 3.42695 | {
"github_metadata": {
"branch": "main",
"commit_count": 104,
"repo_created_at": "2020-10-16T13:05: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": "62fbad15e8... |
e37bc950-590b-4cb7-bd93-c9f16da52f77 | S-K-Siva/GeeksForGeeks_2025 | Difficulty: Easy/DFS of Graph/dfs-of-graph.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
void dfs(int node, vector<vector<int>> adj,
vector<int>& vis,vector<int>& result){
vis[node] = 1;
result.push_back(node);
for(auto neigh : adj[node]){
... | ALGO | 0.99951 | 6.570133 | {
"github_metadata": {
"branch": "main",
"commit_count": 236,
"repo_created_at": "2025-01-07T16:50: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": "cb595b857c... |
e84cb0f9-c423-42f8-8719-a00a55388272 | suraj98/Data-Structures-And-Algoritms | Graph Data Structure - Algorithms/jumping_num.cpp | /*https://practice.geeksforgeeks.org/problems/jumping-numbers/0/?track=Placement */
#include<iostream>
#include<queue>
#include<vector>
#include<algorithm>
using namespace std;
void jump(int x,int n)
{
queue<int>q;
q.push(x);
vector<int>v ;
while(!q.empty())
{
int a = q.front() ;
... | ALGO | 0.999748 | 5.282539 | {
"github_metadata": {
"branch": "master",
"commit_count": 80,
"repo_created_at": "2018-04-03T20:44: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": "657f53db9... |
052debc2-52d8-4009-a628-0aca31eb9b25 | gcmgomes/mineira2023 | problems/sapo/solutions/good/bernardo.cpp | #include <iostream>
#include <string>
#include <algorithm>
#include <vector>
using namespace std;
typedef long long ll;
const int MAX = 1e5 + 10;
const ll LINF = 0x3f3f3f3f3f3f3f3f;
int n, L[MAX], R[MAX];
pair<ll, vector<int>> ok(int pos) {
if (pos < 0 or pos >= n) return {LINF, {}};
vector<int> ans = {pos... | ALGO | 0.999997 | 3.693871 | {
"github_metadata": {
"branch": "main",
"commit_count": 152,
"repo_created_at": "2023-03-04T16:28:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4366406106... |
b5c213fb-dad2-484e-8eae-38aa179b29c3 | Akrobatik/ps | BaekJoon/33000/33542.cpp | // Title : 극적인 승리
// Link : https://www.acmicpc.net/problem/33542
// Time : 228 ms
// Memory: 10948 KB
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int a, b, n;
cin >> a >> b >> n;
vector<pair<int, int>> lr(n + 1);
for (int i = 1; i <= n; ... | ALGO | 0.999993 | 4.392602 | {
"github_metadata": {
"branch": "main",
"commit_count": 2030,
"repo_created_at": "2025-01-18T13:13:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "26ee76601... |
0ff243b0-eb02-4dac-a6c7-5e0885bc99db | ishandutta2007/codeforces-j | jeroenodb/normal/712/D.cpp | #include "bits/stdc++.h"
using namespace std;
#define all(x) begin(x),end(x)
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, string>::va... | ALGO | 0.999668 | 3.780432 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T05:42:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "873008c16592... |
a483bd40-6cef-4533-b83a-5f0e60451937 | amuskova/Data-Structures-And-Algorithms-course-2019-2020 | homework4/Welcome to the Jungle/main.cpp | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
long N;
cin>>N;
vector<long> v;
v.reserve(N);
long a;
for(long i = 0 ; i < N ; i ++)
{
cin>>a;
v.push_back(a);
}
vector<long> help;
l... | ALGO | 0.999995 | 4.01974 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-04-14T17:09: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": "d791f45913... |
13838813-48cb-4a12-8e1c-15cb083a8acc | project-chip/connectedhomeip | src/platform/android/AndroidChipPlatform-JNI.cpp | /*
* Copyright (c) 2020-2021 Project CHIP Authors
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0... | TOOL | 0.908531 | 3.618188 | {
"github_metadata": {
"branch": "master",
"commit_count": 19981,
"repo_created_at": "2020-03-03T17:05:10.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 8072,
"forks": 2209,
"issues": 1971,
"pull_requests": 358
},
"file_meta": {
"content_id... |
0318f4b2-7fe3-4a98-b7c1-c1858d0fef03 | erivero96/PRACTICA-11 | exp1p11.cpp | #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main(){
vector<int>NumerosEnteros;
int num, cantNum;
cout<<"Cuantos numeros enteros desea ingresar?"<<endl;
cin>>cantNum;
for (int i=0; i<cantNum; i++){
cout<<"Ingrese un numero entero:"<<endl;
cin>>n... | ALGO | 0.996083 | 4.120094 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2023-06-27T02: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": "8a0f71e4596... |
4d0bf6c7-1d28-4de3-92a3-0b94508a5fd2 | yufeiran/ComputerTest2022 | 11.9/源.cpp | #define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<stdio.h>
#include<vector>
using namespace std;
int N, M;
const int MAX_N = 501;
int inEdge[MAX_N];
int isOut[MAX_N];
struct Load
{
int from, to;
Load() {};
Load(int FROM, int TO) :from(FROM), to(TO) {};
};
vector<Load>EDGE[MAX_N];
vector<int>outIndex;
void... | ALGO | 0.999996 | 4.015994 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2022-01-10T07:58: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": "c95fe7b66... |
2046fb71-dd56-4873-a8f8-c959601393aa | ijmp320/Competitive-Programming | CodeForces/ZeptoLab Code Rush 2015.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
#define FOR(i,a,n) for(int i=a;i<(int)(n);i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(a) (a).begin(),(a).end()
#define MP(a,b) make_pair(a,b)
#define PB(a) push_back(a)
#define F first
#define... | ALGO | 0.999919 | 3.630874 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2015-09-23T03:47:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b6ac83b6f... |
d649fdce-4bf6-4392-83fe-b0fae794eb7a | hazem3500/SuperMarket | sortHelpers.cpp | // will be passed as a parameter to the function sort()
class sortByName{
bool order;
public:
sortByName(bool order) {this->order = order;}
bool operator()(const Item& RHS, const Item& LHS){
if (order) return (RHS.getName() > LHS.getName());
else return (RHS.getName() < LHS.getName());
... | TOOL | 0.991028 | 5.63 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2017-12-07T15:39: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": "03e6730e2b... |
70a6393a-c758-479f-a16b-8d734c5fb2fb | jdotaz/primer_proyecto | cadenas.cpp | #include <iostream>
using namespace std;
int tamIter(char *strg)
{
int tam = 0;
for (int i = 0; *(strg+i) != '\0'; i++){
tam++;
}
return tam;
}
int tamRecu(char *strg, int c = 0)
{
if (*(strg+c) != '\0'){
c++;
return tamRecu(strg,c);
}
return c;
}
bool palinIter(char *strg, int tam)
{
fo... | ALGO | 0.99972 | 3.796946 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2019-08-21T15:45:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "35e42e6dc1... |
7f93191e-45c7-4822-bdf2-62c94c8bc52e | FFFcomewhere/leetcode | 0045.cpp | #include <iostream>
#include <vector>
#include <list>
#include <map>
#include <unordered_map>
using namespace std;
//动态规划 时间O(n^2) 空间O(n)
class Solution {
public:
int jump(vector<int>& nums) {
int n = nums.size();
//记录每个到底i点 最少需要多少步
vector<int> dp(n, INT_MAX);
dp[0] = 0;
... | ALGO | 0.999993 | 5.391161 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2022-05-09T13:47:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 4,
"pull_requests": 0
},
"file_meta": {
"content_id": "0e01dc5b0775... |
2a7c738c-8a37-4012-ad28-10a7a0571475 | Arjupta/CPP_Projects | Revision/base_convert.cpp |
#include <iostream>
using namespace std;
class BaseConvert{
private:
long long num;
public:
BaseConvert(){
}
void takeInput(){
cout<<"\nEnter a decimal number"<<endl;
long int number;
cin>>number;
this->num = number;
}
void takeBinaryInput(){
cout<... | ALGO | 0.998672 | 4.063983 | {
"github_metadata": {
"branch": "master",
"commit_count": 25,
"repo_created_at": "2020-08-15T14:51:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "461dc51b9... |
2c64fed8-1415-4009-b8e2-6ebf57a192d3 | shreya2004-26/Cpp | mapsStl.cpp | #include <bits/stdc++.h>
using namespace std;
void print(map<int, string> &m)
{
cout << m.size() << endl;
for (auto &pr : m)
{
cout << pr.first << " " << pr.second << endl;
}
}
int main()
{
map<int, string> m;
m[1] = "abc";
m[5] = "cdc";
m[3] = "acd";
m[6] = "a";
m[5] = "cde";
auto it = m.fi... | ALGO | 0.995675 | 3.400624 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2023-04-02T14:07: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": "dc7135dc8a... |
49f24457-8276-4013-95d3-f3d904844f5a | danyalmendigali/competitiveProgramming | online-judge/10179 - Irreducable Basic Fractions.cpp | #include <iostream>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#define ll long long
#define sz size()
#define pb(a) push_back(a)
#define S second
#define F first
using namespace std;
int phi(int n)
{
ll res = n;
for(int i = 2; i * i <= n; i++){
... | ALGO | 0.999706 | 3.917 | {
"github_metadata": {
"branch": "main",
"commit_count": 1207,
"repo_created_at": "2022-12-10T15:47:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4c4c0bef4... |
2db47bc6-ea05-4352-9ba4-6dd3241e4412 | Sumanthhs27/Leetcode | 987-vertical-order-traversal-of-a-binary-tree/987-vertical-order-traversal-of-a-binary-tree.cpp |
class Solution {
public:
map<int,map<int,multiset<int>>>mp;
void sol(TreeNode* root,int pos,int lev){
if(!root)return;
mp[pos][lev].insert(root->val);
sol(root->left,pos-1,lev+1);
sol(root->right,pos+1,lev+1);
}
vector<vector<int>> verticalTraversal(TreeNode* ro... | ALGO | 0.999995 | 5.902981 | {
"github_metadata": {
"branch": "master",
"commit_count": 2137,
"repo_created_at": "2021-10-23T18:15:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "17c75ad... |
09ce1efe-d98b-435a-9464-97ab65df7f11 | Ubpa/ToyRTX | src/CppUtil/RTX/Hitable/MoveSphere.cpp | #include <CppUtil/RTX/MoveSphere.h>
#include <CppUtil/RTX/TRay.h>
#include <CppUtil/Basic/Ptr.h>
#include <CppUtil/Basic/Math.h>
using namespace RTX;
using namespace CppUtil::Basic;
using namespace glm;
using namespace std;
MoveSphere::MoveSphere(float t0, float t1, const vec3 & center0, const vec3 & center1, float... | ALGO | 0.914504 | 5.537498 | {
"github_metadata": {
"branch": "master",
"commit_count": 56,
"repo_created_at": "2018-11-07T05:34:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 399,
"forks": 52,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "0350a8... |
2e5c32fc-13d1-49c4-8c37-941dfca60871 | chongyan11/ridesharing-simulation | sim-2.1/src/schedule.cpp | ////////////////////////////////////////////////////////////////////////
// //
// scheduler.c //
// //
// implementation of the sch... | ALGO | 0.980681 | 5.824747 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2017-09-26T09:28: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": "98f89a5f0a... |
933a93e8-a9a1-4fc5-82c4-b8f6ad76159c | RyanPioneer/Leetcode | 2501~3000/2911. Minimum Changes to Make K Semi-palindromes/main.cpp | /**
* Source: tinyurl.com/yuy673by
* Date: 2023/10/25
* Skill:
* Runtime: 124 ms, faster than 89.01% of C++ online submissions
* Memory Usage: 33.12 MB, less than 51.65% of C++ online submissions
* Time complexity: O(n)
* Space complexity: O(n)
* Constraints:
*
*/
#include <vector>
#include <iostream>
#inclu... | ALGO | 0.999979 | 4.928874 | {
"github_metadata": {
"branch": "main",
"commit_count": 504,
"repo_created_at": "2021-05-09T23:57: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": "64ade2c921... |
49dda8da-533b-4d56-9c45-daefd161b77e | jhuliagraziella/IC | T2 - Data Mining/AG.cpp | #include <bits/stdc++.h>
#define REPETICOES 10
#define TAMANHO 50
#define GERACOES 50
#define TAXACROSS 50
#define TAXAMUT 20
#define APTMAX 100000
#define PESOMAXIMO 0.3
#define CLASSEESTUDO 5
#define NUMGENES 34
#define TAMTREINO 239
#define TAMTESTE 119
using namespace std;
string op[] = {"=", "!=", ">=", "<"};
m... | ALGO | 0.977061 | 3.540051 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2017-07-07T00:50: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": "fb362e851... |
2284230a-f6dc-4c68-b05c-98a35492cbe0 | AbdullahAhmed922/C-Codes | lec24_sorting.cpp | #include<iostream>
using namespace std;
void bubblesort(int n , int arr[]){
for (int i = 0; i < n-1; i++){
bool isswap = false; //Optimization for some edge cases
for (int j = 0; j < n-i-1; j++){
if (arr[j] < arr[j+1]){ // Change the main formula greater than or less than si... | ALGO | 0.999957 | 5.02898 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-07-13T17:58: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": "51878760db2c... |
c35d9e22-1edc-4cb6-8f65-ecd739db8caf | SherlockedTxh/LeetCode | 34. 在排序数组中查找元素的第一个和最后一个位置*.cpp | #include <string>
#include <vector>
#include <algorithm>
#include <stack>
#include <queue>
using namespace std;
//写完发现这种方法有问题,对于所有元素一样的情况无法保证log(n)的复杂度。
//(left + right) / 2写成left + (right - left) / 2防止溢出
class Solution {
public:
vector<int> searchRange(vector<int>& nums, int target) {
int left(0), right(n... | ALGO | 0.999968 | 5.819593 | {
"github_metadata": {
"branch": "master",
"commit_count": 257,
"repo_created_at": "2019-09-28T01:41: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": "c92fe85a... |
8f4c9ca0-5766-4ee5-a6f8-6a696f1a527b | chaitanyasponnapalli/performance-lab | FilterMain.cpp | //<NAME>
//006948176
#include <stdio.h>
#include "cs1300bmp.h"
#include <iostream>
#include <stdint.h>
#include <fstream>
#include "Filter.h"
#include <omp.h>
using namespace std;
#include "rtdsc.h"
//
// Forward declare the functions
//
Filter * readFilter(string filename);
double applyFilter(Filter *filter, cs1300... | TOOL | 0.972256 | 4.285306 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2016-03-29T06:47: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": "5ecf072f20... |
fccaadb3-c258-423e-a43c-2b0c040ee02e | SinghVikram97/striver-a2z-sheet-solutions | 3. Arrays/3. Hard/12. Merge Sort.cpp | // https://www.geeksforgeeks.org/problems/merge-sort/1
// 0, 1, 2, 3, 4 n=5 5/2 = 2 left=[0,1,2] right = [3,4]
// 0, 1, 2, 3 n=4 4/2 = 2 left=[0,1,2] right=[3] not correct
/*
So mid = n-1 / 2
and left from 0 to mid
and right from mid+1 till n-1
*/
class Solution {
public:
void merge(vector<int> &arr, vector<... | ALGO | 0.999982 | 6.037234 | {
"github_metadata": {
"branch": "main",
"commit_count": 57,
"repo_created_at": "2023-11-28T15:56:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e2a4cdbeba4... |
08653608-8eee-4d27-bd9d-f8826182fcd1 | YuxiKou/leetcode-3 | UniqueBinarySearchTreeII.cc | /*
Given n, generate all structurally unique BST's (binary search trees) that store values 1...n.
For example,
Given n = 3, your program should return all 5 unique BST's shown below.
1 3 3 2 1
\ / / / \ \
3 2 1 1 3 2
/ / \ ... | ALGO | 0.999946 | 6.372564 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2014-07-26T23:22: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": "3ada76eba... |
c4a17c0f-cd8c-4c31-89f6-b3ef9c43d8d3 | ITHelpDec/CPP-Primer | Chapter 10 - Generic Algorithms/10.24.cpp | // Exercise 10.24:
/*
Use bind and check_size to find the first element in a vector of ints that has a value greater than the length of a specified string value.
>> This exercise was quite temperamental...semantic errors that came and went...
*/
#include <vector>
#include <iostream>
#include <string>
#include <fun... | ALGO | 0.985139 | 5.179017 | {
"github_metadata": {
"branch": "main",
"commit_count": 626,
"repo_created_at": "2022-08-06T12:25:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b6a9df5e0a... |
ac3e5af2-f094-4837-bcb3-eb56176da247 | lantimilan/topcoder | tc/SRM572div1/p500.cpp | //500, the length n is only 9, but brute force cannot work as we have 10^9
//numbers to check, each need to go through 50 guesses. It appears that if n is
//smaller, say 4 or 5, then we can work out by brute force. How do we do that?
//
//Reading tourist and petr's solution, and the editorial, it finally makes sense.
/... | ALGO | 0.999763 | 3.635045 | {
"github_metadata": {
"branch": "master",
"commit_count": 493,
"repo_created_at": "2012-07-16T05:16: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": "56386977... |
c7e9d605-001a-4fa9-8f04-5774da2b23bb | CaraDit/DALIexample | fractions.cpp | /* This program takes in 2 fractions and an operator and computes the desired problem.
* It then simplifies and prints the result.
* <NAME>, Autumn 2019
*/
#include <iostream>
using namespace std;
class fraction {
private:
// Internal representation of a fraction as two integers
int numerator;
int den... | TOOL | 0.987779 | 6.268135 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-10-27T14:40: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": "8bf4f962da... |
75e5d1e6-66d0-45f8-b688-bbf6d5dbb974 | ishandutta2007/codeforces-a | akulyat/normal/1470/B.cpp | #include <bits/stdc++.h>
#pragma GCC optimize ("O3", "unroll-all-loops")
#pragma GCC target ("sse4.2")
using namespace std;
#define F first
#define S second
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;
ifstream in;
ofstream out;
const long long kk... | ALGO | 0.999337 | 3.566913 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-04-11T00:51:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6854868e2f13... |
89abd72b-eddf-4e2d-88e5-e5d143d37f4e | GrootTheDeveloper/OLP-ICPC | Algo_Notes/DynamicProgramming/code/c11km.cpp | #include <bits/stdc++.h>
#define int long long
using namespace std;
const int oo = 1e18 + 7;
signed main() {
int n; cin >> n;
vector<int> p(n + 1);
for (int i = 1; i <= n; i++) {
cin >> p[i];
}
vector<vector<int>> f(n + 1, vector<int>(n + 1, oo));
f[0][0] = 0;
for (int i = 1; i <... | ALGO | 0.999918 | 3.879347 | {
"github_metadata": {
"branch": "master",
"commit_count": 41,
"repo_created_at": "2025-02-28T20:29:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
"content_id": "46f27f20b... |
2552931e-a7cb-46ec-bb97-72a5661a76dd | 0x822a5b87/csapp | offer/ch04/exec36.cpp | //
// Created by 杜航宇 on 2019-10-04.
//
// 输入一颗二叉搜索树,将二叉搜索树转换成一个排序的双向链表
// 不能创建任何新的节点,只能调整树中节点指针的指向。
#include "iostream"
#include "../Utilities/BinaryTree.hpp"
/*
* 解法二:我们也可以使用中序遍历的方法。
*/
BinaryTreeNode *Convert(BinaryTreeNode *root)
{
if (root == nullptr)
{
return nullptr;
}
// 找到叶子节点
i... | ALGO | 0.999962 | 5.128522 | {
"github_metadata": {
"branch": "master",
"commit_count": 116,
"repo_created_at": "2019-07-05T06:07:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b32f7735... |
905e7ebd-439a-41d3-a506-8aa1822e4f7f | wx257osn2/shampoo | src/sample/shader_tomohiro.hpp | #pragma once
//http://www.demoscene.jp/?p=811
namespace amp_shader{
class sample_ray_marching : public amp_shader_base<sample_ray_marching>{
struct camera{
float_3 get_side()const restrict(cpu, amp){return cross(dir, up);}
float_3 pos;
float_3 dir;
float_3 up;
__declspec(property(get = get_side)) float_3 side;
... | ALGO | 0.973378 | 6.064868 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2015-12-20T13:52:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7bc0fd9d8c... |
e26120d2-036f-43f5-81f7-69193a7bfc51 | MASRAFI07-GB/cseku_apl_24_230207 | task1/swap_adjancency_nodes_old.cpp | // create a linked list and swap two adjacency node
#include <bits/stdc++.h>
using namespace std;
struct node
{
int data;
struct node *next;
};
void print(struct node *&head)
{
struct node *current = head;
while (current != NULL)
{
cout << current->data << " ";
current = current->next;
}
cout << e... | ALGO | 0.99997 | 4.257888 | {
"github_metadata": {
"branch": "main",
"commit_count": 53,
"repo_created_at": "2024-09-08T15:43: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": "ad51e7ad7a0... |
1432e566-0747-414f-b659-9863bc6255d5 | Kyan820815/leetcode | lc04xx/lc0456.cpp | //--- Q: 0456. 0132 Pattern
//--- method 1: stack
class Solution {
public:
bool find132pattern(vector<int>& nums) {
vector<int> sk;
int third = INT_MIN;
for (int i = nums.size()-1; i >= 0; --i) {
if (third > nums[i])
return true;
while (sk.size() && s... | ALGO | 0.999836 | 6.203255 | {
"github_metadata": {
"branch": "main",
"commit_count": 137,
"repo_created_at": "2020-11-27T03:28: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": "ad94732271... |
55f03188-8dbe-4a4b-8342-2b256a32ee1d | Tracktion/tracktion_engine | modules/3rd_party/choc/containers/choc_NonAllocatingStableSort.h | //
// ██████ ██ ██ ██████ ██████
// ██ ██ ██ ██ ██ ██ ** Classy Header-Only Classes **
// ██ ███████ ██ ██ ██
// ██ ██ ██ ██ ██ ██ https://github.com/Tracktion/choc
// ██████ ██ ██ ██████ ██████
//
// CHOC is (C)2022 Tracktion Corporation, and is ... | ALGO | 0.999739 | 7.780531 | {
"github_metadata": {
"branch": "develop",
"commit_count": 1984,
"repo_created_at": "2018-11-09T12:40:42.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1299,
"forks": 170,
"issues": 31,
"pull_requests": 3
},
"file_meta": {
"content_id": "5... |
7ddae1fb-3265-4c56-8e13-17f7e01f3e04 | Mirrgl/Lab_4 | С++/fifth_task.cpp | #include <iostream>
#include <vector>
#include <random>
#include <ctime>
using namespace std;
bool alwaysCoop(int32_t& round_number, vector<bool>& self_choices, vector<bool>& enemy_choices) {
return 1;
}
bool mirror(int32_t& round_number, vector<bool>& self_choices, vector<bool>& enemy_choices) {
if(round_nu... | ALGO | 0.999298 | 3.588467 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2025-05-28T02:43: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": "9e4271fadc... |
13821ef2-1d74-4a16-b453-1d2b3a68ffae | jxnquil/-2-1 | ТИСД лабораторная 2 задание 1/main.cpp | //
// main.cpp
// ТИСД лабораторная 2 задание 1
//
// Created by <NAME> on 21.02.2024.
//
#include <stdio.h>
#include <stdlib.h>
#define MAX 100
#include <iostream>
using namespace std;
int *pointer; /* указатель на область свободной памяти */
int *top_of_stack; /* указатель на вершину стека */
int *bottom_of_stack... | ALGO | 0.996932 | 3.556854 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-02-21T13:43: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": "a968963f8796... |
541d47fc-e8fc-4d70-a65c-191b268a1090 | RZzero/AlgorithmsLib | Codeforces/1352/f.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int T;
cin >> T;
while (T--) {
int a, b, c;
cin >> a >> b >> c;
string answer = "";
if (!b) {
for (int i = 0; i <= a && a; i++) {
answer += '0';
}
for (int i = 0; i <= c && c; i++) {
answer += '1';
... | ALGO | 0.999413 | 3.894674 | {
"github_metadata": {
"branch": "master",
"commit_count": 311,
"repo_created_at": "2017-12-11T02:50:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 0,
"issues": 5,
"pull_requests": 1
},
"file_meta": {
"content_id": "a168bacb... |
f21546aa-738b-4543-a8a6-519c10149195 | arhumsharif/Data-Structures-Lab-08 | Task_04.cpp | //#include<iostream>
//using namespace std;
//class node
//{
//public:
// int data;
// node* right;
// node* left;
// node()
// {
// data = 0;
// right = NULL;
// left = NULL;
// }
//};
//class Binary_Search_Tree
//{
//public:
// node* root;
// int count;
// const int s = 5;
// Binary_Search_Tree()
// {
// root = N... | ALGO | 0.999712 | 3.100528 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2020-11-15T16:20: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": "fce22182fdbe... |
6f045f5a-4c47-44f3-8bab-f05006761433 | Md-Imam-Hasan/codeforces | Practice/Colour-the-Flag.cpp | #include <bits/stdc++.h>
#define ll long long
#define fast_io \
ios_base::sync_with_stdio(0); \
cin.tie(0);
const double pi = 2.0 * acos(0.0);
// ok
using namespace std;
///Code starts from here
int main()
{
fast_io;
int t, kase = 1;
cin >> t;
while (t--)
{
int n, m, i, j, k;
bo... | ALGO | 0.999903 | 3.638631 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2021-08-12T03:15: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": "c2809069751d... |
a4938621-d18e-440b-b74f-0433ff773862 | mquig42/AdventOfCode2024 | src/day01.cpp | #include "day01.h"
Day01::Day01()
{
dayNumber = 1;
}
void Day01::load(File file)
{
while(file.available())
{
list1.push_back(file.parseInt());
list2.push_back(file.parseInt());
}
file.close();
//This method of reading the file puts a 0 on the end of each list. Remove it
list1.pop_back();
l... | ALGO | 0.994906 | 4.701971 | {
"github_metadata": {
"branch": "main",
"commit_count": 95,
"repo_created_at": "2024-11-30T20:47:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "33e2477d31e... |
beca405d-af86-41b9-88a0-06eca961876e | kimusamu/PS_Test | Practice/Practice/4179.cpp | // BOJ 4179
#include <iostream>
#include <queue>
using namespace std;
string room[1002];
int dist1[1002][1002];
int dist2[1002][1002];
int dx[4]{ 1, 0, -1, 0 };
int dy[4]{ 0, 1, 0, -1 };
int main()
{
int R, C;
cin >> R >> C;
for (int i = 0; i < R; ++i)
{
cin >> room[i];
}
for (int i = 0; i < R; ++i)
{
... | ALGO | 0.999961 | 4.311847 | {
"github_metadata": {
"branch": "main",
"commit_count": 37,
"repo_created_at": "2024-11-05T06:24: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": "ff09bb5b0a9... |
27605ef5-1992-4fbd-93eb-4d1a0efc1c15 | chinmay-gupta-2003/POTD | 2024/9_September/30th_1381_Design_a_Stack_With_Increment_Operation.cpp | #include <bits/stdc++.h>
using namespace std;
class CustomStackBrute
{
vector<int> stackVector;
int top, stackSize;
public:
CustomStackBrute(int maxSize)
{
top = -1;
stackSize = maxSize;
stackVector.resize(maxSize);
}
void push(int x)
{
if (top == stackSize - 1)
return;
stac... | ALGO | 0.999236 | 4.802396 | {
"github_metadata": {
"branch": "main",
"commit_count": 254,
"repo_created_at": "2024-10-03T08:08: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": "6ee7fa405e... |
9a1f8df9-4678-4d84-be43-ef802bb77b3d | Yawn-Sean/Daily_CF_Problems | daily_problems/2024/10/1011/personal_submission/cf799d_kamtuo.cpp | /*----------------------------------*/
/* Author : KaMtuo */
/* Email : <EMAIL> */
/* Creation_time : 2024-10-11 19:49 */
/* Software : Visual Studio Code */
/*----------------------------------*/
#ifndef KAMTUO_LEETCODE
int main() {
std::ios::sync_with_stdio(false);
cin.tie(nul... | ALGO | 0.999842 | 4.267707 | {
"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": "83b8... |
de9317dd-03d5-4413-aa85-e92f42284368 | MuKuLJain07/Problem-Solving | Searching - 1/C-Counting2.cpp | #include <iostream>
#include<vector>
using namespace std;
int binarySearch(vector<int> &heights, int key){
int lb = 0;
int ub = heights.size()-1;
while(ub>=lb){
int mid = lb + (ub-lb)/2;
if(heights[mid] == key){
return mid;
}
else if(heights[mid] > key){
... | ALGO | 0.999951 | 4.399692 | {
"github_metadata": {
"branch": "main",
"commit_count": 32,
"repo_created_at": "2024-03-10T04:27:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "93b49a1e437... |
f531e21b-39d1-4376-afce-73d2ce063f68 | skripov-ds-ai/labs_inline_assembler | labs_inline_assembler/first_exercise.cpp | // Copyright (c) 2017 <NAME>
// https://github.com/nizhikebinesi/labs_inline_assembler
#include "first_exercise.h"
namespace exercises {
// Exercise:
// Определить номер позиции, с которой начинается первое слева
// вхождение указанной строки символов.
int index_of(char* src, char* tgt) {
//int src_le... | ALGO | 0.999466 | 4.703438 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2017-05-08T13:25:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5327222e0a... |
1ede27fc-412f-4e9e-9dce-ab8249ded14b | materijalifer/UUTR | labosi/lab-3/2009-10/by_unknown_/simulator.cpp | #include <cstdio>
#include <algorithm>
#include <map>
#include <utility>
#include <string>
using namespace std;
int main (){
FILE *fdef = fopen ("definicija_3_labos.txt","r");
FILE *ftraka = fopen ("traka.txt", "r");
char tren_stanje[500], ulaz_trake[500], novo_stanje[500], novi_znak_trake[500], pomak[... | ALGO | 0.999093 | 3.699283 | {
"github_metadata": {
"branch": "master",
"commit_count": 22,
"repo_created_at": "2022-07-02T18:17: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": "5083680bf... |
785377b0-563c-479f-85ca-e48da6eda532 | Kobzol/sampler | gui/model/statistics/TopdownTreeCalculator.cpp | #include "TopdownTreeCalculator.h"
TopdownTreeCalculator::CallRecord::CallRecord(std::string parent, std::string function,
std::string location, std::string module)
: parent(std::move(parent)), function(std::move(function)),
location(std::move(location)),... | ALGO | 0.978912 | 6.526632 | {
"github_metadata": {
"branch": "master",
"commit_count": 45,
"repo_created_at": "2017-11-17T22:39: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": "457f80633... |
f3bab526-6bca-48fe-9ae6-68af47cc7bb1 | pk400/SPO600-Build-Framework | src/m10k_permute.cpp | #include <iostream>
#include <string>
#include <vector>
using namespace std;
/*
* This is a recursive function to print permuted options.
*/
void PrintOption(vector<vector<string> >& optionGroups, unsigned int idx, vector<unsigned int>& pivots)
{
vector<string> optionGroup = optionGroups[idx];
if (pivots[idx] <... | ALGO | 0.997924 | 5.780567 | {
"github_metadata": {
"branch": "master",
"commit_count": 98,
"repo_created_at": "2015-10-16T16:53:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 9,
"issues": 9,
"pull_requests": 0
},
"file_meta": {
"content_id": "fa0611d4b... |
e2d4849c-04b3-4924-a2f9-94f6f3334080 | zhaoyu775885/FCEMS | src/LinAlg.cpp | #include "LinAlg.h"
#if 0
void leqSolve_z(DComplex *a, DComplex *b, const int n, const int nb)
{
int ipiv[n];
char trans = 'N';
int info1, info2;
info1 = LAPACKE_zgetrf(LAPACK_ROW_MAJOR, n, n, (MKL_Complex16 *)a, n, ipiv);
info2 = LAPACKE_zgetrs(LAPACK_ROW_MAJOR, trans, n, nb, (MKL_Complex16 *)a, n... | ALGO | 0.997482 | 3.509477 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2017-03-15T20:03: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": "e1ee621986... |
603d69de-bda0-4a76-9d01-c2cff4c83c14 | RockyYan1994/Algorithm | 40_combination_sum_2.cpp | /*
first
和39问题类似,但是一直不是特别理解为什么第33行是i>begin,发现解释如下。
cuyuan May 25, 2016, 7:54 PM
For those who don’t understand how to avoid duplicate by:
if "(i > cur && cand[i] == cand[i-1]) continue;
when we should skip a number? not just it’s the same as previous number, but also when it’s previous number haven’t
been adde... | ALGO | 0.999991 | 5.537562 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2017-12-14T08:42:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "08b83b718... |
4019baf8-6c45-4188-a1c8-ed91a8278ae3 | Guan-JW/HOCO | HOCO/SchemeCollectModule/schemes/sequiturBasedEngine/sequitur.cc | /****************************************************************************
sequitur.cc - Module containing the main() function, and functions for
printing out the grammar.
main() function contains: command line options parsing,
program initialization, reading the input...
Compilation note... | ALGO | 0.961268 | 5.517637 | {
"github_metadata": {
"branch": "main",
"commit_count": 32,
"repo_created_at": "2023-04-15T19:20:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f4a8ea1d2b3... |
404d3a51-c213-465b-9729-65e7fed6e68d | vprover/vampire | Shell/SymbolOccurrenceReplacement.cpp | /*
* This file is part of the source code of the software program
* Vampire. It is protected by applicable
* copyright laws.
*
* This source code is distributed under the licence found here
* https://vprover.github.io/license.html
* and in the source directory
*/
#include "Kernel/Formula.hpp"
#include "Kernel/S... | TOOL | 0.995238 | 5.255214 | {
"github_metadata": {
"branch": "master",
"commit_count": 10098,
"repo_created_at": "2014-03-24T15:46:00.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 339,
"forks": 60,
"issues": 31,
"pull_requests": 6
},
"file_meta": {
"content_id": "e03... |
1c7b6317-723e-471d-924e-197d4290306e | q871980431/Algorithmtest | Project/logic/Logic/LeetCode/AddingTwoNumber_2.cpp | /*
* File: LeetCode.cpp
* Author: XuPing
*
* Created On 2019/4/17 16:46:43
*/
#include "AddingTwoNumber_2.h"
namespace leetcode
{
AddingTwoNumber * AddingTwoNumber::s_self = nullptr;
LeetCodeRegister<AddingTwoNumber> addingTwoNumbertest;
void AddingTwoNumber::StartTest(core::IKernel *kernel)
{
TRACE_LOG("... | TEST | 0.978719 | 5.05892 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2019-04-17T03:40: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": "efdfd690b... |
bf5fc1e7-4a6f-41b8-84bd-52e16fd8a8b7 | ilvokhin/cses-problem-set | mathematics/creating_strings_ii.cpp | #include <unordered_map>
#include <algorithm>
#include <iterator>
#include <iostream>
#include <iomanip>
#include <cassert>
#include <utility>
#include <string>
#include <vector>
#include <limits>
#include <queue>
#include <cmath>
#include <map>
#include <set>
using namespace std;
using ll = long long;
static const ... | ALGO | 0.999996 | 4.955783 | {
"github_metadata": {
"branch": "master",
"commit_count": 136,
"repo_created_at": "2020-03-09T14:17:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d1f26b5d... |
04e47d2b-631e-4d64-ac91-4f381ef3767e | moonflower-Bai/OIcode | 动态规划/p1064.cpp | #include <bits/stdc++.h>
using namespace std;
const int qwe = 1005;
int n, m;
int mv[qwe], mp[qwe], av[qwe][3], ap[qwe][3], f[qwe];
int main()
{
freopen("test.in", "r", stdin);
freopen("test.out", "w", stdout);
scanf("%d %d", &n, &m);
int v, p, q;
for (int i = 1; i <= m; i++)
{
scanf("%d... | ALGO | 0.999955 | 3.434022 | {
"github_metadata": {
"branch": "master",
"commit_count": 40,
"repo_created_at": "2022-10-20T11:44: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": "e6fc9d9ab... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.