結果

問題 No.1429 Simple Dowsing
ユーザー harurunharurun
提出日時 2021-03-14 15:46:40
言語 C
(gcc 12.3.0)
結果
TLE  
実行時間 -
コード長 331 bytes
コンパイル時間 481 ms
コンパイル使用メモリ 27,960 KB
実行使用メモリ 36,228 KB
最終ジャッジ日時 2023-09-24 10:07:47
合計ジャッジ時間 6,971 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 -- -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c:1:1: 警告: 戻り値の型をデフォルトの ‘int’ にします [-Wimplicit-int]
    1 | main(){
      | ^~~~
main.c: 関数 ‘main’ 内:
main.c:2:3: 警告: 関数 ‘printf’ の暗黙的な宣言です [-Wimplicit-function-declaration]
    2 |   printf("? 0 0\n");
      |   ^~~~~~
main.c:1:1: 備考: include ‘<stdio.h>’ or provide a declaration of ‘printf’
  +++ |+#include <stdio.h>
    1 | main(){
main.c:2:3: 警告: 組み込み関数 ‘printf’ の互換性がない暗黙的な宣言です [-Wbuiltin-declaration-mismatch]
    2 |   printf("? 0 0\n");
      |   ^~~~~~
main.c:2:3: 備考: include ‘<stdio.h>’ or provide a declaration of ‘printf’
main.c:4:3: 警告: 関数 ‘scanf’ の暗黙的な宣言です [-Wimplicit-function-declaration]
    4 |   scanf("%d",&d);
      |   ^~~~~
main.c:4:3: 備考: include ‘<stdio.h>’ or provide a declaration of ‘scanf’
main.c:4:3: 警告: 組み込み関数 ‘scanf’ の互換性がない暗黙的な宣言です [-Wbuiltin-declaration-mismatch]
main.c:4:3: 備考: include ‘<stdio.h>’ or provide a declaration of ‘scanf’

ソースコード

diff #

main(){
  printf("? 0 0\n");
  int d,e[101],h[101],c,r,p=0;
  scanf("%d",&d);
  for(int x=0;x<101;x++)for(int y=0;y<101;y++)if(x*x+y*y==d){
    e[p]=x;
    h[p++]=y;
  }
  c=e[0];
  d=h[0];
  printf("? %d %d\n",c,d);
  scanf("%d",&r);
  for(int i=0;i<p;i++)if((e[i]-c)*(e[i]-c)+(h[i]-d)*(h[i]-d)==r)printf("! %d %d\n",e[i],h[i]);
}
0