Submission #1310286
Source Code Expand
#include <vector> #include <list> #include <map> #include <set> #include <deque> #include <stack> #include <queue> #include <bitset> #include <algorithm> #include <functional> #include <numeric> #include <utility> #include <sstream> #include <iostream> #include <iomanip> #include <cstdio> #include <cmath> #include <cstdlib> #include <cctype> #include <string> #include <cstring> #include <ctime> using namespace std; typedef long long ll; typedef unsigned long long ull; static const double EPS = 1e-8; static const double PI = 4.0 * atan(1.0); static const double PI2 = 8.0 * atan(1.0); #define REP(i,n) for(int i=0;i<(int)n;++i) #define ALL(c) (c).begin(),(c).end() #define CLEAR(v) memset(v,0,sizeof(v)) #define MP(a,b) make_pair((a),(b)) #define ABS(a) ((a)>0?(a):-(a)) #define FOR(i,s,n) for(int i=s;i<(int)n;++i) int main(int argc, char **argv) { string s; cin >> s; ll n = s.length(), res = 0; REP(i, n) { bool u = (s[i] == 'U'); res += (n - i - 1) * (u ? 1 : 2); res += i * (u ? 2 : 1); } cout << res << endl; return 0; }
Submission Info
Submission Time | |
---|---|
Task | B - Evilator |
User | yupotown |
Language | C++14 (GCC 5.4.1) |
Score | 400 |
Code Size | 1104 Byte |
Status | AC |
Exec Time | 5 ms |
Memory | 512 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 400 / 400 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | s1.txt, s2.txt |
All | 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, s1.txt, s2.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
01.txt | AC | 5 ms | 512 KB |
02.txt | AC | 5 ms | 512 KB |
03.txt | AC | 5 ms | 512 KB |
04.txt | AC | 5 ms | 512 KB |
05.txt | AC | 4 ms | 512 KB |
06.txt | AC | 4 ms | 512 KB |
07.txt | AC | 4 ms | 512 KB |
08.txt | AC | 4 ms | 512 KB |
09.txt | AC | 1 ms | 256 KB |
10.txt | AC | 1 ms | 256 KB |
s1.txt | AC | 1 ms | 256 KB |
s2.txt | AC | 1 ms | 256 KB |