QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#792185 | #9274. Hungry Cannibals | bulijiojiodibuliduo# | WA | 0ms | 3744kb | C++17 | 1.1kb | 2024-11-29 04:02:06 | 2024-11-29 04:02:06 |
Judging History
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 a<=1;
if (x==0) return a<=3;
return true;
}
if (y==0) return false;
if (x==0) return a<=2;
return a<=3;
//return a<=3;
}
int _;
int main() {
for (scanf("%d",&_);_;_--) {
puts(solve()?"Yes":"No");
}
}
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 3744kb
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: 3664kb
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: 3740kb
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: 3608kb
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'