結果
| 問題 | No.3661 Grid Paint Game |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-08-30 14:53:47 |
| 言語 | C++17 (gcc 15.3.0 + boost 1.92.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 864 bytes |
| 記録 | |
| コンパイル時間 | 1,258 ms |
| コンパイル使用メモリ | 214,720 KB |
| 実行使用メモリ | 6,272 KB |
| 最終ジャッジ日時 | 2026-08-30 14:54:33 |
| 合計ジャッジ時間 | 2,519 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 1 WA * 7 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
void solve(int H,int W){
vector<vector<int>> C(H,vector<int>(W,-2));
for(int t=0; ; t++){
if(t == H) break;
for(int k=0; k<W; k++) C.at(t).at(k) = 1;
if(t == W) break;
for(int i=0; i<H; i++) C.at(i).at(t) = -1;
}
int s = 0;
for(int i=0; i<H; i++) for(int k=0; k<W; k++) s += C.at(i).at(k);
cout << H << " " << W << "\n";
if(s >= 0) cout << "sepa ";
else cout << "ryota ";
}
int main(){
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int T; cin >> T;
while(T--){
long long H,W; cin >> H >> W;
long long n = min(H,W);
long long b = n*(n-1)/2,w = n*(n+1)/2;
if(H <= W) b += (W-H)*H;
else w += (H-W)*W,w -= W,b += W;
if(b < w) cout << "ryota\n";
else cout << "sepa\n";
}
}