結果
| 問題 |
No.1801 Segment Game
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-01-07 22:17:25 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 281 ms / 2,000 ms |
| コード長 | 778 bytes |
| コンパイル時間 | 2,298 ms |
| コンパイル使用メモリ | 193,328 KB |
| 最終ジャッジ日時 | 2025-01-27 09:32:46 |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 10 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main(){
int yuki;
cin >> yuki;
while(yuki--){
long long H, W, D;
cin >> H >> W >> D;
long long w = W * W;
long long h = H * H;
if(H % 2 == 0 && W % 2 == 0){
if(D >= H || D >= W) cout << 'N' << endl;
else cout << 'S' << endl;
}
else if(H % 2 == 0){
if(D >= W || D * D >= 1 + h) cout << 'N' << endl;
else cout << 'S' << endl;
}
else if(W % 2 == 0){
if(D >= H || D * D >= 1 + w) cout << 'N' << endl;
else cout << 'S' << endl;
}
else{
if(D * D >= 1 + w || D * D >= 1 + h) cout << 'N' << endl;
else cout << 'S' << endl;
}
}
}