Submission #37493351


Source Code Expand

#include<bits/stdc++.h>
using namespace std;
#define int long long
#define f(i,j,k) for(register int i=j;i<=k;++i)
#define g(i,j,k) for(register int i=j;i>=k;--i)
int n,m,s,l;
string a;
signed main(){
	cin>>a;n=a.size();a=" "+a+" ";
    f(i,1,n)i+=(a[i]=='0'&&a[i+1]=='0'),++s;
    cout<<s;
    return 0;
}

Submission Info

Submission Time
Task C - Cash Register
User scyxdl
Language C++ (GCC 9.2.1)
Score 300
Code Size 318 Byte
Status AC
Exec Time 14 ms
Memory 3736 KiB

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:10:7: warning: ISO C++17 does not allow ‘register’ storage class specifier [-Wregister]
   10 |     f(i,1,n)i+=(a[i]=='0'&&a[i+1]=='0'),++s;
      |       ^
./Main.cpp:4:35: note: in definition of macro ‘f’
    4 | #define f(i,j,k) for(register int i=j;i<=k;++i)
      |                                   ^

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 3
AC × 15
Set Name Test Cases
Sample 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt
All 00_sample_00.txt, 00_sample_01.txt, 00_sample_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, 01_random_11.txt, 01_random_12.txt, 01_random_13.txt, 01_random_14.txt
Case Name Status Exec Time Memory
00_sample_00.txt AC 4 ms 3468 KiB
00_sample_01.txt AC 2 ms 3456 KiB
00_sample_02.txt AC 2 ms 3556 KiB
01_random_03.txt AC 5 ms 3540 KiB
01_random_04.txt AC 14 ms 3736 KiB
01_random_05.txt AC 5 ms 3704 KiB
01_random_06.txt AC 6 ms 3584 KiB
01_random_07.txt AC 6 ms 3588 KiB
01_random_08.txt AC 4 ms 3648 KiB
01_random_09.txt AC 2 ms 3460 KiB
01_random_10.txt AC 3 ms 3588 KiB
01_random_11.txt AC 6 ms 3600 KiB
01_random_12.txt AC 3 ms 3572 KiB
01_random_13.txt AC 2 ms 3464 KiB
01_random_14.txt AC 6 ms 3736 KiB