题解 | 上三角矩阵判定

上三角矩阵判定

https://www.nowcoder.com/practice/f5a29bacfc514e5a935723857e1245e4

#include <iostream>
using namespace std;
typedef long long ll;
int main() {
    ll t,x,c=0;
    cin>>t;
    for(ll i=0;i<t;i++){
        for(ll j=0;j<t;j++){
            cin>>x;
            if(i>j&&x!=0)c++;
        }
    }
    if(!c)cout<<"YES";
    else cout<<"NO";
}
// 64 位输出请用 printf("%lld")

全部评论

相关推荐

点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务