Submission #00144


ソースコード

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#include<bits/stdc++.h>
using namespace std;
int main(){
long long int n;
int m,a,b,c[1000],d=0,x;
cin>>n>>m;
x=(n+1)/2;
for(int i=1;i<=m;i++){
cin>>a>>b;
if(a<=x){
if(b<=x){
while(a>3&&b>3){
a-=3;
b-=3;
}
cout<<"!"<<endl;
}
else{
while(a>3&&b<n-2){
a-=3;
b+=3;
}
cout<<a<<b<<endl;
}
if(a==1||b==1||b==n)c[d]=1;
else if(a==2&&(b>1||b<n-1)||b==2&&(a>1||a<n-1))c[d]=2;
else if(a==3&&(b>2||b<n-2)||b==3&&(a>2||a<n-2))c[d]=3;
}
else{
if(b<=x){
while(a<n-2&&b>3){
a+=3;
b-=3;
}
cout<<a<<b<<endl;
}
else{
while(a<n-2&&b<n-2){
a+=3;
b+=3;
}
cout<<"%"<<endl;
}
if(a==n||b==1||b==n)c[d]=1;
else if(a==n-1&&(b>1||b<n-1)||b==n-1&&(a>1||a<n-1))c[d]=2;
else if(a==n-2&&(b>2||b<n-2)||b==n-2&&(a>2||a<n-2))c[d]=3;
}
d++;
}
for(int i=0;i<d;i++)cout<<c[i]<<endl;
}

ステータス

項目 データ
問題 0003 - タイル (Tile)
ユーザー名 ei1626
投稿日時 2016-11-09 18:59:32
言語 C++11
状態 Wrong Answer
得点 0
ソースコード長 957 Byte
最大実行時間 8000 ms
最大メモリ使用量 592 KB

セット

セット 得点 Cases
1 in1 0 / 20 *1.txt
2 in2 0 / 20 *2.txt
3 in3 0 / 20 *3.txt
4 in4 0 / 20 *4.txt
5 in5 0 / 20 *5.txt

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
2011-yo-t3-in1.txt WA 19 ms 480 KB
1
2011-yo-t3-in2.txt WA 16 ms 592 KB
2
2011-yo-t3-in3.txt TLE 8000 ms 572 KB
3
2011-yo-t3-in4.txt TLE 8000 ms 424 KB
4
2011-yo-t3-in5.txt TLE 8000 ms 408 KB
5