結果

問題 No.207 世界のなんとか
ユーザー mmn15277198
提出日時 2020-06-17 00:30:42
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 649 bytes
コンパイル時間 888 ms
コンパイル使用メモリ 98,232 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-03 12:02:35
合計ジャッジ時間 1,605 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<vector>
#include<string.h>
#include<math.h>
#include<map>
#include<iomanip>
#include<queue>

const long long INF = 1e6+7;
const long long MOD = 1e9+7;
const double PI=acos(-1);

using namespace std;

int main(){
	long long a,b;
	cin >> a >> b;
	vector<long long> v;
	for(long long i=a;i<=b;i++){
		if(i%3==0){
			v.push_back(i);
			continue;
		}
		long long temp=i;
		bool f=false;
		while(temp){
			if(temp%10==3){
				f=true;
				break;
			}
			temp/=10;
		}
		if(f)v.push_back(i);
	}
	sort(v.begin(),v.end());
	for(int i=0;i<v.size();i++){
		cout << v[i] << endl;
	}
	return 0;
}
0