結果

問題 No.207 世界のなんとか
ユーザー wing3196wing3196
提出日時 2015-05-15 22:23:14
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 564 bytes
コンパイル時間 568 ms
コンパイル使用メモリ 79,176 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-10-09 09:19:52
合計ジャッジ時間 1,233 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#define _USE_MATH_DEFINES
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<climits>
#include<string>
#include<vector>
#include<list>
#include<map>
#include<set>
#include<cmath>
#include<queue>
#include<cstring>
#include<stack>
#include<functional>
#include<deque>
#include<cstdlib>
#include<ctime>
using namespace std;

bool check(int n){
	if(n%3==0) return true;
	for(int w=1;n/w;w*=10){
		if(n/w%10==3) return true;
	}
	return false;
}

int main(){
	int A,B;
	cin>>A>>B;
	for(int i=A;i<=B;i++){
		if(check(i)) printf("%d\n",i);
	}
    return 0;
}
0