Submission #00211


ソースコード

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
43
44
45
46
47
48
49
50
#include <bits/stdc++.h>
using namespace std;
int main(){
int n[101],m[101],a[101][101],b[101][101],c[101][10],cnt=0,kari=0;
n[0]=1;
m[0]=1;
while(1){
cin>>n[cnt]>>m[cnt];
if(n[cnt]==0&&m[cnt]==0){
break;
}
for(int i=0; i<n[cnt]; i++){
cin>>a[cnt][i];
}
for(int j=0; j<m[cnt]; j++){
cin>>b[cnt][j];
}
cnt++;
}
for(int p=0; p<cnt; p++){
for(int i=0; i<n[p]; i++){
for(int j=0; j<m[p]; j++){
kari=a[p][i]*b[p][j];
while(1){
if(kari<=9){
c[p][kari%10]++;
break;
}
c[p][kari%10]++;
kari=kari/10;
}
}
}
for(int i=0; i<10; i++){
cout<<c[p][i];
if(i!=9){
cout<<" ";
}
}
cout<<endl;
}
return(0);
}

ステータス

項目 データ
問題 0004 - nmマス計算
ユーザー名 ei2214
投稿日時 2024-03-29 13:36:26
言語 C++17
状態 Accepted
得点 20
ソースコード長 1125 Byte
最大実行時間 35 ms
最大メモリ使用量 664 KB

セット

セット 得点 Cases
1 ALL 20 / 20 *

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
A1 AC 32 ms 604 KB
1
A2 AC 33 ms 628 KB
1
A3 AC 30 ms 520 KB
1
A4 AC 35 ms 664 KB
1