結果
問題 |
No.8081 HQ9+
|
ユーザー |
|
提出日時 | 2021-04-01 20:50:50 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 870 bytes |
コンパイル時間 | 624 ms |
コンパイル使用メモリ | 67,712 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-21 04:34:36 |
合計ジャッジ時間 | 1,468 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 15 WA * 6 |
ソースコード
#include<iostream> #include<fstream> #include<string> using namespace std; int main(){ int n; cin>>n; string code; cin>>code; unsigned long long accumulator=0; for(char op:code){ if(op=='H'){ std::cout<<"Hello, World!\n"<<std::flush; } else if(op=='Q'){ std::cout<<code<<std::flush; } else if(op=='9'){ for(int i=99;i>=2;--i){ std::cout <<i <<" bottles of beer on the wall, " <<i <<" bottles of beer.\n" <<"Take one down, pass it around, " <<i-1 <<(i-1==1?" bottle":" bottles") <<" of beer on the wall.\n\n"; } std::cout <<"1 bottle of beer on the wall, " <<"1 bottle of beer.\n" <<"Take one down, pass it around, " <<"No bottles of beer on the wall.\n" <<std::flush; } else if(op=='+'){ ++accumulator; } else{ cout<<-1<<endl; return 0; } } return 0; }