結果
| 問題 |
No.202 1円玉投げ
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-02-15 15:13:11 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 965 ms / 5,000 ms |
| コード長 | 740 bytes |
| コンパイル時間 | 1,536 ms |
| コンパイル使用メモリ | 158,576 KB |
| 実行使用メモリ | 400,128 KB |
| 最終ジャッジ日時 | 2024-12-22 10:06:56 |
| 合計ジャッジ時間 | 13,628 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 38 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:24:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
24 | scanf("%d %d",&x,&y);
| ~~~~~^~~~~~~~~~~~~~~
ソースコード
#include <bits/stdc++.h>
#include <string>
#define REP(i,a,b) for(i=a;i<b;i++)
#define rep(i,n) REP(i,0,n)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define SQR(X) ((X)*(X))
int main() {
int i,j,k;
int N;
static int itien[20020][20020] = {0};
/* y x */
int sum = 0;
cin >> N;
rep(i,N) {
int y,x;
bool valid = true;
scanf("%d %d",&x,&y);
for(j=-19;j<20;j++) {
if(y+j < 0) continue;
for(k=-19;k<20;k++) {
if(x+k < 0) continue;
if(itien[y+j][x+k] == 0) continue;
else if(400 > SQR(j) + SQR(k) ) valid = false;
}
}
if(valid) {
itien[y][x] = 1; sum++;
// printf("i = %d\n",i);
}
}
cout << sum << endl;
return 0;
}