Submission #3402878
Source Code Expand
#include <bits/stdc++.h> using namespace std; typedef unsigned long long ull; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef pair<double, double> pdd; const ull mod = 1e9 + 7; #define REP(i,n) for(int i=0;i<(int)n;++i) const ll LLINF = LLONG_MAX/3; int main(){ int N; cin >> N; vector<int> dir(N); string S; cin >> S; REP(i, N) dir[i] = (S[i]=='W'); vector<int> dir_sum(N+1); dir_sum[0] = 0; REP(i, N) dir_sum[i+1] = dir_sum[i] + dir[i]; ll res = LLINF; REP(i, N){ cout << left_west << " " << right_west << endl; res = min(res, left_west + (N-i-1-right_west)); } cout << res << endl; return 0; }
Submission Info
Submission Time | |
---|---|
Task | C - Attention |
User | theory_and_me |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 684 Byte |
Status | CE |
Compile Error
./Main.cpp: In function ‘int main()’: ./Main.cpp:25:11: error: ‘left_west’ was not declared in this scope cout << left_west << " " << right_west << endl; ^ ./Main.cpp:25:31: error: ‘right_west’ was not declared in this scope cout << left_west << " " << right_west << endl; ^