結果
問題 |
No.1429 Simple Dowsing
|
ユーザー |
![]() |
提出日時 | 2021-03-14 14:08:32 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 32 ms / 2,000 ms |
コード長 | 425 bytes |
コンパイル時間 | 1,889 ms |
コンパイル使用メモリ | 191,396 KB |
最終ジャッジ日時 | 2025-01-19 16:32:57 |
ジャッジサーバーID (参考情報) |
judge2 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 15 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:21:18: warning: ‘r’ may be used uninitialized [-Wmaybe-uninitialized] 21 | cout<<"! "<<r<<" "<<s<<endl; | ^~~ main.cpp:15:7: note: ‘r’ was declared here 15 | int r,s; | ^ main.cpp:21:23: warning: ‘s’ may be used uninitialized [-Wmaybe-uninitialized] 21 | cout<<"! "<<r<<" "<<s<<endl; | ^ main.cpp:15:9: note: ‘s’ was declared here 15 | int r,s; | ^
ソースコード
#define rep(i,n) for(int i=0;i<(int)(n);i++) #define ALL(v) v.begin(),v.end() typedef long long ll; #include<bits/stdc++.h> using namespace std; int main(){ int d1,d2; cout<<"? 0 0"<<endl; cin>>d1; cout<<"? 100 0"<<endl; cin>>d2; int r,s; for(int i=0;i<=100;i++){ for(int j=0;j<=100;j++){ if(i*i+j*j==d1 && (100-i)*(100-i)+j*j==d2) r=i,s=j; } } cout<<"! "<<r<<" "<<s<<endl; return 0; }