NC232088. If I Catch You
描述
输入描述
The first line contains an integer --- the number of test cases.
Each test case is described by one integer --- the side length of the square loop.
输出描述
For each test case, output an integer in one line --- If Eastred loses, output . Otherwise, output the minimum number of rounds Eastred takes to win.
示例1
输入:
2 1 2
输出:
0 1
说明:
In test case , before the first round, Liola and Eastred are at the same grid. So Eastred catches Liola immediately, Eastred wins in round.C++ 解法, 执行用时: 6ms, 内存消耗: 396K, 提交时间: 2021-12-20 19:23:43
#include <bits/stdc++.h> using namespace std; int n,t; int main(){ cin>>t; while(t--){ cin>>n; cout<<max(2*n-3,0)<<endl; } }