結果
問題 |
No.537 ユーザーID
|
ユーザー |
![]() |
提出日時 | 2017-07-01 00:11:37 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,001 bytes |
コンパイル時間 | 706 ms |
コンパイル使用メモリ | 70,504 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-04 22:05:50 |
合計ジャッジ時間 | 2,054 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 28 WA * 4 |
ソースコード
#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; 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); all++; } }else{ if(judge(s1+s2)){ vec.push_back(s1+s2); all++; } if(judge(s2+s1)){ vec.push_back(s2+s1); all++; } } } } cout << all << endl; return 0; }