페이지

2671번: 잠수함식별

https://www.acmicpc.net/problem/2671


#include<cstdio>
#include<regex>
using namespace std;
char str[151];
int main() {
    while (scanf("%s", str) != -1) puts(regex_match(str, regex("(100+1+|01)+")) ? "SUBMARINE" : "NOISE");
    return 0;
}

댓글 없음 :

댓글 쓰기