結果
問題 | No.373 かけ算と割った余り |
ユーザー |
![]() |
提出日時 | 2016-06-04 22:28:54 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 705 bytes |
コンパイル時間 | 1,398 ms |
コンパイル使用メモリ | 159,708 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-09 04:52:35 |
合計ジャッジ時間 | 1,900 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 5 |
ソースコード
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef vector<int> vi; typedef vector<ll> vl; typedef vector<bool> vb; typedef vector<double> vd; typedef vector<vd> vvd; #define REP(i,n) for(ll i=0; i < (n); ++i) #define FOR(i,s,e) for (ll i = s; i < (ll)e; i++) #define TEN(x) ((ll)1e##x) #define ALL(v) (v).begin(), (v).end() int main() { #ifdef _WIN32 ifstream cin("sample.in"); ofstream cout("sample.out"); #endif cin.tie(0); // cinとcoutの連携を切る ios_base::sync_with_stdio(false); cout << fixed << setprecision(50); ll a, b, c, d; cin >> a >> b >> c >> d; ll ans = a % d; (ans *= b) %= d; (ans *= c) %= d; cout << ans << endl; }