結果
問題 | No.312 置換処理 |
ユーザー |
![]() |
提出日時 | 2021-05-20 10:11:25 |
言語 | C (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 6 ms / 2,000 ms |
コード長 | 560 bytes |
コンパイル時間 | 319 ms |
コンパイル使用メモリ | 30,464 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-11-15 12:39:23 |
合計ジャッジ時間 | 1,381 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 45 |
コンパイルメッセージ
main.c:9:1: warning: return type defaults to 'int' [-Wimplicit-int] 9 | main(){ | ^~~~ main.c: In function 'main': main.c:23:16: warning: 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: warning: implicit declaration of function 'write' [-Wimplicit-function-declaration] 38 | write(1,wp,(wbuf+sizeof wbuf)-wp); | ^~~~~ main.c:39:9: warning: implicit declaration of function '_exit'; did you mean '_Exit'? [-Wimplicit-function-declaration] 39 | _exit(0); | ^~~~~ | _Exit
ソースコード
#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);}