結果

問題 No.746 7の倍数
ユーザー ats5515ats5515
提出日時 2018-10-19 21:30:53
言語 C++11
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 543 bytes
コンパイル時間 724 ms
コンパイル使用メモリ 82,932 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-18 20:03:05
合計ジャッジ時間 1,311 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <string>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <stdio.h>
using namespace std;
#define int long long
int MOD = 1000000007;
signed main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int N;
	cin >> N;
	string res = "0.";
	if (N == 0) {
		cout << 0 << endl;
		return 0;
	}
	else {
		
		int t = 1;
		for (int i = 0; i < N; i++) {
			t *= 10;
			res.push_back((t / 7) + '0');
			t -= (t / 7)*7;
		}
	}
	cout << res << endl;
}
0