結果

問題 No.987 N×Mマス計算(基本)
ユーザー kotatsugame
提出日時 2020-02-07 04:21:34
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 293 bytes
コンパイル時間 660 ms
コンパイル使用メモリ 63,916 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-09-25 07:11:17
合計ジャッジ時間 1,696 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 18
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    6 | main()
      | ^~~~

ソースコード

diff #

#include<iostream>
using namespace std;
int N,M;
char op;
long A[100],B[100];
main()
{
	cin>>N>>M;
	cin>>op;
	for(int j=0;j<M;j++)cin>>B[j];
	for(int i=0;i<N;i++)cin>>A[i];
	for(int i=0;i<N;i++)
	{
		for(int j=0;j<M;j++)
		{
			cout<<(op=='+'?A[i]+B[j]:A[i]*B[j])<<(j==M-1?"\n":" ");
		}
	}
}
0