/ SeriousOJ /

Record Detail

Wrong Answer


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

Code

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int m,n;
    cin>>m>>n;
    int mah[7][m];
    int noy[7][n];
    for(int i=0; i<7; i++)
    {
        for(int j=0;j<m;j++)
        {
            cin>>mah[i][j];
        }
    }
    for(int i=0; i<7; i++)
    {
        for(int j=0;j<n;j++)
        {
            cin>>noy[i][j];
        }
    }
    int noyon_st =0;
    int mahfuj_st =0;

    int noy_solve = 0;
    int mah_solve = 0;

    int max_mah_st = 0;
    int max_noy_st = 0;

    int max_mah_solve = 0;
    int max_noy_solve = 0;

    for(int j=0; j<m;j++)
    {
        for(int i=0; i<7; i++)
        {
            if(mah[i][j]>0){
                mahfuj_st++;
                mah_solve += mah[i][j];
                if(mahfuj_st >= max_mah_st)
                {
                    max_mah_st = mahfuj_st;  
                    max_mah_solve = max(max_mah_solve, mah_solve); 
                }
                
            }else{
                mahfuj_st = 0;
                mah_solve = 0;
            }
        }
    }
    for(int j=0; j<n;j++)
    {
        for(int i=0; i<7; i++)
        {
            if(noy[i][j]>0){
                noyon_st++;
                noy_solve += noy[i][j];
                if(noyon_st >= max_noy_st)
                {
                    max_noy_st = noyon_st;  
                    max_noy_solve = max(max_noy_solve,noy_solve); 
                }
                
            }else{
                noyon_st = 0;
                noy_solve = 0;
            }
        }
    }
    if(max_noy_st>max_mah_st)
    {
        cout<<"Nayon is the boss"<<endl;
    }
    else if(max_mah_st>max_noy_st)
    {
        cout<<"Mahfuj is the boss"<<endl;
    }
    else{
        if(max_noy_solve>max_mah_solve)
        {
            cout<<"Nayon is the boss"<<endl;
        }
        else if(max_mah_solve>max_noy_solve)
        {
            cout<<"Mahfuj is the boss"<<endl;
        }
        else
        {
            cout<<"No one is the boss"<<endl;
        }
    }
    return 0;

}

Information

Submit By
Type
Submission
Problem
P1017 Solution streak
Language
C++20 (G++ 13.2.0)
Submit At
2024-03-27 21:48:03
Judged At
2024-11-11 03:37:00
Judged By
Score
20
Total Time
2ms
Peak Memory
532.0 KiB