Submission #138632

# Submission time Handle Problem Language Result Execution time Memory
138632 2019-07-30T07:50:43 Z WongHokFong_cpp Sails (IOI07_sails) C++14
0 / 100
1000 ms 644 KB
#include <iostream>
#include <cstdlib>
using namespace std;
int flagged[100001],n,h,k,height,mini,s;
int main(void)
{
	cin>>n;
	for (int i=1;i<=n;i++)
	{
		cin>>h>>k;height=max(h,height);
		for (int q=1;q<=k;q++)
		{
			mini=1;
			for (int j=2;j<=h;j++)
			{
				if (flagged[j]<flagged[mini])
				{
					mini=j;
				}
			}
			flagged[mini]++;
		}
	}
	for (int i=1;i<=height;i++) s+=(flagged[i]-1)*flagged[i]/2;
	cout<<s;
}
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 380 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 376 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1072 ms 256 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1081 ms 504 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1072 ms 520 KB Time limit exceeded
# Verdict Execution time Memory Grader output
1 Execution timed out 1049 ms 644 KB Time limit exceeded
# Verdict Execution time Memory Grader output
1 Execution timed out 1070 ms 492 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1077 ms 552 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1076 ms 536 KB Time limit exceeded
2 Halted 0 ms 0 KB -