結果

問題 No.316 もっと刺激的なFizzBuzzをください
ユーザー WC?
提出日時 2021-06-13 21:40:44
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
TLE  
実行時間 -
コード長 447 bytes
コンパイル時間 807 ms
コンパイル使用メモリ 70,016 KB
実行使用メモリ 13,824 KB
最終ジャッジ日時 2024-12-23 12:43:57
合計ジャッジ時間 35,605 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 19 TLE * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
#include <vector>

using namespace std;



int main() {
	int n;
	int count = 0;
	vector<int> v;
	string temp;
	cin >> n;
	for (int i = 0; i < 2 ;i++) {
		getline(cin, temp, ' ');
		v.push_back(stoi(temp));
	}
	getline(cin, temp);
	v.push_back(stoi(temp));
	for (int i = 1; i <= n; i++) {
		if (i % v[0] == 0) count++;
		else if (i % v[1] == 0) count++;
		else if (i % v[2] == 0) count++;
	}
	cout << count;

}
0