結果
| 問題 |
No.232 めぐるはめぐる (2)
|
| コンテスト | |
| ユーザー |
FF256grhy
|
| 提出日時 | 2015-06-27 00:22:03 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 740 bytes |
| コンパイル時間 | 237 ms |
| コンパイル使用メモリ | 22,784 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-07 19:36:56 |
| 合計ジャッジ時間 | 1,712 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 17 WA * 5 |
コンパイルメッセージ
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;
}
FF256grhy