結果
| 問題 |
No.373 かけ算と割った余り
|
| コンテスト | |
| ユーザー |
alpha_virginis
|
| 提出日時 | 2016-06-05 07:43:32 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 868 bytes |
| コンパイル時間 | 1,555 ms |
| コンパイル使用メモリ | 158,652 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-09 06:09:56 |
| 合計ジャッジ時間 | 2,066 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 5 |
コンパイルメッセージ
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);
| ~~~~~^~~~~~~~~~~
ソースコード
#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;
}
alpha_virginis