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 |
|---|---|---|---|---|---|---|---|
c7a3423c-0708-44d0-8960-47665e1113a8 | SupremeLobster/Gratacels | Solucio.h | // <NAME>
// Usuari u1956231
// Sessió p2
#ifndef SOLUCIO_H
#define SOLUCIO_H
#include <iostream>
#include <fstream>
#include <vector>
#include "Candidats.h"
using namespace std;
/**
Permet gestionar la solució del problema.
**/
class Solucio
{
public:
/**
@pre Cert.
@post S'ha creat... | ALGO | 0.989964 | 4.305156 | {
"github_metadata": {
"branch": "master",
"commit_count": 24,
"repo_created_at": "2020-06-16T15:53:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fcbdc4c98... |
063545b3-8774-4a1b-902f-afb846eeb6b7 | queuedq/ps | BOJ/1315/naive.cc | #include <bits/stdc++.h>
#define endl "\n"
using namespace std;
typedef long long lld;
typedef pair<int, int> pii;
typedef pair<lld, lld> pll;
////////////////////////////////////////////////////////////////
const int MAX_N = 100;
const int MAX_P = 1005;
int N;
int S[MAX_N], I[MAX_N], P[MAX_N];
int usable[MAX_P][MAX_P... | ALGO | 0.99757 | 3.929468 | {
"github_metadata": {
"branch": "master",
"commit_count": 824,
"repo_created_at": "2018-05-26T14:07:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e1bac732... |
e890b61a-900f-4189-8da6-0bd0e8b9ab09 | huihui2259/go | c++/Top/148.排序链表.h | #include "c++/head.h"
class Solution
{
public:
ListNode *sortList(ListNode *head)
{
if (head == nullptr || head->next == nullptr)
return head;
ListNode *mid = middleNode(head);
ListNode *left = sortList(head);
ListNode *right = sortList(mid);
return mergeTwoL... | ALGO | 0.99991 | 5.944874 | {
"github_metadata": {
"branch": "main",
"commit_count": 36,
"repo_created_at": "2023-02-24T08:31:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "64d1baee938... |
6a1a0bfa-35bb-4b6b-a5fc-55af9dffe759 | NCAR/lrose-core | codebase/apps/Radx/src/Radx2Grid/PrevReorderInterp.hh | // *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
// ** Copyright UCAR (c) 1990 - 2016
// ** University Corporation for Atmospheric Research (UCAR)
// ** National Center for Atmospheric Research (NCAR)
// ** Bo... | ALGO | 0.951728 | 6.575245 | {
"github_metadata": {
"branch": "master",
"commit_count": 7406,
"repo_created_at": "2016-02-09T23:36:25.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 99,
"forks": 51,
"issues": 16,
"pull_requests": 3
},
"file_meta": {
"content_id": "f2b63... |
b765ac21-2762-4557-848d-372f7f2bd157 | Kartik-Mathur/LVCPPJune21 | Lecture-35/NStairs.cpp | // NStairs.cpp
#include <iostream>
using namespace std;
int topDown(int n, int k, int *dp) {
if (n == 0) {
return dp[n] = 1;
}
if (n < 0) {
return 0;
}
if (dp[n] != 0) {
return dp[n];
}
int ans = 0;
for (int i = 1 ; i <= k ; i++) {
ans += topDown(n - i, k, dp);
}
return dp[n] = ans;
}
int bottomU... | ALGO | 0.999954 | 3.68398 | {
"github_metadata": {
"branch": "main",
"commit_count": 47,
"repo_created_at": "2021-06-30T17:28:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dda768f641d... |
30366aaf-27ee-4e95-9b56-836cecb55402 | krishna25092005/LeetCode_Solutions | 1093-recover-a-tree-from-preorder-traversal/1093-recover-a-tree-from-preorder-traversal.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999641 | 5.89841 | {
"github_metadata": {
"branch": "main",
"commit_count": 1092,
"repo_created_at": "2024-07-27T08:00:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8b70ed747... |
240d11e1-0953-4cd6-86be-a99e646badc3 | Charles-T-T/Algorithm-Practice | Two-pointers/11-container_with_most_water/11_main.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <sstream>
using namespace std;
/*
给定一个长度为 n 的整数数组 height 。有 n 条垂线,第 i 条线的两个端点是 (i, 0) 和 (i, height[i]) 。
找出其中的两条线,使得它们与 x 轴共同构成的容器可以容纳最多的水。
返回容器可以储存的最大水量。
说明:你不能倾斜容器。
示例 1:
输入:[1,8,6,2,5,4,8,3,7]
输出:49
解释:图中垂直线代表输入数组 [1,8,6,2,5,4,8,3,7]。在此情况下,容器能... | ALGO | 0.999923 | 5.452548 | {
"github_metadata": {
"branch": "master",
"commit_count": 316,
"repo_created_at": "2024-02-25T02:39: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": "ac09955a... |
86d874c7-08d2-46c6-b34c-bf5d2224fae3 | djtorel/begin-cpp | Section-10/10-07-Section-Challenge/main.cpp | #include <iostream>
#include <string>
int main() {
std::string alphabet{"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1"
"234567890,.?!'\":- "};
std::string key{"<KEY>
"<KEY>"};
std::cout << "Enter your secret message: ";
std::string message{};
s... | ALGO | 0.999426 | 4.907161 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2018-04-22T22:50:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "aa84616d70... |
3ba43a30-5568-4245-ba64-9f7d674b252f | xuxinyang/luogu | PREANDADVANCE/P5960.cpp | #include <bits/stdc++.h>
using namespace std;
const int maxn = 5e3+5;
int n, m, head[maxn], tot, dist[maxn], cnt[maxn];
bool vis[maxn];
struct Edge
{
int to, next, w;
};
Edge edges[maxn << 2];
void add(int u, int v, int w)
{
edges[++tot] = Edge{v, head[u], w};
head[u] = tot;
}
bool spfa(int s)
{
queue<i... | ALGO | 0.999993 | 3.922773 | {
"github_metadata": {
"branch": "main",
"commit_count": 751,
"repo_created_at": "2022-03-27T12:51:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "801982ab4d... |
47415026-2d7d-4ff3-9712-5364379653a8 | YiranK/Leetcode | 138 Copy List with Random Pointer.cpp | /**
* Definition for singly-linked list with a random pointer.
* struct RandomListNode {
* int label;
* RandomListNode *next, *random;
* RandomListNode(int x) : label(x), next(NULL), random(NULL) {}
* };
*/
class Solution {
public:
RandomListNode *copyRandomList(RandomListNode *head) {
if... | ALGO | 0.999757 | 4.995597 | {
"github_metadata": {
"branch": "master",
"commit_count": 95,
"repo_created_at": "2018-07-22T15:32: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": "61c9c7c1a... |
e0c1367a-c42d-4fc0-892d-4ee6261c7993 | MadMike0204/MyCode | DS/OJ/id172.cpp | #include<iostream>
using namespace std;
class BinaryTree;
class BinaryTreeNode // *LeftChild | Data | *RightChild
{
private:
char data; // 节点数据
BinaryTreeNode* leftChild,*rightChild;
public:
BinaryTreeNode(char e='\0',BinaryTreeNode *l=nullptr,BinaryTreeNode *r=nullptr);
char G... | ALGO | 0.999929 | 4.436585 | {
"github_metadata": {
"branch": "master",
"commit_count": 116,
"repo_created_at": "2024-06-21T11:54:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "29423cdb... |
596ac21a-e7aa-49f9-8785-0351e874c356 | pierrbt/haversine-nearest-cities | main.cpp | /*
* Haversine Calculator
* Made by <NAME> @pierrbt
* CC BY-NC-SA
* 2023-09-18
*/
#include <iostream>
#include "haversine.hpp"
#include <fstream>
#include <utility>
#include <vector>
#include <map>
#define REGION "FR"
struct City {
City(std::string name, double lat, double lon) {
this->name = std:... | TOOL | 0.997886 | 5.012661 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2023-09-18T21:12:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e2bf938cd4... |
25c936d5-d9ff-4861-9d40-ef36d0cb1753 | honey766/Algorithm | 백준/Gold/4386. 별자리 만들기/별자리 만들기.cc | #include <iostream>
#include <tuple>
#include <algorithm>
#include <cmath>
using namespace std;
#define f(x, y) ((x.first - y.first)*(x.first - y.first) + (x.second - y.second)*(x.second - y.second))
int* parent;
int Find(int a) {
if (a == parent[a]) return a;
return parent[a] = Find(parent[a]);
}
bool Union(... | ALGO | 0.999921 | 3.79824 | {
"github_metadata": {
"branch": "main",
"commit_count": 530,
"repo_created_at": "2024-01-18T15:30: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": "e301710a5b... |
175a2192-1767-4d45-acff-0bbed0fac7e7 | Nightonke/Sicily | Sicily/14257_00.cpp | // Problem#: 14257
// Submission#: 3709477
// The source code is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License
// URI: http://creativecommons.org/licenses/by-nc-sa/3.0/
// All Copyright reserved by Informatic Lab of Sun Yat-sen University
#include <iostream>
#include <string>... | ALGO | 0.98917 | 4.154287 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2016-05-07T16:09:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0e8a30389f... |
6b214dfa-37a2-4414-8882-38dec9b2a6b7 | riroan/BaekjoonPS | 백준/Gold/12896. 스크루지 민호/스크루지 민호.cc | #include<bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#define endl '\n'
const int oOvOo=0;
using ll = long long;
using namespace std;
int main(){
std::ios_base::sync_with_stdio(false);
std::cin.tie(nullptr);
std::cout.tie(nullptr);
int n;
... | ALGO | 0.99959 | 3.810766 | {
"github_metadata": {
"branch": "main",
"commit_count": 638,
"repo_created_at": "2022-05-22T03:43:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "99d4c9ac9c... |
459a31e5-131c-4916-9123-9bc56a746837 | marco-luzzara/crossword-resolver | Crossword/main.cpp | #include <iostream>
#include <fstream>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <string>
#include <utility>
#include <algorithm>
#include <cassert>
#include "include/LetterRepository.h"
#include "include/InputFileReader.h"
#include "include/WordYielder.h"
#include <iterator>
std::vect... | TOOL | 0.93491 | 4.50957 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2020-04-07T15:29: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": "89dec1b4f6... |
e320b6f3-189e-4d04-86d8-06f907492063 | mnhtng/C-plus-Algorithm | C++/ThuatToanSinh/chiaTao.cpp | // ap dung sinh nhi phan de tim cac cach chia tao
#include <bits/stdc++.h>
using namespace std;
int sinh( int *xau, int *arr, int n, int &check ){
int i = n;
while( i >= 1 && xau[i] == 1 ){
xau[i] = 0;
i--;
}
if( i == 0 )
check = 0;
else
xau[i]++;
int sum1 =... | ALGO | 0.99995 | 3.828002 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2024-01-01T05:07:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6452ed8ef60... |
080ce6b4-d5aa-4902-8ae0-4ee6ec297773 | Ishwar-Sanap/DSA-Practice | Sliding Window/fruits_into_basket.cpp | #include <bits/stdc++.h>
using namespace std;
/*
Example 1:
Input: fruits = [1,2,1]
Output: 3
Explanation: We can pick from all 3 trees
Example 2:
Input: fruits = [1,2,3,2,2]
Output: 4
Explanation: We can pick from trees [2,3,2,2].
If we had started at the first tree, we would only pick from trees [1,2].
https://... | ALGO | 0.999805 | 5.975587 | {
"github_metadata": {
"branch": "main",
"commit_count": 72,
"repo_created_at": "2025-01-06T19:26: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": "fb660e1a6ff... |
0636786a-54cb-4a2a-9c7e-1a9bfac068c0 | corganhejijun/printer | ReadFile/stpReader/src/GccAna/GccAna_Circ2d2TanOn_5.cxx | // Created on: 1992-01-02
// Created by: <NAME>
// Copyright (c) 1992-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser ... | TOOL | 0.998642 | 4.760552 | {
"github_metadata": {
"branch": "master",
"commit_count": 131,
"repo_created_at": "2019-09-21T08:20:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "42089b33... |
487847b2-bca6-42fd-bdfb-abc3653bed00 | omnirom/android_bootable_recovery | applypatch/imgdiff.cpp | /*
* Copyright (C) 2009 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.940629 | 6.713579 | {
"github_metadata": {
"branch": "android-9.0",
"commit_count": 7644,
"repo_created_at": "2013-10-13T07:53:19.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2055,
"forks": 1670,
"issues": 0,
"pull_requests": 52
},
"file_meta": {
"content_id... |
b5c3efc9-e685-44f6-8e97-993f740db9f3 | convict-git/sport_coding | online_contest/www.codechef.com/CodeChef_May_Challenge_2020_Division_1/Binary_Land/main.cpp | #include <bits/stdc++.h> /*{{{*/
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#ifndef CONVICTION
#pragma GCC optimize ("Ofast")
#pragma GCC optimize ("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse... | ALGO | 0.999343 | 3.804315 | {
"github_metadata": {
"branch": "master",
"commit_count": 46,
"repo_created_at": "2019-10-15T14:17:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9374fa8e1... |
cfcaf99f-c194-4723-bf85-88325b2a9f14 | smhemel/CsAcademy-Online-Judge | CsAcademy - MinMax Subarray.cpp | //
// main.cpp
// CsAcademy - MinMax Subarray
//
// Created by <NAME> on 21/9/17.
// Copyright © 2017 <NAME>. All rights reserved.
//
#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
const int inf = 0x3f3f3f3f;
int main() {
int n,x;
cin >> n;
vector<int> elements;
ele... | ALGO | 0.999952 | 4.786162 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2018-11-04T09:08:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ac2f1a180a... |
f0eb9f80-6a2c-4f74-b1de-a737a5adcb30 | ishandutta2007/codeforces-b | benq/normal/591/C.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define mp make_pair
#define pb push_back
#define pii pair <int, int>
#define vi vector<int>
#define FOR(i, a, b) for (int i=a; i<b; i++)
#define F0R(i, a) for (int i=0; i<a; i++)
#define f first
#define s second
const int MOD = 1000000007;
cons... | ALGO | 0.999969 | 3.552869 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-04-11T01:05:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bcfc9c82eb30... |
376c3f3e-d15d-4203-abc5-d22a9317ee84 | Joslu/HandP | Main.ino |
/* Programa para monitorear el comportamiento del prototipo HackBerry (protesís de mano),
es el programa final que realicé.
El programa incluye un archivo .h donde coloqué las definiciones principales para su uso
Entre los más importantes son valores de desborde de los sensores, definición de estados.
E... | ALGO | 0.963941 | 5.308633 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2019-08-14T17:06: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": "455fa0ae4d... |
090332cf-8b66-4119-ab27-5b9388974a18 | shreyas-mante/Codeforces | icpc_merge.cpp | #include<bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{
ll t,n,i,k,temp,j;
cin>>t;
while(t--)
{
multiset<int> mst;
cin>>n;
vector<int> v[n];
for(i=0;i<n;i++)
{
cin>>k;
for(j=0;j<k;j++)
{
cin>>temp;
v[i].push_back(temp);
}
}
... | ALGO | 0.999966 | 3.160672 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2021-05-02T18:35:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6d6cc583d98... |
f1d90a03-f024-4ae2-b144-10e14b5e86b9 | Ark-Aak/code_repo | testlib/LMXOIR1/data_impacter.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define _rep(i,a,b) for(int i=(a);i>=(b);i--)
#define rep(i,a,b) for(int i=(a);i<=(b);i++)
const string stdFileName="impacter";//std文件名
const string probId="data";//题目Id
const int dataNum=40;//数据组数
//输入输出数据形如data_1.in/data_1.out
#define __OPTION_N... | TOOL | 0.905592 | 3.417529 | {
"github_metadata": {
"branch": "master",
"commit_count": 67,
"repo_created_at": "2023-10-09T08:43:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "99e68e9ee... |
7d915bd0-7002-4c18-a5e4-9ab468706f8b | oneskovic/CP-Problems | CodeForces/Round 277/D.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
#define ll long long
const ll mod = 1000000007;
// Gadan kod :P
ll count_dfs(int parent, int current_node, const vector<vector<int>>& adj, const vector<int>& value, const int max_value, const int max_difference, const int start_node)
{
ll... | ALGO | 0.999884 | 4.371242 | {
"github_metadata": {
"branch": "master",
"commit_count": 30,
"repo_created_at": "2020-10-02T07:21: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": "a7a5caa46... |
468ffcb6-3b4f-446a-86f2-733e9db04f58 | gaorong/AlgorithmTraining | exam/PrimePow.cpp | /********************************************************************************
** auth: gaorong
** mail: <EMAIL>
** date: 2017-03-10 13:52:27
** desc: 如果一个数字能表示为p^q(^表示幂运算)且p为一个素数,q为大于1的正整数就称这个数叫做超级素数幂。现在给出一个正整数n,如果n是一个超级素数幂需要找出对应的p,q。
****************************************************************************... | ALGO | 0.999905 | 3.922558 | {
"github_metadata": {
"branch": "master",
"commit_count": 29,
"repo_created_at": "2017-03-08T08:53: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": "09663cdb6... |
8ad3528d-17a3-4f04-a7b9-a4ea85f9f30a | El-Medonho/Contests | Geral/AtCoder/contests/abc320/c.cpp | // ⢸⣿⣿⣿⣿⠃⠄⢀⣴⡾⠃⠄⠄⠄⠄⠄⠈⠺⠟⠛⠛⠛⠛⠻⢿⣿⣿⣿⣿⣶⣤⡀⠄
// ⢸⣿⣿⣿⡟⢀⣴⣿⡿⠁⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⣸⣿⣿⣿⣿⣿⣿⣿⣷
// ⢸⣿⣿⠟⣴⣿⡿⡟⡼⢹⣷⢲⡶⣖⣾⣶⢄⠄⠄⠄⠄⠄⢀⣼⣿⢿⣿⣿⣿⣿⣿⣿⣿
// ⢸⣿⢫⣾⣿⡟⣾⡸⢠⡿⢳⡿⠍⣼⣿⢏⣿⣷⢄⡀⠄⢠⣾⢻⣿⣸⣿⣿⣿⣿⣿⣿⣿
// ⡿⣡⣿⣿⡟⡼⡁⠁⣰⠂⡾⠉⢨⣿⠃⣿⡿⠍⣾⣟⢤⣿⢇⣿⢇⣿⣿⢿⣿⣿⣿⣿⣿
// ⣱⣿⣿⡟⡐⣰⣧⡷⣿⣴⣧⣤⣼⣯⢸⡿⠁⣰⠟⢀⣼⠏⣲⠏⢸⣿⡟⣿⣿⣿⣿⣿⣿
// ⣿⣿⡟⠁⠄⠟⣁⠄⢡⣿⣿⣿⣿⣿⣿⣦⣼⢟⢀⡼⠃⡹⠃⡀⢸⡿⢸⣿⣿⣿⣿⣿⡟
// ⣿⣿⠃⠄⢀⣾⠋⠓⢰⣿⣿⣿⣿⣿⣿⠿⣿⣿⣾⣅⢔⣕⡇⡇⡼⢁⣿⣿⣿⣿⣿⣿⢣
// ⣿⡟⠄⠄⣾⣇⠷⣢⣿⣿⣿⣿⣿⣿⣿⣭⣀⡈⠙⢿⣿... | ALGO | 0.999734 | 4.44099 | {
"github_metadata": {
"branch": "main",
"commit_count": 34,
"repo_created_at": "2022-09-03T14:12:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "99564ac96ef... |
71cba553-6899-4ed3-9ace-c3c1bdd58f64 | FalseF/Problem-Solving | UVa/13054 Hippo Circus.cpp | /*######## IN THE NAME OF AintAH ##########*/
#pragma GCC diagnostic ignored "-Wunused-variable"
#pragma GCC diagnostic ignored "-Wunused-parameter"
#include<bits/stdc++.h>
using namespace std;
#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
#pragma GCC diagnostic ignored "-Wformat"
#define ll long lon... | ALGO | 0.999921 | 3.143933 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2021-09-06T11:47:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "40c118bd4... |
6b22a05b-248d-4d8e-82b7-848e13027744 | rohith788/Leetcode | Amazon/array/atoi.cpp | ass Solution {
public:
int myAtoi(string str) {
int sign = 1, i = 0;
long num = 0;
while(i < str.size() and str[i] == ' ')
{
i++;
}
if(str[i] == '-')
{
sig... | ALGO | 0.987578 | 4.25866 | {
"github_metadata": {
"branch": "master",
"commit_count": 88,
"repo_created_at": "2019-12-18T23:44: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": "ec6b60993... |
de568ca8-9e30-4b22-9a71-a36747c9c4f3 | 483759/AlgorithmSolutionStorage | C++/AlgorithmSolutionStorage/AlgorithmSeminar/17780.cpp | #include <stdio.h>
#define MAXN 13
#define MAXK 11
int x[MAXK]; //행
int y[MAXK]; //열
int d[MAXK]; //방향
int up[MAXK]; //위에 누구?
int down[MAXK]; //아래 누구?
int a[MAXN][MAXN]; //체스판 정보
int p[MAXN][MAXN]; //어떤 말이 가장 밑에 있는지
int n, k;
int dx[] = { 0, 0,0,-1,1 };
int dy[] = { 0, 1,-1,0,0 };
int rd[] = { 0,2,1,4,3 };
void... | ALGO | 0.999929 | 3.719149 | {
"github_metadata": {
"branch": "master",
"commit_count": 64,
"repo_created_at": "2019-04-15T11:53:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2d633e4af... |
3c66bea1-62f3-4a24-ba25-2b9f63284004 | geemaple/leetcode | leetcode/922.sort-array-by-parity-ii.cpp | // Tag: Array, Two Pointers, Sorting
// Time: O(N)
// Space: O(1)
// Ref: -
// Note: -
// Given an array of integers nums, half of the integers in nums are odd, and the other half are even.
// Sort the array so that whenever nums[i] is odd, i is odd, and whenever nums[i] is even, i is even.
// Return any answe... | ALGO | 0.999994 | 5.764886 | {
"github_metadata": {
"branch": "master",
"commit_count": 1233,
"repo_created_at": "2016-03-30T04:12:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 197,
"forks": 22,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
"content_id": "f421... |
49287460-2aad-45a5-80be-aaed33337b37 | thehs29/TTUD | divide_and_conquer/C_EKO.cpp | #include <bits/stdc++.h>
using namespace std;
long long N, M;
int a[1000007];
long long m = 0;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cin >> N >> M;
for(int i = 0; i < N; i++) {
cin >> a[i];
if(a[i] > m)
m = a[i];
}
long long l = 1, h = m - ... | ALGO | 0.999999 | 4.002195 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2022-06-24T15:22: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": "0d8eb5ddcda... |
39f8fdbc-5bc4-4937-956c-01541a9154c3 | CCatherineeee/DataStructureDesign | 8种排序算法的比较案例/Sort.cpp | #include<iostream>
#include<ctime>
#include"Sort.h"
using namespace std;
// 建立数据表
void CreateData(int n, long long*& Data)
{
srand((unsigned)time(NULL));
for (int i = 0; i < n; i++)
Data[i] = rand();
//for (int i = 0; i < n; i++)
//cout << Data[i] << ' ';
//cout << endl;
}
void show(int n, long long*& Data)
{... | ALGO | 0.999782 | 4.163006 | {
"github_metadata": {
"branch": "main",
"commit_count": 22,
"repo_created_at": "2020-12-19T10:19:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bce63e643b9... |
13f3fec7-7890-4b0e-afd2-f6bc2fc799e8 | cxlove/ACM_ICPC | Online_judge/HDU/hdoj_1556.cpp | #include<iostream>
#include<cstdio>
#include<map>
#include<cstring>
#include<cmath>
#include<vector>
#include<algorithm>
#include<set>
#include<string>
#include<queue>
#define inf 1600005
#define M 40
#define N 100000
#define maxn 300005
#define eps 1e-7
#define zero(a) fabs(a)<... | ALGO | 0.999288 | 3.340302 | {
"github_metadata": {
"branch": "master",
"commit_count": 112,
"repo_created_at": "2013-03-28T06:23:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3293ac89... |
faf8a5ef-2a31-4676-8a7b-7189991babf6 | acuoci/OpenSMOKE | OpenSMOKE_Applications/src/OpenSMOKE_KinPP_Splitting/src/kpp/OpenSMOKE_KPP_BlockMatrixNetwork.cpp | /***************************************************************************
* Copyright (C) 2011 by <NAME> *
* <EMAIL> *
* *
* This program is free software; you can redistribute it... | ALGO | 0.996737 | 4.293663 | {
"github_metadata": {
"branch": "master",
"commit_count": 42,
"repo_created_at": "2014-02-19T06:12:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 21,
"forks": 6,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "da2c4267... |
9238d5f4-f5dd-42a8-9477-86f87cee8bf3 | Yawn-Sean/Daily_CF_Problems | daily_problems/2024/10/1028/personal_submission/cf1043e_yakultgo.cpp | #include <bits/stdc++.h>
#define endl '\n'
using namespace std;
#define int long long
void solve() {
int n, m;
cin >> n >> m;
struct node {
int f, s;
int id;
bool operator<(const node &x) const {
return f - s < x.f - x.s;
}
};
vector<node> a(n);
vector... | ALGO | 0.999948 | 3.74011 | {
"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": "19cc... |
0cfbc0be-f406-47da-8869-45147c41bade | Wira07/Semester_1 | modul 1 - 10/Modul 07/PostestCobaCoba/MencariKarakterDenganSorting.cpp | #include <iostream>
#include <string.h>
#include <stdlib.h>
#include <conio.h>
#include <stdio.h>
using namespace std;
int main(){
char name[10][10], temp[10], namaCari[10];
int found, R, j, data, n;
data = 0;
cout <<"\n * PROGRAM SEARCHING DENGAN METODE BINARY SEARCH * \n";
cout <<"\t PADA KEHIDUPAN SEHARI HARI... | ALGO | 0.999795 | 3.371312 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2023-05-15T22:49: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": "2d78a4b495... |
164d21f1-2753-4e56-b82d-c976669bb078 | greatzero728/acade.studio | codeforces/(484 C Strange Sorting)/(484 C Strange Sorting).cpp | #include <bits/stdc++.h>
using namespace std;
vector<int> mul(vector<int> &a, vector<int> &b) {
int n = a.size();
vector<int> ans(n);
for (int i = 0; i < n; i++) ans[i] = a[b[i]];
return ans;
}
vector<int> qpow(vector<int> a, int b) {
int n = a.size();
vector<int> ans(n);
iota(ans.begin()... | ALGO | 0.999972 | 4.515666 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2024-09-19T07:41:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c79ceef18a32... |
c3d84a1a-c93f-4cb1-8570-8e5de2bbf992 | Ricki23/Programmms | OOPS_LAB_Q3.cpp | #include<iostream>
using namespace std;
class timer
{
int mins;
int sec;
int hrs;
public:
void gets()
{
int minutes,seconds,houres;
cout<<"Enter the time in mins:"<<endl;
cin>>minutes;
cout<<"Enter the time in seconds:"<<endl;
cin>>seconds;
cout<<"... | TEST | 0.910784 | 3.345323 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2022-10-25T14:10:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "927721220322... |
46a59786-309a-4891-bb84-11de5efb7751 | Anubhav12345678/competitive-programming | PERFORMSTRINGSHIFTSVVVVIMPLEETCODE.cpp |
/*
You are given a string s containing lowercase English letters, and a matrix shift, where shift[i] = [direction, amount]:
direction can be 0 (for left shift) or 1 (for right shift).
amount is the amount by which string s is to be shifted.
A left shift by 1 means remove the first character of s and append it to t... | ALGO | 0.999952 | 6.059938 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-11-18T08:04:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6dec60482a... |
f94d277d-6892-4ef9-89e4-8f346b0556a0 | SamJ2018/LeetCode | LeetCode题解/402 Remove K Digits.cpp | /*
Given a non-negative integer num represented as a string, remove k digits from the number so that the new number is the smallest possible.
Note:
The length of num is less than 10002 and will be ≥ k.
The given num does not contain any leading zero.
Example 1:
Input: num = "1432219", k = 3
Output: "1219"
Explanation... | ALGO | 0.999886 | 5.768482 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2019-04-01T23:26: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": "6c370b4bd8... |
14f36277-2b58-4674-9edf-02256759dfe2 | raziahmadansari/CP2_CIPHERSCHOOLS | Day7/detect-cycle-in-linked-list.cpp | #include <iostream>
#include <windows.h>
using namespace std;
class Node
{
public:
int val;
Node* next;
Node(int val = 0)
{
this->val = val;
this->next = nullptr;
}
};
void insert(Node*& head, int val)
{
Node* node = new Node(val);
node->next = head;
head = node;
... | ALGO | 0.999575 | 5.074097 | {
"github_metadata": {
"branch": "master",
"commit_count": 78,
"repo_created_at": "2020-08-11T06:24: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": "3d2d89e8f... |
b5dbd9c9-4c7e-4b66-8332-752bded0fc2b | LLNL/RAJAPerf | src/apps/PRESSURE.hpp | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
// Copyright (c) 2017-25, Lawrence Livermore National Security, LLC
// and RAJA Performance Suite project contributors.
// See the RAJAPerf/LICENSE file for details.
//
// SPDX-License-Identifier: (BSD-3-Clause)
//~~~~~~~~~~~~~~~~~~~~~~~~~~... | ALGO | 0.957944 | 5.995693 | {
"github_metadata": {
"branch": "develop",
"commit_count": 3087,
"repo_created_at": "2017-09-25T20:18:46.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 118,
"forks": 42,
"issues": 45,
"pull_requests": 15
},
"file_meta": {
"content_id": "37... |
0a85ffe2-6912-49ae-b0af-7d383c77561f | davisking/dlib | dlib/svm/kcentroid.h | // Copyright (C) 2008 <NAME> (<EMAIL>)
// License: Boost Software License See LICENSE.txt for the full license.
#ifndef DLIB_KCENTROId_
#define DLIB_KCENTROId_
#include <vector>
#include "kcentroid_abstract.h"
#include "../matrix.h"
#include "function.h"
#include "../std_allocator.h"
namespace dlib
{
// --------... | ALGO | 0.913087 | 6.971648 | {
"github_metadata": {
"branch": "master",
"commit_count": 8325,
"repo_created_at": "2014-01-29T00:45:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 14068,
"forks": 3436,
"issues": 41,
"pull_requests": 5
},
"file_meta": {
"content_id": ... |
0c994577-6b84-4f5e-89d8-9dd0568c5cfd | katzhang/c--practices | mit.6.096.assignment3.5.cpp | #include <iostream>
#include "mit.6.096.assignment3.4.cpp"
using namespace std;
class Polygon {
private:
PointArray points;
static int n;
public:
Polygon(const Point pts[], const int size) : points(pts, size) {
n++;
};
Polygon(const PointArray& pv) : points(pv) {
n++;
};
~PointArray() {
delete points;
... | ALGO | 0.986048 | 5.078276 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2015-08-31T02:13:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "797398ba9... |
aaa6b688-0d2a-4fb2-ad84-efa755cf640f | bigMasterWang/algorithm | MergeKLink.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
#include<vector>
#include<queue>
using namespace s... | ALGO | 0.999954 | 6.048357 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2022-05-16T03:13: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": "885da8d367d5... |
a0761bb2-787b-4064-a9d2-fcdc8a9f87f7 | saadbutt27/OS-Project | all.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
using namespace std;
// Process structure to store process details
struct Process {
char name;
int arrival_time;
int burst_time;
int waiting_time;
int turnaround_time;
};
// Function to calculate waiting time and turnarou... | ALGO | 0.999989 | 5.001418 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-02-22T19:49: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": "936886796ec8... |
65aa44d1-067b-4201-aff9-bdb7d865e743 | RyanL123/Competitive-Programming | Codeforces/1362B.cpp | #include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> pii;
typedef vector<pair<int, int>> vii;
typedef vector<int> vi;
typedef long double ld;
typedef long long ll;
typedef unsigned long long ull;
#define eb emplace_back
#define pb push_back
#define mp make_pair
#define srt(x) sort(x.begin(), x.end())
#... | ALGO | 0.999928 | 4.378901 | {
"github_metadata": {
"branch": "master",
"commit_count": 616,
"repo_created_at": "2019-04-09T21:00:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ce9d018b... |
587c7623-65bf-420d-8c0e-b1be1f25792f | shoryaagrawal553/DSA | 2D_rotate_image(matrix).cpp | /*leetcode problem 48 Rotate Image
You are given an n x n 2D matrix representing an image, rotate the image by 90 degrees (clockwise).
You have to rotate the image in-place, which means you have to modify the input 2D matrix directly.
DO NOT allocate another 2D matrix and do the rotation.
Example 1:
Input: matrix = [[... | ALGO | 0.999967 | 6.529611 | {
"github_metadata": {
"branch": "main",
"commit_count": 155,
"repo_created_at": "2025-04-09T18:09: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": "a74edbd8a4... |
5eb82591-bb61-4955-a01b-41d1fffdc3aa | elrob/Cpp_practice_tests | mock_shrink/main.cpp | #include <iostream>
using namespace std;
#include "shrink.h"
int main() {
const char* dictionary[] = { "iguana", "aardvark", "swimming",
"Zambezi", "river", "rescue", "" };
int word;
word = lookup("iguana", dictionary);
cout << "iguana: " << word << endl;
word = lookup("aardvark", dictionary);
... | TOOL | 0.961367 | 3.615728 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2013-12-08T21:59: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": "17dea8205e... |
2a04746a-b6c8-4ca3-abff-cec8a8f0b96d | 2515299122/algorithm_study | programmercarl/tree/no68_105.cpp | //给定两个整数数组 preorder 和 inorder ,其中 preorder 是二叉树的先序遍历, inorder 是同一棵树的中序遍历,请构造二叉树并
//返回其根节点。
//
//
//
// 示例 1:
//
//
//输入: preorder = [3,9,20,15,7], inorder = [9,3,15,20,7]
//输出: [3,9,20,null,null,15,7]
//
//
// 示例 2:
//
//
//输入: preorder = [-1], inorder = [-1]
//输出: [-1]
//
//
//
//
// 提示:
//
//
// 1 <= preorder.length ... | ALGO | 0.999976 | 6.976552 | {
"github_metadata": {
"branch": "main",
"commit_count": 98,
"repo_created_at": "2024-04-02T01:39:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "aaef7f51801... |
9d59cf2f-8aa2-4936-92a8-0c46826fc12a | Shikhar03Stark/Code-Dump | CodeForces/Practice/D_Co-growing_Sequence.cpp | // Author: <NAME> (Shikhar03Stark)
#include <bits/stdc++.h>
#define FASTIO ios_base::sync_with_stdio(false);cin.tie(NULL);
#define nl '\n'
#define ll long long int
#define ull unsigned long long int
#define dev(x) cerr << #x << " " << x << endl
using namespace std;
void pre(){
return;
}
void solve(){
int... | ALGO | 0.999979 | 4.362462 | {
"github_metadata": {
"branch": "master",
"commit_count": 73,
"repo_created_at": "2022-01-08T13:20: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": "6dd2fd303... |
9ce1d49f-5f7d-4144-80ad-1fed80818acf | jimi567/Algorithm | 프로그래머스/카카오2021/1 - 신규아이디추천.cpp | #include <string>
#include <vector>
#include<iostream>
using namespace std;
bool isNum(char c){
return c >= '0' && c <= '9';
}
string solution(string new_id) {
string answer = new_id;
string tmp = "";
for(int i=0;i<answer.size();i++){
if(isupper(answer[i])) tmp += tolower(answer[i]);
el... | ALGO | 0.99946 | 4.791073 | {
"github_metadata": {
"branch": "main",
"commit_count": 332,
"repo_created_at": "2022-12-23T09:45:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "4a7eefad71... |
df34b599-9662-4d1b-8c9c-66272cd434f8 | l-gllme/cpp_pool_42 | 01/ex04/main.cpp | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.cpp :+: :+: :+: ... | TOOL | 0.901963 | 4.339693 | {
"github_metadata": {
"branch": "master",
"commit_count": 131,
"repo_created_at": "2022-06-13T12:54:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "678dc484... |
4a1bf53d-0098-4f7c-b2bf-6ddf3222ec78 | kobortor/Competitive-Programming | cf-gym/ECNA-2016/H.cpp | #include "bits/stdc++.h"
#define ll long long
using namespace std;
const int MAXN = 110;
int dr[4] = {-1, 0, 1, 0};
int dc[4] = {0, 1, 0, -1};
int n, m;
string a[MAXN];
int cnt[MAXN][MAXN];
int ty[MAXN][MAXN];
int vis[MAXN][MAXN];
int vals[MAXN][MAXN];
int good(int r, int c) {
return (r >= 0 && c >= 0 && r < n &... | ALGO | 0.999754 | 3.448739 | {
"github_metadata": {
"branch": "master",
"commit_count": 617,
"repo_created_at": "2017-07-02T02:41:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 10,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "491dd82... |
43541a21-df28-40e9-9d97-49a1fb5c8c32 | ishandutta2007/codeforces-g | greencis/normal/1446/C.cpp | #include <bits/stdc++.h>
#define all(x) begin(x), end(x)
#define rall(x) rbegin(x), rend(x)
using namespace std;
using ld = long double;
using ll = int64_t;
using pii = pair<int, int>;
using ull = uint64_t;
struct entry {
int go[2], cnt;
} e[6206006];
int solve(int v) {
if (e[v].cnt <= 1) return 0;
int l ... | ALGO | 0.999786 | 3.865052 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:55:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c96271f3d99b... |
4c226540-a398-4234-a3be-cbaa68f39318 | 33sakib33/Codeforces | codeforces/1407/B.cpp | #include<bits/stdc++.h>
using namespace std;
#define mod 1000000009
#define cin1(x) cin>>x
#define cin2(x,y) cin>>x>>y
#define cin3(x,y,z) cin>>x>>y>>z
#define ll long long
#define mp make_pair
#define pb push_back
#define nl printf("\n")
#define ff first
#define ss second
#define set0(a) memset ((a), 0 , sizeof(a))
#d... | ALGO | 0.999965 | 3.23588 | {
"github_metadata": {
"branch": "master",
"commit_count": 163,
"repo_created_at": "2020-12-20T20:03:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "00361572... |
d1d451e4-c6f2-4c9c-9962-48e024d1e310 | KhushiJain5519/LeetCode-Practise | Clown a Linked List Using Random Pointers.cpp | Step 1.)Create Exact Duplicate Nodes:
1.1Iterate through the original linked list.
1.2 For each node in the original linked list, create a new node with the same value.
1.3 During this process, maintain a mapping between the original nodes and their corresponding duplicate nodes using a hashmap. This hashmap will... | ALGO | 0.999848 | 5.931821 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2024-02-01T09:41: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": "1f1dbf9f704c... |
80f4152c-f231-45d9-9831-fb98dc1c76be | dumpinfo/DNNCudatest | 07/MLFN/REGRS_CJ.CPP | // Copyright (c) 1994 <NAME>, Inc. All rights reserved.
// Reproduction or translation of this work beyond that permitted in
// section 117 of the 1976 United States Copyright Act without the
// express written permission of the copyright owner is unlawful.
// Requests for further information should be addressed to th... | ALGO | 0.999884 | 5.626136 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2020-12-24T20:12: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": "492eaa8a53... |
e3bb3b07-1c0c-402a-aec0-a094e393ba45 | Mrhuangyi/leetcode-Solutions | Cpp/Medium/36. 有效的数独.cpp | /*
判断一个 9x9 的数独是否有效。只需要根据以下规则,验证已经填入的数字是否有效即可。
数字 1-9 在每一行只能出现一次。
数字 1-9 在每一列只能出现一次。
数字 1-9 在每一个以粗实线分隔的 3x3 宫内只能出现一次。
上图是一个部分填充的有效的数独。
数独部分空格内已填入了数字,空白格用 '.' 表示。
示例 1:
输入:
[
["5","3",".",".","7",".",".",".","."],
["6",".",".","1","9","5",".",".","."],
[".","9","8",".",".",".",".","6","."],
["8",".",".",".... | ALGO | 0.998963 | 6.763754 | {
"github_metadata": {
"branch": "master",
"commit_count": 744,
"repo_created_at": "2018-04-18T11:21:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "500f35c4... |
5bc9b7b7-4c7c-4448-b026-714dc8b1ad93 | HarshGupta02/Data-Structure-And-Algorithm | BackTracking/Letter Combinations of a Phone Number.cpp | class Solution {
public:
vector<vector<char>>v;
void precompute(){
v.resize(10);
char ch = 'a';
for(int i = 2; i <= 9; i ++){
if(i == 7 or i == 9){
v[i].push_back(ch); v[i].push_back(ch + 1);
v[i].push_back(ch + 2); v[i].push_back(ch... | ALGO | 0.999811 | 6.213933 | {
"github_metadata": {
"branch": "master",
"commit_count": 666,
"repo_created_at": "2022-06-17T05:43: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": "a54fca8b... |
3f38944e-5fc5-4e51-9721-b08e5fdbf809 | canidae/saiph | src/Analyzers/Fight.cpp | #include "Analyzers/Fight.h"
#include <stdlib.h>
#include "Debug.h"
#include "EventBus.h"
#include "Inventory.h"
#include "Monster.h"
#include "Saiph.h"
#include "World.h"
#include "Actions/Fight.h"
#include "Actions/Move.h"
#include "Actions/Throw.h"
#include "Actions/Search.h"
#include "Data/Attack.h"
#include "Data... | ALGO | 0.989397 | 3.81302 | {
"github_metadata": {
"branch": "master",
"commit_count": 2001,
"repo_created_at": "2009-02-03T17:30:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 37,
"forks": 16,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "09d95... |
4121d521-aa71-4cf7-bb36-2ef963bfb97a | yyhaos/Competitions | 2019年北京师范大学校队排位赛/2019年北京师范大学校队排位赛(一)/e.cpp | //Problem Web:
#include<bits/stdc++.h>
#include<ext/rope>
#include<iostream>
#include<stack>
#include<vector>
#include<queue>
#include<stdio.h>
#include<string.h>
#include<math.h>
using namespace std;
#define ll long long
#define lowbit(x) (x&-x)
#define rep(i,x,y) for(ll i=x;i<=y;i++)
#define crep(i,x,y) for(ll i=x;i... | ALGO | 0.999644 | 3.375364 | {
"github_metadata": {
"branch": "master",
"commit_count": 97,
"repo_created_at": "2018-04-08T11:42:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "68b0c55b1... |
941ec408-b103-44e1-bfc5-96e1f56e7d11 | Jashans254/DSA_cpp | LinkedList/lec4_5.cpp | //Deletion at start and end
#include<iostream>
using namespace std;
class Node
{
public:
int data;
Node *prev;
Node *next;
Node(int value)
{
data = value;
prev = NULL;
next = NULL;
}
};
Node * CreateDLL(int arr[] , int index , int size , Node *back)
{
if(index ... | ALGO | 0.999951 | 4.98963 | {
"github_metadata": {
"branch": "main",
"commit_count": 38,
"repo_created_at": "2024-02-01T14:28:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1cd6d6158df... |
66dab453-0faa-4e92-8e50-b07768c62344 | fixstars/m3bp | src/tasks/value_sort/value_sort_logical_task.hpp | /*
* Copyright 2016 Fixstars Corporation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or ... | ALGO | 0.953066 | 7.019085 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2016-04-01T06:02:59.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 18,
"forks": 5,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "2620fcac3... |
f2a9f02d-ca43-43ec-9346-b583ae6ad943 | rodrigozhou/algo | math/miller-rabin.cpp | /**
* Miller-Rabin primality test
*
* This implementation is deterministic for n < 3,825,123,056,546,413,051
*/
long long multmod(long long a, long long b, long long mod) {
long long ret = 0;
int msb = 64 - __builtin_clzll(b);
for (int bit = msb-1; bit >= 0; bit--) {
ret <<= 1;
if (ret ... | ALGO | 0.999805 | 4.983892 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2016-04-05T13:14:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "43399b7aa... |
747c8f43-7c42-4c34-98a0-fb51257badd5 | HarshMahalwar/C-Learning | hashcode.cpp | #include <bits/stdc++.h>
#define ll long long int
#define qw priority_queue<int>
#define qwd priority_queue<int, vector<int>, greater<int>>
#define pp pair<int, int>
#define func \
ios_base::sync_with_stdio(false); \
cin.tie(NULL);
#define test \
int t = 1; \
while (t--)
usi... | ALGO | 0.997428 | 4.109051 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2022-04-21T09:19: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": "c86bc2dd7a80... |
41c78af8-abc9-4936-9761-f5758a1e75b1 | Thasin-Sheikh/Codeforces-Solutions | 1771B .cpp | ///*<NAME>***///
///**Author thasin_sheikh**///
#include<bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
template<class T> using myset=tree<T,null_type,less_equal<T>,rb_tree_tag,tree_order_statistics_node_update>;
#define MAX ... | ALGO | 0.999929 | 3.678151 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2023-03-27T10:45: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": "c68ea37de... |
9716bd7a-bb5d-4a1d-b443-3f16da92f0f2 | Manansodhi/Data-Structures-and-Algorithms | 20. Trees/26. Populating Next Right Pointers in Each Node II (117).cpp | /*
117. Populating Next Right Pointers in Each Node II
Given a binary tree
struct Node {
int val;
Node *left;
Node *right;
Node *next;
}
Populate each next pointer to point to its next right node. If there is no next right node,
the next pointer should be set to NULL.
Initially, all next pointers are set to ... | ALGO | 0.999956 | 5.76743 | {
"github_metadata": {
"branch": "main",
"commit_count": 740,
"repo_created_at": "2022-01-07T15:25:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ddb9f50cce... |
b493bf3a-376a-4e58-bd74-5e412905b334 | rohakdebnath/CodeForces-Solutions | 1992D.cpp | #include <bits/stdc++.h>
using namespace std;
using i64 = long long;
const i64 inf = 2e18;
void solve() {
i64 n, m, k; cin >> n >> m >> k;
string s; cin >> s; s = 'L' + s + 'L';
n += 2;
vector<i64> dp (n, inf); //dp[i] = min water crosses required to cross ith segment
dp[0] = 0;
for (i64 i = 0... | ALGO | 0.999937 | 4.068892 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2024-07-17T12:11: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": "abfe49786d... |
d9a52a53-af63-4177-8952-5cf187b01593 | serapann/polygon_coverage_ros2 | polygon_coverage_planners/include/polygon_coverage_planners/graphs/gtspp_product_graph.h | /*
* polygon_coverage_planning implements algorithms for coverage planning in
* general polygons with holes. Copyright (C) 2019, <NAME>, Autonomous
* Systems Lab, ETH Zürich
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published... | ALGO | 0.982477 | 3.280157 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2023-11-29T15:48:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "078bbe4f1c... |
6816a038-408e-4de0-b331-2b235a67a609 | prathu2601/100-days-of-code | Day 44/Arrays Sum.cpp | //Link to question
//"https://codeforces.com/problemset/problem/1408/B"
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define For(i, a, b) for(ll i=a; i<(b); i++)
#define F0r(i, a) for(ll i=0; i<(a); i++)
#define Forr(i, a, b) for(ll i = (b)-1; i >= a; i--)
#define F0rr(i, a) for(ll i = (a)-1; i >... | ALGO | 0.999921 | 4.122503 | {
"github_metadata": {
"branch": "master",
"commit_count": 159,
"repo_created_at": "2021-07-27T18:16: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": "0b56775e... |
0dff3992-1937-45c3-83ed-73249810deed | organicmaps/organicmaps | 3party/osrm/osrm-backend/third_party/libosmium/include/osmium/area/detail/segment_list.hpp | #ifndef OSMIUM_AREA_DETAIL_SEGMENT_LIST_HPP
#define OSMIUM_AREA_DETAIL_SEGMENT_LIST_HPP
/*
This file is part of Osmium (http://osmcode.org/libosmium).
Copyright 2013-2015 <NAME> <<EMAIL>> and others (see README).
Boost Software License - Version 1.0 - August 17th, 2003
Permission is hereby granted, free of charge,... | TOOL | 0.943095 | 6.69087 | {
"github_metadata": {
"branch": "master",
"commit_count": 42613,
"repo_created_at": "2020-12-27T19:02:26.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 11487,
"forks": 1128,
"issues": 2796,
"pull_requests": 182
},
"file_meta": {
"content_i... |
3ebd6ffc-d307-4376-a4f1-6a283e4a7fc5 | PacoEdwin/C | GraphTheory/Pathbgep/pathbgep.cpp | /*//#include <iostream>
#include<fstream>
#include<vector>
#include<string>
#include<algorithm>
using namespace std;
int n;
struct weight
{
struct data
{
int key = INT_MAX;
int pos;
int marked;
data* ancestor=NULL;
};
data* link = new data;
int w;
};//
vector<vector<weight*>> graph;
vector<weight::data*> v... | ALGO | 0.999988 | 3.663993 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2018-10-22T19:57:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1321fc859... |
328ac8c8-5558-4f3b-96b1-b28cf35268d6 | StevensDeptECE/CPE593 | old/session01AnalysisOfAlgorithms/pseudocodeforcomplexity.cc | \//pseudocode for complexity
for i = 1 to n //O(n)
{
}
for i= 5 to n-20 //O(n)
{
}
for (int i = 0; i < n; i+= 7) { //O(n)
}
for (int i = 8; i < 2*n; i += n/2) { //O(1)
}
//O(n^2)
for (int i = 0; i < n; i++) {//O(n)
for (int j = 1; j < n; j += 5) { //O(n)
}
}
//O(n)
for (int i = 0; i < n; i+= 4) {//O(n)
... | ALGO | 0.977575 | 3.972531 | {
"github_metadata": {
"branch": "master",
"commit_count": 238,
"repo_created_at": "2017-09-05T19:22:17.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 62,
"forks": 57,
"issues": 1,
"pull_requests": 1
},
"file_meta": {
"content_id": "1645d71... |
795fa2b5-8858-42e4-b093-2786d19b8626 | austin880625/problem_solving | Others/Algorithms/kruskal2.cpp | #include<iostream>
#include<algorithm>
#include<vector>
#include<math.h>
#include<cstring>
#include<stdio.h>
using namespace std;
const int MAX_N=1010;
struct Edge{
int from,to;
double w;
bool operator < (const Edge& rhs) const{
return w<rhs.w;
}
};
vector<Edge> edges;
vector<int> G[MAX_N],Gt[MAX_N];
vector<int... | ALGO | 0.999871 | 4.119411 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2015-09-29T21:54: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": "5942d176b... |
5c549d5c-4fe3-452d-85dd-b543a0858230 | moukthika-marthu/AP21110010917-CS306_L | Week6-Lab-excercise/Q2.cpp | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
//E'=A
//T'=B
int i = 0, top = 0;
char stack[20], ip[20];
void push(char c) {
if (top >= 20)
printf("Stack Overflow");
else
stack[top++] = c;
}
void pop(void) {
if (top < 0)
printf("Stack underflow");
else
top--... | ALGO | 0.999612 | 3.070294 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2023-08-13T16:36:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "32b3336bdcd... |
1c1d26f5-cff0-46a1-8cf5-a87812b53222 | E3SM-Project/E3SM | components/homme/src/share/cxx/utilities/BfbUtils.hpp | #ifndef HOMME_BFB_UTILS_HPP
#define HOMME_BFB_UTILS_HPP
#include "PackTraits.hpp"
#include <Kokkos_Core.hpp>
namespace Homme
{
// Set the least significant n bits of the fraction to 0. Use this for
// BFB-testing between GPU and host. Zero the n least significant bits of y in
// y = pow(x, e),
// for example.
// ... | ALGO | 0.981543 | 7.203976 | {
"github_metadata": {
"branch": "master",
"commit_count": 64504,
"repo_created_at": "2014-07-03T19:04:08.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 381,
"forks": 425,
"issues": 535,
"pull_requests": 54
},
"file_meta": {
"content_id": "... |
52dc39e9-cccb-4734-8707-1777e7788a5c | bvquoc/CP-Trainning-2021 | 0 - Contest 2020/VNOI Online 2021/z-Contestants/KH-12 Truong Tran Nhat Huy/socks.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
signed main() {
ios_base::sync_with_stdio(0); cin.tie(0);
freopen("SOCKS.INP", "r", stdin);
freopen("SOCKS.OUT", "w", stdout);
int n, q;
cin >> n >> q;
set <int> S; S.clear();
for (int i = 1; i <= n; ++i) {
int j;
cin >> j;
if (j) S.ins... | ALGO | 0.998876 | 3.739186 | {
"github_metadata": {
"branch": "master",
"commit_count": 611,
"repo_created_at": "2020-06-03T07:47:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b0ef4681... |
bd43215e-b8d0-4685-915f-22b20fd9dbf4 | DevBaweja/Competitive-Coding | Leetcode/138. Copy List with Random Pointer.cpp | #include <bits/stdc++.h>
using namespace std;
class Node
{
public:
int val;
Node *next;
Node *random;
Node(int _val)
{
val = _val;
next = NULL;
random = NULL;
}
};
Node *copyRandomList(Node *head)
{
if (!head)
return head;
unordered_map<Node *, Node *> ... | ALGO | 0.999763 | 5.40601 | {
"github_metadata": {
"branch": "master",
"commit_count": 76,
"repo_created_at": "2020-10-25T07:57: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": "94d8c487c... |
92feba5f-ffeb-41a9-827a-611e3ae134cd | SakolB/PracticeProgramSolving | twoSum.cpp | #include <iostream>
#include <algorithm>
#include <map>
#include <vector>
using namespace std;
int search(int [], int, int);
int main()
{
int n, target;
map<int, vector<int> > position;
cin >> n >> target;
//Put the element in a map
//with the value of a vector of its position
//This is for ins... | ALGO | 0.999972 | 3.830915 | {
"github_metadata": {
"branch": "main",
"commit_count": 22,
"repo_created_at": "2023-05-29T09:21: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": "fd024a58c69... |
35ec76b7-98aa-4edb-ba17-da5531e41999 | omertr616/Coding-and-Algorithms-for-Memories-Project | SCS_two_sequences.cpp | #include <iostream>
#include <string>
#include <queue>
#include <unordered_map>
using namespace std;
struct PairHash {
size_t operator()(const pair<int, int>& p) const {
// return hash<int>()(p.first) ^ (hash<int>()(p.second) << 16);
return static_cast<size_t>(p.first) | (static_cast<size_t>(p.se... | ALGO | 0.999998 | 4.330045 | {
"github_metadata": {
"branch": "main",
"commit_count": 38,
"repo_created_at": "2025-04-03T13:54: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": "54bd220ef85... |
d3d473f0-4053-44cb-8f5d-4b54f96e9ac4 | face4/AtCoder | ABC/113/D_vertical.cpp | #include<iostream>
#include<cstring>
using namespace std;
const int mod = 1000000007;
int main(){
int h, w, x;
cin >> h >> w >> x;
if(w == 1){
cout << 1 << endl;
return 0;
}
int dp[h+1][w];
memset(dp, 0, sizeof(dp));
dp[0][0] = 1;
for(int i = 1; i <= h; i++){
... | ALGO | 0.999969 | 3.930187 | {
"github_metadata": {
"branch": "master",
"commit_count": 96,
"repo_created_at": "2018-06-15T14:41: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": "bac3ea67b... |
7f704ee1-e054-4671-8527-90bd7c184f55 | allenwhc/Leetcode | c++/UniqueBinarySearchTrees/UniqueBinarySearchTrees/main.cpp | /*
* Unique Binary Search Tree I & II
* Description: Implementation of Catalan Number
* Cn=sum(Ci*Cn-i), i=0,1,...,n; n=1,2,...
* Last Modified: 7/15/2015
*/
#include "BinaryTree.h"
#include <vector>
class Solution{
public:
//Unique Binary Search Tree I, return total number of unique BSTs
int numTrees(int n){
... | ALGO | 0.999883 | 6.010717 | {
"github_metadata": {
"branch": "master",
"commit_count": 60,
"repo_created_at": "2015-08-24T18:40:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "19d8803f8... |
ddbd8eaf-fc45-4204-b90f-fbec3c86c5e5 | yugankpal/Do-Not-Click-Here | 1721-swapping-nodes-in-a-linked-list/1721-swapping-nodes-in-a-linked-list.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
ListNode* swapNodes(L... | ALGO | 0.999996 | 5.909592 | {
"github_metadata": {
"branch": "main",
"commit_count": 133,
"repo_created_at": "2022-01-18T12:19: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": "083c90cba5... |
43b66a49-d338-4e44-95ff-bce94781a105 | wiwitrifai/competitive-programming | indonesian-local/compfest/2018-qual/e.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int h[N], t[N], v[N];
long long sum[N];
int main() {
int tc;
scanf("%d", &tc);
while (tc--) {
int n, m;
scanf("%d %d", &n, &m);
memset(sum, 0, sizeof sum);
for (int i = 0; i < n; ++i) {
scanf("%d", h+i);
}
for (... | ALGO | 0.999931 | 3.474687 | {
"github_metadata": {
"branch": "master",
"commit_count": 628,
"repo_created_at": "2016-05-21T12:11:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 37,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3bbf2a6... |
12865f01-9265-4a52-97d1-17e0b0a110e9 | markphan03/fundamental-data-structure-algorithm | C++Programs/DynamicProgramming/LIS/lis.cpp | #include <iostream>
#include <fstream>
using namespace std;
#define nMAX 10000
int a[nMAX + 2], L[nMAX + 2], T[nMAX + 2];
void ReadData(ifstream& inputFile, int& n);
void BuildSolutionTable(int n);
void TraceAndWriteResult(ofstream& outputFile, int n);
void ReadData(ifstream& inputFile, int& n) {
if (inputFile.i... | ALGO | 0.999994 | 4.113899 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-02-19T00:43:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "71c75786c385... |
2ca10feb-2647-490a-ae98-326a0ea3381f | maguire/Optimization-Methods | chemag-4a/chemag-4a/program.cpp | /** <NAME> & <NAME>
* Project 4a
* Entry point and board class for sudoku
*/
// Declarations and functions for project #4
#include <iostream>
#include <limits.h>
#include "d_matrix.h"
#include "d_except.h"
#include <list>
#include <fstream>
#include <cstdlib>
using namespace std;
typedef int ValueType; // Th... | ALGO | 0.961826 | 5.138495 | {
"github_metadata": {
"branch": "master",
"commit_count": 138,
"repo_created_at": "2011-01-24T22:29:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0b4b2357... |
33f2133f-0578-4adb-8ebe-85dd78e26911 | uttamsinha97/fileStructure | newLABSET6.cpp | //LABSET 6
//Write a C++ program to read two lists of names and then merge the names of two lists to a single list by
//performing Co-sequential Match() operation and display the contents of all the lists.
#include<iostream>
#include<string>
#include<fstream>
#include<stdlib.h>
using namespace std;
class coseq
{
publi... | TOOL | 0.989162 | 3.528741 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2018-04-18T16:52: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": "4d4babd166... |
164bd499-8c7b-4274-a426-9a2ee9a25816 | asdwer20/snu_zero_hybrid_astar | setting/Insane_Setting/planner/src/past/hybrid_astar.cpp | // hybrid_astar.cpp
#include <ompl/base/Planner.h>
#include <string>
#include <cmath>
#include <ompl/util/RandomNumbers.h>
#include <ompl/tools/config/SelfConfig.h>
#include <ompl/base/goals/GoalState.h>
#include <ompl/base/ProblemDefinition.h>
#include <ompl/base/spaces/SE2StateSpace.h>
#include <ompl/base/Path.h>
#i... | ALGO | 0.999248 | 5.922259 | {
"github_metadata": {
"branch": "master",
"commit_count": 209,
"repo_created_at": "2019-07-10T02:33:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "594cbfc8... |
975b71e7-243e-428e-a5d7-0a2fca781675 | scepticalbeaver/Hausaufgaben_session1 | Session1/HT_6/calcTree/calcTree.h | #ifndef CALCTREE_H
#define CALCTREE_H
#include <stdlib.h>
#include <iostream>
using std::cout;
using std::endl;
int const strMaxLen = 255;
class CalcTree
{
public:
CalcTree();
~CalcTree();
void setNewTree(char string[]);
void printTree();
double calculateTree();
private:
struct TreeNode;
... | ALGO | 0.914272 | 4.254734 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2013-02-12T14:52:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "adb3b61b4b... |
b8915c1a-d6e1-4438-95d5-5f5744549ce5 | wjin33/oofem-2.4 | src/oofemlib/sparsegeneigenvalsystemnm.h | /*
*
* ##### ##### ###### ###### ### ###
* ## ## ## ## ## ## ## ### ##
* ## ## ## ## #### #### ## # ##
* ## ## ## ## ## ## ## ##
* ## ## ## ## ## ## ## ##
* ... | ALGO | 0.9899 | 5.151982 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2018-08-31T04:08:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "90d80c736... |
0aa5becc-4620-46b5-b37b-97c96964764b | ishandutta2007/codeforces-k | kostia244/normal/1096/G.cpp | #include<bits/stdc++.h>
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define pb push_back
using namespace std;
using ll = long long;
using vi = vector<ll>;
using pi = pair<int, int>;
using vpi = vector<pi>;
const int maxn = 1<<21;
//const ll mod = 20998782977, inv2 = 10499391489, rt = 14762477... | ALGO | 0.999971 | 4.440218 | {
"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": "a55d2cb177bd... |
c1c9011e-bfd4-42a4-b526-70b83804146e | ProdanRaduMatei/Probleme-Pbinfo | Solutions/Magie1/main.cpp | #include <fstream>
#include <queue>
#include <vector>
#include <algorithm>
#include <cstring>
#include <bitset>
#include <stack>
#include <unordered_map>
#include <map>
#include <cmath>
#include <chrono>
using namespace std;
#define Inf 0x3f3f3f3f
#define MAX 2000000000000000000LL
#define mod 1000000007
#define lsb (i... | ALGO | 0.999934 | 3.554364 | {
"github_metadata": {
"branch": "main",
"commit_count": 47,
"repo_created_at": "2023-09-15T16:03:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "544b0481c18... |
52720388-3b00-452b-8ac6-beaaf357b0a7 | gusdndl/BOJ | 백준/Gold/5676. 음주 코딩/음주 코딩.cc | #include <iostream>
#include <vector>
#include <cmath>
using namespace std;
vector<int> segtree;
vector<int> nums;
void build(int node, int start, int end) {
if (start == end) {
// Leaf node
segtree[node] = (nums[start] > 0) ? 1 : ((nums[start] < 0) ? -1 : 0);
return;
}
int mid =... | ALGO | 0.999939 | 5.292799 | {
"github_metadata": {
"branch": "main",
"commit_count": 152,
"repo_created_at": "2023-05-02T05:51: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": "fe9d8d6e44... |
36ff0c07-6045-4df7-9d5e-2935a2328f33 | flin99127/snake | sfml snake originale/main.cpp | # include <SFML/graphics.hpp>
# include <iostream>
# include <cstdlib>
#include<string.h>
using namespace std;
using namespace sf;
int Size = 30;
int width = Size * Size, height = Size * Size;
int corps = 3;
int dir = 1;
int point = 0;
int score = 0;
//la tête du serpent
struct snake
{
int x, y;
}s[100];
//le f... | TOOL | 0.994236 | 4.210536 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-04-27T11:27: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": "05b35f30f1ac... |
d39de74a-edb9-496d-b2ec-8c541701631a | Camerin97/DelfinCamerin_CIS5_Spring2017 | Homework/Assignment 4/Gaddis_8thEd_Chap5_Prob14_StudentLineUp/main.cpp | /*
* File: main.cpp
* Author: <NAME>
* Created on April 3, 2017, 12:45 PM
* Purpose: Determine which student would be first and last in line
* alphabetically.
*/
//System Libraries
#include <iostream> //Input - Output Library
using namespace std; //Name-space under which system libraries exist
//... | ALGO | 0.99766 | 4.009764 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2017-03-07T19:37: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": "ff4cf7ee6f... |
6f3309f2-9b42-4081-a889-a9c34193df9b | huytq000605/GrindLC | Array/Maximum Value Sum by Placing Three Rooks I/solution.cpp | class Solution {
public:
long long maximumValueSum(vector<vector<int>>& board) {
int m = board.size(), n = board[0].size();
auto cmp = [](auto a, auto b) {return a.second > b.second;};
vector<vector<pair<int, long long>>> top3(m, vector<pair<int, long long>>());
for(int r = 0; r < m;... | ALGO | 0.999969 | 5.882678 | {
"github_metadata": {
"branch": "master",
"commit_count": 3539,
"repo_created_at": "2021-05-12T17:21:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
"content_id": "96b0501... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.