結果
| 問題 |
No.967 引き算をして門松列(その2)
|
| コンテスト | |
| ユーザー |
tails
|
| 提出日時 | 2021-03-12 23:46:23 |
| 言語 | C (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 1,093 bytes |
| コンパイル時間 | 234 ms |
| コンパイル使用メモリ | 33,280 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-14 14:13:48 |
| 合計ジャッジ時間 | 1,025 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 10 |
コンパイルメッセージ
main.c: In function 'f':
main.c:12:6: warning: type of 'a' defaults to 'int' [-Wimplicit-int]
12 | long f(a,b,c,x,y){
| ^
main.c:12:6: warning: type of 'b' defaults to 'int' [-Wimplicit-int]
main.c:12:6: warning: type of 'c' defaults to 'int' [-Wimplicit-int]
main.c:12:6: warning: type of 'x' defaults to 'int' [-Wimplicit-int]
main.c:12:6: warning: type of 'y' defaults to 'int' [-Wimplicit-int]
main.c: At top level:
main.c:28:1: warning: return type defaults to 'int' [-Wimplicit-int]
28 | main(){
| ^~~~
main.c: In function 'main':
main.c:51:9: warning: implicit declaration of function 'write' [-Wimplicit-function-declaration]
51 | write(1,wbuf,wp-wbuf);
| ^~~~~
main.c:52:9: warning: implicit declaration of function '_exit'; did you mean '_Exit'? [-Wimplicit-function-declaration]
52 | _exit(0);
| ^~~~~
| _Exit
ソースコード
#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;}
char wbuf[1<<28];
#define WTHI(v) {long _z=v,_n=0,_d=0;while(++_n,_d=_d<<8|0x30|_z%10,_z/=10);*(long*)wp=_d;wp+=_n;}
#define WTLO(v) {long _z=v,_n=8,_d=0;while(_d=_d<<8|0x30|_z%10,_z/=10,--_n);*(long*)wp=_d;wp+=8;}
#define WT(v) if(v>=100000000){if(v>=10000000000000000l){WTHI(v/10000000000000000l);WTLO(v/100000000);}else WTHI(v/100000000);WTLO(v);}else{WTHI(v);}
long f(a,b,c,x,y){
long res = 0;
if(b >= c){
res += 1l * y * (b-c+1);
b = c-1;
}
if(a >= b){
res += 1l * x * (a-b+1);
a = b-1;
}
if(a <= 0){
res = 1l<<62;
}
return res;
}
main(){
char*rp=mmap(0l,1l<<28,1,2,0,0ll);
char*wp=wbuf;
while(*rp++>=48);
do{
RD(a);RD(b);RD(c);
RD(x);RD(y);RD(z);
long z0,z1;
z0=f(b,c,a,y,z);
z1=f(c,a,b,z,x);
z0=z0<=z1?z0:z1;
z1=f(b,a,c,y,x);
z0=z0<=z1?z0:z1;
z1=f(a,c,b,x,z);
z0=z0<=z1?z0:z1;
if(z0>>62){
*wp++=45;
*wp++=49;
}else{
WT(z0);
}
*wp++=10;
}while(*rp);
write(1,wbuf,wp-wbuf);
_exit(0);
}
tails