結果

問題 No.373 かけ算と割った余り
コンテスト
ユーザー alpha_virginis
提出日時 2016-06-05 07:43:32
言語 C++11
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=gnu++11 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 868 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,473 ms
コンパイル使用メモリ 171,564 KB
実行使用メモリ 6,400 KB
最終ジャッジ日時 2026-04-25 09:16:11
合計ジャッジ時間 1,610 ms
ジャッジサーバーID
(参考情報)
judge3_1 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 5
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <bits/stdc++.h>

template<typename T>
class Array {
public:
  T* p; int size; int seek;
  Array(int N) { p = new T[N]; size = N; seek = 0; }
  Array(int N, T x) { p = new T[N]; for(int i = 0; i < N; ++i) p[i] = x; size = N; seek = 0; }
  const T& operator() (int i) const { return p[i]; }
};
template<typename T> inline Array<T> update(Array<T>& xs, int i, const T& x) { Array<T> res = xs; res.p[i] = x; xs.p = nullptr; return res; }
template<typename T, typename U> inline T foldl1(U f, Array<T>& xs) { T res = xs(0); for(int i = 1; i < xs.size; ++i) { res = f(res, xs(i)); } return res; }
template<typename T> T add(const T& x, const T& y) { return x + y; }

int main() {
  long a; scanf("%ld", &a);
  long b; scanf("%ld", &b);
  long c; scanf("%ld", &c);
  long d; scanf("%ld", &d);
  long res = a * b % d * c % d;
  printf("%ld\n", res);
  
  return 0;
}
0