签到 2016.6.26

1、HDU 5670 Machine


解题思路:

变化的规律为红 -> 绿 -> 蓝 -> 红

将红、绿、蓝分别表示0、1、2

原问题就转化为求 n 的三进制表示的最低的 m 位,即求n mod 3^m的三进制表示

复杂度 O(m)


#include <iostream>
#include <cstdio>

using namespace std;

typedef long long LL;

const int maxn = 30 + 5;
char s[maxn];

int m;
LL n;

int main()
{
//    freopen("in.txt", "r", stdin);
    int T;
    while (scanf("%d", &T) != EOF) {
        while (T--) {
            cin>>m>>n;
            for (int i=0; i<m; ++i) {
                s[i] = 'R';
            }
            LL x = n%3;
            LL y = n/3;
            for (int i=m-1; i>=0; --i) {
                if (x == 1) {
                    s[i] = 'G';
                } else if (x == 2) {
                    s[i] = 'B';
                }
                if (y == 0) {
                    break;
                }
                x = y%3;
                y /= 3;
            }
            for (int i=0; i<m; ++i) {
                cout<<s[i];
            }
            cout<<endl;
        }
    }
    return 0;
}

2、HDU 5671 Matrix


解题思路:

暴力肯定是不可行的

可以用两个数组记录行和列交换的操作

再用两个数组记录行和列加一个数的操作

复杂度 O(mn + q)


#include <iostream>
#include <cstdio>
#include <cstring>

using namespace std;

const int maxn = 1000 + 10;
int Matrix[maxn][maxn];
int row[maxn], row_add[maxn];       //行
int column[maxn], column_add[maxn]; //列

int main()
{
//    freopen("in.txt", "r", stdin);
    int T;

    while (scanf("%d", &T) != EOF) {
        while (T--) {
            int n, m, q;
            scanf("%d%d%d", &n, &m, &q);
            for (int i=1; i<=n; ++i) {
                for (int j=1; j<=m; ++j) {
                    scanf("%d", &Matrix[i][j]);
                }
            }
            int a, x, y;
            memset(row_add, 0, sizeof(row_add));
            memset(column_add, 0, sizeof(column_add));
            for (int i=1; i<=n; ++i) {
                row[i] = i;
            }
            for (int i=1; i<=m; ++i) {
                column[i] = i;
            }
            for (int i=0; i<q; ++i) {
                scanf("%d%d%d", &a, &x, &y);
                if (a == 1) {
                    int t = row[x];
                    row[x] = row[y];
                    row[y] = t;
                } else if (a == 2) {
                    int t = column[x];
                    column[x] = column[y];
                    column[y] = t;
                } else if (a == 3) {
                    row_add[row[x]] += y;
                } else {
                    column_add[column[x]] += y;
                }
            }
            int t;
            for (int i=1; i<=n; ++i) {
                for (int j=1; j<m; ++j) {
                    t = Matrix[row[i]][column[j]] + row_add[row[i]] + column_add[column[j]];
                    printf("%d ", t);
                }
                t = Matrix[row[i]][column[m]] + row_add[row[i]] + column_add[column[m]];
                printf("%d\n", t);
            }
        }
    }
    return 0;
}

3、HDU 5675 ztr loves math

题意:
是否存在正整数 x 和 y,满足 n = x^2 - y^2 (n 为正整数)

解题思路:
据说这次 BC 出现很多问题(导致unrated)所以肯定不知道哪里有毒
一:
n = x^2 - y^2 = (x+y) * (x-y)

令 a = x+y; b = x-y;
那么 n = a*b; x = (a+b) / 2; y = (a-b) / 2;

所以 (a-b) != 0 && (a-b) %2 == 0 时有解

复杂度O(sqrt(n))

以为会TLE,没想到358MS过了


二:
假设存在解时 y = x+i; n = (x+i)^2 - x^2;
那么 n = 2xi + i^2;

i = 1时,n = 2x + 1;
i = 2时,n = 4x + 4;

容易得出结论,当 n 不等于 1 && n 不等于 4 && n 为奇数或者 4 的倍数时,方程一定有正整数解

#include <iostream>
#include <cstdio>
#include <cmath>

using namespace std;

typedef long long LL;

int main()
{
//    freopen("in.txt", "r", stdin);
    int T;
    scanf("%d", &T);
    while (T--) {
        LL n;
        scanf("%I64d", &n);
		bool flag = false;
		int t = (int)sqrt(n);
		for (int i=1; i<=t; ++i) {
			if (n%i == 0) {
				LL a = i;
				LL b = n / i;
				if ((a-b) != 0 && (a-b)%2 == 0) {
//                            cout<<a<<" "<<b<<endl;
					flag = true;
					break;
				}
			}
		}
		if (flag) {
			printf("True\n");
		} else {
			printf("False\n");
		}
    }
    return 0;
}

#include <iostream>
#include <cstdio>
#include <cmath>

using namespace std;

typedef long long LL;

int main()
{
//    freopen("in.txt", "r", stdin);
    int T;
    scanf("%d", &T);
    while (T--) {
        LL n;
        scanf("%I64d", &n);
        if (n != 1 && n != 4 && (n%2 != 0 || n%4 == 0)) {
            printf("True\n");
        } else {
            printf("False\n");
        }
    }
    return 0;
}

4、CodeForces_673A Bear and Game


#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <queue>

using namespace std;

typedef long long LL;

const int maxn = 100;
int t[maxn];

int main()
{
#ifdef __AiR_H
    freopen("in.txt", "r", stdin);
#endif // __AiR_H
    int n;
    scanf("%d", &n);
    t[0] = 0;
    for (int i = 1; i <= n; ++i) {
        scanf("%d", &t[i]);
    }
    ++n;
    t[n] = 90;
    bool flag = false;
    for (int i = 1; i <= n; ++i) {
        if (t[i] - t[i-1] > 15) {
            flag = true;
            printf("%d\n", t[i-1] + 15);
            break;
        }
    }
    if (!flag) {
        printf("90\n");
    }
    return 0;
}

5、CodeForces_673B Problems for Round


#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <queue>
#include <vector>

using namespace std;

typedef long long LL;

const int maxn = 1e5 + 10;

vector<int> Div1, Div2;

int main()
{
    int n, m;
    scanf("%d%d", &n, &m);
    int u, v;
    for (int i = 0; i < m; ++i) {
        scanf("%d%d", &u, &v);
        if (u < v) {
            swap(u, v);
        }
        Div1.push_back(u);
        Div2.push_back(v);
    }
    if (m == 0) {
        printf("%d\n", n-1);
    } else {
        int a = *max_element(Div2.begin(), Div2.end());
        int b = *min_element(Div1.begin(), Div1.end());
        printf("%d\n", max(0, b-a));
    }
    return 0;
}

#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <queue>
#include <vector>

using namespace std;

typedef long long LL;

const int maxn = 1e5 + 10;

int main()
{
#ifdef __AiR_H
    freopen("in.txt", "r", stdin);
#endif // __AiR_H
    int n, m;
    scanf("%d%d", &n, &m);
    int u, v;
    int div2_Max = 1, div1_Min = n;
    for (int i = 0; i < m; ++i) {
        scanf("%d%d", &u, &v);
        if (u < v) {
            swap(u, v);
        }
        div1_Min = min(div1_Min, u);
        div2_Max = max(div2_Max, v);
    }
    if (m == 0) {
        printf("%d\n", n-1);
    } else {
        printf("%d\n", max(0, div1_Min - div2_Max));
    }
    return 0;
}

6、HDU 2054 A == B ?

#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <queue>
#include <vector>
#include <stack>
#include <map>
#include <cmath>
#include <cctype>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int uint;

const ull mod = 1e9 + 7;
const int INF = 0x7fffffff;
const int maxn = 1e5 + 10;
char A[maxn], B[maxn];

void Init(char s[]);

int main()
{
#ifdef __AiR_H
    freopen("in.txt", "r", stdin);
#endif // __AiR_H
    while (scanf("%s%s", A, B) != EOF) {
        Init(A);
        Init(B);
        if (strcmp(A, B) == 0) {
            printf("YES\n");
        } else {
            printf("NO\n");
        }
    }
    return 0;
}

void Init(char s[])
{
    int len = strlen(s);
    //strstr(str1,str2)
    //若str2是str1的子串,则返回str2在str1的首次出现的地址
    //如果str2不是str1的子串,则返回NULL
    if (strstr(s, ".")) {
        while (s[len-1] == '0') {
            s[len-1] = '\0';
            --len;
        }
        if (s[len-1] == '.') {
            s[len-1] = '\0';
        }
    }
}

7、Codeforces_5A Chat Server's Outgoing Traffic

#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <queue>
#include <vector>
#include <stack>
#include <map>
#include <cmath>
#include <cctype>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int uint;

const ull mod = 1e9 + 7;
const int INF = 0x7fffffff;
const int maxn = 100 + 10;
char s[maxn];

