第2题 同样是排序 3道自测都过了 为什么提交是0% #include<bits/stdc++.h> using namespace std; int main(){ vector<int> nums{1}; int n, x, y; cin >> n; int tmp; for(int i = 0; i < n; i++){ cin >> tmp; nums.push_back(tmp); } sort(nums.begin(), nums.end()); cin >> x >> y; int l = nums[x], r = nums[x + 1]; if(x == 0){ cout << "infinity" << endl; } else{ cout << r - l << endl; } }
点赞 3

相关推荐

做黑夜里的那道光:两年电赛完赛没必要写,纯扣分
双非本科求职如何逆袭
点赞 评论 收藏
分享
牛客网
牛客网在线编程
牛客网题解
牛客企业服务