結果

問題 No.747 循環小数N桁目 Hard
ユーザー ngtkana
提出日時 2020-04-01 23:11:39
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 545 bytes
コンパイル時間 2,128 ms
コンパイル使用メモリ 193,372 KB
最終ジャッジ日時 2025-01-09 12:22:35
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 65 WA * 55
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using lint=long long;
using real=long double;
int main(){
    std::cin.tie(nullptr);std::ios_base::sync_with_stdio(false);
    std::cout.setf(std::ios_base::fixed);std::cout.precision(15);
    std::string s,t;std::cin>>s>>t;
    lint n=std::accumulate(
            s.begin(),s.end(),0ll,[](lint cum,char c){return cum+c-'0';}
        )%3
        +(s.back()-'0')%2*3;
    if((t.back()-'0')%2==0){
        if(n==2)n=4;
        if(n==5)n=1;
    }
    std::cout<<"428571"[n]<<'\n';
}
/*
 * 0
 * 1
 * 2 4
 * 3
 * 4
 * 5 1
 */
0