結果

問題 No.2551 2, 3, 5, 7 Game
ユーザー heno239heno239
提出日時 2024-02-06 18:12:40
言語 C#
(.NET 8.0.203)
結果
AC  
実行時間 453 ms / 2,357 ms
コード長 2,410 bytes
コンパイル時間 7,144 ms
コンパイル使用メモリ 157,596 KB
実行使用メモリ 185,904 KB
最終ジャッジ日時 2024-02-06 18:12:51
合計ジャッジ時間 11,205 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 58 ms
31,652 KB
testcase_01 AC 57 ms
31,652 KB
testcase_02 AC 56 ms
31,652 KB
testcase_03 AC 57 ms
31,652 KB
testcase_04 AC 58 ms
31,652 KB
testcase_05 AC 453 ms
40,612 KB
testcase_06 AC 439 ms
40,612 KB
testcase_07 AC 437 ms
40,612 KB
testcase_08 AC 431 ms
40,612 KB
testcase_09 AC 417 ms
185,904 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (97 ms)。
MSBuild のバージョン 17.7.3+8ec440e68 (.NET)
/home/judge/data/code/Main.cs(26,13): warning CS0162: 到達できないコードが検出されました [/home/judge/data/code/main.csproj]
  main -> /home/judge/data/code/bin/Release/net7.0/main.dll
  main -> /home/judge/data/code/bin/Release/net7.0/publish/

ソースコード

diff #

using System.Collections;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

internal class Program
{
    private const long mod = 998244353;
    private const long mod17 = 1000000007;
    private const long INF = mod17 * mod17;
    
    public static void Main(string[] args)
    {
        List<long> cs = new List<long>() { 2, 3, 5, 7 };

        bool query(long x)
        {
            long t = 1;
            while (true)
            {
                if (x < t) return true;
                if (t <= x && x < 2 * t) return false;
                t *= 14;
            }

            return true;
        }

        int t = int.Parse(Console.ReadLine());
        for (int i = 0; i < t; i++)
        {
            long n = long.Parse(Console.ReadLine());
            if (query(n-1))
            {
                Console.WriteLine("sepa");
            }
            else
            {
                Console.WriteLine("ryota");
            }
        }
        /*const int mn = 400;
        var iswin = mkar<bool>(mn, false);
        iswin[0] = true;
        for (int i = 1; i < mn; i++)
        {
            foreach (var c in cs)
            {
                if (!iswin[i / (int)c]) iswin[i] = true;
            }
            Console.WriteLine("{0},{1}",i,iswin[i]);
        }*/

        /*List<long> cs = new List<long>() { 2, 3, 5, 7 };
        var nex = new SortedSet<long>();
        List<long> ts = new List<long>();
        nex.Add(1);
        while (nex.Count > 0)
        {
            long val = nex.Min();
            nex.Remove(val);
            if (val > (long)20000000000000000) continue;
            ts.Add(val);
            foreach (var c in cs)
            {
                nex.Add(val * c);
            }
        }

        var iswin = mkar<bool>(ts.Count,false);
        for (int i = 0; i < ts.Count; i++)
        {

        }*/
    }
    public class lower_bound<T> : IComparer<T> where T : IComparable<T>
    {
        public int Compare(T x, T y)
        {
            return 0 <= x.CompareTo(y) ? 1 : -1;
        }
    }
    public static List<T> mkar<T>(int n, T val)
    {
        List<T> res = new List<T>(n);
        for(int i=0;i<n;i++)res.Add(val);
        return res;
    }

    public static int[] getar()
    {
        var res = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
        return res;
    }
}
0