結果
問題 |
No.232 めぐるはめぐる (2)
|
ユーザー |
![]() |
提出日時 | 2016-03-28 23:58:13 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,252 bytes |
コンパイル時間 | 608 ms |
コンパイル使用メモリ | 84,712 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-02 06:51:52 |
合計ジャッジ時間 | 3,142 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 11 WA * 11 |
ソースコード
/* -*- coding: utf-8 -*- * * 232.cc: No.232 めぐるはめぐる (2) - yukicoder */ #include<cstdio> #include<cstdlib> #include<cstring> #include<cmath> #include<iostream> #include<string> #include<vector> #include<map> #include<set> #include<stack> #include<list> #include<queue> #include<deque> #include<algorithm> #include<numeric> #include<utility> #include<complex> #include<functional> using namespace std; /* constant */ /* typedef */ /* global variables */ /* subroutines */ /* main */ int main() { int t, a, b; cin >> t >> a >> b; int m = max(a, b); if (t < m || (m == 0 && t == 1)) { puts("NO"); return 0; } puts("YES"); if (m == 0) { if (t & 1) { printf(">^\nv\n<\n"); t -= 3; } } else if ((t + m) & 1) { while (m > 1) { if (a > 0) putchar('>'), a--; if (b > 0) putchar('^'), b--; putchar('\n'); m--, t--; } if (a > 0 && b > 0) printf(">\n^\n"); else if (a > 0) printf(">^\nv\n"); else printf(">^\n<\n"); t -= 2; } else { while (m > 0) { if (a > 0) putchar('>'), a--; if (b > 0) putchar('^'), b--; putchar('\n'); m--, t--; } } for (int i = 0; i < t; i += 2) printf(">\n<\n"); return 0; }