結果
問題 |
No.8081 HQ9+
|
ユーザー |
|
提出日時 | 2021-04-01 20:20:27 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 674 bytes |
コンパイル時間 | 1,495 ms |
コンパイル使用メモリ | 167,556 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-18 01:57:54 |
合計ジャッジ時間 | 2,293 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 15 WA * 6 |
ソースコード
#include<bits/stdc++.h> using namespace std; using ll = long long int; using ld = long double; #define pow(n,m) powl(n,m); #define sqrt(n) sqrtl(n); const ll MAX = 5000000000000000000; const ll MOD = 1000000007; //998244353; void randinit(){srand((unsigned)time(NULL));} int main(){ ll N; string S; cin >> N >> S; for(ll i = 0;i < N;i++){ if(S[i] != 'Q'){ cout << -1 << endl; return 0; } } for(ll i = 0;i <= N;i++){ if(i * i == N){ for(ll j = 0;j < i;j++){ cout << "Q"; } cout << endl; return 0; } } cout << -1 << endl; }