結果

問題 No.719 Coprime
ユーザー uwiuwi
提出日時 2018-07-27 23:17:35
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 11,675 bytes
コンパイル時間 4,487 ms
コンパイル使用メモリ 89,944 KB
実行使用メモリ 37,212 KB
最終ジャッジ日時 2024-07-05 04:56:23
合計ジャッジ時間 8,224 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 49 ms
36,740 KB
testcase_01 AC 47 ms
36,872 KB
testcase_02 AC 48 ms
36,744 KB
testcase_03 AC 48 ms
36,900 KB
testcase_04 AC 48 ms
36,668 KB
testcase_05 AC 49 ms
36,884 KB
testcase_06 AC 48 ms
36,904 KB
testcase_07 AC 51 ms
37,212 KB
testcase_08 AC 50 ms
36,956 KB
testcase_09 AC 51 ms
37,024 KB
testcase_10 AC 51 ms
36,924 KB
testcase_11 AC 51 ms
36,876 KB
testcase_12 AC 49 ms
36,800 KB
testcase_13 AC 48 ms
36,772 KB
testcase_14 AC 49 ms
36,820 KB
testcase_15 AC 50 ms
36,952 KB
testcase_16 AC 47 ms
37,064 KB
testcase_17 AC 47 ms
36,896 KB
testcase_18 AC 47 ms
36,972 KB
testcase_19 AC 46 ms
36,444 KB
testcase_20 AC 49 ms
36,668 KB
testcase_21 AC 47 ms
36,904 KB
testcase_22 AC 46 ms
37,084 KB
testcase_23 AC 52 ms
36,724 KB
testcase_24 AC 51 ms
36,980 KB
testcase_25 AC 50 ms
36,932 KB
testcase_26 AC 48 ms
36,932 KB
testcase_27 AC 46 ms
36,772 KB
testcase_28 AC 48 ms
36,992 KB
testcase_29 AC 49 ms
36,668 KB
testcase_30 AC 50 ms
36,760 KB
testcase_31 AC 49 ms
36,972 KB
testcase_32 AC 48 ms
36,448 KB
testcase_33 AC 46 ms
36,772 KB
testcase_34 AC 50 ms
36,688 KB
testcase_35 AC 49 ms
36,980 KB
testcase_36 AC 47 ms
36,640 KB
testcase_37 AC 47 ms
37,024 KB
testcase_38 AC 48 ms
36,760 KB
testcase_39 AC 48 ms
36,936 KB
testcase_40 AC 48 ms
36,788 KB
testcase_41 AC 49 ms
36,544 KB
testcase_42 AC 46 ms
36,900 KB
testcase_43 AC 49 ms
36,772 KB
testcase_44 WA -
testcase_45 AC 49 ms
36,948 KB
testcase_46 AC 48 ms
36,548 KB
testcase_47 AC 47 ms
37,028 KB
testcase_48 AC 48 ms
36,568 KB
testcase_49 AC 47 ms
36,816 KB
testcase_50 AC 47 ms
36,936 KB
testcase_51 AC 47 ms
36,980 KB
testcase_52 AC 47 ms
37,004 KB
testcase_53 AC 48 ms
36,680 KB
testcase_54 WA -
testcase_55 AC 48 ms
37,120 KB
testcase_56 AC 49 ms
36,892 KB
testcase_57 AC 49 ms
36,948 KB
testcase_58 AC 48 ms
36,772 KB
testcase_59 AC 48 ms
36,684 KB
testcase_60 AC 49 ms
36,948 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package contest180727;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.InputMismatchException;

public class D3 {
	InputStream is;
	PrintWriter out;
	String INPUT = "";
	
