제출 #473162

#제출 시각아이디문제언어결과실행 시간메모리
473162ZaZo_Genetics (BOI18_genetics)C++14
0 / 100
2099 ms372024 KiB
#include <bits/stdc++.h> #define ZAZO ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); #define int long long using namespace std; int n , m , k; int32_t main() { ZAZO cin >> n >> m >> k; vector<pair<char,int>>v[m]; vector<multiset<int>>ans(n); for(int i = 0 ; i < n ; i ++) { for(int j = 0 ; j < m ; j ++) { char x; cin>>x; v[j].push_back({x,i}); } } for(int i = 0 ; i < m ; i ++) { multiset<int>ad; sort(v[i].begin(),v[i].end()); for(int j = 0 ; j < n ; j ++) { if(v[i][j].first=='A') ad.insert(v[i][j].second); else { if(ad.size()) { auto it=ad.begin(); for(;it!=ad.end();it++) { ans[v[i][j].second].insert(*it); ans[*it].insert(v[i][j].second); } } } } } for(int i = 0 ; i < n ; i++) { int prev=0; auto it=ans[i].begin(); prev=*it; int cnt=0; if(ans[i].size()==k*(n-1)) {cout<<i+1<<endl; break;} } }

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

genetics.cpp: In function 'int32_t main()':
genetics.cpp:49:21: warning: comparison of integer expressions of different signedness: 'std::multiset<long long int>::size_type' {aka 'long unsigned int'} and 'long long int' [-Wsign-compare]
   49 |     if(ans[i].size()==k*(n-1)) {cout<<i+1<<endl; break;}
      |        ~~~~~~~~~~~~~^~~~~~~~~
genetics.cpp:45:9: warning: variable 'prev' set but not used [-Wunused-but-set-variable]
   45 |     int prev=0;
      |         ^~~~
genetics.cpp:48:9: warning: unused variable 'cnt' [-Wunused-variable]
   48 |     int cnt=0;
      |         ^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...