結果
問題 | No.514 宝探し3 |
ユーザー | Twizz |
提出日時 | 2017-05-20 12:04:29 |
言語 | C++11 (gcc 11.4.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,168 bytes |
コンパイル時間 | 1,164 ms |
コンパイル使用メモリ | 160,668 KB |
実行使用メモリ | 25,220 KB |
平均クエリ数 | 8.75 |
最終ジャッジ日時 | 2024-07-16 13:46:09 |
合計ジャッジ時間 | 2,630 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 23 ms
25,208 KB |
testcase_01 | AC | 21 ms
24,836 KB |
testcase_02 | AC | 21 ms
25,220 KB |
testcase_03 | WA | - |
testcase_04 | WA | - |
testcase_05 | AC | 21 ms
25,220 KB |
testcase_06 | AC | 19 ms
25,220 KB |
testcase_07 | AC | 20 ms
24,820 KB |
testcase_08 | AC | 19 ms
24,836 KB |
testcase_09 | AC | 19 ms
25,220 KB |
testcase_10 | AC | 20 ms
24,964 KB |
testcase_11 | AC | 20 ms
24,580 KB |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:18:19: warning: overflow in conversion from ‘ll’ {aka ‘long long int’} to ‘int’ changes value from ‘10000000000’ to ‘1410065408’ [-Woverflow] 18 | int n,m = mod; | ^~~ main.cpp:35:13: warning: overflow in conversion from ‘ll’ {aka ‘long long int’} to ‘int’ changes value from ‘10000000000’ to ‘1410065408’ [-Woverflow] 35 | m = mod; | ^~~ main.cpp:28:73: warning: ‘nowy’ may be used uninitialized in this function [-Wmaybe-uninitialized] 28 | print(nowx + dx[i] * m / 2 << " " << nowy + dy[i] * m / 2); | ^ main.cpp:28:47: warning: ‘nowx’ may be used uninitialized in this function [-Wmaybe-uninitialized] 28 | print(nowx + dx[i] * m / 2 << " " << nowy + dy[i] * m / 2); | ^~~
ソースコード
#include"bits/stdc++.h" //#include<bits/stdc++.h> using namespace std; #define print(x) cout<<x<<endl; #define rep(i,a,b) for(int i=a;i<b;i++) #define REP(i,a) for(int i=0;i<a;i++) typedef long long ll; const ll mod = 10000000000; int main() { int max = 1000000000; int nowx, nowy; int dx[4] = { 1, 1, -1, -1 }; int dy[4] = { 1, -1, 1, -1 }; int now_dist; print(max / 2 << " " << max / 2); int n,m = mod; cin >> n; REP(i, 4) { print(max / 2 + dx[i] * n / 2 << " " << max / 2 + dy[i] * n / 2); cin >> now_dist; if (m > now_dist) { m = now_dist; nowx = max / 2 + dx[i] * n / 2; nowy = max / 2 + dy[i] * n / 2; } } REP(i, 4) { print(nowx + dx[i] * m / 2 << " " << nowy + dy[i] * m / 2); int d = 0; cin >> d; if (d == 0)return 0; } print(max / 2+1 << " " << max / 2); m = mod; cin >> n; REP(i, 4) { print(max / 2 + dx[i] * n / 2 << " " << max / 2 + dy[i] * n / 2); cin >> now_dist; if (m > now_dist) { m = now_dist; nowx = max / 2 + dx[i] * n / 2; nowy = max / 2 + dy[i] * n / 2; } } REP(i, 4) { print(nowx + dx[i] * m / 2 << " " << nowy + dy[i] * m / 2); int d = 0; cin >> d; if (d == 0)return 0; } return 0; }