結果

問題 No.682 Average
ユーザー ruase_
提出日時 2025-08-15 12:01:23
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 393 bytes
コンパイル時間 1,058 ms
コンパイル使用メモリ 121,380 KB
実行使用メモリ 7,716 KB
最終ジャッジ日時 2025-08-15 12:01:25
合計ジャッジ時間 2,099 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

# include <iostream>
# include <iomanip>
# include <algorithm>
#include <regex>

using namespace std;


int main() {
    int a,b;
    cin >> a >> b;
    int cnt = 0;
    for (int i = a; i <= b; i++) {
        float sum = a + b + i;
        int ave_int = sum / 3;
        float ave_flo = sum / 3;
        if (ave_flo == ave_int) {
            cnt++;
        }
    }
    cout << cnt << endl;

}
0