/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 532.0 KiB
#2 Accepted 1ms 532.0 KiB
#3 Wrong Answer 1ms 532.0 KiB
#4 Wrong Answer 2ms 324.0 KiB

Code

#include <iostream>
#include<algorithm>
using namespace std;
int main() {
    int M, N;
    cin >> M >> N;
    int m[M][7], n[N][7];
    for (int i = 0; i < M; i++) {
        for (int j = 0; j < 7; j++) {
            cin >> m[i][j];
        }
    }
    for (int i = 0; i < N; i++) {
        for (int j = 0; j < 7; j++) {
            cin >> n[i][j];
        }
    }
    
    int msm = 0, msn = 0;
    for (int i = 0; i < M; i++) {
        int c_streak=0;
        for (int j = 0; j < 7; j++) {
            if (m[i][j] != 0) {
                c_streak++;
            } else {
                msm = max(msm, c_streak);
                c_streak = 0;
            }
        }
        msm = max(msm, c_streak);
    }
    
    for (int i = 0; i < N; i++) {
        int c_streak=0;
        for (int j = 0; j < 7; j++) {
            if (n[i][j] != 0) {
                c_streak++;
            } else {
                msn = max(msn, c_streak);
                c_streak = 0;
            }
        }
        msn = max(msn, c_streak);
    }
    
    if (msm > msn) {
        cout << "Mahfuz is the boss";
    } else if (msn > msm) {
        cout << "Nayon is the boss";
    } else {
        cout << "No one is the boss";
    }
    
    return 0;
}

Information

Submit By
Type
Submission
Problem
P1017 Solution streak
Contest
Brain booster - 1
Language
C++20 (G++ 13.2.0)
Submit At
2023-12-31 14:13:29
Judged At
2024-11-11 03:46:22
Judged By
Score
20
Total Time
2ms
Peak Memory
532.0 KiB