結果

問題 No.747 循環小数N桁目 Hard
ユーザー greentea011greentea011
提出日時 2018-10-22 11:12:52
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 466 bytes
コンパイル時間 237 ms
コンパイル使用メモリ 31,104 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-29 20:29:56
合計ジャッジ時間 3,150 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 AC 1 ms
5,376 KB
testcase_03 AC 1 ms
5,376 KB
testcase_04 AC 1 ms
5,376 KB
testcase_05 AC 1 ms
5,376 KB
testcase_06 AC 1 ms
5,376 KB
testcase_07 WA -
testcase_08 AC 1 ms
5,376 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 1 ms
5,376 KB
testcase_15 AC 1 ms
5,376 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 1 ms
5,376 KB
testcase_22 AC 0 ms
5,376 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 1 ms
5,376 KB
testcase_29 AC 1 ms
5,376 KB
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 AC 1 ms
5,376 KB
testcase_34 WA -
testcase_35 AC 1 ms
5,376 KB
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 AC 1 ms
5,376 KB
testcase_41 WA -
testcase_42 AC 1 ms
5,376 KB
testcase_43 WA -
testcase_44 AC 1 ms
5,376 KB
testcase_45 WA -
testcase_46 WA -
testcase_47 WA -
testcase_48 AC 1 ms
5,376 KB
testcase_49 WA -
testcase_50 WA -
testcase_51 WA -
testcase_52 WA -
testcase_53 WA -
testcase_54 WA -
testcase_55 AC 1 ms
5,376 KB
testcase_56 AC 2 ms
5,376 KB
testcase_57 WA -
testcase_58 WA -
testcase_59 WA -
testcase_60 AC 2 ms
5,376 KB
testcase_61 WA -
testcase_62 WA -
testcase_63 AC 1 ms
5,376 KB
testcase_64 AC 1 ms
5,376 KB
testcase_65 WA -
testcase_66 WA -
testcase_67 WA -
testcase_68 WA -
testcase_69 AC 1 ms
5,376 KB
testcase_70 WA -
testcase_71 WA -
testcase_72 AC 1 ms
5,376 KB
testcase_73 AC 1 ms
5,376 KB
testcase_74 WA -
testcase_75 WA -
testcase_76 AC 1 ms
5,376 KB
testcase_77 AC 1 ms
5,376 KB
testcase_78 WA -
testcase_79 WA -
testcase_80 WA -
testcase_81 AC 1 ms
5,376 KB
testcase_82 AC 1 ms
5,376 KB
testcase_83 WA -
testcase_84 WA -
testcase_85 AC 1 ms
5,376 KB
testcase_86 WA -
testcase_87 WA -
testcase_88 WA -
testcase_89 AC 1 ms
5,376 KB
testcase_90 AC 1 ms
5,376 KB
testcase_91 WA -
testcase_92 AC 1 ms
5,376 KB
testcase_93 AC 1 ms
5,376 KB
testcase_94 WA -
testcase_95 AC 1 ms
5,376 KB
testcase_96 WA -
testcase_97 AC 2 ms
5,376 KB
testcase_98 WA -
testcase_99 AC 2 ms
5,376 KB
testcase_100 WA -
testcase_101 WA -
testcase_102 AC 1 ms
5,376 KB
testcase_103 AC 1 ms
5,376 KB
testcase_104 WA -
testcase_105 WA -
testcase_106 AC 2 ms
5,376 KB
testcase_107 AC 1 ms
5,376 KB
testcase_108 WA -
testcase_109 WA -
testcase_110 AC 1 ms
5,376 KB
testcase_111 AC 1 ms
5,376 KB
testcase_112 AC 1 ms
5,376 KB
testcase_113 WA -
testcase_114 WA -
testcase_115 WA -
testcase_116 AC 1 ms
5,376 KB
testcase_117 WA -
testcase_118 AC 1 ms
5,376 KB
testcase_119 AC 1 ms
5,376 KB
testcase_120 WA -
testcase_121 WA -
testcase_122 AC 1 ms
5,376 KB
testcase_123 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:9:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    9 |     scanf("%s", n);
      |     ~~~~~^~~~~~~~~
main.cpp:10:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   10 |     scanf("%s", k);
      |     ~~~~~^~~~~~~~~

ソースコード

diff #

#include <stdio.h>
#include <string.h>
#include <math.h>

int val[6] = {2, 8, 5, 7, 1, 4};

int main() {
    char n[100001], k[100001];
    scanf("%s", n);
    scanf("%s", k);

    long nn;
    if ((strlen(n)==1) || (n[strlen(n)-1]!='0')) {
        nn=n[strlen(n)-1]-'0';
    }
    else {
        nn=(n[strlen(n)-2]-'0')*10+(n[strlen(n)-1]-'0');
    }
    long nk=k[strlen(k)-1]-'0';

    long ans=pow(nn,nk);
    printf("%d\n",val[(int)(ans-1)%6]);
    return 0;
}
0