Submission #15575244


Source Code Expand

Copy
#include <bits/stdc++.h>
#define rep(i, a, b) for(int i = a; i < b; i++)
#define Rep(i, a, b) for(int i = a; i <= b; i++)
#define repr(i, a, b) for(int i = b-1; i >= a; i--)
#define _GLIBCXX_DEBUG
#define Vl vector<ll>
#define Vs vector<string>
#define Vp vector<pair<ll, ll>>
using ll = long long;
#define ALL(v) (v).begin(),(v).end()
#define endl "\n"
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define co(x) cout << x << endl
#define coel cout << endl
#define pb push_back
#define sz(v) ((ll)(v).size())
using namespace std;  
const double pi = acos(-1.0);
const ll MOD = 1e9 + 7;
const ll INF = 1LL << 60;
#define pp pair<ll, pair<ll, ll>> 
#define fi first
#define se second

////////////////////////////////////////////////////////


int main() {
    string s; cin >> s;
    ll a = 0;
    ll ans = 0;
    rep(i, 0, sz(s)-1){
        if(s[i]=='2'&&s[i+1]=='5'){
            a++;
            ans += a;
            i++;
        }else {
            a = 0;
        }
    }
    co(ans);

    return 0;
}


Submission Info

Submission Time
Task B - ニコニコ文字列
User SEEL
Language C++ (GCC 9.2.1)
Score 100
Code Size 1078 Byte
Status
Exec Time 9 ms
Memory 3772 KB

Judge Result

Set Name Score / Max Score Test Cases
Sample 0 / 0 subtask0_sample_01.txt, subtask0_sample_02.txt, subtask0_sample_03.txt, subtask0_sample_04.txt, subtask0_sample_05.txt
Subtask1 30 / 30 subtask1_01.txt, subtask1_02.txt, subtask1_03.txt, subtask1_04.txt, subtask1_05.txt, subtask1_06.txt, subtask1_07.txt, subtask1_08.txt, subtask1_09.txt, subtask1_10.txt, subtask1_11.txt, subtask1_12.txt, subtask1_13.txt, subtask0_sample_01.txt, subtask0_sample_02.txt, subtask0_sample_03.txt, subtask0_sample_04.txt, subtask0_sample_05.txt
All 70 / 70 subtask0_sample_01.txt, subtask0_sample_02.txt, subtask0_sample_03.txt, subtask0_sample_04.txt, subtask0_sample_05.txt, subtask1_01.txt, subtask1_02.txt, subtask1_03.txt, subtask1_04.txt, subtask1_05.txt, subtask1_06.txt, subtask1_07.txt, subtask1_08.txt, subtask1_09.txt, subtask1_10.txt, subtask1_11.txt, subtask1_12.txt, subtask1_13.txt, subtask2_01.txt, subtask2_02.txt, subtask2_03.txt, subtask2_04.txt, subtask2_05.txt, subtask2_06.txt, subtask2_07.txt, subtask2_08.txt, subtask2_09.txt, subtask2_10.txt, subtask2_11.txt, subtask2_12.txt
Case Name Status Exec Time Memory
subtask0_sample_01.txt 8 ms 3504 KB
subtask0_sample_02.txt 2 ms 3504 KB
subtask0_sample_03.txt 2 ms 3616 KB
subtask0_sample_04.txt 2 ms 3572 KB
subtask0_sample_05.txt 2 ms 3640 KB
subtask1_01.txt 2 ms 3504 KB
subtask1_02.txt 4 ms 3584 KB
subtask1_03.txt 2 ms 3620 KB
subtask1_04.txt 2 ms 3584 KB
subtask1_05.txt 2 ms 3616 KB
subtask1_06.txt 2 ms 3592 KB
subtask1_07.txt 2 ms 3616 KB
subtask1_08.txt 2 ms 3604 KB
subtask1_09.txt 2 ms 3648 KB
subtask1_10.txt 2 ms 3512 KB
subtask1_11.txt 2 ms 3560 KB
subtask1_12.txt 2 ms 3572 KB
subtask1_13.txt 2 ms 3556 KB
subtask2_01.txt 4 ms 3700 KB
subtask2_02.txt 5 ms 3764 KB
subtask2_03.txt 8 ms 3696 KB
subtask2_04.txt 5 ms 3676 KB
subtask2_05.txt 5 ms 3772 KB
subtask2_06.txt 6 ms 3716 KB
subtask2_07.txt 9 ms 3692 KB
subtask2_08.txt 5 ms 3632 KB
subtask2_09.txt 2 ms 3536 KB
subtask2_10.txt 2 ms 3608 KB
subtask2_11.txt 2 ms 3632 KB
subtask2_12.txt 1 ms 3588 KB