結果
問題 | No.889 素数! |
ユーザー | Kura |
提出日時 | 2019-09-25 22:44:01 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 26 ms / 2,000 ms |
コード長 | 4,535 bytes |
コンパイル時間 | 2,539 ms |
コンパイル使用メモリ | 114,240 KB |
実行使用メモリ | 25,836 KB |
最終ジャッジ日時 | 2024-09-22 18:35:23 |
合計ジャッジ時間 | 4,394 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 24 ms
23,780 KB |
testcase_01 | AC | 24 ms
23,668 KB |
testcase_02 | AC | 24 ms
23,648 KB |
testcase_03 | AC | 24 ms
25,744 KB |
testcase_04 | AC | 24 ms
21,560 KB |
testcase_05 | AC | 25 ms
23,688 KB |
testcase_06 | AC | 24 ms
23,400 KB |
testcase_07 | AC | 24 ms
23,660 KB |
testcase_08 | AC | 24 ms
23,916 KB |
testcase_09 | AC | 25 ms
23,728 KB |
testcase_10 | AC | 24 ms
23,532 KB |
testcase_11 | AC | 24 ms
25,692 KB |
testcase_12 | AC | 24 ms
21,812 KB |
testcase_13 | AC | 24 ms
25,836 KB |
testcase_14 | AC | 24 ms
23,788 KB |
testcase_15 | AC | 24 ms
23,572 KB |
testcase_16 | AC | 24 ms
23,532 KB |
testcase_17 | AC | 24 ms
23,916 KB |
testcase_18 | AC | 25 ms
23,528 KB |
testcase_19 | AC | 24 ms
23,596 KB |
testcase_20 | AC | 25 ms
25,828 KB |
testcase_21 | AC | 26 ms
23,728 KB |
testcase_22 | AC | 25 ms
25,568 KB |
testcase_23 | AC | 24 ms
23,600 KB |
testcase_24 | AC | 25 ms
25,824 KB |
testcase_25 | AC | 25 ms
25,732 KB |
testcase_26 | AC | 25 ms
25,484 KB |
testcase_27 | AC | 25 ms
23,532 KB |
testcase_28 | AC | 25 ms
25,696 KB |
testcase_29 | AC | 24 ms
23,596 KB |
testcase_30 | AC | 24 ms
23,908 KB |
testcase_31 | AC | 25 ms
23,564 KB |
testcase_32 | AC | 23 ms
21,684 KB |
testcase_33 | AC | 24 ms
23,524 KB |
testcase_34 | AC | 24 ms
23,980 KB |
testcase_35 | AC | 25 ms
23,732 KB |
testcase_36 | AC | 24 ms
25,580 KB |
testcase_37 | AC | 25 ms
25,488 KB |
testcase_38 | AC | 24 ms
23,728 KB |
testcase_39 | AC | 25 ms
25,484 KB |
testcase_40 | AC | 25 ms
23,912 KB |
testcase_41 | AC | 24 ms
23,916 KB |
testcase_42 | AC | 25 ms
25,604 KB |
testcase_43 | AC | 24 ms
23,664 KB |
testcase_44 | AC | 25 ms
23,852 KB |
testcase_45 | AC | 24 ms
23,656 KB |
testcase_46 | AC | 24 ms
23,944 KB |
testcase_47 | AC | 24 ms
23,648 KB |
testcase_48 | AC | 24 ms
23,732 KB |
testcase_49 | AC | 24 ms
23,528 KB |
testcase_50 | AC | 25 ms
23,948 KB |
testcase_51 | AC | 24 ms
23,660 KB |
testcase_52 | AC | 24 ms
23,528 KB |
testcase_53 | AC | 24 ms
23,656 KB |
testcase_54 | AC | 25 ms
23,724 KB |
testcase_55 | AC | 24 ms
23,660 KB |
testcase_56 | AC | 24 ms
23,916 KB |
testcase_57 | AC | 25 ms
23,400 KB |
testcase_58 | AC | 24 ms
23,652 KB |
testcase_59 | AC | 24 ms
23,788 KB |
testcase_60 | AC | 25 ms
23,656 KB |
testcase_61 | AC | 24 ms
23,920 KB |
testcase_62 | AC | 25 ms
25,704 KB |
testcase_63 | AC | 24 ms
23,792 KB |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System; using System.IO; class Start { static int Solve() { long n;Inl(out n); if (n == 0 || n == 1) { Outl(n); return 0; } bool b = true; for(int i = 2; i < n; i++) if (n % i == 0) { b = false; break; } if (b) { Outl("Sosu!"); return 0; } for (int i = 2; i * i <= n; i++) if (i * i == n) { Outl("Heihosu!"); return 0; } for(int i = 2; i * i * i <= n; i++) if (i * i * i == n) { Outl("Ripposu!"); return 0; } if (n == 6 || n == 28) Outl("Kanzensu!"); else Outl(n); return 0; } const long MOD = 1000000007; static void Main() { var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false }; Console.SetOut(sw); Solve(); Console.Out.Flush(); } static void Inl(out long t) { t = long.Parse(Console.ReadLine()); } static void Inl(out string t) { t = Console.ReadLine(); } static void Inl(out char t) { t = Console.ReadLine()[0]; } static void Inl(out double t) { t = double.Parse(Console.ReadLine()); } static void Inl<T>(ref T[] t) { string[] s = Console.ReadLine().Split(); Type type = typeof(T); int n = s.Length; if (type == LONG) for (int i = 0; i < n; i++) t[i] = (T)(object)long.Parse(s[i]); else if (type == STRING) for (int i = 0; i < n; i++) t[i] = (T)(object)s[i]; else if (type == CHAR) for (int i = 0; i < n; i++) t[i] = (T)(object)s[i][0]; else for (int i = 0; i < n; i++) t[i] = (T)(object)double.Parse(s[i]); } static void Inl<T, U>(out T t, out U u) { string[] s = Console.ReadLine().Split(); In(out t, ref s, 0); In(out u, ref s, 1); } static void Inl<T, U, V>(out T t, out U u, out V v) { string[] s = Console.ReadLine().Split(); In(out t, ref s, 0); In(out u, ref s, 1); In(out v, ref s, 2); } static void Inl<T, U, V, W>(out T t, out U u, out V v, out W w) { string[] s = Console.ReadLine().Split(); In(out t, ref s, 0); In(out u, ref s, 1); In(out v, ref s, 2); In(out w, ref s, 3); } static void Inl<T, U, V, W, X>(out T t, out U u, out V v, out W w, out X x) { string[] s = Console.ReadLine().Split(); In(out t, ref s, 0); In(out u, ref s, 1); In(out v, ref s, 2); In(out w, ref s, 3); In(out x, ref s, 4); } static void Inl<T, U, V, W, X, Y>(out T t, out U u, out V v, out W w, out X x, out Y y) { string[] s = Console.ReadLine().Split(); In(out t, ref s, 0); In(out u, ref s, 1); In(out v, ref s, 2); In(out w, ref s, 3); In(out x, ref s, 4); In(out y, ref s, 5); } static void Inl<T, U, V, W, X, Y, Z>(out T t, out U u, out V v, out W w, out X x, out Y y, out Z z) { string[] s = Console.ReadLine().Split(); In(out t, ref s, 0); In(out u, ref s, 1); In(out v, ref s, 2); In(out w, ref s, 3); In(out x, ref s, 4); In(out y, ref s, 5); In(out z, ref s, 6); } static void In<T>(out T t, ref string[] s, int i) { Type type = typeof(T); if (type == LONG) t = (T)(object)long.Parse(s[i]); else if (type == STRING) t = (T)(object)s[i]; else if (type == CHAR) t = (T)(object)s[i][0]; else t = (T)(object)double.Parse(s[i]); } static Type LONG = typeof(long); static Type STRING = typeof(string); static Type CHAR = typeof(char); static void Out<T>(T t) { Console.Write(t); } static void Outl<T>(T t) { Console.WriteLine(t); } static void Out(double d, int n) { string s = d.ToString("F" + n); Console.Write(s); } static void Outl(double d, int n) { string s = d.ToString("F" + n); Console.WriteLine(s); } static void Outl<T>(ref T[] t) { Out(t[0]); for (int i = 1; i < t.Length; i++) Out(" " + t[i]); Out('\n'); } static void Swap<T>(ref T a, ref T b) { T c = a; a = b; b = c; } static void Sort<T>(ref T[] t) { Array.Sort(t); } static T Max<T>(params T[] t) where T : IComparable { T max = t[0]; for (int i = 1; i < t.Length; i++) if (max.CompareTo(t[i]) < 0) max = t[i]; return max; } static T Min<T>(params T[] t) where T : IComparable { T max = t[0]; for (int i = 1; i < t.Length; i++) if (max.CompareTo(t[i]) > 0) max = t[i]; return max; } struct Pair { public long a, b; public Pair(long a, long b) { this.a = a; this.b = b; } } static void aSort(ref Pair[] a) { Array.Sort(a, (x, y) => (int)(x.a - y.a)); } static void bSort(ref Pair[] a) { Array.Sort(a, (x, y) => (int)(x.b - y.b)); } }