結果
問題 | No.987 N×Mマス計算(基本) |
ユーザー |
![]() |
提出日時 | 2020-02-14 23:57:27 |
言語 | D (dmd 2.109.1) |
結果 |
AC
|
実行時間 | 5 ms / 2,000 ms |
コード長 | 599 bytes |
コンパイル時間 | 826 ms |
コンパイル使用メモリ | 110,176 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-22 05:09:54 |
合計ジャッジ時間 | 1,592 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 18 |
ソースコード
import std.stdio, std.algorithm, std.conv, std.array, std.string, std.math, std.typecons, std.numeric, core.bitop; void main() { auto nm = readln.split.to!(int[]); auto N = nm[0]; auto M = nm[1]; auto res = new long[][](N, M); auto line = readln.split; auto op = line[0]; auto BS = line[1..$].to!(long[]); long[] AS; foreach (_; 0..N) AS ~= readln.chomp.to!long; foreach (i; 0..N) { foreach (j; 0..M) { res[i][j] = op == "+" ? AS[i] + BS[j] : AS[i] * BS[j]; } } foreach (i; 0..N) writeln(res[i].to!(string[]).join(" ")); }