QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#228630 | #7638. Lake | ucup-team1074# | WA | 0ms | 3708kb | C++20 | 922b | 2023-10-28 13:50:11 | 2023-10-28 13:50:12 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define LL long long
#define pb push_back
#define x first
#define y second
#define endl '\n'
const LL maxn = 4e05+7;
const LL N=1e05+10;
const LL mod=1e09+7;
typedef pair<int,int>pl;
priority_queue<LL , vector<LL>, greater<LL> >t;
priority_queue<LL> q;
LL gcd(LL a, LL b){
return b > 0 ? gcd(b , a % b) : a;
}
LL lcm(LL a , LL b){
return a / gcd(a , b) * b;
}
void solve()
{
int ad , ch;
cin>>ad>>ch;
int res = abs(ad - ch);
int k = min(ad , ch) / 3;
ad -= k * 3;
ch -= k * 3;
res -= k;
int t = min(ad , ch);
if(t > 0){
res -= (5 - t);
k ++;
}
if(res > 0){
k += (res - 1) / 5 + 1;
}
cout<<k * 2 - 1;
}
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
cout.precision(10);
int t=1;
//cin>>t;
while(t--)
{
solve();
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3552kb
input:
1 1
output:
1
result:
ok single line: '1'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3708kb
input:
1 4
output:
1
result:
ok single line: '1'
Test #3:
score: 0
Accepted
time: 0ms
memory: 3700kb
input:
5 5
output:
3
result:
ok single line: '3'
Test #4:
score: 0
Accepted
time: 0ms
memory: 3624kb
input:
4 4
output:
3
result:
ok single line: '3'
Test #5:
score: 0
Accepted
time: 0ms
memory: 3624kb
input:
3 4
output:
1
result:
ok single line: '1'
Test #6:
score: 0
Accepted
time: 0ms
memory: 3552kb
input:
8 12
output:
5
result:
ok single line: '5'
Test #7:
score: 0
Accepted
time: 0ms
memory: 3512kb
input:
12 8
output:
5
result:
ok single line: '5'
Test #8:
score: -100
Wrong Answer
time: 0ms
memory: 3548kb
input:
8182 520051
output:
209111
result:
wrong answer 1st lines differ - expected: '260025', found: '209111'