結果
問題 | No.232 めぐるはめぐる (2) |
ユーザー |
![]() |
提出日時 | 2015-06-27 00:41:04 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 741 bytes |
コンパイル時間 | 114 ms |
コンパイル使用メモリ | 22,528 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-07 19:41:30 |
合計ジャッジ時間 | 1,452 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 18 WA * 4 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:6:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 6 | scanf("%d%d%d", &t, &a, &b); | ~~~~~^~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h> int t, a, b; int main(void) { scanf("%d%d%d", &t, &a, &b); if(t < a || t < b || (t == 1 && a == 0 && b == 0)) { printf("NO\n"); } else { printf("YES\n"); int am = (t - a) % 2; int bm = (t - b) % 2; if(t == 1) { if(a) { printf("^"); } if(b) { printf(">"); } printf("\n"); return 0; } if(am && bm) { printf("^\n>\n"); } else { printf("^>\n"); if(am == 0) { printf("%c", a ? '^' : 'v'); } if(bm == 0) { printf("%c", b ? '>' : '<'); } printf("\n"); } a -= am ? 1 : 2; b -= bm ? 1 : 2; int i; for(i = 0; i < t - 2; i++) { printf("%c", (a <= i && i % 2) ? 'v' : '^'); printf("%c", (b <= i && i % 2) ? '<' : '>'); printf("\n"); } } return 0; }