Submission #42283
ソースコード
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | /* |\_/| |- -| \_+_/ */ #include<bits/stdc++.h> #define endl '\n' using namespace std; int maxx[100001]; int main(){ cin.tie(0); // cout と cin の同期を切る ios::sync_with_stdio( false ); /* cの stdioストリーム (printfとか)と*/ int W,H,N; cin>>W>>H>>N; int x,y; for ( int i=0;i<N;i++){ cin>>x>>y; maxx[x]=max(maxx[x],y); } int ans=W-1; int maxmax=0; for ( int i=W-1;i>=0;i--){ maxmax=max(maxx[i+1],maxmax); ans=min(ans,(W-1)-((W-1)-i)+(maxmax)); } cout<<ans<<endl; return 0; } |
ステータス
項目 | データ |
---|---|
問題 | 0962 - ダンジョン |
ユーザー名 | ei1725 |
投稿日時 | 2018-08-30 09:46:37 |
言語 | C++11 |
状態 | Accepted |
得点 | 11 |
ソースコード長 | 642 Byte |
最大実行時間 | 47 ms |
最大メモリ使用量 | 1108 KB |
セット
セット | 得点 | Cases | |
---|---|---|---|
1 | ALL | 11 / 11 | * |
テストケース
ファイル名 | 状態 | 実行時間 | メモリ使用量 | # |
---|---|---|---|---|
in1.txt | AC | 24 ms | 600 KB |
1
|
in2.txt | AC | 21 ms | 708 KB |
1
|
in3.txt | AC | 20 ms | 640 KB |
1
|
in4.txt | AC | 28 ms | 672 KB |
1
|
in5.txt | AC | 17 ms | 752 KB |
1
|
in6.txt | AC | 19 ms | 576 KB |
1
|
in7.txt | AC | 21 ms | 664 KB |
1
|
in8.txt | AC | 19 ms | 748 KB |
1
|
in9.txt | AC | 23 ms | 696 KB |
1
|
in10.txt | AC | 19 ms | 432 KB |
1
|
in11.txt | AC | 20 ms | 520 KB |
1
|
in12.txt | AC | 24 ms | 476 KB |
1
|
in13.txt | AC | 18 ms | 560 KB |
1
|
in14.txt | AC | 24 ms | 644 KB |
1
|
in15.txt | AC | 24 ms | 600 KB |
1
|
in16.txt | AC | 29 ms | 680 KB |
1
|
in17.txt | AC | 25 ms | 624 KB |
1
|
in18.txt | AC | 21 ms | 948 KB |
1
|
in19.txt | AC | 30 ms | 896 KB |
1
|
in20.txt | AC | 30 ms | 1048 KB |
1
|
in21.txt | AC | 27 ms | 1000 KB |
1
|
in22.txt | AC | 47 ms | 556 KB |
1
|
in23.txt | AC | 25 ms | 508 KB |
1
|
in24.txt | AC | 25 ms | 584 KB |
1
|
in25.txt | AC | 31 ms | 796 KB |
1
|
in26.txt | AC | 39 ms | 676 KB |
1
|
in27.txt | AC | 20 ms | 936 KB |
1
|
in28.txt | AC | 24 ms | 1008 KB |
1
|
in29.txt | AC | 23 ms | 952 KB |
1
|
in30.txt | AC | 37 ms | 1108 KB |
1
|