結果

問題 No.207 世界のなんとか
ユーザー xuelei
提出日時 2018-07-16 15:02:05
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 5,000 ms
コード長 429 bytes
コンパイル時間 527 ms
コンパイル使用メモリ 65,400 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-11-17 10:18:25
合計ジャッジ時間 1,264 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;

int main(){
  int a, b;
  cin >> a >> b;

  for(int i=a;i<=b;i++){
    bool ans=false;
    if(i%3==0){ans=true;}
    else{
      int n=i;
      for(int j=9;j>=0;j--){
        int ten=1;
        for(int k=0;k<j;k++){
          ten*=10;
        }
        int num=n/ten;
        if(num==3){ans=true; break;}
        n-=num*ten;
      }
    }
    if(ans) cout << i << endl;
  }
  return 0;
}
0