QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#792179#9274. Hungry Cannibalsbulijiojiodibuliduo#WA 0ms3928kbC++171.1kb2024-11-29 03:51:272024-11-29 03:51:29

Judging History

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

  • [2024-11-29 03:51:29]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3928kb
  • [2024-11-29 03:51:27]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
typedef vector<int> VI;
typedef basic_string<int> BI;
typedef long long ll;
typedef pair<int,int> PII;
typedef double db;
mt19937 mrand(random_device{}()); 
const ll mod=1000000007;
int rnd(int x) { return mrand() % x;}
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}
// head

bool solve() {
	int a,b,x,y;
	scanf("%d%d%d%d",&a,&x,&b,&y);
	if (x+y==0) return false;
	if (a==0) return true;
	if (a+b<=2) return true;
	if (b>=a+2) return true;
	if (b==a+1) {
		if (y>0) return true;
		return a==1;
	}
	// a == b
	if (y==0) return false;
	if (x==0) return a==2;
	return a<=3;
	// a 1 a 1
	// a 0 a 1

	return true;
}
int _;
int main() {
	for (scanf("%d",&_);_;_--) {
		puts(solve()?"Yes":"No");
	}
}

詳細信息

Test #1:

score: 100
Accepted
time: 0ms
memory: 3612kb

input:

4
2 0 2 1
1 1 4 0
2 1 2 0
3 1 3 1

output:

Yes
Yes
No
Yes

result:

ok 4 tokens

Test #2:

score: 0
Accepted
time: 0ms
memory: 3684kb

input:

6
0 0 1 0
1 0 1 0
1 1 1 0
0 0 1 1
1 0 1 1
1 1 1 1

output:

No
No
Yes
Yes
Yes
Yes

result:

ok 6 tokens

Test #3:

score: 0
Accepted
time: 0ms
memory: 3928kb

input:

24
0 0 1 0
1 0 1 0
1 1 1 0
0 0 1 1
1 0 1 1
1 1 1 1
0 0 2 0
1 0 2 0
1 1 2 0
2 0 2 0
2 1 2 0
2 2 2 0
0 0 2 1
1 0 2 1
1 1 2 1
2 0 2 1
2 1 2 1
2 2 2 1
0 0 2 2
1 0 2 2
1 1 2 2
2 0 2 2
2 1 2 2
2 2 2 2

output:

No
No
Yes
Yes
Yes
Yes
No
No
Yes
No
No
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes

result:

ok 24 tokens

Test #4:

score: 0
Accepted
time: 0ms
memory: 3736kb

input:

64
0 0 1 0
1 0 1 0
1 1 1 0
0 0 1 1
1 0 1 1
1 1 1 1
0 0 2 0
1 0 2 0
1 1 2 0
2 0 2 0
2 1 2 0
2 2 2 0
0 0 2 1
1 0 2 1
1 1 2 1
2 0 2 1
2 1 2 1
2 2 2 1
0 0 2 2
1 0 2 2
1 1 2 2
2 0 2 2
2 1 2 2
2 2 2 2
0 0 3 0
1 0 3 0
1 1 3 0
2 0 3 0
2 1 3 0
2 2 3 0
3 0 3 0
3 1 3 0
3 2 3 0
3 3 3 0
0 0 3 1
1 0 3 1
1 1 3 1
2...

output:

No
No
Yes
Yes
Yes
Yes
No
No
Yes
No
No
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
No
Yes
No
No
No
No
No
No
No
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes

result:

ok 64 tokens

Test #5:

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

input:

139
0 0 1 0
1 0 1 0
1 1 1 0
0 0 1 1
1 0 1 1
1 1 1 1
0 0 2 0
1 0 2 0
1 1 2 0
2 0 2 0
2 1 2 0
2 2 2 0
0 0 2 1
1 0 2 1
1 1 2 1
2 0 2 1
2 1 2 1
2 2 2 1
0 0 2 2
1 0 2 2
1 1 2 2
2 0 2 2
2 1 2 2
2 2 2 2
0 0 3 0
1 0 3 0
1 1 3 0
2 0 3 0
2 1 3 0
2 2 3 0
3 0 3 0
3 1 3 0
3 2 3 0
3 3 3 0
0 0 3 1
1 0 3 1
1 1 3 1
...

output:

No
No
Yes
Yes
Yes
Yes
No
No
Yes
No
No
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
No
Yes
No
No
No
No
No
No
No
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
No
No
Yes
No
Yes
Yes
No
No
No
No
No
No
No
No
No
Yes
Yes
Yes
Yes...

result:

wrong answer 86th words differ - expected: 'No', found: 'Yes'