結果

問題 No.1650 Moving Coins
ユーザー srjywrdnprktsrjywrdnprkt
提出日時 2023-06-07 23:35:12
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 751 bytes
コンパイル時間 877 ms
コンパイル使用メモリ 108,088 KB
実行使用メモリ 4,936 KB
最終ジャッジ日時 2023-08-28 19:17:51
合計ジャッジ時間 16,258 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 325 ms
4,380 KB
testcase_09 WA -
testcase_10 AC 337 ms
4,380 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 389 ms
4,696 KB
testcase_21 WA -
testcase_22 AC 384 ms
4,708 KB
testcase_23 AC 386 ms
4,568 KB
testcase_24 AC 272 ms
4,376 KB
testcase_25 AC 274 ms
4,380 KB
testcase_26 AC 114 ms
4,608 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <cmath>
#include <map>
#include <set>
#include <iomanip>
#include <queue>
#include <algorithm>
#include <numeric>
#include <deque>
#include <complex>
#include <cassert>

using namespace std;
using ll = long long;

int main(){

    int N, M=0;
    cin >> N;
    vector<int> A(N), B(N);
    for (int i=0; i<N; i++) cin >> A[i];
    for (int i=0; i<N; i++){
        cin >> B[i];
        M += abs(A[i]-B[i]);
    }
    cout << M << endl;
    for (int i=0; i<N; i++){
        if (A[i] < B[i]){
            for (int j=0; j<B[i]-A[i]; j++) cout << i+1 << " " << 'R' << endl;
        }
        else{
            for (int j=0; j<A[i]-B[i]; j++) cout << i+1 << " " << 'L' << endl;
        }
    }

    return 0;
}
0