QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#303780#6310. Dining Professorssilver_museWA 7ms5136kbC++14604b2024-01-12 23:40:382024-01-12 23:40:39

Judging History

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

  • [2024-01-12 23:40:39]
  • 评测
  • 测评结果:WA
  • 用时:7ms
  • 内存:5136kb
  • [2024-01-12 23:40:38]
  • 提交

answer

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

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

signed main()
{
//	freopen("temp.in","r",stdin);
//	freopen("temp.out","w",stdout);
	ios::sync_with_stdio(false);
	cin.tie(0); cout.tie(0);
	cin>>n>>gg;
	for(int i=0;i<n;i++) cin>>a[i];
	for(int i=0;i<n;i++)
	{
		if(!a[(i-1+n)%n]) b[i]++;
		if(!a[(i+1)%n]) b[i]++;
		if(!a[i]) b[i]++;
	}
	sort(b,b+n);
	int s=0;
	for(int i=1;i<=gg;i++) s+=b[i];
	cout<<3*n-s;
	return 0;
}

詳細信息

Test #1:

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

input:

5 2
1 0 1 0 1

output:

13

result:

ok 1 number(s): "13"

Test #2:

score: -100
Wrong Answer
time: 7ms
memory: 5136kb

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:

279235

result:

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