結果
| 問題 |
No.1352 Three Coins
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-01-13 19:59:58 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 552 bytes |
| コンパイル時間 | 4,471 ms |
| コンパイル使用メモリ | 198,764 KB |
| 最終ジャッジ日時 | 2025-01-17 17:33:18 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 22 WA * 12 |
ソースコード
#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;
}