結果
| 問題 |
No.537 ユーザーID
|
| コンテスト | |
| ユーザー |
forest3
|
| 提出日時 | 2020-04-08 10:18:55 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 14 ms / 2,000 ms |
| コード長 | 541 bytes |
| コンパイル時間 | 1,496 ms |
| コンパイル使用メモリ | 176,716 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-18 06:46:16 |
| 合計ジャッジ時間 | 2,546 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 32 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main()
{
long long N;
cin >> N;
long long ans = 0;
set<string> st;
for( long long x = 1; x * x <= N; x++ ) {
if( N % x ) continue;
char s1[16], s2[16];
sprintf( s1, "%lld", x );
sprintf( s2, "%lld", N / x );
if( st.find( string( s1 ) + string( s2 ) ) == st.end() ) {
ans++;
st.insert( string( s1 ) + string( s2 ) );
}
if( st.find( string( s2 ) + string( s1 ) ) == st.end() ) {
ans++;
st.insert( string( s2 ) + string( s1 ) );
}
}
cout << ans << endl;
}
forest3