#P98. Communicative Problem Test 1: The wrong bit
Communicative Problem Test 1: The wrong bit
Pinned Announcements
If you came from https://www.luogu.com.cn/problem/P12509, please read this section carefully.
The implementation of this problem's interactive library differs from P12509. AC codes are not interchangeable between these two problems.
However, this problem uses exactly the same test data as P12509. Neither problem uses adaptive judging.
For testing purposes, you may download the sample test data here: http://8.136.99.126/file/3/communicative_problem_sample.zip
In the test data, the input file contains string and the output file contains the correct answer .
Person in charge
Attention
This is a communicative problem.
You must strictly follow the submission guidelines!!!
Problem Description
Given two binary strings and of length that differ in at most one character:
- Program A reads binary string .
- Program A outputs a non-negative integer .
- Program B reads binary string and integer from Program A.
- Program B outputs the differing position between and .
Submission Format
Program A Template
Program A reads a length- binary string (without receiving ) and outputs integer .
#include <bits/stdc++.h>
using namespace std;
int main()
{
string S;
cin >> S;
int X = 0;
// ...
cout << X << endl;
return 0;
}
Program B Template
Program B reads binary string and outputs integer from Program A It outputs position where and differ (output if identical).
#include <bits/stdc++.h>
using namespace std;
int main()
{
string T;
int X;
cin >> T >> X;
int D = 0;
// ...
cout << D << endl;
return 0;
}
Complete Template
// Paste Program A here
/* ATTENTION!!! THIS IS THE BARRIER!!! */
// Paste Program B here
Important Notes
- You must use this template exactly!
- Any attempt to attack the judge will be treated as cheating!
- Submission shouldn't exceed lines and bytes.
- Compilation attributes:
-O2 -std=c++14
. - Time limit: 1s per program; Memory limit: 512MB per program.
Constraints
.