結果

問題 No.537 ユーザーID
ユーザー data9824
提出日時 2017-07-02 15:13:30
言語 C++11
(gcc 4.8.5)
結果
WA   .
実行時間 -
コード長 487 Byte
コンパイル時間 273 ms
使用メモリ 1,736 KB
最終ジャッジ日時 2018-09-25 18:34:58

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
sample1.txt AC 2 ms
1,524 KB
sample2.txt AC 2 ms
1,524 KB
sample3.txt AC 2 ms
1,528 KB
small1.txt AC 2 ms
1,528 KB
small2.txt AC 2 ms
1,524 KB
small3.txt AC 2 ms
1,524 KB
small4.txt WA -
small5.txt WA -
small6.txt AC 2 ms
1,528 KB
small7.txt AC 2 ms
1,524 KB
small8.txt AC 2 ms
1,528 KB
small9.txt AC 2 ms
1,524 KB
small10.txt AC 2 ms
1,528 KB
small11.txt WA -
small12.txt WA -
small13.txt AC 2 ms
1,524 KB
small14.txt AC 2 ms
1,524 KB
small15.txt WA -
test1.txt AC 9 ms
1,528 KB
test2.txt AC 10 ms
1,524 KB
test3.txt AC 10 ms
1,524 KB
test4.txt AC 7 ms
1,528 KB
test5.txt AC 10 ms
1,532 KB
test6.txt AC 7 ms
1,536 KB
test7.txt AC 4 ms
1,524 KB
test8.txt AC 10 ms
1,536 KB
test9.txt AC 11 ms
1,536 KB
test10.txt AC 8 ms
1,532 KB
test11.txt AC 7 ms
1,652 KB
test12.txt AC 13 ms
1,736 KB
test13.txt AC 12 ms
1,720 KB
test14.txt WA -
test15.txt AC 5 ms
1,532 KB
test16.txt WA -
test17.txt AC 9 ms
1,540 KB
テストケース一括ダウンロード
コンパイルメッセージ
In file included from /usr/include/c++/4.8.2/backward/strstream:51:0,
                 from main.cpp:4:
/usr/include/c++/4.8.2/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]
 #warning \
  ^

ソースコード

diff #
#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;
}
0