結果
問題 |
No.537 ユーザーID
|
ユーザー |
|
提出日時 | 2020-07-12 16:43:21 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 19 ms / 2,000 ms |
コード長 | 660 bytes |
コンパイル時間 | 1,211 ms |
コンパイル使用メモリ | 117,188 KB |
最終ジャッジ日時 | 2025-01-11 20:02:06 |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 32 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:32:14: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘std::set<std::__cxx11::basic_string<char> >::size_type’ {aka ‘long unsigned int’} [-Wformat=] 32 | printf("%d\n",s.size() ); | ~^ ~~~~~~~~ | | | | int std::set<std::__cxx11::basic_string<char> >::size_type {aka long unsigned int} | %ld
ソースコード
#include <iostream> #include <vector> #include <algorithm> #include <map> #include <queue> #include <cstdio> #include <ctime> #include <assert.h> #include <chrono> #include <random> #include <numeric> #include <set> using namespace std; typedef long long int ll; using ull = unsigned long long; int main(){ cin.tie(nullptr); ios::sync_with_stdio(false); set<string> s; ll n; cin >> n; for(ll i=1;i*i<=n;i++){ if(n%i==0){ ll j=n/i; string t=to_string(i)+to_string(j); s.insert(t); t=to_string(j)+to_string(i); s.insert(t); } } printf("%d\n",s.size() ); }