Submission #63812117


Source Code Expand

//People who believe in miracles are as amazing as miracles themselves.
#include<bits/stdc++.h>
#define ll long long
using namespace std;
inline ll read(){
    ll x=0,f=1;char ch=getchar();
    while(ch<'0'||ch>'9'){if(ch=='-') f=-f;ch=getchar();}
    while(ch>='0'&&ch<='9')x=(x<<3)+(x<<1)+(ch^48),ch=getchar();
    return x*f;
}

int n; string s;

inline void solve(){
    cin>>s;
    for(auto ch:s){
        ++n;
        if((ch=='i')!=(n&1)) ++n;
    }
    if(n&1) ++n;
    printf("%d\n",n-(int)s.size());
}

signed main(){
#ifndef ONLINE_JUDGE
    freopen("../1.in","r",stdin);
    freopen("../1.out","w",stdout);
#endif
    return solve(),0;
}

Submission Info

Submission Time
Task B - Ticket Gate Log
User include_BM
Language C++ 20 (gcc 12.2)
Score 250
Code Size 677 Byte
Status AC
Exec Time 1 ms
Memory 3856 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 250 / 250
Status
AC × 3
AC × 17
Set Name Test Cases
Sample 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt
All 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 01_random_01.txt, 01_random_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 01_random_06.txt, 01_random_07.txt, 01_random_08.txt, 01_random_09.txt, 01_random_10.txt, 02_handmade_01.txt, 02_handmade_02.txt, 02_handmade_03.txt, 02_handmade_04.txt
Case Name Status Exec Time Memory
00_sample_01.txt AC 1 ms 3672 KiB
00_sample_02.txt AC 1 ms 3648 KiB
00_sample_03.txt AC 1 ms 3808 KiB
01_random_01.txt AC 1 ms 3728 KiB
01_random_02.txt AC 1 ms 3672 KiB
01_random_03.txt AC 1 ms 3788 KiB
01_random_04.txt AC 1 ms 3660 KiB
01_random_05.txt AC 1 ms 3812 KiB
01_random_06.txt AC 1 ms 3732 KiB
01_random_07.txt AC 1 ms 3604 KiB
01_random_08.txt AC 1 ms 3604 KiB
01_random_09.txt AC 1 ms 3856 KiB
01_random_10.txt AC 1 ms 3656 KiB
02_handmade_01.txt AC 1 ms 3784 KiB
02_handmade_02.txt AC 1 ms 3796 KiB
02_handmade_03.txt AC 1 ms 3632 KiB
02_handmade_04.txt AC 1 ms 3672 KiB