Submission #899598

#TimeUsernameProblemLanguageResultExecution timeMemory
899598pccLost Array (NOI19_lostarray)C++14
100 / 100
22 ms3940 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long #define pll pair<ll,ll> #define pii pair<int,int> #define fs first #define sc second #define tlll tuple<ll,ll,ll> const ll inf = 1e9; const ll mxn = 1e5+10; pair<pii,int> ask[mxn]; int ans[mxn]; int main(){ ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); int n,m; fill(ans,ans+mxn,1); cin>>n>>m; for(int i = 0;i<m;i++){ cin>>ask[i].fs.fs>>ask[i].fs.sc>>ask[i].sc; ans[ask[i].fs.fs] = max(ans[ask[i].fs.fs],ask[i].sc); ans[ask[i].fs.sc] = max(ans[ask[i].fs.sc],ask[i].sc); } for(int i =0;i<m;i++){ assert(min(ans[ask[i].fs.fs],ans[ask[i].fs.sc]) == ask[i].sc); } for(int i = 1;i<=n;i++)cout<<ans[i]<<' ';return 0; }

Compilation message (stderr)

lostarray.cpp: In function 'int main()':
lostarray.cpp:30:2: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   30 |  for(int i = 1;i<=n;i++)cout<<ans[i]<<' ';return 0;
      |  ^~~
lostarray.cpp:30:43: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   30 |  for(int i = 1;i<=n;i++)cout<<ans[i]<<' ';return 0;
      |                                           ^~~~~~
#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...