結果

問題 No.537 ユーザーID
ユーザー RIGIHRIGIH
提出日時 2017-07-01 01:08:09
言語 C++11
(gcc 11.4.0)
結果
MLE  
実行時間 -
コード長 1,505 bytes
コンパイル時間 678 ms
コンパイル使用メモリ 64,380 KB
実行使用メモリ 814,464 KB
最終ジャッジ日時 2024-04-15 07:45:34
合計ジャッジ時間 3,251 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 MLE -
testcase_01 -- -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <stdio.h>
#include <cstring>
#include <math.h>
#include <algorithm>
#define rep(i,n) for(int i=0;i<n;i++)
#define FOR(i,a,b) for(int i=a;i<b;i++)
using namespace std;

int main(){
	
	
	long long n;
	cin>>n;

	long long m=sqrt(double(n));
	long long c=0;
	int h[10000000000];
	int k1,k2;
	int x1,x2;

	FOR(i,1,m+1){
		if(n%i==0){
		if(c!=0){
			k1=int(log10(double(i)))+1;
			k2=int(log10(double(n/i)))+1;
			x1=i*pow(10,double(k2))+n/i;
			x2=n/i*pow(10,double(k1))+i;

			//cout<<k1<<endl<<k2<<endl<<x1<<endl<<x2<<endl;

			FOR(j,0,c){
				if(h[j]==x1){
					//cout<<"AAAAAA"<<endl;
					break;
				}
				if(j==c-1){
					//cout<<c<<"から";
					c=c+1;
					//cout<<c<<"に"<<i<<endl;
					h[c-1]=x1;
					//cout<<"h["<<c<<"]に"<<x1<<"="<<h[c-1]<<"が代入された"<<endl;
					break;
				}
			}
			FOR(j,0,c){
				if(h[j]==x2){
					//cout<<"CCCCCCC"<<endl;
					break;
				}
				if(j==c-1){
					//cout<<c<<"から";
					c=c+1;
					//cout<<c<<"に"<<i<<endl;
					h[c-1]=x2;
					break;
				}
			}
		}else{
			k1=int(log10(double(i)))+1;
			k2=int(log10(double(n/i)))+1;
			x1=i*pow(10,double(k2))+n/i;
			x2=n/i*pow(10,double(k1))+i;
			h[0]=x1;
			c=c+1;
			if(x1!=x2){
				h[1]=x2;
				c=2;
			}
		}


		}}
	cout<<c<<endl;

	

	/*int k1,k2,x1,x2;
	int i,n;
	cin>>n>>i;

			k1=int(log10(double(i)))+1;
			k2=int(log10(double(n/i)))+1;
			x1=i*pow(10,double(k2))+n/i;
			x2=n/i*pow(10,double(k1))+i;

			cout<<k1<<endl<<k2<<endl<<x1<<endl<<x2;
			*/

	return 0;


}
0