結果
問題 | No.2796 Small Matryoshka |
ユーザー |
|
提出日時 | 2024-06-28 21:52:19 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 452 bytes |
コンパイル時間 | 2,075 ms |
コンパイル使用メモリ | 174,224 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-06-28 21:52:26 |
合計ジャッジ時間 | 4,341 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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++;continue;}tmp = i.second;}cout << ans << endl;}