結果
問題 | No.2493 K-th in L2 with L1 |
ユーザー | cho435 |
提出日時 | 2023-10-06 21:36:19 |
言語 | C++17(gcc12) (gcc 12.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 529 bytes |
コンパイル時間 | 4,135 ms |
コンパイル使用メモリ | 262,740 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-26 15:51:19 |
合計ジャッジ時間 | 4,621 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 4 |
ソースコード
#include <bits/stdc++.h> #include <atcoder/all> using namespace std; using ll = long long; #define rep(i,n) for(int i=0;i<(int)(n);i++) void solve(){ int d,k; cin>>d>>k; if(d==0){ if(k==1){ cout<<"Yes\n"; cout<<"0 0\n"; }else{ cout<<"No\n"; } return; } if(d*4<k){ cout<<"No\n"; return; } cout<<"Yes\n"; int mx=d*4; mx-=4; if(mx<k){ cout<<0<<" "<<d<<"\n"; return; } int ct=0; while(mx>=k){ mx-=8; ct++; } cout<<ct<<" "<<d-ct<<"\n"; } int main(){ int t; cin>>t; rep(i,t) solve(); }