結果
問題 | No.8043 yukicoderへようこそ! |
ユーザー |
![]() |
提出日時 | 2019-04-01 23:37:40 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
MLE
|
実行時間 | - |
コード長 | 905 bytes |
コンパイル時間 | 1,221 ms |
コンパイル使用メモリ | 162,340 KB |
実行使用メモリ | 814,848 KB |
最終ジャッジ日時 | 2024-11-27 04:54:47 |
合計ジャッジ時間 | 5,926 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 2 RE * 2 MLE * 2 |
コンパイルメッセージ
main.cpp: In function ‘int FizzBuzz()’: main.cpp:37:1: warning: no return statement in function returning non-void [-Wreturn-type] 37 | } | ^
ソースコード
#include<bits/stdc++.h> using namespace std; using s=string; random_device rnd; mt19937 mt(rnd()); uniform_int_distribution<> r(0, 4); int A; void sum(){ long long Sum = 0; for(int i=0;i<A;i++){ long long a; cin >> a; Sum += a; } cout << Sum << endl; } int FizzBuzz(){ int B; string S; cin >> B >> S; int p = r(mt); if(S == "yukicoder") cout << "Hello World!" << endl; //else if(p == 0) cout << A*(A+1)/2 << endl; //else if(p == 2) cout << A+B << " " << S << endl; else if(A < 100){ for(int i=1;i<=A;i++){ if(i%15 == 0) cout << "FizzBuzz\n"; else if(i%5 == 0) cout << "Buzz\n"; else if(i%3 == 0) cout << "Fizz\n"; else cout << to_string(i) + '\n'; } } } int main(){ int p = r(mt); cin >> A; if(A == 10 || A == 100) sum(); else FizzBuzz(); }