QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#588809#7638. Lakeblhxzjr#WA 0ms3660kbC++23486b2024-09-25 14:41:272024-09-25 14:41:28

Judging History

你现在查看的是最新测评结果

  • [2024-09-25 14:41:28]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3660kb
  • [2024-09-25 14:41:27]
  • 提交

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;
		m+=b;
		if(m>cnt){
			m-=cnt;
			cnt+=ceil(m/4.0);
		}
	}
	else{
		cnt+=m/3;
		n-=m;
		n+=b;
		n+=a;
		if(n>cnt) n-=cnt,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: 3536kb

input:

1 1

output:

1

result:

ok single line: '1'

Test #2:

score: -100
Wrong Answer
time: 0ms
memory: 3660kb

input:

1 4

output:

3

result:

wrong answer 1st lines differ - expected: '1', found: '3'