明天就要考试了,但是我正处于一点都不想学的状态
高考前我也是这样的
逆天
代码如下:
#include<vector>
#include<cstdio>
using namespace std;
int n, m;
struct Node{int id;vector<int> d;bool operator<(const Node &tmp) const{for(int i = 0; i < m; i++)if(d[i] >= tmp.d[i]) return false;return true;}
};int main(void)
{scanf("%d%d", &n, &m);vector<Node> nodes; nodes.resize(n);for(int i = 1; i <= n; i++){nodes[i - 1].id = i; nodes[i - 1].d.resize(m);for(int j = 0; j < m; j++)scanf("%d", &nodes[i - 1].d[j]);}for(int i = 0; i < n; i++){bool is_have = false;for(int j = 0; j < n; j++)if(j == i) continue;else if(nodes[i] < nodes[j]){printf("%d\n", nodes[j].id);is_have = true;break;}if(!is_have) printf("0\n");}return 0;
}