Found

Found
Time Limit: 10000ms, Special Time Limit:25000ms, Memory Limit:260144KB
Total submit users: 2, Accepted users: 2
Problem 13881 : No special judgement
Problem description
Alice and Bob live in a city with N intersections (numbered as intersection 1, intersection 2,…, intersection N). There are M roads. Each road is bidirectional and directly joins two intersections. Each pair of intersections is joined by at most one road.

Alice lives in a house at intersection 1. Bob lives in a house at intersection N. They start wandering in the city at 12pm. Each minute each one move from one intersection to another which is connected directly by a road. (Note that since they have to move, they cannot stay at the same intersection they were at in the previous minute).

They agree to meet exactly T minutes after 12pm at some intersection. Also they do not want to meet each other before T minutes. In how many ways can they move inside the city? Note that because they travel fairly fast, they do not meet if they travel on the same road on different directions. 


Input
The first line of the input contains an integer K (1<=K<=5), the number of test cases. Then K test cases follow in the format specified below.

Each test case starts with 3 integers N, M, and T (2<=N<=10; 1<=M<=50; 1<=T<=1,000,000,000,000). 
The next M lines specify road connections. That is, line 1+i, for 1<=i<=M, contain two integers A and B specifying that there is a bidirectional road connecting intersection A and B (1<=A<=N; 1<=B<=N; A is not equal to B).
Output
For each test case, your program should output the number of possible ways (modulo 9973) can Alice and Bob move in the city so that at time T they meet at some intersection but they do not meet at any intersection before that. Since the number can be very large, you should output the numbers modulo 9973.
Sample Input
4
3 3 2
1 2
2 3
1 3
3 2 2
1 2
2 3
4 4 10
1 2
2 4
1 3
4 3
4 5 1000
1 2
2 4
1 3
4 3
1 4
Sample Output
3
0
1024
3213
Problem Source
ACM-ICPC Asia Thailand National On-Site Programming Contest 2015

题解:n的范围很小,所以可以用a*n+b来表示a,b所在位置的状态,用mp[i][j]表示a,b能否从i状态转移到j状态,再进行矩阵快速幂(矩阵的k次乘方就相当于i经过k条路到达j的方数 当k=2时,∑ way[i][x] * way[x][j] (0<=x<n && x!=i && x!=j),以此类推

#include<iostream>
#include<algorithm> 
#include<string.h>
#include<stdio.h>
using namespace std;
typedef long long ll;
const int mod=9973;
const int maxn=105;
bool mp[105][105];
int t,n,m;
ll T;
struct matrix{
    int m[105][105];
    friend matrix operator*(matrix a,matrix b){
        matrix c;
        for(int i=0;i<n*n;i++)
           for(int j=0;j<n*n;j++){
                  c.m[i][j]=0;
                  for(int k=0;k<n*n;k++)
                  c.m[i][j]+=a.m[i][k]*b.m[k][j]%mod;
                  c.m[i][j]%=mod;
           }
        return c;
    }
}cnt;
matrix qpow(matrix a,ll b){
    matrix ret;
    memset(ret.m,0,sizeof(ret.m));
    for(int i=0;i<n;i++) ret.m[i][i]=1;
    while(b){
        if(b&1) ret=ret*a;
        b>>=1;
        a=a*a;
    }
    return ret;
}
int main(){
    scanf("%d",&t);
    while(t--){
        scanf("%d%d%I64d",&n,&m,&T);
        memset(mp,0,sizeof(mp));
        memset(cnt.m,0,sizeof(cnt.m));
        for(int u,v,i=0;i<m;i++){
            scanf("%d%d",&u,&v);
            mp[u][v]=mp[v][u]=1;
        } 
        for(int i=0;i<n*n;i++){
            int a=i/n+1,b=i%n+1;
            if(a==b) continue;
            for(int j=0;j<n*n;j++){
                int c=j/n+1,d=j%n+1;
                if(c==d||a==c||b==d||!mp[a][c]||!mp[b][d]) continue;
                cnt.m[i][j]=1;
            }
        }
        cnt=qpow(cnt,T-1);
        int ans=0;
        for(int i=0;i<n*n;i++){
            int a=i/n+1,b=i%n+1;
            if(!cnt.m[n-1][i]||a==b) continue;
            for(int j=1;j<=n;j++)
               if(mp[a][j]&&mp[b][j])
                  ans=(ans+cnt.m[n-1][i])%mod;
        }
        printf("%d\n",ans);
    }
}



内容概要:本文档提供了关于“微型车间生产线的设计与生产数据采集试验研究”的毕业设计复现代码,涵盖从论文结构生成、机械结构设计、PLC控制系统设计、生产数据采集与分析系统、有限元分析、进度管理、文献管理和论文排版系统的完整实现。通过Python代码和API调用,详细展示了各个模块的功能实现和相互协作。例如,利用SolidWorks API设计机械结构,通过PLC控制系统模拟生产流程,使用数据分析工具进行生产数据的采集和异常检测,以及利用进度管理系统规划项目时间表。 适合人群:具有机械工程、自动化控制或计算机编程基础的学生或研究人员,尤其是从事智能制造领域相关工作的人员。 使用场景及目标:①帮助学生或研究人员快速搭建和理解微型车间生产线的设计与实现;②提供完整的代码框架,便于修改和扩展以适应不同的应用场景;③作为教学或科研项目的参考资料,用于学习和研究智能制造技术。 阅读建议:此资源不仅包含详细的代码实现,还涉及多个学科领域的知识,如机械设计、电气控制、数据分析等。因此,在学习过程中,建议读者结合实际操作,逐步理解每个模块的功能和原理,并尝试调整参数以观察不同设置下的系统表现。同时,可以参考提供的文献资料,深入研究相关理论和技术背景。
### 解决 Maven Not Found 错误的方法 对于遇到 `Maven not found` 的情况,可以从多个角度来解决问题。具体取决于环境的不同以及具体的错误表现形式。 #### 更新 IDEA 中的仓库索引 当在 IntelliJ IDEA 中创建或导入 Maven 项目时,如果遇到依赖项无法解析的情况,可以尝试通过更新本地存储库索引来解决这个问题。这可以通过导航到菜单栏中的 **File->Settings** (或者在 macOS 上是 **IntelliJ IDEA->Preferences**),接着依次点击进入 **Build, Execution, Deployment -> Build Tools -> Maven -> Repositories** ,最后选择并执行刷新操作[^1]。 #### 修改 Gradle 插件应用语句 如果是基于 Gradle 构建工具而遇到了类似于 `'maven' plugin not found` 这样的警告,则可能是由于所使用的插件名称不正确引起的。应将构建脚本里的 `apply plugin: 'maven'` 更改为 `apply plugin: 'maven-publish'` 来适配最新版本的要求[^2]。 #### 安装 Homebrew 并设置环境变量 (针对 Mac 用户) 对于使用 M3 芯片 MacBook Pro 设备上的开发者来说,在终端运行命令时可能会碰到像 `zsh: command not found: brew` 这样表示找不到 Homebrew 工具的消息。这是因为系统的 shell 尚未配置好必要的路径所致。为了修正这一点,首先需要按照官方指南完成 Homebrew 的安装过程;之后再确认 `.zprofile` 或者其他启动文件里包含了指向 `/opt/homebrew/bin` 目录下的可执行文件的相关声明[^3]。 ```bash # 添加至 ~/.zprofile 文件末尾 export PATH="/opt/homebrew/bin:$PATH" ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值