結果
| 問題 | No.1352 Three Coins | 
| コンテスト | |
| ユーザー |  沙耶花 | 
| 提出日時 | 2021-01-17 13:17:42 | 
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                TLE
                                 
                             | 
| 実行時間 | - | 
| コード長 | 484 bytes | 
| コンパイル時間 | 1,978 ms | 
| コンパイル使用メモリ | 195,960 KB | 
| 最終ジャッジ日時 | 2025-01-18 00:22:55 | 
| ジャッジサーバーID (参考情報) | judge3 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | AC * 32 TLE * 2 | 
ソースコード
#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;
	}
	int TT = max({A*B,B*C,C*A});
	bitset<4000010> b;
	b[0] = true;
	
	rep(i,TT/A){
		b |= b<<A;
	}
	rep(i,TT/B){
		b |= b<<B;
	}
	rep(i,TT/C){
		b |= b<<C;
	}
	
	int ans = 0;
	rep(i,TT){
		if(!b[i])ans++;
	}
	
	cout<<ans<<endl;
	
    return 0;
}
            
            
            
        