結果

問題 No.677 10^Nの約数
ユーザー mmn15277198mmn15277198
提出日時 2020-07-04 22:47:46
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 772 bytes
コンパイル時間 1,440 ms
コンパイル使用メモリ 89,152 KB
実行使用メモリ 139,528 KB
最終ジャッジ日時 2023-10-19 18:17:31
合計ジャッジ時間 6,124 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 2 ms
4,348 KB
testcase_06 AC 2 ms
4,348 KB
testcase_07 AC 4 ms
4,348 KB
testcase_08 AC 13 ms
4,348 KB
testcase_09 AC 48 ms
5,428 KB
testcase_10 AC 189 ms
12,136 KB
testcase_11 AC 772 ms
36,708 KB
testcase_12 TLE -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <vector>
#include <iostream>
#include <algorithm>
#include <functional>
#include <string>
#include <math.h>
#include <map>
using namespace std;

int main(){
	int n;
	cin >> n;
	
	vector<int> a(2*n,0);
	for(int i=0;i<2*n;i++){
		if(i<n){
			a[i]=2;
		}else{
			a[i]=5;
		}
	}
	
	vector<unsigned long long> output;
	for(int i=0;i<(1<<2*n);i++){
		vector<int> b(2*n,0);
		for(int j=0;j<2*n;j++){
			if(i&(1<<j)){
				b[j]=1;
			}else{
				b[j]=0;
			}
		}
		unsigned long long ans=1;
		for(int j=0;j<2*n;j++){
			if(b[j]==0)continue;
			ans*=b[j]*a[j];
		}
		output.push_back(ans);
	}
	sort(output.begin(),output.end());
	output.erase(unique(output.begin(),output.end()),output.end());
	for(int i=0;i<output.size();i++){
		cout << output[i] << endl;
	}
	return 0;
}
0