結果
問題 |
No.723 2つの数の和
|
ユーザー |
|
提出日時 | 2018-09-03 01:29:57 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 423 bytes |
コンパイル時間 | 90 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 24,124 KB |
最終ジャッジ日時 | 2024-10-04 11:39:52 |
合計ジャッジ時間 | 3,794 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | TLE * 1 -- * 21 |
ソースコード
def cal(a,X,N): count=0 for i in range(N-1): if(a[i]>X): break for j in range(i,N): sum=a[i]+a[j] if(sum>X): break elif(sum==X): count+=1 if(i!=j): count+=1 return count N,X=list(map(int,input().split())) a=list(map(int,input().split())) a_sort=sorted(a) print(cal(a_sort,X,N))