ログインしてください。
提出 #624991
ソースコード 拡げる
#include <iostream>
using namespace std;
int main() {
int n, round = 0, point = 1, room = 0, flg = 0;
cin >> n;
int a[n];
for (int i = 0; i < n; i++) {
cin >> a[i];
}
while (room < n) {
if (flg != 1) {
round++;
} else {
flg = 0;
}
for (int i = 0; i < n; i++) {
if (a[i] == point) {
room++;
for (int j = i + 1; j < n; j++) {
if (i != n-1) {
if (a[i] != a[j]) break;
}
i = j;
room++;
}
point++;
flg = 1;
printf("%d\n", point);
}
}
if (point == round) {
point++;
}
if (room == n && a[0] == room && a[1] != room) {
round--;
}
}
cout << round << endl;
return 0;
}
提出情報
| 提出日時 | |
|---|---|
| 問題 | B - ディスコ社内ツアー |
| ユーザ | lavi |
| 言語 | C++11 (GCC 4.9.2) |
| 得点 | 0 |
| コード長 | 1001 Byte |
| 結果 | WA |
| 実行時間 | 2035 ms |
| メモリ | 1320 KiB |
ジャッジ結果
| セット名 | Sample | Small | Permutation | All | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 得点 / 配点 | 0 / 0 | 0 / 20 | 0 / 10 | 0 / 70 | ||||||||||||||
| 結果 |
|
|
|
|
| セット名 | テストケース |
|---|---|
| Sample | 00_example_01.txt, 00_example_02.txt, 00_example_03.txt, 00_example_04.txt |
| Small | 00_example_01.txt, 00_example_02.txt, 00_example_03.txt, 00_example_04.txt, 10_rand_01.txt, 10_rand_02.txt, 10_rand_03.txt, 10_rand_04.txt, 10_rand_05.txt, 10_rand_06.txt, 10_rand_07.txt, 10_rand_08.txt, 20_perm_01.txt, 20_perm_02.txt, 20_perm_03.txt, 20_perm_04.txt, 20_perm_05.txt, 20_perm_06.txt, 20_perm_07.txt, 20_perm_08.txt, 30_hand_01.txt, 30_hand_02.txt, 30_hand_03.txt, 30_hand_04.txt, 30_hand_05.txt, 30_hand_06.txt |
| Permutation | 00_example_01.txt, 00_example_02.txt, 00_example_03.txt, 20_perm_01.txt, 20_perm_02.txt, 20_perm_03.txt, 20_perm_04.txt, 20_perm_05.txt, 20_perm_06.txt, 20_perm_07.txt, 20_perm_08.txt, 30_hand_01.txt, 30_hand_02.txt, 60_perm_01.txt, 60_perm_02.txt, 60_perm_03.txt, 60_perm_04.txt, 60_perm_05.txt, 60_perm_06.txt, 60_perm_07.txt, 60_perm_08.txt, 70_hand_01.txt, 70_hand_02.txt |
| All | 00_example_01.txt, 00_example_02.txt, 00_example_03.txt, 00_example_04.txt, 10_rand_01.txt, 10_rand_02.txt, 10_rand_03.txt, 10_rand_04.txt, 10_rand_05.txt, 10_rand_06.txt, 10_rand_07.txt, 10_rand_08.txt, 20_perm_01.txt, 20_perm_02.txt, 20_perm_03.txt, 20_perm_04.txt, 20_perm_05.txt, 20_perm_06.txt, 20_perm_07.txt, 20_perm_08.txt, 30_hand_01.txt, 30_hand_02.txt, 30_hand_03.txt, 30_hand_04.txt, 30_hand_05.txt, 30_hand_06.txt, 50_rand_01.txt, 50_rand_02.txt, 50_rand_03.txt, 50_rand_04.txt, 50_rand_05.txt, 50_rand_06.txt, 50_rand_07.txt, 50_rand_08.txt, 60_perm_01.txt, 60_perm_02.txt, 60_perm_03.txt, 60_perm_04.txt, 60_perm_05.txt, 60_perm_06.txt, 60_perm_07.txt, 60_perm_08.txt, 70_hand_01.txt, 70_hand_02.txt, 70_hand_03.txt, 70_hand_04.txt, 70_hand_05.txt, 70_hand_06.txt |
| ケース名 | 結果 | 実行時間 | メモリ |
|---|---|---|---|
| 00_example_01.txt | WA | 26 ms | 732 KiB |
| 00_example_02.txt | WA | 27 ms | 920 KiB |
| 00_example_03.txt | WA | 27 ms | 800 KiB |
| 00_example_04.txt | WA | 25 ms | 924 KiB |
| 10_rand_01.txt | TLE | 2034 ms | 868 KiB |
| 10_rand_02.txt | TLE | 2035 ms | 932 KiB |
| 10_rand_03.txt | TLE | 2034 ms | 932 KiB |
| 10_rand_04.txt | TLE | 2034 ms | 924 KiB |
| 10_rand_05.txt | TLE | 2034 ms | 928 KiB |
| 10_rand_06.txt | TLE | 2034 ms | 800 KiB |
| 10_rand_07.txt | TLE | 2035 ms | 924 KiB |
| 10_rand_08.txt | TLE | 2033 ms | 928 KiB |
| 20_perm_01.txt | WA | 27 ms | 920 KiB |
| 20_perm_02.txt | WA | 26 ms | 796 KiB |
| 20_perm_03.txt | WA | 26 ms | 732 KiB |
| 20_perm_04.txt | WA | 27 ms | 812 KiB |
| 20_perm_05.txt | WA | 25 ms | 672 KiB |
| 20_perm_06.txt | WA | 24 ms | 800 KiB |
| 20_perm_07.txt | WA | 25 ms | 924 KiB |
| 20_perm_08.txt | WA | 27 ms | 800 KiB |
| 30_hand_01.txt | WA | 27 ms | 712 KiB |
| 30_hand_02.txt | WA | 25 ms | 920 KiB |
| 30_hand_03.txt | WA | 28 ms | 916 KiB |
| 30_hand_04.txt | WA | 26 ms | 672 KiB |
| 30_hand_05.txt | WA | 40 ms | 924 KiB |
| 30_hand_06.txt | TLE | 2034 ms | 812 KiB |
| 50_rand_01.txt | TLE | 2034 ms | 1060 KiB |
| 50_rand_02.txt | TLE | 2034 ms | 1192 KiB |
| 50_rand_03.txt | TLE | 2033 ms | 1184 KiB |
| 50_rand_04.txt | TLE | 2033 ms | 1056 KiB |
| 50_rand_05.txt | TLE | 2034 ms | 888 KiB |
| 50_rand_06.txt | TLE | 2032 ms | 804 KiB |
| 50_rand_07.txt | TLE | 2035 ms | 936 KiB |
| 50_rand_08.txt | TLE | 2035 ms | 1060 KiB |
| 60_perm_01.txt | WA | 750 ms | 856 KiB |
| 60_perm_02.txt | TLE | 2033 ms | 1164 KiB |
| 60_perm_03.txt | TLE | 2035 ms | 1188 KiB |
| 60_perm_04.txt | WA | 1703 ms | 932 KiB |
| 60_perm_05.txt | WA | 305 ms | 804 KiB |
| 60_perm_06.txt | WA | 25 ms | 800 KiB |
| 60_perm_07.txt | WA | 96 ms | 804 KiB |
| 60_perm_08.txt | WA | 1767 ms | 940 KiB |
| 70_hand_01.txt | WA | 128 ms | 1180 KiB |
| 70_hand_02.txt | TLE | 2032 ms | 1316 KiB |
| 70_hand_03.txt | WA | 166 ms | 1188 KiB |
| 70_hand_04.txt | WA | 165 ms | 1184 KiB |
| 70_hand_05.txt | TLE | 2034 ms | 1320 KiB |
| 70_hand_06.txt | TLE | 2032 ms | 1308 KiB |