int main()
{
#ifdef __AiR_H
    freopen("in.txt", "r", stdin);
#endif // __AiR_H
    int Count = 0;
    int ans = 0;
    while (gets(s)) {
        if (s[0] == '+') {
            ++Count;
        } else if (s[0] == '-') {
            --Count;
        } else {
            int len = strlen(s);
            int pos = 0;
            while (s[pos] != ':') {
                ++pos;
            }
            ans += Count * (len - (pos+1));
        }
    }
    printf("%d\n", ans);
    return 0;
}

8、Codeforces_686A Free Ice Cream

#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <queue>
#include <vector>
#include <stack>
#include <map>
#include <cmath>
#include <cctype>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int uint;

const ull mod = 1e9 + 7;
const int INF = 0x7fffffff;
char cmd[2];

int main()
{
#ifdef __AiR_H
    freopen("in.txt", "r", stdin);
#endif // __AiR_H
    ull n, x;
    ull d;
    scanf("%I64d%I64d", &n, &x);
    ull Count = 0;
    for (ull i = 0; i < n; ++i) {
        scanf("%s%I64d", cmd, &d);
        if (cmd[0] == '+') {
            x += d;
        } else {
            if (x < d) {
                ++Count;
            } else {
                x -= d;
            }
        }
    }
    printf("%I64d %I64d\n", x, Count);
    return 0;
}

9、Codeforces_686B Little Robber Girl's Zoo

题目要求操作次数不能超过 20000 ,n^2 的循环肯定会 wa,但是不确定 n^3 循环操作次数会不会超 20000

不过最后 AC 了


#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <queue>
#include <vector>
#include <stack>
#include <map>
#include <cmath>
#include <cctype>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int uint;

const ull mod = 1e9 + 7;
const int INF = 0x7fffffff;
const int maxn = 100 + 10;
int a[maxn];

int main()
{
#ifdef __AiR_H
    freopen("in.txt", "r", stdin);
#endif // __AiR_H
    int n;
    scanf("%d", &n);
    for (int i = 1; i <= n; ++i) {
        scanf("%d", &a[i]);
    }
    int s = 0, e = 0;
    for (int i = 1; i <= n*n; ++i) {
        bool flag = false;
        for (int j = n; j > 0; --j) {
            if (a[j] < a[j-1]) {
                if (!flag) {
                    flag = true;
                    e = j;
                }
                --j;
                s = j;
            } else {
                if (flag) {
                    printf("%d %d\n", s, e);
                    flag = false;
                    for (int k = s; k <= e; k+=2) {
                        swap(a[k], a[k+1]);
                    }
                }
            }
        }
        if (flag) {
            printf("%d %d\n", s, e);
            for (int j = s; j <= e; j+=2) {
                swap(a[j], a[j+1]);
            }
        }
    }
    return 0;
}

10、HDU 1008 Elevator

解题思路:

注意有可能在同一层停留

#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <queue>
#include <vector>
#include <stack>
#include <map>
#include <cmath>
#include <cctype>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int uint;

const ull mod = 1e9 + 7;
const int INF = 0x7fffffff;
const int maxn = 100 + 10;
int num[maxn];

int main()
{
#ifdef __AiR_H
    freopen("in.txt", "r", stdin);
#endif // __AiR_H
    int N;
    while (scanf("%d", &N) != EOF && N != 0) {
        int ans = 0;
        num[0] = 0;
        for (int i = 1; i <= N; ++i) {
            scanf("%d", &num[i]);
            if (num[i-1] < num[i]) {
                ans += (num[i] - num[i-1]) * 6 + 5;
            } else {
                ans += (num[i-1] - num[i]) * 4 + 5;
            }
        }
        printf("%d\n", ans);
    }
    return 0;
}



