QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#742637 | #9525. Welcome to Join the Online Meeting! | feng_Lrefrain | WA | 0ms | 3608kb | C++20 | 1.9kb | 2024-11-13 16:59:00 | 2024-11-13 16:59:01 |
Judging History
answer
/*
* ============================
* @Author: feng_Lrefrain
* @DateTime: 2024-11-13 16:38:31
* ============================
*/
#include <bits/stdc++.h>
#define int long long
#define vi vector<int>
#define pii pair<int,int>
#define fi first
#define se second
#define pb push_back
#define rep(I,S,N) for(int I=(S);I<(N);++I)
#define per(I,S,N) for(int I=(N)-1;I>=(S);--I)
#define all(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
using namespace std;
typedef long long ll;
typedef double db;
//int dx[] = {-1, 0, 1, 0}, dy[] = {0, 1, 0, -1};
//inline ll gcd(ll a,ll b) {return b?gcd(b,a%b):a;}
//inline ll lcm(ll a,ll b) {return a/gcd(a,b)*b;}
//inline ll ksm(ll a,ll b,ll p) {ll ans=1;while(b){if(b&1)ans=(ans*a)%p;b>>=1;a=(a*a)%p;}return ans%p;}
//inline ll lowbit(int x) {return x&(-x);}
//inline int read() {
// int x = 0;
// char ch = getchar();
// while (ch < '0' || ch > '9') ch = getchar();
// while (ch <= '9' && ch >= '0') {
// x = (x << 1) + (x << 3) + (ch ^ 48);
// ch = getchar();
// }
// return x;
//}
const int N = 2e5 + 10, M = 998244353, MM = 1e9 + 7, inf = 1e18;
void solve() {
int n, m, k; cin >> n >> m >> k;
map<int, int> mp;
vector<vi> a(n + 1);
rep(i, 0, k) {
int tmp; cin >> tmp;
mp[tmp] = 1;
}
rep(i, 0, m) {
int u, v; cin >> u >> v;
if (!mp[u]) a[u].pb(v);
}
int sum = 0, cnt = 0;
rep(i, 1, n + 1) {
if (SZ(a[i])) {
sum += SZ(a[i]);
cnt ++;
}
// cout << SZ(a[i]) << " ";
}
cout << sum << '\n';
if (sum < n) {
cout << "No\n";
return;
}
cout << "Yes\n" << cnt << '\n';
rep(i, 1, n + 1) {
if (SZ(a[i])) {
cout << i << " " << SZ(a[i]) << " ";
for (auto &j : a[i]) {
cout << j << " ";
}
}
cout << '\n';
}
}
/*
*/
signed main() {
cin.tie(nullptr)->sync_with_stdio(false);
int _ = 1;
// cin >> _;
while (_ --) {
solve();
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3608kb
input:
4 5 2 3 4 1 2 1 3 2 3 3 4 2 4
output:
4 Yes 2 1 2 2 3 2 2 3 4
result:
wrong answer Token parameter [name=pans] equals to "4", doesn't correspond to pattern "Yes|No"