Submission #522156

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
5221562022-02-04 01:25:28YuDabin약속장소 정하기 (GCJ12KOR_appointment)C++14
35 / 35
2785 ms12596 KiB
#include <bits/stdc++.h>
using namespace std;
#define int long long
const int INF = 1e16;
int n, p, m;
vector<pair<int, int>> man;
vector<vector<pair<int, int>>> graph;
vector<int> ans;
void dijkstra(int i)
{
vector<int> dist(n+1, INF);
priority_queue<pair<int, int>> pq; pq.push({0, man[i].first});
while(!pq.empty())
{
int here = pq.top().second, cost = -pq.top().first; pq.pop();
if(dist[here] != INF) continue;
dist[here] = cost;
for(auto it : graph[here])
{
int there = it.first, ncost = cost + it.second * man[i].second;
if(dist[there] != INF) continue;
pq.push({-ncost, there});
}
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

C.cpp: In function 'int32_t main()':
C.cpp:36:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   36 |  int T; scanf("%lld", &T);
      |         ~~~~~^~~~~~~~~~~~
C.cpp:39:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   39 |   scanf("%lld%lld%lld", &n, &p, &m);
      |   ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
C.cpp:43:36: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   43 |   for(int i = 1; i <= p; i++) scanf("%lld%lld", &man[i].first, &man[i].second);
      |                               ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C.cpp:46:19: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   46 |    int d, l; scanf("%lld%lld", &d, &l); int prv, here;
      |              ~~~~~^~~~~~~~~~~~~~~~~~~~
C.cpp:47:9: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   47 |    scanf("%lld", &prv);
      |    ~~~~~^~~~~~~~~~~~~~
C.cpp:50:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   50 |     scanf("%lld", &here);
      |     ~~~~~^~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...