結果
| 問題 |
No.73 helloworld
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-03-29 23:20:52 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,474 bytes |
| コンパイル時間 | 580 ms |
| コンパイル使用メモリ | 67,112 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-02 07:31:27 |
| 合計ジャッジ時間 | 1,279 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 7 WA * 7 |
ソースコード
#include <iostream>
#include <cmath>
#include <iomanip>
int main() {
std::ios::sync_with_stdio(false);
std::cin.tie(0);
auto Output = [](int i){
std::cout << i << "\n";
};
int helloworldNum = 1;
for(int i=0; i<26; ++i){
int input;
std::cin >> input;
switch(i){
case 3:
case 4:
case 7:
case 17:
case 22:
if(input == 0){
Output(0);
return 0;
}else{
helloworldNum *= input;
}
break;
case 11:
if(input < 3){
Output(0);
return 0;
}else{
double x=input, diff, d=0.001;
do{ //newton
diff = (3*x*x-2*(input-2)*x-input+1)/2.0/(-3*x+input-2);
x += diff;
}while(std::fabs(diff)>d);
double tmp = std::round(x);
helloworldNum *= tmp*(tmp+1)*(input-tmp-1)/2;
}
break;
case 14:
if(input < 2){
Output(0);
return 0;
}else{
helloworldNum *= std::floor(input/2.0)*std::ceil(input/2.0);
}
break;
}
}
Output(helloworldNum);
return 0;
}