【基于QT的调色板】是一个使用Qt框架开发的色彩选择工具,类似于Windows操作系统中常见的颜色选取器。Qt是一个跨平台的应用程序开发框架,广泛应用于桌面、移动和嵌入式设备,支持C++和QML语言。这个调色板功能提供了横竖两种渐变模式,用户可以方便地选取所需的颜色值。 在Qt中,调色板(QPalette)是一个关键的类,用于管理应用程序的视觉样式。QPalette包含了一系列的颜色角色,如背景色、前景色、文本色、高亮色等,这些颜色可以根据用户的系统设置或应用程序的需求进行定制。通过自定义QPalette,开发者可以创建具有独特视觉风格的应用程序。 该调色板功能可能使用了QColorDialog,这是一个标准的Qt对话框,允许用户选择颜色。QColorDialog提供了一种简单的方式来获取用户的颜色选择,通常包括一个调色板界面,用户可以通过滑动或点击来选择RGB、HSV或其他色彩模型中的颜色。 横渐变取色可能通过QGradient实现,QGradient允许开发者创建线性或径向的色彩渐变。线性渐变(QLinearGradient)沿直线从一个点到另一个点过渡颜色,而径向渐变(QRadialGradient)则以圆心为中心向外扩散颜色。在调色板中,用户可能可以通过滑动条或鼠标拖动来改变渐变的位置,从而选取不同位置的颜色。 竖渐变取色则可能是通过调整QGradient的方向来实现的,将原本水平的渐变方向改为垂直。这种设计可以提供另一种方式来探索颜色空间,使得选取颜色更为直观和便捷。 在【colorpanelhsb】这个文件名中,我们可以推测这是与HSB(色相、饱和度、亮度)色彩模型相关的代码或资源。HSB模型是另一种常见且直观的颜色表示方式,与RGB或CMYK模型不同,它以人的感知为基础,更容易理解。在这个调色板中,用户可能可以通过调整H、S、B三个参数来选取所需的颜色。 基于QT的调色板是一个利用Qt框架和其提供的色彩管理工具,如QPalette、QColorDialog、QGradient等,构建的交互式颜色选择组件。它不仅提供了横竖渐变的色彩选取方式,还可能支持HSB色彩模型,使得用户在开发图形用户界面时能更加灵活和精准地控制色彩。
标题基于Spring Boot的二手物品交易网站系统研究AI更换标题第1章引言阐述基于Spring Boot开发二手物品交易网站的研究背景、意义、现状及本文方法与创新点。1.1研究背景与意义介绍二手物品交易的市场需求和Spring Boot技术的适用性。1.2国内外研究现状概述当前二手物品交易网站的发展现状和趋势。1.3论文方法与创新点说明本文采用的研究方法和在系统设计中的创新之处。第2章相关理论与技术介绍开发二手物品交易网站所涉及的相关理论和关键技术。2.1Spring Boot框架解释Spring Boot的核心概念和主要特性。2.2数据库技术讨论适用的数据库技术及其在系统中的角色。2.3前端技术阐述与后端配合的前端技术及其在系统中的应用。第3章系统需求分析详细分析二手物品交易网站系统的功能需求和性能需求。3.1功能需求列举系统应实现的主要功能模块。3.2性能需求明确系统应满足的性能指标和安全性要求。第4章系统设计与实现具体描述基于Spring Boot的二手物品交易网站系统的设计和实现过程。4.1系统架构设计给出系统的整体架构设计和各模块间的交互方式。4.2数据库设计详细阐述数据库的结构设计和数据操作流程。4.3界面设计与实现介绍系统的界面设计和用户交互的实现细节。第5章系统测试与优化说明对系统进行测试的方法和性能优化的措施。5.1测试方法与步骤测试环境的搭建、测试数据的准备及测试流程。5.2测试结果分析对测试结果进行详细分析,验证系统是否满足需求。5.3性能优化措施提出针对系统性能瓶颈的优化建议和实施方案。第6章结论与展望总结研究成果,并展望未来可能的研究方向和改进空间。6.1研究结论概括本文基于Spring Boot开发二手物品交易网站的主要发现和成果。6.2展望与改进讨论未来可能的系统改进方向和新的功能拓展。
1. 用户与权限管理模块 角色管理: 学生:查看个人住宿信息、提交报修申请、查看卫生检查结果、请假外出登记 宿管人员:分配宿舍床位、处理报修申请、记录卫生检查结果、登记晚归情况 管理员:维护楼栋与房间信息、管理用户账号、统计住宿数据、发布宿舍通知 用户操作: 登录认证:对接学校统一身份认证(模拟实现,用学号 / 工号作为账号),支持密码重置 信息管理:学生完善个人信息(院系、专业、联系电话),管理员维护所有用户信息 权限控制:不同角色仅可见对应功能(如学生无法修改床位分配信息) 2. 宿舍信息管理模块 楼栋与房间管理: 楼栋信息:名称(如 "1 号宿舍楼")、层数、性别限制(男 / 女 / 混合)、管理员(宿管) 房间信息:房间号(如 "101")、户型(4 人间 / 6 人间)、床位数量、已住人数、可用状态 设施信息:记录房间内设施(如空调、热水器、桌椅)的配置与完好状态 床位管理: 床位编号:为每个床位设置唯一编号(如 "101-1" 表示 101 房间 1 号床) 状态标记:标记床位为 "空闲 / 已分配 / 维修中",支持批量查询空闲床位 历史记录:保存床位的分配变更记录(如从学生 A 调换到学生 B 的时间与原因) 3. 住宿分配与调整模块 住宿分配: 新生分配:管理员导入新生名单后,宿管可按专业集中、性别匹配等规则批量分配床位 手动分配:针对转专业、复学学生,宿管手动指定空闲床位并记录分配时间 分配结果公示:学生登录后可查看自己的宿舍信息(楼栋、房间号、床位号、室友列表) 调整管理: 调宿申请:学生提交调宿原因(如室友矛盾、身体原因),选择意向宿舍(需有空位) 审批流程:宿管审核申请,通过后执行床位调换,更新双方住宿信息 换宿记录:保存调宿历史(申请人、原床位、新床位、审批人、时间) 4. 报修与安全管理模块 报修管理: 报修提交:学生选择宿舍、设施类型(如 "
JFM7VX690T型SRAM型现场可编程门阵列技术手册主要介绍的是上海复旦微电子集团股份有限公司(简称复旦微电子)生产的高性能FPGA产品JFM7VX690T。该产品属于JFM7系列,具有现场可编程特性,集成了功能强大且可以灵活配置组合的可编程资源,适用于实现多种功能,如输入输出接口、通用数字逻辑、存储器、数字信号处理和时钟管理等。JFM7VX690T型FPGA适用于复杂、高速的数字逻辑电路,广泛应用于通讯、信息处理、工业控制、数据中心、仪表测量、医疗仪器、人工智能、自动驾驶等领域。 产品特点包括: 1. 可配置逻辑资源(CLB),使用LUT6结构。 2. 包含CLB模块,可用于实现常规数字逻辑和分布式RAM。 3. 含有I/O、BlockRAM、DSP、MMCM、GTH等可编程模块。 4. 提供不同的封装规格和工作温度范围的产品,便于满足不同的使用环境。 JFM7VX690T产品系列中,有多种型号可供选择。例如: - JFM7VX690T80采用FCBGA1927封装,尺寸为45x45mm,使用锡银焊球,工作温度范围为-40°C到+100°C。 - JFM7VX690T80-AS同样采用FCBGA1927封装,但工作温度范围更广,为-55°C到+125°C,同样使用锡银焊球。 - JFM7VX690T80-N采用FCBGA1927封装和铅锡焊球,工作温度范围与JFM7VX690T80-AS相同。 - JFM7VX690T36的封装规格为FCBGA1761,尺寸为42.5x42.5mm,使用锡银焊球,工作温度范围为-40°C到+100°C。 - JFM7VX690T36-AS使用锡银焊球,工作温度范围为-55°C到+125°C。 - JFM7VX690T36-N使用铅锡焊球,工作温度范围与JFM7VX690T36-AS相同。 技术手册中还包含了一系列详细的技术参数,包括极限参数、推荐工作条件、电特性参数、ESD等级、MSL等级、重量等。在产品参数章节中,还特别强调了封装类型,包括外形图和尺寸、引出端定义等。引出端定义是指对FPGA芯片上的各个引脚的功能和接线规则进行说明,这对于FPGA的正确应用和电路设计至关重要。 应用指南章节涉及了FPGA在不同应用场景下的推荐使用方法。其中差异说明部分可能涉及产品之间的性能差异;关键性能对比可能包括功耗与速度对比、上电浪涌电流测试情况说明、GTH Channel Loss性能差异说明、GTH电源性能差异说明等。此外,手册可能还提供了其他推荐应用方案,例如不使用的BANK接法推荐、CCLK信号PCB布线推荐、JTAG级联PCB布线推荐、系统工作的复位方案推荐等,这些内容对于提高系统性能和稳定性有着重要作用。 焊接及注意事项章节则针对产品的焊接过程提供了指导,强调焊接过程中的注意事项,以确保产品在组装过程中的稳定性和可靠性。手册还明确指出,未经复旦微电子的许可,不得翻印或者复制全部或部分本资料的内容,且不承担采购方选择与使用本文描述的产品和服务的责任。 上海复旦微电子集团股份有限公司拥有相关的商标和知识产权。该公司在中国发布的技术手册,版权为上海复旦微电子集团股份有限公司所有,未经许可不得进行复制或传播。 技术手册提供了上海复旦微电子集团股份有限公司销售及服务网点的信息,方便用户在需要时能够联系到相应的服务机构,获取最新信息和必要的支持。同时,用户可以访问复旦微电子的官方网站(***以获取更多产品信息和公司动态。
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值