結果

問題 No.933 おまわりさんこいつです
ユーザー masa_ahe
提出日時 2019-11-30 17:11:20
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 385 bytes
コンパイル時間 575 ms
コンパイル使用メモリ 64,924 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-11-21 01:24:20
合計ジャッジ時間 1,708 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 17 WA * 8
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<cstring>
#include<vector>
#include<algorithm>
using namespace std;

typedef long long ll;

int main(){
	int n;
	cin>>n;
	vector<ll>p(n);
	for(int i=0;i<n;i++){
		cin>>p[i];
	}
	sort(p.begin(),p.end());
	ll ans=0;
	if(p[0]==0){
		cout<<0<<endl;
	}
	for(int i=0;i<n;i++){
		p[i]%=9;
		ans*=p[i];
		ans%=9;
	}
	if(ans==0)cout<<9<<endl;
	else cout<<ans<<endl;
}
0