| Task: | Binge watching |
| Sender: | aalto26bw_006 |
| Submission time: | 2026-09-09 16:41:14 +0300 |
| Language: | C++ (C++23) |
| Status: | READY |
| Result: | WRONG ANSWER |
| test | verdict | time | |
|---|---|---|---|
| #1 | ACCEPTED | 0.00 s | details |
| #2 | ACCEPTED | 0.00 s | details |
| #3 | WRONG ANSWER | 0.00 s | details |
| #4 | ACCEPTED | 0.16 s | details |
| #5 | ACCEPTED | 0.15 s | details |
| #6 | WRONG ANSWER | 0.22 s | details |
| #7 | WRONG ANSWER | 0.00 s | details |
| #8 | ACCEPTED | 0.00 s | details |
| #9 | ACCEPTED | 0.00 s | details |
Code
#include <iostream>
#include <vector>
#include <functional>
void printNewLine(){std::cout << "\n";}
template<typename T>
void print(T a){std::cout << a;}
template<typename T>
void println(T a){std::cout << a << "\n";}
std::tuple<int> readInt1(){
int a;
std::cin >> a;
return {a};
}
std::vector<int> readVecInt(int n){
std::vector<int> arr(n);
for (int i = 0; i < n; i++){
int a;
std::cin >> a;
arr[i] = a;
}
return arr;
}
#include <set>
#include <algorithm>
void movie(){
auto [n] = readInt1();
auto arr = readVecInt(2*n);
for (int i = 0; i < n; i++){
int temp = arr[2*i+1];
arr[2*i+1] = arr[2*i];
arr[2*i] = temp;
}
int* s = &arr[0];
std::sort((long*)(s),(long*)(s)+n);
for (int i = 0; i < n; i++){
int temp = arr[2*i+1];
arr[2*i+1] = arr[2*i];
arr[2*i] = temp;
}
int time = 0;
int num = 0;
for (int i = 0; i < n; i++){
if (time <= arr[2*i]){
time = arr[2*i+1];
num += 1;
}
}
println(num);
}
int main() {
//carManufacturing();
//bottle();
movie();
exit(0);
}Test details
Test 1
Verdict: ACCEPTED
| input |
|---|
| 10 6 7 4 5 8 9 2 3 ... |
| correct output |
|---|
| 10 |
| user output |
|---|
| 10 |
Test 2
Verdict: ACCEPTED
| input |
|---|
| 10 1 1000 1 1000 1 1000 1 1000 ... |
| correct output |
|---|
| 1 |
| user output |
|---|
| 1 |
Test 3
Verdict: WRONG ANSWER
| input |
|---|
| 10 404 882 690 974 201 255 800 933 ... |
| correct output |
|---|
| 4 |
| user output |
|---|
| 2 |
Feedback: Incorrect character on line 1 col 1: expected "4", got "2"
Test 4
Verdict: ACCEPTED
| input |
|---|
| 200000 177494 177495 157029 157030 6030 6031 15209 15210 ... |
| correct output |
|---|
| 200000 |
| user output |
|---|
| 200000 |
Test 5
Verdict: ACCEPTED
| input |
|---|
| 200000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 ... |
| correct output |
|---|
| 1 |
| user output |
|---|
| 1 |
Test 6
Verdict: WRONG ANSWER
| input |
|---|
| 200000 82334756 323555178 958182284 981100325 649818003 678160906 801994655 889397498 ... |
| correct output |
|---|
| 725 |
| user output |
|---|
| 15 |
Feedback: Incorrect character on line 1 col 1: expected "725", got "15"
Test 7
Verdict: WRONG ANSWER
| input |
|---|
| 3 1 1000 2 3 5 6 |
| correct output |
|---|
| 2 |
| user output |
|---|
| 1 |
Feedback: Incorrect character on line 1 col 1: expected "2", got "1"
Test 8
Verdict: ACCEPTED
| input |
|---|
| 3 3 4 5 6 7 8 |
| correct output |
|---|
| 3 |
| user output |
|---|
| 3 |
Test 9
Verdict: ACCEPTED
| input |
|---|
| 2 1 2 3 4 |
| correct output |
|---|
| 2 |
| user output |
|---|
| 2 |
