QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#792183 | #9274. Hungry Cannibals | bulijiojiodibuliduo# | WA | 0ms | 3964kb | C++17 | 1.1kb | 2024-11-29 03:57:10 | 2024-11-29 03:57:11 |
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 (x>0&&y>0) return true;
if (y>0) return a<=2;
else return a<=1;
}
if (y==0) return false;
if (x==0) return a==2;
return true;
//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: 3668kb
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: 3964kb
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: 3692kb
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: 3672kb
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: 3676kb
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 91st words differ - expected: 'No', found: 'Yes'