# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
354719 | 2021-01-22T05:07:41 Z | kylych03 | Roller Coaster Railroad (IOI16_railroad) | C++14 | 526 ms | 32364 KB |
#include "railroad.h" #include <bits/stdc++.h> //#include "grader.cpp" #define ll long long using namespace std; long long plan_roller_coaster(std::vector<int> s, std::vector<int> t) { int n = (int) s.size(); map <ll, ll> mp; map <ll, ll> ::iterator it; for(int i = 0 ; i < n;i++){ mp[s[i]]--; mp[t[i]]++; } mp[0]++; ll cnt = 0, res, last = 0; for( it = mp.begin() ; it!=mp.end() ; it++){ cnt += it->second; //cout << cnt<< " - " <<it->first<<" - " <<it->second<<endl; if(cnt < 0){ // cout << cnt <<" ok " <<it->first <<" - " << last << endl; res+= ( cnt * (it->first - last) ); } last = it->first; } return res; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 364 KB | n = 2 |
2 | Correct | 1 ms | 492 KB | n = 2 |
3 | Correct | 1 ms | 364 KB | n = 2 |
4 | Correct | 1 ms | 364 KB | n = 2 |
5 | Correct | 1 ms | 364 KB | n = 2 |
6 | Incorrect | 1 ms | 364 KB | answer is not correct: -69049296 instead of 523688153 |
7 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 364 KB | n = 2 |
2 | Correct | 1 ms | 492 KB | n = 2 |
3 | Correct | 1 ms | 364 KB | n = 2 |
4 | Correct | 1 ms | 364 KB | n = 2 |
5 | Correct | 1 ms | 364 KB | n = 2 |
6 | Incorrect | 1 ms | 364 KB | answer is not correct: -69049296 instead of 523688153 |
7 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 526 ms | 31780 KB | n = 199999 |
2 | Incorrect | 501 ms | 32364 KB | answer is not correct: -322350036594 instead of 1 |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 364 KB | n = 2 |
2 | Correct | 1 ms | 492 KB | n = 2 |
3 | Correct | 1 ms | 364 KB | n = 2 |
4 | Correct | 1 ms | 364 KB | n = 2 |
5 | Correct | 1 ms | 364 KB | n = 2 |
6 | Incorrect | 1 ms | 364 KB | answer is not correct: -69049296 instead of 523688153 |
7 | Halted | 0 ms | 0 KB | - |