結果
問題 |
No.1470 Mex Sum
|
ユーザー |
![]() |
提出日時 | 2021-04-09 23:26:20 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 550 bytes |
コンパイル時間 | 240 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 16,768 KB |
最終ジャッジ日時 | 2024-06-25 07:23:00 |
合計ジャッジ時間 | 4,141 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | TLE * 1 -- * 48 |
ソースコード
# 1470 Mex Sum from sys import stdin def mex1(j): if j==2: return 3 else: return 2 def mex2(j): if j==1: return 3 return 1 def mex3(j): if j==1: return 2 return 1 n=int(stdin.readline()) a=list(map(int,stdin.readline().split())) sum=0 for i in range(n-1): if a[i]==1: for j in range(i+1,n): sum+=mex1(a[j]) elif a[i]==2: for j in range(i+1,n): sum+=mex2(a[j]) else: for j in range(i+1,n): sum+=mex3(a[j]) print(sum)