Бодолт илгээх | Бүх бодолтууд | Шилдэг бодолтууд | Жагсаалт руу буцах |
RGB7938 - Photo |
FJ wants to take pictures of his N cows (2 <= N <= 1,000,000,000), which are standing in a line and conveniently numbered 1..N. Each photograph can capture a consecutive range of cows from the lineup, and FJ wants to make sure that each cow appears in at least one photo. Unfortunately, there are K unfriendly pairs of cows (1 <= K <= 1000) that each refuse to be in the same photograph. Given the locations of these unfriendly pairs, please determine the minimum number of photos FJ needs to take.
Input
Input description...
Output
Output description...
Example
Input: etc. Output: etc.
Нэмсэн: | Bataa |
Огноо: | 2013-12-23 |
Хугацааны хязгаарлалт: | 1s |
Эх кодын хэмжээний хязгаарлалт: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Програмчлалын хэлүүд: | ADA95 ASM32 BASH BF C NCSHARP CSHARP C++ 4.3.2 CPP C99 CLPS LISP sbcl LISP clisp D ERL FORTRAN HASK ICON ICK JAVA JS-RHINO JULIA LUA NEM NICE OCAML PAS-GPC PAS-FPC PERL PHP PIKE PRLG-swi PYTHON PYPY3 PYTHON3 RUBY SCALA SCM guile ST TCL WHITESPACE |
Эх сурвалж: | USACO 2013 US Open, Bronze |