結果

問題 No.290 1010
コンテスト
ユーザー %20
提出日時 2017-03-02 19:39:16
言語 C++11
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=gnu++11 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 521 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 281 ms
コンパイル使用メモリ 39,472 KB
実行使用メモリ 7,720 KB
最終ジャッジ日時 2026-03-05 20:57:51
合計ジャッジ時間 1,084 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 24
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:4:11: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    4 | char _[9];main(){
      |           ^~~~
main.cpp: In function 'int main()':
main.cpp:5:13: warning: 'char* gets(char*)' is deprecated [-Wdeprecated-declarations]
    5 |         gets(_);
      |         ~~~~^~~
In file included from /home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/cstdio:47,
                 from main.cpp:1:
/usr/include/stdio.h:667:14: note: declared here
  667 | extern char *gets (char *__s) __wur __attribute_deprecated__;
      |              ^~~~
/usr/bin/ld: /tmp/ccwmIjlQ.o: in function `main':
main.cpp:(.text.startup+0xc): 警告: the `gets' function is dangerous and should not be used.

ソースコード

diff #
raw source code

#include<cstdio>
#define p(s) puts(#s);return 0;
#define s switch(getchar_unlocked()){
char _[9];main(){
	gets(_);
	s
	case'0':
		s
		case'0':
			p(YES)
		case'1':
			s
			case'0':
				s
				case'\n':
					p(NO)
				default:
					p(YES)
				}
			case'1':
				p(YES)
			default:
				p(NO)
			}
		default:
			p(NO)
		}
	case'1':
		s
		case'0':
			s
			case'0':
				p(YES)
			case'1':
				s
				case'\n':
					p(NO)
				default:
					p(YES)
				}
			default:
				p(NO)
			}
		case'1':
			p(YES)
		default:
			p(NO)
		}
	}
}
0