結果
問題 |
No.232 めぐるはめぐる (2)
|
ユーザー |
![]() |
提出日時 | 2015-07-28 14:33:48 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 917 bytes |
コンパイル時間 | 1,249 ms |
コンパイル使用メモリ | 159,316 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-16 04:43:48 |
合計ジャッジ時間 | 3,086 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 16 WA * 6 |
コンパイルメッセージ
main.cpp: In function ‘void input()’: main.cpp:51:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 51 | scanf("%d%d%d", &t, &a, &b); | ~~~~~^~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <bits/stdc++.h> using namespace std; #define repi(i,a,b) for(int i=(int)(a);i<(int)(b);i++) #define rep(i,n) repi(i,0,n) int t, a, b; void solve() { if(t < max(a,b)) { puts("NO"); return; } puts("YES"); int i = 0, j = 0; if((t-max(a,b))%2) { if(a and b) { i++; j++; t -= 2; puts("^"); puts(">"); } else { i++; j++; t--; puts("^>"); } } while(i < a and j < b) { t--; puts("^>"); i++; j++; } while(i < a) { t--; puts("^"); i++; } while(j < b) { t--; puts(">"); j++; } while(t > 0) { t -= 2; puts(">"); puts("<"); } } void input() { scanf("%d%d%d", &t, &a, &b); } int main() { input(); solve(); return 0; }