제출 #520324

#제출 시각아이디문제언어결과실행 시간메모리
520324MurotYMiners (IOI07_miners)C++14
9 / 100
1593 ms11196 KiB
#include <bits/stdc++.h> #define ll long long #define ios ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); #define ff first #define ss second using namespace std; const int N=1e6+7, M=1e9+7; map <ll,ll> mp; int n; string s; ll ans=0; void dfs(ll x, string a){ mp[x]++; string b; for (int i=0;i<n;i++) if (mp[i] == 0) b=b+s[i]; map <char,ll> mp1; ll res=0; for (int i=0;i<a.size();i++){ if (i-1 >= 0) mp1[a[i-1]]=1; if (i-2 >= 0) mp1[a[i-2]]=1; mp1[a[i]]=1; res+=mp1['B']+mp1['F']+mp1['M']; } mp1.clear(); for (int i=0;i<b.size();i++){ if (i-1 >= 0) mp1[b[i-1]]=1; if (i-2 >= 0) mp1[b[i-2]]=1; mp1[b[i]]=1; res+=mp1['B']+mp1['F']+mp1['M']; } ans=max(ans, res); for (int i=0;i<n;i++){ if (i > x) dfs(i, a+s[x]); } mp[x]--; return ; } int main() { cin >> n >> s; dfs(0, ""); cout << ans; }

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

miners.cpp: In function 'void dfs(long long int, std::string)':
miners.cpp:19:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   19 |  for (int i=0;i<a.size();i++){
      |               ~^~~~~~~~~
miners.cpp:26:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   26 |  for (int i=0;i<b.size();i++){
      |               ~^~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...