版本比较
题解:P14054 [SDCPC 2019] Sekiro
正文
增加 8 行删除 8 行
25 行未改动262728293030313233348 行未改动434445464747484950515253525354555657585958596061626364646566676868697071724 行未改动25 行未改动
**代码:**
```cpp//洛谷 P14054 [SDCPC 2019] Sekiro //洛谷 P14054 [SDCPC 2019] Sekiro#include<bits/stdc++.h>using namespace std;//#define LOCAL//#define emdl '\n'8 行未改动 #ifdef LOCAL freopen("in.txt","r",stdin); freopen("out.txt","w",stdout); #endif
int t; cin>>t; while(t--){ cin>>n>>k; //特判 n=0
//特判 n=0 if(n==0){ cout<<"0"<<emdl; continue; } //贪心
//贪心 if(k>50){ cout<<"1"<<emdl; continue; } //暴力求出答案 //暴力求出答案 int x=n; for(int i=1;i<=k;i++){ x=(x+1)/2; } } cout<<x<<emdl; }
return 0;4 行未改动