Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Author: 曹北健(37509)
- Result: AC Submission_id: 4202387
- Created at: Sun Mar 20 2022 21:29:02 GMT+0800 (China Standard Time)
- Problem: 5424 Time: 3 Memory: 1728
- */
- #include <stdio.h>
- int main(){
- unsigned long long enc5421[11] = { 0,1,2,3,4,8,9,10,11,12 };
- unsigned long long a, b, c = 0, d = 0;
- int i = 0, ans = 0;
- scanf("%llu", &a);
- b = a;
- while(a){
- c |= (enc5421[a % 10]) << (i << 2);
- i++;
- a /= 10;
- }
- d = b ^ c;
- for(i = 0;i < 64;i++){
- if(d & (1ull << i)){
- ans++;
- }
- }
- printf("%llu %d\n", c, ans);
- }
Advertisement
Add Comment
Please, Sign In to add comment