QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#771735 | #1774. Customs Controls | e_kid | WA | 1ms | 3668kb | C++14 | 1.4kb | 2024-11-22 15:20:48 | 2024-11-22 15:20:50 |
Judging History
answer
// Problem: B. 【NOIP Round #3】抓内鬼
// Contest: Public Judge - Public NOIP Round #3 (Div. 1, 提高)
// URL: https://pjudge.ac/contest/1030/problem/21694
// Memory Limit: 1024 MB
// Time Limit: 3000 ms
//
// Powered by CP Editor (https://cpeditor.org)
#include<bits/stdc++.h>
#define int long long
#define rep(i,a,b) for(int i = (a);i<=(b);i++)
#define lep(i,a,b) for(int i = (a);i>=(b);i--)
using namespace std;
const int N = 2e5+10;
int n,m,k,flag,u,v;
int t[N];
signed main(){
ios::sync_with_stdio(false);
cin.tie(0),cout.tie(0);
cin>>n>>m>>k;
if(k == 1){
rep(i,1,n) cin>>t[i];
rep(i,1,m){
cin>>u>>v;
if(u>v) swap(u,v);
if(u == 1 && v == n) flag = 1;
}
if(flag && n<=2) cout<<"impossible";
else{
if(!flag){
cout<<'U';
rep(i,1,n-1) cout<<'P';
}
else{
cout<<"PU";
rep(i,1,n-2) cout<<'P';
}
}
}
else{
rep(i,1,n) cin>>t[i];
rep(i,1,m){
cin>>u>>v;
if(u>v) swap(u,v);
if(u == 1 && v == n) flag = 1;
}
if(flag && n<=2 && k == 1) cout<<"impossible";
else{
if(!flag){
cout<<'P';
rep(i,1,n-k-1) cout<<'P';
rep(i,1,k) cout<<'U';
}
else{
if(n<=2){
if(!k) cout<<"PP";
else cout<<"UU";
}
else{
cout<<'P';
rep(i,1,n-k-2) cout<<'P';
rep(i,1,k) cout<<'U';
cout<<'P';
}
}
}
}
return 0;
}
詳細信息
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3668kb
input:
5 10 2 1 1 1 1 1 3 4 5 4 3 1 4 1 3 5 2 1 2 4 2 5 1 5 2 3
output:
PPUUP
result:
wrong answer invalid character