Submission #931559

#TimeUsernameProblemLanguageResultExecution timeMemory
931559PringModern Machine (JOI23_ho_t5)C++14
15 / 100
72 ms836 KiB
#include <bits/stdc++.h> using namespace std; #ifdef MIKU #define debug(x...) cout << "[" << #x << "] : ", dout(x) void dout() { cout << endl; } template <typename T, typename ...U> void dout(T t, U ...u) { cout << t << (sizeof...(u) ? ", " : ""); dout(u...); } #else #define debug(...) 39 #endif #define int long long #define fs first #define sc second #define mp make_pair #define FOR(i, j, k) for (int i = j, Z = k; i < Z; i++) typedef pair<int, int> pii; const int MXN = 7005; int n, m, q, a[MXN]; string s; void DO(int sr) { debug(sr); s[sr] = 'R'; vector<int> B, R; FOR(i, sr + 1, n) if (s[i] == 'B') B.push_back(i); for (int i = sr - 1; i >= 0; i--) if (s[i] == 'R') R.push_back(i); if (B.size() > R.size()) { FOR(i, 0, B[R.size()] + 1) s[i] = 'R'; } else { if (B.empty()) FOR(i, sr, n) s[i] = 'B'; else FOR(i, R[B.size() - 1], n) s[i] = 'B'; } debug(s); } void miku() { int l, r; cin >> n >> m >> s; if (n > MXN || m > MXN) return; FOR(i, 1, m + 1) cin >> a[i]; cin >> q; if (q > 1) return; cin >> l >> r; FOR(i, l, r + 1) DO(a[i] - 1); int ans = 0; for (auto &i : s) ans += (i == 'R'); cout << ans << '\n'; } int32_t main() { cin.tie(0) -> sync_with_stdio(false); cin.exceptions(iostream::failbit); miku(); return 0; }

Compilation message (stderr)

Main.cpp: In function 'void DO(long long int)':
Main.cpp:10:20: warning: statement has no effect [-Wunused-value]
   10 | #define debug(...) 39
      |                    ^~
Main.cpp:25:5: note: in expansion of macro 'debug'
   25 |     debug(sr);
      |     ^~~~~
Main.cpp:10:20: warning: statement has no effect [-Wunused-value]
   10 | #define debug(...) 39
      |                    ^~
Main.cpp:36:5: note: in expansion of macro 'debug'
   36 |     debug(s);
      |     ^~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...