結果
問題 | No.702 中央値を求めよ LIMITED |
ユーザー |
![]() |
提出日時 | 2018-06-15 22:43:52 |
言語 | C++11 (gcc 13.3.0) |
結果 |
CE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 518 bytes |
コンパイル時間 | 578 ms |
コンパイル使用メモリ | 53,532 KB |
最終ジャッジ日時 | 2025-01-01 22:46:54 |
合計ジャッジ時間 | 968 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
コンパイルメッセージ
main.cpp:6:1: error: ‘uint32_t’ does not name a type 6 | uint32_t x = 0, y = 1, z = 2, w = 3; | ^~~~~~~~ main.cpp:3:1: note: ‘uint32_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’? 2 | #include <algorithm> +++ |+#include <cstdint> 3 | main.cpp:7:1: error: ‘uint32_t’ does not name a type 7 | uint32_t generate() { | ^~~~~~~~ main.cpp:7:1: note: ‘uint32_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’? main.cpp:16:1: error: ‘uint32_t’ does not name a type 16 | uint32_t a[7000001]; | ^~~~~~~~ main.cpp:16:1: note: ‘uint32_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’? main.cpp:18:1: warning: ISO C++ forbids declaration of ‘main’ with no type [-Wreturn-type] 18 | main(){ | ^~~~ main.cpp: In function ‘int main()’: main.cpp:19:16: error: ‘x’ was not declared in this scope 19 | cin >> x; | ^ main.cpp:21:17: error: ‘a’ was not declared in this scope 21 | a[i]=generate(); | ^ main.cpp:21:30: error: no matching function for call to ‘generate()’ 21 | a[i]=generate(); | ~~~~~~~~^~ In file included from /usr/include/c++/13/algorithm:61, from main.cpp:2: /usr/include/c++/13/bits/stl_algo.h:4434:5: note: candidate: ‘template<class _FIter, class _Generator> void std::generate(_FIter, _FIter, _Generator)’ 4434 | generate(_ForwardIterator __first, _ForwardIterator __last, | ^~~~~~~~ /usr/include/c++/13/bits/stl_algo.h:4434:5: note: template argument deduction/substitution failed: main.cpp:21:30: note: candidate expects 3 arguments, 0 provided 21 | a[i]=generate(); | ~~~~~~~~^~ main.cpp:23:14: error: ‘a’ was not declared in this scope 23 | sort(a,a+7000000); |
ソースコード
#include <iostream>#include <algorithm>using namespace std;uint32_t x = 0, y = 1, z = 2, w = 3;uint32_t generate() {uint32_t t = (x^(x<<11));x = y;y = z;z = w;w = (w ^ (w >> 19)) ^ (t ^ (t >> 8));return w;}uint32_t a[7000001];main(){cin >> x;for(int i=0;i<7000000;++i){a[i]=generate();}sort(a,a+7000000);for(int i=0;i<2000000;++i){a[i]=generate();}for(int i=5000000;i<6000001;++i){a[i]=generate();}sort(a,a+6000001);cout << a[3000000] << endl;}