結果
問題 | No.1644 Eight Digits |
ユーザー |
|
提出日時 | 2021-08-13 21:41:19 |
言語 | C++14 (gcc 12.3.0 + boost 1.83.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,635 bytes |
コンパイル時間 | 1,622 ms |
コンパイル使用メモリ | 167,684 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-10-03 18:01:00 |
合計ジャッジ時間 | 16,039 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 450 ms
6,820 KB |
testcase_01 | WA | - |
testcase_02 | AC | 454 ms
6,820 KB |
testcase_03 | WA | - |
testcase_04 | WA | - |
testcase_05 | WA | - |
testcase_06 | WA | - |
testcase_07 | AC | 456 ms
6,816 KB |
testcase_08 | WA | - |
testcase_09 | WA | - |
testcase_10 | WA | - |
testcase_11 | WA | - |
testcase_12 | WA | - |
testcase_13 | AC | 455 ms
6,816 KB |
testcase_14 | WA | - |
testcase_15 | WA | - |
testcase_16 | AC | 453 ms
6,816 KB |
testcase_17 | WA | - |
testcase_18 | AC | 454 ms
6,816 KB |
testcase_19 | AC | 454 ms
6,816 KB |
testcase_20 | AC | 452 ms
6,816 KB |
testcase_21 | WA | - |
testcase_22 | AC | 452 ms
6,820 KB |
testcase_23 | WA | - |
testcase_24 | WA | - |
testcase_25 | WA | - |
testcase_26 | AC | 453 ms
6,820 KB |
testcase_27 | AC | 453 ms
6,816 KB |
ソースコード
//code of JUYU ^ ^ never doubt youself ! #include <bits/stdc++.h> #define For(i,a,b) for(int i=a;i<=b;i++) #define Rep(i,b,a) for(int i=a;i>=b;--i) #define ms(a,b) memset(a,b,sizeof a) #define fir first #define sec second #define eb emplace_back #define pb push_back #define mk make_pair using namespace std; typedef long long ll; typedef pair<int,int> PII; const int MOD = 1e9 + 7; const int N = 1e5 + 10; int ans; //exactly you can get the answer int main() { ll k; scanf("%lld", &k); int ans = 0; for (int i1 = 1; i1 <= 9; i1 ++) { for (int i2 = 1; i2 <= 9; i2 ++) for (int i3 = 1; i3 <= 9; i3 ++) for (int i4 = 1; i4 <= 9; i4 ++) for (int i5 = 1; i5 <= 9; i5 ++) for (int i6 = 1; i6 <= 9; i6 ++) for (int i7 = 1; i7 <= 9; i7 ++) for (int i8 = 1; i8 <= 9; i8 ++) { ll num = i1 * 10000000 + i2 * 1000000 + i3 * 100000 + i4 * 10000 + i5 * 1000 + i6 * 100 + i7 * 10 + i8; if (num % k == 0 && i1 != i2 && i1 != i3 && i1 != i4 && i1 != i5 && i1 != i6 && i1 != i7 && i1 != i8 && i2 != i3 && i2 != i4 && i2 != i5 && i2 != i6 && i2 != i7 && i2 != i8 && i3 != i4 && i3 != i5 && i3 != i6 && i3 != i7 && i3 != i8 && i4 != i5 && i4 != i6 && i4 != i7 && i4 != i8 && i5 != i6 && i5 != i7 && i5 != i8 && i6 != i7 && i6 != i8 && i7 != i8) ans ++; } } cout << ans << endl; return 0; } /* stuff you should look for * int overflow, array bounds * special cases (n=1?) * do smth instead of nothing and stay organized * WRITE STUFF DOWN * DON'T GET STUCK ON ONE APPROACH -- Benq */