	void solve()
	{
		out.println(ENIGMA[ni()]);
	}
	int[] ENIGMA = {
			0, 0, 2, 5, 7, 12, 12, 19, 23, 29, 29, 40, 40, 53, 53, 54, 62, 79, 79, 98, 98, 102, 102, 125, 125, 145, 145, 158, 163, 192, 192, 223, 234, 234, 234, 237, 237, 274, 274, 274, 274, 315, 315, 358, 359, 359, 359, 406, 406, 445, 445, 452, 458, 511, 511, 530, 530, 534, 534, 593, 593, 654, 654, 654, 679, 687, 687, 754, 754, 762, 762, 833, 833, 906, 906, 906, 906, 923, 923, 1002, 1002, 1037, 1037, 1120, 1120, 1136, 1136, 1136, 1136, 1225, 1225, 1250, 1250, 1250, 1250, 1258, 1258, 1355, 1355, 1355, 1355, 1456, 1456, 1559, 1559, 1559, 1559, 1666, 1666, 1775, 1775, 1775, 1775, 1888, 1888, 1904, 1921, 1927, 1927, 1961, 1961, 2071, 2071, 2071, 2077, 2110, 2110, 2237, 2272, 2272, 2272, 2403, 2403, 2415, 2415, 2415, 2415, 2552, 2552, 2691, 2691, 2691, 2691, 2691, 2691, 2691, 2691, 2691, 2691, 2840, 2840, 2991, 2991, 3032, 3032, 3032, 3032, 3189, 3189, 3189, 3189, 3218, 3218, 3381, 3381, 3381, 3381, 3548, 3548, 3695, 3695, 3706, 3707, 3880, 3880, 3880, 3880, 3880, 3880, 4059, 4059, 4240, 4240, 4240, 4240, 4263, 4263, 4312, 4324, 4324, 4324, 4515, 4515, 4708, 4708, 4708, 4708, 4905, 4905, 5104, 5104, 5104, 5104, 5160, 5160, 5176, 5176, 5188, 5188, 5208, 5208, 5419, 5437, 5437, 5437, 5445, 5445, 5457, 5457, 5457, 5457, 5492, 5492, 5715, 5715, 5715, 5715, 5942, 5942, 6171, 6171, 6171, 6215, 6448, 6448, 6464, 6464, 6464, 6464, 6703, 6703, 6944, 6944, 7003, 7003, 7003, 7003, 7003, 7003, 7003, 7003, 7254, 7254, 7318, 7318, 7318, 7371, 7628, 7628, 7664, 7664, 7664, 7664, 7927, 7927, 7951, 7951, 7951, 7951, 8220, 8220, 8491, 8491, 8491, 8491, 8491, 8491, 8768, 8768, 8773, 8773, 9054, 9054, 9337, 9337, 9337, 9337, 9361, 9361, 9633, 9633, 9633, 9633, 9926, 9926, 9950, 9953, 9953, 9953, 9953, 9953, 9965, 9965, 9965, 9965, 9973, 9973, 10280, 10280, 10280, 10280, 10591, 10591, 10904, 10904, 10904, 10904, 11221, 11221, 11355, 11355, 11355, 11355, 11355, 11355, 11355, 11355, 11355, 11372, 11396, 11396, 11727, 11727, 11775, 11775, 11799, 11799, 12136, 12136, 12136, 12136, 12156, 12156, 12217, 12231, 12231, 12231, 12578, 12578, 12927, 12927, 12927, 12927, 13280, 13280, 13296, 13296, 13296, 13296, 13655, 13655, 13982, 13982, 13982, 13982, 13990, 13990, 14357, 14357, 14389, 14389, 14389, 14389, 14762, 14762, 14762, 14790, 14878, 14878, 15257, 15257, 15257, 15257, 15640, 15640, 15640, 15640, 15656, 15656, 16045, 16045, 16108, 16108, 16108, 16108, 16132, 16132, 16529, 16529, 16529, 16529, 16930, 16930, 16930, 16930, 16930, 16930, 17014, 17014, 17423, 17423, 17423, 17423, 17434, 17434, 17450, 17450, 17450, 17450, 17869, 17869, 18290, 18290, 18302, 18364, 18364, 18364, 18376, 18376, 18376, 18376, 18807, 18807, 19240, 19240, 19240, 19240, 19240, 19240, 19679, 19679, 19679, 19679, 20122, 20122, 20146, 20146, 20146, 20146, 20595, 20595, 20635, 20635, 20635, 20635, 20635, 20635, 21092, 21092, 21092, 21092, 21553, 21553, 22016, 22080, 22080, 22080, 22547, 22547, 22583, 22583, 22583, 22583, 22603, 22603, 22603, 22603, 22651, 22651, 23130, 23130, 23202, 23202, 23202, 23202, 23234, 23234, 23721, 23721, 23721, 23721, 24212, 24212, 24353, 24353, 24353, 24391, 24415, 24415, 24914, 24914, 24914, 24914, 25417, 25417, 25433, 25433, 25433, 25433, 25942, 25942, 25954, 26001, 26001, 26001, 26009, 26009, 26049, 26049, 26049, 26049, 26570, 26570, 27093, 27093, 27093, 27093, 27125, 27125, 27578, 27578, 27626, 27626, 27674, 27674, 27690, 27690, 27690, 27690, 27690, 27690, 28231, 28231, 28231, 28231, 28239, 28239, 28786, 28786, 28802, 28802, 28963, 28963, 28999, 28999, 28999, 28999, 29556, 29556, 29580, 29580, 29580, 29580, 30143, 30143, 30159, 30159, 30159, 30159, 30728, 30728, 31299, 31299, 31299, 31299, 31299, 31299, 31876, 31876, 31876, 31876, 31900, 31900, 31960, 31960, 31960, 31960, 32547, 32547, 32547, 32547, 32547, 32590, 33183, 33183, 33183, 33183, 33183, 33183, 33782, 33782, 34383, 34383, 34431, 34431, 34431, 34431, 35038, 35038, 35038, 35038, 35086, 35086, 35699, 35699, 35699, 35699, 36316, 36316, 36935, 36935, 36935, 36935, 36971, 36971, 37144, 37144, 37144, 37144, 37233, 37233, 37864, 37905, 37905, 37905, 37905, 37905, 37905, 37905, 37937, 37937, 38578, 38578, 39221, 39221, 39221, 39221, 39868, 39868, 39928, 39928, 39928, 39928, 40581, 40581, 40581, 40643, 40659, 40659, 41318, 41318, 41979, 41979, 41979, 41979, 41979, 41979, 42088, 42088, 42088, 42088, 42108, 42108, 42781, 42781, 42781, 42781, 43458, 43458, 43506, 43506, 43506, 43506, 44189, 44189, 44189, 44189, 44189, 44219, 44291, 44291, 44982, 44982, 44982, 44982, 44982, 44982, 45046, 45046, 45046, 45046, 45747, 45747, 45855, 45855, 45855, 45855, 45879, 45879, 46588, 46588, 46636, 46636, 46680, 46680, 46680, 46680, 46680, 46680, 47399, 47399, 47411, 47411, 47411, 47411, 47482, 47482, 48209, 48209, 48306, 48306, 48316, 48316, 49049, 49049, 49049, 49049, 49109, 49109, 49848, 49848, 49848, 49848, 50591, 50591, 50591, 50591, 50591, 50591, 50615, 50615, 51366, 51448, 51448, 51448, 51448, 51448, 52205, 52205, 52205, 52205, 52966, 52966, 52978, 52978, 52978, 52978, 53050, 53050, 53819, 53819, 53819, 53819, 54592, 54592, 54592, 54592, 54592, 54592, 54664, 54664, 54704, 54704, 54704, 54704, 54704, 54704, 55491, 55491, 55491, 55491, 55515, 55515, 55539, 55539, 55539, 55539, 56336, 56336, 56374, 56374, 56374, 56374, 56394, 56394, 56394, 56394, 56394, 56422, 57231, 57231, 58042, 58042, 58042, 58042, 58042, 58042, 58078, 58078, 58078, 58078, 58899, 58899, 59722, 59736, 59736, 59736, 60563, 60563, 61392, 61392, 61392, 61392, 61392, 61392, 61392, 61392, 61469, 61469, 62308, 62308, 63015, 63015, 63015, 63015, 63015, 63015, 63015, 63089, 63089, 63089, 63298, 63298, 64151, 64151, 64151, 64151, 65008, 65008, 65867, 65867, 65867, 65867, 66730, 66730, 66754, 66754, 66754, 66754, 66814, 66814, 66886, 66886, 66908, 66908, 66908, 66908, 67785, 67785, 67785, 67785, 68666, 68666, 69549, 69549, 69549, 69549, 70436, 70436, 70520, 70520, 70520, 70520, 70520, 70520, 70522, 70522, 70522, 70522, 70522, 70522, 70658, 70658, 70658, 70686, 70694, 70694, 71601, 71601, 71630, 71630, 72541, 72541, 72581, 72581, 72581, 72581, 72605, 72605, 73524, 73524, 73524, 73524, 73572, 73572, 73572, 73572, 73588, 73588, 74517, 74517, 74517, 74517, 74517, 74517, 74517, 74517, 75454, 75454, 75454, 75454, 76395, 76395, 76647, 76741, 76741, 76741, 77688, 77688, 77712, 77712, 77712, 77712, 78665, 78665, 78665, 78665, 78665, 78665, 78701, 78701, 79604, 79604, 79636, 79636, 79636, 79636, 80603, 80603, 80603, 80603, 81574, 81574, 81586, 81586, 81586, 81616, 82593, 82593, 82653, 82653, 82669, 82669, 83652, 83652, 83652, 83652, 83652, 83652, 83696, 83696, 84687, 84687, 84687, 84687, 84687, 84687, 85684, 85684, 85684, 85684, 85684, 85684, 85780, 85780, 85780, 85780, 85888, 85888, 86897, 86897, 86897, 86897, 87910, 87910, 87910, 87910, 87942, 87942, 88961, 88961, 89982, 89982, 89982, 90091, 90245, 90245, 90317, 90317, 90317, 90317, 91348, 91348, 92381, 92381, 92381, 92381, 92413, 92413, 93452, 93452, 93452, 93452, 93512, 93512, 93512, 93512, 93512, 93512, 94561, 94561, 95612, 95612, 95612, 95612, 95612, 95612, 95624, 95624, 95624, 95624, 96685, 96685, 97748, 97748, 97748, 97748, 97828, 97828, 98897, 98897, 98897, 98897, 99034, 99034, 99034, 99034, 99034, 99034, 99082, 99082, 99218, 99218, 99218, 99218, 99218, 99218, 100305, 100305, 100305, 100305, 101396, 101396, 102489, 102489, 102489, 102489, 103586, 103586, 103622, 103622, 103622, 103622, 104725, 104725, 104725, 104725, 104887, 104887, 105996, 105996, 106036, 106036, 106036, 106036, 106036, 106036, 107153, 107153, 107153, 107153, 107261, 107261, 108384, 108384, 108384, 108384, 108384, 108384, 109513, 109513, 109513, 109513, 109533, 109533, 109533, 109574, 109574, 109574, 109670, 109670, 109706, 109706, 109706, 109706, 109706, 109706, 109706, 109706, 109706, 109706, 110857, 110857, 112010, 112010, 112010, 112010, 112082, 112082, 112118, 112118, 112118, 112118, 113281, 113281, 113281, 113281, 113281, 113311, 113335, 113335, 114506, 114506, 114506, 114506, 114506, 114506, 114546, 114546, 114546, 114546, 115727, 115727, 115727, 115727, 115727, 115727, 116914, 116914, 117157, 117157, 117157, 117157, 118350, 118350, 118350, 118350, 118350, 118350, 118370, 118370, 119571, 119571, 119571, 119571, 119573, 119573, 119637, 119637, 119637, 119637, 119673, 119673, 120886, 120886, 120886, 120886, 122103, 122103, 122399, 122399, 122399, 122399, 123622, 123622, 123622, 123622, 123622, 123622, 124851, 124851, 126082, 126082, 126082, 126082, 126082, 126082, 127319, 127319, 127319, 127319, 127319, 127319, 127359, 127359, 127359, 127359, 127393, 127393, 128642, 128642, 128658, 128658, 128694, 128694, 128694, 128730, 128730, 128730, 129989, 129989, 130085, 130085
	};
	
