# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
151453 | 2019-09-03T09:09:45 Z | babo | 로카히아 유적 (FXCUP4_lokahia) | C++17 | 4 ms | 1144 KB |
#include <bits/stdc++.h> #define x first #define y second using namespace std; int CollectRelics(int,int); multiset<pair<int,int> >st,st2; int FindBase(int N){ int i; for(i=0;i<N;i++) { st.insert(make_pair(1,i)); } while(st.size()>=2) { printf("sz %d , %d %d %d %d %d\n",st.size(),st.begin()->y,next(st.begin())->y,st.begin()->x,next(st.begin())->x); //printf(" %d\n",CollectRelics(st.begin()->y,next(st.begin())->y)); if(st.begin()->x==next(st.begin())->x) { int temp=st.begin()->y==next(st.begin())->y?st.begin()->y:CollectRelics(st.begin()->y,next(st.begin())->y); if(temp!=-1) { //printf("%d\n",st.size()); st.erase(next(st.begin())); st.insert(make_pair(st.begin()->x*2,temp)); st.erase(st.begin()); //printf("%d\n",st.size()); } else { st2.insert(*st.begin()); st.erase(st.begin()); st2.insert(*st.begin()); st.erase(st.begin()); } } else { st2.insert(*st.begin()); st.erase(st.begin()); } } if(st.empty()) while(1) printf("%d",1/0); int las=st.begin()->y; int ans=st.begin()->x; st.erase(st.begin()); for(multiset<pair<int,int> >::iterator it=st2.begin();it!=st2.end();it++) { int temp=las==it->y?las:CollectRelics(las,it->y); if(temp!=-1) { las=temp; ans+=it->x; } } if(ans>N/2) return las; return -1; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 632 KB | Wrong |
2 | Incorrect | 3 ms | 632 KB | Wrong |
3 | Runtime error | 4 ms | 1016 KB | Execution killed with signal 4 (could be triggered by violating memory limits) |
4 | Incorrect | 2 ms | 504 KB | Wrong |
5 | Runtime error | 3 ms | 1144 KB | Execution killed with signal 4 (could be triggered by violating memory limits) |
6 | Incorrect | 3 ms | 632 KB | Wrong |
7 | Incorrect | 2 ms | 504 KB | Wrong |
8 | Correct | 2 ms | 376 KB | Correct : C = 0 |
9 | Incorrect | 2 ms | 504 KB | Wrong |
10 | Incorrect | 3 ms | 632 KB | Wrong |
11 | Incorrect | 3 ms | 632 KB | Wrong |
12 | Incorrect | 2 ms | 632 KB | Wrong |
13 | Incorrect | 2 ms | 632 KB | Wrong |
14 | Incorrect | 2 ms | 504 KB | Wrong |
15 | Incorrect | 3 ms | 532 KB | Wrong |
16 | Incorrect | 3 ms | 632 KB | Wrong |
17 | Runtime error | 3 ms | 1016 KB | Execution killed with signal 4 (could be triggered by violating memory limits) |
18 | Incorrect | 2 ms | 376 KB | Wrong |
19 | Runtime error | 3 ms | 972 KB | Execution killed with signal 4 (could be triggered by violating memory limits) |
20 | Incorrect | 3 ms | 632 KB | Wrong |
21 | Incorrect | 3 ms | 632 KB | Wrong |
22 | Incorrect | 2 ms | 504 KB | Wrong |
23 | Runtime error | 3 ms | 1016 KB | Execution killed with signal 4 (could be triggered by violating memory limits) |
24 | Incorrect | 2 ms | 504 KB | Wrong |
25 | Runtime error | 4 ms | 1144 KB | Execution killed with signal 4 (could be triggered by violating memory limits) |
26 | Incorrect | 3 ms | 632 KB | Wrong |
27 | Runtime error | 4 ms | 1064 KB | Execution killed with signal 4 (could be triggered by violating memory limits) |