当前位置: 首页 > wzjs >正文

网站开发学校青岛外发加工网

网站开发学校,青岛外发加工网,做外国美食的视频网站,如何登录中国建设银行网站纯粹的大模拟而且很简单 不知道acwing为什么把他看作中档题 由于仅是模拟8*8矩阵 直接map每一个位置对应的坐标即可 也可以模拟计算 但是需要脑子 这个直接不需要脑子 还能保证正确 #include <iostream> #include <cstring> #include <algorithm> #includ…

纯粹的大模拟而且很简单 不知道acwing为什么把他看作中档题

由于仅是模拟8*8矩阵 直接map每一个位置对应的坐标即可 也可以模拟计算 但是需要脑子

这个直接不需要脑子 还能保证正确

#include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>
#include <unordered_map>
#include <string>
#include <functional>
#include <utility>
#include <map>
#include <queue>
#include <set>
#include <math.h>#define x first
#define y secondusing namespace std;typedef long long LL;int T;
pair<int,int> loc[65];
int q[9][9], m[9][9];
int m_q[9][9];
double m_[9][9];
int n;
int m_r[9][9];double alfha(int u)  //  阿尔法函数
{if (u == 0) return sqrt(1.0/2);else return 1.0;
}double cal_cos(int i, int j)  //  离散余弦逆变换
{double sum = 0;for (int u = 0; u < 8; u++)for (int v = 0; v < 8; v++){sum += alfha(u) * alfha(v) * m_q[u][v] * cos(acos(-1) * (i+1.0/2) * u / 8) * cos(acos(-1) * (j+1.0/2) * v / 8);}return sum/4.0;
}int trans (double x)  //  四舍五入
{if (x - (int) x >= 0.5) return x + 1;else return x;
}int main()
{loc[1] = make_pair(0,0);loc[2] = make_pair(0,1);loc[3] = make_pair(1,0);loc[4] = make_pair(2,0);loc[5] = make_pair(1,1);loc[6] = make_pair(0,2);loc[7] = make_pair(0,3);loc[8] = make_pair(1,2);loc[9] = make_pair(2,1);loc[10] = make_pair(3,0);loc[11] = make_pair(4,0);loc[12] = make_pair(3,1);loc[13] = make_pair(2,2);loc[14] = make_pair(1,3);loc[15] = make_pair(0,4);loc[16] = make_pair(0,5);loc[17] = make_pair(1,4);loc[18] = make_pair(2,3);loc[19] = make_pair(3,2);loc[20] = make_pair(4,1);loc[21] = make_pair(5,0);loc[22] = make_pair(6,0);loc[23] = make_pair(5,1);loc[24] = make_pair(4,2);loc[25] = make_pair(3,3);loc[26] = make_pair(2,4);loc[27] = make_pair(1,5);loc[28] = make_pair(0,6);loc[29] = make_pair(0,7);loc[30] = make_pair(1,6);loc[31] = make_pair(2,5);loc[32] = make_pair(3,4);loc[33] = make_pair(4,3);loc[34] = make_pair(5,2);loc[35] = make_pair(6,1);loc[36] = make_pair(7,0);loc[37] = make_pair(7,1);loc[38] = make_pair(6,2);loc[39] = make_pair(5,3);loc[40] = make_pair(4,4);loc[41] = make_pair(3,5);loc[42] = make_pair(2,6);loc[43] = make_pair(1,7);loc[44] = make_pair(2,7);loc[45] = make_pair(3,6);loc[46] = make_pair(4,5);loc[47] = make_pair(5,4);loc[48] = make_pair(6,3);loc[49] = make_pair(7,2);loc[50] = make_pair(7,3);loc[51] = make_pair(6,4);loc[52] = make_pair(5,5);loc[53] = make_pair(4,6);loc[54] = make_pair(3,7);loc[55] = make_pair(4,7);loc[56] = make_pair(5,6);loc[57] = make_pair(6,5);loc[58] = make_pair(7,4);loc[59] = make_pair(7,5);loc[60] = make_pair(6,6);loc[61] = make_pair(5,7);loc[62] = make_pair(6,7);loc[63] = make_pair(7,6);loc[64] = make_pair(7,7);for (int i = 0; i < 8; i++)for (int j = 0; j < 8; j++)cin>> q[i][j];cin>> n>>T;for (int i = 1; i <= n; i++){int a;cin>> a;m[loc[i].x][loc[i].y] = a;}for (int i = 0; i < 8; i++)for (int j = 0; j < 8; j++)m_q[i][j] = m[i][j] * q[i][j];if (T == 0)  //  扫描{for (int i = 0; i < 8; i++){for (int j = 0; j < 8; j++)cout<<m[i][j]<<' ';cout<<endl;}}else if (T == 1)  //  量化{for (int i = 0; i < 8; i++){for (int j = 0; j < 8; j++)cout<<m[i][j] * q[i][j]<<' ';cout<<endl;}}else  //  离散逆变换{for (int i = 0; i < 8; i++){for (int j = 0; j < 8; j++){m_[i][j] = cal_cos(i,j);m_r[i][j] = trans(m_[i][j] + 128);}}for (int i = 0; i < 8; i++){for (int j = 0; j < 8; j++){if (m_r[i][j] > 255) cout<<"255"<<' ';else if (m_r[i][j] < 0) cout<<"0"<<' ';else cout<<m_r[i][j]<<' ';}cout<<endl;}}return 0;
}

http://www.dtcms.com/wzjs/797122.html

相关文章:

  • 南昌网站建设方案维护山东滕州做网站技术电话
  • 做企业网站赚钱吗免费的外网连接器
  • 深圳建设网站商asp.net 网站开发视频
  • 天水网站建设博客佳世达电子 苏州 有限公司
  • 自己怎样建网站河北建设工程交易信息网
  • 网站开发验收确 认书网站备案没了
  • wordpress 页面空白页网站改名 seo
  • 做pc端网站价位wordpress 图片排版
  • 长沙做网站最专业政务服务网站建设方案
  • windows优化大师官方网站大连网站建设公司排名
  • 网站建设平台 创新模式网站建设最好的
  • 海口模板建站系统常见的微信营销方式有哪些
  • 做网站常规语言海口网站建设兼职
  • 网站不在首页显示出来吗网站建设包括网页设计
  • 专业仿站网站建设高端网站开发哪里有
  • 视频直播点播网站建设自己做网站难吗
  • 网站建设相关行业有哪些怎么做公司logo
  • 工会网站建设比较好的工会昆明seo工资
  • 网站支付怎么做个人可以注册商标吗
  • 网络营销论述题上海优化seo公司
  • 电子商务物流网站建设网站制作加教程视频
  • 网站建设招标文件范本试用型网站怎么做
  • 酒类产品网站设计做网站公司东莞
  • 为什么一个网站做中英文双语版微信公众号做微网站吗
  • 宣城 网站建设最好的自助建站系统
  • 温州网站优化排名wordpress 分享 朋友圈
  • 制作网站的最新软件是什么wordpress生成多个尺寸图片
  • 用wordpress做外贸网站做网站能给公司带来什么好处
  • discuz网站搬家教程宁波北仑装修公司排行
  • 做网站开发的薪酬怎么样网站建设从零开始教程