結果

問題 No.375 立方体のN等分 (1)
ユーザー kotamanegikotamanegi
提出日時 2016-06-05 00:09:50
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,060 bytes
コンパイル時間 877 ms
コンパイル使用メモリ 89,880 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-17 03:22:34
合計ジャッジ時間 1,906 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,812 KB
testcase_01 AC 2 ms
6,940 KB
testcase_02 WA -
testcase_03 AC 2 ms
6,944 KB
testcase_04 AC 1 ms
6,940 KB
testcase_05 AC 1 ms
6,944 KB
testcase_06 AC 2 ms
6,944 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 3 ms
6,940 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 4 ms
6,940 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 5 ms
6,948 KB
testcase_21 AC 5 ms
6,940 KB
testcase_22 WA -
testcase_23 AC 5 ms
6,940 KB
testcase_24 AC 5 ms
6,944 KB
testcase_25 AC 5 ms
6,940 KB
testcase_26 AC 6 ms
6,944 KB
testcase_27 WA -
testcase_28 AC 5 ms
6,944 KB
testcase_29 AC 5 ms
6,944 KB
testcase_30 AC 5 ms
6,944 KB
testcase_31 AC 6 ms
6,940 KB
testcase_32 AC 5 ms
6,940 KB
testcase_33 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:26: warning: "M_PI" redefined
   26 | #define M_PI 3.14159265359
      | 
In file included from /usr/include/c++/11/cmath:45,
                 from /usr/include/c++/11/math.h:36,
                 from main.cpp:9:
/usr/include/math.h:1151: note: this is the location of the previous definition
 1151 | # define M_PI           3.14159265358979323846  /* pi */
      | 

ソースコード

diff #

#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <math.h>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <math.h>
#include <iostream> 
#include<map>
#include <stdlib.h>
#include <list>
#include <typeinfo>
#include <list>
#include <set>
#include <iomanip>
using namespace std;
#define MAX_MOD 1000000007
#define REP(i,n) for(int i = 0;i < n;++i)
#define M_PI 3.14159265359
vector<long long> insuu;
int main() {
	long long n;
	cin >> n;
	long long T_max = 1;
	long long now_hoge = 2;
	long long copy_n = n;
	while (now_hoge <= sqrt(copy_n)) {
		if (n%now_hoge == 0) {
			n /= now_hoge;
			insuu.push_back(now_hoge);
		}
		else {
			now_hoge++;
		}
	}
	long long a[3] = {1,1,1};
	long long hogehoge = insuu.size();
	for (int i = 0;i < hogehoge;++i) {
		sort(a, a + 3);
		a[0] *= insuu[i];
		T_max *= insuu[i];
	}
	sort(a, a + 3);
	a[0] *= n;
	cout << a[0] + a[1] + a[2] - 3 << " " << T_max*n-1 << endl;
}
0