QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#354479#6310. Dining ProfessorsmarherWA 10ms4088kbC++14444b2024-03-15 14:42:272024-03-15 14:42:29

Judging History

你现在查看的是最新测评结果

  • [2024-03-15 14:42:29]
  • 评测
  • 测评结果:WA
  • 用时:10ms
  • 内存:4088kb
  • [2024-03-15 14:42:27]
  • 提交

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'