結果
問題 | No.1650 Moving Coins |
ユーザー |
|
提出日時 | 2021-08-21 08:29:30 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 134 ms / 2,000 ms |
コード長 | 416 bytes |
コンパイル時間 | 1,437 ms |
コンパイル使用メモリ | 169,420 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-14 17:20:55 |
合計ジャッジ時間 | 7,003 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 24 |
ソースコード
#include<bits/stdc++.h> using namespace std; int main(){ int N; cin>>N; vector<int>A(N),B(N); for(int &i:A)cin>>i; for(int &i:B)cin>>i; int ans=0; for(int i=0;i<N;i++)ans+=abs(A[i]-B[i]); cout<<ans<<'\n'; for(int i=0;i<N;i+=1){ for(int j=0;j<A[i]-B[i];j+=1){ cout<<i+1<<" L\n"; } } for(int i=N-1;i>=0;i-=1){ for(int j=0;j<B[i]-A[i];j+=1){ cout<<i+1<<" R\n"; } } }