結果
| 問題 |
No.537 ユーザーID
|
| コンテスト | |
| ユーザー |
data9824
|
| 提出日時 | 2017-07-02 15:13:30 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 487 bytes |
| コンパイル時間 | 669 ms |
| コンパイル使用メモリ | 61,016 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-10-05 07:39:09 |
| 合計ジャッジ時間 | 1,948 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 25 WA * 7 |
コンパイルメッセージ
In file included from /usr/include/c++/11/backward/strstream:50,
from main.cpp:4:
/usr/include/c++/11/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header which may be removed without further notice at a future date. Please use a non-deprecated interface with equivalent functionality instead. For a listing of replacement headers and interfaces, consult the file backward_warning.h. To disable this warning use -Wno-deprecated. [-Wcpp]
32 | #warning \
| ^~~~~~~
ソースコード
#include <iostream>
#include <cmath>
#include <cstring>
#include <strstream>
using namespace std;
int main() {
long long result = 0;
long long n;
cin >> n;
long long sqrn = (long long)sqrt(n);
for (long long i = 1; i <= sqrn; ++i) {
if (n % i == 0) {
long long k = n / i;
ostrstream str1, str2;
str1 << i << k;
str2 << k << i;
if (strcmp(str1.str(), str2.str()) == 0) {
++result;
} else {
result += 2;
}
}
}
cout << result << endl;
return 0;
}
data9824