Submission #905393
Source Code Expand
#include <bits/stdc++.h> using namespace std; #define FORE(i, a) for (auto i = a.begin(); i != a.end(); ++i) #define REPU(i, a, b) for (int i = (a); i < (b); ++i) #define REPD(i, a, b) for (int i = (a); i > (b); --i) #define MEM(a, x) memset(a, x, sizeof(a)) #define ALL(a) a.begin(), a.end() #define UNIQUE(a) a.erase(unique(ALL(a)), a.end()) vector<string> split(const string &s, char c) { vector<string> v; stringstream ss(s); string x; while (getline(ss, x, c)) v.push_back(x); return v; } #define DEBUG(args...) { vector<string> _v = split(#args, ','); err(_v.begin(), args); } void err(vector<string>::iterator it) {} template<typename T, typename... Args> void err(vector<string>::iterator it, T a, Args... args) { cerr << "[DEBUG] " << it -> substr((*it)[0] == ' ', it -> length()) << " = " << a << '\n'; err(++it, args...); } typedef long long ll; const int MOD = 1000000007; template<class T, class U> inline T tmin(T a, U b) { return (a < b) ? a : b; } template<class T, class U> inline T tmax(T a, U b) { return (a > b) ? a : b; } template<class T, class U> inline void amax(T &a, U b) { if (b > a) a = b; } template<class T, class U> inline void amin(T &a, U b) { if (b < a) a = b; } template<class T> inline T tabs(T a) { return (a > 0) ? a : -a; } template<class T> T gcd(T a, T b) { while (b != 0) { T c = a; a = b; b = c % b; } return a; } void possible() { cout << "Possible" << endl; exit(0); } void impossible() { cout << "Impossible" << endl; exit(0); } int main(int argc, char *argv[]) { ios_base::sync_with_stdio(false); int n; cin >> n; vector<int> a(n); REPU(i, 0, n) cin >> a[i]; sort(ALL(a)); int mx = a.back(); int hmx = (mx + 1) >> 1; if (a[0] == hmx && a[1] > hmx) possible(); else impossible(); return 0; }
Submission Info
Submission Time | |
---|---|
Task | C - Tree Restoring |
User | rantd |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 1837 Byte |
Status | WA |
Exec Time | 3 ms |
Memory | 384 KB |
Judge Result
Set Name | Sample | All | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 700 | ||||||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | example0, example1, example2, example3, example4, example5 |
All | almostline0, almostline1, almostline2, almostline3, can0, can1, can2, can3, can4, can5, can6, deg0, deg1, deg2, deg3, example0, example1, example2, example3, example4, example5, handmade0, line0, line1, line2, line3, ng10, ng11, ng12, ng13, ng20, ng21, ng22, ng23, plus0, plus1, plus2, plus3, rand0, rand1, rand2, star0, star1, star2, star3 |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
almostline0 | WA | 3 ms | 256 KB |
almostline1 | WA | 3 ms | 256 KB |
almostline2 | WA | 3 ms | 256 KB |
almostline3 | AC | 3 ms | 256 KB |
can0 | AC | 3 ms | 256 KB |
can1 | AC | 3 ms | 256 KB |
can2 | AC | 3 ms | 256 KB |
can3 | AC | 3 ms | 256 KB |
can4 | AC | 3 ms | 256 KB |
can5 | WA | 3 ms | 256 KB |
can6 | WA | 3 ms | 256 KB |
deg0 | WA | 3 ms | 256 KB |
deg1 | AC | 3 ms | 256 KB |
deg2 | WA | 3 ms | 256 KB |
deg3 | AC | 3 ms | 256 KB |
example0 | WA | 3 ms | 256 KB |
example1 | AC | 3 ms | 256 KB |
example2 | AC | 2 ms | 256 KB |
example3 | AC | 3 ms | 384 KB |
example4 | AC | 3 ms | 256 KB |
example5 | AC | 3 ms | 256 KB |
handmade0 | WA | 3 ms | 256 KB |
line0 | WA | 3 ms | 256 KB |
line1 | AC | 3 ms | 256 KB |
line2 | WA | 3 ms | 256 KB |
line3 | AC | 3 ms | 384 KB |
ng10 | AC | 3 ms | 256 KB |
ng11 | AC | 3 ms | 256 KB |
ng12 | AC | 3 ms | 256 KB |
ng13 | AC | 3 ms | 256 KB |
ng20 | AC | 3 ms | 256 KB |
ng21 | WA | 3 ms | 256 KB |
ng22 | AC | 3 ms | 384 KB |
ng23 | WA | 3 ms | 256 KB |
plus0 | AC | 3 ms | 256 KB |
plus1 | AC | 3 ms | 256 KB |
plus2 | AC | 3 ms | 256 KB |
plus3 | AC | 3 ms | 256 KB |
rand0 | AC | 3 ms | 256 KB |
rand1 | AC | 3 ms | 256 KB |
rand2 | AC | 3 ms | 256 KB |
star0 | AC | 3 ms | 256 KB |
star1 | WA | 3 ms | 256 KB |
star2 | AC | 3 ms | 256 KB |
star3 | WA | 3 ms | 256 KB |