为什么这种构造方式不行
查看原帖
为什么这种构造方式不行
732523
ZGC1111楼主2022/11/19 21:44
#include<map>
#include<unordered_map>
#include<vector>
#include<queue>
#include<cstring>
#include<math.h>
#include<algorithm>
#include<iostream>
using namespace std;
const int N = 2e5 + 10;
int n, m;
int t, T;
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cin >> t;
    cin >> T;
    while (T--) {
        cin >> n >> m;
        if (n > 1 && m == 1)cout << "NO" << endl;
        else {
            cout << "YES" << endl;
            int k = 1,score=100;
            for (int i = 1; i <= n; i++) {
                for (int j = 1; j <= m; j++) {
                    if (j == k)cout << score << " ";
                    else cout << 0 << " ";
                }
                cout << endl;
                k++;
                if (k > m)k = 1;
            }
        }        
    }
    return 0;
}

就是

100 0 0

0 100 0

0 0 100

100 0 0

这种

题目不是只要求只要有一门分数比另一个人大就行吗

2022/11/19 21:44
加载中...