Submission #64414972


Source Code Expand

#include<bits/stdc++.h>
using namespace std;
#define int long long
#define endl '\n'
#define x first
#define y second
typedef pair<int,int>pii;
const int N = 1e7 + 10;
string s;
int b,n;
int a[N];
void solve(){
	cin >> n;
  	string ss;
  	cin >> s >> ss;
  	int ans = 0;
  	for(int i =  0 ; i < s.size() ; i++){
	  	if(s[i] != ss[i]) ans ++;
	  }
	cout << ans;
}
signed main()
{
	ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
//	int T;
//	cin>>T;
//	while(T--)	
	 solve();
	return 0;
}

Submission Info

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

Compile Error

Main.cpp: In function ‘void solve()’:
Main.cpp:17:28: warning: comparison of integer expressions of different signedness: ‘long long int’ and ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]
   17 |         for(int i =  0 ; i < s.size() ; i++){
      |                          ~~^~~~~~~~~~

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 3496 KiB
00_sample_01.txt AC 1 ms 3564 KiB
00_sample_02.txt AC 1 ms 3380 KiB
00_sample_03.txt AC 1 ms 3520 KiB
01_random_00.txt AC 1 ms 3548 KiB
01_random_01.txt AC 1 ms 3472 KiB
01_random_02.txt AC 1 ms 3548 KiB
02_random2_00.txt AC 1 ms 3564 KiB
02_random2_01.txt AC 1 ms 3548 KiB
02_random2_02.txt AC 1 ms 3376 KiB
02_random2_03.txt AC 1 ms 3480 KiB
02_random2_04.txt AC 1 ms 3496 KiB
02_random2_05.txt AC 1 ms 3424 KiB
02_random2_06.txt AC 1 ms 3496 KiB
02_random2_07.txt AC 1 ms 3484 KiB
03_handmade_00.txt AC 1 ms 3380 KiB
03_handmade_01.txt AC 1 ms 3496 KiB