はまやんはまやんはまやん

hamayanhamayan's blog

Time Limit Exceeded [AtCoder Beginner Contest 112 B]

https://beta.atcoder.jp/contests/abc112/tasks/abc112_b

解法

https://beta.atcoder.jp/contests/abc112/submissions/3348993

t[i]≦Tを満たす中のc[i]の最小値が答え。
もし満たすものがなければ、TLEと答える。

int N, T, c[101], t[101];
//---------------------------------------------------------------------------------------------------
void _main() {
    cin >> N >> T;
    rep(i, 0, N) cin >> c[i] >> t[i];
 
    int ans = inf;
    rep(i, 0, N) if (t[i] <= T) chmin(ans, c[i]);
    if (ans == inf) cout << "TLE" << endl;
    else cout << ans << endl;
}