P1007 独木桥
作者:互联网
1 #include<iostream> 2 #include<algorithm> 3 using namespace std; 4 5 int main() 6 { 7 int maxt = 0; 8 int mint = 0; 9 int n; 10 int len; 11 cin >> len >> n; 12 for (int i = 0; i < n; i++) 13 { 14 int t; 15 cin >> t; 16 maxt = max(max(len - t + 1, t), maxt); 17 mint = max(min(len - t + 1, t), mint); 18 } 19 cout << mint << " " << maxt; 20 }View Code
标签:独木桥,int,P1007,maxt,len,max,include,mint 来源: https://www.cnblogs.com/thjkhdf12/p/11672792.html