QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#591912#2827. Autobiographylonelywolf#WA 0ms3824kbC++20710b2024-09-26 19:03:332024-09-26 19:03:34

Judging History

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

  • [2024-09-26 19:03:34]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3824kb
  • [2024-09-26 19:03:33]
  • 提交

answer

#include <bits/stdc++.h>  
using namespace std;  

#define int long long  

signed main() {  
    ios::sync_with_stdio(false);
    cin.tie(nullptr);  

 	int n, m;
	vector<int> col(n + 1);
	for (int i = 1; i <= n; i++) {
		char c;
		cin >> c;

		col[i] = c == 'o' ? 0 : 1;
	}

	vector cnt(n + 1, vector<int>(2));
	vector<pair<int, int>> e(m);
	for (int i = 0; i < m; i++) {
		int x, y;
		cin >> x >> y;
		e[i] = {x, y};

		if (col[x] != col[y]) {
			cnt[x][col[y]]++;
			cnt[y][col[x]]++;
		}
	}

	int ans = 0;
	for (auto [x, y] : e) {
		if (col[x] != col[y]) {
			ans += (cnt[x][col[y]] - 1) * (cnt[y][col[x]] - 1);
		}
	}

	cout << ans << "\n";

    return 0;
}  
  

詳細信息

Test #1:

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

input:

5 4
bbobo
1 3
2 3
3 4
4 5
4 6
bobo
1 2
1 3
1 4
2 3
2 4
3 4
4 0
bobo

output:

0

result:

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