# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
1012762 |
2024-07-02T14:53:02 Z |
Almonther |
Sticks (POI11_pat) |
C++ |
|
137 ms |
26612 KB |
#include <bits/stdc++.h>
#define suiii ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ll long long
#define co cout<<
// #pragma GCC optimize("O3,Ofast,unroll-loops")
// #pragma GCC target("avx2,sse3,sse4,avx")
using namespace std;
//stuff
ll n;
pair<ll,ll>arr[3000001];
ll cnt=0;
void solve(){
cin>>n;
for(int i=0;i<n;i++){
ll x;
cin>>x;
for(int j=0;j<x;j++){
ll y;
cin>>y;
arr[cnt]={y,i};
cnt++;
}
}
sort(arr,arr+cnt);
for(int i=0;i<cnt;i++) swap(arr[i].first,arr[i].second);
ll i,j,k;
j=k=0;
while(arr[k].first==arr[j].first&&j<cnt) j++;
i=j;
while((arr[j].first==arr[i].first||arr[i].first==arr[k].first)&&i<cnt) i++;
if(arr[k].first==arr[j].first||arr[j].first==arr[i].first||arr[i].first==arr[k].first||i==cnt||j==cnt||k==cnt){
co "NIE";
return;
}
while(1){
ll a,b,c;
a=arr[i].second;
b=arr[j].second;
c=arr[k].second;
if(a+b>c&&a+c>b&&c+b>a){
co arr[i].first<<' '<<a<<' '<<arr[j].first<<' '<<b<<' '<<arr[k].first<<' '<<c;
return;
}
if(i+1>=cnt) break;
if(arr[i].first==arr[i+1].first){
i++;
}
else{
if(arr[i+1].first==arr[j].first){
j=i;
i++;
}
else{
k=j;
j=i;
i++;
}
}
}
co "NIE";
}
int main()
{
suiii
int tt=1;
// cin>>tt;
while(tt--){
solve();
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
Integer 0 violates the range [1, 50] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Integer 0 violates the range [1, 50] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Integer 0 violates the range [1, 50] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Oczekiwano NIE |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Oczekiwano NIE |
2 |
Incorrect |
4 ms |
2924 KB |
Expected integer, but "NIE" found |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Oczekiwano NIE |
2 |
Incorrect |
4 ms |
2908 KB |
Expected integer, but "NIE" found |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
856 KB |
Oczekiwano NIE |
2 |
Incorrect |
13 ms |
3424 KB |
Expected integer, but "NIE" found |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
2648 KB |
Oczekiwano NIE |
2 |
Incorrect |
19 ms |
5980 KB |
Expected integer, but "NIE" found |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
11 ms |
3164 KB |
Oczekiwano NIE |
2 |
Incorrect |
32 ms |
6748 KB |
Integer 0 violates the range [1, 50] |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
65 ms |
13636 KB |
Integer 0 violates the range [1, 50] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
68 ms |
13528 KB |
Integer 0 violates the range [1, 50] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
125 ms |
26612 KB |
Integer 0 violates the range [1, 50] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
137 ms |
26484 KB |
Integer 0 violates the range [1, 50] |
2 |
Halted |
0 ms |
0 KB |
- |