# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
98483 | 2019-02-23T18:50:33 Z | sams | Kronican (COCI16_kronican) | C++17 | 3 ms | 384 KB |
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int maxn = 30; struct node{ int seq, qtd, u; ll d; bool operator<(const node& o) const { if(d!=o.d) return d > o.d; return qtd > o.qtd; } }; int n, k, m[maxn][maxn], dt[maxn][maxn]; /*node dt[maxn][] void dijkstra() { priority_queue<node> row; for(int i = 1 ; i <= n ; ++i) { row.push({(1<<n), 1, i, 0}); } while(row.empty()) { int a, s, c; ll D; a = row.top().u, s = row.top().seq, c = row.top().qtd, D = row.top().d; if(dist ) } } */ int main(){ scanf("%d %d", &n, &k); for(int i = 1 ; i <= n ; ++i) for(int j = 1 ; j <= n ; ++j) scanf ("%d", &m[i][j]), dt[i][j] = m[i][j]; for(int k = 1 ; k <= n ; ++k) for(int i = 1 ; i <= n ; ++i) for(int j = 1 ; j <= n ; ++j) dt[i][j]=min(dt[i][j], dt[i][k] + dt[k][j]); /*cout << "\n"; for(int i = 1 ; i <= n ; ++i) for(int j = 1 ; j <= n ; ++j) cout << dt[i][j] << " \n"[j==n]; */ if(n==k) cout << "0\n"; return 0; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 256 KB | Output isn't correct |
2 | Incorrect | 3 ms | 384 KB | Output isn't correct |
3 | Incorrect | 3 ms | 256 KB | Output isn't correct |
4 | Incorrect | 2 ms | 256 KB | Output isn't correct |
5 | Incorrect | 2 ms | 384 KB | Output isn't correct |
6 | Incorrect | 2 ms | 384 KB | Output isn't correct |
7 | Incorrect | 2 ms | 256 KB | Output isn't correct |
8 | Incorrect | 0 ms | 256 KB | Output isn't correct |
9 | Incorrect | 2 ms | 256 KB | Output isn't correct |
10 | Incorrect | 2 ms | 256 KB | Output isn't correct |