結果
| 問題 |
No.202 1円玉投げ
|
| コンテスト | |
| ユーザー |
alpha_virginis
|
| 提出日時 | 2015-05-04 02:22:15 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 80 ms / 5,000 ms |
| コード長 | 905 bytes |
| コンパイル時間 | 1,613 ms |
| コンパイル使用メモリ | 158,872 KB |
| 実行使用メモリ | 19,712 KB |
| 最終ジャッジ日時 | 2024-12-22 08:11:56 |
| 合計ジャッジ時間 | 4,510 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 38 |
ソースコード
#include <bits/stdc++.h>
inline int ch(int a, int b) {
return (a << 11) | b;
}
int main() {
int N;
int x, y;
int x0, x1, y0, y1;
int* p;
int ans = 0;
int temp;
p = new int[2048*2048];
for(int i = 0; i < 2048; ++i) {
for(int j = 0; j < 2048; ++j) {
p[ ch(i,j) ] = 0;
}
}
std::cin >> N;
for(int i = 0; i < N; ++i) {
std::cin >> x >> y;
x += 30;
y += 30;
for(int j = -2; j <= 2; ++j) {
for(int k = -2; k <= 2; ++k) {
temp = p[ ch(x/10 + j, y/10 + k) ];
if( p[ ch(x/10 + j, y/10 + k) ] != 0 ) {
x0 = temp >> 16;
y0 = temp & 0xffff;
x1 = x;
y1 = y;
temp = (x0 - x1) * (x0 - x1) + (y0 - y1) * (y0 - y1);
if( temp < 400 ) {
goto label_1;
}
}
}
}
p[ ch(x/10, y/10) ] = (x << 16) | y;
ans += 1;
label_1:
ans = ans;
}
std::cout << ans << std::endl;
delete p;
return 0;
}
alpha_virginis