标签:nbsp space name style sync ace code bsp std
简单的写完代码就行了,不要那么一大堆条件
先考虑普遍情况,在考虑特殊
#include <bits/stdc++.h> using namespace std; const int maxn = 1e5 + 10; int n; int a[maxn]; int main(){ ios::sync_with_stdio(0); cin >> n; for(int i = 1; i <= n; i++) cin >> a[i]; sort(a,a+n); for(int i = 3; i <= n; i++){ if(a[i - 2] + a[i - 1] > a[i]){ cout << a[i - 2] << " " << a[i - 1] << " " << a[i]; return 0; } } cout << "-1"; return 0; }
标签:nbsp space name style sync ace code bsp std
原文地址:https://www.cnblogs.com/xcfxcf/p/12628830.html