結果
問題 | No.232 めぐるはめぐる (2) |
ユーザー | kapo |
提出日時 | 2016-05-09 08:50:56 |
言語 | C90 (gcc 11.4.0) |
結果 |
AC
|
実行時間 | 4 ms / 1,000 ms |
コード長 | 951 bytes |
コンパイル時間 | 866 ms |
コンパイル使用メモリ | 24,668 KB |
実行使用メモリ | 4,352 KB |
最終ジャッジ日時 | 2023-10-12 13:46:09 |
合計ジャッジ時間 | 2,271 ms |
ジャッジサーバーID (参考情報) |
judge12 / judge11 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 3 ms
4,348 KB |
testcase_01 | AC | 4 ms
4,348 KB |
testcase_02 | AC | 4 ms
4,348 KB |
testcase_03 | AC | 3 ms
4,348 KB |
testcase_04 | AC | 1 ms
4,348 KB |
testcase_05 | AC | 1 ms
4,348 KB |
testcase_06 | AC | 0 ms
4,348 KB |
testcase_07 | AC | 1 ms
4,348 KB |
testcase_08 | AC | 3 ms
4,352 KB |
testcase_09 | AC | 0 ms
4,348 KB |
testcase_10 | AC | 1 ms
4,352 KB |
testcase_11 | AC | 1 ms
4,348 KB |
testcase_12 | AC | 1 ms
4,352 KB |
testcase_13 | AC | 0 ms
4,348 KB |
testcase_14 | AC | 0 ms
4,348 KB |
testcase_15 | AC | 1 ms
4,348 KB |
testcase_16 | AC | 0 ms
4,348 KB |
testcase_17 | AC | 1 ms
4,352 KB |
testcase_18 | AC | 0 ms
4,352 KB |
testcase_19 | AC | 0 ms
4,348 KB |
testcase_20 | AC | 1 ms
4,348 KB |
testcase_21 | AC | 0 ms
4,348 KB |
testcase_22 | AC | 1 ms
4,348 KB |
testcase_23 | AC | 1 ms
4,348 KB |
testcase_24 | AC | 1 ms
4,348 KB |
ソースコード
#include <stdio.h> int main(void) { int i, t, a, b, x=0, y=0, c=0, f=0; scanf("%d %d %d", &t, &a, &b); if( t < a || t < b || ( t==1 && !a && !b ) ) { printf("NO\n"); return 0; } printf("YES\n"); if( !c && t >= 2 ) { if( !a && !b) { printf("<v\n"); x--; y--; c++; } else if( !a ) { printf(">v\n"); x++; y--; c++; } else if( !b ) { printf("<^\n"); x--; y++; c++; } } while( y < a-1 && x < b-1) { printf("^>\n"); x++; y++; c++; } while( y < a-1 ) { printf("^\n"); y++; c++; } while( x < b-1 ) { printf(">\n"); x++; c++; } while( c < t-1 ) { if( !f ) { printf(">\n"); x++; c++; f = 1; } else if( f ) { printf("<\n"); x--; c++; f = 0; } } if( a == y+1 && b == x+1) { printf("^>\n"); x++; y++; c++; } else if( a == y+1 ) { printf("^\n"); y++; c++; } else if( b == x+1 ) { printf(">\n"); x++; c++; } return 0; }