	void run() throws Exception
	{
		is = INPUT.isEmpty() ? System.in : new ByteArrayInputStream(INPUT.getBytes());
		out = new PrintWriter(System.out);
		
		long s = System.currentTimeMillis();
		solve();
		out.flush();
		if(!INPUT.isEmpty())tr(System.currentTimeMillis()-s+"ms");
//		Thread t = new Thread(null, null, "~", Runtime.getRuntime().maxMemory()){
//			@Override
//			public void run() {
//				long s = System.currentTimeMillis();
//				solve();
//				out.flush();
//				if(!INPUT.isEmpty())tr(System.currentTimeMillis()-s+"ms");
//			}
//		};
//		t.start();
//		t.join();
	}
	
	public static void main(String[] args) throws Exception { new D3().run(); }
	
	private byte[] inbuf = new byte[1024];
	public int lenbuf = 0, ptrbuf = 0;
	
	private int readByte()
	{
		if(lenbuf == -1)throw new InputMismatchException();
		if(ptrbuf >= lenbuf){
			ptrbuf = 0;
			try { lenbuf = is.read(inbuf); } catch (IOException e) { throw new InputMismatchException(); }
			if(lenbuf <= 0)return -1;
		}
		return inbuf[ptrbuf++];
	}
	
	private boolean isSpaceChar(int c) { return !(c >= 33 && c <= 126); }
	private int skip() { int b; while((b = readByte()) != -1 && isSpaceChar(b)); return b; }
	
