| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 293886 | BThero | Monochrome Points (JOI20_monochrome) | C++17 | 1099 ms | 512 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
// chrono::system_clock::now().time_since_epoch().count()
#include<bits/stdc++.h>
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second
#define all(x) (x).begin(), (x).end()
#define debug(x) cerr << #x << " = " << x << endl;
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int MAXN = 300 + 5;
const int INF = (int)1e9;
char s[2 * MAXN];
int n, ans;
void solve() {
scanf("%d", &n);
scanf("%s", s);
for (int i = 0; i < 2 * n; ++i) {
vector<char> vec;
for (int j = 0; j < n; ++j) {
vec.pb(s[j]);
}
int cur = 0;
for (int j = n; j < 2 * n; ++j) {
auto it = find(all(vec), ('B' ^ 'W' ^ s[j]));
cur += (vec.end() - it - 1);
vec.erase(it);
}
ans = max(ans, cur);
rotate(s, s + 1, s + 2 * n);
}
printf("%d\n", ans);
}
int main() {
int tt = 1;
while (tt--) {
solve();
}
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
