質問編集履歴
1
kazuma-sさんのアドバイスにより書き直したソースコードを追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -195,3 +195,87 @@
|
|
195
195
|
}
|
196
196
|
|
197
197
|
```
|
198
|
+
|
199
|
+
|
200
|
+
|
201
|
+
### kazuma-sさんのアドバイスにより書き直したソースコード
|
202
|
+
|
203
|
+
|
204
|
+
|
205
|
+
```c++
|
206
|
+
|
207
|
+
#include <bits/stdc++.h>
|
208
|
+
|
209
|
+
using namespace std;
|
210
|
+
|
211
|
+
|
212
|
+
|
213
|
+
int main() {
|
214
|
+
|
215
|
+
vector<int> deg_table = {1125, 3375, 5625, 7875, 10125, 12375,
|
216
|
+
|
217
|
+
14625, 16875, 19125, 21375, 23625, 25875,
|
218
|
+
|
219
|
+
28125, 30375, 32625, 34875};
|
220
|
+
|
221
|
+
|
222
|
+
|
223
|
+
vector<string> dir_name = {"N", "NNE", "NE", "ENE", "E", "ESE",
|
224
|
+
|
225
|
+
"SE", "SSE", "S", "SSW", "SW", "WSW",
|
226
|
+
|
227
|
+
"W", "WNW", "NW", "NNW", "C"};
|
228
|
+
|
229
|
+
|
230
|
+
|
231
|
+
vector<int> dis_table = {int(0.25 * 60), int(1.55 * 60), int(3.35 * 60),
|
232
|
+
|
233
|
+
int(5.45 * 60), int(7.95 * 60), int(10.75 * 60),
|
234
|
+
|
235
|
+
int(13.85 * 60), int(17.15 * 60), int(20.75 * 60),
|
236
|
+
|
237
|
+
int(24.45 * 60), int(28.45 * 60), int(32.65 * 60),
|
238
|
+
|
239
|
+
int(32.75 * 60)};
|
240
|
+
|
241
|
+
|
242
|
+
|
243
|
+
int deg, dis;
|
244
|
+
|
245
|
+
cin >> deg >> dis;
|
246
|
+
|
247
|
+
deg *= 10;
|
248
|
+
|
249
|
+
|
250
|
+
|
251
|
+
int i = 0;
|
252
|
+
|
253
|
+
while(i < 16 && deg >= deg_table.at(i)) {
|
254
|
+
|
255
|
+
i++;
|
256
|
+
|
257
|
+
}
|
258
|
+
|
259
|
+
int j = 0;
|
260
|
+
|
261
|
+
while(j < 12 && dis >= dis_table.at(j)) {
|
262
|
+
|
263
|
+
j++;
|
264
|
+
|
265
|
+
}
|
266
|
+
|
267
|
+
if(j == 0) {
|
268
|
+
|
269
|
+
i = 17;
|
270
|
+
|
271
|
+
}
|
272
|
+
|
273
|
+
cout << dir_name.at(i) << ' ' << j << endl;
|
274
|
+
|
275
|
+
|
276
|
+
|
277
|
+
return 0;
|
278
|
+
|
279
|
+
}
|
280
|
+
|
281
|
+
```
|