結果
| 問題 | 
                            No.8043 yukicoderへようこそ!
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2019-04-01 21:54:54 | 
| 言語 | Ruby  (3.4.1)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 434 bytes | 
| コンパイル時間 | 56 ms | 
| コンパイル使用メモリ | 7,424 KB | 
| 実行使用メモリ | 12,416 KB | 
| 最終ジャッジ日時 | 2024-11-26 22:35:42 | 
| 合計ジャッジ時間 | 996 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge5 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 5 WA * 1 | 
コンパイルメッセージ
Syntax OK
ソースコード
ln=$stdin.readlines
if ln.size==1
    s=ln[0].split.map &:to_i
    n=s[0]
    if n==0
        puts 'Hello World!'
    else
        puts n*(n+1)/2
    end
    exit
end
if ln.size==2
    ln[0]=ln[0].split.map &:to_i
    if ln[0].size==2
        puts "#{ln[0][0]+ln[0][1]} #{ln[1].chomp}"
        exit
    end
    sum=ln[1].split.map(&:to_i).sum
    puts sum
    exit
end
sum=0
n=ln[0].to_i
for i in 1..n
    sum+=ln[i].to_i
end
puts sum