Submission #18729153
Source Code Expand
#include <bits/stdc++.h>
#define rep(i, N) for(int i = 0; i < (int)N; i++)
#define CREP(i, l, r) for(int i = l; i <= r; i++)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef vector<int> vi;
int main() {
int n, m, t;
scanf("%d%d%d", &n, &m, &t);
vi a(m), b(m);
rep(i,m) scanf("%d%d", &a[i], &b[i]);
int bbb = n, ttt = 0;
rep(i,m) {
bbb -= (a[i] - ttt);
if ( bbb <= 0 ) {
puts("No");
return 0;
}
bbb += (b[i] - a[i]);
bbb = min(bbb, n);
ttt = b[i];
}
bbb -= (t - ttt);
if ( bbb <= 0 ) {
puts("No");
return 0;
}
puts("Yes");
return 0;
}
Submission Info
| Submission Time |
|
| Task |
B - Smartphone Addiction |
| User |
samari06 |
| Language |
C++ (GCC 9.2.1) |
| Score |
200 |
| Code Size |
754 Byte |
| Status |
AC |
| Exec Time |
17 ms |
| Memory |
3648 KiB |
Compile Error
./Main.cpp: In function ‘int main()’:
./Main.cpp:11:10: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
11 | scanf("%d%d%d", &n, &m, &t);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~
./Main.cpp:13:19: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
13 | rep(i,m) scanf("%d%d", &a[i], &b[i]);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~
Judge Result
| Set Name |
Sample |
All |
| Score / Max Score |
0 / 0 |
200 / 200 |
| Status |
|
|
| Set Name |
Test Cases |
| Sample |
sample_01.txt, sample_02.txt, sample_03.txt, sample_04.txt, sample_05.txt |
| All |
handmade_00.txt, handmade_01.txt, random_00.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, sample_01.txt, sample_02.txt, sample_03.txt, sample_04.txt, sample_05.txt |
| Case Name |
Status |
Exec Time |
Memory |
| handmade_00.txt |
AC |
17 ms |
3620 KiB |
| handmade_01.txt |
AC |
2 ms |
3620 KiB |
| random_00.txt |
AC |
7 ms |
3636 KiB |
| random_01.txt |
AC |
2 ms |
3624 KiB |
| random_02.txt |
AC |
2 ms |
3624 KiB |
| random_03.txt |
AC |
2 ms |
3620 KiB |
| random_04.txt |
AC |
3 ms |
3428 KiB |
| random_05.txt |
AC |
2 ms |
3516 KiB |
| random_06.txt |
AC |
1 ms |
3428 KiB |
| random_07.txt |
AC |
3 ms |
3648 KiB |
| random_08.txt |
AC |
2 ms |
3572 KiB |
| random_09.txt |
AC |
2 ms |
3440 KiB |
| random_10.txt |
AC |
2 ms |
3616 KiB |
| random_11.txt |
AC |
3 ms |
3628 KiB |
| random_12.txt |
AC |
4 ms |
3588 KiB |
| random_13.txt |
AC |
2 ms |
3576 KiB |
| sample_01.txt |
AC |
2 ms |
3576 KiB |
| sample_02.txt |
AC |
2 ms |
3616 KiB |
| sample_03.txt |
AC |
2 ms |
3432 KiB |
| sample_04.txt |
AC |
2 ms |
3516 KiB |
| sample_05.txt |
AC |
3 ms |
3520 KiB |