結果

問題 No.747 循環小数N桁目 Hard
ユーザー どららどらら
提出日時 2018-10-20 02:31:56
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 739 bytes
コンパイル時間 1,646 ms
コンパイル使用メモリ 164,712 KB
実行使用メモリ 4,580 KB
最終ジャッジ日時 2023-08-12 04:40:59
合計ジャッジ時間 6,627 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 WA -
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 WA -
testcase_06 AC 1 ms
4,380 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 AC 1 ms
4,380 KB
testcase_09 WA -
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 1 ms
4,376 KB
testcase_12 AC 1 ms
4,380 KB
testcase_13 AC 2 ms
4,384 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 1 ms
4,380 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 2 ms
4,376 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 1 ms
4,376 KB
testcase_24 AC 1 ms
4,376 KB
testcase_25 WA -
testcase_26 AC 1 ms
4,380 KB
testcase_27 AC 2 ms
4,376 KB
testcase_28 AC 2 ms
4,376 KB
testcase_29 AC 1 ms
4,376 KB
testcase_30 AC 2 ms
4,376 KB
testcase_31 AC 1 ms
4,380 KB
testcase_32 WA -
testcase_33 AC 4 ms
4,380 KB
testcase_34 AC 3 ms
4,376 KB
testcase_35 AC 3 ms
4,380 KB
testcase_36 AC 3 ms
4,380 KB
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 AC 4 ms
4,376 KB
testcase_41 AC 5 ms
4,376 KB
testcase_42 AC 4 ms
4,380 KB
testcase_43 WA -
testcase_44 AC 3 ms
4,376 KB
testcase_45 AC 4 ms
4,376 KB
testcase_46 WA -
testcase_47 AC 3 ms
4,380 KB
testcase_48 AC 3 ms
4,380 KB
testcase_49 AC 3 ms
4,380 KB
testcase_50 AC 2 ms
4,380 KB
testcase_51 WA -
testcase_52 WA -
testcase_53 WA -
testcase_54 AC 5 ms
4,376 KB
testcase_55 WA -
testcase_56 WA -
testcase_57 WA -
testcase_58 AC 6 ms
4,376 KB
testcase_59 AC 3 ms
4,380 KB
testcase_60 AC 5 ms
4,380 KB
testcase_61 AC 4 ms
4,380 KB
testcase_62 AC 4 ms
4,376 KB
testcase_63 AC 4 ms
4,376 KB
testcase_64 WA -
testcase_65 WA -
testcase_66 WA -
testcase_67 WA -
testcase_68 WA -
testcase_69 AC 4 ms
4,376 KB
testcase_70 AC 3 ms
4,384 KB
testcase_71 AC 2 ms
4,380 KB
testcase_72 WA -
testcase_73 WA -
testcase_74 AC 4 ms
4,376 KB
testcase_75 WA -
testcase_76 WA -
testcase_77 AC 3 ms
4,380 KB
testcase_78 WA -
testcase_79 AC 3 ms
4,380 KB
testcase_80 AC 4 ms
4,380 KB
testcase_81 AC 2 ms
4,380 KB
testcase_82 WA -
testcase_83 AC 3 ms
4,380 KB
testcase_84 WA -
testcase_85 WA -
testcase_86 WA -
testcase_87 WA -
testcase_88 AC 3 ms
4,380 KB
testcase_89 AC 3 ms
4,380 KB
testcase_90 WA -
testcase_91 AC 4 ms
4,380 KB
testcase_92 AC 3 ms
4,380 KB
testcase_93 AC 4 ms
4,376 KB
testcase_94 AC 5 ms
4,376 KB
testcase_95 AC 5 ms
4,380 KB
testcase_96 AC 4 ms
4,380 KB
testcase_97 AC 5 ms
4,376 KB
testcase_98 AC 6 ms
4,380 KB
testcase_99 WA -
testcase_100 AC 5 ms
4,376 KB
testcase_101 WA -
testcase_102 AC 3 ms
4,376 KB
testcase_103 AC 5 ms
4,380 KB
testcase_104 AC 5 ms
4,376 KB
testcase_105 WA -
testcase_106 AC 5 ms
4,384 KB
testcase_107 AC 5 ms
4,380 KB
testcase_108 AC 5 ms
4,376 KB
testcase_109 WA -
testcase_110 AC 5 ms
4,380 KB
testcase_111 AC 5 ms
4,376 KB
testcase_112 AC 5 ms
4,380 KB
testcase_113 WA -
testcase_114 WA -
testcase_115 WA -
testcase_116 WA -
testcase_117 AC 5 ms
4,380 KB
testcase_118 AC 5 ms
4,376 KB
testcase_119 AC 4 ms
4,376 KB
testcase_120 WA -
testcase_121 AC 4 ms
4,380 KB
testcase_122 AC 4 ms
4,380 KB
testcase_123 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define REP(i,a,n) for(int i=(a); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define FOR(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it)
#define ALLOF(c) (c).begin(), (c).end()
typedef long long ll;
typedef unsigned long long ull;

int calc_mod(const string& str, int mod){
  int ret = 0;
  int now = 0;
  rep(i,str.size()){
    now = now * 10 + (str[i]-'0');
    if(now>=mod){
      now = now%mod;
    }
  }
  return now;
}



int main(){
  string N, K;
  cin >> N;
  cin >> K;

  int x = calc_mod(N, 6);
  int y = calc_mod(K, 2);
  int ret = 1;
  rep(i,y){
    ret *= x;
    ret %= 6;
  }

  string str = "285714";

  cout << str[(ret+5)%6] << endl;
  
  return 0;
}

0