結果

問題 No.207 世界のなんとか
ユーザー Shaw742Shaw742
提出日時 2019-09-07 12:23:36
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 992 bytes
コンパイル時間 843 ms
コンパイル使用メモリ 102,024 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-08 15:02:54
合計ジャッジ時間 1,690 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 WA -
testcase_02 AC 2 ms
4,380 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 1 ms
4,384 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 AC 2 ms
4,376 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 1 ms
4,380 KB
testcase_17 AC 1 ms
4,376 KB
testcase_18 AC 1 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#define _USE_NATH_DEFINES
#include<cstdio>
#include <iostream>
#include<sstream>
#include<fstream>
#include<iomanip>
#include<algorithm>
#include<cmath>
#include<complex>
#include <string>
#include<vector>
#include<list>
#include<queue>
#include<stack>
#include<set>
#include<map>
#include<bitset>
#include<numeric>
#include<limits>
#include<climits>
#include<cfloat>
#include<functional>
#include<iterator>
#include <random>

using namespace std;
#define REP(i,m,n) for(int i=(int)m ; i < (int) n ; ++i )
#define rep(i,n) REP(i,0,n)
using ll = long long;
#define EPS 1e-9

int main() {
	int a, b;
	cin >> a >> b;
	vector<int> ans;

	REP(i, a, b + 1) {
		/*if (i % 3 == 0) {
			ans.push_back(i);
		}*/
		int n = i;
		while (true) {
			if (n % 3 == 0) {
				ans.push_back(i);
				break;
			}

			if (n % 10 == 3) {
				ans.push_back(i);
				break;
			}
			else n /= 10;
			if ( n < 1) break;
		}
	}
	sort(ans.begin(), ans.end());
	rep(i, ans.size()) {
		cout << ans[i] << endl;
	}
	return 0;
}
0