제출 #1000564

#제출 시각아이디문제언어결과실행 시간메모리
1000564De3b0oReconstruction Project (JOI22_reconstruction)C++14
7 / 100
2074 ms49624 KiB
#include<bits/stdc++.h> #define ll long long #define F first #define S second #define in insert #define pb push_back #define ppb pop_back() #define d3 ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); #define cans cout << ans << "\n"; #define yes cout << "Yes" << "\n"; #define no cout << "No" << "\n"; #define pll pair<ll,ll> #define lin cout << "\n"; #define sqr 340 #define mod 1000000007 #define mid ((l+r)/2) #define lc (2*x) #define rc (2*x+1) using namespace std; ll n , m , q; pll a[1000009]; ll fans[1000009]; vector<ll> ed[509]; ll idx[509]; ll ls[509]; int main() { d3 cin >> n >> m; for(int i = 0 ; m>i ; i++) { ll u , v , w; cin >> u >> v >> w; ed[u].pb(w); } for(int i = 1 ; n>=i ; i++) { ls[i]=1e18; sort(ed[i].begin(),ed[i].end()); ed[i].pb(1e18); } cin >> q; for(int i = 0 ; q>i ; i++) { ll x; cin >> x; a[i].F=x; a[i].S=i; } sort(a,a+q); ll px = -1; for(int i = 0 ; q>i ; i++) { ll x = a[i].F; ll ans = 0; for(int j = 1 ; n>j ; j++) { int h = idx[j]; ls[j]+=x-px; for(; ed[j].size()>h ; h++) { if(abs(ed[j][h]-x)>ls[j]) break; ls[j]=abs(ed[j][h]-x); } h--; idx[j]=h; ans+=ls[j]; } fans[a[i].S]=ans; px=x; } for(int i = 0 ; q>i ; i++) cout << fans[i] << "\n"; }

컴파일 시 표준 에러 (stderr) 메시지

reconstruction.cpp: In function 'int main()':
reconstruction.cpp:63:31: warning: comparison of integer expressions of different signedness: 'std::vector<long long int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   63 |             for(; ed[j].size()>h ; h++)
      |                   ~~~~~~~~~~~~^~
#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...