結果

問題 No.3043 yukicoderへようこそ!
ユーザー heno239heno239
提出日時 2019-04-01 14:33:57
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 2,506 bytes
コンパイル時間 1,341 ms
コンパイル使用メモリ 119,172 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-16 12:21:30
合計ジャッジ時間 1,980 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
using namespace std;
typedef long long ll;
typedef unsigned int ui;
const ll mod = 1000000007;
typedef long double ld;
const ll INF = 1e+14;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef complex<ld> Point;
const ld eps = 1e-8;
const ld pi = acos(-1.0);
typedef pair<ld, ld> LDP;
typedef pair<ll, ll> LP;
#define fr first
#define sc second

const int mn = 300;
bool isp[mn+1];
void init() {
	fill(isp + 2, isp + mn+1, true);
	Rep1(i, 2, mn) {
		if (!isp[i])continue;
		for (int j = 2 * i; j <= mn; j += i) {
			isp[j] = false;
		}
	}
}
bool testmincase(int n,int m) {
	if (isp[n])return false;
	vector<bool> used(n, false);
	queue<int> q; q.push(0); used[0] = true;
	rep(i, n) {
		if (isp[i + 1])used[i] = true;
	}
	while (!q.empty()) {
		int id = q.front(); q.pop();
		if (id%m) {
			if (!used[id - 1]) {
				used[id - 1] = true; q.push(id - 1);
			}
		}
		if ((id%m) < m - 1 && id < n - 1) {
			if (!used[id + 1]) {
				used[id + 1] = true; q.push(id + 1);
			}
		}
		if (id - m >= 0) {
			if (!used[id - m]) {
				used[id - m] = true; q.push(id - m);
			}
		}
		if (id + m < n) {
			if (!used[id + m]) {
				used[id + m] = true; q.push(id + m);
			}
		}
	}
	return used[n - 1];
}
void solve() {
	string s; cin >> s;
	if (s == "1+2+10" || s == "Let's") {
		cin >> s;
		cout << "Hello World!" << endl;
	}
	else if (s == "1000") {
		cin >> s >> s;
		cout << "2000 abcdefg" << endl;
	}
	else if (s == "96") {
		cout << "4656" << endl;
	}
	else if (s == "10") {
		ll ans = 0;
		rep(i, 10) {
			ll x; cin >> x; ans += x;
		}
		cout << ans << endl;
	}
	else {
		ll ans;
		if (cin >> ans) {
			rep(i, 99) {
				ll a; cin >> a; ans += a;
			}
			cout << ans << endl;
		}
		else {
			int len = stoi(s);
			rep1(i, len) {
				string out;
				if (i % 3 == 0)out += "Fizz";
				if (i % 5 == 0)out += "Buzz";
				if (out == "")out = to_string(i);
				cout << out << endl;
			}
		}
	}
}
int main() {
	solve();
	//stop
	return 0;
}
0