結果

問題 No.1795 AtCoder Heuristic Rating coloring
ユーザー tailstails
提出日時 2021-12-24 11:23:17
言語 C++11
(gcc 11.4.0)
結果
RE  
(最新)
AC  
(最初)
実行時間 -
コード長 672 bytes
コンパイル時間 1,472 ms
コンパイル使用メモリ 50,816 KB
実行使用メモリ 15,344 KB
最終ジャッジ日時 2023-10-20 07:53:10
合計ジャッジ時間 5,738 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 2 ms
4,348 KB
testcase_06 AC 2 ms
4,348 KB
testcase_07 AC 2 ms
4,348 KB
testcase_08 AC 2 ms
4,348 KB
testcase_09 AC 3 ms
4,348 KB
testcase_10 AC 3 ms
4,348 KB
testcase_11 AC 2 ms
4,348 KB
testcase_12 AC 1 ms
4,348 KB
testcase_13 AC 2 ms
4,348 KB
testcase_14 AC 1 ms
4,348 KB
testcase_15 AC 1 ms
4,348 KB
testcase_16 AC 2 ms
4,348 KB
testcase_17 AC 1 ms
4,348 KB
testcase_18 AC 1 ms
4,348 KB
testcase_19 AC 2 ms
4,348 KB
testcase_20 AC 2 ms
4,348 KB
testcase_21 AC 1 ms
4,348 KB
testcase_22 AC 1 ms
4,348 KB
testcase_23 AC 2 ms
4,348 KB
testcase_24 AC 1 ms
4,348 KB
testcase_25 AC 2 ms
4,348 KB
testcase_26 AC 2 ms
4,348 KB
testcase_27 AC 2 ms
4,348 KB
testcase_28 AC 1 ms
4,348 KB
testcase_29 AC 1 ms
4,348 KB
testcase_30 AC 2 ms
4,348 KB
testcase_31 AC 2 ms
4,348 KB
testcase_32 AC 22 ms
6,856 KB
testcase_33 AC 16 ms
5,892 KB
testcase_34 AC 34 ms
10,496 KB
testcase_35 AC 30 ms
7,800 KB
testcase_36 AC 36 ms
10,736 KB
testcase_37 AC 19 ms
6,228 KB
testcase_38 AC 17 ms
6,328 KB
testcase_39 AC 43 ms
10,928 KB
testcase_40 AC 25 ms
7,240 KB
testcase_41 AC 38 ms
10,548 KB
testcase_42 AC 21 ms
6,816 KB
testcase_43 AC 24 ms
7,288 KB
testcase_44 AC 36 ms
10,316 KB
testcase_45 AC 22 ms
6,860 KB
testcase_46 AC 43 ms
11,200 KB
testcase_47 AC 10 ms
4,620 KB
testcase_48 AC 21 ms
7,008 KB
testcase_49 AC 43 ms
11,364 KB
testcase_50 AC 23 ms
6,428 KB
testcase_51 AC 21 ms
6,124 KB
testcase_52 AC 52 ms
12,620 KB
testcase_53 AC 52 ms
12,604 KB
testcase_54 AC 72 ms
15,344 KB
testcase_55 AC 72 ms
15,344 KB
testcase_56 AC 73 ms
15,344 KB
testcase_57 RE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:41:22: warning: ignoring return value of ‘ssize_t write(int, const void*, size_t)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   41 |                 write(1,wbuf,wp-wbuf);
      |                 ~~~~~^~~~~~~~~~~~~~~~

ソースコード

diff #

#pragma GCC optimize("Ofast")
#pragma GCC target("avx2")

#include <sys/mman.h>
#include <stdint.h>
#include <unistd.h>
#include <map>
using namespace std;

char wbuf[1<<25];

using keyt=unsigned __int128;

int main(){
	map<keyt,char const*> h;
	{
		char const*rp=static_cast<char const*>(mmap(0,1<<25,1,2,0,0));
		while(*rp++!=10);
		while(*rp){
			int d=16;
			keyt k=0;
			char const*p=rp;
			long c;
			while(c=*p++,c!=32){
				k|=keyt(c)<<(--d<<3);
			}
			while(c=*p++,c!=10){
			}
			h[k]=rp;
			rp=p;
		}
	}
	{
		char*wp=wbuf;
		for(auto&&t:h){
			char const*p=t.second;
			long c;
			while(c=*p++,*wp++=c,c!=10){
			}
		}
		write(1,wbuf,wp-wbuf);
	}
	_exit(0);
}
0