結果

問題 No.1429 Simple Dowsing
ユーザー chacoder1
提出日時 2021-03-25 12:40:48
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 42 ms / 2,000 ms
コード長 597 bytes
コンパイル時間 2,614 ms
コンパイル使用メモリ 191,516 KB
最終ジャッジ日時 2025-01-19 21:38:01
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 15
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<n;i++)
typedef pair<int,int>P;

int a[101][101];
int b[101][101];
int main(){
  for(int i=0;i<=100;i++){
    for(int j=0;j<=100;j++){
      a[i][j]=i*i+j*j;
      b[i][j]=(100-i)*(100-i)+j*j;
    }
  }
  int x,y;
  cout<<"? 0 0"<<endl;
  cin>>x;
  //cout<<x<<endl;
  cout<<"? 100 0"<<endl;
  cin>>y;
  //cout<<y<<endl;
  for(int i=0;i<=100;i++){
    for(int j=0;j<=100;j++){
      if(a[i][j]==x && b[i][j]==y){
        cout<<"! "<<i<<" "<<j<<endl;
        return 0;
      }
    }
  }
  return 0;
}
0