QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#130772 | #5364. 面国漫步 | Sorting | 0 | 1ms | 3584kb | C++ | 1.1kb | 2023-07-25 02:20:21 | 2023-07-25 02:20:23 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef array<ll,3> arin;
const ll boss=1LL<<60;
int n,k;
int a[10001];
bool s[10001];
int l[101];
ll d[101];
ll mn[101];
vector<arin>ans;
int f[101];
int main(){
ios::sync_with_stdio(false);cin.tie(0);
cin >> n >> k;
for(int i=2; i<=n ;i++) d[i]=boss;
for(int i=1; i<=k ;i++){
cin >> a[i];l[a[i]]=i;
}
if(l[1]!=1) return cout << "YouAreFake!",0;
for(int i=1; i<=n ;i++){
if(l[i]==0) return cout << "YouAreFake!",0;
s[l[i]]=true;
}
for(int i=1; i<k ;i++){
int r=i+1;
while(!s[r]) ++r;
int l=i;i=r-1;
//cout << l << ' ' << r << endl;
for(int j=1; j<=n ;j++) f[j]=0;
for(int j=l+1; j<=r ;j++) if(++f[a[j]]==2) return cout << "YouAreFake!",0;
for(int j=l+1; j<r ;j++){
int x=a[j];
d[x]--;
mn[x]=boss-d[x];
arin e={a[l],x,d[x]-d[a[l]]};
ans.push_back(e);
}
arin e={a[l],a[r],mn[a[l]]};
d[a[r]]=d[a[l]]+mn[a[l]];
ans.push_back(e);
}
cout << "YouAreWrite!" << '\n';
cout << ans.size() << '\n';
for(auto c:ans) cout << c[0] << ' ' << c[1] << ' ' << c[2] << endl;
}
詳細信息
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3584kb
input:
3 1 1
output:
YouAreFake!
result:
wrong answer Wrong Answer on the First line of output
Subtask #2:
score: 0
Wrong Answer
Test #16:
score: 0
Wrong Answer
time: 1ms
memory: 3424kb
input:
85 78 1 46 49 66 12 47 36 28 44 17 48 34 5 82 20 40 69 52 75 27 14 43 53 83 33 55 38 77 58 56 76 81 6 84 19 80 67 3 50 25 26 21 29 62 70 22 68 63 74 37 7 73 78 42 32 2 64 8 39 71 59 18 23 24 9 51 85 11 57 41 45 16 54 30 35 61 72 4
output:
YouAreFake!
result:
wrong answer Wrong Answer on the First line of output
Subtask #3:
score: 0
Skipped
Dependency #1:
0%
Subtask #4:
score: 0
Skipped
Dependency #2:
0%
Subtask #5:
score: 0
Skipped
Dependency #1:
0%