提出 #51821556
ソースコード 拡げる
// Problem: C - Ideal Holidays
// Contest: AtCoder - AtCoder Beginner Contest 347
// URL: https://atcoder.jp/contests/abc347/tasks/abc347_c
// Memory Limit: 1024 MB
// Time Limit: 2000 ms
//
// Powered by CP Editor (https://cpeditor.org)
/*By Ashok_Zayn اشکنزی-------------------------------------------------------------------
----------------------------------------------------------------------------------------*/
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define ll long long
#define dbl double
#define pb push_back
#define pf push_front
#define ppb pop_back
#define ff first
#define ss second
#define ins insert
#define vll vector <ll>
#define vvll vector <vll>
#define vbool vector <bool>
#define pll pair <ll,ll>
#define vpll vector <pll>
#define allin(v) v.begin(), v.end()
#define allinr(v) v.rbegin(), v.rend()
#define desc() greater <ll>()
#define rapido ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define mll map<ll,ll>
#define umll unorder_map<ll,ll>
#define erase_duplicates(x) x.erase(unique(allin(x)),x.end());
#define endl "\n"
vll dx = {1, 0, -1, 0};
vll dy = {0, 1, 0, -1};
vll dirx = { -1, 0, 0, 1, -1, -1, 1, 1 };
vll diry = { 0, 1, -1, 0, -1, 1, -1, 1 };
#define loop(i,a,b,k) for(ll i=a;i<b;i+=k)
#define rloop(i,a,b,k) for(ll i=a;i>=b;i-=k)
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
/*------------------Policy based data structures------------------------------------------*/
template<class T> using oset = tree<T,null_type,less_equal<T>,rb_tree_tag,tree_order_statistics_node_update>;
//template<class key, class value> using omap = tree <key,value,less<key>,rb_tree_tag,tree_order_statistics_node_update>;
/*find_by_order(k) -> returns iterator to kth element from start 0
order_of_key(k) -> returns count of elements < k */
template<typename T> istream& operator >>(istream &in,vector<T> &v){ for(auto &x:v) in>>x; return in;}
template<typename T> ostream& operator <<(ostream &out,const vector<T> &v){ for(auto &x:v) out<<x<<' '; return out;}
template<typename T1,typename T2> istream& operator >>(istream &in,pair<T1,T2> &p){ in>>p.first>>p.second; return in;}
template<typename T1,typename T2> ostream& operator <<(ostream &out,const pair<T1,T2> &p) {out<<p.first<<' '<<p.second;return out;}
/*-----------------Useful Values----------------------------------------------------------*/
const int ebl = 1e9+7;
const int newebl = 998244353;
const int local_n = 1e5+7;
const int global_n = 1e7+5;
const int max_prime = 1e6+3;
const ll inf = 1e18;
const ll eps = 1e-9;
#define pi 3.141592653589793238462
double PI = acos(-1);
#define modinv2 500000004
/*----------------Useful Functions-------------------------------------------------------*/
ll gcd(ll a, ll b) { while (b) {a %= b; swap(a,b);} return a; }
ll lcm(ll a, ll b) { ll g=gcd(a,b); ll res=a*(b/g); return res; }
ll extnd_gcd(ll a,ll b,ll &x,ll &y){if (a==0){ x=0;y=1;return b;}ll x1,y1;ll g=extnd_gcd(b%a,a,x1,y1);x=y1-(b/a)*x1;y=x1;return g; }
ll phi_n(ll n){ll res=n;for(ll i=2;i*i<=n;i++){if(n%i==0){while(n%i==0) n/=i;res-=(res/i);}}if(n>1){res-=(res/n);}return res;}/*euler's totient phi(n)*/
ll binExp(ll a, ll b, ll m) { a = a % m; ll res = 1; while (b) { if (b&1) { res=(res * a) % m; } a=(a * a) % m; b>>=1; } return res; }
ll mod_inv(ll a, ll m) { a = a % m; return binExp(a,m-2,m); }
ll mod_add(ll a, ll b, ll m) { a = a % m; b = b % m; return (((a + b) % m) + m) % m; }
ll mod_sub(ll a, ll b, ll m) { a = a % m; b = b % m; return (((a - b) % m) + m) % m; }
ll mod_mul(ll a, ll b, ll m) { a = a % m; b = b % m; return (((a * b) % m) + m) % m; }
ll mod_div(ll a, ll b, ll m) { a = a % m; ll binv = mod_inv(b,m); return (((a * binv) % m) + m) % m; }
ll mod(ll n){if(n>=0)return n%ebl;else{ll x=abs(n)/ebl;return (ebl*(x+1)+n)%ebl; }}
ll sqrtll(ll n){ll lo=0,hi=1e9+7; while(hi-lo>1){ll m=(hi+lo)/2;if(m*m<=n){lo=m;}else{hi=m-1;}}if(hi*hi<=n){return hi;}
return lo;}
dbl sqrtld(ll n) { dbl lo=0,hi=1e9+7; while (hi-lo>eps) { dbl m=(hi+lo)/2; if ((n-m*m)>eps) { lo=m; } else { hi=m-eps; }} return lo; }
ll doceil(ll a, ll b){return (a/b)+(a%b==0?0:1);}
/*---------------Custom HashMap----------------------------------------------------------*/
struct custom_hash{static uint64_t splitmix64(uint64_t x){x+=0x9e3779b97f4a7c15;x=(x^(x>>30))* 0xbf58476d1ce4e5b9;
x=(x^(x>>27))* 0x94d049bb133111eb;return x^(x>>31);}size_t operator()(uint64_t x)const{
static const uint64_t FIXED_RANDOM=chrono::steady_clock::now().time_since_epoch().count();return splitmix64(x+FIXED_RANDOM);}};
/*unordered_map<ll,ll,custom_hash>uchm;*/
ll binexp2(ll a, ll b){ll res=1; while(b>0){if(b&1) res=res*a; a=a*a; b>>=1;}return res;}
#define op(n) cout<<n<<endl;
#define ip(n) cin>>n;
#define acy cout<<"Yes"<<endl;
#define acn cout<<"No"<<endl;
#define cfy cout<<"YES"<<endl;
#define cfn cout<<"NO"<<endl;
#define sy cout<<"yes"<<endl;
#define sn cout<<"no"<<endl;
void do_it()
{
ll n, a, b; cin>>n>>a>>b;
vll v(n); cin>>v;
vbool vis(a+b+1, 0);
loop(i,1,a+1,1) vis[i]=1;
loop(i,0,n,1)
{
ll rem=v[i]%(a+b);
if(rem>a)
{
acn
return;
}
}
acy
}
int32_t main(int argc, char const *argv[]){
rapido
// #ifndef ONLINE_JUDGE
// freopen("input.txt","r",stdin);
// freopen("output.txt","w",stdout);
// #endif
//precompute
ll kin=1; //cin>>kin;
for(ll i=1; i<=kin ;i++){
//cout<<"Case #"<<i<<":"<<" ";
do_it();
}
cerr<<"time taken : "<<(float)clock()/CLOCKS_PER_SEC<<" secs"<<endl;
return 0;
}
提出情報
コンパイルエラー
Main.cpp: In function ‘int32_t main(int, const char**)’:
Main.cpp:123:18: warning: unused parameter ‘argc’ [-Wunused-parameter]
123 | int32_t main(int argc, char const *argv[]){
| ~~~~^~~~
Main.cpp:123:36: warning: unused parameter ‘argv’ [-Wunused-parameter]
123 | int32_t main(int argc, char const *argv[]){
| ~~~~~~~~~~~~^~~~~~
ジャッジ結果
| セット名 |
Sample |
All |
| 得点 / 配点 |
0 / 0 |
0 / 350 |
| 結果 |
|
|
| セット名 |
テストケース |
| Sample |
00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt |
| All |
00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 01_test_01.txt, 01_test_02.txt, 01_test_03.txt, 01_test_04.txt, 01_test_05.txt, 01_test_06.txt, 01_test_07.txt, 01_test_08.txt, 01_test_09.txt, 01_test_10.txt, 01_test_11.txt, 01_test_12.txt, 01_test_13.txt, 01_test_14.txt, 01_test_15.txt, 01_test_16.txt, 01_test_17.txt, 01_test_18.txt, 01_test_19.txt, 01_test_20.txt, 01_test_21.txt, 01_test_22.txt, 01_test_23.txt, 01_test_24.txt, 01_test_25.txt, 01_test_26.txt, 01_test_27.txt, 01_test_28.txt, 01_test_29.txt, 01_test_30.txt, 01_test_31.txt, 01_test_32.txt, 01_test_33.txt, 01_test_34.txt, 01_test_35.txt, 01_test_36.txt, 01_test_37.txt, 01_test_38.txt, 01_test_39.txt, 01_test_40.txt, 01_test_41.txt, 01_test_42.txt, 01_test_43.txt, 01_test_44.txt, 01_test_45.txt, 01_test_46.txt, 01_test_47.txt, 01_test_48.txt, 01_test_49.txt |
| ケース名 |
結果 |
実行時間 |
メモリ |
| 00_sample_01.txt |
AC |
1 ms |
3936 KiB |
| 00_sample_02.txt |
AC |
1 ms |
3836 KiB |
| 00_sample_03.txt |
AC |
1 ms |
3840 KiB |
| 01_test_01.txt |
AC |
1413 ms |
248820 KiB |
| 01_test_02.txt |
AC |
10 ms |
4712 KiB |
| 01_test_03.txt |
AC |
268 ms |
131084 KiB |
| 01_test_04.txt |
AC |
1264 ms |
168556 KiB |
| 01_test_05.txt |
AC |
1311 ms |
155264 KiB |
| 01_test_06.txt |
WA |
494 ms |
131344 KiB |
| 01_test_07.txt |
AC |
1241 ms |
158020 KiB |
| 01_test_08.txt |
WA |
475 ms |
118568 KiB |
| 01_test_09.txt |
WA |
198 ms |
36136 KiB |
| 01_test_10.txt |
WA |
938 ms |
198412 KiB |
| 01_test_11.txt |
AC |
914 ms |
97096 KiB |
| 01_test_12.txt |
AC |
514 ms |
80652 KiB |
| 01_test_13.txt |
WA |
194 ms |
112340 KiB |
| 01_test_14.txt |
WA |
179 ms |
107744 KiB |
| 01_test_15.txt |
AC |
1354 ms |
168896 KiB |
| 01_test_16.txt |
WA |
550 ms |
72048 KiB |
| 01_test_17.txt |
AC |
1252 ms |
138476 KiB |
| 01_test_18.txt |
WA |
931 ms |
172416 KiB |
| 01_test_19.txt |
AC |
119 ms |
114712 KiB |
| 01_test_20.txt |
AC |
59 ms |
104700 KiB |
| 01_test_21.txt |
WA |
7 ms |
4184 KiB |
| 01_test_22.txt |
WA |
6 ms |
3860 KiB |
| 01_test_23.txt |
WA |
2 ms |
3824 KiB |
| 01_test_24.txt |
AC |
2 ms |
3836 KiB |
| 01_test_25.txt |
AC |
2 ms |
3736 KiB |
| 01_test_26.txt |
WA |
8 ms |
4180 KiB |
| 01_test_27.txt |
WA |
3 ms |
3880 KiB |
| 01_test_28.txt |
WA |
4 ms |
3812 KiB |
| 01_test_29.txt |
AC |
5 ms |
3840 KiB |
| 01_test_30.txt |
AC |
9 ms |
4164 KiB |
| 01_test_31.txt |
WA |
6 ms |
3892 KiB |
| 01_test_32.txt |
WA |
8 ms |
4096 KiB |
| 01_test_33.txt |
WA |
3 ms |
3736 KiB |
| 01_test_34.txt |
AC |
5 ms |
3992 KiB |
| 01_test_35.txt |
AC |
11 ms |
4720 KiB |
| 01_test_36.txt |
AC |
12 ms |
4648 KiB |
| 01_test_37.txt |
AC |
11 ms |
4640 KiB |
| 01_test_38.txt |
AC |
11 ms |
4616 KiB |
| 01_test_39.txt |
AC |
11 ms |
4716 KiB |
| 01_test_40.txt |
AC |
11 ms |
4692 KiB |
| 01_test_41.txt |
AC |
370 ms |
93780 KiB |
| 01_test_42.txt |
AC |
350 ms |
86828 KiB |
| 01_test_43.txt |
AC |
210 ms |
68932 KiB |
| 01_test_44.txt |
AC |
546 ms |
97288 KiB |
| 01_test_45.txt |
AC |
551 ms |
88736 KiB |
| 01_test_46.txt |
AC |
436 ms |
84708 KiB |
| 01_test_47.txt |
WA |
268 ms |
56652 KiB |
| 01_test_48.txt |
WA |
158 ms |
29172 KiB |
| 01_test_49.txt |
WA |
384 ms |
87804 KiB |