QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#333564#8213. Graffitidanielkou5855RE 0ms3552kbC++17806b2024-02-20 08:27:042024-02-20 08:27:05

Judging History

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

  • [2024-02-20 08:27:05]
  • 评测
  • 测评结果:RE
  • 用时:0ms
  • 内存:3552kb
  • [2024-02-20 08:27:04]
  • 提交

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;

	for (int i = 0; i < N - 1; i++) {
		int a, b; cin >> 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: 3552kb

input:

1
a

output:

1

result:

ok 1 number(s): "1"

Test #2:

score: -100
Runtime Error

input:

3
orz
1 2
2 3

output:


result: