結果
| 問題 | 
                            No.178 美しいWhitespace (1)
                             | 
                    
| コンテスト | |
| ユーザー | 
                             diginatu
                         | 
                    
| 提出日時 | 2015-04-05 23:37:03 | 
| 言語 | D  (dmd 2.109.1)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 436 bytes | 
| コンパイル時間 | 712 ms | 
| コンパイル使用メモリ | 103,568 KB | 
| 実行使用メモリ | 6,944 KB | 
| 最終ジャッジ日時 | 2024-06-12 02:32:28 | 
| 合計ジャッジ時間 | 1,757 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 WA * 1 | 
| other | AC * 7 WA * 14 | 
ソースコード
import std.stdio, std.conv, std.math, std.string, std.range, std.array,
       std.algorithm;
void main() {
  immutable N = readln().strip().to!int();
  int[] a;
  a.length = N;
  
  foreach(immutable int i; 0 .. N) {
    auto buf = readln().strip().split().map!(to!int)().array();
    if(buf[0]%2 == 1) {
      writeln(-1);
      return;
    }
    a[i] = buf[0]/2 + buf[1]*2;
  }
  (a.reduce!max * N - a.reduce!"a+b").writeln();
}
            
            
            
        
            
diginatu