結果
| 問題 | 
                            No.178 美しいWhitespace (1)
                             | 
                    
| コンテスト | |
| ユーザー | 
                             horiesiniti
                         | 
                    
| 提出日時 | 2016-06-14 02:27:50 | 
| 言語 | Ruby  (3.4.1)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 97 ms / 2,000 ms | 
| コード長 | 261 bytes | 
| コンパイル時間 | 45 ms | 
| コンパイル使用メモリ | 7,424 KB | 
| 実行使用メモリ | 12,416 KB | 
| 最終ジャッジ日時 | 2024-10-09 13:31:45 | 
| 合計ジャッジ時間 | 3,509 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge2 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 4 | 
| other | AC * 21 | 
コンパイルメッセージ
Main.rb:20: warning: ambiguous first argument; put parentheses or a space even after `-' operator Syntax OK
ソースコード
n=STDIN.gets.to_i
oddeven=0
max1=0
sum=0
n.times do |i|
	a,b=STDIN.gets.split(" ")
	l=a.to_i+4*b.to_i
	max1=[l,max1].max
	
	if l%2==1 then
		oddeven=1|oddeven
	else
		oddeven=2|oddeven
	end
	sum+=l
end
if oddeven==3 then
	puts -1
else
	puts (max1*n-sum)/2
end
            
            
            
        
            
horiesiniti