Submission #2548905
Source Code Expand
#include<bits/stdc++.h> using namespace std; pair<int,int> su[100001]; vector<int> v; int main(){ int n; scanf("%d",&n); for(int i=0;i<n;i++){ int aa, bb; scanf("%d%d",&aa, &bb); su[i].first = aa-bb; su[i].second = aa+bb; } sort(su, su+n); for(int i=0;i<n;i++){ auto it = lower_bound(v.begin(), v.end(), su[i].second); if(it == v.end()) v.push_back(su[i].second); else v[std::distance(v.begin(), it)] = su[i].second; } printf("%d\n", (int)v.size()); }
Submission Info
Submission Time | |
---|---|
Task | K - ターゲット |
User | jihoon |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 565 Byte |
Status | WA |
Exec Time | 32 ms |
Memory | 1660 KB |
Compile Error
./Main.cpp: In function ‘int main()’: ./Main.cpp:9:19: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] scanf("%d",&n); ^ ./Main.cpp:12:31: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] scanf("%d%d",&aa, &bb); ^
Judge Result
Set Name | All | ||||
---|---|---|---|---|---|
Score / Max Score | 0 / 5 | ||||
Status |
|
Set Name | Test Cases |
---|---|
All | 00, 01, 02, 03, 04, 05, 06, 07, 90, 91 |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
00 | WA | 32 ms | 1024 KB |
01 | WA | 32 ms | 1024 KB |
02 | WA | 32 ms | 1024 KB |
03 | WA | 29 ms | 1024 KB |
04 | WA | 29 ms | 1024 KB |
05 | WA | 29 ms | 1024 KB |
06 | WA | 18 ms | 1024 KB |
07 | WA | 22 ms | 1660 KB |
90 | AC | 1 ms | 256 KB |
91 | WA | 1 ms | 256 KB |