QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#137274#2358. What? Subtasks? Again?Vengeful_Spirit#WA 1ms3872kbC++20609b2023-08-10 09:10:282023-08-10 09:10:30

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-08-10 09:10:30]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3872kb
  • [2023-08-10 09:10:28]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
const int N=1e6+5;
vector<int>e[5];
int vis[N];
int main(){
  int n,m,k;
  scanf("%d%d%d",&n,&m,&k);
  for(int i=1;i<=k;i++){
    int x,y;
    scanf("%d%d",&x,&y);
    y--;
    e[y].push_back(x);
  }
  int ans=-1;
  for(int i=0;i<(1<<5);i++){
    for(int j=0;j<5;j++){
      if(i>>j&1){
	for(auto v:e[j])vis[v]=i;
      }
    }
    int cnt=0;
    for(int j=1;j<=n;j++){
      if(vis[j]!=i)++cnt;
    }
    if(cnt<=m)ans=max(ans,cnt);
  }
  if(ans==-1){
    puts("Round will be unrated");
  }
  else{
    printf("%d\n",ans);
  }
}

詳細信息

Test #1:

score: 100
Accepted
time: 1ms
memory: 3744kb

input:

10 7 10
2 1
3 5
2 1
4 1
9 5
5 4
6 4
7 4
8 4
10 4

output:

6

result:

ok single line: '6'

Test #2:

score: -100
Wrong Answer
time: 1ms
memory: 3872kb

input:

10 9 0

output:

0

result:

wrong answer 1st lines differ - expected: 'Round will be unrated', found: '0'