P2106 confidential espionage (computer rookie experience to be a master psychology)

Confidential Intelligence P2106

Problem Description HY is very fond of chatting with GJQ, while others are still struggling on the path of OI. To avoid disturbing the students, they exchange encrypted messages. The plaintext of their communication is a non-empty sequence made up of 0s and 1s. It also includes several password characters, each representing a different binary string. For example, the ciphertext "011a0bf00a01" could represent different sequences depending on what each character stands for. The key to decrypting this cipher is determining what each password character represents. After long-term statistical analysis, it's now known that each password has a fixed length. Students who have experienced this problem have intercepted two ciphertexts, S1 and S2, and know that they represent the same plaintext. Your task is to determine how many possible valid plaintexts exist based on these two ciphertexts. Input Format The input includes two strings S1 and S2, followed by the number of password characters, and then a list of each character and its corresponding length in bits. Output Format Output M, which indicates the number of possible plaintexts. Sample Input 100ad1 Cc1 4 a 2 d 3 c 4 b 50 Sample Output 2 Explanation The length of the plaintext is ≤ 10000, and no high precision calculations are needed. This problem is actually quite straightforward. The idea is to find the positions where both ciphertexts agree on the value (either 0 or 1) and merge those positions accordingly. Then, we group all positions that must be 0 into one set, those that must be 1 into another, and those that are undetermined into a third. If any position is forced to be both 0 and 1, there is no solution. The number of possible solutions is 2 raised to the power of the number of undetermined positions. However, if the sets for 0 and 1 overlap, it means there is a contradiction, and the answer is zero. Code: #include #include #include #include #include #define N 55555 #define ll unsigned long long using namespace std; const ll T=40000; string s1,s2; vectorP[233]; char A[233]; ll n, L[233], sum1[N], sum2[N], F[N]; bool mark[N]; ll GF(ll x) { if(F[x]!=x)F[x]=GF(F[x]); return F[x]; } void Merge(ll x,ll y) { ll fx=GF(x),fy=GF(y); if(fx!=fy)F[fx]=fy; } ll QM(ll a,ll b) { ll ans=1; while(b) { if(b&1)ans=ans*a; b>>=1; a=a*a; } return ans; } int main() { ll i,j,k,ans=0; cin>>s1>>s2; s1 = " " + s1; s2 = " " + s2; scanf("%lld",&n); for(i=1;i<=n;i++) scanf("%c %lld",&A[i],&k), L[A[i]]=k; for(i=1;i<=T;i++) F[i]=i; for(i=1;iCommon Mode Choke Coil

Common mode choke coil uses the Ferrite Core and winds with double wire which has the ability of high common mode noise suppression and low differential mode noise signal suppression. It is difficult to deform in high speed signal and has small working frequency impedance,large interference frequency impedance and small volume.

Common Mode Choke Coil,Customized Common Mode Choke Coil,Inductors Cmc Coil,Customized Reliable Cmc Coil

Anyang Kayo Amorphous Technology Co.,Ltd. , https://www.kayoamotech.com