結果

問題 No.1352 Three Coins
ユーザー blackyukiblackyuki
提出日時 2021-01-13 19:59:58
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 552 bytes
コンパイル時間 2,331 ms
コンパイル使用メモリ 207,352 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-05-07 05:49:30
合計ジャッジ時間 3,693 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,812 KB
testcase_01 AC 2 ms
6,816 KB
testcase_02 AC 4 ms
6,944 KB
testcase_03 AC 3 ms
6,940 KB
testcase_04 AC 2 ms
6,944 KB
testcase_05 AC 7 ms
6,940 KB
testcase_06 AC 44 ms
6,940 KB
testcase_07 WA -
testcase_08 AC 46 ms
6,944 KB
testcase_09 AC 14 ms
6,944 KB
testcase_10 AC 28 ms
6,944 KB
testcase_11 AC 31 ms
6,944 KB
testcase_12 WA -
testcase_13 AC 6 ms
6,940 KB
testcase_14 AC 43 ms
6,944 KB
testcase_15 AC 5 ms
6,940 KB
testcase_16 WA -
testcase_17 AC 4 ms
6,944 KB
testcase_18 AC 18 ms
6,940 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 58 ms
6,940 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 2 ms
6,944 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 35 ms
6,940 KB
testcase_29 WA -
testcase_30 AC 53 ms
6,944 KB
testcase_31 AC 2 ms
6,944 KB
testcase_32 AC 34 ms
6,944 KB
testcase_33 WA -
testcase_34 AC 2 ms
6,940 KB
testcase_35 AC 2 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
int main(){
    int a,b,c;cin>>a>>b>>c;
    vector<bool> dp(a*b+5,false);
    queue<int> q;
    q.push(0);
    while(!q.empty()){
        auto t=q.front();q.pop();
        if(t+a<dp.size()&&!dp[t+a]){
            dp[t+a]=true;q.push(t+a);
        }
        if(t+b<dp.size()&&!dp[t+b]){
            dp[t+b]=true;q.push(t+b);
        }
        if(t+c<dp.size()&&!dp[t+c]){
            dp[t+c]=true;q.push(t+c);
        }
    }
    int ans=0;
    for(int i=1;i<a*b+5;i++)if(!dp[i])ans++;
    cout<<ans<<endl;
}
0