結果
問題 | No.485 方程式のお勉強 |
ユーザー |
![]() |
提出日時 | 2017-04-01 12:31:33 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 818 bytes |
コンパイル時間 | 1,880 ms |
コンパイル使用メモリ | 167,068 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-04 04:24:37 |
合計ジャッジ時間 | 2,171 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 13 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define REP(i,a,b) for(int i=a;i<(int)b;i++) #define rep(i,n) REP(i,0,n) #define all(c) (c).begin(), (c).end() #define zero(a) memset(a, 0, sizeof a) #define minus(a) memset(a, -1, sizeof a) #define watch(a) { cout << #a << " = " << a << endl; } template<class T1, class T2> inline bool minimize(T1 &a, T2 b) { return b < a && (a = b, 1); } template<class T1, class T2> inline bool maximize(T1 &a, T2 b) { return a < b && (a = b, 1); } template<class T> void operator>> (istream& ist, vector<T>& vs) { for(auto& e: vs) cin >> e; } typedef long long ll; int const inf = 1<<29; int main() { int A, B; cin >> A >> B; for (int x = -10010; x <= 10010; x++) { if (A * x == B) { cout << x << endl; return 0; } } cout << "NO\n"; return 0; }