Submission #851767

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
8517672023-09-20 14:51:56chautanphatCommuter Pass (JOI18_commuter_pass)C++11
0 / 100
2 ms2652 KiB
#include <bits/stdc++.h>
#define io freopen("input.inp", "r", stdin);freopen("output.out", "w", stdout);
using namespace std;
const int maxn = 1e5+1;
int n;
vector< pair<long long, int> > a[maxn];
vector<long long> dijkstra(int start)
{
vector<long long> d(n+1);
d[start] = 0;
priority_queue< pair<long long, int> > q;
q.push(make_pair(0, start));
vector<bool> vs(n+1);
while (q.size())
{
int u = q.top().second;
q.pop();
if (vs[u]) continue;
vs[u] = 1;
for (int i = 0; i < (int)a[u].size(); i++)
{
int v = a[u][i].first, w = a[u][i].second;
if (d[u]+w < d[v])
{
d[v] = d[u]+w;
q.push(make_pair(-d[v], v));
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

commuter_pass.cpp: In function 'int main()':
commuter_pass.cpp:2:19: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
    2 | #define io freopen("input.inp", "r", stdin);freopen("output.out", "w", stdout);
      |            ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
commuter_pass.cpp:43:5: note: in expansion of macro 'io'
   43 |     io;
      |     ^~
commuter_pass.cpp:2:52: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
    2 | #define io freopen("input.inp", "r", stdin);freopen("output.out", "w", stdout);
      |                                             ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
commuter_pass.cpp:43:5: note: in expansion of macro 'io'
   43 |     io;
      |     ^~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...