Submission #6505574
Source Code Expand
#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
int n, cnt;
int flag = 0;
string s;
int ans = 0;
cin >> n;
cin >> s;
for (size_t i = 0; i < n; i++) {
if (s[i] == '#') {
cnt = i;
flag = 1;
break;
}
}
for (size_t i = 0; i < n; i++) {
if (1 == flag && s[i] == '.' && i > cnt)
ans++;
else if (0 == flag && s[i] == '.')
ans++;
}
cout << ans << endl;
return 0;
}
Submission Info
| Submission Time | |
|---|---|
| Task | C - Stones |
| User | s1870284 |
| Language | C++14 (GCC 5.4.1) |
| Score | 0 |
| Code Size | 497 Byte |
| Status | WA |
| Exec Time | 8 ms |
| Memory | 640 KiB |
Judge Result
| Set Name | Sample | All | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 0 / 300 | ||||||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | s1.txt, s2.txt, s3.txt |
| All | 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, 11.txt, 12.txt, 13.txt, 14.txt, 15.txt, 16.txt, 17.txt, 18.txt, 19.txt, 20.txt, 21.txt, 22.txt, s1.txt, s2.txt, s3.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 01.txt | WA | 8 ms | 640 KiB |
| 02.txt | WA | 8 ms | 640 KiB |
| 03.txt | AC | 8 ms | 640 KiB |
| 04.txt | WA | 8 ms | 640 KiB |
| 05.txt | WA | 8 ms | 640 KiB |
| 06.txt | WA | 8 ms | 640 KiB |
| 07.txt | WA | 8 ms | 640 KiB |
| 08.txt | WA | 8 ms | 640 KiB |
| 09.txt | AC | 8 ms | 640 KiB |
| 10.txt | AC | 8 ms | 640 KiB |
| 11.txt | WA | 8 ms | 640 KiB |
| 12.txt | AC | 8 ms | 640 KiB |
| 13.txt | AC | 8 ms | 640 KiB |
| 14.txt | AC | 8 ms | 640 KiB |
| 15.txt | AC | 8 ms | 640 KiB |
| 16.txt | AC | 8 ms | 640 KiB |
| 17.txt | AC | 8 ms | 640 KiB |
| 18.txt | AC | 8 ms | 640 KiB |
| 19.txt | WA | 1 ms | 256 KiB |
| 20.txt | AC | 1 ms | 256 KiB |
| 21.txt | AC | 1 ms | 256 KiB |
| 22.txt | AC | 1 ms | 256 KiB |
| s1.txt | AC | 1 ms | 256 KiB |
| s2.txt | AC | 1 ms | 256 KiB |
| s3.txt | WA | 1 ms | 256 KiB |