제출 #1281268

#제출 시각아이디문제언어결과실행 시간메모리
1281268floExhibition (JOI19_ho_t2)C++20
100 / 100
39 ms2920 KiB
#include <bits/stdc++.h> #define task "testing" #define int long long #define multitest 0 using namespace std; const int N = 1e5; int c[N+5]; pair<int, int> a[N+5]; void flo(int ID) { int n, m; cin >> n >> m; for (int x = 1; x <= n; x++) { cin >> a[x].second >> a[x].first; } sort(a+1, a+n+1); for (int x = 1; x <= m; x++) cin >> c[x]; sort(c+1, c+m+1, greater<int>()); int cnt = 1; for (int x = n; x >= 1 && cnt <= m; x--) { if (a[x].second <= c[cnt]) cnt++; } cout << cnt-1 << "\n"; } signed main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); if (fopen(task".inp", "r")) { freopen(task".inp", "r", stdin); freopen(task".out", "w", stdout); } int TCS = 1, ID = 1; if (multitest) { cin >> TCS; } while (TCS--) flo(ID++); return 0; }

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

joi2019_ho_t2.cpp: In function 'int main()':
joi2019_ho_t2.cpp:40:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   40 |         freopen(task".inp", "r", stdin);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
joi2019_ho_t2.cpp:41:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   41 |         freopen(task".out", "w", stdout);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...