結果
| 問題 | No.1133 キムワイプイーター |
| ユーザー |
|
| 提出日時 | 2020-08-22 02:38:06 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
CE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 962 bytes |
| 記録 | |
| コンパイル時間 | 704 ms |
| コンパイル使用メモリ | 105,360 KB |
| 最終ジャッジ日時 | 2026-06-12 15:23:31 |
| 合計ジャッジ時間 | 1,705 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge2_0 |
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:26:19: error: variable 'std::array<int, 4> dy' has initializer but incomplete type
26 | array<int, 4> dy{1, 0, 0, -1}, dx{0, 1, -1, 0};
| ^~
main.cpp:10:1: note: 'std::array' is defined in header '<array>'; this is probably fixable by adding '#include <array>'
9 | #include <cmath>
+++ |+#include <array>
10 |
main.cpp:26:36: error: variable 'std::array<int, 4> dx' has initializer but incomplete type
26 | array<int, 4> dy{1, 0, 0, -1}, dx{0, 1, -1, 0};
| ^~
main.cpp:26:36: note: 'std::array' is defined in header '<array>'; this is probably fixable by adding '#include <array>'
ソースコード
#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <numeric>
#include <bitset>
#include <cmath>
static const int MOD = 1000000007;
using ll = long long;
using u32 = unsigned;
using u64 = unsigned long long;
using namespace std;
template<class T> constexpr T INF = ::numeric_limits<T>::max()/32*15+208;
int main() {
int n, m;
cin >> n >> m;
string s;
cin >> s;
vector<vector<int>> v(n+1, vector<int>(n+1, 1));
string a = "URLD";
array<int, 4> dy{1, 0, 0, -1}, dx{0, 1, -1, 0};
int y = 0, x = 0;
v[y][x] = 0;
for (int i = 0; i < m; ++i) {
for (int j = 0; j < 4; ++j) {
if(s[i] == a[j]) y += dy[j], x += dx[j];
}
v[y][x] = 0;
}
for (int i = 0; i <= n; ++i) {
for (int j = 0; j <= n; ++j) {
if(j) printf(" ");
printf("%d", v[n-i][j]);
}
puts("");
}
return 0;
}