結果

問題 No.1650 Moving Coins
ユーザー kaede2020kaede2020
提出日時 2021-08-20 22:11:48
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 3,105 bytes
コンパイル時間 4,211 ms
コンパイル使用メモリ 232,404 KB
実行使用メモリ 11,340 KB
最終ジャッジ日時 2024-04-22 04:50:35
合計ジャッジ時間 16,846 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
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 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
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 WA -
testcase_21 WA -
testcase_22 AC 411 ms
10,736 KB
testcase_23 AC 418 ms
10,992 KB
testcase_24 AC 273 ms
5,576 KB
testcase_25 AC 281 ms
5,576 KB
testcase_26 AC 129 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

/*#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <iomanip>//fixed,setprecision
#include <limits.n>//INT_MAX
#include <math.n>//M_PI
#include <random>
#include <time.h>*/
#include <bits/stdc++.h>
using namespace std;
#include <atcoder/all>
using namespace atcoder;
//using mint = modint1000000007;
using mint = modint998244353;
//std::chrono::time_point<std::chrono::steady_clock> start;
template <typename T> bool chmax(T &u, const T z) { if (u < z) {u = z; return true;} else return false; }
template <typename T> bool chmin(T &u, const T z) { if (u > z) {u = z; return true;} else return false; }
#define ll long long
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
typedef pair<ll, int> P;
using vi=vector<int>;
using vvi=vector<vi>;
ll gcd(ll x, ll y) { return y ? gcd(y, x % y) : x; }
ll lcm(ll a, ll b){return a * b / gcd(a, b);}
template<class T, class U>
//contain(string s,string v) sにvが含まれるかを判定

bool contain(const std::basic_string<T>& s, const U& v) {
   return s.find(v) != std::basic_string<T>::npos;
}
const int mod=1000000007;
struct combination {
  vector<mint> fact, ifact;
  combination(int n):fact(n+1),ifact(n+1) {
    assert(n < mod);
    fact[0] = 1;
    for (int i = 1; i <= n; ++i) fact[i] = fact[i-1]*i;
    ifact[n] = fact[n].inv();
    for (int i = n; i >= 1; --i) ifact[i-1] = ifact[i]*i;
  }
  mint operator()(int n, int k) {
    if (k < 0 || k > n) return 0;
    return fact[n]*ifact[k]*ifact[n-k];
  }
};
int main(){
  int n;
  cin>>n;
  vector<int>a(n),b(n);
  rep(i,n)cin>>a[i];
  rep(i,n)cin>>b[i];
  int start=-1;
  vector<tuple<int,int,char>>ans;
  rep(i,n){
    if(a[i]==b[i])continue;
    else if(a[i]<b[i])ans.emplace_back(i,b[i]-a[i],'R');
    else ans.emplace_back(i,a[i]-b[i],'L');
  }
  vector<pair<int,char>>kotae;
  if(ans.size()==0)cout<<0<<endl;
  else{
    rep(i,ans.size()){
      int gyo=get<0>(ans[i])+1;
      int num=get<1>(ans[i]);
      char muki=get<2>(ans[i]);
      rep(j,num){
      //cout<<gyo<<" "<<muki<<endl;
        kotae.emplace_back(gyo,muki);
      }
    }
    int start=0;
    cout<<kotae.size()<<endl;
    rep(i,kotae.size()){
      if(i+1<kotae.size()&&kotae[i].first!=kotae[i+1].first){
        cout<<kotae[i+1].first<<" "<<kotae[i+1].second<<endl;
        cout<<kotae[i].first<<" "<<kotae[i].second<<endl;
        i++;
      }else{
        cout<<kotae[i].first<<" "<<kotae[i].second<<endl;
      }
    }
    //rep(i,kotae.size())cout<<kotae[i].first<<" "<<kotae[i].second<<endl;
  }
  return 0;
}

0