| 比赛 |
期末考试3 |
评测结果 |
WWWAAWAAAAAAAWAWAWAAWWWAWWWAWWWAWWAAAAAAWAWAWWAWAWWAWAWWAWAWAAAWWWWAA |
| 题目名称 |
hope I can sort matrix |
最终得分 |
50 |
| 用户昵称 |
xuyuqing |
运行时间 |
1.842 s |
| 代码语言 |
C++ |
内存使用 |
10.19 MiB |
| 提交时间 |
2026-02-11 11:01:04 |
显示代码纯文本
#include <cstdio>
#include <iostream>
#include <vector>
using namespace std;
class fastIn {
private:
char buf [1 << 20];
char *p1 = buf;
char *p2 = buf;
inline char getch ();
public:
template <typename NumT>
void read (NumT &num);
template <typename NumT>
fastIn& operator >> (NumT &num);
};
inline char fastIn::getch () {
if (p1 == p2) {
p1 = buf;
p2 = buf + fread (buf, 1, 1 << 20, stdin);
if (p1 == p2) {
return EOF;
}
}
return *p1++;
}
template <typename NumT>
void fastIn::read (NumT &num) {
char ch = getch ();
NumT op = 1;
num = 0;
while (ch < '0' || '9' < ch) {
op = ((ch == '-') ? -1 : 1);
ch = getch ();
}
while ('0' <= ch && ch <= '9') {
num *= 10;
num += (ch - '0');
ch = getch ();
}
num *= op;
}
template <typename NumT>
fastIn& fastIn::operator >> (NumT &num) {
read (num);
return *this;
}
fastIn fin;
int n;
int m;
int magic;
int main () {
freopen ("hopeicansortmatrix.in", "r", stdin);
freopen ("hopeicansortmatrix.out", "w", stdout);
fin >> n >> m;
vector<vector<int>> nums (n + 1, vector<int> (m + 1));
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= m; j++) {
fin >> nums[i][j];
magic += nums[i][j] + i + j;
}
}
if (magic % 2) {
cout << "Yes" << endl;
}
else {
cout << "No" << endl;
}
return 0;
}