結果

問題 No.1801 Segment Game
ユーザー hiro71687khiro71687k
提出日時 2023-04-17 16:06:15
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 258 ms / 2,000 ms
コード長 1,132 bytes
コンパイル時間 5,014 ms
コンパイル使用メモリ 254,720 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-20 20:16:38
合計ジャッジ時間 9,452 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 255 ms
5,376 KB
testcase_02 AC 258 ms
5,376 KB
testcase_03 AC 250 ms
5,376 KB
testcase_04 AC 252 ms
5,376 KB
testcase_05 AC 249 ms
5,376 KB
testcase_06 AC 252 ms
5,376 KB
testcase_07 AC 255 ms
5,376 KB
testcase_08 AC 253 ms
5,376 KB
testcase_09 AC 257 ms
5,376 KB
testcase_10 AC 2 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using ll=long long;
using ld=long double;
ld pie=3.141592653589793;
ll inf=1444999999;
ll mod=998244353;
int main(){
    ll t;
    cin >>t;
    vector<char>ans;
    for (ll i = 0; i < t; i++)
    {
        ll h,w,d;
        cin >> h >> w >> d;
        if (h*h+w*w<d*d)
        {
            ans.push_back('N');
            continue;
        }
        if (h%2==0)
        {
            if (w<=d)
            {
                ans.push_back('N');
                continue;
            }
        }else{
            if (w*w+1<=d*d)
            {
                ans.push_back('N');
                continue;
            }
        }
        if (w%2==0)
        {
            if (h<=d)
            {
                ans.push_back('N');
                continue;
            }
        }else{
            if (h*h+1<=d*d)
            {
                ans.push_back('N');
                continue;
            }
        }
        ans.push_back('S');
    }
    for (ll i = 0; i <  ans.size(); i++)
    {
        cout << ans[i] << endl;
    }
    
}
0