結果

問題 No.1058 素敵な数
コンテスト
ユーザー kotatsugame
提出日時 2020-05-22 21:29:23
言語 C++14
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=c++14 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 382 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 545 ms
コンパイル使用メモリ 91,096 KB
実行使用メモリ 6,400 KB
最終ジャッジ日時 2026-04-21 02:21:45
合計ジャッジ時間 1,855 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 9
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:7:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    7 | main()
      | ^~~~
main.cpp: In function 'int main()':
main.cpp:12:11: warning: ignoring return value of '_FIter std::unique(_FIter, _FIter) [with _FIter = __gnu_cxx::__normal_iterator<long int*, vector<long int> >]', declared with attribute 'nodiscard' [-Wunused-result]
   12 |     unique(A.begin(),A.end());
      |     ~~~~~~^~~~~~~~~~~~~~~~~~~
In file included from /home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/algorithm:63,
                 from main.cpp:2:
/home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/bits/stl_algo.h:875:5: note: declared here
  875 |     unique(_ForwardIterator __first, _ForwardIterator __last)
      |     ^~~~~~

ソースコード

diff #
raw source code

#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
long p[]={100003,100019,100043,100049,100057,100069,100103,100109,100129,100151};
vector<long>A;
main()
{
    A.push_back(1);
    for(int i=0;i<10;i++)for(int j=i;j<10;j++)A.push_back(p[i]*p[j]);
    sort(A.begin(),A.end());
    unique(A.begin(),A.end());
    int id;cin>>id;id--;
    cout<<A[id]<<endl;
}
0