# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
195570 | 2020-01-16T09:51:48 Z | theStaticMind | Meetings (JOI19_meetings) | C++14 | 3 ms | 564 KB |
#include "meetings.h" #include<bits/stdc++.h> #define pb push_back #define ii pair<int,int> #define all(x) (x).begin(),(x).end() #define INF 100000000000000000 #define modulo 1000000007 #define mod 998244353 using namespace std; void dp(vector<int> data,int curr){ if(data.empty())return; int big=data[0]; vector<int>sub,other; sub.pb(big); for(int i=1;i<data.size();i++){ if(data[i]==big)continue; int q=Query(big,curr,data[i]); if(q==curr)other.pb(data[i]); else{ sub.pb(data[i]); big=q; } } Bridge(curr,big); sub.erase(find(all(sub),big)); dp(sub,big); dp(other,curr); } void Solve(int N){ vector<int>arr(N); for(int i=1;i<N;i++)cin>>arr[i]; dp(arr,0); }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Execution timed out | 2 ms | 296 KB | Time limit exceeded (wall clock) |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Execution timed out | 2 ms | 296 KB | Time limit exceeded (wall clock) |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Execution timed out | 2 ms | 296 KB | Time limit exceeded (wall clock) |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Execution timed out | 3 ms | 564 KB | Time limit exceeded (wall clock) |
2 | Halted | 0 ms | 0 KB | - |