結果

問題 No.1650 Moving Coins
ユーザー chocoruskchocorusk
提出日時 2021-08-16 07:33:14
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 369 ms / 2,000 ms
コード長 567 bytes
コンパイル時間 832 ms
コンパイル使用メモリ 76,928 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-22 03:30:06
合計ジャッジ時間 11,317 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 234 ms
5,376 KB
testcase_04 AC 180 ms
5,376 KB
testcase_05 AC 221 ms
5,376 KB
testcase_06 AC 233 ms
5,376 KB
testcase_07 AC 242 ms
5,376 KB
testcase_08 AC 297 ms
5,376 KB
testcase_09 AC 302 ms
5,376 KB
testcase_10 AC 302 ms
5,376 KB
testcase_11 AC 319 ms
5,376 KB
testcase_12 AC 279 ms
5,376 KB
testcase_13 AC 289 ms
5,376 KB
testcase_14 AC 302 ms
5,376 KB
testcase_15 AC 296 ms
5,376 KB
testcase_16 AC 308 ms
5,376 KB
testcase_17 AC 312 ms
5,376 KB
testcase_18 AC 349 ms
5,376 KB
testcase_19 AC 355 ms
5,376 KB
testcase_20 AC 369 ms
5,376 KB
testcase_21 AC 363 ms
5,376 KB
testcase_22 AC 354 ms
5,376 KB
testcase_23 AC 365 ms
5,376 KB
testcase_24 AC 246 ms
5,376 KB
testcase_25 AC 246 ms
5,376 KB
testcase_26 AC 118 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
using ll=long long;
const int MAXA=1000000;
const int MAXN=200000;
const int MAXM=200000;
int a[MAXN], b[MAXN];
int main()
{
	int n;
	cin>>n;
	for(int i=0; i<n; i++) cin>>a[i];
	for(int i=0; i<n; i++) cin>>b[i];
	int m=0;
	for(int i=0; i<n; i++) m+=abs(a[i]-b[i]);
	cout<<m<<endl;
	for(int i=0; i<n; i++){
		for(int j=0; j<a[i]-b[i]; j++){
		    cout<<i+1<<"L"<<endl;
		}
	}
	for(int i=n-1; i>=0; i--){
		for(int j=0; j<b[i]-a[i]; j++){
		    cout<<i+1<<"R"<<endl;
		}
	}
    return 0;
}
0