QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#691949#6700. Game on a GraphKdlyh#WA 54ms3976kbC++201.9kb2024-10-31 13:30:502024-10-31 13:30:57

Judging History

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

  • [2024-10-31 13:30:57]
  • 评测
  • 测评结果:WA
  • 用时:54ms
  • 内存:3976kb
  • [2024-10-31 13:30:50]
  • 提交

answer

#include <cassert>
#include <cmath>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <functional>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
#include <stack>

#ifdef LOCAL
template <class T, size_t size = std::tuple_size<T>::value> std::string to_debug(T, std::string s = "") requires(not std::ranges::range<T>);
std::string to_debug(auto x) requires requires(std::ostream& os) { os << x; } { return static_cast<std::ostringstream>(std::ostringstream() << x).str(); }
std::string to_debug(std::ranges::range auto x, std::string s = "") requires(not std::is_same_v<decltype(x), std::string>) {
  for (auto xi : x) { s += ", " + to_debug(xi); }
  return "[" + s.substr(s.empty() ? 0 : 2) + "]";
}
template <class T, size_t size> std::string to_debug(T x, std::string s) requires(not std::ranges::range<T>) {
  [&]<size_t... I>(std::index_sequence<I...>) { ((s += ", " + to_debug(get<I>(x))), ...); }(std::make_index_sequence<size>());
  return "(" + s.substr(s.empty() ? 0 : 2) + ")";
}
#define debug(...) std::cerr << __LINE__ << ": (" #__VA_ARGS__ ") = " << to_debug(std::tuple(__VA_ARGS__)) << "\n"
#else
#define debug(x...)
#endif

using i64 = long long;
#define int long long

void solve()
{
#define tests
    int k; std::cin >> k; std::string str; std::cin >> str;
    int n, m; std::cin >> n >> m; for (int i = 0; i < m; i++) {int u, v; std::cin >> u >> v;}
    std::cout << str.at((m - n + 2) % k) << "\n"; 
}

signed main()
{
    std::cin.tie(nullptr)->sync_with_stdio(false);
    int _{1};
#ifdef tests
    std::cin >> _;
#endif
    while(_--) solve();
    return 0;
}


详细

Test #1:

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

input:

3
5
11212
4 6
0 1
0 2
0 3
1 2
1 3
2 3
5
11121
5 7
0 2
1 3
2 4
0 3
1 2
3 2
4 1
3
121
4 3
0 1
0 2
1 3

output:

2
1
2

result:

ok 3 number(s): "2 1 2"

Test #2:

score: -100
Wrong Answer
time: 54ms
memory: 3976kb

input:

1027
28
1122121222221112112121212112
58 72
32 31
15 56
42 56
31 3
52 57
54 50
47 5
40 22
41 36
42 50
30 28
16 6
28 42
40 23
3 0
4 24
3 50
23 29
53 6
20 27
39 30
7 10
40 43
14 48
27 47
0 6
12 9
25 56
49 41
30 55
13 54
5 11
30 44
6 5
49 34
22 33
1 29
4 39
33 38
35 33
40 2
38 55
47 52
32 52
10 47
26 43...

output:

1
1
2
1
1
2
2
1
1
1
2
1
2
1
2
2
2
1
1
1
1
1
2
2
2
2
1
1
2
1
1
2
2
1
2
1
1
1
1
2
2
1
2
2
2
1
1
2
2
1
1
2
2
2
2
2
2
2
1
2
2
1
1
2
1
2
2
1
2
2
1
2
2
2
2
2
2
2
2
2
2
1
1
1
2
1
1
2
2
1
2
1
2
1
1
2
2
1
2
2
1
2
2
1
1
2
1
1
1
1
1
2
2
2
2
2
2
2
1
1
2
1
1
2
1
1
1
1
2
1
2
2
1
1
2
1
2
1
2
1
1
2
2
2
1
2
2
1
1
1
...

result:

wrong answer 5th numbers differ - expected: '2', found: '1'