Submission #00112
ソースコード
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 | #include <bits/stdc++.h> using namespace std; int main() { int n, m; while ( true ){ cin >> n >> m; if (n == 0 && m == 0){ break ; } vector< int > a(n); vector< int > b(m); vector< int > counts(10, 0); for ( int i = 0; i < n; i++){ cin >> a[i]; } for ( int i = 0; i < m; i++){ cin >> b[i]; } for ( int i = 0; i < n; i++){ for ( int j = 0; j < m; j++){ int temp = a[i] * b[j]; while (temp > 0){ counts[temp % 10]++; temp /= 10; } } } for ( int i = 0; i < 10; i++){ cout << counts[i]; if (i != 9) cout << " " ; } cout << endl; } return (0); } |
ステータス
項目 | データ |
---|---|
問題 | 0004 - nmマス計算 |
ユーザー名 | maruru_0627 |
投稿日時 | 2024-03-29 12:16:40 |
言語 | C++17 |
状態 | Accepted |
得点 | 20 |
ソースコード長 | 870 Byte |
最大実行時間 | 34 ms |
最大メモリ使用量 | 572 KB |
セット
セット | 得点 | Cases | |
---|---|---|---|
1 | ALL | 20 / 20 | * |
テストケース
ファイル名 | 状態 | 実行時間 | メモリ使用量 | # |
---|---|---|---|---|
A1 | AC | 34 ms | 476 KB |
1
|
A2 | AC | 33 ms | 572 KB |
1
|
A3 | AC | 32 ms | 536 KB |
1
|
A4 | AC | 29 ms | 500 KB |
1
|