分成左右两个部分a1,a2和-a3,-a4,-a5View Code import java.io.*;import java.util.*;import java.math.*;public class Main{ public static void main(String[] args){ Scanner cin = new Scanner (System.in); int a1=cin.nextInt(); int a2=cin.nextInt(); int a3=cin.nextInt(); int a4=c... Read More
题意,一个图,要将每条边恰好遍历两遍,而且要以不同的方向,还要回到原点。直接dfs一下就好了,vis[]标记边是否访问,不会的仔细模拟一遍哪个dfs就好了View Code #include<stdio.h>#include<string.h>struct Edge{ int v,next;}edge[111111];int head[11111];int n,m,tot;bool vis[111111];void add(int s,int t){ edge[tot].v=t; edge[tot].next=head[s]; head[s]=tot++;}void d Read More
View Code import java.io.*;import java.util.*;import java.math.*;public class Main{ public static BigInteger fun(BigInteger a,BigInteger b,BigInteger c) { int n=2; BigInteger x=a,y=b,z=c; BigInteger ans; while(n<99) { n++; ans=BigInteger... Read More