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 |
|---|---|---|---|---|---|---|---|
2a50c7d2-1cf9-48cc-96a3-8a1e1e995fc0 | ANTsX/ANTs | ImageSegmentation/itkWeightedVotingFusionImageFilter.h | /*=========================================================================
*
* Copyright Insight Software Consortium
*
* 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
*
* h... | ALGO | 0.942356 | 6.723417 | {
"github_metadata": {
"branch": "master",
"commit_count": 5130,
"repo_created_at": "2013-01-23T15:43:41.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1332,
"forks": 389,
"issues": 88,
"pull_requests": 3
},
"file_meta": {
"content_id": "81... |
c4722321-4363-4398-8c7a-5b49c5a1f3d9 | bm-mit/Codeforces | 129B_StudentsAndShoelaces.cpp | //* 203008088 Apr/22/2023 12:01UTC+7 Minh4893IT B - Students and Shoelaces GNU C++17 Accepted 62 ms 400 KB
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n, m;
cin >> n >> m;
vector<unordered_set<int>> members(n + 1);
for (int i = 0; i < m; ++i)
{
int a, b;
cin >> ... | ALGO | 0.99986 | 3.819927 | {
"github_metadata": {
"branch": "master",
"commit_count": 515,
"repo_created_at": "2023-05-01T08:26:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "37952cc1... |
3d2783f5-93a8-4236-9a3e-28ba083a6672 | AhmedRamadanAbdElghany/CompetitiveProgramming | Spoj/SAMTWARR.cpp | // WA
#include <bits/stdc++.h>
#define all(v) v.begin(),v.end()
#define allr(v) v.rbegin(),v.rend()
#define rep(i,m) for(int i=0;i<m;i++)
#define REP(i,k,m) for(int i=k;i<m;i++)
#define repd(i,m) for(int i=m;i>=0;i--)
#define P(x) cout<<#x<<" = { "<<x<<" }\n"
#define m... | ALGO | 0.999944 | 3.628813 | {
"github_metadata": {
"branch": "master",
"commit_count": 144,
"repo_created_at": "2017-02-11T18:56: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": "aff24bc7... |
ea1f4100-2eef-4482-a6bd-cb9347fc13bd | seantsao00/Jane-The-Ripper | src/sha256.cpp | #include "sha256.h"
#include <hip/hip_runtime.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
// circular shift - wiki:
// https://en.wikipedia.org/wiki/Circular_shift
#define _rotl(v, s) ((v) << (s) | (v) >> (32 - (s)))
#define _rotr(v, s) ((v) >> (s) | (v) << (32 - (s)))
#define _swap(x, y) (((x)... | ALGO | 0.997865 | 6.086264 | {
"github_metadata": {
"branch": "main",
"commit_count": 33,
"repo_created_at": "2024-12-19T13:09: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": "658e27787a6... |
55e5fdc9-644b-42c2-877e-8d2ea709fcc6 | wolfchimneyrock/sudoku | solver.cpp | /////////////////////////////////////////////////////////////////////////////////////
// <NAME>
// CISC 3410 Assignment #2
// 2016-10-02
// solver.cpp
////////////////////////////////////////////////////////////////////////////////////
#include "board.hpp"
#include "solver.hpp"
namespace Sudoku {
Solver::Solver(... | ALGO | 0.999933 | 5.000641 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2016-10-12T19:44: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": "299828eb64... |
c6e01fff-0b94-4f12-a873-2e7b4e89473e | hotbig/letmetry | leetcode/course_schedule_v2.cpp | #include<iostream>
#include<vector>
#include<set>
#include<string>
using namespace std;
class Solution {
class GraphGraph{
public:
int val;
vector<int> next;
};
bool helper(GraphGraph g, vector<GraphGraph>& gr, vector<int>& res, int numCourses)
{
// res.push_back... | ALGO | 0.999981 | 5.298005 | {
"github_metadata": {
"branch": "master",
"commit_count": 167,
"repo_created_at": "2015-06-05T12:58: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": "700f192d... |
005f277c-0ffb-4902-a28c-87bd51226e44 | android/ndk-samples | endless-tunnel/app/src/main/cpp/glm/gtx/matrix_operation.inl | ///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
///////////////////////////////////////////////////////////////////////////////////////////////////
// Created : 2009-08-29
// Updated : 20... | TOOL | 0.948009 | 6.601201 | {
"github_metadata": {
"branch": "main",
"commit_count": 1618,
"repo_created_at": "2015-05-16T10:02:15.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 10324,
"forks": 4239,
"issues": 19,
"pull_requests": 5
},
"file_meta": {
"content_id": "44... |
d24a0bd5-f641-4171-9d3e-1c6275adf5cc | ZanneZankyo/LeetCodeSandBox | 172.factorial-trailing-zeroes.cpp | /*
* @lc app=leetcode id=172 lang=cpp
*
* [172] Factorial Trailing Zeroes
*
* https://leetcode.com/problems/factorial-trailing-zeroes/description/
*
* algorithms
* Easy (37.27%)
* Total Accepted: 148.7K
* Total Submissions: 399K
* Testcase Example: '3'
*
* Given an integer n, return the number of trail... | ALGO | 0.999893 | 6.457255 | {
"github_metadata": {
"branch": "master",
"commit_count": 86,
"repo_created_at": "2019-03-15T01:20: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": "63785f26b... |
307d3c92-817a-4986-8b9a-bab316412dc3 | Endy3032/CTin | TDN/Y1/Archive/MaxNum.cpp | #include <bits/stdc++.h>
using namespace std;
ifstream inp("MAXNUM.inp");
ofstream out("MAXNUM.out");
vector<int> nums;
int numC, n = 0, mx = 0, mxi = 0;
int main() {
/**
* 8
* 10 2 6 2 5 2 1 2
*/
inp >> numC;
for (int i = 0; i < numC; i++) {
inp >> n;
int tmx = max(mx, n);
if (mx != tmx) {
... | ALGO | 0.99989 | 3.614717 | {
"github_metadata": {
"branch": "master",
"commit_count": 162,
"repo_created_at": "2022-10-06T14:40: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": "040ec1be... |
eb4a91e4-5894-4fbc-ab59-20ed206e185a | KratosMultiphysics/Kratos | applications/SwimmingDEMApplication/custom_constitutive/vorticity_induced_lift_laws/el_samni_lift_law.h | // Author: <NAME> (<EMAIL>)
// Date: February 2019
// El Samni, E.A. (1949), see paper by <NAME> (1994)
#if !defined(SDEM_EL_SAMNI_LIFT_LAW_H_INCLUDED)
#define SDEM_EL_SAMNI_LIFT_LAW_H_INCLUDED
#include "vorticity_induced_lift_law.h"
namespace Kratos {
class KRATOS_API(SWIMMING_DEM_APPLICATION) ElSamniLiftLaw :... | ALGO | 0.996092 | 5.986517 | {
"github_metadata": {
"branch": "master",
"commit_count": 106408,
"repo_created_at": "2017-02-13T10:58:24.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1141,
"forks": 265,
"issues": 381,
"pull_requests": 258
},
"file_meta": {
"content_id"... |
efab09ee-8191-4a99-9b99-0dfa42cbc6d0 | KamalRushdi/Data-Structures-Practice | heap_and_priority_queue/heap_using_algorithm_library/src/main.cpp | #include<iostream>
#include<vector>
#include<algorithm>
#include<queue>
#include"../include/coordinate.hpp"
using namespace std;
void heap_stl();
void priority_queues();
void comparator_examples();
int main(int argc, char* argv[]) {
heap_stl();
priority_queues();
comparator_examples();
return 0;
}
... | ALGO | 0.966195 | 3.814949 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2024-02-01T13:41: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": "b64cd39bfd7... |
f7d28717-0835-4d6b-9789-a7eac75af775 | chirag1254/data-structures-using-cpp | 01_stack.cpp | #include<iostream>
using namespace std;
class Stack{
private: int arr[10];
private: int top;
public:
Stack(){
top = -1;
for (int i = 0; i < 10; i++){
arr[i] = 0;
}
}
bool isEmpty(){
if (top == -1)
return true;
... | ALGO | 0.98604 | 3.856385 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2021-07-15T18:28: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": "424aeac3935a... |
dbf5aea1-a71f-4cb3-93a1-9ac6b713160b | XeroHero/C-C-INSA-Lyon | binaryConversions.cpp | // Programmation INSA Lyon 3IF.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include "pch.h"
#include <iostream>
#include <stack>
#include <string>
#include <sstream>
using namespace std;
stack<int> euclideanDivision(int &val, stack<int> &v);
int binaryToDecimal(long long b... | ALGO | 0.998615 | 4.751401 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2018-09-22T13:36: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": "11ea99247a... |
7537a07b-ce41-42de-b37d-396a174caa82 | IGNF/librjmcmc | samples/quickstart/quickstart.cpp | /***********************************************************************
This file is part of the librjmcmc project source files.
Copyright : Institut Geographique National (2008-2012)
Contributors : <NAME>, <NAME>, <NAME>
email : <EMAIL>
This software is a generic C++ library for stochastic optimization.
This softw... | ALGO | 0.999369 | 5.864795 | {
"github_metadata": {
"branch": "master",
"commit_count": 398,
"repo_created_at": "2014-04-30T14:13:42.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 20,
"forks": 11,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f8713c6... |
f71805f8-e1b2-4392-a234-dbada20b36f2 | heavenMOJANG/ICPC | .history/programmes_C_Cpp/HDU/2025“钉耙编程”中国大学生算法设计春季联赛 - 热身赛/1003_20250306092827.cpp | #pragma GCC optimize(1)
#pragma GCC optimize(2)
#pragma GCC optimize(3, "Ofast", "inline")
#include <bits/stdc++.h>
#define int long long
#define i128 __int128
using namespace std;
constexpr int INF = 0x7fffffff;
void solve() {
int n; cin >> n;
i128 A{}, B{}, C{};
for (int i = 0; i < n; ++ i) {
unsi... | ALGO | 0.999835 | 5.077703 | {
"github_metadata": {
"branch": "main",
"commit_count": 28,
"repo_created_at": "2025-01-19T07:27:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9a258d548bf... |
f8022f76-5544-46f0-8c78-d7589e56ce61 | danheeks/PyCAM | Sim/volume.cpp | /*
* Copyright 2010 <NAME> (<EMAIL> "at" gmail.com)
* Copyright 2015 <NAME> (<EMAIL>)
*
* This file is part of OpenCAMlib.
*
* OpenCAMlib is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, ... | ALGO | 0.976965 | 5.041682 | {
"github_metadata": {
"branch": "master",
"commit_count": 161,
"repo_created_at": "2018-10-11T12:34:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 29,
"forks": 5,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "a7116b9... |
3faa0f48-5f74-4707-bea3-af7279a3643e | ishandutta2007/codeforces-n | ngochai94/normal/391/B.cpp | #include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for (int i = (a); i <= (b); i++)
#define FORD(i,a,b) for (int i = (a); i >= (b); i--)
#define REP(i,a) FOR(i,0,(int)(a)-1)
#define reset(a,b) memset(a,b,sizeof(a))
#define BUG(x) cout << #x << " = " << x << endl
#define mod 1000000007
#define pi acos(-1)
... | ALGO | 0.999921 | 3.475399 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T15:35:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "03b3b6c8bc5b... |
d4378aa0-f6e7-4da0-8e42-301326f323ba | llllvvuu/meta-hacker-cup-solver | round1_logs/pass@256/Wildcard Submissions_150.cpp |
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vecto... | ALGO | 0.999996 | 5.827092 | {
"github_metadata": {
"branch": "main",
"commit_count": 26,
"repo_created_at": "2024-09-03T16:52:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "27818d8f89c... |
1080192e-0416-4303-a564-89f082afa400 | abojha/Data-Structure | All_Data_Structure/2_Link_List/9_Create_a_Linked_list_of_desired_Nodes.cpp | #include<iostream>
using namespace std;
struct Node{
int data;
struct Node *next;
};
void display(struct Node *head)
{
while(head!=NULL)
{
cout<<head->data<<" ";
head = head->next;
}
}
struct Node *Creation(int &n)
{
struct Node *head=NULL;
struct Node *temp=NULL;
struct... | ALGO | 0.998835 | 3.770371 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2022-02-25T08:31:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a576e0d72... |
1a96d723-51b9-409a-af97-1592bc01a85b | philippehawi/PLoM | cpp_lib/src/potential_eigen.cpp | #include <Eigen/Dense>
#include <cmath>
#include <iostream> // For debug output
// Define export macros for platform compatibility
#ifdef _WIN32
#define EXPORT __declspec(dllexport)
#else
#define EXPORT __attribute__((visibility("default")))
#endif
extern "C" EXPORT void get_L(const double* H, const double* ... | ALGO | 0.999657 | 4.672899 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2022-03-19T01:32:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "849c4efbf8f... |
b255676d-8cd8-4bfd-9eb3-707cb7675572 | OnisBrown/OOP-Assignment | Wally/WallyC/WallyC.cpp | // WallyC.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "LargeI.h"
#include "matchImage.h"
using namespace std;
int main()
{
int menu = 0; // bool for the menu switch
bool quit = false;
clock_t start = clock();// starts a clock to time execution
int CM = 768; int CN =... | TOOL | 0.921073 | 3.960921 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2022-06-29T11:04: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": "8adabf88e498... |
56c191fe-0cc4-4236-abb2-9658ea707df5 | Yaminyam/Algorithm | BOJ/15903.cc | #include <stdio.h>
int main()
{
int n, m;
long long array[1001];
long long sum = 0;
scanf("%d %d", &n, &m);
for (int i = 0; i < n; i++)
{
scanf("%lld", &array[i]);
}
for (int i = 0; i < m; i++)
{
long long min1 = array[0];
int index1 = 0;
int index2 = 0;
for (int i = 0; i < n; i++)
{
if (a... | ALGO | 0.999989 | 3.340482 | {
"github_metadata": {
"branch": "master",
"commit_count": 600,
"repo_created_at": "2018-10-16T04:07: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": "fbfcae03... |
7ada7763-01f3-428d-a541-c2186163ec73 | MaciejRumas/MES | MES/Gauss.h | #pragma once
#include<iostream>
using namespace std;
struct Gauss {
double** createUpperMatrix(double**& matrix, unsigned n) {
for (unsigned i = 0; i < n; i++) {
for (unsigned j = n - 1; j > i; j--) {
if (matrix[j][i] > matrix[j - 1][i]) { // Pivot //
swap(matrix[j], matrix[j - 1]);
}
}
for... | ALGO | 0.999927 | 3.614261 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2019-10-27T20:08: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": "8ad696a26... |
133ede4c-ab59-4a4e-b0f1-dabe76f7a143 | GrtSid/Competitive_Programming | practice/merge_link.cpp | #include<bits/stdc++.h>
using namespace std;
class node{
public:
int data;
node *next;
};
void push(node **head_ref,int data){
node* new_node=new node();
new_node->data=data;
new_node->next=*head_ref;
(*head_ref)=new_node;
}
void printlist(node *node){
while(node!=NULL){
cout<<node->data<<" ";
node... | ALGO | 0.999965 | 4.508786 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2019-08-22T08:00: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": "0f1fd22891... |
b40eb384-2c65-4704-b076-dd8e58dae81d | LucaDantas/CP | codeforces/Avulse/1758E.cpp | #include <bits/stdc++.h>
using namespace std;
constexpr int maxn = 2e5+10, logn = 20, mod = 1e9+7;
vector<pair<int,int>> g[maxn];
int valor[maxn], h;
bool mark[maxn], ok = 1;
void limpar(int sz) {
ok = 1;
for(int i = 0; i <= sz; i++) {
g[i].clear();
mark[i] = 0;
}
}
void dfs(int u) {
... | ALGO | 0.999771 | 3.961819 | {
"github_metadata": {
"branch": "master",
"commit_count": 870,
"repo_created_at": "2019-11-28T16:12:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0fb7cb57... |
4a313754-0611-4d8d-9725-67a4946fb6ca | lballabio/QuantLib | ql/methods/finitedifferences/schemes/impliciteulerscheme.cpp | /* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
Copyright (C) 2009 <NAME>
Copyright (C) 2009 <NAME>
Copyright (C) 2009, 2017 <NAME>
This file is part of QuantLib, a free-software/open-source library
for financial quantitative analysts and developers - http://quantlib.org/
Qua... | ALGO | 0.994211 | 7.199463 | {
"github_metadata": {
"branch": "master",
"commit_count": 17543,
"repo_created_at": "2015-12-17T16:29:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6151,
"forks": 1964,
"issues": 51,
"pull_requests": 11
},
"file_meta": {
"content_id":... |
e0890817-788d-474f-b68c-5f9876e6a0a2 | WaizungTaam/Deep-Belief-Network | src/dbn.cc | /*
Copyright 2016 WaizungTaam. All rights reserved.
License: Apache License 2.0
Email: <EMAIL>
Creation time: 2016-07-16
Last modified: 2016-07-16
*/
#include <vector>
#include "dbn.h"
#include "rbm.h"
#include "mlp.h"
#include "./math/matrix.h"
DBN::DBN(const std::vector<int> & dim_layers) {
mlp =... | ALGO | 0.976708 | 4.927403 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2016-07-16T16:04: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": "3accaaca8e... |
b5831b6b-10a8-4c68-b9b0-ff1ab5a370e3 | joaoandreotti/competitive_programming | cp3/grah_edge_propertie_check.cpp | #include <bits/stdc++.h>
void input ();
void solve ();
typedef std::vector <int> vi;
typedef std::vector <vi> vvi;
const int MAXN = 2e2 + 1, explored = 2;
int n, m;
vvi g;
int visited [MAXN];
void dfs (int x, int f) {
visited [x] = explored;
for (int v : g [x]) {
if (!visited [v]) {
printf ("Tree-edge: {%d,... | ALGO | 0.999925 | 4.023828 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2019-11-22T15:52: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": "15562f25d2... |
8cbdf196-3561-4b98-9dff-ef91b23e9ae1 | Raviyadav144/Competitve-Programming | DSA/DIVSUBS.cpp | #include<bits/stdc++.h>
using namespace std;
#define forn(i,j,n) for(int i =j; i<n; i++)
#define ll long long
#define all(v) v.begin() , v.end()
#define vi(v,n) vector<int> v(n)
#define fora(e,v) for(auto &e :v)
#define endl "\n"
#define pi acos(-1.0)
#define mod 1000000007
int main()
{
ios::sync_with_stdio(fal... | ALGO | 0.999849 | 3.705484 | {
"github_metadata": {
"branch": "master",
"commit_count": 309,
"repo_created_at": "2021-06-07T18:30: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": "5b6c9719... |
dc3fa002-d512-402e-af65-049417fb2d95 | tinhngovnptho/Code | CP/Code THPT/Thinh giang 10/ThayBinh_K10/Week1/spy.cpp | /*
Author: tinhnopro
created: 02.04.2025 22:38:45
*/
#include <bits/stdc++.h>
#define CHERRY "spy"
using namespace std;
using i64 = long long;
#define int long long
int n, m, i1, j1, i2, j2;
bool c[205][205];
int d[205][205][5];
const int oo = 1e16;
struct DATA{
int x, y, h;
};
int dx[] = {0, 1, 0, -1, 0};... | ALGO | 0.999887 | 4.534709 | {
"github_metadata": {
"branch": "main",
"commit_count": 25,
"repo_created_at": "2024-10-13T07:51: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": "04aaae0b39c... |
50e13e0c-dffa-45ff-a8ca-71e825b125dd | michaelrk02/tlx-toki-course-cp | 03-pencarian-dan-pengurutan/A.cpp | // A - <NAME>
#include <iostream>
using namespace std;
#define ABS(x) ((x) < 0 ? -(x) : (x))
#define MIN(a,b) (((a) < (b)) ? (a) : (b))
int main() {
int N, X;
cin >> N >> X;
int winner = 0;
for (int i = 0; i < N; i++) {
int K;
cin >> K;
int d = ABS(K - X);
if (i > 0)... | ALGO | 0.999992 | 4.185847 | {
"github_metadata": {
"branch": "master",
"commit_count": 25,
"repo_created_at": "2020-06-19T05:10: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": "8b133b5bb... |
8109e062-a59b-43b4-9ae0-abde8a1add85 | oreinke/CodeForces-contests | UTPC Contest 09-13-24 Div. 2/b.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, k;
cin >> n >> k;
k++;
string num;
cin >> num;
int i = 0, j = 0;
int max = 0;
int cur = 1;
int count = 0;
if (num[0] == '2') {
count++;
}
while (i < n) {
// case where no k allowed and we... | ALGO | 0.999385 | 3.841587 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2024-12-05T17:09: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": "9477e9a7e85... |
b5336eb7-dadd-4d73-9fe7-4d96c9e1fd70 | kowalks/competitive-programming | codeforces/cf#784/F.cpp | #include<bits/stdc++.h>
using namespace std;
void solve() {
int n, s=0;
cin >> n;
vector<int> a,b,c(n);
for (int i=0; i < n; i++){
cin >> c[i];
s += c[i];
}
s = s/2;
a.push_back(0);
for (int i = 0; i < n && a[i] <= s; i++) {
a.push_back(a[i] + c[i]);
}... | ALGO | 0.999386 | 3.544046 | {
"github_metadata": {
"branch": "main",
"commit_count": 34,
"repo_created_at": "2022-10-11T13:26:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6967a938762... |
a6b6694e-558e-4d30-bfd6-9158eafb2253 | GosiaWJ/TiMO | program/src/dane.cpp |
#include "dane.hh"
#include<cmath>
using namespace mu;
#include<iostream>
#include<string>
#include<math.h>
#include<locale.h>
#include<QMessageBox>
using namespace std;
Dane::Dane(int e0, int e1, int e2, double *x0, int l, int ogr, int zmienne, double t, double b)
{
epsilon0=e0;
epsilon1=e1;
epsilon2=e... | ALGO | 0.995132 | 4.177333 | {
"github_metadata": {
"branch": "master",
"commit_count": 42,
"repo_created_at": "2018-04-07T19:00: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": "c73f9075a... |
cdd12ff1-6bff-4f56-937a-9f937d1748ba | staillyd/leetcode | ml/bilinear_interpolation.cpp | #include <cmath>
#include <iostream>
struct Point {
Point(float in_x, float in_y, float in_val) : x(in_x), y(in_y), val(in_val) {};
float x;
float y;
float val;
};
float bilinear_interpolation(float x1, float x2, float v1, float v2, float x) {
float ratio = (x - x1) / (x2 - x1);
float v = (1 - ratio) * v... | ALGO | 0.999581 | 5.890572 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2024-06-15T06:15: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": "a835315f3d... |
29d9c7ea-d43e-4978-874e-82a971e87519 | Subhanmalik138/PD_SEMESTER_1 | week 3/TASK10cp.cpp | #include<iostream>
using namespace std;
int main()
{
int a, b, c, d, e, f, g, h, i, j, k, l, m, n, o,p;
cout << "NUMBER 1: ";
cin >> a;
cout << "NUMBER 2: ";
cin >> b;
cout << "NUMBER 3: ";
cin >> c;
cout << "NUMBER 4: ";
cin >> d;
cout << "NUMBER 5: ";
cin >> f;
cout << "NUMBER 6: ";
cin >> g;
cout << "N... | ALGO | 0.99847 | 3.113894 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2024-09-20T05: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": "78ab997464... |
1a92bffd-1fa5-4df2-887b-3aaac3b9ac3b | geekygirlsarah/umkc_robot_2014 | wesley/ros/src/camera/src/distance.cpp | /** THIS CODE IS OBSOLETED BY DISTANCE_LOOP.CPP
*
* distance.cpp
* by: <NAME>
*
* PURPOSE: This code was used to narrow in on an algorithm to find
* the top and distance of a tool in the id_tool program.
*
* Through the use of this program, and the help of Darren
* Cogan, id_... | TOOL | 0.987048 | 6.240727 | {
"github_metadata": {
"branch": "master",
"commit_count": 384,
"repo_created_at": "2013-10-07T20:19:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 3,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
"content_id": "888f6583... |
1da04e10-0f4c-490f-9192-0a5d9564fab9 | zudydy/problem-solving | 백준/Gold/1865. 웜홀/웜홀.cc | #include <iostream>
#include <vector>
#define FASTIO() ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL)
using namespace std;
const int INF = 1e8;
struct Edge {
int start, end, cost;
Edge() {}
Edge(int start, int end, int cost) : start(start), end(end), cost(cost) {}
};
bool bellman_ford(co... | ALGO | 0.999935 | 5.144689 | {
"github_metadata": {
"branch": "main",
"commit_count": 992,
"repo_created_at": "2021-12-14T17:57: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": "ff1df4d120... |
ab4b9526-1051-49d7-a4cf-46728b577d5a | gabillah/practice-programming | Leetcode/128. Longest Consecutive Sequence/128. Longest Consecutive Sequence @ C++ solusi 1.cpp | #include <iostream>
#include <vector>
#include <unordered_set>
#include <algorithm>
using namespace std;
class Solution {
public:
int longestConsecutive(vector<int>& nums) {
unordered_set<int> numSet(nums.begin(), nums.end());
int longest = 0;
// Iterasi setiap angka dalam set.
... | ALGO | 0.999994 | 6.642279 | {
"github_metadata": {
"branch": "main",
"commit_count": 16,
"repo_created_at": "2024-08-08T01:19: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": "ffe6d2aae7a... |
2332235f-00c8-4f7d-95a8-98c67cb93036 | Jumplez/Data-Structures | Bonus/AVLTree.h | #ifndef AVL_TREE_H
#define AVL_TREE_H
#include <iostream>
#include <vector>
#include <string>
#include <limits>
struct AVLNode {
int total_births;
int period;
std::string region;
AVLNode* left;
AVLNode* right;
int height;
AVLNode(int totalBirths, int periodValue, const std::string& region... | ALGO | 0.997118 | 6.877946 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2024-06-08T19:28:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "567e80416... |
7ecd0c3a-36ef-4a8f-827d-a9307ecd7fb2 | sukritidawar/Data_Structures_and_Algorithms | graphrepresentation.cpp | #include <bits/stdc++.h>
using namespace std;
void dfs(int s, vector<vector<int>> &graph, vector<bool> &visited) {
visited[s] = true;
// cout << s << " ";
for(int i = 0; i < graph[s].size(); i++){
// cout << endl << v << " " << visited[v];
if(visited[graph[s][i]] == false){
dfs(... | ALGO | 0.999964 | 5.427886 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2020-11-19T04:05: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": "732e7b518e... |
efa6dafa-8242-4893-ad3c-7125f54b74c9 | ishandutta2007/codeforces-k | kostka/normal/739/B.cpp | //<NAME>
// You are not prepared!
#include "bits/stdc++.h"
using namespace std;
const int MAXN = 200007;
const int LOG = 20;
vector <pair <int, int> > G[MAXN];
int pre[MAXN], post[MAXN];
long long odl[MAXN];
int prz[LOG][MAXN];
int tim = 0;
void dfs(int v, long long d = 0)
{
pre[v] = ++tim;
odl[v] = d;
for(a... | ALGO | 0.999918 | 3.855236 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T06:06:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fccea037ed21... |
68df1fb2-ce6b-4c24-90fb-b913bd6a0ad6 | Yawn-Sean/Daily_CF_Problems | daily_problems/2024/08/0827/personal_submission/cf1237c2_jackeyhua.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <stack>
using namespace std;
void solve() {
int n;
cin >> n;
vector<vector<int>> vc(n, vector<int>(4));
for (int i = 0; i < n; ++i) {
cin >> vc[i][0] >> vc[i][1] >> vc[i][2];
vc[i][3] = i + 1;
}
std::sort(vc.be... | ALGO | 0.999967 | 4.08885 | {
"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": "beff... |
19281271-6664-4d96-ade2-9d28dbcd539f | suraj-iitb/algorithm-identification | BERT/Data_Dump/Insertion/C++/Code/insertion4282862.cpp | /**
* @copyright (c) 2020 <NAME>
*/
#include <iostream>
class InsertionSort {
public:
InsertionSort();
~InsertionSort();
void Main(std::istream &input_stream);
private:
void Sort();
void SwapAndInsert(const int index_source);
bool ShouldSwap(const int index_compare, const int cvalue);
int SwapAndGe... | ALGO | 0.999796 | 6.066191 | {
"github_metadata": {
"branch": "main",
"commit_count": 229,
"repo_created_at": "2020-05-24T06:21:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 2,
"pull_requests": 10
},
"file_meta": {
"content_id": "d2069fbe9... |
3fa0f0a6-f746-48cc-bac2-358750f534b5 | abhakta-47/CompetitiveCodingMyPractices | codeforces/rounds/global 26/c2.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define loop(i, x, n) for (int i = x; i < n; i++)
void sol() {
ll n;
cin >> n;
vector<ll> a(n), maxa(n);
loop(i, 0, n) { cin >> a[i]; }
maxa[n - 1] = a[n - 1];
for (int i = n - 2; i > 0; i--) {
max... | ALGO | 0.999986 | 4.491525 | {
"github_metadata": {
"branch": "main",
"commit_count": 73,
"repo_created_at": "2020-04-29T05:45:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "56961bbc1e7... |
d95d999e-88a5-4f34-a56a-0091620260d6 | ashutosk/opencvprojects | opencvfiles/Rectify.cpp | #include "opencv2/core/core.hpp"
#include "opencv2/calib3d/calib3d.hpp"
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include "opencv2/contrib/contrib.hpp"
#include <stdio.h>
#include <string.h>
using namespace cv;
using namespace std;int main(int argc, char* argv[])
{
Mat img1, img2, g... | ALGO | 0.998242 | 4.535891 | {
"github_metadata": {
"branch": "master",
"commit_count": 41,
"repo_created_at": "2017-05-27T19:48:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "96c0e47d6... |
faf50aca-4139-4ff5-8a2c-202e2ced94e1 | sainisajal147/Problem_solving | atoi.cpp | #include <stdio.h>
#include <cmath>
#include <map>
#include <math.h>
#include <cstdio>
#include <vector>
#include <string>
#include <iostream>
#include <algorithm>
#include <stack>
#include <queue>
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
int ato(string A) {
string s;
int i=0;
... | ALGO | 0.998247 | 3.176328 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2021-05-24T06:14: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": "c64dbd734efc... |
9bd97e56-4808-4ac9-89f5-0b65b41e9395 | honeysuckcle/my-practice-of-leetcode | hard/1723find-minimum-time-to-finish-all-jobs.cpp | /*
Date:2021/5/8
经典动态规划问题
如果采用贪心算法,会在下面的测试用例出问题
[5,5,4,4,4]
2
官方解题方法有很多巧思,比如:
1. 用int的二进制表示已分配工作的集合
2. j-x 表示j为全集时,x的补集
3. for(int x=j; x; x = (x-1) & j) 其中x是j的子集
*/
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
using namespace std;
int minimumTimeRequired(vector<int>& jobs, int k) {
int ... | ALGO | 0.999996 | 5.259457 | {
"github_metadata": {
"branch": "main",
"commit_count": 102,
"repo_created_at": "2021-04-11T12:12: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": "a5979aaea9... |
e24df079-a3e1-4305-8ce5-26ce20b8f6b9 | LuJianBuPing/LeetCode | LeetCode/P084.cpp | #include "LeetCode.h"
class Solution {
public:
int largestRectangleArea(vector<int>& height) {
stack<pair<int, int>> stk;
int result = 0;
height.push_back(0);
stk.push(make_pair(-1,-1));
for (int i = 0; i < height.size(); ++i)
{
while (stk.top().second >= height[i])
{
int h = stk.top().secon... | ALGO | 0.999981 | 6.309244 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2015-03-11T07:11:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "04de83bbb... |
29034ff2-c1d8-4e78-be9f-07d0b0a0fb19 | RealA10N/competitive | cses.fi/problemset/graph-algorithms/cycle-finding/cycle-finding.cpp | // a10n - Sun Mar 27 00:03:39 2022
// Cycle Finding (https://cses.fi/problemset/task/1197)
// Generated by cptk
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define all(x) (x).begin(), (x).end()
#define fori(n, i) for (int i = 0; i < n; i++)
typedef pair<int, int> ii;
typedef vector<int> vi;
t... | ALGO | 0.999977 | 4.523704 | {
"github_metadata": {
"branch": "main",
"commit_count": 210,
"repo_created_at": "2022-01-18T21:22:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "afe3832a59... |
b3e59fd9-bd6e-4acb-bc9e-f5c4899f538d | Freakqency/Competitive-Programming | Codechef/CENS20G.cpp | #include <bits/stdc++.h>
using namespace std;
int check(string res, string ops) {
size_t found = ops.find(res[0]);
if (found == string::npos)
return -1;
for (int i = 1; i <(int) res.size(); i++) {
size_t temp = ops.find(res[i], found+1);
if (temp == string::npos)
... | ALGO | 0.999849 | 4.165515 | {
"github_metadata": {
"branch": "master",
"commit_count": 42,
"repo_created_at": "2020-12-30T15:58: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": "3b15dc2ae... |
2eff34b9-9422-489b-a18f-bb4670f20c11 | ishandutta2007/codeforces-z | zhylj/normal/1588/A.cpp | #include <bits/stdc++.h>
#define gc() getchar()
template <typename T> inline void rd(T& x) {
int si = 1; char c = gc(); x = 0;
while(!isdigit(c)) si = c == '-' ? -1 : si, c = gc();
while(isdigit(c)) x = x * 10 + c - 48, c = gc();
x *= si;
}
template <typename T, typename... Args>
inline void rd(T& x, Args&... args... | ALGO | 0.999936 | 3.956071 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:43: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": "900edf6d91c0... |
208482ca-d6b0-4946-bd57-01f85d2876ff | lakshmank6300/Leetcode | 952-word-subsets/word-subsets.cpp | class Solution {
public:
vector<string> wordSubsets(vector<string>& words1, vector<string>& words2) {
vector<int> freq(26, 0);
for (int i = 0; i < words2.size(); i++) {
vector<int> temp(26, 0);
for (int j = 0; j < words2[i].size(); j++) {
temp[words2[i][j] - '... | ALGO | 0.999564 | 5.793013 | {
"github_metadata": {
"branch": "main",
"commit_count": 588,
"repo_created_at": "2023-05-21T05: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": "83acd45e53... |
0fd8c470-3647-429f-a016-a879f8c6e76e | taskinahmadalfaruqe/CppInJUST | Day-16/ArrayShort.cpp | #include <bits/stdc++.h>
using namespace std;
// Method 01
void SortArray(int array[], int a)
{
for (int i = 0; i < a - 1; i++)
{
for (int j = 0; j < a - i - 1; j++)
{
if (array[j] > array[j + 1])
{
int temp = array[j];
array[j] = array[j ... | ALGO | 0.999967 | 5.305471 | {
"github_metadata": {
"branch": "main",
"commit_count": 76,
"repo_created_at": "2025-03-03T12:14: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": "3f6dc4ced5b... |
272f947e-97fd-456b-9680-0cd94f316460 | Aziz018/CPP_Modules | Module03/inheritance/virtual_inheritance.cpp | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* virtual_inheritance.cpp :+: :+: :+: ... | TOOL | 0.980203 | 6.036219 | {
"github_metadata": {
"branch": "main",
"commit_count": 206,
"repo_created_at": "2024-08-16T09:25:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1961e65975... |
ffc39395-1fe0-4d7d-868c-7b153b081731 | Yfredy/2025-AC | 618深信服笔试/3.cpp | #include<bits/stdc++.h>
using namespace std;
void dfs(vector<vector<int>>& board)
{
int m = board.size();
int n = board[0].size();
int dx[] = {-1,0,1,1,1,0,-1,-1};
int dy[] = {-1,-1,-1,0,1,1,1,0};
for(int i=0;i<m;i++)
{
for(int j=0;j<n;j++)
{
int count = 0;
... | ALGO | 0.999881 | 3.9072 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-06-22T09:56: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": "4471a8c5d80d... |
25ecd766-478c-42ea-866d-2c465aad1049 | IEEE-VIT/back-to-future | C++/binarytree.cpp | // Binary Tree Algorithm in C++
#include <bits/stdc++.h>
using namespace std;
struct Node
{
int data;
Node *left;
Node *right;
//defining constructor
Node(int d){
this->data=d;
this -> left = NULL;
this -> right = NULL;
}
};
Node *NewNode(int data)
{
Node* temp=... | ALGO | 0.99999 | 4.868147 | {
"github_metadata": {
"branch": "main",
"commit_count": 121,
"repo_created_at": "2022-09-30T08:58:06.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 10,
"forks": 31,
"issues": 9,
"pull_requests": 1
},
"file_meta": {
"content_id": "e8946d119... |
124f807c-4983-4a5e-94b4-aa28e86045b8 | Hironobu-okubo/AtCoder | kyopro-tessoku/ch02/B07-ConvenienceStore2.cpp | #include <bits/stdc++.h>
using namespace std;
/* alias */
using ull = unsigned long long;
using ll = long long;
using vi = vector<int>;
using vl = vector<long>;
using vll = vector<long long>;
using vvi = vector<vi>;
using vvl = vector<vl>;
using vvll = vector<vll>;
using vs = vector<string>;
using vc = vector<char>;
us... | ALGO | 0.999954 | 3.863553 | {
"github_metadata": {
"branch": "main",
"commit_count": 666,
"repo_created_at": "2022-05-09T13:14: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": "bad43c7536... |
e029d38e-b215-41c2-b14d-712f92e059a4 | iamfahim/Codeforces | Educational Codeforces Round 11/A.cpp | //<NAME>
#include<bits/stdc++.h>
#define PI acos(-1.0)
#define IOS ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define inf 1LL<<62 // this is minus inf
#define ms(a,b) memset(a, b, sizeof(a))
#define check cout<<"I am in here BRO!"<<endl;
using namespace std;
type... | ALGO | 0.999995 | 3.192059 | {
"github_metadata": {
"branch": "master",
"commit_count": 43,
"repo_created_at": "2019-07-04T16:33: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": "189e50fda... |
7f4adb33-5cfb-45ad-aa0e-c65421856846 | Quaternijkon/Leetcode | 1.两数之和.cpp | /*
* @lc app=leetcode.cn id=1 lang=cpp
*
* [1] 两数之和
*
* https://leetcode.cn/problems/two-sum/description/
*
* algorithms
* Easy (53.95%)
* Likes: 18765
* Dislikes: 0
* Total Accepted: 5.6M
* Total Submissions: 10.4M
* Testcase Example: '[2,7,11,15]\n9'
*
* 给定一个整数数组 nums 和一个整数目标值 target,请你在该数组中找出 和... | ALGO | 0.999971 | 6.147038 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2024-07-27T08:42: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": "a155868ae70... |
f439e57a-867a-4dbe-bd96-bcce0cb7315b | Altu-Bitu-6/Altu-Bitu-KimRina | 01_정렬_맵_셋/필수/1431.cpp | #include<iostream>
#include <algorithm>
#include <vector>
using namespace std;
int compare(string& s1, string& s2) {
int sumA = 0, sumB = 0;
// A와 B의 길이가 다를 경우
if(s1.size() != s2.size()) {
return s1.size() < s2.size();
}
// A와 B의 길이가 같을 경우
else {
for(int i = 0; i < s1.size(); ... | ALGO | 0.999901 | 4.97248 | {
"github_metadata": {
"branch": "main",
"commit_count": 47,
"repo_created_at": "2024-02-14T07:47:02.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a5d90785f694... |
b4d922fa-0d3b-4ccd-8f8b-0f041d44b48e | giriraj1995/CompetitiveCoding | DS & Algorithms/Season 2/Map/Valid Sudoku/Valid Sudoku/main.cpp | //
// main.cpp
// Valid Sudoku
//
// Created by <NAME> on 01/05/21.
//
#include <iostream>
#include <cmath>
#include <vector>
#include <map>
#include <unordered_map>
#include <stack>
#include <queue>
#include <set>
using namespace std;
int isValidSudoku(const vector<string> A) {
vector<vector<bool>> bl(9, vect... | ALGO | 0.997708 | 6.036285 | {
"github_metadata": {
"branch": "master",
"commit_count": 791,
"repo_created_at": "2020-08-04T11:52:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0e4f22af... |
7395756f-a953-4884-aac7-d7139d6ac7df | R4GH4V/geeksforgeeks-Practise | School/Second Largest.cpp | /*
Given an array, return second largest element from an array.
Input:
The first line of input contains an integer T denoting the number of test cases.
The first line of each test case is N,N is the size of array.
The second line of each test case contains N input C[i].
Output:
Print the second largest element.
C... | ALGO | 0.999879 | 4.563652 | {
"github_metadata": {
"branch": "master",
"commit_count": 314,
"repo_created_at": "2017-05-12T14:01:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5a8b311b... |
5c1e4071-ab46-4929-b65f-6edce7f6a156 | MiroslawR/Analisis-Numerico | 21.-Métodos de integración.cpp |
//metodo demetodos de integracion
#include<iostream>
#include<conio.h>
#include <iomanip>
#include <cmath>
#include<stdlib.h>
using namespace std;
double fun (double x) //declaramos la funcion a evaluar dentro de la integral
{
double y = 1/x;
return y;
}
double integ(double x)//declaramos la funcion a evalu... | ALGO | 0.999148 | 3.529073 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2025-01-27T18:26: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": "41d8808d681... |
b01343d3-e3f7-4404-a271-e45474701449 | SimFlowCFD/RapidCFD-dev | src/OpenFOAM/matrices/LduMatrix/Smoothers/GaussSeidel/TGaussSeidelSmoother.H | /*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
--------... | ALGO | 0.984977 | 6.110726 | {
"github_metadata": {
"branch": "master",
"commit_count": 144,
"repo_created_at": "2015-02-12T11:35:40.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 369,
"forks": 103,
"issues": 69,
"pull_requests": 1
},
"file_meta": {
"content_id": "3377... |
78c68c07-5e03-453b-b910-222fcd1b3b04 | rdkit/rdkit | Code/GraphMol/MolInteractionFields/MIFDescriptors.cpp | //
// Copyright (c) 2014-2024, Novartis Institutes for BioMedical Research and
// other RDKit contributors
//
// @@ All Rights Reserved @@
// This file is part of the RDKit.
// The contents are covered by the terms of the BSD license
// which is included in the file license.txt, found at the root
// of the RDKi... | ALGO | 0.992091 | 4.345327 | {
"github_metadata": {
"branch": "master",
"commit_count": 8182,
"repo_created_at": "2013-05-12T06:19:15.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 3003,
"forks": 931,
"issues": 110,
"pull_requests": 25
},
"file_meta": {
"content_id": "... |
49025687-b2dc-4d04-8deb-02a1aa2bb653 | DurdenTy/CPP_pr-ticas | classes/Fila.h | #ifndef FILA_H
#define FILA_H
using namespace std;
template <class T>
class Fila
{
private:
int indexador = 0;
int inicio = 0;
int maximo;
T * fila;
public:
Fila(int cap) {
// inicializar array de items, capacidade, tamanho, posição inicial
this->maximo = cap;
this->fila = new T[maximo];
}
... | TOOL | 0.976641 | 4.635087 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2021-04-24T17:22:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3f08d9807f9... |
733d0605-fbac-4d54-8016-3f973300f720 | JeremyTaraba/LeetCode | Easy/Goal_Parser_Interpretation.cpp | /*
Prompt:
You own a Goal Parser that can interpret a string command. The command consists of an alphabet of "G", "()" and/or "(al)" in some order.
The Goal Parser will interpret "G" as the string "G", "()" as the string "o", and "(al)" as the string "al". The interpreted strings
are then concatenated in the original... | ALGO | 0.963087 | 4.839827 | {
"github_metadata": {
"branch": "master",
"commit_count": 910,
"repo_created_at": "2020-03-26T03:21: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": "58cbc660... |
3a578294-32c3-4037-a9b7-b989bb88a519 | shqpsyd/Server-and-Client | rsa.cc | #include <openssl/pem.h>
#include <openssl/ssl.h>
#include <openssl/rsa.h>
#include <openssl/evp.h>
#include <openssl/bio.h>
#include <openssl/err.h>
#include <iostream>
#include <stdio.h>
int padding = RSA_PKCS1_PADDING;
RSA * createRSA(unsigned char * key,int pub)
{
RSA *rsa= NULL;
BIO *keybio ;
keybi... | TOOL | 0.967592 | 4.431304 | {
"github_metadata": {
"branch": "master",
"commit_count": 30,
"repo_created_at": "2017-11-30T22:00:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5797bca43... |
1952cbb6-88f0-415f-a5d0-6368e6fc22e1 | makarkme/LETI | Semester 3/Alg&DataStruct/LAB2/Menu.cpp | #include "Menu.h"
#include "TimSort.h"
MenuClass::Menu::Menu(long long &array, const int lengthArray) {
link = &array;
length = lengthArray;
menuStatus = 1;
}
// два меню для пунктов 1) и 2) соответственно
void MenuClass::Menu::PrintMenu() {
if (menuStatus == 0) {
while (exitFlag) {
... | TOOL | 0.955134 | 3.736165 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2025-02-07T11:10: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": "b9fdddd24ec... |
78b5ed88-8fe7-4ce6-ab59-f261cf5c0d4b | rrisoncai/learn | accelerated_cpp/7.4.cpp | #include <iostream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
using namespace std;
typedef vector<string> RULE;
typedef vector<RULE> RULE_COLLECTION;
typedef map<string, RULE_COLLECTION> GRAMMAR;
void gen_aux(const GRAMMAR&, const string&, vector<string>&);
bool space(char c)
{
ret... | ALGO | 0.992736 | 4.010092 | {
"github_metadata": {
"branch": "master",
"commit_count": 127,
"repo_created_at": "2013-10-26T10:02:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "049d004d... |
7d01da6f-40a0-4ddb-94f9-ed46b1584bf1 | ATTWIST/algo | 백준/Gold/2098. 외판원 순회/외판원 순회.cc | #include <bits/stdc++.h>
#define MAX_N 16
const int INF = 987654321;
using namespace std;
int n, dp[MAX_N][1 << MAX_N], dist[MAX_N][MAX_N];
int tsp(int here, int visited){
if(visited == (1 << n) - 1){
return dist[here][0] ? dist[here][0] : INF;
}
int &ret = dp[here][visited];
if(ret != -1) ret... | ALGO | 0.999927 | 4.294834 | {
"github_metadata": {
"branch": "main",
"commit_count": 151,
"repo_created_at": "2023-05-26T08:12:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "646f384f65... |
4bd6f61c-9eb2-410e-9c6e-356c303c29a8 | SairajRajput12/DSA | contest/contest_4.cpp | #include <bits/stdc++.h>
int rakshaBandhan(vector < int > arr, int n) {
// Write your code here.
// ninja has n sister.
// each sister has one rakhi.
// rakhis are provided in array.
// ninja want the total sum of all rakhi strictly to be positive.
// tell him maximum rakhi's he can have o... | ALGO | 0.999877 | 4.558434 | {
"github_metadata": {
"branch": "main",
"commit_count": 210,
"repo_created_at": "2023-10-28T12:00: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": "ccdcdd0fef... |
397e9e5a-99ca-4a5a-ab55-feda1424efd0 | tmoux/prog-contests | codeforces/356/A/knighttournament.cpp | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cstring>
#include <stdio.h>
using namespace std;
const int maxn = 300005;
int N, M;
int arr[maxn];
int st[4*maxn];
void build(int p, int l, int r) {
if (l == r) {st[p] = 0; return;};
build(p*2,l,(l+r)/2);
build(p*2+1,(l+r)/2+1,... | ALGO | 0.999987 | 3.50862 | {
"github_metadata": {
"branch": "master",
"commit_count": 288,
"repo_created_at": "2018-10-21T03:33:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1fae7be3... |
95e42ceb-48dc-4fc0-b507-51e674d8c926 | DEVESH307/GFG | Smallest window in a string containing all the characters of another string - GFG/smallest-window-in-a-string-containing-all-the-characters-of-another-string.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
public:
//Function to find the smallest window in the string s consisting
//of all the characters of string p.
string smallestWindow (string s, string p){
// Your code here
if(s =... | ALGO | 0.999982 | 6.095288 | {
"github_metadata": {
"branch": "main",
"commit_count": 426,
"repo_created_at": "2022-10-26T08:55:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a49c0bcd14... |
458a430c-120c-4944-bd99-2b03413bc40c | timruning/leetcode2 | medium/1552MagneticForceBetweenTwoBalls.cpp | //
// Created by 宋峰 on 2021/2/23.
//
#include <vector>
#include <algorithm>
using namespace std;
class Solution {
public:
int max_position(vector<int> positions)
{
int mx=INT_MIN;
for(auto i:positions)
mx=max(mx,i);
return mx;
}
bool isPossible(int d,vector<int> pos... | ALGO | 0.999974 | 5.350358 | {
"github_metadata": {
"branch": "master",
"commit_count": 57,
"repo_created_at": "2018-05-11T07:55: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": "aec62fe83... |
00cfd3f4-1731-499a-a3dd-d106cdeb3bf3 | UladzislauBlok/Tour-of-cpp | chapter6/OperatorOverloading.cpp | // We can define operators for user-defined types (classes and enumerations):
// • Binary arithmetic operators: +, -, ∗, /, and %
// • Binary logical operators: & (bitwise and), | (bitwise or), and ˆ (bitwise exclusive or)
// • Binary relational operators: ==, !=, <, <=, >, >=, and <=>
// • Logical operators: && and ||... | TOOL | 0.930117 | 6.429649 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2025-06-20T10:54: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": "a5c99c140bb... |
e5f8bb09-c195-4087-80fa-0d2a82466dfb | F-YONG3721/computer_programming | CPE-0204B.cpp | #include<iostream>
#include <string>
using namespace std;
int main(){
string s; // 記錄 輸入的字串
string f; // 記錄 s 前後加空格
long long int num, sum; // num 記錄 讀取到的數字; sum 運算後的結果
string action = "Nnoe"; // 記錄將要運算的符號ex: plus, minus
while(cin >> s){
f = ' ' + s + ' ';
// cout << f << endl;
// 初... | ALGO | 0.994899 | 3.463823 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-11-12T13:26: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": "8c9bfb0a9ac7... |
4308ed3a-ba79-4bbd-aefc-b9e0ec80b2fd | RunzeZ0710/Competitive-Programming | Codeforces/practice/similarpairs.cpp | #include <cstdio>
#include <vector>
#include <algorithm>
#include <iostream>
#include <string>
#include <map>
#include <set>
#include <tuple>
#include <numeric>
#include <cmath>
using namespace std;
using ll = long long;
int main(){
ios_base::sync_with_stdio(0); cin.tie(0);
int t; cin >> t;
while(t--){
... | ALGO | 0.999866 | 4.19277 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-07-22T15:30: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": "d297924fedff... |
3c25c3bd-4002-4b2c-8e1b-2b6fe372e018 | sshiwangi/DSA-problems | Linked List/Remove duplicates from an unsorted linked list.cpp | /* Given an unsorted linked list of N nodes. The task is to remove duplicate elements from this unsorted Linked List. When a value appears in multiple nodes,
the node which appeared first should be kept, all others duplicates are to be removed.
Example 1:
Input:
N = 5
value[] = {5,2,3,2,4}
Output: 5 2 3 4
*/
class ... | ALGO | 0.999981 | 5.655918 | {
"github_metadata": {
"branch": "main",
"commit_count": 220,
"repo_created_at": "2022-06-01T14:30:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a934dd26aa... |
e093edc8-a70d-4740-a224-7cffa61e938e | FangGet/BundleFusion_Ubuntu_Pangolin | include/FreeImage/include/CGAL/Marching_tetrahedra_traits_skin_surface_3.h | // Copyright (c) 2005 Rijksuniversiteit Groningen (Netherlands)
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org).
// You can redistribute it and/or modify it under the terms of the GNU
// General Public License as published by the Free Software Foundation,
// either version 3 of the License, or (a... | ALGO | 0.976742 | 6.128799 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2020-06-29T03:53:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 132,
"forks": 34,
"issues": 6,
"pull_requests": 0
},
"file_meta": {
"content_id": "f68371a... |
887651b1-172e-4f45-937e-a71ac3c348e5 | caiddd/DataStructure | code/4_linkedlist.cpp | /***
@author: caidd
@edition: C++20
@charset: GBK
@environment: win10 64bit
***/
#include<bits/stdc++.h>
#include<windows.h>
using namespace std;
#define OVERFLOW -1 // 溢出
#define NOTEXIST -2 // 不存在
#define len data // 为头指针的data取别名,实际存储长度
typedef int ElemType; // 元素类型
// LinkList 为typedef的指针
typedef struct LNode {... | ALGO | 0.994288 | 3.702505 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2022-11-10T08:56:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a74ab9a6dfa6... |
ffc41b2c-954f-4564-8aaa-f7235e638035 | qk12/ACM | Dynamic Programming/数位DP/RoundNumber.cpp | // POJ 3252
#include <cstdio>
#include <cstring>
using namespace std;
typedef long long ll;
int a[70];
ll dp[70][70][70];
ll dfs(int pos, int zero, int one, bool lead, bool limit)
{
if (pos == -1)
return zero >= one;
if (!limit && !lead && dp[pos][zero][one] != -1)
return dp[pos][zero][one];
... | ALGO | 0.999982 | 3.811352 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2019-10-04T06:01: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": "dd7b811f0f... |
062a852e-b766-4a4f-950e-e7e62f70cbed | marcolonardon/unaerp | aulas-extras-c/aula03/calculo-ir.cpp | /*Estrutura condicional
- if
- switch
if(condição1){
//instruções
}else if(condição2){
//instruções
}else{
//instruções
}
switch(variavel){
case 1: //instrução
break; //se não colocar o break, vai passar pelo case
case 2: //instrução
break; //se não colocar o break, vai passar pelo case
default: //instru... | TOOL | 0.988886 | 3.195745 | {
"github_metadata": {
"branch": "main",
"commit_count": 187,
"repo_created_at": "2023-02-07T00:27:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "71360a8c24... |
2e3a3753-285e-4882-a3b6-e8daac836558 | simerda/BI-ZUM-2021 | semestral/hand.h | //
// Created by simerjan on 05.05.21.
//
#ifndef SEMESTRAL_HAND_H
#define SEMESTRAL_HAND_H
#include <stdexcept>
#include <utility>
#include <iostream>
#include <algorithm>
#include "cards.h"
using std::pair;
using std::sort;
using std::cout;
using std::flush;
using std::endl;
using std::make_pair;
using std::runtim... | ALGO | 0.995951 | 5.680411 | {
"github_metadata": {
"branch": "master",
"commit_count": 33,
"repo_created_at": "2022-08-16T07:20: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": "a34f4f16b... |
49984385-0b68-4c0f-92eb-7f0b59ec81c9 | pranayharishchandra/Coding-Odyssey-Codes | 15 GRAPHS/01 BFS AND DFS/09 Is Graph Bipartite.cpp | // https://leetcode.com/problems/is-graph-bipartite/description/
/*
* Bipertitie graph:
alternate nodes should have different colors
and we should be able to color the graph with only 2 color
*/
#include <vector>
#include <set>
#include <queue>
#include <iostream>
using namespace std;
/*
* APPROACH 2 (code not writ... | ALGO | 0.999978 | 6.38377 | {
"github_metadata": {
"branch": "main",
"commit_count": 135,
"repo_created_at": "2024-03-18T17:05: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": "745ca4115d... |
14e7fe31-64ba-401c-88a7-6a1e7f03eebe | Jerry-Terrasse/Programming | 比赛/校内/NOIP模拟试题/20181005(190)/A_ans.cpp | #include<iostream>
#include<queue>
#include<cstdio>
#include<iomanip>
#include<cmath>
#include "memory.h"
#define ld long double
#define MAXN 32
#define ok(x,y) ((x>=1)&&(y>=1)&&(x<=n)&&(y<=m))
#define sqr(x) ((x)*(x))
#define max(x,y) ((x)<(y)?(y):(x))
using namespace std;
const int dx[4]={-1,0,0,1};
const int dy[4]={... | ALGO | 0.999839 | 3.141827 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2018-12-19T05:32:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "eeeaf4a890... |
0b5abadf-600f-40aa-95c3-3558f81382e1 | clemenceparis/CompetitiveProgramming | USACO/cross_country_skiing.cpp | #include<iostream>
#include<fstream>
#include<vector>
#include<math.h>
#include<memory.h>
using namespace std;
vector<vector<int>> grid; vector<pair<int, int>> waystation;
vector<vector<bool>> visited; int n, m;
void DFS(int r, int c, int p, int l) {
if(p != -1 && (r < 0 || c < 0 || r == n || c == m || abs(p-grid... | ALGO | 0.999886 | 3.812239 | {
"github_metadata": {
"branch": "main",
"commit_count": 75,
"repo_created_at": "2022-03-01T12:04:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3519a25d383... |
c78b0327-6c8b-403d-9be4-4decb1163be2 | RachitGarg-12/MyLeetcode | 1319-number-of-operations-to-make-network-connected/1319-number-of-operations-to-make-network-connected.cpp | class DisjointSet{
public:
vector<int> rank,parent,size;
DisjointSet(int n){
rank.resize(n+1,0);
parent.resize(n+1,0);
size.resize(n+1);
for(int i=0;i<=n;i++){
parent[i]=i;
size[i]=1;
}
}
int findUpar(int node){
if(node==parent... | ALGO | 0.999854 | 5.491562 | {
"github_metadata": {
"branch": "main",
"commit_count": 3321,
"repo_created_at": "2022-07-22T13:19:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "671597cfd... |
8a4fa109-3f39-4655-9896-c6df37220968 | LittleYang0531/CQ-CSP-S-2022 | CQ-S00436/galaxy/galaxy.cpp | #include <iostream>
#include <cstring>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <cmath>
#include <queue>
#include <bitset>
using namespace std;
inline int read()
{
int ans = 0;
char i;
while (i=getchar(), i>'9'||i<'0')
{
}
ans = i-'0';
while (i=getchar(), i>='0'&&i<='9')
{
ans*=10;... | ALGO | 0.999932 | 4.711015 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-10-31T10:15: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": "da2042170f67... |
189a6a1f-547a-4539-9fc3-b278264841c0 | terenceQwert/LeeCode_Algorithm | str_sample.cpp | #include <Windows.h>
#include <string.h>
#include <stdio.h>
void ShiftStr(char* str, int** shiftCole, int ShiftSize);
void Test_str_function()
{
char buf[20] = { 0 };
strcpy_s( buf,20, "abcd");
int* shift[2] = { 0 };
shift[0] = new int[2]{ 0,1 };
shift[1] = new int[2]{ 1,5 };
int shiftSize = 2;
ShiftStr(... | ALGO | 0.968029 | 4.506963 | {
"github_metadata": {
"branch": "main",
"commit_count": 31,
"repo_created_at": "2021-10-05T13:49: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": "2f6c8b5eb98... |
f19df684-affb-4d89-81de-8b0d266bfb0b | Autumnal-Joy/leetcode | LCR/LCR029/main.cpp | #ifdef LEETCODE
#include <bits/stdc++.h>
using namespace std;
#endif
static auto _ = []() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
return 0;
}();
#ifdef LEETCODE
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
explicit TreeNode(const int x) : val... | ALGO | 0.999992 | 6.106056 | {
"github_metadata": {
"branch": "main",
"commit_count": 649,
"repo_created_at": "2024-09-27T15:34: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": "9295ce7efb... |
a70ed740-c177-4e19-84b3-16ca21c60727 | PUNEEsto/DSA-C- | day13.cpp | #include<iostream>
using namespace std;
// pointer
int main(){
/*/ int num = 8 ;
cout<<"the address of num is "<<&num << endl;
int *ptr = #
cout << "address is "<< ptr<<endl;// only pointer is use to asign the value of address
cout << "value "<< *ptr<<endl;
cout <<" size of num is "<<sizeof(num)... | ALGO | 0.995041 | 3.440378 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-06-16T20:23: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": "672663e03e4d... |
626fe57d-c0a0-4c76-8cdb-79c29121074f | Rstyk/lab-8.1it | lab 8.1it/lab 8.1it.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cstring>
using namespace std;
int Count(char* str)
{
if (strlen(str) < 4)
return 0;
int k = 0;
for (int i = 0; str[i + 3] != 0; i++)
if (str[i] == str[i + 1] && str[i + 1] == str[i + 2] && str[i + 2] == str[i + 3])
k... | ALGO | 0.999372 | 3.656363 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2023-11-15T18:39:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "076e793d39... |
b95b4c86-e35c-4fc9-810a-8c6ca0b7b995 | Shubhamlmp/Programming-Practice | C++/diameter of a Binary Tree.cpp | // Recursive optimized C program to find the diameter of a
// Binary Tree
#include <bits/stdc++.h>
using namespace std;
// A binary tree node has data, pointer to left child
// and a pointer to right child
struct node {
int data;
struct node *left, *right;
};
// function to create a new node of tree and returns poi... | ALGO | 0.999982 | 5.934288 | {
"github_metadata": {
"branch": "master",
"commit_count": 742,
"repo_created_at": "2021-06-08T02:09:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 53,
"forks": 146,
"issues": 1,
"pull_requests": 2
},
"file_meta": {
"content_id": "c7c71... |
7396d948-1e4a-4857-a2d5-beed3168794d | trannguyenhan/workspace-algorithms | TRR2019/Programming Ass/5. Isomorphism/isomorphism_v1.cpp | #include <iostream>
#include <set>
#include <vector>
#include <algorithm>
#include <fstream>
using namespace std;
/**
* <NAME>
*
* */
class Graph
{
private:
vector< set<int> > adj;
int n;
int m;
public:
Graph(int n)
{
this->n = n;
this->m=0;
adj = vector< set<int> > (n);
}
Graph(istrea... | ALGO | 0.999877 | 4.499142 | {
"github_metadata": {
"branch": "master",
"commit_count": 61,
"repo_created_at": "2020-09-08T02:54:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 90,
"forks": 46,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "55612b5... |
9ad12d11-f418-4906-b30c-4df0d0191e54 | mrcchef/CP | Coding Platform/Coding_blocks/Competative_Programming/Data_structure/Segment_Tree/Quer_bits.cpp | #include <bits/stdc++.h>
using namespace std;
#define fo(i,n) for(i=0;i<n;i++)
#define Fo(i,k,n) for(i=k;k<n?i<n:i>n;k<n?i+=1:i-=1)
#define ll long long
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define mii map<ll,ll>
#define pii pair<ll,ll>
#define vi vector<ll>
#define endl "\n"
#de... | ALGO | 0.999613 | 4.549842 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2022-06-12T05:00:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f0d6937b0f... |
3cb98425-01eb-49ea-ac4f-6cf05b8c944d | bqmnhat/CompetitiveProgramming | VnoiAndSpoj/ChatCay/main.cpp | #include <iostream>
#include <bits/stdc++.h>
#define MaxN 2000
using namespace std;
typedef long long ll;
int n, K[MaxN+5][MaxN+5];
ll dp[MaxN+5][MaxN+5], a[MaxN+5], pref[MaxN+5];
const int INF = 1e9 + 7;
void ReadData() {
for (int i=1; i<=n; i++) {
cin >> a[i];
pref[i] = pref[i-1] + a[i];
}
}
... | ALGO | 0.999923 | 3.472408 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2023-10-28T06:45: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": "9e7087e522b... |
5a5bc483-975f-4666-90ef-abaf16158fa0 | guosaisaiss/LeetCode | 019_RemoveNthNodeFromEndofList/RemoveNthNodeFromEndofList.cpp | #include <iostream>
#include <string>
#include <vector>
#include <sstream>
#include <algorithm>
using namespace std;
struct ListNode {
int val;
ListNode *next;
ListNode(int x) : val(x), next(NULL) {}
};
//two pass, 8ms
/*
class Solution {
public:
ListNode* removeNthFromEnd(ListNode* head, int n) {
int Le... | ALGO | 0.999637 | 5.230746 | {
"github_metadata": {
"branch": "master",
"commit_count": 35,
"repo_created_at": "2018-10-21T15:53: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": "7e63d60fe... |
fe6d51c1-3cdd-41b0-9ae5-4641e53c04b8 | 1Rayquaza/InterviewBit | Graph/Commutable Islands.cpp | #define pi pair<int, int>
int Solution::solve(int A, vector<vector<int> > &B) {
// read q. carefully ! - MINIMUM SPANNING TREE - Prim's Algorithm
vector<pair<int, int>> adj[A+1];
for(auto it: B){
int u = it[0];
int v = it[1];
int w = it[2];
adj[u].push_back({v, w});... | ALGO | 0.999949 | 4.804124 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2023-02-28T11:41: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": "a38b3ee2f59... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.