結果
| 問題 | No.537 ユーザーID | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2017-11-19 16:35:52 | 
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 14 ms / 2,000 ms | 
| コード長 | 435 bytes | 
| コンパイル時間 | 980 ms | 
| コンパイル使用メモリ | 69,696 KB | 
| 実行使用メモリ | 5,248 KB | 
| 最終ジャッジ日時 | 2024-11-25 22:56:21 | 
| 合計ジャッジ時間 | 2,147 ms | 
| ジャッジサーバーID (参考情報) | judge3 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 32 | 
コンパイルメッセージ
main.cpp: In function ‘int main(int, char**)’:
main.cpp:18:38: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘UL’ {aka ‘long long unsigned int’} [-Wformat=]
   18 |                         sprintf(d,"%lu%lu",y,i);
      |                                    ~~^     ~
      |                                      |     |
      |                                      |     UL {aka long long unsigned int}
      |                                      long unsigned int
      |                                    %llu
main.cpp:18:41: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘UL’ {aka ‘long long unsigned int’} [-Wformat=]
   18 |                         sprintf(d,"%lu%lu",y,i);
      |                                       ~~^    ~
      |                                         |    |
      |                                         |    UL {aka long long unsigned int}
      |                                         long unsigned int
      |                                       %llu
main.cpp:20:38: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘UL’ {aka ‘long long unsigned int’} [-Wformat=]
   20 |                         sprintf(d,"%lu%lu",i,y);
      |                                    ~~^     ~
      |                                      |     |
      |                                      |     UL {aka long long unsigned int}
      |                                      long unsigned int
      |                                    %llu
main.cpp:20:41: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘UL’ {aka ‘long long unsigned int’} [-Wformat=]
   20 |                         sprintf(d,"%lu%lu",i,y);
      |                                       ~~^    ~
      |                                         |    |
      |    
            
            ソースコード
#include <iostream>
#include <string>
#include <set>
#include <math.h>
using namespace std;
typedef unsigned long long UL;
int main(int argc, char* argv[])
{
	UL N;
	cin>>N;
	char d[100];
	set<string> nSet;
	UL n=(UL)sqrt((double)N);
	for (UL i=1;i<=n;i++){
		UL x=N%i;
		if (x==0){
			UL y=N/i;
			sprintf(d,"%lu%lu",y,i);
			nSet.insert(d);
			sprintf(d,"%lu%lu",i,y);
			nSet.insert(d);
		}
	}
	cout<<nSet.size()<<endl;
	return 0;
}
            
            
            
        