This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
#define FAST_IO ios_base::sync_with_stdio(0); cin.tie(nullptr)
#define FOR(i, a, b) for (int i = (a); i <= (b); i++)
#define REP(n) FOR(O, 1, (n))
#define pb push_back
#define f first
#define s second
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vii;
const int MAXN = 300100;
int n;
vii seq;
int main()
{
FAST_IO;
cin >> n;
REP(n) {
int a, b; cin >> a >> b;
seq.pb({a,b});
}
bool ok = true;
FOR(i, 1,n-1) if (seq[i].f != seq[0].f) ok = false;
if (ok && n > 1 && seq[0].f > 1) {
cout << "2\n1\n" << min(n, seq[0].f) << "\n";
} else cout << "1\n1\n";
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |