提出 #30049467
ソースコード 拡げる
#include<stdio.h>
int main(){
int N,i,j,cnt=0,cnt2=0;
int t[1000],t2[1000];
scanf("%d",&N);
for(i=0;i<N;i++){
scanf("%d",&t[i]);
}
for(i=0;i<N;i++){
scanf("%d",&t2[i]);
}
for(i=0;i<N;i++){
if(t[i]==t2[i])
cnt++;
}
for(i=0;i<N;i++){
for(j=0;j<N;j++){
if(t[i]==t2[j])
cnt2++;
}
}
printf("%d\n",cnt);
printf("%d\n",cnt2-cnt);
return 0;
}
提出情報
| 提出日時 | |
|---|---|
| 問題 | B - Hit and Blow |
| ユーザ | TCSP |
| 言語 | C (GCC 9.2.1) |
| 得点 | 200 |
| コード長 | 438 Byte |
| 結果 | AC |
| 実行時間 | 6 ms |
| メモリ | 1716 KiB |
コンパイルエラー
./Main.c: In function ‘main’:
./Main.c:6:3: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
6 | scanf("%d",&N);
| ^~~~~~~~~~~~~~
./Main.c:9:5: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
9 | scanf("%d",&t[i]);
| ^~~~~~~~~~~~~~~~~
./Main.c:12:5: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
12 | scanf("%d",&t2[i]);
| ^~~~~~~~~~~~~~~~~~
ジャッジ結果
| セット名 | Sample | All | ||||
|---|---|---|---|---|---|---|
| 得点 / 配点 | 0 / 0 | 200 / 200 | ||||
| 結果 |
|
|
| セット名 | テストケース |
|---|---|
| Sample | 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt |
| All | 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 01_random_00.txt, 01_random_01.txt, 01_random_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 02_same_00.txt, 03_shuffle_00.txt |
| ケース名 | 結果 | 実行時間 | メモリ |
|---|---|---|---|
| 00_sample_00.txt | AC | 6 ms | 1680 KiB |
| 00_sample_01.txt | AC | 1 ms | 1716 KiB |
| 00_sample_02.txt | AC | 1 ms | 1652 KiB |
| 01_random_00.txt | AC | 6 ms | 1648 KiB |
| 01_random_01.txt | AC | 2 ms | 1680 KiB |
| 01_random_02.txt | AC | 3 ms | 1644 KiB |
| 01_random_03.txt | AC | 1 ms | 1652 KiB |
| 01_random_04.txt | AC | 2 ms | 1716 KiB |
| 01_random_05.txt | AC | 2 ms | 1660 KiB |
| 02_same_00.txt | AC | 3 ms | 1648 KiB |
| 03_shuffle_00.txt | AC | 3 ms | 1660 KiB |