답안 #61176

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
61176 2018-07-25T09:59:49 Z Flugan42 Boat (APIO16_boat) C++14
9 / 100
2000 ms 14404 KB
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vi;
typedef pair<ll,ll> ii;
typedef vector<ii> vii;
typedef long double lld;
#define rep(i,a,b) for(ll i = a; i < b; i++)
#define per(i,a,b) for(ll i = a; i >= b; i--)
#define inf 1000000000000000000
#define all(x) x.begin(),x.end()
#define sz(x) (ll)(x).size()
#define trav(a,x) for(auto a : x)

const ll mod = 1000000007;
ll n;
vi a,b,s;

int main(){
  cin >> n;
  a.assign(n,0); b.assign(n,0);
  rep(i,0,n) {
    cin >> a[i] >> b[i];
    assert(b[i]-a[i] < 1000010);
    per(j,b[i],a[i]) { s.push_back(j); }
  }

  vi dp; dp.assign(sz(s),0);
  rep(i,0,sz(s)){
    dp[i] = 1;
    rep(j,0,i) if (s[j] < s[i]) dp[i] = (dp[i]+dp[j])%mod;
  }

  ll res = 0;
  rep(i,0,sz(s)) res = (res+dp[i])%mod;
  cout << res << endl;

}
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 376 KB Output is correct
2 Correct 4 ms 376 KB Output is correct
3 Correct 4 ms 436 KB Output is correct
4 Correct 4 ms 488 KB Output is correct
5 Correct 4 ms 492 KB Output is correct
6 Correct 4 ms 520 KB Output is correct
7 Correct 4 ms 520 KB Output is correct
8 Correct 4 ms 596 KB Output is correct
9 Correct 4 ms 720 KB Output is correct
10 Correct 4 ms 720 KB Output is correct
11 Correct 5 ms 720 KB Output is correct
12 Correct 4 ms 720 KB Output is correct
13 Correct 4 ms 720 KB Output is correct
14 Correct 5 ms 720 KB Output is correct
15 Correct 3 ms 720 KB Output is correct
16 Correct 3 ms 720 KB Output is correct
17 Correct 4 ms 720 KB Output is correct
18 Correct 4 ms 720 KB Output is correct
19 Correct 4 ms 720 KB Output is correct
20 Correct 5 ms 720 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 376 KB Output is correct
2 Correct 4 ms 376 KB Output is correct
3 Correct 4 ms 436 KB Output is correct
4 Correct 4 ms 488 KB Output is correct
5 Correct 4 ms 492 KB Output is correct
6 Correct 4 ms 520 KB Output is correct
7 Correct 4 ms 520 KB Output is correct
8 Correct 4 ms 596 KB Output is correct
9 Correct 4 ms 720 KB Output is correct
10 Correct 4 ms 720 KB Output is correct
11 Correct 5 ms 720 KB Output is correct
12 Correct 4 ms 720 KB Output is correct
13 Correct 4 ms 720 KB Output is correct
14 Correct 5 ms 720 KB Output is correct
15 Correct 3 ms 720 KB Output is correct
16 Correct 3 ms 720 KB Output is correct
17 Correct 4 ms 720 KB Output is correct
18 Correct 4 ms 720 KB Output is correct
19 Correct 4 ms 720 KB Output is correct
20 Correct 5 ms 720 KB Output is correct
21 Execution timed out 2055 ms 14404 KB Time limit exceeded
22 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 3 ms 14404 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 376 KB Output is correct
2 Correct 4 ms 376 KB Output is correct
3 Correct 4 ms 436 KB Output is correct
4 Correct 4 ms 488 KB Output is correct
5 Correct 4 ms 492 KB Output is correct
6 Correct 4 ms 520 KB Output is correct
7 Correct 4 ms 520 KB Output is correct
8 Correct 4 ms 596 KB Output is correct
9 Correct 4 ms 720 KB Output is correct
10 Correct 4 ms 720 KB Output is correct
11 Correct 5 ms 720 KB Output is correct
12 Correct 4 ms 720 KB Output is correct
13 Correct 4 ms 720 KB Output is correct
14 Correct 5 ms 720 KB Output is correct
15 Correct 3 ms 720 KB Output is correct
16 Correct 3 ms 720 KB Output is correct
17 Correct 4 ms 720 KB Output is correct
18 Correct 4 ms 720 KB Output is correct
19 Correct 4 ms 720 KB Output is correct
20 Correct 5 ms 720 KB Output is correct
21 Execution timed out 2055 ms 14404 KB Time limit exceeded
22 Halted 0 ms 0 KB -