Submission #375071

# Submission time Handle Problem Language Result Execution time Memory
375071 2021-03-09T02:10:20 Z daniel920712 Naan (JOI19_naan) C++14
0 / 100
43 ms 35636 KB
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <vector>

using namespace std;
vector < long long > sum[1005];

int main()
{
    long long N,M,i,j,k,tt=0,t;
    scanf("%lld %lld",&N,&M);
    for(i=0;i<N;i++)
    {
        tt=0;
        sum[i].push_back(tt);
        for(j=0;j<M;j++)
        {
            scanf("%lld",&t);
            for(k=0;k<M;k++)
            {
                tt+=t;
                sum[i].push_back(tt);
            }
        }
    }
    N*=M;
    for(i=1;i<N;i++)
    {
        if(sum[0][i]*N>=sum[0][N]*i&&(sum[1][N]-sum[1][i])*N>=sum[1][N]*(N-i))
        {
            printf("%lld 2\n",i);
            printf("1 2\n");
            return 0;
        }

        if(sum[1][i]*N>=sum[1][N]*i&&(sum[0][N]-sum[0][i])*N>=sum[0][N]*(N-i))
        {
            printf("%lld 2\n",i);
            printf("2 1\n");
            return 0;
        }

    }
    printf("-1\n");

    return 0;
}

Compilation message

naan.cpp: In function 'int main()':
naan.cpp:12:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   12 |     scanf("%lld %lld",&N,&M);
      |     ~~~~~^~~~~~~~~~~~~~~~~~~
naan.cpp:19:18: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   19 |             scanf("%lld",&t);
      |             ~~~~~^~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Not a fair distribution.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 43 ms 35636 KB Not a fair distribution.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Not a fair distribution.
2 Halted 0 ms 0 KB -