Submission #11417063
Source Code Expand
#include <iostream> #include <string> #include <vector> #include <algorithm> #include <utility> #include <tuple> #include <cstdint> #include <cstdio> #include <map> #include <queue> #include <set> #include <stack> #include <deque> #include <unordered_map> #include <unordered_set> #include <bitset> #include <cctype> #include<math.h> using namespace std; #define int long long #define endl "\n" #define fir first #define sec second #define fro front #define m_p make_pair #define mod 1000000007 #define all(v) v.begin(),v.end() #define rep(i,n) for(int i=0; i<(int) (n); i++) #define all(v) v.begin(),v.end() #define vecin(v) for(int i=0; i<(int)v.size(); i++)cin>>v[i]; using namespace std; const int MAX = 510000; const int MOD = 1000000007; long long fac[MAX], finv[MAX], inv[MAX]; int jousu(int x00, int y00) { int z00 = 1; for (int i = 0; i < y00; i++) { z00 *= x00; } return z00; } int keta(int x00) { int z00 = x00; int w00 = 0; while (z00 != 0) { z00 /= 10; w00++; } return w00; } int modinv(int a, int m) { int b = m, u = 1, v = 0; while (b) { int t = a / b; a -= t * b; swap(a, b); u -= t * v; swap(u, v); } u %= m; if (u < 0) u += m; return u; } int modpow(int a, int n) { int res = 1; while (n > 0) { if (n & 1) res* a% mod; a = a * a % mod; n >>= 1; } return res; } int gcd(int xx, int yy) { int p = xx; int q = yy; if (q > p)swap(p, q); while (p % q != 0) { p %= q; swap(p, q); } return q; } int lcm(int xx, int yy) { return xx * yy / gcd(xx, yy); } bool prime(int xx) { int a = xx; for (int i = 2; i * i <= xx; i++) { if (xx % i == 0) { return 0; } } return 1; } int com(int xx, int yy) { int zz = 1; for (int i = xx; i > xx - yy; i--) { zz *= i; zz %= mod; } for (int i = 1; i <= yy; i++) { zz *= modinv(i, mod); zz %= mod; } return zz; } signed main() { int t,a=0,b=0; string s; cin >> s; t = (int)s.size() * (s.size() - 1); rep(i, s.size()) { if (s[i] == 'U') { t += i; } else { t += s.size() - 1 - i; } } cout << t << endl; }
Submission Info
Submission Time | |
---|---|
Task | B - Evilator |
User | aspi |
Language | C++14 (GCC 5.4.1) |
Score | 400 |
Code Size | 2189 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 | 5 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 |