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 |
|---|---|---|---|---|---|---|---|
07488f13-fa00-4d93-87d5-2aaef38c4926 | Priesthoo/My_project_work | My_list.h | #include<iostream>
#include"Vector.h"
#ifndef null
#define null nullptr
#endif
using namespace std;
template<class T>
struct Node{
public: // it is not actually necessary,since by default it is public
T data;
Node* next;
Node():data{},next{nullptr}{}
Node& operator=(const Node<T>& node){
... | ALGO | 0.992286 | 3.686948 | {
"github_metadata": {
"branch": "main",
"commit_count": 290,
"repo_created_at": "2024-03-12T19:52:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "681f11797c... |
9cf2e4da-d106-40b4-8d2a-32ea96a8eefc | plerks/coding-practice | LeetCode/简单/3456. 找出长度为 K 的特殊子字符串/solution3456.cpp | /*
url: https://leetcode.cn/problems/find-special-substring-of-length-k/
标签: LeetCode第437场周赛
*/
#include <bits/stdc++.h>
using namespace std;
class Solution3456 {
public:
// 周赛时的暴力解法,通过
bool hasSpecialSubstring(string s, int k) {
int n = s.size();
for (int i = 0; i < 26; i++) {
cha... | ALGO | 0.999813 | 5.570836 | {
"github_metadata": {
"branch": "main",
"commit_count": 444,
"repo_created_at": "2023-07-21T05:58:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ad09bdbb78... |
1f78af83-6183-487a-813c-a8cdefbe7ded | moeryomenko/training | solutions/tree_solutions.cpp | #include <boost/ut.hpp>
#include <algorithm>
#include <cstddef>
#include <cstdlib>
#include <numeric>
#include <queue>
#include <stack>
#include <vector>
struct TreeNode {
int val;
struct TreeNode *left, *right;
};
struct Node {
int val;
std::vector<Node *> children;
};
auto preorder(Node *root) -> std::vec... | ALGO | 0.952569 | 6.960972 | {
"github_metadata": {
"branch": "main",
"commit_count": 60,
"repo_created_at": "2023-01-13T17:25:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e3e71a61a03... |
26fb1992-f20f-4af5-82d1-e75419a2b689 | The-OpenROAD-Project/TritonSizer | src/calc.cpp | ///////////////////////////////////////////////////////////////////////////////
// Authors: <NAME> and <NAME>
// (Ph.D. advisor: <NAME>)
//
// Many subsequent improvements were made by <NAME>
// leading up to the initial release.
//
// BSD 3-Clause License
//
// Copyright (c) 2018, The Regent... | TOOL | 0.98672 | 4.407456 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2018-08-25T18:06:26.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 18,
"forks": 13,
"issues": 5,
"pull_requests": 1
},
"file_meta": {
"content_id": "08d6f45f... |
d718ead6-518a-4421-bf25-a4444d8c9686 | himasai-1423/Leetcode-Practice | DFS of Graph - GFG/dfs-of-graph.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
// Function to return a list containing the DFS traversal of the graph.
vector<int> res;
void dfs(int V, vector<int> adj[], vector<bool> &vis) {
vis[V] = true;
res.push... | ALGO | 0.999955 | 6.729098 | {
"github_metadata": {
"branch": "main",
"commit_count": 2823,
"repo_created_at": "2022-07-31T10:26: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": "12d89bb70... |
1301540a-d39c-4ecb-9152-7c033ce18ae8 | Shiroechi/Contoh-Soal-Latihan-Coding-Untuk-Tes-Masuk-Kerja | cpp/4.cpp | #include <iostream>
#include <stack>
#include <vector>
#include <algorithm>
#include <time.h>
void print_array(std::vector<int> &array)
{
for (int i = 0; i < array.size(); i++)
{
std::cout << array[i] << " ";
}
std::cout << std::endl;
}
void fill_array(std::vector<int> &array)
{
for (int i = 0; i < array.siz... | ALGO | 0.999514 | 4.675418 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2021-10-04T07:11:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8ccfd4bddb3... |
42e2a837-19be-450c-922b-46c565213a67 | ChrisMathis98/RCC-Winter2020-CSC5 | Hmwk/Savitch_9thEd_Ch2_Prob5_Room/main.cpp | /*
* Author: <NAME>
* Date: January 16, 2020, 12:45 PM
* Purpose: Determine if the room exceeds max capacity or not
*/
//System Libraries - Post Here
#include <iostream>
#include <cmath>
using namespace std;
//User Libraries - Post Here
//Global Constants - Post Here
//Only Universal Physics/Math/Conversions fo... | TOOL | 0.987747 | 4.502009 | {
"github_metadata": {
"branch": "master",
"commit_count": 32,
"repo_created_at": "2020-01-15T20:17: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": "3ed42dad4... |
7dc0701f-45d4-4c28-b3cd-eb669323bcc4 | dmikarpoff/CompetProg | GoogleCodeJam/2020/ParentingPR/main.cpp | #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
struct Interval
{
int from;
int till;
int id;
};
int main()
{
int T;
cin >> T;
for (int o = 1; o <= T; ++o)
{
int n;
cin >> n;
vector<Interval> tasks(n);
for (... | ALGO | 0.999942 | 4.420304 | {
"github_metadata": {
"branch": "master",
"commit_count": 57,
"repo_created_at": "2018-02-21T17:43:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a6508efb1... |
b12e529a-18b7-4416-ab78-655e48c12944 | czaky/puzzles-cpp | src/geo.cpp | #include "geo.h"
#include <algorithm>
#include <complex>
#include <iostream>
#include <vector>
namespace puzzles {
namespace geo {
/**
* @brief return maximum count of `points` visible at `angle_rad`.
*
* @param points in cartesian
* @param angle_rad sweep angle in radians
* @return int
*/
int max_point_angle... | ALGO | 0.999483 | 6.192083 | {
"github_metadata": {
"branch": "main",
"commit_count": 60,
"repo_created_at": "2025-01-17T16:03: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": "eaa019866dd... |
35d4b237-4ee1-47b0-96ae-8f3f392d69ba | knixk/DSA-Journey-Kanishk | cpp course/interview questions/reverse-a-ll.cpp | #include <iostream>
using namespace std;
/*
NOTE:
*/
// create a class of node
class Node {
public:
int data;
Node * next;
Node(int d = -1, Node * n = NULL) {
this->data = d;
this->next = n;
}
};
// create a class of ll
class LinkedList {
public:
Node * head;
... | ALGO | 0.999326 | 3.991556 | {
"github_metadata": {
"branch": "main",
"commit_count": 143,
"repo_created_at": "2023-07-04T16:01:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b9d69daa02... |
1c512de0-c83c-45a7-9dec-074b4de8f4c6 | thakursachin05/MASTERING_CPP | AdditionProblem/BigNumber/Addition.cpp | // Program to demonstrate addition of big numbers
// That cannot be stored in int or any data type , we have to use string for them
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
string add(string a, string b){
reverse(a.begin(),a.end());
reverse(b.begin(),b.end());
int cary... | ALGO | 0.999825 | 4.977179 | {
"github_metadata": {
"branch": "main",
"commit_count": 415,
"repo_created_at": "2022-05-03T04:04:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7968b4f087... |
e7ed9384-b43c-4da8-8f56-b97e859a548f | deautifulife/algorithm | 백준/Gold/21608. 상어 초등학교/상어 초등학교.cc | #include <iostream>
using namespace std;
const int dy[] = { -1,0,1,0 };
const int dx[] = { 0,-1,0,1 };
struct STUDENT
{
int me;
int fri[4];
int y, x;
};
int N;
int board[20][20];
STUDENT st[400];
int getPoint(int y, int x, int s) {
int point = 0;
for (int d = 0; d < 4; d++) {
int ny = ... | ALGO | 0.99867 | 3.927541 | {
"github_metadata": {
"branch": "main",
"commit_count": 417,
"repo_created_at": "2023-03-17T11:16: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": "2730392da4... |
ec6c2e2c-6234-48a8-9eec-e36ca67351ba | atsushi-m-ito/QUMASUN | source/actual_kpoint.h | #pragma once
#include "qumasun_input.h"
//k点の折りたたみルール//
//空空間をK倍した場合と結果が一致する//
//double kpx = (kpoint * 2 > kpoint_limit) ? (double)(kpoint - kpoint_limit) : (double)kpoint;
//これを有効にするとガンマ点を通らなくなり、空間をK倍した場合と結果が一致しなくなる//
//逆空間の平均値としてどちらが適切かは議論の余地あり//
//#define KPOINT_SHIFT_IF_EVEN
//#ifdef KPOINT_SHIFT_IF_EVEN
//if ((... | ALGO | 0.994792 | 4.065976 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2024-05-21T07:52: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": "86cf77ae0e... |
687697f9-39b1-46a4-aab3-294eebdcc8f4 | kinga1833/Ksiazka-adresowa | main.cpp | #include <iostream>
#include <windows.h>
#include <cstdlib>
#include <fstream>
#include <vector>
#include <string>
using namespace std;
struct Adresat
{
int idZapisanegoKontaktu;
string imie, nazwisko, numerTelefonu, email, adres;
};
Adresat zapisanieNowejOsoby (vector <Adresat> &adresaci)
{
string imie,... | TOOL | 0.904232 | 3.688966 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2018-10-08T21:03: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": "efce37a3f... |
ddc45f10-0172-42e9-a5ba-2b92737d9964 | tmoux/prog-contests | codeforces/1017/F/F.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 3e8+8;
const ll M = (1LL << 32);
int n, A, B, C, D;
inline ll f(ll x) { return ((1LL*A*(x*(x*x)%M)%M)%M+(B*x*x)%M+C*x+D)%M; }
bitset<maxn/3> sieve;
ll ans = 0;
inline int convert(int x) { //converts num to index in sieve
if ((x+1)... | ALGO | 0.999737 | 5.008837 | {
"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": "d8f147d0... |
08e4a271-c1df-4167-8954-9c25ad068f04 | sprakhar11/Competitive_programming_ | cpp/C_Contrast_Value.cpp |
#include <bits/stdc++.h>
#include <unordered_set>
#include <chrono>
#define ll long long
#define int long long
#define MOD1 998244353
#define INF 1e18
#define endl "\n"
#define vi vector<int>
#define pb push_back
#define vvi vector<vector<int>>
#define pii pair<int, int>
#define ff first
#define ss second
#define... | ALGO | 0.999946 | 4.690539 | {
"github_metadata": {
"branch": "master",
"commit_count": 156,
"repo_created_at": "2022-03-13T03:29:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "adecae74... |
5ff6e421-06e0-472c-a31d-7df69286667b | miamirobin/2017Spring_SoCV | hw5/src/itp/satMgr.h | /****************************************************************************
FileName [ SATMgr.h ]
PackageName [ sat ]
Synopsis [ Define sat prove package interface ]
Author [ ]
Copyright [ Copyleft(c) 2010 LaDs(III), GIEE, NTU, Taiwan ]
****************************************************... | ALGO | 0.984127 | 6.658203 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2018-07-01T20:19:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "35c7afad9d... |
78a655dc-f049-4c7f-a50d-512eef3642b7 | InsightSoftwareConsortium/ITK | Modules/Registration/Metricsv4/include/itkImageToImageMetricv4.hxx | /*=========================================================================
*
* Copyright NumFOCUS
*
* 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
*
* https://www.apache.o... | ALGO | 0.980289 | 6.933393 | {
"github_metadata": {
"branch": "main",
"commit_count": 57165,
"repo_created_at": "2010-07-27T15:48:04.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1517,
"forks": 701,
"issues": 268,
"pull_requests": 49
},
"file_meta": {
"content_id": "e... |
55fe563d-eb21-4d33-92f2-e22cad8315f3 | hello-sources/LeetCode | LeetCode-130.cpp | /*************************************************************************
> File Name: LeetCode-130.cpp
> Author: ltw
> Mail: <EMAIL>
> Created Time: Thu 21 May 2020 08:48:01 PM CST
************************************************************************/
#include <iostream>
using namespace std;
c... | ALGO | 0.999933 | 5.406253 | {
"github_metadata": {
"branch": "master",
"commit_count": 73,
"repo_created_at": "2020-02-25T10:42: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": "fe3fe1ff4... |
059a3f0b-de15-4db9-beaf-6f5619edb6ed | PacificPR/DS_ALGO_PRACTICE | 1. Practice/Questions/20.2 Course_Schedule_Topological_Sort.cpp | /*
There are a total of n courses you have to take, labeled from 0 to n-1.
Some courses may have prerequisites, for example to take course 0 you have to first take course 1, which is expressed as a pair: [0,1]
Given the total number of courses and a list of prerequisite pairs, return the ordering of courses you should ... | ALGO | 0.999992 | 6.284191 | {
"github_metadata": {
"branch": "master",
"commit_count": 59,
"repo_created_at": "2020-04-01T16:41:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9318b6815... |
77a564cc-7acc-453d-82a3-d5302ab166d2 | nmhienbn/Competitive-Programming | Mr.Minh/$History/20210817093316607_063764873772796[BNMINHHIEN][seqgame].cpp | #include <bits/stdc++.h>
#define fi(i, a, b) for(int i = a; i <= b; i++)
#define fid(i, a, b) for(int i = a; i >= b; i--)
#define pii pair<int,int>
#define pb push_back
#define ll long long
#define faster ios_base::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL);
#define Seraphine "seqgame"
const int maxn = 3e5+5;
u... | ALGO | 0.999966 | 3.777042 | {
"github_metadata": {
"branch": "main",
"commit_count": 74,
"repo_created_at": "2023-02-11T14:40:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "664d1a8d9bc... |
03b0d058-0fb0-45e1-8208-451ce9c9f11a | ailyanlu1/ACM-12 | practice/Codeforces/Codeforces Round #156 div1&div2/A.cpp | //#include <bits/stdc++.h>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <string>
#include <bitset>
using namespace std;
typedef long long LL;
... | ALGO | 0.999782 | 3.538048 | {
"github_metadata": {
"branch": "master",
"commit_count": 82,
"repo_created_at": "2018-07-31T00:31:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "84f64d0e0... |
9875c00e-f5ef-4b23-8bc2-5cedeed6a482 | makio93/competitive-othersites | TopCoder/SRM/829/Div1/Q2/2/main1-0.cpp | // 学習2回目,自力AC(ヒント有)
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i=0; i<(int)(n); ++(i))
#define rep3(i, m, n) for (int i=(m); (i)<(int)(n); ++(i))
#define repr(i, n) for (int i=(int)(n)-1; (i)>=0; --(i))
#define rep3r(i, m, n) for (int i=(int)(n)-1; (i)>=(int)(m); -... | ALGO | 0.999804 | 3.997378 | {
"github_metadata": {
"branch": "main",
"commit_count": 1074,
"repo_created_at": "2021-04-26T01:47:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "18cadfddb... |
d04a49d1-4ed2-4f71-bfe2-d54bcd21a66f | woonhyeong/Baekjoon | 2261/2261/main.cpp | //
// main.cpp
// 2261
//
// Created by 이운형 on 26/03/2019.
// Copyright © 2019 201302458. All rights reserved.
//
#include <stdio.h>
#include <limits.h>
#include <algorithm>
#include <vector>
using namespace std;
struct Point{
int x,y;
bool operator < (const Point &v) const {
if (x == v.x) {
... | ALGO | 0.999965 | 4.377654 | {
"github_metadata": {
"branch": "master",
"commit_count": 106,
"repo_created_at": "2019-01-21T10:25: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": "a658a1dc... |
37f87520-5ca5-4bf8-9611-0516d54365b2 | jiahao1001/OJ_Guide | 有OJ/刷题指南(包含leetcode, POJ, PAT等)/PAT/PAT甲级(Advanced Level)/1104. Sum of Number Segments (20).cpp | 1104. Sum of Number Segments (20)
Given a sequence of positive numbers, a segment is defined to be a consecutive subsequence. For example, given the sequence {0.1, 0.2, 0.3, 0.4}, we have 10 segments: (0.1) (0.1, 0.2) (0.1, 0.2, 0.3) (0.1, 0.2, 0.3, 0.4) (0.2) (0.2, 0.3) (0.2, 0.3, 0.4) (0.3) (0.3, 0.4) (0.4).
Now giv... | ALGO | 0.999838 | 4.669485 | {
"github_metadata": {
"branch": "master",
"commit_count": 28,
"repo_created_at": "2017-12-25T06:24:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 82,
"forks": 29,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b2e316e... |
28c0dfaa-0958-4a22-9f5c-69134f1359fe | wang-nima/algorithm_practice | Google Code Jam 2014/magicTrick.cpp | #include <iostream>
#include <unordered_set>
#include <vector>
using namespace std;
int main() {
int t;
cin >> t;
int i = 1;
int a[4][4];
while (t--) {
int ans1;
cin >> ans1;
unordered_set<int> s;
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 4; j++) {
cin >> a[i][j];
if (i == ans1 - 1) {
... | ALGO | 0.997724 | 3.818891 | {
"github_metadata": {
"branch": "master",
"commit_count": 44,
"repo_created_at": "2015-02-04T01:34: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": "86cd0d6d0... |
8f4413ec-0955-4e9c-bfa1-f8bd6677b7f3 | ishandutta2007/codeforces-z | zemen/normal/578/C.cpp | #include <bits/stdc++.h>
using namespace std;
#define sz(x) ((int) (x).size())
#define forn(i,n) for (int i = 0; i < int(n); ++i)
#define forab(i,a,b) for (int i = int(a); i < int(b); ++i)
typedef long long ll;
typedef long double ld;
const int INF = 1000001000;
const ll INFL = 2000000000000001000;
int solve();
i... | ALGO | 0.999833 | 3.908994 | {
"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": "e348e1a29da1... |
a804e2d6-9b84-4c8f-beab-31e2bd8d4b17 | rene-d/hackerrank | data-structures/linked-lists/merge-two-sorted-linked-lists.cpp | // Merge two sorted linked lists
// Given the heads of two sorted linked lists, change their links to get a single, sorted linked list.
//
// https://www.hackerrank.com/challenges/merge-two-sorted-linked-lists/problem
//
#include "linked-list.hpp"
Node* MergeLists(Node *headA, Node* headB);
int main()
{
int t;
... | ALGO | 0.999743 | 5.816685 | {
"github_metadata": {
"branch": "master",
"commit_count": 197,
"repo_created_at": "2018-03-27T13:10:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 86,
"forks": 25,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "aaea63... |
d74cf8b5-17ec-4140-af8c-5beeb79eb2cb | LEO07-dev/Latihan-Daspro | Di Lab/September 19 2022/coba1.cpp | //judul
//Menghitung lama belajar
//Programer : <NAME>
//Modify : 19 Sept 2022
#include <iostream>
using namespace std;
//kamus
int j1, m1, d1, j2, m2, d2, h1, h2, h3, j0, m0, d0;
//deskripsi
main ()
{
cout << "Menghitung lama belajar" << endl;
cout << "Jam belajar awal adalah 07:02:1... | ALGO | 0.98555 | 4.031395 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2023-01-10T03:05:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0d871b922b... |
3d84d88b-790e-48f0-b89f-5c1666de8bae | lannnnn/DSAA-2017-SUSTech | LAB9_11610613/9I.cpp | #include<stdio.h>
#include<memory.h>
#include<queue>
using namespace std;
namespace fastInput {
inline char nc() {
static char buf[1000000], *p1 = buf, *p2 = buf;
return p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1000000, stdin), p1 == p2) ? '@' : *p1++;
}
int over;
inline int nextInt(... | ALGO | 0.999892 | 3.668901 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2021-09-16T21:06: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": "d88572142b5b... |
f9fc468b-1e1d-48e2-8f18-ee6dd0d8ebaf | hoangtrung1999/UIT_Homework | [Second Year] AI/BTS/1_2_1.cpp | #include <iostream>
#include <fstream>
using namespace std;
void SortTime (int Time[], int ID[], int n)
{
for (int i = n-1; i > 0 ; i--)
for (int j = 0; j < i ; j++)
if (Time[j] < Time[i])
{
swap(Time[i], Time[j]);
swap(ID[i], ID[j]);
}
}
int SelectMachine (int machineWork[], int m)
{
int min;
m... | ALGO | 0.999984 | 3.374463 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2018-04-10T07:17: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": "ce800f9a4... |
553de448-8c05-4ba2-afe3-7cfed353384a | Tudor67/Competitive-Programming | LeetCode/Problems/Algorithms/#312_BurstBalloons_sol3_brute_force_TLE.cpp | class Solution {
private:
int solve(vector<int>& nums){
const int N = nums.size();
int maxVal = 0;
for(int i = 0; i < N; ++i){
int val = nums[i];
if(i - 1 >= 0){
val *= nums[i - 1];
}
if(i + 1 < N){
val ... | ALGO | 0.999994 | 5.440068 | {
"github_metadata": {
"branch": "master",
"commit_count": 615,
"repo_created_at": "2020-02-27T19:56:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "44b47f2a... |
ec1b190c-9007-4535-be85-4d9d609e77e2 | ishandutta2007/codeforces-s | shangjingbo/normal/161/A.cpp | #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <queue>
using namespace std;
#define lowbit(x) ((x)&(-(x)))
#define sqr(x) ((x)*(x))
#define PB push_back
#define MP make_pair
ty... | ALGO | 0.999822 | 3.257834 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:07:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e31987dc5341... |
eeed6ec5-3f42-4cc4-ab5c-c0f86a2bd426 | fhormoz/caviar | CAVIAR-C++/armadillo/include/armadillo_bits/spop_max_bones.hpp | // Copyright (C) 2012-2015 National ICT Australia (NICTA)
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
// -----------------------------------------------------... | ALGO | 0.990155 | 6.521913 | {
"github_metadata": {
"branch": "master",
"commit_count": 122,
"repo_created_at": "2014-12-05T22:46:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 60,
"forks": 25,
"issues": 17,
"pull_requests": 1
},
"file_meta": {
"content_id": "abfd0... |
0076ab9d-2267-48e5-8137-3e23f6ad35c7 | Dhaval572/Basic-dsa-program | Delete_at_last_in_linked_list.cpp | // Deletion at the last element in linked list
#include <iostream>
using namespace std;
class Node
{
public:
int data;
Node *next;
// Traversing of linked list
static void displayList(Node *currentNode)
{
cout << "Element of linked list: ";
while (currentNode != nullptr)
{
cout << currentNode->data << '... | ALGO | 0.996012 | 4.937332 | {
"github_metadata": {
"branch": "main",
"commit_count": 195,
"repo_created_at": "2024-07-04T13:57: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": "1a10f90e8b... |
6ded3c20-5a28-4021-90b0-0345014a2a9c | sachinjose/LeetCode-Probs | Prob_994_Rotting_Oranges.cpp | class Solution {
public:
struct cell{
int x;
int y;
int minute;
};
int orangesRotting(vector<vector<int>>& grid) {
int m = grid.size();
int n = grid[0].size();
int dx[8] = {0,-1,1,0};
int dy[8] = {-1,0,0,1};
vector<vector<bool> > visited(m,vector<bool>(n,false));
queue<cell>q;
for (... | ALGO | 0.999832 | 5.612056 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2021-04-13T05:17: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": "7afaa425e... |
f1d36bac-c724-4366-be22-e200a040d0ef | alveko/keithschwarz_cpp | NeedlemanWunsch.hh | /****************************************************************************
* File: NeedlemanWunsch.hh
* Author: <NAME> (<EMAIL>)
*
* An implementation of the Needleman-Wunsch algorithm for optimal string
* alignment. The algorithm takes as input two strings, A and B, then
* computes the cost of an optimal al... | ALGO | 0.999931 | 6.64028 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2013-06-09T13:33:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5933ecf02d... |
41d06740-f829-4492-95d0-ebababb90d8e | projectPiki/pikmin | src/plugPikiKando/fastGrid.cpp | #include "FastGrid.h"
#include "AIPerf.h"
#include "DebugLog.h"
#include "MemStat.h"
#include "sysNew.h"
u8* FastGrid::aiGridMap;
u16 FastGrid::aiGridSize;
u16 FastGrid::aiGridShift = 12;
/*
* --INFO--
* Address: ........
* Size: 00009C
*/
DEFINE_ERROR(__LINE__) // Never used in the DLL
/*
* --INFO--
* Address... | ALGO | 0.940752 | 5.773433 | {
"github_metadata": {
"branch": "main",
"commit_count": 1748,
"repo_created_at": "2021-09-28T00:09:56.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 163,
"forks": 14,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e236fdf... |
bdc823ba-075f-42c2-b071-44a183de5e1e | MaxwellOliveira01/Competitive-programming | ED/bit2D.cpp | #include <bits/stdc++.h>
#define debug(x) cout << "[" << #x << " = " << x << "] ";
#define debugendl(x) cout << "[" << #x << " = " << x << "]\n";
#define ff first
#define ss second
using namespace std;
using ll = long long;
using ld = long double;
using pii = pair<int,int>;
using vi = vector<int>;
using tii = tuple<i... | ALGO | 0.998503 | 3.610671 | {
"github_metadata": {
"branch": "master",
"commit_count": 48,
"repo_created_at": "2020-11-21T01:25: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": "27c8d3b26... |
99794086-8ed0-4648-8292-e08ad866d800 | lakshmanaram/Competitive-programming | codeforces/998C-Convert_to_ones.cpp | #include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
#define vll vector<long long>
#define all(S) S.begin(), S.end()
#define S(a) scanf("%lld", &a)
using namespace std;
int main(){
long n;
ll x, y;
cin >> n >> x >> y;
string s;
cin >> s;
long cont_z = 0, noz = 0;
for (long i =... | ALGO | 0.999648 | 3.464878 | {
"github_metadata": {
"branch": "master",
"commit_count": 90,
"repo_created_at": "2015-11-15T14:22:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 19,
"forks": 7,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5ec456d3... |
7bfd52de-78ed-4449-b57d-df4bae296c89 | NasmeenI/ComOlympic | Camp_2/1)data_structure/8)combination---permutation/Code/0204.cpp | #include <bits/stdc++.h>
#define ll long long
using namespace std;
vector<ll> factor(ll a){
vector<ll> v;
while(a%2==0){
v.push_back(2);
a/=2;
}
for(ll i=3;i<=sqrt(a);i+=2){
while(a%i==0){
v.push_back(i);
a/=i;
}
}
if(a>2) v.push_back(a);
... | ALGO | 0.999881 | 3.403063 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2022-04-19T20:43:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f9306cfed0a... |
7c99b135-37a8-42a5-a106-a7006bc667e6 | 27j4/CSES---DP | countingNumbers.cpp | #include <bits/stdc++.h>
using namespace std;
const unsigned long long maxi = LLONG_MAX*2ULL;
int n;
vector<int> a, b;
vector<vector<vector<vector<vector<unsigned long long>>>>> dp;
unsigned long long helper(int i, int b1, int b2, int prev, int is) {
if (i == n) return 1;
if (dp[b1][b2][prev][i][is] != ... | ALGO | 0.999906 | 4.572349 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2025-05-05T10:47: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": "0db54f9c1c2... |
e16abdad-2f5f-499c-ba73-0124a9e23160 | ggomjae/Algorithm | samsung16234.cpp | #include <iostream>
#define MAX 51
using namespace std;
int n,l,r;
int arr[MAX][MAX];
int cpyArr[MAX][MAX];
int dx[4] = { -1, 0 ,1 ,0 };
int dy[4] = { 0 , 1, 0, -1};
bool state,final;
int ans;
void solution(int px,int py){
for(int i = 0 ; i < 4; ++i){
int nx = px + dx[i];
int ny = py + dy[i];
if(0 <=... | ALGO | 0.999865 | 3.922651 | {
"github_metadata": {
"branch": "master",
"commit_count": 70,
"repo_created_at": "2019-12-23T07:59: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": "6c388925c... |
80993264-489c-4f1c-bba3-cafd3a4d2a98 | zilliztech/knowhere | thirdparty/faiss/faiss/impl/RHNSW.cpp | /**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
// -*- c++ -*-
#include <faiss/impl/RHNSW.h>
#include <string>
#include <vector>
#include <faiss/impl/AuxIndexStructures.h>
na... | ALGO | 0.998009 | 4.35562 | {
"github_metadata": {
"branch": "main",
"commit_count": 1209,
"repo_created_at": "2023-08-09T06:52:35.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 257,
"forks": 102,
"issues": 6,
"pull_requests": 7
},
"file_meta": {
"content_id": "34a668... |
f4775fa0-d662-4e43-90bc-250f0cb39aa0 | jmhIcoding/leetcode_cracker | 105.Construct Binary Tree/105.Construct Binary Tree/源.cpp | #include <stdio.h>
#include <stdlib.h>
#include <vector>
using namespace std;
// Definition for a binary tree node.
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode(int x) : val(x), left(NULL), right(NULL) {}
};
class Solution {
public:
TreeNode * build(vector<int> &... | ALGO | 0.999999 | 5.539387 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2019-09-05T05:56: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": "4791b8d2d... |
3d12c30a-8a20-4249-8635-72e6278d6a08 | lqhenwunai/mytest | Test5.cpp | #include<iostream>
#include<iomanip>
#include<stdio.h>
#include<math.h>
#include<stdlib.h>
using namespace std;
int Mat_x_Mat_x_Mat(double D[3][3], double A[3][3],double B[3][3],double C[3][3]); //D=A*B*C
void print_matrix(double A[3][3], int dim)
{
for (int i=0; i<dim; i++){
for( int j=0; j<dim; j++){
... | ALGO | 0.999808 | 3.555082 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2018-12-07T13:36: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": "76bd76c261... |
7a72388b-bb28-4d6e-b8d3-6851720cddca | 0xcds4r/HFCArchiver | main.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <unordered_map>
#include <queue>
#include <bitset>
struct HuffmanNode {
char data;
unsigned frequency;
HuffmanNode* left;
HuffmanNode* right;
HuffmanNode(char data, unsigned frequency)
: data(data), frequen... | ALGO | 0.998676 | 5.336463 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2025-01-12T19:21: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": "d638aca1f958... |
cde3919b-5950-4816-b94f-5f603f00f254 | qiaozishun4/CSP2024_BJ | BJ-Senior/answers/BJ-S00082/color/color.cpp | /*
Glory Glory Man United
*/
#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 100;
int a[N];
int main()
{
freopen("color.in", "r", stdin);
freopen("color.out", "w", stdout);
int T;
cin >> T;
while (T--)
{
int n;
cin >> n;
for (int i = 1; i <= n; i++) c... | ALGO | 0.999871 | 4.415994 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2024-11-01T16:05: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": "d0f744812a... |
39dee5d9-ba15-49d3-a55b-23bc24d5f4b7 | kjunmin/leetcode | algorithms/cpp/3SumClosest.cpp | class Solution {
public:
int threeSumClosest(vector<int>& nums, int target) {
sort(nums.begin(), nums.end());
int closest = INT_MAX;
int ans = INT_MAX;
int N = nums.size();
for (int i = 0; i < N - 2; i++) {
int high = N - 1;
int low = i + 1;
... | ALGO | 0.999998 | 6.289067 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2021-10-29T09:47:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5e6dee21ad7... |
41b035f0-1004-422b-99d2-fc237df75456 | mmxsrup/ABC-D | abc006-d.cpp | //最大増加列を求めればいい。
/*dpを使う。dpを使うなら漸化式を立てる必要がある。
i=0 または dp[i-1]<a(j)なら dp[i] = min(dp[i], a(j))
である。これを実装すればいい O(n^2)
この回答だとTLE
if(dp[j - 1] < c[i]) dp[j] = min(dp[j], c[i]);
ここでdp[j - 1] < c[i]を満たすの中で、j - 1が最大のものを全探索で探している部分が無駄、dpは単調増加(ソートされた状態になっている)
から2分探索すれば(nlogn)
*/
#include <iostream>
#include <string>
#include <... | ALGO | 0.99993 | 3.876379 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2016-06-18T06:26: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": "38cc6c55d... |
bf4724f6-3153-4fc3-bffc-ef9ea6f17592 | liuyaqiu/LeetCode-Solution | 542-01Matrix.cpp | #include <iostream>
#include <vector>
#include <queue>
using namespace std;
typedef pair<int, int> mypair;
vector<vector<int>> updateMatrix(vector<vector<int>>& matrix) {
int m = matrix.size();
int n = matrix[0].size();
vector<vector<bool>> visit(m, vector<bool>(n, false));
vector<vector<int>> res(m,... | ALGO | 0.999969 | 4.542303 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2016-11-06T12:48: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": "2468a6a1d8... |
2ed72642-c6fc-48ca-bb72-1bd85cd46547 | qingfuliu/DeftRPC | main.cpp | #include <iostream>
#include<vector>
#include <queue>
#include <set>
using namespace std;
class Solution {
public:
int firstMissingPositive(vector<int> nums) {
for (int i = 0; i < nums.size(); ++i) {
while (nums[i] - 1 < nums.size() && nums[i] > 0 && nums[i] != i + 1) {
std::... | ALGO | 0.999867 | 4.995256 | {
"github_metadata": {
"branch": "main",
"commit_count": 99,
"repo_created_at": "2023-05-11T11:55: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": "26a3bbc8c50... |
feb226fd-1519-4f08-b00c-26c10638687e | arshpreetsingh134/Algorithms | Data Structures/Trees/Segment Tree/Segment_Tree.cpp | // Implementation of Segment Tree Data Structure of resolving minimum range queries
// in O(log(n)) time
#include <iostream>
#include <cmath>
#include <limits.h>
#include <exception>
using namespace std;
class MyException : public exception
{
public:
const char *what() const throw()
{
return "\n(EXCEP... | ALGO | 0.999978 | 5.755097 | {
"github_metadata": {
"branch": "main",
"commit_count": 42,
"repo_created_at": "2021-01-23T05:56:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cd2db5fd3b9... |
f2e11daa-5efc-439c-8f70-4d4c89c20ad5 | arslanugur/cpp | programs/data structures/14-minimum-spanning-tree.cpp | #include <iostream>
using namespace std;
struct node {
int fr, to, cost;
} p[6];
int c = 0, dist1 = 0, dist = 0;
void primsalgo(int *ptr, int b[][7], int i, int j)
{
ptr[i] = 1;
while (c < 6)
{
int min = 999;
for (int i = 0; i < 7; i++)
{
if (ptr[i] == 1)
... | ALGO | 0.999658 | 4.253633 | {
"github_metadata": {
"branch": "master",
"commit_count": 616,
"repo_created_at": "2021-09-16T23:23:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "36b5ddb6... |
37e9b7a8-7770-4b68-a4a0-a7ae6dc434a5 | IEcheandia/remarkable | Filter_PoreAnalysis/principalComponents.cpp | /**
* @file
* @copyright Precitec Vision GmbH & Co. KG
* @author HS
* @date 2013
* @brief Filter which computes the half axes of a pore.
*/
// WM includes
#include "principalComponents.h"
#include "fliplib/PipeEventArgs.h"
#include "fliplib/Parameter.h"
#include "overlay/overlayCanvas.h"
#include "overl... | ALGO | 0.93698 | 5.8197 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2024-01-15T11:55: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": "a8a041d041... |
34e654f8-b621-482a-a4aa-fbce30721d06 | LikimiaD/MISIS-BIVT-21-3-Lychev | Lab6/method.cpp | #include <iostream>
#include <cmath>
#include <vector>
using namespace std;
double f(const vector<double>& x) {
return x[0] - 2 * x[1] * x[1] + 4 * x[1];
}
vector<double> grad_f(const vector<double>& x) {
return {1, -4 * x[1] + 4};
}
vector<double> projection(const vector<double>& x) {
double lambda = (-... | ALGO | 0.999979 | 5.414404 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2024-03-06T16:38: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": "f9f19f0fbad... |
c6d934a9-b65d-4297-ab35-f5f63c816fc5 | mengssui/C-PLUS-PLUS-Road | LeetcodeC++/Array/26.remove_repeat_element.cpp | /*
* @Descripttion:
* @version: 0.1
* @Author: Mengbw
* @Date: 2021-06-27 16:38:51
* @LastEditors: Mengbw
* @LastEditTime: 2021-06-27 16:51:22
*/
#include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
int removeDuplicates(vector<int>& nums) {
int size = nums.size();
if (siz... | ALGO | 0.999863 | 5.255435 | {
"github_metadata": {
"branch": "master",
"commit_count": 125,
"repo_created_at": "2020-06-20T01:26: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": "da72fe68... |
80a5fbd4-a2fb-4476-9f5d-a737cdfe2e7f | TonPC64/linklist | linklist.cpp | #include "linklist.h"
#include <iostream>
using namespace std;
char mainMenu();
char insertMenu();
int getListNode (List<int> &a, int position);
int main(){
List<int> a;
ListItr<int> b;
ListItr<int> c;
b = a.zeroth();
bool exit = true;
int x, n = 0, f = 0, r = 0;
do {
char choice = mainMenu();
... | TOOL | 0.970228 | 4.009184 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2016-02-16T07: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": "d951d6554a... |
c525f85b-0328-4861-ab92-fb67605f8e7f | stellarkey/912_project | 6 复试/1 机试/资料/NOIP/师大普及组资料/Day2/std/score.cpp | #include<bits/stdc++.h>
using namespace std;
struct node
{
int number, score;
} a[5010];
int cmp (node x, node y)
{
if (x.score == y.score)
return x.number < y.number;
else return x.score > y.score;
}
int main()
{
freopen("score.in", "r", stdin);
freopen("score.out", "w", stdout);
int n, m... | ALGO | 0.999865 | 3.412153 | {
"github_metadata": {
"branch": "master",
"commit_count": 348,
"repo_created_at": "2019-04-28T06:41:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2770,
"forks": 531,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a44... |
b2e9b2cf-75d8-410c-b357-aafd40817506 | agadilkhan/algo | kbtu_labs/lab8/b.cpp | #include <bits/stdc++.h>
using namespace std;
unordered_map <size_t, size_t> mp;
size_t cnt = 0;
void f(string s, string t){
size_t n = s.size();
size_t m = t.size();
long long h[n];
long long p[n];
long long q = 2147483647;
p[0] = 1;
for(size_t i = 1; i < max(n, m); ++i){
p[i] = (p[... | ALGO | 0.999921 | 4.125558 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-04-13T12:36: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": "a448f87d279f... |
95262a2d-f0ee-42d7-b9f9-fded6d0eebed | b-it-bots/robocup-at-work | mas_common_robotics/mcr_perception/mcr_object_categorization/common/include/mcr_object_categorization/kde.h | /*
* Created on: Mar 18, 2011
* Author: <NAME>
*/
#ifndef CKDE_H
#define CKDE_H
#include <iostream>
#include <vector>
#include <cstdlib>
#include <map>
#include <bin_size_config.h>
#define FIXED_BIN_SIZE_HISTOGRAM 20
class CKde
{
private:
std::map<std::vector<double>, int> densityDistributions;
std::ma... | ALGO | 0.993424 | 5.54562 | {
"github_metadata": {
"branch": "leipzig-2016",
"commit_count": 8,
"repo_created_at": "2014-08-12T09:18:49.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 13,
"forks": 20,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d6d... |
be74f56a-d04f-4760-8a4a-ac500463dba0 | mohamed12samy/Graphics | Graphics/main.cpp | #if defined(UNICODE) && !defined(_UNICODE)
#define _UNICODE
#elif defined(_UNICODE) && !defined(UNICODE)
#define UNICODE
#endif
#include <tchar.h>
#include <windows.h>
#include <bits/stdc++.h>
using namespace std;
/* Declare Windows procedure */
LRESULT CALLBACK WindowProcedure (HWND, UINT, WPARAM, LPARAM);
/* Mak... | ALGO | 0.982989 | 3.437395 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2019-04-29T13:49: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": "70fc55b0c5... |
da57bd8b-50c5-4a00-b589-4b8882d841a9 | moveit/moveit | moveit_core/trajectory_processing/src/ruckig_traj_smoothing.cpp | /*******************************************************************************
* BSD 3-Clause License
*
* Copyright (c) 2021, PickNik Robotics
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are m... | ALGO | 0.998812 | 6.28106 | {
"github_metadata": {
"branch": "master",
"commit_count": 8038,
"repo_created_at": "2016-07-27T20:38:09.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1896,
"forks": 967,
"issues": 563,
"pull_requests": 55
},
"file_meta": {
"content_id": "... |
aa1a6510-c59b-4078-bc3a-ccc0d752bba6 | Anik-Modak/CSE4Y2S_Lab | Multimedia/Run Length Encoding Decoding.cpp | #include<bits/stdc++.h>
using namespace std;
string to_string(int i)
{
ostringstream ss;
ss<<i;
return ss.str();
}
int run_length_encode()
{
ifstream fin;
fin.open("RunLengthInput.txt");
ofstream fout;
fout.open("RunLengthEncoding.txt");
int en_len = 0;
string encode, str;
wh... | ALGO | 0.9974 | 3.802677 | {
"github_metadata": {
"branch": "main",
"commit_count": 36,
"repo_created_at": "2022-01-10T18:33:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0bcfcf01aff... |
1b686703-8ef4-4235-b5d8-2eca4b5bdc83 | InsightSoftwareConsortium/ITK | Modules/Registration/Metricsv4/include/itkImageToImageMetricv4GetValueAndDerivativeThreaderBase.h | /*=========================================================================
*
* Copyright NumFOCUS
*
* 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
*
* https://www.apache.o... | ALGO | 0.906431 | 7.426858 | {
"github_metadata": {
"branch": "main",
"commit_count": 57165,
"repo_created_at": "2010-07-27T15:48:04.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1517,
"forks": 701,
"issues": 268,
"pull_requests": 49
},
"file_meta": {
"content_id": "9... |
be7ab9e8-c326-4b0f-8c4f-91a877b58ccb | KangmoonSeo/PS | 백준/Silver/2579. 계단 오르기/계단 오르기 old.cc | #include <algorithm>
#include <cmath>
#include <iostream>
#include <vector>
#define max(a, b) (a > b ? a : b)
using namespace std;
int dp[301][2] = {}; // dp[i][0] : tol:1, dp[i][1] : tol:2
int n;
int stair(vector<int>& arr) {
if (n == 1)
return arr[0];
else if (n == 2)
return arr[0] + arr[1];
dp[0][0... | ALGO | 0.999983 | 4.093404 | {
"github_metadata": {
"branch": "main",
"commit_count": 600,
"repo_created_at": "2023-03-11T08: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": "3172c9cdc5... |
44c4800b-d147-465d-b73a-ad6437771f68 | Sookmyung-Algos/2021algos | algos_assignment/2nd_grade/고아라_lizze1221/11월 3주차/2617.cpp | #include <iostream>
#include <vector>
#include <cstring>
using namespace std;
int N, M;
vector<int> heavier[100], lighter[100];
bool hVisited[100], lVisited[100];
int HDFS(int node){
int result = 1;
for (int i = 0; i < heavier[node].size(); i++){
if (!hVisited[heavier[node][i]]){
... | ALGO | 0.999903 | 3.612849 | {
"github_metadata": {
"branch": "master",
"commit_count": 5558,
"repo_created_at": "2021-02-22T06:32:53.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 4,
"forks": 38,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4baad10... |
f62eee35-fb6c-4af9-a4bf-f07eaa7ee134 | krayong/Data-Structures-and-Algorithms | BinaryTree/max_sum_no_adjacent.cpp | #include <bits/stdc++.h>
using namespace std;
/*************************************************************************************************************
*
* Link : https://www.geeksforgeeks.org/maximum-sum-nodes-binary-tree-no-two-adjacent/
* Description:
Given ... | ALGO | 0.999867 | 5.064587 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2021-01-02T08:00:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "487b34ae9... |
7b40f1c1-5559-41ed-82b1-bab0b0b55498 | zyq8709/DexHunter | art/runtime/zip_archive.cc | /*
* Copyright (C) 2008 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by app... | TOOL | 0.918259 | 5.498011 | {
"github_metadata": {
"branch": "master",
"commit_count": 29,
"repo_created_at": "2015-08-31T05:29:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1340,
"forks": 533,
"issues": 7,
"pull_requests": 0
},
"file_meta": {
"content_id": "e859... |
28da5dbe-d9af-4d20-9b20-a40b746b3faf | KimWoongwon/2A_TOTAL | 심화학기/chapter6/chapter6/ex6-12.cpp | #include <iostream>
#include <vector>
using namespace std;
int main(void)
{
vector<int> v;
v.push_back(10);
v.push_back(20);
v.push_back(30);
v.push_back(40);
v.push_back(50);
for (vector<int>::size_type i = 0; i < v.size(); i++)
cout << v[i] << " ";
cout << endl;
cout << v[0] << "," << v.front() << endl;
... | TOOL | 0.934603 | 3.288367 | {
"github_metadata": {
"branch": "master",
"commit_count": 38,
"repo_created_at": "2020-07-01T11:01: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": "61565afa3... |
eade3957-3876-4de3-a9ac-dabced6478c1 | francis-maes/lbcpp | extern/shark/src/LinAlg/detsymm.cpp | //===========================================================================
/*!
* \file detsymm.cpp
*
* \brief Used to calculate the determinant, the eigenvalues and eigenvectors
* of the symmetric matrix "amatA".
*
* \author <NAME>
* \date 1998
*
* \par Copyright (c) 1998-2000:
* Inst... | ALGO | 0.999511 | 5.541242 | {
"github_metadata": {
"branch": "master",
"commit_count": 3495,
"repo_created_at": "2015-03-21T09:43:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9915189... |
cf5f301b-9141-44a8-8eba-b84f1e4dc69e | MarekKowalski/HoloFace | Libraries/include/cTracker3/mat.h | #pragma once
#include <iostream>
#include <iomanip>
#include<stdarg.h>
#include <vector>
#include "LapackWrap.h"
template <typename T>
class Mat
{
public:
int height;
int width;
T **mat;
T *data;
public:
Mat();
void setSize(int height, int width);
T* getRow(int i) const;
T* getData() const;
Mat(int he... | TOOL | 0.953868 | 5.267815 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2018-01-26T09:31:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 100,
"forks": 16,
"issues": 6,
"pull_requests": 0
},
"file_meta": {
"content_id": "0345d44... |
318aa888-3349-4cb5-9cbd-51a8c9a91bd2 | Nanahoshi74/ABC | 334/c2.cpp | #include <bits/stdc++.h>
#include <atcoder/all>
using namespace atcoder;
using mint = modint998244353;
//using mint = modint1000000007;
// using mint = modint; /*このときmint::set_mod(mod)のようにしてmodを底にする*/
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define repi(i,a,b) for(ll i = a; i <= (ll)(b... | ALGO | 0.999981 | 3.618548 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2023-11-07T06:53:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "13d62990c21d... |
518d020c-c68a-42fc-8cdf-6d056bd5a947 | Shamikh05/Object-Oriented-Programming-Questions | OOP Lab-2/Lab2_prog1.cpp | #include<iostream>
using namespace std;
void swap(int a,int b);
void swap(int *a,int *p);
void swapaddress(int &a, int &b);
int main()
{
int x,y,temp;
cin >> x >> y;
cout << "Numbers before swapping are :\n" << "x = " << x << endl << "y = " << y << endl;
swap(x,y);
swap(&x,&y);
temp = x;
x = y;
y = temp;
swapa... | ALGO | 0.999647 | 4.57096 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2021-07-13T21:15: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": "6afccb55fb... |
13b6643f-d855-4e68-8488-3ab5792df928 | MahmoudFawzyAOE2/Learning-C-plus-plus | HackerRank/Box_it.cpp | #include<bits/stdc++.h>
using namespace std;
class Box {
int l,b,h ;
public:
Box() {l=0; b=0; h=0;};
Box(int t_l,int t_b ,int t_h) {l=t_l; b=t_b; h=t_h;};
Box(const Box& B) {l=B.l; b=B.b; h=B.h;};
int getLength() {return l;};// Return box's length
int getBreadth () {r... | ALGO | 0.99515 | 3.687448 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2024-07-17T19:57:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8d1fd18c0ac... |
3b5a0a0c-b316-48c7-be61-74dc91f830fa | Akasakar/0O0O0o0 | codeforces.com/Codeforces Round #592 (Div. 2)/1244F.cpp | /* *
* Author: Akasaka
* FileName: 1244F.cpp
* Created: 2019.11.10(UTC+0800) 22.59.32(星期日)
* */
#ifdef AKASAKA
#define IN "./in.in"
#define OUT "./out.out"
#define CLOSE "CON" ///close in/out
#define DebugIN(x) freopen(x, "r", stdin)
#define DebugOUT(x) freopen(x, "w", stdout)
#define STOP print... | ALGO | 0.999999 | 3.798679 | {
"github_metadata": {
"branch": "master",
"commit_count": 144,
"repo_created_at": "2019-09-09T02:17: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": "9c7aa44b... |
b0c69249-29e9-43e8-a9db-6be3abe36ad0 | devsCommunity23/problem-solving-course | Session#Stack/Stack.cpp | #include <iostream>
#include <vector>
using namespace std;
class Stack
{
private:
int *data;
int size;
int currentIndex;
void checkIndex()
{
if (currentIndex == 0)
{
cout << "Stack is empty" << endl;
exit(1);
}
}
public:
Stack()
{
... | ALGO | 0.999382 | 4.172544 | {
"github_metadata": {
"branch": "main",
"commit_count": 46,
"repo_created_at": "2024-04-07T21:49:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ae6c49fbe27... |
dfe0db85-378e-4c40-b7ab-e0ec05ed2129 | petergottschling/discovering_modern_cpp | c++11/limits_example.cpp | #include <iostream>
#include <limits>
#include <vector>
#include <cmath>
#include "print_compiler.hpp"
using namespace std;
template <typename T>
inline void test(const T& x)
{
cout << "x = " << x << " (";
int oldp= cout.precision(numeric_limits<T>::digits10 + 1);
cout << x << ")" << endl;
cout.precis... | ALGO | 0.981476 | 4.232784 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2015-11-16T17:33:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 207,
"forks": 85,
"issues": 3,
"pull_requests": 2
},
"file_meta": {
"content_id": "c773277... |
26835590-90ac-43b9-be43-8ba8c340bbc9 | webbju/android-plus-plus | msbuild/tests/native-stl/src/stl-vector.cpp | #include <iostream>
#include <vector>
#include <algorithm> // sort, max_element, random_shuffle, remove_if, lower_bound
#include <functional> // greater, bind2nd
// used here for convenience, use judiciously in real programs.
using namespace std;
int stl_vector()
{
int arr[4] = {1, 2, 3, 4};
// initialize a vec... | ALGO | 0.92597 | 4.218494 | {
"github_metadata": {
"branch": "main",
"commit_count": 299,
"repo_created_at": "2016-01-04T08:21:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 534,
"forks": 79,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0c6304b... |
c709060c-f1ce-4962-903a-e0a94571f385 | Illumina/ExpansionHunter | ehunter/thirdparty/graph-tools-master-0cd9399/include/graphalign/dagAligner/AffineAlignMatrixVectorized.hh | //
// GraphTools library
// Copyright 2017-2019 Illumina, Inc.
// All rights reserved.
//
// Author: <NAME> <<EMAIL>>
//
// 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... | ALGO | 0.969861 | 6.119707 | {
"github_metadata": {
"branch": "master",
"commit_count": 240,
"repo_created_at": "2016-11-10T19:53:15.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 195,
"forks": 53,
"issues": 81,
"pull_requests": 5
},
"file_meta": {
"content_id": "14905... |
6e76c3f6-05ff-4227-b76b-09b5ff09fed4 | ayush-khanduri/Iview | bst.cpp | /*input
y 3
y -1
y 4
y -1
y -1
n
*/
// Binary Search Tree
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define si(a) scanf("%d",&a)
#define sl(a) scanf("%lld",&a)
#define ss(a) scanf("%s",a)
#de... | ALGO | 0.999973 | 3.874476 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2017-10-14T13:20: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": "fb3b3712f3... |
9fb51619-c863-4d0e-8b1b-cd6b20464bd4 | glennlopez/Cpp.Playground | zyBooks/5 - Arrays and Vectors/5.4 - Iterating through vectors/activity/findMax_example.cpp | #include <iostream>
#include <vector>
using namespace std;
int main() {
const int NUM_VALS = 8; // Number of elements in vector
vector<int> userVals(NUM_VALS); // User values
int i = 0; // Loop index
int maxVal = 0; // Computed max
cout << "Enter " << NUM_VA... | ALGO | 0.999313 | 4.860964 | {
"github_metadata": {
"branch": "master",
"commit_count": 1869,
"repo_created_at": "2015-11-10T16:22:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 21,
"forks": 8,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "2d481d... |
ac03e42d-725b-4fda-99b8-ead781a33a72 | chyo1/Algorithm | 2290-minimum-obstacle-removal-to-reach-corner/2290-minimum-obstacle-removal-to-reach-corner.cpp | class Solution {
public:
int minimumObstacles(vector<vector<int>>& grid) {
int m = grid.size(), n = grid[0].size();
vector<vector<int>> removal(m, vector<int>(n, 1'000'000));
removal[0][0] = 0;
priority_queue<vector<int>, vector<vector<int>>, greater<vector<int>>> q;
... | ALGO | 0.999964 | 5.815391 | {
"github_metadata": {
"branch": "main",
"commit_count": 1191,
"repo_created_at": "2024-04-01T09:28: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": "cce18b2b9... |
e8d87547-55db-4d7d-bd0f-bce8df7580e9 | IamXDD1/OOP_Cpp | 正課/Week7/TS0701/Form.cpp | #include "Form.h"
#include <iostream>
#include <string>
#include <fstream>
#include <vector>
std::fstream inFile, outFile;
int alpha[26] = {};
std::string word = "";
std::string file_name = "";
std::vector<std::string> ans;
void Form::SetInputWord(std::string inputWord) { // set input
word = inputWord;
return;
}
... | TOOL | 0.997352 | 4.149253 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2022-09-12T06:57: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": "6213a591c93c... |
11838882-2d5a-4211-9d99-03ed25e14d6b | surajl7/Technologies | Software/C++/Chapter 8 - Pointers, Virtual Functions and Polymorphism/2K230221/pointers_pointersToFunctions.cpp | // Pointers
/*
Pointers to Functions:
Even through pointers to functions (or function pointers) are introduced in C,
they are widely used in C++ for dynamic binding, and event-based applications.
The concept of pointer to functions acts as a base for pointers to members, which
we have discussed.
T... | TOOL | 0.974581 | 5.138664 | {
"github_metadata": {
"branch": "master",
"commit_count": 95,
"repo_created_at": "2022-10-11T16:41: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": "fb2b94c70... |
46904a1b-503e-4200-b859-3819d8d980fd | ishandutta2007/codeforces-m | marckess/normal/1609/D.cpp |
// Problem : D. Social Network
// Contest : Codeforces - Deltix Round, Autumn 2021 (open for everyone, rated, Div. 1 + Div. 2)
// URL : https://codeforces.com/contest/1609/problem/D
// Memory Limit : 256 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)
#include <bits/stdc++.h>... | ALGO | 0.999856 | 4.325892 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-06-06T01:03: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": "39bf66ed17fb... |
e80fc066-4ba9-4c8c-87e6-d591735fbcf3 | wolflion/LeetCode | 02HWOD_2023yearB_advanced/odA04We Are a team.cpp | #include "test.h"
/*
* 【We Are A Team】
总共有 n 个人在机房,每个人有一个标号(1<=标号<=n),他们分成了多个团队,需要你根据收到的 m 条消息判定指定的两个人是否在一个团队中,具体的:
1、消息构成为 a b c,整数 a、b 分别代表两个人的标号,整数 c 代表指令
2、c == 0 代表 a 和 b 在一个团队内
3、c == 1 代表需要判定 a 和 b 的关系,如果 a 和 b 是一个团队,输出一行’we are a team’,如果不是,输出一行’we are not a team’
4、c 为其他值,或当前行 a 或 b 超出 1~n 的范围,输出‘da pian... | ALGO | 0.999925 | 4.228382 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2017-09-22T02:15: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": "2dd97643c... |
87cc2a8c-03ea-4487-b866-10cabda63a6c | YejingWang/Leetcode | Problems/0100_Same_Tree.h | #pragma once
/*
94. Binary Tree Inorder Traversal
https://leetcode.com/problems/same-tree/
Given the roots of two binary trees p and q, write a function to check if they are the same or not.
Two binary trees are considered the same if they are structurally identical, and the nodes have the same value.
Example 1:
... | ALGO | 0.999773 | 6.858237 | {
"github_metadata": {
"branch": "master",
"commit_count": 111,
"repo_created_at": "2020-04-18T12:03:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5a63f281... |
ce571c88-7fd0-4b30-b586-c9ab5dbffa72 | SevenCoder03/UTH_IT | Graph_Theory/Lab4/Kruskal/main.cpp | #include <bits/stdc++.h>
using namespace std;
int label[] = {1, 2, 3, 4, 5, 6};
class DSU {
int* parent;
int* rank;
public:
DSU(int n) {
parent = new int[n];
rank = new int[n];
for (int i = 0; i < n; i++) {
parent[i] = -1;
rank[i] = 1;
}
}
in... | ALGO | 0.999989 | 4.687413 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-08-14T12:33: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": "88067960a0de... |
7337376f-6e07-4848-9813-ce5184fdf2a3 | vietnguyen30102000/COSC2436-Summer-UH-2023 | ga1/ga1.cpp |
#include <iostream>
#include <vector>
#include <fstream>
#include <bits/stdc++.h>
#include "ArgumentManager.h"
using namespace std;
class LL{
private:
struct NodeL{
int data;
NodeL *next;
};
NodeL *head;
public:
LL():head(nullptr){}
void reverse() {
if(head == nullptr || head->next == nullptr) {
... | ALGO | 0.999241 | 3.945402 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-07-13T19:05:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1bfa1bae9f9d... |
e49eebb2-addf-4e2e-9bc3-5a6107b4eeca | kimsj0302/algorithm_study | codeforce/contest_962/codeforce_contest_962_problem_B.cpp | #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main() {
int num, a, b;
int answer = 0;
int total=0;
scanf("%d %d %d", &num, &a, &b);
char tmp;
vector<int> arr;
int seat = 0;
getchar();
for (int i = 0; i < num; i++) {
char a;
scanf("%c", &a);
if (a == '.')
total++;
... | ALGO | 0.999701 | 3.084514 | {
"github_metadata": {
"branch": "master",
"commit_count": 36,
"repo_created_at": "2018-04-16T16:59:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "97635b685... |
6b96c881-bfe4-4e8b-af64-fdadc00d5882 | kushaal-rana/LeetCode | Recursion/Backtracking/2698. Find the Punishment Number of an Integer.cpp | class Solution
{
public:
// Approach-1 : (Recursion)
bool checkPartition(int idx, int currSum, int num, string square)
{
if (idx == square.size())
return currSum == num;
if (currSum > num)
return false;
// if(currSum==num) return true;
for (int j = id... | ALGO | 0.999802 | 5.481685 | {
"github_metadata": {
"branch": "main",
"commit_count": 63,
"repo_created_at": "2025-02-09T00:27: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": "eea31ac981e... |
616d0fc4-2be6-4a45-84dd-6b3a560e296f | CherryGS/ACM | _atcoder/arc/arc111/e.cpp | #include <map>
#include <set>
#include <cmath>
#include <queue>
#include <cstdio>
#include <vector>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
#define ll long long
#define ull unsigned long long
#define cint const int&
#define Pi acos(-1)
const int mod = 1e9+7;
const int inf_int ... | ALGO | 0.999734 | 3.132861 | {
"github_metadata": {
"branch": "master",
"commit_count": 44,
"repo_created_at": "2021-10-29T11:11:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4c31dd9c9... |
d42f891e-4a02-49e0-a875-0f4518619574 | azakrytnoi/uva | vol100/u10007/u10007.cpp | #ifdef _WIN32
#define UVA_API_EXPORT __declspec(dllexport)
#else
#define __cdecl
#define UVA_API_EXPORT
#endif
#include "u10007.h"
#include <iostream>
#include <iomanip>
#include <vector>
#include <map>
#include <string>
#include <algorithm>
#include <iterator>
#include <numeric>
#include <memory>
#includ... | ALGO | 0.999773 | 4.544049 | {
"github_metadata": {
"branch": "develop",
"commit_count": 752,
"repo_created_at": "2016-02-10T16:17:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b5e8352... |
a178351d-d171-4f77-ad24-7b6c659cd8c1 | shreyashganvir77/Wireless-Monitoring-of-Substation-using-IoT | pf/pf.ino | #include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
int pin = 7;
const int pulsePin = 8;
float rads = 57.29577951; // 1 radian = approx 57 deg.
float degree = 360;
float frequency = 50;
float nano = 1 * pow (10,-6); // Multiplication factor to convert nano seconds into seconds
// Define floats to contain... | TOOL | 0.941537 | 5.511479 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2019-12-30T11:14:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3fa40278e0... |
ef155514-302c-4a54-be9f-5d92e10b04b6 | raincross7/code-similarity | codes/train_code/problem089/problem089_303.cpp | #include <iostream>
#include <cstdio>
#include <string>
static const int drawPoint = 1;
static const int winPoint = 3;
enum Result
{
WINNER_A,
DRAW,
WINNER_B,
};
Result game(const std::string a, const std::string b);
int main(void)
{
int n;
std::cin >> n;
int point_a = 0;
int point_b = 0;
std::string a, b;
... | ALGO | 0.999976 | 4.209856 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-03-06T05:07:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f199361eed0e... |
b3f66cb6-5f62-44c3-87ad-e52d1166634f | camel0t111/ConsoleApplication6 | ConsoleApplication6/MyString.cpp | #define _CRT_SECURE_NO_WARNINGS
#include "MyString.h"
#include <iostream>
using namespace std;
MyString::MyString()
{
length = 80;
str = new char[length + 1];
for (int i = 0; i < length; i++)
{
str[i] = 'X';
}
str[length] = '\0';
}
MyString::MyString(bool askSize)
{
cout << "Enter amount of symbols in string:... | TOOL | 0.968128 | 3.650647 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2024-10-13T20:30: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": "dd6511c4bb... |
c05d5e95-5239-48b6-83fe-432b72385974 | AnuragPatel1/Codeforces-Problem | C_Numeric_String_Template.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int t; cin >> t;
while(t--){
int n; cin >> n;
bool ans = true;
unordered_map <int, vector<int> >arr;
for(int i = 0; i < n; i++){
int num; cin >> num;
arr[num].push_back(i);
}
... | ALGO | 0.999852 | 3.984668 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2025-04-12T09:45:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "38d103d95fc... |
ce885682-8831-416b-916b-1f5506131274 | vectar31/code_library | heavy_light.cpp | // Heavy-light decomposition (and LCA)
//
// Decomposes a tree into a set of disjoint paths ("chains") so that every
// path from the root to any other node touches at most ceil(log2(N)) chains.
// Every chain is rooted in a node and "hanging" downward.
//
// Also, the algorithm lays out all nodes in a sequence so that... | ALGO | 0.998916 | 4.51542 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-05-04T03:00:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "33a9bb0091... |
3b9893b8-646c-49f0-8d9a-17d43351fd50 | joaomarcosth9/competitive-programming | codeforces/good-bye-2022/A.cpp | #include "bits/stdc++.h"
using namespace std;
#ifdef LOCAL_DEBUG
#include "debug.h"
#else
#define debug(...)
#define cerr if (false) cerr
#endif
#define endl '\n'
#define eb emplace_back
#define all(x) begin(x), end(x)
#define rall(x) rbegin(x), rend(x)
#define L1(res...) [&](const auto& x){ return res; }
#define L2(r... | ALGO | 0.999974 | 3.602945 | {
"github_metadata": {
"branch": "main",
"commit_count": 34,
"repo_created_at": "2022-07-20T11:23: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": "3dccfa1c8e1... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.