Submission #1611098
Source Code Expand
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
int main(){
long long n;
cin>>n;
if(n<=51){
if(n%2==0) cout<<(3*n)/2<<endl;
else cout<<1+((3*(n-1))/2)<<endl;
}else{
long long ans=0,p=26;
int c=1;
while(true){
if(n>=p){
n-=p;
ans+=p*c;
++c;
p*=26;
}else{
ans+=c*n;
break;
}
}
cout<<ans<<endl;
}
}
Submission Info
| Submission Time | |
|---|---|
| Task | A - しりとり |
| User | neandehir |
| Language | C++14 (GCC 5.4.1) |
| Score | 1 |
| Code Size | 395 Byte |
| Status | AC |
| Exec Time | 1 ms |
| Memory | 256 KiB |
Judge Result
| Set Name | sample | all | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 1 / 1 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| sample | sample-01.txt, sample-02.txt |
| all | sample-01.txt, sample-02.txt, 01-01.txt, 01-02.txt, 01-03.txt, 01-04.txt, 01-05.txt, 01-06.txt, 01-07.txt, 01-08.txt, 01-09.txt, 01-10.txt, 01-11.txt, 01-12.txt, sample-01.txt, sample-02.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 01-01.txt | AC | 1 ms | 256 KiB |
| 01-02.txt | AC | 1 ms | 256 KiB |
| 01-03.txt | AC | 1 ms | 256 KiB |
| 01-04.txt | AC | 1 ms | 256 KiB |
| 01-05.txt | AC | 1 ms | 256 KiB |
| 01-06.txt | AC | 1 ms | 256 KiB |
| 01-07.txt | AC | 1 ms | 256 KiB |
| 01-08.txt | AC | 1 ms | 256 KiB |
| 01-09.txt | AC | 1 ms | 256 KiB |
| 01-10.txt | AC | 1 ms | 256 KiB |
| 01-11.txt | AC | 1 ms | 256 KiB |
| 01-12.txt | AC | 1 ms | 256 KiB |
| sample-01.txt | AC | 1 ms | 256 KiB |
| sample-02.txt | AC | 1 ms | 256 KiB |