QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#755913#5141. Identical ParityL_wwqqWA 0ms3620kbC++20967b2024-11-16 18:22:322024-11-16 18:22:34

Judging History

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

  • [2024-11-16 18:22:34]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3620kb
  • [2024-11-16 18:22:32]
  • 提交

answer

#include<bits/stdc++.h>
#define int long long
#define i128 __int128
#define fi first
#define se second
#define all(a) begin(a)+1,end(a)
typedef unsigned long long ull;
using namespace std;
using pii = pair<int,int>;
using piii = pair<int,pii>;
const int N = 1e6+5;

int n,m,k;

inline void beez(){
	cin >> n >> k;
	if(n == 1 and k == 1){
		cout << "Yes\n";
		return;
	}
	if(n != 1 and k == 1){
		cout << "No\n";
		return;
	}
	if(k % 2 == 0){
		cout << "Yes\n";
		return;
	} else{
		if(n == k){
			cout << "Yes\n";
			return;
		}
		bool ok = true;
		int a = (n / k) * (k / 2) + (n % k),b = (n / k) * ((k + 1) / 2);
		cout << a << " " << b << "\n";
		if(n & 1){
			if(abs(a - b) != 1)ok = false;
		} else{
			if(a != b)ok = false;
		}
		if(ok) cout << "Yes\n";
		else cout << "No\n";
	}
}
signed main(){
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	
	int __=1;
	cin>>__;
	while(__--){
		beez();
	}
	return 0;
}

详细

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3620kb

input:

3
3 1
4 2
5 3

output:

No
Yes
3 2
Yes

result:

wrong output format YES or NO expected, but 3 found [3rd token]