제출 #1218367

#제출 시각아이디문제언어결과실행 시간메모리
1218367exoworldgdPoi (IOI09_poi)C++20
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #define exoworldgd cin.tie(0)->sync_with_stdio(0),cout.tie(0) #define int long long using namespace std; signed main(void) { exoworldgd; int n,m,p,rank = 0; cin >> n >> m >> p; solved[n+1][m],w[m],score[n+1],cnt[n+1]; memset(w,0,sizeof(w)),memset(score,0,sizeof(score)),memset(cnt,0,sizeof(cnt)); for(int i = 1; i <= n; i++) for(int j = 0; j < m; j++) cin >> solved[i][j]; for(int j = 0; j < m; j++) for(int i = 1; i <= n; i++) if(!solved[i][j]) w[j]++; for(int i = 1; i <= n; i++) for(int j = 0; j < m; j++) if(solved[i][j])score[i] += w[j],cnt[i]++; vector<tuple<int,int,int>> v; v.reserve(n); for(int i = 1; i <= n; i++) v.emplace_back(-score[i],-cnt[i],i); sort(v.begin(),v.end()); for(int i = 0; i < n; i++) if(get<2>(v[i]) == p) { rank = i+1; break; } cout << score[p] << " " << rank; }

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

poi.cpp: In function 'int main()':
poi.cpp:9:5: error: 'solved' was not declared in this scope
    9 |     solved[n+1][m],w[m],score[n+1],cnt[n+1];
      |     ^~~~~~
poi.cpp:9:20: error: 'w' was not declared in this scope
    9 |     solved[n+1][m],w[m],score[n+1],cnt[n+1];
      |                    ^
poi.cpp:9:25: error: 'score' was not declared in this scope
    9 |     solved[n+1][m],w[m],score[n+1],cnt[n+1];
      |                         ^~~~~
poi.cpp:9:36: error: 'cnt' was not declared in this scope; did you mean 'int'?
    9 |     solved[n+1][m],w[m],score[n+1],cnt[n+1];
      |                                    ^~~
      |                                    int