結果
問題 | No.478 一般門松列列 |
ユーザー |
![]() |
提出日時 | 2017-01-29 00:56:46 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 789 bytes |
コンパイル時間 | 744 ms |
コンパイル使用メモリ | 84,084 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-12-23 21:41:36 |
合計ジャッジ時間 | 1,980 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 34 |
ソースコード
/* -*- coding: utf-8 -*- * * 478.cc: No.478 一般門松列列 - yukicoder */ #include<cstdio> #include<cstdlib> #include<cstring> #include<cmath> #include<iostream> #include<string> #include<vector> #include<map> #include<set> #include<stack> #include<list> #include<queue> #include<deque> #include<algorithm> #include<numeric> #include<utility> #include<complex> #include<functional> using namespace std; /* constant */ const int dxs[] = {1, -2, 3, -2}; /* typedef */ /* global variables */ /* subroutines */ /* main */ int main() { int n, k; cin >> n >> k; int x = 1; x += dxs[0]; printf("%d", x); x += dxs[1]; printf(" %d", x); for (int i = 2; i < n; i++) { if (i + k < n) x += dxs[i & 3]; printf(" %d", x); } putchar('\n'); return 0; }