2 solutions

  • 1
    @ 2026-6-6 10:24:44

    qqqqqqqqqqqqqqqqqqqwwwwwwwwwwwwwwwwwwwwwwqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq

    • 0
      @ 2026-2-2 9:47:42
      #include<bits/stdc++.h>
      using namespace std;
      const int N=55;
      int a[N][N]; 
      int main()
      {
      	int h,w;
      	cin>>h>>w;
      	for(int i=1;i<=h;i++)
      	{
      		for(int j=1;j<=w;j++)
      		{
      			cin>>a[i][j];
      		}
      	}
      	int cnt=0;
      	for(int i=1;i<=h;i++)
      	{
      		for(int j=1;j<=w;j++)
      		{
      			for(int i1=i;i1<=h;i1++)
      			{
      				for(int j1=j;j1<=w;j1++)
      				{
      					if(a[i][j]+a[i1][j1]>a[i1][j]+a[i][j1])
      					{
      						cnt++;
      					}
      				}
      			}
      		}
      	}
      	if(cnt>0)
      	{
      		cout<<"No"<<endl;
      	}
      	else
      	{
      		cout<<"Yes"<<endl;
      	}
      	 
      }
      
      
      • 1

      Information

      ID
      2628
      Time
      1000ms
      Memory
      256MiB
      Difficulty
      3
      Tags
      # Submissions
      7
      Accepted
      6
      Uploaded By