听取WA声一片(玄关)
  • 板块P1130 红牌
  • 楼主Innate_Joker
  • 当前回复1
  • 已保存回复1
  • 发布时间2024/8/20 20:56
  • 上次更新2024/8/20 21:11:38
查看原帖
听取WA声一片(玄关)
1086443
Innate_Joker楼主2024/8/20 20:56
#include <cmath>
#include <cstring>
#include <iostream>
using namespace std;
int Time[2001][2001];
long long Joker[2001][2001];
int main() {
	int N,M;
	cin >> N >> M;
	for(int i = 1; i <= M; i ++ ) {
		for(int j = 1; j <= N; j ++ ) {
			cin >> Time[j][i];
		}
	}
	cout << endl;
	for(int i = 1; i <= N; i ++ ) {
		for(int j = 1; j <= M; j ++ ) {
			Joker[i][j] = Time[i][j] + 
			min(Joker[i - 1][j],Joker[i - 1][j % M + 1]);
			cout << Joker[i][j] << " " << Time[i][j] << '\t' << "\b";
		}
		cout << endl;
	}
	long long answer = (long long)pow(2,63) - 1;
	for(int i = 1; i <= M; i ++ ) {
		answer = min(answer,Joker[N][i]);
	}
	cout << answer;
	return 0;
}

一个点都没过……

2024/8/20 20:56
加载中...