結果
問題 |
No.290 1010
|
ユーザー |
![]() |
提出日時 | 2018-01-10 15:55:17 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 358 bytes |
コンパイル時間 | 1,755 ms |
コンパイル使用メモリ | 156,504 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-23 15:38:01 |
合計ジャッジ時間 | 2,549 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 22 WA * 2 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:8:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 8 | scanf("%d", &n); | ~~~~~^~~~~~~~~~ main.cpp:9:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 9 | scanf("%s", s); | ~~~~~^~~~~~~~~
ソースコード
#include "bits/stdc++.h" using namespace std; int n; char s[1000010]; int main() { scanf("%d", &n); scanf("%s", s); if (n < 2) { puts(n == 1 ? "NO" : s[0] == s[1] ? "YES" : "NO"); return 0; } if (n == 3) { puts(s[0]==s[1] || s[1]==s[2] ? "YES" : "NO"); return 0; } puts("YES"); return 0; }