# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
648761 | PoonYaPat | Toll (BOI17_toll) | C++14 | 138 ms | 86852 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
int k,n,m,q;
int dis[50001][17][5][5]; //(a,b,x,y) : from ak+x to (a+(1<<b))k+y
void merge(int ans[5][5], int a[5][5], int b[5][5]) {
for (int i=0; i<k; ++i) {
for (int j=0; j<k; ++j) {
//find ans[i][j]
for (int z=0; z<k; ++z) {
ans[i][j]=min(ans[i][j],a[i][z]+b[z][j]);
}
}
}
}
int main() {
ios_base::sync_with_stdio(0); cin.tie(0);
cin>>k>>n>>m>>q;
memset(dis,0x3f,sizeof(dis));
for (int i=0; i<m; ++i) {
int a,b,w;
cin>>a>>b>>w;
dis[a/k][0][a%k][b%k]=w;
}
for (int i=1; i<17; ++i) {
for (int j=0; j+(1<<i)<=n/k; ++j) {
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |