提出 #67893220


ソースコード 拡げる

#include<bits/stdc++.h>
#define LL long long
#define vec vector<int>
#define fr(x) freopen(#x".in","r",stdin);freopen(#x".out","w",stdout);
using namespace std;
const int N=1e5+5;
int T,k,m;
inline void wr(vec g)
{
	cout<<"Yes\n"<<g.size()<<"\n";
	for(int i:g) cout<<i<<" ";cout<<"\n";
}
int main()
{
	ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);cin>>T;
	while(T--)
	{
		cin>>m>>k;vec g;
		if(m==k)
		{
			for(int i=0;i<m;i++) g.push_back(i);
			wr(g);continue;
		}
		if(k&1)
		{
			for(int i=0;2*i<=k;i++) g.push_back(i);
			wr(g);continue;
		}
		if(k>=6)
		{
			for(int i=0;2*i<=k;i++) if(i^1) g.push_back(i);
			wr(g);continue;
		}
		if(!(m%k)){
			for(int i=0;i<k;i++) g.push_back(i*(m/k));wr(g);
		}
		else cout<<"No\n";
	}
	return 0;
}

提出情報

提出日時
問題 D - |A + A|
ユーザ huangmaster
言語 C++ 23 (gcc 12.2)
得点 700
コード長 783 Byte
結果 AC
実行時間 43 ms
メモリ 4924 KiB

コンパイルエラー

Main.cpp: In function ‘void wr(std::vector<int>)’:
Main.cpp:11:9: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation]
   11 |         for(int i:g) cout<<i<<" ";cout<<"\n";
      |         ^~~
Main.cpp:11:35: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’
   11 |         for(int i:g) cout<<i<<" ";cout<<"\n";
      |                                   ^~~~
Main.cpp: In function ‘int main()’:
Main.cpp:35:25: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation]
   35 |                         for(int i=0;i<k;i++) g.push_back(i*(m/k));wr(g);
      |                         ^~~
Main.cpp:35:67: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’
   35 |                         for(int i=0;i<k;i++) g.push_back(i*(m/k));wr(g);
      |                                                                   ^~

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 700 / 700
結果
AC × 1
AC × 24
セット名 テストケース
Sample 00_sample_00.txt
All 00_sample_00.txt, 01_random_00.txt, 01_random_01.txt, 01_random_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, 01_random_11.txt, 01_random_12.txt, 01_random_13.txt, 01_random_14.txt, 01_random_15.txt, 01_random_16.txt, 01_random_17.txt, 01_random_18.txt, 01_random_19.txt, 01_random_20.txt, 01_random_21.txt, 01_random_22.txt
ケース名 結果 実行時間 メモリ
00_sample_00.txt AC 1 ms 3596 KiB
01_random_00.txt AC 11 ms 4924 KiB
01_random_01.txt AC 6 ms 4040 KiB
01_random_02.txt AC 6 ms 4036 KiB
01_random_03.txt AC 6 ms 4072 KiB
01_random_04.txt AC 43 ms 3416 KiB
01_random_05.txt AC 4 ms 3448 KiB
01_random_06.txt AC 3 ms 3636 KiB
01_random_07.txt AC 3 ms 3560 KiB
01_random_08.txt AC 3 ms 3552 KiB
01_random_09.txt AC 3 ms 3360 KiB
01_random_10.txt AC 1 ms 3440 KiB
01_random_11.txt AC 1 ms 3460 KiB
01_random_12.txt AC 1 ms 3392 KiB
01_random_13.txt AC 1 ms 3520 KiB
01_random_14.txt AC 1 ms 3436 KiB
01_random_15.txt AC 1 ms 3412 KiB
01_random_16.txt AC 1 ms 3320 KiB
01_random_17.txt AC 1 ms 3492 KiB
01_random_18.txt AC 1 ms 3416 KiB
01_random_19.txt AC 1 ms 3432 KiB
01_random_20.txt AC 5 ms 3672 KiB
01_random_21.txt AC 4 ms 3732 KiB
01_random_22.txt AC 4 ms 3508 KiB