# | Submission time^{} |
Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|

479974 | 2021-10-14T04:28:41 Z | Evang | Combo (IOI18_combo) | C++17 | 73 ms | 484 KB |

#include <bits/stdc++.h> using namespace std; #ifdef _DEBUG #define dout(x) clog << "Line " << __LINE__ << ": " << #x << "=" << (x) << el #else #define dout(x) #endif #define mp(a, b) make_pair(a, b) #define mt(args...) make_tuple(args) #define pb(x) push_back(x) #define eb(args...) emplace_back(args) #define ff first #define ss second #define DIE exit(0) template<typename T> using vc = vector<T>; template<typename T> using uset = unordered_set<T>; template<typename A, typename B> using umap = unordered_map<A, B>; template<typename T, typename Comp> using pq = priority_queue<T, vc<T>, Comp>; template<typename T> using maxpq = pq<T, less<T>>; template<typename T> using minpq = pq<T, greater<T>>; using db = double; using ld = long double; using ll = long long; using ull = unsigned long long; using pi = pair<int, int>; using pll = pair<ll, ll>; using vi = vc<int>; using vll = vc<ll>; using vpi = vc<pi>; using vpll = vc<pll>; using str = string; constexpr char el = '\n'; constexpr char sp = ' '; constexpr int inf = 0x3f3f3f3f; constexpr ll llinf = 0x3f3f3f3f3f3f3f3fLL; // --------------------------------------------------------------------- const char c[] = {'A', 'B', 'X', 'Y'}; int press(str p); str guess_sequence(int n){ str s; while(s.size()<n){ int L = 0, R = 3; while(L<R){ int m = (L+R)/2; str t; for(int i = L; i <= m; ++i) t += s + c[i]; if(press(t)>s.size()) R = m; else L = m+1; } s += c[L]; } return s; } #ifdef _DEBUG signed main() { ios::sync_with_stdio(0); int n; cin >> n; cout << guess_sequence(n); } int press(string p){ cout << p << el; int ans; cin >> ans; return ans; } #endif

### Compilation message

# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|

1 | Correct | 1 ms | 200 KB | Output is correct |

2 | Correct | 0 ms | 200 KB | Output is correct |

3 | Correct | 1 ms | 200 KB | Output is correct |

4 | Correct | 1 ms | 200 KB | Output is correct |

5 | Correct | 1 ms | 200 KB | Output is correct |

6 | Correct | 0 ms | 200 KB | Output is correct |

7 | Correct | 1 ms | 200 KB | Output is correct |

8 | Correct | 0 ms | 200 KB | Output is correct |

9 | Correct | 0 ms | 200 KB | Output is correct |

10 | Correct | 1 ms | 200 KB | Output is correct |

11 | Correct | 1 ms | 200 KB | Output is correct |

12 | Correct | 1 ms | 200 KB | Output is correct |

13 | Correct | 1 ms | 200 KB | Output is correct |

14 | Correct | 1 ms | 200 KB | Output is correct |

15 | Correct | 1 ms | 200 KB | Output is correct |

16 | Correct | 0 ms | 200 KB | Output is correct |

17 | Correct | 0 ms | 200 KB | Output is correct |

18 | Correct | 0 ms | 200 KB | Output is correct |

19 | Correct | 0 ms | 200 KB | Output is correct |

20 | Correct | 0 ms | 200 KB | Output is correct |

21 | Correct | 1 ms | 200 KB | Output is correct |

22 | Correct | 1 ms | 200 KB | Output is correct |

23 | Correct | 1 ms | 200 KB | Output is correct |

24 | Correct | 1 ms | 200 KB | Output is correct |

25 | Correct | 0 ms | 200 KB | Output is correct |

26 | Correct | 1 ms | 200 KB | Output is correct |

27 | Correct | 0 ms | 200 KB | Output is correct |

28 | Correct | 1 ms | 200 KB | Output is correct |

29 | Correct | 0 ms | 200 KB | Output is correct |

30 | Correct | 1 ms | 200 KB | Output is correct |

31 | Correct | 1 ms | 200 KB | Output is correct |

32 | Correct | 0 ms | 200 KB | Output is correct |

33 | Correct | 1 ms | 200 KB | Output is correct |

34 | Correct | 1 ms | 200 KB | Output is correct |

35 | Correct | 1 ms | 200 KB | Output is correct |

36 | Correct | 1 ms | 200 KB | Output is correct |

# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|

1 | Correct | 1 ms | 200 KB | Output is correct |

