結果

問題 No.746 7の倍数
ユーザー uw_yu1rabbituw_yu1rabbit
提出日時 2020-09-07 20:59:21
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 805 bytes
コンパイル時間 1,167 ms
コンパイル使用メモリ 75,688 KB
実行使用メモリ 4,508 KB
最終ジャッジ日時 2023-08-19 17:09:26
合計ジャッジ時間 4,103 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,384 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include<iostream>
#include<cstdint>
#include<cstddef>
using namespace std;
using i32 = int_fast32_t;
using i64 = int_fast64_t;
using usize = uint_fast64_t;
#define rep(i, n) for (usize i = 0; i < (usize)(n); i++)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
using P = pair<i64,i64>;

int main(){
ios::sync_with_stdio(false);
std::cin.tie(nullptr);
string s = "142857";
i64 n;
cin >> n;
if(n <= 6){
    if(n == 0){
        cout << 0 << endl;
        return 0;
    }
    cout << "0." << s.substr(0,n) << endl;
}else{
    i64 p = n % 6;
    i64 q = n / 6;
    string ans;
    rep(i,q){
        ans = ans + s;
    }
    if(p != 0)ans = ans + s.substr(0,p);
    cout << ans << endl;
}
}
0