QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#226819 | #7608. Cliques | ckiseki# | WA | 1ms | 3492kb | C++20 | 3.9kb | 2023-10-26 16:49:04 | 2023-10-26 16:49:04 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define all(x) begin(x), end(x)
#ifdef CKISEKI
#define safe cerr << __PRETTY_FUNCTION__ << " line " << __LINE__ << " safe\n"
#define debug(a...) debug_(#a, a)
#define orange(a...) orange_(#a, a)
void debug_(const char *s, auto ...a) {
cerr << "\e[1;32m(" << s << ") = (";
int f = 0;
(..., (cerr << (f++ ? ", " : "") << a));
cerr << ")\e[0m\n";
}
void orange_(const char *s, auto L, auto R) {
cerr << "\e[1;32m[ " << s << " ] = [ ";
for (int f = 0; L != R; ++f)
cerr << (f ? ", " : "") << *L++;
cerr << " ]\e[0m\n";
}
#else
#define safe ((void)0)
#define debug(...) safe
#define orange(...) safe
#endif
const int maxn = 100000;
int dp[maxn], vis[maxn];
int digit_sum(int x) {
int s = 0;
while (x)
s += x % 10, x /= 10;
return s;
}
int DP(int x) {
if (vis[x]) {
return dp[x];
}
vis[x] = true;
int d = min(digit_sum(x), x);
for (int j = 1; j <= d; j++)
if (!DP(x - j))
return dp[x] = true;
return dp[x] = false;
}
int main() {
cin.tie(nullptr)->sync_with_stdio(false);
for (int i = 0; i < 10000; i++) {
if (!DP(i)) {
cout << i << ' ';
}
}
cout << endl;
return 0;
}
/*
0 10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160 170 180 200 210 220 230 240 250 260 270 290 300 310 320 330 340 350 360 380 400 410 420 430 440 450 470 490 500 510 520 530 540 560 580 600 610 620 630 650 670 690 700 710 720 740 760 780 800 810 830 850 870 890 900 920 940 960 980 1000 1010 1020 1030 1040 1050 1060 1070 1080 1100 1110 1120 1130 1140 1150 1160 1170 1190 1200 1210 1220 1230 1240 1250 1260 1280 1300 1310 1320 1330 1340 1350 1370 1390 1400 1410 1420 1430 1440 1460 1480 1500 1510 1520 1530 1550 1570 1590 1600 1610 1620 1640 1660 1680 1700 1710 1730 1750 1770 1790 1800 1820 1840 1860 1880 1900 1920 1940 1960 1980 2000 2010 2020 2030 2040 2050 2060 2070 2090 2100 2110 2120 2130 2140 2150 2160 2180 2200 2210 2220 2230 2240 2250 2270 2290 2300 2310 2320 2330 2340 2360 2380 2400 2410 2420 2430 2450 2470 2490 2500 2510 2520 2540 2560 2580 2600 2610 2630 2650 2670 2690 2700 2720 2740 2760 2780 2800 2820 2840 2860 2880 2900 2920 2940 2960 2980 3000 3010 3020 3030 3040 3050 3060 3080 3100 3110 3120 3130 3140 3150 3170 3190 3200 3210 3220 3230 3240 3260 3280 3300 3310 3320 3330 3350 3370 3390 3400 3410 3420 3440 3460 3480 3500 3510 3530 3550 3570 3590 3600 3620 3640 3660 3680 3700 3720 3740 3760 3780 3800 3820 3840 3860 3880 3900 3920 3940 3960 3990 4000 4010 4020 4030 4040 4050 4070 4090 4100 4110 4120 4130 4140 4160 4180 4200 4210 4220 4230 4250 4270 4290 4300 4310 4320 4340 4360 4380 4400 4410 4430 4450 4470 4490 4500 4520 4540 4560 4580 4600 4620 4640 4660 4680 4700 4720 4740 4760 4780 4800 4820 4840 4860 4890 4910 4930 4950 4980 5000 5010 5020 5030 5040 5060 5080 5100 5110 5120 5130 5150 5170 5190 5200 5210 5220 5240 5260 5280 5300 5310 5330 5350 5370 5390 5400 5420 5440 5460 5480 5500 5520 5540 5560 5580 5600 5620 5640 5660 5680 5700 5720 5740 5760 5790 5810 5830 5850 5880 5900 5920 5940 5970 6000 6010 6020 6030 6050 6070 6090 6100 6110 6120 6140 6160 6180 6200 6210 6230 6250 6270 6290 6300 6320 6340 6360 6380 6400 6420 6440 6460 6480 6500 6520 6540 6560 6580 6600 6620 6640 6660 6690 6710 6730 6750 6780 6800 6820 6840 6870 6900 6920 6940 6970 7000 7010 7020 7040 7060 7080 7100 7110 7130 7150 7170 7190 7200 7220 7240 7260 7280 7300 7320 7340 7360 7380 7400 7420 7440 7460 7480 7500 7520 7540 7560 7590 7610 7630 7650 7680 7700 7720 7740 7770 7800 7820 7840 7870 7900 7920 7950 7980 8000 8010 8030 8050 8070 8090 8100 8120 8140 8160 8180 8200 8220 8240 8260 8280 8300 8320 8340 8360 8380 8400 8420 8440 8460 8490 8510 8530 8550 8580 8600 8620 8640 8670 8700 8720 8740 8770 8800 8820 8850 8880 8900 8920 8950 8980 9000 9020 9040 9060 9080 9100 9120 9140 9160 9180 9200 9220 9240 9260 9280 9300 9320 9340 9360 9390 9410 9430 9450 9480 9500 9520 9540 9570 9600 9620 9640 9670 9700 9720 9750 9780 9800 9820 9850 9880 9900 9930 9960 9990
*/
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3492kb
input:
5 1 2 5 1 2 3 4 2 6 + 4 5 + 2 2 + 1 3 - 2 2 + 2 3 + 4 4
output:
0 10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160 170 180 200 210 220 230 240 250 260 270 290 300 310 320 330 340 350 360 380 400 410 420 430 440 450 470 490 500 510 520 530 540 560 580 600 610 620 630 650 670 690 700 710 720 740 760 780 800 810 830 850 870 890 900 920 940 960 980 1000 1010 1...
result:
wrong answer 1st lines differ - expected: '1', found: '0 10 20 30 40 50 60 70 80 90 1... 9850 9880 9900 9930 9960 9990 '