結果
| 問題 |
No.1429 Simple Dowsing
|
| コンテスト | |
| ユーザー |
monnu
|
| 提出日時 | 2021-03-14 14:07:46 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 26 ms / 2,000 ms |
| コード長 | 460 bytes |
| コンパイル時間 | 1,567 ms |
| コンパイル使用メモリ | 166,800 KB |
| 実行使用メモリ | 25,336 KB |
| 平均クエリ数 | 3.00 |
| 最終ジャッジ日時 | 2024-07-17 10:47:25 |
| 合計ジャッジ時間 | 2,856 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 15 |
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:25:23: warning: 's' may be used uninitialized [-Wmaybe-uninitialized]
25 | cout<<"! "<<r<<" "<<s<<endl;
| ^
main.cpp:19:7: note: 's' was declared here
19 | int s;
| ^
ソースコード
#include <bits/stdc++.h>
using namespace std;
//#include <atcoder/all>
//using namespace atcoder;
using ll=long long;
using Graph=vector<vector<int>>;
#define MAX 200003
#define MOD 1000000007
#define INF 2000000000000000000
int main(){
int d1,d2;
cout<<"? 0 0"<<endl;
cin>>d1;
cout<<"? 100 0"<<endl;
cin>>d2;
int r=(10000+d1-d2)/200;
int s;
for(int i=0;i<=100;i++){
if(i*i==d1-r*r){
s=i;
}
}
cout<<"! "<<r<<" "<<s<<endl;
}
monnu