結果
問題 |
No.987 N×Mマス計算(基本)
|
ユーザー |
![]() |
提出日時 | 2020-03-11 04:10:21 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 4 ms / 2,000 ms |
コード長 | 667 bytes |
コンパイル時間 | 649 ms |
コンパイル使用メモリ | 70,912 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-15 23:54:41 |
合計ジャッジ時間 | 1,500 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 18 |
ソースコード
#include <iostream> #include <string> #include <algorithm> #include <cmath> using namespace std; typedef long long llint; llint n,m; char c; llint ans[105][105]; llint A[105],B[105]; void solve(){ cin >> n >> m; cin >> c; for(int i=0;i<m;i++){ cin >> B[i]; } for(int i=0;i<n;i++){ cin >> A[i]; } for(int i=0;i<n;i++){ for(int j=0;j<m;j++){ if(c=='+'){ ans[i][j]=A[i]+B[j]; } else{ ans[i][j]=A[i]*B[j]; } } } for(int i=0;i<n;i++){ for(int j=0;j<m;j++){ cout << ans[i][j]; cout << " "; } cout << endl; } } int main(int argc, char *argv[]) { solve(); return 0; }