Submission #1551876


Source Code Expand

#include <bits/stdc++.h>
using namespace std;
//#define int long long

typedef long long ll;
typedef unsigned long long ull;
typedef unsigned __int128 HASH;
typedef pair<int,int> pii;
typedef pair<ll, ll> pll;
typedef pair<ull, ull> pullull;
typedef pair<ll,int> plli;
typedef pair<double, int> pdbi;
typedef pair<int,pii> pipii;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef vector<pii> vpii;

#define rep(i,n) for (int i=0;i<(n);i++)
#define rep2(i,a,b) for (int i=(a);i<(b);i++)
#define rrep(i,n) for (int i=(n);i>0;i--)
#define rrep2(i,a,b) for (int i=(a);i>b;i--)
#define pb push_back
#define fi first
#define se second
#define all(a) (a).begin(),(a).end()

const ll hmod1 = 999999937;
const ll hmod2 = 1000000000 + 9;
const ll INF = 1<<30;
const ll mod = 1000000000 + 7;
const int dx4[4] = {1, 0, -1, 0};
const int dy4[4] = {0, 1, 0, -1};
const int dx8[8] = {1, 1, 1, 0, 0, -1, -1, -1};
const int dy8[8] = {0, 1, -1, 1, -1, 0, 1, -1};
const double pi = 3.141592653589793;

int n;
string B[105];

signed main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> n;
    rep(i, n) cin >> B[i];
    int distx = 0;
    int disty = 0;
    rep(i, n)rep(j, n) {
        if (B[i][j] == 'X') {
            distx += i;
        }
        else if (B[i][j] == 'Y') {
            disty += n - 1 - i;
        }
    }
    if (distx > disty) {
        cout << 'X' << endl;
    }
    else if (disty > distx) {
        cout << 'Y' << endl;
    }
    else cout << "Impossbile" << endl;
}

Submission Info

Submission Time
Task D - FU
User roto_37
Language C++14 (GCC 5.4.1)
Score 0
Code Size 1607 Byte
Status WA
Exec Time 1 ms
Memory 256 KB

Judge Result

Set Name All
Score / Max Score 0 / 100
Status
AC × 20
WA × 32
Set Name Test Cases
All 00-sample-00, 00-sample-01, largest-00, largest-01, largest-02, largest-03, largest-04, random-00-006, random-01-042, random-02-045, random-03-042, random-04-004, random-05-100, random-06-013, random-07-091, random-08-021, random-09-011, random-10-100, random-11-009, random-12-031, random-13-079, random-14-060, random-15-044, random-16-036, random-17-075, random-18-087, random-19-064, random-20-010, random-21-051, random-22-087, random-23-100, random-24-051, random-25-025, random-26-044, random-27-045, random-28-083, random-29-031, random-30-059, random-31-016, random-32-019, random-33-038, random-34-056, random-35-077, random-36-043, random-37-009, random-38-073, random-39-099, random-40-079, random-41-100, sample-00, sample-01, smallest-00
Case Name Status Exec Time Memory
00-sample-00 AC 1 ms 256 KB
00-sample-01 WA 1 ms 256 KB
largest-00 AC 1 ms 256 KB
largest-01 WA 1 ms 256 KB
largest-02 AC 1 ms 256 KB
largest-03 AC 1 ms 256 KB
largest-04 WA 1 ms 256 KB
random-00-006 WA 1 ms 256 KB
random-01-042 WA 1 ms 256 KB
random-02-045 AC 1 ms 256 KB
random-03-042 AC 1 ms 256 KB
random-04-004 WA 1 ms 256 KB
random-05-100 WA 1 ms 256 KB
random-06-013 AC 1 ms 256 KB
random-07-091 WA 1 ms 256 KB
random-08-021 WA 1 ms 256 KB
random-09-011 WA 1 ms 256 KB
random-10-100 WA 1 ms 256 KB
random-11-009 WA 1 ms 256 KB
random-12-031 AC 1 ms 256 KB
random-13-079 WA 1 ms 256 KB
random-14-060 WA 1 ms 256 KB
random-15-044 AC 1 ms 256 KB
random-16-036 AC 1 ms 256 KB
random-17-075 WA 1 ms 256 KB
random-18-087 AC 1 ms 256 KB
random-19-064 WA 1 ms 256 KB
random-20-010 WA 1 ms 256 KB
random-21-051 WA 1 ms 256 KB
random-22-087 WA 1 ms 256 KB
random-23-100 WA 1 ms 256 KB
random-24-051 AC 1 ms 256 KB
random-25-025 WA 1 ms 256 KB
random-26-044 WA 1 ms 256 KB
random-27-045 AC 1 ms 256 KB
random-28-083 AC 1 ms 256 KB
random-29-031 WA 1 ms 256 KB
random-30-059 WA 1 ms 256 KB
random-31-016 AC 1 ms 256 KB
random-32-019 WA 1 ms 256 KB
random-33-038 AC 1 ms 256 KB
random-34-056 WA 1 ms 256 KB
random-35-077 WA 1 ms 256 KB
random-36-043 WA 1 ms 256 KB
random-37-009 WA 1 ms 256 KB
random-38-073 WA 1 ms 256 KB
random-39-099 AC 1 ms 256 KB
random-40-079 AC 1 ms 256 KB
random-41-100 AC 1 ms 256 KB
sample-00 AC 1 ms 256 KB
sample-01 WA 1 ms 256 KB
smallest-00 WA 1 ms 256 KB