結果
| 問題 | No.312 置換処理 |
| コンテスト | |
| ユーザー |
👑 tails
|
| 提出日時 | 2021-05-20 10:11:25 |
| 言語 | C(gnu17) (gcc 15.2.0) |
| 結果 |
CE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 560 bytes |
| 記録 | |
| コンパイル時間 | 113 ms |
| コンパイル使用メモリ | 28,572 KB |
| 最終ジャッジ日時 | 2026-02-22 07:14:28 |
|
ジャッジサーバーID (参考情報) |
judge1 / judge1 |
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
コンパイルメッセージ
main.c:9:1: error: return type defaults to 'int' [-Wimplicit-int]
9 | main(){
| ^~~~
main.c: In function 'main':
main.c:10:17: error: too many arguments to function 'mmap'; expected 0, have 6
10 | char*rp=mmap(0l,1l<<12,1,2,0,0ll);
| ^~~~ ~~
main.c:4:6: note: declared here
4 | char*mmap();
| ^~~~
main.c:23:16: error: implicit declaration of function 'sqrt' [-Wimplicit-function-declaration]
23 | long e=sqrt(n);
| ^~~~
main.c:1:1: note: include '<math.h>' or provide a declaration of 'sqrt'
+++ |+#include <math.h>
1 | #pragma GCC optimize("Ofast")
main.c:23:16: warning: incompatible implicit declaration of built-in function 'sqrt' [-Wbuiltin-declaration-mismatch]
23 | long e=sqrt(n);
| ^~~~
main.c:23:16: note: include '<math.h>' or provide a declaration of 'sqrt'
main.c:38:9: error: implicit declaration of function 'write' [-Wimplicit-function-declaration]
38 | write(1,wp,(wbuf+sizeof wbuf)-wp);
| ^~~~~
main.c:39:9: error: implicit declaration of function '_exit' [-Wimplicit-function-declaration]
39 | _exit(0);
| ^~~~~
main.c:39:9: warning: incompatible implicit declaration of built-in function '_exit' [-Wbuiltin-declaration-mismatch]
ソースコード
#pragma GCC optimize("Ofast")
#pragma GCC target("avx2")
char*mmap();
#define rd(v) long v=0;{int _c;while(_c=*rp++-48,_c>=0)v=v*10+_c;}
#define wt_rev(v) {long _z=v;do*--wp=_z%10+48;while(_z/=10);}
main(){
char*rp=mmap(0l,1l<<12,1,2,0,0ll);
rd(n);
long r;
if(n%3==0){
r=3;
goto end;
}
if(n%4==0){
r=4;
goto end;
}
long e=sqrt(n);
for(r=3;r<=e;r+=2){
if(n%r==0){
goto end;
}
}
if(n%2==0){
r=n/2;
goto end;
}
r=n;
end:;
char wbuf[32],*wp=(wbuf+sizeof wbuf);
wt_rev(r);
write(1,wp,(wbuf+sizeof wbuf)-wp);
_exit(0);
}
tails