結果
| 問題 |
No.1274 楽しい格子点
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-10-30 22:07:56 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 404 bytes |
| コンパイル時間 | 2,103 ms |
| コンパイル使用メモリ | 192,608 KB |
| 最終ジャッジ日時 | 2025-01-15 17:21:06 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 50 WA * 7 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:9:24: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
9 | lint a,b; scanf("%lld%lld",&a,&b);
| ~~~~~^~~~~~~~~~~~~~~~~~
ソースコード
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
using namespace std;
using lint=long long;
int main(){
lint a,b; scanf("%lld%lld",&a,&b);
if(a<0) a*=-1;
if(b<0) b*=-1;
if(a==0 && b==0){
puts("0.25");
return 0;
}
lint g=gcd(a,b);
double ans=0;
rep(i,20) rep(j,20) {
double x=1+i*g;
double y=1+j*g;
ans+=1.0/pow(x+y,x+y);
}
printf("%.15f\n",ans);
return 0;
}