Submission #1443855
Source Code Expand
#include <bits/stdc++.h>
using namespace std;
#define INF 1001000100010001000
#define MOD 1000000007
#define EPS 1e-10
#define int long long
#define rep(i, N) for (int i = 0; i < N; i++)
#define Rep(i, N) for (int i = 1; i < N; i++)
#define For(i, a, b) for (int i = (a); i < (b); i++)
#define pb push_back
#define eb emplece_back
#define mp make_pair
#define i_i pair<int, int>
#define vi vector<int>
#define vvi vector<vi >
#define vb vector<bool>
#define vvb vector<vb >
#define vp vector< i_i >
#define Edge pair< i_i, int>
#define all(a) (a).begin(), (a).end()
#define Int(x) int x; scanf("%lld", &x);
#define int2(x, y) int x, y; scanf("%lld %lld", &x, &y);
#define fir first
#define sec second
#define ffir first.first
#define fsec first.second
#define sfir second.first
#define ssec second.second
//int dxy[5] = {0, 1, 0, -1, 0};
// assign
signed main()
{
Int(n);
int2(a, b);
int2(c, d);
for (int m = 0; m < n-1; m++) {
if ( (n-1-m) * c - d * m <= a - b &&
a - b <= (n - 1 - m) * d - c * m) {
std::cout << "YES" << std::endl;
return 0;
}
}
std::cout << "NO" << std::endl;
return 0;
}
Submission Info
Submission Time |
|
Task |
B - Moderate Differences |
User |
Ti11192916 |
Language |
C++14 (GCC 5.4.1) |
Score |
400 |
Code Size |
1240 Byte |
Status |
AC |
Exec Time |
2 ms |
Memory |
256 KB |
Compile Error
./Main.cpp: In function ‘int main()’:
./Main.cpp:23:40: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
#define Int(x) int x; scanf("%lld", &x);
^
./Main.cpp:37:5: note: in expansion of macro ‘Int’
Int(n);
^
./Main.cpp:24:56: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
#define int2(x, y) int x, y; scanf("%lld %lld", &x, &y);
^
./Main.cpp:38:5: note: in expansion of macro ‘int2’
int2(a, b);
^
./Main.cpp:24:56: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
#define int2(x, y) int x, y; scanf("%lld %lld", &x, &y);
^
./Main.cpp:39:5: note: in expansion of macro ‘int2’
int2(c, d);
^
Judge Result
Set Name |
Sample |
All |
Score / Max Score |
0 / 0 |
400 / 400 |
Status |
|
|
Set Name |
Test Cases |
Sample |
sample1.txt, sample2.txt, sample3.txt, sample4.txt |
All |
sample1.txt, sample2.txt, sample3.txt, sample4.txt, a01.txt, a02.txt, a03.txt, a04.txt, b01.txt, b02.txt, b03.txt, b04.txt, c01.txt, c02.txt, c03.txt, c04.txt, d01.txt, d02.txt, d03.txt, d04.txt, d05.txt, d06.txt, d07.txt, d08.txt, d09.txt, d10.txt, d11.txt, d12.txt, d13.txt, d14.txt, d15.txt, d16.txt, d17.txt, d18.txt, sample1.txt, sample2.txt, sample3.txt, sample4.txt |
Case Name |
Status |
Exec Time |
Memory |
a01.txt |
AC |
1 ms |
256 KB |
a02.txt |
AC |
1 ms |
256 KB |
a03.txt |
AC |
1 ms |
256 KB |
a04.txt |
AC |
1 ms |
256 KB |
b01.txt |
AC |
1 ms |
256 KB |
b02.txt |
AC |
2 ms |
256 KB |
b03.txt |
AC |
2 ms |
256 KB |
b04.txt |
AC |
1 ms |
256 KB |
c01.txt |
AC |
1 ms |
256 KB |
c02.txt |
AC |
1 ms |
256 KB |
c03.txt |
AC |
1 ms |
256 KB |
c04.txt |
AC |
1 ms |
256 KB |
d01.txt |
AC |
1 ms |
256 KB |
d02.txt |
AC |
1 ms |
256 KB |
d03.txt |
AC |
1 ms |
256 KB |
d04.txt |
AC |
2 ms |
256 KB |
d05.txt |
AC |
2 ms |
256 KB |
d06.txt |
AC |
1 ms |
256 KB |
d07.txt |
AC |
1 ms |
256 KB |
d08.txt |
AC |
1 ms |
256 KB |
d09.txt |
AC |
1 ms |
256 KB |
d10.txt |
AC |
1 ms |
256 KB |
d11.txt |
AC |
1 ms |
256 KB |
d12.txt |
AC |
2 ms |
256 KB |
d13.txt |
AC |
1 ms |
256 KB |
d14.txt |
AC |
1 ms |
256 KB |
d15.txt |
AC |
1 ms |
256 KB |
d16.txt |
AC |
1 ms |
256 KB |
d17.txt |
AC |
1 ms |
256 KB |
d18.txt |
AC |
1 ms |
256 KB |
sample1.txt |
AC |
1 ms |
256 KB |
sample2.txt |
AC |
1 ms |
256 KB |
sample3.txt |
AC |
1 ms |
256 KB |
sample4.txt |
AC |
1 ms |
256 KB |