제출 #907580

#제출 시각아이디문제언어결과실행 시간메모리
907580AlphaMale06Self Study (JOI22_ho_t2)C++14
35 / 100
1063 ms12004 KiB
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; #define yes cout << "YES\n" #define no cout << "NO\n" #define F first #define S second #define pb push_back #define mp make_pair #define all(x) (x).begin(), (x).end() #define int long long void solve(){ int n, m; cin >> n >> m; int a[n], b[n]; for(int i=0; i< n; i++)cin >> a[i]; for(int i=0; i< n; i++)cin >> b[i]; int l=0; int r=1e18+1; int ans=0; if(m==1){ ans=1e18; for(int i=0; i< n; i++){ ans=min(ans, max(a[i], b[i])); } cout << ans << '\n'; return; } set<pair<int, int>> st; for(int i=0; i< n; i++){ st.insert({0, i}); } for(int i=0; i<n*m; i++){ pair<int, int> k=*st.begin(); st.erase(k); st.insert({k.F+a[k.S], k.S}); } cout << (*st.begin()).F << '\n'; } signed main(){ ios_base::sync_with_stdio(false); cin.tie(0); solve(); }

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

Main.cpp: In function 'void solve()':
Main.cpp:21:6: warning: unused variable 'l' [-Wunused-variable]
   21 |  int l=0; int r=1e18+1;
      |      ^
Main.cpp:21:15: warning: unused variable 'r' [-Wunused-variable]
   21 |  int l=0; int r=1e18+1;
      |               ^
#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...