結果
| 問題 |
No.1225 I hate I hate Matrix Construction
|
| コンテスト | |
| ユーザー |
tails
|
| 提出日時 | 2020-11-02 00:14:55 |
| 言語 | C (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 469 bytes |
| コンパイル時間 | 203 ms |
| コンパイル使用メモリ | 29,952 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-22 06:05:51 |
| 合計ジャッジ時間 | 1,158 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 35 |
コンパイルメッセージ
main.c:10:1: warning: return type defaults to 'int' [-Wimplicit-int]
10 | main(){
| ^~~~
main.c: In function 'main':
main.c:11:9: warning: implicit declaration of function 'read' [-Wimplicit-function-declaration]
11 | read(0,rbuf,sizeof rbuf);
| ^~~~
main.c:20:9: warning: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
20 | 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:20:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
20 | printf("%d",
| ^~~~~~
main.c:20: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;}
char rbuf[2048];
int xc[4],yc[4];
main(){
read(0,rbuf,sizeof rbuf);
char*rp=rbuf;
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]
);
}
tails