/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 540.0 KiB
#2 Accepted 1ms 444.0 KiB
#3 Wrong Answer 1ms 540.0 KiB
#4 Wrong Answer 1ms 496.0 KiB
#5 Accepted 1ms 540.0 KiB
#6 Accepted 1ms 540.0 KiB
#7 Wrong Answer 1ms 540.0 KiB
#8 Accepted 1ms 408.0 KiB
#9 Wrong Answer 1ms 484.0 KiB
#10 Accepted 1ms 540.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];
        }cout<<endl;
    }
    for(int i=0; i<7; i++)
    {
        for(int j=0;j<n;j++)
        {
            cin>>noy[i][j];
        }cout<<endl;
    }
    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 = 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 = 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:35:32
Judged At
2024-03-27 21:35:32
Judged By
Score
60
Total Time
1ms
Peak Memory
540.0 KiB