結果
| 問題 |
No.60 魔法少女
|
| コンテスト | |
| ユーザー |
kuuso1
|
| 提出日時 | 2014-11-09 23:38:57 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 1,665 bytes |
| コンパイル時間 | 3,237 ms |
| コンパイル使用メモリ | 113,340 KB |
| 実行使用メモリ | 38,912 KB |
| 最終ジャッジ日時 | 2024-12-31 09:01:38 |
| 合計ジャッジ時間 | 3,203 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 RE * 1 |
| other | RE * 10 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System;
using System.Collections;
using System.Collections.Generic;
class TEST{
static void Main(){
Sol mySol =new Sol();
mySol.Solve();
}
}
class Sol{
public void Solve(){
int GETA=600;
int[][] Map=new int[1200][];
for(int i=0;i<1200;i++){
Map[i]=new int[1200];
}
int AX,AY,AW,AH,AD;
for(int k=K;k>0;k--){
var d=ria();
AX=d[0];AY=d[1];AW=d[2];AH=d[3];AD=d[4];
for(int Y=AY+GETA;Y<=AY+AH+GETA;Y++){
Map[Y][AX+GETA]+=AD;
Map[Y][AX+AW+GETA+1]-=AD;
}
}
for(int i=1;i<1200;i++){
for(int j=1;j<1200;j++){
Map[i][j]+=Map[i][j-1];
}
}
int cnt=0;
for(int i=0;i<X.Length;i++){
cnt+=Map[Y[i]+GETA][X[i]+GETA]>H[i]?0:H[i]-Map[Y[i]+GETA][X[i]+GETA];
}
Console.WriteLine(cnt);
}
int N;
int K;
int[] X;
int[] Y;
int[] H;
public Sol(){
var d=ria();
N=d[0];K=d[1];
X=new int[N];
Y=new int[N];
H=new int[N];
for(int i=0;i<N;i++){
var dd=ria();
X[i]=dd[0];
Y[i]=dd[1];
H[i]=dd[2];
}
}
static String rs(){return Console.ReadLine();}
static int ri(){return int.Parse(Console.ReadLine());}
static long rl(){return long.Parse(Console.ReadLine());}
static double rd(){return double.Parse(Console.ReadLine());}
static String[] rsa(){return Console.ReadLine().Split(' ');}
static int[] ria(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>int.Parse(e));}
static long[] rla(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>long.Parse(e));}
static double[] rda(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>double.Parse(e));}
}
kuuso1