結果

問題 No.3068 Speedrun (Hard)
ユーザー tobbie
提出日時 2025-04-07 21:00:42
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
TLE  
実行時間 -
コード長 494 bytes
コンパイル時間 2,147 ms
コンパイル使用メモリ 194,216 KB
実行使用メモリ 16,072 KB
最終ジャッジ日時 2025-04-07 21:00:48
合計ジャッジ時間 6,416 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 2 TLE * 1 -- * 29
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

#define rep(i, n) for (int i = 0; i < (int)n; i++)

int main() {
  vector<int> a(4);
  rep(i, 4) cin >> a[i];
  int n; cin >> n;
  vector<int> p(4);
  rep(i, 4) cin >> p[i];
  int t; cin >> t;
  rep(i, a[0]+1) {
    rep(j, a[1]+1) {
      rep(k, a[2]+1) {
	int l = n-(i+j+k);
	if (l <= a[3] &&
	    p[0]*i + p[1]*j + p[2]*k + p[3]*l == t) {
	  cout << i << " " << j << " " << k << " " << l << endl;
	  return 0;
	}
      }
    }
  }
  return 0;
}
0