이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "trilib.h"
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll,ll>pairll;
typedef pair<ll,ull>pairull;
typedef pair<ll,pairll>pair3l;
typedef long double ld;
typedef pair<ld,ld>pairld;
typedef pair<string,ll>pairsl;
#define fr first
#define sc second
#define pb push_back
#define endl '\n'
#define N 100007
#define MOD 1000000007
#define INF 10000000000007
#define eps 0.00000000001
#define A 50
#define PI 3.14159265359
ll n,d[40007];
vector<pairll>v,a;
void S(ll l,ll r,ll z){
if(is_clockwise(v[l].fr,z,v[l].sc)==0 && is_clockwise(v[r].fr,z,v[r].sc)==0 && is_clockwise(v[l].fr,z,v[r].sc)==0)return ;
if(l==r){
d[l]=z;
}
}
int main(){
n=get_n();
ll x=is_clockwise(1,3,2);
if(x==1){
v.pb({1,3});
v.pb({3,2});
v.pb({2,3});
}else{
v.pb({1,2});
v.pb({2,3});
v.pb({3,1});
}
for(int i=4;i<=n;i++){
for(int j=0;j<v.size();j++){
d[j]=is_clockwise(v[j].fr,i,v[j].sc);
}
a.clear();
for(int j=0;j<v.size();j++){
if(d[j]==1 && d[(j-1+v.size())%v.size()]==0){
a.pb({v[j].fr,i});
}
if(d[j]==1 && d[(j+1)%v.size()]==0){
a.pb({i,v[j].sc});
}
if(d[j]==0){
a.pb(v[j]);
}
}
swap(v,a);
}
give_answer(v.size());
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
tri.cpp: In function 'int main()':
tri.cpp:51:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<long long int, long long int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
51 | for(int j=0;j<v.size();j++){
| ~^~~~~~~~~
tri.cpp:55:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<long long int, long long int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
55 | for(int j=0;j<v.size();j++){
| ~^~~~~~~~~
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |