Submission #64280103


Source Code Expand

#include <bits/stdc++.h>
#define _F(x,y,z) for(int x=y;x<=z;x++)
#define F_(x,z,y) for(int x=z;x>=y;x--)
#define TF(x,y,z) for(int x=head[y],z;x;x=nex[x])

using namespace std;

typedef long long ll;
typedef double dou;
typedef const int ci;
typedef pair<int,int> pii;

ci maxn=2e6+10;

int n,cnt;	
char a[maxn],b[maxn];
int main()
{
	scanf("%d%s%s",&n,a+1,b+1);
	_F(i,1,n)
	{
		if(a[i]!=b[i])
			cnt++;
	}
	printf("%d",cnt);
	return 0;
}

Submission Info

Submission Time
Task A - Hamming Distance
User adolphshi
Language C++ 20 (gcc 12.2)
Score 100
Code Size 464 Byte
Status AC
Exec Time 1 ms
Memory 3820 KiB

Compile Error

Main.cpp: In function ‘int main()’:
Main.cpp:19:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   19 |         scanf("%d%s%s",&n,a+1,b+1);
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 100 / 100
Status
AC × 4
AC × 17
Set Name Test Cases
Sample 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt
All 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 01_random_00.txt, 01_random_01.txt, 01_random_02.txt, 02_random2_00.txt, 02_random2_01.txt, 02_random2_02.txt, 02_random2_03.txt, 02_random2_04.txt, 02_random2_05.txt, 02_random2_06.txt, 02_random2_07.txt, 03_handmade_00.txt, 03_handmade_01.txt
Case Name Status Exec Time Memory
00_sample_00.txt AC 1 ms 3632 KiB
00_sample_01.txt AC 1 ms 3688 KiB
00_sample_02.txt AC 1 ms 3820 KiB
00_sample_03.txt AC 1 ms 3820 KiB
01_random_00.txt AC 1 ms 3656 KiB
01_random_01.txt AC 1 ms 3684 KiB
01_random_02.txt AC 1 ms 3812 KiB
02_random2_00.txt AC 1 ms 3756 KiB
02_random2_01.txt AC 1 ms 3656 KiB
02_random2_02.txt AC 1 ms 3628 KiB
02_random2_03.txt AC 1 ms 3660 KiB
02_random2_04.txt AC 1 ms 3816 KiB
02_random2_05.txt AC 1 ms 3764 KiB
02_random2_06.txt AC 1 ms 3692 KiB
02_random2_07.txt AC 1 ms 3660 KiB
03_handmade_00.txt AC 1 ms 3676 KiB
03_handmade_01.txt AC 1 ms 3748 KiB