Submission #64279698
Source Code Expand
Copy
#include<bits/stdc++.h>using namespace std;int main(){string s,t;int n;cin>>n>>s>>t;int ans=0;for(int i=0;i<s.size();i++){if(s[i]!=t[i]){ans++;}}cout<<ans;return 0;}
#include<bits/stdc++.h> using namespace std; int main(){ string s,t; int n; cin>>n>>s>>t; int ans=0; for(int i=0;i<s.size();i++){ if(s[i]!=t[i]){ ans++; } } cout<<ans; return 0; }
Submission Info
Submission Time | |
---|---|
Task | A - Hamming Distance |
User | xy0906 |
Language | C++ 20 (gcc 12.2) |
Score | 100 |
Code Size | 208 Byte |
Status | AC |
Exec Time | 1 ms |
Memory | 3648 KB |
Compile Error
Main.cpp: In function ‘int main()’: Main.cpp:8:22: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare] 8 | for(int i=0;i<s.size();i++){ | ~^~~~~~~~~
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 100 / 100 | ||||
Status |
|
|
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 | 3484 KB |
00_sample_01.txt | AC | 1 ms | 3492 KB |
00_sample_02.txt | AC | 1 ms | 3456 KB |
00_sample_03.txt | AC | 1 ms | 3456 KB |
01_random_00.txt | AC | 1 ms | 3472 KB |
01_random_01.txt | AC | 1 ms | 3648 KB |
01_random_02.txt | AC | 1 ms | 3368 KB |
02_random2_00.txt | AC | 1 ms | 3508 KB |
02_random2_01.txt | AC | 1 ms | 3536 KB |
02_random2_02.txt | AC | 1 ms | 3568 KB |
02_random2_03.txt | AC | 1 ms | 3464 KB |
02_random2_04.txt | AC | 1 ms | 3492 KB |
02_random2_05.txt | AC | 1 ms | 3456 KB |
02_random2_06.txt | AC | 1 ms | 3524 KB |
02_random2_07.txt | AC | 1 ms | 3436 KB |
03_handmade_00.txt | AC | 1 ms | 3456 KB |
03_handmade_01.txt | AC | 1 ms | 3364 KB |