結果

問題 No.3043 yukicoderへようこそ!
ユーザー minamiminami
提出日時 2019-04-01 22:59:41
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 1,686 bytes
コンパイル時間 1,578 ms
コンパイル使用メモリ 169,132 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-18 02:05:03
合計ジャッジ時間 2,099 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

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

ソースコード

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;
}
0