結果

問題 No.933 おまわりさんこいつです
ユーザー kotatsugame
提出日時 2019-11-29 21:50:46
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 70 ms / 2,000 ms
コード長 226 bytes
コンパイル時間 508 ms
コンパイル使用メモリ 63,360 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-20 21:56:46
合計ジャッジ時間 1,606 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 25
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    6 | main()
      | ^~~~

ソースコード

diff #

#include<iostream>
using namespace std;
int N;
int F=0;
long T=1;
main()
{
	cin>>N;
	for(int i=0;i<N;i++)
	{
		long A;cin>>A;
		if(F==0&&(A>=9||T>=9||A*T>=9))F=1;
		if(A==0)F=-1;
		T=A%9*T%9;
	}
	cout<<(T?T:F==1?9:0)<<endl;
}
0