제출 #1281229

#제출 시각아이디문제언어결과실행 시간메모리
1281229tunademayoMarathon Race 2 (JOI24_ho_t3)C++20
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h> using namespace std; #define ll long long const bool Multitest = 0; const int N = 5e5 + 10, M = 800; int a[N]; vector<int> pos; void work() { cin >> n >> m; for(int i = 1 ; i <= m ; i++) { int x; cin >> x; a[x]++; } for(int i = 1 ; i <= m ; i++) { if(a[i]) pos.push_back(i); } cin >> q; while(q--) { int l, r, t; cin >> l >> r >> t; if(b.size() > M) { cout << "No" << '\n'; return; } cout << "Yes" << '\n'; } } int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); if(fopen("boardgame.inp", "r")) { freopen("boardgame.inp", "r", stdin); freopen("boardgame.out", "w", stdout); } int q = 1; if(Multitest) cin >> q; while(q--) work(); }

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

Main.cpp: In function 'void work()':
Main.cpp:14:12: error: 'n' was not declared in this scope
   14 |     cin >> n >> m;
      |            ^
Main.cpp:14:17: error: 'm' was not declared in this scope
   14 |     cin >> n >> m;
      |                 ^
Main.cpp:27:12: error: 'q' was not declared in this scope
   27 |     cin >> q;
      |            ^
Main.cpp:33:12: error: 'b' was not declared in this scope
   33 |         if(b.size() > M)
      |            ^
Main.cpp: In function 'int main()':
Main.cpp:51:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   51 |         freopen("boardgame.inp", "r", stdin);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Main.cpp:52:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   52 |         freopen("boardgame.out", "w", stdout);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~