QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#593730 | #7638. Lake | wkr | WA | 0ms | 3648kb | C++20 | 635b | 2024-09-27 15:42:45 | 2024-09-27 15:42:46 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define int long long int
signed main() {
int n, m;
cin >> n >> m;
int ans = 0;
while (n > 0 || m > 0) {
if (n >= 3 && m >= 3) {
n -= 3;
m -= 3;
if (n > m) {
--n;
} else {
--m;
}
} else if (n >= 3) {
m = 0;
n -= 4;
} else if (m >= 3) {
m -= 4;
n = 0;
} else {
m = 0;
n = 0;
}
++ans;
}
cout << ans << endl;
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3648kb
input:
1 1
output:
1
result:
ok single line: '1'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3552kb
input:
1 4
output:
1
result:
ok single line: '1'
Test #3:
score: -100
Wrong Answer
time: 0ms
memory: 3644kb
input:
5 5
output:
2
result:
wrong answer 1st lines differ - expected: '3', found: '2'