제출 #1134831

#제출 시각아이디문제언어결과실행 시간메모리
1134831ackhavaRoller Coaster Railroad (IOI16_railroad)C++20
34 / 100
44 ms13384 KiB
#include "railroad.h" #include <bits/stdc++.h> #define REP(v, i, j) for (int v = i; v != j; v++) #define FORI(v) for (auto i : v) #define FORJ(v) for (auto j : v) #define OUT(v, a) \ FORI(v) \ cout << i << a; #define OUTS(v, a, b) \ cout << v.size() << a; \ OUT(v, b) #define in(a, n) \ REP(i, 0, n) \ cin >> a[i]; #define SORT(v) sort(begin(v), end(v)) #define REV(v) reverse(begin(v), end(v)) #define MEMSET(m) memset(m, -1, sizeof m) #define pb push_back #define fi first #define se second #define detachIO \ ios_base::sync_with_stdio(false); \ cin.tie(0); \ cout.tie(0); using namespace std; typedef pair<int, int> pii; typedef pair<pii, int> piii; typedef pair<pii, pii> piiii; long long memo[16][65536]; vector<int> s,t; long long dp(int idx, int mask){ if(mask == ((1<<s.size())-1))return 0; auto &ans=memo[idx][mask]; if(ans!=-1)return ans; ans=2e16; REP(i,0,s.size()){ if(mask&(1<<i))continue; ans=min(ans,dp(i,mask|(1<<i)) + max(0,t[idx]-s[i])); } return ans; } long long plan_roller_coaster(std::vector<int> s, std::vector<int> t) { int n = (int) s.size(); MEMSET(memo); ::s=s; ::t=t; long long ans=2e16; REP(i,0,n){ ans=min(ans,dp(i,1<<i)); } return ans; }

컴파일 시 표준 에러 (stderr) 메시지

railroad.h:1:9: warning: #pragma once in main file
    1 | #pragma once
      |         ^~~~
railroad_c.h:1:9: warning: #pragma once in main file
    1 | #pragma once
      |         ^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...