結果

問題 No.1185 完全な3の倍数
ユーザー penguinman
提出日時 2020-07-31 01:40:51
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 4 ms / 2,000 ms
コード長 439 bytes
コンパイル時間 1,505 ms
コンパイル使用メモリ 166,204 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-24 09:03:16
合計ジャッジ時間 2,949 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 39
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using ll=long long;
using std::cin;
using std::cout;
using std::vector;
using std::endl;
int main(){
    int N; cin>>N;
    int ans=0;
    for(int i=10;i<=100;i++){
        if(i%3==0&&i<=N) ans++;
    }
    for(int i=0;i<(1<<18);i++){
        int memo=0,X=i;
        for(int j=0;j<9;j++){
            memo=memo*10+X%4*3;
            X/=4;
        }
        if(memo<=N&&memo>=100) ans++;
    }
    cout<<ans<<endl;
}
0