题目描述: 类似1087,基础最大流。化多源多汇点为单源单汇点。 解题思路: 标准的最大流题目。输入处理用sscanf。数组注意清空。 代码: #include <stdio.h> #include <stdlib.h> #define N 103 #define MAX 1000000 int c[N][N], visit[N], pre[N], n, pn, cn, ed
You are given two positive integer sequences 𝑎1,…,𝑎𝑛 and 𝑏1,…,𝑏𝑚. For each 𝑗=1,…,𝑚 find the greatest common divisor of 𝑎1+𝑏𝑗,…,𝑎𝑛+𝑏𝑗. Input The first line contains two integers 𝑛 and