結果
問題 | No.232 めぐるはめぐる (2) |
ユーザー |
![]() |
提出日時 | 2016-03-29 00:00:24 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 4 ms / 1,000 ms |
コード長 | 1,252 bytes |
コンパイル時間 | 779 ms |
コンパイル使用メモリ | 83,544 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-14 12:42:22 |
合計ジャッジ時間 | 1,866 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 22 |
ソースコード
/* -*- 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(">^\n<\n"); else printf(">^\nv\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; }