| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 449555 | CyberSleeper | Miners (IOI07_miners) | C++14 | 1577 ms | 844 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL)
#define debug(x) cout << "Line " << __LINE__ << ", " << #x << " is " << x << endl
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define ll long long
#define ull unsigned long long
#define ld long double
#define pld pair<ld, ld>
#define pli pair<ld, int>
#define pii pair<int, int>
#define pis pair<int, string>
#define pl pair<ll, ll>
#define nl '\n'
using namespace std;
int N;
string S, food="MFB";
int main(){
fastio;
cin >> N >> S;
int ans=0;
for(int i=0; i<(1<<N); i++){
string A="", B="";
for(int j=0; j<N; j++){
if(i&(1<<j))
A+=S[j];
else
B+=S[j];
}
int tmp=0;
int cnt[3]={0, 0, 0};
for(int j=0; j<A.size(); j++){
for(int l=0; l<3; l++){
if(A[j]==food[l]){
cnt[l]++;
}
if(j>2 && A[j-3]==food[l])
cnt[l]--;
}
for(int l=0; l<3; l++)
if(cnt[l])
tmp++;
}
cnt[0]=cnt[1]=cnt[2]=0;
for(int j=0; j<B.size(); j++){
for(int l=0; l<3; l++){
if(B[j]==food[l]){
cnt[l]++;
}
if(j>2 && B[j-3]==food[l])
cnt[l]--;
}
for(int l=0; l<3; l++)
if(cnt[l])
tmp++;
}
ans=max(ans, tmp);
}
cout << ans << endl;
}
컴파일 시 표준 에러 (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... | ||||
| # | 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... | ||||
| # | 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... | ||||
