結果

問題 No.796 well known
ユーザー yicodeyicode
提出日時 2023-05-03 18:59:42
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 773 bytes
コンパイル時間 2,037 ms
コンパイル使用メモリ 166,348 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-05-01 15:24:07
合計ジャッジ時間 3,939 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,812 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 10 ms
6,944 KB
testcase_06 AC 12 ms
6,940 KB
testcase_07 AC 4 ms
6,940 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
int main() {
  long long N; cin >> N;
  bool fire = false;
  if(N % 3 == 0) {
  for(int i = 312456; i >= 1; i--) {
    if(i % 3 == 1 && (i - 1) % N == 0 && N % 3 == 0) {
      long long x = i;
      for(int j = 0; j < N - 1; j++) {
        cout << (x - 1) / N << " ";
      }
      cout << (x - 1) / N + 1<< endl;
      fire = true;
      break;
    }
    if(fire) break;
  }
  }else {
    for(int i = 312456; i >= 1; i--) {
    if(i % 3 == 1 && (i) % N == 0) {
      long long x = i;
      for(int j = 0; j < N - 1; j++) {
        cout << (x - 1) / N << " ";
      }
      cout << (x - 1) / N<< endl;
      fire = true;
      break;
    }
    if(fire) break;
  }
  }
}
0