Submission #1689717


Source Code Expand

import java.math.BigInteger;
import java.util.Scanner;

public class Main {
	BigInteger[][] base = new BigInteger[2][2];
	static Scanner sc=new Scanner(System.in);
	public static void main(String[] args) {
		int n=sc.nextInt();
		helper(n);
	}

	private static void helper(int n) {
		// TODO Auto-generated method stub
		for(int i=1;i<=3500;i++){
			for(int j=1;j<=3500;j++){
				for(int k=1;k<=3500;k++){
					long up=i*j+j*k+k*i;
					long down=i*j*k;
					long n1=4*down;
					long n2=n*up;
					if(n1==n2){
						System.out.println(""+i+" "+j+" "+k);
						return;
					}
				}
			}
		}
	}

	private BigInteger[][] matrixMult(BigInteger[][] leftmatrix, BigInteger[][] rightMatrix) {
		// TODO Auto-generated method stub
		BigInteger[][] res = new BigInteger[2][2];
		res[0][0] = leftmatrix[0][0].multiply(rightMatrix[0][0]).add(leftmatrix[0][1].multiply(rightMatrix[1][0]));
		res[0][1] = leftmatrix[0][0].multiply(rightMatrix[0][1]).add(leftmatrix[0][1].multiply(rightMatrix[1][1]));
		res[1][0] = leftmatrix[1][0].multiply(rightMatrix[0][0]).add(leftmatrix[1][1].multiply(rightMatrix[1][0]));
		res[1][1] = leftmatrix[1][0].multiply(rightMatrix[0][1]).add(leftmatrix[1][1].multiply(rightMatrix[1][1]));
		return res;
	}

	public BigInteger[][] fib(int n) {
		if ((n) <= 1)
			return base;
		BigInteger[][] res = ((n) % 2 == 1 ? fib((n - 1) / 2) : fib(n / 2));
		res = matrixMult(res, res);
		if ((n) % 2 == 1)
			res = matrixMult(res, base);
		return res;
	}



}

Submission Info

Submission Time
Task C - 4/N
User zcg496203111
Language Java8 (OpenJDK 1.8.0)
Score 0
Code Size 1522 Byte
Status TLE
Exec Time 2113 ms
Memory 25172 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 300
Status
AC × 1
TLE × 2
AC × 22
TLE × 28
Set Name Test Cases
Sample 0002, 3485, 4664
All 0002, 0003, 0004, 0005, 0006, 0007, 0049, 0073, 0097, 0121, 0137, 0139, 0156, 0163, 0169, 0181, 0191, 0223, 0229, 0263, 0271, 0289, 0361, 0481, 0529, 0551, 0649, 0720, 0916, 1081, 1156, 1498, 1921, 2041, 2329, 2449, 2568, 2918, 2929, 3289, 3429, 3485, 3763, 4081, 4277, 4648, 4652, 4656, 4660, 4664
Case Name Status Exec Time Memory
0002 AC 109 ms 20948 KB
0003 AC 103 ms 17748 KB
0004 AC 130 ms 21844 KB
0005 AC 134 ms 20692 KB
0006 AC 131 ms 21076 KB
0007 AC 131 ms 21844 KB
0049 AC 403 ms 20820 KB
0073 AC 563 ms 19028 KB
0097 AC 720 ms 21716 KB
0121 AC 832 ms 21076 KB
0137 AC 894 ms 20816 KB
0139 AC 904 ms 21076 KB
0156 AC 1018 ms 20948 KB
0163 AC 1071 ms 23764 KB
0169 AC 1091 ms 21204 KB
0181 AC 1166 ms 21972 KB
0191 AC 1256 ms 21332 KB
0223 AC 1429 ms 19284 KB
0229 AC 1438 ms 20948 KB
0263 AC 1661 ms 20948 KB
0271 AC 1685 ms 19412 KB
0289 AC 1969 ms 19284 KB
0361 TLE 2109 ms 23124 KB
0481 TLE 2109 ms 23764 KB
0529 TLE 2109 ms 23764 KB
0551 TLE 2109 ms 19540 KB
0649 TLE 2109 ms 19924 KB
0720 TLE 2109 ms 21972 KB
0916 TLE 2109 ms 19924 KB
1081 TLE 2109 ms 19796 KB
1156 TLE 2109 ms 21716 KB
1498 TLE 2109 ms 21716 KB
1921 TLE 2109 ms 19156 KB
2041 TLE 2109 ms 19156 KB
2329 TLE 2109 ms 21204 KB
2449 TLE 2109 ms 21460 KB
2568 TLE 2109 ms 18768 KB
2918 TLE 2109 ms 21716 KB
2929 TLE 2109 ms 25172 KB
3289 TLE 2109 ms 21716 KB
3429 TLE 2109 ms 19924 KB
3485 TLE 2109 ms 21076 KB
3763 TLE 2109 ms 18768 KB
4081 TLE 2109 ms 20692 KB
4277 TLE 2109 ms 19924 KB
4648 TLE 2109 ms 21332 KB
4652 TLE 2113 ms 21716 KB
4656 TLE 2109 ms 18900 KB
4660 TLE 2109 ms 21076 KB
4664 TLE 2108 ms 18772 KB