답안 #930504

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
930504 2024-02-20T04:17:43 Z magagam Palindrome-Free Numbers (BOI13_numbers) C++17
12.5 / 100
1000 ms 604 KB
//#pragma optimize ("g",on)
//#pragma GCC optimize ("inline")
//#pragma GCC optimize ("Ofast")
//#pragma GCC optimize ("unroll-loops")
//#pragma GCC optimize ("03")
//#pragma GCC target ("sse,sse2,sse3,ssse3,sse4,popcnt,abm,avx2,mmx,fma,avx,tune=native")
//#pragma comment(linker, "/stack:200000000")
#include <bits/stdc++.h>
#define npe next_permutation
#define int long long
#define pb push_back
#define pf push_front
#define ppb pop_back()
#define ppf pop_front()
#define len(x) (int)x.size()
#define vi vector<int>
#define vpii vector<pair<int,int>>
#define vvi vector<vi>
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define itn int
#define fro for
#define lb(s,x) (lower_bound(all(s),x))-s.begin())
#define ub(s,x) (upper_bound(all(s),x)-s.begin())
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const int maxn=2e5+5,mod=1e9+7,inf=1e18,bir=1ll,nol=0ll;
/*
20.02.2024
TUESDAY
Taak zdes nado recursiu
*/
void at(bool ok){if(ok) cout<<"YES\n";else cout<<"NO\n";}
bool bit(int mask,int i){if((1<<i)&mask)return 1;return 0;}
int gcd(int a,int b){while(b){if(a>b) swap(a,b);b%=a;}return a;}
int lcm(int a,int b){return a*b/gcd(a,b);}
int binpow(int a,int b){
	a%=mod;
	if(b==0) return 1;
	if(b&1){
		return binpow(a,b-1)*a%mod;
	}
	int x=binpow(a,b>>1);
	return x*x%mod;
}
int x,y;
bool f(int x){
	string s=to_string(x);
	set<char> st;
	for(auto it:s){
		st.insert(it);
	}
	return (len(st)==len(s));
}
void solve(){
	cin>>x>>y;
	int ans=0;
	for(int i=x;i<=y;i++) ans+=f(i);
	cout<<ans<<'\n';
}
signed main(){
//	freopen("A.in","r",stdin),freopen("A.out","w",stdout);
	ios_base::sync_with_stdio(0);cin.tie(0);
	int T=1;
//	cin>>T;
	for(int i=1;i<=T;i++){
//		cout<<"Case #"<<i<<": ";
		solve();
	}
}
//(a/b)%mod=(a*(b^(mod-2)))%mod;
//(a+1)*(2*a+1)/6
//upper_bound(x) first element that is greater than
//lower_bound(x) first element that is greater or equal to x
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 456 KB Output is correct
3 Incorrect 32 ms 348 KB Output isn't correct
4 Incorrect 12 ms 600 KB Output isn't correct
5 Correct 0 ms 344 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 500 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 0 ms 456 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Incorrect 1 ms 348 KB Output isn't correct
12 Incorrect 0 ms 348 KB Output isn't correct
13 Correct 0 ms 348 KB Output is correct
14 Incorrect 16 ms 348 KB Output isn't correct
15 Incorrect 13 ms 344 KB Output isn't correct
16 Incorrect 1 ms 344 KB Output isn't correct
17 Incorrect 5 ms 348 KB Output isn't correct
18 Correct 0 ms 348 KB Output is correct
19 Incorrect 31 ms 348 KB Output isn't correct
20 Incorrect 12 ms 604 KB Output isn't correct
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1068 ms 348 KB Time limit exceeded
2 Execution timed out 1049 ms 344 KB Time limit exceeded
3 Execution timed out 1064 ms 348 KB Time limit exceeded
4 Execution timed out 1052 ms 348 KB Time limit exceeded
5 Execution timed out 1008 ms 344 KB Time limit exceeded
6 Execution timed out 1047 ms 344 KB Time limit exceeded
7 Incorrect 528 ms 432 KB Output isn't correct
8 Incorrect 360 ms 348 KB Output isn't correct
9 Incorrect 659 ms 436 KB Output isn't correct
10 Incorrect 909 ms 592 KB Output isn't correct
11 Execution timed out 1034 ms 344 KB Time limit exceeded
12 Execution timed out 1098 ms 344 KB Time limit exceeded
13 Execution timed out 1043 ms 344 KB Time limit exceeded
14 Execution timed out 1012 ms 344 KB Time limit exceeded
15 Execution timed out 1066 ms 348 KB Time limit exceeded
16 Execution timed out 1027 ms 344 KB Time limit exceeded
17 Execution timed out 1050 ms 360 KB Time limit exceeded
18 Execution timed out 1004 ms 344 KB Time limit exceeded
19 Execution timed out 1046 ms 344 KB Time limit exceeded
20 Execution timed out 1030 ms 348 KB Time limit exceeded
21 Execution timed out 1026 ms 348 KB Time limit exceeded
22 Execution timed out 1065 ms 348 KB Time limit exceeded
23 Execution timed out 1006 ms 344 KB Time limit exceeded
24 Execution timed out 1044 ms 344 KB Time limit exceeded
25 Execution timed out 1006 ms 344 KB Time limit exceeded
26 Execution timed out 1018 ms 344 KB Time limit exceeded
27 Execution timed out 1056 ms 348 KB Time limit exceeded
28 Execution timed out 1048 ms 344 KB Time limit exceeded
29 Execution timed out 1042 ms 348 KB Time limit exceeded
30 Execution timed out 1034 ms 344 KB Time limit exceeded
31 Execution timed out 1031 ms 348 KB Time limit exceeded
32 Execution timed out 1048 ms 348 KB Time limit exceeded
33 Execution timed out 1068 ms 596 KB Time limit exceeded
34 Execution timed out 1072 ms 348 KB Time limit exceeded
35 Execution timed out 1055 ms 348 KB Time limit exceeded
36 Execution timed out 1053 ms 348 KB Time limit exceeded
37 Execution timed out 1066 ms 348 KB Time limit exceeded
38 Execution timed out 1070 ms 348 KB Time limit exceeded
39 Execution timed out 1043 ms 348 KB Time limit exceeded
40 Execution timed out 1053 ms 348 KB Time limit exceeded
41 Execution timed out 1040 ms 344 KB Time limit exceeded
42 Execution timed out 1068 ms 348 KB Time limit exceeded
43 Execution timed out 1053 ms 348 KB Time limit exceeded
44 Execution timed out 1079 ms 348 KB Time limit exceeded
45 Execution timed out 1046 ms 348 KB Time limit exceeded