結果

問題 No.373 かけ算と割った余り
ユーザー romNinjaromNinja
提出日時 2016-06-04 22:36:58
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
RE  
実行時間 -
コード長 251 bytes
コンパイル時間 618 ms
コンパイル使用メモリ 70,132 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-17 00:43:38
合計ジャッジ時間 1,950 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:15:29: warning: 'd' is used uninitialized [-Wuninitialized]
   15 |         long long d = (a*b)%d;
      |                             ^
main.cpp:15:19: note: 'd' was declared here
   15 |         long long d = (a*b)%d;
      |                   ^

ソースコード

diff #

#include<iostream>
#include<string>
#include<vector>
#include<map>

using namespace std;

unsigned long long a, b,c,d;

int main() {
	cin >> a >> b >> c >> d;
	a = a%d;
	b = b%d;
	c = c%d;
	long long d = (a*b)%d;
	cout << (d*c)%d << endl;
	return 0;
}
0