Submission #2213803


Source Code Expand

#define _CRT_SECURE_NO_WARNINGS
#include "bits/stdc++.h"
#include <random>
using namespace std;


//呪文
#define DUMPOUT cerr
#define dump(...) DUMPOUT<<"  ";DUMPOUT<<#__VA_ARGS__<<" :["<<__LINE__<<":"<<__FUNCTION__<<"]"<<endl;DUMPOUT<<"    ";dump_func(__VA_ARGS__)

typedef unsigned uint; typedef long long ll; typedef unsigned long long ull; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef pair<double, double> pdd; typedef pair<string, string> pss;
template <typename _KTy, typename _Ty> ostream& operator << (ostream& ostr, const pair<_KTy, _Ty>& m) { ostr << "{" << m.first << ", " << m.second << "}"; return ostr; }
template <typename _KTy, typename _Ty> ostream& operator << (ostream& ostr, const map<_KTy, _Ty>& m) { if (m.empty()) { ostr << "{ }"; return ostr; } ostr << "{" << *m.begin(); for (auto itr = ++m.begin(); itr != m.end(); itr++) { ostr << ", " << *itr; } ostr << "}"; return ostr; }
template <typename _Ty> ostream& operator << (ostream& ostr, const vector<_Ty>& v) { if (v.empty()) { ostr << "{ }"; return ostr; } ostr << "{" << v.front(); for (auto itr = ++v.begin(); itr != v.end(); itr++) { ostr << ", " << *itr; }	ostr << "}"; return ostr; }
template <typename _Ty> ostream& operator << (ostream& ostr, const set<_Ty>& s) { if (s.empty()) { ostr << "{ }"; return ostr; } ostr << "{" << *(s.begin()); for (auto itr = ++s.begin(); itr != s.end(); itr++) { ostr << ", " << *itr; }	ostr << "}"; return ostr; }
template <typename _Ty> ostream& operator << (ostream& ostr, const stack<_Ty>& s) { if (s.empty()) { ostr << "{ }"; return ostr; } stack<_Ty> t(s); ostr << "{" << t.top(); t.pop(); while (!t.empty()) { ostr << ", " << t.top(); t.pop(); } ostr << "}";	return ostr; }
template <typename _Ty> ostream& operator << (ostream& ostr, const list<_Ty>& l) { if (l.empty()) { ostr << "{ }"; return ostr; } ostr << "{" << l.front(); for (auto itr = ++l.begin(); itr != l.end(); ++itr) { ostr << ", " << *itr; } ostr << "}"; return ostr; }
template <typename _KTy, typename _Ty> istream& operator >> (istream& istr, pair<_KTy, _Ty>& m) { istr >> m.first >> m.second; return istr; }
template <typename _Ty> istream& operator >> (istream& istr, vector<_Ty>& v) { for (size_t i = 0; i < v.size(); i++) istr >> v[i]; return istr; }
namespace aux { // print tuple
	template<typename Ty, unsigned N, unsigned L> struct tp { static void print(ostream& os, const Ty& v) { os << get<N>(v) << ", "; tp<Ty, N + 1, L>::print(os, v); } };
	template<typename Ty, unsigned N> struct tp<Ty, N, N> { static void print(ostream& os, const Ty& value) { os << get<N>(value); } };
}
template<typename... Tys> ostream& operator<<(ostream& os, const tuple<Tys...>& t) { os << "{"; aux::tp<tuple<Tys...>, 0, sizeof...(Tys)-1>::print(os, t); os << "}"; return os; }

template<typename A, size_t N, typename T> inline void Fill(A(&array)[N], const T &val) { std::fill((T*)array, (T*)(array + N), val); }

void dump_func() { DUMPOUT << endl; }
template <class Head, class... Tail> void dump_func(Head&& head, Tail&&... tail) { DUMPOUT << head; if (sizeof...(Tail) == 0) { DUMPOUT << " "; } else { DUMPOUT << ", "; } dump_func(std::move(tail)...); }

#define PI 3.14159265358979323846
#define EPS 1e-11
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define all(x) (x).begin(), (x).end()
#define SZ(x) ((int)(x).size())
#define fake false
#ifdef VC
#define scanf scanf_s
#endif


int main() {
	int t; cin >> t;
	int n; cin >> n;
	int a[105] = {};
	for (int i = 0; i < n; i++) cin >> a[i];
	a[n] = 105;
	int m; cin >> m;
	int b[105] = {};
	for (int i = 0; i < m; i++) cin >> b[i];
	bool used[105] = {};
	int st = 0;
	bool flg = true;
	for (int i = 0; i < m; i++) {
		while (b[i] - t > a[st]) st++;
		if (b[i] < a[st]) {
			flg = false;
			break;
		}
		st++;
	}
	cout << (flg?"yes":"no") << endl;
	return 0;
}

Submission Info

Submission Time
Task C - おいしいたこ焼きの売り方
User takoyaki
Language C++14 (GCC 5.4.1)
Score 100
Code Size 3905 Byte
Status AC
Exec Time 1 ms
Memory 256 KB

Judge Result

Set Name All
Score / Max Score 100 / 100
Status
AC × 35
Set Name Test Cases
All rand0.txt, rand1.txt, rand10.txt, rand11.txt, rand12.txt, rand13.txt, rand14.txt, rand15.txt, rand16.txt, rand17.txt, rand18.txt, rand19.txt, rand2.txt, rand20.txt, rand21.txt, rand22.txt, rand23.txt, rand24.txt, rand25.txt, rand26.txt, rand27.txt, rand28.txt, rand29.txt, rand3.txt, rand4.txt, rand5.txt, rand6.txt, rand7.txt, rand8.txt, rand9.txt, s1.txt, s2.txt, s3.txt, s4.txt, s5.txt
Case Name Status Exec Time Memory
rand0.txt AC 1 ms 256 KB
rand1.txt AC 1 ms 256 KB
rand10.txt AC 1 ms 256 KB
rand11.txt AC 1 ms 256 KB
rand12.txt AC 1 ms 256 KB
rand13.txt AC 1 ms 256 KB
rand14.txt AC 1 ms 256 KB
rand15.txt AC 1 ms 256 KB
rand16.txt AC 1 ms 256 KB
rand17.txt AC 1 ms 256 KB
rand18.txt AC 1 ms 256 KB
rand19.txt AC 1 ms 256 KB
rand2.txt AC 1 ms 256 KB
rand20.txt AC 1 ms 256 KB
rand21.txt AC 1 ms 256 KB
rand22.txt AC 1 ms 256 KB
rand23.txt AC 1 ms 256 KB
rand24.txt AC 1 ms 256 KB
rand25.txt AC 1 ms 256 KB
rand26.txt AC 1 ms 256 KB
rand27.txt AC 1 ms 256 KB
rand28.txt AC 1 ms 256 KB
rand29.txt AC 1 ms 256 KB
rand3.txt AC 1 ms 256 KB
rand4.txt AC 1 ms 256 KB
rand5.txt AC 1 ms 256 KB
rand6.txt AC 1 ms 256 KB
rand7.txt AC 1 ms 256 KB
rand8.txt AC 1 ms 256 KB
rand9.txt AC 1 ms 256 KB
s1.txt AC 1 ms 256 KB
s2.txt AC 1 ms 256 KB
s3.txt AC 1 ms 256 KB
s4.txt AC 1 ms 256 KB
s5.txt AC 1 ms 256 KB