結果
問題 | No.1429 Simple Dowsing |
ユーザー | milkcoffee |
提出日時 | 2021-03-14 14:12:34 |
言語 | C++14 (gcc 13.2.0 + boost 1.83.0) |
結果 |
AC
|
実行時間 | 29 ms / 2,000 ms |
コード長 | 2,614 bytes |
コンパイル時間 | 1,530 ms |
コンパイル使用メモリ | 166,400 KB |
実行使用メモリ | 24,240 KB |
平均クエリ数 | 3.00 |
最終ジャッジ日時 | 2023-09-24 10:01:51 |
合計ジャッジ時間 | 2,876 ms |
ジャッジサーバーID (参考情報) |
judge12 / judge11 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 29 ms
23,376 KB |
testcase_01 | AC | 25 ms
23,640 KB |
testcase_02 | AC | 25 ms
23,388 KB |
testcase_03 | AC | 24 ms
24,240 KB |
testcase_04 | AC | 23 ms
24,036 KB |
testcase_05 | AC | 24 ms
23,676 KB |
testcase_06 | AC | 23 ms
24,192 KB |
testcase_07 | AC | 23 ms
23,424 KB |
testcase_08 | AC | 25 ms
23,916 KB |
testcase_09 | AC | 23 ms
24,060 KB |
testcase_10 | AC | 23 ms
23,604 KB |
testcase_11 | AC | 24 ms
24,240 KB |
testcase_12 | AC | 23 ms
23,364 KB |
testcase_13 | AC | 23 ms
23,376 KB |
testcase_14 | AC | 23 ms
24,048 KB |
コンパイルメッセージ
main.cpp: 関数 ‘int main()’ 内: main.cpp:95:16: 警告: ‘y’ may be used uninitialized [-Wmaybe-uninitialized] 95 | ll n,m,k,x,y,p=1,flag=0,max=0; | ^ main.cpp:95:14: 警告: ‘x’ may be used uninitialized [-Wmaybe-uninitialized] 95 | ll n,m,k,x,y,p=1,flag=0,max=0; | ^
ソースコード
#include <bits/stdc++.h> using namespace std; #define ll long long #define forin(in ,n) for(ll i=0; i<n; i++) cin>>in[i] #define forout(out) for(ll i=0; i<(ll)out.size(); i++) cout<<out[i]<<endl #define rep(i, n) for (ll i = 0; i < n; ++i) #define rep_up(i, a, n) for (ll i = a; i < n; ++i) #define rep_down(i, a, n) for (ll i = a; i >= n; --i) #define P pair<ll, ll> #define all(v) v.begin(), v.end() #define fi first #define se second #define vvvll vector<vector<vector<ll>>> #define vvll vector<vector<ll>> #define vll vector<ll> #define pqll priority_queue<ll> #define pqllg priority_queue<ll, vector<ll>, greater<ll>> constexpr ll INF = (1ll << 60); constexpr ll mod = 1000000007; constexpr double pi = 3.14159265358979323846; template <typename T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return 1; } return 0; } template <typename T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return 1; } return 0; } template <typename T> void pt(T val) { cout << val << "\n"; } template <typename T> void pt_vll(vector<T> &v) { ll vs = v.size(); rep(i, vs) { cout << v[i]; if (i == vs - 1) cout << "\n"; else cout << " "; } } ll mypow(ll a, ll n) { ll ret = 1; if(n==0) return 1; if(a==0) return 0; rep(i, n) { if (ret > (ll)(1e18 + 10) / a) return -1; ret *= a; } return ret; } long long modpow(long long a, long long n, long long mod) { long long res = 1; while (n > 0) { if (n & 1) res = res * a % mod; a = a * a % mod; n >>= 1; } return res; } long long modinv(long long a, long long m) { long long b = m, u = 1, v = 0; while (b) { long long t = a / b; a -= t * b; swap(a, b); u -= t * v; swap(u, v); } u %= m; if (u < 0) u += m; return u; } ll dig(ll n) {//桁数 ll res = 0; while(n > 0) { res ++; n /= 10; } return res; } int main() { ll n,m,k,x,y,p=1,flag=0,max=0; cout<<"? "<<50<<" "<<50<<endl; cin>>n; rep(i,101){ rep(j,101){ if((i-50)*(i-50)+(j-50)*(j-50)==n&&flag==0){ x=i; y=j; flag=1; break; } } } if(x==0) p=-1; cout<<"? "<<x-p<<" "<<y<<endl; cin>>m; rep(i,101){ rep(j,101){ if((i-50)*(i-50)+(j-50)*(j-50)==n&&(i-x+p)*(i-x+p)+(j-y)*(j-y)==m){ cout<<"! "<<i<<" "<<j<<endl; return 0; } } } }