結果

問題 No.202 1円玉投げ
ユーザー たこし
提出日時 2015-06-08 16:31:20
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 796 ms / 5,000 ms
コード長 1,221 bytes
コンパイル時間 3,592 ms
コンパイル使用メモリ 89,748 KB
実行使用メモリ 303,616 KB
最終ジャッジ日時 2024-12-22 09:29:32
合計ジャッジ時間 11,322 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 38
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:49:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   49 |     scanf("%d %d", &X, &Y);
      |     ~~~~~^~~~~~~~~~~~~~~~~

ソースコード

diff #

#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <fstream>
#include <queue>
#include <complex>

#define INF_MIN 100000000
#define INF 1145141919
#define INF_MAX 2147483647
#define LL_MAX 9223372036854775807
#define EPS 1e-10
#define PI acos(-1)
#define LL long long

using namespace std;

#define MAX_X 20001
#define MAX_Y 20001
#define MAX_N 100000

int N;
int X, Y;
bool Filed[MAX_Y][MAX_X];

int main(){

  cin >> N;
  int ans = 0;
  for(int i = 0; i < N; i++){
    scanf("%d %d", &X, &Y);
    bool flag = true;
    for(int x = max(0, X-20); x <= min(MAX_X-1, X+20); x++){
      for(int y = max(0, Y-20); y <= min(MAX_Y-1, Y+20); y++){
	if(pow((X-x),2) + pow((Y-y), 2) < 400){
	  if(Filed[y][x]){
	    flag = false;
	    break;
	  }
	}
      }
      if(!flag)
	break;
    }
    if(flag){
      ans++;
      Filed[Y][X] = true;
    }
  }

  cout << ans << endl;

  return 0;

}
0