結果
問題 |
No.2796 Small Matryoshka
|
ユーザー |
|
提出日時 | 2024-06-28 22:00:14 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 490 bytes |
コンパイル時間 | 1,518 ms |
コンパイル使用メモリ | 173,896 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-28 22:00:18 |
合計ジャッジ時間 | 3,704 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 8 WA * 11 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define REP(i, n) for(int i=0 ; (i)<(int)(n) ; (i)++) int main(void){ int n; cin >> n; vector<pair<int, int>> rr(n); REP(i, n) cin >> rr.at(i).first >> rr.at(i).second; sort(rr.begin(), rr.end()); int ans = 0, tmp = 0; for(auto i : rr){ if(tmp > i.first){ ans++; tmp = min(tmp, i.second); continue; } tmp = i.second; } cout << ans << endl; }