結果

問題 No.537 ユーザーID
ユーザー kotamanegikotamanegi
提出日時 2017-06-30 22:28:55
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 975 bytes
コンパイル時間 643 ms
コンパイル使用メモリ 95,500 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-15 06:16:14
合計ジャッジ時間 1,882 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 12 ms
6,816 KB
testcase_01 WA -
testcase_02 AC 12 ms
6,940 KB
testcase_03 AC 13 ms
6,944 KB
testcase_04 AC 12 ms
6,940 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 12 ms
6,940 KB
testcase_10 AC 12 ms
6,940 KB
testcase_11 AC 13 ms
6,944 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 13 ms
6,940 KB
testcase_20 AC 21 ms
6,940 KB
testcase_21 WA -
testcase_22 AC 13 ms
6,944 KB
testcase_23 WA -
testcase_24 AC 13 ms
6,940 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 13 ms
6,940 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:47:31: warning: iteration 9999998 invokes undefined behavior [-Waggressive-loop-optimizations]
   47 |                 ans *= solve[i] + 1;
      |                        ~~~~~~~^
main.cpp:46:26: note: within this loop
   46 |         for (int i = 2;i <= 10000000;++i) {
      |                        ~~^~~~~~~~~~~

ソースコード

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 <random>
#include<map>
#include <iomanip>
#include <time.h>
#include <stdlib.h>
#include <list>
#include <typeinfo>
#include <list>
#include <set>
using namespace std;
#define eps 0.000000001
#define LONG_INF 10000000000000000
#define GOLD 1.61803398874989484820458
#define MAX_MOD 1000000007
#define REP(i,n) for(long long i = 0;i < n;++i)
long long solve[10000000] = {};
int main() {
	long long n;
	cin >> n;
	for (int i = 2;i <= sqrt(n);++i) {
		if (n % i == 0) {
			solve[i]++;
			n /= i;
		}
	}
	long long ans = 1;
	if (n <= 10000000) {
		solve[n]++;
	}
	else ans = 2;
	for (int i = 2;i <= 10000000;++i) {
		ans *= solve[i] + 1;
	}
	cout <<ans <<  endl;
	return 0;
}
0