QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#736964#9623. 合成大西瓜ehdxbcWA 0ms3852kbC++20618b2024-11-12 14:04:372024-11-12 14:04:38

Judging History

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

  • [2024-11-12 14:04:38]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3852kb
  • [2024-11-12 14:04:37]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> PII;
signed main() {
   ios::sync_with_stdio(false);
   cin.tie(nullptr);
   cout.tie(0);
   int n, m;
   cin >> n >> m;
   vector<PII> a(n);
   for (int i = 0; i < n; i++) {
      cin >> a[i].first;
      a[i].second = i;
   }
   vector<int> out(n);
   for (int i = 0; i < m; i++) {
      int x, y;
      cin >> x >> y;
      x--, y--;
      out[x]++;
      out[y]++;
   }
   sort(a.begin(), a.end());
   if (out[a[0].second] != 1) {
      cout << a[0].first << endl;
   } else {
      cout << a[1].first << endl;
   }
}

詳細信息

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3852kb

input:

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

output:

1

result:

wrong answer 1st lines differ - expected: '6', found: '1'