Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
#include
using namespace std; #include
#include
using namespace __gnu_pbds; #define ordered_set tree
, rb_tree_tag,tree_order_statistics_node_update> const long long maxn = 1e5+10; int n; int val[maxn]; ordered_set num[maxn]; vector
g[maxn]; int ans[maxn]; void swap_ordered_set(ordered_set &a, ordered_set &b) { a.swap(b); } void solve(int node,int par) { for(auto ax:g[node]) { if(ax==par)continue; solve(ax,node); if(num[node].size()
>n; for(int i=0;i
>val[i]; } for(int i=1;i
>x; x--; g[x].push_back(i); } solve(0,-1); for(int i=0;i
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)