Submission #68682513
Source Code Expand
Copy
#include <stdio.h>int main(void) {const char* target = "tea";int pos = 0;int nlc = 0;int c;while ((c = getchar()) != EOF && c != '\0' && (nlc += c == '\n') < 2) {if (c == target[pos]) {pos++;} else {pos = 0;if (c == target[pos]) pos++;}}puts(target[pos] == '\0' ? "Yes" : "No");return 0;}
#include <stdio.h>
int main(void) {
const char* target = "tea";
int pos = 0;
int nlc = 0;
int c;
while ((c = getchar()) != EOF && c != '\0' && (nlc += c == '\n') < 2) {
if (c == target[pos]) {
pos++;
} else {
pos = 0;
if (c == target[pos]) pos++;
}
}
puts(target[pos] == '\0' ? "Yes" : "No");
return 0;
}
Submission Info
| Submission Time | |
|---|---|
| Task | A - I'm a teapot |
| User | mikecat |
| Language | C (gcc 12.2.0) |
| Score | 100 |
| Code Size | 347 Byte |
| Status | AC |
| Exec Time | 1 ms |
| Memory | 1628 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 100 / 100 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt |
| All | 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 01_random_00.txt, 01_random_01.txt, 01_random_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 02_corner_00.txt, 02_corner_01.txt, 02_corner_02.txt, 02_corner_03.txt, 02_corner_04.txt, 02_corner_05.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 00_sample_00.txt | AC | 1 ms | 1508 KiB |
| 00_sample_01.txt | AC | 1 ms | 1504 KiB |
| 00_sample_02.txt | AC | 1 ms | 1500 KiB |
| 00_sample_03.txt | AC | 0 ms | 1504 KiB |
| 01_random_00.txt | AC | 0 ms | 1612 KiB |
| 01_random_01.txt | AC | 0 ms | 1500 KiB |
| 01_random_02.txt | AC | 0 ms | 1500 KiB |
| 01_random_03.txt | AC | 1 ms | 1508 KiB |
| 01_random_04.txt | AC | 1 ms | 1624 KiB |
| 01_random_05.txt | AC | 1 ms | 1628 KiB |
| 02_corner_00.txt | AC | 1 ms | 1628 KiB |
| 02_corner_01.txt | AC | 1 ms | 1504 KiB |
| 02_corner_02.txt | AC | 1 ms | 1504 KiB |
| 02_corner_03.txt | AC | 0 ms | 1508 KiB |
| 02_corner_04.txt | AC | 0 ms | 1500 KiB |
| 02_corner_05.txt | AC | 0 ms | 1504 KiB |