結果
問題 | No.1801 Segment Game |
ユーザー |
![]() |
提出日時 | 2022-01-07 22:15:50 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 147 ms / 2,000 ms |
コード長 | 2,873 bytes |
コンパイル時間 | 4,236 ms |
コンパイル使用メモリ | 251,788 KB |
最終ジャッジ日時 | 2025-01-27 09:30:57 |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 10 |
ソースコード
#include <bits/stdc++.h>/*#include <boost/multiprecision/cpp_dec_float.hpp>#include <boost/multiprecision/cpp_int.hpp>namespace mp = boost::multiprecision;using bint = mp::cpp_int;*/#include <atcoder/all>#include <iostream>#include <queue>#include <stack>#include <vector>#include <string>#include <set>#include <map>#include <random>#include <bitset>#define rep(i,n) for (int i = 0; i < int(n); ++i)#define repp(i,n,m) for (int i = m; i < int(n); ++i)#define repb(i,n) for (int i = int(n)-1; i >= 0; --i)#define fi first#define se second#define endl "\n"using namespace std;using namespace atcoder;using ll = long long;using ld = long double;using P = pair<int, int>;using PL = pair<long long, long long>;using Pxy = pair<long double, long double>;using pil = pair<int,ll>;using pli = pair<ll,int>;const int INF = 1001001007;const long long mod1 = 1000000007LL;const long long mod2 = 998244353LL;const ll inf = 2e18;const ld pi = 3.14159265358979323;const ld eps = 1e-7;const char _ = ' ';template<class T>istream &operator>>(istream &is,vector<T> &v){for(auto &e:v)is>>e;return is;}template<class T>ostream &operator<<(ostream &os,const vector<T> &v){if(v.size()!=0){rep(i,v.size())os<<v[i]<<(i+1==v.size()?"":" ");}return os;}template<class T>istream &operator>>(istream &is,vector<vector<T>> &v){for(auto &e:v)is>>e;return is;}template<class T>ostream &operator<<(ostream &os,const vector<vector<T>> &v){if(v.size()!=0){for(auto &e:v)os<<e;}return os;}template<typename T>bool range(T a,T b,T x){return (a<=x&&x<b);}template<typename T>bool rrange(T a,T b,T c,T d,T x,T y){return (range(a,c,x)&&range(b,d,y));}template<typename T>void rev(vector<T> &v){reverse(v.begin(),v.end());}void revs(string &s) {reverse(s.begin(),s.end());}template<typename T>void sor(vector<T> &v, int f=0){sort(v.begin(),v.end());if(f!=0) rev(v);}template<typename T>bool chmin(T &a,const T &b){if(a>b){a=b;return true;}return false;}template<typename T>bool chmax(T &a,const T &b){if(a<b){a=b;return true;}return false;}template<typename T>void eru(vector<T> &v){sor(v);v.erase(unique(v.begin(),v.end()),v.end());}template<typename T>T cel(T a,T b){if(a%b==0)return a/b;return a/b +1;}void o(){cout<<"!?"<<endl;}template<typename T>void o(T a){cout<<a<<endl;}template<typename T,typename U>void o2(T a,U b){cout<<a<<_<<b<<endl;}template<typename T,typename U>void o2(pair<T,U> a){o2(a.first,a.second);}template<typename T,typename U,typename V>void o3(T a,U b,V c){cout<<a<<_<<b<<_<<c<<endl;}template<typename T>void mout(T a){cout<<a.val()<<endl;}int main(){int t; cin >> t;vector<char> ans(t);rep(i,t){ll h, w, d; cin >> h >> w >> d;ll x = h * h + (w % 2 == 0 ? 0 : 1);ll y = w * w + (h % 2 == 0 ? 0 : 1);ans[i] = (min(x,y) <= d * d ? 'N' : 'S');}rep(i,t) o(ans[i]);}