結果

問題 No.746 7の倍数
ユーザー Esire
提出日時 2018-11-01 22:27:06
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 5 ms / 2,000 ms
コード長 910 bytes
コンパイル時間 1,324 ms
コンパイル使用メモリ 72,652 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-20 06:43:12
合計ジャッジ時間 2,319 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

//g++ -std=c++11 -Wall -O2 -o main.exe main.cpp
//g++ -std=c++14 -Wall -O2 -o main.exe main.cpp
 
#include <cstdio>
#include <iostream>
#include <string>
#include <vector>
#include <functional>
#include <algorithm>
#include <complex>
#include <numeric>
//最大公約数: gcd()
//最小公倍数: lcm()

#define ll long long int

using namespace std;
 
template <typename T>
void sortasc(vector<T> &v){ //vectorを昇順にソート
    sort(v.begin(), v.end(), std::greater<int>());
    return;
}
 
template <typename T>
void sortdesc(vector<T> &v){ //vectorを降順にソート
    sort(v.begin(), v.end(), std::less<int>());
    return;
}
 
int main(){
    int n;
    string s = "142857";
    cin >> n;

    cout << "0";
    if(n == 0){
        cout << endl;
        return 0;
    }

    cout << ".";
    for(int i = 1; i <= n; i++){
        cout << s[(i - 1) % 6];
    }

    cout << endl;
    return 0;
}
0