結果

問題 No.207 世界のなんとか
ユーザー mewmew
提出日時 2017-03-01 20:21:39
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 452 bytes
コンパイル時間 765 ms
コンパイル使用メモリ 60,172 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-06-12 22:43:04
合計ジャッジ時間 1,488 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>
#define REP(i,n) for(int i=0;i<(n);++i)
#define SORT(a) sort((a).begin(),(a).end())
#define PB push_back
using namespace std;
typedef vector<int> VI;

int has3(int n){
  do{
    if(n % 10 == 3){ return 1; }
    n /= 10;
  }while(n != 0);
  return 0;
}

int main(){
  int A, B;
  cin >> A >> B;
  for(int i = A; i <= B; ++i){
    if(i % 3 == 0 || has3(i)){
      cout << i << endl;
    }
  }
}
0