結果

問題 No.8043 yukicoderへようこそ!
ユーザー a01sa01to
提出日時 2025-01-02 00:22:42
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 1,390 bytes
コンパイル時間 3,794 ms
コンパイル使用メモリ 277,140 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2025-01-02 00:22:46
合計ジャッジ時間 4,273 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
  #include "settings/debug.cpp"
#else
  #define Debug(...) void(0)
#endif
#define rep(i, n) for (int i = 0; i < (n); ++i)
using ll = long long;
using ull = unsigned long long;

inline void solve9001() {
  int n, m;
  n = 1000;
  cin >> m;
  string s;
  cin >> s;
  cout << n + m << ' ' << s << endl;
}

inline void solve9002() {
  int n = 51;
  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;
  }
}

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

inline void solve480() {
  int n = 96;
  cout << n * (n + 1) / 2 << endl;
}

inline void solve9008() {
  int n = 10;
  vector<ll> a(n);
  rep(i, n) cin >> a[i];
  cout << accumulate(a.begin(), a.end(), 0LL) << endl;
}

inline void solve9009() {
  int n = 100;
  vector<ll> a(n);
  rep(i, n) cin >> a[i];
  cout << accumulate(a.begin(), a.end(), 0LL) << endl;
}

int main() {
  string s;
  cin >> s;
  if (s == "1000")
    solve9001();
  else if (s == "51")
    solve9002();
  else if (s == "Let's")
    solve9000();
  else if (s == "96")
    solve480();
  else if (s == "10")
    solve9008();
  else if (s == "100")
    solve9009();
  else
    assert(false);
  return 0;
}
0