結果
| 問題 |
No.92 逃走経路
|
| コンテスト | |
| ユーザー |
tails
|
| 提出日時 | 2020-10-26 19:54:27 |
| 言語 | C (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 5,000 ms |
| コード長 | 948 bytes |
| コンパイル時間 | 497 ms |
| コンパイル使用メモリ | 32,196 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-21 21:33:56 |
| 合計ジャッジ時間 | 1,078 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 18 |
コンパイルメッセージ
main.c:13:1: warning: return type defaults to 'int' [-Wimplicit-int]
13 | main(){
| ^~~~
main.c: In function 'main':
main.c:23:9: warning: implicit declaration of function 'memset' [-Wimplicit-function-declaration]
23 | memset(h1,1,1024);
| ^~~~~~
main.c:1:1: note: include '<string.h>' or provide a declaration of 'memset'
+++ |+#include <string.h>
1 | #pragma GCC optimize("Ofast")
main.c:23:9: warning: incompatible implicit declaration of built-in function 'memset' [-Wbuiltin-declaration-mismatch]
23 | memset(h1,1,1024);
| ^~~~~~
main.c:23:9: note: include '<string.h>' or provide a declaration of 'memset'
main.c:35:17: warning: implicit declaration of function 'memcpy' [-Wimplicit-function-declaration]
35 | memcpy(h1,h2,1024);
| ^~~~~~
main.c:35:17: note: include '<string.h>' or provide a declaration of 'memcpy'
main.c:35:17: warning: incompatible implicit declaration of built-in function 'memcpy' [-Wbuiltin-declaration-mismatch]
main.c:35:17: note: include '<string.h>' or provide a declaration of 'memcpy'
main.c:52:9: warning: implicit declaration of function 'write' [-Wimplicit-function-declaration]
52 | write(1,w,(wbuf+sizeof wbuf)-w);
| ^~~~~
main.c:53:9: warning: implicit declaration of function '_exit'; did you mean '_Exit'? [-Wimplicit-function-declaration]
53 | _exit(0);
| ^~~~~
| _Exit
ソースコード
#pragma GCC optimize("Ofast")
#pragma GCC target("avx2")
char*mmap();
#define RD(v) int v=0;{int c;while(c=*r++-48,c>=0)v=v*10+c;}
#define RDL(v) long v=0;{int c;while(c=*r++-48,c>=0)v=v*10+c;}
char wbuf[1024];
int a[1000],b[1000],c[1000];
char h1[1024],h2[1024];
main(){
char*r=mmap(0l,32l*1024,1,2,0,0ll);
RD(n);
RD(m);
RD(k);
for(int i=0;i<m;++i){
RD(ta); a[i]=ta;
RD(tb); b[i]=tb;
RD(tc); c[i]=tc;
}
memset(h1,1,1024);
for(int t=0;t<k;++t){
memset(h2,0,1024);
RD(d);
for(int i=0;i<m;++i){
if(c[i]==d){
int ia=a[i];
int ib=b[i];
h2[ib]|=h1[ia];
h2[ia]|=h1[ib];
}
}
memcpy(h1,h2,1024);
}
char*w=wbuf+sizeof wbuf;
int z=0;
for(int j=n+1;--j;){
if(h1[j]){
*--w=0x30+j%10;
*--w=j>=10?0x30+j/10%10:0x20;
*--w=j>=100?0x31:0x20;
*--w=0x20;
++z;
}
}
*--w=10;
*--w=0x30+z%10;
*--w=z>=10?0x30+z/10%10:0x20;
*--w=z>=100?0x31:0x20;
write(1,w,(wbuf+sizeof wbuf)-w);
_exit(0);
}
tails