| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 362529 | flappybird | Boat (APIO16_boat) | C++14 | 2117 ms | 227948 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define MAX 510
#define all(v) v.begin(), v.end()
#define ln '\n'
#define MOD 1000000007
#define INF 210000000000
#define pb push_back
#define abs(x) (((x)>0)?(x):(-(x)))
#define len(x) ((x).second-(x).first)
typedef long long ll;
map<int, int> m;
int main(void) {
ios::sync_with_stdio(false);
cin.tie(0);
int N;
cin >> N;
int i, j, k;
int a, b;
int sum;
m[0] = 1;
map<int, int>::iterator it;
for (i = 1; i <= N; i++) {
cin >> a >> b;
sum = 0;
for (it = m.begin(); it != m.end(); it++) {
if (it->first >= a) break;
sum += it->second;
sum %= MOD;
}
for (j = a; j <= b; j++) {
sum += m[j];
sum %= MOD;
m[j] = sum;
}
}
sum = 0;
for (it = m.begin(); it != m.end(); it++) {
if (it->first) sum += it->second, sum %= MOD;
}
while (sum < 0) sum += MOD;
cout << sum << ln;
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
