Submission #37484942
Source Code Expand
#include <bits/stdc++.h>
using namespace std;
int main(){
string S;
cin >> S;
int N = S.size();
int ans = N;
for (int i = 0; i < N - 1; i++){
if (S[i] == '0' && S[i + 1] == '0'){
ans--;
i++;
}
}
cout << ans << endl;
}
Submission Info
| Submission Time | |
|---|---|
| Task | C - Cash Register |
| User | SSRS |
| Language | C++ (GCC 9.2.1) |
| Score | 300 |
| Code Size | 265 Byte |
| Status | AC |
| Exec Time | 9 ms |
| Memory | 3692 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 300 / 300 | ||||
| Status |
|
|
| 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 | 6 ms | 3444 KiB |
| 00_sample_01.txt | AC | 2 ms | 3492 KiB |
| 00_sample_02.txt | AC | 4 ms | 3532 KiB |
| 01_random_03.txt | AC | 6 ms | 3668 KiB |
| 01_random_04.txt | AC | 6 ms | 3664 KiB |
| 01_random_05.txt | AC | 6 ms | 3648 KiB |
| 01_random_06.txt | AC | 9 ms | 3648 KiB |
| 01_random_07.txt | AC | 4 ms | 3692 KiB |
| 01_random_08.txt | AC | 4 ms | 3680 KiB |
| 01_random_09.txt | AC | 2 ms | 3612 KiB |
| 01_random_10.txt | AC | 3 ms | 3644 KiB |
| 01_random_11.txt | AC | 4 ms | 3648 KiB |
| 01_random_12.txt | AC | 2 ms | 3680 KiB |
| 01_random_13.txt | AC | 2 ms | 3440 KiB |
| 01_random_14.txt | AC | 3 ms | 3648 KiB |