結果

問題 No.383 レーティング
ユーザー kurenai3110
提出日時 2017-06-15 00:57:32
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 588 bytes
コンパイル時間 610 ms
コンパイル使用メモリ 64,356 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-09-24 23:30:46
合計ジャッジ時間 7,748 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 13 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
using namespace std;

int main()
{
	double w0 = rand();
	double w1 = rand();
	double w2 = rand();

	for (int i = 0; i < 1e7; i++) {
		double x1 = (double)rand() / RAND_MAX;
		double x2 = (double)rand() / RAND_MAX;
		double y = -x1 + x2;

		double y_pred = w0 + w1*x1 + w2*x2;

		w0 += 1e-4*(y - y_pred);
		w1 += 1e-4*(y - y_pred)*x1;
		w2 += 1e-4*(y - y_pred)*x2;
	}

	double x1, x2, y;
	cin >> x1 >> x2;

	y = w0 + w1*x1 + w2*x2;
	y = round(y);

	cout << showpos << y << endl;

    return 0;
}
0