QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#333565#8213. Graffitidanielkou5855WA 0ms3556kbC++17835b2024-02-20 08:27:482024-02-20 08:27:48

Judging History

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

  • [2024-02-20 08:27:48]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3556kb
  • [2024-02-20 08:27:48]
  • 提交

answer

// Source: https://usaco.guide/general/io

#include <cstdlib>
#include <cstring>
#include <iostream>
#include <vector>
#include <chrono>
#include <algorithm>
#include <map>
#include <set>
#include <queue>
#include <string>
#include <bitset>
#include <random>

#define int long long
#define sz(x) (int) x.size()
#define all(x) x.begin(), x.end()

using namespace std;

vector<vector<int>> adj;

signed main() {
    cin.tie(0) -> sync_with_stdio(false);

    int N; string W;

	cin >> N >> W;

	adj.resize(N);

	for (int i = 0; i < N - 1; i++) {
		int a, b; cin >> a >> b; a--; b--;

		adj[a].push_back(b); adj[b].push_back(a);
	}

	if (W.length() == 1) {
		cout << N << "\n";
		return 0;
	} else if (W.length() == 2) {
		cout << 2 * (N - 1) << "\n";
		return 0;
	} 

	cout << "fuck\n";
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

1
a

output:

1

result:

ok 1 number(s): "1"

Test #2:

score: -100
Wrong Answer
time: 0ms
memory: 3556kb

input:

3
orz
1 2
2 3

output:

fuck

result:

wrong output format Expected integer, but "fuck" found