# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
103576 | kishtarn555 | Lun (COCI19_lun) | C++14 | 2 ms | 384 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<iostream>
#include<vector>
#include<algorithm>
#include<stack>
using namespace std;
int N;
int main() {
ios_base::sync_with_stdio(0); cin.tie(0);
cin >>N;
char c;
long long sum = 0;
long long pos;
long long last;
for (int i = 0; i < N; i++) {
cin >> c;
if (c=='x') {
pos = i;
continue;
}
if (i+1==N) {
last = c-'0';
continue;
}
if ( i%2!=N%2) {
sum+=c-'0';
} else {
// cout <<(int)((c-'0')*2)<<endl;
sum+= ((c-'0')*2)/10;
sum +=((c-'0')*2)%10;
}
}
// cout << sum<< endl;
if (pos +1==N) {
sum*=9;
cout<<sum%10;
return 0;
}
// c
// cout << last<<endl;
for (int i = 0; i < 10; i ++) {
long long ss = sum+i;
if (pos %2!=N%2) {
} else {
cout << "!";
ss=sum + (2*i)/10+(2*i)%10;
}
if ((ss*9)%10==last) {
cout << i;return 0;
}
}
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |