萌新求助,关于 CFqwq
  • 板块学术版
  • 楼主Sparkle_ZHJXqwq
  • 当前回复9
  • 已保存回复9
  • 发布时间2021/4/30 15:06
  • 上次更新2023/11/4 23:56:26
查看原帖
萌新求助,关于 CFqwq
265517
Sparkle_ZHJXqwq楼主2021/4/30 15:06

在昨天晚上的 Educational Codeforces Round 中,我很快地写完并通过了 A 题,可今天下午查看时却发现 Wrong Answer on test 1 了,然而我在本地 IDE 与洛谷 IDE 都测试了一遍之后发现我的答案与 Codeforces 上 test 1 的答案完全一致,大佬们能指点我一下吗?

附上代码:

#include <bits/stdc++.h>
#define int long long
using namespace std;
 
const int L = 1e5 + 5;
int T, r, b, d;
 
inline int read() {
	int f = 0, tmp = 1; char ch;
	while (ch < '0' || ch > '9') {
		if (ch == '-1' && !tmp) tmp = -1;
		ch = getchar();
	}
	while (ch >= '0' && ch <= '9') f = f*10 + ch - '0', ch = getchar();
	return f*tmp;
}
 
signed main() {
	T = read();
	while (T--) {
		r = read(), b = read(), d = read();
		
		if (r < b) swap(r, b);
		
		if (b*(d+1) >= r) printf("YES\n");
		else printf("NO\n");
	}
}

代码中可能有一些多余部分

以及 test 1:

Input

4
1 1 0
2 7 3
6 1 4
5 4 0

Answer

YES
YES
NO
NO
2021/4/30 15:06
加载中...