/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 2ms 584.0 KiB
#2 Wrong Answer 3ms 816.0 KiB
#3 Wrong Answer 84ms 972.0 KiB

Code

#include <bits/stdc++.h>

using namespace std;

vector<array<int, 4>> v;

void BaseCases() {
    v.push_back({0, 0, 3, 0});
    v.push_back({1, 1, 2, 0});
    v.push_back({3, 0, 2, 0});
    v.push_back({0, 0, 1, 2});
    v.push_back({1, 1, 1, 1});
    v.push_back({3, 0, 1, 1});
    v.push_back({0, 3, 1, 0});
    v.push_back({2, 2, 1, 0});
    v.push_back({4, 1, 1, 0});
    v.push_back({6, 0, 1, 0});
    v.push_back({1, 1, 0, 2});
    v.push_back({3, 0, 0, 2});
    v.push_back({2, 2, 0, 1});
    v.push_back({4, 1, 0, 1});
    v.push_back({6, 0, 0, 1});
    v.push_back({1, 4, 0, 0});
    v.push_back({3, 3, 0, 0});
    v.push_back({5, 2, 0, 0});
    v.push_back({7, 1, 0, 0});
    v.push_back({9, 0, 0, 0});
}

int dp[51][51][51];
int a, b, c, d;

void solve(int cs) {
  cin >> a >> b >> c >> d;

  for (int i = 0; i <= a; ++i) {
    for (int j = 0; j <= b; ++j) {
      for (int k = 0; k <= c; ++k) {
        for (auto &x : v) {
          if (i >= x[0] && j >= x[1] && k >= x[2] && d >= x[3]) {
            dp[i][j][k] = max(dp[i][j][k], dp[i - x[0]][j - x[1]][k - x[2]] + 1);
          }
        }
      }
    }
  }

  cout << "Case " << cs << ": " << dp[a][b][c] << "\n";
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int tc = 1;
  BaseCases();
  cin >> tc;
  for (int cs = 1; cs <= tc; cs++) {
    solve(cs);
  }
  return 0;
}

Information

Submit By
Type
Submission
Problem
P1014 FIFA World Cup 2022 Again!
Language
C++20 (G++ 13.2.0)
Submit At
2024-07-13 09:20:23
Judged At
2024-11-11 03:26:33
Judged By
Score
1
Total Time
84ms
Peak Memory
972.0 KiB