QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#660659#6310. Dining Professorscandy34#WA 5ms5160kbC++17522b2024-10-20 12:34:432024-10-20 12:34:43

Judging History

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

  • [2024-10-20 12:34:43]
  • 评测
  • 测评结果:WA
  • 用时:5ms
  • 内存:5160kb
  • [2024-10-20 12:34:43]
  • 提交

answer

#include<bits/stdc++.h>
#define int long long
#define endl '\n'
#define ph push_back
#define pp pop_back
using namespace std;

const int N=1e5+5;
int n,k,a[N],b[N];

signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);
    cin>>n>>k;
    for(int i=1;i<=n;i++) cin>>a[i];
    for(int i=1;i<=n;i++)
    {
        int u=i%n+1,v=(i+n-2)%n+1;
        b[i]=(!a[i])+(!a[u])+(!a[v]);
    }
    int ans=3*n;
    for(int i=1;i<=k;i++) ans-=b[i];
    cout<<ans<<endl;
    return 0;
}

詳細信息

Test #1:

score: 100
Accepted
time: 0ms
memory: 3568kb

input:

5 2
1 0 1 0 1

output:

13

result:

ok 1 number(s): "13"

Test #2:

score: -100
Wrong Answer
time: 5ms
memory: 5160kb

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:

250073

result:

wrong answer 1st numbers differ - expected: '279236', found: '250073'