This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
void subtask1() {
array<int, 2> start{}, end{};
cin >> start[0] >> start[1] >> end[0] >> end[1];
int l; cin >> l;
if (start[0] == 1 && end[0] == 1) { // both one line 1
cout << min( (start[1] - end[1] + l + 1) % (l + 1), (end[1] - start[1] + l + 1) % (l + 1) );
} else if (start[0] != end[0]) { // one on line 1, other on line 2
cout << 1;
} else { // both on line 2
cout << 0;
}
}
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n; cin >> n;
if (n == 2) subtask1();
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |