提出 #548035
ソースコード 拡げる
#include <algorithm>
#include <iostream>
#include <fstream>
#include <cstdio>
#include <string>
#include <vector>
#include <stack>
#include <cmath>
#include <functional>
#include <cassert>
#include <iomanip>
#include <array>
#include <time.h>
#include <limits.h>
#define debug(x) cout<<#x<<": "<<x<<endl
#define rep(i,n) for (int i=0;i<(n);i++)
#define FOR(i,a,b) for (int i=(a);i<=(b);i++)
using namespace std;
long long S[100001];
long long C[100001];
long long mass[100001] = { 0 };
int main(){
cin.tie(0);
ios::sync_with_stdio(false);
#ifdef _WIN32
istream &cin = ifstream("input.txt");
#endif
int N;
int cur = 0;
cin >> N;
rep(i, N){
cin >> S[i] >> C[i];
}
rep(i, N){
while (C[i] > 0){
//debug(S[i]);
if (mass[S[i]] != 0){
S[i] = mass[S[i]] + 1;
}
else{
mass[S[i]] = S[i] + C[i] - 1;
S[i]++;
C[i]--;
}
}
cout << S[i] - 1<< endl;
}
system("PAUSE");
return 0;
}
提出情報
| 提出日時 | |
|---|---|
| 問題 | D - マスと駒と色塗り |
| ユーザ | yuya625625 |
| 言語 | C++11 (GCC 4.9.2) |
| 得点 | 0 |
| コード長 | 987 Byte |
| 結果 | TLE |
| 実行時間 | 2033 ms |
| メモリ | 3240 KiB |
コンパイルエラー
./Main.cpp: In function ‘int main()’:
./Main.cpp:58:17: warning: ignoring return value of ‘int system(const char*)’, declared with attribute warn_unused_result [-Wunused-result]
system("PAUSE");
^
ジャッジ結果
| セット名 | Sample | Dataset1 | Dataset2 | Dataset3 | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 得点 / 配点 | 0 / 0 | 0 / 35 | 0 / 40 | 0 / 25 | ||||||||||||||||||
| 結果 |
|
|
|
|
| セット名 | テストケース |
|---|---|
| Sample | sample-01.txt, sample-02.txt, sample-03.txt |
| Dataset1 | sample-01.txt, sample-02.txt, 01-01.txt, 01-02.txt, 01-03.txt, 01-04.txt, 01-05.txt, 01-06.txt, 01-07.txt, 01-08.txt, 01-09.txt |
| Dataset2 | sample-01.txt, sample-02.txt, sample-03.txt, 02-01.txt, 02-02.txt, 02-03.txt, 02-04.txt, 02-05.txt, 02-06.txt, 02-07.txt, 02-08.txt, 02-09.txt, 02-10.txt, 02-11.txt, 02-12.txt |
| Dataset3 | sample-01.txt, sample-02.txt, sample-03.txt, 01-01.txt, 01-02.txt, 01-03.txt, 01-04.txt, 01-05.txt, 01-06.txt, 01-07.txt, 01-08.txt, 01-09.txt, 02-01.txt, 02-02.txt, 02-03.txt, 02-04.txt, 02-05.txt, 02-06.txt, 02-07.txt, 02-08.txt, 02-09.txt, 02-10.txt, 02-11.txt, 02-12.txt, 03-01.txt, 03-02.txt, 03-03.txt, 03-04.txt, 03-05.txt, 03-06.txt, 03-07.txt, 03-08.txt, 03-09.txt, 03-10.txt, 03-11.txt, 03-12.txt |
| ケース名 | 結果 | 実行時間 | メモリ |
|---|---|---|---|
| 01-01.txt | TLE | 2033 ms | 2084 KiB |
| 01-02.txt | TLE | 2033 ms | 2712 KiB |
| 01-03.txt | TLE | 2033 ms | 3240 KiB |
| 01-04.txt | AC | 154 ms | 2464 KiB |
| 01-05.txt | AC | 30 ms | 1332 KiB |
| 01-06.txt | AC | 31 ms | 1632 KiB |
| 01-07.txt | AC | 38 ms | 1696 KiB |
| 01-08.txt | AC | 521 ms | 1836 KiB |
| 01-09.txt | AC | 1975 ms | 2736 KiB |
| 02-01.txt | RE | 271 ms | 800 KiB |
| 02-02.txt | RE | 270 ms | 924 KiB |
| 02-03.txt | RE | 270 ms | 732 KiB |
| 02-04.txt | AC | 32 ms | 976 KiB |
| 02-05.txt | RE | 268 ms | 928 KiB |
| 02-06.txt | RE | 268 ms | 924 KiB |
| 02-07.txt | RE | 270 ms | 796 KiB |
| 02-08.txt | RE | 268 ms | 800 KiB |
| 02-09.txt | RE | 268 ms | 924 KiB |
| 02-10.txt | RE | 267 ms | 800 KiB |
| 02-11.txt | RE | 272 ms | 732 KiB |
| 02-12.txt | RE | 271 ms | 736 KiB |
| 03-01.txt | RE | 306 ms | 2340 KiB |
| 03-02.txt | RE | 305 ms | 2332 KiB |
| 03-03.txt | RE | 305 ms | 2340 KiB |
| 03-04.txt | TLE | 2033 ms | 2728 KiB |
| 03-05.txt | RE | 298 ms | 2328 KiB |
| 03-06.txt | RE | 309 ms | 2336 KiB |
| 03-07.txt | RE | 306 ms | 2336 KiB |
| 03-08.txt | RE | 300 ms | 2336 KiB |
| 03-09.txt | RE | 301 ms | 2336 KiB |
| 03-10.txt | RE | 274 ms | 928 KiB |
| 03-11.txt | RE | 305 ms | 2340 KiB |
| 03-12.txt | RE | 306 ms | 2336 KiB |
| sample-01.txt | AC | 27 ms | 928 KiB |
| sample-02.txt | AC | 27 ms | 928 KiB |
| sample-03.txt | RE | 268 ms | 928 KiB |