/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Wrong Answer 1ms 764.0 KiB
#2 Accepted 1ms 484.0 KiB
#3 Accepted 1ms 532.0 KiB
#4 Accepted 1ms 320.0 KiB
#5 Wrong Answer 1ms 316.0 KiB

Code

#include <bits/stdc++.h>

#pragma GCC optimize("Ofast")
using namespace std;

void solve(int cs) {
  int n, m;
  cin >> m >> n;
  
  vector<vector<int>> M(7, vector<int>(m)), N(7, vector<int>(n));
  for (int i = 0; i < 7; i++) {
    for (int j = 0; j < m; j++) {
      cin >> M[i][j];
    }
  }
  
  for (int i = 0; i < 7; i++) {
    for (int j = 0; j < n; j++) {
      cin >> N[i][j];
    }
  }
  
  int mahfuz = 0, noyon = 0;
  int cnt = 0;
  for (int j = 0; j < m; j++) {
    for (int i = 0; i < 7; i++) {
      if (M[i][j] > 0) cnt += M[i][j];
      else {
        mahfuz = max(mahfuz, cnt);
        cnt = 0;
      }
    }
  }
  mahfuz = max(mahfuz, cnt);
  cnt = 0;
  for (int j = 0; j < n; j++) {
    for (int i = 0; i < 7; i++) {
      if (N[i][j] > 0) cnt += N[i][j];
      else {
        noyon = max(noyon, cnt);
        cnt = 0;
      }
    }
  }
  noyon = max(noyon, cnt);
  if (mahfuz > noyon) cout << "Mahfuz is the boss\n";
  else if (noyon > mahfuz) cout << "Noyon is the boss\n";
  else cout << "No one is the boss\n";
}

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

Information

Submit By
Type
Submission
Problem
P1017 Solution streak
Language
C++20 (G++ 13.2.0)
Submit At
2024-07-11 11:49:09
Judged At
2024-11-11 03:27:34
Judged By
Score
30
Total Time
1ms
Peak Memory
764.0 KiB