結果

問題 No.306 さいたま2008
ユーザー Div9851Div9851
提出日時 2015-11-27 23:42:58
言語 C++11
(gcc 13.3.0)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 171 bytes
コンパイル時間 124 ms
コンパイル使用メモリ 23,168 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-09-14 01:02:41
合計ジャッジ時間 906 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 23
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:4:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    4 |         scanf("%d %d",&x1,&y1);x1*=-1;
      |         ~~~~~^~~~~~~~~~~~~~~~~
main.cpp:5:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    5 |         scanf("%d %d",&x2,&y2);
      |         ~~~~~^~~~~~~~~~~~~~~~~

ソースコード

diff #

#include <cstdio>
int main() {
	int x1,y1,x2,y2;
	scanf("%d %d",&x1,&y1);x1*=-1;
	scanf("%d %d",&x2,&y2);
	double a=(double)(y1-y2)/(x1-x2);
	printf("%.15lf\n",y2-a*x2);
}
0