	private double nd() { return Double.parseDouble(ns()); }
	private char nc() { return (char)skip(); }
	
	private String ns()
	{
		int b = skip();
		StringBuilder sb = new StringBuilder();
		while(!(isSpaceChar(b))){ // when nextLine, (isSpaceChar(b) && b != ' ')
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}
	
	private char[] ns(int n)
	{
		char[] buf = new char[n];
		int b = skip(), p = 0;
		while(p < n && !(isSpaceChar(b))){
			buf[p++] = (char)b;
			b = readByte();
		}
		return n == p ? buf : Arrays.copyOf(buf, p);
	}
	
	private int[] na(int n)
	{
		int[] a = new int[n];
		for(int i = 0;i < n;i++)a[i] = ni();
		return a;
	}
	
	private long[] nal(int n)
	{
		long[] a = new long[n];
		for(int i = 0;i < n;i++)a[i] = nl();
		return a;
	}
	
	private char[][] nm(int n, int m) {
		char[][] map = new char[n][];
		for(int i = 0;i < n;i++)map[i] = ns(m);
		return map;
	}
	
	private int[][] nmi(int n, int m) {
		int[][] map = new int[n][];
		for(int i = 0;i < n;i++)map[i] = na(m);
		return map;
	}
	
	private int ni() { return (int)nl(); }
	
	private long nl()
	{
		long num = 0;
		int b;
		boolean minus = false;
		while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
		if(b == '-'){
			minus = true;
			b = readByte();
		}
		
		while(true){
			if(b >= '0' && b <= '9'){
				num = num * 10 + (b - '0');
			}else{
				return minus ? -num : num;
			}
			b = readByte();
		}
	}
	
	private static void tr(Object... o) { System.out.println(Arrays.deepToString(o)); }
}
0