2 | Correct | 1 ms | 200 KB | Output is correct |

3 | Correct | 1 ms | 200 KB | Output is correct |

4 | Correct | 1 ms | 200 KB | Output is correct |

5 | Correct | 0 ms | 200 KB | Output is correct |

6 | Correct | 1 ms | 200 KB | Output is correct |

7 | Correct | 0 ms | 200 KB | Output is correct |

8 | Correct | 0 ms | 200 KB | Output is correct |

9 | Correct | 0 ms | 200 KB | Output is correct |

10 | Correct | 0 ms | 200 KB | Output is correct |

11 | Correct | 1 ms | 200 KB | Output is correct |

12 | Correct | 0 ms | 200 KB | Output is correct |

13 | Correct | 1 ms | 200 KB | Output is correct |

14 | Correct | 1 ms | 200 KB | Output is correct |

15 | Correct | 0 ms | 200 KB | Output is correct |

16 | Correct | 0 ms | 200 KB | Output is correct |

17 | Partially correct | 54 ms | 416 KB | Output is partially correct |

18 | Partially correct | 53 ms | 424 KB | Output is partially correct |

19 | Partially correct | 54 ms | 356 KB | Output is partially correct |

20 | Partially correct | 23 ms | 348 KB | Output is partially correct |

21 | Partially correct | 63 ms | 480 KB | Output is partially correct |

22 | Partially correct | 1 ms | 200 KB | Output is partially correct |

23 | Partially correct | 1 ms | 200 KB | Output is partially correct |

24 | Partially correct | 1 ms | 200 KB | Output is partially correct |

25 | Partially correct | 2 ms | 292 KB | Output is partially correct |

26 | Partially correct | 3 ms | 288 KB | Output is partially correct |

27 | Partially correct | 3 ms | 200 KB | Output is partially correct |

28 | Partially correct | 3 ms | 200 KB | Output is partially correct |

29 | Partially correct | 4 ms | 200 KB | Output is partially correct |

30 | Partially correct | 5 ms | 296 KB | Output is partially correct |

31 | Partially correct | 4 ms | 200 KB | Output is partially correct |

32 | Partially correct | 35 ms | 472 KB | Output is partially correct |

33 | Partially correct | 50 ms | 472 KB | Output is partially correct |

34 | Partially correct | 47 ms | 296 KB | Output is partially correct |

35 | Partially correct | 45 ms | 452 KB | Output is partially correct |

36 | Partially correct | 26 ms | 352 KB | Output is partially correct |

37 | Partially correct | 62 ms | 348 KB | Output is partially correct |

38 | Partially correct | 48 ms | 476 KB | Output is partially correct |

39 | Partially correct | 44 ms | 432 KB | Output is partially correct |

40 | Partially correct | 36 ms | 352 KB | Output is partially correct |

41 | Partially correct | 52 ms | 412 KB | Output is partially correct |

42 | Partially correct | 48 ms | 356 KB | Output is partially correct |

43 | Partially correct | 61 ms | 300 KB | Output is partially correct |

44 | Partially correct | 50 ms | 448 KB | Output is partially correct |

45 | Partially correct | 48 ms | 348 KB | Output is partially correct |

46 | Partially correct | 49 ms | 308 KB | Output is partially correct |

47 | Partially correct | 73 ms | 352 KB | Output is partially correct |

48 | Partially correct | 42 ms | 344 KB | Output is partially correct |

49 | Partially correct | 45 ms | 352 KB | Output is partially correct |

50 | Partially correct | 55 ms | 476 KB | Output is partially correct |

51 | Partially correct | 53 ms | 352 KB | Output is partially correct |

52 | Partially correct | 45 ms | 320 KB | Output is partially correct |

53 | Partially correct | 46 ms | 460 KB | Output is partially correct |

54 | Partially correct | 58 ms | 352 KB | Output is partially correct |

55 | Partially correct | 41 ms | 320 KB | Output is partially correct |

56 | Partially correct | 51 ms | 460 KB | Output is partially correct |

57 | Partially correct | 52 ms | 484 KB | Output is partially correct |

58 | Partially correct | 48 ms | 352 KB | Output is partially correct |

59 | Partially correct | 50 ms | 400 KB | Output is partially correct |

60 | Partially correct | 60 ms | 348 KB | Output is partially correct |

61 | Partially correct | 40 ms | 352 KB | Output is partially correct |

62 | Partially correct | 46 ms | 356 KB | Output is partially correct |

63 | Partially correct | 27 ms | 352 KB | Output is partially correct |

