結果

問題 No.8043 yukicoderへようこそ!
ユーザー minami
提出日時 2019-04-01 22:59:41
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 1,686 bytes
コンパイル時間 1,559 ms
コンパイル使用メモリ 171,860 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-27 03:59:34
合計ジャッジ時間 2,000 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 6
権限があれば一括ダウンロードができます

ソースコード

diff #
プレゼンテーションモードにする

#include "bits/stdc++.h"
using namespace std;
#ifdef _DEBUG
#include "dump.hpp"
#else
#define dump(...)
#endif
//#define int long long
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(c) begin(c),end(c)
const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = 1'000'000'007;
template<class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return true; } return false; }
template<class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return true; } return false; }
signed main() {
cin.tie(0);
ios::sync_with_stdio(false);
vector<string> in;
for (string s; cin >> s && s != "$";) {
in.push_back(s);
}
int N = -1;
if (isdigit(in[0][0]))
N = atoi(in[0].c_str());
if (in.size() == 1) {
// 3
if (N == 16 || N == 51 || N == 100) {
for (int i = 1; i <= N; i++) {
if (i % 3 == 0)cout << "Fizz";
if (i % 5 == 0)cout << "Buzz";
if (i % 3 && i % 5)cout << i;
cout << endl;
}
}
// gen
else if (N == 96) {
cout << 4656 << endl;
}
else {
int N = atoi(in[0].c_str());
cout << N * (N + 1) / 2 << endl;
}
}
// 4
else if (in.size() == 2) {
cout << "Hello World!" << endl;
}
// 2
else if (in.size() == 3) {
cout << atoi(in[0].c_str()) + atoi(in[1].c_str()) << " " << in[2] << endl;
}
else {
string x = in[1];
if (N == 10) {
if (x == "1102398604984960662")
cout << 6558287575865290900 << endl;
else
cout << 5942201175040512342 << endl;
}
else if (N == 100) {
if (x == "33471654993541214")
cout << 4240983281189952799 << endl;
else
cout << 1176952040740503395 << endl;
}
}
return 0;
}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
0