QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#354479 | #6310. Dining Professors | marher | WA | 10ms | 4088kb | C++14 | 444b | 2024-03-15 14:42:27 | 2024-03-15 14:42:29 |
Judging History
answer
// 🤣🤣🤣🤣🤣🤣🤣🤣
#include<bits/stdc++.h>
using namespace std;
const int N=5e5+5000;
int n,a[N],num,cnt[50],ans;
main()
{
// freopen("in.txt","r",stdin);
cin>>n>>num;
for(int i=0;i<n;i++)cin>>a[i];
for(int i=0;i<n;i++)cnt[a[i]+a[(i+1)%n]+a[(i-1+n)%n]]++;
ans=3*n;
while(cnt[3]--)num--;
while(cnt[2]--)ans-=(num>0),num--;
while(cnt[1]--)ans-=2*(num>0),num--;
cout<<ans;
}
详细
Test #1:
score: 100
Accepted
time: 1ms
memory: 3604kb
input:
5 2 1 0 1 0 1
output:
13
result:
ok 1 number(s): "13"
Test #2:
score: 0
Accepted
time: 10ms
memory: 3944kb
input:
100000 33292 1 1 1 1 0 1 1 0 0 1 1 1 1 1 0 1 0 1 0 1 0 1 1 1 1 1 1 0 0 0 0 0 1 1 1 1 0 1 1 1 0 1 0 0 1 1 0 0 0 1 0 1 0 1 0 1 1 0 1 1 1 1 0 1 1 0 1 1 1 0 1 0 0 0 1 0 0 0 1 0 0 1 0 0 0 1 0 0 0 0 0 0 0 1 1 0 0 1 1 1 1 0 1 0 0 1 0 1 0 1 0 1 0 0 1 1 0 1 0 1 0 1 1 1 1 0 1 0 0 0 0 0 1 1 0 1 0 1 0 1 1 1 0 0...
output:
279236
result:
ok 1 number(s): "279236"
Test #3:
score: -100
Wrong Answer
time: 10ms
memory: 4088kb
input:
100000 91906 1 1 1 1 1 0 1 0 0 0 1 0 0 0 1 0 1 1 1 0 0 0 0 0 1 0 0 0 0 0 1 1 0 0 1 0 1 0 0 0 1 0 0 1 0 1 0 0 1 1 1 0 0 1 0 0 0 1 1 1 0 0 0 1 0 1 1 0 1 0 0 1 1 0 1 0 1 0 1 1 0 0 0 1 0 0 1 0 1 0 1 1 1 0 1 0 1 1 1 0 1 1 0 0 0 0 1 1 1 1 1 1 1 0 0 0 1 0 1 0 0 1 0 0 1 0 1 0 0 1 0 0 0 0 1 0 1 0 1 1 0 0 1 0...
output:
187545
result:
wrong answer 1st numbers differ - expected: '174297', found: '187545'