結果
問題 | No.485 方程式のお勉強 |
ユーザー |
![]() |
提出日時 | 2017-02-24 23:30:55 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 706 bytes |
コンパイル時間 | 1,460 ms |
コンパイル使用メモリ | 166,880 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-04 03:31:53 |
合計ジャッジ時間 | 2,108 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 13 |
ソースコード
#include<bits/stdc++.h>using namespace std;typedef long long LL;struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star;#define fin "\n"#define FOR(i,bg,ed) for(int i=(bg);i<(ed);i++)#define REP(i,n) FOR(i,0,n)#define fi first#define se second#define pb push_back#define DEBUG if(0)template <typename T>inline void chmin(T &l,T r){l=min(l,r);}template <typename T>inline void chmax(T &l,T r){l=max(l,r);}template <typename T>istream& operator>>(istream &is,vector<T> &v){for(auto &it:v)is>>it;return is;}int main(){int a,b;cin>>a>>b;int res=0;FOR(x,-300,300)if(a*x==b)res=x;if(res)cout<<res<<endl;else cout<<"NO"<<endl;return 0;}