結果

問題 No.473 和と積の和
ユーザー tailstails
提出日時 2016-12-23 00:39:54
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 522 bytes
コンパイル時間 2,195 ms
コンパイル使用メモリ 177,412 KB
実行使用メモリ 107,520 KB
最終ジャッジ日時 2024-05-09 13:21:10
合計ジャッジ時間 6,805 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 TLE -
testcase_04 AC 2 ms
6,944 KB
testcase_05 AC 2 ms
6,940 KB
testcase_06 AC 2 ms
6,944 KB
testcase_07 AC 2 ms
6,944 KB
testcase_08 AC 2 ms
6,948 KB
testcase_09 AC 2 ms
6,944 KB
testcase_10 AC 2 ms
6,944 KB
testcase_11 AC 2 ms
6,944 KB
testcase_12 AC 2 ms
6,944 KB
testcase_13 AC 2 ms
6,944 KB
testcase_14 AC 3 ms
6,940 KB
testcase_15 AC 2 ms
6,944 KB
testcase_16 AC 2 ms
6,944 KB
testcase_17 AC 2 ms
6,948 KB
testcase_18 AC 2 ms
6,944 KB
testcase_19 AC 2 ms
6,948 KB
testcase_20 AC 2 ms
6,944 KB
testcase_21 AC 2 ms
6,944 KB
testcase_22 AC 2 ms
6,944 KB
testcase_23 AC 7 ms
6,944 KB
testcase_24 AC 16 ms
6,940 KB
testcase_25 TLE -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
testcase_42 -- -
testcase_43 -- -
testcase_44 -- -
testcase_45 -- -
testcase_46 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    4 | main(){
      | ^~~~

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

main(){
	int n,x;
	scanf("%d%d",&n,&x);
	set<multiset<int>> s1;
	set<multiset<int>> s2;
	{
		multiset<int> m;
		m.insert(x);
		s1.insert(m);
	}
	for(int i=1;i<n;++i){
		for(multiset<int> const& m:s1){
			for(int v:m){
				for(int j=2;j*j<=v+1;++j){
					if((v+1)%j==0){
						multiset<int> m2=m;
						m2.erase(m2.find(v));
						m2.insert(j-1);
						m2.insert((v+1)/j-1);
						s2.insert(m2);
					}
				}
			}
		}
		s1.swap(s2);s2.clear();
	}
	printf("%d\n",s1.size());
}
0