QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#619394 | #8936. Team Arrangement | zzpcd# | Compile Error | / | / | Python3 | 678b | 2024-10-07 14:04:46 | 2024-10-07 14:04:48 |
Judging History
This is the latest submission verdict.
- [2024-10-07 14:04:48]
- Judged
- Verdict: Compile Error
- Time: 0ms
- Memory: 0kb
- [2024-10-07 14:04:46]
- Submitted
answer
#include<bits/stdc++.h>
#define N 1000010
using namespace std;
int n,a,b;
long long f[N];
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
cin>>n>>a>>b;
f[0]=0,f[1]=1;
for(int i=2;i<=n;++i) f[i]=f[i-2]+1ll*n*(3ll*n-1)/2ll;
long long ans=f[n];
for(int i=1;i<=n;++i)
{
// n-a+2
int l=1,r=n-a+1+1-i;
l=max(l,b-i+1);
r=min(r,b);
int tmp=r-l+1;
// cerr << i <<" ::: " <<tmp <<" "<<ans <<"??\n";
if(a-i>=0)
{
ans-=tmp;
}
if(a+i<=n)
{
ans-=tmp;
}
}
cout<<ans<<'\n';
return 0;
}
Details
File "answer.code", line 12 for(int i=2;i<=n;++i) f[i]=f[i-2]+1ll*n*(3ll*n-1)/2ll; ^ SyntaxError: invalid decimal literal