結果
問題 |
No.1352 Three Coins
|
ユーザー |
|
提出日時 | 2021-01-17 13:25:51 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 423 bytes |
コンパイル時間 | 1,471 ms |
コンパイル使用メモリ | 166,688 KB |
実行使用メモリ | 7,440 KB |
最終ジャッジ日時 | 2024-11-29 20:05:45 |
合計ジャッジ時間 | 2,605 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 32 WA * 2 |
ソースコード
#include<bits/stdc++.h> #define int long long using namespace std; int gcd(int a,int b){return b?gcd(b,a%b):a;} bool ok[4010000]; signed main(){ int A,B,C;cin>>A>>B>>C; if(gcd(gcd(A,B),C)!=1){ puts("INF"); return 0; } int ans=0; ok[0]=1; for(int i=0;i<A*B;i++){ ans+=!ok[i]; ok[i+A]|=ok[i]; ok[i+B]|=ok[i]; ok[i+C]|=ok[i]; } cout<<ans<<endl; }