제출 #1137755

#제출 시각아이디문제언어결과실행 시간메모리
1137755SmuggingSpunFortune Telling 2 (JOI14_fortune_telling2)C++20
4 / 100
3 ms328 KiB
#include<bits/stdc++.h> #define taskname "B" using namespace std; typedef long long ll; int n, k; namespace sub1{ const int lim = 1e3 + 5; int a[lim][2]; void solve(){ for(int i = 1; i <= n; i++){ cin >> a[i][0] >> a[i][1]; } for(int _ = 0; _ < k; _++){ int x; cin >> x; for(int i = 1; i <= n; i++){ if(a[i][0] <= x){ swap(a[i][0], a[i][1]); } } } ll ans = 0; for(int i = 1; i <= n; i++){ ans += a[i][0]; } cout << ans; } } namespace sub23{ void solve(){ } } int main(){ ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); if(fopen(taskname".inp", "r")){ freopen(taskname".inp", "r", stdin); } cin >> n >> k; if(max(n, k) <= 1000){ sub1::solve(); } else{ sub23::solve(); } }

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

fortune_telling2.cpp: In function 'int main()':
fortune_telling2.cpp:37:24: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   37 |                 freopen(taskname".inp", "r", stdin);
      |                 ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...