Submission #00219
ソースコード
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | #include <bits/stdc++.h> using namespace std; int main(){ int n,m; cin >> n >> m; int a[n],b[m]; int cp2[n]; int ans[n][m] = {}; int cnt[10] = {}; int cp=0; while (n != 0 && m != 0){ int a[n],b[m]; int ans[n][m]; for ( int i=0; i < n; i++){ cin >> a[i]; } for ( int i=0; i < m; i++){ cin >> b[i]; for ( int k=0; k < n; k++){ ans[k][i] = a[k] * b[i]; } } for ( int i=0; i < n; i++){ for ( int j=0; j < m; j++){ cp = ans[i][j]; while (cp != 0){ cnt[cp % 10]++; cp = cp / 10; } } } for ( int i=0; i < 9; i++){ cout << cnt[i] << " " ; cnt[i] = 0; } cout << cnt[9]; cnt[9] = 0; cout << endl; cin >> n >> m; } return (0); } |
ステータス
項目 | データ |
---|---|
問題 | 0004 - nmマス計算 |
ユーザー名 | ei2213 |
投稿日時 | 2024-03-29 13:40:53 |
言語 | C++11 |
状態 | Accepted |
得点 | 20 |
ソースコード長 | 996 Byte |
最大実行時間 | 30 ms |
最大メモリ使用量 | 728 KB |
セット
セット | 得点 | Cases | |
---|---|---|---|
1 | ALL | 20 / 20 | * |
テストケース
ファイル名 | 状態 | 実行時間 | メモリ使用量 | # |
---|---|---|---|---|
A1 | AC | 30 ms | 604 KB |
1
|
A2 | AC | 26 ms | 668 KB |
1
|
A3 | AC | 27 ms | 728 KB |
1
|
A4 | AC | 25 ms | 660 KB |
1
|