QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#588757 | #7638. Lake | blhxzjr# | WA | 0ms | 3672kb | C++23 | 419b | 2024-09-25 14:21:47 | 2024-09-25 14:21:47 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
#define int long long
int n,m,k,_;
void solve(){
cin>>n>>m;
int a=m%3;
int b=n%3;
m-=a;
n-=b;
int cnt=0;
if(m>=n){
cnt+=n/3;
m-=n;
m+=a;
cnt+=ceil(m/4.0);
}
else{
cnt+=m/3;
n-=m;
n+=b;
cnt+=ceil(n/4.0);
}
cout<<2*cnt-1;
}
signed main(){
ios::sync_with_stdio(0);
cin.tie(0);
_=1;
while(_--){
solve();
}
}
详细
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: 3652kb
input:
1 4
output:
1
result:
ok single line: '1'
Test #3:
score: 0
Accepted
time: 0ms
memory: 3664kb
input:
5 5
output:
3
result:
ok single line: '3'
Test #4:
score: 0
Accepted
time: 0ms
memory: 3672kb
input:
4 4
output:
3
result:
ok single line: '3'
Test #5:
score: -100
Wrong Answer
time: 0ms
memory: 3656kb
input:
3 4
output:
3
result:
wrong answer 1st lines differ - expected: '1', found: '3'