Submission #459617

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
4596172021-08-08 20:44:06nickmet2004Aesthetic (NOI20_aesthetic)C++11
38 / 100
779 ms83724 KiB
#include<bits/stdc++.h>
#define ll long long
using namespace std;
const int N = 3e5 + 5;
ll n , m , au[N] , av[N] , aw[N];
ll u , v , w , A = 0;
vector<pair<ll, pair<ll , ll> > > adj[N];
ll d1[N] , dn[N] , f[N] , par[N] , path[N] , son[N];
priority_queue<pair<ll , ll> > pq;
multiset<pair<ll , ll>> S;
vector<ll> B[N] , T[N];
void q(int x){
f[x] = 1;
for(auto y : adj[x]){
//cout << "h";
auto it = S.find({dn[y.first] + y.second.first + d1[x] , y.second.second});
if(f[y.first]) S.erase(it);
else S.insert({dn[x] + y.second.first + d1[y.first] , y.second.second});
}
}
void dfs(int u , int p){
if(path[u]) son[u] = u;
else son[u] = son[p];
T[son[u]].emplace_back(u);
for(int v : B[u]) dfs(v , u);
}
main (){
ios_base::sync_with_stdio(0); //cin.tie(0);
scanf("%d%d" , &n , &m);
for(int i =0; i <m; ++i) scanf("%d%d%d" , &au[i] , &av[i], &aw[i]);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

Aesthetic.cpp:27:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   27 | main (){
      | ^~~~
Aesthetic.cpp: In function 'int main()':
Aesthetic.cpp:29:13: warning: format '%d' expects argument of type 'int*', but argument 2 has type 'long long int*' [-Wformat=]
   29 |     scanf("%d%d" , &n , &m);
      |            ~^      ~~
      |             |      |
      |             int*   long long int*
      |            %lld
Aesthetic.cpp:29:15: warning: format '%d' expects argument of type 'int*', but argument 3 has type 'long long int*' [-Wformat=]
   29 |     scanf("%d%d" , &n , &m);
      |              ~^         ~~
      |               |         |
      |               int*      long long int*
      |              %lld
Aesthetic.cpp:30:39: warning: format '%d' expects argument of type 'int*', but argument 2 has type 'long long int*' [-Wformat=]
   30 |     for(int i  =0; i <m; ++i) scanf("%d%d%d" , &au[i] , &av[i], &aw[i]);
      |                                      ~^        ~~~~~~
      |                                       |        |
      |                                       int*     long long int*
      |                                      %lld
Aesthetic.cpp:30:41: warning: format '%d' expects argument of type 'int*', but argument 3 has type 'long long int*' [-Wformat=]
   30 |     for(int i  =0; i <m; ++i) scanf("%d%d%d" , &au[i] , &av[i], &aw[i]);
      |                                        ~^               ~~~~~~
      |                                         |               |
      |                                         int*            long long int*
      |                                        %lld
Aesthetic.cpp:30:43: warning: format '%d' expects argument of type 'int*', but argument 4 has type 'long long int*' [-Wformat=]
   30 |     for(int i  =0; i <m; ++i) scanf("%d%d%d" , &au[i] , &av[i], &aw[i]);
      |                                          ~^                     ~~~~~~
      |                                           |                     |
      |                                           int*                  long long int*
      |                                          %lld
Aesthetic.cpp:105:14: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long long int' [-Wformat=]
  105 |     printf("%d" ,ans);
      |             ~^   ~~~
      |              |   |
      |              int long long int
      |             %lld
Aesthetic.cpp:29:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   29 |     scanf("%d%d" , &n , &m);
      |     ~~~~~^~~~~~~~~~~~~~~~~~
Aesthetic.cpp:30:36: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   30 |     for(int i  =0; i <m; ++i) scanf("%d%d%d" , &au[i] , &av[i], &aw[i]);
      |                               ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...