标签:
---------------------------------------
相邻的两个自然数互质,所以与n互质并且不大于n的最大数就是n-1了,还有就是稍微注意一下数据范围。
AC代码:
1 import java.math.BigInteger; 2 import java.util.Scanner; 3 4 public class Main { 5 6 public static void main(String[] args) { 7 8 Scanner sc=new Scanner(System.in); 9 int times=sc.nextInt(); 10 while(times-->0) System.out.println(sc.nextBigInteger().subtract(BigInteger.ONE)); 11 12 } 13 14 }
题目来源: http://acm.nyist.net/JudgeOnline/problem.php?pid=1047
标签:
原文地址:http://www.cnblogs.com/cc11001100/p/5870477.html