最美情侣中文字幕电影,在线麻豆精品传媒,在线网站高清黄,久久黄色视频

歡迎光臨散文網(wǎng) 會(huì)員登陸 & 注冊(cè)

GESP2023.6真題 圖像壓縮講解

2023-06-17 15:36 作者:JamesAlanE  | 我要投稿

有沒有大佬幫忙看一下,不知道怎么回事只有60,感覺寫得都對(duì)的啊,是數(shù)據(jù)有問題還是什么?謝謝了??

  1. #include<bits/stdc++.h>
  2. using?namespace?std;
  3. int?n;
  4. char?a[20]="0123456789ABCDEF";
  5. string?s[25];
  6. map<string,char>?m;
  7. struct?cj
  8. {?
  9. ????int?sum=0,xb;
  10. }b[256];
  11. bool?cmp(cj?x,cj?y)
  12. {
  13. ????return?x.sum>y.sum||(x.sum==y.sum&&x.xb<y.xb);
  14. }
  15. int?change1(char?x,char?y)
  16. {
  17. ????int?ans=0;
  18. ????if(x>='0'&&x<='9')
  19. ????????ans+=(x-'0')*16;
  20. ????else
  21. ????????ans+=(x-'A'+10)*16;
  22. ????if(y>='0'&&y<='9')
  23. ????????ans+=y-'0';
  24. ????else
  25. ????????ans+=y-'A'+10;
  26. ????return?ans;
  27. }
  28. string?change2(int?x)
  29. {
  30. ????string?ans="";
  31. ????ans+=a[x/16];
  32. ????ans+=a[x%16];
  33. ????return?ans;
  34. }
  35. int?main()
  36. {
  37. ????cin>>n;
  38. ????for(int?i=1;i<=n;i++)
  39. ????{
  40. ????????cin>>s[i];
  41. ????????int?len=s[i].size();
  42. ????????char?a1,a2;
  43. ????????for(int?j=0;j<len;j+=2)
  44. ????????{
  45. ????????????a1=s[i][j];a2=s[i][j+1];
  46. ????????????b[change1(a1,a2)].sum++;
  47. ????????????b[change1(a1,a2)].xb=change1(a1,a2);
  48. ????????}
  49. ????}
  50. ????sort(b,b+256,cmp);
  51. ????for(int?i=0;i<16;i++)
  52. ????{
  53. ????????cout<<change2(b[i].xb);
  54. ????????m[change2(b[i].xb)]=a[i];
  55. ????//????cout<<m[change2(b[i].xb)]<<endl;
  56. ????}
  57. ????cout<<endl;
  58. ????for(int?i=16;i<256;i++)
  59. ????{
  60. ????????int?min=0;
  61. ????????string?s2=change2(b[i].xb);
  62. ????????//cout<<s2<<'?';
  63. ????????for(int?j=1;j<16;j++)
  64. ????????{
  65. ????????????if(abs(b[j].xb-b[i].xb)<abs(b[min].xb-b[i].xb)||(abs(b[j].xb-(b[i].xb))==abs(b[min].xb-b[i].xb)&&i<min))
  66. ????????????????min=j;
  67. ????????//????cout<<abs(a[j]-b[i].sum)<<'?';
  68. ????????}
  69. ????????//cout<<min<<'?';
  70. ????????m[s2]=a[min];
  71. ????????//cout<<m[s2]<<endl;
  72. ????}
  73. ????
  74. ????for(int?i=1;i<=n;i++)
  75. ????{
  76. ????????int?len=s[i].size();
  77. ????????char?a1,a2;
  78. ????????for(int?j=0;j<len;j+=2)
  79. ????????{
  80. ????????????a1=s[i][j];a2=s[i][j+1];
  81. ????????????string?s2="";
  82. ????????????s2+=a1;
  83. ????????????s2+=a2;
  84. ????????????cout<<m[s2];
  85. ????????}
  86. ????????cout<<endl;
  87. ????}
  88. ????return?0;
  89. }
  90. /*
  91. 10
  92. 00FFCFAB00FFAC09071B5CCFAB76
  93. 00AFCBAB11FFAB09981D34CFAF56
  94. 01BFCEAB00FFAC0907F25FCFBA65
  95. 10FBCBAB11FFAB09981DF4CFCA67
  96. 00FFCBFB00FFAC0907A25CCFFC76
  97. 00FFCBAB1CFFCB09FC1AC4CFCF67
  98. 01FCCBAB00FFAC0F071A54CFBA65
  99. 10EFCBAB11FFAB09981B34CFCF67
  100. 01FFCBAB00FFAC0F071054CFAC76
  101. 1000CBAB11FFAB0A981B84CFCF66
  102. */

GESP2023.6真題 圖像壓縮講解的評(píng)論 (共 條)

分享到微博請(qǐng)遵守國家法律
思茅市| 赫章县| 天镇县| 名山县| 桂平市| 贵港市| 呼图壁县| 扶余县| 应用必备| 永州市| 石河子市| 金昌市| 鄂托克前旗| 漳州市| 富锦市| 金阳县| 罗山县| 台东县| 镇宁| 岳阳市| 清流县| 江口县| 曲沃县| 达孜县| 隆林| 汉沽区| 凤翔县| 汾西县| 哈尔滨市| 舒城县| 准格尔旗| 蓝山县| 大埔县| 太保市| 黎平县| 五寨县| 开原市| 麻阳| 镇安县| 阳曲县| 沅陵县|