ABC112B - Time Limit Exceeded
#include <algorithm> #include <iostream> #include <vector> using namespace std; #define REP(i, n) for (int i = 0; i < (n); ++i) #define PB push_back int main(void) { int n, t, p_cost, p_time; vector<int> ret; cin.tie(0); ios::sync_with_stdio(false); cin >> n >> t; REP(i, n) { cin >> p_cost >> p_time; if (p_time <= t) { ret.PB(p_cost); } } if (ret.size() == 0) { cout << "TLE" << "\n"; } else { cout << *min_element(ret.begin(), ret.end()) << "\n"; } return 0; }
無駄に vector 使って1RE。。