結果

問題 No.537 ユーザーID
ユーザー RIGIHRIGIH
提出日時 2017-07-01 01:08:28
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,502 bytes
コンパイル時間 553 ms
コンパイル使用メモリ 63,920 KB
実行使用メモリ 42,752 KB
最終ジャッジ日時 2024-04-15 07:45:38
合計ジャッジ時間 2,622 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

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[10000000];
	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