/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 2ms 324.0 KiB
#2 Accepted 2ms 328.0 KiB
#3 Accepted 2ms 492.0 KiB
#4 Accepted 2ms 540.0 KiB
#5 Accepted 2ms 560.0 KiB
#6 Accepted 2ms 496.0 KiB
#7 Accepted 2ms 448.0 KiB
#8 Wrong Answer 2ms 484.0 KiB
#9 Accepted 2ms 492.0 KiB
#10 Accepted 2ms 524.0 KiB

Code

#include <bits/stdc++.h>

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

// #ifndef ONLINE_JUDGE
// #include "Ash.cpp"
// #else
// #define dbg(...)
// #define dbgA(...)
// #endif

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];
    }
  }
  
  int64_t mahfuz = 0, noyon = 0;
  int64_t 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 << "Nayon 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:54:32
Judged At
2024-11-11 03:27:32
Judged By
Score
90
Total Time
2ms
Peak Memory
560.0 KiB