Submission #102517

#TimeUsernameProblemLanguageResultExecution timeMemory
102517jhnah917조화행렬 (KOI18_matrix)C++14
0 / 100
18 ms640 KiB
#include <bits/stdc++.h> #define x first #define y second using namespace std; typedef pair<int, int> p; void f2(){ int n; cin >> n; vector<p> v(n); for(int i=0; i<n; i++) cin >> v[i].x >> v[i].y; sort(v.begin(), v.end()); vector<int> lis; for(auto &i : v){ int t = i.y; auto it = lower_bound(lis.begin(), lis.end(), t); if(it == lis.end()) lis.push_back(t); else *it = t; } cout << lis.size(); } int main(){ int n; cin >> n; if(n == 2){ f2(); } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...