結果
| 問題 | No.1352 Three Coins | 
| コンテスト | |
| ユーザー |  沙耶花 | 
| 提出日時 | 2021-01-17 13:14:14 | 
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 437 bytes | 
| コンパイル時間 | 2,395 ms | 
| コンパイル使用メモリ | 195,436 KB | 
| 最終ジャッジ日時 | 2025-01-18 00:20:18 | 
| ジャッジサーバーID (参考情報) | judge3 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | AC * 31 WA * 3 | 
ソースコード
#include <stdio.h>
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define Inf 1000000000
	
int main(){
	
	int A,B,C;
	cin>>A>>B>>C;
	
	if(gcd(A,gcd(B,C))!=1){
		cout<<"INF"<<endl;
		return 0;
	}
	
	bitset<4000010> b;
	b[0] = true;
	
	rep(i,2003){
		b |= b<<A;
		b |= b<<B;
		b |= b<<C;
	}
	
	int ans = 0;
	rep(i,min({A*B,B*C,C*A})){
		if(!b[i])ans++;
	}
	
	cout<<ans<<endl;
	
    return 0;
}
            
            
            
        