提出 #26924004
ソースコード 拡げる
#include <bits/stdc++.h>
#include <iostream>
using namespace std;
int main() {
int N, M;
cin >> N >> M;
int offset_i = 0;
int offset_j = 0;
for (int i = 1; i <= N; i++) {
for (int j = 1; j <= M; j++) {
int c;
cin >> c;
if (i == 1 && j == 1) {
offset_i = (c-1) / 7;
offset_j = (c-1) % 7;
}
if (offset_j + j > 7) {
cout << "No" << endl;
return 0;
}
if (c != ((offset_i + i - 1) * 7 + (offset_j + j))) {
cout << "No" << endl;
return 0;
}
}
}
cout << "Yes" << endl;
}
提出情報
| 提出日時 | |
|---|---|
| 問題 | C - Calendar Validator |
| ユーザ | hnkz_hnkz |
| 言語 | C++ (GCC 9.2.1) |
| 得点 | 300 |
| コード長 | 732 Byte |
| 結果 | AC |
| 実行時間 | 35 ms |
| メモリ | 3588 KiB |
ジャッジ結果
| セット名 | Sample | All | ||||
|---|---|---|---|---|---|---|
| 得点 / 配点 | 0 / 0 | 300 / 300 | ||||
| 結果 |
|
|
| セット名 | テストケース |
|---|---|
| Sample | example0.txt, example1.txt, example2.txt |
| All | 000.txt, 001.txt, 002.txt, 003.txt, 004.txt, 005.txt, 006.txt, 007.txt, 008.txt, 009.txt, 010.txt, 011.txt, 012.txt, 013.txt, 014.txt, 015.txt, 016.txt, 017.txt, 018.txt, 019.txt, 020.txt, 021.txt, 022.txt, example0.txt, example1.txt, example2.txt |
| ケース名 | 結果 | 実行時間 | メモリ |
|---|---|---|---|
| 000.txt | AC | 1 ms | 3548 KiB |
| 001.txt | AC | 2 ms | 3588 KiB |
| 002.txt | AC | 2 ms | 3408 KiB |
| 003.txt | AC | 2 ms | 3360 KiB |
| 004.txt | AC | 2 ms | 3480 KiB |
| 005.txt | AC | 2 ms | 3480 KiB |
| 006.txt | AC | 2 ms | 3484 KiB |
| 007.txt | AC | 2 ms | 3424 KiB |
| 008.txt | AC | 4 ms | 3552 KiB |
| 009.txt | AC | 2 ms | 3424 KiB |
| 010.txt | AC | 28 ms | 3584 KiB |
| 011.txt | AC | 35 ms | 3408 KiB |
| 012.txt | AC | 2 ms | 3520 KiB |
| 013.txt | AC | 14 ms | 3368 KiB |
| 014.txt | AC | 2 ms | 3584 KiB |
| 015.txt | AC | 2 ms | 3520 KiB |
| 016.txt | AC | 2 ms | 3356 KiB |
| 017.txt | AC | 2 ms | 3356 KiB |
| 018.txt | AC | 2 ms | 3556 KiB |
| 019.txt | AC | 2 ms | 3552 KiB |
| 020.txt | AC | 8 ms | 3520 KiB |
| 021.txt | AC | 2 ms | 3360 KiB |
| 022.txt | AC | 2 ms | 3584 KiB |
| example0.txt | AC | 2 ms | 3496 KiB |
| example1.txt | AC | 2 ms | 3364 KiB |
| example2.txt | AC | 2 ms | 3480 KiB |