Submission #47462232
Source Code Expand
Copy
#include<bits/stdc++.h>using namespace std;#define int long longsigned main(){int n;cin>>n;int ans=0;for(int i=1;i<=n;i++){int x;cin>>x;for(int j=1;j<=9;j++){int temp=i;int flag=0;while(temp){if(temp%10!=j)flag=1;temp/=10;}if(flag)continue;for(int k=1;k<=x;k++){int temp=k;int flag=0;while(temp){if(temp%10!=j)flag=1;
#include<bits/stdc++.h> using namespace std; #define int long long signed main(){ int n;cin>>n; int ans=0; for(int i=1;i<=n;i++){ int x;cin>>x; for(int j=1;j<=9;j++){ int temp=i; int flag=0; while(temp){ if(temp%10!=j)flag=1; temp/=10; } if(flag)continue; for(int k=1;k<=x;k++){ int temp=k; int flag=0; while(temp){ if(temp%10!=j)flag=1; temp/=10; } if(flag)continue; ans++; } } } cout<<ans; }
Submission Info
Submission Time | |
---|---|
Task | B - 11/11 |
User | chronicle12345 |
Language | C++ 20 (gcc 12.2) |
Score | 200 |
Code Size | 718 Byte |
Status | AC |
Exec Time | 1 ms |
Memory | 3652 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 200 / 200 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt |
All | 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 01_random_06.txt, 01_random_07.txt, 01_random_08.txt, 01_random_09.txt, 01_random_10.txt, 02_handmade_11.txt, 02_handmade_12.txt, 02_handmade_13.txt, 02_handmade_14.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
00_sample_00.txt | AC | 1 ms | 3488 KB |
00_sample_01.txt | AC | 1 ms | 3428 KB |
00_sample_02.txt | AC | 1 ms | 3568 KB |
01_random_03.txt | AC | 1 ms | 3488 KB |
01_random_04.txt | AC | 1 ms | 3652 KB |
01_random_05.txt | AC | 1 ms | 3552 KB |
01_random_06.txt | AC | 1 ms | 3488 KB |
01_random_07.txt | AC | 1 ms | 3444 KB |
01_random_08.txt | AC | 1 ms | 3504 KB |
01_random_09.txt | AC | 1 ms | 3488 KB |
01_random_10.txt | AC | 1 ms | 3504 KB |
02_handmade_11.txt | AC | 1 ms | 3484 KB |
02_handmade_12.txt | AC | 1 ms | 3504 KB |
02_handmade_13.txt | AC | 1 ms | 3644 KB |
02_handmade_14.txt | AC | 1 ms | 3492 KB |