結果
問題 |
No.1257 変わった平均値
|
ユーザー |
|
提出日時 | 2020-10-16 22:32:02 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,032 bytes |
コンパイル時間 | 1,941 ms |
コンパイル使用メモリ | 199,596 KB |
最終ジャッジ日時 | 2025-01-15 08:50:00 |
ジャッジサーバーID (参考情報) |
judge3 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 19 WA * 6 |
ソースコード
#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;} } int now=p[0]; 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; }