QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#792184 | #9274. Hungry Cannibals | bulijiojiodibuliduo# | WA | 0ms | 3972kb | C++17 | 1.1kb | 2024-11-29 04:00:46 | 2024-11-29 04:00:47 |
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<=2;
return a<=3;
}
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");
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3664kb
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: 3896kb
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: 3956kb
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: 3740kb
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: 0
Accepted
time: 0ms
memory: 3972kb
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:
ok 139 tokens
Test #6:
score: -100
Wrong Answer
time: 0ms
memory: 3700kb
input:
265 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 172nd words differ - expected: 'Yes', found: 'No'