Submission #9930647


Source Code Expand

Copy
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep2(i,a,b) for(int i=a;i<b;i++)
using namespace std;

int n,ans;
string s;

main()
{
        cin>>n>>s;

        rep2(i,0,10)
        {
                rep2(j,0,10)
                {
                        rep2(k,0,10)
                        {
                                char a='0'+i,
                                     b='0'+j,
                                     c='0'+k;
                                string t="";
                                t.push_back(a);
                                t.push_back(b);
                                t.push_back(c);
                                if(s.find(a)!=string::npos)
                                {
                                        if(s.find(b,s.find(a)+1)!=string::npos)
                                        {
                                                if(s.find(c,s.find(b,s.find(a)+1)+1)!=string::npos)
                                                {
                                                        ans++;
                                                        //cout<<t<<endl;
                                                }
                                        }
                                }
                        }
                }
        }
        cout<<ans<<endl;
}

Submission Info

Submission Time
Task D - Lucky PIN
User h1guch
Language C++14 (GCC 5.4.1)
Score 400
Code Size 1401 Byte
Status AC
Exec Time 3 ms
Memory 256 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 400 / 400
Status
AC × 3
AC × 33
Set Name Test Cases
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-corner-01.txt, 01-corner-02.txt, 01-corner-03.txt, 01-corner-04.txt, 02-random-01.txt, 02-random-02.txt, 02-random-03.txt, 02-random-04.txt, 02-random-05.txt, 02-random-06.txt, 02-random-07.txt, 03-random-x-01.txt, 03-random-x-02.txt, 03-random-x-03.txt, 04-expand-01.txt, 04-expand-02.txt, 04-expand-03.txt, 04-expand-04.txt, 04-expand-05.txt, 04-expand-06.txt, 04-expand-07.txt, 04-expand-08.txt, 05-limiting-01.txt, 05-limiting-02.txt, 05-limiting-03.txt, 05-limiting-04.txt, 05-limiting-05.txt, 05-limiting-06.txt, 05-limiting-07.txt, 05-limiting-08.txt
Case Name Status Exec Time Memory
00-sample-01.txt AC 1 ms 256 KB
00-sample-02.txt AC 1 ms 256 KB
00-sample-03.txt AC 1 ms 256 KB
01-corner-01.txt AC 1 ms 256 KB
01-corner-02.txt AC 1 ms 256 KB
01-corner-03.txt AC 1 ms 256 KB
01-corner-04.txt AC 1 ms 256 KB
02-random-01.txt AC 1 ms 256 KB
02-random-02.txt AC 1 ms 256 KB
02-random-03.txt AC 1 ms 256 KB
02-random-04.txt AC 1 ms 256 KB
02-random-05.txt AC 1 ms 256 KB
02-random-06.txt AC 1 ms 256 KB
02-random-07.txt AC 2 ms 256 KB
03-random-x-01.txt AC 2 ms 256 KB
03-random-x-02.txt AC 3 ms 256 KB
03-random-x-03.txt AC 3 ms 256 KB
04-expand-01.txt AC 3 ms 256 KB
04-expand-02.txt AC 3 ms 256 KB
04-expand-03.txt AC 3 ms 256 KB
04-expand-04.txt AC 3 ms 256 KB
04-expand-05.txt AC 3 ms 256 KB
04-expand-06.txt AC 3 ms 256 KB
04-expand-07.txt AC 3 ms 256 KB
04-expand-08.txt AC 2 ms 256 KB
05-limiting-01.txt AC 3 ms 256 KB
05-limiting-02.txt AC 3 ms 256 KB
05-limiting-03.txt AC 3 ms 256 KB
05-limiting-04.txt AC 3 ms 256 KB
05-limiting-05.txt AC 3 ms 256 KB
05-limiting-06.txt AC 2 ms 256 KB
05-limiting-07.txt AC 2 ms 256 KB
05-limiting-08.txt AC 2 ms 256 KB