結果

問題 No.537 ユーザーID
ユーザー myanta
提出日時 2017-06-30 22:37:21
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 13 ms / 2,000 ms
コード長 434 bytes
コンパイル時間 517 ms
コンパイル使用メモリ 49,280 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-10-04 20:30:48
合計ジャッジ時間 1,450 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 32
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:29:26: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘std::set<std::vector<char> >::size_type’ {aka ‘long unsigned int’} [-Wformat=]
   29 |                 printf("%d\n", m.size());
      |                         ~^     ~~~~~~~~
      |                          |           |
      |                          int         std::set<std::vector<char> >::size_type {aka long unsigned int}
      |                         %ld

ソースコード

diff #

#include<cstdio>
#include<vector>
#include<set>


using namespace std;
using ll=long long;


int main(void)
{
	ll n;

	while(scanf("%lld", &n)==1)
	{
		set<vector<char>> m;
		vector<char> s(30);

		for(ll i=1;i*i<=n;i++)
		{
			if(n%i) continue;
			ll j=n/i;
			s.assign(30, 0);
			sprintf(&s[0], "%lld%lld", i, j);
			m.insert(s);
			sprintf(&s[0], "%lld%lld", j, i);
			m.insert(s);
		}
		printf("%d\n", m.size());
	}

	return 0;
}
0