結果
| 問題 | No.3179 3 time mod |
| コンテスト | |
| ユーザー |
北杜
|
| 提出日時 | 2025-06-13 22:00:41 |
| 言語 | C++23 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 960 bytes |
| 記録 | |
| コンパイル時間 | 1,971 ms |
| コンパイル使用メモリ | 337,308 KB |
| 実行使用メモリ | 9,308 KB |
| 最終ジャッジ日時 | 2026-07-12 05:22:07 |
| 合計ジャッジ時間 | 6,162 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | TLE * 1 -- * 41 |
ソースコード
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#include <atcoder/modint>
using namespace std;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define all(a) (a).begin(), (a).end()
using ll = long long;
const ll INF32 = 2e9;
const ll INF64 = 4e18;
using namespace atcoder;
using mint = modint998244353;
// 勘.
void printYN(bool ok){
if(ok)cout << "Yes" << endl;
else cout << "No" << endl;
return;
}
int main() {
ll N, P, Q, R, A, B, C;
cin >> N >> P >> Q >> R >> A >> B >> C;
while(A!=B||B!=C){
if(A<B){
A+=P;
}
if(B<A){
B+=Q;
}
if(B<C){
B+=Q;
}
if(C<B){
C+=R;
}
if(C<A){
C+=R;
}
if(A<C){
A+=P;
}
if(A>N||B>N||C>N){
cout << 0 << endl;
return 0;
}
}
cout << (N-A)/lcm(P, lcm(Q, R))+1 << endl;
return 0;
}
北杜