Submission #1178606


Source Code Expand

#include <bits/stdc++.h>
using namespace std;
#define int long long
using ll=long long;
using vi=vector<int>;
using vl=vector<long long>;
using pii=pair<int,int>;
using pll=pair<long long,long long>;
#define ITR(i,c) for(auto i=begin(c);i!=end(c);++i)
#define FORE(x,c) for(auto &x:c)
#define REPF(i,a,n) for(int i=a,i##_len=(int)(n);i<i##_len;++i)
#define REP(i,n) REPF(i,0,n)
#define RREP(i,n) for(int i=(int)(n);i>=0;--i)
#define ALL(c) begin(c),end(c)
#define RALL(c) rbegin(c),rend(c)   // c++14
#define SZ(c) ((int)c.size())
#define EXIST(c,x) (c.find(x)!=end(c))
#define OUTOFRANGE(y,x,h,w) (y<0||x<0||y>=h||x>=w)
#define dump(...)
const int DX[9]={0,1,0,-1,1,1,-1,-1,0},DY[9]={-1,0,1,0,-1,1,1,-1,0};
#define INF (1001001001)
#define INFLL (1001001001001001001ll)
template<class T> ostream& operator << (ostream &os,const vector<T> &v) {
    ITR(i,v) os << *i << (i==end(v)-1 ? "" : "\n"); return os; }
template<class T> istream& operator >> (istream &is,vector<T> &v) {
    ITR(i,v) is >> * i; return is; }
template<class T> istream& operator >> (istream &is, pair<T,T> &p) {
        is >> p.first >> p.second; return is; }
template<class T>bool chmax(T &a,const T &b){if(a<b){a=b;return 1;}return 0;}
template<class T>bool chmin(T &a,const T &b){if(b<a){a=b;return 1;}return 0;}
//------------------------------------------------------------------------------
struct before_main_function {
    before_main_function() {
        #ifdef int
            #undef INF
            #define INF INFLL
            #define stoi stoll
        #endif
        cin.tie(0);ios::sync_with_stdio(false);
        cout<<setprecision(15)<<fixed;
    }
} before_main_function;
//------------------------------------------------------------------------------

int dp[1010];
signed main() {
    int N;
    cin>>N;
    vector<pii> b(N);
    REP(i,N) {
        cin>>b[i].first>>b[i].second;
    }
    sort(ALL(b));
    dp[0]=1;
    REPF(i,1,N) {
        int max=0;
        REP(j,i) {
            if(b[i].first>b[j].first && b[i].second>b[j].second) {
                chmax(max,dp[j]);
            }
        }
        dp[i]=max+1;
    }
    cout<<(*max_element(ALL(dp)))<<endl;
    return 0;
}

Submission Info

Submission Time
Task D - プレゼント
User algon
Language C++14 (GCC 5.4.1)
Score 30
Code Size 2241 Byte
Status RE
Exec Time 121 ms
Memory 1792 KB

Judge Result

Set Name Sample Subtask0 All
Score / Max Score 0 / 0 30 / 30 0 / 70
Status
AC × 4
AC × 19
AC × 19
RE × 15
Set Name Test Cases
Sample sample0.txt, sample1.txt, sample2.txt, sample3.txt
Subtask0 subtask0_0.txt, subtask0_1.txt, subtask0_10.txt, subtask0_11.txt, subtask0_12.txt, subtask0_13.txt, subtask0_14.txt, subtask0_2.txt, subtask0_3.txt, subtask0_4.txt, subtask0_5.txt, subtask0_6.txt, subtask0_7.txt, subtask0_8.txt, subtask0_9.txt, sample0.txt, sample1.txt, sample2.txt, sample3.txt
All sample0.txt, sample1.txt, sample2.txt, sample3.txt, subtask0_0.txt, subtask0_1.txt, subtask0_10.txt, subtask0_11.txt, subtask0_12.txt, subtask0_13.txt, subtask0_14.txt, subtask0_2.txt, subtask0_3.txt, subtask0_4.txt, subtask0_5.txt, subtask0_6.txt, subtask0_7.txt, subtask0_8.txt, subtask0_9.txt, subtask1_0.txt, subtask1_1.txt, subtask1_10.txt, subtask1_11.txt, subtask1_12.txt, subtask1_13.txt, subtask1_14.txt, subtask1_2.txt, subtask1_3.txt, subtask1_4.txt, subtask1_5.txt, subtask1_6.txt, subtask1_7.txt, subtask1_8.txt, subtask1_9.txt
Case Name Status Exec Time Memory
sample0.txt AC 1 ms 256 KB
sample1.txt AC 1 ms 256 KB
sample2.txt AC 1 ms 256 KB
sample3.txt AC 1 ms 256 KB
subtask0_0.txt AC 1 ms 256 KB
subtask0_1.txt AC 1 ms 256 KB
subtask0_10.txt AC 2 ms 256 KB
subtask0_11.txt AC 2 ms 256 KB
subtask0_12.txt AC 3 ms 256 KB
subtask0_13.txt AC 3 ms 256 KB
subtask0_14.txt AC 3 ms 256 KB
subtask0_2.txt AC 1 ms 256 KB
subtask0_3.txt AC 1 ms 256 KB
subtask0_4.txt AC 2 ms 256 KB
subtask0_5.txt AC 1 ms 256 KB
subtask0_6.txt AC 2 ms 256 KB
subtask0_7.txt AC 3 ms 256 KB
subtask0_8.txt AC 2 ms 256 KB
subtask0_9.txt AC 1 ms 256 KB
subtask1_0.txt RE 111 ms 1280 KB
subtask1_1.txt RE 98 ms 256 KB
subtask1_10.txt RE 113 ms 1792 KB
subtask1_11.txt RE 115 ms 1792 KB
subtask1_12.txt RE 121 ms 1792 KB
subtask1_13.txt RE 120 ms 1792 KB
subtask1_14.txt RE 120 ms 1792 KB
subtask1_2.txt RE 101 ms 512 KB
subtask1_3.txt RE 118 ms 1536 KB
subtask1_4.txt RE 121 ms 1792 KB
subtask1_5.txt RE 101 ms 512 KB
subtask1_6.txt RE 115 ms 1408 KB
subtask1_7.txt RE 106 ms 1024 KB
subtask1_8.txt RE 116 ms 1664 KB
subtask1_9.txt RE 108 ms 896 KB