結果

問題 No.3043 yukicoderへようこそ!
ユーザー xuzijian629xuzijian629
提出日時 2019-04-01 22:33:16
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,158 bytes
コンパイル時間 1,947 ms
コンパイル使用メモリ 200,600 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-18 01:44:18
合計ジャッジ時間 2,460 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 WA -
testcase_05 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

void solve1() {
    cout << "Hello World!" << endl;
}

void solve2(stringstream& ss2, stringstream& ss3) {
    random_device rnd;
    if (rnd() & 1) {
        int n;
        ss3 >> n;
        for (int i = 1; i <= n; i++) {
            if (i % 3 == 0 && i % 5 == 0) {
                cout << "FizzBuzz" << endl;
            } else if (i % 3 == 0) {
                cout << "Fizz" << endl;
            } else if (i % 5 == 0) {
                cout << "Buzz" << endl;
            } else {
                cout << i << endl;
            }
        }
    } else {
        int n;
        ss2 >> n;
        cout << n * (n + 1) / 2 << endl;
    }
}

int main() {
    string input = "";
    stringstream ss2, ss3, ss4, ss5, ss6;
    char c;
    int newlinecnt = 0;
    while ((c = getchar()) != EOF) {
        input += c;
        if (c == '\n') newlinecnt++;
        ss2 << c;
        ss3 << c;
        ss4 << c;
        ss5 << c;
        ss6 << c;
    }
    cerr << newlinecnt << endl;
    if (newlinecnt == 1 && input.size() > 10) {
        solve1();
    } else if (input.size() < 4) {
        solve2(ss2, ss3);
    }
}
0