# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
896398 | MongHwa | 스탬프 수집 (JOI16_ho_t2) | C++17 | 5 ms | 3160 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <iostream>
using namespace std;
#define ll long long
ll J[100005], O[100005], I[100005];
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
int n; string s;
cin >> n >> s;
ll org = 0;
for(int i = 0; i < n; i++)
{
J[i+1] = J[i];
if(s[i] == 'J')
J[i+1]++;
}
for(int i = 0; i < n; i++)
{
O[i+1] = O[i];
if(s[i] == 'O')
O[i+1] += J[i+1];
}
for(int i = 0; i < n; i++)
{
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |