Submission #3821358


Source Code Expand

#include <bits/stdc++.h>
using namespace std;
#define _MACRO(_1, _2, _3, NAME, ...) NAME
#define _repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define _rep(i,n) _repl(i,0,n)
#define rep(...) _MACRO(__VA_ARGS__, _repl, _rep)(__VA_ARGS__)
#define pb push_back
#define all(x) begin(x),end(x)
#define uniq(x) sort(all(x)),(x).erase(unique(all(x)),end(x))
#ifdef LOCAL
#define dbg(...) _dbg(#__VA_ARGS__, __VA_ARGS__)
void _dbg(string){cerr<<endl;}
template<class H,class... T> void _dbg(string s,H h,T... t){int l=s.find(',');cerr<<s.substr(0,l)<<" = "<<h<<", ";_dbg(s.substr(l+1),t...);}
template<class T,class U> ostream& operator<<(ostream &o, const pair<T,U> &p){o<<"("<<p.first<<","<<p.second<<")";return o;}
template<class T> ostream& operator<<(ostream &o, const vector<T> &v){o<<"[";for(T t:v){o<<t<<",";}o<<"]";return o;}
#else
#define dbg(...) {}
#endif

bool solve(){
  int n,m,x,y;
  cin>>n>>m>>x>>y;
  vector<int> u(n),v(m);
  rep(i,n) cin>>u[i];
  rep(i,m) cin>>v[i];

  for(int z=x+1; z<=y; z++){
    bool ok = true;
    rep(i,n) ok &= u[i] < z;
    rep(i,m) ok &= v[i] >= z;
    if(ok) return true;
  }
  return false;
}

int main(){
  cout << (solve() ? "No War" : "War") << endl;

  return 0;
}

Submission Info

Submission Time
Task B - 1 Dimensional World's Tale
User tossy
Language C++14 (GCC 5.4.1)
Score 200
Code Size 1251 Byte
Status AC
Exec Time 1 ms
Memory 256 KB

Judge Result

Set Name All Sample
Score / Max Score 200 / 200 0 / 0
Status
AC × 17
AC × 3
Set Name Test Cases
All hand1, hand2, max1, max2, max3, max4, max5, max7, max8, normal1, normal2, normal3, normal4, normal5, sample_01, sample_02, sample_03
Sample sample_01, sample_02, sample_03
Case Name Status Exec Time Memory
hand1 AC 1 ms 256 KB
hand2 AC 1 ms 256 KB
max1 AC 1 ms 256 KB
max2 AC 1 ms 256 KB
max3 AC 1 ms 256 KB
max4 AC 1 ms 256 KB
max5 AC 1 ms 256 KB
max7 AC 1 ms 256 KB
max8 AC 1 ms 256 KB
normal1 AC 1 ms 256 KB
normal2 AC 1 ms 256 KB
normal3 AC 1 ms 256 KB
normal4 AC 1 ms 256 KB
normal5 AC 1 ms 256 KB
sample_01 AC 1 ms 256 KB
sample_02 AC 1 ms 256 KB
sample_03 AC 1 ms 256 KB