結果

問題 No.373 かけ算と割った余り
ユーザー alpha_virginisalpha_virginis
提出日時 2016-06-05 07:43:32
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 868 bytes
コンパイル時間 1,294 ms
コンパイル使用メモリ 158,656 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-17 12:07:52
合計ジャッジ時間 1,839 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 1 ms
5,376 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:16:16: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   16 |   long a; scanf("%ld", &a);
      |           ~~~~~^~~~~~~~~~~
main.cpp:17:16: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   17 |   long b; scanf("%ld", &b);
      |           ~~~~~^~~~~~~~~~~
main.cpp:18:16: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   18 |   long c; scanf("%ld", &c);
      |           ~~~~~^~~~~~~~~~~
main.cpp:19:16: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   19 |   long d; scanf("%ld", &d);
      |           ~~~~~^~~~~~~~~~~

ソースコード

diff #

#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