結果
| 問題 |
No.987 N×Mマス計算(基本)
|
| コンテスト | |
| ユーザー |
mattyan0502
|
| 提出日時 | 2020-05-24 20:08:35 |
| 言語 | Java (openjdk 23) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,097 bytes |
| コンパイル時間 | 4,735 ms |
| コンパイル使用メモリ | 86,192 KB |
| 実行使用メモリ | 43,956 KB |
| 最終ジャッジ日時 | 2024-10-12 04:26:34 |
| 合計ジャッジ時間 | 7,480 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 13 WA * 5 |
ソースコード
import java.util.*;
public class Main {
public static void main(String[] args) throws Exception {
// Your code here!
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int M = sc.nextInt();
String op = sc.next();
int B[] = new int[M];
for(int i=0;i<M;i++)
{
B[i] = sc.nextInt();
}
for(int j=0;j<N;j++)
{
int C = sc.nextInt();
for(int k=0;k<M;k++)
{
if(op.equals("+"))
{
if(k<M-1)
{
System.out.print(B[k] + C +" ");
}else{
System.out.print(B[k] + C);
}
}
else{
if(k<M-1)
{
System.out.print(B[k] * C +" ");
}else{
System.out.print(B[k] * C);
}
}
}
System.out.println("");
}
}
}
mattyan0502