Submission #59908417
Source Code Expand
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef double DOUBLE;
typedef complex<double> point;
#define xx real()
#define yy imag()
#define REP(i, a, b) for(int i = (a); i < (int)(b); i++)
#define REPN(i, a, b) for(int i = (a); i <= (int)(b); i++)
#define FA(it, x) for(__typeof((x).begin()) it = (x).begin(); it != (x).end(); it++)
#define SZ(x) (int)(x).size()
#define BE(x) (x).begin(), (x).end()
#define SORT(x) sort(BE(x))
#define _1 first
#define _2 second
#define x0 gray_cat_x0
#define y0 gray_cat_y0
#define x1 gray_cat_x1
#define y1 gray_cat_y1
#define j0 gray_cat_j0
template<class T> T gcd(T a, T b) { return b ? gcd(b, a % b) : a; }
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
#define file "I1"
const double EPS = 1e-9;
const double PI = acos(-1.);
const ll LL_INF = 1e17 + 16;
const int INF = 1e9 + 10;
// const ll MOD = 1e9 + 7;
const ll MOD = 998244353;
const int MAXN = 3e5 + 5;
int a[MAXN];
vi ans;
void solve(){
int n, k;
scanf("%d%d", &n, &k);
REPN(i, 1, n) {
scanf("%d", &a[i]);
}
if (n == 2) {
if (a[1] > a[2] && a[2] + k > a[1]) {
printf("No\n");
return;
} else if (a[1] <= a[2]) {
printf("Yes\n0\n");
} else {
printf("Yes\n1\n1\n");
}
return;
}
REP(i, 1, n) {
REP(j, 0, 100 * i) {
ans.pb(i);
}
}
REP(i, 1, 100000) {
ans.pb(n - 1);
}
printf("Yes\n%d\n", SZ(ans));
REP(i, 0, SZ(ans)) {
printf("%d ", ans[i]);
}
}
int main(){
#ifndef ONLINE_JUDGE
freopen("in.txt", "r", stdin);
freopen("out.txt", "w", stdout);
#endif
//freopen(file".in", "r", stdin); freopen(file".out", "w", stdout);
int t = 1;
//cin >> t;
while(t--){
solve();
}
}
Submission Info
| Submission Time |
|
| Task |
A - Add and Swap |
| User |
Timur_Sitdikov |
| Language |
C++ 20 (gcc 12.2) |
| Score |
600 |
| Code Size |
1884 Byte |
| Status |
AC |
| Exec Time |
13 ms |
| Memory |
4440 KiB |
Compile Error
Main.cpp: In function ‘void solve()’:
Main.cpp:49:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
49 | scanf("%d%d", &n, &k);
| ~~~~~^~~~~~~~~~~~~~~~
Main.cpp:51:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
51 | scanf("%d", &a[i]);
| ~~~~~^~~~~~~~~~~~~
Judge Result
| Set Name |
Sample |
All |
| Score / Max Score |
0 / 0 |
600 / 600 |
| Status |
|
|
| Set Name |
Test Cases |
| Sample |
00_sample_01.txt, 00_sample_02.txt |
| All |
00_sample_01.txt, 00_sample_02.txt, 01_test_01.txt, 01_test_02.txt, 01_test_03.txt, 01_test_04.txt, 01_test_05.txt, 01_test_06.txt, 01_test_07.txt, 01_test_08.txt, 01_test_09.txt, 01_test_10.txt, 01_test_11.txt, 01_test_12.txt, 01_test_13.txt, 01_test_14.txt, 01_test_15.txt, 01_test_16.txt, 01_test_17.txt, 01_test_18.txt, 01_test_19.txt, 01_test_20.txt, 01_test_21.txt, 01_test_22.txt, 01_test_23.txt, 01_test_24.txt, 01_test_25.txt, 01_test_26.txt, 01_test_27.txt, 01_test_28.txt, 01_test_29.txt, 01_test_30.txt, 01_test_31.txt, 01_test_32.txt, 01_test_33.txt, 01_test_34.txt, 01_test_35.txt, 01_test_36.txt, 02_handmade_01.txt, 02_handmade_02.txt, 02_handmade_03.txt, 02_handmade_04.txt, 02_handmade_05.txt, 02_handmade_06.txt, 02_handmade_07.txt, 02_handmade_08.txt, 02_handmade_09.txt, 02_handmade_10.txt |
| Case Name |
Status |
Exec Time |
Memory |
| 00_sample_01.txt |
AC |
6 ms |
3964 KiB |
| 00_sample_02.txt |
AC |
6 ms |
3924 KiB |
| 01_test_01.txt |
AC |
12 ms |
4368 KiB |
| 01_test_02.txt |
AC |
12 ms |
4316 KiB |
| 01_test_03.txt |
AC |
12 ms |
4352 KiB |
| 01_test_04.txt |
AC |
12 ms |
4348 KiB |
| 01_test_05.txt |
AC |
12 ms |
4352 KiB |
| 01_test_06.txt |
AC |
12 ms |
4360 KiB |
| 01_test_07.txt |
AC |
12 ms |
4208 KiB |
| 01_test_08.txt |
AC |
12 ms |
4392 KiB |
| 01_test_09.txt |
AC |
12 ms |
4332 KiB |
| 01_test_10.txt |
AC |
12 ms |
4340 KiB |
| 01_test_11.txt |
AC |
12 ms |
4340 KiB |
| 01_test_12.txt |
AC |
12 ms |
4356 KiB |
| 01_test_13.txt |
AC |
12 ms |
4360 KiB |
| 01_test_14.txt |
AC |
12 ms |
4200 KiB |
| 01_test_15.txt |
AC |
12 ms |
4280 KiB |
| 01_test_16.txt |
AC |
12 ms |
4336 KiB |
| 01_test_17.txt |
AC |
12 ms |
4340 KiB |
| 01_test_18.txt |
AC |
12 ms |
4336 KiB |
| 01_test_19.txt |
AC |
12 ms |
4280 KiB |
| 01_test_20.txt |
AC |
12 ms |
4368 KiB |
| 01_test_21.txt |
AC |
13 ms |
4328 KiB |
| 01_test_22.txt |
AC |
12 ms |
4340 KiB |
| 01_test_23.txt |
AC |
12 ms |
4436 KiB |
| 01_test_24.txt |
AC |
12 ms |
4316 KiB |
| 01_test_25.txt |
AC |
13 ms |
4364 KiB |
| 01_test_26.txt |
AC |
12 ms |
4332 KiB |
| 01_test_27.txt |
AC |
12 ms |
4324 KiB |
| 01_test_28.txt |
AC |
1 ms |
3624 KiB |
| 01_test_29.txt |
AC |
1 ms |
3732 KiB |
| 01_test_30.txt |
AC |
1 ms |
3500 KiB |
| 01_test_31.txt |
AC |
1 ms |
3680 KiB |
| 01_test_32.txt |
AC |
1 ms |
3624 KiB |
| 01_test_33.txt |
AC |
1 ms |
3684 KiB |
| 01_test_34.txt |
AC |
1 ms |
3712 KiB |
| 01_test_35.txt |
AC |
1 ms |
3688 KiB |
| 01_test_36.txt |
AC |
12 ms |
4332 KiB |
| 02_handmade_01.txt |
AC |
6 ms |
3808 KiB |
| 02_handmade_02.txt |
AC |
12 ms |
4440 KiB |
| 02_handmade_03.txt |
AC |
12 ms |
4368 KiB |
| 02_handmade_04.txt |
AC |
6 ms |
4044 KiB |
| 02_handmade_05.txt |
AC |
12 ms |
4204 KiB |
| 02_handmade_06.txt |
AC |
13 ms |
4312 KiB |
| 02_handmade_07.txt |
AC |
11 ms |
4328 KiB |
| 02_handmade_08.txt |
AC |
12 ms |
4288 KiB |
| 02_handmade_09.txt |
AC |
11 ms |
4436 KiB |
| 02_handmade_10.txt |
AC |
12 ms |
4204 KiB |