結果

問題 No.1257 変わった平均値
ユーザー abc3
提出日時 2020-10-16 22:36:48
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 1,026 bytes
コンパイル時間 2,794 ms
コンパイル使用メモリ 199,852 KB
最終ジャッジ日時 2025-01-15 08:54:51
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 20 WA * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#include <math.h>
#include <iomanip>
#include <cstdint>
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

const int INF=1001001001;
const int mod = 1000000007;

int main() {
  vector<int>p(3),q(3);
  cin>>p[0]>>p[1]>>p[2]>>q[0]>>q[1]>>q[2];
  //if(p[0]>q[0]||p[1]>q[1]||p[2]>q[2]){cout<<"No"<<endl;return 0;}
  //if(q[0]%2!=0||q[1]%2!=0||q[2]%2!=0){cout<<"No"<<endl;return 0;}
  //for(int i=0;i<2;i++){
  //  if(p[i]<p[i+1]){swap(p[i],p[i+1]);cout<<2<<endl;}
  //}
  queue<int>k;
  for(int i=0;i<3;i++){
    while(p[i]<q[i]){
      p[i]*=2;
      k.push(i);
    }
    if(p[i]!=q[i]){cout<<"No"<<endl;return 0;}
  }
  for(int i=0;i<3;i++){
    while(!k.empty()){
      int a=k.front();k.pop();
      if(k.empty()){cout<<"No"<<endl;return 0;}
      int b=k.front();k.pop();
      int c=6-a-b;
      cout<<1<<" "<<c<<endl;
    }
  }
  return 0;
}
0