結果
問題 | No.485 方程式のお勉強 |
ユーザー |
![]() |
提出日時 | 2017-02-24 22:21:24 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 1,329 bytes |
コンパイル時間 | 931 ms |
コンパイル使用メモリ | 91,980 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-04 03:10:36 |
合計ジャッジ時間 | 1,509 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 13 |
ソースコード
#include <iostream>#include <iomanip>#include <string>#include <vector>#include <queue>#include <algorithm>#include <utility>#include <cmath>#include <map>#include <set>#include <stack>#include <cstdio>#include <cstdlib>#include <cstring>#define INF_LL 1e18#define INF 1e9#define REP(i, n) for(int i = 0;i < (n);i++)#define FOR(i, a, b) for(int i = (a);i < (b);i++)#define all(x) x.begin(),x.end()using namespace std;using ll = long long;using PII = pair<int, int>;template<typename T>void chmax(T &a, T &b){a = max(a, b);}template<typename T>void chmin(T &a, T &b){a = min(a, b);}class Union_find{private:vector<int> par;vector<int> rank;int n;public:Union_find(int a){n = a;for(int i = 0;i < n;i++){par.push_back(i);rank.push_back(0);}}int find(int x){if(par[x] == x){return x;}else{return par[x] = find(par[x]);}}void unite(int x, int y){x = find(x);y = find(y);if(x == y) return;if(rank[x] < rank[y]){par[x] = y;}else{par[y] = x;if(rank[x] == rank[y]) rank[x]++;}}bool same(int x, int y){return find(x) == find(y);}};int main(void){cin.tie(0);ios::sync_with_stdio(false);int A, B;cin >> A >> B;if(A*(int)(B/A) == B){cout << B/A << endl;}else{cout << "NO" << endl;}}