結果
| 問題 | 
                            No.1532 Different Products
                             | 
                    
| コンテスト | |
| ユーザー | 
                             tails
                         | 
                    
| 提出日時 | 2021-06-04 21:54:25 | 
| 言語 | C++11(廃止可能性あり)  (gcc 13.3.0)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 1,301 ms / 4,000 ms | 
| コード長 | 337 bytes | 
| コンパイル時間 | 430 ms | 
| コンパイル使用メモリ | 49,280 KB | 
| 実行使用メモリ | 14,080 KB | 
| 最終ジャッジ日時 | 2024-11-19 14:03:39 | 
| 合計ジャッジ時間 | 40,841 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | AC * 62 | 
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:6:19: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    6 |         std::scanf("%ld",&n);
      |         ~~~~~~~~~~^~~~~~~~~~
main.cpp:7:19: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    7 |         std::scanf("%ld",&k);
      |         ~~~~~~~~~~^~~~~~~~~~
            
            ソースコード
#include <cstdio>
#include <map>
int main(){
	long n,k;
	std::scanf("%ld",&n);
	std::scanf("%ld",&k);
	std::map<long,long> h;
	h[k]=1;
	for(long i=n;i>=2;--i){
		std::map<long,long> d=h;
		for(auto v:h){
			long a=v.first/i;
			d[a]+=v.second;
		}
		h=d;
	}
	h[0]=0;
	long t=0;
	for(auto v:h){
		t+=v.second;
	}
	printf("%ld",t*2-1);
}
            
            
            
        
            
tails