Submission #1663998
Source Code Expand
/* You lost the game. */
#include <list>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <algorithm>
#include <sstream>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <climits>
#include <cfloat>
#include <numeric>
#include <cassert>
#include <unordered_set>
#include <unordered_map>
#include <fstream>
#include <vector>
#include <pthread.h>
#define fin(i,n) for (int i = (L) 0; i < n; i++)
#define fin2(i,a,b) for (int i = a; i < b; i++)
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define mod 1000000007
#define PI 3.1415926535897932384626
#define si(n) scanf("%d", &n)
#define sii(n,m) scanf("%d %d", &n, &m)
#define siii(n,m,k) scanf("%d %d %d", &n, &m, &k)
#define sl(n) scanf("%lld", &n)
#define sll(n,m) scanf("%lld %lld", &n, &m)
#define slll(n,m,k) scanf("%lld %lld %lld", &n, &m, &k)
#define sd(n) scanf("%lf", &n)
#define sdd(n,m) scanf("%lf %lf", &n, &m)
#define sddd(n,m,k) scanf("%lf %lf %lf", &n, &m, &k)
#define sc(c) scanf("%c", &c)
#define ss(s) scanf("%s", s)
#define sai(t,n) fin(i,n) { scanf("%d", &t[i]); }
#define sal(t,n) fin(i,n) { scanf("%lld", &t[i]); }
#define sad(t,n) fin(i,n) { scanf("%lf", &t[i]); }
#define pc(n) printf("%c\n", n)
#define ps(s) printf("%s\n", s)
#define pi(n) printf("%d\n", n)
#define pii(n,m) printf("%d %d\n", n, m)
#define pl(n) printf("%lld\n", n)
#define pll(n,m) printf("%lld %lld\n", n, m)
#define plll(n,m,k) printf("%lld %lld %lld\n", n, m, k)
#define pd(n) printf("%lf\n", n)
#define pdd(n,m) printf("%lf %lf\n", n, m)
#define pai(t,n) fin(i,n) { printf("%d ", t[i]); } printf("\n")
#define pal(t,n) fin(i,n) { printf("%lld ", t[i]); } printf("\n")
#define pad(t,n) fin(i,n) { printf("%lf ", t[i]); } printf("\n")
#define OK ps("OK")
#define OK1 ps("OK1")
#define OK2 ps("OK2")
#define L long long int
#define D double
#define C char
#define PII pair<int, int>
#define VPII vector<PII>
#define VL vector<L>
#define VI vector<int>
#define VVI vector<VI>
#define VD vector<D>
#define VVD vector<VD>
#define VVPII vector<VPII>
#define VC vector<C>
using namespace std;
int main() {
//freopen("input.txt", "r", stdin);
//freopen("output.txt", "w", stdout);
int n, m, t;
map<int, int> tb;
si(n);
fin(i, n) { si(t); if (tb.find(t) == tb.end()) { tb[t] = 1; } else { tb[t]++; } }
si(m);
fin(i, m) {
si(t);
if (tb.find(t) == tb.end()) { ps("NO"); return 0; }
else if (tb[t] == 0) { ps("NO"); return 0; }
else { tb[t]--; }
}
ps("YES");
return 0;
}
Submission Info
| Submission Time |
|
| Task |
B - Problem Set |
| User |
noelnadal |
| Language |
C++14 (GCC 5.4.1) |
| Score |
200 |
| Code Size |
2686 Byte |
| Status |
AC |
| Exec Time |
233 ms |
| Memory |
9600 KiB |
Compile Error
./Main.cpp: In function ‘int main()’:
./Main.cpp:86:10: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
si(n);
^
./Main.cpp:87:22: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
fin(i, n) { si(t); if (tb.find(t) == tb.end()) { tb[t] = 1; } else { tb[t]++; } }
^
./Main.cpp:88:10: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
si(m);
^
./Main.cpp:90:14: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
si(t);
^
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 KiB |
| 01-02.txt |
AC |
1 ms |
256 KiB |
| 01-03.txt |
AC |
1 ms |
256 KiB |
| 01-04.txt |
AC |
1 ms |
256 KiB |
| 01-05.txt |
AC |
1 ms |
256 KiB |
| 01-06.txt |
AC |
1 ms |
256 KiB |
| 01-07.txt |
AC |
1 ms |
256 KiB |
| 01-08.txt |
AC |
1 ms |
256 KiB |
| 01-09.txt |
AC |
1 ms |
256 KiB |
| 02-01.txt |
AC |
124 ms |
9600 KiB |
| 02-02.txt |
AC |
136 ms |
9600 KiB |
| 02-03.txt |
AC |
233 ms |
9600 KiB |
| 02-04.txt |
AC |
137 ms |
9600 KiB |
| 02-05.txt |
AC |
136 ms |
9600 KiB |
| 02-06.txt |
AC |
27 ms |
256 KiB |
| 02-07.txt |
AC |
53 ms |
256 KiB |
| 02-08.txt |
AC |
55 ms |
256 KiB |
| 02-09.txt |
AC |
53 ms |
256 KiB |
| 02-10.txt |
AC |
54 ms |
256 KiB |
| sample-01.txt |
AC |
1 ms |
256 KiB |
| sample-02.txt |
AC |
1 ms |
256 KiB |
| sample-03.txt |
AC |
1 ms |
256 KiB |
| sample-04.txt |
AC |
1 ms |
256 KiB |