/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 532.0 KiB
#2 Accepted 1ms 536.0 KiB
#3 Wrong Answer 1ms 344.0 KiB
#4 Wrong Answer 1ms 544.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,summ=0,sumn=0;
    for (int i = 0; i < M; i++) {
        int c_streak=0;
        for (int j = 0; j < 7; j++) {
            if (m[i][j] != 0) {
                summ=summ+m[i][j];
                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++;
                sumn=sumn+n[i][j];
            } else {
                msn = max(msn, c_streak);
                c_streak = 0;
            }
        }
        msn = max(msn, c_streak);
    }
    
    if (msm > msn && summ>sumn) {
        cout << "Mahfuz is the boss";
    } else if (msn > msm && sumn>summ) {
        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++17 (G++ 13.2.0)
Submit At
2023-12-31 16:56:53
Judged At
2024-11-11 03:44:54
Judged By
Score
20
Total Time
1ms
Peak Memory
544.0 KiB