제출 #956721

#제출 시각아이디문제언어결과실행 시간메모리
956721DeltaStructMiners (IOI07_miners)C++17
0 / 100
1560 ms604 KiB
#include <bits/stdc++.h> using namespace std; int main(){ int n,id=numeric_limits<int>::lowest(); cin >> n; string s; cin >> s; vector dp(4,vector(4,vector(4,vector<int>(4,id)))); for (char a:s){ vector res(5,vector(5,vector(5,vector<int>(5,id)))); for (int i(0);i < 4;++i) for (int k(0);k < 4;++k) for (int j(0);j < 4;++j) for (int l(0);l < 4;++l){ if (dp[i][k][j][l]!=3) for (int t(0);t < 3;++t){ { set<int> s = {i,k,t}; if (s.find(3)!=s.end()) s.erase(3); res[k][t][j][l] = max(res[k][t][j][l],dp[i][k][j][l]+(int)s.size()); } { set<int> s = {j,l,t}; if (s.find(3)!=s.end()) s.erase(3); res[i][k][l][t] = max(res[i][k][l][t],dp[i][k][j][l]+(int)s.size()); } } } swap(dp,res); } int r = 0; for (int i(0);i < 4;++i) for (int k(0);k < 4;++k) for (int j(0);j < 4;++j) for (int l(0);l < 4;++l){ r = max(r,dp[i][k][j][l]); } cout << r << endl; }

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

miners.cpp: In function 'int main()':
miners.cpp:6:13: warning: unused variable 'a' [-Wunused-variable]
    6 |   for (char a:s){
      |             ^
#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...