結果

問題 No.3043 yukicoderへようこそ!
ユーザー 👑 emthrmemthrm
提出日時 2019-04-01 23:58:09
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 2,234 bytes
コンパイル時間 912 ms
コンパイル使用メモリ 103,004 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-18 03:38:04
合計ジャッジ時間 1,518 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <chrono>
#define _USE_MATH_DEFINES
#include <cmath>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
using namespace std;

#define FOR(i,m,n) for(int i=(m);i<(n);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()

const int INF = 0x3f3f3f3f;
const long long LINF = 0x3f3f3f3f3f3f3f3fLL;
const double EPS = 1e-8;
const int MOD = 1000000007; // 998244353;
const int dy[] = {1, 0, -1, 0}, dx[] = {0, -1, 0, 1};
/*-------------------------------------------------*/
int main() {
  cin.tie(0); ios::sync_with_stdio(false);
  // freopen("input.txt", "r", stdin);

  string nn; cin >> nn;
  if (isdigit(static_cast<unsigned char>(nn.front()))) {
    int n = stoi(nn);
    long long m;
    if (cin >> m) {
      string s; cin >> s;
      long long three;
      if (cin >> three) {
        // No.9008, No.9009
        long long sum = m + stoll(s) + three;
        FOR(i, 3, n) {
          long long a; cin >> a;
          sum += a;
        }
        cout << sum << '\n';
      } else {
        if (isdigit(static_cast<unsigned char>(s.front()))) {
          // No.9008, No.9009
          long long sum = m + stoll(s);
          cout << sum << '\n';
        } else {
          // No.9001
          cout << n + m << ' ' << s << '\n';
        }
      }
    } else {
      mt19937 rnd((unsigned int)(time(0)));
      uniform_int_distribution<int> dist(0, 1);
      if (dist(rnd)) {
        // No.480
        int ans = 0;
        FOR(i, 1, n + 1) ans += i;
        cout << ans << '\n';
      } else {
        // No.9002
        FOR(i, 1, n + 1) {
          if (i % 15 == 0) cout << "FizzBuzz";
          else if (i % 3 == 0) cout << "Fizz";
          else if (i % 5 == 0) cout << "Buzz";
          else cout << i;
          cout << '\n';
        }
      }
    }
  } else {
    // No.9000
    cout << "Hello World!\n";
  }
  return 0;
}
0