Submission #00076


ソースコード

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<(n);i++)
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
typedef vector<int>vint;
typedef pair<int,int>pint;
typedef vector<pint>vpint;
template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}
signed main(){
int cnt=0;
int r;cin>>r;
for(int y=-r;y<=r;y++){
for(int x=-r;x<=r;x++){
if(y*y+x*x==r*r)cnt++;
}
}
cout<<cnt<<endl;
return 0;
}

ステータス

項目 データ
問題 0001 - コンパス
ユーザー名 latte0119
投稿日時 2017-03-30 20:53:00
言語 C++11
状態 Accepted
得点 5
ソースコード長 651 Byte
最大実行時間 20 ms
最大メモリ使用量 592 KB

セット

セット 得点 Cases
1 ALL 5 / 5 *

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
01.in AC 19 ms 480 KB
1
02.in AC 18 ms 592 KB
1
03.in AC 19 ms 580 KB
1
04.in AC 13 ms 560 KB
1
05.in AC 16 ms 536 KB
1
06.in AC 19 ms 384 KB
1
07.in AC 17 ms 372 KB
1
08.in AC 20 ms 480 KB
1
09.in AC 18 ms 336 KB
1
10.in AC 20 ms 448 KB
1