Submission #2233617
Source Code Expand
#include "bits/stdc++.h" using namespace std; #define FOR(i,a,b) for(int i =(a);i<(b);i++) #define REP(i,n) for(int i=0;i<(n);i++) #define REPm(i,n) for(int i=(n)-1;i>=0;i--) #define REP1(i,n) for(int i=1;i<=(n);i++) typedef long long ll; int main(){ int N,M; vector<int> D; vector<int> T; int input; cin >> N; REP(i,N){ cin >> input; D.push_back(input); } cin >> M; REP(i,M){ cin >> input; T.push_back(input); } sort(D.begin(),D.end()); sort(T.begin(),T.end()); int index1 = 0; int index2 = 0; while(index1 < N && index2 < M){ if(D[index1] > T[index2]){ break; } if(D[index1] == T[index2]) index2++; index1++; } if(index2 == M) cout << "YES" << endl; else cout << "NO" << endl; return 0; }
Submission Info
Submission Time | |
---|---|
Task | B - Problem Set |
User | yankeiori |
Language | C++14 (GCC 5.4.1) |
Score | 200 |
Code Size | 880 Byte |
Status | AC |
Exec Time | 185 ms |
Memory | 2548 KB |
Judge Result
Set Name | sample | dataset1 | dataset2 | ||||||
---|---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 100 / 100 | 100 / 100 | ||||||
Status |
|
|
|
Set Name | Test Cases |
---|---|
sample | sample-01.txt, sample-02.txt, sample-03.txt, sample-04.txt |
dataset1 | sample-01.txt, sample-02.txt, sample-03.txt, sample-04.txt, 01-01.txt, 01-02.txt, 01-03.txt, 01-04.txt, 01-05.txt, 01-06.txt, 01-07.txt, 01-08.txt, 01-09.txt |
dataset2 | sample-01.txt, sample-02.txt, sample-03.txt, sample-04.txt, 01-01.txt, 01-02.txt, 01-03.txt, 01-04.txt, 01-05.txt, 01-06.txt, 01-07.txt, 01-08.txt, 01-09.txt, 02-01.txt, 02-02.txt, 02-03.txt, 02-04.txt, 02-05.txt, 02-06.txt, 02-07.txt, 02-08.txt, 02-09.txt, 02-10.txt, sample-01.txt, sample-02.txt, sample-03.txt, sample-04.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
01-01.txt | AC | 1 ms | 256 KB |
01-02.txt | AC | 1 ms | 256 KB |
01-03.txt | AC | 1 ms | 256 KB |
01-04.txt | AC | 1 ms | 256 KB |
01-05.txt | AC | 1 ms | 256 KB |
01-06.txt | AC | 1 ms | 256 KB |
01-07.txt | AC | 1 ms | 256 KB |
01-08.txt | AC | 1 ms | 256 KB |
01-09.txt | AC | 1 ms | 256 KB |
02-01.txt | AC | 93 ms | 1400 KB |
02-02.txt | AC | 98 ms | 1400 KB |
02-03.txt | AC | 185 ms | 2548 KB |
02-04.txt | AC | 97 ms | 1400 KB |
02-05.txt | AC | 185 ms | 2548 KB |
02-06.txt | AC | 85 ms | 1400 KB |
02-07.txt | AC | 167 ms | 2548 KB |
02-08.txt | AC | 168 ms | 2548 KB |
02-09.txt | AC | 169 ms | 2548 KB |
02-10.txt | AC | 168 ms | 2548 KB |
sample-01.txt | AC | 1 ms | 256 KB |
sample-02.txt | AC | 1 ms | 256 KB |
sample-03.txt | AC | 1 ms | 256 KB |
sample-04.txt | AC | 1 ms | 256 KB |