結果

問題 No.537 ユーザーID
ユーザー RonlynesRonlynes
提出日時 2017-06-30 23:07:42
言語 C++11
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 1,089 bytes
コンパイル時間 852 ms
コンパイル使用メモリ 70,380 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-04 21:13:28
合計ジャッジ時間 2,282 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 28 WA * 4
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <string>
#include <queue>
#include <cmath>
using namespace std;
vector<string> vec;
int all = 0;
bool judge(string s){
    for(int i=0;i<all;i++){
        if(vec[i] == s){
            return false;
        }
    }
    return true;
}
int main(void){
    long long n, cnt=0, betu=0, ans;
    cin >> n;
    for(int i=1;i<=sqrt(n);i++){
        if(n%i == 0){
            int j = n/i;
            string s1 = to_string(i);
            string s2 = to_string(j);
            if( (s1+s2) == (s2+s1) ){
                if(judge(s1+s2)){
                    vec.push_back(s1+s2);
                    // betu++;
                    all++;
                }
            }else{
                if(judge(s1+s2)){
                    vec.push_back(s1+s2);
                    // cnt++;
                    all++;
                }
                if(judge(s2+s1)){
                    vec.push_back(s2+s1);
                    // cnt++;
                    all++;
                }
            }
        }    
    }
    cout << all << endl;

    return 0;
}
0