結果

問題 No.239 にゃんぱすー
ユーザー LayCurse
提出日時 2015-07-10 22:22:20
言語 C++11
(gcc 4.8.5)
結果
AC  
実行時間 14 ms
コード長 2,411 Byte
コンパイル時間 1,122 ms
使用メモリ 2,264 KB
最終ジャッジ日時 2019-09-18 13:40:44

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
challenge01.txt AC 3 ms
1,612 KB
challenge02.txt AC 3 ms
1,608 KB
challenge03.txt AC 3 ms
1,604 KB
sample1.txt AC 3 ms
1,612 KB
sample2.txt AC 3 ms
1,608 KB
sample3.txt AC 3 ms
1,612 KB
sample4.txt AC 3 ms
1,612 KB
test1.txt AC 3 ms
1,616 KB
test2.txt AC 4 ms
1,620 KB
test3.txt AC 3 ms
1,628 KB
test4.txt AC 3 ms
1,636 KB
test5.txt AC 4 ms
1,648 KB
test6.txt AC 4 ms
1,668 KB
test7.txt AC 5 ms
1,692 KB
test8.txt AC 5 ms
1,712 KB
test9.txt AC 6 ms
1,744 KB
test10.txt AC 6 ms
1,772 KB
test11.txt AC 7 ms
1,808 KB
test12.txt AC 7 ms
1,844 KB
test13.txt AC 8 ms
1,888 KB
test14.txt AC 8 ms
1,924 KB
test15.txt AC 9 ms
1,976 KB
test16.txt AC 10 ms
2,028 KB
test17.txt AC 11 ms
2,072 KB
test18.txt AC 12 ms
2,140 KB
test19.txt AC 12 ms
2,196 KB
test20.txt AC 13 ms
2,256 KB
test21.txt AC 3 ms
1,620 KB
test22.txt AC 3 ms
1,640 KB
test23.txt AC 5 ms
1,668 KB
test24.txt AC 5 ms
1,712 KB
test25.txt AC 6 ms
1,776 KB
test26.txt AC 7 ms
1,844 KB
test27.txt AC 8 ms
1,928 KB
test28.txt AC 10 ms
2,028 KB
test29.txt AC 12 ms
2,136 KB
test30.txt AC 14 ms
2,264 KB
テストケース一括ダウンロード

ソースコード

diff #
#include<bits/stdc++.h>
using namespace std;

#define REP(i,a,b) for(i=a;i<b;i++)
#define rep(i,n) REP(i,0,n)

#define mygc(c) (c)=getchar_unlocked()
#define mypc(c) putchar_unlocked(c)

#define ll long long
#define ull unsigned ll

void reader(int *x){int k,m=0;*x=0;for(;;){mygc(k);if(k=='-'){m=1;break;}if('0'<=k&&k<='9'){*x=k-'0';break;}}for(;;){mygc(k);if(k<'0'||k>'9')break;*x=(*x)*10+k-'0';}if(m)(*x)=-(*x);}
void reader(ll *x){int k,m=0;*x=0;for(;;){mygc(k);if(k=='-'){m=1;break;}if('0'<=k&&k<='9'){*x=k-'0';break;}}for(;;){mygc(k);if(k<'0'||k>'9')break;*x=(*x)*10+k-'0';}if(m)(*x)=-(*x);}
void reader(double *x){scanf("%lf",x);}
int reader(char c[]){int i,s=0;for(;;){mygc(i);if(i!=' '&&i!='\n'&&i!='\r'&&i!='\t'&&i!=EOF) break;}c[s++]=i;for(;;){mygc(i);if(i==' '||i=='\n'||i=='\r'||i=='\t'||i==EOF) break;c[s++]=i;}c[s]='\0';return s;}
template <class T, class S> void reader(T *x, S *y){reader(x);reader(y);}
template <class T, class S, class U> void reader(T *x, S *y, U *z){reader(x);reader(y);reader(z);}
template <class T, class S, class U, class V> void reader(T *x, S *y, U *z, V *w){reader(x);reader(y);reader(z);reader(w);}

void writer(int x, char c){int s=0,m=0;char f[10];if(x<0)m=1,x=-x;while(x)f[s++]=x%10,x/=10;if(!s)f[s++]=0;if(m)mypc('-');while(s--)mypc(f[s]+'0');mypc(c);}
void writer(ll x, char c){int s=0,m=0;char f[20];if(x<0)m=1,x=-x;while(x)f[s++]=x%10,x/=10;if(!s)f[s++]=0;if(m)mypc('-');while(s--)mypc(f[s]+'0');mypc(c);}
void writer(double x, char c){printf("%.15f",x);mypc(c);}
void writer(const char c[]){int i;for(i=0;c[i]!='\0';i++)mypc(c[i]);}
void writer(const char x[], char c){int i;for(i=0;x[i]!='\0';i++)mypc(x[i]);mypc(c);}
template<class T> void writerLn(T x){writer(x,'\n');}
template<class T, class S> void writerLn(T x, S y){writer(x,' ');writer(y,'\n');}
template<class T, class S, class U> void writerLn(T x, S y, U z){writer(x,' ');writer(y,' ');writer(z,'\n');}
template<class T> void writerArr(T x[], int n){int i;if(!n){mypc('\n');return;}rep(i,n-1)writer(x[i],' ');writer(x[n-1],'\n');}

char memarr[17000000]; void *mem = memarr;
#define MD 1000000007

int N;
string in[111][111];

int main(){
  int i, j, k;
  int res = -1, ok = 0;

  reader(&N);
  rep(i,N) rep(j,N) cin >> in[i][j];

  rep(i,N){
    rep(j,N) if(!(in[j][i]=="-" || in[j][i]=="nyanpass")) break;
    if(j==N) res = i+1, ok++;
  }
  if(ok > 1) res = -1;
  writerLn(res);

  return 0;
}
0