結果

問題 No.933 おまわりさんこいつです
ユーザー ianCK
提出日時 2019-12-31 15:49:24
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 242 bytes
コンパイル時間 237 ms
コンパイル使用メモリ 22,528 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-11-19 02:17:11
合計ジャッジ時間 1,266 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22 WA * 3
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:6:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    6 |         scanf("%d", &n);
      |         ~~~~~^~~~~~~~~~
main.cpp:8:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    8 |                 scanf("%lld", &tmp);
      |                 ~~~~~^~~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>

int main() {
	int n, ans = 1;
	long long int tmp;
	scanf("%d", &n);
	for (int i = 0; i < n; i++) {
		scanf("%lld", &tmp);
		tmp %= 9;
		ans = ans * tmp % 9;
	}
	if (ans == 0) ans = 9;
	printf("%d\n", ans);
}
0