結果
| 問題 | 
                            No.232 めぐるはめぐる (2)
                             | 
                    
| コンテスト | |
| ユーザー | 
                             hadrori
                         | 
                    
| 提出日時 | 2015-07-28 14:36:25 | 
| 言語 | C++11(廃止可能性あり)  (gcc 13.3.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 1,137 bytes | 
| コンパイル時間 | 1,110 ms | 
| コンパイル使用メモリ | 158,252 KB | 
| 実行使用メモリ | 6,944 KB | 
| 最終ジャッジ日時 | 2024-07-16 04:44:45 | 
| 合計ジャッジ時間 | 3,305 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge3 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 WA * 1 | 
| other | AC * 11 WA * 11 | 
コンパイルメッセージ
main.cpp: In function ‘void input()’:
main.cpp:64:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   64 |     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;
    }
    int i = 0, j = 0;
    if((t-max(a,b))%2) {
        if(a and b) {
            puts("YES");
            i++; j++;
            t -= 2;
            puts("^");
            puts(">");
        }
        else if(a or b){
            puts("YES");
            i++; j++;
            t--;
            puts("^>");
        }
        else {
            puts("NO");
            return;
        }
    }
    while(i < a and j < b) {
        t--;
        puts("^>");
        i++; j++;
    }
    while(i < a) {
        t--;
        puts("^");
        i++;
    }
    while(j < b) {
        t--;
        puts(">");
        j++;
    }
    if(j > b) {
        t--;
        puts("<");
    }
    if(i > a) {
        t--;
        puts("v");
    }
    while(t > 0) {
        t -= 2;
        puts(">");
        puts("<");
    }
}
void input() {
    scanf("%d%d%d", &t, &a, &b);
}
int main() {
    input();
    solve();
    return 0;
}
            
            
            
        
            
hadrori