結果
| 問題 | No.432 占い(Easy) |
| コンテスト | |
| ユーザー |
takatowin
|
| 提出日時 | 2017-01-07 17:05:11 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 480 bytes |
| 記録 | |
| コンパイル時間 | 274 ms |
| コンパイル使用メモリ | 54,508 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-05-26 20:12:18 |
| 合計ジャッジ時間 | 1,821 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 22 |
ソースコード
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
void make(char* s){
int i,j,x=strlen(s);
char temp;
if(x==1){
printf("%s\n",s);
return;
}
for(i=x;i>0;i--){
for(j=0;j<i-1;j++){
temp=s[j]+s[j+1]-2*48;
if(temp>=10)
temp-=9;
s[j]=temp+48;
}
}
printf("%d\n",(int)s[0]-48);
}
int main(void){
int i,t;
scanf("%d",&t);
char s[1001];
for(i=0;i<t;i++){
scanf("%s",s);
make(s);
}
return 0;
}
takatowin