結果

問題 No.60 魔法少女
ユーザー kuuso1kuuso1
提出日時 2014-11-09 23:38:57
言語 C#(csc)
(csc 3.9.0)
結果
RE  
実行時間 -
コード長 1,665 bytes
コンパイル時間 3,113 ms
コンパイル使用メモリ 107,712 KB
実行使用メモリ 34,548 KB
最終ジャッジ日時 2023-08-30 02:51:05
合計ジャッジ時間 5,901 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
29,084 KB
testcase_01 AC 69 ms
33,136 KB
testcase_02 AC 67 ms
29,172 KB
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

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));}
}
0