結果
| 問題 |
No.232 めぐるはめぐる (2)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-05-14 23:16:40 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 493 bytes |
| コンパイル時間 | 2,714 ms |
| コンパイル使用メモリ | 190,776 KB |
| 最終ジャッジ日時 | 2025-01-10 10:56:54 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 16 WA * 6 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:8:25: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
8 | int t,a,b; scanf("%d%d%d",&t,&a,&b);
| ~~~~~^~~~~~~~~~~~~~~~~~~
ソースコード
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
using namespace std;
int main(){
int t,a,b; scanf("%d%d%d",&t,&a,&b);
if(max(a,b)>t) return puts("NO"),0;
puts("YES");
int y=0,x=0;
if(max(a,b)%2!=t%2){
if(a<=b) puts("^"), y++;
else puts(">"), x++;
t--;
}
while(y<a || x<b){
if(y<a && x<b) puts(">^"), y++, x++;
else if(y<a) puts("^"), y++;
else if(x<b) puts(">"), x++;
t--;
}
while(t>0){
puts("<");
puts(">");
t-=2;
}
return 0;
}