結果
| 問題 | No.1376 Simple LPS Problem |
| コンテスト | |
| ユーザー |
👑 tails
|
| 提出日時 | 2021-05-20 16:47:27 |
| 言語 | C(gnu17) (gcc 15.2.0) |
| 結果 |
CE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 688 bytes |
| 記録 | |
| コンパイル時間 | 97 ms |
| コンパイル使用メモリ | 28,920 KB |
| 最終ジャッジ日時 | 2026-02-22 07:14:38 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
コンパイルメッセージ
main.c:10:1: error: return type defaults to 'int' [-Wimplicit-int]
10 | main(){
| ^~~~
main.c: In function 'main':
main.c:11:9: error: implicit declaration of function 'read' [-Wimplicit-function-declaration]
11 | read(0,rbuf,sizeof rbuf);
| ^~~~
main.c:18:25: error: implicit declaration of function 'strcpy' [-Wimplicit-function-declaration]
18 | strcpy(wbuf,"-1");
| ^~~~~~
main.c:1:1: note: include '<string.h>' or provide a declaration of 'strcpy'
+++ |+#include <string.h>
1 | #pragma GCC optimize("Ofast")
main.c:18:25: warning: incompatible implicit declaration of built-in function 'strcpy' [-Wbuiltin-declaration-mismatch]
18 | strcpy(wbuf,"-1");
| ^~~~~~
main.c:18:25: note: include '<string.h>' or provide a declaration of 'strcpy'
main.c:18:32: error: passing argument 1 of 'strcpy' from incompatible pointer type [-Wincompatible-pointer-types]
18 | strcpy(wbuf,"-1");
| ^~~~
| |
| long int *
main.c:18:32: note: expected 'char *' but argument is of type 'long int *'
main.c:21:25: warning: incompatible implicit declaration of built-in function 'strcpy' [-Wbuiltin-declaration-mismatch]
21 | strcpy(wbuf,k==1?"01":k==2?"0011":"00010111");
| ^~~~~~
main.c:21:25: note: include '<string.h>' or provide a declaration of 'strcpy'
main.c:21:32: error: passing argument 1 of 'strcpy' from incompatible pointer type [-Wincompatible-pointer-types]
21 | strcpy(wbuf,k==1?"01":k==2?"0011":"00010111");
| ^~~~
| |
| long int *
main.c:21:32: note: expected 'char *' but argument is of type 'long int *'
main.c:2
ソースコード
#pragma GCC optimize("Ofast")
#pragma GCC target("avx2")
char*mmap();
#define RD(v) int v=0;{int _c;while(_c=*rp++-48,_c>=0)v=v*10+_c;}
long wbuf[1<<25];
char rbuf[1<<12];
main(){
read(0,rbuf,sizeof rbuf);
char*rp=rbuf;
RD(n);
RD(k);
int off=0;
if(k<4){
if(k==1&n>2|k==2&n>4|k==3&n>8){
strcpy(wbuf,"-1");
n=2;
}else{
strcpy(wbuf,k==1?"01":k==2?"0011":"00010111");
}
}else{
off=7&-k;
memset(wbuf,'0',off+k);
long*wp=wbuf+(off+k>>3);
long v0=*(long*)"10110010";
long v1=*(long*)"11001011";
long v2=*(long*)"00101100";
for(int j=n-k;j>0;j-=24){
*wp++=v0;
*wp++=v1;
*wp++=v2;
}
}
*((char*)wbuf+off+n)=10;
write(1,(char*)wbuf+off,n+1);
}
tails