Submission #998010
Source Code Expand
#include <algorithm> #include <cassert> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <deque> #include <iomanip> #include <iostream> #include <limits> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> #define FOR(i,k,n) for (int (i)=(k); (i)<(n); ++(i)) #define rep(i,n) FOR(i,0,n) #define pb push_back #define eb emplace_back #define mp make_pair #define fst first #define snd second #define all(v) begin(v), end(v) #define debug(x) cerr<< #x <<": "<<x<<endl #define debug2(x,y) cerr<< #x <<": "<< x <<", "<< #y <<": "<< y <<endl using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair<int, int> pii; typedef vector<int> vi; typedef vector<vector<int> > vvi; typedef vector<ll> vll; typedef vector<vector<ll> > vvll; typedef vector<char> vc; typedef vector<vector<char> > vvc; typedef vector<double> vd; typedef vector<vector<double> > vvd; template<class T> using vv=vector<vector< T > >; typedef deque<int> di; typedef deque<deque<int> > ddi; typedef deque<bool> db; typedef deque<deque<bool> > ddb; int main() { int n; cin >> n; vi a(n); rep (i, n) { cin >> a[i]; } string s; cin >> s; int M, m; M = 0; rep (i, n-1) { if (s[i] == 'M') { M += 1; } else { break; } } m = n-1 - M; vi maxM(n-M, 0); rep (i, n) { for (int j = max(0, i-M); j <= min(i, n-M-1); ++j) { maxM[j] = max(maxM[j], a[i]); } } rep (i, n) { for (int j = max(0, i-M); j <= min(i, n-M-1); ++j) { maxM[j] = max(maxM[j], a[i]); } } sort(all(maxM)); printf("%d\n", maxM[0]); return 0; }
Submission Info
Submission Time | |
---|---|
Task | B - Compression |
User | tspcx |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 1774 Byte |
Status | WA |
Exec Time | 2102 ms |
Memory | 1408 KB |
Judge Result
Set Name | Sample | subtask1 | subtask2 | All | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 400 | 0 / 800 | 0 / 200 | ||||||||||||||||||
Status |
|
|
|
|
Set Name | Test Cases |
---|---|
Sample | sample_1.txt, sample_2.txt, sample_3.txt, sample_4.txt |
subtask1 | sample_2.txt, subtask_1.2_1.txt, subtask_1.2_2.txt, subtask_1_1.txt, subtask_1_10.txt, subtask_1_2.txt, subtask_1_3.txt, subtask_1_4.txt, subtask_1_5.txt, subtask_1_6.txt, subtask_1_7.txt, subtask_1_8.txt, subtask_1_9.txt |
subtask2 | sample_1.txt, subtask_1.2_1.txt, subtask_1.2_2.txt, subtask_2_1.txt, subtask_2_10.txt, subtask_2_2.txt, subtask_2_3.txt, subtask_2_4.txt, subtask_2_5.txt, subtask_2_6.txt, subtask_2_7.txt, subtask_2_8.txt, subtask_2_9.txt |
All | sample_1.txt, sample_2.txt, sample_3.txt, sample_4.txt, 2_1.txt, 2_2.txt, subtask_1.2_1.txt, subtask_1.2_2.txt, subtask_1_1.txt, subtask_1_10.txt, subtask_1_2.txt, subtask_1_3.txt, subtask_1_4.txt, subtask_1_5.txt, subtask_1_6.txt, subtask_1_7.txt, subtask_1_8.txt, subtask_1_9.txt, subtask_2_1.txt, subtask_2_10.txt, subtask_2_2.txt, subtask_2_3.txt, subtask_2_4.txt, subtask_2_5.txt, subtask_2_6.txt, subtask_2_7.txt, subtask_2_8.txt, subtask_2_9.txt, subtask_3_1.txt, subtask_3_10.txt, subtask_3_11.txt, subtask_3_12.txt, subtask_3_13.txt, subtask_3_14.txt, subtask_3_15.txt, subtask_3_16.txt, subtask_3_17.txt, subtask_3_18.txt, subtask_3_19.txt, subtask_3_2.txt, subtask_3_20.txt, subtask_3_21.txt, subtask_3_3.txt, subtask_3_4.txt, subtask_3_5.txt, subtask_3_6.txt, subtask_3_7.txt, subtask_3_8.txt, subtask_3_9.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
2_1.txt | AC | 3 ms | 256 KB |
2_2.txt | AC | 3 ms | 384 KB |
sample_1.txt | WA | 3 ms | 256 KB |
sample_2.txt | AC | 3 ms | 384 KB |
sample_3.txt | WA | 3 ms | 256 KB |
sample_4.txt | WA | 3 ms | 256 KB |
subtask_1.2_1.txt | AC | 3 ms | 256 KB |
subtask_1.2_2.txt | AC | 3 ms | 256 KB |
subtask_1_1.txt | AC | 1524 ms | 1152 KB |
subtask_1_10.txt | TLE | 2102 ms | 1024 KB |
subtask_1_2.txt | TLE | 2042 ms | 896 KB |
subtask_1_3.txt | AC | 94 ms | 896 KB |
subtask_1_4.txt | TLE | 2102 ms | 768 KB |
subtask_1_5.txt | AC | 9 ms | 384 KB |
subtask_1_6.txt | TLE | 2102 ms | 1152 KB |
subtask_1_7.txt | AC | 3 ms | 256 KB |
subtask_1_8.txt | TLE | 2102 ms | 1024 KB |
subtask_1_9.txt | TLE | 2102 ms | 1024 KB |
subtask_2_1.txt | WA | 40 ms | 1280 KB |
subtask_2_10.txt | WA | 41 ms | 1280 KB |
subtask_2_2.txt | WA | 41 ms | 1280 KB |
subtask_2_3.txt | WA | 41 ms | 1280 KB |
subtask_2_4.txt | WA | 41 ms | 1280 KB |
subtask_2_5.txt | AC | 3 ms | 256 KB |
subtask_2_6.txt | AC | 3 ms | 256 KB |
subtask_2_7.txt | WA | 3 ms | 256 KB |
subtask_2_8.txt | WA | 40 ms | 1280 KB |
subtask_2_9.txt | WA | 11 ms | 512 KB |
subtask_3_1.txt | WA | 41 ms | 1408 KB |
subtask_3_10.txt | WA | 41 ms | 1280 KB |
subtask_3_11.txt | WA | 40 ms | 1280 KB |
subtask_3_12.txt | AC | 41 ms | 1280 KB |
subtask_3_13.txt | WA | 41 ms | 1280 KB |
subtask_3_14.txt | WA | 41 ms | 1280 KB |
subtask_3_15.txt | AC | 41 ms | 1280 KB |
subtask_3_16.txt | AC | 41 ms | 1280 KB |
subtask_3_17.txt | WA | 41 ms | 1280 KB |
subtask_3_18.txt | WA | 40 ms | 1280 KB |
subtask_3_19.txt | WA | 40 ms | 1280 KB |
subtask_3_2.txt | WA | 41 ms | 1280 KB |
subtask_3_20.txt | WA | 43 ms | 1280 KB |
subtask_3_21.txt | WA | 40 ms | 1280 KB |
subtask_3_3.txt | WA | 7 ms | 384 KB |
subtask_3_4.txt | WA | 36 ms | 1152 KB |
subtask_3_5.txt | WA | 33 ms | 1024 KB |
subtask_3_6.txt | WA | 41 ms | 1280 KB |
subtask_3_7.txt | WA | 41 ms | 1280 KB |
subtask_3_8.txt | WA | 40 ms | 1280 KB |
subtask_3_9.txt | WA | 41 ms | 1280 KB |