Submission #00268


ソースコード

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
51
52
#include<bits/stdc++.h>
using namespace std;
int main(){
int n,m,i,j,x,xx,xxx,xxxx,l=0,d[5][10]={};
while(1){
cin>>n>>m;
if(n==0&&m==0){
break;
}
int a[n],b[m];
for(i=0;i<n;i++){
cin>>a[i];
}
for(i=0;i<m;i++){
cin>>b[i];
for(j=0;j<n;j++){
x=a[j]*b[i];
if(x==1000){
d[l][1]++;
d[l][0]++;
}else if(x<=999&&100<=x){
xx=x/100;
xxx=(x-(xx*100))/10;
xxxx=x-(xx*100+xxx*10);
d[l][xx]++;
d[l][xxx]++;
d[l][xxxx]++;
}else if(x<=99&&10<=x){
xx=x/10;
xxx=x-(xx*10);
d[l][xx]++;
d[l][xxx]++;
}else{
d[l][x]++;
}
}
}
l++;
}
for(i=0;i<l;i++){
for(j=0;j<10;j++){
if(j==9){
cout<<d[i][j]<<"\n";
}else{
cout<<d[i][j]<<" ";
}
}
}
return(0);
}

ステータス

項目 データ
問題 0004 - nmマス計算
ユーザー名 m2279
投稿日時 2024-03-29 14:38:58
言語 C++
状態 Runtime Error
得点 0
ソースコード長 1285 Byte
最大実行時間 87 ms
最大メモリ使用量 660 KB

セット

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

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
A1 RE 87 ms 604 KB
1
A2 RE 35 ms 452 KB
1
A3 RE 37 ms 560 KB
1
A4 RE 31 ms 660 KB
1