結果

問題 No.478 一般門松列列
コンテスト
ユーザー vjudge1
提出日時 2026-03-23 21:16:09
言語 C++17
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=c++17 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 788 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 4,217 ms
コンパイル使用メモリ 281,484 KB
実行使用メモリ 6,144 KB
最終ジャッジ日時 2026-03-23 21:16:21
合計ジャッジ時間 6,926 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 34
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include<bits/stdc++.h>
#include<bits/extc++.h>
#define int long long
#define inf 0x3f3f3f3f3f3f3f3f
#define maxn 1234567
#define eps 1e-7
#define mod 1000000007
#define Mod 998244353
#define f(i,a,b) for(int i=a;i<=b;i++)
#define r(i,a,b) for(int i=a;i>=b;i--) 
#define fx(i,a,b,x) for(int i=a;i<=b;i+=x)
#define rx(i,a,b,x) for(int i=a;i>=b;i-=x) 
using namespace std;
using namespace __gnu_cxx;
using namespace __gnu_pbds;
int T;
int n,k,pre=19260818;
void solve(){
	scanf("%lld%lld",&n,&k);
	printf("19260817 19260818 ");
	f(i,1,n-k-2){
		if(i&1)printf("%lld ",pre-(i+1)),pre-=i+1;
		else printf("%lld ",pre+(i+1)),pre+=i+1;
	}
	if((n-k)&1)f(i,1,k)printf("%lld ",pre-i);
	else f(i,1,k)printf("%lld ",pre+i);
}
signed main(){
	T=1;
//	scanf("%lld",&t);
	while(T--)solve();
	return 0;
}
0