結果
| 問題 |
No.987 N×Mマス計算(基本)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-02-14 22:17:30 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 2,000 ms |
| コード長 | 341 bytes |
| コンパイル時間 | 1,888 ms |
| コンパイル使用メモリ | 194,596 KB |
| 最終ジャッジ日時 | 2025-01-09 00:18:31 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 18 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:13:23: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
13 | rep(j,m) scanf("%lld",&b[j]);
| ~~~~~^~~~~~~~~~~~~~
main.cpp:14:23: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
14 | rep(i,n) scanf("%lld",&a[i]);
| ~~~~~^~~~~~~~~~~~~~
ソースコード
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
using namespace std;
using lint=long long;
int main(){
int n,m;
char op;
cin>>n>>m>>op;
vector<lint> b(m),a(n);
rep(j,m) scanf("%lld",&b[j]);
rep(i,n) scanf("%lld",&a[i]);
rep(i,n) rep(j,m) printf("%lld%c",op=='+'?a[i]+b[j]:a[i]*b[j],j<m-1?' ':'\n');
return 0;
}