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
#include
#include
#include
using namespace std; const long long maxn =1e6+10; const long long mod=1e9+7; int main() { ///ifstream cin("haircut.in"); ///ofstream cout("haircut.out"); ios_base::sync_with_stdio(false); cin.tie(0); long long n,k; cin>>n>>k; vector
>v; for(long long i=0;i
>x>>y; v.push_back({y,x}); } sort(v.begin(),v.end()); multiset
ms; while(k--) { ms.insert(0); } long long ans=0; for(long long i=0;i
::iterator it = ms.upper_bound(v[i].second); if(it == ms.begin()) continue; it--; ms.erase(it); ms.insert(v[i].first); ans++; } cout<
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)