QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#866439 | #9784. Donkey and Puss in Boots | jimmyywang | WA | 1ms | 5708kb | C++23 | 1.3kb | 2025-01-22 15:12:02 | 2025-01-22 15:12:02 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define f(i,a,b) for(ll i=a;i<=b;i++)
#define wt int tt=d;while(tt--)
#define py puts("Puss in Boots")
#define pn puts("Donkey")
#define fe(i,e) for(int i=0;i<e.size();i++)
#define vi vector<ll>
inline ll rd() {
ll x=0,f=1;
char c=getchar();
while(!isdigit(c)){if(c=='-')f=-1;c=getchar();}
while(isdigit(c))x=x*10+c-'0',c=getchar();
return x*f;
}
namespace binom{
const ll Lim=300010,mod=998244353;
ll jc[Lim],inv[Lim],inc[Lim];
void pre(){
jc[0]=jc[1]=inc[0]=inc[1]=inv[0]=inv[1]=1;
f(i,2,Lim-1)jc[i]=jc[i-1]*i%mod,inv[i]=(mod-mod/i)*inv[mod%i]%mod,
inc[i]=inc[i-1]*inv[i]%mod;
}ll C(ll n,ll m){if(n<0||m<0||n<m)return 0;return jc[n]*inc[m]%mod*inc[n-m]%mod;}
}
// using namespace binom;
ll dx[4]={0,1,0,-1};
ll dy[4]={1,0,-1,0};
#define d rd()
#define pb push_back
const ll N=300010;
struct edge{ll v,w,nx;}e[N<<1];
ll hd[N],cnt;
void add(ll u,ll v,ll w){e[++cnt]=(edge){v,w,hd[u]};hd[u]=cnt;}
ll qp(ll a,ll b,ll p){
ll ans=1;while(b){
if(b&1)ans=ans*a%p;
a=a*a%p;b>>=1;
}return ans;
}ll n,m;
ll sum;
ll a[1000010];
int main(){n=d;
f(i,1,n){
a[i]=d,sum+=a[i];
}f(i,1,n){
if(sum-a[i]<n){pn;return 0;}
}py;
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 5664kb
input:
2 2 2
output:
Puss in Boots
result:
ok single line: 'Puss in Boots'
Test #2:
score: 0
Accepted
time: 1ms
memory: 5704kb
input:
4 0 47 0 0
output:
Donkey
result:
ok single line: 'Donkey'
Test #3:
score: 0
Accepted
time: 1ms
memory: 5708kb
input:
4 0 47 0 0
output:
Donkey
result:
ok single line: 'Donkey'
Test #4:
score: 0
Accepted
time: 0ms
memory: 5708kb
input:
10 5 7 3 0 2 0 0 1 0 0
output:
Puss in Boots
result:
ok single line: 'Puss in Boots'
Test #5:
score: 0
Accepted
time: 0ms
memory: 5704kb
input:
5 8 5 1 1 0
output:
Puss in Boots
result:
ok single line: 'Puss in Boots'
Test #6:
score: 0
Accepted
time: 0ms
memory: 5704kb
input:
9 5 13 1 0 0 0 0 0 0
output:
Donkey
result:
ok single line: 'Donkey'
Test #7:
score: 0
Accepted
time: 0ms
memory: 5704kb
input:
7 13 0 1 0 0 0 0
output:
Donkey
result:
ok single line: 'Donkey'
Test #8:
score: -100
Wrong Answer
time: 0ms
memory: 5700kb
input:
5 0 0 0 0 0
output:
Donkey
result:
wrong answer 1st lines differ - expected: 'Puss in Boots', found: 'Donkey'