Submission #98483

#TimeUsernameProblemLanguageResultExecution timeMemory
98483samsKronican (COCI16_kronican)C++17
0 / 100
3 ms384 KiB
#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 (stderr)

kronican.cpp: In function 'int main()':
kronican.cpp:42:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d %d", &n, &k);
  ~~~~~^~~~~~~~~~~~~~~~~
kronican.cpp:46:26: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
    scanf ("%d", &m[i][j]), dt[i][j] = m[i][j];
    ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...