64 | Partially correct | 56 ms | 352 KB | Output is partially correct |

65 | Partially correct | 53 ms | 472 KB | Output is partially correct |

66 | Partially correct | 39 ms | 472 KB | Output is partially correct |

67 | Partially correct | 45 ms | 320 KB | Output is partially correct |

68 | Partially correct | 62 ms | 472 KB | Output is partially correct |

69 | Partially correct | 53 ms | 352 KB | Output is partially correct |

70 | Partially correct | 48 ms | 348 KB | Output is partially correct |

71 | Partially correct | 43 ms | 448 KB | Output is partially correct |

72 | Partially correct | 50 ms | 352 KB | Output is partially correct |

73 | Partially correct | 37 ms | 296 KB | Output is partially correct |

74 | Partially correct | 41 ms | 348 KB | Output is partially correct |

75 | Partially correct | 51 ms | 348 KB | Output is partially correct |

76 | Partially correct | 52 ms | 352 KB | Output is partially correct |

77 | Partially correct | 46 ms | 468 KB | Output is partially correct |

78 | Partially correct | 1 ms | 200 KB | Output is partially correct |

79 | Partially correct | 1 ms | 200 KB | Output is partially correct |

80 | Partially correct | 2 ms | 200 KB | Output is partially correct |

81 | Partially correct | 1 ms | 200 KB | Output is partially correct |

82 | Partially correct | 2 ms | 200 KB | Output is partially correct |

83 | Partially correct | 1 ms | 200 KB | Output is partially correct |

84 | Partially correct | 1 ms | 200 KB | Output is partially correct |

85 | Partially correct | 1 ms | 200 KB | Output is partially correct |

86 | Partially correct | 1 ms | 200 KB | Output is partially correct |

87 | Partially correct | 2 ms | 200 KB | Output is partially correct |

88 | Partially correct | 1 ms | 200 KB | Output is partially correct |

89 | Partially correct | 1 ms | 200 KB | Output is partially correct |

90 | Partially correct | 1 ms | 200 KB | Output is partially correct |

91 | Partially correct | 1 ms | 200 KB | Output is partially correct |

92 | Partially correct | 1 ms | 200 KB | Output is partially correct |

93 | Partially correct | 1 ms | 200 KB | Output is partially correct |

94 | Partially correct | 1 ms | 200 KB | Output is partially correct |

95 | Partially correct | 1 ms | 200 KB | Output is partially correct |

96 | Partially correct | 1 ms | 200 KB | Output is partially correct |

97 | Partially correct | 2 ms | 200 KB | Output is partially correct |

98 | Partially correct | 2 ms | 200 KB | Output is partially correct |

99 | Partially correct | 2 ms | 200 KB | Output is partially correct |

100 | Partially correct | 2 ms | 200 KB | Output is partially correct |

101 | Partially correct | 2 ms | 200 KB | Output is partially correct |

102 | Partially correct | 2 ms | 200 KB | Output is partially correct |

103 | Partially correct | 2 ms | 200 KB | Output is partially correct |

104 | Partially correct | 2 ms | 200 KB | Output is partially correct |

105 | Partially correct | 1 ms | 200 KB | Output is partially correct |

106 | Partially correct | 1 ms | 200 KB | Output is partially correct |

107 | Partially correct | 1 ms | 200 KB | Output is partially correct |

108 | Partially correct | 1 ms | 200 KB | Output is partially correct |

109 | Partially correct | 1 ms | 200 KB | Output is partially correct |

110 | Partially correct | 1 ms | 200 KB | Output is partially correct |

111 | Partially correct | 1 ms | 200 KB | Output is partially correct |

112 | Partially correct | 1 ms | 200 KB | Output is partially correct |

113 | Partially correct | 1 ms | 200 KB | Output is partially correct |

114 | Partially correct | 1 ms | 200 KB | Output is partially correct |

115 | Partially correct | 1 ms | 200 KB | Output is partially correct |

116 | Partially correct | 1 ms | 200 KB | Output is partially correct |

117 | Partially correct | 1 ms | 200 KB | Output is partially correct |

118 | Partially correct | 1 ms | 200 KB | Output is partially correct |

119 | Partially correct | 1 ms | 200 KB | Output is partially correct |

120 | Partially correct | 2 ms | 200 KB | Output is partially correct |

121 | Partially correct | 2 ms | 200 KB | Output is partially correct |

122 | Partially correct | 2 ms | 200 KB | Output is partially correct |

123 | Partially correct | 2 ms | 200 KB | Output is partially correct |