結果

問題 No.375 立方体のN等分 (1)
ユーザー Yut176
提出日時 2016-06-04 23:14:39
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 370 bytes
コンパイル時間 648 ms
コンパイル使用メモリ 63,524 KB
実行使用メモリ 9,892 KB
最終ジャッジ日時 2024-10-08 09:29:34
合計ジャッジ時間 7,255 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 4 WA * 3 TLE * 1 -- * 24
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <stdio.h>
#include <math.h>
#include <vector>
#include <algorithm>
using namespace std;

int main(){
	long long int n;
	cin >> n;
	long long int s=0,l=0;

	l=n-1;

	while(true){
		for(int i=2;i<=n;i++){
			if(n%i == 0){
				n = n/i;
				// s++;
				s += i-1;
				break;
			}
		}
		if(n==1) break;
	}
	// s++;

	cout << s <<" "<< l<<endl;


}
0