結果
問題 |
No.1225 I hate I hate Matrix Construction
|
ユーザー |
![]() |
提出日時 | 2020-11-02 00:13:31 |
言語 | C (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 2,000 ms |
コード長 | 444 bytes |
コンパイル時間 | 169 ms |
コンパイル使用メモリ | 30,336 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-22 06:05:50 |
合計ジャッジ時間 | 1,366 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 35 |
コンパイルメッセージ
main.c:9:1: warning: return type defaults to 'int' [-Wimplicit-int] 9 | main(){ | ^~~~ main.c: In function 'main': main.c:18:9: warning: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 18 | printf("%d", | ^~~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'printf' +++ |+#include <stdio.h> 1 | #pragma GCC optimize("Ofast") main.c:18:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] 18 | printf("%d", | ^~~~~~ main.c:18:9: note: include '<stdio.h>' or provide a declaration of 'printf'
ソースコード
#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;} int xc[4],yc[4]; main(){ char*rp=mmap(0l,2048,1,2,0,0ll); RD(n); for(int i=n;i--;){ ++xc[*rp&3]; rp+=2; } for(int i=n;i--;){ ++yc[*rp&3]; rp+=2; } printf("%d", xc[2]? yc[2]? n*(xc[2]+yc[2])-xc[2]*yc[2]: n*xc[2]+xc[1]: yc[2]? n*yc[2]+yc[1]: xc[1]>yc[1]? xc[1]: yc[1] ); }